diff --git a/examples/lesson02.js b/examples/lesson02.js index 3629aa7..9cad745 100644 --- a/examples/lesson02.js +++ b/examples/lesson02.js @@ -14,6 +14,7 @@ webgl.canvas = document; const canvas = document.createElement('canvas'); const frame = document.requestAnimationFrame; +webgl.init(); // optional let gl; document.title = 'Lesson02'; diff --git a/index.d.ts b/index.d.ts index dd100d1..98c218c 100644 --- a/index.d.ts +++ b/index.d.ts @@ -60,6 +60,8 @@ declare module "webgl-raub" { export default webgl; export interface WebGL { + init: ()=> void; + contextAttributes: TContextAttributes; getContextAttributes: () => TContextAttributes; @@ -132,11 +134,6 @@ declare module "webgl-raub" { srcOffset?: number, length?: number, ) => void; - bufferSubData: ( - target: number, - offset: number, - arr: Float32Array, - ) => void; copyBufferSubData: ( readTarget: number, writeTarget: number, diff --git a/js/webgl.js b/js/webgl.js index 8beb689..b1e4230 100644 --- a/js/webgl.js +++ b/js/webgl.js @@ -15,10 +15,6 @@ const unfoldBool = (x) => typeof x === 'boolean' ? (x ? 1 : 0) : x; if (!gl.__isInited) { gl.__isInited = true; - if (!global.__skipGlewInit) { - gl.init(); - } - // WebGL constructors gl.WebGLRenderingContext = function WebGLRenderingContext(_) { this._ = _; }; gl.WebGLProgram = function WebGLProgram(_) { this._ = _; }; diff --git a/test/index.test.js b/test/index.test.js index 5bfaeb7..b69fff2 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -1,6 +1,5 @@ 'use strict'; -global.__skipGlewInit = true; const webgl = require('..'); diff --git a/test/setup.js b/test/setup.js index 287b0e3..cc1451c 100644 --- a/test/setup.js +++ b/test/setup.js @@ -1,5 +1,3 @@ 'use strict'; -global.__skipGlewInit = true; - module.exports = async () => require('..');