Skip to content

Commit

Permalink
Update types and examples
Browse files Browse the repository at this point in the history
  • Loading branch information
raub committed Oct 17, 2023
1 parent aba6df0 commit aabcc8c
Show file tree
Hide file tree
Showing 15 changed files with 852 additions and 864 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const webgl = require('webgl-raub');

Here `webgl` contains the **WebGL** API, like a `WebGLRenderingContext` instance would. See
[WebGLRenderingContext docs](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext)
for reference, and [TypeSctipt definitions](/index.d.ts) for the full list of exports.
for reference, and [TypeScript definitions](/index.d.ts) for the full list of exports.

To use browser **WebGL** libs, like [three.js](https://threejs.org/),
several additional interfaces must also be provided to mimic the browser.
Expand Down
5 changes: 2 additions & 3 deletions examples/cube.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
'use strict';

const webgl = require('..');

const { Document } = require('glfw-raub');

const webgl = require('..');
const { mat4 } = require('./libs/glMatrix-0.9.5.min');


Document.setWebgl(webgl);
const document = new Document();
const document = new Document({ vsync: true, autoEsc: true });
webgl.canvas = document;
const frame = document.requestAnimationFrame;

Expand Down
4 changes: 2 additions & 2 deletions examples/extensions.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use strict';

const webgl = require('..');

const { Document } = require('glfw-raub');

const webgl = require('..');


Document.setWebgl(webgl);
new Document();
Expand Down
4 changes: 2 additions & 2 deletions examples/glversion.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use strict';

const gl = require('..');

const { Document } = require('glfw-raub');

const gl = require('..');


Document.setWebgl(gl);
new Document();
Expand Down
5 changes: 2 additions & 3 deletions examples/lesson02.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
'use strict';

const webgl = require('..');

const { Document } = require('glfw-raub');

const webgl = require('..');
const { mat4 } = require('./libs/glMatrix-0.9.5.min');


Document.setWebgl(webgl);
const document = new Document();
const document = new Document({ vsync: true, autoEsc: true });
webgl.canvas = document;

const canvas = document.createElement('canvas');
Expand Down
5 changes: 2 additions & 3 deletions examples/lesson05.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
'use strict';

const webgl = require('..');
const Image = require('image-raub');

const { Document } = require('glfw-raub');

const webgl = require('..');
const { mat4 } = require('./libs/glMatrix-0.9.5.min');


Document.setWebgl(webgl);
const document = new Document();
const document = new Document({ vsync: true, autoEsc: true });
webgl.canvas = document;

const canvas = document.createElement('canvas');
Expand Down
5 changes: 2 additions & 3 deletions examples/lesson08.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
'use strict';

const webgl = require('..');
const Image = require('image-raub');

const { Document } = require('glfw-raub');

const webgl = require('..');
const { mat4, mat3, vec3 } = require('./libs/glMatrix-0.9.5.min');


Document.setWebgl(webgl);
const document = new Document();
const document = new Document({ vsync: true, autoEsc: true });
webgl.canvas = document;

const canvas = document.createElement('canvas');
Expand Down
60 changes: 30 additions & 30 deletions examples/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"main": "lesson05.js",
"dependencies": {
"glfw-raub": "^5.2.0",
"image-raub": "^4.1.1"
"glfw-raub": "^5.3.1",
"image-raub": "^4.2.0"
}
}
5 changes: 2 additions & 3 deletions examples/screen_aligned.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
'use strict';

const webgl = require('..');
const Image = require('image-raub');

const { Document } = require('glfw-raub');

const webgl = require('..');
const { mat4 } = require('./libs/glMatrix-0.9.5.min');


Document.setWebgl(webgl);
const document = new Document();
const document = new Document({ vsync: true, autoEsc: true });
webgl.canvas = document;

const canvas = document.createElement('canvas');
Expand Down
5 changes: 2 additions & 3 deletions examples/vao-oes.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
'use strict';

const webgl = require('..');

const { Document } = require('glfw-raub');

const webgl = require('..');
const { mat4 } = require('./libs/glMatrix-0.9.5.min');


Document.setWebgl(webgl);
const document = new Document({ osxCore: true });
const document = new Document({ vsync: true, autoEsc: true });
webgl.canvas = document;
const frame = document.requestAnimationFrame;

Expand Down
5 changes: 2 additions & 3 deletions examples/vao.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
'use strict';

const webgl = require('..');

const { Document } = require('glfw-raub');

const webgl = require('..');
const { mat4 } = require('./libs/glMatrix-0.9.5.min');


Document.setWebgl(webgl);
const document = new Document({ osxCore: true });
const document = new Document({ vsync: true, autoEsc: true });
webgl.canvas = document;
const frame = document.requestAnimationFrame;

Expand Down
Loading

0 comments on commit aabcc8c

Please sign in to comment.