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
|
2
|
3
(5) |
4
|
|
5
(1) |
6
(16) |
7
(3) |
8
(3) |
9
(4) |
10
(13) |
11
(5) |
|
12
(1) |
13
(1) |
14
|
15
(7) |
16
(4) |
17
(1) |
18
(1) |
|
19
(3) |
20
|
21
(1) |
22
(16) |
23
|
24
(2) |
25
|
|
26
(1) |
27
(4) |
28
(6) |
29
(3) |
30
(1) |
|
|
|
From: Elias N. <eli...@us...> - 2004-09-10 22:06:39
|
Update of /cvsroot/java-game-lib/LWJGL In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6954 Modified Files: SignatureDump.java Log Message: Converted native code from C++ (.cpp files) to C (.c files), thus avoiding an annoying dependency on the standard C++ library on Linux. We weren't using any particular C++ features anyway. Index: SignatureDump.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/SignatureDump.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- SignatureDump.java 23 May 2004 15:35:07 -0000 1.1 +++ SignatureDump.java 10 Sep 2004 08:13:46 -0000 1.2 @@ -29,7 +29,7 @@ System.out.print("NULL"); System.out.print(", "); if (gl_name != null) { - System.out.print("(void**)&"); + System.out.print("(void*)&"); System.out.print(gl_name); } else System.out.print("NULL"); |
Update of /cvsroot/java-game-lib/LWJGL/src/native/common/arb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6954/src/native/common/arb Modified Files: Makefile.am Added Files: org_lwjgl_opengl_ARBBufferObject.c org_lwjgl_opengl_ARBDrawBuffers.c org_lwjgl_opengl_ARBImaging.c org_lwjgl_opengl_ARBMatrixPalette.c org_lwjgl_opengl_ARBMultisample.c org_lwjgl_opengl_ARBMultitexture.c org_lwjgl_opengl_ARBOcclusionQuery.c org_lwjgl_opengl_ARBPointParameters.c org_lwjgl_opengl_ARBProgram.c org_lwjgl_opengl_ARBShaderObjects.c org_lwjgl_opengl_ARBTextureCompression.c org_lwjgl_opengl_ARBTransposeMatrix.c org_lwjgl_opengl_ARBVertexBlend.c org_lwjgl_opengl_ARBVertexProgram.c org_lwjgl_opengl_ARBVertexShader.c org_lwjgl_opengl_ARBWindowPos.c Removed Files: org_lwjgl_opengl_ARBBufferObject.cpp org_lwjgl_opengl_ARBDrawBuffers.cpp org_lwjgl_opengl_ARBImaging.cpp org_lwjgl_opengl_ARBMatrixPalette.cpp org_lwjgl_opengl_ARBMultisample.cpp org_lwjgl_opengl_ARBMultitexture.cpp org_lwjgl_opengl_ARBOcclusionQuery.cpp org_lwjgl_opengl_ARBPointParameters.cpp org_lwjgl_opengl_ARBProgram.cpp org_lwjgl_opengl_ARBShaderObjects.cpp org_lwjgl_opengl_ARBTextureCompression.cpp org_lwjgl_opengl_ARBTransposeMatrix.cpp org_lwjgl_opengl_ARBVertexBlend.cpp org_lwjgl_opengl_ARBVertexProgram.cpp org_lwjgl_opengl_ARBVertexShader.cpp org_lwjgl_opengl_ARBWindowPos.cpp Log Message: Converted native code from C++ (.cpp files) to C (.c files), thus avoiding an annoying dependency on the standard C++ library on Linux. We weren't using any particular C++ features anyway. --- NEW FILE: org_lwjgl_opengl_ARBDrawBuffers.c --- /* * Copyright (c) 2002-2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // ---------------------------------- // IMPLEMENTATION OF NATIVE METHODS FOR CLASS: org.lwjgl.opengl.ARBDrawBuffers // ---------------------------------- #include "extgl.h" typedef void (APIENTRY * glDrawBuffersARBPROC) (GLsizei n, const GLenum *bufs); static glDrawBuffersARBPROC glDrawBuffersARB; /* * Class: org.lwjgl.opengl.ARBDrawBuffers * Method: nglDrawBuffersARB */ static void JNICALL Java_org_lwjgl_opengl_ARBDrawBuffers_nglDrawBuffersARB (JNIEnv * env, jclass clazz, jint size, jobject buffers, jint buffersOffset) { GLuint *buffers_ptr = (GLuint *)(*env)->GetDirectBufferAddress(env, buffers) + buffersOffset; glDrawBuffersARB(size, buffers_ptr); } #ifdef __clplusplus extern "C" { #endif JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBDrawBuffers_initNativeStubs(JNIEnv *env, jclass clazz) { JavaMethodAndExtFunction functions[] = { {"nglDrawBuffersARB", "(ILjava/nio/IntBuffer;I)V", (void*)&Java_org_lwjgl_opengl_ARBDrawBuffers_nglDrawBuffersARB, "glDrawBuffersARB", (void*)&glDrawBuffersARB} }; int num_functions = NUMFUNCTIONS(functions); extgl_InitializeClass(env, clazz, num_functions, functions); } #ifdef __cplusplus } #endif --- NEW FILE: org_lwjgl_opengl_ARBMatrixPalette.c --- /* * Copyright (c) 2002-2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // ---------------------------------- // IMPLEMENTATION OF NATIVE METHODS FOR CLASS: org.lwjgl.opengl.ARBMatrixPalette // ---------------------------------- #include "extgl.h" typedef void (APIENTRY * glCurrentPaletteMatrixARBPROC) (GLint index); typedef void (APIENTRY * glMatrixIndexubvARBPROC) (GLint size, GLubyte *indices); typedef void (APIENTRY * glMatrixIndexusvARBPROC) (GLint size, GLushort *indices); typedef void (APIENTRY * glMatrixIndexuivARBPROC) (GLint size, GLuint *indices); typedef void (APIENTRY * glMatrixIndexPointerARBPROC) (GLint size, GLenum type, GLsizei stride, GLvoid *pointer); static glCurrentPaletteMatrixARBPROC glCurrentPaletteMatrixARB; static glMatrixIndexubvARBPROC glMatrixIndexubvARB; static glMatrixIndexusvARBPROC glMatrixIndexusvARB; static glMatrixIndexuivARBPROC glMatrixIndexuivARB; static glMatrixIndexPointerARBPROC glMatrixIndexPointerARB; /* * Class: org.lwjgl.opengl.ARBMatrixPalette * Method: glCurrentPaletteMatrixARB */ static void JNICALL Java_org_lwjgl_opengl_ARBMatrixPalette_glCurrentPaletteMatrixARB (JNIEnv * env, jclass clazz, jint index) { glCurrentPaletteMatrixARB(index); } /* * Class: org.lwjgl.opengl.ARBMatrixPalette * Method: nglMatrixIndexPointerARB */ static void JNICALL Java_org_lwjgl_opengl_ARBMatrixPalette_nglMatrixIndexPointerARB (JNIEnv * env, jclass clazz, jint size, jint type, jint stride, jobject pPointer, jint pPointer_offset) { GLvoid *pPointer_ptr = (GLvoid *)((GLubyte *)(*env)->GetDirectBufferAddress(env, pPointer) + pPointer_offset); glMatrixIndexPointerARB(size, type, stride, pPointer_ptr); } /* * Class: org.lwjgl.opengl.ARBMatrixPalette * Method: nglMatrixIndexPointerARBVBO */ static void JNICALL Java_org_lwjgl_opengl_ARBMatrixPalette_nglMatrixIndexPointerARBVBO (JNIEnv * env, jclass clazz, jint size, jint type, jint stride, jint buffer_offset) { glMatrixIndexPointerARB(size, type, stride, (GLvoid *)buffer_offset); } /* * Class: org.lwjgl.opengl.ARBMatrixPalette * Method: nglMatrixIndexubvARB */ static void JNICALL Java_org_lwjgl_opengl_ARBMatrixPalette_nglMatrixIndexubvARB (JNIEnv * env, jclass clazz, jint size, jobject pIndices, jint pIndices_offset) { GLubyte *pIndices_ptr = (GLubyte *)(*env)->GetDirectBufferAddress(env, pIndices) + pIndices_offset; glMatrixIndexubvARB(size, pIndices_ptr); } /* * Class: org.lwjgl.opengl.ARBMatrixPalette * Method: nglMatrixIndexuivARB */ static void JNICALL Java_org_lwjgl_opengl_ARBMatrixPalette_nglMatrixIndexuivARB (JNIEnv * env, jclass clazz, jint size, jobject piIndices, jint piIndices_offset) { GLuint *piIndices_ptr = (GLuint *)(*env)->GetDirectBufferAddress(env, piIndices) + piIndices_offset; glMatrixIndexuivARB(size, piIndices_ptr); } /* * Class: org.lwjgl.opengl.ARBMatrixPalette * Method: nglMatrixIndexusvARB */ static void JNICALL Java_org_lwjgl_opengl_ARBMatrixPalette_nglMatrixIndexusvARB (JNIEnv * env, jclass clazz, jint size, jobject psIndices, jint psIndices_offset) { GLushort *psIndices_ptr = (GLushort *)(*env)->GetDirectBufferAddress(env, psIndices) + psIndices_offset; glMatrixIndexusvARB(size, psIndices_ptr); } #ifdef _cplusplus extern "C" { #endif JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBMatrixPalette_initNativeStubs(JNIEnv *env, jclass clazz) { JavaMethodAndExtFunction functions[] = { {"glCurrentPaletteMatrixARB", "(I)V", (void*)&Java_org_lwjgl_opengl_ARBMatrixPalette_glCurrentPaletteMatrixARB, "glCurrentPaletteMatrixARB", (void*)&glCurrentPaletteMatrixARB}, {"nglMatrixIndexPointerARB", "(IIILjava/nio/Buffer;I)V", (void*)&Java_org_lwjgl_opengl_ARBMatrixPalette_nglMatrixIndexPointerARB, "glMatrixIndexPointerARB", (void*)&glMatrixIndexPointerARB}, {"nglMatrixIndexPointerARBVBO", "(IIII)V", (void*)&Java_org_lwjgl_opengl_ARBMatrixPalette_nglMatrixIndexPointerARBVBO, NULL, NULL}, {"nglMatrixIndexubvARB", "(ILjava/nio/ByteBuffer;I)V", (void*)&Java_org_lwjgl_opengl_ARBMatrixPalette_nglMatrixIndexubvARB, "glMatrixIndexubvARB", (void*)&glMatrixIndexubvARB}, {"nglMatrixIndexuivARB", "(ILjava/nio/IntBuffer;I)V", (void*)&Java_org_lwjgl_opengl_ARBMatrixPalette_nglMatrixIndexuivARB, "glMatrixIndexuivARB", (void*)&glMatrixIndexuivARB}, {"nglMatrixIndexusvARB", "(ILjava/nio/ShortBuffer;I)V", (void*)&Java_org_lwjgl_opengl_ARBMatrixPalette_nglMatrixIndexusvARB, "glMatrixIndexusvARB", (void*)&glMatrixIndexusvARB} }; int num_functions = NUMFUNCTIONS(functions); extgl_InitializeClass(env, clazz, num_functions, functions); } #ifdef __cplusplus } #endif --- NEW FILE: org_lwjgl_opengl_ARBVertexProgram.c --- /* * Copyright (c) 2002-2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // ---------------------------------- // IMPLEMENTATION OF NATIVE METHODS FOR CLASS: org.lwjgl.opengl.ARBVertexProgram // ---------------------------------- #include "extgl.h" #include "common_tools.h" typedef void (APIENTRY * glVertexAttrib1sARBPROC) (GLuint index, GLshort x); typedef void (APIENTRY * glVertexAttrib1fARBPROC) (GLuint index, GLfloat x); typedef void (APIENTRY * glVertexAttrib2sARBPROC) (GLuint index, GLshort x, GLshort y); typedef void (APIENTRY * glVertexAttrib2fARBPROC) (GLuint index, GLfloat x, GLfloat y); typedef void (APIENTRY * glVertexAttrib3sARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z); typedef void (APIENTRY * glVertexAttrib3fARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); typedef void (APIENTRY * glVertexAttrib4sARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); typedef void (APIENTRY * glVertexAttrib4fARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); typedef void (APIENTRY * glVertexAttrib4NubARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); typedef void (APIENTRY * glVertexAttrib1svARBPROC) (GLuint index, const GLshort *v); typedef void (APIENTRY * glVertexAttrib1fvARBPROC) (GLuint index, const GLfloat *v); typedef void (APIENTRY * glVertexAttrib2svARBPROC) (GLuint index, const GLshort *v); typedef void (APIENTRY * glVertexAttrib2fvARBPROC) (GLuint index, const GLfloat *v); typedef void (APIENTRY * glVertexAttrib2dvARBPROC) (GLuint index, const GLdouble *v); typedef void (APIENTRY * glVertexAttrib3svARBPROC) (GLuint index, const GLshort *v); typedef void (APIENTRY * glVertexAttrib3fvARBPROC) (GLuint index, const GLfloat *v); typedef void (APIENTRY * glVertexAttrib3dvARBPROC) (GLuint index, const GLdouble *v); typedef void (APIENTRY * glVertexAttrib4bvARBPROC) (GLuint index, const GLbyte *v); typedef void (APIENTRY * glVertexAttrib4svARBPROC) (GLuint index, const GLshort *v); typedef void (APIENTRY * glVertexAttrib4ivARBPROC) (GLuint index, const GLint *v); typedef void (APIENTRY * glVertexAttrib4ubvARBPROC) (GLuint index, const GLubyte *v); typedef void (APIENTRY * glVertexAttrib4usvARBPROC) (GLuint index, const GLushort *v); typedef void (APIENTRY * glVertexAttrib4uivARBPROC) (GLuint index, const GLuint *v); typedef void (APIENTRY * glVertexAttrib4fvARBPROC) (GLuint index, const GLfloat *v); typedef void (APIENTRY * glVertexAttrib4dvARBPROC) (GLuint index, const GLdouble *v); typedef void (APIENTRY * glVertexAttrib4NbvARBPROC) (GLuint index, const GLbyte *v); typedef void (APIENTRY * glVertexAttrib4NsvARBPROC) (GLuint index, const GLshort *v); typedef void (APIENTRY * glVertexAttrib4NivARBPROC) (GLuint index, const GLint *v); typedef void (APIENTRY * glVertexAttrib4NubvARBPROC) (GLuint index, const GLubyte *v); typedef void (APIENTRY * glVertexAttrib4NusvARBPROC) (GLuint index, const GLushort *v); typedef void (APIENTRY * glVertexAttrib4NuivARBPROC) (GLuint index, const GLuint *v); typedef void (APIENTRY * glVertexAttribPointerARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); typedef void (APIENTRY * glEnableVertexAttribArrayARBPROC) (GLuint index); typedef void (APIENTRY * glDisableVertexAttribArrayARBPROC) (GLuint index); typedef void (APIENTRY * glGetVertexAttribdvARBPROC) (GLuint index, GLenum pname, GLdouble *params); typedef void (APIENTRY * glGetVertexAttribfvARBPROC) (GLuint index, GLenum pname, GLfloat *params); typedef void (APIENTRY * glGetVertexAttribivARBPROC) (GLuint index, GLenum pname, GLint *params); typedef void (APIENTRY * glGetVertexAttribPointervARBPROC) (GLuint index, GLenum pname, GLvoid **pointer); static glVertexAttrib1sARBPROC glVertexAttrib1sARB; static glVertexAttrib1fARBPROC glVertexAttrib1fARB; static glVertexAttrib2sARBPROC glVertexAttrib2sARB; static glVertexAttrib2fARBPROC glVertexAttrib2fARB; static glVertexAttrib3sARBPROC glVertexAttrib3sARB; static glVertexAttrib3fARBPROC glVertexAttrib3fARB; static glVertexAttrib4sARBPROC glVertexAttrib4sARB; static glVertexAttrib4fARBPROC glVertexAttrib4fARB; static glVertexAttrib4NubARBPROC glVertexAttrib4NubARB; static glVertexAttribPointerARBPROC glVertexAttribPointerARB; static glEnableVertexAttribArrayARBPROC glEnableVertexAttribArrayARB; static glDisableVertexAttribArrayARBPROC glDisableVertexAttribArrayARB; static glGetVertexAttribfvARBPROC glGetVertexAttribfvARB; static glGetVertexAttribivARBPROC glGetVertexAttribivARB; static glGetVertexAttribPointervARBPROC glGetVertexAttribPointervARB; /* * Class: org.lwjgl.opengl.ARBVertexProgram * Method: glVertexAttrib1sARB */ static void JNICALL Java_org_lwjgl_opengl_ARBVertexProgram_glVertexAttrib1sARB (JNIEnv * env, jclass clazz, jint index, jshort x) { glVertexAttrib1sARB(index, x); } /* * Class: org.lwjgl.opengl.ARBVertexProgram * Method: glVertexAttrib1fARB */ static void JNICALL Java_org_lwjgl_opengl_ARBVertexProgram_glVertexAttrib1fARB (JNIEnv * env, jclass clazz, jint index, jfloat x) { glVertexAttrib1fARB(index, x); } /* * Class: org.lwjgl.opengl.ARBVertexProgram * Method: glVertexAttrib2sARB */ static void JNICALL Java_org_lwjgl_opengl_ARBVertexProgram_glVertexAttrib2sARB (JNIEnv * env, jclass clazz, jint index, jshort x, jshort y) { glVertexAttrib2sARB(index, x, y); } /* * Class: org.lwjgl.opengl.ARBVertexProgram * Method: glVertexAttrib2fARB */ static void JNICALL Java_org_lwjgl_opengl_ARBVertexProgram_glVertexAttrib2fARB (JNIEnv * env, jclass clazz, jint index, jfloat x, jfloat y) { glVertexAttrib2fARB(index, x, y); } /* * Class: org.lwjgl.opengl.ARBVertexProgram * Method: glVertexAttrib3sARB */ static void JNICALL Java_org_lwjgl_opengl_ARBVertexProgram_glVertexAttrib3sARB (JNIEnv * env, jclass clazz, jint index, jshort x, jshort y, jshort z) { glVertexAttrib3sARB(index, x, y, z); } /* * Class: org.lwjgl.opengl.ARBVertexProgram * Method: glVertexAttrib3fARB */ static void JNICALL Java_org_lwjgl_opengl_ARBVertexProgram_glVertexAttrib3fARB (JNIEnv * env, jclass clazz, jint index, jfloat x, jfloat y, jfloat z) { glVertexAttrib3fARB(index, x, y, z); } /* * Class: org.lwjgl.opengl.ARBVertexProgram * Method: glVertexAttrib4sARB */ static void JNICALL Java_org_lwjgl_opengl_ARBVertexProgram_glVertexAttrib4sARB (JNIEnv * env, jclass clazz, jint index, jshort x, jshort y, jshort z, jshort w) { glVertexAttrib4sARB(index, x, y, z, w); } /* * Class: org.lwjgl.opengl.ARBVertexProgram * Method: glVertexAttrib4fARB */ static void JNICALL Java_org_lwjgl_opengl_ARBVertexProgram_glVertexAttrib4fARB (JNIEnv * env, jclass clazz, jint index, jfloat x, jfloat y, jfloat z, jfloat w) { glVertexAttrib4fARB(index, x, y, z, w); } /* * Class: org.lwjgl.opengl.ARBVertexProgram * Method: glVertexAttrib4NubARB */ static void JNICALL Java_org_lwjgl_opengl_ARBVertexProgram_glVertexAttrib4NubARB (JNIEnv * env, jclass clazz, jint index, jbyte x, jbyte y, jbyte z, jbyte w) { glVertexAttrib4NubARB(index, x, y, z, w); } /* * Class: org.lwjgl.opengl.ARBVertexProgram * Method: nglVertexAttribPointerARB */ static void JNICALL Java_org_lwjgl_opengl_ARBVertexProgram_nglVertexAttribPointerARB (JNIEnv * env, jclass clazz, jint index, jint size, jint type, jboolean normalized, jint stride, jobject buffer, jint bufferOffset) { GLvoid *buffer_ptr = (GLvoid *)((GLubyte *)(*env)->GetDirectBufferAddress(env, buffer) + bufferOffset); glVertexAttribPointerARB(index, size, type, normalized, stride, buffer_ptr); } /* * Class: org.lwjgl.opengl.ARBVertexProgram * Method: nglVertexAttribPointerARBVBO */ static void JNICALL Java_org_lwjgl_opengl_ARBVertexProgram_nglVertexAttribPointerARBVBO (JNIEnv * env, jclass clazz, jint index, jint size, jint type, jboolean normalized, jint stride, jint bufferOffset) { glVertexAttribPointerARB(index, size, type, normalized, stride, (GLvoid *)bufferOffset); } /* * Class: org.lwjgl.opengl.ARBVertexProgram * Method: glEnableVertexAttribArrayARB */ static void JNICALL Java_org_lwjgl_opengl_ARBVertexProgram_glEnableVertexAttribArrayARB (JNIEnv * env, jclass clazz, jint index) { glEnableVertexAttribArrayARB(index); } /* * Class: org.lwjgl.opengl.ARBVertexProgram * Method: glDisableVertexAttribArrayARB */ static void JNICALL Java_org_lwjgl_opengl_ARBVertexProgram_glDisableVertexAttribArrayARB (JNIEnv * env, jclass clazz, jint index) { glDisableVertexAttribArrayARB(index); } /* * Class: org.lwjgl.opengl.ARBVertexProgram * Method: nglGetVertexAttribfvARB */ static void JNICALL Java_org_lwjgl_opengl_ARBVertexProgram_nglGetVertexAttribfvARB (JNIEnv * env, jclass clazz, jint index, jint pname, jobject params, jint paramsOffset) { GLfloat *params_ptr = (GLfloat *)(*env)->GetDirectBufferAddress(env, params) + paramsOffset; glGetVertexAttribfvARB(index, pname, params_ptr); } /* * Class: org.lwjgl.opengl.ARBVertexProgram * Method: nglGetVertexAttribivARB */ static void JNICALL Java_org_lwjgl_opengl_ARBVertexProgram_nglGetVertexAttribivARB (JNIEnv * env, jclass clazz, jint index, jint pname, jobject params, jint paramsOffset) { GLint *params_ptr = (GLint *)(*env)->GetDirectBufferAddress(env, params) + paramsOffset; glGetVertexAttribivARB(index, pname, params_ptr); } /* * Class: org.lwjgl.opengl.ARBVertexProgram * Method: glGetVertexAttribPointerARB */ static jobject JNICALL Java_org_lwjgl_opengl_ARBVertexProgram_glGetVertexAttribPointerARB (JNIEnv * env, jclass clazz, jint index, jint pname, jint size) { void *address; glGetVertexAttribPointervARB((GLuint)index, (GLuint)pname, &address); return safeNewBuffer(env, address, size); } #ifdef __cplusplus extern "C" { #endif JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexProgram_initNativeStubs(JNIEnv *env, jclass clazz) { JavaMethodAndExtFunction functions[] = { {"glVertexAttrib1sARB", "(IS)V", (void*)&Java_org_lwjgl_opengl_ARBVertexProgram_glVertexAttrib1sARB, "glVertexAttrib1sARB", (void*)&glVertexAttrib1sARB}, {"glVertexAttrib1fARB", "(IF)V", (void*)&Java_org_lwjgl_opengl_ARBVertexProgram_glVertexAttrib1fARB, "glVertexAttrib1fARB", (void*)&glVertexAttrib1fARB}, {"glVertexAttrib2sARB", "(ISS)V", (void*)&Java_org_lwjgl_opengl_ARBVertexProgram_glVertexAttrib2sARB, "glVertexAttrib2sARB", (void*)&glVertexAttrib2sARB}, {"glVertexAttrib2fARB", "(IFF)V", (void*)&Java_org_lwjgl_opengl_ARBVertexProgram_glVertexAttrib2fARB, "glVertexAttrib2fARB", (void*)&glVertexAttrib2fARB}, {"glVertexAttrib3sARB", "(ISSS)V", (void*)&Java_org_lwjgl_opengl_ARBVertexProgram_glVertexAttrib3sARB, "glVertexAttrib3sARB", (void*)&glVertexAttrib3sARB}, {"glVertexAttrib3fARB", "(IFFF)V", (void*)&Java_org_lwjgl_opengl_ARBVertexProgram_glVertexAttrib3fARB, "glVertexAttrib3fARB", (void*)&glVertexAttrib3fARB}, {"glVertexAttrib4sARB", "(ISSSS)V", (void*)&Java_org_lwjgl_opengl_ARBVertexProgram_glVertexAttrib4sARB, "glVertexAttrib4sARB", (void*)&glVertexAttrib4sARB}, {"glVertexAttrib4fARB", "(IFFFF)V", (void*)&Java_org_lwjgl_opengl_ARBVertexProgram_glVertexAttrib4fARB, "glVertexAttrib4fARB", (void*)&glVertexAttrib4fARB}, {"glVertexAttrib4NubARB", "(IBBBB)V", (void*)&Java_org_lwjgl_opengl_ARBVertexProgram_glVertexAttrib4NubARB, "glVertexAttrib4NubARB", (void*)&glVertexAttrib4NubARB}, {"nglVertexAttribPointerARB", "(IIIZILjava/nio/Buffer;I)V", (void*)&Java_org_lwjgl_opengl_ARBVertexProgram_nglVertexAttribPointerARB, "glVertexAttribPointerARB", (void*)&glVertexAttribPointerARB}, {"nglVertexAttribPointerARBVBO", "(IIIZII)V", (void*)&Java_org_lwjgl_opengl_ARBVertexProgram_nglVertexAttribPointerARBVBO, NULL, NULL}, {"glEnableVertexAttribArrayARB", "(I)V", (void*)&Java_org_lwjgl_opengl_ARBVertexProgram_glEnableVertexAttribArrayARB, "glEnableVertexAttribArrayARB", (void*)&glEnableVertexAttribArrayARB}, {"glDisableVertexAttribArrayARB", "(I)V", (void*)&Java_org_lwjgl_opengl_ARBVertexProgram_glDisableVertexAttribArrayARB, "glDisableVertexAttribArrayARB", (void*)&glDisableVertexAttribArrayARB}, {"nglGetVertexAttribfvARB", "(IILjava/nio/FloatBuffer;I)V", (void*)&Java_org_lwjgl_opengl_ARBVertexProgram_nglGetVertexAttribfvARB, "glGetVertexAttribfvARB", (void*)&glGetVertexAttribfvARB}, {"nglGetVertexAttribivARB", "(IILjava/nio/IntBuffer;I)V", (void*)&Java_org_lwjgl_opengl_ARBVertexProgram_nglGetVertexAttribivARB, "glGetVertexAttribivARB", (void*)&glGetVertexAttribivARB}, {"glGetVertexAttribPointerARB", "(III)Ljava/nio/ByteBuffer;", (void*)&Java_org_lwjgl_opengl_ARBVertexProgram_glGetVertexAttribPointerARB, "glGetVertexAttribPointervARB", (void*)&glGetVertexAttribPointervARB} }; int num_functions = NUMFUNCTIONS(functions); extgl_InitializeClass(env, clazz, num_functions, functions); } #ifdef __cplusplus } #endif --- NEW FILE: org_lwjgl_opengl_ARBMultisample.c --- /* * Copyright (c) 2002-2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // ---------------------------------- // IMPLEMENTATION OF NATIVE METHODS FOR CLASS: org.lwjgl.opengl.ARBMultisample // ---------------------------------- #include "extgl.h" typedef void (APIENTRY * glSampleCoverageARBPROC) (GLclampf value, GLboolean invert); static glSampleCoverageARBPROC glSampleCoverageARB; /* * Class: org.lwjgl.opengl.ARBMultisample * Method: glSampleCoverageARB */ static void JNICALL Java_org_lwjgl_opengl_ARBMultisample_glSampleCoverageARB (JNIEnv * env, jclass clazz, jfloat value, jboolean invert) { glSampleCoverageARB(value, invert); } #ifdef __cplusplus extern "C" { #endif JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBMultisample_initNativeStubs(JNIEnv *env, jclass clazz) { JavaMethodAndExtFunction functions[] = { {"glSampleCoverageARB", "(FZ)V", (void*)&Java_org_lwjgl_opengl_ARBMultisample_glSampleCoverageARB, "glSampleCoverageARB", (void*)&glSampleCoverageARB} }; int num_functions = NUMFUNCTIONS(functions); extgl_InitializeClass(env, clazz, num_functions, functions); } #ifdef __cplusplus } #endif --- NEW FILE: org_lwjgl_opengl_ARBOcclusionQuery.c --- /* * Copyright (c) 2002-2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // ---------------------------------- // IMPLEMENTATION OF NATIVE METHODS FOR CLASS: org.lwjgl.opengl.ARBOcclusionQuery // ---------------------------------- #include "extgl.h" typedef void (APIENTRY * glGenQueriesARBPROC) (GLsizei n, GLuint *ids); typedef void (APIENTRY * glDeleteQueriesARBPROC) (GLsizei n, const GLuint *ids); typedef GLboolean (APIENTRY * glIsQueryARBPROC) (GLuint id); typedef void (APIENTRY * glBeginQueryARBPROC) (GLenum target, GLuint id); typedef void (APIENTRY * glEndQueryARBPROC) (GLenum target); typedef void (APIENTRY * glGetQueryivARBPROC) (GLenum target, GLenum pname, GLint *params); typedef void (APIENTRY * glGetQueryObjectivARBPROC) (GLuint id, GLenum pname, GLint *params); typedef void (APIENTRY * glGetQueryObjectuivARBPROC) (GLuint id, GLenum pname, GLuint *params); static glGenQueriesARBPROC glGenQueriesARB; static glDeleteQueriesARBPROC glDeleteQueriesARB; static glIsQueryARBPROC glIsQueryARB; static glBeginQueryARBPROC glBeginQueryARB; static glEndQueryARBPROC glEndQueryARB; static glGetQueryivARBPROC glGetQueryivARB; static glGetQueryObjectivARBPROC glGetQueryObjectivARB; static glGetQueryObjectuivARBPROC glGetQueryObjectuivARB; /* * Class: org.lwjgl.opengl.ARBOcclusionQuery * Method: nglGenQueriesARB */ static void JNICALL Java_org_lwjgl_opengl_ARBOcclusionQuery_nglGenQueriesARB (JNIEnv * env, jclass clazz, jint n, jobject ids, jint idsOffset) { GLuint *ids_ptr = (GLuint *)(*env)->GetDirectBufferAddress(env, ids) + idsOffset; glGenQueriesARB(n, ids_ptr); } /* * Class: org.lwjgl.opengl.ARBOcclusionQuery * Method: nglDeleteQueriesARB */ static void JNICALL Java_org_lwjgl_opengl_ARBOcclusionQuery_nglDeleteQueriesARB (JNIEnv * env, jclass clazz, jint n, jobject ids, jint idsOffset) { GLuint *ids_ptr = (GLuint *)(*env)->GetDirectBufferAddress(env, ids) + idsOffset; glDeleteQueriesARB(n, ids_ptr); } /* * Class: org.lwjgl.opengl.ARBOcclusionQuery * Method: glIsQueryARB */ static jboolean JNICALL Java_org_lwjgl_opengl_ARBOcclusionQuery_glIsQueryARB (JNIEnv * env, jclass clazz, jint id) { GLboolean result = glIsQueryARB(id); return result; } /* * Class: org.lwjgl.opengl.ARBOcclusionQuery * Method: glBeginQueryARB */ static void JNICALL Java_org_lwjgl_opengl_ARBOcclusionQuery_glBeginQueryARB (JNIEnv * env, jclass clazz, jint target, jint id) { glBeginQueryARB(target, id); } /* * Class: org.lwjgl.opengl.ARBOcclusionQuery * Method: glEndQueryARB */ static void JNICALL Java_org_lwjgl_opengl_ARBOcclusionQuery_glEndQueryARB (JNIEnv * env, jclass clazz, jint target) { glEndQueryARB(target); } /* * Class: org.lwjgl.opengl.ARBOcclusionQuery * Method: nglGetQueryivARB */ static void JNICALL Java_org_lwjgl_opengl_ARBOcclusionQuery_nglGetQueryivARB (JNIEnv * env, jclass clazz, jint target, jint pname, jobject params, jint paramsOffset) { GLint *params_ptr = (GLint *)(*env)->GetDirectBufferAddress(env, params) + paramsOffset; glGetQueryivARB(target, pname, params_ptr); } /* * Class: org.lwjgl.opengl.ARBOcclusionQuery * Method: nglGetQueryObjectivARB */ static void JNICALL Java_org_lwjgl_opengl_ARBOcclusionQuery_nglGetQueryObjectivARB (JNIEnv * env, jclass clazz, jint id, jint pname, jobject params, jint paramsOffset) { GLint *params_ptr = (GLint *)(*env)->GetDirectBufferAddress(env, params) + paramsOffset; glGetQueryObjectivARB(id, pname, params_ptr); } /* * Class: org.lwjgl.opengl.ARBOcclusionQuery * Method: nglGetQueryObjectuivARB */ static void JNICALL Java_org_lwjgl_opengl_ARBOcclusionQuery_nglGetQueryObjectuivARB (JNIEnv * env, jclass clazz, jint id, jint pname, jobject params, jint paramsOffset) { GLuint *params_ptr = (GLuint *)(*env)->GetDirectBufferAddress(env, params) + paramsOffset; glGetQueryObjectuivARB(id, pname, params_ptr); } #ifdef __cplusplus extern "C" { #endif JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBOcclusionQuery_initNativeStubs(JNIEnv *env, jclass clazz) { JavaMethodAndExtFunction functions[] = { {"nglGenQueriesARB", "(ILjava/nio/IntBuffer;I)V", (void*)&Java_org_lwjgl_opengl_ARBOcclusionQuery_nglGenQueriesARB, "glGenQueriesARB", (void*)&glGenQueriesARB}, {"nglDeleteQueriesARB", "(ILjava/nio/IntBuffer;I)V", (void*)&Java_org_lwjgl_opengl_ARBOcclusionQuery_nglDeleteQueriesARB, "glDeleteQueriesARB", (void*)&glDeleteQueriesARB}, {"glIsQueryARB", "(I)Z", (void*)&Java_org_lwjgl_opengl_ARBOcclusionQuery_glIsQueryARB, "glIsQueryARB", (void*)&glIsQueryARB}, {"glBeginQueryARB", "(II)V", (void*)&Java_org_lwjgl_opengl_ARBOcclusionQuery_glBeginQueryARB, "glBeginQueryARB", (void*)&glBeginQueryARB}, {"glEndQueryARB", "(I)V", (void*)&Java_org_lwjgl_opengl_ARBOcclusionQuery_glEndQueryARB, "glEndQueryARB", (void*)&glEndQueryARB}, {"nglGetQueryivARB", "(IILjava/nio/IntBuffer;I)V", (void*)&Java_org_lwjgl_opengl_ARBOcclusionQuery_nglGetQueryivARB, "glGetQueryivARB", (void*)&glGetQueryivARB}, {"nglGetQueryObjectivARB", "(IILjava/nio/IntBuffer;I)V", (void*)&Java_org_lwjgl_opengl_ARBOcclusionQuery_nglGetQueryObjectivARB, "glGetQueryObjectivARB", (void*)&glGetQueryObjectivARB}, {"nglGetQueryObjectuivARB", "(IILjava/nio/IntBuffer;I)V", (void*)&Java_org_lwjgl_opengl_ARBOcclusionQuery_nglGetQueryObjectuivARB, "glGetQueryObjectuivARB", (void*)&glGetQueryObjectuivARB} }; int num_functions = NUMFUNCTIONS(functions); extgl_InitializeClass(env, clazz, num_functions, functions); } #ifdef __cplusplus } #endif --- org_lwjgl_opengl_ARBWindowPos.cpp DELETED --- --- org_lwjgl_opengl_ARBMatrixPalette.cpp DELETED --- --- NEW FILE: org_lwjgl_opengl_ARBVertexBlend.c --- /* * Copyright (c) 2002-2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // ---------------------------------- // IMPLEMENTATION OF NATIVE METHODS FOR CLASS: org.lwjgl.opengl.ARBVertexBlend // ---------------------------------- #include "extgl.h" typedef void (APIENTRY * glWeightbvARBPROC) (GLint size, GLbyte *weights); typedef void (APIENTRY * glWeightsvARBPROC) (GLint size, GLshort *weights); typedef void (APIENTRY * glWeightivARBPROC) (GLint size, GLint *weights); typedef void (APIENTRY * glWeightfvARBPROC) (GLint size, GLfloat *weights); typedef void (APIENTRY * glWeightubvARBPROC) (GLint size, GLubyte *weights); typedef void (APIENTRY * glWeightusvARBPROC) (GLint size, GLushort *weights); typedef void (APIENTRY * glWeightuivARBPROC) (GLint size, GLuint *weights); typedef void (APIENTRY * glWeightPointerARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); typedef void (APIENTRY * glVertexBlendARBPROC) (GLint count); static glWeightbvARBPROC glWeightbvARB; static glWeightsvARBPROC glWeightsvARB; static glWeightivARBPROC glWeightivARB; static glWeightfvARBPROC glWeightfvARB; static glWeightubvARBPROC glWeightubvARB; static glWeightusvARBPROC glWeightusvARB; static glWeightuivARBPROC glWeightuivARB; static glWeightPointerARBPROC glWeightPointerARB; static glVertexBlendARBPROC glVertexBlendARB; /* * Class: org.lwjgl.opengl.ARBVertexBlend * Method: nglWeightbvARB */ static void JNICALL Java_org_lwjgl_opengl_ARBVertexBlend_nglWeightbvARB (JNIEnv * env, jclass clazz, jint size, jobject pWeights, jint pWeights_offset) { GLbyte *pWeights_ptr = (GLbyte *)(*env)->GetDirectBufferAddress(env, pWeights) + pWeights_offset; glWeightbvARB(size, pWeights_ptr); } /* * Class: org.lwjgl.opengl.ARBVertexBlend * Method: nglWeightfvARB */ static void JNICALL Java_org_lwjgl_opengl_ARBVertexBlend_nglWeightfvARB (JNIEnv * env, jclass clazz, jint size, jobject pfWeights, jint pfWeights_offset) { GLfloat *pfWeights_ptr = (GLfloat *)(*env)->GetDirectBufferAddress(env, pfWeights) + pfWeights_offset; glWeightfvARB(size, pfWeights_ptr); } /* * Class: org.lwjgl.opengl.ARBVertexBlend * Method: nglWeightivARB */ static void JNICALL Java_org_lwjgl_opengl_ARBVertexBlend_nglWeightivARB (JNIEnv * env, jclass clazz, jint size, jobject piWeights, jint piWeights_offset) { GLint *piWeights_ptr = (GLint *)(*env)->GetDirectBufferAddress(env, piWeights) + piWeights_offset; glWeightivARB(size, piWeights_ptr); } /* * Class: org.lwjgl.opengl.ARBVertexBlend * Method: nglWeightsvARB */ static void JNICALL Java_org_lwjgl_opengl_ARBVertexBlend_nglWeightsvARB (JNIEnv * env, jclass clazz, jint size, jobject psWeights, jint psWeights_offset) { GLshort *psWeights_ptr = (GLshort *)(*env)->GetDirectBufferAddress(env, psWeights) + psWeights_offset; glWeightsvARB(size, psWeights_ptr); } /* * Class: org.lwjgl.opengl.ARBVertexBlend * Method: nglWeightubvARB */ static void JNICALL Java_org_lwjgl_opengl_ARBVertexBlend_nglWeightubvARB (JNIEnv * env, jclass clazz, jint size, jobject pWeights, jint pWeights_offset) { GLubyte *pWeights_ptr = (GLubyte *)(*env)->GetDirectBufferAddress(env, pWeights) + pWeights_offset; glWeightubvARB(size, pWeights_ptr); } /* * Class: org.lwjgl.opengl.ARBVertexBlend * Method: nglWeightuivARB */ static void JNICALL Java_org_lwjgl_opengl_ARBVertexBlend_nglWeightuivARB (JNIEnv * env, jclass clazz, jint size, jobject piWeights, jint piWeights_offset) { GLuint *piWeights_ptr = (GLuint *)(*env)->GetDirectBufferAddress(env, piWeights) + piWeights_offset; glWeightuivARB(size, piWeights_ptr); } /* * Class: org.lwjgl.opengl.ARBVertexBlend * Method: nglWeightusvARB */ static void JNICALL Java_org_lwjgl_opengl_ARBVertexBlend_nglWeightusvARB (JNIEnv * env, jclass clazz, jint size, jobject psWeights, jint psWeights_offset) { GLushort *psWeights_ptr = (GLushort *)(*env)->GetDirectBufferAddress(env, psWeights) + psWeights_offset; glWeightusvARB(size, psWeights_ptr); } /* * Class: org.lwjgl.opengl.ARBVertexBlend * Method: nglWeightPointerARB */ static void JNICALL Java_org_lwjgl_opengl_ARBVertexBlend_nglWeightPointerARB (JNIEnv * env, jclass clazz, jint size, jint type, jint stride, jobject pPointer, jint pPointer_offset) { GLvoid *pPointer_ptr = (GLvoid *)((GLubyte *)(*env)->GetDirectBufferAddress(env, pPointer) + pPointer_offset); glWeightPointerARB(size, type, stride, pPointer_ptr); } /* * Class: org.lwjgl.opengl.ARBVertexBlend * Method: nglWeightPointerARBVBO */ static void JNICALL Java_org_lwjgl_opengl_ARBVertexBlend_nglWeightPointerARBVBO (JNIEnv * env, jclass clazz, jint size, jint type, jint stride, jint buffer_offset) { glWeightPointerARB(size, type, stride, (GLvoid *)buffer_offset); } /* * Class: org.lwjgl.opengl.ARBVertexBlend * Method: glVertexBlendARB */ static void JNICALL Java_org_lwjgl_opengl_ARBVertexBlend_glVertexBlendARB (JNIEnv * env, jclass clazz, jint count) { glVertexBlendARB(count); } #ifdef __cplusplus extern "C" { #endif JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexBlend_initNativeStubs(JNIEnv *env, jclass clazz) { JavaMethodAndExtFunction functions[] = { {"nglWeightbvARB", "(ILjava/nio/ByteBuffer;I)V", (void*)&Java_org_lwjgl_opengl_ARBVertexBlend_nglWeightbvARB, "glWeightbvARB", (void*)&glWeightbvARB}, {"nglWeightfvARB", "(ILjava/nio/FloatBuffer;I)V", (void*)&Java_org_lwjgl_opengl_ARBVertexBlend_nglWeightfvARB, "glWeightfvARB", (void*)&glWeightfvARB}, {"nglWeightivARB", "(ILjava/nio/IntBuffer;I)V", (void*)&Java_org_lwjgl_opengl_ARBVertexBlend_nglWeightivARB, "glWeightivARB", (void*)&glWeightivARB}, {"nglWeightsvARB", "(ILjava/nio/ShortBuffer;I)V", (void*)&Java_org_lwjgl_opengl_ARBVertexBlend_nglWeightsvARB, "glWeightsvARB", (void*)&glWeightsvARB}, {"nglWeightubvARB", "(ILjava/nio/ByteBuffer;I)V", (void*)&Java_org_lwjgl_opengl_ARBVertexBlend_nglWeightubvARB, "glWeightubvARB", (void*)&glWeightubvARB}, {"nglWeightuivARB", "(ILjava/nio/IntBuffer;I)V", (void*)&Java_org_lwjgl_opengl_ARBVertexBlend_nglWeightuivARB, "glWeightuivARB", (void*)&glWeightuivARB}, {"nglWeightusvARB", "(ILjava/nio/ShortBuffer;I)V", (void*)&Java_org_lwjgl_opengl_ARBVertexBlend_nglWeightusvARB, "glWeightusvARB", (void*)&glWeightusvARB}, {"nglWeightPointerARB", "(IIILjava/nio/Buffer;I)V", (void*)&Java_org_lwjgl_opengl_ARBVertexBlend_nglWeightPointerARB, "glWeightPointerARB", (void*)&glWeightPointerARB}, {"nglWeightPointerARBVBO", "(IIII)V", (void*)&Java_org_lwjgl_opengl_ARBVertexBlend_nglWeightPointerARBVBO, NULL, NULL}, {"glVertexBlendARB", "(I)V", (void*)&Java_org_lwjgl_opengl_ARBVertexBlend_glVertexBlendARB, "glVertexBlendARB", (void*)&glVertexBlendARB} }; int num_functions = NUMFUNCTIONS(functions); extgl_InitializeClass(env, clazz, num_functions, functions); } #ifdef __cplusplus } #endif --- NEW FILE: org_lwjgl_opengl_ARBImaging.c --- /* * Copyright (c) 2002-2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** * $Id: org_lwjgl_opengl_ARBImaging.c,v 1.1 2004/09/10 08:13:51 elias_naur Exp $ * * Core OpenGL functions. * * @author cix_foo <ci...@us...> * @version $Revision: 1.1 $ */ #include "extgl.h" typedef void (APIENTRY * glBlendColorPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ); typedef void (APIENTRY * glBlendEquationPROC) (GLenum mode ); typedef void (APIENTRY * glColorTablePROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table ); typedef void (APIENTRY * glColorTableParameterfvPROC) (GLenum target, GLenum pname, const GLfloat *params); typedef void (APIENTRY * glColorTableParameterivPROC) (GLenum target, GLenum pname, const GLint *params); typedef void (APIENTRY * glCopyColorTablePROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width ); typedef void (APIENTRY * glGetColorTablePROC) (GLenum target, GLenum format, GLenum type, GLvoid *table ); typedef void (APIENTRY * glGetColorTableParameterfvPROC) (GLenum target, GLenum pname, GLfloat *params ); typedef void (APIENTRY * glGetColorTableParameterivPROC) (GLenum target, GLenum pname, GLint *params ); typedef void (APIENTRY * glColorSubTablePROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data ); typedef void (APIENTRY * glCopyColorSubTablePROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width ); typedef void (APIENTRY * glConvolutionFilter1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image ); typedef void (APIENTRY * glConvolutionFilter2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image ); typedef void (APIENTRY * glConvolutionParameterfPROC) (GLenum target, GLenum pname, GLfloat params ); typedef void (APIENTRY * glConvolutionParameterfvPROC) (GLenum target, GLenum pname, const GLfloat *params ); typedef void (APIENTRY * glConvolutionParameteriPROC) (GLenum target, GLenum pname, GLint params ); typedef void (APIENTRY * glConvolutionParameterivPROC) (GLenum target, GLenum pname, const GLint *params ); typedef void (APIENTRY * glCopyConvolutionFilter1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width ); typedef void (APIENTRY * glCopyConvolutionFilter2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); typedef void (APIENTRY * glGetConvolutionFilterPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image ); typedef void (APIENTRY * glGetConvolutionParameterfvPROC) (GLenum target, GLenum pname, GLfloat *params ); typedef void (APIENTRY * glGetConvolutionParameterivPROC) (GLenum target, GLenum pname, GLint *params ); typedef void (APIENTRY * glSeparableFilter2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column ); typedef void (APIENTRY * glGetHistogramPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values ); typedef void (APIENTRY * glGetHistogramParameterfvPROC) (GLenum target, GLenum pname, GLfloat *params ); typedef void (APIENTRY * glGetHistogramParameterivPROC) (GLenum target, GLenum pname, GLint *params ); typedef void (APIENTRY * glGetMinmaxPROC) (GLenum target, GLboolean reset, GLenum format, GLenum types, GLvoid *values ); typedef void (APIENTRY * glGetMinmaxParameterfvPROC) (GLenum target, GLenum pname, GLfloat *params ); typedef void (APIENTRY * glGetMinmaxParameterivPROC) (GLenum target, GLenum pname, GLint *params ); typedef void (APIENTRY * glHistogramPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink ); typedef void (APIENTRY * glResetHistogramPROC) (GLenum target ); typedef void (APIENTRY * glMinmaxPROC) (GLenum target, GLenum internalformat, GLboolean sink ); typedef void (APIENTRY * glResetMinmaxPROC) (GLenum target ); typedef void (APIENTRY * glGetSeparableFilterPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span ); static glBlendColorPROC glBlendColor; static glBlendEquationPROC glBlendEquation; static glColorTablePROC glColorTable; static glColorTableParameterfvPROC glColorTableParameterfv; static glColorTableParameterivPROC glColorTableParameteriv; static glCopyColorTablePROC glCopyColorTable; static glGetColorTablePROC glGetColorTable; static glGetColorTableParameterfvPROC glGetColorTableParameterfv; static glGetColorTableParameterivPROC glGetColorTableParameteriv; static glColorSubTablePROC glColorSubTable; static glCopyColorSubTablePROC glCopyColorSubTable; static glConvolutionFilter1DPROC glConvolutionFilter1D; static glConvolutionFilter2DPROC glConvolutionFilter2D; static glConvolutionParameterfPROC glConvolutionParameterf; static glConvolutionParameterfvPROC glConvolutionParameterfv; static glConvolutionParameteriPROC glConvolutionParameteri; static glConvolutionParameterivPROC glConvolutionParameteriv; static glCopyConvolutionFilter1DPROC glCopyConvolutionFilter1D; static glCopyConvolutionFilter2DPROC glCopyConvolutionFilter2D; static glGetConvolutionFilterPROC glGetConvolutionFilter; static glGetConvolutionParameterfvPROC glGetConvolutionParameterfv; static glGetConvolutionParameterivPROC glGetConvolutionParameteriv; static glGetSeparableFilterPROC glGetSeparableFilter; static glSeparableFilter2DPROC glSeparableFilter2D; static glGetHistogramPROC glGetHistogram; static glGetHistogramParameterfvPROC glGetHistogramParameterfv; static glGetHistogramParameterivPROC glGetHistogramParameteriv; static glGetMinmaxPROC glGetMinmax; static glGetMinmaxParameterfvPROC glGetMinmaxParameterfv; static glGetMinmaxParameterivPROC glGetMinmaxParameteriv; static glHistogramPROC glHistogram; static glMinmaxPROC glMinmax; static glResetHistogramPROC glResetHistogram; static glResetMinmaxPROC glResetMinmax; /* * Class: org_lwjgl_opengl_ARBImaging * Method: glColorTable * Signature: (IIIIII)V */ static void JNICALL Java_org_lwjgl_opengl_ARBImaging_nglColorTable (JNIEnv * env, jclass clazz, jint target, jint internalFormat, jint width, jint format, jint type, jobject buffer, jint offset) { const void *address = (const void *)(offset + (const GLbyte *)(*env)->GetDirectBufferAddress(env, buffer)); glColorTable(target, internalFormat, width, format, type, address); } /* * Class: org_lwjgl_opengl_ARBImaging * Method: glColorSubTable * Signature: (IIIIII)V */ static void JNICALL Java_org_lwjgl_opengl_ARBImaging_nglColorSubTable (JNIEnv * env, jclass clazz, jint target, jint start, jint count, jint format, jint type, jobject buffer, jint offset) { const void *address = (const void *)(offset + (const GLbyte *)(*env)->GetDirectBufferAddress(env, buffer)); glColorSubTable(target, start, count, format, type, address); } /* * Class: org_lwjgl_opengl_ARBImaging * Method: glGetColorTable * Signature: (IIII)V */ static void JNICALL Java_org_lwjgl_opengl_ARBImaging_nglGetColorTable (JNIEnv * env, jclass clazz, jint target, jint format, jint type, jobject buffer, jint offset) { void *address = (void *)(offset + (GLbyte *)(*env)->GetDirectBufferAddress(env, buffer)); glGetColorTable(target, format, type, address); } /* * Class: org_lwjgl_opengl_ARBImaging * Method: glGetColorTableParameteriv * Signature: (III)V */ static void JNICALL Java_org_lwjgl_opengl_ARBImaging_nglGetColorTableParameteriv (JNIEnv * env, jclass clazz, jint target, jint pname, jobject buffer, jint offset) { GLint *address = offset + (GLint *)(*env)->GetDirectBufferAddress(env, buffer); glGetColorTableParameteriv(target, pname, address); } /* * Class: org_lwjgl_opengl_ARBImaging * Method: glGetColorTableParameterfv * Signature: (III)V */ static void JNICALL Java_org_lwjgl_opengl_ARBImaging_nglGetColorTableParameterfv (JNIEnv * env, jclass clazz, jint target, jint pname, jobject buffer, jint offset) { GLfloat *address = offset + (GLfloat *)(*env)->GetDirectBufferAddress(env, buffer); glGetColorTableParameterfv(target, pname, address); } /* * Class: org_lwjgl_opengl_ARBImaging * Method: glColorTableParameteriv * Signature: (III)V */ static void JNICALL Java_org_lwjgl_opengl_ARBImaging_nglColorTableParameteriv (JNIEnv *env, jclass clazz, jint target, jint pname, jobject buffer, jint offset) { const GLint *address = offset + (const GLint *)(*env)->GetDirectBufferAddress(env, buffer); glColorTableParameteriv(target, pname, address); } /* * Class: org_lwjgl_opengl_ARBImaging * Method: glColorTableParameterfv * Signature: (III)V */ static void JNICALL Java_org_lwjgl_opengl_ARBImaging_nglColorTableParameterfv (JNIEnv *env, jclass clazz, jint target, jint pname, jobject buffer, jint offset) { const GLfloat *address = offset + (const GLfloat *)(*env)->GetDirectBufferAddress(env, buffer); glColorTableParameterfv(target, pname, address); } /* * Class: org_lwjgl_opengl_ARBImaging * Method: glCopyColorSubTable * Signature: (IIIII)V */ static void JNICALL Java_org_lwjgl_opengl_ARBImaging_glCopyColorSubTable (JNIEnv *env, jclass clazz, jint target, jint start, jint x, jint y, jint width) { glCopyColorSubTable(target, start, x, y, width); } /* * Class: org_lwjgl_opengl_ARBImaging * Method: glCopyColorTable * Signature: (IIIII)V */ static void JNICALL Java_org_lwjgl_opengl_ARBImaging_glCopyColorTable (JNIEnv *env, jclass clazz, jint target, jint internalformat, jint x, jint y, jint width) { glCopyColorTable(target, internalformat, x, y, width); } /* * Class: org_lwjgl_opengl_ARBImaging * Method: glBlendEquation * Signature: (I)V */ static void JNICALL Java_org_lwjgl_opengl_ARBImaging_glBlendEquation (JNIEnv *env, jclass clazz, jint mode) { glBlendEquation(mode); } /* * Class: org_lwjgl_opengl_ARBImaging * Method: glBlendColor */ static void JNICALL Java_org_lwjgl_opengl_ARBImaging_glBlendColor(JNIEnv * env, jclass clazz, jfloat p0, jfloat p1, jfloat p2, jfloat p3) { glBlendColor((GLfloat) p0, (GLfloat) p1, (GLfloat) p2, (GLfloat) p3); } /* * Class: org_lwjgl_opengl_ARBImaging * Method: glHistogram * Signature: (IIIZ)V */ static void JNICALL Java_org_lwjgl_opengl_ARBImaging_glHistogram (JNIEnv *env, jclass clazz, jint target, jint width, jint internalformat, jboolean sink) { glHistogram(target, width, internalformat, sink); } /* * Class: org_lwjgl_opengl_ARBImaging * Method: glResetHistogram * Signature: (I)V */ static void JNICALL Java_org_lwjgl_opengl_ARBImaging_glResetHistogram (JNIEnv *env, jclass clazz, jint target) { glResetHistogram(target); } /* * Class: org_lwjgl_opengl_ARBImaging * Method: glGetHistogram * Signature: (IZIII)V */ static void JNICALL Java_org_lwjgl_opengl_ARBImaging_nglGetHistogram (JNIEnv *env, jclass clazz, jint target, jboolean reset, jint format, jint type, jobject buffer, jint offset) { void *address = (void *)(offset + (GLbyte *)(*env)->GetDirectBufferAddress(env, buffer)); glGetHistogram(target, reset, format, type, address); } /* * Class: org_lwjgl_opengl_ARBImaging * Method: glGetHistogramParameterfv * Signature: (III)V */ static void JNICALL Java_org_lwjgl_opengl_ARBImaging_nglGetHistogramParameterfv (JNIEnv *env, jclass clazz, jint target, jint pname, jobject buffer, jint offset) { GLfloat *address = offset + (GLfloat *)(*env)->GetDirectBufferAddress(env, buffer); glGetHistogramParameterfv(target, pname, address); } /* * Class: org_lwjgl_opengl_ARBImaging * Method: glGetHistogramParameteriv * Signature: (III)V */ static void JNICALL Java_org_lwjgl_opengl_ARBImaging_nglGetHistogramParameteriv (JNIEnv *env, jclass clazz, jint target, jint pname, jobject buffer, jint offset) { GLint *address = offset + (GLint *)(*env)->GetDirectBufferAddress(env, buffer); glGetHistogramParameteriv(target, pname, address); } /* * Class: org_lwjgl_opengl_ARBImaging * Method: glMinmax * Signature: (IIZ)V */ static void JNICALL Java_org_lwjgl_opengl_ARBImaging_glMinmax (JNIEnv *env, jclass clazz, jint target, jint internalformat, jboolean sink) { glMinmax(target, internalformat, sink); } /* * Class: org_lwjgl_opengl_ARBImaging * Method: glResetMinmax * Signature: (I)V */ static void JNICALL Java_org_lwjgl_opengl_ARBImaging_glResetMinmax (JNIEnv *env, jclass clazz, jint target) { glResetMinmax(target); } /* * Class: org_lwjgl_opengl_ARBImaging * Method: glGetMinmax * Signature: (IZIII)V */ static void JNICALL Java_org_lwjgl_opengl_ARBImaging_nglGetMinmax (JNIEnv *env, jclass clazz, jint target, jboolean reset, jint format, jint type, jobject buffer, jint offset) { void *address = (void *)(offset + (GLbyte *)(*env)->GetDirectBufferAddress(env, buffer)); glGetMinmax(target, reset, format, type, address); } /* * Class: org_lwjgl_opengl_ARBImaging * Method: glGetMinmaxParameterfv * Signature: (III)V */ static void JNICALL Java_org_lwjgl_opengl_ARBImaging_nglGetMinmaxParameterfv (JNIEnv *env, jclass clazz, jint target, jint pname, jobject buffer, jint offset) { GLfloat *address = offset + (GLfloat *)(*env)->GetDirectBufferAddress(env, buffer); glGetMinmaxParameterfv(target, pname, address); } /* * Class: org_lwjgl_opengl_ARBImaging * Method: glGetMinmaxParameteriv * Signature: (III)V */ static void JNICALL Java_org_lwjgl_opengl_ARBImaging_nglGetMinmaxParameteriv (JNIEnv *env, jclass clazz, jint target, jint pname, jobject buffer, jint offset) { GLint *address = offset + (GLint *)(*env)->GetDirectBufferAddress(env, buffer); glGetMinmaxParameteriv(target, pname, address); } /* * Class: org_lwjgl_opengl_ARBImaging * Method: glConvolutionFilter1D * Signature: (IIIIII)V */ static void JNICALL Java_org_lwjgl_opengl_ARBImaging_nglConvolutionFilter1D (JNIEnv *env, jclass clazz, jint target, jint internalformat, jint width, jint format, jint type, jobject buffer, jint offset) { const void *address = (const void *)(offset + (const GLbyte *)(*env)->GetDirectBufferAddress(env, buffer)); glConvolutionFilter1D(target, internalformat, width, format, type, address); } /* * Class: org_lwjgl_opengl_ARBImaging * Method: glConvolutionFilter2D * Signature: (IIIIIII)V */ static void JNICALL Java_org_lwjgl_opengl_ARBImaging_nglConvolutionFilter2D (JNIEnv *env, jclass clazz, jint target, jint internalformat, jint width, jint height, jint format, jint type, jobject buffer, jint offset) { const void *address = (const void *)(offset + (const GLbyte *)(*env)->GetDirectBufferAddress(env, buffer)); glConvolutionFilter2D(target, internalformat, width, height, format, type, address); } /* * Class: org_lwjgl_opengl_ARBImaging * Method: glConvolutionParameterf * Signature: (IIF)V */ static void JNICALL Java_org_lwjgl_opengl_ARBImaging_glConvolutionParameterf (JNIEnv *env, jclass clazz, jint target, jint pname, jfloat params) { glConvolutionParameterf(target, pname, params); } /* * Class: org_lwjgl_opengl_ARBImaging * Method: glConvolutionParameterfv * Signature: (III)V */ static void JNICALL Java_org_lwjgl_opengl_ARBImaging_nglConvolutionParameterfv (JNIEnv *env, jclass clazz, jint target, jint pname, jobject buffer, jint offset) { const GLfloat *address = offset + (const GLfloat *)(*env)->GetDirectBufferAddress(env, buffer); glConvolutionParameterfv(target, pname, address); } /* * Class: org_lwjgl_opengl_ARBImaging * Method: glConvolutionParameteri * Signature: (III)V */ static void JNICALL Java_org_lwjgl_opengl_ARBImaging_glConvolutionParameteri (JNIEnv *env, jclass clazz, jint target, jint pname, jint params) { glConvolutionParameteri(target, pname, params); } /* * Class: org_lwjgl_opengl_ARBImaging * Method: glConvolutionParameteriv * Signature: (II... [truncated message content] |
|
From: Brian M. <ma...@us...> - 2004-09-10 21:58:58
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common/fmod3 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14812 Modified Files: org_lwjgl_fmod3_FMusic.c org_lwjgl_fmod3_FSound.c Log Message: fixed wrong return type fixed compilation on win32 Index: org_lwjgl_fmod3_FMusic.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/fmod3/org_lwjgl_fmod3_FMusic.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_fmod3_FMusic.c 10 Sep 2004 08:13:53 -0000 1.1 +++ org_lwjgl_fmod3_FMusic.c 10 Sep 2004 21:58:11 -0000 1.2 @@ -128,7 +128,7 @@ */ JNIEXPORT void JNICALL Java_org_lwjgl_fmod3_FMusic_FMUSIC_1StopAllSongs (JNIEnv *env, jclass clazz){ - return fmod_instance->FMUSIC_StopAllSongs(); + fmod_instance->FMUSIC_StopAllSongs(); } /* @@ -493,21 +493,28 @@ * priority to max value */ void attachMixerThread() { + jclass threadClass; + jmethodID currentThread; + jobject myThread; + jfieldID highPriority; + jint highPriorityValue; + jmethodID priority; + (*jvm)->AttachCurrentThreadAsDaemon(jvm, (void*)&mixer_jnienv, NULL); // set to high priority // ============================== // get current thread - jclass threadClass = (*mixer_jnienv)->FindClass(mixer_jnienv, "java/lang/Thread"); - jmethodID currentThread = (*mixer_jnienv)->GetStaticMethodID(mixer_jnienv, threadClass, "currentThread", "()Ljava/lang/Thread;"); - jobject myThread = (*mixer_jnienv)->CallStaticObjectMethod(mixer_jnienv, threadClass, currentThread); + threadClass = (*mixer_jnienv)->FindClass(mixer_jnienv, "java/lang/Thread"); + currentThread = (*mixer_jnienv)->GetStaticMethodID(mixer_jnienv, threadClass, "currentThread", "()Ljava/lang/Thread;"); + myThread = (*mixer_jnienv)->CallStaticObjectMethod(mixer_jnienv, threadClass, currentThread); // get value of high priority - jfieldID highPriority = (*mixer_jnienv)->GetStaticFieldID(mixer_jnienv, threadClass, "MAX_PRIORITY", "I"); - jint highPriorityValue = (*mixer_jnienv)->GetStaticIntField(mixer_jnienv, threadClass, highPriority); + highPriority = (*mixer_jnienv)->GetStaticFieldID(mixer_jnienv, threadClass, "MAX_PRIORITY", "I"); + highPriorityValue = (*mixer_jnienv)->GetStaticIntField(mixer_jnienv, threadClass, highPriority); // call set priority - jmethodID priority = (*mixer_jnienv)->GetMethodID(mixer_jnienv, threadClass, "setPriority", "(I)V"); + priority = (*mixer_jnienv)->GetMethodID(mixer_jnienv, threadClass, "setPriority", "(I)V"); (*mixer_jnienv)->CallVoidMethod(mixer_jnienv, myThread, priority, highPriorityValue); // ------------------------------ } Index: org_lwjgl_fmod3_FSound.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/fmod3/org_lwjgl_fmod3_FSound.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_fmod3_FSound.c 10 Sep 2004 08:13:53 -0000 1.1 +++ org_lwjgl_fmod3_FSound.c 10 Sep 2004 21:58:11 -0000 1.2 @@ -157,7 +157,7 @@ * Signature: (F)V */ JNIEXPORT void JNICALL Java_org_lwjgl_fmod3_FSound_FSOUND_1SetPanSeperation(JNIEnv * env, jclass clazz, jfloat pansep) { - return fmod_instance->FSOUND_SetPanSeperation(pansep); + fmod_instance->FSOUND_SetPanSeperation(pansep); } /* @@ -949,7 +949,7 @@ * Signature: (F)V */ JNIEXPORT void JNICALL Java_org_lwjgl_fmod3_FSound_FSOUND_13D_1SetDopplerFactor(JNIEnv * env, jclass clazz, jfloat scale) { - return fmod_instance->FSOUND_3D_SetDopplerFactor(scale); + fmod_instance->FSOUND_3D_SetDopplerFactor(scale); } /* @@ -958,7 +958,7 @@ * Signature: (F)V */ JNIEXPORT void JNICALL Java_org_lwjgl_fmod3_FSound_FSOUND_13D_1SetRolloffFactor(JNIEnv * env, jclass clazz, jfloat scale) { - return fmod_instance->FSOUND_3D_SetRolloffFactor(scale); + fmod_instance->FSOUND_3D_SetRolloffFactor(scale); } /* @@ -1097,7 +1097,7 @@ * Method: nFSOUND_Stream_GetLength * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod3_FSound_nFSOUND_1Stream_1GetLength(JNIEnv * env, jclass clazz, jlong stream) { +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod3_FSound_nFSOUND_1Stream_1GetLength(JNIEnv * env, jclass clazz, jlong stream) { return fmod_instance->FSOUND_Stream_GetLength((FSOUND_STREAM*) stream); } @@ -1106,7 +1106,7 @@ * Method: nFSOUND_Stream_GetLengthMs * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod3_FSound_nFSOUND_1Stream_1GetLengthMs(JNIEnv * env, jclass clazz, jlong stream) { +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod3_FSound_nFSOUND_1Stream_1GetLengthMs(JNIEnv * env, jclass clazz, jlong stream) { return fmod_instance->FSOUND_Stream_GetLengthMs((FSOUND_STREAM*) stream); } @@ -1432,7 +1432,7 @@ * Signature: (CI)V */ JNIEXPORT void JNICALL Java_org_lwjgl_fmod3_FSound_FSOUND_1CD_1SetPlayMode(JNIEnv * env, jclass clazz, jchar drive, jint mode) { - return fmod_instance->FSOUND_CD_SetPlayMode(drive, mode); + fmod_instance->FSOUND_CD_SetPlayMode(drive, mode); } /* @@ -1839,21 +1839,28 @@ * priority to max value */ void attachStreamThread() { + jclass threadClass; + jmethodID currentThread; + jobject myThread; + jfieldID highPriority; + jint highPriorityValue; + jmethodID priority; + (*jvm)->AttachCurrentThreadAsDaemon(jvm, (void*)&stream_jnienv, NULL); // set to high priority // ============================== // get current thread - jclass threadClass = (*stream_jnienv)->FindClass(stream_jnienv, "java/lang/Thread"); - jmethodID currentThread = (*stream_jnienv)->GetStaticMethodID(stream_jnienv, threadClass, "currentThread", "()Ljava/lang/Thread;"); - jobject myThread = (*stream_jnienv)->CallStaticObjectMethod(stream_jnienv, threadClass, currentThread); + threadClass = (*stream_jnienv)->FindClass(stream_jnienv, "java/lang/Thread"); + currentThread = (*stream_jnienv)->GetStaticMethodID(stream_jnienv, threadClass, "currentThread", "()Ljava/lang/Thread;"); + myThread = (*stream_jnienv)->CallStaticObjectMethod(stream_jnienv, threadClass, currentThread); // get value of high priority - jfieldID highPriority = (*stream_jnienv)->GetStaticFieldID(stream_jnienv, threadClass, "MAX_PRIORITY", "I"); - jint highPriorityValue = (*stream_jnienv)->GetStaticIntField(stream_jnienv, threadClass, highPriority); + highPriority = (*stream_jnienv)->GetStaticFieldID(stream_jnienv, threadClass, "MAX_PRIORITY", "I"); + highPriorityValue = (*stream_jnienv)->GetStaticIntField(stream_jnienv, threadClass, highPriority); // call set priority - jmethodID priority = (*stream_jnienv)->GetMethodID(stream_jnienv, threadClass, "setPriority", "(I)V"); + priority = (*stream_jnienv)->GetMethodID(stream_jnienv, threadClass, "setPriority", "(I)V"); (*stream_jnienv)->CallVoidMethod(stream_jnienv, myThread, priority, highPriorityValue); // ------------------------------ } @@ -1861,11 +1868,16 @@ // FSound callbacks // ======================================= void * F_CALLBACKAPI fsound_dspcallback(void *originalbuffer, void *newbuffer, int length, void *userdata) { + int size; + jobject origBuffer; + jobject newBuffer; + jobject resultBuffer; + if (mixer_jnienv == NULL) { attachMixerThread(); } - int size = length * fsound_dsp_buffer_size; - jobject origBuffer = (*mixer_jnienv)->NewDirectByteBuffer(mixer_jnienv, originalbuffer, size); - jobject newBuffer = (*mixer_jnienv)->NewDirectByteBuffer(mixer_jnienv, newbuffer, size); - jobject resultBuffer = (*mixer_jnienv)->CallStaticObjectMethod(mixer_jnienv, fsound, sound_dspcallback, (jlong) *((long *)userdata), origBuffer, newBuffer, (jint) length); + size = length * fsound_dsp_buffer_size; + origBuffer = (*mixer_jnienv)->NewDirectByteBuffer(mixer_jnienv, originalbuffer, size); + newBuffer = (*mixer_jnienv)->NewDirectByteBuffer(mixer_jnienv, newbuffer, size); + resultBuffer = (*mixer_jnienv)->CallStaticObjectMethod(mixer_jnienv, fsound, sound_dspcallback, (jlong) *((long *)userdata), origBuffer, newBuffer, (jint) length); return (*mixer_jnienv)->GetDirectBufferAddress(mixer_jnienv, resultBuffer); } @@ -1876,8 +1888,9 @@ } signed char F_CALLBACKAPI fsound_stream_synccallback(FSOUND_STREAM *stream, void *buff, int len, void *param) { + int length; if (stream_jnienv == NULL) { attachStreamThread(); } - int length = strlen((const char *) buff); + length = strlen((const char *) buff); (*stream_jnienv)->CallStaticVoidMethod(stream_jnienv, fsound, sound_stream_synccallback, (jlong) stream, safeNewBuffer(stream_jnienv, buff, length), (jint) len); return true; } |
|
From: Brian M. <ma...@us...> - 2004-09-10 21:57:22
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/fmod3 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14559 Modified Files: FSound.java Log Message: fixed wrong return type Index: FSound.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/fmod3/FSound.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- FSound.java 20 Aug 2004 06:19:11 -0000 1.6 +++ FSound.java 10 Sep 2004 21:56:58 -0000 1.7 @@ -2206,10 +2206,10 @@ * @param stream The stream to have its length returned * @return On success, the size of the stream in BYTES is returned. On failure, 0 is returned. */ - public static boolean FSOUND_Stream_GetLength(FSoundStream stream) { + public static int FSOUND_Stream_GetLength(FSoundStream stream) { return nFSOUND_Stream_GetLength(stream.streamHandle); } - private static native boolean nFSOUND_Stream_GetLength(long streamHandle); + private static native int nFSOUND_Stream_GetLength(long streamHandle); /** * Returns the size of the stream in MILLISECONDS @@ -2220,10 +2220,10 @@ * @param stream The stream to have its its total duration returned. * @return On success, the size of the stream in MILLISECONDS is returned. On failure, 0 is returned. */ - public static boolean FSOUND_Stream_GetLengthMs(FSoundStream stream) { + public static int FSOUND_Stream_GetLengthMs(FSoundStream stream) { return nFSOUND_Stream_GetLengthMs(stream.streamHandle); } - private static native boolean nFSOUND_Stream_GetLengthMs(long streamHandle); + private static native int nFSOUND_Stream_GetLengthMs(long streamHandle); /** * Retrieves the mode of the stream |
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6954/src/native/linux Modified Files: Makefile.am Added Files: display.c extgl_glx.c org_lwjgl_Sys.c org_lwjgl_input_Controller.c org_lwjgl_input_Cursor.c org_lwjgl_input_Keyboard.c org_lwjgl_input_Mouse.c org_lwjgl_opengl_Display.c org_lwjgl_opengl_Pbuffer.c Removed Files: display.cpp extgl_glx.cpp org_lwjgl_Sys.cpp org_lwjgl_input_Controller.cpp org_lwjgl_input_Cursor.cpp org_lwjgl_input_Keyboard.cpp org_lwjgl_input_Mouse.cpp org_lwjgl_opengl_Display.cpp org_lwjgl_opengl_Pbuffer.cpp Log Message: Converted native code from C++ (.cpp files) to C (.c files), thus avoiding an annoying dependency on the standard C++ library on Linux. We weren't using any particular C++ features anyway. Index: Makefile.am =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/Makefile.am,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- Makefile.am 21 Aug 2004 00:18:19 -0000 1.17 +++ Makefile.am 10 Sep 2004 08:13:55 -0000 1.18 @@ -6,14 +6,13 @@ INCLUDES = -I../common NATIVE = \ - org_lwjgl_Sys.cpp \ - org_lwjgl_input_Controller.cpp \ - org_lwjgl_input_Keyboard.cpp \ - org_lwjgl_input_Mouse.cpp \ - org_lwjgl_input_Cursor.cpp \ - org_lwjgl_opengl_Display.cpp \ - org_lwjgl_opengl_Pbuffer.cpp \ - display.cpp \ - extgl_glx.cpp -# extxcursor.cpp + org_lwjgl_Sys.c \ + org_lwjgl_input_Controller.c \ + org_lwjgl_input_Keyboard.c \ + org_lwjgl_input_Mouse.c \ + org_lwjgl_input_Cursor.c \ + org_lwjgl_opengl_Display.c \ + org_lwjgl_opengl_Pbuffer.c \ + display.c \ + extgl_glx.c --- org_lwjgl_opengl_Display.cpp DELETED --- --- NEW FILE: extgl_glx.c --- /* * Copyright (c) 2002-2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "extgl_glx.h" glXGetFBConfigsPROC glXGetFBConfigs = NULL; glXChooseFBConfigPROC glXChooseFBConfig = NULL; glXGetFBConfigAttribPROC glXGetFBConfigAttrib = NULL; glXGetVisualFromFBConfigPROC glXGetVisualFromFBConfig = NULL; glXCreateWindowPROC glXCreateWindow = NULL; glXDestroyWindowPROC glXDestroyWindow = NULL; glXCreatePixmapPROC glXCreatePixmap = NULL; glXDestroyPixmapPROC glXDestroyPixmap = NULL; glXCreatePbufferPROC glXCreatePbuffer = NULL; glXDestroyPbufferPROC glXDestroyPbuffer = NULL; glXQueryDrawablePROC glXQueryDrawable = NULL; glXCreateNewContextPROC glXCreateNewContext = NULL; glXMakeContextCurrentPROC glXMakeContextCurrent = NULL; glXGetCurrentReadDrawablePROC glXGetCurrentReadDrawable = NULL; glXGetCurrentDisplayPROC glXGetCurrentDisplay = NULL; glXQueryContextPROC glXQueryContext = NULL; glXSelectEventPROC glXSelectEvent = NULL; glXGetSelectedEventPROC glXGetSelectedEvent = NULL; glXChooseVisualPROC glXChooseVisual = NULL; glXCopyContextPROC glXCopyContext = NULL; glXCreateContextPROC glXCreateContext = NULL; glXCreateGLXPixmapPROC glXCreateGLXPixmap = NULL; glXDestroyContextPROC glXDestroyContext = NULL; glXDestroyGLXPixmapPROC glXDestroyGLXPixmap = NULL; glXGetConfigPROC glXGetConfig = NULL; glXGetCurrentContextPROC glXGetCurrentContext = NULL; glXGetCurrentDrawablePROC glXGetCurrentDrawable = NULL; glXIsDirectPROC glXIsDirect = NULL; glXMakeCurrentPROC glXMakeCurrent = NULL; glXQueryExtensionPROC glXQueryExtension = NULL; glXQueryVersionPROC glXQueryVersion = NULL; glXSwapBuffersPROC glXSwapBuffers = NULL; glXUseXFontPROC glXUseXFont = NULL; glXWaitGLPROC glXWaitGL = NULL; glXWaitXPROC glXWaitX = NULL; glXGetClientStringPROC glXGetClientString = NULL; glXQueryServerStringPROC glXQueryServerString = NULL; glXQueryExtensionsStringPROC glXQueryExtensionsString = NULL; /* GLX_SGI_swap_control */ glXSwapIntervalSGIPROC glXSwapIntervalSGI = NULL; /** returns true if the extention is available */ static bool GLXQueryExtension(JNIEnv* env, Display *disp, int screen, const char *name) { const GLubyte *exts = (const GLubyte *)glXQueryExtensionsString(disp, screen); return extgl_QueryExtension(env, exts, name); } static void extgl_InitGLX13(JNIEnv *env) { ExtFunction functions[] = { {"glXGetFBConfigs", (void*)&glXGetFBConfigs}, {"glXChooseFBConfig", (void*)&glXChooseFBConfig}, {"glXGetFBConfigAttrib", (void*)&glXGetFBConfigAttrib}, {"glXGetVisualFromFBConfig", (void*)&glXGetVisualFromFBConfig}, {"glXCreateWindow", (void*)&glXCreateWindow}, {"glXDestroyWindow", (void*)&glXDestroyWindow}, {"glXCreatePixmap", (void*)&glXCreatePixmap}, {"glXDestroyPixmap", (void*)&glXDestroyPixmap}, {"glXCreatePbuffer", (void*)&glXCreatePbuffer}, {"glXDestroyPbuffer", (void*)&glXDestroyPbuffer}, {"glXQueryDrawable", (void*)&glXQueryDrawable}, {"glXCreateNewContext", (void*)&glXCreateNewContext}, {"glXMakeContextCurrent", (void*)&glXMakeContextCurrent}, {"glXGetCurrentReadDrawable", (void*)&glXGetCurrentReadDrawable}, {"glXGetCurrentDisplay", (void*)&glXGetCurrentDisplay}, {"glXQueryContext", (void*)&glXQueryContext}, {"glXSelectEvent", (void*)&glXSelectEvent}, {"glXGetSelectedEvent", (void*)&glXGetSelectedEvent}}; if (extgl_Extensions.GLX13) extgl_Extensions.GLX13 = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions); } static bool extgl_InitGLX12(void) { ExtFunction functions[] = { {"glXChooseVisual", (void*)&glXChooseVisual}, {"glXCopyContext", (void*)&glXCopyContext}, {"glXCreateContext", (void*)&glXCreateContext}, {"glXCreateGLXPixmap", (void*)&glXCreateGLXPixmap}, {"glXDestroyContext", (void*)&glXDestroyContext}, {"glXDestroyGLXPixmap", (void*)&glXDestroyGLXPixmap}, {"glXGetConfig", (void*)&glXGetConfig}, {"glXGetCurrentContext", (void*)&glXGetCurrentContext}, {"glXGetCurrentDrawable", (void*)&glXGetCurrentDrawable}, {"glXIsDirect", (void*)&glXIsDirect}, {"glXMakeCurrent", (void*)&glXMakeCurrent}, {"glXQueryExtension", (void*)&glXQueryExtension}, {"glXQueryVersion", (void*)&glXQueryVersion}, {"glXSwapBuffers", (void*)&glXSwapBuffers}, {"glXUseXFont", (void*)&glXUseXFont}, {"glXWaitGL", (void*)&glXWaitGL}, {"glXWaitX", (void*)&glXWaitX}, {"glXGetClientString", (void*)&glXGetClientString}, {"glXQueryServerString", (void*)&glXQueryServerString}, {"glXQueryExtensionsString", (void*)&glXQueryExtensionsString}}; return extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions); } static void extgl_InitGLXSupportedExtensions(JNIEnv *env, Display *disp, int screen) { extgl_Extensions.GLX_EXT_visual_info = GLXQueryExtension(env, disp, screen, "GLX_EXT_visual_info"); extgl_Extensions.GLX_EXT_visual_rating = GLXQueryExtension(env, disp, screen, "GLX_EXT_visual_rating"); extgl_Extensions.GLX_SGI_swap_control = GLXQueryExtension(env, disp, screen, "GLX_SGI_swap_control"); extgl_Extensions.GLX_ARB_multisample = GLXQueryExtension(env, disp, screen, "GLX_ARB_multisample"); } static void extgl_InitGLXSGISwapControl(JNIEnv *env) { ExtFunction functions[] = { {"glXSwapIntervalSGI", (void*)&glXSwapIntervalSGI}}; if (extgl_Extensions.GLX_SGI_swap_control) extgl_Extensions.GLX_SGI_swap_control = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions); } bool extgl_InitGLX(JNIEnv *env, Display *disp, int screen) { int major, minor; /* Assume glx ver >= 1.2 */ extgl_Extensions.GLX12 = true; if (!extgl_InitGLX12()) return false; extgl_InitGLXSupportedExtensions(env, disp, screen); if (glXQueryVersion(disp, &major, &minor) != True) return false; if (major > 1 || (major == 1 && minor >= 3)) extgl_Extensions.GLX13 = true; extgl_InitGLX13(env); extgl_InitGLXSGISwapControl(env); return true; } --- NEW FILE: org_lwjgl_input_Controller.c --- /* * Copyright (c) 2002-2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** * $Id: org_lwjgl_input_Controller.c,v 1.1 2004/09/10 08:13:55 elias_naur Exp $ * * Linux controller handling. * * @author Elias Naur <br...@ma...> * @version $Revision: 1.1 $ */ #include <jni.h> #include "Window.h" #include "common_tools.h" #include "org_lwjgl_input_Controller.h" /** * Initializes any field ids */ JNIEXPORT void JNICALL Java_org_lwjgl_input_Controller_initIDs(JNIEnv * env, jclass clazz) { } /** * Called when the Controller instance is to be created */ JNIEXPORT void JNICALL Java_org_lwjgl_input_Controller_nCreate(JNIEnv *env, jclass clazz) { throwException(env, "Controller not implemented"); } /* * Class: org_lwjgl_input_Controller * Method: nDestroy * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_input_Controller_nDestroy(JNIEnv *env, jclass clazz) { } /* * Class: org_lwjgl_input_Controller * Method: nPoll * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_input_Controller_nPoll(JNIEnv * env, jclass clazz) { } --- org_lwjgl_opengl_Pbuffer.cpp DELETED --- --- NEW FILE: display.c --- /* * Copyright (c) 2002-2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** * $Id: display.c,v 1.1 2004/09/10 08:13:55 elias_naur Exp $ * * Linux specific library for display handling. * * @author elias_naur <eli...@us...> * @version $Revision: 1.1 $ */ #include <X11/X.h> #include <X11/Xlib.h> #include <X11/extensions/xf86vmode.h> #include <X11/extensions/Xrandr.h> #include <X11/Xutil.h> #include <stdio.h> #include <stdlib.h> #include <math.h> #include "display.h" #include "common_tools.h" #include "Window.h" typedef struct { int width; int height; int freq; union { int size_index; // Data for Xrandr extension XF86VidModeModeInfo xf86vm_modeinfo; // Data for XF86VidMode extension } mode_data; } mode_info; static int saved_width; static int saved_height; static int saved_freq; static int current_width; static int current_height; static int current_freq; static int saved_gamma_ramp_length = 0; static unsigned short *r_ramp; static unsigned short *g_ramp; static unsigned short *b_ramp; static extension current_extension = NONE; int getScreenModeWidth(void) { return current_width; } int getScreenModeHeight(void) { return current_height; } extension getCurrentDisplayModeExtension(void) { return current_extension; } static bool getXF86VidModeVersion(Display *disp, int *major, int *minor) { int event_base, error_base; if (!XF86VidModeQueryExtension(disp, &event_base, &error_base)) { printfDebug("XF86VidMode extension not available\n"); return false; } if (!XF86VidModeQueryVersion(disp, major, minor)) { printfDebug("Could not query XF86VidMode version\n"); return false; } printfDebug("XF86VidMode extension version %i.%i\n", *major, *minor); return true; } static bool getXrandrVersion(Display *disp, int *major, int *minor) { int event_base, error_base; if (!XRRQueryExtension(disp, &event_base, &error_base)) { printfDebug("Xrandr extension not available\n"); return false; } if (!XRRQueryVersion(disp, major, minor)) { printfDebug("Could not query Xrandr version\n"); return false; } printfDebug("Xrandr extension version %i.%i\n", *major, *minor); return true; } static bool isXrandrSupported(Display *disp) { int major, minor; if (!getXrandrVersion(disp, &major, &minor)) return false; return major >= 1; } static bool isXF86VidModeSupported(Display *disp) { int minor_ver, major_ver; if (!getXF86VidModeVersion(disp, &major_ver, &minor_ver)) return false; return major_ver >= 2; } static extension getBestDisplayModeExtension(Display *disp) { if (isXrandrSupported(disp)) return XRANDR; else if (isXF86VidModeSupported(disp)) return XF86VIDMODE; else return NONE; } static mode_info *getXrandrDisplayModes(Display *disp, int screen, int *num_modes) { int num_randr_sizes; XRRScreenSize *sizes = XRRSizes(disp, screen, &num_randr_sizes); /* Count number of modes */ int num_randr_modes = 0; int i; for (i = 0; i < num_randr_sizes; i++) { int num_randr_rates; XRRRates(disp, screen, i, &num_randr_rates); num_randr_modes += num_randr_rates; } mode_info *avail_modes = (mode_info *)malloc(sizeof(mode_info)*num_randr_modes); if (avail_modes == NULL) return NULL; int mode = 0; for (i = 0; i < num_randr_sizes; i++) { int num_randr_rates; short *freqs = XRRRates(disp, screen, i, &num_randr_rates); int j; for (j = 0; j < num_randr_rates; j++) { avail_modes[mode].width = sizes[i].width; avail_modes[mode].height = sizes[i].height; avail_modes[mode].freq = freqs[j]; avail_modes[mode].mode_data.size_index = i; mode++; } } *num_modes = num_randr_modes; return avail_modes; } static mode_info *getXF86VidModeDisplayModes(Display *disp, int screen, int *num_modes) { int num_xf86vm_modes; XF86VidModeModeInfo **avail_xf86vm_modes; XF86VidModeGetAllModeLines(disp, screen, &num_xf86vm_modes, &avail_xf86vm_modes); mode_info *avail_modes = (mode_info *)malloc(sizeof(mode_info)*num_xf86vm_modes); if (avail_modes == NULL) { XFree(avail_xf86vm_modes); return NULL; } int i; for (i = 0; i < num_xf86vm_modes; i++) { avail_modes[i].width = avail_xf86vm_modes[i]->hdisplay; avail_modes[i].height = avail_xf86vm_modes[i]->vdisplay; avail_modes[i].freq = 0; // No frequency support in XF86VidMode avail_modes[i].mode_data.xf86vm_modeinfo = *avail_xf86vm_modes[i]; } XFree(avail_xf86vm_modes); *num_modes = num_xf86vm_modes; return avail_modes; } static mode_info *getDisplayModes(Display *disp, int screen, int *num_modes) { switch (current_extension) { case XF86VIDMODE: return getXF86VidModeDisplayModes(disp, screen, num_modes); case XRANDR: return getXrandrDisplayModes(disp, screen, num_modes); case NONE: // fall through default: // Should never happen return NULL; } } static bool setXF86VidModeMode(Display *disp, int screen, mode_info *mode) { return True == XF86VidModeSwitchToMode(disp, screen, &mode->mode_data.xf86vm_modeinfo); } static bool setXrandrMode(Display *disp, int screen, mode_info *mode) { Status success; do { Time config_time; Drawable root_window = RootWindow(disp, screen); XRRScreenConfiguration *screen_configuration = XRRGetScreenInfo (disp, root_window); XRRConfigTimes(screen_configuration, &config_time); Rotation current_rotation; XRRConfigRotations(screen_configuration, ¤t_rotation); success = XRRSetScreenConfigAndRate(disp, screen_configuration, root_window, mode->mode_data.size_index, current_rotation, mode->freq, config_time); XRRFreeScreenConfigInfo(screen_configuration); } while (success != 0); return true; } static bool setMode(Display *disp, int screen, int width, int height, int freq/*, bool lock_mode*/) { if (current_extension == NONE) return false; int num_modes, i; mode_info *avail_modes = getDisplayModes(disp, screen, &num_modes); if (avail_modes == NULL) { printfDebug("Could not get display modes\n"); return false; } bool result = false; for ( i = 0; i < num_modes; ++i ) { printfDebug("Mode %d: %dx%d @%d\n", i, avail_modes[i].width, avail_modes[i].height, avail_modes[i].freq); if (avail_modes[i].width == width && avail_modes[i].height == height && avail_modes[i].freq == freq) { switch (current_extension) { case XF86VIDMODE: if (!setXF86VidModeMode(disp, screen, &avail_modes[i])) { printfDebug("Could not switch mode\n"); continue; } break; case XRANDR: if (!setXrandrMode(disp, screen, &avail_modes[i])) { printfDebug("Could not switch mode\n"); continue; } break; case NONE: // Should never happen default: // Should never happen continue; } result = true; break; } } free(avail_modes); XFlush(disp); return result; } static void freeSavedGammaRamps() { free(r_ramp); free(g_ramp); free(b_ramp); r_ramp = NULL; g_ramp = NULL; b_ramp = NULL; saved_gamma_ramp_length = 0; } static int getGammaRampLengthOfDisplay(Display *disp, int screen) { int ramp_size; if (!isXF86VidModeSupported(disp)) { printfDebug("XF86VidMode extension version >= 2 not found\n"); return 0; } if (XF86VidModeGetGammaRampSize(disp, screen, &ramp_size) == False) { printfDebug("XF86VidModeGetGammaRampSize call failed\n"); return 0; } return ramp_size; } int getGammaRampLength(int screen) { Display *disp = XOpenDisplay(NULL); if (disp == NULL) { printfDebug("Could not open display"); return 0; } int length = getGammaRampLengthOfDisplay(disp, screen); XCloseDisplay(disp); return length; } jobject initDisplay(JNIEnv *env, int screen) { int num_modes; mode_info *avail_modes; Display *disp = XOpenDisplay(NULL); if (disp == NULL) { throwException(env, "Could not open display"); return NULL; } current_extension = getBestDisplayModeExtension(disp); if (current_extension == NONE) { throwException(env, "No display mode extension is available"); XCloseDisplay(disp); return NULL; } avail_modes = getDisplayModes(disp, screen, &num_modes); if (avail_modes == NULL) { throwException(env, "Could not get display modes"); XCloseDisplay(disp); return NULL; } saved_width = current_width = avail_modes[0].width; saved_height = current_height = avail_modes[0].height; saved_freq = current_freq = avail_modes[0].freq; int bpp = XDefaultDepth(disp, screen); printfDebug("Original display dimensions: width %d, height %d freq %d\n", saved_width, saved_height, saved_freq); jclass jclass_DisplayMode = (*env)->FindClass(env, "org/lwjgl/opengl/DisplayMode"); jmethodID ctor = (*env)->GetMethodID(env, jclass_DisplayMode, "<init>", "(IIII)V"); jobject newMode = (*env)->NewObject(env, jclass_DisplayMode, ctor, saved_width, saved_height, bpp, saved_freq); free(avail_modes); /* Fetch the current gamma ramp */ saved_gamma_ramp_length = getGammaRampLengthOfDisplay(disp, screen); if (saved_gamma_ramp_length > 0) { r_ramp = (unsigned short *)malloc(sizeof(unsigned short)*saved_gamma_ramp_length); g_ramp = (unsigned short *)malloc(sizeof(unsigned short)*saved_gamma_ramp_length); b_ramp = (unsigned short *)malloc(sizeof(unsigned short)*saved_gamma_ramp_length); if (!XF86VidModeGetGammaRamp(disp, screen, saved_gamma_ramp_length, r_ramp, g_ramp, b_ramp)) freeSavedGammaRamps(); } XCloseDisplay(disp); return newMode; } void temporaryRestoreMode(int screen) { Display *disp = XOpenDisplay(NULL); if (disp == NULL) { printfDebug("Could not open display"); return; } if (!setMode(disp, screen, current_width, current_height, current_freq)) printfDebug("Could not restore mode\n"); XCloseDisplay(disp); // Don't propagate error to caller } void temporaryResetMode(int screen) { Display *disp = XOpenDisplay(NULL); if (disp == NULL) { printfDebug("Could not open display"); return; } if (!setMode(disp, screen, saved_width, saved_height, saved_freq)) printfDebug("Could not reset mode\n"); XCloseDisplay(disp); // Don't propagate error to caller } void switchDisplayMode(JNIEnv * env, jobject mode, int screen) { if (mode == NULL) { throwException(env, "mode must be non-null"); return; } jclass cls_displayMode = (*env)->GetObjectClass(env, mode); jfieldID fid_width = (*env)->GetFieldID(env, cls_displayMode, "width", "I"); jfieldID fid_height = (*env)->GetFieldID(env, cls_displayMode, "height", "I"); jfieldID fid_freq = (*env)->GetFieldID(env, cls_displayMode, "freq", "I"); int width = (*env)->GetIntField(env, mode, fid_width); int height = (*env)->GetIntField(env, mode, fid_height); int freq = (*env)->GetIntField(env, mode, fid_freq); Display *disp = XOpenDisplay(NULL); if (disp == NULL) { throwException(env, "Could not open display"); return; } if (setMode(disp, screen, width, height, freq)) { current_width = width; current_height = height; current_freq = freq; } else throwException(env, "Could not switch mode."); XCloseDisplay(disp); } void resetDisplayMode(JNIEnv *env, int screen) { Display *disp = XOpenDisplay(NULL); // Display *disp = incDisplay(env); if (disp == NULL) return; if (!setMode(disp, screen, saved_width, saved_height, saved_freq)) { printfDebug("Failed to reset mode"); } if (saved_gamma_ramp_length > 0) { XF86VidModeSetGammaRamp(disp, screen, saved_gamma_ramp_length, r_ramp, g_ramp, b_ramp); freeSavedGammaRamps(); } // decDisplay(); XCloseDisplay(disp); } jobjectArray getAvailableDisplayModes(JNIEnv * env, int screen) { int num_modes, i; mode_info *avail_modes; Display *disp = XOpenDisplay(NULL); if (disp == NULL) { throwException(env, "Could not open display"); return NULL; } int bpp = XDefaultDepth(disp, screen); avail_modes = getDisplayModes(disp, screen, &num_modes); if (avail_modes == NULL) { printfDebug("Could not get display modes\n"); XCloseDisplay(disp); return NULL; } // Allocate an array of DisplayModes big enough jclass displayModeClass = (*env)->FindClass(env, "org/lwjgl/opengl/DisplayMode"); jobjectArray ret = (*env)->NewObjectArray(env, num_modes, displayModeClass, NULL); jmethodID displayModeConstructor = (*env)->GetMethodID(env, displayModeClass, "<init>", "(IIII)V"); for (i = 0; i < num_modes; i++) { jobject displayMode = (*env)->NewObject(env, displayModeClass, displayModeConstructor, avail_modes[i].width, avail_modes[i].height, bpp, avail_modes[i].freq); (*env)->SetObjectArrayElement(env, ret, i, displayMode); } free(avail_modes); XCloseDisplay(disp); return ret; } void setGammaRamp(JNIEnv *env, jobject gamma_ramp_buffer, int screen) { Display * disp = XOpenDisplay(NULL); if (disp == NULL) { throwException(env, "Could not open display"); return; } int gamma_ramp_length = getGammaRampLengthOfDisplay(disp, screen); if (gamma_ramp_length == 0) { throwException(env, "Gamma ramp not supported"); return; } const float *gamma_ramp = (const float *)(*env)->GetDirectBufferAddress(env, gamma_ramp_buffer); unsigned short *ramp; ramp = (unsigned short *)malloc(sizeof(unsigned short)*gamma_ramp_length); int i; for (i = 0; i < gamma_ramp_length; i++) { float scaled_gamma = gamma_ramp[i]*0xffff; ramp[i] = (unsigned short)round(scaled_gamma); } if (XF86VidModeSetGammaRamp(disp, screen, gamma_ramp_length, ramp, ramp, ramp) == False) { throwException(env, "Could not set gamma ramp."); } XCloseDisplay(disp); } --- extgl_glx.cpp DELETED --- --- org_lwjgl_input_Keyboard.cpp DELETED --- --- NEW FILE: org_lwjgl_input_Mouse.c --- /* * Copyright (c) 2002-2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** * $Id: org_lwjgl_input_Mouse.c,v 1.6 2004/09/10 08:13:55 elias_naur Exp $ * * Linux mouse handling. * * @author elias_naur <eli...@us...> * @version $Revision: 1.6 $ */ #include <X11/X.h> #include <X11/Xlib.h> #include <X11/extensions/xf86vmode.h> #include <X11/Xcursor/Xcursor.h> #include <assert.h> #include <string.h> #include "Window.h" #include "common_tools.h" #include "display.h" #include "org_lwjgl_input_Mouse.h" #define NUM_BUTTONS 3 #define POINTER_WARP_BORDER 10 #define WARP_RETRY 5 // scale the mouse wheel according to win32 #define WHEEL_SCALE 120 static bool pointer_grabbed; static bool created; static int dx; static int dy; static int dz; static int last_x; static int last_y; static int last_z; static jbyte buttons[NUM_BUTTONS]; static event_queue_t event_queue; static bool buffer_enabled; static Cursor blank_cursor; static Cursor current_cursor; static void setCursorPos(int x, int y) { int current_x = x; int current_y = y; dx += current_x - last_x; dy += current_y - last_y; last_x = current_x; last_y = current_y; } static int transformY(int y) { return getWindowHeight() - 1 - y; } static void resetCursor(int x, int y) { last_x = x; last_y = y; } static bool blankCursor(void) { unsigned int best_width, best_height; if (XQueryBestCursor(getDisplay(), getCurrentWindow(), 1, 1, &best_width, &best_height) == 0) { printfDebug("Could not query best cursor size\n"); return false; } Pixmap mask = XCreatePixmap(getDisplay(), getCurrentWindow(), best_width, best_height, 1); XGCValues gc_values; gc_values.foreground = 0; GC gc = XCreateGC(getDisplay(), mask, GCForeground, &gc_values); XFillRectangle(getDisplay(), mask, gc, 0, 0, best_width, best_height); XFreeGC(getDisplay(), gc); XColor dummy_color; blank_cursor = XCreatePixmapCursor(getDisplay(), mask, mask, &dummy_color, &dummy_color, 0, 0); XFreePixmap(getDisplay(), mask); return true; } static void updateCursor(void) { Cursor cursor; if (shouldGrab()) { cursor = blank_cursor; } else { cursor = current_cursor; } XDefineCursor(getDisplay(), getCurrentWindow(), cursor); } static void grabPointer(void) { if (!pointer_grabbed) { int result; int grab_mask = PointerMotionMask | ButtonPressMask | ButtonReleaseMask; result = XGrabPointer(getDisplay(), getCurrentWindow(), False, grab_mask, GrabModeAsync, GrabModeAsync, getCurrentWindow(), None, CurrentTime); if (result == GrabSuccess) { pointer_grabbed = true; // make sure we have a centered window if (isLegacyFullscreen()) { XWindowAttributes win_attribs; XGetWindowAttributes(getDisplay(), getCurrentWindow(), &win_attribs); XF86VidModeSetViewPort(getDisplay(), getCurrentScreen(), win_attribs.x, win_attribs.y); } XFlush(getDisplay()); } } } static void ungrabPointer(void) { if (pointer_grabbed) { pointer_grabbed = false; XUngrabPointer(getDisplay(), CurrentTime); XFlush(getDisplay()); } } void updatePointerGrab(void) { if (!created) return; if (isLegacyFullscreen() || shouldGrab()) { grabPointer(); } else { ungrabPointer(); } updateCursor(); } void handleWarpEvent(XClientMessageEvent *event) { int center_x = event->data.l[0]; int center_y = event->data.l[1]; resetCursor(center_x, center_y); } static void doWarpPointer(int center_x, int center_y) { XEvent warp_event; warp_event.type = ClientMessage; warp_event.xclient.message_type = getWarpAtom(); warp_event.xclient.format = 32; warp_event.xclient.data.l[0] = center_x; warp_event.xclient.data.l[1] = center_y; XSendEvent(getDisplay(), getCurrentWindow(), False, 0, &warp_event); XWarpPointer(getDisplay(), None, getCurrentWindow(), 0, 0, 0, 0, center_x, center_y); } JNIEXPORT jint JNICALL Java_org_lwjgl_input_Mouse_nGetNativeCursorCaps (JNIEnv *env, jclass clazz) { int caps = 0; XcursorBool argb_supported = XcursorSupportsARGB(getDisplay()); XcursorBool anim_supported = XcursorSupportsAnim(getDisplay()); if (argb_supported) caps |= org_lwjgl_input_Mouse_CURSOR_8_BIT_ALPHA | org_lwjgl_input_Mouse_CURSOR_ONE_BIT_TRANSPARENCY; if (anim_supported) caps |= org_lwjgl_input_Mouse_CURSOR_ANIMATION; return caps; } JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nSetNativeCursor(JNIEnv *env, jclass clazz, jobject cursor_handle) { if (cursor_handle != NULL) { Cursor *cursor = (Cursor *)(*env)->GetDirectBufferAddress(env, cursor_handle); current_cursor = *cursor; } else current_cursor = None; updateCursor(); } JNIEXPORT jint JNICALL Java_org_lwjgl_input_Mouse_nGetMinCursorSize (JNIEnv *env, jclass clazz) { unsigned int width_return = 0; unsigned int height_return = 0; XQueryBestCursor(getDisplay(), getCurrentWindow(), 1, 1, &width_return, &height_return); return width_return > height_return ? width_return : height_return; } JNIEXPORT jint JNICALL Java_org_lwjgl_input_Mouse_nGetMaxCursorSize (JNIEnv *env, jclass clazz) { unsigned int width_return = 0; unsigned int height_return = 0; XQueryBestCursor(getDisplay(), getCurrentWindow(), 0xffffffff, 0xffffffff, &width_return, &height_return); return width_return > height_return ? height_return : width_return; } JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_Mouse_nHasWheel(JNIEnv *env , jclass clazz) { return JNI_TRUE; } JNIEXPORT jint JNICALL Java_org_lwjgl_input_Mouse_nGetButtonCount(JNIEnv *env, jclass clazz) { return NUM_BUTTONS; } JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nCreate (JNIEnv * env, jclass clazz) { Display *disp = incDisplay(env); if (disp == NULL) return; int i; last_z = last_y = last_x = dx = dy = dz = 0; for (i = 0; i < NUM_BUTTONS; i++) buttons[i] = 0; if (!blankCursor()) { decDisplay(); throwException(env, "Could not create blank cursor"); return; } current_cursor = None; created = true; pointer_grabbed = false; buffer_enabled = false; updatePointerGrab(); initEventQueue(&event_queue); doWarpPointer(getWindowWidth()/2, getWindowHeight()/2); } JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nDestroy (JNIEnv * env, jclass clazz) { ungrabPointer(); XFreeCursor(getDisplay(), blank_cursor); created = false; decDisplay(); } static unsigned char mapButton(XButtonEvent *event) { switch (event->button) { case Button1: return 0; case Button2: return 2; case Button3: return 1; default: return NUM_BUTTONS; } } static void handleButton(XButtonEvent *event, unsigned char state) { unsigned char button_num = mapButton(event); if (button_num == NUM_BUTTONS) return; buttons[button_num] = state; if (buffer_enabled) { putEventElement(&event_queue, button_num); putEventElement(&event_queue, state); } } void handleButtonPress(XButtonEvent *event) { switch (event->button) { case Button4: dz += WHEEL_SCALE; break; case Button5: dz -= WHEEL_SCALE; break; default: break; } handleButton(event, 1); } void handleButtonRelease(XButtonEvent *event) { handleButton(event, 0); } static int max(int v1, int v2) { return v1 > v2 ? v1 : v2; } static int min(int v1, int v2) { return v1 < v2 ? v1 : v2; } void handlePointerMotion(XMotionEvent *event) { int x = event->x; int y = event->y; setCursorPos(x, y); if (!pointer_grabbed || !shouldGrab()) return; int x_root = event->x_root; int y_root = event->y_root; // find the window position in root coordinates int win_left = x_root - x; int win_top = y_root - y; int win_right = win_left + getWindowWidth(); int win_bottom = win_top + getWindowHeight(); // cap the window position to the screen dimensions int border_left = max(0, win_left); int border_top = max(0, win_top); int border_right = min(getScreenModeWidth(), win_right); int border_bottom = min(getScreenModeHeight(), win_bottom); // determine whether the cursor is outside the bounds bool outside_limits = x_root < border_left + POINTER_WARP_BORDER || y_root < border_top + POINTER_WARP_BORDER || x_root > border_right - POINTER_WARP_BORDER || y_root > border_bottom - POINTER_WARP_BORDER; if (outside_limits) { // Find the center of the limits in window coordinates int center_x = (border_right - border_left)/2; int center_y = (border_bottom - border_top)/2; doWarpPointer(center_x, center_y); } } JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nPoll(JNIEnv * env, jclass clazz, jobject coord_buffer_obj, jobject button_buffer_obj) { int *coords = (int *)(*env)->GetDirectBufferAddress(env, coord_buffer_obj); int coords_length = (*env)->GetDirectBufferCapacity(env, coord_buffer_obj); unsigned char *buttons_buffer = (unsigned char *)(*env)->GetDirectBufferAddress(env, button_buffer_obj); int buttons_length = (*env)->GetDirectBufferCapacity(env, button_buffer_obj); if (coords_length < 3) { printfDebug("ERROR: Not enough space in coords array: %d < 3\n", coords_length); return; } coords[0] = dx; coords[1] = -dy; coords[2] = dz; dx = 0; dy = 0; dz = 0; int num_buttons = NUM_BUTTONS; if (num_buttons > buttons_length) num_buttons = buttons_length; int i; for (i = 0; i < num_buttons; i++) buttons_buffer[i] = buttons[i]; } JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nEnableBuffer(JNIEnv *env, jclass clazz) { buffer_enabled = true; } JNIEXPORT jint JNICALL Java_org_lwjgl_input_Mouse_nRead(JNIEnv *env, jclass clazz, jobject buffer, jint buffer_position) { unsigned char* buffer_ptr = (unsigned char *)(*env)->GetDirectBufferAddress(env, buffer); int buffer_size = (*env)->GetDirectBufferCapacity(env, buffer) - buffer_position; return copyEvents(&event_queue, buffer_ptr + buffer_position, buffer_size, 2); } JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nGrabMouse(JNIEnv * env, jclass clazz, jboolean new_grab) { setGrab(new_grab == JNI_TRUE ? true : false); resetCursor(getWindowWidth()/2, transformY(getWindowHeight()/2)); } --- display.cpp DELETED --- --- NEW FILE: org_lwjgl_Sys.c --- /* * Copyright (c) 2002-2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** * $Id: org_lwjgl_Sys.c,v 1.6 2004/09/10 08:13:55 elias_naur Exp $ * * Linux system library. * * @author elias_naur <eli...@us...> * @version $Revision: 1.6 $ */ #include <sched.h> #include <sys/time.h> #include <sys/resource.h> #include "org_lwjgl_Sys.h" #include "common_tools.h" static long int hires_timer; // Hires timer current time /* * Class: org_lwjgl_Sys * Method: getTimerResolution * Signature: ()J */ JNIEXPORT jlong JNICALL Java_org_lwjgl_Sys_getTimerResolution (JNIEnv * env, jclass clazz) { // Constant on linux return 1000000; } static long queryTime(void) { struct timeval tv; if (gettimeofday(&tv, NULL) == -1) { printfDebug("Could not read current time\n"); } long result = tv.tv_sec * 1000000l + tv.tv_usec; return result; } JNIEXPORT void JNICALL Java_org_lwjgl_Sys_setDebug(JNIEnv *env, jclass clazz, jboolean enabled) { setDebugEnabled(enabled == JNI_TRUE ? true : false); } /* * Class: org_lwjgl_Sys * Method: ngetTime * Signature: ()J */ JNIEXPORT jlong JNICALL Java_org_lwjgl_Sys_ngetTime (JNIEnv * env, jclass clazz) { hires_timer = queryTime(); return (jlong) hires_timer; } /* * Class: org_lwjgl_Sys * Method: setProcessPriority * Signature: (I)V */ JNIEXPORT void JNICALL Java_org_lwjgl_Sys_setProcessPriority (JNIEnv * env, jclass clazz, jint priority) { int linux_priority; int max_pri, min_pri; struct sched_param sched_pri; if (sched_getscheduler(0) != SCHED_OTHER) { // Reset scheduler to normal sched_pri.sched_priority = 0; if (sched_setscheduler(0, SCHED_OTHER, &sched_pri) != 0) { printfDebug("Could not set realtime priority\n"); return; } } switch (priority) { case org_lwjgl_Sys_REALTIME_PRIORITY: min_pri = sched_get_priority_min(SCHED_FIFO); max_pri = sched_get_priority_max(SCHED_FIFO); if (min_pri == -1 || max_pri == -1) { printfDebug("Failed to set realtime priority\n"); return; } sched_pri.sched_priority = (max_pri + min_pri)/2; if (sched_setscheduler(0, SCHED_FIFO, &sched_pri) != 0) { printfDebug("Could not set realtime priority\n"); return; } return; case org_lwjgl_Sys_HIGH_PRIORITY: linux_priority = -20; break; case org_lwjgl_Sys_NORMAL_PRIORITY: linux_priority = 0; break; case org_lwjgl_Sys_LOW_PRIORITY: linux_priority = 20; break; default: return; } if (setpriority(PRIO_PROCESS, 0, linux_priority) == -1) { printfDebug("Failed to set priority.\n"); } } JNIEXPORT void JNICALL Java_org_lwjgl_Sys_nAlert(JNIEnv * env, jclass clazz, jstring title, jstring message) { jboolean copy = JNI_FALSE; const char * eMessageText = (*env)->GetStringUTFChars(env, message, ©); const char * cTitleBarText = (*env)->GetStringUTFChars(env, title, ©); printf("*** Alert ***\n%s\n%s\n", cTitleBarText, eMessageText); (*env)->ReleaseStringUTFChars(env, message, eMessageText); (*env)->ReleaseStringUTFChars(env, title, cTitleBarText); } JNIEXPORT jstring JNICALL Java_org_lwjgl_Sys_getNativeLibraryVersion(JNIEnv *env, jclass clazz) { return getVersionString(env); } /* * Class: org_lwjgl_Sys * Method: openURL * Signature: (Ljava/lang/String;)V */ JNIEXPORT void JNICALL Java_org_lwjgl_Sys_nOpenURL (JNIEnv * env, jclass clazz, jstring url) { const char * urlString = (*env)->GetStringUTFChars(env, url, NULL); printf("*** Please visit %s\n", urlString); (*env)->ReleaseStringUTFChars(env, url, urlString); } JNIEXPORT jstring JNICALL Java_org_lwjgl_Sys_nGetClipboard (JNIEnv * env, jclass clazz) { return NULL; } --- NEW FILE: org_lwjgl_input_Keyboard.c --- /* * Copyright (c) 2002-2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** * $Id: org_lwjgl_input_Keyboard.c,v 1.4 2004/09/10 08:13:55 elias_naur Exp $ * * Linux keyboard handling. * * @author elias_naur <eli...@us...> * @version $Revision: 1.4 $ */ #include <X11/X.h> #include <X11/Xlib.h> #include <X11/Xutil.h> #include <string.h> #include <assert.h> #include "Window.h" #include "common_tools.h" #include "org_lwjgl_input_Keyboard.h" #define KEYBOARD_BUFFER_SIZE 50 #define KEYBOARD_SIZE 256 #define KEY_EVENT_BACKLOG 40 static unsigned char key_buf[KEYBOARD_SIZE]; static unsigned char key_map[KEYBOARD_SIZE]; static event_queue_t event_queue; static bool keyboard_grabbed; static bool buffer_enabled; static bool translation_enabled; static bool created = false; static void grabKeyboard(void) { if (!keyboard_grabbed) { int result = XGrabKeyboard(getDisplay(), getCurrentWindow(), False, GrabModeAsync, GrabModeAsync, CurrentTime); if (result == GrabSuccess) keyboard_grabbed = true; } } static void ungrabKeyboard(void) { if (keyboard_grabbed) { keyboard_grabbed = false; XUngrabKeyboard(getDisplay(), CurrentTime); } } void updateKeyboardGrab(void) { if (!created) return; if (isLegacyFullscreen()/* || shouldGrab()*/) { grabKeyboard(); } else { ungrabKeyboard(); } } JNIEXPORT void JNICALL Java_org_lwjgl_input_Keyboard_nCreate (JNIEnv * env, jclass clazz) { Display *disp = incDisplay(env); if (disp == NULL) return; int i; for (i = 0; i < KEYBOARD_SIZE; i++) key_map[i] = i; key_map[0x6b] = 0xdb; // Left doze key key_map[0x6c] = 0xdc; // Right doze key key_map[0x6d] = 0xdd; // Apps key key_map[0x5a] = 0xc8; // Up arrow key_map[0x5c] = 0xcb; // Left arrow key_map[0x5e] = 0xcd; // Right arrow key_map[0x60] = 0xd0; // Down arrow key_map[0x59] = 0xc7; // Home key_map[0x62] = 0xd2; // Insert key_map[0x63] = 0xd3; // Delete key_map[0x5f] = 0xcf; // End key_map[0x5b] = 0xc9; // Page up key_map[0x61] = 0xd1; // Page down key_map[0x67] = 0xb7; // SysRQ key_map[0x66] = 0xc5; // Pause key_map[0x64] = 0x9c; // Numpad enter key_map[0x65] = 0x9d; // Right control key_map[0x68] = 0xb5; // Numpad divide memset(key_buf, 0, KEYBOARD_SIZE*sizeof(unsigned char)); created = true; keyboard_grabbed = false; translation_enabled = false; buffer_enabled = false; initEventQueue(&event_queue); updateKeyboardGrab(); } JNIEXPORT void JNICALL Java_org_lwjgl_input_Keyboard_nDestroy (JNIEnv * env, jclass clazz) { ungrabKeyboard(); created = false; decDisplay(); } static unsigned char getKeycode(XKeyEvent *event) { unsigned char keycode = (unsigned char)((event->keycode - 8) & 0xff); keycode = key_map[keycode]; return keycode; } static int translateEvent(XKeyEvent *event) { static char temp_translation_buffer[KEYBOARD_BUFFER_SIZE]; static XComposeStatus status; int num_chars, i; if (event->type == KeyRelease) { putEventElement(&event_queue, 0); putEventElement(&event_queue, 0); return 0; } num_chars = XLookupString(event, temp_translation_buffer, KEYBOARD_BUFFER_SIZE, NULL, &status); if (num_chars > 0) { num_chars--; /* Assume little endian byte order */ putEventElement(&event_queue, temp_translation_buffer[0]); putEventElement(&event_queue, 0); for (i = 0; i < num_chars; i++) { putEventElement(&event_queue, 0); putEventElement(&event_queue, 0); putEventElement(&event_queue, temp_translation_buffer[i + 1]); putEventElement(&event_queue, 0); } } else { putEventElement(&event_queue, 0); putEventElement(&event_queue, 0); } return num_chars; } static unsigned char eventState(XKeyEvent *event) { if (event->type == KeyPress) { return 1; } else if (event->type == KeyRelease) { return 0; } else assert(0); } static void bufferEvent(XKeyEvent *key_event) { unsigned char keycode = getKeycode(key_event); unsigned char state = eventState(key_event); //printf("Reading a key %d %d count %d\n", (int)keycode, (int)state, num_events); putEventElement(&event_queue, keycode); putEventElement(&event_queue, state); if (translation_enabled) translateEvent(key_event); } void handleKeyEvent(XKeyEvent *event) { unsigned char keycode = getKeycode(event); unsigned char state = eventState(event); key_buf[keycode] = state; if (buffer_enabled) bufferEvent(event); } JNIEXPORT void JNICALL Java_org_lwjgl_input_Keyboard_nPoll(JNIEnv * env, jclass clazz, jobject buffer) { unsigned char *new_keyboard_buffer = (unsigned char *)(*env)->GetDirectBufferAddress(env, buffer); memcpy(new_keyboard_buffer, key_buf, KEYBOARD_SIZE*sizeof(unsigned char)); } JNIEXPORT int JNICALL Java_org_lwjgl_input_Keyboard_nRead(JNIEnv * env, jclass clazz, jobject buffer, jint buffer_position) { int event_size; if (translation_enabled) event_size = 4; else event_size = 2; unsigned char* buffer_ptr = (unsigned char *)(*env)->GetDirectBufferAddress(env, buffer); int buffer_size = (*env)->GetDirectBufferCapacity(env, buffer) - buffer_position; return copyEvents(&event_queue, buffer_ptr + buffer_position, buffer_size, event_size); } JNIEXPORT void JNICALL Java_org_lwjgl_input_Keyboard_nEnableTranslation(JNIEnv *env, jclass clazz) { translation_enabled = true; } JNIEXPORT void JNICALL Java_org_lwjgl_input_Keyboard_nEnableBuffer(JNIEnv * env, jclass clazz) { buffer_enabled = true; } JNIEXPORT jint JNICALL Java_org_lwjgl_input_Keyboard_nisStateKeySet(JNIEnv *env, jclass clazz, jint key) { return org_lwjgl_input_Keyboard_STATE_UNKNOWN; } --- org_lwjgl_input_Controller.cpp DELETED --- --- org_lwjgl_input_Mouse.cpp DELETED --- --- NEW FILE: org_lwjgl_opengl_Pbuffer.c --- /* * Copyright (c) 2002-2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** * $Id: org_lwjgl_opengl_Pbuffer.c,v 1.1 2004/09/10 08:13:56 elias_naur Exp $ * * Linux Pbuffer. * * @author elias_naur <eli...@us...> * @version $Revision: 1.1 $ */ #include <stdlib.h> #include "org_lwjgl_opengl_Pbuffer.h" #include "extgl.h" #include "Window.h" #include "common_tools.h" typedef struct _PbufferInfo { GLXPbuffer buffer; GLXContext context; } PbufferInfo; JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_Pbuffer_nIsBufferLost (JNIEnv *env, jclass clazz, jobject handle_buffer) { // The buffer is never lost, because of the GLX_PRESERVED_CONTENTS flag return JNI_FALSE; } JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_Pbuffer_getPbufferCaps (JNIEnv *env, jclass clazz) { // Only support the GLX 1.3 Pbuffers and ignore the GLX_SGIX_pbuffer extension return extgl_Extensions.GLX13 ? org_lwjgl_opengl_Pbuffer_PBUFFER_SUPPORTED : 0; } static void destroyPbuffer(PbufferInfo *buffer_info) { GLXPbuffer buffer = buffer_info->buffer; GLXContext context = buffer_info->context; glXDestroyPbuffer(getDisplay(), buffer); glXDestroyContext(getDisplay(), context); decDisplay(); } static bool checkPbufferCaps(JNIEnv *env, GLXFBConfig config, int width, int height) { int max; int result = glXGetFBConfigAttrib(getDisplay(), config, GLX_MAX_PBUFFER_WIDTH, &max); if (result != Success) { throwException(env, "Could not get GLX_MAX_PBUFFER_WIDTH from configuration"); return false; } if (max < width) { throwException(env, "Width too large"); return false; } result = glXGetFBConfigAttrib(getDisplay(), config, GLX_MAX_PBUFFER_HEIGHT, &max); if (result != Success) { throwException(env, "Could not get GLX_MAX_PBUFFER_WIDTH from configuration"); return false; } if (max < height) { throwException(env, "Height too large"); return false; } return true; } static bool createPbufferUsingUniqueContext(JNIEnv *env, PbufferInfo *pbuffer_info, jobject pixel_format, int width, int height, const int *buffer_attribs) { GLXFBConfig *configs = chooseVisualGLX13(env, pixel_format, false, GLX_PBUFFER_BIT, false); if (configs == NULL) { throwException(env, "No matching pixel format"); return false; } if (!checkPbufferCaps(env, configs[0], width, height)) { XFree(configs); return false; } GLXContext context = glXCreateNewContext(getDisplay(), configs[0], GLX_RGBA_TYPE, getCurrentGLXContext(), True); if (context == NULL) { XFree(configs); throwException(env, "Could not create a GLX context"); return false; } jboolean allow_software_acceleration = getBooleanProperty(env, "org.lwjgl.opengl.Window.allowSoftwareOpenGL"); if (!allow_software_acceleration && glXIsDirect(getDisplay(), context) == False) { glXDestroyContext(getDisplay(), context); XFree(configs); throwException(env, "Could not create a direct GLX context"); return false; } GLXPbuffer buffer = glXCreatePbuffer(getDisplay(), configs[0], buffer_attribs); XFree(configs); pbuffer_info->context = context; pbuffer_info->buffer = buffer; return true; } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nCreate(JNIEnv *env, jclass clazz, jobject handle_buffer, jint width, jint height, jobject pixel_format, jobject pixelFormatCaps, jobject pBufferAttribs) { Display *disp = incDisplay(env); if (disp == NULL) { return; } int current_screen = getCurrentScreen(); if (!extgl_InitGLX(env, disp, current_screen)) { decDisplay(); throwException(env, "Could not init GLX"); return; } const int buffer_attribs[] = {GLX_PBUFFER_WIDTH, width, GLX_PBUFFER_HEIGHT, height, GLX_PRESERVED_CONTENTS, True, GLX_LARGEST_PBUFFER, False, None, None}; if ((*env)->GetDirectBufferCapacity(env, handle_buffer) < sizeof(PbufferInfo)) { decDisplay(); throwException(env, "Handle buffer not large enough"); return; } PbufferInfo *buffer_info = (PbufferInfo *)(*env)->GetDirectBufferAddress(env, handle_buffer); bool result; result = createPbufferUsingUniqueContext(env, buffer_info, pixel_format, width, height, buffer_attribs); if (!result || !checkXError(env)) { decDisplay(); destroyPbuffer(buffer_info); return; } } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nMakeCurrent (JNIEnv *env, jclass clazz, jobject handle_buffer) { PbufferInfo *buffer_info = (PbufferInfo *)(*env)->GetDirectBufferAddress(env, handle_buffer); GLXPbuffer buffer = buffer_info->buffer; GLXContext context = buffer_info->context; if (glXMakeContextCurrent(getDisplay(), buffer, buffer, context) == False) { throwException(env, "Could not make pbuffer context current"); } } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nDestroy (JNIEnv *env, jclass clazz, jobject handle_buffer) { PbufferInfo *buffer_info = (PbufferInfo *)(*env)->GetDirectBufferAddress(env, handle_buffer); destroyPbuffer(buffer_info); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nSetAttrib (JNIEnv *env, jclass clazz, jobject handle_buffer, jint attrib, jint value) { throwException(env, "The render-to-texture extension is not supported."); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nBindTexImage (JNIEnv *env, jclass clazz, jobject handle_buffer, jint buffer) { throwException(env, "The render-to-texture extension is not supported."); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nReleaseTexImage (JNIEnv *env, jclass clazz, jobject handle_buffer, jint buffer) { throwException(env, "The render-to-texture extension is not supported."); } --- NEW FILE: org_lwjgl_input_Cursor.c --- /* * Copyright (c) 2002-2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** * $Id: org_lwjgl_input_Cursor.c,v 1.1 2004/09/10 08:13:55 elias_naur Exp $ * * Linux cursor handling. * * @author elias_naur <eli...@us...> * @version $Revision: 1.1 $ */ #include <X11/X.h> #include <X11/Xlib.h> #include <X11/Xcursor/Xcursor.h> #include "org_lwjgl_input_Cursor.h" //#include "extxcursor.h" #include "Window.h" #include "common_tools.h" JNIEXPORT void JNICALL Java_org_lwjgl_input_Cursor_nCreateCursor (JNIEnv *env, jclass clazz, jobject handle_buffer, jint width, jint height, jint x_hotspot, jint y_hotspot, jint num_images, jobject image_buffer, jint images_offset, jobject delay_buffer, jint delays_offset) { if ((*env)->GetDirectBufferCapacity(env, handle_buffer) < sizeof(Cursor)) { throwException(env, "Handle buffer not large enough"); return; } Display *disp = incDisplay(env); if (disp == NULL) return; const int *delays = NULL; if (delay_buffer != NULL) delays = (const int *)(*env)->GetDirectBufferAddress(env, delay_buffer) + delays_offset; XcursorPixel *pixels = (XcursorPixel *)(*env)->GetDirectBufferAddress(env, image_buffer) + images_offset; int stride = width*height; XcursorImages *cursor_images = XcursorImagesCreate(num_images); if (cursor_images == NULL) { decDisplay(); throwException(env, "Could not allocate cursor."); return; } cursor_images->nimage = num... [truncated message content] |
|
From: Elias N. <eli...@us...> - 2004-09-10 21:50:52
|
Update of /cvsroot/java-game-lib/LWJGL/src/native In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6954/src/native Modified Files: Makefile.am configure.in Added Files: dummy.c Removed Files: dummy.cpp Log Message: Converted native code from C++ (.cpp files) to C (.c files), thus avoiding an annoying dependency on the standard C++ library on Linux. We weren't using any particular C++ features anyway. --- NEW FILE: dummy.c --- void dummy() { } Index: Makefile.am =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/Makefile.am,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- Makefile.am 20 Jan 2004 08:37:17 -0000 1.15 +++ Makefile.am 10 Sep 2004 08:13:47 -0000 1.16 @@ -1,7 +1,7 @@ SUBDIRS = common @native_build_dir@ lib_LTLIBRARIES = liblwjgl.la -liblwjgl_la_SOURCES = dummy.cpp +liblwjgl_la_SOURCES = dummy.c liblwjgl_la_LIBADD = $(DEP_LIBS) @native_build_dir@/libnative.la liblwjgl_la_DEPENDENCIES = $(DEP_LIBS) @native_build_dir@/libnative.la --- dummy.cpp DELETED --- Index: configure.in =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/configure.in,v retrieving revision 1.55 retrieving revision 1.56 diff -u -d -r1.55 -r1.56 --- configure.in 21 Aug 2004 20:31:24 -0000 1.55 +++ configure.in 10 Sep 2004 08:13:47 -0000 1.56 @@ -15,14 +15,12 @@ AC_PROG_LN_S AC_PROG_MAKE_SET -AC_PROG_CXX AC_CANONICAL_HOST case "$host_os" in darwin*) _BUILD_FLAGS="-D_AGL -fpascal-strings" LDFLAGS="-Xlinker -framework -Xlinker JavaVM -Xlinker -framework -Xlinker ApplicationServices -Xlinker -framework -Xlinker CoreServices -Xlinker -framework -Xlinker Carbon" NATIVE_BUILD_DIR=macosx - CXXFLAGS="$CXXFLAGS -Wall $_BUILD_FLAGS" CFLAGS="$CFLAGS -Wall $_BUILD_FLAGS" ;; bsdi* | linux* | solaris*) AC_PATH_XTRA @@ -42,13 +40,13 @@ *) AC_MSG_ERROR([Unsupported system $host_os]);; esac -CC="$CXX" AC_PROG_LIBTOOL AC_JNI_INCLUDE_DIR for JNI_INCLUDE_DIR in $JNI_INCLUDE_DIRS do + CFLAGS="$CFLAGS -I$JNI_INCLUDE_DIR" CXXFLAGS="$CXXFLAGS -I$JNI_INCLUDE_DIR" done |
|
From: Brian M. <ma...@us...> - 2004-09-10 21:33:46
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13583 Modified Files: org_lwjgl_opengl_GL20.cpp Log Message: fixed compilation Index: org_lwjgl_opengl_GL20.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_opengl_GL20.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_opengl_GL20.cpp 9 Sep 2004 23:51:16 -0000 1.1 +++ org_lwjgl_opengl_GL20.cpp 10 Sep 2004 05:48:14 -0000 1.2 @@ -821,13 +821,13 @@ {"nglGetActiveUniform", "(IIILjava/nio/IntBuffer;ILjava/nio/IntBuffer;ILjava/nio/IntBuffer;ILjava/nio/ByteBuffer;I)V", (void*)&Java_org_lwjgl_opengl_GL20_nglGetActiveUniform, "glGetActiveUniform", (void**)&glGetActiveUniform}, {"nglGetUniformfv", "(IILjava/nio/FloatBuffer;I)V", (void*)&Java_org_lwjgl_opengl_GL20_nglGetUniformfv, "glGetUniformfv", (void**)&glGetUniformfv}, {"nglGetUniformiv", "(IILjava/nio/IntBuffer;I)V", (void*)&Java_org_lwjgl_opengl_GL20_nglGetUniformiv, "glGetUniformiv", (void**)&glGetUniformiv}, - {"nglGetShaderSource", "(IILjava/nio/IntBuffer;ILjava/nio/ByteBuffer;I)V", (void*)&Java_org_lwjgl_opengl_GL20_nglGetShaderSource, "glGetShaderSource", (void**)&glGetShaderSource} + {"nglGetShaderSource", "(IILjava/nio/IntBuffer;ILjava/nio/ByteBuffer;I)V", (void*)&Java_org_lwjgl_opengl_GL20_nglGetShaderSource, "glGetShaderSource", (void**)&glGetShaderSource}, // ARB_vertex_shader {"nglBindAttribLocation", "(IILjava/nio/ByteBuffer;I)V", (void*)&Java_org_lwjgl_opengl_GL20_nglBindAttribLocation, "glBindAttribLocation", (void**)&glBindAttribLocation}, {"nglGetActiveAttrib", "(IIILjava/nio/IntBuffer;ILjava/nio/IntBuffer;ILjava/nio/IntBuffer;ILjava/nio/ByteBuffer;I)V", (void*)&Java_org_lwjgl_opengl_GL20_nglGetActiveAttrib, "glGetActiveAttrib", (void**)&glGetActiveAttrib}, - {"nglGetAttribLocation", "(ILjava/nio/ByteBuffer;I)I", (void*)&Java_org_lwjgl_opengl_GL20_nglGetAttribLocation, "glGetAttribLocation", (void**)&glGetAttribLocation} + {"nglGetAttribLocation", "(ILjava/nio/ByteBuffer;I)I", (void*)&Java_org_lwjgl_opengl_GL20_nglGetAttribLocation, "glGetAttribLocation", (void**)&glGetAttribLocation}, // ARB_draw_buffers - {"nglDrawBuffers", "(ILjava/nio/IntBuffer;I)V", (void*)&Java_org_lwjgl_opengl_GL20_nglDrawBuffers, "glDrawBuffers", (void**)&glDrawBuffers} + {"nglDrawBuffers", "(ILjava/nio/IntBuffer;I)V", (void*)&Java_org_lwjgl_opengl_GL20_nglDrawBuffers, "glDrawBuffers", (void**)&glDrawBuffers}, // Two-Sided Stencil {"glStencilFuncSeparate", "(IIII)V", (void*)&Java_org_lwjgl_opengl_GL20_glStencilFuncSeparate, "glStencilFuncSeparate", (void**)&glStencilFuncSeparate}, {"glStencilOpSeparate", "(IIII)V", (void*)&Java_org_lwjgl_opengl_GL20_glStencilOpSeparate, "glStencilOpSeparate", (void**)&glStencilOpSeparate} |
|
From: Elias N. <eli...@us...> - 2004-09-10 14:09:54
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15824/linux Modified Files: org_lwjgl_opengl_Display.c Log Message: Improved _NET_WM_STATE_FULLSCREEN support for older kde window managers Index: org_lwjgl_opengl_Display.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_opengl_Display.c 10 Sep 2004 08:13:56 -0000 1.1 +++ org_lwjgl_opengl_Display.c 10 Sep 2004 14:09:33 -0000 1.2 @@ -191,6 +191,14 @@ XCloseDisplay(disp); } +static void setDecorations(int dec) { + Atom motif_hints_atom = XInternAtom(getDisplay(), "_MOTIF_WM_HINTS", False); + MotifWmHints motif_hints; + motif_hints.flags = MWM_HINTS_DECORATIONS; + motif_hints.decorations = dec; + XChangeProperty (getDisplay(), getCurrentWindow(), motif_hints_atom, motif_hints_atom, 32, PropModeReplace, (unsigned char *)&motif_hints, sizeof(MotifWmHints)/sizeof(long)); +} + bool releaseInput(void) { if (isLegacyFullscreen() || input_released) return false; @@ -369,13 +377,9 @@ } printfDebug("Created window\n"); current_win = win; - if (undecorated && current_window_mode == WINDOWED) { + if (current_window_mode != WINDOWED || undecorated) { // Use Motif decoration hint property and hope the window manager respects them - Atom motif_hints_atom = XInternAtom(getDisplay(), "_MOTIF_WM_HINTS", False); - MotifWmHints motif_hints; - motif_hints.flags = MWM_HINTS_DECORATIONS; - motif_hints.decorations = 0; - XChangeProperty (getDisplay(), getCurrentWindow(), motif_hints_atom, motif_hints_atom, 32, PropModeReplace, (unsigned char *)&motif_hints, sizeof(MotifWmHints)/sizeof(long)); + setDecorations(0); } XSizeHints * size_hints = XAllocSizeHints(); size_hints->flags = PMinSize | PMaxSize; |
|
From: Elias N. <eli...@us...> - 2004-09-10 11:18:32
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9970/common Modified Files: org_lwjgl_openal_eax_EAX20.c Log Message: More conversion fixes Index: org_lwjgl_openal_eax_EAX20.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_eax_EAX20.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- org_lwjgl_openal_eax_EAX20.c 10 Sep 2004 09:56:26 -0000 1.2 +++ org_lwjgl_openal_eax_EAX20.c 10 Sep 2004 11:18:05 -0000 1.3 @@ -45,12 +45,14 @@ #include "common_tools.h" #include "extal.h" +#ifdef _WIN32 // EAX 2.0 GUIDs static const GUID DSPROPSETID_EAX20_ListenerProperties = { 0x306a6a8, 0xb224, 0x11d2, { 0x99, 0xe5, 0x0, 0x0, 0xe8, 0xd8, 0xc7, 0x22 } }; static const GUID DSPROPSETID_EAX20_BufferProperties = { 0x306a6a7, 0xb224, 0x11d2, {0x99, 0xe5, 0x0, 0x0, 0xe8, 0xd8, 0xc7, 0x22 } }; +#endif /* * Determines available EAX extensions |
|
From: Elias N. <eli...@us...> - 2004-09-10 09:56:48
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26322/src/native/common Modified Files: common_tools.c common_tools.h extal.c extal.h org_lwjgl_openal_ALC.c org_lwjgl_openal_eax_EAX20.c Log Message: Win32 specific fix ups for C++->C conversion Index: common_tools.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/common_tools.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- common_tools.c 10 Sep 2004 08:13:47 -0000 1.1 +++ common_tools.c 10 Sep 2004 09:56:26 -0000 1.2 @@ -121,9 +121,11 @@ } static void throwGeneralException(JNIEnv * env, const char *exception_name, const char * err) { + jclass cls; + if ((*env)->ExceptionCheck(env) == JNI_TRUE) return; // The JVM crashes if we try to throw two exceptions from one native call - jclass cls = (*env)->FindClass(env, exception_name); + cls = (*env)->FindClass(env, exception_name); (*env)->ThrowNew(env, cls, err); (*env)->DeleteLocalRef(env, cls); } @@ -142,13 +144,14 @@ bool ext_InitializeFunctions(ExtGetProcAddressPROC gpa, int num_functions, ExtFunction *functions) { int i; + void **ext_function_pointer_pointer; for (i = 0; i < num_functions; i++) { ExtFunction *function = functions + i; if (function->ext_function_name != NULL) { void *ext_func_pointer = gpa(function->ext_function_name); if (ext_func_pointer == NULL) return false; - void **ext_function_pointer_pointer = function->ext_function_pointer; + ext_function_pointer_pointer = function->ext_function_pointer; *ext_function_pointer_pointer = ext_func_pointer; } } @@ -156,25 +159,30 @@ } void ext_InitializeClass(JNIEnv *env, jclass clazz, ExtGetProcAddressPROC gpa, int num_functions, JavaMethodAndExtFunction *functions) { + JNINativeMethod *methods; + JavaMethodAndExtFunction *function; + void *ext_func_pointer; + void **ext_function_pointer_pointer; + JNINativeMethod *method; + int i; if (clazz == NULL) { throwException(env, "Null class"); return; } - JNINativeMethod *methods = (JNINativeMethod *)malloc(num_functions*sizeof(JNINativeMethod)); - int i; + methods = (JNINativeMethod *)malloc(num_functions*sizeof(JNINativeMethod)); for (i = 0; i < num_functions; i++) { - JavaMethodAndExtFunction *function = functions + i; + function = functions + i; if (function->ext_function_name != NULL) { - void *ext_func_pointer = gpa(function->ext_function_name); + ext_func_pointer = gpa(function->ext_function_name); if (ext_func_pointer == NULL) { free(methods); throwException(env, "Missing driver symbols"); return; } - void **ext_function_pointer_pointer = function->ext_function_pointer; + ext_function_pointer_pointer = function->ext_function_pointer; *ext_function_pointer_pointer = ext_func_pointer; } - JNINativeMethod *method = methods + i; + method = methods + i; method->name = function->method_name; method->signature = function->signature; method->fnPtr = function->method_pointer; Index: org_lwjgl_openal_ALC.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_ALC.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_openal_ALC.c 10 Sep 2004 08:13:48 -0000 1.1 +++ org_lwjgl_openal_ALC.c 10 Sep 2004 09:56:26 -0000 1.2 @@ -83,11 +83,13 @@ */ static jstring JNICALL Java_org_lwjgl_openal_ALC_nalcGetString (JNIEnv *env, jclass clazz, jint deviceaddress, jint token) { const char* alcString = (const char*) alcGetString((ALCdevice*) deviceaddress, (ALenum) token); + jstring string; + if(alcString == NULL) { return NULL; } - jstring string = (*env)->NewStringUTF(env, alcString); + string = (*env)->NewStringUTF(env, alcString); CHECK_ALC_ERROR return string; @@ -116,6 +118,11 @@ */ static jobject JNICALL Java_org_lwjgl_openal_ALC_alcOpenDevice (JNIEnv *env, jclass clazz, jstring tokstr) { const char * tokenstring; + ALCdevice* device; + /* get ready to create ALCdevice instance */ + jobject alcDevice_object = NULL; + jclass alcDevice_class = NULL; + jmethodID alcDevice_method = NULL; jboolean isCopy = JNI_FALSE; if(tokstr != NULL) { @@ -125,7 +132,7 @@ } /* get device */ - ALCdevice* device = alcOpenDevice((ALubyte *) tokenstring); + device = alcOpenDevice((ALubyte *) tokenstring); /* if error - cleanup and get out */ if(device == NULL) { @@ -135,11 +142,6 @@ return NULL; } - /* get ready to create ALCdevice instance */ - jobject alcDevice_object = NULL; - jclass alcDevice_class = NULL; - jmethodID alcDevice_method = NULL; - /* find class and constructor */ alcDevice_class = (*env)->FindClass(env, "org/lwjgl/openal/ALCdevice"); alcDevice_method = (*env)->GetMethodID(env, alcDevice_class, "<init>", "(I)V"); @@ -172,22 +174,23 @@ * ALCcontext* alcCreateContext( ALCdevice *dev, ALint* attrlist ); */ static jobject JNICALL Java_org_lwjgl_openal_ALC_alcCreateContext (JNIEnv *env, jclass clazz, jint deviceaddress, jobject attrlist) { - ALint* address = NULL; - if (attrlist != NULL) { - address = (ALint*) (*env)->GetDirectBufferAddress(env, attrlist); - } - ALCcontext* context = alcCreateContext((ALCdevice*) deviceaddress, address); + ALint* address = NULL; + ALCcontext* context; + /* get ready to create ALCcontext instance */ + jobject alcContext_object = NULL; + jclass alcContext_class = NULL; + jmethodID alcContext_method = NULL; + + if (attrlist != NULL) { + address = (ALint*) (*env)->GetDirectBufferAddress(env, attrlist); + } + context = alcCreateContext((ALCdevice*) deviceaddress, address); /* if error - get out */ if(context == NULL) { return NULL; } - /* get ready to create ALCcontext instance */ - jobject alcContext_object = NULL; - jclass alcContext_class = NULL; - jmethodID alcContext_method = NULL; - /* find class and constructor */ alcContext_class = (*env)->FindClass(env, "org/lwjgl/openal/ALCcontext"); alcContext_method = (*env)->GetMethodID(env, alcContext_class, "<init>", "(I)V"); @@ -233,17 +236,16 @@ * ALCcontext* alcGetCurrentContext( ALvoid ); */ static jobject JNICALL Java_org_lwjgl_openal_ALC_alcGetCurrentContext (JNIEnv *env, jclass clazz) { - ALCcontext* context = alcGetCurrentContext(); - if(context == NULL) { - return NULL; - } /* get ready to create ALCcontext instance */ jobject alcContext_object = NULL; jclass alcContext_class = NULL; jmethodID alcContext_method = NULL; + if(context == NULL) { + return NULL; + } /* find class and constructor */ alcContext_class = (*env)->FindClass(env, "org/lwjgl/openal/ALCcontext"); alcContext_method = (*env)->GetMethodID(env, alcContext_class, "<init>", "(I)V"); @@ -263,15 +265,15 @@ static jobject JNICALL Java_org_lwjgl_openal_ALC_alcGetContextsDevice (JNIEnv *env, jclass clazz, jint contextaddress) { ALCdevice* device = alcGetContextsDevice((ALCcontext*) contextaddress); - if(device == NULL) { - return NULL; - } - /* get ready to create ALCdevice instance */ jobject alcDevice_object = NULL; jclass alcDevice_class = NULL; jmethodID alcDevice_method = NULL; + if(device == NULL) { + return NULL; + } + /* find class and constructor */ alcDevice_class = (*env)->FindClass(env, "org/lwjgl/openal/ALCdevice"); alcDevice_method = (*env)->GetMethodID(env, alcDevice_class, "<init>", "(I)V"); Index: org_lwjgl_openal_eax_EAX20.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_eax_EAX20.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_openal_eax_EAX20.c 10 Sep 2004 08:13:48 -0000 1.1 +++ org_lwjgl_openal_eax_EAX20.c 10 Sep 2004 09:56:26 -0000 1.2 @@ -45,6 +45,13 @@ #include "common_tools.h" #include "extal.h" +// EAX 2.0 GUIDs +static const GUID DSPROPSETID_EAX20_ListenerProperties + = { 0x306a6a8, 0xb224, 0x11d2, { 0x99, 0xe5, 0x0, 0x0, 0xe8, 0xd8, 0xc7, 0x22 } }; + +static const GUID DSPROPSETID_EAX20_BufferProperties + = { 0x306a6a7, 0xb224, 0x11d2, {0x99, 0xe5, 0x0, 0x0, 0xe8, 0xd8, 0xc7, 0x22 } }; + /* * Determines available EAX extensions */ @@ -86,9 +93,9 @@ // determine buffer or listener if (propertySetID == org_lwjgl_openal_eax_EAX20_BUFFER_GUID) { - result = (jint) eaxGet(&DSPROPSETID_EAX20_BufferProperties, (ALuint) property, (ALuint) source, (ALvoid*) (offset + (const char*) env->GetDirectBufferAddress(value)), (ALuint) size); + result = (jint) eaxGet(&DSPROPSETID_EAX20_BufferProperties, (ALuint) property, (ALuint) source, (ALvoid*) (offset + (const char*)(*env)->GetDirectBufferAddress(env, value)), (ALuint) size); } else if (propertySetID == org_lwjgl_openal_eax_EAX20_LISTENER_GUID) { - result = (jint) eaxGet(&DSPROPSETID_EAX20_ListenerProperties, (ALuint) property, (ALuint) source, (ALvoid*) (offset + (const char*) env->GetDirectBufferAddress(value)), (ALuint) size); + result = (jint) eaxGet(&DSPROPSETID_EAX20_ListenerProperties, (ALuint) property, (ALuint) source, (ALvoid*) (offset + (const char*)(*env)->GetDirectBufferAddress(env, value)), (ALuint) size); } CHECK_AL_ERROR return result; @@ -111,9 +118,9 @@ // determine buffer or listener if (propertySetID == org_lwjgl_openal_eax_EAX20_BUFFER_GUID) { - result = (jint) eaxSet(&DSPROPSETID_EAX20_BufferProperties, (ALuint) (property), source, (ALvoid*) (offset + (const char*) env->GetDirectBufferAddress(value)), (ALuint) size); + result = (jint) eaxSet(&DSPROPSETID_EAX20_BufferProperties, (ALuint) (property), source, (ALvoid*) (offset + (const char*)(*env)->GetDirectBufferAddress(env, value)), (ALuint) size); } else if (propertySetID == org_lwjgl_openal_eax_EAX20_LISTENER_GUID) { - result = (jint) eaxSet(&DSPROPSETID_EAX20_ListenerProperties, (ALuint) (property), source, (ALvoid*) (offset + (const char*) env->GetDirectBufferAddress(value)), (ALuint) size); + result = (jint) eaxSet(&DSPROPSETID_EAX20_ListenerProperties, (ALuint) (property), source, (ALvoid*) (offset + (const char*)(*env)->GetDirectBufferAddress(env, value)), (ALuint) size); } CHECK_AL_ERROR return result; Index: extal.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/extal.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- extal.c 10 Sep 2004 08:13:47 -0000 1.14 +++ extal.c 10 Sep 2004 09:56:26 -0000 1.15 @@ -146,14 +146,18 @@ static bool LoadOpenAL(JNIEnv *env, jobjectArray oalPaths) { jsize pathcount = (*env)->GetArrayLength(env, oalPaths); - printfDebug("Found %d OpenAL paths\n", (int)pathcount); int i; + jstring path; + const char *path_str; + char *lib_str; + + printfDebug("Found %d OpenAL paths\n", (int)pathcount); for(i=0;i<pathcount;i++) { - jstring path = (jstring) (*env)->GetObjectArrayElement(env, oalPaths, i); - const char *path_str = (*env)->GetStringUTFChars(env, path, NULL); + path = (jstring) (*env)->GetObjectArrayElement(env, oalPaths, i); + path_str = (*env)->GetStringUTFChars(env, path, NULL); printfDebug("Testing '%s'\n", path_str); #ifdef _WIN32 - char *lib_str = concatenate(path_str, "lwjglaudio.dll"); + lib_str = concatenate(path_str, "lwjglaudio.dll"); handleOAL = LoadLibrary(lib_str); free(lib_str); #endif Index: extal.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/extal.h,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- extal.h 4 Jul 2004 09:13:17 -0000 1.27 +++ extal.h 10 Sep 2004 09:56:26 -0000 1.28 @@ -130,15 +130,6 @@ #define AL_CALLBACK #endif -#ifdef _WIN32 -// EAX 2.0 GUIDs -const GUID DSPROPSETID_EAX20_ListenerProperties - = { 0x306a6a8, 0xb224, 0x11d2, { 0x99, 0xe5, 0x0, 0x0, 0xe8, 0xd8, 0xc7, 0x22 } }; - -const GUID DSPROPSETID_EAX20_BufferProperties - = { 0x306a6a7, 0xb224, 0x11d2, {0x99, 0xe5, 0x0, 0x0, 0xe8, 0xd8, 0xc7, 0x22 } }; -#endif - #define INITGUID #define OPENAL Index: common_tools.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/common_tools.h,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- common_tools.h 10 Sep 2004 08:13:47 -0000 1.21 +++ common_tools.h 10 Sep 2004 09:56:26 -0000 1.22 @@ -68,34 +68,30 @@ #define false 0 #endif -extern void initAttribList(attrib_list_t *list); -extern void putAttrib(attrib_list_t *list, int attrib); - -extern bool isDebugEnabled(void); -extern jstring getVersionString(JNIEnv *env); -extern void initEventQueue(event_queue_t *event_queue); -extern int copyEvents(event_queue_t *event_queue, unsigned char *output_event_buffer, int buffer_size, int event_size); -extern void putEventElement(event_queue_t *queue, unsigned char byte); -extern unsigned char *getOutputList(event_queue_t *queue); -extern void throwException(JNIEnv *env, const char *msg); -extern void throwOpenALException(JNIEnv * env, const char * err); -extern void throwFMODException(JNIEnv * env, const char * err); -extern void setDebugEnabled(bool enable); -extern void printfDebug(const char *format, ...); -extern bool getBooleanProperty(JNIEnv *env, const char* propertyName); +#ifdef _WIN32 +#define inline __inline +#endif static inline void * safeGetBufferAddress(JNIEnv *env, jobject buffer, int offset) { - if (buffer == NULL) - return NULL; - else + if (buffer != NULL) { +#ifdef __cplusplus + return (void *)((char *)env->GetDirectBufferAddress(buffer) + offset); +#else return (void *)((char *)(*env)->GetDirectBufferAddress(env, buffer) + offset); +#endif + } else + return NULL; } static inline jobject safeNewBuffer(JNIEnv *env, void *p, int size) { - if (p == NULL) - return NULL; - else + if (p != NULL) { +#ifdef __cplusplus + return env->NewDirectByteBuffer(p, size); +#else return (*env)->NewDirectByteBuffer(env, p, size); +#endif + } else + return NULL; } static inline const void *offsetToPointer(jint offset) { @@ -119,7 +115,33 @@ #define NUMFUNCTIONS(x) (sizeof(x)/sizeof(JavaMethodAndExtFunction)); +#ifdef __cplusplus +extern "C" { +#endif + +extern void initAttribList(attrib_list_t *list); +extern void putAttrib(attrib_list_t *list, int attrib); + +extern bool isDebugEnabled(void); +extern jstring getVersionString(JNIEnv *env); +extern void initEventQueue(event_queue_t *event_queue); +extern int copyEvents(event_queue_t *event_queue, unsigned char *output_event_buffer, int buffer_size, int event_size); +extern void putEventElement(event_queue_t *queue, unsigned char byte); +extern unsigned char *getOutputList(event_queue_t *queue); +extern void throwException(JNIEnv *env, const char *msg); +extern void throwOpenALException(JNIEnv * env, const char * err); +extern void throwFMODException(JNIEnv * env, const char * err); +extern void setDebugEnabled(bool enable); +extern void printfDebug(const char *format, ...); +extern bool getBooleanProperty(JNIEnv *env, const char* propertyName); + + extern void ext_InitializeClass(JNIEnv *env, jclass clazz, ExtGetProcAddressPROC gpa, int num_functions, JavaMethodAndExtFunction *functions); extern bool ext_InitializeFunctions(ExtGetProcAddressPROC gpa, int num_functions, ExtFunction *functions); +#ifdef __cplusplus +} +#endif + #endif + |
|
From: Elias N. <eli...@us...> - 2004-09-10 09:56:45
|
Update of /cvsroot/java-game-lib/LWJGL/platform_build/win32_ms_cmdline In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26322/platform_build/win32_ms_cmdline Modified Files: build.bat Log Message: Win32 specific fix ups for C++->C conversion Index: build.bat =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/platform_build/win32_ms_cmdline/build.bat,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- build.bat 8 Sep 2004 18:50:21 -0000 1.3 +++ build.bat 10 Sep 2004 09:56:25 -0000 1.4 @@ -1,20 +1,20 @@ @echo off -set JAVAHOME=C:\Java\jdk1.5.0 -set ALHOME="c:\Program Files\OpenAL 1.0 Software Development Kit" +set JAVAHOME=C:\j2sdk +set ALHOME="c:\Program Files\Creative Labs\OpenAL 1.0 SDK" set EAXHOME="c:\Program Files\Creative Labs\EAX 2.0 Extensions SDK" set DXHOME="C:\Program Files\DX90SDK" set PLTSDKHOME="C:\Program Files\Microsoft SDK" -set COPTIONS=-DWIN32 /I%DXHOME%\Include /I%PLTSDKHOME%\include /I%JAVAHOME%\include /I%JAVAHOME%\include\win32 /I%ALHOME%\Include /I%EAXHOME%\Include /I..\..\src\native\common /O2 /nologo /c +set COPTIONS=/I%DXHOME%\Include /I%PLTSDKHOME%\include /I%JAVAHOME%\include /I%JAVAHOME%\include\win32 /I%ALHOME%\Include /I%EAXHOME%\Include /I..\..\src\native\common /O2 /nologo /c set LINKEROPTS=/link /LIBPATH:%ALHOME%\libs /LIBPATH:%EAXHOME%\Libs /LIBPATH:%DXHOME%\Lib /LIBPATH:%PLTSDKHOME%\Lib set LIBS=dinput.lib dxguid.lib OpenAL32.lib alut.lib eaxguid.lib OpenGL32.Lib Version.lib user32.lib Gdi32.lib Advapi32.lib for %%x in (..\..\src\native\win32\*.cpp) do cl %COPTIONS% %%x -for %%x in (..\..\src\native\common\*.cpp) do cl %COPTIONS% %%x -for %%x in (..\..\src\native\common\arb\*.cpp) do cl %COPTIONS% %%x -for %%x in (..\..\src\native\common\nv\*.cpp) do cl %COPTIONS% %%x -for %%x in (..\..\src\native\common\ext\*.cpp) do cl %COPTIONS% %%x -for %%x in (..\..\src\native\common\ati\*.cpp) do cl %COPTIONS% %%x +for %%x in (..\..\src\native\common\*.c) do cl %COPTIONS% %%x +for %%x in (..\..\src\native\common\arb\*.c) do cl %COPTIONS% %%x +for %%x in (..\..\src\native\common\nv\*.c) do cl %COPTIONS% %%x +for %%x in (..\..\src\native\common\ext\*.c) do cl %COPTIONS% %%x +for %%x in (..\..\src\native\common\ati\*.c) do cl %COPTIONS% %%x cl /LD /Felwjgl.dll *.obj %LINKEROPTS% %LIBS% |
Update of /cvsroot/java-game-lib/LWJGL/src/native/common/ati In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6954/src/native/common/ati Modified Files: Makefile.am Added Files: org_lwjgl_opengl_ATIDrawBuffers.c org_lwjgl_opengl_ATIElementArray.c org_lwjgl_opengl_ATIEnvmapBumpmap.c org_lwjgl_opengl_ATIFragmentShader.c org_lwjgl_opengl_ATIMapObjectBuffer.c org_lwjgl_opengl_ATIPnTriangles.c org_lwjgl_opengl_ATISeparateStencil.c org_lwjgl_opengl_ATIVertexArrayObject.c org_lwjgl_opengl_ATIVertexAttribArrayObject.c org_lwjgl_opengl_ATIVertexStreams.c Removed Files: org_lwjgl_opengl_ATIDrawBuffers.cpp org_lwjgl_opengl_ATIElementArray.cpp org_lwjgl_opengl_ATIEnvmapBumpmap.cpp org_lwjgl_opengl_ATIFragmentShader.cpp org_lwjgl_opengl_ATIMapObjectBuffer.cpp org_lwjgl_opengl_ATIPnTriangles.cpp org_lwjgl_opengl_ATISeparateStencil.cpp org_lwjgl_opengl_ATIVertexArrayObject.cpp org_lwjgl_opengl_ATIVertexAttribArrayObject.cpp org_lwjgl_opengl_ATIVertexStreams.cpp Log Message: Converted native code from C++ (.cpp files) to C (.c files), thus avoiding an annoying dependency on the standard C++ library on Linux. We weren't using any particular C++ features anyway. --- org_lwjgl_opengl_ATIEnvmapBumpmap.cpp DELETED --- --- org_lwjgl_opengl_ATISeparateStencil.cpp DELETED --- --- NEW FILE: org_lwjgl_opengl_ATIVertexAttribArrayObject.c --- /* * Copyright (c) 2002-2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // ---------------------------------- // IMPLEMENTATION OF NATIVE METHODS FOR CLASS: org.lwjgl.opengl.ATIVertexAttribArrayObject // ---------------------------------- #include "extgl.h" typedef void (APIENTRY * glVertexAttribArrayObjectATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); typedef void (APIENTRY * glGetVertexAttribArrayObjectfvATIPROC) (GLuint index, GLenum pname, GLfloat *params); typedef void (APIENTRY * glGetVertexAttribArrayObjectivATIPROC) (GLuint index, GLenum pname, GLint *params); static glVertexAttribArrayObjectATIPROC glVertexAttribArrayObjectATI; static glGetVertexAttribArrayObjectfvATIPROC glGetVertexAttribArrayObjectfvATI; static glGetVertexAttribArrayObjectivATIPROC glGetVertexAttribArrayObjectivATI; /* * Class: org.lwjgl.opengl.ATIVertexAttribArrayObject * Method: glVertexAttribArrayObjectATI */ static void JNICALL Java_org_lwjgl_opengl_ATIVertexAttribArrayObject_glVertexAttribArrayObjectATI (JNIEnv * env, jclass clazz, jint index, jint size, jint type, jboolean normalized, jint stride, jint buffer, jint offset) { glVertexAttribArrayObjectATI(index, size, type, normalized, stride, buffer, offset); } /* * Class: org.lwjgl.opengl.ATIVertexAttribArrayObject * Method: nglGetVertexAttribArrayObjectfvATI */ static void JNICALL Java_org_lwjgl_opengl_ATIVertexAttribArrayObject_nglGetVertexAttribArrayObjectfvATI (JNIEnv * env, jclass clazz, jint index, jint pname, jobject params, jint paramsOffset) { GLfloat *params_ptr = (GLfloat *)(*env)->GetDirectBufferAddress(env, params) + paramsOffset; glGetVertexAttribArrayObjectfvATI(index, pname, params_ptr); } /* * Class: org.lwjgl.opengl.ATIVertexAttribArrayObject * Method: nglGetVertexAttribArrayObjectivATI */ static void JNICALL Java_org_lwjgl_opengl_ATIVertexAttribArrayObject_nglGetVertexAttribArrayObjectivATI (JNIEnv * env, jclass clazz, jint index, jint pname, jobject params, jint paramsOffset) { GLint *params_ptr = (GLint *)(*env)->GetDirectBufferAddress(env, params) + paramsOffset; glGetVertexAttribArrayObjectivATI(index, pname, params_ptr); } #ifdef __cplusplus extern "C" { #endif JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ATIVertexAttribArrayObject_initNativeStubs(JNIEnv *env, jclass clazz) { JavaMethodAndExtFunction functions[] = { {"glVertexAttribArrayObjectATI", "(IIIZIII)V", (void*)&Java_org_lwjgl_opengl_ATIVertexAttribArrayObject_glVertexAttribArrayObjectATI, "glVertexAttribArrayObjectATI", (void*)&glVertexAttribArrayObjectATI}, {"nglGetVertexAttribArrayObjectfvATI", "(IILjava/nio/FloatBuffer;I)V", (void*)&Java_org_lwjgl_opengl_ATIVertexAttribArrayObject_nglGetVertexAttribArrayObjectfvATI, "glGetVertexAttribArrayObjectfvATI", (void*)&glGetVertexAttribArrayObjectfvATI}, {"nglGetVertexAttribArrayObjectivATI", "(IILjava/nio/IntBuffer;I)V", (void*)&Java_org_lwjgl_opengl_ATIVertexAttribArrayObject_nglGetVertexAttribArrayObjectivATI, "glGetVertexAttribArrayObjectivATI", (void*)&glGetVertexAttribArrayObjectivATI} }; int num_functions = NUMFUNCTIONS(functions); extgl_InitializeClass(env, clazz, num_functions, functions); } #ifdef __cplusplus } #endif --- NEW FILE: org_lwjgl_opengl_ATIFragmentShader.c --- /* * Copyright (c) 2002-2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // ---------------------------------- // IMPLEMENTATION OF NATIVE METHODS FOR CLASS: org.lwjgl.opengl.ATIFragmentShader // ---------------------------------- #include "extgl.h" typedef GLuint (APIENTRY * glGenFragmentShadersATIPROC) (GLuint range); typedef void (APIENTRY * glBindFragmentShaderATIPROC) (GLuint id); typedef void (APIENTRY * glDeleteFragmentShaderATIPROC) (GLuint id); typedef void (APIENTRY * glBeginFragmentShaderATIPROC) (GLvoid); typedef void (APIENTRY * glEndFragmentShaderATIPROC) (GLvoid); typedef void (APIENTRY * glPassTexCoordATIPROC) (GLuint dst, GLuint coord, GLenum swizzle); typedef void (APIENTRY * glSampleMapATIPROC) (GLuint dst, GLuint interp, GLenum swizzle); typedef void (APIENTRY * glColorFragmentOp1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); typedef void (APIENTRY * glColorFragmentOp2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); typedef void (APIENTRY * glColorFragmentOp3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); typedef void (APIENTRY * glAlphaFragmentOp1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); typedef void (APIENTRY * glAlphaFragmentOp2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); typedef void (APIENTRY * glAlphaFragmentOp3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); typedef void (APIENTRY * glSetFragmentShaderConstantATIPROC) (GLuint dst, const GLfloat *value); static glGenFragmentShadersATIPROC glGenFragmentShadersATI; static glBindFragmentShaderATIPROC glBindFragmentShaderATI; static glDeleteFragmentShaderATIPROC glDeleteFragmentShaderATI; static glBeginFragmentShaderATIPROC glBeginFragmentShaderATI; static glEndFragmentShaderATIPROC glEndFragmentShaderATI; static glPassTexCoordATIPROC glPassTexCoordATI; static glSampleMapATIPROC glSampleMapATI; static glColorFragmentOp1ATIPROC glColorFragmentOp1ATI; static glColorFragmentOp2ATIPROC glColorFragmentOp2ATI; static glColorFragmentOp3ATIPROC glColorFragmentOp3ATI; static glAlphaFragmentOp1ATIPROC glAlphaFragmentOp1ATI; static glAlphaFragmentOp2ATIPROC glAlphaFragmentOp2ATI; static glAlphaFragmentOp3ATIPROC glAlphaFragmentOp3ATI; static glSetFragmentShaderConstantATIPROC glSetFragmentShaderConstantATI; /* * Class: org.lwjgl.opengl.ATIFragmentShader * Method: glGenFragmentShadersATI */ static jint JNICALL Java_org_lwjgl_opengl_ATIFragmentShader_glGenFragmentShadersATI (JNIEnv * env, jclass clazz, jint range) { GLuint result = glGenFragmentShadersATI(range); return result; } /* * Class: org.lwjgl.opengl.ATIFragmentShader * Method: glBindFragmentShaderATI */ static void JNICALL Java_org_lwjgl_opengl_ATIFragmentShader_glBindFragmentShaderATI (JNIEnv * env, jclass clazz, jint id) { glBindFragmentShaderATI(id); } /* * Class: org.lwjgl.opengl.ATIFragmentShader * Method: glDeleteFragmentShaderATI */ static void JNICALL Java_org_lwjgl_opengl_ATIFragmentShader_glDeleteFragmentShaderATI (JNIEnv * env, jclass clazz, jint id) { glDeleteFragmentShaderATI(id); } /* * Class: org.lwjgl.opengl.ATIFragmentShader * Method: glBeginFragmentShaderATI */ static void JNICALL Java_org_lwjgl_opengl_ATIFragmentShader_glBeginFragmentShaderATI (JNIEnv * env, jclass clazz) { glBeginFragmentShaderATI(); } /* * Class: org.lwjgl.opengl.ATIFragmentShader * Method: glEndFragmentShaderATI */ static void JNICALL Java_org_lwjgl_opengl_ATIFragmentShader_glEndFragmentShaderATI (JNIEnv * env, jclass clazz) { glEndFragmentShaderATI(); } /* * Class: org.lwjgl.opengl.ATIFragmentShader * Method: glPassTexCoordATI */ static void JNICALL Java_org_lwjgl_opengl_ATIFragmentShader_glPassTexCoordATI (JNIEnv * env, jclass clazz, jint dst, jint coord, jint swizzle) { glPassTexCoordATI(dst, coord, swizzle); } /* * Class: org.lwjgl.opengl.ATIFragmentShader * Method: glSampleMapATI */ static void JNICALL Java_org_lwjgl_opengl_ATIFragmentShader_glSampleMapATI (JNIEnv * env, jclass clazz, jint dst, jint interp, jint swizzle) { glSampleMapATI(dst, interp, swizzle); } /* * Class: org.lwjgl.opengl.ATIFragmentShader * Method: glColorFragmentOp1ATI */ static void JNICALL Java_org_lwjgl_opengl_ATIFragmentShader_glColorFragmentOp1ATI (JNIEnv * env, jclass clazz, jint op, jint dst, jint dstMask, jint dstMod, jint arg1, jint arg1Rep, jint arg1Mod) { glColorFragmentOp1ATI(op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod); } /* * Class: org.lwjgl.opengl.ATIFragmentShader * Method: glColorFragmentOp2ATI */ static void JNICALL Java_org_lwjgl_opengl_ATIFragmentShader_glColorFragmentOp2ATI (JNIEnv * env, jclass clazz, jint op, jint dst, jint dstMask, jint dstMod, jint arg1, jint arg1Rep, jint arg1Mod, jint arg2, jint arg2Rep, jint arg2Mod) { glColorFragmentOp2ATI(op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod); } /* * Class: org.lwjgl.opengl.ATIFragmentShader * Method: glColorFragmentOp3ATI */ static void JNICALL Java_org_lwjgl_opengl_ATIFragmentShader_glColorFragmentOp3ATI (JNIEnv * env, jclass clazz, jint op, jint dst, jint dstMask, jint dstMod, jint arg1, jint arg1Rep, jint arg1Mod, jint arg2, jint arg2Rep, jint arg2Mod, jint arg3, jint arg3Rep, jint arg3Mod) { glColorFragmentOp3ATI(op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, arg3, arg3Rep, arg3Mod); } /* * Class: org.lwjgl.opengl.ATIFragmentShader * Method: glAlphaFragmentOp1ATI */ static void JNICALL Java_org_lwjgl_opengl_ATIFragmentShader_glAlphaFragmentOp1ATI (JNIEnv * env, jclass clazz, jint op, jint dst, jint dstMod, jint arg1, jint arg1Rep, jint arg1Mod) { glAlphaFragmentOp1ATI(op, dst, dstMod, arg1, arg1Rep, arg1Mod); } /* * Class: org.lwjgl.opengl.ATIFragmentShader * Method: glAlphaFragmentOp2ATI */ static void JNICALL Java_org_lwjgl_opengl_ATIFragmentShader_glAlphaFragmentOp2ATI (JNIEnv * env, jclass clazz, jint op, jint dst, jint dstMod, jint arg1, jint arg1Rep, jint arg1Mod, jint arg2, jint arg2Rep, jint arg2Mod) { glAlphaFragmentOp2ATI(op, dst, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod); } /* * Class: org.lwjgl.opengl.ATIFragmentShader * Method: glAlphaFragmentOp3ATI */ static void JNICALL Java_org_lwjgl_opengl_ATIFragmentShader_glAlphaFragmentOp3ATI (JNIEnv * env, jclass clazz, jint op, jint dst, jint dstMod, jint arg1, jint arg1Rep, jint arg1Mod, jint arg2, jint arg2Rep, jint arg2Mod, jint arg3, jint arg3Rep, jint arg3Mod) { glAlphaFragmentOp3ATI(op, dst, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, arg3, arg3Rep, arg3Mod); } /* * Class: org.lwjgl.opengl.ATIFragmentShader * Method: nglSetFragmentShaderConstantATI */ static void JNICALL Java_org_lwjgl_opengl_ATIFragmentShader_nglSetFragmentShaderConstantATI (JNIEnv * env, jclass clazz, jint dst, jobject pfValue, jint pfValue_offset) { GLfloat *pfValue_ptr = (GLfloat *)(*env)->GetDirectBufferAddress(env, pfValue) + pfValue_offset; glSetFragmentShaderConstantATI(dst, pfValue_ptr); } #ifdef __cplusplus extern "C" { #endif JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ATIFragmentShader_initNativeStubs(JNIEnv *env, jclass clazz) { JavaMethodAndExtFunction functions[] = { {"glGenFragmentShadersATI", "(I)I", (void*)&Java_org_lwjgl_opengl_ATIFragmentShader_glGenFragmentShadersATI, "glGenFragmentShadersATI", (void*)&glGenFragmentShadersATI}, {"glBindFragmentShaderATI", "(I)V", (void*)&Java_org_lwjgl_opengl_ATIFragmentShader_glBindFragmentShaderATI, "glBindFragmentShaderATI", (void*)&glBindFragmentShaderATI}, {"glDeleteFragmentShaderATI", "(I)V", (void*)&Java_org_lwjgl_opengl_ATIFragmentShader_glDeleteFragmentShaderATI, "glDeleteFragmentShaderATI", (void*)&glDeleteFragmentShaderATI}, {"glBeginFragmentShaderATI", "()V", (void*)&Java_org_lwjgl_opengl_ATIFragmentShader_glBeginFragmentShaderATI, "glBeginFragmentShaderATI", (void*)&glBeginFragmentShaderATI}, {"glEndFragmentShaderATI", "()V", (void*)&Java_org_lwjgl_opengl_ATIFragmentShader_glEndFragmentShaderATI, "glEndFragmentShaderATI", (void*)&glEndFragmentShaderATI}, {"glPassTexCoordATI", "(III)V", (void*)&Java_org_lwjgl_opengl_ATIFragmentShader_glPassTexCoordATI, "glPassTexCoordATI", (void*)&glPassTexCoordATI}, {"glSampleMapATI", "(III)V", (void*)&Java_org_lwjgl_opengl_ATIFragmentShader_glSampleMapATI, "glSampleMapATI", (void*)&glSampleMapATI}, {"glColorFragmentOp1ATI", "(IIIIIII)V", (void*)&Java_org_lwjgl_opengl_ATIFragmentShader_glColorFragmentOp1ATI, "glColorFragmentOp1ATI", (void*)&glColorFragmentOp1ATI}, {"glColorFragmentOp2ATI", "(IIIIIIIIII)V", (void*)&Java_org_lwjgl_opengl_ATIFragmentShader_glColorFragmentOp2ATI, "glColorFragmentOp2ATI", (void*)&glColorFragmentOp2ATI}, {"glColorFragmentOp3ATI", "(IIIIIIIIIIIII)V", (void*)&Java_org_lwjgl_opengl_ATIFragmentShader_glColorFragmentOp3ATI, "glColorFragmentOp3ATI", (void*)&glColorFragmentOp3ATI}, {"glAlphaFragmentOp1ATI", "(IIIIII)V", (void*)&Java_org_lwjgl_opengl_ATIFragmentShader_glAlphaFragmentOp1ATI, "glAlphaFragmentOp1ATI", (void*)&glAlphaFragmentOp1ATI}, {"glAlphaFragmentOp2ATI", "(IIIIIIIII)V", (void*)&Java_org_lwjgl_opengl_ATIFragmentShader_glAlphaFragmentOp2ATI, "glAlphaFragmentOp2ATI", (void*)&glAlphaFragmentOp2ATI}, {"glAlphaFragmentOp3ATI", "(IIIIIIIIIIII)V", (void*)&Java_org_lwjgl_opengl_ATIFragmentShader_glAlphaFragmentOp3ATI, "glAlphaFragmentOp3ATI", (void*)&glAlphaFragmentOp3ATI}, {"nglSetFragmentShaderConstantATI", "(ILjava/nio/FloatBuffer;I)V", (void*)&Java_org_lwjgl_opengl_ATIFragmentShader_nglSetFragmentShaderConstantATI, "glSetFragmentShaderConstantATI", (void*)&glSetFragmentShaderConstantATI} }; int num_functions = NUMFUNCTIONS(functions); extgl_InitializeClass(env, clazz, num_functions, functions); } #ifdef __cplusplus } #endif --- org_lwjgl_opengl_ATIElementArray.cpp DELETED --- --- NEW FILE: org_lwjgl_opengl_ATIEnvmapBumpmap.c --- /* * Copyright (c) 2002-2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // ---------------------------------- // IMPLEMENTATION OF NATIVE METHODS FOR CLASS: org.lwjgl.opengl.ATIEnvmapBumpmap // ---------------------------------- #include "extgl.h" typedef void (APIENTRY * glTexBumpParameterivATIPROC) (GLenum pname, GLint *param); typedef void (APIENTRY * glTexBumpParameterfvATIPROC) (GLenum pname, GLfloat *param); typedef void (APIENTRY * glGetTexBumpParameterivATIPROC) (GLenum pname, GLint *param); typedef void (APIENTRY * glGetTexBumpParameterfvATIPROC) (GLenum pname, GLfloat *param); static glTexBumpParameterivATIPROC glTexBumpParameterivATI; static glTexBumpParameterfvATIPROC glTexBumpParameterfvATI; static glGetTexBumpParameterivATIPROC glGetTexBumpParameterivATI; static glGetTexBumpParameterfvATIPROC glGetTexBumpParameterfvATI; /* * Class: org.lwjgl.opengl.ATIEnvmapBumpmap * Method: nglTexBumpParameterfvATI */ static void JNICALL Java_org_lwjgl_opengl_ATIEnvmapBumpmap_nglTexBumpParameterfvATI (JNIEnv * env, jclass clazz, jint pname, jobject pfParam, jint pfParam_offset) { GLfloat *pfParam_ptr = (GLfloat *)(*env)->GetDirectBufferAddress(env, pfParam) + pfParam_offset; glTexBumpParameterfvATI(pname, pfParam_ptr); } /* * Class: org.lwjgl.opengl.ATIEnvmapBumpmap * Method: nglTexBumpParameterivATI */ static void JNICALL Java_org_lwjgl_opengl_ATIEnvmapBumpmap_nglTexBumpParameterivATI (JNIEnv * env, jclass clazz, jint pname, jobject piParam, jint piParam_offset) { GLint *piParam_ptr = (GLint *)(*env)->GetDirectBufferAddress(env, piParam) + piParam_offset; glTexBumpParameterivATI(pname, piParam_ptr); } /* * Class: org.lwjgl.opengl.ATIEnvmapBumpmap * Method: nglGetTexBumpParameterfvATI */ static void JNICALL Java_org_lwjgl_opengl_ATIEnvmapBumpmap_nglGetTexBumpParameterfvATI (JNIEnv * env, jclass clazz, jint pname, jobject pfParam, jint pfParam_offset) { GLfloat *pfParam_ptr = (GLfloat *)(*env)->GetDirectBufferAddress(env, pfParam) + pfParam_offset; glGetTexBumpParameterfvATI(pname, pfParam_ptr); } /* * Class: org.lwjgl.opengl.ATIEnvmapBumpmap * Method: nglGetTexBumpParameterivATI */ static void JNICALL Java_org_lwjgl_opengl_ATIEnvmapBumpmap_nglGetTexBumpParameterivATI (JNIEnv * env, jclass clazz, jint pname, jobject piParam, jint piParam_offset) { GLint *piParam_ptr = (GLint *)(*env)->GetDirectBufferAddress(env, piParam) + piParam_offset; glGetTexBumpParameterivATI(pname, piParam_ptr); } #ifdef __cplusplus extern "C" { #endif JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ATIEnvmapBumpmap_initNativeStubs(JNIEnv *env, jclass clazz) { JavaMethodAndExtFunction functions[] = { {"nglTexBumpParameterfvATI", "(ILjava/nio/FloatBuffer;I)V", (void*)&Java_org_lwjgl_opengl_ATIEnvmapBumpmap_nglTexBumpParameterfvATI, "glTexBumpParameterfvATI", (void*)&glTexBumpParameterfvATI}, {"nglTexBumpParameterivATI", "(ILjava/nio/IntBuffer;I)V", (void*)&Java_org_lwjgl_opengl_ATIEnvmapBumpmap_nglTexBumpParameterivATI, "glTexBumpParameterivATI", (void*)&glTexBumpParameterivATI}, {"nglGetTexBumpParameterfvATI", "(ILjava/nio/FloatBuffer;I)V", (void*)&Java_org_lwjgl_opengl_ATIEnvmapBumpmap_nglGetTexBumpParameterfvATI, "glGetTexBumpParameterfvATI", (void*)&glGetTexBumpParameterfvATI}, {"nglGetTexBumpParameterivATI", "(ILjava/nio/IntBuffer;I)V", (void*)&Java_org_lwjgl_opengl_ATIEnvmapBumpmap_nglGetTexBumpParameterivATI, "glGetTexBumpParameterivATI", (void*)&glGetTexBumpParameterivATI} }; int num_functions = NUMFUNCTIONS(functions); extgl_InitializeClass(env, clazz, num_functions, functions); } #ifdef __cplusplus } #endif --- org_lwjgl_opengl_ATIDrawBuffers.cpp DELETED --- --- NEW FILE: org_lwjgl_opengl_ATIVertexArrayObject.c --- /* * Copyright (c) 2002-2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // ---------------------------------- // IMPLEMENTATION OF NATIVE METHODS FOR CLASS: org.lwjgl.opengl.ATIVertexArrayObject // ---------------------------------- #include "extgl.h" #include "common_tools.h" typedef GLuint (APIENTRY * glNewObjectBufferATIPROC) (GLsizei size, const GLvoid *pointer, GLenum usage); typedef GLboolean (APIENTRY * glIsObjectBufferATIPROC) (GLuint buffer); typedef void (APIENTRY * glUpdateObjectBufferATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve); typedef void (APIENTRY * glGetObjectBufferfvATIPROC) (GLuint buffer, GLenum pname, GLfloat *params); typedef void (APIENTRY * glGetObjectBufferivATIPROC) (GLuint buffer, GLenum pname, GLint *params); typedef void (APIENTRY * glFreeObjectBufferATIPROC) (GLuint buffer); typedef void (APIENTRY * glArrayObjectATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); typedef void (APIENTRY * glGetArrayObjectfvATIPROC) (GLenum array, GLenum pname, GLfloat *params); typedef void (APIENTRY * glGetArrayObjectivATIPROC) (GLenum array, GLenum pname, GLint *params); typedef void (APIENTRY * glVariantArrayObjectATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); typedef void (APIENTRY * glGetVariantArrayObjectfvATIPROC) (GLuint id, GLenum pname, GLfloat *params); typedef void (APIENTRY * glGetVariantArrayObjectivATIPROC) (GLuint id, GLenum pname, GLint *params); static glNewObjectBufferATIPROC glNewObjectBufferATI; static glIsObjectBufferATIPROC glIsObjectBufferATI; static glUpdateObjectBufferATIPROC glUpdateObjectBufferATI; static glGetObjectBufferfvATIPROC glGetObjectBufferfvATI; static glGetObjectBufferivATIPROC glGetObjectBufferivATI; static glFreeObjectBufferATIPROC glFreeObjectBufferATI; static glArrayObjectATIPROC glArrayObjectATI; static glGetArrayObjectfvATIPROC glGetArrayObjectfvATI; static glGetArrayObjectivATIPROC glGetArrayObjectivATI; static glVariantArrayObjectATIPROC glVariantArrayObjectATI; static glGetVariantArrayObjectfvATIPROC glGetVariantArrayObjectfvATI; static glGetVariantArrayObjectivATIPROC glGetVariantArrayObjectivATI; /* * Class: org.lwjgl.opengl.ATIVertexArrayObject * Method: nglNewObjectBufferATI */ static jint JNICALL Java_org_lwjgl_opengl_ATIVertexArrayObject_nglNewObjectBufferATI (JNIEnv * env, jclass clazz, jint size, jobject pPointer, jint pPointer_offset, jint usage) { GLvoid *pPointer_ptr = safeGetBufferAddress(env, pPointer, pPointer_offset); GLuint result = glNewObjectBufferATI(size, pPointer_ptr, usage); return result; } /* * Class: org.lwjgl.opengl.ATIVertexArrayObject * Method: glIsObjectBufferATI */ static jboolean JNICALL Java_org_lwjgl_opengl_ATIVertexArrayObject_glIsObjectBufferATI (JNIEnv * env, jclass clazz, jint buffer) { GLboolean result = glIsObjectBufferATI(buffer); return result; } /* * Class: org.lwjgl.opengl.ATIVertexArrayObject * Method: nglUpdateObjectBufferATI */ static void JNICALL Java_org_lwjgl_opengl_ATIVertexArrayObject_nglUpdateObjectBufferATI (JNIEnv * env, jclass clazz, jint buffer, jint offset, jint size, jobject pPointer, jint pPointer_offset, jint preserve) { GLvoid *pPointer_ptr = (GLvoid *)((GLubyte *)(*env)->GetDirectBufferAddress(env, pPointer) + pPointer_offset); glUpdateObjectBufferATI(buffer, offset, size, pPointer_ptr, preserve); } /* * Class: org.lwjgl.opengl.ATIVertexArrayObject * Method: nglGetObjectBufferfvATI */ static void JNICALL Java_org_lwjgl_opengl_ATIVertexArrayObject_nglGetObjectBufferfvATI (JNIEnv * env, jclass clazz, jint buffer, jint pname, jobject pfParams, jint pfParams_offset) { GLfloat *pfParams_ptr = (GLfloat *)(*env)->GetDirectBufferAddress(env, pfParams) + pfParams_offset; glGetObjectBufferfvATI(buffer, pname, pfParams_ptr); } /* * Class: org.lwjgl.opengl.ATIVertexArrayObject * Method: nglGetObjectBufferivATI */ static void JNICALL Java_org_lwjgl_opengl_ATIVertexArrayObject_nglGetObjectBufferivATI (JNIEnv * env, jclass clazz, jint buffer, jint pname, jobject piParams, jint piParams_offset) { GLint *piParams_ptr = (GLint *)(*env)->GetDirectBufferAddress(env, piParams) + piParams_offset; glGetObjectBufferivATI(buffer, pname, piParams_ptr); } /* * Class: org.lwjgl.opengl.ATIVertexArrayObject * Method: glFreeObjectBufferATI */ static void JNICALL Java_org_lwjgl_opengl_ATIVertexArrayObject_glFreeObjectBufferATI (JNIEnv * env, jclass clazz, jint buffer) { glFreeObjectBufferATI(buffer); } /* * Class: org.lwjgl.opengl.ATIVertexArrayObject * Method: glArrayObjectATI */ static void JNICALL Java_org_lwjgl_opengl_ATIVertexArrayObject_glArrayObjectATI (JNIEnv * env, jclass clazz, jint array, jint size, jint type, jint stride, jint buffer, jint offset) { glArrayObjectATI(array, size, type, stride, buffer, offset); } /* * Class: org.lwjgl.opengl.ATIVertexArrayObject * Method: nglGetArrayObjectfvATI */ static void JNICALL Java_org_lwjgl_opengl_ATIVertexArrayObject_nglGetArrayObjectfvATI (JNIEnv * env, jclass clazz, jint array, jint pname, jobject pfParams, jint pfParams_offset) { GLfloat *pfParams_ptr = (GLfloat *)(*env)->GetDirectBufferAddress(env, pfParams) + pfParams_offset; glGetArrayObjectfvATI(array, pname, pfParams_ptr); } /* * Class: org.lwjgl.opengl.ATIVertexArrayObject * Method: nglGetArrayObjectivATI */ static void JNICALL Java_org_lwjgl_opengl_ATIVertexArrayObject_nglGetArrayObjectivATI (JNIEnv * env, jclass clazz, jint array, jint pname, jobject piParams, jint piParams_offset) { GLint *piParams_ptr = (GLint *)(*env)->GetDirectBufferAddress(env, piParams) + piParams_offset; glGetArrayObjectivATI(array, pname, piParams_ptr); } /* * Class: org.lwjgl.opengl.ATIVertexArrayObject * Method: glVariantArrayObjectATI */ static void JNICALL Java_org_lwjgl_opengl_ATIVertexArrayObject_glVariantArrayObjectATI (JNIEnv * env, jclass clazz, jint id, jint type, jint stride, jint buffer, jint offset) { glVariantArrayObjectATI(id, type, stride, buffer, offset); } /* * Class: org.lwjgl.opengl.ATIVertexArrayObject * Method: nglGetVariantArrayObjectfvATI */ static void JNICALL Java_org_lwjgl_opengl_ATIVertexArrayObject_nglGetVariantArrayObjectfvATI (JNIEnv * env, jclass clazz, jint id, jint pname, jobject pfParams, jint pfParams_offset_offset) { GLfloat *pfParams_ptr = (GLfloat *)(*env)->GetDirectBufferAddress(env, pfParams) + pfParams_offset_offset; glGetVariantArrayObjectfvATI(id, pname, pfParams_ptr); } /* * Class: org.lwjgl.opengl.ATIVertexArrayObject * Method: nglGetVariantArrayObjectivATI */ static void JNICALL Java_org_lwjgl_opengl_ATIVertexArrayObject_nglGetVariantArrayObjectivATI (JNIEnv * env, jclass clazz, jint id, jint pname, jobject piParams, jint piParams_offset) { GLint *piParams_ptr = (GLint *)(*env)->GetDirectBufferAddress(env, piParams) + piParams_offset; glGetVariantArrayObjectivATI(id, pname, piParams_ptr); } #ifdef __cplusplus extern "C" { #endif JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ATIVertexArrayObject_initNativeStubs(JNIEnv *env, jclass clazz) { JavaMethodAndExtFunction functions[] = { {"nglNewObjectBufferATI", "(ILjava/nio/Buffer;II)I", (void*)&Java_org_lwjgl_opengl_ATIVertexArrayObject_nglNewObjectBufferATI, "glNewObjectBufferATI", (void*)&glNewObjectBufferATI}, {"glIsObjectBufferATI", "(I)Z", (void*)&Java_org_lwjgl_opengl_ATIVertexArrayObject_glIsObjectBufferATI, "glIsObjectBufferATI", (void*)&glIsObjectBufferATI}, {"nglUpdateObjectBufferATI", "(IIILjava/nio/Buffer;II)V", (void*)&Java_org_lwjgl_opengl_ATIVertexArrayObject_nglUpdateObjectBufferATI, "glUpdateObjectBufferATI", (void*)&glUpdateObjectBufferATI}, {"nglGetObjectBufferfvATI", "(IILjava/nio/FloatBuffer;I)V", (void*)&Java_org_lwjgl_opengl_ATIVertexArrayObject_nglGetObjectBufferfvATI, "glGetObjectBufferfvATI", (void*)&glGetObjectBufferfvATI}, {"nglGetObjectBufferivATI", "(IILjava/nio/IntBuffer;I)V", (void*)&Java_org_lwjgl_opengl_ATIVertexArrayObject_nglGetObjectBufferivATI, "glGetObjectBufferivATI", (void*)&glGetObjectBufferivATI}, {"glFreeObjectBufferATI", "(I)V", (void*)&Java_org_lwjgl_opengl_ATIVertexArrayObject_glFreeObjectBufferATI, "glFreeObjectBufferATI", (void*)&glFreeObjectBufferATI}, {"glArrayObjectATI", "(IIIIII)V", (void*)&Java_org_lwjgl_opengl_ATIVertexArrayObject_glArrayObjectATI, "glArrayObjectATI", (void*)&glArrayObjectATI}, {"nglGetArrayObjectfvATI", "(IILjava/nio/FloatBuffer;I)V", (void*)&Java_org_lwjgl_opengl_ATIVertexArrayObject_nglGetArrayObjectfvATI, "glGetArrayObjectfvATI", (void*)&glGetArrayObjectfvATI}, {"nglGetArrayObjectivATI", "(IILjava/nio/IntBuffer;I)V", (void*)&Java_org_lwjgl_opengl_ATIVertexArrayObject_nglGetArrayObjectivATI, "glGetArrayObjectivATI", (void*)&glGetArrayObjectivATI}, {"glVariantArrayObjectATI", "(IIIII)V", (void*)&Java_org_lwjgl_opengl_ATIVertexArrayObject_glVariantArrayObjectATI, "glVariantArrayObjectATI", (void*)&glVariantArrayObjectATI}, {"nglGetVariantArrayObjectfvATI", "(IILjava/nio/FloatBuffer;I)V", (void*)&Java_org_lwjgl_opengl_ATIVertexArrayObject_nglGetVariantArrayObjectfvATI, "glGetVariantArrayObjectfvATI", (void*)&glGetVariantArrayObjectfvATI}, {"nglGetVariantArrayObjectivATI", "(IILjava/nio/IntBuffer;I)V", (void*)&Java_org_lwjgl_opengl_ATIVertexArrayObject_nglGetVariantArrayObjectivATI, "glGetVariantArrayObjectivATI", (void*)&glGetVariantArrayObjectivATI} }; int num_functions = NUMFUNCTIONS(functions); extgl_InitializeClass(env, clazz, num_functions, functions); } #ifdef __cplusplus } #endif --- NEW FILE: org_lwjgl_opengl_ATIVertexStreams.c --- /* * Copyright (c) 2002-2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // ---------------------------------- // IMPLEMENTATION OF NATIVE METHODS FOR CLASS: org.lwjgl.opengl.ATIVertexStreams // ---------------------------------- #include "extgl.h" typedef void (APIENTRY * glClientActiveVertexStreamATIPROC) (GLenum stream); typedef void (APIENTRY * glVertexBlendEnviATIPROC) (GLenum pname, GLint param); typedef void (APIENTRY * glVertexBlendEnvfATIPROC) (GLenum pname, GLfloat param); typedef void (APIENTRY * glVertexStream1sATIPROC) (GLenum stream, GLshort x); typedef void (APIENTRY * glVertexStream1iATIPROC) (GLenum stream, GLint x); typedef void (APIENTRY * glVertexStream1fATIPROC) (GLenum stream, GLfloat x); typedef void (APIENTRY * glVertexStream2sATIPROC) (GLenum stream, GLshort x, GLshort y); typedef void (APIENTRY * glVertexStream2iATIPROC) (GLenum stream, GLint x, GLint y); typedef void (APIENTRY * glVertexStream2fATIPROC) (GLenum stream, GLfloat x, GLfloat y); typedef void (APIENTRY * glVertexStream3sATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); typedef void (APIENTRY * glVertexStream3iATIPROC) (GLenum stream, GLint x, GLint y, GLint z); typedef void (APIENTRY * glVertexStream3fATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); typedef void (APIENTRY * glVertexStream4sATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); typedef void (APIENTRY * glVertexStream4iATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w); typedef void (APIENTRY * glVertexStream4fATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); typedef void (APIENTRY * glNormalStream3bATIPROC) (GLenum stream, GLbyte x, GLbyte y, GLbyte z); typedef void (APIENTRY * glNormalStream3sATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); typedef void (APIENTRY * glNormalStream3iATIPROC) (GLenum stream, GLint x, GLint y, GLint z); typedef void (APIENTRY * glNormalStream3fATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); static glClientActiveVertexStreamATIPROC glClientActiveVertexStreamATI; static glVertexBlendEnviATIPROC glVertexBlendEnviATI; static glVertexBlendEnvfATIPROC glVertexBlendEnvfATI; static glVertexStream1sATIPROC glVertexStream1sATI; static glVertexStream1iATIPROC glVertexStream1iATI; static glVertexStream1fATIPROC glVertexStream1fATI; static glVertexStream2sATIPROC glVertexStream2sATI; static glVertexStream2iATIPROC glVertexStream2iATI; static glVertexStream2fATIPROC glVertexStream2fATI; static glVertexStream3sATIPROC glVertexStream3sATI; static glVertexStream3iATIPROC glVertexStream3iATI; static glVertexStream3fATIPROC glVertexStream3fATI; static glVertexStream4sATIPROC glVertexStream4sATI; static glVertexStream4iATIPROC glVertexStream4iATI; static glVertexStream4fATIPROC glVertexStream4fATI; static glNormalStream3bATIPROC glNormalStream3bATI; static glNormalStream3sATIPROC glNormalStream3sATI; static glNormalStream3iATIPROC glNormalStream3iATI; static glNormalStream3fATIPROC glNormalStream3fATI; /* * Class: org.lwjgl.opengl.ATIVertexStreams * Method: glVertexStream1fATI */ static void JNICALL Java_org_lwjgl_opengl_ATIVertexStreams_glVertexStream1fATI (JNIEnv * env, jclass clazz, jint stream, jfloat x) { glVertexStream1fATI(stream, x); } /* * Class: org.lwjgl.opengl.ATIVertexStreams * Method: glVertexStream1iATI */ static void JNICALL Java_org_lwjgl_opengl_ATIVertexStreams_glVertexStream1iATI (JNIEnv * env, jclass clazz, jint stream, jint x) { glVertexStream1iATI(stream, x); } /* * Class: org.lwjgl.opengl.ATIVertexStreams * Method: glVertexStream1sATI */ static void JNICALL Java_org_lwjgl_opengl_ATIVertexStreams_glVertexStream1sATI (JNIEnv * env, jclass clazz, jint stream, jshort x) { glVertexStream1sATI(stream, x); } /* * Class: org.lwjgl.opengl.ATIVertexStreams * Method: glVertexStream2fATI */ static void JNICALL Java_org_lwjgl_opengl_ATIVertexStreams_glVertexStream2fATI (JNIEnv * env, jclass clazz, jint stream, jfloat x, jfloat y) { glVertexStream2fATI(stream, x, y); } /* * Class: org.lwjgl.opengl.ATIVertexStreams * Method: glVertexStream2iATI */ static void JNICALL Java_org_lwjgl_opengl_ATIVertexStreams_glVertexStream2iATI (JNIEnv * env, jclass clazz, jint stream, jint x, jint y) { glVertexStream2iATI(stream, x, y); } /* * Class: org.lwjgl.opengl.ATIVertexStreams * Method: glVertexStream2sATI */ static void JNICALL Java_org_lwjgl_opengl_ATIVertexStreams_glVertexStream2sATI (JNIEnv * env, jclass clazz, jint stream, jshort x, jshort y) { glVertexStream2sATI(stream, x, y); } /* * Class: org.lwjgl.opengl.ATIVertexStreams * Method: glVertexStream3fATI */ static void JNICALL Java_org_lwjgl_opengl_ATIVertexStreams_glVertexStream3fATI (JNIEnv * env, jclass clazz, jint stream, jfloat x, jfloat y, jfloat z) { glVertexStream3fATI(stream, x, y, z); } /* * Class: org.lwjgl.opengl.ATIVertexStreams * Method: glVertexStream3iATI */ static void JNICALL Java_org_lwjgl_opengl_ATIVertexStreams_glVertexStream3iATI (JNIEnv * env, jclass clazz, jint stream, jint x, jint y, jint z) { glVertexStream3iATI(stream, x, y, z); } /* * Class: org.lwjgl.opengl.ATIVertexStreams * Method: glVertexStream3sATI */ static void JNICALL Java_org_lwjgl_opengl_ATIVertexStreams_glVertexStream3sATI (JNIEnv * env, jclass clazz, jint stream, jshort x, jshort y, jshort z) { glVertexStream3sATI(stream, x, y, z); } /* * Class: org.lwjgl.opengl.ATIVertexStreams * Method: glVertexStream4fATI */ static void JNICALL Java_org_lwjgl_opengl_ATIVertexStreams_glVertexStream4fATI (JNIEnv * env, jclass clazz, jint stream, jfloat x, jfloat y, jfloat z, jfloat w) { glVertexStream4fATI(stream, x, y, z, w); } /* * Class: org.lwjgl.opengl.ATIVertexStreams * Method: glVertexStream4iATI */ static void JNICALL Java_org_lwjgl_opengl_ATIVertexStreams_glVertexStream4iATI (JNIEnv * env, jclass clazz, jint stream, jint x, jint y, jint z, jint w) { glVertexStream4iATI(stream, x, y, z, w); } /* * Class: org.lwjgl.opengl.ATIVertexStreams * Method: glVertexStream4sATI */ static void JNICALL Java_org_lwjgl_opengl_ATIVertexStreams_glVertexStream4sATI (JNIEnv * env, jclass clazz, jint stream, jshort x, jshort y, jshort z, jshort w) { glVertexStream4sATI(stream, x, y, z, w); } /* * Class: org.lwjgl.opengl.ATIVertexStreams * Method: glNormalStream3bATI */ static void JNICALL Java_org_lwjgl_opengl_ATIVertexStreams_glNormalStream3bATI (JNIEnv * env, jclass clazz, jint stream, jbyte x, jbyte y, jbyte z) { glNormalStream3bATI(stream, x, y, z); } /* * Class: org.lwjgl.opengl.ATIVertexStreams * Method: glNormalStream3fATI */ static void JNICALL Java_org_lwjgl_opengl_ATIVertexStreams_glNormalStream3fATI (JNIEnv * env, jclass clazz, jint stream, jfloat x, jfloat y, jfloat z) { glNormalStream3fATI(stream, x, y, z); } /* * Class: org.lwjgl.opengl.ATIVertexStreams * Method: glNormalStream3iATI */ static void JNICALL Java_org_lwjgl_opengl_ATIVertexStreams_glNormalStream3iATI (JNIEnv * env, jclass clazz, jint stream, jint x, jint y, jint z) { glNormalStream3iATI(stream, x, y, z); } /* * Class: org.lwjgl.opengl.ATIVertexStreams * Method: glNormalStream3sATI */ static void JNICALL Java_org_lwjgl_opengl_ATIVertexStreams_glNormalStream3sATI (JNIEnv * env, jclass clazz, jint stream, jshort x, jshort y, jshort z) { glNormalStream3sATI(stream, x, y, z); } /* * Class: org.lwjgl.opengl.ATIVertexStreams * Method: glClientActiveVertexStreamATI */ static void JNICALL Java_org_lwjgl_opengl_ATIVertexStreams_glClientActiveVertexStreamATI (JNIEnv * env, jclass clazz, jint stream) { glClientActiveVertexStreamATI(stream); } /* * Class: org.lwjgl.opengl.ATIVertexStreams * Method: glVertexBlendEnvfATI */ static void JNICALL Java_org_lwjgl_opengl_ATIVertexStreams_glVertexBlendEnvfATI (JNIEnv * env, jclass clazz, jint pname, jfloat param) { glVertexBlendEnvfATI(pname, param); } /* * Class: org.lwjgl.opengl.ATIVertexStreams * Method: glVertexBlendEnviATI */ static void JNICALL Java_org_lwjgl_opengl_ATIVertexStreams_glVertexBlendEnviATI (JNIEnv * env, jclass clazz, jint pname, jint param) { glVertexBlendEnviATI(pname, param); } #ifdef __cplusplus extern "C" { #endif JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ATIVertexStreams_initNativeStubs(JNIEnv *env, jclass clazz) { JavaMethodAndExtFunction functions[] = { {"glVertexStream1fATI", "(IF)V", (void*)&Java_org_lwjgl_opengl_ATIVertexStreams_glVertexStream1fATI, "glVertexStream1fATI", (void*)&glVertexStream1fATI}, {"glVertexStream1iATI", "(II)V", (void*)&Java_org_lwjgl_opengl_ATIVertexStreams_glVertexStream1iATI, "glVertexStream1iATI", (void*)&glVertexStream1iATI}, {"glVertexStream1sATI", "(IS)V", (void*)&Java_org_lwjgl_opengl_ATIVertexStreams_glVertexStream1sATI, "glVertexStream1sATI", (void*)&glVertexStream1sATI}, {"glVertexStream2fATI", "(IFF)V", (void*)&Java_org_lwjgl_opengl_ATIVertexStreams_glVertexStream2fATI, "glVertexStream2fATI", (void*)&glVertexStream2fATI}, {"glVertexStream2iATI", "(III)V", (void*)&Java_org_lwjgl_opengl_ATIVertexStreams_glVertexStream2iATI, "glVertexStream2iATI", (void*)&glVertexStream2iATI}, {"glVertexStream2sATI", "(ISS)V", (void*)&Java_org_lwjgl_opengl_ATIVertexStreams_glVertexStream2sATI, "glVertexStream2sATI", (void*)&glVertexStream2sATI}, {"glVertexStream3fATI", "(IFFF)V", (void*)&Java_org_lwjgl_opengl_ATIVertexStreams_glVertexStream3fATI, "glVertexStream3fATI", (void*)&glVertexStream3fATI}, {"glVertexStream3iATI", "(IIII)V", (void*)&Java_org_lwjgl_opengl_ATIVertexStreams_glVertexStream3iATI, "glVertexStream3iATI", (void*)&glVertexStream3iATI}, {"glVertexStream3sATI", "(ISSS)V", (void*)&Java_org_lwjgl_opengl_ATIVertexStreams_glVertexStream3sATI, "glVertexStream3sATI", (void*)&glVertexStream3sATI}, {"glVertexStream4fATI", "(IFFFF)V", (void*)&Java_org_lwjgl_opengl_ATIVertexStreams_glVertexStream4fATI, "glVertexStream4fATI", (void*)&glVertexStream4fATI}, {"glVertexStream4iATI", "(IIIII)V", (void*)&Java_org_lwjgl_opengl_ATIVertexStreams_glVertexStream4iATI, "glVertexStream4iATI", (void*)&glVertexStream4iATI}, {"glVertexStream4sATI", "(ISSSS)V", (void*)&Java_org_lwjgl_opengl_ATIVertexStreams_glVertexStream4sATI, "glVertexStream4sATI", (void*)&glVertexStream4sATI}, {"glNormalStream3bATI", "(IBBB)V", (void*)&Java_org_lwjgl_opengl_ATIVertexStreams_glNormalStream3bATI, "glNormalStream3bATI", (void*)&glNormalStream3bATI}, {"glNormalStream3fATI", "(IFFF)V", (void*)&Java_org_lwjgl_opengl_ATIVertexStreams_glNormalStream3fATI, "glNormalStream3fATI", (void*)&glNormalStream3fATI}, {"glNormalStream3iATI", "(IIII)V", (void*)&Java_org_lwjgl_opengl_ATIVertexStreams_glNormalStream3iATI, "glNormalStream3iATI", (void*)&glNormalStream3iATI}, {"glNormalStream3sATI", "(ISSS)V", (void*)&Java_org_lwjgl_opengl_ATIVertexStreams_glNormalStream3sATI, "glNormalStream3sATI", (void*)&glNormalStream3sATI}, {"glClientActiveVertexStreamATI", "(I)V", (void*)&Java_org_lwjgl_opengl_ATIVertexStreams_glClientActiveVertexStreamATI, "glClientActiveVertexStreamATI", (void*)&glClientActiveVertexStreamATI}, {"glVertexBlendEnvfATI", "(IF)V", (void*)&Java_org_lwjgl_opengl_ATIVertexStreams_glVertexBlendEnvfATI, "glVertexBlendEnvfATI", (void*)&glVertexBlendEnvfATI}, {"glVertexBlendEnviATI", "(II)V", (void*)&Java_org_lwjgl_opengl_ATIVertexStreams_glVertexBlendEnviATI, "glVertexBlendEnviATI", (void*)&glVertexBlendEnviATI} }; int num_functions = NUMFUNCTIONS(functions); extgl_InitializeClass(env, clazz, num_functions, functions); } #ifdef __cplusplus } #endif --- NEW FILE: org_lwjgl_opengl_ATIDrawBuffers.c --- /* * Copyright (c) 2002-2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // ---------------------------------- // IMPLEMENTATION OF NATIVE METHODS FOR CLASS: org.lwjgl.opengl.ATIDrawBuffers // ---------------------------------- #include "extgl.h" typedef void (APIENTRY * glDrawBuffersATIPROC) (GLsizei n, const GLenum *bufs); static glDrawBuffersATIPROC glDrawBuffersATI; /* * Class: org.lwjgl.opengl.ATIDrawBuffers * Method: nglDrawBuffersATI */ static void JNICALL Java_org_lwjgl_opengl_ATIDrawBuffers_nglDrawBuffersATI (JNIEnv * env, jclass clazz, jint size, jobject buffers, jint buffersOffset) { GLuint *buffers_ptr = (GLuint *)(*env)->GetDirectBufferAddress(env, buffers) + buffersOffset; glDrawBuffersATI(size, buffers_ptr); } #ifdef __cplusplus extern "C" { #endif JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ATIDrawBuffers_initNativeStubs(JNIEnv *env, jclass clazz) { JavaMethodAndExtFunction functions[] = { {"nglDrawBuffersATI", "(ILjava/nio/IntBuffer;I)V", (void*)&Java_org_lwjgl_opengl_ATIDrawBuffers_nglDrawBuffersATI, "glDrawBuffersATI", (void*)&glDrawBuffersATI} }; int num_functions = NUMFUNCTIONS(functions); extgl_InitializeClass(env, clazz, num_functions, functions); } #ifdef __cplusplus } #endif --- NEW FILE: org_lwjgl_opengl_ATIElementArray.c --- /* * Copyright (c) 2002-2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // ---------------------------------- // IMPLEMENTATION OF NATIVE METHODS FOR CLASS: org.lwjgl.opengl.ATIElementArray // ---------------------------------- #include "extgl.h" typedef void (APIENTRY * glElementPointerATIPROC) (GLenum type, const GLvoid *pointer); typedef void (APIENTRY * glDrawElementArrayATIPROC) (GLenum mode, GLsizei count); typedef void (APIENTRY * glDrawRangeElementArrayATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count); static glElementPointerATIPROC glElementPointerATI; static glDrawElementArrayATIPROC glDrawElementArrayATI; static glDrawRangeElementArrayATIPROC glDrawRangeElementArrayATI; /* * Class: org.lwjgl.opengl.ATIElementArray * Method: nglElementPointerATI */ static void JNICALL Java_org_lwjgl_opengl_ATIElementArray_nglElementPointerATI (JNIEnv * env, jclass clazz, jint type, jobject pPointer, jint pPointer_offset) { GLvoid *pPointer_ptr = (GLvoid *)((GLubyte *)(*env)->GetDirectBufferAddress(env, pPointer) + pPointer_offset); glElementPointerATI(type, pPointer_ptr); } /* * Class: org.lwjgl.opengl.ATIElementArray * Method: nglElementPointerATIVBO */ static void JNICALL Java_org_lwjgl_opengl_ATIElementArray_nglElementPointerATIVBO (JNIEnv * env, jclass clazz, jint type, jint buffer_offset) { glElementPointerATI(type, (GLvoid *)buffer_offset); } /* * Class: org.lwjgl.opengl.ATIElementArray * Method: glDrawElementArrayATI */ static void JNICALL Java_org_lwjgl_opengl_ATIElementArray_glDrawElementArrayATI (JNIEnv * env, jclass clazz, jint mode, jint count) { glDrawElementArrayATI(mode, count); } /* * Class: org.lwjgl.opengl.ATIElementArray * Method: glDrawRangeElementArrayATI */ static void JNICALL Java_org_lwjgl_opengl_ATIElementArray_glDrawRangeElementArrayATI (JNIEnv * env, jclass clazz, jint mode, jint start, jint end, jint count) { glDrawRangeElementArrayATI(mode, start, end, count); } #ifdef __cplusplus extern "C" { #endif JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ATIElementArray_initNativeStubs(JNIEnv *env, jclass clazz) { JavaMethodAndExtFunction functions[] = { {"nglElementPointerATI", "(ILjava/nio/Buffer;I)V", (void*)&Java_org_lwjgl_opengl_ATIElementArray_nglElementPointerATI, "glElementPointerATI", (void*)&glElementPointerATI}, {"nglElementPointerATIVBO", "(II)V", (void*)&Java_org_lwjgl_opengl_ATIElementArray_nglElementPointerATIVBO, NULL, NULL}, {"glDrawElementArrayATI", "(II)V", (void*)&Java_org_lwjgl_opengl_ATIElementArray_glDrawElementArrayATI, "glDrawElementArrayATI", (void*)&glDrawElementArrayATI}, {"glDrawRangeElementArrayATI", "(IIII)V", (void*)&Java_org_lwjgl_opengl_ATIElementArray_glDrawRangeElementArrayATI, "glDrawRangeElementArrayATI", (void*)&glDrawRangeElementArrayATI} }; int num_functions = NUMFUNCTIONS(functions); extgl_InitializeClass(env, clazz, num_functions, functions); } #ifdef __cplusplus } #endif Index: Makefile.am =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/ati/Makefile.am,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Makefile.am 3 Sep 2004 08:45:13 -0000 1.4 +++ Makefile.am 10 Sep 2004 08:13:51 -0000 1.5 @@ -2,13 +2,13 @@ libati_la_SOURCES = $(SRC) INCLUDES=-I.. -SRC=org_lwjgl_opengl_ATIElementArray.cpp \ - org_lwjgl_opengl_ATIEnvmapBumpmap.cpp \ - org_lwjgl_opengl_ATIFragmentShader.cpp \ - org_lwjgl_opengl_ATIPnTriangles.cpp \ - org_lwjgl_opengl_ATISeparateStencil.cpp \ - org_lwjgl_opengl_ATIVertexArrayObject.cpp \ - org_lwjgl_opengl_ATIVertexStreams.cpp \ - org_lwjgl_opengl_ATIDrawBuffers.cpp \ - org_lwjgl_opengl_ATIMapObjectBuffer.cpp \ - org_lwjgl_opengl_ATIVertexAttribArrayObject.cpp +SRC=org_lwjgl_opengl_ATIElementArray.c \ + org_lwjgl_opengl_ATIEnvmapBumpmap.c \ + org_lwjgl_opengl_ATIFragmentShader.c \ + org_lwjgl_opengl_ATIPnTriangles.c \ + org_lwjgl_opengl_ATISeparateStencil.c \ + org_lwjgl_opengl_ATIVertexArrayObject.c \ + org_lwjgl_opengl_ATIVertexStreams.c \ + org_lwjgl_opengl_ATIDrawBuffers.c \ + org_lwjgl_opengl_ATIMapObjectBuffer.c \ + org_lwjgl_opengl_ATIVertexAttribArrayObject.c --- NEW FILE: org_lwjgl_opengl_ATIMapObjectBuffer.c --- /* * Copyright (c) 2002-2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // ---------------------------------- // IMPLEMENTATION OF NATIVE METHODS FOR CLASS: org.lwjgl.opengl.ATIMapObjectBuffer // ---------------------------------- #include "extgl.h" #include "common_tools.h" typedef void * (APIENTRY * glMapObjectBufferATIPROC) (GLuint buffer); typedef void (APIENTRY * glUnmapObjectBufferATIPROC) (GLuint buffer); static glMapObjectBufferATIPROC glMapObjectBufferATI; static glUnmapObjectBufferATIPROC glUnmapObjectBufferATI; /* * Class: org.lwjgl.opengl.ATIMapObjectBuffer * Method: glMapObjectBufferATI */ static jobject JNICALL Java_org_lwjgl_opengl_ATIMapObjectBuffer_glMapObjectBufferATI (JNIEnv * env, jclass clazz, jint buffer, jint size, jobject oldBuffer) { void *buffer_address = glMapObjectBufferATI((GLenum)buffer); if (oldBuffer != NULL) { void *old_buffer_address = (*env)->GetDirectBufferAddress(env, oldBuffer); if (old_buffer_address == buffer_address) return oldBuffer; } return safeNewBuffer(env, buffer_address, size); } /* * Class: org.lwjgl.opengl.ATIMapObjectBuffer * Method: glUnmapObjectBufferATI */ static void JNICALL Java_org_lwjgl_opengl_ATIMapObjectBuffer_glUnmapObjectBufferATI (JNIEnv * env, jclass clazz, jint buffer) { glUnmapObjectBufferATI(buffer); } #ifdef __cplusplus extern "C" { #endif JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ATIMapObjectBuffer_initNativeStubs(JNIEnv *env, jclass clazz) { JavaMethodAndExtFunction functions[] = { {"glMapObjectBufferATI", "(IILjava/nio/ByteBuffer;)Ljava/nio/ByteBuffer;", (void*)&Java_org_lwjgl_opengl_ATIMapObjectBuffer_glMapObjectBufferATI, "glMapObjectBufferATI", (void*)&glMapObjectBufferATI}, {"glUnmapObjectBufferATI", "(I)V", (void*)&Java_org_lwjgl_opengl_ATIMapObjectBuffer_glUnmapObjectBufferATI, "glUnmapObjectBufferATI", (void*)&glUnmapObjectBufferATI} }; int num_functions = NUMFUNCTIONS(functions); extgl_InitializeClass(env, clazz, num_functions, functions); } #ifdef __cplusplus } #endif --- NEW FILE: org_lwjgl_opengl_ATIPnTriangles.c --- /* * Copyright (c) 2002-2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES O... [truncated message content] |
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6954/src/native/common Modified Files: Makefile.am checkALerror.h common_tools.h org_lwjgl_opengl_GLContext.h Added Files: common_tools.c extal.c extgl.c org_lwjgl_openal_AL.c org_lwjgl_openal_AL10.c org_lwjgl_openal_ALC.c org_lwjgl_openal_eax_EAX.c org_lwjgl_openal_eax_EAX20.c org_lwjgl_openal_eax_EAXBufferProperties.c org_lwjgl_openal_eax_EAXListenerProperties.c org_lwjgl_opengl_GL11.c org_lwjgl_opengl_GL12.c org_lwjgl_opengl_GL13.c org_lwjgl_opengl_GL14.c org_lwjgl_opengl_GL15.c org_lwjgl_opengl_GL20.c org_lwjgl_opengl_GLContext.c Removed Files: common_tools.cpp extal.cpp extgl.cpp org_lwjgl_openal_AL.cpp org_lwjgl_openal_AL10.cpp org_lwjgl_openal_ALC.cpp org_lwjgl_openal_eax_EAX.cpp org_lwjgl_openal_eax_EAX20.cpp org_lwjgl_openal_eax_EAXBufferProperties.cpp org_lwjgl_openal_eax_EAXListenerProperties.cpp org_lwjgl_opengl_GL11.cpp org_lwjgl_opengl_GL12.cpp org_lwjgl_opengl_GL13.cpp org_lwjgl_opengl_GL14.cpp org_lwjgl_opengl_GL15.cpp org_lwjgl_opengl_GL20.cpp org_lwjgl_opengl_GLContext.cpp Log Message: Converted native code from C++ (.cpp files) to C (.c files), thus avoiding an annoying dependency on the standard C++ library on Linux. We weren't using any particular C++ features anyway. --- org_lwjgl_opengl_GL14.cpp DELETED --- --- extgl.cpp DELETED --- --- org_lwjgl_opengl_GL20.cpp DELETED --- --- NEW FILE: common_tools.c --- /* * Copyright (c) 2002-2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** * $Id: common_tools.c,v 1.1 2004/09/10 08:13:47 elias_naur Exp $ * * @author elias_naur <eli...@us...> * @version $Revision: 1.1 $ */ #include <stdlib.h> #include "common_tools.h" static bool debug = false; static const char* VERSION = "0.92"; JavaVM *jvm; void initAttribList(attrib_list_t *list) { list->current_index = 0; } void putAttrib(attrib_list_t *list, int attrib) { if (list->current_index == ATTRIB_LIST_SIZE) { printfDebug("Ignoring attrib %d: attrib list size too small", attrib); return; } list->attribs[list->current_index] = attrib; list->current_index++; } jstring getVersionString(JNIEnv *env) { return (*env)->NewStringUTF(env, VERSION); } bool isDebugEnabled(void) { return debug; } void setDebugEnabled(bool enable) { debug = enable; } void printfDebug(const char *format, ...) { va_list ap; va_start(ap, format); if (isDebugEnabled()) vfprintf(stderr, format, ap); va_end(ap); } static void incListStart(event_queue_t *queue) { queue->list_start = (queue->list_start + 1)%EVENT_BUFFER_SIZE; } void initEventQueue(event_queue_t *event_queue) { event_queue->list_start = 0; event_queue->list_end = 0; } void putEventElement(event_queue_t *queue, unsigned char byte) { int next_index = (queue->list_end + 1)%EVENT_BUFFER_SIZE; if (next_index == queue->list_start) { printfDebug("Event buffer overflow!\n"); return; } queue->input_event_buffer[queue->list_end] = byte; queue->list_end = next_index; } static bool hasMoreEvents(event_queue_t *queue) { return queue->list_start != queue->list_end; } static void copyEvent(event_queue_t *queue, unsigned char *output_event_buffer, int output_index, int event_size) { int i; for (i = 0; i < event_size; i++) { output_event_buffer[output_index] = queue->input_event_buffer[queue->list_start]; incListStart(queue); output_index++; } } int copyEvents(event_queue_t *event_queue, unsigned char *output_event_buffer, int buffer_size, int event_size) { int num_events = 0; int index = 0; while (index + event_size <= buffer_size && hasMoreEvents(event_queue)) { copyEvent(event_queue, output_event_buffer, index, event_size); num_events++; index += event_size; } return num_events; } static void throwGeneralException(JNIEnv * env, const char *exception_name, const char * err) { if ((*env)->ExceptionCheck(env) == JNI_TRUE) return; // The JVM crashes if we try to throw two exceptions from one native call jclass cls = (*env)->FindClass(env, exception_name); (*env)->ThrowNew(env, cls, err); (*env)->DeleteLocalRef(env, cls); } void throwOpenALException(JNIEnv * env, const char * err) { throwGeneralException(env, "org/lwjgl/openal/OpenALException", err); } void throwFMODException(JNIEnv * env, const char * err) { throwGeneralException(env, "org/lwjgl/fmod3/FMODException", err); } void throwException(JNIEnv * env, const char * err) { throwGeneralException(env, "org/lwjgl/LWJGLException", err); } bool ext_InitializeFunctions(ExtGetProcAddressPROC gpa, int num_functions, ExtFunction *functions) { int i; for (i = 0; i < num_functions; i++) { ExtFunction *function = functions + i; if (function->ext_function_name != NULL) { void *ext_func_pointer = gpa(function->ext_function_name); if (ext_func_pointer == NULL) return false; void **ext_function_pointer_pointer = function->ext_function_pointer; *ext_function_pointer_pointer = ext_func_pointer; } } return true; } void ext_InitializeClass(JNIEnv *env, jclass clazz, ExtGetProcAddressPROC gpa, int num_functions, JavaMethodAndExtFunction *functions) { if (clazz == NULL) { throwException(env, "Null class"); return; } JNINativeMethod *methods = (JNINativeMethod *)malloc(num_functions*sizeof(JNINativeMethod)); int i; for (i = 0; i < num_functions; i++) { JavaMethodAndExtFunction *function = functions + i; if (function->ext_function_name != NULL) { void *ext_func_pointer = gpa(function->ext_function_name); if (ext_func_pointer == NULL) { free(methods); throwException(env, "Missing driver symbols"); return; } void **ext_function_pointer_pointer = function->ext_function_pointer; *ext_function_pointer_pointer = ext_func_pointer; } JNINativeMethod *method = methods + i; method->name = function->method_name; method->signature = function->signature; method->fnPtr = function->method_pointer; } (*env)->RegisterNatives(env, clazz, methods, num_functions); free(methods); } bool getBooleanProperty(JNIEnv *env, const char* propertyName) { jstring property = (*env)->NewStringUTF(env, propertyName); jclass booleanClass = (*env)->FindClass(env, "java/lang/Boolean"); jmethodID getBoolean = (*env)->GetStaticMethodID(env, booleanClass, "getBoolean", "(Ljava/lang/String;)Z"); return (*env)->CallStaticBooleanMethod(env, booleanClass, getBoolean, property) ? true : false; } JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) { jvm = vm; return JNI_VERSION_1_4; } JNIEXPORT void JNICALL JNI_OnUnload(JavaVM *vm, void *reserved) { } Index: checkALerror.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/checkALerror.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- checkALerror.h 12 Jun 2004 20:28:29 -0000 1.11 +++ checkALerror.h 10 Sep 2004 08:13:47 -0000 1.12 @@ -42,9 +42,9 @@ if (isDebugEnabled()) { \ int err = alGetError(); \ if (err != AL_NO_ERROR) { \ - jclass cls = env->FindClass("org/lwjgl/openal/OpenALException"); \ - env->ThrowNew(cls, (const char*) alGetString(err)); \ - env->DeleteLocalRef(cls); \ + jclass cls = (*env)->FindClass(env, "org/lwjgl/openal/OpenALException"); \ + (*env)->ThrowNew(env, cls, (const char*) alGetString(err)); \ + (*env)->DeleteLocalRef(env, cls); \ } \ } \ } @@ -54,9 +54,9 @@ if (isDebugEnabled()) { \ int err = alcGetError((ALCdevice*) deviceaddress); \ if (err != AL_NO_ERROR) { \ - jclass cls = env->FindClass("org/lwjgl/openal/OpenALException"); \ - env->ThrowNew(cls, (const char*) alcGetString((ALCdevice*) deviceaddress, err)); \ - env->DeleteLocalRef(cls); \ + jclass cls = (*env)->FindClass(env, "org/lwjgl/openal/OpenALException"); \ + (*env)->ThrowNew(env, cls, (const char*) alcGetString((ALCdevice*) deviceaddress, err)); \ + (*env)->DeleteLocalRef(env, cls); \ } \ } \ } --- common_tools.cpp DELETED --- Index: common_tools.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/common_tools.h,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- common_tools.h 4 Jul 2004 13:14:06 -0000 1.20 +++ common_tools.h 10 Sep 2004 08:13:47 -0000 1.21 @@ -62,6 +62,12 @@ int attribs[ATTRIB_LIST_SIZE]; } attrib_list_t; +#ifndef __cplusplus +typedef unsigned char bool; +#define true 1 +#define false 0 +#endif + extern void initAttribList(attrib_list_t *list); extern void putAttrib(attrib_list_t *list, int attrib); @@ -71,7 +77,6 @@ extern int copyEvents(event_queue_t *event_queue, unsigned char *output_event_buffer, int buffer_size, int event_size); extern void putEventElement(event_queue_t *queue, unsigned char byte); extern unsigned char *getOutputList(event_queue_t *queue); -//extern int getEventBufferSize(event_queue_t *event_queue); extern void throwException(JNIEnv *env, const char *msg); extern void throwOpenALException(JNIEnv * env, const char * err); extern void throwFMODException(JNIEnv * env, const char * err); @@ -83,14 +88,14 @@ if (buffer == NULL) return NULL; else - return (void *)((char *)env->GetDirectBufferAddress(buffer) + offset); + return (void *)((char *)(*env)->GetDirectBufferAddress(env, buffer) + offset); } static inline jobject safeNewBuffer(JNIEnv *env, void *p, int size) { if (p == NULL) return NULL; else - return env->NewDirectByteBuffer(p, size); + return (*env)->NewDirectByteBuffer(env, p, size); } static inline const void *offsetToPointer(jint offset) { --- NEW FILE: org_lwjgl_opengl_GL14.c --- /* * Copyright (c) 2002-2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** * $Id: org_lwjgl_opengl_GL14.c,v 1.1 2004/09/10 08:13:49 elias_naur Exp $ * * Core OpenGL functions. * * @author cix_foo <ci...@us...> * @version $Revision: 1.1 $ */ #include "extgl.h" #include "common_tools.h" typedef void (APIENTRY * glBlendColorPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); typedef void (APIENTRY * glBlendEquationPROC) (GLenum mode); typedef void (APIENTRY * glFogCoordfPROC) (GLfloat coord); typedef void (APIENTRY * glFogCoordPointerPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); typedef void (APIENTRY * glMultiDrawArraysPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); typedef void (APIENTRY * glPointParameterfPROC) (GLenum pname, GLfloat param); typedef void (APIENTRY * glPointParameterfvPROC) (GLenum pname, GLfloat *params); typedef void (APIENTRY * glSecondaryColor3bPROC) (GLbyte red, GLbyte green, GLbyte blue); typedef void (APIENTRY * glSecondaryColor3fPROC) (GLfloat red, GLfloat green, GLfloat blue); typedef void (APIENTRY * glSecondaryColor3ubPROC) (GLubyte red, GLubyte green, GLubyte blue); typedef void (APIENTRY * glSecondaryColorPointerPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); typedef void (APIENTRY * glBlendFuncSeparatePROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); typedef void (APIENTRY * glWindowPos2fPROC) (GLfloat x, GLfloat y); typedef void (APIENTRY * glWindowPos2iPROC) (GLint x, GLint y); typedef void (APIENTRY * glWindowPos3fPROC) (GLfloat x, GLfloat y, GLfloat z); typedef void (APIENTRY * glWindowPos3iPROC) (GLint x, GLint y, GLint z); static glFogCoordfPROC glFogCoordf; static glFogCoordPointerPROC glFogCoordPointer; static glMultiDrawArraysPROC glMultiDrawArrays; static glPointParameterfPROC glPointParameterf; static glPointParameterfvPROC glPointParameterfv; static glSecondaryColor3bPROC glSecondaryColor3b; static glSecondaryColor3fPROC glSecondaryColor3f; static glSecondaryColor3ubPROC glSecondaryColor3ub; static glSecondaryColorPointerPROC glSecondaryColorPointer; static glBlendFuncSeparatePROC glBlendFuncSeparate; static glWindowPos2fPROC glWindowPos2f; static glWindowPos2iPROC glWindowPos2i; static glWindowPos3fPROC glWindowPos3f; static glWindowPos3iPROC glWindowPos3i; static glBlendColorPROC glBlendColor; static glBlendEquationPROC glBlendEquation; static void JNICALL Java_org_lwjgl_opengl_GL14_glBlendEquation (JNIEnv *env, jclass clazz, jint mode) { glBlendEquation(mode); } static void JNICALL Java_org_lwjgl_opengl_GL14_glBlendColor(JNIEnv * env, jclass clazz, jfloat p0, jfloat p1, jfloat p2, jfloat p3) { glBlendColor((GLfloat) p0, (GLfloat) p1, (GLfloat) p2, (GLfloat) p3); } /* * Class: org_lwjgl_opengl_GL14 * Method: glFogCoordf * Signature: (F)V */ static void JNICALL Java_org_lwjgl_opengl_GL14_glFogCoordf (JNIEnv *env, jclass clazz, jfloat f) { glFogCoordf(f); } /* * Class: org_lwjgl_opengl_GL14 * Method: nglFogCoordPointer * Signature: (IILjava/nio/Buffer;)V */ static void JNICALL Java_org_lwjgl_opengl_GL14_nglFogCoordPointer (JNIEnv *env, jclass clazz, jint p1, jint p2, jobject buffer, jint offset) { GLvoid *address = (GLvoid *)(offset + (GLbyte *)(*env)->GetDirectBufferAddress(env, buffer)); glFogCoordPointer(p1, p2, address); } /* * Class: org_lwjgl_opengl_GL14 * Method: nglFogCoordPointerVBO * Signature: (IILjava/nio/Buffer;)V */ static void JNICALL Java_org_lwjgl_opengl_GL14_nglFogCoordPointerVBO (JNIEnv *env, jclass clazz, jint p1, jint p2, jint buffer_offset) { glFogCoordPointer(p1, p2, offsetToPointer(buffer_offset)); } /* * Class: org_lwjgl_opengl_GL14 * Method: glMultiDrawArrays * Signature: (IIII)V */ static void JNICALL Java_org_lwjgl_opengl_GL14_nglMultiDrawArrays (JNIEnv *env, jclass clazz, jint mode, jobject first, jint first_offset, jobject count, jint count_offset, jint primcount) { GLint *address = first_offset + (GLint *)(*env)->GetDirectBufferAddress(env, first); GLsizei *address2 = count_offset + (GLsizei *)(*env)->GetDirectBufferAddress(env, count); glMultiDrawArrays(mode, address, address2, (GLsizei)primcount); } /* * Class: org_lwjgl_opengl_GL14 * Method: glPointParameterf * Signature: (IF)V */ static void JNICALL Java_org_lwjgl_opengl_GL14_glPointParameterf (JNIEnv *env, jclass clazz, jint p1, jfloat p2) { glPointParameterf(p1, p2); } /* * Class: org_lwjgl_opengl_GL14 * Method: glPointParameterfv * Signature: (ILjava/nio/FloatBuffer;)V */ static void JNICALL Java_org_lwjgl_opengl_GL14_nglPointParameterfv (JNIEnv *env, jclass clazz, jint p1, jobject buffer, jint offset) { GLfloat *address = offset + (GLfloat *)(*env)->GetDirectBufferAddress(env, buffer); glPointParameterfv(p1, address); } /* * Class: org_lwjgl_opengl_GL14 * Method: glSecondaryColor3b * Signature: (BBB)V */ static void JNICALL Java_org_lwjgl_opengl_GL14_glSecondaryColor3b (JNIEnv *env, jclass clazz, jbyte p1, jbyte p2, jbyte p3) { glSecondaryColor3b(p1, p2, p3); } /* * Class: org_lwjgl_opengl_GL14 * Method: glSecondaryColor3f * Signature: (FFF)V */ static void JNICALL Java_org_lwjgl_opengl_GL14_glSecondaryColor3f (JNIEnv *env, jclass clazz, jfloat p1, jfloat p2, jfloat p3) { glSecondaryColor3f(p1, p2, p3); } /* * Class: org_lwjgl_opengl_GL14 * Method: glSecondaryColor3ub * Signature: (BBB)V */ static void JNICALL Java_org_lwjgl_opengl_GL14_glSecondaryColor3ub (JNIEnv *env, jclass clazz, jbyte p1, jbyte p2, jbyte p3) { glSecondaryColor3ub(p1, p2, p3); } /* * Class: org_lwjgl_opengl_GL14 * Method: nglSecondaryColorPointer * Signature: (IIILjava/nio/Buffer;)V */ static void JNICALL Java_org_lwjgl_opengl_GL14_nglSecondaryColorPointer (JNIEnv *env, jclass clazz, jint p1, jint p2, jint p3, jobject buffer, jint offset) { const GLvoid *address = (const GLvoid *)(offset + (GLbyte *)(*env)->GetDirectBufferAddress(env, buffer)); glSecondaryColorPointer(p1, p2, p3, address); } /* * Class: org_lwjgl_opengl_GL14 * Method: nglSecondaryColorPointerVBO * Signature: (IIILjava/nio/Buffer;)V */ static void JNICALL Java_org_lwjgl_opengl_GL14_nglSecondaryColorPointerVBO (JNIEnv *env, jclass clazz, jint p1, jint p2, jint p3, jint buffer_offset) { glSecondaryColorPointer(p1, p2, p3, offsetToPointer(buffer_offset)); } /* * Class: org_lwjgl_opengl_GL14 * Method: glBlendFuncSeparate * Signature: (IIII)V */ static void JNICALL Java_org_lwjgl_opengl_GL14_glBlendFuncSeparate (JNIEnv *env, jclass clazz, jint p1, jint p2, jint p3, jint p4) { glBlendFuncSeparate(p1, p2, p3, p4); } /* * Class: org_lwjgl_opengl_GL14 * Method: glWindowPos2f * Signature: (FF)V */ static void JNICALL Java_org_lwjgl_opengl_GL14_glWindowPos2f (JNIEnv *env, jclass clazz, jfloat p1, jfloat p2) { glWindowPos2f(p1, p2); } /* * Class: org_lwjgl_opengl_GL14 * Method: glWindowPos2i * Signature: (II)V */ static void JNICALL Java_org_lwjgl_opengl_GL14_glWindowPos2i (JNIEnv *env, jclass clazz, jint p1, jint p2) { glWindowPos2i(p1, p2); } /* * Class: org_lwjgl_opengl_GL14 * Method: glWindowPos3f * Signature: (FFF)V */ static void JNICALL Java_org_lwjgl_opengl_GL14_glWindowPos3f (JNIEnv *env, jclass clazz, jfloat p1, jfloat p2, jfloat p3) { glWindowPos3f(p1, p2, p3); } /* * Class: org_lwjgl_opengl_GL14 * Method: glWindowPos3i * Signature: (III)V */ static void JNICALL Java_org_lwjgl_opengl_GL14_glWindowPos3i (JNIEnv *env, jclass clazz, jint p1, jint p2, jint p3) { glWindowPos3i(p1, p2, p3); } #ifdef __cplusplus extern "C" { #endif JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14_initNativeStubs(JNIEnv *env, jclass clazz) { JavaMethodAndExtFunction functions[] = { {"glBlendEquation", "(I)V", (void*)&Java_org_lwjgl_opengl_GL14_glBlendEquation, "glBlendEquation", (void*)&glBlendEquation}, {"glBlendColor", "(FFFF)V", (void*)&Java_org_lwjgl_opengl_GL14_glBlendColor, "glBlendColor", (void*)&glBlendColor}, {"glFogCoordf", "(F)V", (void*)&Java_org_lwjgl_opengl_GL14_glFogCoordf, "glFogCoordf", (void*)&glFogCoordf}, {"nglFogCoordPointer", "(IILjava/nio/Buffer;I)V", (void*)&Java_org_lwjgl_opengl_GL14_nglFogCoordPointer, "glFogCoordPointer", (void*)&glFogCoordPointer}, {"nglFogCoordPointerVBO", "(III)V", (void*)&Java_org_lwjgl_opengl_GL14_nglFogCoordPointerVBO, NULL, NULL}, {"nglMultiDrawArrays", "(ILjava/nio/IntBuffer;ILjava/nio/IntBuffer;II)V", (void*)&Java_org_lwjgl_opengl_GL14_nglMultiDrawArrays, "glMultiDrawArrays", (void*)&glMultiDrawArrays}, {"glPointParameterf", "(IF)V", (void*)&Java_org_lwjgl_opengl_GL14_glPointParameterf, "glPointParameterf", (void*)&glPointParameterf}, {"nglPointParameterfv", "(ILjava/nio/FloatBuffer;I)V", (void*)&Java_org_lwjgl_opengl_GL14_nglPointParameterfv, "glPointParameterfv", (void*)&glPointParameterfv}, {"glSecondaryColor3b", "(BBB)V", (void*)&Java_org_lwjgl_opengl_GL14_glSecondaryColor3b, "glSecondaryColor3b", (void*)&glSecondaryColor3b}, {"glSecondaryColor3f", "(FFF)V", (void*)&Java_org_lwjgl_opengl_GL14_glSecondaryColor3f, "glSecondaryColor3f", (void*)&glSecondaryColor3f}, {"glSecondaryColor3ub", "(BBB)V", (void*)&Java_org_lwjgl_opengl_GL14_glSecondaryColor3ub, "glSecondaryColor3ub", (void*)&glSecondaryColor3ub}, {"nglSecondaryColorPointer", "(IIILjava/nio/Buffer;I)V", (void*)&Java_org_lwjgl_opengl_GL14_nglSecondaryColorPointer, "glSecondaryColorPointer", (void*)&glSecondaryColorPointer}, {"nglSecondaryColorPointerVBO", "(IIII)V", (void*)&Java_org_lwjgl_opengl_GL14_nglSecondaryColorPointerVBO, NULL, NULL}, {"glBlendFuncSeparate", "(IIII)V", (void*)&Java_org_lwjgl_opengl_GL14_glBlendFuncSeparate, "glBlendFuncSeparate", (void*)&glBlendFuncSeparate}, {"glWindowPos2f", "(FF)V", (void*)&Java_org_lwjgl_opengl_GL14_glWindowPos2f, "glWindowPos2f", (void*)&glWindowPos2f}, {"glWindowPos2i", "(II)V", (void*)&Java_org_lwjgl_opengl_GL14_glWindowPos2i, "glWindowPos2i", (void*)&glWindowPos2i}, {"glWindowPos3f", "(FFF)V", (void*)&Java_org_lwjgl_opengl_GL14_glWindowPos3f, "glWindowPos3f", (void*)&glWindowPos3f}, {"glWindowPos3i", "(III)V", (void*)&Java_org_lwjgl_opengl_GL14_glWindowPos3i, "glWindowPos3i", (void*)&glWindowPos3i} }; int num_functions = NUMFUNCTIONS(functions); extgl_InitializeClass(env, clazz, num_functions, functions); } #ifdef __cplusplus } #endif --- NEW FILE: org_lwjgl_openal_eax_EAXBufferProperties.c --- /* * Copyright (c) 2002-2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "org_lwjgl_openal_eax_EAXBufferProperties.h" #include <stddef.h> #ifdef _WIN32 #include <eax.h> #endif /* * Class: org_lwjgl_openal_eax_EAXBufferProperties * Method: sizeOfEaxBufferProperties * Signature: ()I */ JNIEXPORT jint JNICALL Java_org_lwjgl_openal_eax_EAXBufferProperties_sizeOfEaxBufferProperties(JNIEnv *env, jclass clazz) { #ifdef _WIN32 return sizeof(EAXBUFFERPROPERTIES); #else return 0; #endif } /* * Class: org_lwjgl_openal_eax_EAXBufferProperties * Method: assignOffsets * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_eax_EAXBufferProperties_assignOffsets(JNIEnv *env, jclass clazz) { #ifdef _WIN32 jclass listener_class; jfieldID field; //get class/fields listener_class = env->FindClass("org/lwjgl/openal/eax/EAXBufferProperties"); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "direct_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXBUFFERPROPERTIES, lDirect)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "directHF_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXBUFFERPROPERTIES, lDirectHF)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "room_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXBUFFERPROPERTIES, lRoom)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "roomHF_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXBUFFERPROPERTIES, lRoomHF)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "roomRolloffFactor_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXBUFFERPROPERTIES, flRoomRolloffFactor)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "obstruction_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXBUFFERPROPERTIES, lObstruction)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "obstructionLFRatio_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXBUFFERPROPERTIES, flObstructionLFRatio)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "occlusion_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXBUFFERPROPERTIES, lOcclusion)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "occlusionLFRatio_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXBUFFERPROPERTIES, flOcclusionLFRatio)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "occlusionRoomRatio_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXBUFFERPROPERTIES, flOcclusionRoomRatio)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "outsideVolumeHF_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXBUFFERPROPERTIES, lOutsideVolumeHF)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "airAbsorptionFactor_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXBUFFERPROPERTIES, flAirAbsorptionFactor)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "flags_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXBUFFERPROPERTIES, dwFlags)); #endif } --- NEW FILE: org_lwjgl_opengl_GL15.c --- /* * Copyright (c) 2002-2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // ---------------------------------- // IMPLEMENTATION OF NATIVE METHODS FOR CLASS: org.lwjgl.opengl.GL15 // ---------------------------------- #include "extgl.h" #include "common_tools.h" typedef int GLintptr; typedef unsigned int GLsizeiptr; typedef void (APIENTRY * glBindBufferPROC) (GLenum target, GLuint buffer); typedef void (APIENTRY * glDeleteBuffersPROC) (GLsizei n, const GLuint *buffers); typedef void (APIENTRY * glGenBuffersPROC) (GLsizei n, GLuint *buffers); typedef GLboolean (APIENTRY * glIsBufferPROC) (GLuint buffer); typedef void (APIENTRY * glBufferDataPROC) (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage); typedef void (APIENTRY * glBufferSubDataPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data); typedef void (APIENTRY * glGetBufferSubDataPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data); typedef void * (APIENTRY * glMapBufferPROC) (GLenum target, GLenum access); typedef GLboolean (APIENTRY * glUnmapBufferPROC) (GLenum target); typedef void (APIENTRY * glGetBufferParameterivPROC) (GLenum target, GLenum pname, GLint *params); typedef void (APIENTRY * glGetBufferPointervPROC) (GLenum target, GLenum pname, GLvoid **params); typedef void (APIENTRY * glGenQueriesPROC) (GLsizei n, GLuint *ids); typedef void (APIENTRY * glDeleteQueriesPROC) (GLsizei n, const GLuint *ids); typedef GLboolean (APIENTRY * glIsQueryPROC) (GLuint id); typedef void (APIENTRY * glBeginQueryPROC) (GLenum target, GLuint id); typedef void (APIENTRY * glEndQueryPROC) (GLenum target); typedef void (APIENTRY * glGetQueryivPROC) (GLenum target, GLenum pname, GLint *params); typedef void (APIENTRY * glGetQueryObjectivPROC) (GLuint id, GLenum pname, GLint *params); typedef void (APIENTRY * glGetQueryObjectuivPROC) (GLuint id, GLenum pname, GLuint *params); static glBindBufferPROC glBindBuffer; static glDeleteBuffersPROC glDeleteBuffers; static glGenBuffersPROC glGenBuffers; static glIsBufferPROC glIsBuffer; static glBufferDataPROC glBufferData; static glBufferSubDataPROC glBufferSubData; static glGetBufferSubDataPROC glGetBufferSubData; static glMapBufferPROC glMapBuffer; static glUnmapBufferPROC glUnmapBuffer; static glGetBufferParameterivPROC glGetBufferParameteriv; static glGetBufferPointervPROC glGetBufferPointerv; static glGenQueriesPROC glGenQueries; static glDeleteQueriesPROC glDeleteQueries; static glIsQueryPROC glIsQuery; static glBeginQueryPROC glBeginQuery; static glEndQueryPROC glEndQuery; static glGetQueryivPROC glGetQueryiv; static glGetQueryObjectivPROC glGetQueryObjectiv; static glGetQueryObjectuivPROC glGetQueryObjectuiv; /* * Class: org.lwjgl.opengl.GL15 * Method: nglBindBuffer */ static void JNICALL Java_org_lwjgl_opengl_GL15_nglBindBuffer (JNIEnv * env, jclass clazz, jint target, jint buffer) { glBindBuffer(target, buffer); } /* * Class: org.lwjgl.opengl.GL15 * Method: nglDeleteBuffers */ static void JNICALL Java_org_lwjgl_opengl_GL15_nglDeleteBuffers (JNIEnv * env, jclass clazz, jint n, jobject buffers, jint buffers_offset) { GLuint *buffers_ptr = (GLuint *)(*env)->GetDirectBufferAddress(env, buffers) + buffers_offset; glDeleteBuffers(n, buffers_ptr); } /* * Class: org.lwjgl.opengl.GL15 * Method: nglGenBuffers */ static void JNICALL Java_org_lwjgl_opengl_GL15_nglGenBuffers (JNIEnv * env, jclass clazz, jint n, jobject buffers, jint buffers_offset) { GLuint *buffers_ptr = (GLuint *)(*env)->GetDirectBufferAddress(env, buffers) + buffers_offset; glGenBuffers(n, buffers_ptr); } /* * Class: org.lwjgl.opengl.GL15 * Method: glIsBuffer */ static jboolean JNICALL Java_org_lwjgl_opengl_GL15_glIsBuffer (JNIEnv * env, jclass clazz, jint buffer) { GLboolean result = glIsBuffer(buffer); return result; } /* * Class: org.lwjgl.opengl.GL15 * Method: nglBufferData */ static void JNICALL Java_org_lwjgl_opengl_GL15_nglBufferData (JNIEnv * env, jclass clazz, jint target, jint size, jobject data, jint data_offset, jint usage) { GLvoid *data_ptr = (GLvoid *)safeGetBufferAddress(env, data, data_offset); glBufferData(target, size, data_ptr, usage); } /* * Class: org.lwjgl.opengl.GL15 * Method: nglBufferSubData */ static void JNICALL Java_org_lwjgl_opengl_GL15_nglBufferSubData (JNIEnv * env, jclass clazz, jint target, jint offset, jint size, jobject data, jint data_offset) { GLvoid *data_ptr = (GLvoid *)((GLubyte *)(*env)->GetDirectBufferAddress(env, data) + data_offset); glBufferSubData(target, offset, size, data_ptr); } /* * Class: org.lwjgl.opengl.GL15 * Method: nglGetBufferSubData */ static void JNICALL Java_org_lwjgl_opengl_GL15_nglGetBufferSubData (JNIEnv * env, jclass clazz, jint target, jint offset, jint size, jobject data, jint data_offset) { GLvoid *data_ptr = (GLvoid *)((GLubyte *)(*env)->GetDirectBufferAddress(env, data) + data_offset); glGetBufferSubData(target, offset, size, data_ptr); } /* * Class: org.lwjgl.opengl.GL15 * Method: glMapBuffer */ static jobject JNICALL Java_org_lwjgl_opengl_GL15_glMapBuffer (JNIEnv * env, jclass clazz, jint target, jint access, jint size, jobject oldBuffer) { void *buffer_address = glMapBuffer((GLenum)target, (GLenum)access); if (oldBuffer != NULL) { void *old_buffer_address = (*env)->GetDirectBufferAddress(env, oldBuffer); if (old_buffer_address == buffer_address) return oldBuffer; } return safeNewBuffer(env, buffer_address, size); } /* * Class: org.lwjgl.opengl.GL15 * Method: glUnmapBuffer */ static jboolean JNICALL Java_org_lwjgl_opengl_GL15_glUnmapBuffer (JNIEnv * env, jclass clazz, jint target) { GLboolean result = glUnmapBuffer(target); return result; } /* * Class: org.lwjgl.opengl.GL15 * Method: nglGetBufferParameteriv */ static void JNICALL Java_org_lwjgl_opengl_GL15_nglGetBufferParameteriv (JNIEnv * env, jclass clazz, jint target, jint pname, jobject params, jint params_offset) { GLint *params_ptr = (GLint *)(*env)->GetDirectBufferAddress(env, params) + params_offset; glGetBufferParameteriv(target, pname, params_ptr); } /* * Class: org.lwjgl.opengl.GL15 * Method: glGetBufferPointer */ static jobject JNICALL Java_org_lwjgl_opengl_GL15_glGetBufferPointer (JNIEnv * env, jclass clazz, jint target, jint pname, jint size) { void *pointer; glGetBufferPointerv((GLenum)target, (GLenum)pname, &pointer); return safeNewBuffer(env, pointer, size); } /* * Class: org.lwjgl.opengl.GL15 * Method: nglGenQueries */ static void JNICALL Java_org_lwjgl_opengl_GL15_nglGenQueries (JNIEnv * env, jclass clazz, jint n, jobject ids, jint idsOffset) { GLuint *ids_ptr = (GLuint *)(*env)->GetDirectBufferAddress(env, ids) + idsOffset; glGenQueries(n, ids_ptr); } /* * Class: org.lwjgl.opengl.GL15 * Method: nglDeleteQueries */ static void JNICALL Java_org_lwjgl_opengl_GL15_nglDeleteQueries (JNIEnv * env, jclass clazz, jint n, jobject ids, jint idsOffset) { GLuint *ids_ptr = (GLuint *)(*env)->GetDirectBufferAddress(env, ids) + idsOffset; glDeleteQueries(n, ids_ptr); } /* * Class: org.lwjgl.opengl.GL15 * Method: glIsQuery */ static jboolean JNICALL Java_org_lwjgl_opengl_GL15_glIsQuery (JNIEnv * env, jclass clazz, jint id) { GLboolean result = glIsQuery(id); return result; } /* * Class: org.lwjgl.opengl.GL15 * Method: glBeginQuery */ static void JNICALL Java_org_lwjgl_opengl_GL15_glBeginQuery (JNIEnv * env, jclass clazz, jint target, jint id) { glBeginQuery(target, id); } /* * Class: org.lwjgl.opengl.GL15 * Method: glEndQuery */ static void JNICALL Java_org_lwjgl_opengl_GL15_glEndQuery (JNIEnv * env, jclass clazz, jint target) { glEndQuery(target); } /* * Class: org.lwjgl.opengl.GL15 * Method: nglGetQueryiv */ static void JNICALL Java_org_lwjgl_opengl_GL15_nglGetQueryiv (JNIEnv * env, jclass clazz, jint target, jint pname, jobject params, jint paramsOffset) { GLint *params_ptr = (GLint *)(*env)->GetDirectBufferAddress(env, params) + paramsOffset; glGetQueryiv(target, pname, params_ptr); } /* * Class: org.lwjgl.opengl.GL15 * Method: nglGetQueryObjectiv */ static void JNICALL Java_org_lwjgl_opengl_GL15_nglGetQueryObjectiv (JNIEnv * env, jclass clazz, jint id, jint pname, jobject params, jint paramsOffset) { GLint *params_ptr = (GLint *)(*env)->GetDirectBufferAddress(env, params) + paramsOffset; glGetQueryObjectiv(id, pname, params_ptr); } /* * Class: org.lwjgl.opengl.GL15 * Method: nglGetQueryObjectuiv */ static void JNICALL Java_org_lwjgl_opengl_GL15_nglGetQueryObjectuiv (JNIEnv * env, jclass clazz, jint id, jint pname, jobject params, jint paramsOffset) { GLuint *params_ptr = (GLuint *)(*env)->GetDirectBufferAddress(env, params) + paramsOffset; glGetQueryObjectuiv(id, pname, params_ptr); } #ifdef __cplusplus extern "C" { #endif JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL15_initNativeStubs(JNIEnv *env, jclass clazz) { JavaMethodAndExtFunction functions[] = { {"nglBindBuffer", "(II)V", (void*)&Java_org_lwjgl_opengl_GL15_nglBindBuffer, "glBindBuffer", (void*)&glBindBuffer}, {"nglDeleteBuffers", "(ILjava/nio/IntBuffer;I)V", (void*)&Java_org_lwjgl_opengl_GL15_nglDeleteBuffers, "glDeleteBuffers", (void*)&glDeleteBuffers}, {"nglGenBuffers", "(ILjava/nio/IntBuffer;I)V", (void*)&Java_org_lwjgl_opengl_GL15_nglGenBuffers, "glGenBuffers", (void*)&glGenBuffers}, {"glIsBuffer", "(I)Z", (void*)&Java_org_lwjgl_opengl_GL15_glIsBuffer, "glIsBuffer", (void*)&glIsBuffer}, {"nglBufferData", "(IILjava/nio/Buffer;II)V", (void*)&Java_org_lwjgl_opengl_GL15_nglBufferData, "glBufferData", (void*)&glBufferData}, {"nglBufferSubData", "(IIILjava/nio/Buffer;I)V", (void*)&Java_org_lwjgl_opengl_GL15_nglBufferSubData, "glBufferSubData", (void*)&glBufferSubData}, {"nglGetBufferSubData", "(IIILjava/nio/Buffer;I)V", (void*)&Java_org_lwjgl_opengl_GL15_nglGetBufferSubData, "glGetBufferSubData", (void*)&glGetBufferSubData}, {"glMapBuffer", "(IIILjava/nio/ByteBuffer;)Ljava/nio/ByteBuffer;", (void*)&Java_org_lwjgl_opengl_GL15_glMapBuffer, "glMapBuffer", (void*)&glMapBuffer}, {"glUnmapBuffer", "(I)Z", (void*)&Java_org_lwjgl_opengl_GL15_glUnmapBuffer, "glUnmapBuffer", (void*)&glUnmapBuffer}, {"nglGetBufferParameteriv", "(IILjava/nio/IntBuffer;I)V", (void*)&Java_org_lwjgl_opengl_GL15_nglGetBufferParameteriv, "glGetBufferParameteriv", (void*)&glGetBufferParameteriv}, {"glGetBufferPointer", "(III)Ljava/nio/ByteBuffer;", (void*)&Java_org_lwjgl_opengl_GL15_glGetBufferPointer, "glGetBufferPointerv", (void*)&glGetBufferPointerv}, {"nglGenQueries", "(ILjava/nio/IntBuffer;I)V", (void*)&Java_org_lwjgl_opengl_GL15_nglGenQueries, "glGenQueries", (void*)&glGenQueries}, {"nglDeleteQueries", "(ILjava/nio/IntBuffer;I)V", (void*)&Java_org_lwjgl_opengl_GL15_nglDeleteQueries, "glDeleteQueries", (void*)&glDeleteQueries}, {"glIsQuery", "(I)Z", (void*)&Java_org_lwjgl_opengl_GL15_glIsQuery, "glIsQuery", (void*)&glIsQuery}, {"glBeginQuery", "(II)V", (void*)&Java_org_lwjgl_opengl_GL15_glBeginQuery, "glBeginQuery", (void*)&glBeginQuery}, {"glEndQuery", "(I)V", (void*)&Java_org_lwjgl_opengl_GL15_glEndQuery, "glEndQuery", (void*)&glEndQuery}, {"nglGetQueryiv", "(IILjava/nio/IntBuffer;I)V", (void*)&Java_org_lwjgl_opengl_GL15_nglGetQueryiv, "glGetQueryiv", (void*)&glGetQueryiv}, {"nglGetQueryObjectiv", "(IILjava/nio/IntBuffer;I)V", (void*)&Java_org_lwjgl_opengl_GL15_nglGetQueryObjectiv, "glGetQueryObjectiv", (void*)&glGetQueryObjectiv}, {"nglGetQueryObjectuiv", "(IILjava/nio/IntBuffer;I)V", (void*)&Java_org_lwjgl_opengl_GL15_nglGetQueryObjectuiv, "glGetQueryObjectuiv", (void*)&glGetQueryObjectuiv} }; int num_functions = NUMFUNCTIONS(functions); extgl_InitializeClass(env, clazz, num_functions, functions); } #ifdef __cplusplus } #endif --- org_lwjgl_openal_eax_EAX.cpp DELETED --- --- org_lwjgl_openal_eax_EAXListenerProperties.cpp DELETED --- --- org_lwjgl_openal_eax_EAXBufferProperties.cpp DELETED --- --- NEW FILE: org_lwjgl_openal_eax_EAXListenerProperties.c --- /* * Copyright (c) 2002-2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "org_lwjgl_openal_eax_EAXListenerProperties.h" #include <stddef.h> #ifdef _WIN32 #include <eax.h> #endif /* * Class: org_lwjgl_openal_eax_EAXListenerProperties * Method: sizeOfEaxListenerProperties * Signature: ()I */ JNIEXPORT jint JNICALL Java_org_lwjgl_openal_eax_EAXListenerProperties_sizeOfEaxListenerProperties(JNIEnv *env, jclass clazz) { #ifdef _WIN32 return sizeof(EAXLISTENERPROPERTIES); #else return 0; #endif } /* * Class: org_lwjgl_openal_eax_EAXListenerProperties * Method: assignOffsets * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_eax_EAXListenerProperties_assignOffsets (JNIEnv *env, jclass clazz) { #ifdef _WIN32 jclass listener_class; jfieldID field; //get class/fields listener_class = env->FindClass("org/lwjgl/openal/eax/EAXListenerProperties"); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "room_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXLISTENERPROPERTIES, lRoom)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "roomHF_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXLISTENERPROPERTIES, lRoomHF)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "roomRolloffFactor_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXLISTENERPROPERTIES, flRoomRolloffFactor)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "decayTime_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXLISTENERPROPERTIES, flDecayTime)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "decayHFRatio_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXLISTENERPROPERTIES, flDecayHFRatio)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "reflections_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXLISTENERPROPERTIES, lReflections)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "reflectionsDelay_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXLISTENERPROPERTIES, flReflectionsDelay)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "reverb_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXLISTENERPROPERTIES, lReverb)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "reverbDelay_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXLISTENERPROPERTIES, flReverbDelay)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "environment_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXLISTENERPROPERTIES, dwEnvironment)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "environmentSize_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXLISTENERPROPERTIES, flEnvironmentSize)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "environmentDiffusion_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXLISTENERPROPERTIES, flEnvironmentDiffusion)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "airAbsorptionHF_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXLISTENERPROPERTIES, flAirAbsorptionHF)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "flags_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXLISTENERPROPERTIES, dwFlags)); #endif } Index: Makefile.am =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/Makefile.am,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- Makefile.am 9 Sep 2004 23:51:16 -0000 1.24 +++ Makefile.am 10 Sep 2004 08:13:47 -0000 1.25 @@ -9,38 +9,23 @@ DEP_LIBS=libtools.la arb/libarb.la ati/libati.la ext/libext.la nv/libnv.la TOOLS = \ - common_tools.cpp \ + common_tools.c \ common_tools.h COMMON = \ - extal.cpp \ - extal.h \ - extgl.cpp \ - extgl.h \ - org_lwjgl_Display.h \ - org_lwjgl_Sys.h \ - org_lwjgl_input_GamePad.h \ - org_lwjgl_input_Joystick.h \ - org_lwjgl_input_Keyboard.h \ - org_lwjgl_input_Mouse.h \ - org_lwjgl_openal_ALC.cpp \ - org_lwjgl_openal_ALC.h \ - org_lwjgl_openal_AL.cpp \ - org_lwjgl_openal_AL.h \ - org_lwjgl_openal_AL10.cpp \ - org_lwjgl_openal_AL10.h \ - org_lwjgl_openal_eax_EAX.cpp \ - org_lwjgl_openal_eax_EAX.h \ - org_lwjgl_openal_eax_EAX20.cpp \ - org_lwjgl_openal_eax_EAX.h \ - org_lwjgl_openal_eax_EAXBufferProperties.cpp \ - org_lwjgl_openal_eax_EAXBufferProperties.h \ - org_lwjgl_openal_eax_EAXListenerProperties.cpp \ - org_lwjgl_openal_eax_EAXListenerProperties.h \ - org_lwjgl_opengl_GLContext.cpp \ - org_lwjgl_opengl_GL11.cpp \ - org_lwjgl_opengl_GL12.cpp \ - org_lwjgl_opengl_GL13.cpp \ - org_lwjgl_opengl_GL14.cpp \ - org_lwjgl_opengl_GL15.cpp \ - org_lwjgl_opengl_GL20.cpp + extal.c \ + extgl.c \ + org_lwjgl_openal_ALC.c \ + org_lwjgl_openal_AL.c \ + org_lwjgl_openal_AL10.c \ + org_lwjgl_openal_eax_EAX.c \ + org_lwjgl_openal_eax_EAX20.c \ + org_lwjgl_openal_eax_EAXBufferProperties.c \ + org_lwjgl_openal_eax_EAXListenerProperties.c \ + org_lwjgl_opengl_GLContext.c \ + org_lwjgl_opengl_GL11.c \ + org_lwjgl_opengl_GL12.c \ + org_lwjgl_opengl_GL13.c \ + org_lwjgl_opengl_GL14.c \ + org_lwjgl_opengl_GL15.c \ + org_lwjgl_opengl_GL20.c --- NEW FILE: extgl.c --- /* ---------------------------------------------------------------------------- Copyright (c) 2001-2002, Lev Povalahev All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * The name of the author may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------*/ /* Lev Povalahev le...@gm... http://www.uni-karlsruhe.de/~uli2/ */ #include <stdio.h> #include <string.h> #include "extgl.h" #include "common_tools.h" /* turn off the warning for the borland compiler*/ #ifdef __BORLANDC__ #pragma warn -8064 #pragma warn -8065 #endif /* __BORLANDC__ */ #ifdef _X11 #include <dlfcn.h> #endif #ifdef _AGL aglChoosePixelFormatPROC aglChoosePixelFormat = NULL; aglDestroyPixelFormatPROC aglDestroyPixelFormat = NULL; aglNextPixelFormatPROC aglNextPixelFormat = NULL; aglDescribePixelFormatPROC aglDescribePixelFormat = NULL; aglDevicesOfPixelFormatPROC aglDevicesOfPixelFormat = NULL; aglQueryRendererInfoPROC aglQueryRendererInfo = NULL; aglDestroyRendererInfoPROC aglDestroyRendererInfo = NULL; aglNextRendererInfoPROC aglNextRendererInfo = NULL; aglDescribeRendererPROC aglDescribeRenderer = NULL; aglCreateContextPROC aglCreateContext = NULL; aglDestroyContextPROC aglDestroyContext = NULL; aglCopyContextPROC aglCopyContext = NULL; aglUpdateContextPROC aglUpdateContext = NULL; aglSetCurrentContextPROC aglSetCurrentContext = NULL; aglGetCurrentContextPROC aglGetCurrentContext = NULL; aglSetDrawablePROC aglSetDrawable = NULL; aglSetOffScreenPROC aglSetOffScreen = NULL; aglSetFullScreenPROC aglSetFullScreen = NULL; aglGetDrawablePROC aglGetDrawable = NULL; aglSetVirtualScreenPROC aglSetVirtualScreen = NULL; aglGetVirtualScreenPROC aglGetVirtualScreen = NULL; aglGetVersionPROC aglGetVersion = NULL; aglSwapBuffersPROC aglSwapBuffers = NULL; aglEnablePROC aglEnable = NULL; aglDisablePROC aglDisable = NULL; aglIsEnabledPROC aglIsEnabled = NULL; aglSetIntegerPROC aglSetInteger = NULL; aglGetIntegerPROC aglGetInteger = NULL; aglUseFontPROC aglUseFont = NULL; aglGetErrorPROC aglGetError = NULL; aglErrorStringPROC aglErrorString = NULL; aglResetLibraryPROC aglResetLibrary = NULL; aglSurfaceTexturePROC aglSurfaceTexture = NULL; #endif struct ExtensionTypes extgl_Extensions; #ifdef _WIN32 HMODULE lib_gl_handle = NULL; #endif #ifdef _X11 void * lib_gl_handle = NULL; typedef void * (APIENTRY * glXGetProcAddressARBPROC) (const GLubyte *procName); static glXGetProcAddressARBPROC glXGetProcAddressARB; #endif #ifdef _AGL CFBundleRef opengl_bundle_ref = NULL; CFBundleRef agl_bundle_ref = NULL; #endif /* getProcAddress */ void *extgl_GetProcAddress(const char *name) { #ifdef _WIN32 void *t = wglGetProcAddress(name); if (t == NULL) { t = GetProcAddress(lib_gl_handle, name); if (t == NULL) { printfDebug("Could not locate symbol %s\n", name); } } return t; #endif #ifdef _X11 void *t = (void*)glXGetProcAddressARB((const GLubyte*)name); if (t == NULL) { t = dlsym(lib_gl_handle, name); if (t == NULL) { printfDebug("Could not locate symbol %s\n", name); } } return t; #endif #ifdef _AGL CFStringRef str = CFStringCreateWithCStringNoCopy(NULL, name, kCFStringEncodingUTF8, kCFAllocatorNull); void *func_pointer = CFBundleGetFunctionPointerForName(opengl_bundle_ref, str); if (func_pointer == NULL) { func_pointer = CFBundleGetFunctionPointerForName(agl_bundle_ref, str); if (func_pointer == NULL) { printfDebug("Could not locate symbol %s\n", name); } } CFRelease(str); return func_pointer; #endif } void extgl_InitializeClass(JNIEnv *env, jclass clazz, int num_functions, JavaMethodAndExtFunction *functions) { ext_InitializeClass(env, clazz, &extgl_GetProcAddress, num_functions, functions); } bool extgl_InitializeFunctions(int num_functions, ExtFunction *functions) { return ext_InitializeFunctions(&extgl_GetProcAddress, num_functions, functions); } #ifdef _AGL // ------------------------- static CFBundleRef loadBundle(const Str255 frameworkName) { OSStatus err = noErr; FSRefParam fileRefParam; FSRef fileRef; CFURLRef bundleURLOpenGL; CFBundleRef bundle_ref; memset(&fileRefParam, 0, sizeof(fileRefParam)); memset(&fileRef, 0, sizeof(fileRef)); fileRefParam.ioNamePtr = frameworkName; fileRefParam.newRef = &fileRef; // Frameworks directory/folder // err = FindFolder (kSystemDomain, kFrameworksFolderType, false, &fileRefParam.ioVRefNum, &fileRefParam.ioDirID); if (noErr != err) { printfDebug("Could not find frameworks folder\n"); return NULL; } // make FSRef for folder // err = PBMakeFSRefSync (&fileRefParam); if (noErr != err) { printfDebug("Could make FSref to frameworks folder\n"); return NULL; } // create URL to folder // bundleURLOpenGL = CFURLCreateFromFSRef (kCFAllocatorDefault, &fileRef); if (!bundleURLOpenGL) { printfDebug("Could create framework URL\n"); return NULL; } bundle_ref = CFBundleCreate(kCFAllocatorDefault,bundleURLOpenGL); CFRelease (bundleURLOpenGL); if (bundle_ref == NULL) { printfDebug("Could not load framework\n"); return NULL; } // if the code was successfully loaded, look for our function. if (!CFBundleLoadExecutable(bundle_ref)) { printfDebug("Could not load MachO executable\n"); CFRelease(bundle_ref); return NULL; } return bundle_ref; } static void aglUnloadFramework(CFBundleRef f) { CFBundleUnloadExecutable(f); CFRelease(f); } #endif bool extgl_QueryExtension(JNIEnv *env, const GLubyte*extensions, const char *name) { const GLubyte *start; GLubyte *where, *terminator; if (extensions == NULL) { printfDebug("NULL extension string\n"); return false; } /* Extension names should not have spaces. */ where = (GLubyte *) strchr(name, ' '); if (where || *name == '\0') return false; /* It takes a bit of care to be fool-proof about parsing the OpenGL extensions string. Don't be fooled by sub-strings, etc. */ start = extensions; for (;;) { where = (GLubyte *) strstr((const char *) start, name); if (!where) break; terminator = where + strlen(name); if (where == start || *(where - 1) == ' ') if (*terminator == ' ' || *terminator == '\0') { return true; } start = terminator; } return false; } /*-----------------------------------------------------*/ /* AGL stuff BEGIN*/ /*-----------------------------------------------------*/ #ifdef _AGL bool extgl_InitAGL(JNIEnv *env) { aglChoosePixelFormat = (aglChoosePixelFormatPROC)extgl_GetProcAddress("aglChoosePixelFormat"); aglDestroyPixelFormat = (aglDestroyPixelFormatPROC)extgl_GetProcAddress("aglDestroyPixelFormat"); aglNextPixelFormat = (aglNextPixelFormatPROC)extgl_GetProcAddress("aglNextPixelFormat"); aglDescribePixelFormat = (aglDescribePixelFormatPROC)extgl_GetProcAddress("aglDescribePixelFormat"); aglDevicesOfPixelFormat = (aglDevicesOfPixelFormatPROC)extgl_GetProcAddress("aglDevicesOfPixelFormat"); aglQueryRendererInfo = (aglQueryRendererInfoPROC)extgl_GetProcAddress("aglQueryRendererInfo"); aglDestroyRendererInfo = (aglDestroyRendererInfoPROC)extgl_GetProcAddress("aglDestroyRendererInfo"); aglNextRendererInfo = (aglNextRendererInfoPROC)extgl_GetProcAddress("aglNextRendererInfo"); aglDescribeRenderer = (aglDescribeRendererPROC)extgl_GetProcAddress("aglDescribeRenderer"); aglCreateContext = (aglCreateContextPROC)extgl_GetProcAddress("aglCreateContext"); aglDestroyContext = (aglDestroyContextPROC)extgl_GetProcAddress("aglDestroyContext"); aglCopyContext = (aglCopyContextPROC)extgl_GetProcAddress("aglCopyContext"); aglUpdateContext = (aglUpdateContextPROC)extgl_GetProcAddress("aglUpdateContext"); aglSetCurrentContext = (aglSetCurrentContextPROC)extgl_GetProcAddress("aglSetCurrentContext"); aglGetCurrentContext = (aglGetCurrentContextPROC)extgl_GetProcAddress("aglGetCurrentContext"); aglSetDrawable = (aglSetDrawablePROC)extgl_GetProcAddress("aglSetDrawable"); aglSetOffScreen = (aglSetOffScreenPROC)extgl_GetProcAddress("aglSetOffScreen"); aglSetFullScreen = (aglSetFullScreenPROC)extgl_GetProcAddress("aglSetFullScreen"); aglGetDrawable = (aglGetDrawablePROC)extgl_GetProcAddress("aglGetDrawable"); aglSetVirtualScreen = (aglSetVirtualScreenPROC)extgl_GetProcAddress("aglSetVirtualScreen"); aglGetVirtualScreen = (aglGetVirtualScreenPROC)extgl_GetProcAddress("aglGetVirtualScreen"); aglGetVersion = (aglGetVersionPROC)extgl_GetProcAddress("aglGetVersion"); aglSwapBuffers = (aglSwapBuffersPROC)extgl_GetProcAddress("aglSwapBuffers"); aglEnable = (aglEnablePROC)extgl_GetProcAddress("aglEnable"); aglDisable = (aglDisablePROC)extgl_GetProcAddress("aglDisable"); aglIsEnabled = (aglIsEnabledPROC)extgl_GetProcAddress("aglIsEnabled"); aglSetInteger = (aglSetIntegerPROC)extgl_GetProcAddress("aglSetInteger"); aglGetInteger = (aglGetIntegerPROC)extgl_GetProcAddress("aglGetInteger"); aglUseFont = (aglUseFontPROC)extgl_GetProcAddress("aglUseFont"); aglGetError = (aglGetErrorPROC)extgl_GetProcAddress("aglGetError"); aglErrorString = (aglErrorStringPROC)extgl_GetProcAddress("aglErrorString"); aglResetLibrary = (aglResetLibraryPROC)extgl_GetProcAddress("aglResetLibrary"); aglSurfaceTexture = (aglSurfaceTexturePROC)extgl_GetProcAddress("aglSurfaceTexture"); return !extgl_error; // Split out AGL into extgl_agl.cpp like wgl and glx and replace with InitializeFunctions } #endif /*-----------------------------------------------------*/ /* AGL stuff END*/ /*-----------------------------------------------------*/ #ifdef _AGL bool extgl_Open(void) { if (opengl_bundle_ref != NULL) return true; opengl_bundle_ref = loadBundle("\pOpenGL.framework"); if (opengl_bundle_ref == NULL) return false; agl_bundle_ref = loadBundle("\pAGL.framework"); if (agl_bundle_ref == NULL) { aglUnloadFramework(opengl_bundle_ref); return false; } return true; } #endif #ifdef _X11 bool extgl_Open() { if (lib_gl_handle != NULL) return true; lib_gl_handle = dlopen("libGL.so.1", RTLD_LAZY | RTLD_GLOBAL); if (lib_gl_handle == NULL) { printfDebug("Error loading libGL.so.1: %s\n", dlerror... [truncated message content] |