don't enable mipmapping if texture is the color buffer of a PGraphics

This commit is contained in:
codeanticode
2012-11-19 16:54:11 +00:00
parent 11ca3752fe
commit e02e3392c0
4 changed files with 32 additions and 2 deletions

View File

@@ -82,6 +82,7 @@ public class Texture implements PConstants {
protected PGraphicsOpenGL pg; // The main renderer
protected PGL pgl; // The interface between Processing and OpenGL.
protected PGL.Context context; // The context that created this texture.
protected PGraphicsOpenGL pgDraw; // The main renderer is the color buffer of.
protected boolean usingMipmaps;
protected boolean usingRepeat;
@@ -135,6 +136,8 @@ public class Texture implements PConstants {
pgl = pg.pgl;
context = pgl.createEmptyContext();
pgDraw = null;
glName = 0;
init(width, height, (Parameters)params);
@@ -1184,6 +1187,16 @@ public class Texture implements PConstants {
}
protected void colorBufferOf(PGraphicsOpenGL pgDraw) {
this.pgDraw = pgDraw;
}
protected boolean isColorBuffer() {
return pgDraw != null;
}
///////////////////////////////////////////////////////////
// Utilities.