summaryrefslogtreecommitdiffstats
path: root/src/jogl
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
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')
-rw-r--r--src/jogl/classes/jogamp/opengl/GLBufferSizeTracker.java26
-rw-r--r--src/jogl/classes/jogamp/opengl/GLBufferStateTracker.java8
2 files changed, 3 insertions, 31 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
diff --git a/src/jogl/classes/jogamp/opengl/GLBufferStateTracker.java b/src/jogl/classes/jogamp/opengl/GLBufferStateTracker.java
index d028bf98d..5a31431d8 100644
--- a/src/jogl/classes/jogamp/opengl/GLBufferStateTracker.java
+++ b/src/jogl/classes/jogamp/opengl/GLBufferStateTracker.java
@@ -136,14 +136,6 @@ public class GLBufferStateTracker {
return value;
}
- /** Indicates whether the binding state for the specified target is
- currently known, ie it could be bound or not but it must be tracked.<br>
- Should be called after getBoundBufferObject()
- because that method may change the answer for a given target. */
- public boolean isBoundBufferObjectKnown(int target) {
- return 0 < bindingMap.get(target) ;
- }
-
/** Clears out the known/unknown state of the various buffer object
binding states. These will be refreshed later on an as-needed
basis. This is called by the implementations of