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
|
4
(21) |
5
(8) |
6
|
7
(1) |
|
8
(24) |
9
|
10
(2) |
11
(1) |
12
(2) |
13
|
14
|
|
15
(25) |
16
(1) |
17
(8) |
18
(7) |
19
(2) |
20
|
21
|
|
22
|
23
(7) |
24
(6) |
25
(3) |
26
(8) |
27
(2) |
28
(1) |
|
29
(3) |
|
|
|
|
|
|
|
From: <ma...@us...> - 2004-02-04 22:17:23
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/nv In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5108/opengl/nv Modified Files: NVFragmentProgram.java NVProgram.java NVVertexProgram.java Log Message: formatting issues Index: NVFragmentProgram.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/nv/NVFragmentProgram.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- NVFragmentProgram.java 4 Feb 2004 22:04:27 -0000 1.4 +++ NVFragmentProgram.java 4 Feb 2004 22:14:39 -0000 1.5 @@ -1,100 +1 @@ -/* - * Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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. - */ -/* - * Created by LWJGL. - * User: spasi - * Date: 2003-11-28 - * Time: 18:59:45 - */ - -package org.lwjgl.opengl.nv; - -import java.nio.ByteBuffer; -import java.nio.FloatBuffer; - - - -public class NVFragmentProgram extends NVProgram { - - /* - Accepted by the <cap> parameter of Disable, Enable, and IsEnabled, by the - <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev, - and by the <target> parameter of BindProgramNV, LoadProgramNV, - ProgramLocalParameter4dARB, ProgramLocalParameter4dvARB, - ProgramLocalParameter4fARB, ProgramLocalParameter4fvARB, - GetProgramLocalParameterdvARB, and GetProgramLocalParameterfvARB: - */ - public static final int GL_FRAGMENT_PROGRAM_NV = 0x8870; - - /* - Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, - and GetDoublev: - */ - public static final int GL_MAX_TEXTURE_COORDS_NV = 0x8871; - public static final int GL_MAX_TEXTURE_IMAGE_UNITS_NV = 0x8872; - public static final int GL_FRAGMENT_PROGRAM_BINDING_NV = 0x8873; - public static final int GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV = 0x8868; - - // --------------------------- - public static void glProgramNamedParameter4fNV(int id, ByteBuffer name, float x, float y, float z, - float w) { - nglProgramNamedParameter4fNV(id, name.remaining(), name, name.position(), x, y, z, w); - } - - private static native void nglProgramNamedParameter4fNV(int id, int length, ByteBuffer name, - int nameOffset, float x, float y, float z, - float w); - // --------------------------- - - // --------------------------- - public static void glGetProgramNamedParameterNV(int id, ByteBuffer name, FloatBuffer params) { - assert params.remaining() >= 4: "<params> must have 4 floats available."; - nglGetProgramNamedParameterfvNV(id, name.remaining(), name, name.position(), params, - params.position()); - } - - private static native void nglGetProgramNamedParameterfvNV(int id, int length, ByteBuffer name, - int nameOffset, FloatBuffer params, - int paramsOffset); - // --------------------------- - - public static native void glProgramLocalParameter4fARB(int target, int index, float x, float y, float z, float w); - - // --------------------------- - public static void glGetProgramLocalParameterARB(int target, int index, FloatBuffer params) { - assert params.remaining() >= 4: "<params> must have 4 floats available."; - nglGetProgramLocalParameterfvARB(target, index, params, params.position()); - } - - private static native void nglGetProgramLocalParameterfvARB(int target, int index, FloatBuffer params, int params_offset); - // --------------------------- -} +/* * Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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. */ /* * Created by LWJGL. * User: spasi * Date: 2003-11-28 * Time: 18:59:45 */ package org.lwjgl.opengl.nv; import java.nio.ByteBuffer; import java.nio.FloatBuffer; public class NVFragmentProgram extends NVProgram { /* Accepted by the <cap> parameter of Disable, Enable, and IsEnabled, by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev, and by the <target> parameter of BindProgramNV, LoadProgramNV, ProgramLocalParameter4dARB, ProgramLocalParameter4dvARB, ProgramLocalParameter4fARB, ProgramLocalParameter4fvARB, GetProgramLocalParameterdvARB, and GetProgramLocalParameterfvARB: */ public static final int GL_FRAGMENT_PROGRAM_NV = 0x8870; /* Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev: */ public static final int GL_MAX_TEXTURE_COORDS_NV = 0x8871; public static final int GL_MAX_TEXTURE_IMAGE_UNITS_NV = 0x8872; public static final int GL_FRAGMENT_PROGRAM_BINDING_NV = 0x8873; public static final int GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV = 0x8868; // --------------------------- public static void glProgramNamedParameter4fNV(int id, ByteBuffer name, float x, float y, float z, float w) { nglProgramNamedParameter4fNV(id, name.remaining(), name, name.position(), x, y, z, w); } private static native void nglProgramNamedParameter4fNV( int id, int length, ByteBuffer name, int nameOffset, float x, float y, float z, float w); // --------------------------- // --------------------------- public static void glGetProgramNamedParameterNV(int id, ByteBuffer name, FloatBuffer params) { assert params.remaining() >= 4 : "<params> must have 4 floats available."; nglGetProgramNamedParameterfvNV(id, name.remaining(), name, name.position(), params, params.position()); } private static native void nglGetProgramNamedParameterfvNV( int id, int length, ByteBuffer name, int nameOffset, FloatBuffer params, int paramsOffset); // --------------------------- public static native void glProgramLocalParameter4fARB(int target, int index, float x, float y, float z, float w); // --------------------------- public static void glGetProgramLocalParameterARB(int target, int index, FloatBuffer params) { assert params.remaining() >= 4 : "<params> must have 4 floats available."; nglGetProgramLocalParameterfvARB(target, index, params, params.position()); } private static native void nglGetProgramLocalParameterfvARB( int target, int index, FloatBuffer params, int params_offset); // --------------------------- } \ No newline at end of file Index: NVProgram.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/nv/NVProgram.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- NVProgram.java 20 Jan 2004 08:37:16 -0000 1.1 +++ NVProgram.java 4 Feb 2004 22:14:39 -0000 1.2 @@ -1,130 +1 @@ -/* - * Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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. - */ -/* - * Created by LWJGL. - * User: spasi - * Date: 2003-11-28 - * Time: 18:39:30 - */ - -package org.lwjgl.opengl.nv; - -import java.nio.ByteBuffer; -import java.nio.Buffer; -import java.nio.IntBuffer; - -class NVProgram { - - /* - Accepted by the <pname> parameter of GetProgramivNV: - */ - public static final int GL_PROGRAM_TARGET_NV = 0x8646; - public static final int GL_PROGRAM_LENGTH_NV = 0x8627; - public static final int GL_PROGRAM_RESIDENT_NV = 0x8647; - - /* - Accepted by the <pname> parameter of GetProgramStringNV: - */ - public static final int GL_PROGRAM_STRING_NV = 0x8628; - - /* - Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, - GetFloatv, and GetDoublev: - */ - public static final int GL_PROGRAM_ERROR_POSITION_NV = 0x864B; - - /* - Accepted by the <name> parameter of GetString: - */ - public static final int GL_PROGRAM_ERROR_STRING_NV = 0x8874; - - // --------------------------- - public static void glLoadProgramNV(int target, int programID, ByteBuffer string) { - nglLoadProgramNV(target, programID, string.remaining(), string, string.position()); - } - - private static native void nglLoadProgramNV(int target, int programID, int length, Buffer string, int stringOffset); - // --------------------------- - - public static native void glBindProgramNV(int target, int programID); - - // --------------------------- - public static void glDeleteProgramsNV(IntBuffer programs) { - nglDeleteProgramsNV(programs.remaining(), programs, programs.position()); - } - - private static native void nglDeleteProgramsNV(int n, IntBuffer programs, int programsOffset); - // --------------------------- - - // --------------------------- - public static void glGenProgramsNV(IntBuffer programs) { - nglGenProgramsNV(programs.remaining(), programs, programs.position()); - } - - private static native void nglGenProgramsNV(int n, IntBuffer programs, int programsOffset); - // --------------------------- - - // --------------------------- - public static void glGetProgramNV(int programID, int parameterName, IntBuffer params) { - nglGetProgramivNV(programID, parameterName, params, params.position()); - } - - private static native void nglGetProgramivNV(int programID, int parameterName, IntBuffer params, int paramsOffset); - // --------------------------- - - // --------------------------- - public static void glGetProgramStringNV(int programID, int parameterName, ByteBuffer paramString) { - nglGetProgramStringNV(programID, parameterName, paramString, paramString.position()); - } - - private static native void nglGetProgramStringNV(int programID, int parameterName, Buffer paramString, int paramStringOffset); - // --------------------------- - - public static native boolean glIsProgramNV(int programID); - - // --------------------------- - public static boolean glAreProgramsResidentNV(IntBuffer programIDs, ByteBuffer programResidences) { - assert programIDs.remaining() == programResidences.remaining(): "programIDs.remaining() != programResidences.remaining()"; - return nglAreProgramsResidentNV(programIDs.remaining(), programIDs, programIDs.position(), programResidences, programResidences.position()); - } - - private static native boolean nglAreProgramsResidentNV(int n, IntBuffer programIDs, int programIDsOffset, ByteBuffer programResidences, int programResidencesOffset); - // --------------------------- - - // --------------------------- - public static void glRequestResidentProgramsNV(IntBuffer programIDs) { - nglRequestResidentProgramsNV(programIDs.remaining(), programIDs, programIDs.position()); - } - - private static native void nglRequestResidentProgramsNV(int n, IntBuffer programIDs, int programIDsOffset); - // --------------------------- -} +/* * Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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. */ /* * Created by LWJGL. * User: spasi * Date: 2003-11-28 * Time: 18:39:30 */ package org.lwjgl.opengl.nv; import java.nio.ByteBuffer; import java.nio.Buffer; import java.nio.IntBuffer; class NVProgram { /* Accepted by the <pname> parameter of GetProgramivNV: */ public static final int GL_PROGRAM_TARGET_NV = 0x8646; public static final int GL_PROGRAM_LENGTH_NV = 0x8627; public static final int GL_PROGRAM_RESIDENT_NV = 0x8647; /* Accepted by the <pname> parameter of GetProgramStringNV: */ public static final int GL_PROGRAM_STRING_NV = 0x8628; /* Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev: */ public static final int GL_PROGRAM_ERROR_POSITION_NV = 0x864B; /* Accepted by the <name> parameter of GetString: */ public static final int GL_PROGRAM_ERROR_STRING_NV = 0x8874; // --------------------------- public static void glLoadProgramNV(int target, int programID, ByteBuffer string) { nglLoadProgramNV(target, programID, string.remaining(), string, string.position()); } private static native void nglLoadProgramNV(int target, int programID, int length, Buffer string, int stringOffset); // --------------------------- public static native void glBindProgramNV(int target, int programID); // --------------------------- public static void glDeleteProgramsNV(IntBuffer programs) { nglDeleteProgramsNV(programs.remaining(), programs, programs.position()); } private static native void nglDeleteProgramsNV(int n, IntBuffer programs, int programsOffset); // --------------------------- // --------------------------- public static void glGenProgramsNV(IntBuffer programs) { nglGenProgramsNV(programs.remaining(), programs, programs.position()); } private static native void nglGenProgramsNV(int n, IntBuffer programs, int programsOffset); // --------------------------- // --------------------------- public static void glGetProgramNV(int programID, int parameterName, IntBuffer params) { nglGetProgramivNV(programID, parameterName, params, params.position()); } private static native void nglGetProgramivNV(int programID, int parameterName, IntBuffer params, int paramsOffset); // --------------------------- // --------------------------- public static void glGetProgramStringNV(int programID, int parameterName, ByteBuffer paramString) { nglGetProgramStringNV(programID, parameterName, paramString, paramString.position()); } private static native void nglGetProgramStringNV( int programID, int parameterName, Buffer paramString, int paramStringOffset); // --------------------------- public static native boolean glIsProgramNV(int programID); // --------------------------- public static boolean glAreProgramsResidentNV(IntBuffer programIDs, ByteBuffer programResidences) { assert programIDs.remaining() == programResidences.remaining() : "programIDs.remaining() != programResidences.remaining()"; return nglAreProgramsResidentNV( programIDs.remaining(), programIDs, programIDs.position(), programResidences, programResidences.position()); } private static native boolean nglAreProgramsResidentNV( int n, IntBuffer programIDs, int programIDsOffset, ByteBuffer programResidences, int programResidencesOffset); // --------------------------- // --------------------------- public static void glRequestResidentProgramsNV(IntBuffer programIDs) { nglRequestResidentProgramsNV(programIDs.remaining(), programIDs, programIDs.position()); } private static native void nglRequestResidentProgramsNV(int n, IntBuffer programIDs, int programIDsOffset); // --------------------------- } \ No newline at end of file Index: NVVertexProgram.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/nv/NVVertexProgram.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- NVVertexProgram.java 20 Jan 2004 11:19:12 -0000 1.7 +++ NVVertexProgram.java 4 Feb 2004 22:14:39 -0000 1.8 @@ -1,309 +1 @@ -/* - * Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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. - */ -/* - * Created by LWJGL. - * User: spasi - * Date: 2003-11-28 - * Time: 18:54:32 - */ - -package org.lwjgl.opengl.nv; - -import java.nio.*; - -import org.lwjgl.opengl.VBOTracker; -import org.lwjgl.opengl.GL11; - -public class NVVertexProgram extends NVProgram { - - /* - Accepted by the <cap> parameter of Disable, Enable, and IsEnabled, - and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, - and GetDoublev, and by the <target> parameter of BindProgramNV, - ExecuteProgramNV, GetProgramParameter[df]vNV, GetTrackMatrixivNV, - LoadProgramNV, ProgramParameter[s]4[df][v]NV, and TrackMatrixNV: - */ - - public static final int GL_VERTEX_PROGRAM_NV = 0x8620; - - /* - Accepted by the <cap> parameter of Disable, Enable, and IsEnabled, - and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, - and GetDoublev: - */ - public static final int GL_VERTEX_PROGRAM_POINT_SIZE_NV = 0x8642; - public static final int GL_VERTEX_PROGRAM_TWO_SIDE_NV = 0x8643; - - /* - Accepted by the <target> parameter of ExecuteProgramNV and - LoadProgramNV: - */ - public static final int GL_VERTEX_STATE_PROGRAM_NV = 0x8621; - - /* - Accepted by the <pname> parameter of GetVertexAttrib[dfi]vNV: - */ - public static final int GL_ATTRIB_ARRAY_SIZE_NV = 0x8623; - public static final int GL_ATTRIB_ARRAY_STRIDE_NV = 0x8624; - public static final int GL_ATTRIB_ARRAY_TYPE_NV = 0x8625; - public static final int GL_CURRENT_ATTRIB_NV = 0x8626; - - /* - Accepted by the <pname> parameter of GetProgramParameterfvNV - and GetProgramParameterdvNV: - */ - public static final int GL_PROGRAM_PARAMETER_NV = 0x8644; - - /* - Accepted by the <pname> parameter of GetVertexAttribPointervNV: - */ - public static final int GL_ATTRIB_ARRAY_POINTER_NV = 0x8645; - - - /* - Accepted by the <pname> parameter of GetTrackMatrixivNV: - */ - public static final int GL_TRACK_MATRIX_NV = 0x8648; - public static final int GL_TRACK_MATRIX_TRANSFORM_NV = 0x8649; - - /* - Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, - GetFloatv, and GetDoublev: - */ - public static final int GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV = 0x862E; - public static final int GL_MAX_TRACK_MATRICES_NV = 0x862F; - public static final int GL_CURRENT_MATRIX_STACK_DEPTH_NV = 0x8640; - public static final int GL_CURRENT_MATRIX_NV = 0x8641; - public static final int GL_VERTEX_PROGRAM_BINDING_NV = 0x864A; - - /* - Accepted by the <matrix> parameter of TrackMatrixNV: - */ - public static final int GL_MODELVIEW_PROJECTION_NV = 0x8629; - - /* - Accepted by the <matrix> parameter of TrackMatrixNV and by the - <mode> parameter of MatrixMode: - */ - public static final int GL_MATRIX0_NV = 0x8630; - public static final int GL_MATRIX1_NV = 0x8631; - public static final int GL_MATRIX2_NV = 0x8632; - public static final int GL_MATRIX3_NV = 0x8633; - public static final int GL_MATRIX4_NV = 0x8634; - public static final int GL_MATRIX5_NV = 0x8635; - public static final int GL_MATRIX6_NV = 0x8636; - public static final int GL_MATRIX7_NV = 0x8637; - - /* - Accepted by the <transform> parameter of TrackMatrixNV: - */ - public static final int GL_IDENTITY_NV = 0x862A; - public static final int GL_INVERSE_NV = 0x862B; - public static final int GL_TRANSPOSE_NV = 0x862C; - public static final int GL_INVERSE_TRANSPOSE_NV = 0x862D; - - /* - Accepted by the <array> parameter of EnableClientState and - DisableClientState, by the <cap> parameter of IsEnabled, and by - the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and - GetDoublev: - */ - public static final int GL_VERTEX_ATTRIB_ARRAY0_NV = 0x8650; - public static final int GL_VERTEX_ATTRIB_ARRAY1_NV = 0x8651; - public static final int GL_VERTEX_ATTRIB_ARRAY2_NV = 0x8652; - public static final int GL_VERTEX_ATTRIB_ARRAY3_NV = 0x8653; - public static final int GL_VERTEX_ATTRIB_ARRAY4_NV = 0x8654; - public static final int GL_VERTEX_ATTRIB_ARRAY5_NV = 0x8655; - public static final int GL_VERTEX_ATTRIB_ARRAY6_NV = 0x8656; - public static final int GL_VERTEX_ATTRIB_ARRAY7_NV = 0x8657; - public static final int GL_VERTEX_ATTRIB_ARRAY8_NV = 0x8658; - public static final int GL_VERTEX_ATTRIB_ARRAY9_NV = 0x8659; - public static final int GL_VERTEX_ATTRIB_ARRAY10_NV = 0x865A; - public static final int GL_VERTEX_ATTRIB_ARRAY11_NV = 0x865B; - public static final int GL_VERTEX_ATTRIB_ARRAY12_NV = 0x865C; - public static final int GL_VERTEX_ATTRIB_ARRAY13_NV = 0x865D; - public static final int GL_VERTEX_ATTRIB_ARRAY14_NV = 0x865E; - public static final int GL_VERTEX_ATTRIB_ARRAY15_NV = 0x865F; - - /* - Accepted by the <target> parameter of GetMapdv, GetMapfv, GetMapiv, - Map1d and Map1f and by the <cap> parameter of Enable, Disable, and - IsEnabled, and by the <pname> parameter of GetBooleanv, GetIntegerv, - GetFloatv, and GetDoublev: - */ - public static final int GL_MAP1_VERTEX_ATTRIB0_4_NV = 0x8660; - public static final int GL_MAP1_VERTEX_ATTRIB1_4_NV = 0x8661; - public static final int GL_MAP1_VERTEX_ATTRIB2_4_NV = 0x8662; - public static final int GL_MAP1_VERTEX_ATTRIB3_4_NV = 0x8663; - public static final int GL_MAP1_VERTEX_ATTRIB4_4_NV = 0x8664; - public static final int GL_MAP1_VERTEX_ATTRIB5_4_NV = 0x8665; - public static final int GL_MAP1_VERTEX_ATTRIB6_4_NV = 0x8666; - public static final int GL_MAP1_VERTEX_ATTRIB7_4_NV = 0x8667; - public static final int GL_MAP1_VERTEX_ATTRIB8_4_NV = 0x8668; - public static final int GL_MAP1_VERTEX_ATTRIB9_4_NV = 0x8669; - public static final int GL_MAP1_VERTEX_ATTRIB10_4_NV = 0x866A; - public static final int GL_MAP1_VERTEX_ATTRIB11_4_NV = 0x866B; - public static final int GL_MAP1_VERTEX_ATTRIB12_4_NV = 0x866C; - public static final int GL_MAP1_VERTEX_ATTRIB13_4_NV = 0x866D; - public static final int GL_MAP1_VERTEX_ATTRIB14_4_NV = 0x866E; - public static final int GL_MAP1_VERTEX_ATTRIB15_4_NV = 0x866F; - - /* - Accepted by the <target> parameter of GetMapdv, GetMapfv, GetMapiv, - Map2d and Map2f and by the <cap> parameter of Enable, Disable, and - IsEnabled, and by the <pname> parameter of GetBooleanv, GetIntegerv, - GetFloatv, and GetDoublev: - */ - public static final int GL_MAP2_VERTEX_ATTRIB0_4_NV = 0x8670; - public static final int GL_MAP2_VERTEX_ATTRIB1_4_NV = 0x8671; - public static final int GL_MAP2_VERTEX_ATTRIB2_4_NV = 0x8672; - public static final int GL_MAP2_VERTEX_ATTRIB3_4_NV = 0x8673; - public static final int GL_MAP2_VERTEX_ATTRIB4_4_NV = 0x8674; - public static final int GL_MAP2_VERTEX_ATTRIB5_4_NV = 0x8675; - public static final int GL_MAP2_VERTEX_ATTRIB6_4_NV = 0x8676; - public static final int GL_MAP2_VERTEX_ATTRIB7_4_NV = 0x8677; - public static final int GL_MAP2_VERTEX_ATTRIB8_4_NV = 0x8678; - public static final int GL_MAP2_VERTEX_ATTRIB9_4_NV = 0x8679; - public static final int GL_MAP2_VERTEX_ATTRIB10_4_NV = 0x867A; - public static final int GL_MAP2_VERTEX_ATTRIB11_4_NV = 0x867B; - public static final int GL_MAP2_VERTEX_ATTRIB12_4_NV = 0x867C; - public static final int GL_MAP2_VERTEX_ATTRIB13_4_NV = 0x867D; - public static final int GL_MAP2_VERTEX_ATTRIB14_4_NV = 0x867E; - public static final int GL_MAP2_VERTEX_ATTRIB15_4_NV = 0x867F; - - // --------------------------- - public static void glExecuteProgramNV(int target, int id, FloatBuffer params) { - assert params.remaining() >= 4: "<params> must have 4 floats available."; - nglExecuteProgramNV(target, id, params, params.position()); - } - - private static native void nglExecuteProgramNV(int target, int id, FloatBuffer params, int paramsOffset); - // --------------------------- - - // --------------------------- - public static void glGetProgramParameterNV(int target, int index, int parameterName, FloatBuffer params) { - assert params.remaining() >= 4: "<params> must have 4 floats available."; - nglGetProgramParameterfvNV(target, index, parameterName, params, params.position()); - } - - private static native void nglGetProgramParameterfvNV(int target, int index, int parameterName, FloatBuffer params, int paramsOffset); - // --------------------------- - - // --------------------------- - public static void glGetTrackMatrixNV(int target, int address, int parameterName, IntBuffer params) { - nglGetTrackMatrixivNV(target, address, parameterName, params, params.position()); - } - - private static native void nglGetTrackMatrixivNV(int target, int address, int parameterName, IntBuffer params, int paramsOffset); - // --------------------------- - - // --------------------------- - public static void glGetVertexAttribNV(int index, int parameterName, FloatBuffer params) { - nglGetVertexAttribfvNV(index, parameterName, params, params.position()); - } - - private static native void nglGetVertexAttribfvNV(int index, int parameterName, FloatBuffer params, int paramsOffset); - // --------------------------- - - // --------------------------- - public static void glGetVertexAttribNV(int index, int parameterName, IntBuffer params) { - nglGetVertexAttribivNV(index, parameterName, params, params.position()); - } - - private static native void nglGetVertexAttribivNV(int index, int parameterName, IntBuffer params, int paramsOffset); - // --------------------------- - - public static native ByteBuffer glGetVertexAttribPointerNV(int index, int parameterName, int size); - - public static native void glProgramParameter4fNV(int target, int index, float x, float y, float z, float w); - - - // --------------------------- - public static void glProgramParameters4NV(int target, int index, int count, FloatBuffer params) { - assert params.remaining() >= 4 * count: "<params> must have " + 4 * count + " floats available."; - nglProgramParameters4fvNV(target, index, count, params, params.position()); - } - - private static native void nglProgramParameters4fvNV(int target, int index, int count, FloatBuffer params, int paramsOffset); - // --------------------------- - - public static native void glTrackMatrixNV(int target, int address, int matrix, int transform); - - public static void glVertexAttribPointerNV(int index, int size, boolean unsigned, int stride, ByteBuffer buffer) { - assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; - nglVertexAttribPointerNV(index, size, unsigned ? GL11.GL_UNSIGNED_BYTE : GL11.GL_BYTE, stride, buffer, buffer.position()); - } - - public static void glVertexAttribPointerNV(int index, int size, boolean unsigned, int stride, ShortBuffer buffer) { - assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; - nglVertexAttribPointerNV(index, size, unsigned ? GL11.GL_UNSIGNED_SHORT : GL11.GL_SHORT, stride, buffer, buffer.position() << 1); - } - - public static void glVertexAttribPointerNV(int index, int size, int stride, FloatBuffer buffer) { - assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; - nglVertexAttribPointerNV(index, size, GL11.GL_FLOAT, stride, buffer, buffer.position() << 2); - } - - public static void glVertexAttribPointerNV(int index, int size, boolean unsigned, int stride, IntBuffer buffer) { - assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; - nglVertexAttribPointerNV(index, size, unsigned ? GL11.GL_UNSIGNED_INT : GL11.GL_INT, stride, buffer, buffer.position() << 2); - } - - private static native void nglVertexAttribPointerNV(int index, int size, int type, int stride, Buffer buffer, int bufferOffset); - - // --------------------------- - public static void glVertexAttribPointerNV(int index, int size, int type, int stride, int bufferOffset) { - assert VBOTracker.getVBOArrayStack().getState() != 0: "Cannot use int offsets when VBO is disabled"; - nglVertexAttribPointerNVVBO(index, size, type, stride, bufferOffset); - } - - private static native void nglVertexAttribPointerNVVBO(int index, int size, int type, int stride, int bufferOffset); - // --------------------------- - - public static native void glVertexAttrib1sNV(int index, short x); - - public static native void glVertexAttrib1fNV(int index, float x); - - public static native void glVertexAttrib2sNV(int index, short x, short y); - - public static native void glVertexAttrib2fNV(int index, float x, float y); - - public static native void glVertexAttrib3sNV(int index, short x, short y, short z); - - public static native void glVertexAttrib3fNV(int index, float x, float y, float z); - - public static native void glVertexAttrib4sNV(int index, short x, short y, short z, short w); - - public static native void glVertexAttrib4fNV(int index, float x, float y, float z, float w); - - public static native void glVertexAttrib4ubNV(int index, byte x, byte y, byte z, byte w); -} +/* * Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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. */ /* * Created by LWJGL. * User: spasi * Date: 2003-11-28 * Time: 18:54:32 */ package org.lwjgl.opengl.nv; import java.nio.*; import org.lwjgl.opengl.VBOTracker; import org.lwjgl.opengl.GL11; public class NVVertexProgram extends NVProgram { /* Accepted by the <cap> parameter of Disable, Enable, and IsEnabled, and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev, and by the <target> parameter of BindProgramNV, ExecuteProgramNV, GetProgramParameter[df]vNV, GetTrackMatrixivNV, LoadProgramNV, ProgramParameter[s]4[df][v]NV, and TrackMatrixNV: */ public static final int GL_VERTEX_PROGRAM_NV = 0x8620; /* Accepted by the <cap> parameter of Disable, Enable, and IsEnabled, and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev: */ public static final int GL_VERTEX_PROGRAM_POINT_SIZE_NV = 0x8642; public static final int GL_VERTEX_PROGRAM_TWO_SIDE_NV = 0x8643; /* Accepted by the <target> parameter of ExecuteProgramNV and LoadProgramNV: */ public static final int GL_VERTEX_STATE_PROGRAM_NV = 0x8621; /* Accepted by the <pname> parameter of GetVertexAttrib[dfi]vNV: */ public static final int GL_ATTRIB_ARRAY_SIZE_NV = 0x8623; public static final int GL_ATTRIB_ARRAY_STRIDE_NV = 0x8624; public static final int GL_ATTRIB_ARRAY_TYPE_NV = 0x8625; public static final int GL_CURRENT_ATTRIB_NV = 0x8626; /* Accepted by the <pname> parameter of GetProgramParameterfvNV and GetProgramParameterdvNV: */ public static final int GL_PROGRAM_PARAMETER_NV = 0x8644; /* Accepted by the <pname> parameter of GetVertexAttribPointervNV: */ public static final int GL_ATTRIB_ARRAY_POINTER_NV = 0x8645; /* Accepted by the <pname> parameter of GetTrackMatrixivNV: */ public static final int GL_TRACK_MATRIX_NV = 0x8648; public static final int GL_TRACK_MATRIX_TRANSFORM_NV = 0x8649; /* Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev: */ public static final int GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV = 0x862E; public static final int GL_MAX_TRACK_MATRICES_NV = 0x862F; public static final int GL_CURRENT_MATRIX_STACK_DEPTH_NV = 0x8640; public static final int GL_CURRENT_MATRIX_NV = 0x8641; public static final int GL_VERTEX_PROGRAM_BINDING_NV = 0x864A; /* Accepted by the <matrix> parameter of TrackMatrixNV: */ public static final int GL_MODELVIEW_PROJECTION_NV = 0x8629; /* Accepted by the <matrix> parameter of TrackMatrixNV and by the <mode> parameter of MatrixMode: */ public static final int GL_MATRIX0_NV = 0x8630; public static final int GL_MATRIX1_NV = 0x8631; public static final int GL_MATRIX2_NV = 0x8632; public static final int GL_MATRIX3_NV = 0x8633; public static final int GL_MATRIX4_NV = 0x8634; public static final int GL_MATRIX5_NV = 0x8635; public static final int GL_MATRIX6_NV = 0x8636; public static final int GL_MATRIX7_NV = 0x8637; /* Accepted by the <transform> parameter of TrackMatrixNV: */ public static final int GL_IDENTITY_NV = 0x862A; public static final int GL_INVERSE_NV = 0x862B; public static final int GL_TRANSPOSE_NV = 0x862C; public static final int GL_INVERSE_TRANSPOSE_NV = 0x862D; /* Accepted by the <array> parameter of EnableClientState and DisableClientState, by the <cap> parameter of IsEnabled, and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev: */ public static final int GL_VERTEX_ATTRIB_ARRAY0_NV = 0x8650; public static final int GL_VERTEX_ATTRIB_ARRAY1_NV = 0x8651; public static final int GL_VERTEX_ATTRIB_ARRAY2_NV = 0x8652; public static final int GL_VERTEX_ATTRIB_ARRAY3_NV = 0x8653; public static final int GL_VERTEX_ATTRIB_ARRAY4_NV = 0x8654; public static final int GL_VERTEX_ATTRIB_ARRAY5_NV = 0x8655; public static final int GL_VERTEX_ATTRIB_ARRAY6_NV = 0x8656; public static final int GL_VERTEX_ATTRIB_ARRAY7_NV = 0x8657; public static final int GL_VERTEX_ATTRIB_ARRAY8_NV = 0x8658; public static final int GL_VERTEX_ATTRIB_ARRAY9_NV = 0x8659; public static final int GL_VERTEX_ATTRIB_ARRAY10_NV = 0x865A; public static final int GL_VERTEX_ATTRIB_ARRAY11_NV = 0x865B; public static final int GL_VERTEX_ATTRIB_ARRAY12_NV = 0x865C; public static final int GL_VERTEX_ATTRIB_ARRAY13_NV = 0x865D; public static final int GL_VERTEX_ATTRIB_ARRAY14_NV = 0x865E; public static final int GL_VERTEX_ATTRIB_ARRAY15_NV = 0x865F; /* Accepted by the <target> parameter of GetMapdv, GetMapfv, GetMapiv, Map1d and Map1f and by the <cap> parameter of Enable, Disable, and IsEnabled, and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev: */ public static final int GL_MAP1_VERTEX_ATTRIB0_4_NV = 0x8660; public static final int GL_MAP1_VERTEX_ATTRIB1_4_NV = 0x8661; public static final int GL_MAP1_VERTEX_ATTRIB2_4_NV = 0x8662; public static final int GL_MAP1_VERTEX_ATTRIB3_4_NV = 0x8663; public static final int GL_MAP1_VERTEX_ATTRIB4_4_NV = 0x8664; public static final int GL_MAP1_VERTEX_ATTRIB5_4_NV = 0x8665; public static final int GL_MAP1_VERTEX_ATTRIB6_4_NV = 0x8666; public static final int GL_MAP1_VERTEX_ATTRIB7_4_NV = 0x8667; public static final int GL_MAP1_VERTEX_ATTRIB8_4_NV = 0x8668; public static final int GL_MAP1_VERTEX_ATTRIB9_4_NV = 0x8669; public static final int GL_MAP1_VERTEX_ATTRIB10_4_NV = 0x866A; public static final int GL_MAP1_VERTEX_ATTRIB11_4_NV = 0x866B; public static final int GL_MAP1_VERTEX_ATTRIB12_4_NV = 0x866C; public static final int GL_MAP1_VERTEX_ATTRIB13_4_NV = 0x866D; public static final int GL_MAP1_VERTEX_ATTRIB14_4_NV = 0x866E; public static final int GL_MAP1_VERTEX_ATTRIB15_4_NV = 0x866F; /* Accepted by the <target> parameter of GetMapdv, GetMapfv, GetMapiv, Map2d and Map2f and by the <cap> parameter of Enable, Disable, and IsEnabled, and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev: */ public static final int GL_MAP2_VERTEX_ATTRIB0_4_NV = 0x8670; public static final int GL_MAP2_VERTEX_ATTRIB1_4_NV = 0x8671; public static final int GL_MAP2_VERTEX_ATTRIB2_4_NV = 0x8672; public static final int GL_MAP2_VERTEX_ATTRIB3_4_NV = 0x8673; public static final int GL_MAP2_VERTEX_ATTRIB4_4_NV = 0x8674; public static final int GL_MAP2_VERTEX_ATTRIB5_4_NV = 0x8675; public static final int GL_MAP2_VERTEX_ATTRIB6_4_NV = 0x8676; public static final int GL_MAP2_VERTEX_ATTRIB7_4_NV = 0x8677; public static final int GL_MAP2_VERTEX_ATTRIB8_4_NV = 0x8678; public static final int GL_MAP2_VERTEX_ATTRIB9_4_NV = 0x8679; public static final int GL_MAP2_VERTEX_ATTRIB10_4_NV = 0x867A; public static final int GL_MAP2_VERTEX_ATTRIB11_4_NV = 0x867B; public static final int GL_MAP2_VERTEX_ATTRIB12_4_NV = 0x867C; public static final int GL_MAP2_VERTEX_ATTRIB13_4_NV = 0x867D; public static final int GL_MAP2_VERTEX_ATTRIB14_4_NV = 0x867E; public static final int GL_MAP2_VERTEX_ATTRIB15_4_NV = 0x867F; // --------------------------- public static void glExecuteProgramNV(int target, int id, FloatBuffer params) { assert params.remaining() >= 4 : "<params> must have 4 floats available."; nglExecuteProgramNV(target, id, params, params.position()); } private static native void nglExecuteProgramNV(int target, int id, FloatBuffer params, int paramsOffset); // --------------------------- // --------------------------- public static void glGetProgramParameterNV(int target, int index, int parameterName, FloatBuffer params) { assert params.remaining() >= 4 : "<params> must have 4 floats available."; nglGetProgramParameterfvNV(target, index, parameterName, params, params.position()); } private static native void nglGetProgramParameterfvNV( int target, int index, int parameterName, FloatBuffer params, int paramsOffset); // --------------------------- // --------------------------- public static void glGetTrackMatrixNV(int target, int address, int parameterName, IntBuffer params) { nglGetTrackMatrixivNV(target, address, parameterName, params, params.position()); } private static native void nglGetTrackMatrixivNV( int target, int address, int parameterName, IntBuffer params, int paramsOffset); // --------------------------- // --------------------------- public static void glGetVertexAttribNV(int index, int parameterName, FloatBuffer params) { nglGetVertexAttribfvNV(index, parameterName, params, params.position()); } private static native void nglGetVertexAttribfvNV(int index, int parameterName, FloatBuffer params, int paramsOffset); // --------------------------- // --------------------------- public static void glGetVertexAttribNV(int index, int parameterName, IntBuffer params) { nglGetVertexAttribivNV(index, parameterName, params, params.position()); } private static native void nglGetVertexAttribivNV(int index, int parameterName, IntBuffer params, int paramsOffset); // --------------------------- public static native ByteBuffer glGetVertexAttribPointerNV(int index, int parameterName, int size); public static native void glProgramParameter4fNV(int target, int index, float x, float y, float z, float w); // --------------------------- public static void glProgramParameters4NV(int target, int index, int count, FloatBuffer params) { assert params.remaining() >= 4 * count : "<params> must have " + 4 * count + " floats available."; nglProgramParameters4fvNV(target, index, count, params, params.position()); } private static native void nglProgramParameters4fvNV( int target, int index, int count, FloatBuffer params, int paramsOffset); // --------------------------- public static native void glTrackMatrixNV(int target, int address, int matrix, int transform); public static void glVertexAttribPointerNV(int index, int size, boolean unsigned, int stride, ByteBuffer buffer) { assert VBOTracker.getVBOArrayStack().getState() == 0 : "Cannot use Buffers when VBO is enabled"; nglVertexAttribPointerNV( index, size, unsigned ? GL11.GL_UNSIGNED_BYTE : GL11.GL_BYTE, stride, buffer, buffer.position()); } public static void glVertexAttribPointerNV(int index, int size, boolean unsigned, int stride, ShortBuffer buffer) { assert VBOTracker.getVBOArrayStack().getState() == 0 : "Cannot use Buffers when VBO is enabled"; nglVertexAttribPointerNV( index, size, unsigned ? GL11.GL_UNSIGNED_SHORT : GL11.GL_SHORT, stride, buffer, buffer.position() << 1); } public static void glVertexAttribPointerNV(int index, int size, int stride, FloatBuffer buffer) { assert VBOTracker.getVBOArrayStack().getState() == 0 : "Cannot use Buffers when VBO is enabled"; nglVertexAttribPointerNV(index, size, GL11.GL_FLOAT, stride, buffer, buffer.position() << 2); } public static void glVertexAttribPointerNV(int index, int size, boolean unsigned, int stride, IntBuffer buffer) { assert VBOTracker.getVBOArrayStack().getState() == 0 : "Cannot use Buffers when VBO is enabled"; nglVertexAttribPointerNV( index, size, unsigned ? GL11.GL_UNSIGNED_INT : GL11.GL_INT, stride, buffer, buffer.position() << 2); } private static native void nglVertexAttribPointerNV( int index, int size, int type, int stride, Buffer buffer, int bufferOffset); // --------------------------- public static void glVertexAttribPointerNV(int index, int size, int type, int stride, int bufferOffset) { assert VBOTracker.getVBOArrayStack().getState() != 0 : "Cannot use int offsets when VBO is disabled"; nglVertexAttribPointerNVVBO(index, size, type, stride, bufferOffset); } private static native void nglVertexAttribPointerNVVBO(int index, int size, int type, int stride, int bufferOffset); // --------------------------- public static native void glVertexAttrib1sNV(int index, short x); public static native void glVertexAttrib1fNV(int index, float x); public static native void glVertexAttrib2sNV(int index, short x, short y); public static native void glVertexAttrib2fNV(int index, float x, float y); public static native void glVertexAttrib3sNV(int index, short x, short y, short z); public static native void glVertexAttrib3fNV(int index, float x, float y, float z); public static native void glVertexAttrib4sNV(int index, short x, short y, short z, short w); public static native void glVertexAttrib4fNV(int index, float x, float y, float z, float w); public static native void glVertexAttrib4ubNV(int index, byte x, byte y, byte z, byte w); } \ No newline at end of file |
|
From: <ma...@us...> - 2004-02-04 22:17:23
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/arb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5108/opengl/arb Modified Files: ARBFragmentProgram.java Log Message: formatting issues Index: ARBFragmentProgram.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/arb/ARBFragmentProgram.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ARBFragmentProgram.java 20 Jan 2004 08:37:16 -0000 1.3 +++ ARBFragmentProgram.java 4 Feb 2004 22:14:39 -0000 1.4 @@ -1,76 +1 @@ -/* - * Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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. - */ -/* - * Created by zDimensions. - * User: spasi - * Date: 2003-11-28 - * Time: 16:41:02 - */ - -package org.lwjgl.opengl.arb; - -public class ARBFragmentProgram extends ARBProgram { - - /* - * Accepted by the <cap> parameter of Disable, Enable, and IsEnabled, - * by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, - * and GetDoublev, and by the <target> parameter of ProgramStringARB, - * BindProgramARB, ProgramEnvParameter4[df][v]ARB, - * ProgramLocalParameter4[df][v]ARB, GetProgramEnvParameter[df]vARB, - * GetProgramLocalParameter[df]vARB, GetProgramivARB and - * GetProgramStringARB. - */ - public static final int GL_FRAGMENT_PROGRAM_ARB = 0x8804; - - /* - * Accepted by the <pname> parameter of GetProgramivARB: - */ - public static final int GL_PROGRAM_ALU_INSTRUCTIONS_ARB = 0x8805; - public static final int GL_PROGRAM_TEX_INSTRUCTIONS_ARB = 0x8806; - public static final int GL_PROGRAM_TEX_INDIRECTIONS_ARB = 0x8807; - public static final int GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB = 0x8808; - public static final int GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB = 0x8809; - public static final int GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB = 0x880A; - public static final int GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB = 0x880B; - public static final int GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB = 0x880C; - public static final int GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB = 0x880D; - public static final int GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB = 0x880E; - public static final int GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB = 0x880F; - public static final int GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB = 0x8810; - - /* - * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, - * GetFloatv, and GetDoublev: - */ - public static final int GL_MAX_TEXTURE_COORDS_ARB = 0x8871; - public static final int GL_MAX_TEXTURE_IMAGE_UNITS_ARB = 0x8872; -} +/* * Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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. */ /* * Created by zDimensions. * User: spasi * Date: 2003-11-28 * Time: 16:41:02 */ package org.lwjgl.opengl.arb; public class ARBFragmentProgram extends ARBProgram { /* * Accepted by the <cap> parameter of Disable, Enable, and IsEnabled, * by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, * and GetDoublev, and by the <target> parameter of ProgramStringARB, * BindProgramARB, ProgramEnvParameter4[df][v]ARB, * ProgramLocalParameter4[df][v]ARB, GetProgramEnvParameter[df]vARB, * GetProgramLocalParameter[df]vARB, GetProgramivARB and * GetProgramStringARB. */ public static final int GL_FRAGMENT_PROGRAM_ARB = 0x8804; /* * Accepted by the <pname> parameter of GetProgramivARB: */ public static final int GL_PROGRAM_ALU_INSTRUCTIONS_ARB = 0x8805; public static final int GL_PROGRAM_TEX_INSTRUCTIONS_ARB = 0x8806; public static final int GL_PROGRAM_TEX_INDIRECTIONS_ARB = 0x8807; public static final int GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB = 0x8808; public static final int GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB = 0x8809; public static final int GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB = 0x880A; public static final int GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB = 0x880B; public static final int GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB = 0x880C; public static final int GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB = 0x880D; public static final int GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB = 0x880E; public static final int GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB = 0x880F; public static final int GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB = 0x8810; /* * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, * GetFloatv, and GetDoublev: */ public static final int GL_MAX_TEXTURE_COORDS_ARB = 0x8871; public static final int GL_MAX_TEXTURE_IMAGE_UNITS_ARB = 0x8872; } \ No newline at end of file |
|
From: <ma...@us...> - 2004-02-04 22:08:48
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2466 Modified Files: Window.java Log Message: license Index: Window.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/Window.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- Window.java 25 Nov 2003 22:34:04 -0000 1.18 +++ Window.java 4 Feb 2004 22:06:18 -0000 1.19 @@ -1,9 +1,35 @@ -/* - * Created on 27-Mar-2003 +/* + * Copyright (c) 2002-2004 Light Weight Java Game Library 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. * - * To change this generated comment go to - * Window>Preferences>Java>Code Generation>Code Template + * * 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 'Light Weight Java Game Library' 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. */ + package org.lwjgl.opengl; /** |
|
From: <ma...@us...> - 2004-02-04 22:06:58
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/arb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1794/org/lwjgl/opengl/arb Modified Files: ARBMatrixPalette.java ARBVertexBlend.java ARBVertexProgram.java Log Message: bugger off warnings Index: ARBMatrixPalette.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/arb/ARBMatrixPalette.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- ARBMatrixPalette.java 4 Feb 2004 00:42:29 -0000 1.8 +++ ARBMatrixPalette.java 4 Feb 2004 22:04:26 -0000 1.9 @@ -45,7 +45,6 @@ import java.nio.IntBuffer; import org.lwjgl.opengl.BufferChecks; -import org.lwjgl.opengl.VBOTracker; import org.lwjgl.opengl.GL11; public class ARBMatrixPalette { Index: ARBVertexBlend.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/arb/ARBVertexBlend.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- ARBVertexBlend.java 4 Feb 2004 00:42:29 -0000 1.8 +++ ARBVertexBlend.java 4 Feb 2004 22:04:26 -0000 1.9 @@ -46,7 +46,6 @@ import java.nio.FloatBuffer; import org.lwjgl.opengl.BufferChecks; -import org.lwjgl.opengl.VBOTracker; import org.lwjgl.opengl.GL11; public class ARBVertexBlend { Index: ARBVertexProgram.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/arb/ARBVertexProgram.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- ARBVertexProgram.java 4 Feb 2004 00:42:29 -0000 1.9 +++ ARBVertexProgram.java 4 Feb 2004 22:04:26 -0000 1.10 @@ -40,7 +40,6 @@ import org.lwjgl.opengl.BufferChecks; import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.VBOTracker; import java.nio.Buffer; import java.nio.ByteBuffer; import java.nio.ShortBuffer; |
|
From: <ma...@us...> - 2004-02-04 22:06:58
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/nv In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1794/org/lwjgl/opengl/nv Modified Files: NVFragmentProgram.java Log Message: bugger off warnings Index: NVFragmentProgram.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/nv/NVFragmentProgram.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- NVFragmentProgram.java 31 Jan 2004 15:29:57 -0000 1.3 +++ NVFragmentProgram.java 4 Feb 2004 22:04:27 -0000 1.4 @@ -41,7 +41,7 @@ import java.nio.ByteBuffer; import java.nio.FloatBuffer; -import org.lwjgl.opengl.arb.ARBFragmentProgram; + public class NVFragmentProgram extends NVProgram { |
|
From: <ma...@us...> - 2004-02-04 22:06:58
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1794/org/lwjgl/opengl Modified Files: GL11.java Log Message: bugger off warnings Index: GL11.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/GL11.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- GL11.java 4 Feb 2004 00:42:29 -0000 1.4 +++ GL11.java 4 Feb 2004 22:04:26 -0000 1.5 @@ -38,8 +38,6 @@ import java.nio.FloatBuffer; import java.nio.DoubleBuffer; import java.nio.Buffer; -import java.util.HashMap; -import java.util.Map; /** * $Id$ |
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32007 Modified Files: FullScreenWindowedTest.java Game.java Grass.java PbufferTest.java VBOIndexTest.java VBOTest.java Log Message: removed usage of native glu using getters Index: FullScreenWindowedTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl/FullScreenWindowedTest.java,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- FullScreenWindowedTest.java 20 Jan 2004 11:19:12 -0000 1.23 +++ FullScreenWindowedTest.java 4 Feb 2004 21:56:58 -0000 1.24 @@ -34,6 +34,7 @@ import org.lwjgl.*; import org.lwjgl.input.*; import org.lwjgl.opengl.*; +import org.lwjgl.opengl.glu.GLU; import org.lwjgl.vector.Vector2f; /** @@ -49,9 +50,6 @@ /** Intended deiplay mode */ private DisplayMode mode; - /** GLU instance */ - private GLU glu; - /** our quad moving around */ private Vector2f quadPosition; Index: Game.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl/Game.java,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- Game.java 20 Jan 2004 11:19:12 -0000 1.26 +++ Game.java 4 Feb 2004 21:56:58 -0000 1.27 @@ -43,6 +43,7 @@ import org.lwjgl.*; import org.lwjgl.opengl.*; +import org.lwjgl.opengl.glu.GLU; import org.lwjgl.input.*; import java.nio.*; @@ -126,9 +127,9 @@ angle = 0.0f; Mouse.poll(); - if (Mouse.dx != 0 || Mouse.dy != 0 || Mouse.dwheel != 0) - System.out.println("Mouse moved " + Mouse.dx + " " + Mouse.dy + " " + Mouse.dwheel); - for (int i = 0; i < Mouse.buttonCount; i++) + if (Mouse.getDX() != 0 || Mouse.getDY() != 0 || Mouse.getDWheel() != 0) + System.out.println("Mouse moved " + Mouse.getDX() + " " + Mouse.getDY() + " " + Mouse.getDWheel()); + for (int i = 0; i < Mouse.getButtonCount(); i++) if (Mouse.isButtonDown(i)) System.out.println("Button " + i + " down"); /* Keyboard.poll(); @@ -137,9 +138,9 @@ Keyboard.read(); for (int i = 0; i < Keyboard.getNumKeyboardEvents(); i++) { Keyboard.next(); - if (Keyboard.key == Keyboard.KEY_ESCAPE && Keyboard.state) + if (Keyboard.getEventKey() == Keyboard.KEY_ESCAPE && Keyboard.getEventKeyState()) finished = true; - if (Keyboard.key == Keyboard.KEY_T && Keyboard.state) + if (Keyboard.getEventKey() == Keyboard.KEY_T && Keyboard.getEventKeyState()) System.out.println("Current time: " + Sys.getTime()); } } Index: Grass.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl/Grass.java,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- Grass.java 31 Jan 2004 20:40:24 -0000 1.25 +++ Grass.java 4 Feb 2004 21:56:58 -0000 1.26 @@ -43,6 +43,7 @@ import org.lwjgl.input.*; import org.lwjgl.opengl.*; +import org.lwjgl.opengl.glu.GLU; import org.lwjgl.opengl.nv.*; import org.lwjgl.*; @@ -176,10 +177,10 @@ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glEnable(GL11.GL_BLEND); GL11.glMatrixMode(GL11.GL_PROJECTION); - GLU.gluPerspective(40.0, 1.0, 1.0, 50.0); + GLU.gluPerspective(40.0f, 1.0f, 1.0f, 50.0f); GL11.glMatrixMode(GL11.GL_MODELVIEW); - GLU.gluLookAt(14.0, 10.0, -16.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0); + GLU.gluLookAt(14.0f, 10.0f, -16.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f); aslod.angle = 2.6179935f; aslod.value = 0.2f; @@ -442,9 +443,9 @@ Keyboard.read(); for (int i = 0; i < Keyboard.getNumKeyboardEvents(); i++) { Keyboard.next(); - if (!Keyboard.state) + if (!Keyboard.getEventKeyState()) continue; - switch (Keyboard.key) { + switch (Keyboard.getEventKey()) { case Keyboard.KEY_A : aslod.angle += 0.1; break; Index: PbufferTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl/PbufferTest.java,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- PbufferTest.java 20 Jan 2004 11:19:12 -0000 1.22 +++ PbufferTest.java 4 Feb 2004 21:56:58 -0000 1.23 @@ -34,6 +34,7 @@ import org.lwjgl.*; import org.lwjgl.input.*; import org.lwjgl.opengl.*; +import org.lwjgl.opengl.glu.GLU; import org.lwjgl.vector.Vector2f; import java.nio.*; @@ -51,9 +52,6 @@ /** Intended deiplay mode */ private DisplayMode mode; - /** GLU instance */ - private GLU glu; - /** our quad moving around */ private Vector2f quadPosition; Index: VBOIndexTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl/VBOIndexTest.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- VBOIndexTest.java 20 Jan 2004 11:19:12 -0000 1.10 +++ VBOIndexTest.java 4 Feb 2004 21:56:58 -0000 1.11 @@ -43,6 +43,7 @@ import org.lwjgl.*; import org.lwjgl.opengl.*; +import org.lwjgl.opengl.glu.GLU; import org.lwjgl.opengl.arb.*; import org.lwjgl.input.*; @@ -129,9 +130,9 @@ angle = 0.0f; Mouse.poll(); - if (Mouse.dx != 0 || Mouse.dy != 0 || Mouse.dwheel != 0) - System.out.println("Mouse moved " + Mouse.dx + " " + Mouse.dy + " " + Mouse.dwheel); - for (int i = 0; i < Mouse.buttonCount; i++) + if (Mouse.getDX() != 0 || Mouse.getDY() != 0 || Mouse.getDWheel() != 0) + System.out.println("Mouse moved " + Mouse.getDX() + " " + Mouse.getDY() + " " + Mouse.getDWheel()); + for (int i = 0; i < Mouse.getButtonCount(); i++) if (Mouse.isButtonDown(i)) System.out.println("Button " + i + " down"); /* Keyboard.poll(); @@ -140,9 +141,9 @@ Keyboard.read(); for (int i = 0; i < Keyboard.getNumKeyboardEvents(); i++) { Keyboard.next(); - if (Keyboard.key == Keyboard.KEY_ESCAPE && Keyboard.state) + if (Keyboard.getEventKey() == Keyboard.KEY_ESCAPE && Keyboard.getEventKeyState()) finished = true; - if (Keyboard.key == Keyboard.KEY_T && Keyboard.state) + if (Keyboard.getEventKey() == Keyboard.KEY_T && Keyboard.getEventKeyState()) System.out.println("Current time: " + Sys.getTime()); } } Index: VBOTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl/VBOTest.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- VBOTest.java 20 Jan 2004 11:19:12 -0000 1.16 +++ VBOTest.java 4 Feb 2004 21:56:58 -0000 1.17 @@ -43,6 +43,7 @@ import org.lwjgl.*; import org.lwjgl.opengl.*; +import org.lwjgl.opengl.glu.GLU; import org.lwjgl.opengl.arb.*; import org.lwjgl.input.*; @@ -125,9 +126,9 @@ angle = 0.0f; Mouse.poll(); - if (Mouse.dx != 0 || Mouse.dy != 0 || Mouse.dwheel != 0) - System.out.println("Mouse moved " + Mouse.dx + " " + Mouse.dy + " " + Mouse.dwheel); - for (int i = 0; i < Mouse.buttonCount; i++) + if (Mouse.getDX() != 0 || Mouse.getDY() != 0 || Mouse.getDWheel() != 0) + System.out.println("Mouse moved " + Mouse.getDX() + " " + Mouse.getDY() + " " + Mouse.getDWheel()); + for (int i = 0; i < Mouse.getButtonCount(); i++) if (Mouse.isButtonDown(i)) System.out.println("Button " + i + " down"); /* Keyboard.poll(); @@ -136,9 +137,9 @@ Keyboard.read(); for (int i = 0; i < Keyboard.getNumKeyboardEvents(); i++) { Keyboard.next(); - if (Keyboard.key == Keyboard.KEY_ESCAPE && Keyboard.state) + if (Keyboard.getEventKey() == Keyboard.KEY_ESCAPE && Keyboard.getEventKeyState()) finished = true; - if (Keyboard.key == Keyboard.KEY_T && Keyboard.state) + if (Keyboard.getEventKey() == Keyboard.KEY_T && Keyboard.getEventKeyState()) System.out.println("Current time: " + Sys.getTime()); } } |
|
From: <ma...@us...> - 2004-02-04 21:56:10
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31093 Modified Files: PositionTest.java Log Message: removed usage of native glu using getters Index: PositionTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/PositionTest.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- PositionTest.java 20 Jan 2004 11:19:12 -0000 1.9 +++ PositionTest.java 4 Feb 2004 21:53:44 -0000 1.10 @@ -6,6 +6,7 @@ import org.lwjgl.*; import org.lwjgl.openal.*; import org.lwjgl.opengl.*; +import org.lwjgl.opengl.glu.GLU; import org.lwjgl.input.*; /** @@ -125,7 +126,7 @@ GL11.glViewport(0, 0, WINDOW_WIDTH, WINDOW_HEIGHT); GL11.glMatrixMode(GL11.GL_PROJECTION); GL11.glLoadIdentity(); - GLU.gluPerspective(50.0, WINDOW_WIDTH / WINDOW_HEIGHT, 0.0, 50.0); + GLU.gluPerspective(50.0f, (float) WINDOW_WIDTH / WINDOW_HEIGHT, 0.0f, 50.0f); GL11.glMatrixMode(GL11.GL_MODELVIEW); GL11.glLoadIdentity(); GL11.glTranslatef(0.0f, 0.0f, -6.6f); @@ -387,8 +388,8 @@ // Test for movement with Mouse // ============================================ - listenerPosition.put(0, listenerPosition.get(0) + (0.01f * Mouse.dx)); - listenerPosition.put(1, listenerPosition.get(1) + (0.01f * Mouse.dy)); + listenerPosition.put(0, listenerPosition.get(0) + (0.01f * Mouse.getDX())); + listenerPosition.put(1, listenerPosition.get(1) + (0.01f * Mouse.getDY())); if (Mouse.isButtonDown(0)) { listenerPosition.put(2, listenerPosition.get(2) - 0.1f); } |
|
From: <ma...@us...> - 2004-02-04 21:55:27
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30822 Modified Files: StressTest.java Log Message: tell user that how to exit :) Index: StressTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/StressTest.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- StressTest.java 17 Aug 2003 16:58:18 -0000 1.8 +++ StressTest.java 4 Feb 2004 21:52:50 -0000 1.9 @@ -193,6 +193,7 @@ System.out.println("FreeMemory: " + Runtime.getRuntime().freeMemory() / 1024); System.out.println("TotalMemory: " + Runtime.getRuntime().totalMemory() / 1024); System.out.println("========================"); + System.out.println("Push any key to exit..."); System.in.read(); } catch (Exception e) { } |
|
From: <ma...@us...> - 2004-02-04 21:52:26
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30183 Modified Files: WindowCreationTest.java Log Message: cleaned up Index: WindowCreationTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/WindowCreationTest.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- WindowCreationTest.java 17 Aug 2003 18:40:57 -0000 1.15 +++ WindowCreationTest.java 4 Feb 2004 21:50:00 -0000 1.16 @@ -1,8 +1,33 @@ /* - * Created on 18-03-2003 + * Copyright (c) 2004 Lightweight Java Game Library Project + * All rights reserved. * - * To change this generated comment go to - * Window>Preferences>Java>Code Generation>Code Template + * 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 'Lightweight Java Game Library' 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. */ package org.lwjgl.test; @@ -10,26 +35,36 @@ import org.lwjgl.opengl.Window; /** - * @author Brian + * Small class for testing that the Window is creatable + * If this class can't run, LWJGL wont work! + * + * @author Brian Matzon <br...@ma...> */ public class WindowCreationTest { + /** + * Main entry point + * + * @param args ignored params to app + */ public static void main(String[] args) { + // get avaialble modes, and print out DisplayMode[] modes = Display.getAvailableDisplayModes(); System.out.println("Found " + modes.length + " display modes"); - + // Create the actual window try { Window.create("WindowCreationTest", 50, 50, 320, 240, 16, 0, 0, 0); } catch (Exception e) { e.printStackTrace(); + System.out.println("Unable to create window!, exiting..."); + System.exit(-1); } + System.out.println("Window created"); System.out.println(Window.getHeight() + ", " + Window.getWidth() + ", " + Window.getTitle()); - - System.out.println("Display created"); - + // wait for user to close window while(!Window.isCloseRequested()) { Window.update(); try { @@ -39,6 +74,7 @@ } } + // nuke window and get out Window.destroy(); } } |
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29115 Modified Files: ControllerCreationTest.java HWCursorTest.java KeyboardTest.java MouseCreationTest.java Log Message: removed usage of native glu using getters Index: ControllerCreationTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/ControllerCreationTest.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- ControllerCreationTest.java 4 Feb 2004 20:44:07 -0000 1.19 +++ ControllerCreationTest.java 4 Feb 2004 21:46:13 -0000 1.20 @@ -37,7 +37,7 @@ import org.lwjgl.input.Controller; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.Window; -import org.lwjgl.opengl.GLU; +import org.lwjgl.opengl.glu.GLU; import org.lwjgl.vector.Vector2f; /** @@ -89,7 +89,7 @@ private void initializeOpenGL() { GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); - GLU.gluOrtho2D(0.0, 640, 0, 480); + GLU.gluOrtho2D(0.0f, 640f, 0f, 480f); } public void executeTest() { Index: HWCursorTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/HWCursorTest.java,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- HWCursorTest.java 4 Feb 2004 20:44:07 -0000 1.23 +++ HWCursorTest.java 4 Feb 2004 21:46:13 -0000 1.24 @@ -34,6 +34,7 @@ import org.lwjgl.*; import org.lwjgl.input.*; import org.lwjgl.opengl.*; +import org.lwjgl.opengl.glu.GLU; import java.nio.*; @@ -50,9 +51,6 @@ /** Intended deiplay mode */ private DisplayMode mode; - /** GLU instance */ - private GLU glu; - /** The native cursor */ private static Cursor cursor = null; Index: KeyboardTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/KeyboardTest.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- KeyboardTest.java 4 Feb 2004 20:44:07 -0000 1.18 +++ KeyboardTest.java 4 Feb 2004 21:46:13 -0000 1.19 @@ -35,7 +35,7 @@ import org.lwjgl.input.Keyboard; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.Window; -import org.lwjgl.opengl.GLU; +import org.lwjgl.opengl.glu.GLU; import org.lwjgl.vector.Vector2f; /** @@ -48,15 +48,12 @@ */ public class KeyboardTest { - /** GLU instance */ - private GLU glu; - /** position of quad to draw */ private Vector2f position = new Vector2f(320.0f, 240.0f); - + /** Display mode selected */ private DisplayMode displayMode; - + private boolean bufferedKeyboard; private boolean translatedKeyboard; private int bufferSize; @@ -76,7 +73,7 @@ System.exit(-1); } } - + private void setupDisplay(boolean fullscreen) { try { Window.create("KeyboardTest", 50, 50, 640, 480, 16, 0, 0, 0); @@ -85,12 +82,12 @@ System.exit(-1); } - initializeOpenGL(); + initializeOpenGL(); } private void initializeOpenGL() { GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); - GLU.gluOrtho2D(0.0, 640, 0, 480); + GLU.gluOrtho2D(0.0f, 640f, 0f, 480f); } public void executeTest() { @@ -119,8 +116,8 @@ while (!Window.isCloseRequested()) { Window.update(); - - if(Window.isMinimized()) { + + if (Window.isMinimized()) { try { Thread.sleep(100); } catch (InterruptedException inte) { @@ -134,69 +131,69 @@ Keyboard.read(); int count = Keyboard.getNumKeyboardEvents(); - while(Keyboard.next()) { + while (Keyboard.next()) { System.out.println("Checking key:" + Keyboard.getKeyName(Keyboard.getEventKey())); - System.out.println("Key character: " + Keyboard.getCharacter()); - if(Keyboard.getEventKey() == Keyboard.KEY_ESCAPE) { + System.out.println("Key character: " + Keyboard.getCharacter()); + + if (Keyboard.getEventKey() == Keyboard.KEY_ESCAPE) { return; } if (Keyboard.isKeyDown(Keyboard.KEY_RIGHT)) { position.x += 1; } - + if (Keyboard.isKeyDown(Keyboard.KEY_LEFT)) { position.x -= 1; } - + if (Keyboard.isKeyDown(Keyboard.KEY_UP)) { position.y += 1; } - + if (Keyboard.isKeyDown(Keyboard.KEY_DOWN)) { position.y -= 1; } - - if(Keyboard.isStateKeySet(Keyboard.KEY_SCROLL) == Keyboard.STATE_ON) { + + if (Keyboard.isStateKeySet(Keyboard.KEY_SCROLL) == Keyboard.STATE_ON) { System.out.println("SCROLL lock on"); } - - if(Keyboard.isStateKeySet(Keyboard.KEY_CAPITAL) == Keyboard.STATE_ON) { + + if (Keyboard.isStateKeySet(Keyboard.KEY_CAPITAL) == Keyboard.STATE_ON) { System.out.println("CAPS lock on"); } - - if(Keyboard.isStateKeySet(Keyboard.KEY_NUMLOCK) == Keyboard.STATE_ON) { + + if (Keyboard.isStateKeySet(Keyboard.KEY_NUMLOCK) == Keyboard.STATE_ON) { System.out.println("NUM lock on"); } } if (count > 0) { System.out.println(); } - - if(position.x<0) { + + if (position.x < 0) { position.x = 0; - } else if (position.x>640-60) { - position.x = 640-60; + } else if (position.x > 640 - 60) { + position.x = 640 - 60; } - - if(position.y < 0) { + + if (position.y < 0) { position.y = 0; - } else if (position.y>480-30) { - position.y = 480-30; + } else if (position.y > 480 - 30) { + position.y = 480 - 30; } - render(); Window.paint(); - + try { Thread.sleep(0); } catch (Exception e) { } } } - + private void render() { GL11.glClear(GL11.GL_COLOR_BUFFER_BIT); @@ -205,7 +202,7 @@ float color = 1.0f; int buttonDown = 0; GL11.glColor3f(color, color, color); - + GL11.glVertex2f(position.x + 0.0f, position.y + 0.0f); GL11.glVertex2f(position.x + 0.0f, position.y + 30.0f); GL11.glVertex2f(position.x + 40.0f, position.y + 30.0f); Index: MouseCreationTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/MouseCreationTest.java,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- MouseCreationTest.java 4 Feb 2004 20:44:07 -0000 1.23 +++ MouseCreationTest.java 4 Feb 2004 21:46:13 -0000 1.24 @@ -37,7 +37,7 @@ import org.lwjgl.input.Mouse; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.Window; -import org.lwjgl.opengl.GLU; +import org.lwjgl.opengl.glu.GLU; import org.lwjgl.vector.Vector2f; /** @@ -49,10 +49,7 @@ * @version $Revision$ */ public class MouseCreationTest { - /** GLU instance */ - private GLU glu; - - /** position of quad to draw */ + /** position of quad to draw */ private Vector2f position = new Vector2f(320.0f, 240.0f); /** Display mode selected */ @@ -92,7 +89,7 @@ private void initializeOpenGL() { GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); - GLU.gluOrtho2D(0.0, 640, 0, 480); + GLU.gluOrtho2D(0.0f, 640f, 0f, 480f); } public void executeTest() { |
|
From: <ma...@us...> - 2004-02-04 21:46:46
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28413 Modified Files: ControllerTest.java Log Message: new test, based on MouseTest Index: ControllerTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/ControllerTest.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- ControllerTest.java 4 Feb 2004 20:44:07 -0000 1.17 +++ ControllerTest.java 4 Feb 2004 21:44:13 -0000 1.18 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002 Lightweight Java Game Library Project + * Copyright (c) 2002-2004 Lightweight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -31,13 +31,13 @@ */ package org.lwjgl.test.input; -import org.lwjgl.DisplayMode; import org.lwjgl.input.Controller; import org.lwjgl.input.Keyboard; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.Window; -import org.lwjgl.opengl.GLU; +import org.lwjgl.opengl.glu.GLU; import org.lwjgl.vector.Vector2f; +import org.lwjgl.vector.Vector3f; /** * $Id$ @@ -48,35 +48,80 @@ * @version $Revision$ */ public class ControllerTest { - - /** GLU instance */ - private GLU glu; - - /** position of quad to draw */ - private Vector2f position = new Vector2f(320.0f, 240.0f); - /** Display mode selected */ - private DisplayMode displayMode; + /** Controller fuzz */ + public static final int FUZZ = 200; + + /** Direction controller has moved */ + private int direction; + + /** Last button pressed */ + private int lastButton = 0; + + /** Last direction we scrolled in */ + private int lastScrollDirection = -1; + + /** Width of window */ + private static int WINDOW_WIDTH = 640; + + /** Height of window */ + private static int WINDOW_HEIGHT = 640; + + /** Triangle size (in ½) */ + private Vector2f triangleSize = new Vector2f(120, 100); + + /** Triangle color */ + private Vector3f triangleColor[] = new Vector3f[] { + new Vector3f(1,1,1), + new Vector3f(1,0,0), + new Vector3f(0,1,0), + new Vector3f(0,0,1) + }; + + private Vector3f quadColor[] = new Vector3f[] { + new Vector3f(1,1,1), + new Vector3f(1,0,0), + new Vector3f(0,1,0), + new Vector3f(0,0,1) + }; + + /** Triangles to paint */ + private Vector2f[] triangles = { + new Vector2f(WINDOW_WIDTH/2, WINDOW_HEIGHT - triangleSize.y), + new Vector2f(triangleSize.y, WINDOW_HEIGHT/2), + new Vector2f(WINDOW_WIDTH/2, triangleSize.y), + new Vector2f(WINDOW_WIDTH-triangleSize.y, WINDOW_HEIGHT/2) + }; + /** Whether the test is closing */ + private boolean closing = false; + + /** Fullscreen or not */ + public static final boolean FULLSCREEN = false; + /** Creates a new instance of ControllerTest */ public ControllerTest() { } private void initialize() { // create display and opengl - setupDisplay(false); + setupDisplay(); - try { - Keyboard.create(); - } catch (Exception e) { - e.printStackTrace(); - System.exit(-1); - } + createController(); + createKeyboard(); } - private void setupDisplay(boolean fullscreen) { + /** + * Setup display + */ + private void setupDisplay() { try { - Window.create("ControllerTest", 50, 50, 640, 480, 16, 0, 0, 0); + if (FULLSCREEN) { + Window.create("ControllerTest", 16, 0, 0, 0); + } else { + Window.create("ControllerTest", 50, 50, WINDOW_WIDTH, WINDOW_HEIGHT, 16, 0, 0, 0); + } + Window.setVSyncEnabled(true); } catch (Exception e) { e.printStackTrace(); System.exit(-1); @@ -85,110 +130,288 @@ initializeOpenGL(); } + /** + * Initializes OpenGL + * + */ private void initializeOpenGL() { GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); - GLU.gluOrtho2D(0.0, 640, 0, 480); + GLU.gluOrtho2D(0.0f, WINDOW_WIDTH, 0, WINDOW_HEIGHT); } + /** + * Executes the actual test + */ public void executeTest() { initialize(); - createController(); - - wiggleController(); + runTest(); Controller.destroy(); Keyboard.destroy(); Window.destroy(); } + /** + * Creates the controller + */ private void createController() { try { Controller.create(); } catch (Exception e) { e.printStackTrace(); + System.out.println("No controller found, exiting..."); + System.exit(-1); + } + } + + /** + * Creates the keyboard + */ + private void createKeyboard() { + try { + Keyboard.create(); + } catch (Exception e) { + e.printStackTrace(); System.exit(-1); } } - private void wiggleController() { - while (!Window.isCloseRequested()) { - Window.update(); + /** + * Runs the test + */ + private void runTest() { + // while not exiting + while (!closing) { + handleWindow(); - if(Window.isMinimized()) { - try { - Thread.sleep(100); - } catch (InterruptedException inte) { - inte.printStackTrace(); + // secondary check + if(!closing) { + + // poll and check keyboard and mouse + handleKeyboard(); + handleController(); + + + // pause and continue if minimized + if(Window.isMinimized()) { + if(Window.isDirty()) { + render(); + Window.paint(); + } + pause(100); + continue; } - continue; - } - Controller.poll(); - Keyboard.poll(); - - if(Keyboard.isKeyDown(Keyboard.KEY_ESCAPE)) { - return; + // render and flip + logic(); + render(); + Window.paint(); } + Thread.yield(); + } + } - if (Controller.getX() > 200) { - position.x += 1; + /** + * Pauses the current thread for a specified time + * + * @param time milliseconds to pause + */ + private void pause(long time) { + try { + Thread.sleep(time); + } catch (InterruptedException inte) { + inte.printStackTrace(); + } + } + + /** + * Handles the window + */ + private void handleWindow() { + Window.update(); + closing = Window.isCloseRequested(); + } + + /** + * handles the controller + */ + private void handleController() { + readController(); + } + + /** + * Reads the controller + */ + private void readController() { + // poll for current values + Controller.poll(); + + // get last button down + for(int i=0;i<Controller.getButtonCount(); i++) { + if(Controller.isButtonDown(i)) { + lastButton = i; } - - if (Controller.getX() < -200) { - position.x -= 1; + } + + updateState(); + } + + /** + * Updates our "model" + */ + private void updateState() { + direction = -1; + + // get out if no movement + if (Controller.getX() == Controller.getY() && Controller.getX() == 0) { + if(!Controller.hasPOV()) { + return; } - - if (Controller.getY() < -200) { - position.y += 1; + } + + // determine direction moved + // ============================ + if(Controller.getX() > FUZZ) { + direction = 3; + } + + if(Controller.getX() < -FUZZ) { + direction = 1; + } + + if(Controller.getY() > FUZZ) { + direction = 2; + } + + if(Controller.getY() < -FUZZ) { + direction = 0; + } + // ---------------------------- + + if(direction > -1) { + + // based on which button was last pushed, update model + switch(lastButton) { + case -1: + break; + case 1: + triangleColor[direction].y = 1; + break; + case 2: + triangleColor[direction].z = 1; + break; + case 3: + triangleColor[direction].x = 1; + triangleColor[direction].y = 1; + triangleColor[direction].z = 1; + break; + case 0: // fall through + default: + triangleColor[direction].x = 1; + break; } - - if (Controller.getY() > 200) { - position.y -= 1; + } + + + if(Controller.hasPOV()) { + // get direction to update in + switch(Controller.getPov()) { + case Controller.POV_CENTER: + return; + case Controller.POV_SOUTH: + case Controller.POV_EAST: + lastScrollDirection++; + break; + case Controller.POV_NORTH: + case Controller.POV_WEST: + lastScrollDirection--; + break; } - if(position.x<0) { - position.x = 0; - } else if (position.x>640-60) { - position.x = 640-60; + // over/underflow + if(lastScrollDirection < 0) { + lastScrollDirection = 3; } - - if(position.y < 0) { - position.y = 0; - } else if (position.y>480-30) { - position.y = 480-30; + if(lastScrollDirection > 3) { + lastScrollDirection = 0; } - - render(); - - Window.paint(); + // update colors + quadColor[lastScrollDirection].x = (float) Math.random(); + quadColor[lastScrollDirection].y = (float) Math.random(); + quadColor[lastScrollDirection].z = (float) Math.random(); + } + } + + /** + * Handles the keyboard + */ + private void handleKeyboard() { + Keyboard.poll(); + + // closing on ESCAPE + if(Keyboard.isKeyDown(Keyboard.KEY_ESCAPE)) { + closing = true; } } + /** + * Does the "model logic" + */ + private void logic() { + // "we fade to black" + // =========================================== + for(int i=0; i<triangleColor.length; i++) { + triangleColor[i].x -= 0.01; + triangleColor[i].y -= 0.01; + triangleColor[i].z -= 0.01; + } + + for(int i=0; i<quadColor.length; i++) { + quadColor[i].x -= 0.01; + quadColor[i].y -= 0.01; + quadColor[i].z -= 0.01; + } + // ------------------------------------------- + } + + /** + * Render our triangles + */ private void render() { GL11.glClear(GL11.GL_COLOR_BUFFER_BIT); - GL11.glBegin(GL11.GL_POLYGON); - { - float color = 1.0f; - int buttonDown = 0; - - for(int i=0;i<Controller.getButtonCount(); i++) { - if(Controller.isButtonDown(i)) { - color = (1.0f / Controller.getButtonCount()) * (i+1); - System.out.println("Button " + i + " down"); + // for each triangle, render it at position, rotating degrees for each + for(int i=0; i<triangles.length; i++) { + GL11.glPushMatrix(); { + GL11.glTranslatef(triangles[i].x, triangles[i].y, 0); + GL11.glRotatef(i*90, 0, 0, 1); + + GL11.glColor3f(triangleColor[i].x, triangleColor[i].y, triangleColor[i].z); + + GL11.glBegin(GL11.GL_TRIANGLES); { + GL11.glVertex2f(0, triangleSize.y); + GL11.glVertex2f(-triangleSize.x, -triangleSize.y); + GL11.glVertex2f(+triangleSize.x, -triangleSize.y); } + GL11.glEnd(); } - GL11.glColor3f(color, color, color); - - GL11.glVertex2f(position.x + 0.0f, position.y + 0.0f); - GL11.glVertex2f(position.x + 0.0f, position.y + 30.0f); - GL11.glVertex2f(position.x + 40.0f, position.y + 30.0f); - GL11.glVertex2f(position.x + 60.0f, position.y + 15.f); - GL11.glVertex2f(position.x + 40.0f, position.y + 0.0f); + GL11.glPopMatrix(); } - GL11.glEnd(); + + // paint quad in the middle (yes, wasting cpu cycles by not precalculating) + GL11.glBegin(GL11.GL_QUADS); { + GL11.glColor3f(quadColor[0].x, quadColor[0].y, quadColor[0].z); + GL11.glVertex2f(WINDOW_WIDTH/2-triangleSize.x, WINDOW_HEIGHT/2-triangleSize.x); + GL11.glColor3f(quadColor[1].x, quadColor[1].y, quadColor[1].z); + GL11.glVertex2f(WINDOW_WIDTH/2+triangleSize.x, WINDOW_HEIGHT/2-triangleSize.x); + GL11.glColor3f(quadColor[2].x, quadColor[2].y, quadColor[2].z); + GL11.glVertex2f(WINDOW_WIDTH/2+triangleSize.x, WINDOW_HEIGHT/2+triangleSize.x); + GL11.glColor3f(quadColor[3].x, quadColor[3].y, quadColor[3].z); + GL11.glVertex2f(WINDOW_WIDTH/2-triangleSize.x, WINDOW_HEIGHT/2+triangleSize.x); + } + GL11.glEnd(); } /** |
|
From: <ma...@us...> - 2004-02-04 21:45:53
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28232 Modified Files: MouseTest.java Log Message: isDirty support Index: MouseTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/MouseTest.java,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- MouseTest.java 4 Feb 2004 20:44:58 -0000 1.25 +++ MouseTest.java 4 Feb 2004 21:43:24 -0000 1.26 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002 Lightweight Java Game Library Project + * Copyright (c) 2002-2004 Lightweight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -205,6 +205,10 @@ // pause and continue if minimized if(Window.isMinimized()) { + if(Window.isDirty()) { + render(); + Window.paint(); + } pause(100); continue; } |
|
From: <ma...@us...> - 2004-02-04 21:09:11
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17571 Modified Files: Mouse.java Log Message: absolute mouse Index: Mouse.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Mouse.java,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- Mouse.java 4 Feb 2004 20:39:40 -0000 1.31 +++ Mouse.java 4 Feb 2004 21:06:38 -0000 1.32 @@ -38,6 +38,7 @@ import java.nio.ByteOrder; import org.lwjgl.*; +import org.lwjgl.opengl.Window; /** * $Id$ @@ -46,8 +47,9 @@ * mouse buttons, and determine the mouse movement delta since the last poll. * * n buttons supported, n being a native limit. A scrolly wheel is also - * supported, if one such is available. All movement is reported as delta from - * last position. + * supported, if one such is available. Movement is reported as delta from + * last position or as an absolute position. If the window has been created + * the absolute position will be clamped to 0 - Window (width | height) * * @author cix_foo <ci...@us...> * @author elias_naur <eli...@us...> @@ -71,6 +73,12 @@ /** The mouse buttons status from the last poll */ private static byte[] buttons; + /** X */ + private static int x; + + /** Y */ + private static int y; + /** Delta X */ private static int dx; @@ -288,6 +296,26 @@ public static void poll() { assert created : "The mouse has not been created."; nPoll(); + + // set absolute position + x += dx; + y += dy; + + // if window has been created, clamp to edges + if(Window.isCreated()) { + // clamp x, y + if (x < 0) { + x = 0; + } else if (x > Window.getWidth()) { + x = Window.getWidth(); + } + + if (y < 0) { + y = 0; + } else if (y > Window.getHeight()) { + y = Window.getWidth(); + } + } } /** @@ -402,6 +430,26 @@ } /** + * Retrieves the absolute position. If the Window has been created + * x will be clamped to 0 - Window.getWidth(). + * + * @return Absolute x axis position of mouse + */ + public static int getX() { + return x; + } + + /** + * Retrieves the absolute position. If the Window has been created + * y will be clamped to 0 - Window.getHeight(). + * + * @return Absolute y axis position of mouse + */ + public static int getY() { + return y; + } + + /** * @return Movement on the x axis since last poll */ public static int getDX() { |
|
From: <ma...@us...> - 2004-02-04 20:47:24
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11812 Modified Files: MouseTest.java Log Message: using getters new test Index: MouseTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/MouseTest.java,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- MouseTest.java 20 Jan 2004 11:19:12 -0000 1.24 +++ MouseTest.java 4 Feb 2004 20:44:58 -0000 1.25 @@ -31,13 +31,13 @@ */ package org.lwjgl.test.input; -import org.lwjgl.DisplayMode; import org.lwjgl.input.Mouse; import org.lwjgl.input.Keyboard; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.Window; -import org.lwjgl.opengl.GLU; +import org.lwjgl.opengl.glu.GLU; import org.lwjgl.vector.Vector2f; +import org.lwjgl.vector.Vector3f; /** * $Id$ @@ -48,35 +48,81 @@ * @version $Revision$ */ public class MouseTest { - - /** GLU instance */ - private GLU glu; - - /** position of quad to draw */ - private Vector2f position = new Vector2f(320.0f, 240.0f); + /** Direction mouse has moved */ + private int direction; - /** Display mode selected */ - private DisplayMode displayMode; + /** Last button pressed */ + private int lastButton = 0; + + /** Last direction we scrolled in */ + private int lastScrollDirection = -1; + + /** Width of window */ + private static int WINDOW_WIDTH = 640; + + /** Height of window */ + private static int WINDOW_HEIGHT = 640; + + /** Triangle size (in ½) */ + private Vector2f triangleSize = new Vector2f(120, 100); + + /** Triangle color */ + private Vector3f triangleColor[] = new Vector3f[] { + new Vector3f(1,1,1), + new Vector3f(1,0,0), + new Vector3f(0,1,0), + new Vector3f(0,0,1) + }; + + private Vector3f quadColor[] = new Vector3f[] { + new Vector3f(1,1,1), + new Vector3f(1,0,0), + new Vector3f(0,1,0), + new Vector3f(0,0,1) + }; + + /** Triangles to paint */ + private Vector2f[] triangles = { + new Vector2f(WINDOW_WIDTH/2, WINDOW_HEIGHT - triangleSize.y), + new Vector2f(triangleSize.y, WINDOW_HEIGHT/2), + new Vector2f(WINDOW_WIDTH/2, triangleSize.y), + new Vector2f(WINDOW_WIDTH-triangleSize.y, WINDOW_HEIGHT/2) + }; + /** Whether the test is closing */ + private boolean closing = false; + + /** Fullscreen or not */ + public static final boolean FULLSCREEN = false; + + /** Buffered mouse or not */ + public static final boolean BUFFERED_MOUSE = true; + + private int bufferSize; + /** Creates a new instance of MouseTest */ public MouseTest() { } private void initialize() { // create display and opengl - setupDisplay(false); + setupDisplay(); - try { - Keyboard.create(); - } catch (Exception e) { - e.printStackTrace(); - System.exit(-1); - } + createMouse(); + createKeyboard(); } - private void setupDisplay(boolean fullscreen) { + /** + * Setup display + */ + private void setupDisplay() { try { - Window.create("MouseTest", 50, 50, 640, 480, 16, 0, 0, 0); + if (FULLSCREEN) { + Window.create("MouseTest", 16, 0, 0, 0); + } else { + Window.create("MouseTest", 50, 50, WINDOW_WIDTH, WINDOW_HEIGHT, 16, 0, 0, 0); + } + Window.setVSyncEnabled(true); } catch (Exception e) { e.printStackTrace(); System.exit(-1); @@ -85,23 +131,31 @@ initializeOpenGL(); } + /** + * Initializes OpenGL + * + */ private void initializeOpenGL() { GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); - GLU.gluOrtho2D(0.0, 640, 0, 480); + GLU.gluOrtho2D(0.0f, WINDOW_WIDTH, 0, WINDOW_HEIGHT); } + /** + * Executes the actual test + */ public void executeTest() { initialize(); - createMouse(); - - wiggleMouse(); + runTest(); Mouse.destroy(); Keyboard.destroy(); Window.destroy(); } + /** + * Creates the mouse + */ private void createMouse() { try { Mouse.create(); @@ -109,73 +163,276 @@ e.printStackTrace(); System.exit(-1); } - } - private void wiggleMouse() { - while (!Window.isCloseRequested()) { - Window.update(); - - if(Window.isMinimized()) { - try { - Thread.sleep(100); - } catch (InterruptedException inte) { - inte.printStackTrace(); - } - continue; + // if compiled for buffered mode, enable that + if(BUFFERED_MOUSE) { + try { + Mouse.enableBuffer(); + } catch (Exception e) { + e.printStackTrace(); + System.exit(-1); } + } + } + + /** + * Creates the keyboard + */ + private void createKeyboard() { + try { + Keyboard.create(); + } catch (Exception e) { + e.printStackTrace(); + System.exit(-1); + } + } - Mouse.poll(); - Keyboard.poll(); + /** + * Runs the test + */ + private void runTest() { + // while not exiting + while (!closing) { + handleWindow(); - if(Keyboard.isKeyDown(Keyboard.KEY_ESCAPE)) { - return; + // secondary check + if(!closing) { + + // poll and check keyboard and mouse + handleKeyboard(); + handleMouse(); + + + // pause and continue if minimized + if(Window.isMinimized()) { + pause(100); + continue; + } + + // render and flip + logic(); + render(); + Window.paint(); } + Thread.yield(); + } + } - position.x += Mouse.dx; - position.y += Mouse.dy; - - if(position.x<0) { - position.x = 0; - } else if (position.x>640-60) { - position.x = 640-60; + /** + * Pauses the current thread for a specified time + * + * @param time milliseconds to pause + */ + private void pause(long time) { + try { + Thread.sleep(time); + } catch (InterruptedException inte) { + inte.printStackTrace(); + } + } + + /** + * Handles the window + */ + private void handleWindow() { + Window.update(); + closing = Window.isCloseRequested(); + } + + /** + * handles the mouse + */ + private void handleMouse() { + if(BUFFERED_MOUSE) { + readBufferedMouse(); + } else { + readUnbufferedMouse(); + } + } + + /** + * reads a mouse in buffered mode + */ + private void readBufferedMouse() { + // poll for current values + Mouse.poll(); + + // read events + Mouse.read(); + + // iterate all events, use the last button down + while(Mouse.next()) { + if(Mouse.getEventButtonState()) { + lastButton = Mouse.getEventButton(); } - - if(position.y < 0) { - position.y = 0; - } else if (position.y>480-30) { - position.y = 480-30; + } + + updateState(); + } + + /** + * Reads the mouse in unbuffered mode + */ + private void readUnbufferedMouse() { + // poll for current values + Mouse.poll(); + + // get last button down + for(int i=0;i<Mouse.getButtonCount(); i++) { + if(Mouse.isButtonDown(i)) { + lastButton = i; } - + } + + updateState(); + } + + /** + * Updates our "model" + * + */ + private void updateState() { + direction = -1; - render(); + // get out if no movement + if (Mouse.getDX() == Mouse.getDY() && Mouse.getDX() == 0 && Mouse.getDWheel() == 0) { + return; + } + + // determine direction moved + // ============================ + if(Mouse.getDX() > 0) { + direction = 3; + } + + if(Mouse.getDX() < 0) { + direction = 1; + } + + if(Mouse.getDY() > 0) { + direction = 0; + } + + if(Mouse.getDY() < 0) { + direction = 2; + } + // ---------------------------- + + if(direction > -1) { - Window.paint(); + // based on which button was last pushed, update model + switch(lastButton) { + case -1: + break; + case 1: + triangleColor[direction].y = 1; + break; + case 2: + triangleColor[direction].z = 1; + break; + case 3: + triangleColor[direction].x = 1; + triangleColor[direction].y = 1; + triangleColor[direction].z = 1; + break; + case 0: // fall through + default: + triangleColor[direction].x = 1; + break; + } + } + + // get direction to update in + if (Mouse.getDWheel() > 0) { + lastScrollDirection++; + } else if (Mouse.getDWheel() < 0) { + lastScrollDirection--; + } else if (Mouse.getDWheel() == 0) { + return; + } + + // over/underflow + if(lastScrollDirection < 0) { + lastScrollDirection = 3; + } + if(lastScrollDirection > 3) { + lastScrollDirection = 0; + } + + // update colors + quadColor[lastScrollDirection].x = (float) Math.random(); + quadColor[lastScrollDirection].y = (float) Math.random(); + quadColor[lastScrollDirection].z = (float) Math.random(); + } + + /** + * Handles the keyboard + */ + private void handleKeyboard() { + Keyboard.poll(); + + // closing on ESCAPE + if(Keyboard.isKeyDown(Keyboard.KEY_ESCAPE)) { + closing = true; } } + /** + * Does the "model logic" + */ + private void logic() { + // "we fade to black" + // =========================================== + for(int i=0; i<triangleColor.length; i++) { + triangleColor[i].x -= 0.01; + triangleColor[i].y -= 0.01; + triangleColor[i].z -= 0.01; + } + + for(int i=0; i<quadColor.length; i++) { + quadColor[i].x -= 0.01; + quadColor[i].y -= 0.01; + quadColor[i].z -= 0.01; + } + // ------------------------------------------- + } + + /** + * Render our triangles + */ private void render() { GL11.glClear(GL11.GL_COLOR_BUFFER_BIT); - GL11.glBegin(GL11.GL_POLYGON); - { - float color = 1.0f; - int buttonDown = 0; - - for(int i=0;i<Mouse.buttonCount; i++) { - if(Mouse.isButtonDown(i)) { - color = (1.0f / Mouse.buttonCount) * (i+1); - break; + // for each triangle, render it at position, rotating degrees for each + for(int i=0; i<triangles.length; i++) { + GL11.glPushMatrix(); { + GL11.glTranslatef(triangles[i].x, triangles[i].y, 0); + GL11.glRotatef(i*90, 0, 0, 1); + + GL11.glColor3f(triangleColor[i].x, triangleColor[i].y, triangleColor[i].z); + + GL11.glBegin(GL11.GL_TRIANGLES); { + GL11.glVertex2f(0, triangleSize.y); + GL11.glVertex2f(-triangleSize.x, -triangleSize.y); + GL11.glVertex2f(+triangleSize.x, -triangleSize.y); } + GL11.glEnd(); } - GL11.glColor3f(color, color, color); - - GL11.glVertex2f(position.x + 0.0f, position.y + 0.0f); - GL11.glVertex2f(position.x + 0.0f, position.y + 30.0f); - GL11.glVertex2f(position.x + 40.0f, position.y + 30.0f); - GL11.glVertex2f(position.x + 60.0f, position.y + 15.f); - GL11.glVertex2f(position.x + 40.0f, position.y + 0.0f); + GL11.glPopMatrix(); } - GL11.glEnd(); + + // paint quad in the middle (yes, wasting cpu cycles by not precalculating) + GL11.glBegin(GL11.GL_QUADS); { + GL11.glColor3f(quadColor[0].x, quadColor[0].y, quadColor[0].z); + GL11.glVertex2f(WINDOW_WIDTH/2-triangleSize.x, WINDOW_HEIGHT/2-triangleSize.x); + GL11.glColor3f(quadColor[1].x, quadColor[1].y, quadColor[1].z); + GL11.glVertex2f(WINDOW_WIDTH/2+triangleSize.x, WINDOW_HEIGHT/2-triangleSize.x); + GL11.glColor3f(quadColor[2].x, quadColor[2].y, quadColor[2].z); + GL11.glVertex2f(WINDOW_WIDTH/2+triangleSize.x, WINDOW_HEIGHT/2+triangleSize.x); + GL11.glColor3f(quadColor[3].x, quadColor[3].y, quadColor[3].z); + GL11.glVertex2f(WINDOW_WIDTH/2-triangleSize.x, WINDOW_HEIGHT/2+triangleSize.x); + } + GL11.glEnd(); } /** |
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11535 Modified Files: ControllerCreationTest.java ControllerTest.java HWCursorTest.java KeyboardTest.java MouseCreationTest.java Log Message: using getters Index: ControllerCreationTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/ControllerCreationTest.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- ControllerCreationTest.java 20 Jan 2004 11:19:12 -0000 1.18 +++ ControllerCreationTest.java 4 Feb 2004 20:44:07 -0000 1.19 @@ -165,14 +165,14 @@ Controller.poll(); //controller is a bit fuzzy - if(Controller.x > 100) { + if(Controller.getX() > 100) { position.x += 1; - } else if (Controller.x < -100) { + } else if (Controller.getX() < -100) { position.x -= 1; } - if(Controller.y > 100) { + if(Controller.getY() > 100) { position.y -= 1; - } else if (Controller.y < -100) { + } else if (Controller.getY() < -100) { position.y += 1; } Index: ControllerTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/ControllerTest.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- ControllerTest.java 20 Jan 2004 11:19:12 -0000 1.16 +++ ControllerTest.java 4 Feb 2004 20:44:07 -0000 1.17 @@ -131,19 +131,19 @@ return; } - if (Controller.x > 200) { + if (Controller.getX() > 200) { position.x += 1; } - if (Controller.x < -200) { + if (Controller.getX() < -200) { position.x -= 1; } - if (Controller.y < -200) { + if (Controller.getY() < -200) { position.y += 1; } - if (Controller.y > 200) { + if (Controller.getY() > 200) { position.y -= 1; } @@ -174,9 +174,9 @@ float color = 1.0f; int buttonDown = 0; - for(int i=0;i<Controller.buttonCount; i++) { + for(int i=0;i<Controller.getButtonCount(); i++) { if(Controller.isButtonDown(i)) { - color = (1.0f / Controller.buttonCount) * (i+1); + color = (1.0f / Controller.getButtonCount()) * (i+1); System.out.println("Button " + i + " down"); } } Index: HWCursorTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/HWCursorTest.java,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- HWCursorTest.java 20 Jan 2004 11:19:12 -0000 1.22 +++ HWCursorTest.java 4 Feb 2004 20:44:07 -0000 1.23 @@ -208,9 +208,9 @@ Keyboard.poll(); Mouse.poll(); - if (Mouse.dx != 0 || Mouse.dy != 0) { - mouse_x += Mouse.dx; - mouse_y += Mouse.dy; + if (Mouse.getDX() != 0 || Mouse.getDY() != 0) { + mouse_x += Mouse.getDX(); + mouse_y += Mouse.getDY(); System.out.println("mouse_x " + mouse_x + " mouse_y " + mouse_y); } Index: KeyboardTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/KeyboardTest.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- KeyboardTest.java 20 Jan 2004 11:19:12 -0000 1.17 +++ KeyboardTest.java 4 Feb 2004 20:44:07 -0000 1.18 @@ -135,9 +135,9 @@ int count = Keyboard.getNumKeyboardEvents(); while(Keyboard.next()) { - System.out.println("Checking key:" + Keyboard.getKeyName(Keyboard.key)); - System.out.println("Key character: " + Keyboard.character); - if(Keyboard.key == Keyboard.KEY_ESCAPE) { + System.out.println("Checking key:" + Keyboard.getKeyName(Keyboard.getEventKey())); + System.out.println("Key character: " + Keyboard.getCharacter()); + if(Keyboard.getEventKey() == Keyboard.KEY_ESCAPE) { return; } Index: MouseCreationTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/MouseCreationTest.java,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- MouseCreationTest.java 20 Jan 2004 11:19:12 -0000 1.22 +++ MouseCreationTest.java 4 Feb 2004 20:44:07 -0000 1.23 @@ -166,8 +166,8 @@ Mouse.poll(); - position.x += Mouse.dx; - position.y += Mouse.dy; + position.x += Mouse.getDX(); + position.y += Mouse.getDY(); if(position.x<0) { position.x = 0; @@ -207,9 +207,9 @@ float color = 1.0f; int buttonDown = 0; - for(int i=0;i<Mouse.buttonCount; i++) { + for(int i=0;i<Mouse.getButtonCount(); i++) { if(Mouse.isButtonDown(i)) { - color = (1.0f / Mouse.buttonCount) * (i+1); + color = (1.0f / Mouse.getButtonCount()) * (i+1); break; } } |
|
From: <ma...@us...> - 2004-02-04 20:44:33
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10929 Removed Files: DisplayConfigurationTest.java OpenURLTest.java Log Message: be gone ye old tests --- DisplayConfigurationTest.java DELETED --- --- OpenURLTest.java DELETED --- |
|
From: <ma...@us...> - 2004-02-04 20:42:06
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10214 Modified Files: Controller.java Keyboard.java Mouse.java Log Message: using getters Index: Controller.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Controller.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- Controller.java 30 Sep 2003 10:52:05 -0000 1.9 +++ Controller.java 4 Feb 2004 20:39:39 -0000 1.10 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002 Lightweight Java Game Library Project + * Copyright (c) 2002-2004 Lightweight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -63,28 +63,28 @@ private static boolean[] buttons; /** X position, range -1000 to 1000 */ - public static int x = 0; + private static int x = 0; /** X rotational position, range -1000 to 1000 */ - public static int rx = 0; + private static int rx = 0; /** Y position, range -1000 to 1000 */ - public static int y = 0; + private static int y = 0; /** Y rotational position, range -1000 to 1000 */ - public static int ry = 0; + private static int ry = 0; /** Z position, range -1000 to 1000 */ - public static int z = 0; + private static int z = 0; /** Z rotational position, range -1000 to 1000 */ - public static int rz = 0; + private static int rz = 0; /** Position of Point of View from -1 to 27000 (360 degrees) */ - public static int pov; + private static int pov; /** Slider position, range -1000 to 1000 */ - public static int slider = 0; + private static int slider = 0; /** Constant specifying centered POV */ public static final int POV_CENTER = -1; @@ -102,31 +102,31 @@ public static final int POV_WEST = 9000; /** Number of buttons on the controller */ - public static int buttonCount = -1; + private static int buttonCount = -1; /** Does this controller support a x axis */ - public static boolean hasXAxis = false; + private static boolean hasXAxis = false; /** Does this controller support a rotational x axis */ - public static boolean hasRXAxis = false; + private static boolean hasRXAxis = false; /** Does this controller support an y axis */ - public static boolean hasYAxis = false; + private static boolean hasYAxis = false; /** Does this controller support a rotational y axis */ - public static boolean hasRYAxis = false; + private static boolean hasRYAxis = false; /** Does this controller support a z axis */ - public static boolean hasZAxis = false; + private static boolean hasZAxis = false; /** Does this controller support a rotational z axis */ - public static boolean hasRZAxis = false; + private static boolean hasRZAxis = false; /** Does this controller support a Point-Of-View (hat) */ - public static boolean hasPOV = false; + private static boolean hasPOV = false; /** Does this controller support a slider */ - public static boolean hasSlider = false; + private static boolean hasSlider = false; /** Button names. These are set upon create(), to names like BUTTON0, BUTTON1, etc. */ private static String[] buttonName; @@ -258,4 +258,122 @@ * Register fields with the native library */ private static native void initIDs(); + /** + * @return Returns the buttonCount. + */ + public static int getButtonCount() { + return buttonCount; + } + + /** + * @return Returns whether POV is supported + */ + public static boolean hasPOV() { + return hasPOV; + } + + /** + * @return Returns whether a rotational x axis is supported + */ + public static boolean hasRXAxis() { + return hasRXAxis; + } + + /** + * @return Returns whether a rotational y axis is supported + */ + public static boolean hasRYAxis() { + return hasRYAxis; + } + + /** + * @return Returns whether a rotational z axis is supported + */ + public static boolean hasRZAxis() { + return hasRZAxis; + } + + /** + * @return Returns whether a slider is supported + */ + public static boolean hasSlider() { + return hasSlider; + } + + /** + * @return Returns whether a x axis is supported + */ + public static boolean hasXAxis() { + return hasXAxis; + } + + /** + * @return Returns whether a y axis is supported + */ + public static boolean hasYAxis() { + return hasYAxis; + } + + /** + * @return Returns whether a z axis is supported + */ + public static boolean hasZAxis() { + return hasZAxis; + } + + /** + * @return Returns the POV value + */ + public static int getPov() { + return pov; + } + + /** + * @return Returns the rotational value of the x axis + */ + public static int getRx() { + return rx; + } + + /** + * @return Returns the rotational value of the y axis + */ + public static int getRy() { + return ry; + } + + /** + * @return Returns the rotational value of the z axis + */ + public static int getRz() { + return rz; + } + + /** + * @return Returns the slider value + */ + public static int getSlider() { + return slider; + } + + /** + * @return Returns the x axis value + */ + public static int getX() { + return x; + } + + /** + * @return Returns the y axis value + */ + public static int getY() { + return y; + } + + /** + * @return Returns the z axis value + */ + public static int getZ() { + return z; + } } Index: Keyboard.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Keyboard.java,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- Keyboard.java 11 Oct 2003 16:29:39 -0000 1.31 +++ Keyboard.java 4 Feb 2004 20:39:40 -0000 1.32 @@ -222,7 +222,7 @@ } /** The number of keys supported */ - public static final int keyCount = counter; + private static final int keyCount = counter; /** Has the keyboard been created? */ private static boolean created; @@ -244,13 +244,13 @@ private static int numEvents; /** The current keyboard character being examined */ - public static char character; + private static char eventCharacter; /** The current keyboard event key being examined */ - public static int key; + private static int eventKey; /** The current state of the key being examined in the event queue */ - public static boolean state; + private static boolean eventState; /** One time initialization */ private static boolean initialized; @@ -454,12 +454,45 @@ assert readBuffer != null : "Keyboard buffering has not been enabled."; if (readBuffer.hasRemaining()) { - key = readBuffer.get() & 0xFF; - state = readBuffer.get() != 0; - if (translationEnabled) - character = readBuffer.getChar(); + eventKey = readBuffer.get() & 0xFF; + eventState = readBuffer.get() != 0; + if (translationEnabled) { + eventCharacter = readBuffer.getChar(); + } return true; - } else + } else { return false; + } } -} + + /** + * @return Number of keys on this keyboard + */ + public static int getKeyCount() { + return keyCount; + } + + /** + * @return The character from the current event + */ + public static char getCharacter() { + return eventCharacter; + } + + /** + * @return The key from the current event + */ + public static int getEventKey() { + return eventKey; + } + + /** + * Gets the state of the tkey that generated the + * current event + * + * @return True if key was down, or false if released + */ + public static boolean getEventKeyState() { + return eventState; + } +} \ No newline at end of file Index: Mouse.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Mouse.java,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- Mouse.java 11 Oct 2003 16:29:40 -0000 1.30 +++ Mouse.java 4 Feb 2004 20:39:40 -0000 1.31 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002 Lightweight Java Game Library Project + * Copyright (c) 2002-2004 Lightweight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -50,12 +50,20 @@ * last position. * * @author cix_foo <ci...@us...> + * @author elias_naur <eli...@us...> + * @author Brian Matzon <br...@ma...> * @version $Revision$ */ public class Mouse { + + /** 1 bit transparency for native cursor */ public final static int CURSOR_ONE_BIT_TRANSPARENCY = 1; + + /** 8 bit alhpa native cursor */ public final static int CURSOR_8_BIT_ALPHA = 2; - public final static int CURSOR_ANIMATION = 4; + + /** animation native cursor */ + public final static int CURSOR_ANIMATION = 4; /** Has the mouse been created? */ private static boolean created; @@ -64,41 +72,40 @@ private static byte[] buttons; /** Delta X */ - public static int dx; + private static int dx; /** Delta Y */ - public static int dy; + private static int dy; /** Delta Z */ - public static int dwheel; + private static int dwheel; /** Number of buttons supported by the mouse */ - public static int buttonCount = -1; + private static int buttonCount = -1; /** Does this mouse support a scroll wheel */ - public static boolean hasWheel = false; + private static boolean hasWheel = false; /** The current native cursor, if any */ private static Cursor currentCursor; /** Button names. These are set upon create(), to names like BUTTON0, BUTTON1, etc. */ private static String[] buttonName; + + /** hashmap of button names, for fast lookup */ private static final Map buttonMap = new HashMap(16); /** Lazy initialization */ private static boolean initialized; - /** - * The mouse button events from the last read: a sequence of pairs of button number, - * followed by state. - */ - private static ByteBuffer readBuffer; + /** The mouse button events from the last read */ + private static ByteBuffer readBuffer = null; /** The current mouse event button being examined */ - public static int button; + private static int eventButton; /** The current state of the button being examined in the event queue */ - public static boolean state; + private static boolean eventState; /** * Mouse cannot be constructed. @@ -235,8 +242,10 @@ buttons = new byte[buttonCount]; } + /** Native query of wheel support */ private static native boolean nHasWheel(); + /** Native query of button count */ private static native int nGetButtonCount(); /** @@ -294,10 +303,10 @@ */ public static boolean isButtonDown(int button) { assert created : "The mouse has not been created."; - if (button >= buttonCount) - return false; + if (button >= buttonCount || button < 0) + return false; else - return buttons[button] == 1; + return buttons[button] == 1; } /** @@ -306,7 +315,7 @@ * @return a String with the button's human readable name in it or null if the button is unnamed */ public static String getButtonName(int button) { - if (button >= buttonName.length) + if (button >= buttonName.length || button < 0) return null; else return buttonName[button]; @@ -371,10 +380,59 @@ assert readBuffer != null : "Mouse buffering has not been enabled."; if (readBuffer.hasRemaining()) { - button = readBuffer.get() & 0xFF; - state = readBuffer.get() != 0; + eventButton = readBuffer.get() & 0xFF; + eventState = readBuffer.get() != 0; return true; } else return false; } + + /** + * @return Current events button + */ + public static int getEventButton() { + return eventButton; + } + + /** + * @return Current events button state + */ + public static boolean getEventButtonState() { + return eventState; + } + + /** + * @return Movement on the x axis since last poll + */ + public static int getDX() { + return dx; + } + + /** + * @return Movement on the y axis since last poll + */ + public static int getDY() { + return dy; + } + + /** + * @return Movement of the wheel since last poll + */ + public static int getDWheel() { + return dwheel; + } + + /** + * @return Number of buttons on this mouse + */ + public static int getButtonCount() { + return buttonCount; + } + + /** + * @return Whether or not this mouse has wheel support + */ + public static boolean hasWheel() { + return hasWheel; + } } |
|
From: <ci...@us...> - 2004-02-04 00:44:54
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9783/src/java/org/lwjgl/opengl Modified Files: BufferChecks.java GL11.java Log Message: New buffer bounds checking code. Incomplete. Index: BufferChecks.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/BufferChecks.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- BufferChecks.java 4 Feb 2004 00:17:13 -0000 1.1 +++ BufferChecks.java 4 Feb 2004 00:42:29 -0000 1.2 @@ -52,7 +52,7 @@ * @author cix_foo <ci...@us...> * @version $Revision$ */ -class BufferChecks { +public class BufferChecks { /** Static methods only! */ private BufferChecks() {} @@ -103,7 +103,7 @@ * Helper method to ensure that vertex buffer objects are disabled. * If they are enabled, we'll throw an OpenGLException */ - static void checkVBOdisabled() { + public static void checkVBOdisabled() { if (VBOTracker.getVBOArrayStack().getState() != 0) { throw new OpenGLException("Cannot use Buffers when VBO is enabled"); } @@ -113,7 +113,7 @@ * Helper method to ensure that vertex buffer objects are enabled. * If they are disabled, we'll throw an OpenGLException */ - static void checkVBOenabled() { + public static void checkVBOenabled() { if (VBOTracker.getVBOArrayStack().getState() == 0) { throw new OpenGLException("Cannot use offsets when VBO is disabled"); } Index: GL11.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/GL11.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- GL11.java 4 Feb 2004 00:17:13 -0000 1.3 +++ GL11.java 4 Feb 2004 00:42:29 -0000 1.4 @@ -51,6 +51,7 @@ */ public abstract class GL11 { + /* AccumOp */ public static final int GL_ACCUM = 0x0100; public static final int GL_LOAD = 0x0101; |
|
From: <ci...@us...> - 2004-02-04 00:44:54
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/arb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9783/src/java/org/lwjgl/opengl/arb Modified Files: ARBProgram.java ARBTextureCompression.java ARBVertexBlend.java ARBMatrixPalette.java ARBVertexProgram.java ARBVertexShader.java ARBVertexBufferObject.java ARBPointParameters.java ARBOcclusionQuery.java ARBTransposeMatrix.java Log Message: New buffer bounds checking code. Incomplete. Index: ARBProgram.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/arb/ARBProgram.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ARBProgram.java 20 Jan 2004 08:37:16 -0000 1.1 +++ ARBProgram.java 4 Feb 2004 00:42:29 -0000 1.2 @@ -1,236 +1,244 @@ -/* - * Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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. - */ -/* - * Created by LWJGL. - * User: spasi - * Date: 2003-11-28 - * Time: 16:32:30 - */ - -package org.lwjgl.opengl.arb; - -import java.nio.ByteBuffer; -import java.nio.Buffer; -import java.nio.IntBuffer; -import java.nio.FloatBuffer; - -class ARBProgram { - - /* - * Accepted by the <format> parameter of ProgramStringARB: - */ - public final static int GL_PROGRAM_FORMAT_ASCII_ARB = 0x8875; - - /* - * Accepted by the <pname> parameter of GetProgramivARB: - */ - public static final int GL_PROGRAM_LENGTH_ARB = 0x8627; - public static final int GL_PROGRAM_FORMAT_ARB = 0x8876; - public static final int GL_PROGRAM_BINDING_ARB = 0x8677; - public static final int GL_PROGRAM_INSTRUCTIONS_ARB = 0x88A0; - public static final int GL_MAX_PROGRAM_INSTRUCTIONS_ARB = 0x88A1; - public static final int GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB = 0x88A2; - public static final int GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB = 0x88A3; - public static final int GL_PROGRAM_TEMPORARIES_ARB = 0x88A4; - public static final int GL_MAX_PROGRAM_TEMPORARIES_ARB = 0x88A5; - public static final int GL_PROGRAM_NATIVE_TEMPORARIES_ARB = 0x88A6; - public static final int GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB = 0x88A7; - public static final int GL_PROGRAM_PARAMETERS_ARB = 0x88A8; - public static final int GL_MAX_PROGRAM_PARAMETERS_ARB = 0x88A9; - public static final int GL_PROGRAM_NATIVE_PARAMETERS_ARB = 0x88AA; - public static final int GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB = 0x88AB; - public static final int GL_PROGRAM_ATTRIBS_ARB = 0x88AC; - public static final int GL_MAX_PROGRAM_ATTRIBS_ARB = 0x88AD; - public static final int GL_PROGRAM_NATIVE_ATTRIBS_ARB = 0x88AE; - public static final int GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB = 0x88AF; - public static final int GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB = 0x88B4; - public static final int GL_MAX_PROGRAM_ENV_PARAMETERS_ARB = 0x88B5; - public static final int GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB = 0x88B6; - - /* - * Accepted by the <pname> parameter of GetProgramStringARB: - */ - public static final int GL_PROGRAM_STRING_ARB = 0x8628; - - /* - * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, - * GetFloatv, and GetDoublev: - */ - public static final int GL_PROGRAM_ERROR_POSITION_ARB = 0x864B; - public static final int GL_CURRENT_MATRIX_ARB = 0x8641; - public static final int GL_TRANSPOSE_CURRENT_MATRIX_ARB = 0x88B7; - public static final int GL_CURRENT_MATRIX_STACK_DEPTH_ARB = 0x8640; - public static final int GL_MAX_PROGRAM_MATRICES_ARB = 0x862F; - public static final int GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB = 0x862E; - - /* - * Accepted by the <name> parameter of GetString: - */ - public static final int GL_PROGRAM_ERROR_STRING_ARB = 0x8874; - - /* - * Accepted by the <mode> parameter of MatrixMode: - */ - public static final int GL_MATRIX0_ARB = 0x88C0; - public static final int GL_MATRIX1_ARB = 0x88C1; - public static final int GL_MATRIX2_ARB = 0x88C2; - public static final int GL_MATRIX3_ARB = 0x88C3; - public static final int GL_MATRIX4_ARB = 0x88C4; - public static final int GL_MATRIX5_ARB = 0x88C5; - public static final int GL_MATRIX6_ARB = 0x88C6; - public static final int GL_MATRIX7_ARB = 0x88C7; - public static final int GL_MATRIX8_ARB = 0x88C8; - public static final int GL_MATRIX9_ARB = 0x88C9; - public static final int GL_MATRIX10_ARB = 0x88CA; - public static final int GL_MATRIX11_ARB = 0x88CB; - public static final int GL_MATRIX12_ARB = 0x88CC; - public static final int GL_MATRIX13_ARB = 0x88CD; - public static final int GL_MATRIX14_ARB = 0x88CE; - public static final int GL_MATRIX15_ARB = 0x88CF; - public static final int GL_MATRIX16_ARB = 0x88D0; - public static final int GL_MATRIX17_ARB = 0x88D1; - public static final int GL_MATRIX18_ARB = 0x88D2; - public static final int GL_MATRIX19_ARB = 0x88D3; - public static final int GL_MATRIX20_ARB = 0x88D4; - public static final int GL_MATRIX21_ARB = 0x88D5; - public static final int GL_MATRIX22_ARB = 0x88D6; - public static final int GL_MATRIX23_ARB = 0x88D7; - public static final int GL_MATRIX24_ARB = 0x88D8; - public static final int GL_MATRIX25_ARB = 0x88D9; - public static final int GL_MATRIX26_ARB = 0x88DA; - public static final int GL_MATRIX27_ARB = 0x88DB; - public static final int GL_MATRIX28_ARB = 0x88DC; - public static final int GL_MATRIX29_ARB = 0x88DD; - public static final int GL_MATRIX30_ARB = 0x88DE; - public static final int GL_MATRIX31_ARB = 0x88DF; - - // --------------------------- - public static void glProgramStringARB(int target, int format, ByteBuffer string) { - nglProgramStringARB(target, format, string.remaining(), string, string.position()); - } - - private static native void nglProgramStringARB(int target, int format, int length, Buffer string, int stringOffset); - // --------------------------- - - public static native void glBindProgramARB(int target, int program); - - // --------------------------- - public static void glDeleteProgramsARB(IntBuffer programs) { - nglDeleteProgramsARB(programs.remaining(), programs, programs.position()); - } - - private static native void nglDeleteProgramsARB(int n, IntBuffer programs, int programsOffset); - // --------------------------- - - // --------------------------- - public static void glGenProgramsARB(IntBuffer programs) { - nglGenProgramsARB(programs.remaining(), programs, programs.position()); - } - - private static native void nglGenProgramsARB(int n, IntBuffer programs, int programsOffset); - // --------------------------- - - public static native void glProgramEnvParameter4fARB( - int target, - int index, - float x, - float y, - float z, - float w); - - // --------------------------- - public static void glProgramEnvParameterARB(int target, int index, FloatBuffer params) { - assert index >= 0 : "<index> must be greater than or equal to 0."; - assert params.remaining() >= 4 : "<params> must have 4 floats available."; - nglProgramEnvParameter4fvARB(target, index, params, params.position()); - } - - private static native void nglProgramEnvParameter4fvARB(int target, int index, FloatBuffer params, int paramsOffset); - // --------------------------- - - public static native void glProgramLocalParameter4fARB( - int target, - int index, - float x, - float y, - float z, - float w); - - // --------------------------- - public static void glProgramLocalParameterARB(int target, int index, FloatBuffer params) { - assert index >= 0 : "<index> must be greater than or equal to 0."; - assert params.remaining() >= 4 : "<params> must have 4 floats available."; - nglProgramLocalParameter4fvARB(target, index, params, params.position()); - } - - private static native void nglProgramLocalParameter4fvARB(int target, int index, FloatBuffer params, int paramsOffset); - // --------------------------- - - // --------------------------- - public static void glGetProgramEnvParameterARB(int target, int index, FloatBuffer params) { - assert index >= 0 : "<index> must be greater than or equal to 0."; - assert params.remaining() >= 4 : "<params> must have 4 floats available."; - nglGetProgramEnvParameterfvARB(target, index, params, params.position()); - } - - private static native void nglGetProgramEnvParameterfvARB(int target, int index, FloatBuffer params, int paramsOffset); - // --------------------------- - - // --------------------------- - public static void glGetProgramLocalParameterARB(int target, int index, FloatBuffer params) { - assert index >= 0 : "<index> must be greater than or equal to 0."; - assert params.remaining() >= 4 : "<params> must have 4 floats available."; - nglGetProgramLocalParameterfvARB(target, index, params, params.position()); - } - - private static native void nglGetProgramLocalParameterfvARB(int target, int index, FloatBuffer params, int paramsOffset); - // --------------------------- - - // --------------------------- - public static void glGetProgramARB(int target, int parameterName, IntBuffer params) { - nglGetProgramivARB(target, parameterName, params, params.position()); - } - - private static native void nglGetProgramivARB(int target, int parameterName, IntBuffer params, int paramsOffset); - // --------------------------- - - // --------------------------- - public static void glGetProgramStringARB(int target, int parameterName, ByteBuffer paramString) { - nglGetProgramStringARB(target, parameterName, paramString, paramString.position()); - } - - private static native void nglGetProgramStringARB(int target, int parameterName, Buffer paramString, int paramStringOffset); - // --------------------------- - - public static native boolean glIsProgramARB(int program); - -} +/* + * Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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. + */ +/* + * Created by LWJGL. + * User: spasi + * Date: 2003-11-28 + * Time: 16:32:30 + */ + +package org.lwjgl.opengl.arb; + +import java.nio.BufferUnderflowException; +import java.nio.ByteBuffer; +import java.nio.Buffer; +import java.nio.IntBuffer; +import java.nio.FloatBuffer; + +class ARBProgram { + + /* + * Accepted by the <format> parameter of ProgramStringARB: + */ + public final static int GL_PROGRAM_FORMAT_ASCII_ARB = 0x8875; + + /* + * Accepted by the <pname> parameter of GetProgramivARB: + */ + public static final int GL_PROGRAM_LENGTH_ARB = 0x8627; + public static final int GL_PROGRAM_FORMAT_ARB = 0x8876; + public static final int GL_PROGRAM_BINDING_ARB = 0x8677; + public static final int GL_PROGRAM_INSTRUCTIONS_ARB = 0x88A0; + public static final int GL_MAX_PROGRAM_INSTRUCTIONS_ARB = 0x88A1; + public static final int GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB = 0x88A2; + public static final int GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB = 0x88A3; + public static final int GL_PROGRAM_TEMPORARIES_ARB = 0x88A4; + public static final int GL_MAX_PROGRAM_TEMPORARIES_ARB = 0x88A5; + public static final int GL_PROGRAM_NATIVE_TEMPORARIES_ARB = 0x88A6; + public static final int GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB = 0x88A7; + public static final int GL_PROGRAM_PARAMETERS_ARB = 0x88A8; + public static final int GL_MAX_PROGRAM_PARAMETERS_ARB = 0x88A9; + public static final int GL_PROGRAM_NATIVE_PARAMETERS_ARB = 0x88AA; + public static final int GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB = 0x88AB; + public static final int GL_PROGRAM_ATTRIBS_ARB = 0x88AC; + public static final int GL_MAX_PROGRAM_ATTRIBS_ARB = 0x88AD; + public static final int GL_PROGRAM_NATIVE_ATTRIBS_ARB = 0x88AE; + public static final int GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB = 0x88AF; + public static final int GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB = 0x88B4; + public static final int GL_MAX_PROGRAM_ENV_PARAMETERS_ARB = 0x88B5; + public static final int GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB = 0x88B6; + + /* + * Accepted by the <pname> parameter of GetProgramStringARB: + */ + public static final int GL_PROGRAM_STRING_ARB = 0x8628; + + /* + * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, + * GetFloatv, and GetDoublev: + */ + public static final int GL_PROGRAM_ERROR_POSITION_ARB = 0x864B; + public static final int GL_CURRENT_MATRIX_ARB = 0x8641; + public static final int GL_TRANSPOSE_CURRENT_MATRIX_ARB = 0x88B7; + public static final int GL_CURRENT_MATRIX_STACK_DEPTH_ARB = 0x8640; + public static final int GL_MAX_PROGRAM_MATRICES_ARB = 0x862F; + public static final int GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB = 0x862E; + + /* + * Accepted by the <name> parameter of GetString: + */ + public static final int GL_PROGRAM_ERROR_STRING_ARB = 0x8874; + + /* + * Accepted by the <mode> parameter of MatrixMode: + */ + public static final int GL_MATRIX0_ARB = 0x88C0; + public static final int GL_MATRIX1_ARB = 0x88C1; + public static final int GL_MATRIX2_ARB = 0x88C2; + public static final int GL_MATRIX3_ARB = 0x88C3; + public static final int GL_MATRIX4_ARB = 0x88C4; + public static final int GL_MATRIX5_ARB = 0x88C5; + public static final int GL_MATRIX6_ARB = 0x88C6; + public static final int GL_MATRIX7_ARB = 0x88C7; + public static final int GL_MATRIX8_ARB = 0x88C8; + public static final int GL_MATRIX9_ARB = 0x88C9; + public static final int GL_MATRIX10_ARB = 0x88CA; + public static final int GL_MATRIX11_ARB = 0x88CB; + public static final int GL_MATRIX12_ARB = 0x88CC; + public static final int GL_MATRIX13_ARB = 0x88CD; + public static final int GL_MATRIX14_ARB = 0x88CE; + public static final int GL_MATRIX15_ARB = 0x88CF; + public static final int GL_MATRIX16_ARB = 0x88D0; + public static final int GL_MATRIX17_ARB = 0x88D1; + public static final int GL_MATRIX18_ARB = 0x88D2; + public static final int GL_MATRIX19_ARB = 0x88D3; + public static final int GL_MATRIX20_ARB = 0x88D4; + public static final int GL_MATRIX21_ARB = 0x88D5; + public static final int GL_MATRIX22_ARB = 0x88D6; + public static final int GL_MATRIX23_ARB = 0x88D7; + public static final int GL_MATRIX24_ARB = 0x88D8; + public static final int GL_MATRIX25_ARB = 0x88D9; + public static final int GL_MATRIX26_ARB = 0x88DA; + public static final int GL_MATRIX27_ARB = 0x88DB; + public static final int GL_MATRIX28_ARB = 0x88DC; + public static final int GL_MATRIX29_ARB = 0x88DD; + public static final int GL_MATRIX30_ARB = 0x88DE; + public static final int GL_MATRIX31_ARB = 0x88DF; + + // --------------------------- + public static void glProgramStringARB(int target, int format, ByteBuffer string) { + nglProgramStringARB(target, format, string.remaining(), string, string.position()); + } + + private static native void nglProgramStringARB(int target, int format, int length, Buffer string, int stringOffset); + // --------------------------- + + public static native void glBindProgramARB(int target, int program); + + // --------------------------- + public static void glDeleteProgramsARB(IntBuffer programs) { + nglDeleteProgramsARB(programs.remaining(), programs, programs.position()); + } + + private static native void nglDeleteProgramsARB(int n, IntBuffer programs, int programsOffset); + // --------------------------- + + // --------------------------- + public static void glGenProgramsARB(IntBuffer programs) { + nglGenProgramsARB(programs.remaining(), programs, programs.position()); + } + + private static native void nglGenProgramsARB(int n, IntBuffer programs, int programsOffset); + // --------------------------- + + public static native void glProgramEnvParameter4fARB( + int target, + int index, + float x, + float y, + float z, + float w); + + private static void checkProgramEnv(int index, Buffer buf) { + if (index < 0) { + throw new IllegalArgumentException("<index> must be greater than or equal to 0."); + } + if (buf.remaining() < 4) { + throw new BufferUnderflowException(); + } + } + + // --------------------------- + public static void glProgramEnvParameterARB(int target, int index, FloatBuffer params) { + checkProgramEnv(index, params); + nglProgramEnvParameter4fvARB(target, index, params, params.position()); + } + + private static native void nglProgramEnvParameter4fvARB(int target, int index, FloatBuffer params, int paramsOffset); + // --------------------------- + + public static native void glProgramLocalParameter4fARB( + int target, + int index, + float x, + float y, + float z, + float w); + + // --------------------------- + public static void glProgramLocalParameterARB(int target, int index, FloatBuffer params) { + checkProgramEnv(index, params); + nglProgramLocalParameter4fvARB(target, index, params, params.position()); + } + + private static native void nglProgramLocalParameter4fvARB(int target, int index, FloatBuffer params, int paramsOffset); + // --------------------------- + + // --------------------------- + public static void glGetProgramEnvParameterARB(int target, int index, FloatBuffer params) { + checkProgramEnv(index, params); + nglGetProgramEnvParameterfvARB(target, index, params, params.position()); + } + + private static native void nglGetProgramEnvParameterfvARB(int target, int index, FloatBuffer params, int paramsOffset); + // --------------------------- + + // --------------------------- + public static void glGetProgramLocalParameterARB(int target, int index, FloatBuffer params) { + checkProgramEnv(index, params); + nglGetProgramLocalParameterfvARB(target, index, params, params.position()); + } + + private static native void nglGetProgramLocalParameterfvARB(int target, int index, FloatBuffer params, int paramsOffset); + // --------------------------- + + // --------------------------- + public static void glGetProgramARB(int target, int parameterName, IntBuffer params) { + // TODO: Check buffer size + nglGetProgramivARB(target, parameterName, params, params.position()); + } + + private static native void nglGetProgramivARB(int target, int parameterName, IntBuffer params, int paramsOffset); + // --------------------------- + + // --------------------------- + public static void glGetProgramStringARB(int target, int parameterName, ByteBuffer paramString) { + // TODO: Check buffer size + nglGetProgramStringARB(target, parameterName, paramString, paramString.position()); + } + + private static native void nglGetProgramStringARB(int target, int parameterName, Buffer paramString, int paramStringOffset); + // --------------------------- + + public static native boolean glIsProgramARB(int program); + +} Index: ARBTextureCompression.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/arb/ARBTextureCompression.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- ARBTextureCompression.java 20 Jan 2004 08:37:16 -0000 1.6 +++ ARBTextureCompression.java 4 Feb 2004 00:42:29 -0000 1.7 @@ -60,95 +60,122 @@ public static final int GL_COMPRESSED_TEXTURE_FORMATS_ARB = 0x86A3; public static void glCompressedTexImage1DARB(int target, int level, int internalformat, int width, int border, int imageSize, ByteBuffer pData) { + // TODO: Check buffer size nglCompressedTexImage1DARB(target, level, internalformat, width, border, imageSize, pData, pData.position()); } public static void glCompressedTexImage1DARB(int target, int level, int internalformat, int width, int border, int imageSize, ShortBuffer pData) { + // TODO: Check buffer size nglCompressedTexImage1DARB(target, level, internalformat, width, border, imageSize, pData, pData.position()<<1); } public static void glCompressedTexImage1DARB(int target, int level, int internalformat, int width, int border, int imageSize, IntBuffer pData) { + // TODO: Check buffer size nglCompressedTexImage1DARB(target, level, internalformat, width, border, imageSize, pData, pData.position()<<2); } public static void glCompressedTexImage1DARB(int target, int level, int internalformat, int width, int border, int imageSize, FloatBuffer pData) { + // TODO: Check buffer size nglCompressedTexImage1DARB(target, level, internalformat, width, border, imageSize, pData, pData.position()<<2); } private static native void nglCompressedTexImage1DARB(int target, int level, int internalformat, int width, int border, int imageSize, Buffer pData, int pData_offset); public static void glCompressedTexImage2DARB(int target, int level, int internalformat, int width, int height, int border, int imageSize, ByteBuffer pData) { + // TODO: Check buffer size nglCompressedTexImage2DARB(target, level, internalformat, width, height, border, imageSize, pData, pData.position()); } public static void glCompressedTexImage2DARB(int target, int level, int internalformat, int width, int height, int border, int imageSize, ShortBuffer pData) { + // TODO: Check buffer size nglCompressedTexImage2DARB(target, level, internalformat, width, height, border, imageSize, pData, pData.position()<<1); } public static void glCompressedTexImage2DARB(int target, int level, int internalformat, int width, int height, int border, int imageSize, IntBuffer pData) { + // TODO: Check buffer size nglCompressedTexImage2DARB(target, level, internalformat, width, height, border, imageSize, pData, pData.position()<<2); } public static void glCompressedTexImage2DARB(int target, int level, int internalformat, int width, int height, int border, int imageSize, FloatBuffer pData) { + // TODO: Check buffer size nglCompressedTexImage2DARB(target, level, internalformat, width, height, border, imageSize, pData, pData.position()<<2); } private static native void nglCompressedTexImage2DARB(int target, int level, int internalformat, int width, int height, int border, int imageSize, Buffer pData, int pData_offset); public static void glCompressedTexImage3DARB(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, ByteBuffer pData) { + // TODO: Check buffer size nglCompressedTexImage3DARB(target, level, internalformat, width, height, depth, border, imageSize, pData, pData.position()); } public static void glCompressedTexImage3DARB(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, ShortBuffer pData) { + // TODO: Check buffer size nglCompressedTexImage3DARB(target, level, internalformat, width, height, depth, border, imageSize, pData, pData.position()<<1); } public static void glCompressedTexImage3DARB(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, IntBuffer pData) { + // TODO: Check buffer size nglCompressedTexImage3DARB(target, level, internalformat, width, height, depth, border, imageSize, pData, pData.position()<<2); } public static void glCompressedTexImage3DARB(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, FloatBuffer pData) { + // TODO: Check buffer size nglCompressedTexImage3DARB(target, level, internalformat, width, height, depth, border, imageSize, pData, pData.position()<<2); } private static native void nglCompressedTexImage3DARB(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, Buffer pData, int pData_offset); public static void glCompressedTexSubImage1DARB(int target, int level, int xoffset, int width, int border, int imageSize, ByteBuffer pData) { + // TODO: Check buffer size nglCompressedTexSubImage1DARB(target, level, xoffset, width, border, imageSize, pData, pData.position()); } public static void glCompressedTexSubImage1DARB(int target, int level, int xoffset, int width, int border, int imageSize, ShortBuffer pData) { + // TODO: Check buffer size nglCompressedTexSubImage1DARB(target, level, xoffset, width, border, imageSize, pData, pData.position()<<1); } public static void glCompressedTexSubImage1DARB(int target, int level, int xoffset, int width, int border, int imageSize, IntBuffer pData) { + // TODO: Check buffer size nglCompressedTexSubImage1DARB(target, level, xoffset, width, border, imageSize, pData, pData.position()<<2); } public static void glCompressedTexSubImage1DARB(int target, int level, int xoffset, int width, int border, int imageSize, FloatBuffer pData) { + // TODO: Check buffer size nglCompressedTexSubImage1DARB(target, level, xoffset, width, border, imageSize, pData, pData.position()<<2); } private static native void nglCompressedTexSubImage1DARB(int target, int level, int xoffset, int width, int border, int imageSize, Buffer pData, int pData_offset); public static void glCompressedTexSubImage2DARB(int target, int level, int xoffset, int yoffset, int width, int height, int border, int imageSize, ByteBuffer pData) { + // TODO: Check buffer size nglCompressedTexSubImage2DARB(target, level, xoffset, yoffset, width, height, border, imageSize, pData, pData.position()); } public static void glCompressedTexSubImage2DARB(int target, int level, int xoffset, int yoffset, int width, int height, int border, int imageSize, ShortBuffer pData) { + // TODO: Check buffer size nglCompressedTexSubImage2DARB(target, level, xoffset, yoffset, width, height, border, imageSize, pData, pData.position()<<1); } public static void glCompressedTexSubImage2DARB(int target, int level, int xoffset, int yoffset, int width, int height, int border, int imageSize, IntBuffer pData) { + // TODO: Check buffer size nglCompressedTexSubImage2DARB(target, level, xoffset, yoffset, width, height, border, imageSize, pData, pData.position()<<2); } public static void glCompressedTexSubImage2DARB(int target, int level, int xoffset, int yoffset, int width, int height, int border, int imageSize, FloatBuffer pData) { + // TODO: Check buffer size nglCompressedTexSubImage2DARB(target, level, xoffset, yoffset, width, height, border, imageSize, pData, pData.position()<<2); } private static native void nglCompressedTexSubImage2DARB(int target, int level, int xoffset, int yoffset, int width, int height, int border, int imageSize, Buffer pData, int pData_offset); public static void glCompressedTexSubImage3DARB(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int border, int imageSize, ByteBuffer pData) { + // TODO: Check buffer size nglCompressedTexSubImage3DARB(target, level, xoffset, yoffset, zoffset, width, height, depth, border, imageSize, pData, pData.position()); } public static void glCompressedTexSubImage3DARB(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int border, int imageSize, ShortBuffer pData) { + // TODO: Check buffer size nglCompressedTexSubImage3DARB(target, level, xoffset, yoffset, zoffset, width, height, depth, border, imageSize, pData, pData.position()<<1); } public static void glCompressedTexSubImage3DARB(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int border, int imageSize, IntBuffer pData) { + // TODO: Check buffer size nglCompressedTexSubImage3DARB(target, level, xoffset, yoffset, zoffset, width, height, depth, border, imageSize, pData, pData.position()<<2); } public static void glCompressedTexSubImage3DARB(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int border, int imageSize, FloatBuffer pData) { + // TODO: Check buffer size nglCompressedTexSubImage3DARB(target, level, xoffset, yoffset, zoffset, width, height, depth, border, imageSize, pData, pData.position()<<2); } private static native void nglCompressedTexSubImage3DARB(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int border, int imageSize, Buffer pData, int pData_offset); public static void glGetCompressedTexImageARB(int target, int lod, ByteBuffer pImg) { + // TODO: Check buffer size nglGetCompressedTexImageARB(target, lod, pImg, pImg.position()); } public static void glGetCompressedTexImageARB(int target, int lod, ShortBuffer pImg) { + // TODO: Check buffer size nglGetCompressedTexImageARB(target, lod, pImg, pImg.position()<<1); } public static void glGetCompressedTexImageARB(int target, int lod, IntBuffer pImg) { + // TODO: Check buffer size nglGetCompressedTexImageARB(target, lod, pImg, pImg.position()<<2); } private static native void nglGetCompressedTexImageARB(int target, int lod, Buffer pImg, int pImg_offset); Index: ARBVertexBlend.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/arb/ARBVertexBlend.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- ARBVertexBlend.java 20 Jan 2004 11:19:12 -0000 1.7 +++ ARBVertexBlend.java 4 Feb 2004 00:42:29 -0000 1.8 @@ -45,6 +45,7 @@ import java.nio.IntBuffer; import java.nio.FloatBuffer; +import org.lwjgl.opengl.BufferChecks; import org.lwjgl.opengl.VBOTracker; import org.lwjgl.opengl.GL11; @@ -128,26 +129,26 @@ private static native void nglWeightusvARB(int size, ShortBuffer psWeights, int psWeights_offset); public static void glWeightPointerARB(int size, boolean unsigned, int stride, ByteBuffer pPointer) { - assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + BufferChecks.checkVBOdisabled(); nglWeightPointerARB(size, unsigned ? GL11.GL_UNSIGNED_BYTE : GL11.GL_BYTE, stride, pPointer, pPointer.position()); } public static void glWeightPointerARB(int size, boolean unsigned, int stride, ShortBuffer pPointer) { - assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + BufferChecks.checkVBOdisabled(); nglWeightPointerARB(size, unsigned ? GL11.GL_UNSIGNED_SHORT : GL11.GL_SHORT, stride, pPointer, pPointer.position()<<1); } public static void glWeightPointerARB(int size, int stride, FloatBuffer pPointer) { - assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + BufferChecks.checkVBOdisabled(); nglWeightPointerARB(size, GL11.GL_FLOAT, stride, pPointer, pPointer.position()<<2); } public static void glWeightPointerARB(int size, boolean unsigned, int stride, IntBuffer pPointer) { - assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + BufferChecks.checkVBOdisabled(); nglWeightPointerARB(size, unsigned ? GL11.GL_UNSIGNED_INT : GL11.GL_INT, stride, pPointer, pPointer.position()<<2); } private static native void nglWeightPointerARB(int size, int type, int stride, Buffer pPointer, int pPointer_offset); public static void glWeightPointerARB(int size, int type, int stride, int buffer_offset) { - assert VBOTracker.getVBOArrayStack().getState() != 0: "Cannot use int offsets when VBO is disabled"; + BufferChecks.checkVBOenabled(); nglWeightPointerARBVBO(size, type, stride, buffer_offset); } private static native void nglWeightPointerARBVBO(int size, int type, int stride, int buffer_offset); - public static native void glVertexBlendARB(int count); + public static native void glVertexBlendARB(int count); } Index: ARBMatrixPalette.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/arb/ARBMatrixPalette.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- ARBMatrixPalette.java 20 Jan 2004 11:19:12 -0000 1.7 +++ ARBMatrixPalette.java 4 Feb 2004 00:42:29 -0000 1.8 @@ -44,6 +44,7 @@ import java.nio.ShortBuffer; import java.nio.IntBuffer; +import org.lwjgl.opengl.BufferChecks; import org.lwjgl.opengl.VBOTracker; import org.lwjgl.opengl.GL11; @@ -61,20 +62,20 @@ public static native void glCurrentPaletteMatrixARB(int index); public static void glMatrixIndexPointerARB(int size, int stride, ByteBuffer pPointer) { - assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + BufferChecks.checkVBOdisabled(); nglMatrixIndexPointerARB(size, GL11.GL_UNSIGNED_BYTE, stride, pPointer, pPointer.position()); } public static void glMatrixIndexPointerARB(int size, int stride, ShortBuffer pPointer) { - assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + BufferChecks.checkVBOdisabled(); nglMatrixIndexPointerARB(size, GL11.GL_UNSIGNED_SHORT, stride, pPointer, pPointer.position()<<1); } public static void glMatrixIndexPointerARB(int size, int stride, IntBuffer pPointer) { - assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + BufferChecks.checkVBOdisabled(); nglMatrixIndexPointerARB(size, GL11.GL_UNSIGNED_INT, stride, pPointer, pPointer.position()<<2); } private static native void nglMatrixIndexPointerARB(int size, int type, int stride, Buffer pPointer, int pPointer_offset); public static void glMatrixIndexPointerARB(int size, int type, int stride, int buffer_offset) { - assert VBOTracker.getVBOArrayStack().getState() != 0: "Cannot use int offsets when VBO is disabled"; + BufferChecks.checkVBOenabled(); nglMatrixIndexPointerARBVBO(size, type, stride, buffer_offset); } private static native void nglMatrixIndexPointerARBVBO(int size, int type, int stride, int buffer_offset); Index: ARBVertexProgram.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/arb/ARBVertexProgram.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- ARBVertexProgram.java 29 Jan 2004 22:07:02 -0000 1.8 +++ ARBVertexProgram.java 4 Feb 2004 00:42:29 -0000 1.9 @@ -1,172 +1,173 @@ -/* - * Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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. - */ -/* - * Created by LWJGL. - * User: spasi - * Date: 2003-11-28 - * Time: 16:39:44 - */ - -package org.lwjgl.opengl.arb; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.VBOTracker; -import java.nio.Buffer; -import java.nio.ByteBuffer; -import java.nio.ShortBuffer; -import java.nio.FloatBuffer; -import java.nio.IntBuffer; - -public class ARBVertexProgram extends ARBProgram { - - /* - * Accepted by the <cap> parameter of Disable, Enable, and IsEnabled, by the - * <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev, - * and by the <target> parameter of ProgramStringARB, BindProgramARB, - * ProgramEnvParameter4[df][v]ARB, ProgramLocalParameter4[df][v]ARB, - * GetProgramEnvParameter[df]vARB, GetProgramLocalParameter[df]vARB, - * GetProgramivARB, and GetProgramStringARB. - */ - public static final int GL_VERTEX_PROGRAM_ARB = 0x8620; - - /* - * Accepted by the <cap> parameter of Disable, Enable, and IsEnabled, and by - * the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and - * GetDoublev: - */ - public static final int GL_VERTEX_PROGRAM_POINT_SIZE_ARB = 0x8642; - public static final int GL_VERTEX_PROGRAM_TWO_SIDE_ARB = 0x8643; - public static final int GL_COLOR_SUM_ARB = 0x8458; - - /* - * Accepted by the <pname> parameter of GetVertexAttrib[dfi]vARB: - */ - public static final int GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB = 0x8622; - public static final int GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB = 0x8623; - public static final int GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB = 0x8624; - public static final int GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB = 0x8625; - public static final int GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB = 0x886A; - public static final int GL_CURRENT_VERTEX_ATTRIB_ARB = 0x8626; - - /* - * Accepted by the <pname> parameter of GetVertexAttribPointervARB: - */ - public static final int GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB = 0x8645; - - /* - * Accepted by the <pname> parameter of GetProgramivARB: - */ - public static final int GL_PROGRAM_ADDRESS_REGISTERS_ARB = 0x88B0; - public static final int GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB = 0x88B1; - public static final int GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB = 0x88B2; - public static final int GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB = 0x88B3; - - /* - * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, - * GetFloatv, and GetDoublev: - */ - public static final int GL_MAX_VERTEX_ATTRIBS_ARB = 0x8869; - - public static native void glVertexAttrib1sARB(int index, short x); - - public static native void glVertexAttrib1fARB(int index, float x); - - public static native void glVertexAttrib2sARB(int index, short x, short y); - - public static native void glVertexAttrib2fARB(int index, float x, float y); - - public static native void glVertexAttrib3sARB(int index, short x, short y, short z); - - public static native void glVertexAttrib3fARB(int index, float x, float y, float z); - - public static native void glVertexAttrib4sARB(int index, short x, short y, short z, short w); - - public static native void glVertexAttrib4fARB(int index, float x, float y, float z, float w); - - public static native void glVertexAttrib4NubARB(int index, byte x, byte y, byte z, byte w); - - public static void glVertexAttribPointerARB(int index, int size, boolean unsigned, boolean normalized, int stride, ByteBuffer buffer) { - assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; - nglVertexAttribPointerARB(index, size, unsigned ? GL11.GL_UNSIGNED_BYTE : GL11.GL_BYTE, normalized, stride, buffer, buffer.position()); - } - - public static void glVertexAttribPointerARB(int index, int size, boolean unsigned, boolean normalized, int stride, ShortBuffer buffer) { - assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; - nglVertexAttribPointerARB(index, size, unsigned ? GL11.GL_UNSIGNED_SHORT : GL11.GL_SHORT, normalized, stride, buffer, buffer.position() << 1); - } - - public static void glVertexAttribPointerARB(int index, int size, boolean normalized, int stride, FloatBuffer buffer) { - assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; - nglVertexAttribPointerARB(index, size, GL11.GL_FLOAT, normalized, stride, buffer, buffer.position() << 2); - } - - public static void glVertexAttribPointerARB(int index, int size, boolean unsigned, boolean normalized, int stride, IntBuffer buffer) { - assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; - nglVertexAttribPointerARB(index, size, unsigned ? GL11.GL_UNSIGNED_INT : GL11.GL_INT, normalized, stride, buffer, buffer.position() << 2); - } - - private static native void nglVertexAttribPointerARB(int index, int size, int type, boolean normalized, int stride, Buffer buffer, int bufferOffset); - - // --------------------------- - public static void glVertexAttribPointerARB(int index, int size, int type, boolean normalized, int stride, int bufferOffset) { - assert VBOTracker.getVBOArrayStack().getState() != 0: "Cannot use int offsets when VBO is disabled"; - nglVertexAttribPointerARBVBO(index, size, type, normalized, stride, bufferOffset); - } - - private static native void nglVertexAttribPointerARBVBO(int index, int size, int type, boolean normalized, int stride, int bufferOffset); - // --------------------------- - - public static native void glEnableVertexAttribArrayARB(int index); - - public static native void glDisableVertexAttribArrayARB(int index); - - // --------------------------- - public static void glGetVertexAttribARB(int index, int pname, FloatBuffer params) { - assert params.remaining() > 0 : "<params> must have at least one element available."; - nglGetVertexAttribfvARB(index, pname, params, params.position()); - } - - private static native void nglGetVertexAttribfvARB(int index, int pname, FloatBuffer params, int paramsOffset); - // --------------------------- - - // --------------------------- - public static void glGetVertexAttribARB(int index, int pname, IntBuffer params) { - assert params.remaining() > 0 : "<params> must have at least one element available."; - nglGetVertexAttribivARB(index, pname, params, params.position()); - } - - private static native void nglGetVertexAttribivARB(int index, int pname, IntBuffer params, int paramsOffset); - // --------------------------- - - public static native ByteBuffer glGetVertexAttribPointerARB(int index, int pname, int size); - -} +/* + * Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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. + */ +/* + * Created by LWJGL. + * User: spasi + * Date: 2003-11-28 + * Time: 16:39:44 + */ + +package org.lwjgl.opengl.arb; + +import org.lwjgl.opengl.BufferChecks; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.VBOTracker; +import java.nio.Buffer; +import java.nio.ByteBuffer; +import java.nio.ShortBuffer; +import java.nio.FloatBuffer; +import java.nio.IntBuffer; + +public class ARBVertexProgram extends ARBProgram { + + /* + * Accepted by the <cap> parameter of Disable, Enable, and IsEnabled, by the + * <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev, + * and by the <target> parameter of ProgramStringARB, BindProgramARB, + * ProgramEnvParameter4[df][v]ARB, ProgramLocalParameter4[df][v]ARB, + * GetProgramEnvParameter[df]vARB, GetProgramLocalParameter[df]vARB, + * GetProgramivARB, and GetProgramStringARB. + */ + public static final int GL_VERTEX_PROGRAM_ARB = 0x8620; + + /* + * Accepted by the <cap> parameter of Disable, Enable, and IsEnabled, and by + * the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev: + */ + public static final int GL_VERTEX_PROGRAM_POINT_SIZE_ARB = 0x8642; + public static final int GL_VERTEX_PROGRAM_TWO_SIDE_ARB = 0x8643; + public static final int GL_COLOR_SUM_ARB = 0x8458; + + /* + * Accepted by the <pname> parameter of GetVertexAttrib[dfi]vARB: + */ + public static final int GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB = 0x8622; + public static final int GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB = 0x8623; + public static final int GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB = 0x8624; + public static final int GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB = 0x8625; + public static final int GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB = 0x886A; + public static final int GL_CURRENT_VERTEX_ATTRIB_ARB = 0x8626; + + /* + * Accepted by the <pname> parameter of GetVertexAttribPointervARB: + */ + public static final int GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB = 0x8645; + + /* + * Accepted by the <pname> parameter of GetProgramivARB: + */ + public static final int GL_PROGRAM_ADDRESS_REGISTERS_ARB = 0x88B0; + public static final int GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB = 0x88B1; + public static final int GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB = 0x88B2; + public static final int GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB = 0x88B3; + + /* + * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, + * GetFloatv, and GetDoublev: + */ + public static final int GL_MAX_VERTEX_ATTRIBS_ARB = 0x8869; + + public static native void glVertexAttrib1sARB(int index, short x); + + public static native void glVertexAttrib1fARB(int index, float x); + + public static native void glVertexAttrib2sARB(int index, short x, short y); + + public static native void glVertexAttrib2fARB(int index, float x, float y); + + public static native void glVertexAttrib3sARB(int index, short x, short y, short z); + + public static native void glVertexAttrib3fARB(int index, float x, float y, float z); + + public static native void glVertexAttrib4sARB(int index, short x, short y, short z, short w); + + public static native void glVertexAttrib4fARB(int index, float x, float y, float z, float w); + + public static native void glVertexAttrib4NubARB(int index, byte x, byte y, byte z, byte w); + + public static void glVertexAttribPointerARB(int index, int size, boolean unsigned, boolean normalized, int stride, ByteBuffer buffer) { + BufferChecks.checkVBOdisabled(); + nglVertexAttribPointerARB(index, size, unsigned ? GL11.GL_UNSIGNED_BYTE : GL11.GL_BYTE, normalized, stride, buffer, buffer.position()); + } + + public static void glVertexAttribPointerARB(int index, int size, boolean unsigned, boolean normalized, int stride, ShortBuffer buffer) { + BufferChecks.checkVBOdisabled(); + nglVertexAttribPointerARB(index, size, unsigned ? GL11.GL_UNSIGNED_SHORT : GL11.GL_SHORT, normalized, stride, buffer, buffer.position() << 1); + } + + public static void glVertexAttribPointerARB(int index, int size, boolean normalized, int stride, FloatBuffer buffer) { + BufferChecks.checkVBOdisabled(); + nglVertexAttribPointerARB(index, size, GL11.GL_FLOAT, normalized, stride, buffer, buffer.position() << 2); + } + + public static void glVertexAttribPointerARB(int index, int size, boolean unsigned, boolean normalized, int stride, IntBuffer buffer) { + BufferChecks.checkVBOdisabled(); + nglVertexAttribPointerARB(index, size, unsigned ? GL11.GL_UNSIGNED_INT : GL11.GL_INT, normalized, stride, buffer, buffer.position() << 2); + } + + private static native void nglVertexAttribPointerARB(int index, int size, int type, boolean normalized, int stride, Buffer buffer, int bufferOffset); + + // --------------------------- + public static void glVertexAttribPointerARB(int index, int size, int type, boolean normalized, int stride, int bufferOffset) { + BufferChecks.checkVBOenabled(); + nglVertexAttribPointerARBVBO(index, size, type, normalized, stride, bufferOffset); + } + + private static native void nglVertexAttribPointerARBVBO(int index, int size, int type, boolean normalized, int stride, int bufferOffset); + // --------------------------- + + public static native void glEnableVertexAttribArrayARB(int index); + + public static native void glDisableVertexAttribArrayARB(int index); + + // --------------------------- + public static void glGetVertexAttribARB(int index, int pname, FloatBuffer params) { + // TODO: check buffer size + nglGetVertexAttribfvARB(index, pname, params, params.position()); + } + + private static native void nglGetVertexAttribfvARB(int index, int pname, FloatBuffer params, int paramsOffset); + // --------------------------- + + // --------------------------- + public static void glGetVertexAttribARB(int index, int pname, IntBuffer params) { + // TODO: check buffer size + nglGetVertexAttribivARB(index, pname, params, params.position()); + } + + private static native void nglGetVertexAttribivARB(int index, int pname, IntBuffer params, int paramsOffset); + // --------------------------- + + public static native ByteBuffer glGetVertexAttribPointerARB(int index, int pname, int size); + +} Index: ARBVertexShader.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/arb/ARBVertexShader.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ARBVertexShader.java 30 Jan 2004 20:25:48 -0000 1.1 +++ ARBVertexShader.java 4 Feb 2004 00:42:29 -0000 1.2 @@ -65,7 +65,9 @@ // --------------------------- public static void glBindAttribLocationARB(int programObj, int index, ByteBuffer name) { - assert name.get(name.limit()) == 0 : "<name> must be a null-terminated string."; + if (name.get(name.limit()) != 0) { + throw new IllegalArgumentException("<name> must be a null-terminated string."); + } nglBindAttribLocationARB(programObj, index, name, name.position()); } @@ -76,14 +78,12 @@ // --------------------------- public static void glGetActiveAttribARB(int programObj, int index, IntBuffer length, IntBuffer size, IntBuffer type, ByteBuffer name) { - assert size.remaining() > 0 : "<size> must have at least one element available."; - assert type.remaining() > 0 : "<type> must have at least one element available."; - + // TODO: check buffer size + if ( length == null ) nglGetActiveAttribARB(programObj, index, name.remaining(), null, -1, size, size.position(), type, type.position(), name, name.position()); else { - assert length.remaining() > 0 : "<length> must have at least one element available."; nglGetActiveAttribARB(programObj, index, name.remaining(), length, length.position(), size, size.position(), type, type.position(), name, name.position()); } @@ -97,7 +97,9 @@ // --------------------------- public static int glGetAttribLocationARB(int programObj, ByteBuffer name) { - assert name.get(name.limit()) == 0 : "<name> must be null-terminated."; + if (name.get(name.limit()) != 0) { + throw new IllegalArgumentException("<name> must be a null-terminated string."); + } return nglGetAttribLocationARB(programObj, name, name.position()); } Index: ARBVertexBufferObject.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/arb/ARBVertexBufferObject.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- ARBVertexBufferObject.java 20 Jan 2004 08:37:16 -0000 1.5 +++ ARBVertexBufferObject.java 4 Feb 2004 00:42:29 -0000 1.6 @@ -170,6 +170,7 @@ public static native ByteBuffer glMapBufferARB(int target, int access, int size, ByteBuffer oldBuffer); public static native boolean glUnmapBufferARB(int target); public static void glGetBufferParameterARB(int target, int pname, IntBuffer params) { + // TODO:check buffer size nglGetBufferParameterivARB(target, pname, params, params.position()); } private static native void nglGetBufferParameterivARB(int target, int pname, IntBuffer params, int params_offset); Index: ARBPointParameters.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/arb/ARBPointParameters.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- ARBPointParameters.java 20 Jan 2004 08:37:16 -0000 1.6 +++ ARBPointParameters.java 4 Feb 2004 00:42:29 -0000 1.7 @@ -50,6 +50,7 @@ public static native void glPointParameterfARB(int pname, float param); public static void glPointParameterARB(int pname, FloatBuffer pfParams) { + // TODO: check buffer size nglPointParameterfvARB(pname, pfParams, pfParams.position()); } private static native void nglPointParameterfvARB(int pname, FloatBuffer pfParams, int pfParams_offset); Index: ARBOcclusionQuery.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/arb/ARBOcclusionQuery.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ARBOcclusionQuery.java 30 Jan 2004 22:04:30 -0000 1.2 +++ ARBOcclusionQuery.java 4 Feb 2004 00:42:29 -0000 1.3 @@ -93,6 +93,7 @@ // --------------------------- public static void glGetQueryObjectiARB(int id, int pname, IntBuffer params) { + // TODO: check buffer size nglGetQueryObjectivARB(id, pname, params, params.position()); } @@ -101,6 +102,7 @@ // --------------------------- public static void glGetQueryObjectuiARB(int id, int pname, IntBuffer params) { + // TODO: check buffer size nglGetQueryObjectuivARB(id, pname, params, params.position()); } Index: ARBTransposeMatrix.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/arb/ARBTransposeMatrix.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- ARBTransposeMatrix.java 20 Jan 2004 08:37:16 -0000 1.6 +++ ARBTransposeMatrix.java 4 Feb 2004 00:42:29 -0000 1.7 @@ -39,6 +39,7 @@ */ package org.lwjgl.opengl.arb; +import java.nio.BufferUnderflowException; import java.nio.FloatBuffer; public class ARBTransposeMatrix { @@ -48,11 +49,17 @@ public static final int GL_TRANSPOSE_COLOR_MATRIX_ARB = 0x84E6; public static void glLoadTransposeMatrixARB(FloatBuffer pfMtx) { + if (pfMtx.remaining() < 16) { + throw new BufferUnderflowException(); + } nglLoadTransposeMatrixfARB(pfMtx, pfMtx.position()); } private static native void nglLoadTransposeMatrixfARB(FloatBuffer pfMtx, int pfMtx_offset); public static void glMultTransposeMatrixfARB(FloatBuffer pfMtx) { + if (pfMtx.remaining() < 16) { + throw new BufferUnderflowException(); + } nglMultTransposeMatrixfARB(pfMtx, pfMtx.position()); } private static native void nglMultTransposeMatrixfARB(FloatBuffer pfMtx, int pfMtx_offset); |
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3698/src/java/org/lwjgl/opengl Modified Files: Util.java GL12.java GL14.java GLCaps.java GL13.java GL11.java Added Files: BufferChecks.java Log Message: New buffer bounds checking code. Incomplete. --- NEW FILE: BufferChecks.java --- /* * Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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. */ package org.lwjgl.opengl; import java.nio.Buffer; import java.nio.BufferOverflowException; import java.util.HashMap; import java.util.Map; /** * $Id: BufferChecks.java,v 1.1 2004/02/04 00:17:13 cix_foo Exp $ * A class to check buffer boundaries in GL methods. Many GL methods read data from the GL * into a native Buffer at its current position. If there is unsufficient space in the buffer * when the call is made then a buffer overflow would otherwise occur and cause unexpected * behaviour, a crash, or worse, a security risk. Therefore in those methods where GL reads * data back into a buffer, we will call a bounds check method from this class to ensure that * there is sufficient space in the buffer. * * Thrown by the debug build library of the LWJGL if any OpenGL operation * causes an error. * * @author cix_foo <ci...@us...> * @version $Revision: 1.1 $ */ class BufferChecks { /** Static methods only! */ private BufferChecks() {} private static Map pixelMapMap = new HashMap(); private static Map getMap = new HashMap(); private static final Util.IntValue scratchInt = new Util.IntValue(0); static void putPixelMap(int from, int to) { pixelMapMap.put(new Util.IntValue(from), new Util.IntValue(to)); } static void putGetMap(int enum, int size) { getMap.put(new Util.IntValue(enum), new Util.IntValue(size)); } /** * Ensure that a pixel map buffer is big enough */ static void checkPixelMapBuffer(int map, Buffer buf) { scratchInt.value = map; Util.IntValue ret = (Util.IntValue) pixelMapMap.get(scratchInt); if (ret == null) { throw new OpenGLException("Unknown pixel map value "+map); } else { GL11.glGetInteger(ret.value, Util.int_buffer); int size = Util.int_buffer.get(0); if (buf.remaining() < size) { throw new BufferOverflowException(); } } } /** * Ensure that a buffer for glGet is big enough */ static void checkGetBuffer(int enum, Buffer buf) { scratchInt.value = enum; Util.IntValue ret = (Util.IntValue) getMap.get(scratchInt); if (ret == null) { throw new OpenGLException("Unknown enum glGet* "+enum); } else if (buf.remaining() < ret.value) { throw new BufferOverflowException(); } } /** * Helper method to ensure that vertex buffer objects are disabled. * If they are enabled, we'll throw an OpenGLException */ static void checkVBOdisabled() { if (VBOTracker.getVBOArrayStack().getState() != 0) { throw new OpenGLException("Cannot use Buffers when VBO is enabled"); } } /** * Helper method to ensure that vertex buffer objects are enabled. * If they are disabled, we'll throw an OpenGLException */ static void checkVBOenabled() { if (VBOTracker.getVBOArrayStack().getState() == 0) { throw new OpenGLException("Cannot use offsets when VBO is disabled"); } } } Index: Util.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/Util.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Util.java 20 Jan 2004 11:19:12 -0000 1.6 +++ Util.java 4 Feb 2004 00:17:13 -0000 1.7 @@ -41,7 +41,9 @@ */ abstract class Util { - private final static IntBuffer int_buffer = ByteBuffer.allocateDirect(4).order(ByteOrder.nativeOrder()).asIntBuffer(); + + final static IntBuffer int_buffer = ByteBuffer.allocateDirect(16).order(ByteOrder.nativeOrder()).asIntBuffer(); + /** * A helper function which is used to get the byte offset in an arbitrary buffer * based on its position @@ -62,4 +64,22 @@ GL11.glGetInteger(gl_enum, int_buffer); return int_buffer.get(0); } + + /** + * Handy mutable integer value class + */ + static final class IntValue { + int value; + IntValue(int value) { + this.value = value; + } + public boolean equals(Object obj) { + return ((IntValue) obj).value == value; + } + public int hashCode() { + return value; + } + } + + } Index: GL12.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/GL12.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- GL12.java 20 Jan 2004 11:19:12 -0000 1.1 +++ GL12.java 4 Feb 2004 00:17:13 -0000 1.2 @@ -161,41 +161,51 @@ public static final int GL_BLEND_COLOR = 0x8005; public static void glColorTable(int target, int internalFormat, int width, int format, int type, ByteBuffer data) { + // TODO: check buffer size valid nglColorTable(target, internalFormat, width, format, type, data, data.position()); } public static void glColorTable(int target, int internalFormat, int width, int format, int type, FloatBuffer data) { + // TODO: check buffer size valid nglColorTable(target, internalFormat, width, format, type, data, data.position() << 2); } private static native void nglColorTable(int target, int internalFormat, int width, int format, int type, Buffer data, int data_offset); public static void glColorSubTable(int target, int start, int count, int format, int type, ByteBuffer data) { + // TODO: check buffer size valid nglColorSubTable(target, start, count, format, type, data, data.position()); } public static void glColorSubTable(int target, int start, int count, int format, int type, FloatBuffer data) { + // TODO: check buffer size valid nglColorSubTable(target, start, count, format, type, data, data.position() << 2); } private static native void nglColorSubTable(int target, int start, int count, int format, int type, Buffer data, int data_offset); public static void glColorTableParameter(int target, int pname, IntBuffer params) { + // TODO: check buffer size valid nglColorTableParameteriv(target, pname, params, params.position()); } private static native void nglColorTableParameteriv(int target, int pname, IntBuffer params, int data_offset); public static void glColorTableParameter(int target, int pname, FloatBuffer params) { + // TODO: check buffer size valid nglColorTableParameterfv(target, pname, params, params.position()); } private static native void nglColorTableParameterfv(int target, int pname, FloatBuffer params, int data_offset); public static native void glCopyColorSubTable(int target, int start, int x, int y, int width); public static native void glCopyColorTable(int target, int internalformat, int x, int y, int width); public static void glGetColorTable(int target, int format, int type, ByteBuffer data) { + // TODO: check buffer size valid nglGetColorTable(target, format, type, data, data.position()); } public static void glGetColorTable(int target, int format, int type, FloatBuffer data) { + // TODO: check buffer size valid nglGetColorTable(target, format, type, data, data.position()); } private static native void nglGetColorTable(int target, int format, int type, Buffer data, int data_offset); public static void glGetColorTableParameter(int target, int pname, IntBuffer params) { + // TODO: check buffer size valid nglGetColorTableParameteriv(target, pname, params, params.position()); } private static native void nglGetColorTableParameteriv(int target, int pname, IntBuffer params, int params_offset); public static void glGetColorTableParameter(int target, int pname, FloatBuffer params) { + // TODO: check buffer size valid nglGetColorTableParameterfv(target, pname, params, params.position()); } private static native void nglGetColorTableParameterfv(int target, int pname, FloatBuffer params, int params_offset); @@ -204,59 +214,75 @@ public static native void glHistogram(int target, int width, int internalformat, boolean sink); public static native void glResetHistogram(int target); public static void glGetHistogram(int target, boolean reset, int format, int type, ByteBuffer values) { + // TODO: check buffer size valid nglGetHistogram(target, reset, format, type, values, values.position()); } public static void glGetHistogram(int target, boolean reset, int format, int type, ShortBuffer values) { + // TODO: check buffer size valid nglGetHistogram(target, reset, format, type, values, values.position() << 1); } public static void glGetHistogram(int target, boolean reset, int format, int type, IntBuffer values) { + // TODO: check buffer size valid nglGetHistogram(target, reset, format, type, values, values.position() << 2); } public static void glGetHistogram(int target, boolean reset, int format, int type, FloatBuffer values) { + // TODO: check buffer size valid nglGetHistogram(target, reset, format, type, values, values.position() << 2); } private static native void nglGetHistogram(int target, boolean reset, int format, int type, Buffer values, int values_offset); public static void glGetHistogramParameter(int target, int pname, FloatBuffer params) { + // TODO: check buffer size valid nglGetHistogramParameterfv(target, pname, params, params.position()); } private static native void nglGetHistogramParameterfv(int target, int pname, FloatBuffer params, int params_offset); public static void glGetHistogramParameter(int target, int pname, IntBuffer params) { + // TODO: check buffer size valid nglGetHistogramParameteriv(target, pname, params, params.position()); } private static native void nglGetHistogramParameteriv(int target, int pname, IntBuffer params, int params_offset); public static native void glMinmax(int target, int internalformat, boolean sink); public static native void glResetMinmax(int target); public static void glGetMinmax(int target, boolean reset, int format, int types, ByteBuffer values) { + // TODO: check buffer size valid nglGetMinmax(target, reset, format, types, values, values.position()); } public static void glGetMinmax(int target, boolean reset, int format, int types, ShortBuffer values) { + // TODO: check buffer size valid nglGetMinmax(target, reset, format, types, values, values.position() << 1); } public static void glGetMinmax(int target, boolean reset, int format, int types, IntBuffer values) { + // TODO: check buffer size valid nglGetMinmax(target, reset, format, types, values, values.position() << 2); } public static void glGetMinmax(int target, boolean reset, int format, int types, FloatBuffer values) { + // TODO: check buffer size valid nglGetMinmax(target, reset, format, types, values, values.position() << 2); } private static native void nglGetMinmax(int target, boolean reset, int format, int types, Buffer values, int values_offset); public static void glGetMinmaxParameter(int target, int pname, FloatBuffer params) { + // TODO: check buffer size valid nglGetMinmaxParameterfv(target, pname, params, params.position()); } private static native void nglGetMinmaxParameterfv(int target, int pname, FloatBuffer params, int params_offset); public static void glGetMinmaxParameter(int target, int pname, IntBuffer params) { + // TODO: check buffer size valid nglGetMinmaxParameteriv(target, pname, params, params.position()); } private static native void nglGetMinmaxParameteriv(int target, int pname, IntBuffer params, int params_offset); public static void glConvolutionFilter1D(int target, int internalformat, int width, int format, int type, ByteBuffer image) { + // TODO: check buffer size valid nglConvolutionFilter1D(target, internalformat, width, format, type, image, image.position()); } public static void glConvolutionFilter1D(int target, int internalformat, int width, int format, int type, ShortBuffer image) { + // TODO: check buffer size valid nglConvolutionFilter1D(target, internalformat, width, format, type, image, image.position()); } public static void glConvolutionFilter1D(int target, int internalformat, int width, int format, int type, IntBuffer image) { + // TODO: check buffer size valid nglConvolutionFilter1D(target, internalformat, width, format, type, image, image.position()); } public static void glConvolutionFilter1D(int target, int internalformat, int width, int format, int type, FloatBuffer image) { + // TODO: check buffer size valid nglConvolutionFilter1D(target, internalformat, width, format, type, image, image.position()); } private static native void nglConvolutionFilter1D(int target, int internalformat, int width, int format, int type, Buffer image, int image_offset); @@ -265,85 +291,104 @@ private static native void nglConvolutionFilter2D(int target, int internalformat, int width, int height, int format, int type, Buffer image, int image_offset); public static native void glConvolutionParameterf(int target, int pname, float params); public static void glConvolutionParameter(int target, int pname, FloatBuffer params) { + // TODO: check buffer size valid + nglConvolutionParameterfv(target, pname, params, params.position()); } private static native void nglConvolutionParameterfv(int target, int pname, FloatBuffer params, int params_offset); public static native void glConvolutionParameteri(int target, int pname, int params); public static void glConvolutionParameteriv(int target, int pname, IntBuffer params) { + // TODO: check buffer size valid nglConvolutionParameteriv(target, pname, params, params.position()); } private static native void nglConvolutionParameteriv(int target, int pname, IntBuffer params, int params_offset); public static native void glCopyConvolutionFilter1D(int target, int internalformat, int x, int y, int width); public static native void glCopyConvolutionFilter2D(int target, int internalformat, int x, int y, int width, int height); public static void glGetConvolutionFilter(int target, int format, int type, ByteBuffer image) { + // TODO: check buffer size valid nglGetConvolutionFilter(target, format, type, image, image.position()); } public static void glGetConvolutionFilter(int target, int format, int type, ShortBuffer image) { + // TODO: check buffer size valid nglGetConvolutionFilter(target, format, type, image, image.position() << 1); } public static void glGetConvolutionFilter(int target, int format, int type, IntBuffer image) { + // TODO: check buffer size valid nglGetConvolutionFilter(target, format, type, image, image.position() << 2); } public static void glGetConvolutionFilter(int target, int format, int type, FloatBuffer image) { + // TODO: check buffer size valid nglGetConvolutionFilter(target, format, type, image, image.position() << 2); } private static native void nglGetConvolutionFilter(int target, int format, int type, Buffer image, int image_offset); public static void glGetConvolutionParameter(int target, int pname, FloatBuffer params) { + // TODO: check buffer size valid nglGetConvolutionParameterfv(target, pname, params, params.position()); } private static native void nglGetConvolutionParameterfv(int target, int pname, FloatBuffer params, int params_offset); public static void glGetConvolutionParameter(int target, int pname, IntBuffer params) { + // TODO: check buffer size valid nglGetConvolutionParameteriv(target, pname, params, params.position()); } private static native void nglGetConvolutionParameteriv(int target, int pname, IntBuffer params, int params_offset); public static void glSeparableFilter2D(int target, int internalformat, int width, int height, int format, int type, Buffer row, Buffer column) { + // TODO: check buffer size valid nglSeparableFilter2D(target, internalformat, width, height, format, type, row, Util.getOffset(row), column, Util.getOffset(column)); } private static native void nglSeparableFilter2D(int target, int internalformat, int width, int height, int format, int type, Buffer row, int row_offset, Buffer column, int column_offset); public static void glGetSeparableFilter(int target, int format, int type, Buffer row, Buffer column, Buffer span) { + // TODO: check buffer size valid nglGetSeparableFilter(target, format, type, row, Util.getOffset(row), column, Util.getOffset(column), span, Util.getOffset(span)); } private static native void nglGetSeparableFilter(int target, int format, int type, Buffer row, int row_offset, Buffer column, int column_offset, Buffer span, int span_offset); public static void glDrawRangeElements(int mode, int start, int end, ByteBuffer indices) { - assert VBOTracker.getVBOElementStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + BufferChecks.checkVBOdisabled(); nglDrawRangeElements(mode, start, end, indices.remaining(), GL_UNSIGNED_BYTE, indices, indices.position()); } public static void glDrawRangeElements(int mode, int start, int end, ShortBuffer indices) { - assert VBOTracker.getVBOElementStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + BufferChecks.checkVBOdisabled(); nglDrawRangeElements(mode, start, end, indices.remaining(), GL_UNSIGNED_SHORT, indices, indices.position() << 1); } public static void glDrawRangeElements(int mode, int start, int end, IntBuffer indices) { - assert VBOTracker.getVBOElementStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + BufferChecks.checkVBOdisabled(); nglDrawRangeElements(mode, start, end, indices.remaining(), GL_UNSIGNED_INT, indices, indices.position() << 2); } private static native void nglDrawRangeElements(int mode, int start, int end, int count, int type, Buffer indices, int indices_offset); public static void glDrawRangeElements(int mode, int start, int end, int count, int type, int buffer_offset) { - assert VBOTracker.getVBOElementStack().getState() != 0: "Cannot use int offsets when VBO is disabled"; + BufferChecks.checkVBOenabled(); nglDrawRangeElementsVBO(mode, start, end, count, type, buffer_offset); } private static native void nglDrawRangeElementsVBO(int mode, int start, int end, int count, int type, int buffer_offset); public static void glTexImage3D(int target, int level, int internalFormat, int width, int height, int depth, int border, int format, int type, ByteBuffer pixels) { + // TODO: check buffer size valid nglTexImage3D(target, level, internalFormat, width, height, depth, border, format, type, pixels, pixels.position()); } public static void glTexImage3D(int target, int level, int internalFormat, int width, int height, int depth, int border, int format, int type, ShortBuffer pixels) { + // TODO: check buffer size valid nglTexImage3D(target, level, internalFormat, width, height, depth, border, format, type, pixels, pixels.position() << 1); } public static void glTexImage3D(int target, int level, int internalFormat, int width, int height, int depth, int border, int format, int type, IntBuffer pixels) { + // TODO: check buffer size valid nglTexImage3D(target, level, internalFormat, width, height, depth, border, format, type, pixels, pixels.position() << 2); } public static void glTexImage3D(int target, int level, int internalFormat, int width, int height, int depth, int border, int format, int type, FloatBuffer pixels) { + // TODO: check buffer size valid nglTexImage3D(target, level, internalFormat, width, height, depth, border, format, type, pixels, pixels.position() << 2); } private static native void nglTexImage3D(int target, int level, int internalFormat, int width, int height, int depth, int border, int format, int type, Buffer pixels, int pixels_offset); public static void glTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, ByteBuffer pixels) { + // TODO: check buffer size valid nglTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels, pixels.position()); } public static void glTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, ShortBuffer pixels) { + // TODO: check buffer size valid nglTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels, pixels.position() << 1); } public static void glTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, IntBuffer pixels) { + // TODO: check buffer size valid nglTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels, pixels.position() << 2); } public static void glTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, FloatBuffer pixels) { + // TODO: check buffer size valid nglTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels, pixels.position() << 2); } private static native void nglTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, Buffer pixels, int pixels_offset); Index: GL14.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/GL14.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- GL14.java 20 Jan 2004 11:19:12 -0000 1.1 +++ GL14.java 4 Feb 2004 00:17:13 -0000 1.2 @@ -88,23 +88,26 @@ public static native void glFogCoordf(float coord); public static void glFogCoordPointer(int stride, FloatBuffer data) { - assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + BufferChecks.checkVBOdisabled(); nglFogCoordPointer(GL_FLOAT, stride, data, data.position() << 2); } private static native void nglFogCoordPointer(int type, int stride, Buffer data, int data_offset); public static void glFogCoordPointer(int type, int stride, int buffer_offset) { - assert VBOTracker.getVBOArrayStack().getState() != 0: "Cannot use int offsets when VBO is disabled"; + BufferChecks.checkVBOenabled(); nglFogCoordPointerVBO(type, stride, buffer_offset); } private static native void nglFogCoordPointerVBO(int type, int stride, int buffer_offset); public static void glMultiDrawArrays(int mode, IntBuffer piFirst, IntBuffer piCount) { - assert piFirst.remaining() == piCount.remaining(): "piFirst.remaining() != piCount.remaining()"; + if (piFirst.remaining() != piCount.remaining()) { + throw new IllegalArgumentException("piFirst.remaining() != piCount.remaining()"); + } nglMultiDrawArrays(mode, piFirst, piFirst.position(), piCount, piCount.position(), piFirst.remaining()); } private static native void nglMultiDrawArrays(int mode, IntBuffer piFirst, int piFirst_offset, IntBuffer piCount, int piCount_offset, int primcount); /* public static native void glMultiDrawElements(int mode, int piCount, int type, int pIndices, int primcount);*/ public static native void glPointParameterf (int pname, float param); public static void glPointParameter(int pname, FloatBuffer params) { + // TODO: check buffer size valid nglPointParameterfv(pname, params, params.position()); } private static native void nglPointParameterfv(int pname, FloatBuffer params, int params_offset); @@ -112,16 +115,16 @@ public static native void glSecondaryColor3f (float red, float green, float blue); public static native void glSecondaryColor3ub (byte red, byte green, byte blue); public static void glSecondaryColorPointer(int size, boolean unsigned, int stride, ByteBuffer data) { - assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + BufferChecks.checkVBOdisabled(); nglSecondaryColorPointer(size, unsigned ? GL_UNSIGNED_BYTE : GL_BYTE, stride, data, data.position()); } public static void glSecondaryColorPointer(int size, int stride, FloatBuffer data) { - assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + BufferChecks.checkVBOdisabled(); nglSecondaryColorPointer(size, GL_FLOAT, stride, data, data.position() << 2); } private static native void nglSecondaryColorPointer (int size, int type, int stride, Buffer data, int data_offset); public static void glSecondaryColorPointer(int size, int type, int stride, int buffer_offset) { - assert VBOTracker.getVBOArrayStack().getState() != 0: "Cannot use int offsets when VBO is disabled"; + BufferChecks.checkVBOenabled(); nglSecondaryColorPointerVBO(size, type, stride, buffer_offset); } private static native void nglSecondaryColorPointerVBO(int size, int type, int stride, int buffer_offset); Index: GLCaps.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/GLCaps.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- GLCaps.java 30 Jan 2004 20:32:06 -0000 1.19 +++ GLCaps.java 4 Feb 2004 00:17:13 -0000 1.20 @@ -37,8 +37,8 @@ import java.lang.reflect.*; import java.lang.reflect.Field; import java.util.HashMap; -import java.util.HashSet; import java.util.Iterator; +import java.util.Set; /** * $Id$ @@ -165,7 +165,7 @@ System.loadLibrary(Sys.getLibraryName()); } - private static void setExtensionFields(HashSet exts, HashMap field_map) { + private static void setExtensionFields(Set exts, HashMap field_map) { Sys.log("Available extensions:"); Iterator it = exts.iterator(); while ( it.hasNext() ) { @@ -186,9 +186,13 @@ /** * Determine which extensions are available. Use this to initialize capability fields. Can only be - * called _after_ a GLWindow or Pbuffer has been created. + * called _after_ a GLWindow or Pbuffer has been created (or a context from some other GL library). + * Using LWJGL, this method is called automatically for you when the LWJGL Window is created and there + * is no need to call it yourself. + * + * @param exts A Set of OpenGL extension string names */ - static void determineAvailableExtensions(HashSet exts) { + public static void determineAvailableExtensions(Set exts) { // Grab all the public static booleans out of this class Field[] fields = GLCaps.class.getDeclaredFields(); HashMap map = new HashMap(fields.length); Index: GL13.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/GL13.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- GL13.java 20 Jan 2004 11:19:12 -0000 1.1 +++ GL13.java 4 Feb 2004 00:17:13 -0000 1.2 @@ -148,90 +148,117 @@ public static native void glActiveTexture(int texture); public static native void glClientActiveTexture(int texture); public static void glCompressedTexImage1D(int target, int level, int internalformat, int width, int border, int imageSize, ByteBuffer data) { + // TODO: check buffer size valid nglCompressedTexImage1D(target, level, internalformat, width, border, imageSize, data, data.position()); } public static void glCompressedTexImage1D(int target, int level, int internalformat, int width, int border, int imageSize, ShortBuffer data) { + // TODO: check buffer size valid nglCompressedTexImage1D(target, level, internalformat, width, border, imageSize, data, data.position() << 1); } public static void glCompressedTexImage1D(int target, int level, int internalformat, int width, int border, int imageSize, IntBuffer data) { + // TODO: check buffer size valid nglCompressedTexImage1D(target, level, internalformat, width, border, imageSize, data, data.position() << 2); } public static void glCompressedTexImage1D(int target, int level, int internalformat, int width, int border, int imageSize, FloatBuffer data) { + // TODO: check buffer size valid nglCompressedTexImage1D(target, level, internalformat, width, border, imageSize, data, data.position() << 2); } private static native void nglCompressedTexImage1D(int target, int level, int internalformat, int width, int border, int imageSize, Buffer data, int data_offset); public static void glCompressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, int imageSize, ByteBuffer data) { + // TODO: check buffer size valid nglCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data, data.position()); } public static void glCompressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, int imageSize, ShortBuffer data) { + // TODO: check buffer size valid nglCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data, data.position() << 1); } public static void glCompressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, int imageSize, IntBuffer data) { + // TODO: check buffer size valid nglCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data, data.position() << 2); } public static void glCompressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, int imageSize, FloatBuffer data) { + // TODO: check buffer size valid nglCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data, data.position() << 2); } private static native void nglCompressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, int imageSize, Buffer data, int data_offset); public static void glCompressedTexImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, ByteBuffer data) { + // TODO: check buffer size valid nglCompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data, data.position()); } public static void glCompressedTexImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, ShortBuffer data) { + // TODO: check buffer size valid nglCompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data, data.position() << 1); } public static void glCompressedTexImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, IntBuffer data) { + // TODO: check buffer size valid nglCompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data, data.position() << 2); } public static void glCompressedTexImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, FloatBuffer data) { + // TODO: check buffer size valid nglCompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data, data.position() << 2); } private static native void nglCompressedTexImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, Buffer data, int data_offset); public static void glCompressedTexSubImage1D(int target, int level, int xoffset, int width, int format, int imageSize, ByteBuffer data) { + // TODO: check buffer size valid nglCompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, data, data.position()); } public static void glCompressedTexSubImage1D(int target, int level, int xoffset, int width, int format, int imageSize, ShortBuffer data) { + // TODO: check buffer size valid nglCompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, data, data.position() << 1); } public static void glCompressedTexSubImage1D(int target, int level, int xoffset, int width, int format, int imageSize, IntBuffer data) { + // TODO: check buffer size valid nglCompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, data, data.position() << 2); } public static void glCompressedTexSubImage1D(int target, int level, int xoffset, int width, int format, int imageSize, FloatBuffer data) { + // TODO: check buffer size valid nglCompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, data, data.position() << 2); } private static native void nglCompressedTexSubImage1D(int target, int level, int xoffset, int width, int format, int imageSize, Buffer data, int data_offset); public static void glCompressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, ByteBuffer data) { + // TODO: check buffer size valid nglCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data, data.position()); } public static void glCompressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, ShortBuffer data) { + // TODO: check buffer size valid nglCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data, data.position() << 1); } public static void glCompressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, IntBuffer data) { + // TODO: check buffer size valid nglCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data, data.position() << 2); } public static void glCompressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, FloatBuffer data) { + // TODO: check buffer size valid nglCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data, data.position() << 2); } private static native void nglCompressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, Buffer data, int data_offset); public static void glCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, ByteBuffer data) { + // TODO: check buffer size valid nglCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data, data.position()); } public static void glCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, ShortBuffer data) { + // TODO: check buffer size valid nglCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data, data.position() << 1); } public static void glCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, IntBuffer data) { + // TODO: check buffer size valid nglCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data, data.position() << 2); } public static void glCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, FloatBuffer data) { + // TODO: check buffer size valid nglCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data, data.position() << 2); } private static native void nglCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, Buffer data, int data_offset); public static void glGetCompressedTexImage(int target, int lod, ByteBuffer img) { + // TODO: check buffer size valid nglGetCompressedTexImage(target, lod, img, img.position()); } public static void glGetCompressedTexImage(int target, int lod, ShortBuffer img) { + // TODO: check buffer size valid nglGetCompressedTexImage(target, lod, img, img.position() << 1); } public static void glGetCompressedTexImage(int target, int lod, IntBuffer img) { + // TODO: check buffer size valid nglGetCompressedTexImage(target, lod, img, img.position() << 2); } private static native void nglGetCompressedTexImage(int target, int lod, Buffer img, int img_offset); @@ -240,10 +267,16 @@ public static native void glMultiTexCoord3f(int target, float s, float t, float r); public static native void glMultiTexCoord4f(int target, float s, float t, float r, float q); public static void glLoadTransposeMatrix(FloatBuffer m) { + if (m.remaining() < 16) { + throw new BufferUnderflowException(); + } nglLoadTransposeMatrixf(m, m.position()); } private static native void nglLoadTransposeMatrixf(FloatBuffer m, int m_offset); public static void glMultTransposeMatrix(FloatBuffer m) { + if (m.remaining() < 16) { + throw new BufferUnderflowException(); + } nglMultTransposeMatrixf(m, m.position()); } private static native void nglMultTransposeMatrixf(FloatBuffer m, int m_offset); Index: GL11.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/GL11.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- GL11.java 26 Jan 2004 17:12:21 -0000 1.2 +++ GL11.java 4 Feb 2004 00:17:13 -0000 1.3 @@ -38,6 +38,8 @@ import java.nio.FloatBuffer; import java.nio.DoubleBuffer; import java.nio.Buffer; +import java.util.HashMap; +import java.util.Map; /** * $Id$ @@ -718,6 +720,222 @@ public static final int GL_LOGIC_OP = GL_INDEX_LOGIC_OP; public static final int GL_TEXTURE_COMPONENTS = GL_TEXTURE_INTERNAL_FORMAT; + /* + * Register buffer checking maps + */ + static { + // For glGetPixelMap + BufferChecks.putPixelMap(GL_PIXEL_MAP_S_TO_S, GL_PIXEL_MAP_S_TO_S_SIZE); + BufferChecks.putPixelMap(GL_PIXEL_MAP_I_TO_R, GL_PIXEL_MAP_I_TO_R_SIZE); + BufferChecks.putPixelMap(GL_PIXEL_MAP_I_TO_G, GL_PIXEL_MAP_I_TO_G_SIZE); + BufferChecks.putPixelMap(GL_PIXEL_MAP_I_TO_G, GL_PIXEL_MAP_I_TO_B_SIZE); + BufferChecks.putPixelMap(GL_PIXEL_MAP_I_TO_A, GL_PIXEL_MAP_I_TO_A_SIZE); + BufferChecks.putPixelMap(GL_PIXEL_MAP_R_TO_R, GL_PIXEL_MAP_R_TO_R_SIZE); + BufferChecks.putPixelMap(GL_PIXEL_MAP_G_TO_G, GL_PIXEL_MAP_G_TO_G_SIZE); + BufferChecks.putPixelMap(GL_PIXEL_MAP_B_TO_B, GL_PIXEL_MAP_B_TO_B_SIZE); + BufferChecks.putPixelMap(GL_PIXEL_MAP_B_TO_B, GL_PIXEL_MAP_A_TO_A_SIZE); + + // For glGetIntegerv/glGetFloatv/glGetBooleanv/glGetDoublev + BufferChecks.putGetMap(GL_ACCUM_ALPHA_BITS, 1); + BufferChecks.putGetMap(GL_ACCUM_BLUE_BITS, 1); + BufferChecks.putGetMap(GL_ACCUM_CLEAR_VALUE, 4); + BufferChecks.putGetMap(GL_ACCUM_GREEN_BITS, 1); + BufferChecks.putGetMap(GL_ACCUM_RED_BITS, 1); + BufferChecks.putGetMap(GL_ALPHA_BIAS, 1); + BufferChecks.putGetMap(GL_ALPHA_BITS, 1); + BufferChecks.putGetMap(GL_ALPHA_SCALE, 1); + BufferChecks.putGetMap(GL_ALPHA_TEST, 1); + BufferChecks.putGetMap(GL_ALPHA_TEST_FUNC, 1); + BufferChecks.putGetMap(GL_ALPHA_TEST_REF, 1); + BufferChecks.putGetMap(GL_ATTRIB_STACK_DEPTH, 1); + BufferChecks.putGetMap(GL_AUTO_NORMAL, 1); + BufferChecks.putGetMap(GL_AUX_BUFFERS, 1); + BufferChecks.putGetMap(GL_BLEND, 1); + BufferChecks.putGetMap(GL_BLEND_DST, 1); + BufferChecks.putGetMap(GL_BLEND_SRC, 1); + BufferChecks.putGetMap(GL_BLUE_BIAS, 1); + BufferChecks.putGetMap(GL_BLUE_BITS, 1); + BufferChecks.putGetMap(GL_BLUE_SCALE, 1); + BufferChecks.putGetMap(GL_CLIP_PLANE0, 1); + BufferChecks.putGetMap(GL_CLIP_PLANE1, 1); + BufferChecks.putGetMap(GL_CLIP_PLANE2, 1); + BufferChecks.putGetMap(GL_CLIP_PLANE3, 1); + BufferChecks.putGetMap(GL_CLIP_PLANE4, 1); + BufferChecks.putGetMap(GL_CLIP_PLANE5, 1); + BufferChecks.putGetMap(GL_COLOR_CLEAR_VALUE, 4); + BufferChecks.putGetMap(GL_COLOR_MATERIAL, 1); + BufferChecks.putGetMap(GL_COLOR_MATERIAL_FACE, 1); + BufferChecks.putGetMap(GL_COLOR_MATERIAL_PARAMETER, 1); + BufferChecks.putGetMap(GL_COLOR_WRITEMASK, 4); + BufferChecks.putGetMap(GL_CULL_FACE, 1); + BufferChecks.putGetMap(GL_CULL_FACE_MODE, 1); + BufferChecks.putGetMap(GL_CURRENT_COLOR, 4); + BufferChecks.putGetMap(GL_CURRENT_INDEX, 1); + BufferChecks.putGetMap(GL_CURRENT_NORMAL, 3); + BufferChecks.putGetMap(GL_CURRENT_RASTER_COLOR, 4); + BufferChecks.putGetMap(GL_CURRENT_RASTER_INDEX, 1); + BufferChecks.putGetMap(GL_CURRENT_RASTER_POSITION, 4); + BufferChecks.putGetMap(GL_CURRENT_RASTER_TEXTURE_COORDS, 4); + BufferChecks.putGetMap(GL_CURRENT_RASTER_POSITION_VALID, 1); + BufferChecks.putGetMap(GL_CURRENT_TEXTURE_COORDS, 4); + BufferChecks.putGetMap(GL_DEPTH_BITS, 1); + BufferChecks.putGetMap(GL_DEPTH_CLEAR_VALUE, 1); + BufferChecks.putGetMap(GL_DEPTH_FUNC, 1); + BufferChecks.putGetMap(GL_DEPTH_RANGE, 2); + BufferChecks.putGetMap(GL_DEPTH_WRITEMASK, 1); + BufferChecks.putGetMap(GL_DOUBLEBUFFER, 1); + BufferChecks.putGetMap(GL_DRAW_BUFFER, 1); + BufferChecks.putGetMap(GL_EDGE_FLAG, 1); + BufferChecks.putGetMap(GL_FOG, 1); + BufferChecks.putGetMap(GL_FOG_COLOR, 4); + BufferChecks.putGetMap(GL_FOG_DENSITY, 1); + BufferChecks.putGetMap(GL_FOG_END, 1); + BufferChecks.putGetMap(GL_FOG_HINT, 1); + BufferChecks.putGetMap(GL_FOG_INDEX, 1); + BufferChecks.putGetMap(GL_FOG_MODE, 1); + BufferChecks.putGetMap(GL_FOG_START, 1); + BufferChecks.putGetMap(GL_FRONT_FACE, 1); + BufferChecks.putGetMap(GL_GREEN_BIAS, 1); + BufferChecks.putGetMap(GL_GREEN_BITS, 1); + BufferChecks.putGetMap(GL_GREEN_SCALE, 1); + BufferChecks.putGetMap(GL_INDEX_BITS, 1); + BufferChecks.putGetMap(GL_INDEX_CLEAR_VALUE, 1); + BufferChecks.putGetMap(GL_INDEX_MODE, 1); + BufferChecks.putGetMap(GL_INDEX_OFFSET, 1); + BufferChecks.putGetMap(GL_INDEX_SHIFT, 1); + BufferChecks.putGetMap(GL_INDEX_WRITEMASK, 1); + BufferChecks.putGetMap(GL_LIGHT0, 1); + BufferChecks.putGetMap(GL_LIGHT1, 1); + BufferChecks.putGetMap(GL_LIGHT2, 1); + BufferChecks.putGetMap(GL_LIGHT3, 1); + BufferChecks.putGetMap(GL_LIGHT4, 1); + BufferChecks.putGetMap(GL_LIGHT5, 1); + BufferChecks.putGetMap(GL_LIGHT6, 1); + BufferChecks.putGetMap(GL_LIGHT7, 1); + BufferChecks.putGetMap(GL_LIGHTING, 1); + BufferChecks.putGetMap(GL_LIGHT_MODEL_AMBIENT, 4); + BufferChecks.putGetMap(GL_LIGHT_MODEL_LOCAL_VIEWER, 1); + BufferChecks.putGetMap(GL_LIGHT_MODEL_TWO_SIDE, 1); + BufferChecks.putGetMap(GL_LINE_SMOOTH, 1); + BufferChecks.putGetMap(GL_LINE_STIPPLE, 1); + BufferChecks.putGetMap(GL_LINE_STIPPLE_PATTERN, 1); + BufferChecks.putGetMap(GL_LINE_STIPPLE_REPEAT, 1); + BufferChecks.putGetMap(GL_LINE_WIDTH, 1); + BufferChecks.putGetMap(GL_LINE_WIDTH_GRANULARITY, 1); + BufferChecks.putGetMap(GL_LINE_WIDTH_RANGE, 2); + BufferChecks.putGetMap(GL_LIST_BASE, 1); + BufferChecks.putGetMap(GL_LIST_INDEX, 1); + BufferChecks.putGetMap(GL_LIST_MODE, 1); + BufferChecks.putGetMap(GL_LOGIC_OP, 1); + BufferChecks.putGetMap(GL_LOGIC_OP_MODE, 1); + BufferChecks.putGetMap(GL_MAP1_COLOR_4, 1); + BufferChecks.putGetMap(GL_MAP1_GRID_DOMAIN, 2); + BufferChecks.putGetMap(GL_MAP1_GRID_SEGMENTS, 1); + BufferChecks.putGetMap(GL_MAP1_INDEX, 1); + BufferChecks.putGetMap(GL_MAP1_NORMAL, 1); + BufferChecks.putGetMap(GL_MAP1_TEXTURE_COORD_1, 1); + BufferChecks.putGetMap(GL_MAP1_TEXTURE_COORD_2, 1); + BufferChecks.putGetMap(GL_MAP1_TEXTURE_COORD_3, 1); + BufferChecks.putGetMap(GL_MAP1_TEXTURE_COORD_4, 1); + BufferChecks.putGetMap(GL_MAP1_VERTEX_3, 1); + BufferChecks.putGetMap(GL_MAP1_VERTEX_4, 1); + BufferChecks.putGetMap(GL_MAP2_COLOR_4, 1); + BufferChecks.putGetMap(GL_MAP2_GRID_DOMAIN, 4); + BufferChecks.putGetMap(GL_MAP2_GRID_SEGMENTS, 2); + BufferChecks.putGetMap(GL_MAP2_INDEX, 1); + BufferChecks.putGetMap(GL_MAP2_NORMAL, 1); + BufferChecks.putGetMap(GL_MAP2_TEXTURE_COORD_1, 1); + BufferChecks.putGetMap(GL_MAP2_TEXTURE_COORD_2, 1); + BufferChecks.putGetMap(GL_MAP2_TEXTURE_COORD_3, 1); + BufferChecks.putGetMap(GL_MAP2_TEXTURE_COORD_4, 1); + BufferChecks.putGetMap(GL_MAP2_VERTEX_3, 1); + BufferChecks.putGetMap(GL_MAP2_VERTEX_4, 1); + BufferChecks.putGetMap(GL_MAP_COLOR, 1); + BufferChecks.putGetMap(GL_MAP_STENCIL, 1); + BufferChecks.putGetMap(GL_MATRIX_MODE, 1); + BufferChecks.putGetMap(GL_MAX_ATTRIB_STACK_DEPTH, 1); + BufferChecks.putGetMap(GL_MAX_CLIENT_ATTRIB_STACK_DEPTH, 1); + BufferChecks.putGetMap(GL_MAX_CLIP_PLANES, 1); + BufferChecks.putGetMap(GL_MAX_EVAL_ORDER, 1); + BufferChecks.putGetMap(GL_MAX_LIGHTS, 1); + BufferChecks.putGetMap(GL_MAX_LIST_NESTING, 1); + BufferChecks.putGetMap(GL_MAX_MODELVIEW_STACK_DEPTH, 1); + BufferChecks.putGetMap(GL_MAX_NAME_STACK_DEPTH, 1); + BufferChecks.putGetMap(GL_MAX_PIXEL_MAP_TABLE, 1); + BufferChecks.putGetMap(GL_MAX_PROJECTION_STACK_DEPTH, 1); + BufferChecks.putGetMap(GL_MAX_TEXTURE_SIZE, 1); + BufferChecks.putGetMap(GL_MAX_TEXTURE_STACK_DEPTH, 1); + BufferChecks.putGetMap(GL_MAX_VIEWPORT_DIMS, 2); + BufferChecks.putGetMap(GL_MODELVIEW_MATRIX, 16); + BufferChecks.putGetMap(GL_MODELVIEW_STACK_DEPTH, 1); + BufferChecks.putGetMap(GL_NAME_STACK_DEPTH, 1); + BufferChecks.putGetMap(GL_NORMALIZE, 1); + BufferChecks.putGetMap(GL_PACK_ALIGNMENT, 1); + BufferChecks.putGetMap(GL_PACK_LSB_FIRST, 1); + BufferChecks.putGetMap(GL_PACK_ROW_LENGTH, 1); + BufferChecks.putGetMap(GL_PACK_SKIP_PIXELS, 1); + BufferChecks.putGetMap(GL_PACK_SKIP_ROWS, 1); + BufferChecks.putGetMap(GL_PACK_SWAP_BYTES, 1); + BufferChecks.putGetMap(GL_PIXEL_MAP_A_TO_A_SIZE, 1); + BufferChecks.putGetMap(GL_PIXEL_MAP_B_TO_B_SIZE, 1); + BufferChecks.putGetMap(GL_PIXEL_MAP_G_TO_G_SIZE, 1); + BufferChecks.putGetMap(GL_PIXEL_MAP_I_TO_A_SIZE, 1); + BufferChecks.putGetMap(GL_PIXEL_MAP_I_TO_B_SIZE, 1); + BufferChecks.putGetMap(GL_PIXEL_MAP_I_TO_G_SIZE, 1); + BufferChecks.putGetMap(GL_PIXEL_MAP_I_TO_I_SIZE, 1); + BufferChecks.putGetMap(GL_PIXEL_MAP_I_TO_R_SIZE, 1); + BufferChecks.putGetMap(GL_PIXEL_MAP_R_TO_R_SIZE, 1); + BufferChecks.putGetMap(GL_PIXEL_MAP_S_TO_S_SIZE, 1); + BufferChecks.putGetMap(GL_POINT_SIZE, 1); + BufferChecks.putGetMap(GL_POINT_SIZE_GRANULARITY, 1); + BufferChecks.putGetMap(GL_POINT_SIZE_RANGE, 2); + BufferChecks.putGetMap(GL_POINT_SMOOTH, 1); + BufferChecks.putGetMap(GL_POLYGON_MODE, 2); + BufferChecks.putGetMap(GL_POLYGON_SMOOTH, 1); + BufferChecks.putGetMap(GL_POLYGON_STIPPLE, 1); + BufferChecks.putGetMap(GL_PROJECTION_MATRIX, 16); + BufferChecks.putGetMap(GL_PROJECTION_STACK_DEPTH, 1); + BufferChecks.putGetMap(GL_READ_BUFFER, 1); + BufferChecks.putGetMap(GL_RED_BIAS, 1); + BufferChecks.putGetMap(GL_RED_BITS, 1); + BufferChecks.putGetMap(GL_RED_SCALE, 1); + BufferChecks.putGetMap(GL_RENDER_MODE, 1); + BufferChecks.putGetMap(GL_RGBA_MODE, 1); + BufferChecks.putGetMap(GL_SCISSOR_BOX, 4); + BufferChecks.putGetMap(GL_SCISSOR_TEST, 1); + BufferChecks.putGetMap(GL_SHADE_MODEL, 1); + BufferChecks.putGetMap(GL_STENCIL_BITS, 1); + BufferChecks.putGetMap(GL_STENCIL_CLEAR_VALUE, 1); + BufferChecks.putGetMap(GL_STENCIL_FAIL, 1); + BufferChecks.putGetMap(GL_STENCIL_FUNC, 1); + BufferChecks.putGetMap(GL_STENCIL_PASS_DEPTH_FAIL, 1); + BufferChecks.putGetMap(GL_STENCIL_PASS_DEPTH_PASS, 1); + BufferChecks.putGetMap(GL_STENCIL_REF, 1); + BufferChecks.putGetMap(GL_STENCIL_TEST, 1); + BufferChecks.putGetMap(GL_STENCIL_VALUE_MASK, 1); + BufferChecks.putGetMap(GL_STENCIL_WRITEMASK, 1); + BufferChecks.putGetMap(GL_STEREO, 1); + BufferChecks.putGetMap(GL_SUBPIXEL_BITS, 1); + BufferChecks.putGetMap(GL_TEXTURE_1D, 1); + BufferChecks.putGetMap(GL_TEXTURE_2D, 1); + BufferChecks.putGetMap(GL_TEXTURE_GEN_S, 1); + BufferChecks.putGetMap(GL_TEXTURE_GEN_T, 1); + BufferChecks.putGetMap(GL_TEXTURE_GEN_R, 1); + BufferChecks.putGetMap(GL_TEXTURE_GEN_Q, 1); + BufferChecks.putGetMap(GL_TEXTURE_MATRIX, 16); + BufferChecks.putGetMap(GL_TEXTURE_STACK_DEPTH, 1); + BufferChecks.putGetMap(GL_UNPACK_ALIGNMENT, 1); + BufferChecks.putGetMap(GL_UNPACK_LSB_FIRST, 1); + BufferChecks.putGetMap(GL_UNPACK_ROW_LENGTH, 1); + BufferChecks.putGetMap(GL_UNPACK_SKIP_PIXELS, 1); + BufferChecks.putGetMap(GL_UNPACK_SKIP_ROWS, 1); + BufferChecks.putGetMap(GL_UNPACK_SWAP_BYTES, 1); + BufferChecks.putGetMap(GL_VIEWPORT, 4); + BufferChecks.putGetMap(GL_ZOOM_X, 1); + BufferChecks.putGetMap(GL_ZOOM_Y, 1); + + } + public static native void glAccum(int op, float value); public static native void glAlphaFunc(int func, float ref); public static native void glClearColor(float red, float green, float blue, float alpha); @@ -736,6 +954,7 @@ public static native void glCallList(int list); public static native void glBlendFunc(int sfactor, int dfactor); public static void glBitmap(int width, int height, float xorig, float yorig, float xmove, float ymove, ByteBuffer bitmap) { + // TODO: check buffer size valid nglBitmap(width, height, xorig, yorig, xmove, ymove, bitmap, bitmap.position()); } private static native void nglBitmap(int width, int height, float xorig, float yorig, float xmove, float ymove, ByteBuffer bitmap, int bitmap_offset); @@ -755,17 +974,18 @@ public static native void glCopyTexImage2D(int target, int level, int internalFormat, int x, int y, int width, int height, int border); public static native void glCopyTexImage1D(int target, int level, int internalFormat, int x, int y, int width, int border); public static native void glCopyPixels(int x, int y, int width, int height, int type); + public static void glColorPointer(int size, boolean unsigned, int stride, ByteBuffer pointer) { - assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + BufferChecks.checkVBOdisabled(); nglColorPointer(size, unsigned ? GL_UNSIGNED_BYTE : GL_BYTE, stride, pointer, pointer.position()); } public static void glColorPointer(int size, int stride, FloatBuffer pointer) { - assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + BufferChecks.checkVBOdisabled(); nglColorPointer(size, GL_FLOAT, stride, pointer, pointer.position() << 2); } private static native void nglColorPointer(int size, int type, int stride, Buffer pointer, int pointer_offset); public static void glColorPointer(int size, int type, int stride, int buffer_offset) { - assert VBOTracker.getVBOArrayStack().getState() != 0: "Cannot use int offsets when VBO is disabled"; + BufferChecks.checkVBOenabled(); nglColorPointerVBO(size, type, stride, buffer_offset); } private static native void nglColorPointerVBO(int size, int type, int stride, int buffer_offset); @@ -778,6 +998,9 @@ public static native void glColor4f(float red, float green, float blue, float alpha); public static native void glColor4ub(byte red, byte green, byte blue, byte alpha); public static void glClipPlane(int plane, DoubleBuffer equation) { + if (equation.remaining() < 4) { + throw new BufferUnderflowException(); + } nglClipPlane(plane, equation, equation.position() << 3); } private static native void nglClipPlane(int plane, DoubleBuffer equation, int equation_offset); @@ -794,41 +1017,44 @@ public static native void glEnable(int cap); public static native void glDisable(int cap); public static void glEdgeFlagPointer(int stride, ByteBuffer pointer) { - assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + BufferChecks.checkVBOdisabled(); nglEdgeFlagPointer(stride, pointer, pointer.position()); } private static native void nglEdgeFlagPointer(int stride, Buffer pointer, int pointer_offset); public static void glEdgeFlagPointer(int stride, int buffer_offset) { - assert VBOTracker.getVBOArrayStack().getState() != 0: "Cannot use int offsets when VBO is disabled"; + BufferChecks.checkVBOenabled(); nglEdgeFlagPointerVBO(stride, buffer_offset); } private static native void nglEdgeFlagPointerVBO(int stride, int buffer_offset); public static native void glEdgeFlag(boolean flag); public static void glDrawPixels(int width, int height, int format, int type, ByteBuffer pixels) { + // TODO: check buffer size valid nglDrawPixels(width, height, format, type, pixels, pixels.position()); } public static void glDrawPixels(int width, int height, int format, int type, ShortBuffer pixels) { + // TODO: check buffer size valid nglDrawPixels(width, height, format, type, pixels, pixels.position() << 1); } public static void glDrawPixels(int width, int height, int format, int type, IntBuffer pixels) { + // TODO: check buffer size valid nglDrawPixels(width, height, format, type, pixels, pixels.position() << 2); } private static native void nglDrawPixels(int width, int height, int format, int type, Buffer pixels, int pixels_offset); public static void glDrawElements(int mode, ByteBuffer indices) { - assert VBOTracker.getVBOElementStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + BufferChecks.checkVBOdisabled(); nglDrawElements(mode, indices.remaining(), GL_UNSIGNED_BYTE, indices, indices.position()); } public static void glDrawElements(int mode, ShortBuffer indices) { - assert VBOTracker.getVBOElementStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + BufferChecks.checkVBOdisabled(); nglDrawElements(mode, indices.remaining(), GL_UNSIGNED_SHORT, indices, indices.position() << 1); } public static void glDrawElements(int mode, IntBuffer indices) { - assert VBOTracker.getVBOElementStack().getState() == 0: "Cannot use Buffers when VBO is enabled"; + BufferChecks.checkVBOdisabled(); nglDrawElements(mode, indices.remaining(), GL_UNSIGNED_INT, indices, indices.position() << 2); } private static native void nglDrawElements(int mode, int count, int type, Buffer indices, int indices_offset); public static void glDrawElements(int mode, int count, int type, int buffer_offset) { - assert VBOTracker.getVBOElementStack().getState() != 0: "Cannot use int offsets when VBO is disabled"; + BufferChecks.checkVBOenabled(); nglDrawElementsVBO(mode, count, type, buffer_offset); } private static native void nglDrawElementsVBO(int mode, int count, int type, int buffer_offset); @@ -841,60 +1067,77 @@ nglFeedbackBuffer(buffer.remaining(), type, buffer, buffer.position()); } private static native void nglFeedbackBuffer(int size, int type, FloatBuffer buffer, int buffer_offset); + public static void glGetPixelMap(int map, FloatBuffer values) { + BufferChecks.checkPixelMapBuffer(map, values); nglGetPixelMapfv(map, values, values.position()); } private static native void nglGetPixelMapfv(int map, FloatBuffer values, int values_offset); public static void glGetPixelMap(int map, IntBuffer values) { + BufferChecks.checkPixelMapBuffer(map, values); nglGetPixelMapuiv(map, values, values.position()); } private static native void nglGetPixelMapuiv(int map, IntBuffer values, int values_offset); public static void glGetPixelMap(int map, ShortBuffer values) { + BufferChecks.checkPixelMapBuffer(map, values); nglGetPixelMapusv(map, values, values.position()); } private static native void nglGetPixelMapusv(int map, ShortBuffer values, int values_offset); public static void glGetMaterial(int face, int pname, FloatBuffer params) { + // TODO: check buffer size valid nglGetMaterialfv(face, pname, params, params.position()); } private static native void nglGetMaterialfv(int face, int pname, FloatBuffer params, int params_offset); public static void glGetMaterial(int face, int pname, IntBuffer params) { + // TODO: check buffer size valid nglGetMaterialiv(face, pname, params, params.position()); } private static native void nglGetMaterialiv(int face, int pname, IntBuffer params, int params_offset); public static void glGetMap(int target, int query, FloatBuffer v) { + // TODO: check buffer size valid nglGetMapfv(target, query, v, v.position()); } public static void glGetMap(int target, int query, IntBuffer v) { + // TODO: check buffer size valid nglGetMapiv(target, query, v, v.position()); } private static native void nglGetMapfv(int target, int query, FloatBuffer v, int v_offset); private static native void nglGetMapiv(int target, int query, IntBuffer v, int v_offset); public static void glGetLight(int light, int pname, FloatBuffer params) { + // TODO: check buffer size valid nglGetLightfv(light, pname, params, params.position()); } private static native void nglGetLightfv(int light, int pname, FloatBuffer params, int params_offset); public static void glGetLight(int light, int pname, IntBuffer params) { + // TODO: check buffer size valid nglGetLightiv(light, pname, params, params.position()); } private static native void nglGetLightiv(int light, int pname, IntBuffer params, int params_offset); public static native int glGetError(); public static void glGetClipPlane(int plane, DoubleBuffer equation) { + if (equation.remaining() < 4) { + throw new BufferUnderflowException(); + } nglGetClipPlane(plane, equation, equation.position()); } private static native void nglGetClipPlane(int plane, DoubleBuffer equation, int equation_offset); public static void glGetBoolean(int pname, ByteBuffer params) { + BufferChecks.checkGetBuffer(pname, params); nglGetBooleanv(pname, params, params.position()); } private static native void nglGetBooleanv(int pname, ByteBuffer params, int params_offset); public static void glGetDouble(int pname, DoubleBuffer params) { + BufferChecks.checkGetBuffer(pname, params); nglGetDoublev(pname, params, params.position()); } private static native void nglGetDoublev(int pname, DoubleBuffer params, int params_offset); public static void glGetFloat(int pname, FloatBuffer params) { + BufferChecks.checkGetBuffer(pname, params); nglGetFloatv(pname, params, params.position()); } private static native void nglGetFloatv(int pname, FloatBuffer params, int params_offset); public static void glGetInteger(int pname, IntBuffer params) { + BufferChecks.checkGetBuffer(pname, params); nglGetIntegerv(pname, params, params.position()); } private static native void nglGetIntegerv(int pname, IntBuffer params, int params_offset); @@ -908,10 +1151,12 @@ public static native void glFogf(int pname, float param); public static native void glFogi(int pname, int param); public static void glFog(int pname, FloatBuffer params) { + // TODO: check buffer size valid nglFogfv(pname, params, params.position()); } private static native void nglFogfv(int pname, FloatBuffer params, int params_offset); public static void glFog(int pname, IntBuffer params) { + // TODO: check buffer size valid nglFogiv(pname, params, params.position()); } private static native void nglFogiv(int pname, IntBuffer params, int params_offset); @@ -927,72 +1172,84 @@ public static native ByteBuffer glGetPointerv(int pname, int... [truncated message content] |