aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-04-12 20:29:56 +0200
committerSven Gothel <[email protected]>2013-04-12 20:29:56 +0200
commit5606dd12f8086b506f33030072af5095a5871f9c (patch)
tree567f86af7d58ec538c5602319e6ea7d8ee6295c5 /src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java
parentcfe62741e19196d973d9b31f2c8f3873705cb74b (diff)
FBObject.init() uses safe 1x1 size like reset(..) to behave equal; GLFBODrawableImpl.contextMadeCurrent(ctx, true): Throw exception if !initialized
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java')
-rw-r--r--src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java33
1 files changed, 16 insertions, 17 deletions
diff --git a/src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java b/src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java
index ac10e2728..85f63b52c 100644
--- a/src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java
@@ -335,16 +335,17 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
protected final void contextMadeCurrent(GLContext glc, boolean current) {
final GL gl = glc.getGL();
if(current) {
+ if( !initialized ) {
+ throw new GLException("Not initialized: "+this);
+ }
fbos[fboIBack].bind(gl);
fboBound = true;
- } else {
- if(fboBound) {
- swapFBOImpl(glc);
- swapFBOImplPost(glc);
- fboBound=false;
- if(DEBUG_SWAP) {
- System.err.println("Post FBO swap(@release): done");
- }
+ } else if( fboBound ) {
+ swapFBOImpl(glc);
+ swapFBOImplPost(glc);
+ fboBound=false;
+ if(DEBUG_SWAP) {
+ System.err.println("Post FBO swap(@release): done");
}
}
}
@@ -353,17 +354,15 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
protected void swapBuffersImpl(boolean doubleBuffered) {
final GLContext ctx = GLContext.getCurrent();
boolean doPostSwap = false;
- if(null!=ctx && ctx.getGLDrawable()==this) {
- if(fboBound) {
- swapFBOImpl(ctx);
- doPostSwap = true;
- fboBound=false;
- if(DEBUG_SWAP) {
- System.err.println("Post FBO swap(@swap): done");
- }
+ if( null != ctx && ctx.getGLDrawable() == this && fboBound ) {
+ swapFBOImpl(ctx);
+ doPostSwap = true;
+ fboBound=false;
+ if(DEBUG_SWAP) {
+ System.err.println("Post FBO swap(@swap): done");
}
}
- if(null != swapBufferContext) {
+ if( null != swapBufferContext ) {
swapBufferContext.swapBuffers(doubleBuffered);
}
if(doPostSwap) {