update active variable in PShader, unbind VBOs in drawTexture, drawRect

This commit is contained in:
codeanticode
2012-05-26 23:32:12 +00:00
parent 2dbecb9373
commit 7ac9043abb
2 changed files with 6 additions and 0 deletions

View File

@@ -1376,6 +1376,8 @@ public class PGL {
enableTexturing(target);
glActiveTexture(GL_TEXTURE0);
glBindTexture(target, id);
glBindBuffer(GL_ARRAY_BUFFER, 0); // Making sure that no VBO is bound at this point.
texData.position(0);
glVertexAttribPointer(texVertLoc, 2, GL_FLOAT, false, 4 * SIZEOF_FLOAT, texData);
@@ -1451,6 +1453,8 @@ public class PGL {
rectData.rewind();
rectData.put(rectCoords);
glBindBuffer(GL_ARRAY_BUFFER, 0); // Making sure that no VBO is bound at this point.
rectData.position(0);
glVertexAttribPointer(rectVertLoc, 2, GL_FLOAT, false, 2 * SIZEOF_FLOAT, rectData);

View File

@@ -155,6 +155,7 @@ public class PShader {
public void start() {
init();
pgl.glUseProgram(programObject);
active = true;
}
@@ -163,6 +164,7 @@ public class PShader {
*/
public void stop() {
pgl.glUseProgram(0);
active = false;
}