From bf8a54b502f0fcd930e12a8bbda65f9538e8a2f7 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 22 Apr 2011 06:03:44 +0200 Subject: GLArrayData API and impl. changes +++ Remove GL parameter for - createFixed(..) - createGLSL(..) validation at client/server array data happens at 1st enableBuffer() call, no current context or profile required at creation time. Added ShaderState for createGLSL(..) clarifying dependency to the ShaderState, passing it down to the GLSLArrayHandler, which also removes the TLS GLContext.getCurrent() call. +++ Partially reverted ab48dac3f4419ceac51fdf059f310f0f0499c4d7 factory methods: removed added vboTarget parameter, since all createFixed and createGLSL are GL_ARRAY_BUFFER (VBO). Adding createData(..) factory method in GLArrayDataServer allowing diff vbo targets, ie GL_ELEMENT_ARRAY_BUFFER .. or none. --- src/jogl/classes/javax/media/opengl/GLArrayData.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/jogl/classes/javax') diff --git a/src/jogl/classes/javax/media/opengl/GLArrayData.java b/src/jogl/classes/javax/media/opengl/GLArrayData.java index b449ce232..f375be623 100644 --- a/src/jogl/classes/javax/media/opengl/GLArrayData.java +++ b/src/jogl/classes/javax/media/opengl/GLArrayData.java @@ -124,14 +124,21 @@ public interface GLArrayData { public int getComponentType(); /** - * The components size in bytes + * The component's size in bytes */ public int getComponentSize(); /** - * Return the number of elements. + * The current number of used elements.
+ * In case the buffer's position is 0 (sealed, flipped), it's based on it's limit instead of it's position. */ public int getElementNumber(); + + /** + * The current number of used bytes.
+ * In case the buffer's position is 0 (sealed, flipped), it's based on it's limit instead of it's position. + */ + public int getByteSize(); /** * True, if GL shall normalize fixed point data while converting -- cgit v1.2.3