diff --git a/src/java/org/lwjgl/opengl/ARBColorBufferFloat.java b/src/java/org/lwjgl/opengl/ARBColorBufferFloat.java index 6f3c87a1..5ed66bff 100644 --- a/src/java/org/lwjgl/opengl/ARBColorBufferFloat.java +++ b/src/java/org/lwjgl/opengl/ARBColorBufferFloat.java @@ -60,18 +60,18 @@ public final class ARBColorBufferFloat { * parameter array of wglGetPixelFormatAttribivARB, and the * parameter array of wglGetPixelFormatAttribfvARB: */ - public static final int WGL_TYPE_RGBA_FLOAT_ARB = 0x21A0; + static final int WGL_TYPE_RGBA_FLOAT_ARB = 0x21A0; /* * Accepted as values of the arguments in the * glXCreateNewContext and glXCreateContext functions */ - public static final int GLX_RGBA_FLOAT_TYPE = 0x20B9; + static final int GLX_RGBA_FLOAT_TYPE = 0x20B9; /* * Accepted as a bit set in the GLX_RENDER_TYPE variable */ - public static final int GLX_RGBA_FLOAT_BIT = 0x00000004; + static final int GLX_RGBA_FLOAT_BIT = 0x00000004; private ARBColorBufferFloat() { } diff --git a/src/java/org/lwjgl/opengl/EXTPalettedTexture.java b/src/java/org/lwjgl/opengl/EXTPalettedTexture.java new file mode 100644 index 00000000..3e733286 --- /dev/null +++ b/src/java/org/lwjgl/opengl/EXTPalettedTexture.java @@ -0,0 +1,163 @@ +/* + * Copyright (c) 2002-2004 LWJGL Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'LWJGL' nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.lwjgl.opengl; + +import org.lwjgl.LWJGLException; +import org.lwjgl.BufferChecks; + +import java.nio.*; + +public final class EXTPalettedTexture { + + /* + * Accepted by the internalformat parameter of TexImage1D, TexImage2D and + * TexImage3DEXT: + */ + public static final int GL_COLOR_INDEX1_EXT = 0x80E2; + public static final int GL_COLOR_INDEX2_EXT = 0x80E3; + public static final int GL_COLOR_INDEX4_EXT = 0x80E4; + public static final int GL_COLOR_INDEX8_EXT = 0x80E5; + public static final int GL_COLOR_INDEX12_EXT = 0x80E6; + public static final int GL_COLOR_INDEX16_EXT = 0x80E7; + + /* + * Accepted by the pname parameter of GetColorTableParameterivEXT and + * GetColorTableParameterfvEXT: + */ + public static final int GL_COLOR_TABLE_FORMAT_EXT = 0x80D8; + public static final int GL_COLOR_TABLE_WIDTH_EXT = 0x80D9; + public static final int GL_COLOR_TABLE_RED_SIZE_EXT = 0x80DA; + public static final int GL_COLOR_TABLE_GREEN_SIZE_EXT = 0x80DB; + public static final int GL_COLOR_TABLE_BLUE_SIZE_EXT = 0x80DC; + public static final int GL_COLOR_TABLE_ALPHA_SIZE_EXT = 0x80DD; + public static final int GL_COLOR_TABLE_LUMINANCE_SIZE_EXT = 0x80DE; + public static final int GL_COLOR_TABLE_INTENSITY_SIZE_EXT = 0x80DF; + + /* + * Accepted by the value parameter of GetTexLevelParameter{if}v: + */ + public static final int GL_TEXTURE_INDEX_SIZE_EXT = 0x80ED; + + private EXTPalettedTexture() { + } + + static native void initNativeStubs() throws LWJGLException; + + // --------------------------- + public static void glColorTableEXT(int target, int internalFormat, int width, int format, int type, ByteBuffer data) { + BufferChecks.checkBuffer(data, GLBufferChecks.calculateImageStorage(format, type, width, 1, 1)); + nglColorTableEXT(target, internalFormat, width, format, type, data, data.position()); + } + + public static void glColorTableEXT(int target, int internalFormat, int width, int format, int type, ShortBuffer data) { + BufferChecks.checkBuffer(data, GLBufferChecks.calculateImageStorage(format, type, width, 1, 1) >> 1); + nglColorTableEXT(target, internalFormat, width, format, type, data, data.position() << 1); + } + + public static void glColorTableEXT(int target, int internalFormat, int width, int format, int type, IntBuffer data) { + BufferChecks.checkBuffer(data, GLBufferChecks.calculateImageStorage(format, type, width, 1, 1) >> 2); + nglColorTableEXT(target, internalFormat, width, format, type, data, data.position() << 2); + } + + public static void glColorTableEXT(int target, int internalFormat, int width, int format, int type, FloatBuffer data) { + BufferChecks.checkBuffer(data, GLBufferChecks.calculateImageStorage(format, type, width, 1, 1) >> 2); + nglColorTableEXT(target, internalFormat, width, format, type, data, data.position() << 2); + } + + private static native void nglColorTableEXT(int target, int internalFormat, int width, int format, int type, + Buffer data, int dataOffset); + // --------------------------- + + // --------------------------- + public static void glColorSubTableEXT(int target, int start, int count, int format, int type, ByteBuffer data) { + BufferChecks.checkBuffer(data, GLBufferChecks.calculateImageStorage(format, type, count, 1, 1)); + nglColorSubTableEXT(target, start, count, format, type, data, data.position()); + } + + public static void glColorSubTableEXT(int target, int start, int count, int format, int type, ShortBuffer data) { + BufferChecks.checkBuffer(data, GLBufferChecks.calculateImageStorage(format, type, count, 1, 1) << 1); + nglColorSubTableEXT(target, start, count, format, type, data, data.position() << 1); + } + + public static void glColorSubTableEXT(int target, int start, int count, int format, int type, IntBuffer data) { + BufferChecks.checkBuffer(data, GLBufferChecks.calculateImageStorage(format, type, count, 1, 1) << 2); + nglColorSubTableEXT(target, start, count, format, type, data, data.position() << 2); + } + + public static void glColorSubTableEXT(int target, int start, int count, int format, int type, FloatBuffer data) { + BufferChecks.checkBuffer(data, GLBufferChecks.calculateImageStorage(format, type, count, 1, 1) << 2); + nglColorSubTableEXT(target, start, count, format, type, data, data.position() << 2); + } + + private static native void nglColorSubTableEXT(int target, int start, int count, int format, int type, + Buffer data, int dataOffset); + // --------------------------- + + // --------------------------- + public static void glGetColorTableEXT(int target, int format, int type, ByteBuffer data) { + nglGetColorTableEXT(target, format, type, data, data.position()); + } + + public static void glGetColorTableEXT(int target, int format, int type, ShortBuffer data) { + nglGetColorTableEXT(target, format, type, data, data.position() << 1); + } + + public static void glGetColorTableEXT(int target, int format, int type, IntBuffer data) { + nglGetColorTableEXT(target, format, type, data, data.position() << 2); + } + + public static void glGetColorTableEXT(int target, int format, int type, FloatBuffer data) { + nglGetColorTableEXT(target, format, type, data, data.position() << 2); + } + + private static native void nglGetColorTableEXT(int target, int format, int type, Buffer data, int dataOffset); + // --------------------------- + + // --------------------------- + public static void glGetColorTableParameterivEXT(int target, int pname, IntBuffer params) { + BufferChecks.checkBuffer(params); + nglGetColorTableParameterivEXT(target, pname, params, params.position()); + } + + private static native void nglGetColorTableParameterivEXT(int target, int pname, IntBuffer params, int paramsOffset); + // --------------------------- + + // --------------------------- + public static void glGetColorTableParameterfvEXT(int target, int pname, FloatBuffer params) { + BufferChecks.checkBuffer(params); + nglGetColorTableParameterfvEXT(target, pname, params, params.position()); + } + + private static native void nglGetColorTableParameterfvEXT(int target, int pname, FloatBuffer params, int paramsOffset); + // --------------------------- + +} \ No newline at end of file diff --git a/src/java/org/lwjgl/opengl/GL11.java b/src/java/org/lwjgl/opengl/GL11.java index 5a278b65..0edf923a 100644 --- a/src/java/org/lwjgl/opengl/GL11.java +++ b/src/java/org/lwjgl/opengl/GL11.java @@ -1,31 +1,31 @@ -/* +/* * Copyright (c) 2002-2004 LWJGL Project * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are + * modification, are permitted provided that the following conditions are * met: - * - * * Redistributions of source code must retain the above copyright + * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * * Neither the name of 'LWJGL' nor the names of - * its contributors may be used to endorse or promote products derived + * * Neither the name of 'LWJGL' nor the names of + * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ @@ -45,13 +45,13 @@ import org.lwjgl.LWJGLException; * $Id$ * * The core OpenGL1.1 API. - * + * * @author cix_foo * @version $Revision$ */ public final class GL11 { - + /* AccumOp */ public static final int GL_ACCUM = 0x0100; public static final int GL_LOAD = 0x0101; @@ -768,7 +768,7 @@ public final class GL11 { 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) { BufferChecks.checkDirect(pointer); GLBufferChecks.ensureArrayVBOdisabled(); @@ -866,7 +866,7 @@ public final class GL11 { 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.checkBuffer(values, 256); nglGetPixelMapfv(map, values, values.position()); @@ -1039,7 +1039,7 @@ public final class GL11 { nglGetTexImage(target, level, format, type, pixels, pixels.position() << 2); } private static native void nglGetTexImage(int target, int level, int format, int type, Buffer pixels, int pixels_offset); - + public static void glGetTexGen(int coord, int pname, IntBuffer params) { BufferChecks.checkBuffer(params); nglGetTexGeniv(coord, pname, params, params.position()); @@ -1286,6 +1286,10 @@ public final class GL11 { BufferChecks.checkBuffer(pixels, GLBufferChecks.calculateImageStorage(format, type, width, height, 1)>>2); nglTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels, pixels.position() << 2); } + public static void glTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, FloatBuffer pixels) { + BufferChecks.checkBuffer(pixels, GLBufferChecks.calculateImageStorage(format, type, width, height, 1) >> 2); + nglTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels, pixels.position() << 2); + } private static native void nglTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, Buffer pixels, int pixels_offset); public static void glTexSubImage1D(int target, int level, int xoffset, int width, int format, int type, ByteBuffer pixels) { BufferChecks.checkBuffer(pixels, GLBufferChecks.calculateImageStorage(format, type, width, 1, 1)); @@ -1299,6 +1303,10 @@ public final class GL11 { BufferChecks.checkBuffer(pixels, GLBufferChecks.calculateImageStorage(format, type, width, 1, 1)>>2); nglTexSubImage1D(target, level, xoffset, width, format, type, pixels, pixels.position() << 2); } + public static void glTexSubImage1D(int target, int level, int xoffset, int width, int format, int type, FloatBuffer pixels) { + BufferChecks.checkBuffer(pixels, GLBufferChecks.calculateImageStorage(format, type, width, 1, 1) >> 2); + nglTexSubImage1D(target, level, xoffset, width, format, type, pixels, pixels.position() << 2); + } private static native void nglTexSubImage1D(int target, int level, int xoffset, int width, int format, int type, Buffer pixels, int pixels_offset); public static native void glTexParameterf(int target, int pname, float param); public static native void glTexParameteri(int target, int pname, int param); diff --git a/src/java/org/lwjgl/opengl/GLBufferChecks.java b/src/java/org/lwjgl/opengl/GLBufferChecks.java index 74446620..874674e7 100644 --- a/src/java/org/lwjgl/opengl/GLBufferChecks.java +++ b/src/java/org/lwjgl/opengl/GLBufferChecks.java @@ -1,31 +1,31 @@ -/* +/* * Copyright (c) 2002-2004 LWJGL Project * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are + * modification, are permitted provided that the following conditions are * met: - * - * * Redistributions of source code must retain the above copyright + * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * * Neither the name of 'LWJGL' nor the names of - * its contributors may be used to endorse or promote products derived + * * Neither the name of 'LWJGL' nor the names of + * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ @@ -41,10 +41,10 @@ package org.lwjgl.opengl; * 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 * @version $Revision$ */ @@ -91,7 +91,7 @@ class GLBufferChecks { } /** * Calculate the storage required for an image. - * + * * @param format * The format of the image (example: GL_RGBA) * @param type @@ -104,8 +104,7 @@ class GLBufferChecks { * The depth of the image (1 for 2D images) * @return the size, in bytes, of the image */ - static int calculateImageStorage(int format, int type, int width, - int height, int depth) { + static int calculateImageStorage(int format, int type, int width, int height, int depth) { int bpe; switch (type) { case GL11.GL_UNSIGNED_BYTE : diff --git a/src/java/org/lwjgl/opengl/GLContext.java b/src/java/org/lwjgl/opengl/GLContext.java index 7355f4e2..5ccead65 100644 --- a/src/java/org/lwjgl/opengl/GLContext.java +++ b/src/java/org/lwjgl/opengl/GLContext.java @@ -52,9 +52,7 @@ import java.util.*; */ public final class GLContext { - /** - * The currently initialised context - */ + /** The currently initialised context */ private static WeakReference currentContext; /* @@ -108,6 +106,7 @@ public final class GLContext { public static boolean GL_EXT_fog_coord; public static boolean GL_EXT_multi_draw_arrays; public static boolean GL_EXT_packed_pixels; + public static boolean GL_EXT_paletted_texture; public static boolean GL_EXT_pixel_buffer_object; public static boolean GL_EXT_point_parameters; public static boolean GL_EXT_rescale_normal; @@ -117,6 +116,7 @@ public final class GLContext { public static boolean GL_EXT_shared_texture_palette; public static boolean GL_EXT_stencil_two_side; public static boolean GL_EXT_stencil_wrap; + public static boolean GL_EXT_texture_3D; public static boolean GL_EXT_texture_compression_s3tc; public static boolean GL_EXT_texture_env_combine; public static boolean GL_EXT_texture_env_dot3; @@ -141,6 +141,10 @@ public final class GLContext { public static boolean GL_ATI_vertex_streams; public static boolean GL_ATI_vertex_attrib_array_object; + public static boolean GL_HP_occlusion_test; + + public static boolean GL_IBM_rasterpos_clip; + public static boolean GL_NV_blend_square; public static boolean GL_NV_copy_depth_to_color; public static boolean GL_NV_depth_clamp; @@ -177,6 +181,8 @@ public final class GLContext { public static boolean GL_NV_vertex_program2_option; public static boolean GL_NV_vertex_program3; + public static boolean GL_SUN_slice_accum; + public static boolean OpenGL11; public static boolean OpenGL12; public static boolean OpenGL13; @@ -184,9 +190,7 @@ public final class GLContext { public static boolean OpenGL15; public static boolean OpenGL20; - /** - * Map of classes that have native stubs loaded - */ + /** Map of classes that have native stubs loaded */ private static Map exts; private static int gl_ref_count; private static boolean did_auto_load; @@ -395,9 +399,7 @@ public final class GLContext { resetNativeStubs(org.lwjgl.opengl.GL11.class); } - /** - * If the OpenGL reference count is 0, the library is loaded. The reference count is then incremented. - */ + /** If the OpenGL reference count is 0, the library is loaded. The reference count is then incremented. */ public static void loadOpenGLLibrary() throws LWJGLException { if ( gl_ref_count == 0 ) nLoadOpenGLLibrary(); @@ -406,9 +408,7 @@ public final class GLContext { private static native void nLoadOpenGLLibrary() throws LWJGLException; - /** - * The OpenGL library reference count is decremented, and if it reaches 0, the library is unloaded. - */ + /** The OpenGL library reference count is decremented, and if it reaches 0, the library is unloaded. */ public static void unloadOpenGLLibrary() { gl_ref_count--; if ( gl_ref_count == 0 ) @@ -417,8 +417,6 @@ public final class GLContext { private static native void nUnloadOpenGLLibrary(); - /** - * Native method to clear native stub bindings - */ + /** Native method to clear native stub bindings */ private static native void resetNativeStubs(Class clazz); } diff --git a/src/java/org/lwjgl/opengl/HPOcclusionTest.java b/src/java/org/lwjgl/opengl/HPOcclusionTest.java new file mode 100644 index 00000000..8df177d0 --- /dev/null +++ b/src/java/org/lwjgl/opengl/HPOcclusionTest.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2002-2004 LWJGL Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'LWJGL' nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.lwjgl.opengl; + +public final class HPOcclusionTest { + + /* + * Accepted by the parameter of Enable, Disable, and IsEnabled, by + * the of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev : + */ + public static final int GL_OCCLUSION_TEST_HP = 0x8165; + + /* + * Accepted by the of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev : + */ + public static final int GL_OCCLUSION_TEST_RESULT_HP = 0x8166; + + private HPOcclusionTest() { + } + +} \ No newline at end of file diff --git a/src/java/org/lwjgl/opengl/IBMRasterposClip.java b/src/java/org/lwjgl/opengl/IBMRasterposClip.java new file mode 100644 index 00000000..0ecb848c --- /dev/null +++ b/src/java/org/lwjgl/opengl/IBMRasterposClip.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2002-2004 LWJGL Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'LWJGL' nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.lwjgl.opengl; + +public final class IBMRasterposClip { + + /* + * Accepted by the parameter of Enable and Disable and the + * parameter of IsEnabled, GetBooleanv, GetIntegerv, GetFloatv, GetDoublev: + */ + public static final int GL_RASTER_POSITION_UNCLIPPED_IBM = 103010; + + private IBMRasterposClip() { + } + +} \ No newline at end of file diff --git a/src/java/org/lwjgl/opengl/Pbuffer.java b/src/java/org/lwjgl/opengl/Pbuffer.java index 29b6626a..6edf2eb3 100644 --- a/src/java/org/lwjgl/opengl/Pbuffer.java +++ b/src/java/org/lwjgl/opengl/Pbuffer.java @@ -1,31 +1,31 @@ -/* +/* * Copyright (c) 2002-2004 LWJGL Project * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are + * modification, are permitted provided that the following conditions are * met: - * - * * Redistributions of source code must retain the above copyright + * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * * Neither the name of 'LWJGL' nor the names of - * its contributors may be used to endorse or promote products derived + * * Neither the name of 'LWJGL' nor the names of + * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ @@ -139,7 +139,7 @@ public final class Pbuffer { /** * The maximum number of bytes in the native handle */ - private final static int HANDLE_SIZE = 24; + private static final int HANDLE_SIZE = 24; /** * Handle to the native GL rendering context diff --git a/src/java/org/lwjgl/opengl/SUNSliceAccum.java b/src/java/org/lwjgl/opengl/SUNSliceAccum.java new file mode 100644 index 00000000..e5a5a0fe --- /dev/null +++ b/src/java/org/lwjgl/opengl/SUNSliceAccum.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2002-2004 LWJGL Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'LWJGL' nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.lwjgl.opengl; + +public final class SUNSliceAccum { + + /* + * Accepted by the parameter of Accum, + */ + public static final int GL_SLICE_ACCUM_SUN = 0x85CC; + + private SUNSliceAccum() { + } + +} \ No newline at end of file diff --git a/src/native/common/ext/Makefile.am b/src/native/common/ext/Makefile.am index 69146439..6d4ab639 100644 --- a/src/native/common/ext/Makefile.am +++ b/src/native/common/ext/Makefile.am @@ -9,6 +9,7 @@ SRC=org_lwjgl_opengl_EXTBlendEquationSeparate.c \ org_lwjgl_opengl_EXTDrawRangeElements.c \ org_lwjgl_opengl_EXTFogCoord.c \ org_lwjgl_opengl_EXTMultiDrawArrays.c \ + org_lwjgl_opengl_EXTPalettedTexture.c \ org_lwjgl_opengl_EXTPointParameters.c \ org_lwjgl_opengl_EXTSecondaryColor.c \ org_lwjgl_opengl_EXTStencilTwoSide.c \ diff --git a/src/native/common/ext/org_lwjgl_opengl_EXTPalettedTexture.c b/src/native/common/ext/org_lwjgl_opengl_EXTPalettedTexture.c new file mode 100644 index 00000000..b32cf3f7 --- /dev/null +++ b/src/native/common/ext/org_lwjgl_opengl_EXTPalettedTexture.c @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2002-2004 LWJGL Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'LWJGL' nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +// ------------------------------------------- +// IMPLEMENTATION OF NATIVE METHODS FOR CLASS: org.lwjgl.opengl.EXTPalettedTexture +// ------------------------------------------- + +#include "extgl.h" +#include "common_tools.h" + +typedef void (APIENTRY * glColorTableEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *data); +typedef void (APIENTRY * glColorSubTableEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +typedef void (APIENTRY * glGetColorTableEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data); +typedef void (APIENTRY * glGetColorTableParameterivEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * glGetColorTableParameterfvEXTPROC) (GLenum target, GLenum pname, GLfloat *params); + +static glColorTableEXTPROC glColorTableEXT; +static glColorSubTableEXTPROC glColorSubTableEXT; +static glGetColorTableEXTPROC glGetColorTableEXT; +static glGetColorTableParameterivEXTPROC glGetColorTableParameterivEXT; +static glGetColorTableParameterfvEXTPROC glGetColorTableParameterfvEXT; + +/* + * Class: org.lwjgl.opengl.EXTPalettedTexture + * Method: nglColorTableEXT + */ +static void JNICALL Java_org_lwjgl_opengl_EXTPalettedTexture_nglColorTableEXT + (JNIEnv * env, jclass clazz, jint target, jint internalFormat, jint width, jint format, jint type, jobject data, jint dataOffset) +{ + const void *address = (const void *)(dataOffset + (GLbyte *)(*env)->GetDirectBufferAddress(env, data)); + glColorTableEXT(target, internalFormat, width, format, type, address); +} + +/* + * Class: org.lwjgl.opengl.EXTPalettedTexture + * Method: nglColorSubTableEXT + */ +static void JNICALL Java_org_lwjgl_opengl_EXTPalettedTexture_nglColorSubTableEXT + (JNIEnv * env, jclass clazz, jint target, jint start, jint count, jint format, jint type, jobject data, jint dataOffset) +{ + const void *address = (const void *)(dataOffset + (GLbyte *)(*env)->GetDirectBufferAddress(env, data)); + glColorSubTableEXT(target, start, count, format, type, address); +} + +/* + * Class: org.lwjgl.opengl.EXTPalettedTexture + * Method: nglGetColorTableEXT + */ +static void JNICALL Java_org_lwjgl_opengl_EXTPalettedTexture_nglGetColorTableEXT + (JNIEnv * env, jclass clazz, jint target, jint format, jint type, jobject data, jint dataOffset) +{ + void *address = (void *)(dataOffset + (GLbyte *)(*env)->GetDirectBufferAddress(env, data)); + glGetColorTableEXT(target, format, type, address); +} + +/* + * Class: org.lwjgl.opengl.EXTPalettedTexture + * Method: nglGetColorTableParameterivEXT + */ +static void JNICALL Java_org_lwjgl_opengl_EXTPalettedTexture_nglGetColorTableParameterivEXT + (JNIEnv * env, jclass clazz, jint target, jint pname, jobject params, jint paramsOffset) +{ + GLint *address = paramsOffset + (GLint *)(*env)->GetDirectBufferAddress(env, params); + glGetColorTableParameterivEXT(target, pname, address); +} + +/* + * Class: org.lwjgl.opengl.EXTPalettedTexture + * Method: nglGetColorTableParameterfvEXT + */ +static void JNICALL Java_org_lwjgl_opengl_EXTPalettedTexture_nglGetColorTableParameterfvEXT + (JNIEnv * env, jclass clazz, jint target, jint pname, jobject params, jint paramsOffset) +{ + GLfloat *address = paramsOffset + (GLfloat *)(*env)->GetDirectBufferAddress(env, params); + glGetColorTableParameterfvEXT(target, pname, address); +} + +#ifdef __cplusplus +extern "C" { +#endif +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTPalettedTexture_initNativeStubs(JNIEnv *env, jclass clazz) { + JavaMethodAndExtFunction functions[] = { + {"nglColorTableEXT", "(IIIIILjava/nio/Buffer;I)V", (void*)&Java_org_lwjgl_opengl_EXTPalettedTexture_nglColorTableEXT, "glColorTableEXT", (void*)&glColorTableEXT}, + {"nglColorSubTableEXT", "(IIIIILjava/nio/Buffer;I)V", (void*)&Java_org_lwjgl_opengl_EXTPalettedTexture_nglColorSubTableEXT, "glColorSubTableEXT", (void*)&glColorSubTableEXT}, + {"nglGetColorTableEXT", "(IIILjava/nio/Buffer;I)V", (void*)&Java_org_lwjgl_opengl_EXTPalettedTexture_nglGetColorTableEXT, "glGetColorTableEXT", (void*)&glGetColorTableEXT}, + {"nglGetColorTableParameterivEXT", "(IILjava/nio/IntBuffer;I)V", (void*)&Java_org_lwjgl_opengl_EXTPalettedTexture_nglGetColorTableParameterivEXT, "glGetColorTableParameterivEXT", (void*)&glGetColorTableParameterivEXT}, + {"nglGetColorTableParameterfvEXT", "(IILjava/nio/FloatBuffer;I)V", (void*)&Java_org_lwjgl_opengl_EXTPalettedTexture_nglGetColorTableParameterfvEXT, "glGetColorTableParameterfvEXT", (void*)&glGetColorTableParameterfvEXT}, + }; + int num_functions = NUMFUNCTIONS(functions); + extgl_InitializeClass(env, clazz, num_functions, functions); +} +#ifdef __cplusplus +} +#endif \ No newline at end of file