Skip to content

Commit

Permalink
Remove init form setup
Browse files Browse the repository at this point in the history
  • Loading branch information
raub committed Oct 5, 2023
1 parent 78345d4 commit 5b05c09
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 12 deletions.
1 change: 1 addition & 0 deletions examples/lesson02.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ webgl.canvas = document;
const canvas = document.createElement('canvas');
const frame = document.requestAnimationFrame;

webgl.init(); // optional
let gl;

document.title = 'Lesson02';
Expand Down
7 changes: 2 additions & 5 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ declare module "webgl-raub" {
export default webgl;

export interface WebGL {
init: ()=> void;

contextAttributes: TContextAttributes;
getContextAttributes: () => TContextAttributes;

Expand Down Expand Up @@ -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,
Expand Down
4 changes: 0 additions & 4 deletions js/webgl.js
Original file line number Diff line number Diff line change
Expand Up @@ -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._ = _; };
Expand Down
1 change: 0 additions & 1 deletion test/index.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';

global.__skipGlewInit = true;
const webgl = require('..');


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

global.__skipGlewInit = true;

module.exports = async () => require('..');

0 comments on commit 5b05c09

Please sign in to comment.