diff options
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/util/GLArrayDataEditable.java')
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/GLArrayDataEditable.java | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataEditable.java b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataEditable.java index 588e90d1e..9b04a48aa 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataEditable.java +++ b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataEditable.java @@ -14,7 +14,7 @@ import java.nio.*; public interface GLArrayDataEditable extends GLArrayData { public boolean sealed(); - + public boolean enabled(); /** @@ -45,12 +45,11 @@ public interface GLArrayDataEditable extends GLArrayData { public void seal(GL gl, boolean seal); /** - * <p> * Enables the buffer if <code>enable</code> is <code>true</code>, * and transfers the data if required. - * In case {@link #isVBO() VBO is used}, it is bound accordingly for the data transfer and data association. + * In case {@link #isVBO() VBO is used}, it is bound accordingly for the data transfer and association, + * i.e. it issued {@link #bindBuffer(GL, boolean)}. * The VBO buffer is unbound when the method returns. - * </p> * <p> * Disables the buffer if <code>enable</code> is <code>false</code>. * </p> @@ -67,15 +66,26 @@ public interface GLArrayDataEditable extends GLArrayData { * @see #setEnableAlways(boolean) */ public void enableBuffer(GL gl, boolean enable); - + /** - * In case {@link #isVBO() VBO is used}, the buffer is bound - * if <code>bind</code> is <code>true</code>, otherwise the buffer is unbound. + * if <code>bind</code> is true and the data uses {@link #isVBO() VBO}, + * the latter will be bound and data written to the GPU if required. + * <p> + * If <code>bind</code> is false and the data uses {@link #isVBO() VBO}, + * the latter will be unbound. + * </p> + * <p> + * This method is exposed to allow data VBO arrays, i.e. {@link GL#GL_ELEMENT_ARRAY_BUFFER}, + * to be bounded and written while keeping the VBO bound. The latter is in contrast to {@link #enableBuffer(GL, boolean)}, + * which leaves the VBO unbound, since it's not required for vertex attributes or pointers. + * </p> * - * @param gl - * @param bind + * @param gl current GL object + * @param bind true if VBO shall be bound and data written, + * otherwise clear VBO binding. + * @return true if data uses VBO and action was performed, otherwise false */ - public void bindBuffer(GL gl, boolean bind); + public boolean bindBuffer(GL gl, boolean bind); /** * Affects the behavior of 'enableBuffer'. |