aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/GLBufferSizeTracker.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-04-22 05:47:07 +0200
committerSven Gothel <[email protected]>2011-04-22 05:47:07 +0200
commitfa5c609fa107a456930e74b247af819851ed1fe9 (patch)
tree15e90cb6cf2d5adfecba42342f9d34e987aefaee /src/jogl/classes/jogamp/opengl/GLBufferSizeTracker.java
parentd921526577596882f7ff21e2e1141368c23ebed0 (diff)
GLBufferSizeTracker/GLBufferStateTracker: Remove Redundancy
GLBufferStateTracker.isBoundBufferObjectKnown() is redundant, since it's 'get' method added it if not yet known. GLBufferSizeTracker removed above mentioned call, fallback to std GL query, no exception.
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/GLBufferSizeTracker.java')
-rw-r--r--src/jogl/classes/jogamp/opengl/GLBufferSizeTracker.java26
1 files changed, 3 insertions, 23 deletions
diff --git a/src/jogl/classes/jogamp/opengl/GLBufferSizeTracker.java b/src/jogl/classes/jogamp/opengl/GLBufferSizeTracker.java
index 15e3affee..fc8be95e9 100644
--- a/src/jogl/classes/jogamp/opengl/GLBufferSizeTracker.java
+++ b/src/jogl/classes/jogamp/opengl/GLBufferSizeTracker.java
@@ -107,17 +107,7 @@ public class GLBufferSizeTracker {
int target, GL caller, long size) {
// Need to do some similar queries to getBufferSize below
int buffer = bufferStateTracker.getBoundBufferObject(target, caller);
- boolean valid = bufferStateTracker.isBoundBufferObjectKnown(target);
- if (valid) {
- if (buffer == 0) {
- // FIXME: this really should not happen if we know what's
- // going on. Very likely there is an OpenGL error in the
- // application if we get here. Could silently return 0, but it
- // seems better to get an early warning that something is
- // wrong.
- throw new GLException("Error: no OpenGL buffer object appears to be bound to target 0x" +
- Integer.toHexString(target));
- }
+ if (buffer != 0) {
setDirectStateBufferSize(buffer, caller, size);
}
// We don't know the current buffer state. Note that the buffer
@@ -135,18 +125,8 @@ public class GLBufferSizeTracker {
GL caller) {
// See whether we know what buffer is currently bound to the given
// state
- int buffer = bufferStateTracker.getBoundBufferObject(target, caller);
- boolean valid = bufferStateTracker.isBoundBufferObjectKnown(target);
- if (valid) {
- if (0 == buffer) {
- // FIXME: this really should not happen if we know what's
- // going on. Very likely there is an OpenGL error in the
- // application if we get here. Could silently return 0, but it
- // seems better to get an early warning that something is
- // wrong.
- throw new GLException("Error: no OpenGL buffer object appears to be bound to target 0x" +
- Integer.toHexString(target));
- }
+ final int buffer = bufferStateTracker.getBoundBufferObject(target, caller);
+ if (0 != buffer) {
return getBufferSizeImpl(target, buffer, caller);
}
// We don't know what's going on in this case; query the GL for an answer