Completed GL 2.0

This commit is contained in:
Ioannis Tsakpinis 2005-01-15 23:50:55 +00:00
parent 73552e3d51
commit 2227e83ea4
4 changed files with 475 additions and 52 deletions

View File

@ -125,20 +125,29 @@ public final class GL14 {
}
private static native void nglMultiDrawArrays(int mode, IntBuffer piFirst, int piFirst_offset, IntBuffer piCount, int piCount_offset, int primcount);
/* public static native void glMultiDrawElements(int mode, int piCount, int type, int pIndices, int primcount);*/
/*public static native void glMultiDrawElements(int mode, int piCount, int type, int pIndices, int primcount);*/
public static native void glPointParameteri(int pname, int param);
public static native void glPointParameterf(int pname, float param);
// ---------------------------
public static void glPointParameter(int pname, IntBuffer params) {
BufferChecks.checkBuffer(params);
nglPointParameteriv(pname, params, params.position());
}
private static native void nglPointParameteriv(int pname, IntBuffer params, int params_offset);
// ---------------------------
// ---------------------------
public static void glPointParameter(int pname, FloatBuffer params) {
BufferChecks.checkBuffer(params);
nglPointParameterfv(pname, params, params.position());
}
private static native void nglPointParameterfv(int pname, FloatBuffer params, int params_offset);
// ---------------------------
public static native void glSecondaryColor3b(byte red, byte green, byte blue);
public static native void glSecondaryColor3f(float red, float green, float blue);
public static native void glSecondaryColor3ub(byte red, byte green, byte blue);
public static void glSecondaryColorPointer(int size, boolean unsigned, int stride, ByteBuffer data) {
@ -152,14 +161,12 @@ public final class GL14 {
GLBufferChecks.ensureArrayVBOdisabled();
nglSecondaryColorPointer(size, GL11.GL_FLOAT, stride, data, data.position() << 2);
}
private static native void nglSecondaryColorPointer(int size, int type, int stride, Buffer data, int data_offset);
public static void glSecondaryColorPointer(int size, int type, int stride, int buffer_offset) {
GLBufferChecks.ensureArrayVBOenabled();
nglSecondaryColorPointerVBO(size, type, stride, buffer_offset);
}
private static native void nglSecondaryColorPointerVBO(int size, int type, int stride, int buffer_offset);
public static native void glBlendFuncSeparate(int sfactorRGB, int dfactorRGB, int sfactorAlpha, int dfactorAlpha);

View File

@ -34,10 +34,7 @@ package org.lwjgl.opengl;
import org.lwjgl.BufferChecks;
import org.lwjgl.LWJGLException;
import java.nio.BufferOverflowException;
import java.nio.ByteBuffer;
import java.nio.FloatBuffer;
import java.nio.IntBuffer;
import java.nio.*;
public final class GL20 {
@ -46,19 +43,28 @@ public final class GL20 {
static native void initNativeStubs() throws LWJGLException;
// ------------------------------------------------------------------
// ----------------------[ ARB_shading_language_100 ]----------------------
// ------------------------------------------------------------------
/*
* Accepted by the <name> parameter of GetString:
*/
public static final int GL_SHADING_LANGUAGE_VERSION = 0x8B8C;
// ------------------------------------------------------------------
// ----------------------[ ARB_shader_objects ]----------------------
// ------------------------------------------------------------------
/*
* Accepted by the <pname> argument of GetHandleARB:
* Accepted by the <pname> argument of GetInteger:
*/
public static final int GL_PROGRAM_OBJECT = 0x8B40;
public static final int GL_CURRENT_PROGRAM = 0x8B8D;
/*
* Accepted by the <pname> parameter of GetObjectParameter{fi}vARB:
*/
public static final int GL_SHADER_TYPE = 0x8B4E;
public static final int GL_SHADER_TYPE = 0x8B4F;
public static final int GL_DELETE_STATUS = 0x8B80;
public static final int GL_COMPILE_STATUS = 0x8B81;
public static final int GL_LINK_STATUS = 0x8B82;
@ -98,8 +104,6 @@ public final class GL20 {
public static final int GL_SAMPLER_CUBE = 0x8B60;
public static final int GL_SAMPLER_1D_SHADOW = 0x8B61;
public static final int GL_SAMPLER_2D_SHADOW = 0x8B62;
public static final int GL_SAMPLER_2D_RECT = 0x8B63;
public static final int GL_SAMPLER_2D_RECT_SHADOW = 0x8B64;
// ---------------------------
/**
@ -448,6 +452,83 @@ public final class GL20 {
IntBuffer length, int lengthOffset, ByteBuffer source, int sourceOffset);
// ---------------------------
// ------------------------------------------------------------------
// ----------------------[ ARB_vertex_program ]----------------------
// ------------------------------------------------------------------
public static native void glVertexAttrib1s(int index, short x);
public static native void glVertexAttrib1f(int index, float x);
public static native void glVertexAttrib2s(int index, short x, short y);
public static native void glVertexAttrib2f(int index, float x, float y);
public static native void glVertexAttrib3s(int index, short x, short y, short z);
public static native void glVertexAttrib3f(int index, float x, float y, float z);
public static native void glVertexAttrib4s(int index, short x, short y, short z, short w);
public static native void glVertexAttrib4f(int index, float x, float y, float z, float w);
public static native void glVertexAttrib4Nub(int index, byte x, byte y, byte z, byte w);
public static void glVertexAttribPointer(int index, int size, boolean unsigned, boolean normalized, int stride, ByteBuffer buffer) {
GLBufferChecks.ensureArrayVBOdisabled();
nglVertexAttribPointer(index, size, unsigned ? GL11.GL_UNSIGNED_BYTE : GL11.GL_BYTE, normalized, stride, buffer, buffer.position());
}
public static void glVertexAttribPointer(int index, int size, boolean unsigned, boolean normalized, int stride, ShortBuffer buffer) {
GLBufferChecks.ensureArrayVBOdisabled();
nglVertexAttribPointer(index, size, unsigned ? GL11.GL_UNSIGNED_SHORT : GL11.GL_SHORT, normalized, stride, buffer, buffer.position() << 1);
}
public static void glVertexAttribPointer(int index, int size, boolean normalized, int stride, FloatBuffer buffer) {
GLBufferChecks.ensureArrayVBOdisabled();
nglVertexAttribPointer(index, size, GL11.GL_FLOAT, normalized, stride, buffer, buffer.position() << 2);
}
public static void glVertexAttribPointer(int index, int size, boolean unsigned, boolean normalized, int stride, IntBuffer buffer) {
GLBufferChecks.ensureArrayVBOdisabled();
nglVertexAttribPointer(index, size, unsigned ? GL11.GL_UNSIGNED_INT : GL11.GL_INT, normalized, stride, buffer, buffer.position() << 2);
}
private static native void nglVertexAttribPointer(int index, int size, int type, boolean normalized, int stride, Buffer buffer, int bufferOffset);
// ---------------------------
public static void glVertexAttribPointer(int index, int size, int type, boolean normalized, int stride, int bufferOffset) {
GLBufferChecks.ensureArrayVBOenabled();
nglVertexAttribPointerVBO(index, size, type, normalized, stride, bufferOffset);
}
private static native void nglVertexAttribPointerVBO(int index, int size, int type, boolean normalized, int stride, int bufferOffset);
// ---------------------------
public static native void glEnableVertexAttribArray(int index);
public static native void glDisableVertexAttribArray(int index);
// ---------------------------
public static void glGetVertexAttrib(int index, int pname, FloatBuffer params) {
BufferChecks.checkBuffer(params);
nglGetVertexAttribfv(index, pname, params, params.position());
}
private static native void nglGetVertexAttribfv(int index, int pname, FloatBuffer params, int paramsOffset);
// ---------------------------
// ---------------------------
public static void glGetVertexAttrib(int index, int pname, IntBuffer params) {
BufferChecks.checkBuffer(params);
nglGetVertexAttribiv(index, pname, params, params.position());
}
private static native void nglGetVertexAttribiv(int index, int pname, IntBuffer params, int paramsOffset);
// ---------------------------
public static native ByteBuffer glGetVertexAttribPointer(int index, int pname, int size);
// -----------------------------------------------------------------
// ----------------------[ ARB_vertex_shader ]----------------------
// -----------------------------------------------------------------
@ -617,6 +698,18 @@ public final class GL20 {
*/
public static final int GL_COORD_REPLACE = 0x8862;
/*
* Accepted by the <pname> parameter of PointParameter{if}vARB, and the
* <pname> of Get:
*/
public static final int GL_POINT_SPRITE_COORD_ORIGIN = 0x8CA0;
/*
* Accepted by the <param> parameter of PointParameter{if}vARB:
*/
public static final int GL_LOWER_LEFT = 0x8CA1;
public static final int GL_UPPER_LEFT = 0x8CA2;
// -----------------------------------------------------------------
// ----------------------[ Two-Sided Stencil ]----------------------
// -----------------------------------------------------------------
@ -625,11 +718,23 @@ public final class GL20 {
public static final int GL_STENCIL_BACK_FAIL = 0x8801;
public static final int GL_STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802;
public static final int GL_STENCIL_BACK_PASS_DEPTH_PASS = 0x8803;
public static final int GL_STENCIL_BACK_REF = 0x0000; // TODO: Find this value
public static final int GL_STENCIL_BACK_VALUE_MASK = 0x0000; // TODO: Find this value
public static native void glStencilFuncSeparate(int face, int func, int ref, int mask);
public static final int GL_STENCIL_BACK_REF = 0x8CA3;
public static final int GL_STENCIL_BACK_VALUE_MASK = 0x8CA4;
public static final int GL_STENCIL_BACK_WRITEMASK = 0x8CA5;
public static native void glStencilOpSeparate(int face, int sfail, int dpfail, int dppass);
public static native void glStencilFuncSeparate(int face, int func, int ref, int mask);
public static native void glStencilMaskSeparate(int face, int mask);
// -------------------------------------------------------------
// ----------------------[ EXT_blend_equation_separate ]----------------------
// -------------------------------------------------------------
public static final int GL_BLEND_EQUATION_RGB = 0x8009;
public static final int GL_BLEND_EQUATION_ALPHA = 0x883D;
public static native void glBlendEquationSeparate(int modeRGB, int modeAlpha);
}

View File

@ -1,35 +1,35 @@
/*
/*
* Copyright (c) 2002-2004 LWJGL Project
* All rights reserved.
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* $Id$
*
@ -48,7 +48,9 @@ typedef void (APIENTRY * glFogCoordfPROC) (GLfloat coord);
typedef void (APIENTRY * glFogCoordPointerPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
typedef void (APIENTRY * glMultiDrawArraysPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
typedef void (APIENTRY * glPointParameterfPROC) (GLenum pname, GLfloat param);
typedef void (APIENTRY * glPointParameteriPROC) (GLenum pname, GLint param);
typedef void (APIENTRY * glPointParameterfvPROC) (GLenum pname, GLfloat *params);
typedef void (APIENTRY * glPointParameterivPROC) (GLenum pname, GLint *params);
typedef void (APIENTRY * glSecondaryColor3bPROC) (GLbyte red, GLbyte green, GLbyte blue);
typedef void (APIENTRY * glSecondaryColor3fPROC) (GLfloat red, GLfloat green, GLfloat blue);
typedef void (APIENTRY * glSecondaryColor3ubPROC) (GLubyte red, GLubyte green, GLubyte blue);
@ -63,7 +65,9 @@ static glFogCoordfPROC glFogCoordf;
static glFogCoordPointerPROC glFogCoordPointer;
static glMultiDrawArraysPROC glMultiDrawArrays;
static glPointParameterfPROC glPointParameterf;
static glPointParameteriPROC glPointParameteri;
static glPointParameterfvPROC glPointParameterfv;
static glPointParameterivPROC glPointParameteriv;
static glSecondaryColor3bPROC glSecondaryColor3b;
static glSecondaryColor3fPROC glSecondaryColor3f;
static glSecondaryColor3ubPROC glSecondaryColor3ub;
@ -80,14 +84,11 @@ static void JNICALL Java_org_lwjgl_opengl_GL14_glBlendEquation
(JNIEnv *env, jclass clazz, jint mode)
{
glBlendEquation(mode);
}
static void JNICALL Java_org_lwjgl_opengl_GL14_glBlendColor(JNIEnv * env, jclass clazz, jfloat p0, jfloat p1, jfloat p2, jfloat p3)
{
glBlendColor((GLfloat) p0, (GLfloat) p1, (GLfloat) p2, (GLfloat) p3);
}
/*
@ -110,7 +111,7 @@ static void JNICALL Java_org_lwjgl_opengl_GL14_nglFogCoordPointer
(JNIEnv *env, jclass clazz, jint p1, jint p2, jobject buffer, jint offset) {
GLvoid *address = (GLvoid *)(offset + (GLbyte *)(*env)->GetDirectBufferAddress(env, buffer));
glFogCoordPointer(p1, p2, address);
}
/*
@ -121,7 +122,6 @@ static void JNICALL Java_org_lwjgl_opengl_GL14_nglFogCoordPointer
static void JNICALL Java_org_lwjgl_opengl_GL14_nglFogCoordPointerVBO
(JNIEnv *env, jclass clazz, jint p1, jint p2, jint buffer_offset) {
glFogCoordPointer(p1, p2, offsetToPointer(buffer_offset));
}
/*
@ -134,9 +134,8 @@ static void JNICALL Java_org_lwjgl_opengl_GL14_nglMultiDrawArrays
GLint *address = first_offset + (GLint *)(*env)->GetDirectBufferAddress(env, first);
GLsizei *address2 = count_offset + (GLsizei *)(*env)->GetDirectBufferAddress(env, count);
glMultiDrawArrays(mode, address, address2, (GLsizei)primcount);
}
/*
* Class: org_lwjgl_opengl_GL14
* Method: glPointParameterf
@ -145,7 +144,16 @@ static void JNICALL Java_org_lwjgl_opengl_GL14_nglMultiDrawArrays
static void JNICALL Java_org_lwjgl_opengl_GL14_glPointParameterf
(JNIEnv *env, jclass clazz, jint p1, jfloat p2) {
glPointParameterf(p1, p2);
}
/*
* Class: org_lwjgl_opengl_GL14
* Method: glPointParameteri
* Signature: (IF)V
*/
static void JNICALL Java_org_lwjgl_opengl_GL14_glPointParameteri
(JNIEnv *env, jclass clazz, jint p1, jint p2) {
glPointParameteri(p1, p2);
}
/*
@ -157,7 +165,17 @@ static void JNICALL Java_org_lwjgl_opengl_GL14_nglPointParameterfv
(JNIEnv *env, jclass clazz, jint p1, jobject buffer, jint offset) {
GLfloat *address = offset + (GLfloat *)(*env)->GetDirectBufferAddress(env, buffer);
glPointParameterfv(p1, address);
}
/*
* Class: org_lwjgl_opengl_GL14
* Method: glPointParameteriv
* Signature: (ILjava/nio/IntBuffer;)V
*/
static void JNICALL Java_org_lwjgl_opengl_GL14_nglPointParameteriv
(JNIEnv *env, jclass clazz, jint p1, jobject buffer, jint offset) {
GLint *address = offset + (GLint *)(*env)->GetDirectBufferAddress(env, buffer);
glPointParameteriv(p1, address);
}
/*
@ -201,7 +219,7 @@ static void JNICALL Java_org_lwjgl_opengl_GL14_nglSecondaryColorPointer
(JNIEnv *env, jclass clazz, jint p1, jint p2, jint p3, jobject buffer, jint offset) {
const GLvoid *address = (const GLvoid *)(offset + (GLbyte *)(*env)->GetDirectBufferAddress(env, buffer));
glSecondaryColorPointer(p1, p2, p3, address);
}
/*
@ -212,7 +230,7 @@ static void JNICALL Java_org_lwjgl_opengl_GL14_nglSecondaryColorPointer
static void JNICALL Java_org_lwjgl_opengl_GL14_nglSecondaryColorPointerVBO
(JNIEnv *env, jclass clazz, jint p1, jint p2, jint p3, jint buffer_offset) {
glSecondaryColorPointer(p1, p2, p3, offsetToPointer(buffer_offset));
}
/*
@ -223,7 +241,7 @@ static void JNICALL Java_org_lwjgl_opengl_GL14_nglSecondaryColorPointerVBO
static void JNICALL Java_org_lwjgl_opengl_GL14_glBlendFuncSeparate
(JNIEnv *env, jclass clazz, jint p1, jint p2, jint p3, jint p4) {
glBlendFuncSeparate(p1, p2, p3, p4);
}
@ -281,7 +299,9 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14_initNativeStubs(JNIEnv *env, j
{"nglFogCoordPointerVBO", "(III)V", (void*)&Java_org_lwjgl_opengl_GL14_nglFogCoordPointerVBO, NULL, NULL},
{"nglMultiDrawArrays", "(ILjava/nio/IntBuffer;ILjava/nio/IntBuffer;II)V", (void*)&Java_org_lwjgl_opengl_GL14_nglMultiDrawArrays, "glMultiDrawArrays", (void*)&glMultiDrawArrays},
{"glPointParameterf", "(IF)V", (void*)&Java_org_lwjgl_opengl_GL14_glPointParameterf, "glPointParameterf", (void*)&glPointParameterf},
{"glPointParameteri", "(II)V", (void*)&Java_org_lwjgl_opengl_GL14_glPointParameteri, "glPointParameteri", (void*)&glPointParameteri},
{"nglPointParameterfv", "(ILjava/nio/FloatBuffer;I)V", (void*)&Java_org_lwjgl_opengl_GL14_nglPointParameterfv, "glPointParameterfv", (void*)&glPointParameterfv},
{"nglPointParameteriv", "(ILjava/nio/IntBuffer;I)V", (void*)&Java_org_lwjgl_opengl_GL14_nglPointParameteriv, "glPointParameteriv", (void*)&glPointParameteriv},
{"glSecondaryColor3b", "(BBB)V", (void*)&Java_org_lwjgl_opengl_GL14_glSecondaryColor3b, "glSecondaryColor3b", (void*)&glSecondaryColor3b},
{"glSecondaryColor3f", "(FFF)V", (void*)&Java_org_lwjgl_opengl_GL14_glSecondaryColor3f, "glSecondaryColor3f", (void*)&glSecondaryColor3f},
{"glSecondaryColor3ub", "(BBB)V", (void*)&Java_org_lwjgl_opengl_GL14_glSecondaryColor3ub, "glSecondaryColor3ub", (void*)&glSecondaryColor3ub},

View File

@ -93,6 +93,46 @@ static int sourceCount;
static GLchar** sources = NULL;;
static GLint* sourcesLengths = NULL;
// ARB_vertex_program
typedef void (APIENTRY * glVertexAttrib1sPROC) (GLuint index, GLshort x);
typedef void (APIENTRY * glVertexAttrib1fPROC) (GLuint index, GLfloat x);
typedef void (APIENTRY * glVertexAttrib2sPROC) (GLuint index, GLshort x, GLshort y);
typedef void (APIENTRY * glVertexAttrib2fPROC) (GLuint index, GLfloat x, GLfloat y);
typedef void (APIENTRY * glVertexAttrib3sPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
typedef void (APIENTRY * glVertexAttrib3fPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
typedef void (APIENTRY * glVertexAttrib4sPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
typedef void (APIENTRY * glVertexAttrib4fPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
typedef void (APIENTRY * glVertexAttrib4NubPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
typedef void (APIENTRY * glVertexAttrib1svPROC) (GLuint index, const GLshort *v);
typedef void (APIENTRY * glVertexAttrib1fvPROC) (GLuint index, const GLfloat *v);
typedef void (APIENTRY * glVertexAttrib2svPROC) (GLuint index, const GLshort *v);
typedef void (APIENTRY * glVertexAttrib2fvPROC) (GLuint index, const GLfloat *v);
typedef void (APIENTRY * glVertexAttrib2dvPROC) (GLuint index, const GLdouble *v);
typedef void (APIENTRY * glVertexAttrib3svPROC) (GLuint index, const GLshort *v);
typedef void (APIENTRY * glVertexAttrib3fvPROC) (GLuint index, const GLfloat *v);
typedef void (APIENTRY * glVertexAttrib3dvPROC) (GLuint index, const GLdouble *v);
typedef void (APIENTRY * glVertexAttrib4bvPROC) (GLuint index, const GLbyte *v);
typedef void (APIENTRY * glVertexAttrib4svPROC) (GLuint index, const GLshort *v);
typedef void (APIENTRY * glVertexAttrib4ivPROC) (GLuint index, const GLint *v);
typedef void (APIENTRY * glVertexAttrib4ubvPROC) (GLuint index, const GLubyte *v);
typedef void (APIENTRY * glVertexAttrib4usvPROC) (GLuint index, const GLushort *v);
typedef void (APIENTRY * glVertexAttrib4uivPROC) (GLuint index, const GLuint *v);
typedef void (APIENTRY * glVertexAttrib4fvPROC) (GLuint index, const GLfloat *v);
typedef void (APIENTRY * glVertexAttrib4dvPROC) (GLuint index, const GLdouble *v);
typedef void (APIENTRY * glVertexAttrib4NbvPROC) (GLuint index, const GLbyte *v);
typedef void (APIENTRY * glVertexAttrib4NsvPROC) (GLuint index, const GLshort *v);
typedef void (APIENTRY * glVertexAttrib4NivPROC) (GLuint index, const GLint *v);
typedef void (APIENTRY * glVertexAttrib4NubvPROC) (GLuint index, const GLubyte *v);
typedef void (APIENTRY * glVertexAttrib4NusvPROC) (GLuint index, const GLushort *v);
typedef void (APIENTRY * glVertexAttrib4NuivPROC) (GLuint index, const GLuint *v);
typedef void (APIENTRY * glVertexAttribPointerPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
typedef void (APIENTRY * glEnableVertexAttribArrayPROC) (GLuint index);
typedef void (APIENTRY * glDisableVertexAttribArrayPROC) (GLuint index);
typedef void (APIENTRY * glGetVertexAttribdvPROC) (GLuint index, GLenum pname, GLdouble *params);
typedef void (APIENTRY * glGetVertexAttribfvPROC) (GLuint index, GLenum pname, GLfloat *params);
typedef void (APIENTRY * glGetVertexAttribivPROC) (GLuint index, GLenum pname, GLint *params);
typedef void (APIENTRY * glGetVertexAttribPointervPROC) (GLuint index, GLenum pname, GLvoid **pointer);
// ARB_vertex_shader
typedef void (APIENTRY * glBindAttribLocationPROC) (GLuint program, GLuint index, const GLchar *name);
typedef void (APIENTRY * glGetActiveAttribPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, const GLchar *name);
@ -100,8 +140,11 @@ typedef GLint (APIENTRY * glGetAttribLocationPROC) (GLuint program, const GLchar
// ARB_draw_buffers
typedef void (APIENTRY * glDrawBuffersPROC) (GLsizei n, const GLenum *bufs);
// Two-Sided Stencil
typedef void (APIENTRY * glStencilFuncSeparatePROC) (GLenum face, GLenum func, GLint ref, GLuint mask);
typedef void (APIENTRY * glStencilOpSeparatePROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
typedef void (APIENTRY * glStencilFuncSeparatePROC) (GLenum face, GLenum func, GLint ref, GLuint mask);
typedef void (APIENTRY * glStencilMaskSeparatePROC) (GLenum face, GLuint mask);
// EXT_blend_equation_separate
typedef void (APIENTRY * glBlendEquationSeparatePROC) (GLenum modeRGB, GLenum modeAlpha);
// ARB_shader_objects
static glAttachShaderPROC glAttachShader;
@ -148,6 +191,22 @@ static glUniformMatrix3fvPROC glUniformMatrix3fv;
static glUniformMatrix4fvPROC glUniformMatrix4fv;
static glUseProgramPROC glUseProgram;
static glValidateProgramPROC glValidateProgram;
// ARB_vertex_program
static glVertexAttrib1sPROC glVertexAttrib1s;
static glVertexAttrib1fPROC glVertexAttrib1f;
static glVertexAttrib2sPROC glVertexAttrib2s;
static glVertexAttrib2fPROC glVertexAttrib2f;
static glVertexAttrib3sPROC glVertexAttrib3s;
static glVertexAttrib3fPROC glVertexAttrib3f;
static glVertexAttrib4sPROC glVertexAttrib4s;
static glVertexAttrib4fPROC glVertexAttrib4f;
static glVertexAttrib4NubPROC glVertexAttrib4Nub;
static glVertexAttribPointerPROC glVertexAttribPointer;
static glEnableVertexAttribArrayPROC glEnableVertexAttribArray;
static glDisableVertexAttribArrayPROC glDisableVertexAttribArray;
static glGetVertexAttribfvPROC glGetVertexAttribfv;
static glGetVertexAttribivPROC glGetVertexAttribiv;
static glGetVertexAttribPointervPROC glGetVertexAttribPointerv;
// ARB_vertex_shader
static glBindAttribLocationPROC glBindAttribLocation;
static glGetActiveAttribPROC glGetActiveAttrib;
@ -155,8 +214,11 @@ static glGetAttribLocationPROC glGetAttribLocation;
// ARB_draw_buffers
static glDrawBuffersPROC glDrawBuffers;
// Two-Sided Stencil
static glStencilFuncSeparatePROC glStencilFuncSeparate;
static glStencilOpSeparatePROC glStencilOpSeparate;
static glStencilFuncSeparatePROC glStencilFuncSeparate;
static glStencilMaskSeparatePROC glStencilMaskSeparate;
// EXT_blend_equation_separate
static glBlendEquationSeparatePROC glBlendEquationSeparate;
// ------------------------------------------------------------------
// ----------------------[ ARB_shader_objects ]----------------------
@ -685,6 +747,191 @@ static void JNICALL Java_org_lwjgl_opengl_GL20_nglGetShaderSource
}
}
// ------------------------------------------------------------------
// ----------------------[ ARB_vertex_program ]----------------------
// ------------------------------------------------------------------
/*
* Class: org.lwjgl.opengl.GL20
* Method: glVertexAttrib1s
*/
static void JNICALL Java_org_lwjgl_opengl_GL20_glVertexAttrib1s
(JNIEnv * env, jclass clazz, jint index, jshort x)
{
glVertexAttrib1s(index, x);
}
/*
* Class: org.lwjgl.opengl.GL20
* Method: glVertexAttrib1f
*/
static void JNICALL Java_org_lwjgl_opengl_GL20_glVertexAttrib1f
(JNIEnv * env, jclass clazz, jint index, jfloat x)
{
glVertexAttrib1f(index, x);
}
/*
* Class: org.lwjgl.opengl.GL20
* Method: glVertexAttrib2s
*/
static void JNICALL Java_org_lwjgl_opengl_GL20_glVertexAttrib2s
(JNIEnv * env, jclass clazz, jint index, jshort x, jshort y)
{
glVertexAttrib2s(index, x, y);
}
/*
* Class: org.lwjgl.opengl.GL20
* Method: glVertexAttrib2f
*/
static void JNICALL Java_org_lwjgl_opengl_GL20_glVertexAttrib2f
(JNIEnv * env, jclass clazz, jint index, jfloat x, jfloat y)
{
glVertexAttrib2f(index, x, y);
}
/*
* Class: org.lwjgl.opengl.GL20
* Method: glVertexAttrib3s
*/
static void JNICALL Java_org_lwjgl_opengl_GL20_glVertexAttrib3s
(JNIEnv * env, jclass clazz, jint index, jshort x, jshort y, jshort z)
{
glVertexAttrib3s(index, x, y, z);
}
/*
* Class: org.lwjgl.opengl.GL20
* Method: glVertexAttrib3f
*/
static void JNICALL Java_org_lwjgl_opengl_GL20_glVertexAttrib3f
(JNIEnv * env, jclass clazz, jint index, jfloat x, jfloat y, jfloat z)
{
glVertexAttrib3f(index, x, y, z);
}
/*
* Class: org.lwjgl.opengl.GL20
* Method: glVertexAttrib4s
*/
static void JNICALL Java_org_lwjgl_opengl_GL20_glVertexAttrib4s
(JNIEnv * env, jclass clazz, jint index, jshort x, jshort y, jshort z, jshort w)
{
glVertexAttrib4s(index, x, y, z, w);
}
/*
* Class: org.lwjgl.opengl.GL20
* Method: glVertexAttrib4f
*/
static void JNICALL Java_org_lwjgl_opengl_GL20_glVertexAttrib4f
(JNIEnv * env, jclass clazz, jint index, jfloat x, jfloat y, jfloat z, jfloat w)
{
glVertexAttrib4f(index, x, y, z, w);
}
/*
* Class: org.lwjgl.opengl.GL20
* Method: glVertexAttrib4Nub
*/
static void JNICALL Java_org_lwjgl_opengl_GL20_glVertexAttrib4Nub
(JNIEnv * env, jclass clazz, jint index, jbyte x, jbyte y, jbyte z, jbyte w)
{
glVertexAttrib4Nub(index, x, y, z, w);
}
/*
* Class: org.lwjgl.opengl.GL20
* Method: nglVertexAttribPointer
*/
static void JNICALL Java_org_lwjgl_opengl_GL20_nglVertexAttribPointer
(JNIEnv * env, jclass clazz, jint index, jint size, jint type, jboolean normalized, jint stride, jobject buffer, jint bufferOffset)
{
GLvoid *buffer_ptr = (GLvoid *)((GLubyte *)(*env)->GetDirectBufferAddress(env, buffer) + bufferOffset);
glVertexAttribPointer(index, size, type, normalized, stride, buffer_ptr);
}
/*
* Class: org.lwjgl.opengl.GL20
* Method: nglVertexAttribPointerVBO
*/
static void JNICALL Java_org_lwjgl_opengl_GL20_nglVertexAttribPointerVBO
(JNIEnv * env, jclass clazz, jint index, jint size, jint type, jboolean normalized, jint stride, jint bufferOffset)
{
glVertexAttribPointer(index, size, type, normalized, stride, (GLvoid *)bufferOffset);
}
/*
* Class: org.lwjgl.opengl.GL20
* Method: glEnableVertexAttribArray
*/
static void JNICALL Java_org_lwjgl_opengl_GL20_glEnableVertexAttribArray
(JNIEnv * env, jclass clazz, jint index)
{
glEnableVertexAttribArray(index);
}
/*
* Class: org.lwjgl.opengl.GL20
* Method: glDisableVertexAttribArray
*/
static void JNICALL Java_org_lwjgl_opengl_GL20_glDisableVertexAttribArray
(JNIEnv * env, jclass clazz, jint index)
{
glDisableVertexAttribArray(index);
}
/*
* Class: org.lwjgl.opengl.GL20
* Method: nglGetVertexAttribfv
*/
static void JNICALL Java_org_lwjgl_opengl_GL20_nglGetVertexAttribfv
(JNIEnv * env, jclass clazz, jint index, jint pname, jobject params, jint paramsOffset)
{
GLfloat *params_ptr = (GLfloat *)(*env)->GetDirectBufferAddress(env, params) + paramsOffset;
glGetVertexAttribfv(index, pname, params_ptr);
}
/*
* Class: org.lwjgl.opengl.GL20
* Method: nglGetVertexAttribiv
*/
static void JNICALL Java_org_lwjgl_opengl_GL20_nglGetVertexAttribiv
(JNIEnv * env, jclass clazz, jint index, jint pname, jobject params, jint paramsOffset)
{
GLint *params_ptr = (GLint *)(*env)->GetDirectBufferAddress(env, params) + paramsOffset;
glGetVertexAttribiv(index, pname, params_ptr);
}
/*
* Class: org.lwjgl.opengl.GL20
* Method: glGetVertexAttribPointer
*/
static jobject JNICALL Java_org_lwjgl_opengl_GL20_glGetVertexAttribPointer
(JNIEnv * env, jclass clazz, jint index, jint pname, jint size)
{
void *address;
glGetVertexAttribPointerv((GLuint)index, (GLuint)pname, &address);
return safeNewBuffer(env, address, size);
}
// ------------------------------------------------------------------
// ----------------------[ ARB_vertex_shaders ]----------------------
// ------------------------------------------------------------------
@ -748,6 +995,16 @@ static void JNICALL Java_org_lwjgl_opengl_GL20_nglDrawBuffers
// ----------------------[ Two-Sided Stencil ]----------------------
// -----------------------------------------------------------------
/*
* Class: org.lwjgl.opengl.GL20
* Method: glStencilOpSeparate
*/
static void JNICALL Java_org_lwjgl_opengl_GL20_glStencilOpSeparate
(JNIEnv * env, jclass clazz, jint face, jint sfail, jint dpfail, jint dppass)
{
glStencilOpSeparate(face, sfail, dpfail, dppass);
}
/*
* Class: org.lwjgl.opengl.GL20
* Method: glStencilFuncSeparate
@ -760,12 +1017,26 @@ static void JNICALL Java_org_lwjgl_opengl_GL20_glStencilFuncSeparate
/*
* Class: org.lwjgl.opengl.GL20
* Method: glStencilOpSeparate
* Method: glStencilMaskSeparate
*/
static void JNICALL Java_org_lwjgl_opengl_GL20_glStencilOpSeparate
(JNIEnv * env, jclass clazz, jint face, jint sfail, jint dpfail, jint dppass)
static void JNICALL Java_org_lwjgl_opengl_GL20_glStencilMaskSeparate
(JNIEnv * env, jclass clazz, jint face, jint mask)
{
glStencilOpSeparate(face, sfail, dpfail, dppass);
glStencilMaskSeparate(face, mask);
}
// -----------------------------------------------------------------
// ----------------------[ EXT_blend_equation_separate ]----------------------
// -----------------------------------------------------------------
/*
* Class: org.lwjgl.opengl.GL20
* Method: glBlendEquationSeparate
*/
static void JNICALL Java_org_lwjgl_opengl_GL20_glBlendEquationSeparate
(JNIEnv * env, jclass clazz, jint modeRGB, jint modeAlpha)
{
glBlendEquationSeparate(modeRGB, modeAlpha);
}
#ifdef __cplusplus
@ -820,6 +1091,23 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_initNativeStubs(JNIEnv *env, j
{"nglGetUniformfv", "(IILjava/nio/FloatBuffer;I)V", (void*)&Java_org_lwjgl_opengl_GL20_nglGetUniformfv, "glGetUniformfv", (void*)&glGetUniformfv},
{"nglGetUniformiv", "(IILjava/nio/IntBuffer;I)V", (void*)&Java_org_lwjgl_opengl_GL20_nglGetUniformiv, "glGetUniformiv", (void*)&glGetUniformiv},
{"nglGetShaderSource", "(IILjava/nio/IntBuffer;ILjava/nio/ByteBuffer;I)V", (void*)&Java_org_lwjgl_opengl_GL20_nglGetShaderSource, "glGetShaderSource", (void*)&glGetShaderSource},
// ARB_vertex_program
{"glVertexAttrib1s", "(IS)V", (void*)&Java_org_lwjgl_opengl_GL20_glVertexAttrib1s, "glVertexAttrib1s", (void*)&glVertexAttrib1s},
{"glVertexAttrib1f", "(IF)V", (void*)&Java_org_lwjgl_opengl_GL20_glVertexAttrib1f, "glVertexAttrib1f", (void*)&glVertexAttrib1f},
{"glVertexAttrib2s", "(ISS)V", (void*)&Java_org_lwjgl_opengl_GL20_glVertexAttrib2s, "glVertexAttrib2s", (void*)&glVertexAttrib2s},
{"glVertexAttrib2f", "(IFF)V", (void*)&Java_org_lwjgl_opengl_GL20_glVertexAttrib2f, "glVertexAttrib2f", (void*)&glVertexAttrib2f},
{"glVertexAttrib3s", "(ISSS)V", (void*)&Java_org_lwjgl_opengl_GL20_glVertexAttrib3s, "glVertexAttrib3s", (void*)&glVertexAttrib3s},
{"glVertexAttrib3f", "(IFFF)V", (void*)&Java_org_lwjgl_opengl_GL20_glVertexAttrib3f, "glVertexAttrib3f", (void*)&glVertexAttrib3f},
{"glVertexAttrib4s", "(ISSSS)V", (void*)&Java_org_lwjgl_opengl_GL20_glVertexAttrib4s, "glVertexAttrib4s", (void*)&glVertexAttrib4s},
{"glVertexAttrib4f", "(IFFFF)V", (void*)&Java_org_lwjgl_opengl_GL20_glVertexAttrib4f, "glVertexAttrib4f", (void*)&glVertexAttrib4f},
{"glVertexAttrib4Nub", "(IBBBB)V", (void*)&Java_org_lwjgl_opengl_GL20_glVertexAttrib4Nub, "glVertexAttrib4Nub", (void*)&glVertexAttrib4Nub},
{"nglVertexAttribPointer", "(IIIZILjava/nio/Buffer;I)V", (void*)&Java_org_lwjgl_opengl_GL20_nglVertexAttribPointer, "glVertexAttribPointer", (void*)&glVertexAttribPointer},
{"nglVertexAttribPointerVBO", "(IIIZII)V", (void*)&Java_org_lwjgl_opengl_GL20_nglVertexAttribPointerVBO, NULL, NULL},
{"glEnableVertexAttribArray", "(I)V", (void*)&Java_org_lwjgl_opengl_GL20_glEnableVertexAttribArray, "glEnableVertexAttribArray", (void*)&glEnableVertexAttribArray},
{"glDisableVertexAttribArray", "(I)V", (void*)&Java_org_lwjgl_opengl_GL20_glDisableVertexAttribArray, "glDisableVertexAttribArray", (void*)&glDisableVertexAttribArray},
{"nglGetVertexAttribfv", "(IILjava/nio/FloatBuffer;I)V", (void*)&Java_org_lwjgl_opengl_GL20_nglGetVertexAttribfv, "glGetVertexAttribfv", (void*)&glGetVertexAttribfv},
{"nglGetVertexAttribiv", "(IILjava/nio/IntBuffer;I)V", (void*)&Java_org_lwjgl_opengl_GL20_nglGetVertexAttribiv, "glGetVertexAttribiv", (void*)&glGetVertexAttribiv},
{"glGetVertexAttribPointer", "(III)Ljava/nio/ByteBuffer;", (void*)&Java_org_lwjgl_opengl_GL20_glGetVertexAttribPointer, "glGetVertexAttribPointerv", (void*)&glGetVertexAttribPointerv},
// ARB_vertex_shader
{"nglBindAttribLocation", "(IILjava/nio/ByteBuffer;I)V", (void*)&Java_org_lwjgl_opengl_GL20_nglBindAttribLocation, "glBindAttribLocation", (void*)&glBindAttribLocation},
{"nglGetActiveAttrib", "(IIILjava/nio/IntBuffer;ILjava/nio/IntBuffer;ILjava/nio/IntBuffer;ILjava/nio/ByteBuffer;I)V", (void*)&Java_org_lwjgl_opengl_GL20_nglGetActiveAttrib, "glGetActiveAttrib", (void*)&glGetActiveAttrib},
@ -827,8 +1115,11 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_initNativeStubs(JNIEnv *env, j
// ARB_draw_buffers
{"nglDrawBuffers", "(ILjava/nio/IntBuffer;I)V", (void*)&Java_org_lwjgl_opengl_GL20_nglDrawBuffers, "glDrawBuffers", (void*)&glDrawBuffers},
// Two-Sided Stencil
{"glStencilOpSeparate", "(IIII)V", (void*)&Java_org_lwjgl_opengl_GL20_glStencilOpSeparate, "glStencilOpSeparate", (void*)&glStencilOpSeparate},
{"glStencilFuncSeparate", "(IIII)V", (void*)&Java_org_lwjgl_opengl_GL20_glStencilFuncSeparate, "glStencilFuncSeparate", (void*)&glStencilFuncSeparate},
{"glStencilOpSeparate", "(IIII)V", (void*)&Java_org_lwjgl_opengl_GL20_glStencilOpSeparate, "glStencilOpSeparate", (void*)&glStencilOpSeparate}
{"glStencilMaskSeparate", "(II)V", (void*)&Java_org_lwjgl_opengl_GL20_glStencilMaskSeparate, "glStencilMaskSeparate", (void*)&glStencilMaskSeparate},
// EXT_blend_equation_separate
{"glBlendEquationSeparate", "(II)V", (void*)&Java_org_lwjgl_opengl_GL20_glBlendEquationSeparate, "glBlendEquationSeparate", (void*)&glBlendEquationSeparate}
};
int num_functions = NUMFUNCTIONS(functions);
extgl_InitializeClass(env, clazz, num_functions, functions);