Skip to content

Commit

Permalink
Finish typing vertex_array_object.js
Browse files Browse the repository at this point in the history
  • Loading branch information
jfirebaugh committed Aug 24, 2017
1 parent 3730e83 commit d4e35f2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/data/buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class Buffer {
* @param program The active WebGL program
* @param vertexOffset Index of the starting vertex of the segment
*/
setVertexAttribPointers(gl: WebGLRenderingContext, program: Program, vertexOffset: number) {
setVertexAttribPointers(gl: WebGLRenderingContext, program: Program, vertexOffset: ?number) {
for (let j = 0; j < this.attributes.length; j++) {
const member = this.attributes[j];
const attribIndex: number | void = program.attributes[member.name];
Expand All @@ -121,7 +121,7 @@ class Buffer {
(gl: any)[AttributeType[member.type]],
false,
this.arrayType.bytesPerElement,
member.offset + (this.arrayType.bytesPerElement * vertexOffset || 0)
member.offset + (this.arrayType.bytesPerElement * (vertexOffset || 0))
);
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/render/vertex_array_object.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ class VertexArrayObject {
}

freshBind(gl: WebGLRenderingContext,
program: any,
layoutVertexBuffer: any,
elementBuffer: any,
vertexBuffer2: any,
vertexOffset: any,
dynamicVertexBuffer: any) {
program: Program,
layoutVertexBuffer: Buffer,
elementBuffer: ?Buffer,
vertexBuffer2: ?Buffer,
vertexOffset: ?number,
dynamicVertexBuffer: ?Buffer) {
let numPrevAttributes;
const numNextAttributes = program.numAttributes;

Expand Down

0 comments on commit d4e35f2

Please sign in to comment.