From 4667ad39359ac0f096ad8257bc3e29740493028a Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 29 Aug 2008 08:49:29 +0000 Subject: BufferUtil: - new GL type tools - new put methods ImmModeSink: - using 1 VBO array for 1-4 attributes GLArrayData - split into GLArrayData and GLArrayDataEditable, the latter of modifying purposes only - GLArrayDataWrapper implements a container only git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1764 232f8b59-042b-4e1e-8c03-345bb8c30851 --- src/classes/com/sun/opengl/impl/GLFixedArrayHandler.java | 4 ++-- .../com/sun/opengl/impl/glsl/GLSLArrayHandler.java | 16 +++++----------- 2 files changed, 7 insertions(+), 13 deletions(-) (limited to 'src/classes/com/sun/opengl/impl') diff --git a/src/classes/com/sun/opengl/impl/GLFixedArrayHandler.java b/src/classes/com/sun/opengl/impl/GLFixedArrayHandler.java index 9882beb69..333a75aa0 100644 --- a/src/classes/com/sun/opengl/impl/GLFixedArrayHandler.java +++ b/src/classes/com/sun/opengl/impl/GLFixedArrayHandler.java @@ -6,9 +6,9 @@ import javax.media.opengl.glsl.ShaderState; import java.nio.*; public class GLFixedArrayHandler implements GLArrayHandler { - private GLArrayData ad; + private GLArrayDataEditable ad; - public GLFixedArrayHandler(GLArrayData ad) { + public GLFixedArrayHandler(GLArrayDataEditable ad) { this.ad = ad; } diff --git a/src/classes/com/sun/opengl/impl/glsl/GLSLArrayHandler.java b/src/classes/com/sun/opengl/impl/glsl/GLSLArrayHandler.java index 2910e67bd..3d48f2014 100644 --- a/src/classes/com/sun/opengl/impl/glsl/GLSLArrayHandler.java +++ b/src/classes/com/sun/opengl/impl/glsl/GLSLArrayHandler.java @@ -8,16 +8,14 @@ import javax.media.opengl.glsl.ShaderState; import java.nio.*; public class GLSLArrayHandler implements GLArrayHandler { - private GLArrayData ad; + private GLArrayDataEditable ad; - public GLSLArrayHandler(GLArrayData ad) { + public GLSLArrayHandler(GLArrayDataEditable ad) { this.ad = ad; } protected final void passVertexAttribPointer(GL2ES2 gl, ShaderState st) { - if ( ! st.glVertexAttribPointer(gl, ad) ) { - throw new RuntimeException("Internal Error"); - } + st.glVertexAttribPointer(gl, ad); } public void enableBuffer(GL gl, boolean enable) { @@ -28,9 +26,7 @@ public class GLSLArrayHandler implements GLArrayHandler { } if(enable) { - if(!st.glEnableVertexAttribArray(glsl, ad.getName())) { - throw new RuntimeException("Internal Error"); - } + st.glEnableVertexAttribArray(glsl, ad.getName()); Buffer buffer = ad.getBuffer(); @@ -53,9 +49,7 @@ public class GLSLArrayHandler implements GLArrayHandler { if(ad.isVBO()) { gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0); } - if(!st.glDisableVertexAttribArray(glsl, ad.getName())) { - throw new RuntimeException("Internal Error"); - } + st.glDisableVertexAttribArray(glsl, ad.getName()); } } -- cgit v1.2.3