Summary: | Make JOGL's tracking information public | ||
---|---|---|---|
Product: | [JogAmp] Jogl | Reporter: | PJDM <pjd.mayne+jogl> |
Component: | opengl | Assignee: | Sven Gothel <sgothel> |
Status: | RESOLVED WORKSFORME | ||
Severity: | enhancement | ||
Priority: | --- | ||
Version: | 2 | ||
Hardware: | All | ||
OS: | all | ||
Type: | --- | SCM Refs: | |
Workaround: | --- |
Description
PJDM
2014-03-05 23:26:11 CET
'gl.getBoundBuffer(target)' lets you query the buffer bound to a specific target. 'gl.getBufferStorage(int bufferName)' gives you the GLBufferStorage as created via 'gl.glBufferData(..)' or 'gl.glNamedBufferDataEXT(..)', see GLBufferStorage API documentation! Further more, GLBufferStorage.getMappedBuffer() gives you a mapped NIO buffer for that storage as mapped via 'gl.glMapBufferRange(..)' etc. Summary: ========= So what object states do we track currently: - object -> target binding - GLBufferStorage of object-name w/ storage created - GLBufferStorage's mapped NIO buffer what do we _not_ track: - buffer-names which are not bound to target - GLBufferStorage of object-name w/o storage created so one could ask whether a buffer-name has a storage created, simply by 'null != gl.getBufferStorage(bufferName)', etc. Bug closed. +++++ In GLBase you have: ++++++++++++++++++++++++++ /** * @param target a GL buffer (VBO) target as used in {@link GL#glBindBuffer(int, int)}, ie {@link GL#GL_ELEMENT_ARRAY_BUFFER}, {@link GL#GL_ARRAY_BUFFER}, .. * @return the GL buffer name bound to a target via {@link GL#glBindBuffer(int, int)} or 0 if unbound. * @see #getBufferStorage(int) */ public int getBoundBuffer(int target); /** * @param bufferName a GL buffer name, generated with e.g. {@link GL#glGenBuffers(int, int[], int)} and used in {@link GL#glBindBuffer(int, int)}, {@link GL#glBufferData(int, long, java.nio.Buffer, int)} or {@link GL2#glNamedBufferDataEXT(int, long, java.nio.Buffer, int)}. * @return the size of the given GL buffer storage, see {@link GLBufferStorage} * @see #getBoundBuffer(int) */ public GLBufferStorage getBufferStorage(int bufferName); ++++++++++++++++++++++++++ .. further more, you have: ++++++++++++++++++++++++++ /** * @return true if a VBO is bound to {@link GL#GL_ARRAY_BUFFER} via {@link GL#glBindBuffer(int, int)}, otherwise false */ public boolean isVBOArrayBound(); /** * @return true if a VBO is bound to {@link GL#GL_ELEMENT_ARRAY_BUFFER} via {@link GL#glBindBuffer(int, int)}, otherwise false */ public boolean isVBOElementArrayBound(); ++++++++++++++++++++++++++ |