Texture.bind()/unbind() call the gl functions irrespective of the value of the bound flag

This commit is contained in:
codeanticode
2012-07-25 17:12:59 +00:00
parent 7ffc0c29bf
commit 87d07557dd
3 changed files with 8 additions and 11 deletions
+1
View File
@@ -569,6 +569,7 @@ public class PGL {
caps.setDepthBits(24);
caps.setStencilBits(8);
caps.setAlphaBits(8);
//caps.setFBO(false);
caps.setBackgroundOpaque(true);
if (toolkit == AWT) {
@@ -204,7 +204,7 @@ public class PGraphicsOpenGL extends PGraphics {
/** Flag to indicate that we are inside beginCamera/endCamera block. */
protected boolean manipulatingCamera;
/** Flag indicating the use of an ortographics projection matrix. */
/** Flag indicating the use of an orthographic projection matrix. */
protected boolean usingOrthoProjection;
// ........................................................
+6 -10
View File
@@ -556,20 +556,16 @@ public class Texture implements PConstants {
public void bind() {
if (!bound) {
pgl.enableTexturing(glTarget);
pgl.glBindTexture(glTarget, glName);
bound = true;
}
pgl.enableTexturing(glTarget);
pgl.glBindTexture(glTarget, glName);
bound = true;
}
public void unbind() {
if (bound) {
pgl.enableTexturing(glTarget);
pgl.glBindTexture(glTarget, 0);
bound = false;
}
pgl.enableTexturing(glTarget);
pgl.glBindTexture(glTarget, 0);
bound = false;
}