Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #5 from define-private-public/patch-1
Browse files Browse the repository at this point in the history
Should be using the size of a `cuchar` not an `int` for colors
  • Loading branch information
zacharycarter committed Aug 10, 2017
2 parents 54a3751 + b7f58ae commit 5330a20
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/zengine/zgl.nim
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ proc loadDefaultBuffers() =

glGenBuffers(1, addr lines.vboId[1]);
glBindBuffer(GL_ARRAY_BUFFER, lines.vboId[1]);
glBufferData(GL_ARRAY_BUFFER, sizeof(int)*4*2*MAX_LINES_BATCH, addr lines.colors[0], GL_DYNAMIC_DRAW);
glBufferData(GL_ARRAY_BUFFER, sizeof(cuchar)*4*2*MAX_LINES_BATCH, addr lines.colors[0], GL_DYNAMIC_DRAW);
glEnableVertexAttribArray(currentShader.colorLoc);
glVertexAttribPointer(currentShader.colorLoc, 4, cGL_UNSIGNED_BYTE, GL_TRUE, 0, nil);

Expand All @@ -388,7 +388,7 @@ proc loadDefaultBuffers() =

glGenBuffers(1, addr triangles.vboId[1]);
glBindBuffer(GL_ARRAY_BUFFER, triangles.vboId[1]);
glBufferData(GL_ARRAY_BUFFER, sizeof(int)*4*3*MAX_TRIANGLES_BATCH, addr triangles.colors[0], GL_DYNAMIC_DRAW);
glBufferData(GL_ARRAY_BUFFER, sizeof(cuchar)*4*3*MAX_TRIANGLES_BATCH, addr triangles.colors[0], GL_DYNAMIC_DRAW);
glEnableVertexAttribArray(currentShader.colorLoc);
glVertexAttribPointer(currentShader.colorLoc, 4, cGL_UNSIGNED_BYTE, GL_TRUE, 0, nil);

Expand All @@ -411,7 +411,7 @@ proc loadDefaultBuffers() =

glGenBuffers(1, addr quads.vboId[2]);
glBindBuffer(GL_ARRAY_BUFFER, quads.vboId[2]);
glBufferData(GL_ARRAY_BUFFER, sizeof(int)*4*4*MAX_QUADS_BATCH, addr quads.colors[0], GL_DYNAMIC_DRAW);
glBufferData(GL_ARRAY_BUFFER, sizeof(cuchar)*4*4*MAX_QUADS_BATCH, addr quads.colors[0], GL_DYNAMIC_DRAW);
glEnableVertexAttribArray(currentShader.colorLoc);
glVertexAttribPointer(currentShader.colorLoc, 4, cGL_UNSIGNED_BYTE, GL_TRUE, 0, nil);

Expand Down

0 comments on commit 5330a20

Please sign in to comment.