diff options
author | Sven Gothel <[email protected]> | 2012-10-12 14:56:20 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-10-12 14:56:20 +0200 |
commit | f49f8e22953ed2426fd4264ee407e2dc3fc07cfc (patch) | |
tree | a1a646e638b02c6c0c7a3778d3bb2f8728c7f8e9 /src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java | |
parent | 8582ece7dc7f65271b3184261697a542766d9864 (diff) |
GLArrayData* VBO binding: Adding explicit bindBuffer(..) method, since VBO is not more bound after enableBuffer(); Fix unit test (test VBO bound).
Explicit bindBuffer(..) is required now, since enableBuffer() doesn't leave it bound.
See fixed VBORegion* patch for use case, i.e. using a VBO index buffer for glDrawElements().
Complets commit 8582ece7dc7f65271b3184261697a542766d9864.
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java')
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java index 5a1524d05..30fc0012b 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java +++ b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java @@ -171,7 +171,13 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData bufferEnabled = enable; } } - + + public void bindBuffer(GL gl, boolean bind) { + if(isVBO()) { + gl.glBindBuffer(getVBOTarget(), bind ? getVBOName() : 0); + } + } + public void setEnableAlways(boolean always) { enableBufferAlways = always; } |