mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-07-04 20:46:39 +02:00
Code cleanup.
This commit is contained in:
parent
289cea0fc0
commit
01c1145e28
9 changed files with 81 additions and 61 deletions
14
lib/webgl.js
14
lib/webgl.js
|
@ -69,12 +69,12 @@
|
|||
var positionBuffer = context.createBuffer();
|
||||
context.bindBuffer(context.ARRAY_BUFFER, positionBuffer);
|
||||
context.bufferData(context.ARRAY_BUFFER, new Float32Array([
|
||||
-1,-1,
|
||||
-1, 1,
|
||||
1,-1,
|
||||
1, 1,
|
||||
-1, 1,
|
||||
1,-1
|
||||
-1, -1,
|
||||
-1, 1,
|
||||
1, -1,
|
||||
1, 1,
|
||||
-1, 1,
|
||||
1, -1
|
||||
|
||||
]), context.STATIC_DRAW);
|
||||
|
||||
|
@ -84,7 +84,7 @@
|
|||
var normalize = false; // don't normalize the data
|
||||
var stride = 0; // 0 = move forward size * sizeof(type) each iteration to get the next position
|
||||
var offset = 0; // start at the beginning of the buffer
|
||||
context.vertexAttribPointer( positionAttributeLocation, size, type, normalize, stride, offset);
|
||||
context.vertexAttribPointer(positionAttributeLocation, size, type, normalize, stride, offset);
|
||||
|
||||
var texCoordLocation = context.getAttribLocation(program, "a_texCoord");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue