summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp
diff options
context:
space:
mode:
authorSven Gothel <sgothel@jausoft.com>2013-04-12 20:29:56 +0200
committerSven Gothel <sgothel@jausoft.com>2013-04-12 20:29:56 +0200
commit5606dd12f8086b506f33030072af5095a5871f9c (patch)
tree567f86af7d58ec538c5602319e6ea7d8ee6295c5 /src/jogl/classes/com/jogamp
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/com/jogamp')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/FBObject.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/FBObject.java b/src/jogl/classes/com/jogamp/opengl/FBObject.java
index 7d0fcfa38..6f2ac3e35 100644
--- a/src/jogl/classes/com/jogamp/opengl/FBObject.java
+++ b/src/jogl/classes/com/jogamp/opengl/FBObject.java
@@ -835,6 +835,8 @@ public class FBObject {
checkPreGLError(gl);
+ if( 0 >= width ) { width = 1; }
+ if( 0 >= height ) { height = 1; }
this.width = width;
this.height = height;
this.samples = samples <= maxSamples ? samples : maxSamples;
@@ -941,7 +943,7 @@ public class FBObject {
* @throws GLException in case of an error, i.e. size too big, etc ..
*/
public final void reset(GL gl, int newWidth, int newHeight, int newSamples, boolean resetSamplingSink) {
- if(!initialized) {
+ if( !initialized ) {
init(gl, newWidth, newHeight, newSamples);
return;
}
@@ -949,10 +951,10 @@ public class FBObject {
newSamples = newSamples <= maxSamples ? newSamples : maxSamples; // clamp
if( newWidth != width || newHeight != height || newSamples != samples ) {
- if(0>=newWidth) { newWidth = 1; }
- if(0>=newHeight) { newHeight = 1; }
- if(newWidth > 2 + maxTextureSize || newHeight> 2 + maxTextureSize ||
- newWidth > maxRenderbufferSize || newHeight> maxRenderbufferSize ) {
+ if( 0 >= newWidth ) { newWidth = 1; }
+ if( 0 >= newHeight ) { newHeight = 1; }
+ if( newWidth > 2 + maxTextureSize || newHeight > 2 + maxTextureSize ||
+ newWidth > maxRenderbufferSize || newHeight > maxRenderbufferSize ) {
throw new GLException("size "+width+"x"+height+" exceeds on of the maxima [texture "+maxTextureSize+", renderbuffer "+maxRenderbufferSize+"]");
}