From 1992d24671f8d99abccb671b8f9d5a7cd474fd00 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 12 Oct 2012 21:38:36 +0200 Subject: GLArrayData* VBO binding: Properly document and impl. bindBuffer(..) in detail w/ data sync within GLArrayHandle, which also removed redundant code (VBO data sync and binding). Refines commit 8582ece7dc7f65271b3184261697a542766d9864 and f49f8e22953ed2426fd4264ee407e2dc3fc07cfc --- .../classes/jogamp/opengl/util/GLArrayHandler.java | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'src/jogl/classes/jogamp/opengl/util/GLArrayHandler.java') diff --git a/src/jogl/classes/jogamp/opengl/util/GLArrayHandler.java b/src/jogl/classes/jogamp/opengl/util/GLArrayHandler.java index 2049f9618..a6314a216 100644 --- a/src/jogl/classes/jogamp/opengl/util/GLArrayHandler.java +++ b/src/jogl/classes/jogamp/opengl/util/GLArrayHandler.java @@ -37,12 +37,28 @@ import javax.media.opengl.*; */ public interface GLArrayHandler { + + /** + * if bind is true and the data uses VBO, + * the latter will be bound and data written to the GPU if required. + *

+ * If bind is false and the data uses VBO, + * the latter will be unbound. + *

+ * + * @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 boolean bindBuffer(GL gl, boolean bind); + /** * Implementation shall enable or disable the array state. *

* Before enabling the array state, - * implementation shall associate the data with the array - * and synchronize the data with the GPU. + * implementation shall synchronize the data with the GPU + * and associate the data with the array. *

* * @param gl current GL object -- cgit v1.2.3