mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
don't enable mipmapping if texture is the color buffer of a PGraphics
This commit is contained in:
@@ -5522,6 +5522,7 @@ public class PGraphicsOpenGL extends PGraphics {
|
||||
sampling, mipmap);
|
||||
texture = new Texture(parent, width, height, params);
|
||||
texture.invertedY(true);
|
||||
texture.colorBufferOf(this);
|
||||
pgPrimary.setCache(this, texture);
|
||||
}
|
||||
}
|
||||
@@ -5970,7 +5971,8 @@ public class PGraphicsOpenGL extends PGraphics {
|
||||
|
||||
|
||||
protected void checkTexture(Texture tex) {
|
||||
if (tex.usingMipmaps == hints[DISABLE_TEXTURE_MIPMAPS]) {
|
||||
if (!tex.isColorBuffer() &&
|
||||
tex.usingMipmaps == hints[DISABLE_TEXTURE_MIPMAPS]) {
|
||||
if (hints[DISABLE_TEXTURE_MIPMAPS]) {
|
||||
tex.usingMipmaps(false, textureSampling);
|
||||
} else {
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -5530,6 +5530,7 @@ public class PGraphicsOpenGL extends PGraphics {
|
||||
sampling, mipmap);
|
||||
texture = new Texture(parent, width, height, params);
|
||||
texture.invertedY(true);
|
||||
texture.colorBufferOf(this);
|
||||
pgPrimary.setCache(this, texture);
|
||||
}
|
||||
}
|
||||
@@ -5978,7 +5979,8 @@ public class PGraphicsOpenGL extends PGraphics {
|
||||
|
||||
|
||||
protected void checkTexture(Texture tex) {
|
||||
if (tex.usingMipmaps == hints[DISABLE_TEXTURE_MIPMAPS]) {
|
||||
if (!tex.isColorBuffer() &&
|
||||
tex.usingMipmaps == hints[DISABLE_TEXTURE_MIPMAPS]) {
|
||||
if (hints[DISABLE_TEXTURE_MIPMAPS]) {
|
||||
tex.usingMipmaps(false, textureSampling);
|
||||
} else {
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user