From 31184990208f97c4ffa1e4411e82fef1d5030747 Mon Sep 17 00:00:00 2001 From: Ioannis Tsakpinis Date: Sun, 25 Nov 2012 02:52:51 +0200 Subject: [PATCH] Added alternative VertexAttribPointer with ByteBuffer data and explicit type. --- .../org/lwjgl/opengl/ARB_vertex_shader.java | 34 +++++++++++-------- src/templates/org/lwjgl/opengl/GL20.java | 7 ++++ 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/src/templates/org/lwjgl/opengl/ARB_vertex_shader.java b/src/templates/org/lwjgl/opengl/ARB_vertex_shader.java index d173a795..ea07fca8 100644 --- a/src/templates/org/lwjgl/opengl/ARB_vertex_shader.java +++ b/src/templates/org/lwjgl/opengl/ARB_vertex_shader.java @@ -32,7 +32,6 @@ package org.lwjgl.opengl; import org.lwjgl.util.generator.*; -import org.lwjgl.util.generator.Alternate; import org.lwjgl.util.generator.opengl.*; import java.nio.*; @@ -49,13 +48,13 @@ public interface ARB_vertex_shader { * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, * GetFloatv, and GetDoublev: */ - int GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB = 0x8B4A; - int GL_MAX_VARYING_FLOATS_ARB = 0x8B4B; - int GL_MAX_VERTEX_ATTRIBS_ARB = 0x8869; - int GL_MAX_TEXTURE_IMAGE_UNITS_ARB = 0x8872; - int GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB = 0x8B4C; + int GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB = 0x8B4A; + int GL_MAX_VARYING_FLOATS_ARB = 0x8B4B; + int GL_MAX_VERTEX_ATTRIBS_ARB = 0x8869; + int GL_MAX_TEXTURE_IMAGE_UNITS_ARB = 0x8872; + int GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB = 0x8B4C; int GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB = 0x8B4D; - int GL_MAX_TEXTURE_COORDS_ARB = 0x8871; + int GL_MAX_TEXTURE_COORDS_ARB = 0x8871; /** * Accepted by the <cap> parameter of Disable, Enable, and IsEnabled, and @@ -63,19 +62,19 @@ public interface ARB_vertex_shader { * GetDoublev: */ int GL_VERTEX_PROGRAM_POINT_SIZE_ARB = 0x8642; - int GL_VERTEX_PROGRAM_TWO_SIDE_ARB = 0x8643; + int GL_VERTEX_PROGRAM_TWO_SIDE_ARB = 0x8643; /** Accepted by the <pname> parameter GetObjectParameter{if}vARB: */ - int GL_OBJECT_ACTIVE_ATTRIBUTES_ARB = 0x8B89; + int GL_OBJECT_ACTIVE_ATTRIBUTES_ARB = 0x8B89; int GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB = 0x8B8A; /** Accepted by the <pname> parameter of GetVertexAttrib{dfi}vARB: */ - int GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB = 0x8622; - int GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB = 0x8623; - int GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB = 0x8624; - int GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB = 0x8625; + int GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB = 0x8622; + int GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB = 0x8623; + int GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB = 0x8624; + int GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB = 0x8625; int GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB = 0x886A; - int GL_CURRENT_VERTEX_ATTRIB_ARB = 0x8626; + int GL_CURRENT_VERTEX_ATTRIB_ARB = 0x8626; /** Accepted by the <pname> parameter of GetVertexAttribPointervARB: */ int GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB = 0x8645; @@ -141,6 +140,13 @@ public interface ARB_vertex_shader { @GLfloat @GLdouble Buffer buffer); + @Alternate("glVertexAttribPointerARB") + void glVertexAttribPointerARB(@GLuint int index, int size, @GLenum int type, boolean normalized, @GLsizei int stride, + @CachedReference(index = "index", name = "glVertexAttribPointer_buffer") + @BufferObject(BufferKind.ArrayVBO) + @Check + @Const ByteBuffer buffer); + void glEnableVertexAttribArrayARB(@GLuint int index); void glDisableVertexAttribArrayARB(@GLuint int index); diff --git a/src/templates/org/lwjgl/opengl/GL20.java b/src/templates/org/lwjgl/opengl/GL20.java index 22474cfb..f3062eed 100644 --- a/src/templates/org/lwjgl/opengl/GL20.java +++ b/src/templates/org/lwjgl/opengl/GL20.java @@ -367,6 +367,13 @@ public interface GL20 { @GLfloat @GLdouble Buffer buffer); + @Alternate("glVertexAttribPointer") + void glVertexAttribPointer(@GLuint int index, int size, @GLenum int type, boolean normalized, @GLsizei int stride, + @CachedReference(index = "index", name = "glVertexAttribPointer_buffer") + @BufferObject(BufferKind.ArrayVBO) + @Check + @Const ByteBuffer buffer); + void glEnableVertexAttribArray(@GLuint int index); void glDisableVertexAttribArray(@GLuint int index);