You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(134) |
Sep
(52) |
Oct
(13) |
Nov
(342) |
Dec
(163) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(44) |
Feb
(62) |
Mar
(158) |
Apr
(38) |
May
(70) |
Jun
(58) |
Jul
(104) |
Aug
(207) |
Sep
(83) |
Oct
(122) |
Nov
(23) |
Dec
(49) |
| 2004 |
Jan
(119) |
Feb
(132) |
Mar
(192) |
Apr
(140) |
May
(77) |
Jun
(74) |
Jul
(201) |
Aug
(63) |
Sep
(102) |
Oct
(70) |
Nov
(173) |
Dec
(78) |
| 2005 |
Jan
(174) |
Feb
(197) |
Mar
(105) |
Apr
(59) |
May
(77) |
Jun
(43) |
Jul
(21) |
Aug
(18) |
Sep
(47) |
Oct
(37) |
Nov
(74) |
Dec
(50) |
| 2006 |
Jan
(44) |
Feb
(19) |
Mar
(32) |
Apr
(24) |
May
(31) |
Jun
(55) |
Jul
(138) |
Aug
(28) |
Sep
(12) |
Oct
(41) |
Nov
(58) |
Dec
(24) |
| 2007 |
Jan
(28) |
Feb
(14) |
Mar
(10) |
Apr
(68) |
May
(30) |
Jun
(26) |
Jul
(18) |
Aug
(63) |
Sep
(19) |
Oct
(29) |
Nov
(20) |
Dec
(10) |
| 2008 |
Jan
(38) |
Feb
(7) |
Mar
(37) |
Apr
(120) |
May
(41) |
Jun
(36) |
Jul
(39) |
Aug
(24) |
Sep
(28) |
Oct
(30) |
Nov
(36) |
Dec
(75) |
| 2009 |
Jan
(46) |
Feb
(22) |
Mar
(50) |
Apr
(70) |
May
(134) |
Jun
(105) |
Jul
(75) |
Aug
(34) |
Sep
(38) |
Oct
(34) |
Nov
(19) |
Dec
(20) |
| 2010 |
Jan
(11) |
Feb
(20) |
Mar
(65) |
Apr
(83) |
May
(104) |
Jun
(73) |
Jul
(78) |
Aug
(57) |
Sep
(43) |
Oct
(35) |
Nov
(9) |
Dec
(4) |
| 2011 |
Jan
(21) |
Feb
(11) |
Mar
(18) |
Apr
(10) |
May
(18) |
Jun
(15) |
Jul
(48) |
Aug
(25) |
Sep
(17) |
Oct
(45) |
Nov
(15) |
Dec
(12) |
| 2012 |
Jan
(21) |
Feb
(9) |
Mar
(12) |
Apr
(9) |
May
(9) |
Jun
(5) |
Jul
(1) |
Aug
(10) |
Sep
(12) |
Oct
(1) |
Nov
(28) |
Dec
(5) |
| 2013 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
| 2016 |
Jan
(2) |
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
1
(1) |
2
(4) |
3
|
4
|
5
|
|
6
|
7
(2) |
8
(3) |
9
(5) |
10
|
11
(4) |
12
|
|
13
(2) |
14
(2) |
15
(2) |
16
(9) |
17
|
18
|
19
|
|
20
|
21
(7) |
22
(4) |
23
(4) |
24
|
25
(10) |
26
|
|
27
(4) |
28
(16) |
29
(14) |
30
(11) |
31
(1) |
|
|
|
From: Brian M. <ma...@us...> - 2005-03-16 21:18:49
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27724/src/java/org/lwjgl Modified Files: Sys.java Log Message: updated version string to 96 Index: Sys.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/Sys.java,v retrieving revision 1.82 retrieving revision 1.83 diff -u -d -r1.82 -r1.83 --- Sys.java 13 Mar 2005 20:12:31 -0000 1.82 +++ Sys.java 16 Mar 2005 21:18:40 -0000 1.83 @@ -48,7 +48,7 @@ public final class Sys { /** Current version of library */ - public static final String VERSION = "0.95"; + public static final String VERSION = "0.96"; /** The native library name */ private static final String LIBRARY_NAME = "lwjgl"; |
|
From: Brian M. <ma...@us...> - 2005-03-16 21:13:39
|
Update of /cvsroot/java-game-lib/LWJGL In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26458 Modified Files: build.xml Log Message: no need to generate headers for Sys and AWTGLCanvas Index: build.xml =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/build.xml,v retrieving revision 1.70 retrieving revision 1.71 diff -u -d -r1.70 -r1.71 --- build.xml 15 Mar 2005 03:53:43 -0000 1.70 +++ build.xml 16 Mar 2005 21:13:29 -0000 1.71 @@ -584,9 +584,7 @@ </javah> <!-- lwjgl --> <javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.headers}" force="yes"> - <class name="org.lwjgl.opengl.AWTGLCanvas" /> <class name="org.lwjgl.opengl.AWTSurfaceLock" /> - <class name="org.lwjgl.Sys" /> <class name="org.lwjgl.DefaultSysImplementation" /> <class name="org.lwjgl.input.Cursor" /> <class name="org.lwjgl.input.Keyboard" /> |
|
From: Elias N. <eli...@us...> - 2005-03-16 11:47:35
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21455/src/native/common Modified Files: org_lwjgl_opengl_GL20.c Log Message: Sync generated source files Index: org_lwjgl_opengl_GL20.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_opengl_GL20.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- org_lwjgl_opengl_GL20.c 11 Mar 2005 16:18:16 -0000 1.8 +++ org_lwjgl_opengl_GL20.c 16 Mar 2005 11:47:24 -0000 1.9 @@ -3,252 +3,260 @@ #include <jni.h> #include "extgl.h" -typedef void (APIENTRY *glShaderSourcePROC) (GLuint shader, GLsizei count, const GLchar ** string, const GLint* length); -typedef GLint (APIENTRY *glCreateShaderPROC) (GLuint type); -typedef GLboolean (APIENTRY *glIsShaderPROC) (GLuint shader); -typedef void (APIENTRY *glCompileShaderPROC) (GLuint shader); -typedef void (APIENTRY *glDeleteShaderPROC) (GLuint shader); -typedef GLint (APIENTRY *glCreateProgramPROC) (); -typedef GLboolean (APIENTRY *glIsProgramPROC) (GLint program); -typedef void (APIENTRY *glAttachShaderPROC) (GLuint program, GLuint shader); -typedef void (APIENTRY *glDetachShaderPROC) (GLuint program, GLuint shader); -typedef void (APIENTRY *glLinkProgramPROC) (GLuint program); -typedef void (APIENTRY *glUseProgramPROC) (GLuint program); -typedef void (APIENTRY *glValidateProgramPROC) (GLuint program); -typedef void (APIENTRY *glDeleteProgramPROC) (GLuint program); -typedef void (APIENTRY *glUniform1fPROC) (GLint location, GLfloat v0); -typedef void (APIENTRY *glUniform2fPROC) (GLint location, GLfloat v0, GLfloat v1); -typedef void (APIENTRY *glUniform3fPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (APIENTRY *glUniform4fPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (APIENTRY *glUniform1iPROC) (GLint location, GLint v0); -typedef void (APIENTRY *glUniform2iPROC) (GLint location, GLint v0, GLint v1); -typedef void (APIENTRY *glUniform3iPROC) (GLint location, GLint v0, GLint v1, GLint v2); -typedef void (APIENTRY *glUniform4iPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (APIENTRY *glUniform1fvPROC) (GLint location, GLsizei count, GLfloat * values); -typedef void (APIENTRY *glUniform2fvPROC) (GLint location, GLsizei count, GLfloat * values); -typedef void (APIENTRY *glUniform3fvPROC) (GLint location, GLsizei count, GLfloat * values); -typedef void (APIENTRY *glUniform4fvPROC) (GLint location, GLsizei count, GLfloat * values); -typedef void (APIENTRY *glUniform1ivPROC) (GLint location, GLsizei count, GLint * values); -typedef void (APIENTRY *glUniform2ivPROC) (GLint location, GLsizei count, GLint * values); -typedef void (APIENTRY *glUniform3ivPROC) (GLint location, GLsizei count, GLint * values); -typedef void (APIENTRY *glUniform4ivPROC) (GLint location, GLsizei count, GLint * values); -typedef void (APIENTRY *glUniformMatrix2fvPROC) (GLint location, GLsizei count, GLboolean transpose, GLfloat * matrices); -typedef void (APIENTRY *glUniformMatrix3fvPROC) (GLint location, GLsizei count, GLboolean transpose, GLfloat * matrices); -typedef void (APIENTRY *glUniformMatrix4fvPROC) (GLint location, GLsizei count, GLboolean transpose, GLfloat * matrices); -typedef void (APIENTRY *glGetShaderivPROC) (GLuint shader, GLenum pname, GLint * params); -typedef void (APIENTRY *glGetProgramivPROC) (GLuint program, GLenum pname, GLint * params); -typedef void (APIENTRY *glGetShaderInfoLogPROC) (GLuint shader, GLsizei maxLength, GLsizei * length, GLchar * infoLog); -typedef void (APIENTRY *glGetProgramInfoLogPROC) (GLuint program, GLsizei maxLength, GLsizei * length, GLchar * infoLog); -typedef void (APIENTRY *glGetAttachedShadersPROC) (GLuint program, GLsizei maxCount, GLsizei * count, GLuint * shaders); -typedef GLint (APIENTRY *glGetUniformLocationPROC) (GLuint program, const GLchar * name); -typedef void (APIENTRY *glGetActiveUniformPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei * length, GLsizei * size, GLenum * type, GLchar * name); -typedef void (APIENTRY *glGetUniformfvPROC) (GLuint program, GLint location, GLfloat * params); -typedef void (APIENTRY *glGetUniformivPROC) (GLuint program, GLint location, GLint * params); -typedef void (APIENTRY *glGetShaderSourcePROC) (GLuint shader, GLsizei maxLength, GLsizei * length, GLchar * source); -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 *glVertexAttribPointerPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * buffer); -typedef void (APIENTRY *glEnableVertexAttribArrayPROC) (GLuint index); -typedef void (APIENTRY *glDisableVertexAttribArrayPROC) (GLuint index); -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); -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); -typedef GLint (APIENTRY *glGetAttribLocationPROC) (GLuint program, const GLchar * name); -typedef void (APIENTRY *glDrawBuffersPROC) (GLsizei size, const GLenum * buffers); -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); typedef void (APIENTRY *glBlendEquationSeparatePROC) (GLenum modeRGB, GLenum modeAlpha); +typedef void (APIENTRY *glStencilMaskSeparatePROC) (GLenum face, GLuint mask); +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 *glDrawBuffersPROC) (GLsizei size, const GLenum * buffers); +typedef GLint (APIENTRY *glGetAttribLocationPROC) (GLuint program, const GLchar * name); +typedef void (APIENTRY *glGetActiveAttribPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei * length, GLint * size, GLenum * type, const GLchar * name); +typedef void (APIENTRY *glBindAttribLocationPROC) (GLuint program, GLuint index, const GLchar * name); +typedef void (APIENTRY *glGetVertexAttribPointervPROC) (GLuint index, GLenum pname, GLvoid ** pointer); +typedef void (APIENTRY *glGetVertexAttribivPROC) (GLuint index, GLenum pname, GLint * params); +typedef void (APIENTRY *glGetVertexAttribfvPROC) (GLuint index, GLenum pname, GLfloat * params); +typedef void (APIENTRY *glDisableVertexAttribArrayPROC) (GLuint index); +typedef void (APIENTRY *glEnableVertexAttribArrayPROC) (GLuint index); +typedef void (APIENTRY *glVertexAttribPointerPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * buffer); +typedef void (APIENTRY *glVertexAttrib4NubPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (APIENTRY *glVertexAttrib4fPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRY *glVertexAttrib4sPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRY *glVertexAttrib3fPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY *glVertexAttrib3sPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRY *glVertexAttrib2fPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (APIENTRY *glVertexAttrib2sPROC) (GLuint index, GLshort x, GLshort y); +typedef void (APIENTRY *glVertexAttrib1fPROC) (GLuint index, GLfloat x); +typedef void (APIENTRY *glVertexAttrib1sPROC) (GLuint index, GLshort x); +typedef void (APIENTRY *glGetShaderSourcePROC) (GLuint shader, GLsizei maxLength, GLsizei * length, GLchar * source); +typedef void (APIENTRY *glGetUniformivPROC) (GLuint program, GLint location, GLint * params); +typedef void (APIENTRY *glGetUniformfvPROC) (GLuint program, GLint location, GLfloat * params); +typedef void (APIENTRY *glGetActiveUniformPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei * length, GLsizei * size, GLenum * type, GLchar * name); +typedef GLint (APIENTRY *glGetUniformLocationPROC) (GLuint program, const GLchar * name); +typedef void (APIENTRY *glGetAttachedShadersPROC) (GLuint program, GLsizei maxCount, GLsizei * count, GLuint * shaders); +typedef void (APIENTRY *glGetProgramInfoLogPROC) (GLuint program, GLsizei maxLength, GLsizei * length, GLchar * infoLog); +typedef void (APIENTRY *glGetShaderInfoLogPROC) (GLuint shader, GLsizei maxLength, GLsizei * length, GLchar * infoLog); +typedef void (APIENTRY *glGetProgramivPROC) (GLuint program, GLenum pname, GLint * params); +typedef void (APIENTRY *glGetShaderivPROC) (GLuint shader, GLenum pname, GLint * params); +typedef void (APIENTRY *glUniformMatrix4fvPROC) (GLint location, GLsizei count, GLboolean transpose, GLfloat * matrices); +typedef void (APIENTRY *glUniformMatrix3fvPROC) (GLint location, GLsizei count, GLboolean transpose, GLfloat * matrices); +typedef void (APIENTRY *glUniformMatrix2fvPROC) (GLint location, GLsizei count, GLboolean transpose, GLfloat * matrices); +typedef void (APIENTRY *glUniform4ivPROC) (GLint location, GLsizei count, GLint * values); +typedef void (APIENTRY *glUniform3ivPROC) (GLint location, GLsizei count, GLint * values); +typedef void (APIENTRY *glUniform2ivPROC) (GLint location, GLsizei count, GLint * values); +typedef void (APIENTRY *glUniform1ivPROC) (GLint location, GLsizei count, GLint * values); +typedef void (APIENTRY *glUniform4fvPROC) (GLint location, GLsizei count, GLfloat * values); +typedef void (APIENTRY *glUniform3fvPROC) (GLint location, GLsizei count, GLfloat * values); +typedef void (APIENTRY *glUniform2fvPROC) (GLint location, GLsizei count, GLfloat * values); +typedef void (APIENTRY *glUniform1fvPROC) (GLint location, GLsizei count, GLfloat * values); +typedef void (APIENTRY *glUniform4iPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (APIENTRY *glUniform3iPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (APIENTRY *glUniform2iPROC) (GLint location, GLint v0, GLint v1); +typedef void (APIENTRY *glUniform1iPROC) (GLint location, GLint v0); +typedef void (APIENTRY *glUniform4fPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (APIENTRY *glUniform3fPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (APIENTRY *glUniform2fPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (APIENTRY *glUniform1fPROC) (GLint location, GLfloat v0); +typedef void (APIENTRY *glDeleteProgramPROC) (GLuint program); +typedef void (APIENTRY *glValidateProgramPROC) (GLuint program); +typedef void (APIENTRY *glUseProgramPROC) (GLuint program); +typedef void (APIENTRY *glLinkProgramPROC) (GLuint program); +typedef void (APIENTRY *glDetachShaderPROC) (GLuint program, GLuint shader); +typedef void (APIENTRY *glAttachShaderPROC) (GLuint program, GLuint shader); +typedef GLboolean (APIENTRY *glIsProgramPROC) (GLint program); +typedef GLint (APIENTRY *glCreateProgramPROC) (); +typedef void (APIENTRY *glDeleteShaderPROC) (GLuint shader); +typedef void (APIENTRY *glCompileShaderPROC) (GLuint shader); +typedef GLboolean (APIENTRY *glIsShaderPROC) (GLuint shader); +typedef GLint (APIENTRY *glCreateShaderPROC) (GLuint type); +typedef void (APIENTRY *glShaderSourcePROC) (GLuint shader, GLsizei count, const GLchar ** string, const GLint* length); -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglShaderSource(JNIEnv *env, jclass clazz, jint shader, jint count, jobject string, jint string_position, jint length, jlong function_pointer) { - const GLchar *string_address = ((const GLchar *)(*env)->GetDirectBufferAddress(env, string)) + string_position; - glShaderSourcePROC glShaderSource = (glShaderSourcePROC)((intptr_t)function_pointer); - glShaderSource(shader, count, &string_address, &length); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GL20_nglCreateShader(JNIEnv *env, jclass clazz, jint type, jlong function_pointer) { - glCreateShaderPROC glCreateShader = (glCreateShaderPROC)((intptr_t)function_pointer); - GLint __result = glCreateShader(type); - return __result; +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglBlendEquationSeparate(JNIEnv *env, jclass clazz, jint modeRGB, jint modeAlpha, jlong function_pointer) { + glBlendEquationSeparatePROC glBlendEquationSeparate = (glBlendEquationSeparatePROC)((intptr_t)function_pointer); + glBlendEquationSeparate(modeRGB, modeAlpha); } -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_GL20_nglIsShader(JNIEnv *env, jclass clazz, jint shader, jlong function_pointer) { - glIsShaderPROC glIsShader = (glIsShaderPROC)((intptr_t)function_pointer); - GLboolean __result = glIsShader(shader); - return __result; +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglStencilMaskSeparate(JNIEnv *env, jclass clazz, jint face, jint mask, jlong function_pointer) { + glStencilMaskSeparatePROC glStencilMaskSeparate = (glStencilMaskSeparatePROC)((intptr_t)function_pointer); + glStencilMaskSeparate(face, mask); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglCompileShader(JNIEnv *env, jclass clazz, jint shader, jlong function_pointer) { - glCompileShaderPROC glCompileShader = (glCompileShaderPROC)((intptr_t)function_pointer); - glCompileShader(shader); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglStencilFuncSeparate(JNIEnv *env, jclass clazz, jint face, jint func, jint ref, jint mask, jlong function_pointer) { + glStencilFuncSeparatePROC glStencilFuncSeparate = (glStencilFuncSeparatePROC)((intptr_t)function_pointer); + glStencilFuncSeparate(face, func, ref, mask); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglDeleteShader(JNIEnv *env, jclass clazz, jint shader, jlong function_pointer) { - glDeleteShaderPROC glDeleteShader = (glDeleteShaderPROC)((intptr_t)function_pointer); - glDeleteShader(shader); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglStencilOpSeparate(JNIEnv *env, jclass clazz, jint face, jint sfail, jint dpfail, jint dppass, jlong function_pointer) { + glStencilOpSeparatePROC glStencilOpSeparate = (glStencilOpSeparatePROC)((intptr_t)function_pointer); + glStencilOpSeparate(face, sfail, dpfail, dppass); } -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GL20_nglCreateProgram(JNIEnv *env, jclass clazz, jlong function_pointer) { - glCreateProgramPROC glCreateProgram = (glCreateProgramPROC)((intptr_t)function_pointer); - GLint __result = glCreateProgram(); - return __result; +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglDrawBuffers(JNIEnv *env, jclass clazz, jint size, jobject buffers, jint buffers_position, jlong function_pointer) { + const GLenum *buffers_address = ((const GLenum *)(*env)->GetDirectBufferAddress(env, buffers)) + buffers_position; + glDrawBuffersPROC glDrawBuffers = (glDrawBuffersPROC)((intptr_t)function_pointer); + glDrawBuffers(size, buffers_address); } -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_GL20_nglIsProgram(JNIEnv *env, jclass clazz, jint program, jlong function_pointer) { - glIsProgramPROC glIsProgram = (glIsProgramPROC)((intptr_t)function_pointer); - GLboolean __result = glIsProgram(program); +JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GL20_nglGetAttribLocation(JNIEnv *env, jclass clazz, jint program, jobject name, jint name_position, jlong function_pointer) { + const GLchar *name_address = ((const GLchar *)(*env)->GetDirectBufferAddress(env, name)) + name_position; + glGetAttribLocationPROC glGetAttribLocation = (glGetAttribLocationPROC)((intptr_t)function_pointer); + GLint __result = glGetAttribLocation(program, name_address); return __result; } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglAttachShader(JNIEnv *env, jclass clazz, jint program, jint shader, jlong function_pointer) { - glAttachShaderPROC glAttachShader = (glAttachShaderPROC)((intptr_t)function_pointer); - glAttachShader(program, shader); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetActiveAttrib(JNIEnv *env, jclass clazz, jint program, jint index, jint maxLength, jobject length, jint length_position, jobject size, jint size_position, jobject type, jint type_position, jobject name, jint name_position, jlong function_pointer) { + GLsizei *length_address = ((GLsizei *)safeGetBufferAddress(env, length)) + length_position; + GLint *size_address = ((GLint *)(*env)->GetDirectBufferAddress(env, size)) + size_position; + GLenum *type_address = ((GLenum *)(*env)->GetDirectBufferAddress(env, type)) + type_position; + const GLchar *name_address = ((const GLchar *)(*env)->GetDirectBufferAddress(env, name)) + name_position; + glGetActiveAttribPROC glGetActiveAttrib = (glGetActiveAttribPROC)((intptr_t)function_pointer); + glGetActiveAttrib(program, index, maxLength, length_address, size_address, type_address, name_address); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglDetachShader(JNIEnv *env, jclass clazz, jint program, jint shader, jlong function_pointer) { - glDetachShaderPROC glDetachShader = (glDetachShaderPROC)((intptr_t)function_pointer); - glDetachShader(program, shader); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglBindAttribLocation(JNIEnv *env, jclass clazz, jint program, jint index, jobject name, jint name_position, jlong function_pointer) { + const GLchar *name_address = ((const GLchar *)(*env)->GetDirectBufferAddress(env, name)) + name_position; + glBindAttribLocationPROC glBindAttribLocation = (glBindAttribLocationPROC)((intptr_t)function_pointer); + glBindAttribLocation(program, index, name_address); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglLinkProgram(JNIEnv *env, jclass clazz, jint program, jlong function_pointer) { - glLinkProgramPROC glLinkProgram = (glLinkProgramPROC)((intptr_t)function_pointer); - glLinkProgram(program); +JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_GL20_nglGetVertexAttribPointerv(JNIEnv *env, jclass clazz, jint index, jint pname, jint result_size, jlong function_pointer) { + glGetVertexAttribPointervPROC glGetVertexAttribPointerv = (glGetVertexAttribPointervPROC)((intptr_t)function_pointer); + GLvoid * __result; + glGetVertexAttribPointerv(index, pname, &__result); + return safeNewBuffer(env, __result, result_size); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUseProgram(JNIEnv *env, jclass clazz, jint program, jlong function_pointer) { - glUseProgramPROC glUseProgram = (glUseProgramPROC)((intptr_t)function_pointer); - glUseProgram(program); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetVertexAttribiv(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; + glGetVertexAttribivPROC glGetVertexAttribiv = (glGetVertexAttribivPROC)((intptr_t)function_pointer); + glGetVertexAttribiv(index, pname, params_address); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglValidateProgram(JNIEnv *env, jclass clazz, jint program, jlong function_pointer) { - glValidateProgramPROC glValidateProgram = (glValidateProgramPROC)((intptr_t)function_pointer); - glValidateProgram(program); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetVertexAttribfv(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; + glGetVertexAttribfvPROC glGetVertexAttribfv = (glGetVertexAttribfvPROC)((intptr_t)function_pointer); + glGetVertexAttribfv(index, pname, params_address); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglDeleteProgram(JNIEnv *env, jclass clazz, jint program, jlong function_pointer) { - glDeleteProgramPROC glDeleteProgram = (glDeleteProgramPROC)((intptr_t)function_pointer); - glDeleteProgram(program); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglDisableVertexAttribArray(JNIEnv *env, jclass clazz, jint index, jlong function_pointer) { + glDisableVertexAttribArrayPROC glDisableVertexAttribArray = (glDisableVertexAttribArrayPROC)((intptr_t)function_pointer); + glDisableVertexAttribArray(index); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform1f(JNIEnv *env, jclass clazz, jint location, jfloat v0, jlong function_pointer) { - glUniform1fPROC glUniform1f = (glUniform1fPROC)((intptr_t)function_pointer); - glUniform1f(location, v0); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglEnableVertexAttribArray(JNIEnv *env, jclass clazz, jint index, jlong function_pointer) { + glEnableVertexAttribArrayPROC glEnableVertexAttribArray = (glEnableVertexAttribArrayPROC)((intptr_t)function_pointer); + glEnableVertexAttribArray(index); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform2f(JNIEnv *env, jclass clazz, jint location, jfloat v0, jfloat v1, jlong function_pointer) { - glUniform2fPROC glUniform2f = (glUniform2fPROC)((intptr_t)function_pointer); - glUniform2f(location, v0, v1); +JNIEXPORT 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 buffer_position, jlong function_pointer) { + const GLvoid *buffer_address = ((const GLvoid *)(((char *)(*env)->GetDirectBufferAddress(env, buffer)) + buffer_position)); + glVertexAttribPointerPROC glVertexAttribPointer = (glVertexAttribPointerPROC)((intptr_t)function_pointer); + glVertexAttribPointer(index, size, type, normalized, stride, buffer_address); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform3f(JNIEnv *env, jclass clazz, jint location, jfloat v0, jfloat v1, jfloat v2, jlong function_pointer) { - glUniform3fPROC glUniform3f = (glUniform3fPROC)((intptr_t)function_pointer); - glUniform3f(location, v0, v1, v2); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglVertexAttribPointerBO(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)); + glVertexAttribPointerPROC glVertexAttribPointer = (glVertexAttribPointerPROC)((intptr_t)function_pointer); + glVertexAttribPointer(index, size, type, normalized, stride, buffer_address); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform4f(JNIEnv *env, jclass clazz, jint location, jfloat v0, jfloat v1, jfloat v2, jfloat v3, jlong function_pointer) { - glUniform4fPROC glUniform4f = (glUniform4fPROC)((intptr_t)function_pointer); - glUniform4f(location, v0, v1, v2, v3); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglVertexAttrib4Nub(JNIEnv *env, jclass clazz, jint index, jbyte x, jbyte y, jbyte z, jbyte w, jlong function_pointer) { + glVertexAttrib4NubPROC glVertexAttrib4Nub = (glVertexAttrib4NubPROC)((intptr_t)function_pointer); + glVertexAttrib4Nub(index, x, y, z, w); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform1i(JNIEnv *env, jclass clazz, jint location, jint v0, jlong function_pointer) { - glUniform1iPROC glUniform1i = (glUniform1iPROC)((intptr_t)function_pointer); - glUniform1i(location, v0); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglVertexAttrib4f(JNIEnv *env, jclass clazz, jint index, jfloat x, jfloat y, jfloat z, jfloat w, jlong function_pointer) { + glVertexAttrib4fPROC glVertexAttrib4f = (glVertexAttrib4fPROC)((intptr_t)function_pointer); + glVertexAttrib4f(index, x, y, z, w); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform2i(JNIEnv *env, jclass clazz, jint location, jint v0, jint v1, jlong function_pointer) { - glUniform2iPROC glUniform2i = (glUniform2iPROC)((intptr_t)function_pointer); - glUniform2i(location, v0, v1); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglVertexAttrib4s(JNIEnv *env, jclass clazz, jint index, jshort x, jshort y, jshort z, jshort w, jlong function_pointer) { + glVertexAttrib4sPROC glVertexAttrib4s = (glVertexAttrib4sPROC)((intptr_t)function_pointer); + glVertexAttrib4s(index, x, y, z, w); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform3i(JNIEnv *env, jclass clazz, jint location, jint v0, jint v1, jint v2, jlong function_pointer) { - glUniform3iPROC glUniform3i = (glUniform3iPROC)((intptr_t)function_pointer); - glUniform3i(location, v0, v1, v2); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglVertexAttrib3f(JNIEnv *env, jclass clazz, jint index, jfloat x, jfloat y, jfloat z, jlong function_pointer) { + glVertexAttrib3fPROC glVertexAttrib3f = (glVertexAttrib3fPROC)((intptr_t)function_pointer); + glVertexAttrib3f(index, x, y, z); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform4i(JNIEnv *env, jclass clazz, jint location, jint v0, jint v1, jint v2, jint v3, jlong function_pointer) { - glUniform4iPROC glUniform4i = (glUniform4iPROC)((intptr_t)function_pointer); - glUniform4i(location, v0, v1, v2, v3); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglVertexAttrib3s(JNIEnv *env, jclass clazz, jint index, jshort x, jshort y, jshort z, jlong function_pointer) { + glVertexAttrib3sPROC glVertexAttrib3s = (glVertexAttrib3sPROC)((intptr_t)function_pointer); + glVertexAttrib3s(index, x, y, z); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform1fv(JNIEnv *env, jclass clazz, jint location, jint count, jobject values, jint values_position, jlong function_pointer) { - GLfloat *values_address = ((GLfloat *)(*env)->GetDirectBufferAddress(env, values)) + values_position; - glUniform1fvPROC glUniform1fv = (glUniform1fvPROC)((intptr_t)function_pointer); - glUniform1fv(location, count, values_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglVertexAttrib2f(JNIEnv *env, jclass clazz, jint index, jfloat x, jfloat y, jlong function_pointer) { + glVertexAttrib2fPROC glVertexAttrib2f = (glVertexAttrib2fPROC)((intptr_t)function_pointer); + glVertexAttrib2f(index, x, y); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform2fv(JNIEnv *env, jclass clazz, jint location, jint count, jobject values, jint values_position, jlong function_pointer) { - GLfloat *values_address = ((GLfloat *)(*env)->GetDirectBufferAddress(env, values)) + values_position; - glUniform2fvPROC glUniform2fv = (glUniform2fvPROC)((intptr_t)function_pointer); - glUniform2fv(location, count, values_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglVertexAttrib2s(JNIEnv *env, jclass clazz, jint index, jshort x, jshort y, jlong function_pointer) { + glVertexAttrib2sPROC glVertexAttrib2s = (glVertexAttrib2sPROC)((intptr_t)function_pointer); + glVertexAttrib2s(index, x, y); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform3fv(JNIEnv *env, jclass clazz, jint location, jint count, jobject values, jint values_position, jlong function_pointer) { - GLfloat *values_address = ((GLfloat *)(*env)->GetDirectBufferAddress(env, values)) + values_position; - glUniform3fvPROC glUniform3fv = (glUniform3fvPROC)((intptr_t)function_pointer); - glUniform3fv(location, count, values_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglVertexAttrib1f(JNIEnv *env, jclass clazz, jint index, jfloat x, jlong function_pointer) { + glVertexAttrib1fPROC glVertexAttrib1f = (glVertexAttrib1fPROC)((intptr_t)function_pointer); + glVertexAttrib1f(index, x); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform4fv(JNIEnv *env, jclass clazz, jint location, jint count, jobject values, jint values_position, jlong function_pointer) { - GLfloat *values_address = ((GLfloat *)(*env)->GetDirectBufferAddress(env, values)) + values_position; - glUniform4fvPROC glUniform4fv = (glUniform4fvPROC)((intptr_t)function_pointer); - glUniform4fv(location, count, values_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglVertexAttrib1s(JNIEnv *env, jclass clazz, jint index, jshort x, jlong function_pointer) { + glVertexAttrib1sPROC glVertexAttrib1s = (glVertexAttrib1sPROC)((intptr_t)function_pointer); + glVertexAttrib1s(index, x); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform1iv(JNIEnv *env, jclass clazz, jint location, jint count, jobject values, jint values_position, jlong function_pointer) { - GLint *values_address = ((GLint *)(*env)->GetDirectBufferAddress(env, values)) + values_position; - glUniform1ivPROC glUniform1iv = (glUniform1ivPROC)((intptr_t)function_pointer); - glUniform1iv(location, count, values_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetShaderSource(JNIEnv *env, jclass clazz, jint shader, jint maxLength, jobject length, jint length_position, jobject source, jint source_position, jlong function_pointer) { + GLsizei *length_address = ((GLsizei *)safeGetBufferAddress(env, length)) + length_position; + GLchar *source_address = ((GLchar *)(*env)->GetDirectBufferAddress(env, source)) + source_position; + glGetShaderSourcePROC glGetShaderSource = (glGetShaderSourcePROC)((intptr_t)function_pointer); + glGetShaderSource(shader, maxLength, length_address, source_address); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform2iv(JNIEnv *env, jclass clazz, jint location, jint count, jobject values, jint values_position, jlong function_pointer) { - GLint *values_address = ((GLint *)(*env)->GetDirectBufferAddress(env, values)) + values_position; - glUniform2ivPROC glUniform2iv = (glUniform2ivPROC)((intptr_t)function_pointer); - glUniform2iv(location, count, values_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetUniformiv(JNIEnv *env, jclass clazz, jint program, jint location, jobject params, jint params_position, jlong function_pointer) { + GLint *params_address = ((GLint *)(*env)->GetDirectBufferAddress(env, params)) + params_position; + glGetUniformivPROC glGetUniformiv = (glGetUniformivPROC)((intptr_t)function_pointer); + glGetUniformiv(program, location, params_address); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform3iv(JNIEnv *env, jclass clazz, jint location, jint count, jobject values, jint values_position, jlong function_pointer) { - GLint *values_address = ((GLint *)(*env)->GetDirectBufferAddress(env, values)) + values_position; - glUniform3ivPROC glUniform3iv = (glUniform3ivPROC)((intptr_t)function_pointer); - glUniform3iv(location, count, values_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetUniformfv(JNIEnv *env, jclass clazz, jint program, jint location, jobject params, jint params_position, jlong function_pointer) { + GLfloat *params_address = ((GLfloat *)(*env)->GetDirectBufferAddress(env, params)) + params_position; + glGetUniformfvPROC glGetUniformfv = (glGetUniformfvPROC)((intptr_t)function_pointer); + glGetUniformfv(program, location, params_address); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform4iv(JNIEnv *env, jclass clazz, jint location, jint count, jobject values, jint values_position, jlong function_pointer) { - GLint *values_address = ((GLint *)(*env)->GetDirectBufferAddress(env, values)) + values_position; - glUniform4ivPROC glUniform4iv = (glUniform4ivPROC)((intptr_t)function_pointer); - glUniform4iv(location, count, values_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetActiveUniform(JNIEnv *env, jclass clazz, jint program, jint index, jint maxLength, jobject length, jint length_position, jobject size, jint size_position, jobject type, jint type_position, jobject name, jint name_position, jlong function_pointer) { + GLsizei *length_address = ((GLsizei *)safeGetBufferAddress(env, length)) + length_position; + GLsizei *size_address = ((GLsizei *)(*env)->GetDirectBufferAddress(env, size)) + size_position; + GLenum *type_address = ((GLenum *)(*env)->GetDirectBufferAddress(env, type)) + type_position; + GLchar *name_address = ((GLchar *)(*env)->GetDirectBufferAddress(env, name)) + name_position; + glGetActiveUniformPROC glGetActiveUniform = (glGetActiveUniformPROC)((intptr_t)function_pointer); + glGetActiveUniform(program, index, maxLength, length_address, size_address, type_address, name_address); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniformMatrix2fv(JNIEnv *env, jclass clazz, jint location, jint count, jboolean transpose, jobject matrices, jint matrices_position, jlong function_pointer) { - GLfloat *matrices_address = ((GLfloat *)(*env)->GetDirectBufferAddress(env, matrices)) + matrices_position; - glUniformMatrix2fvPROC glUniformMatrix2fv = (glUniformMatrix2fvPROC)((intptr_t)function_pointer); - glUniformMatrix2fv(location, count, transpose, matrices_address); +JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GL20_nglGetUniformLocation(JNIEnv *env, jclass clazz, jint program, jobject name, jint name_position, jlong function_pointer) { + const GLchar *name_address = ((const GLchar *)(*env)->GetDirectBufferAddress(env, name)) + name_position; + glGetUniformLocationPROC glGetUniformLocation = (glGetUniformLocationPROC)((intptr_t)function_pointer); + GLint __result = glGetUniformLocation(program, name_address); + return __result; } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniformMatrix3fv(JNIEnv *env, jclass clazz, jint location, jint count, jboolean transpose, jobject matrices, jint matrices_position, jlong function_pointer) { - GLfloat *matrices_address = ((GLfloat *)(*env)->GetDirectBufferAddress(env, matrices)) + matrices_position; - glUniformMatrix3fvPROC glUniformMatrix3fv = (glUniformMatrix3fvPROC)((intptr_t)function_pointer); - glUniformMatrix3fv(location, count, transpose, matrices_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetAttachedShaders(JNIEnv *env, jclass clazz, jint program, jint maxCount, jobject count, jint count_position, jobject shaders, jint shaders_position, jlong function_pointer) { + GLsizei *count_address = ((GLsizei *)safeGetBufferAddress(env, count)) + count_position; + GLuint *shaders_address = ((GLuint *)(*env)->GetDirectBufferAddress(env, shaders)) + shaders_position; + glGetAttachedShadersPROC glGetAttachedShaders = (glGetAttachedShadersPROC)((intptr_t)function_pointer); + glGetAttachedShaders(program, maxCount, count_address, shaders_address); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniformMatrix4fv(JNIEnv *env, jclass clazz, jint location, jint count, jboolean transpose, jobject matrices, jint matrices_position, jlong function_pointer) { - GLfloat *matrices_address = ((GLfloat *)(*env)->GetDirectBufferAddress(env, matrices)) + matrices_position; - glUniformMatrix4fvPROC glUniformMatrix4fv = (glUniformMatrix4fvPROC)((intptr_t)function_pointer); - glUniformMatrix4fv(location, count, transpose, matrices_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetProgramInfoLog(JNIEnv *env, jclass clazz, jint program, jint maxLength, jobject length, jint length_position, jobject infoLog, jint infoLog_position, jlong function_pointer) { + GLsizei *length_address = ((GLsizei *)safeGetBufferAddress(env, length)) + length_position; + GLchar *infoLog_address = ((GLchar *)(*env)->GetDirectBufferAddress(env, infoLog)) + infoLog_position; + glGetProgramInfoLogPROC glGetProgramInfoLog = (glGetProgramInfoLogPROC)((intptr_t)function_pointer); + glGetProgramInfoLog(program, maxLength, length_address, infoLog_address); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetShaderiv(JNIEnv *env, jclass clazz, jint shader, jint pname, jobject params, jint params_position, jlong function_pointer) { - GLint *params_address = ((GLint *)(*env)->GetDirectBufferAddress(env, params)) + params_position; - glGetShaderivPROC glGetShaderiv = (glGetShaderivPROC)((intptr_t)function_pointer); - glGetShaderiv(shader, pname, params_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetShaderInfoLog(JNIEnv *env, jclass clazz, jint shader, jint maxLength, jobject length, jint length_position, jobject infoLog, jint infoLog_position, jlong function_pointer) { + GLsizei *length_address = ((GLsizei *)safeGetBufferAddress(env, length)) + length_position; + GLchar *infoLog_address = ((GLchar *)(*env)->GetDirectBufferAddress(env, infoLog)) + infoLog_position; + glGetShaderInfoLogPROC glGetShaderInfoLog = (glGetShaderInfoLogPROC)((intptr_t)function_pointer); + glGetShaderInfoLog(shader, maxLength, length_address, infoLog_address); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetProgramiv(JNIEnv *env, jclass clazz, jint program, jint pname, jobject params, jint params_position, jlong function_pointer) { @@ -257,193 +265,185 @@ glGetProgramiv(program, pname, params_address); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetShaderInfoLog(JNIEnv *env, jclass clazz, jint shader, jint maxLength, jobject length, jint length_position, jobject infoLog, jint infoLog_position, jlong function_pointer) { - GLsizei *length_address = ((GLsizei *)safeGetBufferAddress(env, length)) + length_position; - GLchar *infoLog_address = ((GLchar *)(*env)->GetDirectBufferAddress(env, infoLog)) + infoLog_position; - glGetShaderInfoLogPROC glGetShaderInfoLog = (glGetShaderInfoLogPROC)((intptr_t)function_pointer); - glGetShaderInfoLog(shader, maxLength, length_address, infoLog_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetShaderiv(JNIEnv *env, jclass clazz, jint shader, jint pname, jobject params, jint params_position, jlong function_pointer) { + GLint *params_address = ((GLint *)(*env)->GetDirectBufferAddress(env, params)) + params_position; + glGetShaderivPROC glGetShaderiv = (glGetShaderivPROC)((intptr_t)function_pointer); + glGetShaderiv(shader, pname, params_address); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetProgramInfoLog(JNIEnv *env, jclass clazz, jint program, jint maxLength, jobject length, jint length_position, jobject infoLog, jint infoLog_position, jlong function_pointer) { - GLsizei *length_address = ((GLsizei *)safeGetBufferAddress(env, length)) + length_position; - GLchar *infoLog_address = ((GLchar *)(*env)->GetDirectBufferAddress(env, infoLog)) + infoLog_position; - glGetProgramInfoLogPROC glGetProgramInfoLog = (glGetProgramInfoLogPROC)((intptr_t)function_pointer); - glGetProgramInfoLog(program, maxLength, length_address, infoLog_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniformMatrix4fv(JNIEnv *env, jclass clazz, jint location, jint count, jboolean transpose, jobject matrices, jint matrices_position, jlong function_pointer) { + GLfloat *matrices_address = ((GLfloat *)(*env)->GetDirectBufferAddress(env, matrices)) + matrices_position; + glUniformMatrix4fvPROC glUniformMatrix4fv = (glUniformMatrix4fvPROC)((intptr_t)function_pointer); + glUniformMatrix4fv(location, count, transpose, matrices_address); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetAttachedShaders(JNIEnv *env, jclass clazz, jint program, jint maxCount, jobject count, jint count_position, jobject shaders, jint shaders_position, jlong function_pointer) { - GLsizei *count_address = ((GLsizei *)safeGetBufferAddress(env, count)) + count_position; - GLuint *shaders_address = ((GLuint *)(*env)->GetDirectBufferAddress(env, shaders)) + shaders_position; - glGetAttachedShadersPROC glGetAttachedShaders = (glGetAttachedShadersPROC)((intptr_t)function_pointer); - glGetAttachedShaders(program, maxCount, count_address, shaders_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniformMatrix3fv(JNIEnv *env, jclass clazz, jint location, jint count, jboolean transpose, jobject matrices, jint matrices_position, jlong function_pointer) { + GLfloat *matrices_address = ((GLfloat *)(*env)->GetDirectBufferAddress(env, matrices)) + matrices_position; + glUniformMatrix3fvPROC glUniformMatrix3fv = (glUniformMatrix3fvPROC)((intptr_t)function_pointer); + glUniformMatrix3fv(location, count, transpose, matrices_address); } -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GL20_nglGetUniformLocation(JNIEnv *env, jclass clazz, jint program, jobject name, jint name_position, jlong function_pointer) { - const GLchar *name_address = ((const GLchar *)(*env)->GetDirectBufferAddress(env, name)) + name_position; - glGetUniformLocationPROC glGetUniformLocation = (glGetUniformLocationPROC)((intptr_t)function_pointer); - GLint __result = glGetUniformLocation(program, name_address); - return __result; +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniformMatrix2fv(JNIEnv *env, jclass clazz, jint location, jint count, jboolean transpose, jobject matrices, jint matrices_position, jlong function_pointer) { + GLfloat *matrices_address = ((GLfloat *)(*env)->GetDirectBufferAddress(env, matrices)) + matrices_position; + glUniformMatrix2fvPROC glUniformMatrix2fv = (glUniformMatrix2fvPROC)((intptr_t)function_pointer); + glUniformMatrix2fv(location, count, transpose, matrices_address); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetActiveUniform(JNIEnv *env, jclass clazz, jint program, jint index, jint maxLength, jobject length, jint length_position, jobject size, jint size_position, jobject type, jint type_position, jobject name, jint name_position, jlong function_pointer) { - GLsizei *length_address = ((GLsizei *)safeGetBufferAddress(env, length)) + length_position; - GLsizei *size_address = ((GLsizei *)(*env)->GetDirectBufferAddress(env, size)) + size_position; - GLenum *type_address = ((GLenum *)(*env)->GetDirectBufferAddress(env, type)) + type_position; - GLchar *name_address = ((GLchar *)(*env)->GetDirectBufferAddress(env, name)) + name_position; - glGetActiveUniformPROC glGetActiveUniform = (glGetActiveUniformPROC)((intptr_t)function_pointer); - glGetActiveUniform(program, index, maxLength, length_address, size_address, type_address, name_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform4iv(JNIEnv *env, jclass clazz, jint location, jint count, jobject values, jint values_position, jlong function_pointer) { + GLint *values_address = ((GLint *)(*env)->GetDirectBufferAddress(env, values)) + values_position; + glUniform4ivPROC glUniform4iv = (glUniform4ivPROC)((intptr_t)function_pointer); + glUniform4iv(location, count, values_address); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetUniformfv(JNIEnv *env, jclass clazz, jint program, jint location, jobject params, jint params_position, jlong function_pointer) { - GLfloat *params_address = ((GLfloat *)(*env)->GetDirectBufferAddress(env, params)) + params_position; - glGetUniformfvPROC glGetUniformfv = (glGetUniformfvPROC)((intptr_t)function_pointer); - glGetUniformfv(program, location, params_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform3iv(JNIEnv *env, jclass clazz, jint location, jint count, jobject values, jint values_position, jlong function_pointer) { + GLint *values_address = ((GLint *)(*env)->GetDirectBufferAddress(env, values)) + values_position; + glUniform3ivPROC glUniform3iv = (glUniform3ivPROC)((intptr_t)function_pointer); + glUniform3iv(location, count, values_address); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetUniformiv(JNIEnv *env, jclass clazz, jint program, jint location, jobject params, jint params_position, jlong function_pointer) { - GLint *params_address = ((GLint *)(*env)->GetDirectBufferAddress(env, params)) + params_position; - glGetUniformivPROC glGetUniformiv = (glGetUniformivPROC)((intptr_t)function_pointer); - glGetUniformiv(program, location, params_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform2iv(JNIEnv *env, jclass clazz, jint location, jint count, jobject values, jint values_position, jlong function_pointer) { + GLint *values_address = ((GLint *)(*env)->GetDirectBufferAddress(env, values)) + values_position; + glUniform2ivPROC glUniform2iv = (glUniform2ivPROC)((intptr_t)function_pointer); + glUniform2iv(location, count, values_address); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetShaderSource(JNIEnv *env, jclass clazz, jint shader, jint maxLength, jobject length, jint length_position, jobject source, jint source_position, jlong function_pointer) { - GLsizei *length_address = ((GLsizei *)safeGetBufferAddress(env, length)) + length_position; - GLchar *source_address = ((GLchar *)(*env)->GetDirectBufferAddress(env, source)) + source_position; - glGetShaderSourcePROC glGetShaderSource = (glGetShaderSourcePROC)((intptr_t)function_pointer); - glGetShaderSource(shader, maxLength, length_address, source_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform1iv(JNIEnv *env, jclass clazz, jint location, jint count, jobject values, jint values_position, jlong function_pointer) { + GLint *values_address = ((GLint *)(*env)->GetDirectBufferAddress(env, values)) + values_position; + glUniform1ivPROC glUniform1iv = (glUniform1ivPROC)((intptr_t)function_pointer); + glUniform1iv(location, count, values_address); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglVertexAttrib1s(JNIEnv *env, jclass clazz, jint index, jshort x, jlong function_pointer) { - glVertexAttrib1sPROC glVertexAttrib1s = (glVertexAttrib1sPROC)((intptr_t)function_pointer); - glVertexAttrib1s(index, x); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform4fv(JNIEnv *env, jclass clazz, jint location, jint count, jobject values, jint values_position, jlong function_pointer) { + GLfloat *values_address = ((GLfloat *)(*env)->GetDirectBufferAddress(env, values)) + values_position; + glUniform4fvPROC glUniform4fv = (glUniform4fvPROC)((intptr_t)function_pointer); + glUniform4fv(location, count, values_address); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglVertexAttrib1f(JNIEnv *env, jclass clazz, jint index, jfloat x, jlong function_pointer) { - glVertexAttrib1fPROC glVertexAttrib1f = (glVertexAttrib1fPROC)((intptr_t)function_pointer); - glVertexAttrib1f(index, x); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform3fv(JNIEnv *env, jclass clazz, jint location, jint count, jobject values, jint values_position, jlong function_pointer) { + GLfloat *values_address = ((GLfloat *)(*env)->GetDirectBufferAddress(env, values)) + values_position; + glUniform3fvPROC glUniform3fv = (glUniform3fvPROC)((intptr_t)function_pointer); + glUniform3fv(location, count, values_address); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglVertexAttrib2s(JNIEnv *env, jclass clazz, jint index, jshort x, jshort y, jlong function_pointer) { - glVertexAttrib2sPROC glVertexAttrib2s = (glVertexAttrib2sPROC)((intptr_t)function_pointer); - glVertexAttrib2s(index, x, y); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform2fv(JNIEnv *env, jclass clazz, jint location, jint count, jobject values, jint values_position, jlong function_pointer) { + GLfloat *values_address = ((GLfloat *)(*env)->GetDirectBufferAddress(env, values)) + values_position; + glUniform2fvPROC glUniform2fv = (glUniform2fvPROC)((intptr_t)function_pointer); + glUniform2fv(location, count, values_address); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglVertexAttrib2f(JNIEnv *env, jclass clazz, jint index, jfloat x, jfloat y, jlong function_pointer) { - glVertexAttrib2fPROC glVertexAttrib2f = (glVertexAttrib2fPROC)((intptr_t)function_pointer); - glVertexAttrib2f(index, x, y); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform1fv(JNIEnv *env, jclass clazz, jint location, jint count, jobject values, jint values_position, jlong function_pointer) { + GLfloat *values_address = ((GLfloat *)(*env)->GetDirectBufferAddress(env, values)) + values_position; + glUniform1fvPROC glUniform1fv = (glUniform1fvPROC)((intptr_t)function_pointer); + glUniform1fv(location, count, values_address); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglVertexAttrib3s(JNIEnv *env, jclass clazz, jint index, jshort x, jshort y, jshort z, jlong function_pointer) { - glVertexAttrib3sPROC glVertexAttrib3s = (glVertexAttrib3sPROC)((intptr_t)function_pointer); - glVertexAttrib3s(index, x, y, z); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform4i(JNIEnv *env, jclass clazz, jint location, jint v0, jint v1, jint v2, jint v3, jlong function_pointer) { + glUniform4iPROC glUniform4i = (glUniform4iPROC)((intptr_t)function_pointer); + glUniform4i(location, v0, v1, v2, v3); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglVertexAttrib3f(JNIEnv *env, jclass clazz, jint index, jfloat x, jfloat y, jfloat z, jlong function_pointer) { - glVertexAttrib3fPROC glVertexAttrib3f = (glVertexAttrib3fPROC)((intptr_t)function_pointer); - glVertexAttrib3f(index, x, y, z); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform3i(JNIEnv *env, jclass clazz, jint location, jint v0, jint v1, jint v2, jlong function_pointer) { + glUniform3iPROC glUniform3i = (glUniform3iPROC)((intptr_t)function_pointer); + glUniform3i(location, v0, v1, v2); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglVertexAttrib4s(JNIEnv *env, jclass clazz, jint index, jshort x, jshort y, jshort z, jshort w, jlong function_pointer) { - glVertexAttrib4sPROC glVertexAttrib4s = (glVertexAttrib4sPROC)((intptr_t)function_pointer); - glVertexAttrib4s(index, x, y, z, w); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform2i(JNIEnv *env, jclass clazz, jint location, jint v0, jint v1, jlong function_pointer) { + glUniform2iPROC glUniform2i = (glUniform2iPROC)((intptr_t)function_pointer); + glUniform2i(location, v0, v1); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglVertexAttrib4f(JNIEnv *env, jclass clazz, jint index, jfloat x, jfloat y, jfloat z, jfloat w, jlong function_pointer) { - glVertexAttrib4fPROC glVertexAttrib4f = (glVertexAttrib4fPROC)((intptr_t)function_pointer); - glVertexAttrib4f(index, x, y, z, w); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform1i(JNIEnv *env, jclass clazz, jint location, jint v0, jlong function_pointer) { + glUniform1iPROC glUniform1i = (glUniform1iPROC)((intptr_t)function_pointer); + glUniform1i(location, v0); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglVertexAttrib4Nub(JNIEnv *env, jclass clazz, jint index, jbyte x, jbyte y, jbyte z, jbyte w, jlong function_pointer) { - glVertexAttrib4NubPROC glVertexAttrib4Nub = (glVertexAttrib4NubPROC)((intptr_t)function_pointer); - glVertexAttrib4Nub(index, x, y, z, w); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform4f(JNIEnv *env, jclass clazz, jint location, jfloat v0, jfloat v1, jfloat v2, jfloat v3, jlong function_pointer) { + glUniform4fPROC glUniform4f = (glUniform4fPROC)((intptr_t)function_pointer); + glUniform4f(location, v0, v1, v2, v3); } -JNIEXPORT 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 buffer_position, jlong function_pointer) { - const GLvoid *buffer_address = ((const GLvoid *)(((char *)(*env)->GetDirectBufferAddress(env, buffer)) + buffer_position)); - glVertexAttribPointerPROC glVertexAttribPointer = (glVertexAttribPointerPROC)((intptr_t)function_pointer); - glVertexAttribPointer(index, size, type, normalized, stride, buffer_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform3f(JNIEnv *env, jclass clazz, jint location, jfloat v0, jfloat v1, jfloat v2, jlong function_pointer) { + glUniform3fPROC glUniform3f = (glUniform3fPROC)((intptr_t)function_pointer); + glUniform3f(location, v0, v1, v2); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglVertexAttribPointerBO(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)); - glVertexAttribPointerPROC glVertexAttribPointer = (glVertexAttribPointerPROC)((intptr_t)function_pointer); - glVertexAttribPointer(index, size, type, normalized, stride, buffer_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform2f(JNIEnv *env, jclass clazz, jint location, jfloat v0, jfloat v1, jlong function_pointer) { + glUniform2fPROC glUniform2f = (glUniform2fPROC)((intptr_t)function_pointer); + glUniform2f(location, v0, v1); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglEnableVertexAttribArray(JNIEnv *env, jclass clazz, jint index, jlong function_pointer) { - glEnableVertexAttribArrayPROC glEnableVertexAttribArray = (glEnableVertexAttribArrayPROC)((intptr_t)function_pointer); - glEnableVertexAttribArray(index); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform1f(JNIEnv *env, jclass clazz, jint location, jfloat v0, jlong function_pointer) { + glUniform1fPROC glUniform1f = (glUniform1fPROC)((intptr_t)function_pointer); + glUniform1f(location, v0); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglDisableVertexAttribArray(JNIEnv *env, jclass clazz, jint index, jlong function_pointer) { - glDisableVertexAttribArrayPROC glDisableVertexAttribArray = (glDisableVertexAttribArrayPROC)((intptr_t)function_pointer); - glDisableVertexAttribArray(index); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglDeleteProgram(JNIEnv *env, jclass clazz, jint program, jlong function_pointer) { + glDeleteProgramPROC glDeleteProgram = (glDeleteProgramPROC)((intptr_t)function_pointer); + glDeleteProgram(program); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetVertexAttribfv(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; - glGetVertexAttribfvPROC glGetVertexAttribfv = (glGetVertexAttribfvPROC)((intptr_t)function_pointer); - glGetVertexAttribfv(index, pname, params_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglValidateProgram(JNIEnv *env, jclass clazz, jint program, jlong function_pointer) { + glValidateProgramPROC glValidateProgram = (glValidateProgramPROC)((intptr_t)function_pointer); + glValidateProgram(program); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetVertexAttribiv(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; - glGetVertexAttribivPROC glGetVertexAttribiv = (glGetVertexAttribivPROC)((intptr_t)function_pointer); - glGetVertexAttribiv(index, pname, params_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUseProgram(JNIEnv *env, jclass clazz, jint program, jlong function_pointer) { + glUseProgramPROC glUseProgram = (glUseProgramPROC)((intptr_t)function_pointer); + glUseProgram(program); } -JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_GL20_nglGetVertexAttribPointerv(JNIEnv *env, jclass clazz, jint index, jint pname, jint result_size, jlong function_pointer) { - glGetVertexAttribPointervPROC glGetVertexAttribPointerv = (glGetVertexAttribPointervPROC)((intptr_t)function_pointer); - GLvoid * __result; - glGetVertexAttribPointerv(index, pname, &__result); - return safeNewBuffer(env, __result, result_size); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglLinkProgram(JNIEnv *env, jclass clazz, jint program, jlong function_pointer) { + glLinkProgramPROC glLinkProgram = (glLinkProgramPROC)((intptr_t)function_pointer); + glLinkProgram(program); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglBindAttribLocation(JNIEnv *env, jclass clazz, jint program, jint index, jobject name, jint name_position, jlong function_pointer) { - const GLchar *name_address = ((const GLchar *)(*env)->GetDirectBufferAddress(env, name)) + name_position; - glBindAttribLocationPROC glBindAttribLocation = (glBindAttribLocationPROC)((intptr_t)function_pointer); - glBindAttribLocation(program, index, name_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglDetachShader(JNIEnv *env, jclass clazz, jint program, jint shader, jlong function_pointer) { + glDetachShaderPROC glDetachShader = (glDetachShaderPROC)((intptr_t)function_pointer); + glDetachShader(program, shader); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetActiveAttrib(JNIEnv *env, jclass clazz, jint program, jint index, jint maxLength, jobject length, jint length_position, jobject size, jint size_position, jobject type, jint type_position, jobject name, jint name_position, jlong function_pointer) { - GLsizei *length_address = ((GLsizei *)safeGetBufferAddress(env, length)) + length_position; - GLint *size_address = ((GLint *)(*env)->GetDirectBufferAddress(env, size)) + size_position; - GLenum *type_address = ((GLenum *)(*env)->GetDirectBufferAddress(env, type)) + type_position; - const GLchar *name_address = ((const GLchar *)(*env)->GetDirectBufferAddress(env, name)) + name_position; - glGetActiveAttribPROC glGetActiveAttrib = (glGetActiveAttribPROC)((intptr_t)function_pointer); - glGetActiveAttrib(program, index, maxLength, length_address, size_address, type_address, name_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglAttachShader(JNIEnv *env, jclass clazz, jint program, jint shader, jlong function_pointer) { + glAttachShaderPROC glAttachShader = (glAttachShaderPROC)((intptr_t)function_pointer); + glAttachShader(program, shader); } -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GL20_nglGetAttribLocation(JNIEnv *env, jclass clazz, jint program, jobject name, jint name_position, jlong function_pointer) { - const GLchar *name_address = ((const GLchar *)(*env)->GetDirectBufferAddress(env, name)) + name_position; - glGetAttribLocationPROC glGetAttribLocation = (glGetAttribLocationPROC)((intptr_t)function_pointer); - GLint __result = glGetAttribLocation(program, name_address); +JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_GL20_nglIsProgram(JNIEnv *env, jclass clazz, jint program, jlong function_pointer) { + glIsProgramPROC glIsProgram = (glIsProgramPROC)((intptr_t)function_pointer); + GLboolean __result = glIsProgram(program); return __result; } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglDrawBuffers(JNIEnv *env, jclass clazz, jint size, jobject buffers, jint buffers_position, jlong function_pointer) { - const GLenum *buffers_address = ((const GLenum *)(*env)->GetDirectBufferAddress(env, buffers)) + buffers_position; - glDrawBuffersPROC glDrawBuffers = (glDrawBuffersPROC)((intptr_t)function_pointer); - glDrawBuffers(size, buffers_address); +JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GL20_nglCreateProgram(JNIEnv *env, jclass clazz, jlong function_pointer) { + glCreateProgramPROC glCreateProgram = (glCreateProgramPROC)((intptr_t)function_pointer); + GLint __result = glCreateProgram(); + return __result; } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglStencilOpSeparate(JNIEnv *env, jclass clazz, jint face, jint sfail, jint dpfail, jint dppass, jlong function_pointer) { - glStencilOpSeparatePROC glStencilOpSeparate = (glStencilOpSeparatePROC)((intptr_t)function_pointer); - glStencilOpSeparate(face, sfail, dpfail, dppass); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglDeleteShader(JNIEnv *env, jclass clazz, jint shader, jlong function_pointer) { + glDeleteShaderPROC glDeleteShader = (glDeleteShaderPROC)((intptr_t)function_pointer); + glDeleteShader(shader); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglStencilFuncSeparate(JNIEnv *env, jclass clazz, jint face, jint func, jint ref, jint mask, jlong function_pointer) { - glStencilFuncSeparatePROC glStencilFuncSeparate = (glStencilFuncSepa... [truncated message content] |
|
From: Elias N. <eli...@us...> - 2005-03-16 11:47:33
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21455/src/java/org/lwjgl/opengl Modified Files: ContextCapabilities.java GL20.java Log Message: Sync generated source files Index: ContextCapabilities.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ContextCapabilities.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- ContextCapabilities.java 17 Feb 2005 12:23:38 -0000 1.5 +++ ContextCapabilities.java 16 Mar 2005 11:47:23 -0000 1.6 @@ -734,9 +734,7 @@ long GL20_glGetProgramInfoLog_pointer; long GL20_glGetShaderInfoLog_pointer; long GL20_glGetProgramiv_pointer; - long GL20_glGetProgramfv_pointer; long GL20_glGetShaderiv_pointer; - long GL20_glGetShaderfv_pointer; long GL20_glUniformMatrix4fv_pointer; long GL20_glUniformMatrix3fv_pointer; long GL20_glUniformMatrix2fv_pointer; @@ -1665,9 +1663,7 @@ (GL20_glGetProgramInfoLog_pointer = GLContext.getFunctionAddress("glGetProgramInfoLog")) != 0 && (GL20_glGetShaderInfoLog_pointer = GLContext.getFunctionAddress("glGetShaderInfoLog")) != 0 && (GL20_glGetProgramiv_pointer = GLContext.getFunctionAddress("glGetProgramiv")) != 0 && - (GL20_glGetProgramfv_pointer = GLContext.getFunctionAddress("glGetProgramfv")) != 0 && (GL20_glGetShaderiv_pointer = GLContext.getFunctionAddress("glGetShaderiv")) != 0 && - (GL20_glGetShaderfv_pointer = GLContext.getFunctionAddress("glGetShaderfv")) != 0 && (GL20_glUniformMatrix4fv_pointer = GLContext.getFunctionAddress("glUniformMatrix4fv")) != 0 && (GL20_glUniformMatrix3fv_pointer = GLContext.getFunctionAddress("glUniformMatrix3fv")) != 0 && (GL20_glUniformMatrix2fv_pointer = GLContext.getFunctionAddress("glUniformMatrix2fv")) != 0 && Index: GL20.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/GL20.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- GL20.java 11 Mar 2005 16:17:18 -0000 1.8 +++ GL20.java 16 Mar 2005 11:47:23 -0000 1.9 @@ -7,359 +7,376 @@ import java.nio.*; public final class GL20 { - public static final int GL_SHADING_LANGUAGE_VERSION = 0x8b8c; - public static final int GL_CURRENT_PROGRAM = 0x8b8d; - 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; - public static final int GL_VALIDATE_STATUS = 0x8b83; - public static final int GL_INFO_LOG_LENGTH = 0x8b84; [...1041 lines suppressed...] - public static void glBlendEquationSeparate(int modeRGB, int modeAlpha) { - long function_pointer = GLContext.getCapabilities().GL20_glBlendEquationSeparate_pointer; + /** + * The ARB_shader_objects extension allows multiple, optionally null-terminated, source strings to define a shader program. + * <p/> + * This method uses just a single string, that should NOT be null-terminated. + * @param shader + * @param string + */ + public static void glShaderSource(int shader, ByteBuffer string) { + BufferChecks.checkDirect(string); + long function_pointer = GLContext.getCapabilities().GL20_glShaderSource_pointer; BufferChecks.checkFunctionAddress(function_pointer); - nglBlendEquationSeparate(modeRGB, modeAlpha, function_pointer); + nglShaderSource(shader, 1, string, string.position(), (string.remaining()), function_pointer); } - private static native void nglBlendEquationSeparate(int modeRGB, int modeAlpha, long function_pointer); + private static native void nglShaderSource(int shader, int count, ByteBuffer string, int string_position, int length, long function_pointer); } |
|
From: Elias N. <eli...@us...> - 2005-03-16 10:59:21
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10532/src/native/win32 Modified Files: org_lwjgl_opengl_Display.c Log Message: Win32: Confine cursor to fullscreen window to prevent native cursors to stray outside borders in multi-monitor setups Index: org_lwjgl_opengl_Display.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_Display.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- org_lwjgl_opengl_Display.c 23 Feb 2005 11:42:04 -0000 1.17 +++ org_lwjgl_opengl_Display.c 16 Mar 2005 10:58:58 -0000 1.18 @@ -71,6 +71,19 @@ return display_hwnd; } +static void setupCursorClipping() { + RECT hwnd_client; + if (display_hwnd != NULL && GetWindowRect(display_hwnd, &hwnd_client) != 0) { + if (ClipCursor(&hwnd_client) == 0) + printfDebug("ClipCursor failed\n"); + } +} + +static void resetDisplayModeAndClipping(JNIEnv *env) { + resetDisplayMode(env); + ClipCursor(NULL); +} + /* * Called when the application is alt-tabbed to or from */ @@ -92,7 +105,7 @@ did_maximize = true; } else if (isFullScreen) { ShowWindow(display_hwnd, SW_SHOWMINNOACTIVE); - resetDisplayMode(NULL); + resetDisplayModeAndClipping(NULL); } inAppActivate = false; } @@ -114,6 +127,8 @@ int xPos; int yPos; int dwheel; + if (isFullScreen && !isMinimized && isFocused) + setupCursorClipping(); switch (msg) { // disable screen saver and monitor power down messages which wreak havoc case WM_SYSCOMMAND: @@ -319,6 +334,8 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Win32Display_destroyWindow(JNIEnv *env, jobject self) { closeWindow(&display_hwnd, &display_hdc); + if (isFullScreen) + ClipCursor(NULL); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Win32Display_switchDisplayMode(JNIEnv *env, jobject self, jobject mode) { @@ -326,7 +343,7 @@ } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Win32Display_resetDisplayMode(JNIEnv *env, jobject self) { - resetDisplayMode(env); + resetDisplayModeAndClipping(env); } JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_Win32Display_getGammaRampLength(JNIEnv *env, jobject self) { |
|
From: Mark B. <cap...@us...> - 2005-03-15 03:53:54
|
Update of /cvsroot/java-game-lib/LWJGL In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19573 Modified Files: build.xml Log Message: DevIL dynamic lib loading. Added some Mac and Linux code. Index: build.xml =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/build.xml,v retrieving revision 1.69 retrieving revision 1.70 diff -u -d -r1.69 -r1.70 --- build.xml 23 Feb 2005 11:11:05 -0000 1.69 +++ build.xml 15 Mar 2005 03:53:43 -0000 1.70 @@ -584,7 +584,9 @@ </javah> <!-- lwjgl --> <javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.headers}" force="yes"> + <class name="org.lwjgl.opengl.AWTGLCanvas" /> <class name="org.lwjgl.opengl.AWTSurfaceLock" /> + <class name="org.lwjgl.Sys" /> <class name="org.lwjgl.DefaultSysImplementation" /> <class name="org.lwjgl.input.Cursor" /> <class name="org.lwjgl.input.Keyboard" /> |
|
From: Mark B. <cap...@us...> - 2005-03-15 03:53:53
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/devil In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19573/src/java/org/lwjgl/devil Modified Files: IL.java ILUT.java ILU.java Log Message: DevIL dynamic lib loading. Added some Mac and Linux code. Index: ILUT.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/devil/ILUT.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ILUT.java 12 Jan 2005 12:30:34 -0000 1.1 +++ ILUT.java 15 Mar 2005 03:53:42 -0000 1.2 @@ -85,7 +85,7 @@ public static final int ILUT_OPENGL = 0; static { - System.loadLibrary("ILU"); +// System.loadLibrary("ILU"); System.loadLibrary("lwjgl-devil"); } Index: IL.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/devil/IL.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- IL.java 11 Dec 2004 01:55:49 -0000 1.6 +++ IL.java 15 Mar 2005 03:53:42 -0000 1.7 @@ -300,7 +300,7 @@ public static final int IL_EOF = -1; static { - System.loadLibrary("DevIL"); + //System.loadLibrary("DevIL"); System.loadLibrary("lwjgl-devil"); } Index: ILU.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/devil/ILU.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ILU.java 9 Jan 2005 23:59:33 -0000 1.2 +++ ILU.java 15 Mar 2005 03:53:42 -0000 1.3 @@ -82,7 +82,7 @@ // public static final int ILU_VENDOR = IL_VENDOR; static { - System.loadLibrary("ILU"); +// System.loadLibrary("ILU"); System.loadLibrary("lwjgl-devil"); } |
|
From: Caspian Rychlik-P. <ci...@us...> - 2005-03-14 11:42:57
|
Update of /cvsroot/java-game-lib/LWJGL/platform_build/win32_ms_cmdline In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19804/platform_build/win32_ms_cmdline Modified Files: build.bat Log Message: Added winmm.lib Index: build.bat =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/platform_build/win32_ms_cmdline/build.bat,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- build.bat 21 Feb 2005 14:46:41 -0000 1.16 +++ build.bat 14 Mar 2005 11:42:46 -0000 1.17 @@ -8,9 +8,9 @@ set COPTIONS=/I"%DXHOME%\include" /I"%CHOME%\include" /I"%PLTSDKHOME%\include" /I"%JAVA_HOME%\include" /I"%JAVA_HOME%\include\win32" /I"%ALHOME%\include" /I"..\..\src\native\common" /Ox /Ob2 /Oi /Ot /Oy /FD /EHsc /MT /Gy /W2 /nologo /c /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "LWJGL_EXPORTS" /D "_WINDLL" rem Can't get /DELAYLOAD to work rem set LINKEROPTS=/link /LIBPATH:"%JAVA_HOME%\lib" /LIBPATH:"%ALHOME%\libs" /LIBPATH:"%DXHOME%\Lib" /LIBPATH:"%PLTSDKHOME%\Lib" /LIBPATH:"%CHOME%\Lib" /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /MACHINE:X86 /NOLOGO /DLL /DELAYLOAD:jawt.dll -rem set LIBS=dinput.lib dxguid.lib OpenGL32.Lib Version.lib user32.lib Gdi32.lib Advapi32.lib jawt.lib delayimp.lib +rem set LIBS=dinput.lib dxguid.lib OpenGL32.Lib Version.lib user32.lib Gdi32.lib Advapi32.lib jawt.lib delayimp.lib winmm.lib set LINKEROPTS=/link /LIBPATH:"%JAVA_HOME%\lib" /LIBPATH:"%ALHOME%\libs" /LIBPATH:"%DXHOME%\Lib" /LIBPATH:"%PLTSDKHOME%\Lib" /LIBPATH:"%CHOME%\Lib" /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /MACHINE:X86 /NOLOGO /DLL -set LIBS=Kernel32.lib dinput.lib dxguid.lib OpenGL32.Lib Version.lib user32.lib Gdi32.lib Advapi32.lib jawt.lib +set LIBS=Kernel32.lib dinput.lib dxguid.lib OpenGL32.Lib Version.lib user32.lib Gdi32.lib Advapi32.lib jawt.lib winmm.lib for %%x in (..\..\src\native\win32\*.c) do cl %COPTIONS% %%x for %%x in (..\..\src\native\common\*.c) do cl %COPTIONS% %%x |
|
From: Caspian Rychlik-P. <ci...@us...> - 2005-03-14 10:56:51
|
Update of /cvsroot/java-game-lib/LWJGL/platform_build/win32_ms_cmdline In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8971/platform_build/win32_ms_cmdline Modified Files: lwjgl.build Log Message: Index: lwjgl.build =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/platform_build/win32_ms_cmdline/lwjgl.build,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- lwjgl.build 30 Jun 2004 22:38:48 -0000 1.1 +++ lwjgl.build 14 Mar 2005 10:56:37 -0000 1.2 @@ -52,6 +52,8 @@ <arg value="/DEFAULTLIB:user32.lib"/> <arg value="/DEFAULTLIB:Gdi32.lib"/> <arg value="/DEFAULTLIB:AdvApi32.lib"/> + <arg value="/DEFAULTLIB:jawt.lib"/> + <arg value="/DEFAULTLIB:winmm.lib"/> <arg value="/DLL"/> <sources> <includes name="build/*.obj" /> |
|
From: Caspian Rychlik-P. <ci...@us...> - 2005-03-13 20:13:01
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10315/src/native/win32 Modified Files: org_lwjgl_Sys.c Log Message: Removed that ugly calibration code! Now using a new kind of hires timer instead. Index: org_lwjgl_Sys.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Sys.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- org_lwjgl_Sys.c 21 Feb 2005 15:00:46 -0000 1.9 +++ org_lwjgl_Sys.c 13 Mar 2005 20:12:50 -0000 1.10 @@ -40,13 +40,11 @@ */ #include "Window.h" +#include "mmsystem.h" #include "org_lwjgl_NativeSysImplementation.h" #include "common_tools.h" #include <malloc.h> -unsigned __int64 hires_timer_freq = 0; // Hires timer frequency -unsigned __int64 hires_timer = 0; // Hires timer current time - /* * Class: org_lwjgl_Sys * Method: getTimerResolution @@ -55,8 +53,7 @@ JNIEXPORT jlong JNICALL Java_org_lwjgl_NativeSysImplementation_getTimerResolution (JNIEnv * env, jobject ignored) { - QueryPerformanceFrequency((LARGE_INTEGER*) &hires_timer_freq); - return (jlong) hires_timer_freq; + return (jlong) 1000L; } /* @@ -67,8 +64,15 @@ JNIEXPORT jlong JNICALL Java_org_lwjgl_NativeSysImplementation_getTime (JNIEnv * env, jobject ignored) { - QueryPerformanceCounter((LARGE_INTEGER*) &hires_timer); - return (jlong) hires_timer; + + MMRESULT result; + DWORD time; + + result = timeBeginPeriod(1); + time = timeGetTime(); + result = timeEndPeriod(1); + + return time; } /* |
|
From: Caspian Rychlik-P. <ci...@us...> - 2005-03-13 20:12:41
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10225/src/java/org/lwjgl Modified Files: Sys.java Log Message: Removed that ugly calibration code! Now using a new kind of hires timer instead. Index: Sys.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/Sys.java,v retrieving revision 1.81 retrieving revision 1.82 diff -u -d -r1.81 -r1.82 --- Sys.java 8 Mar 2005 23:13:50 -0000 1.81 +++ Sys.java 13 Mar 2005 20:12:31 -0000 1.82 @@ -61,62 +61,6 @@ /** The implementation instance to delegate platform specific behavior to */ private final static SysImplementation implementation; - - /* - * Timer calibration. The hires timers on some systems - notably SpeedStep chips, - * HyperThreaded chips, or dual-processor/cores, are notoriously inaccurate. We - * therefore need to calibrate the hires timer with a lowres timer that is known - * to keep much more accurate time. System.currentTimeMillis() keeps accurate time - * down to a worst-case resolution of 50ms, which is good enough for us as it means - * at worst we will have 3-4 frames at the wrong rate if a hires timer resolution - * change occurs. - */ - - /** Master control: override all our clever recalibration */ - private static final boolean OVERRIDE_CALIBRATION = Boolean.getBoolean("org.lwjgl.Sys.overrideCalibration"); - - /** Turn on debugging for calibration */ - private static final boolean DEBUG_CALIBRATION = Boolean.getBoolean("org.lwjgl.Sys.debugCalibration"); - - /** - * Timer calibration error, expressed as % variance either side of the baseline in the - * system property org.lwjhgl.Sys.timerError. 35.0% is the default. - */ - private static final double UPPER_TIMER_ERROR = 1.0 + Double.parseDouble(System.getProperty("org.lwjgl.Sys.timerError", "35.0")) / 100.0; - private static final double LOWER_TIMER_ERROR = 1.0 - Double.parseDouble(System.getProperty("org.lwjgl.Sys.timerError", "35.0")) / 100.0; - - /** Short term recalibration threshold */ - private static final long SHORT_RECALIBRATION_THRESHOLD = Long.parseLong(System.getProperty("org.lwjgl.Sys.shortRecalibrationThreshold", "50")); - - /** Long term recalibration threshold */ - private static final long LONG_RECALIBRATION_THRESHOLD = Long.parseLong(System.getProperty("org.lwjgl.Sys.longRecalibrationThreshold", "1000")); - - /** Last recalibration timer value, in milliseconds */ - private static long recalibrationThen; - - /** Current recalibration timer value, in milliseconds */ - private static long recalibrationNow; - - /** Hires time when we started counting recalibration time */ - private static long hiresRecalibrationThen; - - /** Last lowres timer time, in milliseconds */ - private static long lowresThen; - - /** Current lowres timer time, in milliseconds */ - private static long lowresNow; - - /** Last hires timer time, in ticks */ - private static long hiresThen; - - /** Current hires timer time, in ticks */ - private static long hiresNow; - - /** Baseline hires resolution */ - private static long defaultResolution; - - /** Current hires resolution */ - private static long currentResolution; static { implementation = createImplementation(); @@ -179,91 +123,7 @@ * @return timer resolution in ticks per second or 0 if no timer is present. */ public static long getTimerResolution() { - - // Check for explicit override - if (OVERRIDE_CALIBRATION) { - return implementation.getTimerResolution(); - } - - // Firstly make sure we have at least some notion of a baseline - if (defaultResolution == 0L) { - defaultResolution = implementation.getTimerResolution(); - currentResolution = defaultResolution; - if (DEBUG_CALIBRATION) { - System.err.println("Initial timer calibration "+defaultResolution+" ticks per second"); - } - } - - lowresNow = System.currentTimeMillis() & 0x7FFFFFFFFFFFFFFFL; - hiresNow = getTime(); - if (lowresNow > lowresThen + SHORT_RECALIBRATION_THRESHOLD && hiresNow > hiresThen) { - // We've had a lowres timer update. We can use this to calibrate the hires timer - // resolution. - double millis = lowresNow - lowresThen; - double ticks = hiresNow - hiresThen; - lowresThen = lowresNow; - hiresThen = hiresNow; - double ticksPerSecond = 1000.0 * ticks / millis; - // If the ticksPerSecond we've calcuated is out by more than the error % from - // the baseline resolution, we will discreetly replace the returned timer resolution - // by our calculated. If this persists for more than a second or so we will adjust - // the baseline resolution to the average that we've calculated over the second. - double errorRatio = ticksPerSecond / (double) defaultResolution; - if (errorRatio < LOWER_TIMER_ERROR || errorRatio > UPPER_TIMER_ERROR) { - // We're outside the acceptable range so we will use the newly calculated ticks - // per second. If we were already using recalibrated time, we start counting - // the ticks that pass over a certain length of time. If that duration is exceeded - // and we're still using recalibrated time, we permanently recalibrate. - - long tempResolution = (long) ticksPerSecond; - - if (DEBUG_CALIBRATION) { - System.err.println("Temporary recalibration to "+tempResolution+" ticks per second"); - } - - if (currentResolution == defaultResolution) { - // Start timing - hiresRecalibrationThen = hiresNow; - recalibrationThen = lowresNow; - recalibrationNow = lowresNow; - } else { - // Continue counting ticks - long ticksSinceRecalibration = hiresNow - hiresRecalibrationThen; - if (ticksSinceRecalibration < 0) { - // Bah. Wrapped timer, so forget it this time and start over. - hiresRecalibrationThen = hiresNow; - recalibrationThen = lowresNow; - } else { - recalibrationNow = lowresNow; - long totalMillisSinceRecalibrationStarted = recalibrationNow - recalibrationThen; - if (totalMillisSinceRecalibrationStarted > LONG_RECALIBRATION_THRESHOLD) { - // Ok, we've now been operating at a different resolution for long enough. - // Let's choose a new default resolution based on the average we've - // calculated since it first started needing recalibrating - long totalTicksSinceRecalibrationStarted = hiresNow - hiresRecalibrationThen; - if (totalTicksSinceRecalibrationStarted > 0) { - defaultResolution = (long) (1000.0 * totalTicksSinceRecalibrationStarted / totalMillisSinceRecalibrationStarted); - tempResolution = defaultResolution; - if (DEBUG_CALIBRATION) { - System.err.println("Permanent recalibration to "+defaultResolution+" ticks per second"); - } - } else { - // Bah. Once again, a wrapped timer. - hiresRecalibrationThen = hiresNow; - recalibrationThen = lowresNow; - } - } - } - } - - // Temporarily change current resolution to the recently calculated resolution - currentResolution = tempResolution; - } else { - currentResolution = defaultResolution; - } - } - - return currentResolution; + return implementation.getTimerResolution(); } /** |
|
From: Ioannis T. <sp...@us...> - 2005-03-11 16:19:15
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3667 Modified Files: GL.java GLImpl.java IGL.java Log Message: Fixed GetShader & GetProgram Index: GLImpl.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/util/GLImpl.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- GLImpl.java 15 Feb 2005 11:05:11 -0000 1.9 +++ GLImpl.java 11 Mar 2005 16:19:02 -0000 1.10 @@ -6405,15 +6405,6 @@ * @param pname * @param params */ - public void glGetShader(int shader, int pname, FloatBuffer params) { - GL.glGetShader(shader, pname, params); - } - - /** - * @param shader - * @param pname - * @param params - */ public void glGetShader(int shader, int pname, IntBuffer params) { GL.glGetShader(shader, pname, params); } @@ -6423,15 +6414,6 @@ * @param pname * @param params */ - public void glGetProgram(int program, int pname, FloatBuffer params) { - GL.glGetProgram(program, pname, params); - } - - /** - * @param program - * @param pname - * @param params - */ public void glGetProgram(int program, int pname, IntBuffer params) { GL.glGetProgram(program, pname, params); } Index: GL.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/util/GL.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- GL.java 15 Feb 2005 11:05:04 -0000 1.9 +++ GL.java 11 Mar 2005 16:19:02 -0000 1.10 @@ -3165,7 +3165,7 @@ * @param target * @param size * @param usage - */ + */ public static void glBufferData(int target, int size, int usage) { GL15.glBufferData(target, size, usage); } @@ -6574,15 +6574,6 @@ * @param pname * @param params */ - public static void glGetShader(int shader, int pname, FloatBuffer params) { - GL20.glGetShader(shader, pname, params); - } - - /** - * @param shader - * @param pname - * @param params - */ public static void glGetShader(int shader, int pname, IntBuffer params) { GL20.glGetShader(shader, pname, params); } @@ -6592,15 +6583,6 @@ * @param pname * @param params */ - public static void glGetProgram(int program, int pname, FloatBuffer params) { - GL20.glGetProgram(program, pname, params); - } - - /** - * @param program - * @param pname - * @param params - */ public static void glGetProgram(int program, int pname, IntBuffer params) { GL20.glGetProgram(program, pname, params); } Index: IGL.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/util/IGL.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- IGL.java 15 Feb 2005 11:05:12 -0000 1.8 +++ IGL.java 11 Mar 2005 16:19:02 -0000 1.9 @@ -5470,13 +5470,6 @@ * @param pname * @param params */ - void glGetShader(int shader, int pname, FloatBuffer params); - - /** - * @param shader - * @param pname - * @param params - */ void glGetShader(int shader, int pname, IntBuffer params); /** @@ -5484,13 +5477,6 @@ * @param pname * @param params */ - void glGetProgram(int program, int pname, FloatBuffer params); - - /** - * @param program - * @param pname - * @param params - */ void glGetProgram(int program, int pname, IntBuffer params); /** |
|
From: Ioannis T. <sp...@us...> - 2005-03-11 16:18:28
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3408 Modified Files: org_lwjgl_opengl_GL20.c Log Message: Fixed GetShader & GetProgram Index: org_lwjgl_opengl_GL20.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_opengl_GL20.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- org_lwjgl_opengl_GL20.c 16 Feb 2005 20:25:04 -0000 1.7 +++ org_lwjgl_opengl_GL20.c 11 Mar 2005 16:18:16 -0000 1.8 @@ -3,274 +3,246 @@ #include <jni.h> #include "extgl.h" -typedef void (APIENTRY *glBlendEquationSeparatePROC) (GLenum modeRGB, GLenum modeAlpha); -typedef void (APIENTRY *glStencilMaskSeparatePROC) (GLenum face, GLuint mask); -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 *glDrawBuffersPROC) (GLsizei size, const GLenum * buffers); -typedef GLint (APIENTRY *glGetAttribLocationPROC) (GLuint program, const GLchar * name); -typedef void (APIENTRY *glGetActiveAttribPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei * length, GLint * size, GLenum * type, const GLchar * name); -typedef void (APIENTRY *glBindAttribLocationPROC) (GLuint program, GLuint index, const GLchar * name); -typedef void (APIENTRY *glGetVertexAttribPointervPROC) (GLuint index, GLenum pname, GLvoid ** pointer); -typedef void (APIENTRY *glGetVertexAttribivPROC) (GLuint index, GLenum pname, GLint * params); -typedef void (APIENTRY *glGetVertexAttribfvPROC) (GLuint index, GLenum pname, GLfloat * params); -typedef void (APIENTRY *glDisableVertexAttribArrayPROC) (GLuint index); -typedef void (APIENTRY *glEnableVertexAttribArrayPROC) (GLuint index); -typedef void (APIENTRY *glVertexAttribPointerPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * buffer); -typedef void (APIENTRY *glVertexAttrib4NubPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -typedef void (APIENTRY *glVertexAttrib4fPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRY *glVertexAttrib4sPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRY *glVertexAttrib3fPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY *glVertexAttrib3sPROC) (GLuint index, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRY *glVertexAttrib2fPROC) (GLuint index, GLfloat x, GLfloat y); -typedef void (APIENTRY *glVertexAttrib2sPROC) (GLuint index, GLshort x, GLshort y); -typedef void (APIENTRY *glVertexAttrib1fPROC) (GLuint index, GLfloat x); -typedef void (APIENTRY *glVertexAttrib1sPROC) (GLuint index, GLshort x); -typedef void (APIENTRY *glGetShaderSourcePROC) (GLuint shader, GLsizei maxLength, GLsizei * length, GLchar * source); -typedef void (APIENTRY *glGetUniformivPROC) (GLuint program, GLint location, GLint * params); -typedef void (APIENTRY *glGetUniformfvPROC) (GLuint program, GLint location, GLfloat * params); -typedef void (APIENTRY *glGetActiveUniformPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei * length, GLsizei * size, GLenum * type, GLchar * name); -typedef GLint (APIENTRY *glGetUniformLocationPROC) (GLuint program, const GLchar * name); -typedef void (APIENTRY *glGetAttachedShadersPROC) (GLuint program, GLsizei maxCount, GLsizei * count, GLuint * shaders); -typedef void (APIENTRY *glGetProgramInfoLogPROC) (GLuint program, GLsizei maxLength, GLsizei * length, GLchar * infoLog); -typedef void (APIENTRY *glGetShaderInfoLogPROC) (GLuint shader, GLsizei maxLength, GLsizei * length, GLchar * infoLog); -typedef void (APIENTRY *glGetProgramivPROC) (GLuint program, GLenum pname, GLint * params); -typedef void (APIENTRY *glGetProgramfvPROC) (GLuint program, GLenum pname, GLfloat * params); -typedef void (APIENTRY *glGetShaderivPROC) (GLuint shader, GLenum pname, GLint * params); -typedef void (APIENTRY *glGetShaderfvPROC) (GLuint shader, GLenum pname, GLfloat * params); -typedef void (APIENTRY *glUniformMatrix4fvPROC) (GLint location, GLsizei count, GLboolean transpose, GLfloat * matrices); -typedef void (APIENTRY *glUniformMatrix3fvPROC) (GLint location, GLsizei count, GLboolean transpose, GLfloat * matrices); -typedef void (APIENTRY *glUniformMatrix2fvPROC) (GLint location, GLsizei count, GLboolean transpose, GLfloat * matrices); -typedef void (APIENTRY *glUniform4ivPROC) (GLint location, GLsizei count, GLint * values); -typedef void (APIENTRY *glUniform3ivPROC) (GLint location, GLsizei count, GLint * values); -typedef void (APIENTRY *glUniform2ivPROC) (GLint location, GLsizei count, GLint * values); -typedef void (APIENTRY *glUniform1ivPROC) (GLint location, GLsizei count, GLint * values); -typedef void (APIENTRY *glUniform4fvPROC) (GLint location, GLsizei count, GLfloat * values); -typedef void (APIENTRY *glUniform3fvPROC) (GLint location, GLsizei count, GLfloat * values); -typedef void (APIENTRY *glUniform2fvPROC) (GLint location, GLsizei count, GLfloat * values); -typedef void (APIENTRY *glUniform1fvPROC) (GLint location, GLsizei count, GLfloat * values); -typedef void (APIENTRY *glUniform4iPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (APIENTRY *glUniform3iPROC) (GLint location, GLint v0, GLint v1, GLint v2); -typedef void (APIENTRY *glUniform2iPROC) (GLint location, GLint v0, GLint v1); -typedef void (APIENTRY *glUniform1iPROC) (GLint location, GLint v0); -typedef void (APIENTRY *glUniform4fPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (APIENTRY *glUniform3fPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (APIENTRY *glUniform2fPROC) (GLint location, GLfloat v0, GLfloat v1); -typedef void (APIENTRY *glUniform1fPROC) (GLint location, GLfloat v0); -typedef void (APIENTRY *glDeleteProgramPROC) (GLuint program); -typedef void (APIENTRY *glValidateProgramPROC) (GLuint program); -typedef void (APIENTRY *glUseProgramPROC) (GLuint program); -typedef void (APIENTRY *glLinkProgramPROC) (GLuint program); -typedef void (APIENTRY *glDetachShaderPROC) (GLuint program, GLuint shader); -typedef void (APIENTRY *glAttachShaderPROC) (GLuint program, GLuint shader); -typedef GLboolean (APIENTRY *glIsProgramPROC) (GLint program); -typedef GLint (APIENTRY *glCreateProgramPROC) (); -typedef void (APIENTRY *glDeleteShaderPROC) (GLuint shader); -typedef void (APIENTRY *glCompileShaderPROC) (GLuint shader); -typedef GLboolean (APIENTRY *glIsShaderPROC) (GLuint shader); -typedef GLint (APIENTRY *glCreateShaderPROC) (GLuint type); typedef void (APIENTRY *glShaderSourcePROC) (GLuint shader, GLsizei count, const GLchar ** string, const GLint* length); +typedef GLint (APIENTRY *glCreateShaderPROC) (GLuint type); +typedef GLboolean (APIENTRY *glIsShaderPROC) (GLuint shader); +typedef void (APIENTRY *glCompileShaderPROC) (GLuint shader); +typedef void (APIENTRY *glDeleteShaderPROC) (GLuint shader); +typedef GLint (APIENTRY *glCreateProgramPROC) (); +typedef GLboolean (APIENTRY *glIsProgramPROC) (GLint program); +typedef void (APIENTRY *glAttachShaderPROC) (GLuint program, GLuint shader); +typedef void (APIENTRY *glDetachShaderPROC) (GLuint program, GLuint shader); +typedef void (APIENTRY *glLinkProgramPROC) (GLuint program); +typedef void (APIENTRY *glUseProgramPROC) (GLuint program); +typedef void (APIENTRY *glValidateProgramPROC) (GLuint program); +typedef void (APIENTRY *glDeleteProgramPROC) (GLuint program); +typedef void (APIENTRY *glUniform1fPROC) (GLint location, GLfloat v0); +typedef void (APIENTRY *glUniform2fPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (APIENTRY *glUniform3fPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (APIENTRY *glUniform4fPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (APIENTRY *glUniform1iPROC) (GLint location, GLint v0); +typedef void (APIENTRY *glUniform2iPROC) (GLint location, GLint v0, GLint v1); +typedef void (APIENTRY *glUniform3iPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (APIENTRY *glUniform4iPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (APIENTRY *glUniform1fvPROC) (GLint location, GLsizei count, GLfloat * values); +typedef void (APIENTRY *glUniform2fvPROC) (GLint location, GLsizei count, GLfloat * values); +typedef void (APIENTRY *glUniform3fvPROC) (GLint location, GLsizei count, GLfloat * values); +typedef void (APIENTRY *glUniform4fvPROC) (GLint location, GLsizei count, GLfloat * values); +typedef void (APIENTRY *glUniform1ivPROC) (GLint location, GLsizei count, GLint * values); +typedef void (APIENTRY *glUniform2ivPROC) (GLint location, GLsizei count, GLint * values); +typedef void (APIENTRY *glUniform3ivPROC) (GLint location, GLsizei count, GLint * values); +typedef void (APIENTRY *glUniform4ivPROC) (GLint location, GLsizei count, GLint * values); +typedef void (APIENTRY *glUniformMatrix2fvPROC) (GLint location, GLsizei count, GLboolean transpose, GLfloat * matrices); +typedef void (APIENTRY *glUniformMatrix3fvPROC) (GLint location, GLsizei count, GLboolean transpose, GLfloat * matrices); +typedef void (APIENTRY *glUniformMatrix4fvPROC) (GLint location, GLsizei count, GLboolean transpose, GLfloat * matrices); +typedef void (APIENTRY *glGetShaderivPROC) (GLuint shader, GLenum pname, GLint * params); +typedef void (APIENTRY *glGetProgramivPROC) (GLuint program, GLenum pname, GLint * params); +typedef void (APIENTRY *glGetShaderInfoLogPROC) (GLuint shader, GLsizei maxLength, GLsizei * length, GLchar * infoLog); +typedef void (APIENTRY *glGetProgramInfoLogPROC) (GLuint program, GLsizei maxLength, GLsizei * length, GLchar * infoLog); +typedef void (APIENTRY *glGetAttachedShadersPROC) (GLuint program, GLsizei maxCount, GLsizei * count, GLuint * shaders); +typedef GLint (APIENTRY *glGetUniformLocationPROC) (GLuint program, const GLchar * name); +typedef void (APIENTRY *glGetActiveUniformPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei * length, GLsizei * size, GLenum * type, GLchar * name); +typedef void (APIENTRY *glGetUniformfvPROC) (GLuint program, GLint location, GLfloat * params); +typedef void (APIENTRY *glGetUniformivPROC) (GLuint program, GLint location, GLint * params); +typedef void (APIENTRY *glGetShaderSourcePROC) (GLuint shader, GLsizei maxLength, GLsizei * length, GLchar * source); +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 *glVertexAttribPointerPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * buffer); +typedef void (APIENTRY *glEnableVertexAttribArrayPROC) (GLuint index); +typedef void (APIENTRY *glDisableVertexAttribArrayPROC) (GLuint index); +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); +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); +typedef GLint (APIENTRY *glGetAttribLocationPROC) (GLuint program, const GLchar * name); +typedef void (APIENTRY *glDrawBuffersPROC) (GLsizei size, const GLenum * buffers); +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); +typedef void (APIENTRY *glBlendEquationSeparatePROC) (GLenum modeRGB, GLenum modeAlpha); -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglBlendEquationSeparate(JNIEnv *env, jclass clazz, jint modeRGB, jint modeAlpha, jlong function_pointer) { - glBlendEquationSeparatePROC glBlendEquationSeparate = (glBlendEquationSeparatePROC)((intptr_t)function_pointer); - glBlendEquationSeparate(modeRGB, modeAlpha); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglShaderSource(JNIEnv *env, jclass clazz, jint shader, jint count, jobject string, jint string_position, jint length, jlong function_pointer) { + const GLchar *string_address = ((const GLchar *)(*env)->GetDirectBufferAddress(env, string)) + string_position; + glShaderSourcePROC glShaderSource = (glShaderSourcePROC)((intptr_t)function_pointer); + glShaderSource(shader, count, &string_address, &length); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglStencilMaskSeparate(JNIEnv *env, jclass clazz, jint face, jint mask, jlong function_pointer) { - glStencilMaskSeparatePROC glStencilMaskSeparate = (glStencilMaskSeparatePROC)((intptr_t)function_pointer); - glStencilMaskSeparate(face, mask); +JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GL20_nglCreateShader(JNIEnv *env, jclass clazz, jint type, jlong function_pointer) { + glCreateShaderPROC glCreateShader = (glCreateShaderPROC)((intptr_t)function_pointer); + GLint __result = glCreateShader(type); + return __result; } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglStencilFuncSeparate(JNIEnv *env, jclass clazz, jint face, jint func, jint ref, jint mask, jlong function_pointer) { - glStencilFuncSeparatePROC glStencilFuncSeparate = (glStencilFuncSeparatePROC)((intptr_t)function_pointer); - glStencilFuncSeparate(face, func, ref, mask); +JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_GL20_nglIsShader(JNIEnv *env, jclass clazz, jint shader, jlong function_pointer) { + glIsShaderPROC glIsShader = (glIsShaderPROC)((intptr_t)function_pointer); + GLboolean __result = glIsShader(shader); + return __result; } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglStencilOpSeparate(JNIEnv *env, jclass clazz, jint face, jint sfail, jint dpfail, jint dppass, jlong function_pointer) { - glStencilOpSeparatePROC glStencilOpSeparate = (glStencilOpSeparatePROC)((intptr_t)function_pointer); - glStencilOpSeparate(face, sfail, dpfail, dppass); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglCompileShader(JNIEnv *env, jclass clazz, jint shader, jlong function_pointer) { + glCompileShaderPROC glCompileShader = (glCompileShaderPROC)((intptr_t)function_pointer); + glCompileShader(shader); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglDrawBuffers(JNIEnv *env, jclass clazz, jint size, jobject buffers, jint buffers_position, jlong function_pointer) { - const GLenum *buffers_address = ((const GLenum *)(*env)->GetDirectBufferAddress(env, buffers)) + buffers_position; - glDrawBuffersPROC glDrawBuffers = (glDrawBuffersPROC)((intptr_t)function_pointer); - glDrawBuffers(size, buffers_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglDeleteShader(JNIEnv *env, jclass clazz, jint shader, jlong function_pointer) { + glDeleteShaderPROC glDeleteShader = (glDeleteShaderPROC)((intptr_t)function_pointer); + glDeleteShader(shader); } -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GL20_nglGetAttribLocation(JNIEnv *env, jclass clazz, jint program, jobject name, jint name_position, jlong function_pointer) { - const GLchar *name_address = ((const GLchar *)(*env)->GetDirectBufferAddress(env, name)) + name_position; - glGetAttribLocationPROC glGetAttribLocation = (glGetAttribLocationPROC)((intptr_t)function_pointer); - GLint __result = glGetAttribLocation(program, name_address); +JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GL20_nglCreateProgram(JNIEnv *env, jclass clazz, jlong function_pointer) { + glCreateProgramPROC glCreateProgram = (glCreateProgramPROC)((intptr_t)function_pointer); + GLint __result = glCreateProgram(); return __result; } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetActiveAttrib(JNIEnv *env, jclass clazz, jint program, jint index, jint maxLength, jobject length, jint length_position, jobject size, jint size_position, jobject type, jint type_position, jobject name, jint name_position, jlong function_pointer) { - GLsizei *length_address = ((GLsizei *)safeGetBufferAddress(env, length)) + length_position; - GLint *size_address = ((GLint *)(*env)->GetDirectBufferAddress(env, size)) + size_position; - GLenum *type_address = ((GLenum *)(*env)->GetDirectBufferAddress(env, type)) + type_position; - const GLchar *name_address = ((const GLchar *)(*env)->GetDirectBufferAddress(env, name)) + name_position; - glGetActiveAttribPROC glGetActiveAttrib = (glGetActiveAttribPROC)((intptr_t)function_pointer); - glGetActiveAttrib(program, index, maxLength, length_address, size_address, type_address, name_address); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglBindAttribLocation(JNIEnv *env, jclass clazz, jint program, jint index, jobject name, jint name_position, jlong function_pointer) { - const GLchar *name_address = ((const GLchar *)(*env)->GetDirectBufferAddress(env, name)) + name_position; - glBindAttribLocationPROC glBindAttribLocation = (glBindAttribLocationPROC)((intptr_t)function_pointer); - glBindAttribLocation(program, index, name_address); -} - -JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_GL20_nglGetVertexAttribPointerv(JNIEnv *env, jclass clazz, jint index, jint pname, jint result_size, jlong function_pointer) { - glGetVertexAttribPointervPROC glGetVertexAttribPointerv = (glGetVertexAttribPointervPROC)((intptr_t)function_pointer); - GLvoid * __result; - glGetVertexAttribPointerv(index, pname, &__result); - return safeNewBuffer(env, __result, result_size); +JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_GL20_nglIsProgram(JNIEnv *env, jclass clazz, jint program, jlong function_pointer) { + glIsProgramPROC glIsProgram = (glIsProgramPROC)((intptr_t)function_pointer); + GLboolean __result = glIsProgram(program); + return __result; } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetVertexAttribiv(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; - glGetVertexAttribivPROC glGetVertexAttribiv = (glGetVertexAttribivPROC)((intptr_t)function_pointer); - glGetVertexAttribiv(index, pname, params_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglAttachShader(JNIEnv *env, jclass clazz, jint program, jint shader, jlong function_pointer) { + glAttachShaderPROC glAttachShader = (glAttachShaderPROC)((intptr_t)function_pointer); + glAttachShader(program, shader); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetVertexAttribfv(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; - glGetVertexAttribfvPROC glGetVertexAttribfv = (glGetVertexAttribfvPROC)((intptr_t)function_pointer); - glGetVertexAttribfv(index, pname, params_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglDetachShader(JNIEnv *env, jclass clazz, jint program, jint shader, jlong function_pointer) { + glDetachShaderPROC glDetachShader = (glDetachShaderPROC)((intptr_t)function_pointer); + glDetachShader(program, shader); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglDisableVertexAttribArray(JNIEnv *env, jclass clazz, jint index, jlong function_pointer) { - glDisableVertexAttribArrayPROC glDisableVertexAttribArray = (glDisableVertexAttribArrayPROC)((intptr_t)function_pointer); - glDisableVertexAttribArray(index); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglLinkProgram(JNIEnv *env, jclass clazz, jint program, jlong function_pointer) { + glLinkProgramPROC glLinkProgram = (glLinkProgramPROC)((intptr_t)function_pointer); + glLinkProgram(program); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglEnableVertexAttribArray(JNIEnv *env, jclass clazz, jint index, jlong function_pointer) { - glEnableVertexAttribArrayPROC glEnableVertexAttribArray = (glEnableVertexAttribArrayPROC)((intptr_t)function_pointer); - glEnableVertexAttribArray(index); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUseProgram(JNIEnv *env, jclass clazz, jint program, jlong function_pointer) { + glUseProgramPROC glUseProgram = (glUseProgramPROC)((intptr_t)function_pointer); + glUseProgram(program); } -JNIEXPORT 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 buffer_position, jlong function_pointer) { - const GLvoid *buffer_address = ((const GLvoid *)(((char *)(*env)->GetDirectBufferAddress(env, buffer)) + buffer_position)); - glVertexAttribPointerPROC glVertexAttribPointer = (glVertexAttribPointerPROC)((intptr_t)function_pointer); - glVertexAttribPointer(index, size, type, normalized, stride, buffer_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglValidateProgram(JNIEnv *env, jclass clazz, jint program, jlong function_pointer) { + glValidateProgramPROC glValidateProgram = (glValidateProgramPROC)((intptr_t)function_pointer); + glValidateProgram(program); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglVertexAttribPointerBO(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)); - glVertexAttribPointerPROC glVertexAttribPointer = (glVertexAttribPointerPROC)((intptr_t)function_pointer); - glVertexAttribPointer(index, size, type, normalized, stride, buffer_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglDeleteProgram(JNIEnv *env, jclass clazz, jint program, jlong function_pointer) { + glDeleteProgramPROC glDeleteProgram = (glDeleteProgramPROC)((intptr_t)function_pointer); + glDeleteProgram(program); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglVertexAttrib4Nub(JNIEnv *env, jclass clazz, jint index, jbyte x, jbyte y, jbyte z, jbyte w, jlong function_pointer) { - glVertexAttrib4NubPROC glVertexAttrib4Nub = (glVertexAttrib4NubPROC)((intptr_t)function_pointer); - glVertexAttrib4Nub(index, x, y, z, w); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform1f(JNIEnv *env, jclass clazz, jint location, jfloat v0, jlong function_pointer) { + glUniform1fPROC glUniform1f = (glUniform1fPROC)((intptr_t)function_pointer); + glUniform1f(location, v0); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglVertexAttrib4f(JNIEnv *env, jclass clazz, jint index, jfloat x, jfloat y, jfloat z, jfloat w, jlong function_pointer) { - glVertexAttrib4fPROC glVertexAttrib4f = (glVertexAttrib4fPROC)((intptr_t)function_pointer); - glVertexAttrib4f(index, x, y, z, w); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform2f(JNIEnv *env, jclass clazz, jint location, jfloat v0, jfloat v1, jlong function_pointer) { + glUniform2fPROC glUniform2f = (glUniform2fPROC)((intptr_t)function_pointer); + glUniform2f(location, v0, v1); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglVertexAttrib4s(JNIEnv *env, jclass clazz, jint index, jshort x, jshort y, jshort z, jshort w, jlong function_pointer) { - glVertexAttrib4sPROC glVertexAttrib4s = (glVertexAttrib4sPROC)((intptr_t)function_pointer); - glVertexAttrib4s(index, x, y, z, w); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform3f(JNIEnv *env, jclass clazz, jint location, jfloat v0, jfloat v1, jfloat v2, jlong function_pointer) { + glUniform3fPROC glUniform3f = (glUniform3fPROC)((intptr_t)function_pointer); + glUniform3f(location, v0, v1, v2); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglVertexAttrib3f(JNIEnv *env, jclass clazz, jint index, jfloat x, jfloat y, jfloat z, jlong function_pointer) { - glVertexAttrib3fPROC glVertexAttrib3f = (glVertexAttrib3fPROC)((intptr_t)function_pointer); - glVertexAttrib3f(index, x, y, z); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform4f(JNIEnv *env, jclass clazz, jint location, jfloat v0, jfloat v1, jfloat v2, jfloat v3, jlong function_pointer) { + glUniform4fPROC glUniform4f = (glUniform4fPROC)((intptr_t)function_pointer); + glUniform4f(location, v0, v1, v2, v3); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglVertexAttrib3s(JNIEnv *env, jclass clazz, jint index, jshort x, jshort y, jshort z, jlong function_pointer) { - glVertexAttrib3sPROC glVertexAttrib3s = (glVertexAttrib3sPROC)((intptr_t)function_pointer); - glVertexAttrib3s(index, x, y, z); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform1i(JNIEnv *env, jclass clazz, jint location, jint v0, jlong function_pointer) { + glUniform1iPROC glUniform1i = (glUniform1iPROC)((intptr_t)function_pointer); + glUniform1i(location, v0); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglVertexAttrib2f(JNIEnv *env, jclass clazz, jint index, jfloat x, jfloat y, jlong function_pointer) { - glVertexAttrib2fPROC glVertexAttrib2f = (glVertexAttrib2fPROC)((intptr_t)function_pointer); - glVertexAttrib2f(index, x, y); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform2i(JNIEnv *env, jclass clazz, jint location, jint v0, jint v1, jlong function_pointer) { + glUniform2iPROC glUniform2i = (glUniform2iPROC)((intptr_t)function_pointer); + glUniform2i(location, v0, v1); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglVertexAttrib2s(JNIEnv *env, jclass clazz, jint index, jshort x, jshort y, jlong function_pointer) { - glVertexAttrib2sPROC glVertexAttrib2s = (glVertexAttrib2sPROC)((intptr_t)function_pointer); - glVertexAttrib2s(index, x, y); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform3i(JNIEnv *env, jclass clazz, jint location, jint v0, jint v1, jint v2, jlong function_pointer) { + glUniform3iPROC glUniform3i = (glUniform3iPROC)((intptr_t)function_pointer); + glUniform3i(location, v0, v1, v2); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglVertexAttrib1f(JNIEnv *env, jclass clazz, jint index, jfloat x, jlong function_pointer) { - glVertexAttrib1fPROC glVertexAttrib1f = (glVertexAttrib1fPROC)((intptr_t)function_pointer); - glVertexAttrib1f(index, x); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform4i(JNIEnv *env, jclass clazz, jint location, jint v0, jint v1, jint v2, jint v3, jlong function_pointer) { + glUniform4iPROC glUniform4i = (glUniform4iPROC)((intptr_t)function_pointer); + glUniform4i(location, v0, v1, v2, v3); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglVertexAttrib1s(JNIEnv *env, jclass clazz, jint index, jshort x, jlong function_pointer) { - glVertexAttrib1sPROC glVertexAttrib1s = (glVertexAttrib1sPROC)((intptr_t)function_pointer); - glVertexAttrib1s(index, x); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform1fv(JNIEnv *env, jclass clazz, jint location, jint count, jobject values, jint values_position, jlong function_pointer) { + GLfloat *values_address = ((GLfloat *)(*env)->GetDirectBufferAddress(env, values)) + values_position; + glUniform1fvPROC glUniform1fv = (glUniform1fvPROC)((intptr_t)function_pointer); + glUniform1fv(location, count, values_address); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetShaderSource(JNIEnv *env, jclass clazz, jint shader, jint maxLength, jobject length, jint length_position, jobject source, jint source_position, jlong function_pointer) { - GLsizei *length_address = ((GLsizei *)safeGetBufferAddress(env, length)) + length_position; - GLchar *source_address = ((GLchar *)(*env)->GetDirectBufferAddress(env, source)) + source_position; - glGetShaderSourcePROC glGetShaderSource = (glGetShaderSourcePROC)((intptr_t)function_pointer); - glGetShaderSource(shader, maxLength, length_address, source_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform2fv(JNIEnv *env, jclass clazz, jint location, jint count, jobject values, jint values_position, jlong function_pointer) { + GLfloat *values_address = ((GLfloat *)(*env)->GetDirectBufferAddress(env, values)) + values_position; + glUniform2fvPROC glUniform2fv = (glUniform2fvPROC)((intptr_t)function_pointer); + glUniform2fv(location, count, values_address); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetUniformiv(JNIEnv *env, jclass clazz, jint program, jint location, jobject params, jint params_position, jlong function_pointer) { - GLint *params_address = ((GLint *)(*env)->GetDirectBufferAddress(env, params)) + params_position; - glGetUniformivPROC glGetUniformiv = (glGetUniformivPROC)((intptr_t)function_pointer); - glGetUniformiv(program, location, params_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform3fv(JNIEnv *env, jclass clazz, jint location, jint count, jobject values, jint values_position, jlong function_pointer) { + GLfloat *values_address = ((GLfloat *)(*env)->GetDirectBufferAddress(env, values)) + values_position; + glUniform3fvPROC glUniform3fv = (glUniform3fvPROC)((intptr_t)function_pointer); + glUniform3fv(location, count, values_address); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetUniformfv(JNIEnv *env, jclass clazz, jint program, jint location, jobject params, jint params_position, jlong function_pointer) { - GLfloat *params_address = ((GLfloat *)(*env)->GetDirectBufferAddress(env, params)) + params_position; - glGetUniformfvPROC glGetUniformfv = (glGetUniformfvPROC)((intptr_t)function_pointer); - glGetUniformfv(program, location, params_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform4fv(JNIEnv *env, jclass clazz, jint location, jint count, jobject values, jint values_position, jlong function_pointer) { + GLfloat *values_address = ((GLfloat *)(*env)->GetDirectBufferAddress(env, values)) + values_position; + glUniform4fvPROC glUniform4fv = (glUniform4fvPROC)((intptr_t)function_pointer); + glUniform4fv(location, count, values_address); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetActiveUniform(JNIEnv *env, jclass clazz, jint program, jint index, jint maxLength, jobject length, jint length_position, jobject size, jint size_position, jobject type, jint type_position, jobject name, jint name_position, jlong function_pointer) { - GLsizei *length_address = ((GLsizei *)safeGetBufferAddress(env, length)) + length_position; - GLsizei *size_address = ((GLsizei *)(*env)->GetDirectBufferAddress(env, size)) + size_position; - GLenum *type_address = ((GLenum *)(*env)->GetDirectBufferAddress(env, type)) + type_position; - GLchar *name_address = ((GLchar *)(*env)->GetDirectBufferAddress(env, name)) + name_position; - glGetActiveUniformPROC glGetActiveUniform = (glGetActiveUniformPROC)((intptr_t)function_pointer); - glGetActiveUniform(program, index, maxLength, length_address, size_address, type_address, name_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform1iv(JNIEnv *env, jclass clazz, jint location, jint count, jobject values, jint values_position, jlong function_pointer) { + GLint *values_address = ((GLint *)(*env)->GetDirectBufferAddress(env, values)) + values_position; + glUniform1ivPROC glUniform1iv = (glUniform1ivPROC)((intptr_t)function_pointer); + glUniform1iv(location, count, values_address); } -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GL20_nglGetUniformLocation(JNIEnv *env, jclass clazz, jint program, jobject name, jint name_position, jlong function_pointer) { - const GLchar *name_address = ((const GLchar *)(*env)->GetDirectBufferAddress(env, name)) + name_position; - glGetUniformLocationPROC glGetUniformLocation = (glGetUniformLocationPROC)((intptr_t)function_pointer); - GLint __result = glGetUniformLocation(program, name_address); - return __result; +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform2iv(JNIEnv *env, jclass clazz, jint location, jint count, jobject values, jint values_position, jlong function_pointer) { + GLint *values_address = ((GLint *)(*env)->GetDirectBufferAddress(env, values)) + values_position; + glUniform2ivPROC glUniform2iv = (glUniform2ivPROC)((intptr_t)function_pointer); + glUniform2iv(location, count, values_address); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetAttachedShaders(JNIEnv *env, jclass clazz, jint program, jint maxCount, jobject count, jint count_position, jobject shaders, jint shaders_position, jlong function_pointer) { - GLsizei *count_address = ((GLsizei *)safeGetBufferAddress(env, count)) + count_position; - GLuint *shaders_address = ((GLuint *)(*env)->GetDirectBufferAddress(env, shaders)) + shaders_position; - glGetAttachedShadersPROC glGetAttachedShaders = (glGetAttachedShadersPROC)((intptr_t)function_pointer); - glGetAttachedShaders(program, maxCount, count_address, shaders_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform3iv(JNIEnv *env, jclass clazz, jint location, jint count, jobject values, jint values_position, jlong function_pointer) { + GLint *values_address = ((GLint *)(*env)->GetDirectBufferAddress(env, values)) + values_position; + glUniform3ivPROC glUniform3iv = (glUniform3ivPROC)((intptr_t)function_pointer); + glUniform3iv(location, count, values_address); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetProgramInfoLog(JNIEnv *env, jclass clazz, jint program, jint maxLength, jobject length, jint length_position, jobject infoLog, jint infoLog_position, jlong function_pointer) { - GLsizei *length_address = ((GLsizei *)safeGetBufferAddress(env, length)) + length_position; - GLchar *infoLog_address = ((GLchar *)(*env)->GetDirectBufferAddress(env, infoLog)) + infoLog_position; - glGetProgramInfoLogPROC glGetProgramInfoLog = (glGetProgramInfoLogPROC)((intptr_t)function_pointer); - glGetProgramInfoLog(program, maxLength, length_address, infoLog_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform4iv(JNIEnv *env, jclass clazz, jint location, jint count, jobject values, jint values_position, jlong function_pointer) { + GLint *values_address = ((GLint *)(*env)->GetDirectBufferAddress(env, values)) + values_position; + glUniform4ivPROC glUniform4iv = (glUniform4ivPROC)((intptr_t)function_pointer); + glUniform4iv(location, count, values_address); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetShaderInfoLog(JNIEnv *env, jclass clazz, jint shader, jint maxLength, jobject length, jint length_position, jobject infoLog, jint infoLog_position, jlong function_pointer) { - GLsizei *length_address = ((GLsizei *)safeGetBufferAddress(env, length)) + length_position; - GLchar *infoLog_address = ((GLchar *)(*env)->GetDirectBufferAddress(env, infoLog)) + infoLog_position; - glGetShaderInfoLogPROC glGetShaderInfoLog = (glGetShaderInfoLogPROC)((intptr_t)function_pointer); - glGetShaderInfoLog(shader, maxLength, length_address, infoLog_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniformMatrix2fv(JNIEnv *env, jclass clazz, jint location, jint count, jboolean transpose, jobject matrices, jint matrices_position, jlong function_pointer) { + GLfloat *matrices_address = ((GLfloat *)(*env)->GetDirectBufferAddress(env, matrices)) + matrices_position; + glUniformMatrix2fvPROC glUniformMatrix2fv = (glUniformMatrix2fvPROC)((intptr_t)function_pointer); + glUniformMatrix2fv(location, count, transpose, matrices_address); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetProgramiv(JNIEnv *env, jclass clazz, jint program, jint pname, jobject params, jint params_position, jlong function_pointer) { - GLint *params_address = ((GLint *)(*env)->GetDirectBufferAddress(env, params)) + params_position; - glGetProgramivPROC glGetProgramiv = (glGetProgramivPROC)((intptr_t)function_pointer); - glGetProgramiv(program, pname, params_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniformMatrix3fv(JNIEnv *env, jclass clazz, jint location, jint count, jboolean transpose, jobject matrices, jint matrices_position, jlong function_pointer) { + GLfloat *matrices_address = ((GLfloat *)(*env)->GetDirectBufferAddress(env, matrices)) + matrices_position; + glUniformMatrix3fvPROC glUniformMatrix3fv = (glUniformMatrix3fvPROC)((intptr_t)function_pointer); + glUniformMatrix3fv(location, count, transpose, matrices_address); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetProgramfv(JNIEnv *env, jclass clazz, jint program, jint pname, jobject params, jint params_position, jlong function_pointer) { - GLfloat *params_address = ((GLfloat *)(*env)->GetDirectBufferAddress(env, params)) + params_position; - glGetProgramfvPROC glGetProgramfv = (glGetProgramfvPROC)((intptr_t)function_pointer); - glGetProgramfv(program, pname, params_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniformMatrix4fv(JNIEnv *env, jclass clazz, jint location, jint count, jboolean transpose, jobject matrices, jint matrices_position, jlong function_pointer) { + GLfloat *matrices_address = ((GLfloat *)(*env)->GetDirectBufferAddress(env, matrices)) + matrices_position; + glUniformMatrix4fvPROC glUniformMatrix4fv = (glUniformMatrix4fvPROC)((intptr_t)function_pointer); + glUniformMatrix4fv(location, count, transpose, matrices_address); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetShaderiv(JNIEnv *env, jclass clazz, jint shader, jint pname, jobject params, jint params_position, jlong function_pointer) { @@ -279,185 +251,199 @@ glGetShaderiv(shader, pname, params_address); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetShaderfv(JNIEnv *env, jclass clazz, jint shader, jint pname, jobject params, jint params_position, jlong function_pointer) { - GLfloat *params_address = ((GLfloat *)(*env)->GetDirectBufferAddress(env, params)) + params_position; - glGetShaderfvPROC glGetShaderfv = (glGetShaderfvPROC)((intptr_t)function_pointer); - glGetShaderfv(shader, pname, params_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetProgramiv(JNIEnv *env, jclass clazz, jint program, jint pname, jobject params, jint params_position, jlong function_pointer) { + GLint *params_address = ((GLint *)(*env)->GetDirectBufferAddress(env, params)) + params_position; + glGetProgramivPROC glGetProgramiv = (glGetProgramivPROC)((intptr_t)function_pointer); + glGetProgramiv(program, pname, params_address); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniformMatrix4fv(JNIEnv *env, jclass clazz, jint location, jint count, jboolean transpose, jobject matrices, jint matrices_position, jlong function_pointer) { - GLfloat *matrices_address = ((GLfloat *)(*env)->GetDirectBufferAddress(env, matrices)) + matrices_position; - glUniformMatrix4fvPROC glUniformMatrix4fv = (glUniformMatrix4fvPROC)((intptr_t)function_pointer); - glUniformMatrix4fv(location, count, transpose, matrices_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetShaderInfoLog(JNIEnv *env, jclass clazz, jint shader, jint maxLength, jobject length, jint length_position, jobject infoLog, jint infoLog_position, jlong function_pointer) { + GLsizei *length_address = ((GLsizei *)safeGetBufferAddress(env, length)) + length_position; + GLchar *infoLog_address = ((GLchar *)(*env)->GetDirectBufferAddress(env, infoLog)) + infoLog_position; + glGetShaderInfoLogPROC glGetShaderInfoLog = (glGetShaderInfoLogPROC)((intptr_t)function_pointer); + glGetShaderInfoLog(shader, maxLength, length_address, infoLog_address); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniformMatrix3fv(JNIEnv *env, jclass clazz, jint location, jint count, jboolean transpose, jobject matrices, jint matrices_position, jlong function_pointer) { - GLfloat *matrices_address = ((GLfloat *)(*env)->GetDirectBufferAddress(env, matrices)) + matrices_position; - glUniformMatrix3fvPROC glUniformMatrix3fv = (glUniformMatrix3fvPROC)((intptr_t)function_pointer); - glUniformMatrix3fv(location, count, transpose, matrices_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetProgramInfoLog(JNIEnv *env, jclass clazz, jint program, jint maxLength, jobject length, jint length_position, jobject infoLog, jint infoLog_position, jlong function_pointer) { + GLsizei *length_address = ((GLsizei *)safeGetBufferAddress(env, length)) + length_position; + GLchar *infoLog_address = ((GLchar *)(*env)->GetDirectBufferAddress(env, infoLog)) + infoLog_position; + glGetProgramInfoLogPROC glGetProgramInfoLog = (glGetProgramInfoLogPROC)((intptr_t)function_pointer); + glGetProgramInfoLog(program, maxLength, length_address, infoLog_address); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniformMatrix2fv(JNIEnv *env, jclass clazz, jint location, jint count, jboolean transpose, jobject matrices, jint matrices_position, jlong function_pointer) { - GLfloat *matrices_address = ((GLfloat *)(*env)->GetDirectBufferAddress(env, matrices)) + matrices_position; - glUniformMatrix2fvPROC glUniformMatrix2fv = (glUniformMatrix2fvPROC)((intptr_t)function_pointer); - glUniformMatrix2fv(location, count, transpose, matrices_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetAttachedShaders(JNIEnv *env, jclass clazz, jint program, jint maxCount, jobject count, jint count_position, jobject shaders, jint shaders_position, jlong function_pointer) { + GLsizei *count_address = ((GLsizei *)safeGetBufferAddress(env, count)) + count_position; + GLuint *shaders_address = ((GLuint *)(*env)->GetDirectBufferAddress(env, shaders)) + shaders_position; + glGetAttachedShadersPROC glGetAttachedShaders = (glGetAttachedShadersPROC)((intptr_t)function_pointer); + glGetAttachedShaders(program, maxCount, count_address, shaders_address); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform4iv(JNIEnv *env, jclass clazz, jint location, jint count, jobject values, jint values_position, jlong function_pointer) { - GLint *values_address = ((GLint *)(*env)->GetDirectBufferAddress(env, values)) + values_position; - glUniform4ivPROC glUniform4iv = (glUniform4ivPROC)((intptr_t)function_pointer); - glUniform4iv(location, count, values_address); +JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GL20_nglGetUniformLocation(JNIEnv *env, jclass clazz, jint program, jobject name, jint name_position, jlong function_pointer) { + const GLchar *name_address = ((const GLchar *)(*env)->GetDirectBufferAddress(env, name)) + name_position; + glGetUniformLocationPROC glGetUniformLocation = (glGetUniformLocationPROC)((intptr_t)function_pointer); + GLint __result = glGetUniformLocation(program, name_address); + return __result; } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform3iv(JNIEnv *env, jclass clazz, jint location, jint count, jobject values, jint values_position, jlong function_pointer) { - GLint *values_address = ((GLint *)(*env)->GetDirectBufferAddress(env, values)) + values_position; - glUniform3ivPROC glUniform3iv = (glUniform3ivPROC)((intptr_t)function_pointer); - glUniform3iv(location, count, values_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetActiveUniform(JNIEnv *env, jclass clazz, jint program, jint index, jint maxLength, jobject length, jint length_position, jobject size, jint size_position, jobject type, jint type_position, jobject name, jint name_position, jlong function_pointer) { + GLsizei *length_address = ((GLsizei *)safeGetBufferAddress(env, length)) + length_position; + GLsizei *size_address = ((GLsizei *)(*env)->GetDirectBufferAddress(env, size)) + size_position; + GLenum *type_address = ((GLenum *)(*env)->GetDirectBufferAddress(env, type)) + type_position; + GLchar *name_address = ((GLchar *)(*env)->GetDirectBufferAddress(env, name)) + name_position; + glGetActiveUniformPROC glGetActiveUniform = (glGetActiveUniformPROC)((intptr_t)function_pointer); + glGetActiveUniform(program, index, maxLength, length_address, size_address, type_address, name_address); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform2iv(JNIEnv *env, jclass clazz, jint location, jint count, jobject values, jint values_position, jlong function_pointer) { - GLint *values_address = ((GLint *)(*env)->GetDirectBufferAddress(env, values)) + values_position; - glUniform2ivPROC glUniform2iv = (glUniform2ivPROC)((intptr_t)function_pointer); - glUniform2iv(location, count, values_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetUniformfv(JNIEnv *env, jclass clazz, jint program, jint location, jobject params, jint params_position, jlong function_pointer) { + GLfloat *params_address = ((GLfloat *)(*env)->GetDirectBufferAddress(env, params)) + params_position; + glGetUniformfvPROC glGetUniformfv = (glGetUniformfvPROC)((intptr_t)function_pointer); + glGetUniformfv(program, location, params_address); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform1iv(JNIEnv *env, jclass clazz, jint location, jint count, jobject values, jint values_position, jlong function_pointer) { - GLint *values_address = ((GLint *)(*env)->GetDirectBufferAddress(env, values)) + values_position; - glUniform1ivPROC glUniform1iv = (glUniform1ivPROC)((intptr_t)function_pointer); - glUniform1iv(location, count, values_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetUniformiv(JNIEnv *env, jclass clazz, jint program, jint location, jobject params, jint params_position, jlong function_pointer) { + GLint *params_address = ((GLint *)(*env)->GetDirectBufferAddress(env, params)) + params_position; + glGetUniformivPROC glGetUniformiv = (glGetUniformivPROC)((intptr_t)function_pointer); + glGetUniformiv(program, location, params_address); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform4fv(JNIEnv *env, jclass clazz, jint location, jint count, jobject values, jint values_position, jlong function_pointer) { - GLfloat *values_address = ((GLfloat *)(*env)->GetDirectBufferAddress(env, values)) + values_position; - glUniform4fvPROC glUniform4fv = (glUniform4fvPROC)((intptr_t)function_pointer); - glUniform4fv(location, count, values_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetShaderSource(JNIEnv *env, jclass clazz, jint shader, jint maxLength, jobject length, jint length_position, jobject source, jint source_position, jlong function_pointer) { + GLsizei *length_address = ((GLsizei *)safeGetBufferAddress(env, length)) + length_position; + GLchar *source_address = ((GLchar *)(*env)->GetDirectBufferAddress(env, source)) + source_position; + glGetShaderSourcePROC glGetShaderSource = (glGetShaderSourcePROC)((intptr_t)function_pointer); + glGetShaderSource(shader, maxLength, length_address, source_address); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform3fv(JNIEnv *env, jclass clazz, jint location, jint count, jobject values, jint values_position, jlong function_pointer) { - GLfloat *values_address = ((GLfloat *)(*env)->GetDirectBufferAddress(env, values)) + values_position; - glUniform3fvPROC glUniform3fv = (glUniform3fvPROC)((intptr_t)function_pointer); - glUniform3fv(location, count, values_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglVertexAttrib1s(JNIEnv *env, jclass clazz, jint index, jshort x, jlong function_pointer) { + glVertexAttrib1sPROC glVertexAttrib1s = (glVertexAttrib1sPROC)((intptr_t)function_pointer); + glVertexAttrib1s(index, x); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform2fv(JNIEnv *env, jclass clazz, jint location, jint count, jobject values, jint values_position, jlong function_pointer) { - GLfloat *values_address = ((GLfloat *)(*env)->GetDirectBufferAddress(env, values)) + values_position; - glUniform2fvPROC glUniform2fv = (glUniform2fvPROC)((intptr_t)function_pointer); - glUniform2fv(location, count, values_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglVertexAttrib1f(JNIEnv *env, jclass clazz, jint index, jfloat x, jlong function_pointer) { + glVertexAttrib1fPROC glVertexAttrib1f = (glVertexAttrib1fPROC)((intptr_t)function_pointer); + glVertexAttrib1f(index, x); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform1fv(JNIEnv *env, jclass clazz, jint location, jint count, jobject values, jint values_position, jlong function_pointer) { - GLfloat *values_address = ((GLfloat *)(*env)->GetDirectBufferAddress(env, values)) + values_position; - glUniform1fvPROC glUniform1fv = (glUniform1fvPROC)((intptr_t)function_pointer); - glUniform1fv(location, count, values_address); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglVertexAttrib2s(JNIEnv *env, jclass clazz, jint index, jshort x, jshort y, jlong function_pointer) { + glVertexAttrib2sPROC glVertexAttrib2s = (glVertexAttrib2sPROC)((intptr_t)function_pointer); + glVertexAttrib2s(index, x, y); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform4i(JNIEnv *env, jclass clazz, jint location, jint v0, jint v1, jint v2, jint v3, jlong function_pointer) { - glUniform4iPROC glUniform4i = (glUniform4iPROC)((intptr_t)function_pointer); - glUniform4i(location, v0, v1, v2, v3); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglVertexAttrib2f(JNIEnv *env, jclass clazz, jint index, jfloat x, jfloat y, jlong function_pointer) { + glVertexAttrib2fPROC glVertexAttrib2f = (glVertexAttrib2fPROC)((intptr_t)function_pointer); + glVertexAttrib2f(index, x, y); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform3i(JNIEnv *env, jclass clazz, jint location, jint v0, jint v1, jint v2, jlong function_pointer) { - glUniform3iPROC glUniform3i = (glUniform3iPROC)((intptr_t)function_pointer); - glUniform3i(location, v0, v1, v2); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglVertexAttrib3s(JNIEnv *env, jclass clazz, jint index, jshort x, jshort y, jshort z, jlong function_pointer) { + glVertexAttrib3sPROC glVertexAttrib3s = (glVertexAttrib3sPROC)((intptr_t)function_pointer); + glVertexAttrib3s(index, x, y, z); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform2i(JNIEnv *env, jclass clazz, jint location, jint v0, jint v1, jlong function_pointer) { - glUniform2iPROC glUniform2i = (glUniform2iPROC)((intptr_t)function_pointer); - glUniform2i(location, v0, v1); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglVertexAttrib3f(JNIEnv *env, jclass clazz, jint index, jfloat x, jfloat y, jfloat z, jlong function_pointer) { + glVertexAttrib3fPROC glVertexAttrib3f = (glVertexAttrib3fPROC)((intptr_t)function_pointer); + glVertexAttrib3f(index, x, y, z); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform1i(JNIEnv *env, jclass clazz, jint location, jint v0, jlong function_pointer) { - glUniform1iPROC glUniform1i = (glUniform1iPROC)((intptr_t)function_pointer); - glUniform1i(location, v0); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglVertexAttrib4s(JNIEnv *env, jclass clazz, jint index, jshort x, jshort y, jshort z, jshort w, jlong function_pointer) { + glVertexAttrib4sPROC glVertexAttrib4s = (glVertexAttrib4sPROC)((intptr_t)function_pointer); + glVertexAttrib4s(index, x, y, z, w); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform4f(JNIEnv *env, jclass clazz, jint location, jfloat v0, jfloat v1, jfloat v2, jfloat v3, jlong function_pointer) { - glUniform4fPROC glUniform4f = (glUniform4fPROC)((intptr_t)function_pointer); - glUniform4f(location, v0, v1, v2, v3); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglVertexAttrib4f(JNIEnv *env, jclass clazz, jint index, jfloat x, jfloat y, jfloat z, jfloat w, jlong function_pointer) { + glVertexAttrib4fPROC glVertexAttrib4f = (glVertexAttrib4fPROC)((intptr_t)function_pointer); + glVertexAttrib4f(index, x, y, z, w); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform3f(JNIEnv *env, jclass clazz, jint location, jfloat v0, jfloat v1, jfloat v2, jlong function_pointer) { - glUniform3fPROC glUniform3f = (glUniform3fPROC)((intptr_t)function_pointer); - glUniform3f(location, v0, v1, v2); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglVertexAttrib4Nub(JNIEnv *env, jclass clazz, jint index, jbyte x, jbyte y, jbyte z, jbyte w, jlong function_pointer) { + glVertexAttrib4NubPROC glVertexAttrib4Nub = (glVertexAttrib4NubPROC)((intptr_t)function_pointer); + glVertexAttrib4Nub(index, x, y, z, w); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform2f(JNIEnv *env, jclass clazz, jint location, jfloat v0, jfloat v1, jlong function_pointer) { - glUniform2fPROC glUniform2f = (glUniform2fPROC)((intptr_t)function_pointer); - glUniform2f(location, v0, v1); +JNIEXPORT 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 buffer_position, jlong function_pointer) { + const GLvoid *buffer_address = ((const GLvoid *)(((char *)(*env)->GetDirectBufferAddress(env, buffer)) + buffer_position)); + glVertexAttribPointerPROC glVertexAttribPointer = (glVertexAttribPointerPROC)((intptr_t)function_pointer); + glVertexAttribPointer(index, size, type, normalized, stride, buffer_address); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUniform1f(JNIEnv *env, jclass clazz, jint location, jfloat v0, jlong function_pointer) { - glUniform1fPROC glUniform1f = (glUniform1fPROC)((intptr_t)function_pointer); - glUniform1f(location, v0); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglVertexAttribPointerBO(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)); + glVertexAttribPointerPROC glVertexAttribPointer = (glVertexAttribPointerPROC)((intptr_t)function_pointer); + glVertexAttribPointer(index, size, type, normalized, stride, buffer_address); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglDeleteProgram(JNIEnv *env, jclass clazz, jint program, jlong function_pointer) { - glDeleteProgramPROC glDeleteProgram = (glDeleteProgramPROC)((intptr_t)function_pointer); - glDeleteProgram(program); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglEnableVertexAttribArray(JNIEnv *env, jclass clazz, jint index, jlong function_pointer) { + glEnableVertexAttribArrayPROC glEnableVertexAttribArray = (glEnableVertexAttribArrayPROC)((intptr_t)function_pointer); + glEnableVertexAttribArray(index); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglValidateProgram(JNIEnv *env, jclass clazz, jint program, jlong function_pointer) { - glValidateProgramPROC glValidateProgram = (glValidateProgramPROC)((intptr_t)function_pointer); - glValidateProgram(program); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglDisableVertexAttribArray(JNIEnv *env, jclass clazz, jint index, jlong function_pointer) { + glDisableVertexAttribArrayPROC glDisableVertexAttribArray = (glDisableVertexAttribArrayPROC)((intptr_t)function_pointer); + glDisableVertexAttribArray(index); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglUseProgram(JNIEnv *env, jclass clazz, jint program, jlong function_pointer) { - glUseProgramPROC glUseProgram = (glUseProgramPROC)((intptr_t)function_pointer); - glUseProgram(program); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetVertexAttribfv(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; + glGetVertexAttribfvPROC glGetVertexAttribfv = (glGetVertexAttribfvPROC)((intptr_t)function_pointer); + glGetVertexAttribfv(index, pname, params_address); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglLinkProgram(JNIEnv *env, jclass clazz, jint program, jlong function_pointer) { - glLinkProgramPROC glLinkProgram = (glLinkProgramPROC)((intptr_t)function_pointer); - glLinkProgram(program); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetVertexAttribiv(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; + glGetVertexAttribivPROC glGetVertexAttribiv = (glGetVertexAttribivPROC)((intptr_t)function_pointer); + glGetVertexAttribiv(index, pname, params_address); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglDetachShader(JNIEnv *env, jclass clazz, jint program, jint shader, jlong function_pointer) { - glDetachShaderPROC glDetachShader = (glDetachShaderPROC)((intptr_t)function_pointer); - glDetachShader(program, shader); +JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_GL20_nglGetVertexAttribPointerv(JNIEnv *env, jclass clazz, jint index, jint pname, jint result_size, jlong function_pointer) { + glGetVertexAttribPointervPROC glGetVertexAttribPointerv = (glGetVertexAttribPointervPROC)((intptr_t)function_pointer); + GLvoid * __result; + glGetVertexAttribPointerv(index, pname, &__result); + return safeNewBuffer(env, __result, result_size); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglAttachShader(JNIEnv *env, jclass clazz, jint program, jint shader, jlong function_pointer) { - glAttachShaderPROC glAttachShader = (glAttachShaderPROC)((intptr_t)function_pointer); - glAttachShader(program, shader); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglBindAttribLocation(JNIEnv *env, jclass clazz, jint program, jint index, jobject name, jint name_position, jlong function_pointer) { + const GLchar *name_address = ((const GLchar *)(*env)->GetDirectBufferAddress(env, name)) + name_position; + glBindAttribLocationPROC glBindAttribLocation = (glBindAttribLocationPROC)((intptr_t)function_pointer); + glBindAttribLocation(program, index, name_address); } -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_GL20_nglIsProgram(JNIEnv *env, jclass clazz, jint program, jlong function_pointer) { - glIsProgramPROC glIsProgram = (glIsProgramPROC)((intptr_t)function_pointer); - GLboolean __result = glIsProgram(program); - return __result; +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglGetActiveAttrib(JNIEnv *env, jclass clazz, jint program, jint index, jint maxLength, jobject length, jint length_position, jobject size, jint size_position, jobject type, jint type_position, jobject name, jint name_position, jlong function_pointer) { + GLsizei *length_address = ((GLsizei *)safeGetBufferAddress(env, length)) + length_position; + GLint *size_address = ((GLint *)(*env)->GetDirectBufferAddress(env, size)) + size_position; + GLenum *type_address = ((GLenum *)(*env)->GetDirectBufferAddress(env, type)) + type_position; + const GLchar *name_address = ((const GLchar *)(*env)->GetDirectBufferAddress(env, name)) + name_position; + glGetActiveAttribPROC glGetActiveAttrib = (glGetActiveAttribPROC)((intptr_t)function_pointer); + glGetActiveAttrib(program, index, maxLength, length_address, size_address, type_address, name_address); } -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GL20_nglCreateProgram(JNIEnv *env, jclass clazz, jlong function_pointer) { - glCreateProgramPROC glCreateProgram = (glCreateProgramPROC)((intptr_t)function_pointer); - GLint __result = glCreateProgram(); +JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GL20_nglGetAttribLocation(JNIEnv *env, jclass clazz, jint program, jobject name, jint name_position, jlong function_pointer) { + const GLchar *name_address = ((const GLchar *)(*env)->GetDirectBufferAddress(env, name)) + name_position; + glGetAttribLocationPROC glGetAttribLocation = (glGetAttribLocationPROC)((intptr_t)function_pointer); + GLint __result = glGetAttribLocation(program, name_address); return __result; } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20_nglDeleteShader(JNIEnv *env, jclass clazz, jint shader, jlong function_pointer) { - glDeleteShaderPROC glDeleteShader = (glDeleteShaderPROC)((intptr_t)function_pointer); - glDeleteShad... [truncated message content] |
|
From: Ioannis T. <sp...@us...> - 2005-03-11 16:17:30
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3167 Modified Files: ATITextureCompression3DC.java GL20.java Log Message: Fixed GetShader & GetProgram Index: ATITextureCompression3DC.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ATITextureCompression3DC.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ATITextureCompression3DC.java 15 Feb 2005 11:05:02 -0000 1.2 +++ ATITextureCompression3DC.java 11 Mar 2005 16:17:18 -0000 1.3 @@ -7,7 +7,7 @@ import java.nio.*; public final class ATITextureCompression3DC { - public static final int GL_COMPRESSED_RGB_3DC_ATI = 0x8837; + public static final int GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI = 0x8837; private ATITextureCompression3DC() { } Index: GL20.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/GL20.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- GL20.java 16 Feb 2005 21:46:03 -0000 1.7 +++ GL20.java 11 Mar 2005 16:17:18 -0000 1.8 @@ -7,386 +7,351 @@ import java.nio.*; public final class GL20 { - public static final int GL_BLEND_EQUATION_ALPHA = 0x883d; - public static final int GL_BLEND_EQUATION_RGB = 0x8009; - public static final int GL_STENCIL_BACK_WRITEMASK = 0x8ca5; - public static final int GL_STENCIL_BACK_VALUE_MASK = 0x8ca4; - public static final int GL_STENCIL_BACK_REF = 0x8ca3; - public static final int GL_STENCIL_BACK_PASS_DEPTH_PASS = 0x8803; - public static final int GL_STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802; - public static final int GL_STENCIL_BACK_FAIL = 0x8801; [...1059 lines suppressed...] - /** - * The ARB_shader_objects extension allows multiple, optionally null-terminated, source strings to define a shader program. - * <p/> - * This method uses just a single string, that should NOT be null-terminated. - * @param shader - * @param string - */ - public static void glShaderSource(int shader, ByteBuffer string) { - BufferChecks.checkDirect(string); - long function_pointer = GLContext.getCapabilities().GL20_glShaderSource_pointer; + public static void glBlendEquationSeparate(int modeRGB, int modeAlpha) { + long function_pointer = GLContext.getCapabilities().GL20_glBlendEquationSeparate_pointer; BufferChecks.checkFunctionAddress(function_pointer); - nglShaderSource(shader, 1, string, string.position(), (string.remaining()), function_pointer); + nglBlendEquationSeparate(modeRGB, modeAlpha, function_pointer); } - private static native void nglShaderSource(int shader, int count, ByteBuffer string, int string_position, int length, long function_pointer); + private static native void nglBlendEquationSeparate(int modeRGB, int modeAlpha, long function_pointer); } |
|
From: Ioannis T. <sp...@us...> - 2005-03-11 16:16:53
|
Update of /cvsroot/java-game-lib/LWJGL/src/templates/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2958 Modified Files: GL20.java Log Message: Fixed GetShader & GetProgram Index: GL20.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/templates/org/lwjgl/opengl/GL20.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- GL20.java 20 Feb 2005 20:53:49 -0000 1.3 +++ GL20.java 11 Mar 2005 16:16:27 -0000 1.4 @@ -187,13 +187,9 @@ boolean transpose, FloatBuffer matrices); @StripPostfix("params") - void glGetShaderfv(@GLuint int shader, @GLenum int pname, @Check FloatBuffer params); - @StripPostfix("params") void glGetShaderiv(@GLuint int shader, @GLenum int pname, @Check IntBuffer params); @StripPostfix("params") - void glGetProgramfv(@GLuint int program, @GLenum int pname, @Check FloatBuffer params); - @StripPostfix("params") void glGetProgramiv(@GLuint int program, @GLenum int pname, @Check IntBuffer params); void glGetShaderInfoLog(@GLuint int shader, @AutoSize("infoLog") @GLsizei int maxLength, |
|
From: Elias N. <eli...@us...> - 2005-03-09 13:28:29
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15152/src/java/org/lwjgl/openal Modified Files: AL.java Log Message: OpenAL: Don't use System.mapLibraryName Index: AL.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/AL.java,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- AL.java 9 Mar 2005 13:06:04 -0000 1.37 +++ AL.java 9 Mar 2005 13:28:16 -0000 1.38 @@ -138,18 +138,20 @@ String osName = System.getProperty("os.name"); String libname; + String platform_lib_name; if (osName.startsWith("Win")) { libname = "lwjglaudio"; + platform_lib_name = "lwjglaudio.dll"; } else if (osName.startsWith("Lin")) { libname = "openal"; + platform_lib_name = "libopenal.so"; } else if (osName.startsWith("Mac")) { libname = "openal"; + platform_lib_name = "openal.dylib"; } else { throw new LWJGLException("Unknown platform: "+osName); } - String platform_lib_name = System.mapLibraryName(libname); - // Add all possible paths from java.library.path String java_library_path = System.getProperty("java.library.path"); StringTokenizer st = new StringTokenizer(System.getProperty("java.library.path"), File.pathSeparator); |
|
From: Elias N. <eli...@us...> - 2005-03-09 13:06:28
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9613/src/java/org/lwjgl/openal Modified Files: AL.java Log Message: OpenAL: Moved more library loading from native to java Index: AL.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/AL.java,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- AL.java 18 Feb 2005 08:17:27 -0000 1.36 +++ AL.java 9 Mar 2005 13:06:04 -0000 1.37 @@ -35,6 +35,9 @@ import java.lang.reflect.Method; import java.util.StringTokenizer; +import java.util.List; +import java.util.ArrayList; + import org.lwjgl.LWJGLException; import org.lwjgl.Sys; @@ -130,49 +133,49 @@ private static String[] getOALPaths() throws LWJGLException { // need to pass path of possible locations of OAL to native side - String libpath = System.getProperty("java.library.path"); - String seperator = System.getProperty("path.separator"); - String jwsLibname; - + List possible_paths = new ArrayList(); + String osName = System.getProperty("os.name"); + + String libname; if (osName.startsWith("Win")) { - jwsLibname = "lwjglaudio"; + libname = "lwjglaudio"; } else if (osName.startsWith("Lin")) { - jwsLibname = "openal"; + libname = "openal"; } else if (osName.startsWith("Mac")) { - jwsLibname = "openal"; + libname = "openal"; } else { throw new LWJGLException("Unknown platform: "+osName); } - String jwsPath = getPathFromClassLoader(jwsLibname); - if (jwsPath != null) { - Sys.log("getPathFromClassLoader: Path found: " + jwsPath); - libpath += seperator - + jwsPath.substring(0, jwsPath.lastIndexOf(File.separator)); - } - String lwjgl_jws_path = getPathFromClassLoader("lwjgl"); - if (lwjgl_jws_path != null) { - Sys.log("getPathFromClassLoader: Path found: " + lwjgl_jws_path); - libpath += seperator - + lwjgl_jws_path.substring(0, lwjgl_jws_path.lastIndexOf(File.separator)); - } - StringTokenizer st = new StringTokenizer(libpath, seperator); - - //create needed string array - String[] oalPaths = new String[st.countTokens() + 1]; + String platform_lib_name = System.mapLibraryName(libname); - //build paths - for (int i = 0; i < oalPaths.length - 1; i++) { - oalPaths[i] = st.nextToken() + File.separator; + // Add all possible paths from java.library.path + String java_library_path = System.getProperty("java.library.path"); + StringTokenizer st = new StringTokenizer(System.getProperty("java.library.path"), File.pathSeparator); + while (st.hasMoreTokens()) { + String path = st.nextToken(); + possible_paths.add(path + File.separator + platform_lib_name); } - - for(int i=0 ; i<oalPaths.length; i++) { - Sys.log("Will search " + oalPaths[i] + " for " + jwsLibname); + + String classloader_path = getPathFromClassLoader(libname); + if (classloader_path != null) { + Sys.log("getPathFromClassLoader: Path found: " + classloader_path); + possible_paths.add(classloader_path); + } + String lwjgl_classloader_path = getPathFromClassLoader("lwjgl"); + if (lwjgl_classloader_path != null) { + Sys.log("getPathFromClassLoader: Path found: " + lwjgl_classloader_path); + possible_paths.add(lwjgl_classloader_path.substring(0, lwjgl_classloader_path.lastIndexOf(File.separator)) + + File.separator + platform_lib_name); } //add cwd path - oalPaths[oalPaths.length - 1] = ""; + possible_paths.add(platform_lib_name); + //create needed string array + String[] oalPaths = new String[possible_paths.size()]; + possible_paths.toArray(oalPaths); + return oalPaths; } |
|
From: Elias N. <eli...@us...> - 2005-03-09 13:06:28
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9613/src/native/common Modified Files: extal.c extal.h Log Message: OpenAL: Moved more library loading from native to java Index: extal.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/extal.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- extal.c 18 Jan 2005 15:22:52 -0000 1.21 +++ extal.c 9 Mar 2005 13:06:17 -0000 1.22 @@ -50,22 +50,20 @@ */ #ifdef _WIN32 /* Handle to OpenAL Library */ -HMODULE handleOAL; +static HMODULE handleOAL; #endif #ifdef _X11 -void* handleOGG; -void* handleVorbis; -void* handleVorbisFile; -void* handleOAL; +static void* handleOAL; #endif #ifdef _MACOSX #include <mach-o/dyld.h> #include <stdlib.h> #include <string.h> -const struct mach_header* handleOAL = NULL; +static const struct mach_header* handleOAL; #endif -alGetProcAddressPROC alGetProcAddress = NULL; +typedef ALvoid* (ALAPIENTRY *alGetProcAddressPROC)( ALubyte* fname ); +static alGetProcAddressPROC alGetProcAddress = NULL; /* Loads OpenAL */ static bool LoadOpenAL(JNIEnv *env, jobjectArray oalPaths); @@ -109,35 +107,6 @@ } /** - * Concatenate two strings - */ -static char *concatenate(const char *str1, const char *str2) { - int length1 = strlen(str1); - int length2 = strlen(str2); - char *str = (char *)calloc(length1 + length2 + 1, sizeof(char)); - strncpy(str, str1, length1); - strncpy(str + length1, str2, length2 + 1); - return str; -} - -#ifdef _X11 -static void closeVorbisLibs(void) { - if (handleOGG != NULL) { - dlclose(handleOGG); - handleOGG = NULL; - } - if (handleVorbis != NULL) { - dlclose(handleVorbis); - handleVorbis = NULL; - } - if (handleVorbisFile != NULL) { - dlclose(handleVorbisFile); - handleVorbisFile = NULL; - } -} -#endif - -/** * Loads the OpenAL Library */ static bool LoadOpenAL(JNIEnv *env, jobjectArray oalPaths) { @@ -145,7 +114,6 @@ int i; jstring path; char *path_str; - char *lib_str; printfDebug("Found %d OpenAL paths\n", (int)pathcount); for(i=0;i<pathcount;i++) { @@ -153,35 +121,13 @@ path_str = GetStringNativeChars(env, path); printfDebug("Testing '%s'\n", path_str); #ifdef _WIN32 - lib_str = concatenate(path_str, "lwjglaudio.dll"); - handleOAL = LoadLibrary(lib_str); - free(lib_str); + handleOAL = LoadLibrary(path_str); #endif #ifdef _X11 - lib_str = concatenate(path_str, "libogg.so.0"); - handleOGG = dlopen(lib_str, RTLD_LAZY); - free(lib_str); - - lib_str = concatenate(path_str, "libvorbis.so.0"); - handleVorbis = dlopen(lib_str, RTLD_LAZY); - free(lib_str); - - lib_str = concatenate(path_str, "libvorbisfile.so.3"); - handleVorbisFile = dlopen(lib_str, RTLD_LAZY); - free(lib_str); - - lib_str = concatenate(path_str, "libopenal.so"); - handleOAL = dlopen(lib_str, RTLD_LAZY); - free(lib_str); - - if (handleOAL == NULL) { - closeVorbisLibs(); - } + handleOAL = dlopen(path_str, RTLD_LAZY); #endif #ifdef _MACOSX - lib_str = concatenate(path_str, "openal.dylib"); - handleOAL = NSAddImage(lib_str, NSADDIMAGE_OPTION_RETURN_ON_ERROR); - free(lib_str); + handleOAL = NSAddImage(path_str, NSADDIMAGE_OPTION_RETURN_ON_ERROR); #endif if (handleOAL != NULL) { printfDebug("Found OpenAL at '%s'\n", path_str); @@ -207,7 +153,6 @@ dlclose(handleOAL); handleOAL = NULL; } - closeVorbisLibs(); #endif #ifdef _MACOSX // Cannot remove the image Index: extal.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/extal.h,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- extal.h 15 Feb 2005 11:05:13 -0000 1.34 +++ extal.h 9 Mar 2005 13:06:17 -0000 1.35 @@ -96,8 +96,7 @@ void InitializeOpenAL(JNIEnv *env, jobjectArray oalPaths); void DeInitializeOpenAL(); -typedef ALvoid* (ALAPIENTRY *alGetProcAddressPROC)( ALubyte* fname ); -extern alGetProcAddressPROC alGetProcAddress; +//extern alGetProcAddressPROC alGetProcAddress; typedef ALCcontext* (ALCAPIENTRY *alcGetCurrentContextPROC)(ALCvoid); extern alcGetCurrentContextPROC alcGetCurrentContext; |
|
From: Ioannis T. <sp...@us...> - 2005-03-09 10:14:41
|
Update of /cvsroot/java-game-lib/LWJGL/src/templates/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27627 Modified Files: ATI_texture_compression_3dc.java Log Message: Fixed constant name Index: ATI_texture_compression_3dc.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/templates/org/lwjgl/opengl/ATI_texture_compression_3dc.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ATI_texture_compression_3dc.java 20 Feb 2005 20:53:49 -0000 1.3 +++ ATI_texture_compression_3dc.java 9 Mar 2005 10:14:28 -0000 1.4 @@ -35,5 +35,5 @@ @Extension(postfix="ATI", className="ATITextureCompression3DC") public interface ATI_texture_compression_3dc { - int GL_COMPRESSED_RGB_3DC_ATI = 0x8837; + int GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI = 0x8837; } |
|
From: Elias N. <eli...@us...> - 2005-03-09 08:37:18
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3225/src/java/org/lwjgl/opengl Modified Files: AWTGLCanvas.java Win32CanvasImplementation.java Log Message: Moved Win32 specific code to win32 specific class(!) Index: Win32CanvasImplementation.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/Win32CanvasImplementation.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Win32CanvasImplementation.java 21 Feb 2005 14:46:42 -0000 1.1 +++ Win32CanvasImplementation.java 9 Mar 2005 08:37:06 -0000 1.2 @@ -49,6 +49,10 @@ * @version $Revision$ */ final class Win32CanvasImplementation implements AWTCanvasImplementation { + static { + System.loadLibrary("jawt"); + } + public PeerInfo createPeerInfo(AWTGLCanvas canvas, PixelFormat pixel_format) throws LWJGLException { return new Win32AWTGLCanvasPeerInfo(canvas, pixel_format); } Index: AWTGLCanvas.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/AWTGLCanvas.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- AWTGLCanvas.java 8 Mar 2005 20:44:41 -0000 1.9 +++ AWTGLCanvas.java 9 Mar 2005 08:37:05 -0000 1.10 @@ -65,7 +65,6 @@ if (OS_NAME.startsWith("Linux")) { class_name = "org.lwjgl.opengl.LinuxCanvasImplementation"; } else if (OS_NAME.startsWith("Windows")) { - System.loadLibrary("jawt"); class_name = "org.lwjgl.opengl.Win32CanvasImplementation"; } else if (OS_NAME.startsWith("Mac")) { class_name = "org.lwjgl.opengl.MacOSXCanvasImplementation"; |
|
From: Caspian Rychlik-P. <ci...@us...> - 2005-03-08 23:14:15
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31476/src/java/org/lwjgl Modified Files: Sys.java Log Message: Fixed up bugs and problems in new timer calibration code. Index: Sys.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/Sys.java,v retrieving revision 1.80 retrieving revision 1.81 diff -u -d -r1.80 -r1.81 --- Sys.java 8 Mar 2005 14:46:46 -0000 1.80 +++ Sys.java 8 Mar 2005 23:13:50 -0000 1.81 @@ -97,8 +97,8 @@ /** Current recalibration timer value, in milliseconds */ private static long recalibrationNow; - /** Total hires ticks that have passed since we started using recalibrated time */ - private static long ticksSinceRecalibration; + /** Hires time when we started counting recalibration time */ + private static long hiresRecalibrationThen; /** Last lowres timer time, in milliseconds */ private static long lowresThen; @@ -223,23 +223,35 @@ if (currentResolution == defaultResolution) { // Start timing - ticksSinceRecalibration = 0L; + hiresRecalibrationThen = hiresNow; recalibrationThen = lowresNow; recalibrationNow = lowresNow; } else { // Continue counting ticks - ticksSinceRecalibration += getTime(); - recalibrationNow = lowresNow; - long totalTicksSinceRecalibrationStarted = recalibrationNow - recalibrationThen; - if (totalTicksSinceRecalibrationStarted > LONG_RECALIBRATION_THRESHOLD) { - // Ok, we've now been operating at a different resolution for long enough. - // Let's choose a new default resolution based on the average we've - // calculated since it first started needing recalibrating - long actualRecalibrationDuration = recalibrationNow - recalibrationThen; - defaultResolution = (long) (1000.0 * totalTicksSinceRecalibrationStarted / actualRecalibrationDuration); - tempResolution = defaultResolution; - if (DEBUG_CALIBRATION) { - System.err.println("Permanent recalibration to "+defaultResolution+" ticks per second"); + long ticksSinceRecalibration = hiresNow - hiresRecalibrationThen; + if (ticksSinceRecalibration < 0) { + // Bah. Wrapped timer, so forget it this time and start over. + hiresRecalibrationThen = hiresNow; + recalibrationThen = lowresNow; + } else { + recalibrationNow = lowresNow; + long totalMillisSinceRecalibrationStarted = recalibrationNow - recalibrationThen; + if (totalMillisSinceRecalibrationStarted > LONG_RECALIBRATION_THRESHOLD) { + // Ok, we've now been operating at a different resolution for long enough. + // Let's choose a new default resolution based on the average we've + // calculated since it first started needing recalibrating + long totalTicksSinceRecalibrationStarted = hiresNow - hiresRecalibrationThen; + if (totalTicksSinceRecalibrationStarted > 0) { + defaultResolution = (long) (1000.0 * totalTicksSinceRecalibrationStarted / totalMillisSinceRecalibrationStarted); + tempResolution = defaultResolution; + if (DEBUG_CALIBRATION) { + System.err.println("Permanent recalibration to "+defaultResolution+" ticks per second"); + } + } else { + // Bah. Once again, a wrapped timer. + hiresRecalibrationThen = hiresNow; + recalibrationThen = lowresNow; + } } } } @@ -247,11 +259,6 @@ // Temporarily change current resolution to the recently calculated resolution currentResolution = tempResolution; } else { - // Recalibrate the baseline using the operating system - defaultResolution = implementation.getTimerResolution(); - if (DEBUG_CALIBRATION && currentResolution != defaultResolution) { - System.err.println("Resetting to system calibration "+defaultResolution+" ticks per second"); - } currentResolution = defaultResolution; } } |
|
From: Brian M. <ma...@us...> - 2005-03-08 20:44:51
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24338/src/java/org/lwjgl/opengl Modified Files: AWTGLCanvas.java Log Message: fixed loading of awt through use of loadLibrary on windows Index: AWTGLCanvas.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/AWTGLCanvas.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- AWTGLCanvas.java 23 Feb 2005 11:11:06 -0000 1.8 +++ AWTGLCanvas.java 8 Mar 2005 20:44:41 -0000 1.9 @@ -65,6 +65,7 @@ if (OS_NAME.startsWith("Linux")) { class_name = "org.lwjgl.opengl.LinuxCanvasImplementation"; } else if (OS_NAME.startsWith("Windows")) { + System.loadLibrary("jawt"); class_name = "org.lwjgl.opengl.Win32CanvasImplementation"; } else if (OS_NAME.startsWith("Mac")) { class_name = "org.lwjgl.opengl.MacOSXCanvasImplementation"; |
|
From: Caspian Rychlik-P. <ci...@us...> - 2005-03-08 14:46:57
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21698/src/java/org/lwjgl Modified Files: Sys.java Log Message: New auto-calibrating system hires timer. Index: Sys.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/Sys.java,v retrieving revision 1.79 retrieving revision 1.80 diff -u -d -r1.79 -r1.80 --- Sys.java 23 Feb 2005 11:22:14 -0000 1.79 +++ Sys.java 8 Mar 2005 14:46:46 -0000 1.80 @@ -55,13 +55,69 @@ /** Debug flag. */ public static final boolean DEBUG = Boolean.getBoolean("org.lwjgl.Sys.debug"); - - /** OS Name */ - private final static String OS_NAME = System.getProperty("os.name"); + + /** OS Name */ + private final static String OS_NAME = System.getProperty("os.name"); /** The implementation instance to delegate platform specific behavior to */ private final static SysImplementation implementation; + + /* + * Timer calibration. The hires timers on some systems - notably SpeedStep chips, + * HyperThreaded chips, or dual-processor/cores, are notoriously inaccurate. We + * therefore need to calibrate the hires timer with a lowres timer that is known + * to keep much more accurate time. System.currentTimeMillis() keeps accurate time + * down to a worst-case resolution of 50ms, which is good enough for us as it means + * at worst we will have 3-4 frames at the wrong rate if a hires timer resolution + * change occurs. + */ + + /** Master control: override all our clever recalibration */ + private static final boolean OVERRIDE_CALIBRATION = Boolean.getBoolean("org.lwjgl.Sys.overrideCalibration"); + + /** Turn on debugging for calibration */ + private static final boolean DEBUG_CALIBRATION = Boolean.getBoolean("org.lwjgl.Sys.debugCalibration"); + + /** + * Timer calibration error, expressed as % variance either side of the baseline in the + * system property org.lwjhgl.Sys.timerError. 35.0% is the default. + */ + private static final double UPPER_TIMER_ERROR = 1.0 + Double.parseDouble(System.getProperty("org.lwjgl.Sys.timerError", "35.0")) / 100.0; + private static final double LOWER_TIMER_ERROR = 1.0 - Double.parseDouble(System.getProperty("org.lwjgl.Sys.timerError", "35.0")) / 100.0; + + /** Short term recalibration threshold */ + private static final long SHORT_RECALIBRATION_THRESHOLD = Long.parseLong(System.getProperty("org.lwjgl.Sys.shortRecalibrationThreshold", "50")); + + /** Long term recalibration threshold */ + private static final long LONG_RECALIBRATION_THRESHOLD = Long.parseLong(System.getProperty("org.lwjgl.Sys.longRecalibrationThreshold", "1000")); + + /** Last recalibration timer value, in milliseconds */ + private static long recalibrationThen; + + /** Current recalibration timer value, in milliseconds */ + private static long recalibrationNow; + + /** Total hires ticks that have passed since we started using recalibrated time */ + private static long ticksSinceRecalibration; + /** Last lowres timer time, in milliseconds */ + private static long lowresThen; + + /** Current lowres timer time, in milliseconds */ + private static long lowresNow; + + /** Last hires timer time, in ticks */ + private static long hiresThen; + + /** Current hires timer time, in ticks */ + private static long hiresNow; + + /** Baseline hires resolution */ + private static long defaultResolution; + + /** Current hires resolution */ + private static long currentResolution; + static { implementation = createImplementation(); System.loadLibrary(LIBRARY_NAME); @@ -117,12 +173,90 @@ } /** - * Obtains the number of ticks that the hires timer does in a second. + * Obtains the number of ticks that the hires timer does in a second. This method is fast; + * it should be called as frequently as possible, as it recalibrates the timer. * * @return timer resolution in ticks per second or 0 if no timer is present. */ public static long getTimerResolution() { - return implementation.getTimerResolution(); + + // Check for explicit override + if (OVERRIDE_CALIBRATION) { + return implementation.getTimerResolution(); + } + + // Firstly make sure we have at least some notion of a baseline + if (defaultResolution == 0L) { + defaultResolution = implementation.getTimerResolution(); + currentResolution = defaultResolution; + if (DEBUG_CALIBRATION) { + System.err.println("Initial timer calibration "+defaultResolution+" ticks per second"); + } + } + + lowresNow = System.currentTimeMillis() & 0x7FFFFFFFFFFFFFFFL; + hiresNow = getTime(); + if (lowresNow > lowresThen + SHORT_RECALIBRATION_THRESHOLD && hiresNow > hiresThen) { + // We've had a lowres timer update. We can use this to calibrate the hires timer + // resolution. + double millis = lowresNow - lowresThen; + double ticks = hiresNow - hiresThen; + lowresThen = lowresNow; + hiresThen = hiresNow; + double ticksPerSecond = 1000.0 * ticks / millis; + // If the ticksPerSecond we've calcuated is out by more than the error % from + // the baseline resolution, we will discreetly replace the returned timer resolution + // by our calculated. If this persists for more than a second or so we will adjust + // the baseline resolution to the average that we've calculated over the second. + double errorRatio = ticksPerSecond / (double) defaultResolution; + if (errorRatio < LOWER_TIMER_ERROR || errorRatio > UPPER_TIMER_ERROR) { + // We're outside the acceptable range so we will use the newly calculated ticks + // per second. If we were already using recalibrated time, we start counting + // the ticks that pass over a certain length of time. If that duration is exceeded + // and we're still using recalibrated time, we permanently recalibrate. + + long tempResolution = (long) ticksPerSecond; + + if (DEBUG_CALIBRATION) { + System.err.println("Temporary recalibration to "+tempResolution+" ticks per second"); + } + + if (currentResolution == defaultResolution) { + // Start timing + ticksSinceRecalibration = 0L; + recalibrationThen = lowresNow; + recalibrationNow = lowresNow; + } else { + // Continue counting ticks + ticksSinceRecalibration += getTime(); + recalibrationNow = lowresNow; + long totalTicksSinceRecalibrationStarted = recalibrationNow - recalibrationThen; + if (totalTicksSinceRecalibrationStarted > LONG_RECALIBRATION_THRESHOLD) { + // Ok, we've now been operating at a different resolution for long enough. + // Let's choose a new default resolution based on the average we've + // calculated since it first started needing recalibrating + long actualRecalibrationDuration = recalibrationNow - recalibrationThen; + defaultResolution = (long) (1000.0 * totalTicksSinceRecalibrationStarted / actualRecalibrationDuration); + tempResolution = defaultResolution; + if (DEBUG_CALIBRATION) { + System.err.println("Permanent recalibration to "+defaultResolution+" ticks per second"); + } + } + } + + // Temporarily change current resolution to the recently calculated resolution + currentResolution = tempResolution; + } else { + // Recalibrate the baseline using the operating system + defaultResolution = implementation.getTimerResolution(); + if (DEBUG_CALIBRATION && currentResolution != defaultResolution) { + System.err.println("Resetting to system calibration "+defaultResolution+" ticks per second"); + } + currentResolution = defaultResolution; + } + } + + return currentResolution; } /** |
|
From: Brian M. <ma...@us...> - 2005-03-07 16:17:44
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl/awt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5415/src/java/org/lwjgl/test/opengl/awt Modified Files: AWTGears.java Log Message: cleanup Index: AWTGears.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl/awt/AWTGears.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- AWTGears.java 7 Mar 2005 16:15:14 -0000 1.1 +++ AWTGears.java 7 Mar 2005 16:17:25 -0000 1.2 @@ -5,7 +5,6 @@ package org.lwjgl.test.opengl.awt; import java.awt.Frame; -import java.awt.Toolkit; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.nio.FloatBuffer; @@ -16,15 +15,14 @@ import org.lwjgl.opengl.AWTGLCanvas; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GLContext; -import org.lwjgl.opengl.glu.GLU; /** * $Id$ * <p> - * Tests AWTGLCanvas functionality + * AWT version of the gears demo * <p> * @version $Revision$ - * @author $Author$ + * @author Brian Matzon <br...@ma...> */ public class AWTGears extends Frame { |
|
From: Brian M. <ma...@us...> - 2005-03-07 16:15:29
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl/awt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4805/src/java/org/lwjgl/test/opengl/awt Added Files: AWTGears.java Log Message: AWT version of gears --- NEW FILE: AWTGears.java --- /* * Copyright (c) 2004-2005 Covalent Software Ltd * All rights reserved. */ package org.lwjgl.test.opengl.awt; import java.awt.Frame; import java.awt.Toolkit; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.nio.FloatBuffer; import org.lwjgl.BufferUtils; import org.lwjgl.LWJGLException; import org.lwjgl.opengl.ARBTransposeMatrix; import org.lwjgl.opengl.AWTGLCanvas; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GLContext; import org.lwjgl.opengl.glu.GLU; /** * $Id$ * <p> * Tests AWTGLCanvas functionality * <p> * @version $Revision$ * @author $Author$ */ public class AWTGears extends Frame { /** AWT GL canvas */ private AWTGLCanvas canvas0; private float view_rotx = 20.0f; private float view_roty = 30.0f; private float view_rotz = 0.0f; private int gear1; private int gear2; private int gear3; private float angle = 0.0f; /** * C'tor */ public AWTGears() throws LWJGLException { setTitle("Gears"); setSize(300, 300); setLayout(null); add(canvas0 = new AWTGLCanvas() { long startTime = 0; long fps = 0; public void paintGL() { if(startTime == 0) { setup(); startTime = System.currentTimeMillis() + 5000; } try { angle += 2.0f; GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); GL11.glPushMatrix(); GL11.glRotatef(view_rotx, 1.0f, 0.0f, 0.0f); GL11.glRotatef(view_roty, 0.0f, 1.0f, 0.0f); GL11.glRotatef(view_rotz, 0.0f, 0.0f, 1.0f); GL11.glPushMatrix(); GL11.glTranslatef(-3.0f, -2.0f, 0.0f); GL11.glRotatef(angle, 0.0f, 0.0f, 1.0f); GL11.glCallList(gear1); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslatef(3.1f, -2.0f, 0.0f); GL11.glRotatef(-2.0f * angle - 9.0f, 0.0f, 0.0f, 1.0f); GL11.glCallList(gear2); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslatef(-3.1f, 4.2f, 0.0f); GL11.glRotatef(-2.0f * angle - 25.0f, 0.0f, 0.0f, 1.0f); GL11.glCallList(gear3); GL11.glPopMatrix(); GL11.glPopMatrix(); swapBuffers(); } catch (LWJGLException e) { throw new RuntimeException(e); } if (startTime > System.currentTimeMillis()) { fps++; } else { long timeUsed = 5000 + (startTime - System.currentTimeMillis()); startTime = System.currentTimeMillis() + 5000; System.out.println(fps + " frames in " + (float) (timeUsed / 1000f) + " seconds = " + (fps / (timeUsed / 1000f))); fps = 0; } } }); canvas0.setBounds(0, 0, 300, 300); addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { dispose(); } }); setResizable(true); setVisible(true); new Thread() { { setDaemon(true); } public void run() { for (;;) { canvas0.repaint(); } } }.start(); } private void setup() { // setup ogl FloatBuffer pos = BufferUtils.createFloatBuffer(4).put(new float[] { 5.0f, 5.0f, 10.0f, 0.0f}); FloatBuffer red = BufferUtils.createFloatBuffer(4).put(new float[] { 0.8f, 0.1f, 0.0f, 1.0f}); FloatBuffer green = BufferUtils.createFloatBuffer(4).put(new float[] { 0.0f, 0.8f, 0.2f, 1.0f}); FloatBuffer blue = BufferUtils.createFloatBuffer(4).put(new float[] { 0.2f, 0.2f, 1.0f, 1.0f}); pos.flip(); red.flip(); green.flip(); blue.flip(); GL11.glLight(GL11.GL_LIGHT0, GL11.GL_POSITION, pos); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_LIGHT0); GL11.glEnable(GL11.GL_DEPTH_TEST); /* make the gears */ gear1 = GL11.glGenLists(1); GL11.glNewList(gear1, GL11.GL_COMPILE); GL11.glMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT_AND_DIFFUSE, red); gear(1.0f, 4.0f, 1.0f, 20, 0.7f); GL11.glEndList(); gear2 = GL11.glGenLists(1); GL11.glNewList(gear2, GL11.GL_COMPILE); GL11.glMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT_AND_DIFFUSE, green); gear(0.5f, 2.0f, 2.0f, 10, 0.7f); GL11.glEndList(); gear3 = GL11.glGenLists(1); GL11.glNewList(gear3, GL11.GL_COMPILE); GL11.glMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT_AND_DIFFUSE, blue); gear(1.3f, 2.0f, 0.5f, 10, 0.7f); GL11.glEndList(); GL11.glEnable(GL11.GL_NORMALIZE); GL11.glMatrixMode(GL11.GL_PROJECTION); System.err.println("GL_VENDOR: " + GL11.glGetString(GL11.GL_VENDOR)); System.err.println("GL_RENDERER: " + GL11.glGetString(GL11.GL_RENDERER)); System.err.println("GL_VERSION: " + GL11.glGetString(GL11.GL_VERSION)); System.err.println(); System.err.println("glLoadTransposeMatrixfARB() supported: " + GLContext.getCapabilities().GL_ARB_transpose_matrix); if (!GLContext.getCapabilities().GL_ARB_transpose_matrix) { // --- not using extensions GL11.glLoadIdentity(); } else { // --- using extensions final FloatBuffer identityTranspose = BufferUtils.createFloatBuffer(16).put( new float[] { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1}); identityTranspose.flip(); ARBTransposeMatrix.glLoadTransposeMatrixARB(identityTranspose); } float h = (float) 300 / (float) 300; GL11.glFrustum(-1.0f, 1.0f, -h, h, 5.0f, 60.0f); GL11.glMatrixMode(GL11.GL_MODELVIEW); GL11.glLoadIdentity(); GL11.glTranslatef(0.0f, 0.0f, -40.0f); } /** * Draw a gear wheel. You'll probably want to call this function when * building a display list since we do a lot of trig here. * * @param inner_radius radius of hole at center * @param outer_radius radius at center of teeth * @param width width of gear * @param teeth number of teeth * @param tooth_depth depth of tooth */ private void gear(float inner_radius, float outer_radius, float width, int teeth, float tooth_depth) { int i; float r0, r1, r2; float angle, da; float u, v, len; r0 = inner_radius; r1 = outer_radius - tooth_depth / 2.0f; r2 = outer_radius + tooth_depth / 2.0f; da = 2.0f * (float) Math.PI / teeth / 4.0f; GL11.glShadeModel(GL11.GL_FLAT); GL11.glNormal3f(0.0f, 0.0f, 1.0f); /* draw front face */ GL11.glBegin(GL11.GL_QUAD_STRIP); for (i = 0; i <= teeth; i++) { angle = i * 2.0f * (float) Math.PI / teeth; GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), width * 0.5f); GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), width * 0.5f); if (i < teeth) { GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), width * 0.5f); GL11.glVertex3f(r1 * (float) Math.cos(angle + 3.0f * da), r1 * (float) Math.sin(angle + 3.0f * da), width * 0.5f); } } GL11.glEnd(); /* draw front sides of teeth */ GL11.glBegin(GL11.GL_QUADS); for (i = 0; i < teeth; i++) { angle = i * 2.0f * (float) Math.PI / teeth; GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), width * 0.5f); GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), width * 0.5f); GL11.glVertex3f(r2 * (float) Math.cos(angle + 2.0f * da), r2 * (float) Math.sin(angle + 2.0f * da), width * 0.5f); GL11.glVertex3f(r1 * (float) Math.cos(angle + 3.0f * da), r1 * (float) Math.sin(angle + 3.0f * da), width * 0.5f); } GL11.glEnd(); /* draw back face */ GL11.glBegin(GL11.GL_QUAD_STRIP); for (i = 0; i <= teeth; i++) { angle = i * 2.0f * (float) Math.PI / teeth; GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), -width * 0.5f); GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), -width * 0.5f); GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), -width * 0.5f); GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), -width * 0.5f); } GL11.glEnd(); /* draw back sides of teeth */ GL11.glBegin(GL11.GL_QUADS); for (i = 0; i < teeth; i++) { angle = i * 2.0f * (float) Math.PI / teeth; GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), -width * 0.5f); GL11.glVertex3f(r2 * (float) Math.cos(angle + 2 * da), r2 * (float) Math.sin(angle + 2 * da), -width * 0.5f); GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), -width * 0.5f); GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), -width * 0.5f); } GL11.glEnd(); /* draw outward faces of teeth */ GL11.glBegin(GL11.GL_QUAD_STRIP); for (i = 0; i < teeth; i++) { angle = i * 2.0f * (float) Math.PI / teeth; GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), width * 0.5f); GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), -width * 0.5f); u = r2 * (float) Math.cos(angle + da) - r1 * (float) Math.cos(angle); v = r2 * (float) Math.sin(angle + da) - r1 * (float) Math.sin(angle); len = (float) Math.sqrt(u * u + v * v); u /= len; v /= len; GL11.glNormal3f(v, -u, 0.0f); GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), width * 0.5f); GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), -width * 0.5f); GL11.glNormal3f((float) Math.cos(angle), (float) Math.sin(angle), 0.0f); GL11.glVertex3f(r2 * (float) Math.cos(angle + 2 * da), r2 * (float) Math.sin(angle + 2 * da), width * 0.5f); GL11.glVertex3f(r2 * (float) Math.cos(angle + 2 * da), r2 * (float) Math.sin(angle + 2 * da), -width * 0.5f); u = r1 * (float) Math.cos(angle + 3 * da) - r2 * (float) Math.cos(angle + 2 * da); v = r1 * (float) Math.sin(angle + 3 * da) - r2 * (float) Math.sin(angle + 2 * da); GL11.glNormal3f(v, -u, 0.0f); GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), width * 0.5f); GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), -width * 0.5f); GL11.glNormal3f((float) Math.cos(angle), (float) Math.sin(angle), 0.0f); } GL11.glVertex3f(r1 * (float) Math.cos(0), r1 * (float) Math.sin(0), width * 0.5f); GL11.glVertex3f(r1 * (float) Math.cos(0), r1 * (float) Math.sin(0), -width * 0.5f); GL11.glEnd(); GL11.glShadeModel(GL11.GL_SMOOTH); /* draw inside radius cylinder */ GL11.glBegin(GL11.GL_QUAD_STRIP); for (i = 0; i <= teeth; i++) { angle = i * 2.0f * (float) Math.PI / teeth; GL11.glNormal3f(-(float) Math.cos(angle), -(float) Math.sin(angle), 0.0f); GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), -width * 0.5f); GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), width * 0.5f); } GL11.glEnd(); } public static void main(String[] args) throws LWJGLException { new AWTGears(); } } |