aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/opengl
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-04-08 14:52:19 +0200
committerSven Gothel <[email protected]>2011-04-08 14:52:19 +0200
commitea9517a1bb3144f4ab6f3b8f1a41ced9046fd9b4 (patch)
treeecbe8ba01ca5e7b6d51abbcb6732d44c6c15a8c6 /src/jogl/classes/com/jogamp/opengl
parentab48dac3f4419ceac51fdf059f310f0f0499c4d7 (diff)
Fix FBObject: Remove double stencil RB generation; Expose data (size, ..)
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/FBObject.java26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/FBObject.java b/src/jogl/classes/com/jogamp/opengl/util/FBObject.java
index ad32b4ffe..c853bff15 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/FBObject.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/FBObject.java
@@ -39,17 +39,16 @@ public class FBObject {
private int width, height;
private int fb, fbo_tex, depth_rb, stencil_rb, vStatus;
private int texInternalFormat, texDataFormat, texDataType;
-
- public static final int ATTR_DEPTH = 1 << 0;
- public static final int ATTR_STENCIL = 1 << 1;
-
+ private boolean bound;
+
public FBObject(int width, int height) {
this.width = width;
this.height = height;
this.fb = 0;
this.fbo_tex = 0;
this.depth_rb = 0;
- this.stencil_rb = 0;
+ this.stencil_rb = 0;
+ this.bound = false;
}
public boolean validateStatus(GL gl) {
@@ -283,7 +282,6 @@ public class FBObject {
checkBound(true);
int name[] = new int[1];
gl.glGenRenderbuffers(1, name, 0);
- gl.glGenRenderbuffers(1, name, 0);
stencil_rb = name[0];
if(stencil_rb==0) {
throw new GLException("null generated stencilbuffer");
@@ -331,8 +329,6 @@ public class FBObject {
}
}
- boolean bound = false;
-
private final void checkBound(boolean shallBeBound) {
if(bound != shallBeBound) {
final String s0 = shallBeBound ? "not" : "already" ;
@@ -361,10 +357,14 @@ public class FBObject {
gl.glBindTexture(GL.GL_TEXTURE_2D, fbo_tex); // to use it ..
}
- public int getFBName() {
- return fb;
- }
- public int getTextureName() {
- return fbo_tex;
+ public final boolean isBound() { return bound; }
+ public final int getWidth() { return width; }
+ public final int getHeight() { return height; }
+ public final int getFBName() { return fb; }
+ public final int getTextureName() { return fbo_tex; }
+ public final int getStencilBuffer() { return stencil_rb; }
+ public final int getDepthBuffer() { return depth_rb; }
+ public final String toString() {
+ return "FBO[name "+fb+", size "+width+"x"+height+", tex "+fbo_tex+", depth "+depth_rb+", stencil "+stencil_rb+"]";
}
}