|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.opengl.impl.GLBufferStateTracker
public class GLBufferStateTracker
Tracks as closely as possible which OpenGL buffer object is bound to which binding target in the current OpenGL context. GLBufferStateTracker objects are allocated on a per-GLImpl basis, which is basically identical to a per-OpenGL-context basis (assuming correct usage of the GLImpl objects, which is checked by the DebugGL). This class is used to verify that e.g. the vertex buffer object extension is in use when the glVertexPointer variant taking a long as argument is called.
Note that because the enumerated value used for the binding of a buffer object (e.g. GL_ARRAY_BUFFER) is different than that used to query the binding using glGetIntegerv (e.g. GL_ARRAY_BUFFER_BINDING), then in the face of new binding targets being added to the GL (e.g. GL_TRANSFORM_FEEDBACK_BUFFER_NV) it is impossible to set up a query of the buffer object currently bound to a particular state. It turns out that for some uses, such as finding the size of the currently bound buffer, this doesn't matter, though of course without knowing the buffer object we can't re-associate the queried size with the buffer object ID.
Because the namespace of buffer objects is the unsigned integers with 0 reserved by the GL, and because we have to be able to return both 0 and other integers as valid answers from getBoundBufferObject(), we need a second query, which is to ask whether we know the state of the binding for a given target. For "unknown" targets such as GL_TRANSFORM_FEEDBACK_BUFFER_NV we return false from this, but we also clear the valid bit and later refresh the binding state if glPushClientAttrib / glPopClientAttrib are called, since we don't want the complexity of tracking stacks of these attributes.
Constructor Summary | |
---|---|
GLBufferStateTracker()
|
Method Summary | |
---|---|
void |
clearBufferObjectState()
Clears out the known/unknown state of the various buffer object binding states. |
int |
getBoundBufferObject(int target,
GL caller)
Note: returns an unspecified value if the binding for the specified target (e.g. |
boolean |
isBoundBufferObjectKnown(int target)
Indicates whether the binding state for the specified target is currently known. |
void |
setBoundBufferObject(int target,
int buffer)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GLBufferStateTracker()
Method Detail |
---|
public void setBoundBufferObject(int target, int buffer)
public int getBoundBufferObject(int target, GL caller)
public boolean isBoundBufferObjectKnown(int target)
public void clearBufferObjectState()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |