From 202e913022d6289d8e206fdf4f26c5ca81b681ac Mon Sep 17 00:00:00 2001 From: Ioannis Tsakpinis Date: Sat, 5 Nov 2005 18:57:25 +0000 Subject: [PATCH] Added missing functions in ARB_vertex_shader --- .../org/lwjgl/opengl/ARBVertexShader.java | 186 ++++++++++++++++++ .../org_lwjgl_opengl_ARBVertexShader.c | 132 +++++++++++++ .../org/lwjgl/opengl/ARB_vertex_shader.java | 85 ++++++-- 3 files changed, 386 insertions(+), 17 deletions(-) diff --git a/src/generated/org/lwjgl/opengl/ARBVertexShader.java b/src/generated/org/lwjgl/opengl/ARBVertexShader.java index b2d4777d..1e055a3a 100644 --- a/src/generated/org/lwjgl/opengl/ARBVertexShader.java +++ b/src/generated/org/lwjgl/opengl/ARBVertexShader.java @@ -38,6 +38,160 @@ public final class ARBVertexShader { } + public static void glVertexAttrib1sARB(int index, short v0) { + long function_pointer = GLContext.getCapabilities().ARB_vertex_shader_glVertexAttrib1sARB_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + nglVertexAttrib1sARB(index, v0, function_pointer); + } + private static native void nglVertexAttrib1sARB(int index, short v0, long function_pointer); + + public static void glVertexAttrib1fARB(int index, float v0) { + long function_pointer = GLContext.getCapabilities().ARB_vertex_shader_glVertexAttrib1fARB_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + nglVertexAttrib1fARB(index, v0, function_pointer); + } + private static native void nglVertexAttrib1fARB(int index, float v0, long function_pointer); + + public static void glVertexAttrib1dARB(int index, double v0) { + long function_pointer = GLContext.getCapabilities().ARB_vertex_shader_glVertexAttrib1dARB_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + nglVertexAttrib1dARB(index, v0, function_pointer); + } + private static native void nglVertexAttrib1dARB(int index, double v0, long function_pointer); + + public static void glVertexAttrib2sARB(int index, short v0, short v1) { + long function_pointer = GLContext.getCapabilities().ARB_vertex_shader_glVertexAttrib2sARB_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + nglVertexAttrib2sARB(index, v0, v1, function_pointer); + } + private static native void nglVertexAttrib2sARB(int index, short v0, short v1, long function_pointer); + + public static void glVertexAttrib2fARB(int index, float v0, float v1) { + long function_pointer = GLContext.getCapabilities().ARB_vertex_shader_glVertexAttrib2fARB_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + nglVertexAttrib2fARB(index, v0, v1, function_pointer); + } + private static native void nglVertexAttrib2fARB(int index, float v0, float v1, long function_pointer); + + public static void glVertexAttrib2dARB(int index, double v0, double v1) { + long function_pointer = GLContext.getCapabilities().ARB_vertex_shader_glVertexAttrib2dARB_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + nglVertexAttrib2dARB(index, v0, v1, function_pointer); + } + private static native void nglVertexAttrib2dARB(int index, double v0, double v1, long function_pointer); + + public static void glVertexAttrib3sARB(int index, short v0, short v1, short v2) { + long function_pointer = GLContext.getCapabilities().ARB_vertex_shader_glVertexAttrib3sARB_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + nglVertexAttrib3sARB(index, v0, v1, v2, function_pointer); + } + private static native void nglVertexAttrib3sARB(int index, short v0, short v1, short v2, long function_pointer); + + public static void glVertexAttrib3fARB(int index, float v0, float v1, float v2) { + long function_pointer = GLContext.getCapabilities().ARB_vertex_shader_glVertexAttrib3fARB_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + nglVertexAttrib3fARB(index, v0, v1, v2, function_pointer); + } + private static native void nglVertexAttrib3fARB(int index, float v0, float v1, float v2, long function_pointer); + + public static void glVertexAttrib3dARB(int index, double v0, double v1, double v2) { + long function_pointer = GLContext.getCapabilities().ARB_vertex_shader_glVertexAttrib3dARB_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + nglVertexAttrib3dARB(index, v0, v1, v2, function_pointer); + } + private static native void nglVertexAttrib3dARB(int index, double v0, double v1, double v2, long function_pointer); + + public static void glVertexAttrib4sARB(int index, short v0, short v1, short v2, short v3) { + long function_pointer = GLContext.getCapabilities().ARB_vertex_shader_glVertexAttrib4sARB_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + nglVertexAttrib4sARB(index, v0, v1, v2, v3, function_pointer); + } + private static native void nglVertexAttrib4sARB(int index, short v0, short v1, short v2, short v3, long function_pointer); + + public static void glVertexAttrib4fARB(int index, float v0, float v1, float v2, float v3) { + long function_pointer = GLContext.getCapabilities().ARB_vertex_shader_glVertexAttrib4fARB_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + nglVertexAttrib4fARB(index, v0, v1, v2, v3, function_pointer); + } + private static native void nglVertexAttrib4fARB(int index, float v0, float v1, float v2, float v3, long function_pointer); + + public static void glVertexAttrib4dARB(int index, double v0, double v1, double v2, double v3) { + long function_pointer = GLContext.getCapabilities().ARB_vertex_shader_glVertexAttrib4dARB_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + nglVertexAttrib4dARB(index, v0, v1, v2, v3, function_pointer); + } + private static native void nglVertexAttrib4dARB(int index, double v0, double v1, double v2, double v3, long function_pointer); + + public static void glVertexAttrib4NubARB(int index, byte x, byte y, byte z, byte w) { + long function_pointer = GLContext.getCapabilities().ARB_vertex_shader_glVertexAttrib4NubARB_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + nglVertexAttrib4NubARB(index, x, y, z, w, function_pointer); + } + private static native void nglVertexAttrib4NubARB(int index, byte x, byte y, byte z, byte w, long function_pointer); + + public static void glVertexAttribPointerARB(int index, int size, boolean normalized, int stride, DoubleBuffer buffer) { + long function_pointer = GLContext.getCapabilities().ARB_vertex_shader_glVertexAttribPointerARB_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + GLChecks.ensureArrayVBOdisabled(); + BufferChecks.checkDirect(buffer); + GLChecks.getReferences().ARB_vertex_shader_glVertexAttribPointerARB_buffer = buffer; + nglVertexAttribPointerARB(index, size, GL11.GL_DOUBLE, normalized, stride, buffer, buffer.position() << 3, function_pointer); + } + public static void glVertexAttribPointerARB(int index, int size, boolean normalized, int stride, FloatBuffer buffer) { + long function_pointer = GLContext.getCapabilities().ARB_vertex_shader_glVertexAttribPointerARB_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + GLChecks.ensureArrayVBOdisabled(); + BufferChecks.checkDirect(buffer); + GLChecks.getReferences().ARB_vertex_shader_glVertexAttribPointerARB_buffer = buffer; + nglVertexAttribPointerARB(index, size, GL11.GL_FLOAT, normalized, stride, buffer, buffer.position() << 2, function_pointer); + } + public static void glVertexAttribPointerARB(int index, int size, boolean unsigned, boolean normalized, int stride, ByteBuffer buffer) { + long function_pointer = GLContext.getCapabilities().ARB_vertex_shader_glVertexAttribPointerARB_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + GLChecks.ensureArrayVBOdisabled(); + BufferChecks.checkDirect(buffer); + GLChecks.getReferences().ARB_vertex_shader_glVertexAttribPointerARB_buffer = buffer; + nglVertexAttribPointerARB(index, size, unsigned ? GL11.GL_UNSIGNED_BYTE : GL11.GL_BYTE, normalized, stride, buffer, buffer.position(), function_pointer); + } + public static void glVertexAttribPointerARB(int index, int size, boolean unsigned, boolean normalized, int stride, IntBuffer buffer) { + long function_pointer = GLContext.getCapabilities().ARB_vertex_shader_glVertexAttribPointerARB_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + GLChecks.ensureArrayVBOdisabled(); + BufferChecks.checkDirect(buffer); + GLChecks.getReferences().ARB_vertex_shader_glVertexAttribPointerARB_buffer = buffer; + nglVertexAttribPointerARB(index, size, unsigned ? GL11.GL_UNSIGNED_INT : GL11.GL_INT, normalized, stride, buffer, buffer.position() << 2, function_pointer); + } + public static void glVertexAttribPointerARB(int index, int size, boolean unsigned, boolean normalized, int stride, ShortBuffer buffer) { + long function_pointer = GLContext.getCapabilities().ARB_vertex_shader_glVertexAttribPointerARB_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + GLChecks.ensureArrayVBOdisabled(); + BufferChecks.checkDirect(buffer); + GLChecks.getReferences().ARB_vertex_shader_glVertexAttribPointerARB_buffer = buffer; + nglVertexAttribPointerARB(index, size, unsigned ? GL11.GL_UNSIGNED_SHORT : GL11.GL_SHORT, normalized, stride, buffer, buffer.position() << 1, function_pointer); + } + private static native void nglVertexAttribPointerARB(int index, int size, int type, boolean normalized, int stride, Buffer buffer, int buffer_position, long function_pointer); + public static void glVertexAttribPointerARB(int index, int size, int type, boolean normalized, int stride, int buffer_buffer_offset) { + long function_pointer = GLContext.getCapabilities().ARB_vertex_shader_glVertexAttribPointerARB_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + GLChecks.ensureArrayVBOenabled(); + nglVertexAttribPointerARBBO(index, size, type, normalized, stride, buffer_buffer_offset, function_pointer); + } + private static native void nglVertexAttribPointerARBBO(int index, int size, int type, boolean normalized, int stride, int buffer_buffer_offset, long function_pointer); + + public static void glEnableVertexAttribArrayARB(int index) { + long function_pointer = GLContext.getCapabilities().ARB_vertex_shader_glEnableVertexAttribArrayARB_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + nglEnableVertexAttribArrayARB(index, function_pointer); + } + private static native void nglEnableVertexAttribArrayARB(int index, long function_pointer); + + public static void glDisableVertexAttribArrayARB(int index) { + long function_pointer = GLContext.getCapabilities().ARB_vertex_shader_glDisableVertexAttribArrayARB_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + nglDisableVertexAttribArrayARB(index, function_pointer); + } + private static native void nglDisableVertexAttribArrayARB(int index, long function_pointer); + public static void glBindAttribLocationARB(int programObj, int index, ByteBuffer name) { long function_pointer = GLContext.getCapabilities().ARB_vertex_shader_glBindAttribLocationARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); @@ -68,4 +222,36 @@ public final class ARBVertexShader { return __result; } private static native int nglGetAttribLocationARB(int programObj, ByteBuffer name, int name_position, long function_pointer); + + public static void glGetVertexAttribARB(int index, int pname, FloatBuffer params) { + long function_pointer = GLContext.getCapabilities().ARB_vertex_shader_glGetVertexAttribfvARB_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkDirect(params); + nglGetVertexAttribfvARB(index, pname, params, params.position(), function_pointer); + } + private static native void nglGetVertexAttribfvARB(int index, int pname, FloatBuffer params, int params_position, long function_pointer); + + public static void glGetVertexAttribARB(int index, int pname, DoubleBuffer params) { + long function_pointer = GLContext.getCapabilities().ARB_vertex_shader_glGetVertexAttribdvARB_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkDirect(params); + nglGetVertexAttribdvARB(index, pname, params, params.position(), function_pointer); + } + private static native void nglGetVertexAttribdvARB(int index, int pname, DoubleBuffer params, int params_position, long function_pointer); + + public static void glGetVertexAttribARB(int index, int pname, IntBuffer params) { + long function_pointer = GLContext.getCapabilities().ARB_vertex_shader_glGetVertexAttribivARB_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkDirect(params); + nglGetVertexAttribivARB(index, pname, params, params.position(), function_pointer); + } + private static native void nglGetVertexAttribivARB(int index, int pname, IntBuffer params, int params_position, long function_pointer); + + public static java.nio.ByteBuffer glGetVertexAttribPointerARB(int index, int pname, int result_size) { + long function_pointer = GLContext.getCapabilities().ARB_vertex_shader_glGetVertexAttribPointervARB_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + java.nio.ByteBuffer __result = nglGetVertexAttribPointervARB(index, pname, result_size, function_pointer); + return __result; + } + private static native java.nio.ByteBuffer nglGetVertexAttribPointervARB(int index, int pname, int result_size, long function_pointer); } diff --git a/src/native/generated/org_lwjgl_opengl_ARBVertexShader.c b/src/native/generated/org_lwjgl_opengl_ARBVertexShader.c index 23ff9555..af0b0090 100644 --- a/src/native/generated/org_lwjgl_opengl_ARBVertexShader.c +++ b/src/native/generated/org_lwjgl_opengl_ARBVertexShader.c @@ -3,9 +3,116 @@ #include #include "extgl.h" +typedef void (APIENTRY *glVertexAttrib1sARBPROC) (GLuint index, GLshort v0); +typedef void (APIENTRY *glVertexAttrib1fARBPROC) (GLuint index, GLfloat v0); +typedef void (APIENTRY *glVertexAttrib1dARBPROC) (GLuint index, GLdouble v0); +typedef void (APIENTRY *glVertexAttrib2sARBPROC) (GLuint index, GLshort v0, GLshort v1); +typedef void (APIENTRY *glVertexAttrib2fARBPROC) (GLuint index, GLfloat v0, GLfloat v1); +typedef void (APIENTRY *glVertexAttrib2dARBPROC) (GLuint index, GLdouble v0, GLdouble v1); +typedef void (APIENTRY *glVertexAttrib3sARBPROC) (GLuint index, GLshort v0, GLshort v1, GLshort v2); +typedef void (APIENTRY *glVertexAttrib3fARBPROC) (GLuint index, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (APIENTRY *glVertexAttrib3dARBPROC) (GLuint index, GLdouble v0, GLdouble v1, GLdouble v2); +typedef void (APIENTRY *glVertexAttrib4sARBPROC) (GLuint index, GLshort v0, GLshort v1, GLshort v2, GLshort v3); +typedef void (APIENTRY *glVertexAttrib4fARBPROC) (GLuint index, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (APIENTRY *glVertexAttrib4dARBPROC) (GLuint index, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3); +typedef void (APIENTRY *glVertexAttrib4NubARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (APIENTRY *glVertexAttribPointerARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * buffer); +typedef void (APIENTRY *glEnableVertexAttribArrayARBPROC) (GLuint index); +typedef void (APIENTRY *glDisableVertexAttribArrayARBPROC) (GLuint index); typedef void (APIENTRY *glBindAttribLocationARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB * name); typedef void (APIENTRY *glGetActiveAttribARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name); typedef GLint (APIENTRY *glGetAttribLocationARBPROC) (GLhandleARB programObj, const GLcharARB * name); +typedef void (APIENTRY *glGetVertexAttribfvARBPROC) (GLuint index, GLenum pname, GLfloat * params); +typedef void (APIENTRY *glGetVertexAttribdvARBPROC) (GLuint index, GLenum pname, GLdouble * params); +typedef void (APIENTRY *glGetVertexAttribivARBPROC) (GLuint index, GLenum pname, GLint * params); +typedef void (APIENTRY *glGetVertexAttribPointervARBPROC) (GLuint index, GLenum pname, GLvoid ** result); + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglVertexAttrib1sARB(JNIEnv *env, jclass clazz, jint index, jshort v0, jlong function_pointer) { + glVertexAttrib1sARBPROC glVertexAttrib1sARB = (glVertexAttrib1sARBPROC)((intptr_t)function_pointer); + glVertexAttrib1sARB(index, v0); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglVertexAttrib1fARB(JNIEnv *env, jclass clazz, jint index, jfloat v0, jlong function_pointer) { + glVertexAttrib1fARBPROC glVertexAttrib1fARB = (glVertexAttrib1fARBPROC)((intptr_t)function_pointer); + glVertexAttrib1fARB(index, v0); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglVertexAttrib1dARB(JNIEnv *env, jclass clazz, jint index, jdouble v0, jlong function_pointer) { + glVertexAttrib1dARBPROC glVertexAttrib1dARB = (glVertexAttrib1dARBPROC)((intptr_t)function_pointer); + glVertexAttrib1dARB(index, v0); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglVertexAttrib2sARB(JNIEnv *env, jclass clazz, jint index, jshort v0, jshort v1, jlong function_pointer) { + glVertexAttrib2sARBPROC glVertexAttrib2sARB = (glVertexAttrib2sARBPROC)((intptr_t)function_pointer); + glVertexAttrib2sARB(index, v0, v1); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglVertexAttrib2fARB(JNIEnv *env, jclass clazz, jint index, jfloat v0, jfloat v1, jlong function_pointer) { + glVertexAttrib2fARBPROC glVertexAttrib2fARB = (glVertexAttrib2fARBPROC)((intptr_t)function_pointer); + glVertexAttrib2fARB(index, v0, v1); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglVertexAttrib2dARB(JNIEnv *env, jclass clazz, jint index, jdouble v0, jdouble v1, jlong function_pointer) { + glVertexAttrib2dARBPROC glVertexAttrib2dARB = (glVertexAttrib2dARBPROC)((intptr_t)function_pointer); + glVertexAttrib2dARB(index, v0, v1); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglVertexAttrib3sARB(JNIEnv *env, jclass clazz, jint index, jshort v0, jshort v1, jshort v2, jlong function_pointer) { + glVertexAttrib3sARBPROC glVertexAttrib3sARB = (glVertexAttrib3sARBPROC)((intptr_t)function_pointer); + glVertexAttrib3sARB(index, v0, v1, v2); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglVertexAttrib3fARB(JNIEnv *env, jclass clazz, jint index, jfloat v0, jfloat v1, jfloat v2, jlong function_pointer) { + glVertexAttrib3fARBPROC glVertexAttrib3fARB = (glVertexAttrib3fARBPROC)((intptr_t)function_pointer); + glVertexAttrib3fARB(index, v0, v1, v2); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglVertexAttrib3dARB(JNIEnv *env, jclass clazz, jint index, jdouble v0, jdouble v1, jdouble v2, jlong function_pointer) { + glVertexAttrib3dARBPROC glVertexAttrib3dARB = (glVertexAttrib3dARBPROC)((intptr_t)function_pointer); + glVertexAttrib3dARB(index, v0, v1, v2); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglVertexAttrib4sARB(JNIEnv *env, jclass clazz, jint index, jshort v0, jshort v1, jshort v2, jshort v3, jlong function_pointer) { + glVertexAttrib4sARBPROC glVertexAttrib4sARB = (glVertexAttrib4sARBPROC)((intptr_t)function_pointer); + glVertexAttrib4sARB(index, v0, v1, v2, v3); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglVertexAttrib4fARB(JNIEnv *env, jclass clazz, jint index, jfloat v0, jfloat v1, jfloat v2, jfloat v3, jlong function_pointer) { + glVertexAttrib4fARBPROC glVertexAttrib4fARB = (glVertexAttrib4fARBPROC)((intptr_t)function_pointer); + glVertexAttrib4fARB(index, v0, v1, v2, v3); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglVertexAttrib4dARB(JNIEnv *env, jclass clazz, jint index, jdouble v0, jdouble v1, jdouble v2, jdouble v3, jlong function_pointer) { + glVertexAttrib4dARBPROC glVertexAttrib4dARB = (glVertexAttrib4dARBPROC)((intptr_t)function_pointer); + glVertexAttrib4dARB(index, v0, v1, v2, v3); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglVertexAttrib4NubARB(JNIEnv *env, jclass clazz, jint index, jbyte x, jbyte y, jbyte z, jbyte w, jlong function_pointer) { + glVertexAttrib4NubARBPROC glVertexAttrib4NubARB = (glVertexAttrib4NubARBPROC)((intptr_t)function_pointer); + glVertexAttrib4NubARB(index, x, y, z, w); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglVertexAttribPointerARB(JNIEnv *env, jclass clazz, jint index, jint size, jint type, jboolean normalized, jint stride, jobject buffer, jint buffer_position, jlong function_pointer) { + const GLvoid *buffer_address = ((const GLvoid *)(((char *)(*env)->GetDirectBufferAddress(env, buffer)) + buffer_position)); + glVertexAttribPointerARBPROC glVertexAttribPointerARB = (glVertexAttribPointerARBPROC)((intptr_t)function_pointer); + glVertexAttribPointerARB(index, size, type, normalized, stride, buffer_address); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglVertexAttribPointerARBBO(JNIEnv *env, jclass clazz, jint index, jint size, jint type, jboolean normalized, jint stride, jint buffer_buffer_offset, jlong function_pointer) { + const GLvoid *buffer_address = ((const GLvoid *)offsetToPointer(buffer_buffer_offset)); + glVertexAttribPointerARBPROC glVertexAttribPointerARB = (glVertexAttribPointerARBPROC)((intptr_t)function_pointer); + glVertexAttribPointerARB(index, size, type, normalized, stride, buffer_address); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglEnableVertexAttribArrayARB(JNIEnv *env, jclass clazz, jint index, jlong function_pointer) { + glEnableVertexAttribArrayARBPROC glEnableVertexAttribArrayARB = (glEnableVertexAttribArrayARBPROC)((intptr_t)function_pointer); + glEnableVertexAttribArrayARB(index); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglDisableVertexAttribArrayARB(JNIEnv *env, jclass clazz, jint index, jlong function_pointer) { + glDisableVertexAttribArrayARBPROC glDisableVertexAttribArrayARB = (glDisableVertexAttribArrayARBPROC)((intptr_t)function_pointer); + glDisableVertexAttribArrayARB(index); +} JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglBindAttribLocationARB(JNIEnv *env, jclass clazz, jint programObj, jint index, jobject name, jint name_position, jlong function_pointer) { const GLcharARB *name_address = ((const GLcharARB *)(*env)->GetDirectBufferAddress(env, name)) + name_position; @@ -29,3 +136,28 @@ JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglGetAttribLocatio return __result; } +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglGetVertexAttribfvARB(JNIEnv *env, jclass clazz, jint index, jint pname, jobject params, jint params_position, jlong function_pointer) { + GLfloat *params_address = ((GLfloat *)(*env)->GetDirectBufferAddress(env, params)) + params_position; + glGetVertexAttribfvARBPROC glGetVertexAttribfvARB = (glGetVertexAttribfvARBPROC)((intptr_t)function_pointer); + glGetVertexAttribfvARB(index, pname, params_address); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglGetVertexAttribdvARB(JNIEnv *env, jclass clazz, jint index, jint pname, jobject params, jint params_position, jlong function_pointer) { + GLdouble *params_address = ((GLdouble *)(*env)->GetDirectBufferAddress(env, params)) + params_position; + glGetVertexAttribdvARBPROC glGetVertexAttribdvARB = (glGetVertexAttribdvARBPROC)((intptr_t)function_pointer); + glGetVertexAttribdvARB(index, pname, params_address); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglGetVertexAttribivARB(JNIEnv *env, jclass clazz, jint index, jint pname, jobject params, jint params_position, jlong function_pointer) { + GLint *params_address = ((GLint *)(*env)->GetDirectBufferAddress(env, params)) + params_position; + glGetVertexAttribivARBPROC glGetVertexAttribivARB = (glGetVertexAttribivARBPROC)((intptr_t)function_pointer); + glGetVertexAttribivARB(index, pname, params_address); +} + +JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglGetVertexAttribPointervARB(JNIEnv *env, jclass clazz, jint index, jint pname, jint result_size, jlong function_pointer) { + glGetVertexAttribPointervARBPROC glGetVertexAttribPointervARB = (glGetVertexAttribPointervARBPROC)((intptr_t)function_pointer); + GLvoid * __result; + glGetVertexAttribPointervARB(index, pname, &__result); + return safeNewBuffer(env, __result, result_size); +} + diff --git a/src/templates/org/lwjgl/opengl/ARB_vertex_shader.java b/src/templates/org/lwjgl/opengl/ARB_vertex_shader.java index 8104dce6..85e05ef6 100644 --- a/src/templates/org/lwjgl/opengl/ARB_vertex_shader.java +++ b/src/templates/org/lwjgl/opengl/ARB_vertex_shader.java @@ -31,12 +31,12 @@ */ package org.lwjgl.opengl; -import java.nio.ByteBuffer; -import java.nio.IntBuffer; - import org.lwjgl.util.generator.*; +import java.nio.*; + public interface ARB_vertex_shader { + /* * Accepted by the argument of CreateShaderObjectARB and * returned by the parameter of GetObjectParameter{if}vARB: @@ -95,23 +95,74 @@ public interface ARB_vertex_shader { int GL_FLOAT_MAT3_ARB = 0x8B5B; int GL_FLOAT_MAT4_ARB = 0x8B5C; + void glVertexAttrib1sARB(@GLuint int index, short v0); + + void glVertexAttrib1fARB(@GLuint int index, float v0); + + void glVertexAttrib1dARB(@GLuint int index, double v0); + + void glVertexAttrib2sARB(@GLuint int index, short v0, short v1); + + void glVertexAttrib2fARB(@GLuint int index, float v0, float v1); + + void glVertexAttrib2dARB(@GLuint int index, double v0, double v1); + + void glVertexAttrib3sARB(@GLuint int index, short v0, short v1, short v2); + + void glVertexAttrib3fARB(@GLuint int index, float v0, float v1, float v2); + + void glVertexAttrib3dARB(@GLuint int index, double v0, double v1, double v2); + + void glVertexAttrib4sARB(@GLuint int index, short v0, short v1, short v2, short v3); + + void glVertexAttrib4fARB(@GLuint int index, float v0, float v1, float v2, float v3); + + void glVertexAttrib4dARB(@GLuint int index, double v0, double v1, double v2, double v3); + + void glVertexAttrib4NubARB(@GLuint int index, @GLubyte byte x, @GLubyte byte y, @GLubyte byte z, @GLubyte byte w); + + void glVertexAttribPointerARB(@GLuint int index, int size, @AutoType("buffer") @GLenum int type, boolean normalized, @GLsizei int stride, + @CachedReference + @BufferObject(BufferKind.ArrayVBO) + @Check + @Const + @GLbyte + @GLubyte + @GLshort + @GLushort + @GLint + @GLuint + @GLfloat + @GLdouble Buffer buffer); + + void glEnableVertexAttribArrayARB(@GLuint int index); + + void glDisableVertexAttribArrayARB(@GLuint int index); + void glBindAttribLocationARB(@GLhandleARB int programObj, @GLuint int index, @NullTerminated @Const @GLcharARB ByteBuffer name); - // --------------------------- void glGetActiveAttribARB(@GLhandleARB int programObj, @GLuint int index, - @AutoSize("name") - @GLsizei - int maxLength, - @Check(value="1", canBeNull=true) - @GLsizei - IntBuffer length, - @Check("1") - IntBuffer size, - @Check("1") - @GLenum - IntBuffer type, - @GLcharARB - ByteBuffer name); + @AutoSize("name") + @GLsizei int maxLength, + @Check(value = "1", canBeNull = true) + @GLsizei IntBuffer length, + @Check("1") IntBuffer size, + @Check("1") + @GLenum IntBuffer type, + @GLcharARB ByteBuffer name); int glGetAttribLocationARB(@GLhandleARB int programObj, @NullTerminated @Const @GLcharARB ByteBuffer name); + + @StripPostfix("params") + void glGetVertexAttribfvARB(@GLuint int index, @GLenum int pname, @Check FloatBuffer params); + + @StripPostfix("params") + void glGetVertexAttribdvARB(@GLuint int index, @GLenum int pname, @Check DoubleBuffer params); + + @StripPostfix("params") + void glGetVertexAttribivARB(@GLuint int index, @GLenum int pname, @Check IntBuffer params); + + @StripPostfix("result") + void glGetVertexAttribPointervARB(@GLuint int index, @GLenum int pname, @Result @GLvoid ByteBuffer result); + }