aboutsummaryrefslogtreecommitdiffstats
path: root/ardor3d-jogl
diff options
context:
space:
mode:
authorJulien Gouesse <[email protected]>2013-06-19 19:39:23 +0200
committerJulien Gouesse <[email protected]>2013-06-19 19:39:23 +0200
commit1dbe6a9d1aec9240be294e0dca74df79377cfc05 (patch)
tree8f5ce57e3b638e965e57ec1bfde4a004459d0703 /ardor3d-jogl
parent3931791d51704fb2f4cb867cc16c8ac2d4abe1bf (diff)
Forces the rebinding of the texture only when the drawable uses a frame buffer object as neothemachine suggested
Diffstat (limited to 'ardor3d-jogl')
-rw-r--r--ardor3d-jogl/src/main/java/com/ardor3d/scene/state/jogl/JoglTextureStateUtil.java8
1 files changed, 3 insertions, 5 deletions
diff --git a/ardor3d-jogl/src/main/java/com/ardor3d/scene/state/jogl/JoglTextureStateUtil.java b/ardor3d-jogl/src/main/java/com/ardor3d/scene/state/jogl/JoglTextureStateUtil.java
index 2d35f05..7e8adc0 100644
--- a/ardor3d-jogl/src/main/java/com/ardor3d/scene/state/jogl/JoglTextureStateUtil.java
+++ b/ardor3d-jogl/src/main/java/com/ardor3d/scene/state/jogl/JoglTextureStateUtil.java
@@ -62,7 +62,6 @@ import com.ardor3d.util.TextureManager;
import com.ardor3d.util.geom.BufferUtils;
import com.ardor3d.util.stat.StatCollector;
import com.ardor3d.util.stat.StatType;
-import com.jogamp.newt.opengl.GLWindow;
public class JoglTextureStateUtil {
private static final Logger logger = Logger.getLogger(JoglTextureStateUtil.class.getName());
@@ -677,11 +676,10 @@ public class JoglTextureStateUtil {
}
} else {
final GLDrawable drawable = GLContext.getCurrent().getGLDrawable();
- // forces the rebinding when the drawable is offscreen
- final boolean onscreen = !(drawable instanceof GLWindow)
- || ((GLWindow) drawable).getChosenCapabilities().isOnscreen();
+ // forces the rebinding when the drawable uses a frame buffer object
+ final boolean fbo = drawable.getChosenGLCapabilities().isFBO();
// texture already exists in OpenGL, just bind it if needed
- if (!unitRecord.isValid() || unitRecord.boundTexture != textureId || !onscreen) {
+ if (!unitRecord.isValid() || unitRecord.boundTexture != textureId || fbo) {
checkAndSetUnit(i, record, caps);
gl.glBindTexture(getGLType(type), textureId);
if (Constants.stats) {