From: <sp...@us...> - 2011-08-08 10:48:23
|
Revision: 3605 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3605&view=rev Author: spasi Date: 2011-08-08 10:48:14 +0000 (Mon, 08 Aug 2011) Log Message: ----------- Added support for OpenGL 4.2 Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/ContextAttribs.java trunk/LWJGL/src/native/common/common_tools.c trunk/LWJGL/src/templates/org/lwjgl/opencl/KHR_icd.java trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_direct_state_access.java trunk/LWJGL/src/templates/org/lwjgl/opengl/GL40.java trunk/LWJGL/src/templates/org/lwjgl/opengl/GL41.java trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_half_float.java Added Paths: ----------- trunk/LWJGL/src/templates/org/lwjgl/opencl/AMD_vec3.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_base_instance.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_compressed_texture_pixel_storage.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_conservative_depth.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_internalformat_query.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_map_buffer_alignment.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_shader_atomic_counters.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_shader_image_load_store.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_shading_language_420pack.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_shading_language_packing.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_texture_storage.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_transform_feedback_instanced.java trunk/LWJGL/src/templates/org/lwjgl/opengl/GL42.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/ContextAttribs.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/ContextAttribs.java 2011-08-06 13:18:49 UTC (rev 3604) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/ContextAttribs.java 2011-08-08 10:48:14 UTC (rev 3605) @@ -87,7 +87,7 @@ public ContextAttribs(final int majorVersion, final int minorVersion) { if ( majorVersion < 0 || 4 < majorVersion || minorVersion < 0 || - (majorVersion == 4 && 1 < minorVersion) || + (majorVersion == 4 && 2 < minorVersion) || (majorVersion == 3 && 3 < minorVersion) || (majorVersion == 2 && 1 < minorVersion) || (majorVersion == 1 && 5 < minorVersion) ) Modified: trunk/LWJGL/src/native/common/common_tools.c =================================================================== --- trunk/LWJGL/src/native/common/common_tools.c 2011-08-06 13:18:49 UTC (rev 3604) +++ trunk/LWJGL/src/native/common/common_tools.c 2011-08-08 10:48:14 UTC (rev 3605) @@ -120,7 +120,7 @@ org_lwjgl_LWJGLUtil_class = (*env)->FindClass(env, "org/lwjgl/LWJGLUtil"); if (org_lwjgl_LWJGLUtil_class == NULL) return; - log_method = (*env)->GetStaticMethodID(env, org_lwjgl_LWJGLUtil_class, "log", "(Ljava/lang/String;)V"); + log_method = (*env)->GetStaticMethodID(env, org_lwjgl_LWJGLUtil_class, "log", "(Ljava/lang/CharSequence;)V"); if (log_method == NULL) return; (*env)->CallStaticVoidMethod(env, org_lwjgl_LWJGLUtil_class, log_method, str); Added: trunk/LWJGL/src/templates/org/lwjgl/opencl/AMD_vec3.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opencl/AMD_vec3.java (rev 0) +++ trunk/LWJGL/src/templates/org/lwjgl/opencl/AMD_vec3.java 2011-08-08 10:48:14 UTC (rev 3605) @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2002-2011 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.opencl; + +import org.lwjgl.util.generator.opencl.CLDeviceExtension; + +@CLDeviceExtension +public interface AMD_vec3 { + +} \ No newline at end of file Modified: trunk/LWJGL/src/templates/org/lwjgl/opencl/KHR_icd.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opencl/KHR_icd.java 2011-08-06 13:18:49 UTC (rev 3604) +++ trunk/LWJGL/src/templates/org/lwjgl/opencl/KHR_icd.java 2011-08-08 10:48:14 UTC (rev 3605) @@ -49,7 +49,7 @@ /** Returned by clGetPlatformIDs when no platforms are found */ int CL_PLATFORM_NOT_FOUND_KHR = -1001; - @Optional(reason = "AMD Stream does not expose this (version tested: 2.2)") + @Optional(reason = "AMD Stream does not expose this (version tested: 2.5)") @cl_int int clIcdGetPlatformIDsKHR(@AutoSize(value = "platforms", canBeNull = true) @cl_uint int num_entries, @OutParameter @Check(canBeNull = true) @NativeType("cl_platform_id") PointerBuffer platforms, Added: trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_base_instance.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_base_instance.java (rev 0) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_base_instance.java 2011-08-08 10:48:14 UTC (rev 3605) @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2002-2011 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.util.generator.*; +import org.lwjgl.util.generator.opengl.*; + +import java.nio.Buffer; + +public interface ARB_base_instance { + + @Reuse("GL42") + void glDrawArraysInstancedBaseInstance(@GLenum int mode, + int first, + @GLsizei int count, + @GLsizei int primcount, + @GLuint int baseinstance); + + @Reuse("GL42") + void glDrawElementsInstancedBaseInstance(@GLenum int mode, + @AutoSize("indices") @GLsizei int count, + @AutoType("indices") @GLenum int type, + @Const + @BufferObject(BufferKind.ElementVBO) + @GLubyte + @GLushort + @GLuint Buffer indices, + @GLsizei int primcount, + @GLuint int baseinstance); + + @Reuse("GL42") + void glDrawElementsInstancedBaseVertexBaseInstance(@GLenum int mode, + @AutoSize("indices") @GLsizei int count, + @AutoType("indices") @GLenum int type, + @Const + @BufferObject(BufferKind.ElementVBO) + @GLubyte + @GLushort + @GLuint Buffer indices, + @GLsizei int primcount, + int basevertex, + @GLuint int baseinstance); + +} \ No newline at end of file Added: trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_compressed_texture_pixel_storage.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_compressed_texture_pixel_storage.java (rev 0) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_compressed_texture_pixel_storage.java 2011-08-08 10:48:14 UTC (rev 3605) @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2002-2011 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 interface ARB_compressed_texture_pixel_storage { + + /** + * Accepted by the <pname> parameter of PixelStore[fi], GetBooleanv, + * GetIntegerv, GetInteger64v, GetFloatv, and GetDoublev: + */ + int GL_UNPACK_COMPRESSED_BLOCK_WIDTH = 0x9127, + GL_UNPACK_COMPRESSED_BLOCK_HEIGHT = 0x9128, + GL_UNPACK_COMPRESSED_BLOCK_DEPTH = 0x9129, + GL_UNPACK_COMPRESSED_BLOCK_SIZE = 0x912A, + GL_PACK_COMPRESSED_BLOCK_WIDTH = 0x912B, + GL_PACK_COMPRESSED_BLOCK_HEIGHT = 0x912C, + GL_PACK_COMPRESSED_BLOCK_DEPTH = 0x912D, + GL_PACK_COMPRESSED_BLOCK_SIZE = 0x912E; + +} \ No newline at end of file Added: trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_conservative_depth.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_conservative_depth.java (rev 0) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_conservative_depth.java 2011-08-08 10:48:14 UTC (rev 3605) @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2002-2011 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 interface ARB_conservative_depth { +} \ No newline at end of file Added: trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_internalformat_query.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_internalformat_query.java (rev 0) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_internalformat_query.java 2011-08-08 10:48:14 UTC (rev 3605) @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2002-2011 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.util.generator.*; +import org.lwjgl.util.generator.opengl.GLenum; +import org.lwjgl.util.generator.opengl.GLreturn; +import org.lwjgl.util.generator.opengl.GLsizei; + +import java.nio.IntBuffer; + +@Extension(postfix = "") +public interface ARB_internalformat_query { + + /** Accepted by the <pname> parameter of GetInternalformativ: */ + int GL_NUM_SAMPLE_COUNTS = 0x9380; + + @StripPostfix("params") + @Reuse("GL42") + void glGetInternalformativ(@GLenum int target, @GLenum int internalformat, + @GLenum int pname, @AutoSize("params") @GLsizei int bufSize, @OutParameter IntBuffer params); + + @Alternate("glGetInternalformativ") + @StripPostfix("params") + @GLreturn("params") + @Reuse("GL42") + void glGetInternalformativ2(@GLenum int target, @GLenum int internalformat, + @GLenum int pname, @Constant("1") @GLsizei int bufSize, @OutParameter IntBuffer params); + +} \ No newline at end of file Added: trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_map_buffer_alignment.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_map_buffer_alignment.java (rev 0) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_map_buffer_alignment.java 2011-08-08 10:48:14 UTC (rev 3605) @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2002-2011 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 interface ARB_map_buffer_alignment { + + /** + * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, + * GetInteger64v, GetFloatv, and GetDoublev: + */ + int GL_MIN_MAP_BUFFER_ALIGNMENT = 0x90BC; + +} \ No newline at end of file Added: trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_shader_atomic_counters.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_shader_atomic_counters.java (rev 0) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_shader_atomic_counters.java 2011-08-08 10:48:14 UTC (rev 3605) @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2002-2011 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.util.generator.*; +import org.lwjgl.util.generator.opengl.GLenum; +import org.lwjgl.util.generator.opengl.GLreturn; +import org.lwjgl.util.generator.opengl.GLuint; + +import java.nio.IntBuffer; + +@Extension(postfix = "") +public interface ARB_shader_atomic_counters { + + /** Accepted by the <target> parameter of BindBufferBase and BindBufferRange: */ + int GL_ATOMIC_COUNTER_BUFFER = 0x92C0; + + /** + * Accepted by the <pname> parameter of GetBooleani_v, GetIntegeri_v, + * GetFloati_v, GetDoublei_v, GetInteger64i_v, GetBooleanv, GetIntegerv, + * GetInteger64v, GetFloatv, GetDoublev, and GetActiveAtomicCounterBufferiv: + */ + int GL_ATOMIC_COUNTER_BUFFER_BINDING = 0x92C1; + + /** Accepted by the <pname> parameter of GetIntegeri_64v: */ + int GL_ATOMIC_COUNTER_BUFFER_START = 0x92C2, + GL_ATOMIC_COUNTER_BUFFER_SIZE = 0x92C3; + + /** Accepted by the <pname> parameter of GetActiveAtomicCounterBufferiv: */ + int GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE = 0x92C4, + GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS = 0x92C5, + GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES = 0x92C6, + GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER = 0x92C7, + GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER = 0x92C8, + GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER = 0x92C9, + GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER = 0x92CA, + GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER = 0x92CB; + + /** + * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, + * GetInteger64v, GetFloatv, and GetDoublev: + */ + int GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS = 0x92CC, + GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS = 0x92CD, + GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS = 0x92CE, + GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS = 0x92CF, + GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS = 0x92D0, + GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS = 0x92D1, + GL_MAX_VERTEX_ATOMIC_COUNTERS = 0x92D2, + GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS = 0x92D3, + GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS = 0x92D4, + GL_MAX_GEOMETRY_ATOMIC_COUNTERS = 0x92D5, + GL_MAX_FRAGMENT_ATOMIC_COUNTERS = 0x92D6, + GL_MAX_COMBINED_ATOMIC_COUNTERS = 0x92D7, + GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE = 0x92D8, + GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS = 0x92DC; + + /** Accepted by the <pname> parameter of GetProgramiv: */ + int GL_ACTIVE_ATOMIC_COUNTER_BUFFERS = 0x92D9; + + /** Accepted by the <pname> parameter of GetActiveUniformsiv: */ + int GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX = 0x92DA; + + /** Returned in <params> by GetActiveUniform and GetActiveUniformsiv: */ + int GL_UNSIGNED_INT_ATOMIC_COUNTER = 0x92DB; + + @StripPostfix("params") + @Reuse("GL42") + void glGetActiveAtomicCounterBufferiv(@GLuint int program, @GLuint int bufferIndex, @GLenum int pname, @Check("1") @OutParameter IntBuffer params); + + @Alternate("glGetActiveAtomicCounterBufferiv") + @StripPostfix("params") + @GLreturn("params") + @Reuse("GL42") + void glGetActiveAtomicCounterBufferiv2(@GLuint int program, @GLuint int bufferIndex, @GLenum int pname, @OutParameter IntBuffer params); + +} \ No newline at end of file Added: trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_shader_image_load_store.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_shader_image_load_store.java (rev 0) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_shader_image_load_store.java 2011-08-08 10:48:14 UTC (rev 3605) @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2002-2011 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.util.generator.Reuse; +import org.lwjgl.util.generator.opengl.GLbitfield; +import org.lwjgl.util.generator.opengl.GLenum; +import org.lwjgl.util.generator.opengl.GLuint; + +public interface ARB_shader_image_load_store { + + /** + * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, + * GetFloatv, GetDoublev, and GetInteger64v: + */ + int GL_MAX_IMAGE_UNITS = 0x8F38, + GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS = 0x8F39, + GL_MAX_IMAGE_SAMPLES = 0x906D, + GL_MAX_VERTEX_IMAGE_UNIFORMS = 0x90CA, + GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS = 0x90CB, + GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS = 0x90CC, + GL_MAX_GEOMETRY_IMAGE_UNIFORMS = 0x90CD, + GL_MAX_FRAGMENT_IMAGE_UNIFORMS = 0x90CE, + GL_MAX_COMBINED_IMAGE_UNIFORMS = 0x90CF; + + /** Accepted by the <target> parameter of GetIntegeri_v and GetBooleani_v: */ + int GL_IMAGE_BINDING_NAME = 0x8F3A, + GL_IMAGE_BINDING_LEVEL = 0x8F3B, + GL_IMAGE_BINDING_LAYERED = 0x8F3C, + GL_IMAGE_BINDING_LAYER = 0x8F3D, + GL_IMAGE_BINDING_ACCESS = 0x8F3E, + GL_IMAGE_BINDING_FORMAT = 0x906E; + + /** Accepted by the <barriers> parameter of MemoryBarrier: */ + int GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT = 0x00000001, + GL_ELEMENT_ARRAY_BARRIER_BIT = 0x00000002, + GL_UNIFORM_BARRIER_BIT = 0x00000004, + GL_TEXTURE_FETCH_BARRIER_BIT = 0x00000008, + GL_SHADER_IMAGE_ACCESS_BARRIER_BIT = 0x00000020, + GL_COMMAND_BARRIER_BIT = 0x00000040, + GL_PIXEL_BUFFER_BARRIER_BIT = 0x00000080, + GL_TEXTURE_UPDATE_BARRIER_BIT = 0x00000100, + GL_BUFFER_UPDATE_BARRIER_BIT = 0x00000200, + GL_FRAMEBUFFER_BARRIER_BIT = 0x00000400, + GL_TRANSFORM_FEEDBACK_BARRIER_BIT = 0x00000800, + GL_ATOMIC_COUNTER_BARRIER_BIT = 0x00001000, + GL_ALL_BARRIER_BITS = 0xFFFFFFFF; + + /** Returned by the <type> parameter of GetActiveUniform: */ + int GL_IMAGE_1D = 0x904C, + GL_IMAGE_2D = 0x904D, + GL_IMAGE_3D = 0x904E, + GL_IMAGE_2D_RECT = 0x904F, + GL_IMAGE_CUBE = 0x9050, + GL_IMAGE_BUFFER = 0x9051, + GL_IMAGE_1D_ARRAY = 0x9052, + GL_IMAGE_2D_ARRAY = 0x9053, + GL_IMAGE_CUBE_MAP_ARRAY = 0x9054, + GL_IMAGE_2D_MULTISAMPLE = 0x9055, + GL_IMAGE_2D_MULTISAMPLE_ARRAY = 0x9056, + GL_INT_IMAGE_1D = 0x9057, + GL_INT_IMAGE_2D = 0x9058, + GL_INT_IMAGE_3D = 0x9059, + GL_INT_IMAGE_2D_RECT = 0x905A, + GL_INT_IMAGE_CUBE = 0x905B, + GL_INT_IMAGE_BUFFER = 0x905C, + GL_INT_IMAGE_1D_ARRAY = 0x905D, + GL_INT_IMAGE_2D_ARRAY = 0x905E, + GL_INT_IMAGE_CUBE_MAP_ARRAY = 0x905F, + GL_INT_IMAGE_2D_MULTISAMPLE = 0x9060, + GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY = 0x9061, + GL_UNSIGNED_INT_IMAGE_1D = 0x9062, + GL_UNSIGNED_INT_IMAGE_2D = 0x9063, + GL_UNSIGNED_INT_IMAGE_3D = 0x9064, + GL_UNSIGNED_INT_IMAGE_2D_RECT = 0x9065, + GL_UNSIGNED_INT_IMAGE_CUBE = 0x9066, + GL_UNSIGNED_INT_IMAGE_BUFFER = 0x9067, + GL_UNSIGNED_INT_IMAGE_1D_ARRAY = 0x9068, + GL_UNSIGNED_INT_IMAGE_2D_ARRAY = 0x9069, + GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY = 0x906A, + GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE = 0x906B, + GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY = 0x906C; + + /** + * Accepted by the <value> parameter of GetTexParameteriv, GetTexParameterfv, + * GetTexParameterIiv, and GetTexParameterIuiv: + */ + int GL_IMAGE_FORMAT_COMPATIBILITY_TYPE = 0x90C7; + + /** + * Returned in the <data> parameter of GetTexParameteriv, GetTexParameterfv, + * GetTexParameterIiv, and GetTexParameterIuiv when <value> is + * IMAGE_FORMAT_COMPATIBILITY_TYPE: + */ + int GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE = 0x90C8, + IMAGE_FORMAT_COMPATIBILITY_BY_CLASS = 0x90C9; + + @Reuse("GL42") + void glBindImageTexture(@GLuint int unit, @GLuint int texture, int level, + boolean layered, int layer, @GLenum int access, + @GLenum int format); + + @Reuse("GL42") + void glMemoryBarrier(@GLbitfield int barriers); + +} \ No newline at end of file Added: trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_shading_language_420pack.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_shading_language_420pack.java (rev 0) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_shading_language_420pack.java 2011-08-08 10:48:14 UTC (rev 3605) @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2002-2011 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 interface ARB_shading_language_420pack { + +} Added: trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_shading_language_packing.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_shading_language_packing.java (rev 0) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_shading_language_packing.java 2011-08-08 10:48:14 UTC (rev 3605) @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2002-2011 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 interface ARB_shading_language_packing { + +} Added: trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_texture_storage.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_texture_storage.java (rev 0) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_texture_storage.java 2011-08-08 10:48:14 UTC (rev 3605) @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2002-2011 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.util.generator.Reuse; +import org.lwjgl.util.generator.opengl.GLenum; +import org.lwjgl.util.generator.opengl.GLsizei; + +public interface ARB_texture_storage { + + /** Accepted by the <value> parameter of GetTexParameter{if}v: */ + int GL_TEXTURE_IMMUTABLE_FORMAT = 0x912F; + + @Reuse("GL42") + void glTexStorage1D(@GLenum int target, @GLsizei int levels, + @GLenum int internalformat, + @GLsizei int width); + + @Reuse("GL42") + void glTexStorage2D(@GLenum int target, @GLsizei int levels, + @GLenum int internalformat, + @GLsizei int width, @GLsizei int height); + + @Reuse("GL42") + void glTexStorage3D(@GLenum int target, @GLsizei int levels, + @GLenum int internalformat, + @GLsizei int width, @GLsizei int height, @GLsizei int depth); + +} Added: trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_transform_feedback_instanced.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_transform_feedback_instanced.java (rev 0) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_transform_feedback_instanced.java 2011-08-08 10:48:14 UTC (rev 3605) @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2002-2011 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.util.generator.Reuse; +import org.lwjgl.util.generator.opengl.GLenum; +import org.lwjgl.util.generator.opengl.GLsizei; +import org.lwjgl.util.generator.opengl.GLuint; + +public interface ARB_transform_feedback_instanced { + + @Reuse("GL42") + void glDrawTransformFeedbackInstanced(@GLenum int mode, @GLuint int id, @GLsizei int primcount); + + @Reuse("GL42") + void glDrawTransformFeedbackStreamInstanced(@GLenum int mode, @GLuint int id, @GLuint int stream, @GLsizei int primcount); + +} \ No newline at end of file Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_direct_state_access.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_direct_state_access.java 2011-08-06 13:18:49 UTC (rev 3604) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_direct_state_access.java 2011-08-08 10:48:14 UTC (rev 3605) @@ -520,11 +520,11 @@ value parameters */ - @Optional(reason = "AMD does not expose this (last driver checked: 10.9)") + @Optional(reason = "AMD does not expose this (last driver checked: 11.7)") @Dependent("OpenGL30") void glEnableClientStateiEXT(@GLenum int array, @GLuint int index); - @Optional(reason = "AMD does not expose this (last driver checked: 10.9)") + @Optional(reason = "AMD does not expose this (last driver checked: 11.7)") @Dependent("OpenGL30") void glDisableClientStateiEXT(@GLenum int array, @GLuint int index); @@ -566,7 +566,7 @@ and before state value parameters */ - @Optional(reason = "AMD does not expose this (last driver checked: 10.9)") + @Optional(reason = "AMD does not expose this (last driver checked: 11.7)") @Dependent("OpenGL30") @StripPostfix("params") void glGetFloati_vEXT(@GLenum int pname, @GLuint int index, @OutParameter @Check("16") FloatBuffer params); @@ -577,7 +577,7 @@ @StripPostfix("params") void glGetFloati_vEXT2(@GLenum int pname, @GLuint int index, @OutParameter FloatBuffer params); - @Optional(reason = "AMD does not expose this (last driver checked: 10.9)") + @Optional(reason = "AMD does not expose this (last driver checked: 11.7)") @Dependent("OpenGL30") @StripPostfix("params") void glGetDoublei_vEXT(@GLenum int pname, @GLuint int index, @OutParameter @Check("16") DoubleBuffer params); @@ -588,7 +588,7 @@ @StripPostfix("params") void glGetDoublei_vEXT2(@GLenum int pname, @GLuint int index, @OutParameter DoubleBuffer params); - @Optional(reason = "AMD does not expose this (last driver checked: 10.9)") + @Optional(reason = "AMD does not expose this (last driver checked: 11.7)") @Dependent("OpenGL30") @StripPostfix(value = "params", hasPostfix = false) void glGetPointeri_vEXT(@GLenum int pname, @GLuint int index, @Result @GLvoid ByteBuffer params); Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/GL40.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/GL40.java 2011-08-06 13:18:49 UTC (rev 3604) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/GL40.java 2011-08-08 10:48:14 UTC (rev 3605) @@ -184,7 +184,6 @@ */ int GL_MIN_SAMPLE_SHADING_VALUE = 0x8C37; - @Optional(reason = "AMD does not expose this (last driver checked: 10.9)") void glMinSampleShading(@GLclampf float value); // --------------------------------------------------------------------- Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/GL41.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/GL41.java 2011-08-06 13:18:49 UTC (rev 3604) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/GL41.java 2011-08-08 10:48:14 UTC (rev 3605) @@ -68,22 +68,17 @@ GL_MEDIUM_INT = 0x8DF4, GL_HIGH_INT = 0x8DF5; - @Optional(reason = "Not exposed in ATI Catalyst 10.10c") void glReleaseShaderCompiler(); - @Optional(reason = "Not exposed in ATI Catalyst 10.10c") void glShaderBinary(@AutoSize("shaders") @GLsizei int count, @Const @GLuint IntBuffer shaders, @GLenum int binaryformat, @Const @GLvoid ByteBuffer binary, @AutoSize("binary") @GLsizei int length); - @Optional(reason = "Not exposed in ATI Catalyst 10.10c") void glGetShaderPrecisionFormat(@GLenum int shadertype, @GLenum int precisiontype, @OutParameter @Check("2") IntBuffer range, @OutParameter @Check("1") IntBuffer precision); - @Optional(reason = "Not exposed in ATI Catalyst 10.10c") void glDepthRangef(@GLclampf float n, @GLclampf float f); - @Optional(reason = "Not exposed in ATI Catalyst 10.10c") void glClearDepthf(@GLclampf float d); // ---------------------------------------------------------------------- @@ -360,41 +355,31 @@ int GL_DOUBLE_MAT4x2 = 0x8F4D; int GL_DOUBLE_MAT4x3 = 0x8F4E; - @Optional(reason = "Not exposed in ATI Catalyst 10.10c") void glVertexAttribL1d(@GLuint int index, double x); - @Optional(reason = "Not exposed in ATI Catalyst 10.10c") void glVertexAttribL2d(@GLuint int index, double x, double y); - @Optional(reason = "Not exposed in ATI Catalyst 10.10c") void glVertexAttribL3d(@GLuint int index, double x, double y, double z); - @Optional(reason = "Not exposed in ATI Catalyst 10.10c") void glVertexAttribL4d(@GLuint int index, double x, double y, double z, double w); - @Optional(reason = "Not exposed in ATI Catalyst 10.10c") @StripPostfix("v") void glVertexAttribL1dv(@GLuint int index, @Const @Check("1") DoubleBuffer v); - @Optional(reason = "Not exposed in ATI Catalyst 10.10c") @StripPostfix("v") void glVertexAttribL2dv(@GLuint int index, @Const @Check("2") DoubleBuffer v); - @Optional(reason = "Not exposed in ATI Catalyst 10.10c") @StripPostfix("v") void glVertexAttribL3dv(@GLuint int index, @Const @Check("3") DoubleBuffer v); - @Optional(reason = "Not exposed in ATI Catalyst 10.10c") @StripPostfix("v") void glVertexAttribL4dv(@GLuint int index, @Const @Check("4") DoubleBuffer v); - @Optional(reason = "Not exposed in ATI Catalyst 10.10c") void glVertexAttribLPointer(@GLuint int index, int size, @Constant("GL11.GL_DOUBLE") @GLenum int type, @GLsizei int stride, @CachedReference(index = "index", name = "glVertexAttribPointer_buffer") @BufferObject(BufferKind.ArrayVBO) @Check @Const @GLdouble Buffer pointer); - @Optional(reason = "Not exposed in ATI Catalyst 10.10c") @StripPostfix("params") void glGetVertexAttribLdv(@GLuint int index, @GLenum int pname, @OutParameter @Check("4") DoubleBuffer params); Added: trunk/LWJGL/src/templates/org/lwjgl/opengl/GL42.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/GL42.java (rev 0) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/GL42.java 2011-08-08 10:48:14 UTC (rev 3605) @@ -0,0 +1,321 @@ +/* + * Copyright (c) 2002-2011 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.util.generator.*; +import org.lwjgl.util.generator.opengl.*; + +import java.nio.Buffer; +import java.nio.IntBuffer; + +public interface GL42 { + + // ---------------------------------------------------------------------------- + // ----------------------[ ARB_texture_compression_bptc ]---------------------- + // ---------------------------------------------------------------------------- + + /** + * Accepted by the <internalformat> parameter of TexImage2D, TexImage3D, + * CopyTexImage2D, CopyTexImage3D, CompressedTexImage2DARB, and + * CompressedTexImage3DARB and the <format> parameter of + * CompressedTexSubImage2DARB and CompressedTexSubImage3DARB: + */ + int GL_COMPRESSED_RGBA_BPTC_UNORM = 0x8E8C; + int GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM = 0x8E8D; + int GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT = 0x8E8E; + int GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT = 0x8E8F; + + // ------------------------------------------------------------------------------------ + // ----------------------[ ARB_compressed_texture_pixel_storage ]---------------------- + // ------------------------------------------------------------------------------------ + + /** + * Accepted by the <pname> parameter of PixelStore[fi], GetBooleanv, + * GetIntegerv, GetInteger64v, GetFloatv, and GetDoublev: + */ + int GL_UNPACK_COMPRESSED_BLOCK_WIDTH = 0x9127, + GL_UNPACK_COMPRESSED_BLOCK_HEIGHT = 0x9128, + GL_UNPACK_COMPRESSED_BLOCK_DEPTH = 0x9129, + GL_UNPACK_COMPRESSED_BLOCK_SIZE = 0x912A, + GL_PACK_COMPRESSED_BLOCK_WIDTH = 0x912B, + GL_PACK_COMPRESSED_BLOCK_HEIGHT = 0x912C, + GL_PACK_COMPRESSED_BLOCK_DEPTH = 0x912D, + GL_PACK_COMPRESSED_BLOCK_SIZE = 0x912E; + + // -------------------------------------------------------------------------- + // ----------------------[ ARB_shader_atomic_counters ]---------------------- + // -------------------------------------------------------------------------- + + /** Accepted by the <target> parameter of BindBufferBase and BindBufferRange: */ + int GL_ATOMIC_COUNTER_BUFFER = 0x92C0; + + /** + * Accepted by the <pname> parameter of GetBooleani_v, GetIntegeri_v, + * GetFloati_v, GetDoublei_v, GetInteger64i_v, GetBooleanv, GetIntegerv, + * GetInteger64v, GetFloatv, GetDoublev, and GetActiveAtomicCounterBufferiv: + */ + int GL_ATOMIC_COUNTER_BUFFER_BINDING = 0x92C1; + + /** Accepted by the <pname> parameter of GetIntegeri_64v: */ + int GL_ATOMIC_COUNTER_BUFFER_START = 0x92C2, + GL_ATOMIC_COUNTER_BUFFER_SIZE = 0x92C3; + + /** Accepted by the <pname> parameter of GetActiveAtomicCounterBufferiv: */ + int GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE = 0x92C4, + GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS = 0x92C5, + GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES = 0x92C6, + GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER = 0x92C7, + GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER = 0x92C8, + GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER = 0x92C9, + GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER = 0x92CA, + GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER = 0x92CB; + + /** + * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, + * GetInteger64v, GetFloatv, and GetDoublev: + */ + int GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS = 0x92CC, + GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS = 0x92CD, + GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS = 0x92CE, + GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS = 0x92CF, + GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS = 0x92D0, + GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS = 0x92D1, + GL_MAX_VERTEX_ATOMIC_COUNTERS = 0x92D2, + GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS = 0x92D3, + GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS = 0x92D4, + GL_MAX_GEOMETRY_ATOMIC_COUNTERS = 0x92D5, + GL_MAX_FRAGMENT_ATOMIC_COUNTERS = 0x92D6, + GL_MAX_COMBINED_ATOMIC_COUNTERS = 0x92D7, + GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE = 0x92D8, + GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS = 0x92DC; + + /** Accepted by the <pname> parameter of GetProgramiv: */ + int GL_ACTIVE_ATOMIC_COUNTER_BUFFERS = 0x92D9; + + /** Accepted by the <pname> parameter of GetActiveUniformsiv: */ + int GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX = 0x92DA; + + /** Returned in <params> by GetActiveUniform and GetActiveUniformsiv: */ + int GL_UNSIGNED_INT_ATOMIC_COUNTER = 0x92DB; + + @StripPostfix("params") + void glGetActiveAtomicCounterBufferiv(@GLuint int program, @GLuint int bufferIndex, @GLenum int pname, @Check("1") @OutParameter IntBuffer params); + + @Alternate("glGetActiveAtomicCounterBufferiv") + @StripPostfix("params") + @GLreturn("params") + void glGetActiveAtomicCounterBufferiv2(@GLuint int program, @GLuint int bufferIndex, @GLenum int pname, @OutParameter IntBuffer params); + + // ------------------------------------------------------------------- + // ----------------------[ ARB_texture_storage ]---------------------- + // ------------------------------------------------------------------- + + /** Accepted by the <value> parameter of GetTexParameter{if}v: */ + int GL_TEXTURE_IMMUTABLE_FORMAT = 0x912F; + + void glTexStorage1D(@GLenum int target, @GLsizei int levels, + @GLenum int internalformat, + @GLsizei int width); + + void glTexStorage2D(@GLenum int target, @GLsizei int levels, + @GLenum int internalformat, + @GLsizei int width, @GLsizei int height); + + void glTexStorage3D(@GLenum int target, @GLsizei int levels, + @GLenum int internalformat, + @GLsizei int width, @GLsizei int height, @GLsizei int depth); + + // -------------------------------------------------------------------------------- + // ----------------------[ ARB_transform_feedback_instanced ]---------------------- + // -------------------------------------------------------------------------------- + + void glDrawTransformFeedbackInstanced(@GLenum int mode, @GLuint int id, @GLsizei int primcount); + + void glDrawTransformFeedbackStreamInstanced(@GLenum int mode, @GLuint int id, @GLuint int stream, @GLsizei int primcount); + + // ----------------------------------------------------------------- + // ----------------------[ ARB_base_instance ]---------------------- + // ----------------------------------------------------------------- + + void glDrawArraysInstancedBaseInstance(@GLenum int mode, + int first, + @GLsizei int count, + @GLsizei int primcount, + @GLuint int baseinstance); + + void glDrawElementsInstancedBaseInstance(@GLenum int mode, + @AutoSize("indices") @GLsizei int count, + @AutoType("indices") @GLenum int type, + @Const + @BufferObject(BufferKind.ElementVBO) + @GLubyte + @GLushort + @GLuint Buffer indices, + @GLsizei int primcount, + @GLuint int baseinstance); + + void glDrawElementsInstancedBaseVertexBaseInstance(@GLenum int mode, + @AutoSize("indices") @GLsizei int count, + @AutoType("indices") @GLenum int type, + @Const + @BufferObject(BufferKind.ElementVBO) + @GLubyte + @GLushort + @GLuint Buffer indices, + @GLsizei int primcount, + int basevertex, + @GLuint int baseinstance); + + // --------------------------------------------------------------------------- + // ----------------------[ ARB_shader_image_load_store ]---------------------- + // --------------------------------------------------------------------------- + + /** + * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, + * GetFloatv, GetDoublev, and GetInteger64v: + */ + int GL_MAX_IMAGE_UNITS = 0x8F38, + GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS = 0x8F39, + GL_MAX_IMAGE_SAMPLES = 0x906D, + GL_MAX_VERTEX_IMAGE_UNIFORMS = 0x90CA, + GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS = 0x90CB, + GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS = 0x90CC, + GL_MAX_GEOMETRY_IMAGE_UNIFORMS = 0x90CD, + GL_MAX_FRAGMENT_IMAGE_UNIFORMS = 0x90CE, + GL_MAX_COMBINED_IMAGE_UNIFORMS = 0x90CF; + + /** Accepted by the <target> parameter of GetIntegeri_v and GetBooleani_v: */ + int GL_IMAGE_BINDING_NAME = 0x8F3A, + GL_IMAGE_BINDING_LEVEL = 0x8F3B, + GL_IMAGE_BINDING_LAYERED = 0x8F3C, + GL_IMAGE_BINDING_LAYER = 0x8F3D, + GL_IMAGE_BINDING_ACCESS = 0x8F3E, + GL_IMAGE_BINDING_FORMAT = 0x906E; + + /** Accepted by the <barriers> parameter of MemoryBarrier: */ + int GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT = 0x00000001, + GL_ELEMENT_ARRAY_BARRIER_BIT = 0x00000002, + GL_UNIFORM_BARRIER_BIT = 0x00000004, + GL_TEXTURE_FETCH_BARRIER_BIT = 0x00000008, + GL_SHADER_IMAGE_ACCESS_BARRIER_BIT = 0x00000020, + GL_COMMAND_BARRIER_BIT = 0x00000040, + GL_PIXEL_BUFFER_BARRIER_BIT = 0x00000080, + GL_TEXTURE_UPDATE_BARRIER_BIT = 0x00000100, + GL_BUFFER_UPDATE_BARRIER_BIT = 0x00000200, + GL_FRAMEBUFFER_BARRIER_BIT = 0x00000400, + GL_TRANSFORM_FEEDBACK_BARRIER_BIT = 0x00000800, + GL_ATOMIC_COUNTER_BARRIER_BIT = 0x00001000, + GL_ALL_BARRIER_BITS = 0xFFFFFFFF; + + /** Returned by the <type> parameter of GetActiveUniform: */ + int GL_IMAGE_1D = 0x904C, + GL_IMAGE_2D ... [truncated message content] |
From: <sp...@us...> - 2011-08-13 17:21:06
|
Revision: 3610 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3610&view=rev Author: spasi Date: 2011-08-13 17:20:59 +0000 (Sat, 13 Aug 2011) Log Message: ----------- Fixed GL42 detection and added an @Optional so that AMD's beta driver works. Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/GLContext.java trunk/LWJGL/src/templates/org/lwjgl/opengl/GL42.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/GLContext.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/GLContext.java 2011-08-10 17:27:49 UTC (rev 3609) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/GLContext.java 2011-08-13 17:20:59 UTC (rev 3610) @@ -221,7 +221,7 @@ { 1, 2, 3, 4, 5 }, // OpenGL 1 { 0, 1 }, // OpenGL 2 { 0, 1, 2, 3 }, // OpenGL 3 - { 0, 1 }, // OpenGL 4 + { 0, 1, 2 }, // OpenGL 4 }; for ( int major = 1; major <= GL_VERSIONS.length; major++ ) { Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/GL42.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/GL42.java 2011-08-10 17:27:49 UTC (rev 3609) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/GL42.java 2011-08-13 17:20:59 UTC (rev 3610) @@ -127,6 +127,7 @@ /** Returned in <params> by GetActiveUniform and GetActiveUniformsiv: */ int GL_UNSIGNED_INT_ATOMIC_COUNTER = 0x92DB; + @Optional(reason = "AMD's beta 4.2 driver (11.8) does not expose this") @StripPostfix("params") void glGetActiveAtomicCounterBufferiv(@GLuint int program, @GLuint int bufferIndex, @GLenum int pname, @Check("1") @OutParameter IntBuffer params); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sp...@us...> - 2011-08-16 22:17:39
|
Revision: 3616 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3616&view=rev Author: spasi Date: 2011-08-16 22:17:32 +0000 (Tue, 16 Aug 2011) Log Message: ----------- Added unicode support on Windows. Fixed AL and GLES native stub bindings. Replaced many GetStringNativeChars usages with a Java implementation. Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/MemoryUtil.java trunk/LWJGL/src/java/org/lwjgl/WindowsSysImplementation.java trunk/LWJGL/src/java/org/lwjgl/openal/ALC10.java trunk/LWJGL/src/java/org/lwjgl/openal/ALC11.java trunk/LWJGL/src/java/org/lwjgl/opencl/CL.java trunk/LWJGL/src/java/org/lwjgl/opengl/GLContext.java trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java trunk/LWJGL/src/java/org/lwjgl/util/generator/SignatureTranslator.java trunk/LWJGL/src/native/common/opengl/org_lwjgl_opengl_GLContext.c trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC10.c trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC11.c trunk/LWJGL/src/native/common/org_lwjgl_opencl_CL.c trunk/LWJGL/src/native/windows/Window.h trunk/LWJGL/src/native/windows/opengl/context.c trunk/LWJGL/src/native/windows/opengl/context.h trunk/LWJGL/src/native/windows/opengles/context.c trunk/LWJGL/src/native/windows/opengles/context.h trunk/LWJGL/src/native/windows/org_lwjgl_Sys.c trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c Modified: trunk/LWJGL/src/java/org/lwjgl/MemoryUtil.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/MemoryUtil.java 2011-08-15 19:24:39 UTC (rev 3615) +++ trunk/LWJGL/src/java/org/lwjgl/MemoryUtil.java 2011-08-16 22:17:32 UTC (rev 3616) @@ -33,6 +33,8 @@ import java.lang.reflect.Field; import java.nio.*; +import java.nio.charset.Charset; +import java.nio.charset.CharsetEncoder; /** * [INTERNAL USE ONLY] @@ -43,6 +45,16 @@ */ public final class MemoryUtil { + private static final CharsetEncoder textEncoder; + + static { + CharsetEncoder encoder = Charset.defaultCharset().newEncoder(); + if ( 1.0f < encoder.maxBytesPerChar() ) + encoder = Charset.forName("ISO-8859-1").newEncoder(); + + textEncoder = encoder; + } + private static final Accessor memUtil; static { @@ -92,10 +104,6 @@ private MemoryUtil() { } - public static String wrap(final String test) { - return "MemoryUtil.getAddress(" + test + ")"; - } - /** * Returns the memory address of the specified buffer. [INTERNAL USE ONLY] * @@ -179,6 +187,66 @@ public static long getAddressSafe(PointerBuffer buffer, int position) { return buffer == null ? 0L : getAddress(buffer, position); } + // --- [ String utilities ] --- + + /** + * Returns the specified text as a null-terminated CharBuffer. + * + * @param text the text to encode + * + * @return the encoded text + */ + public static CharBuffer encodeUTF16(final CharSequence text) { + CharBuffer buffer = BufferUtils.createCharBuffer(text.length() + 1); + buffer.append(text).append('\0'); + buffer.flip(); + return buffer; + } + + /** + * Returns the specified text array as a CharBuffer. The CharBuffer is packed + * and each text is null-terminated. + * + * @param text the text array to encode + * + * @return the encoded text + */ + public static CharBuffer encodeUTF16(final CharSequence... text) { + int len = 0; + for ( CharSequence cs : text ) + len += cs.length(); + + final CharBuffer buffer = BufferUtils.createCharBuffer(len + text.length); + for ( CharSequence cs : text ) + buffer.append(cs).append('\0'); + + buffer.flip(); + return buffer; + } + + /** + * Encodes and null-terminated the specified text and returns a ByteBuffer. + * If text is null, null is returned. + * + * @param text the text to encode + * + * @return the encoded text or null + * + * @see String#getBytes() + */ + public static ByteBuffer encodeASCII(final CharSequence text) { + if ( text == null ) + return null; + + final ByteBuffer buffer = BufferUtils.createByteBuffer(text.length() + 1); + + textEncoder.encode(CharBuffer.wrap(text), buffer, true); + buffer.put((byte)0); + buffer.flip(); + + return buffer; + } + interface Accessor { long getAddress(Buffer buffer); Modified: trunk/LWJGL/src/java/org/lwjgl/WindowsSysImplementation.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/WindowsSysImplementation.java 2011-08-15 19:24:39 UTC (rev 3615) +++ trunk/LWJGL/src/java/org/lwjgl/WindowsSysImplementation.java 2011-08-16 22:17:32 UTC (rev 3616) @@ -31,6 +31,7 @@ */ package org.lwjgl; +import java.nio.CharBuffer; import java.security.PrivilegedExceptionAction; import java.security.PrivilegedActionException; import java.security.AccessController; @@ -95,9 +96,15 @@ if(!Display.isCreated()) { initCommonControls(); } - nAlert(getHwnd(), title, message); + + LWJGLUtil.log(String.format("*** Alert *** %s\n%s\n", title, message)); + + // Pack both strings in the same buffer + final CharBuffer buffer = MemoryUtil.encodeUTF16(title, message); + final long address = MemoryUtil.getAddress0(buffer); + nAlert(getHwnd(), address, address + (title.length() + 1) * 2); } - private static native void nAlert(long parent_hwnd, String title, String message); + private static native void nAlert(long parent_hwnd, long title, long message); private static native void initCommonControls(); public boolean openURL(final String url) { Modified: trunk/LWJGL/src/java/org/lwjgl/openal/ALC10.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/openal/ALC10.java 2011-08-15 19:24:39 UTC (rev 3615) +++ trunk/LWJGL/src/java/org/lwjgl/openal/ALC10.java 2011-08-16 22:17:32 UTC (rev 3616) @@ -31,7 +31,7 @@ */ package org.lwjgl.openal; -import java.nio.Buffer; +import java.nio.ByteBuffer; import java.nio.IntBuffer; import java.util.HashMap; @@ -199,7 +199,8 @@ * @return opened device, or null */ public static ALCdevice alcOpenDevice(String devicename) { - long device_address = nalcOpenDevice(devicename); + ByteBuffer buffer = MemoryUtil.encodeASCII(devicename); + long device_address = nalcOpenDevice(MemoryUtil.getAddressSafe(buffer)); if(device_address != 0) { ALCdevice device = new ALCdevice(device_address); synchronized (ALC10.devices) { @@ -209,7 +210,7 @@ } return null; } - static native long nalcOpenDevice(String devicename); + static native long nalcOpenDevice(long devicename); /** * The <code>alcCloseDevice</code> function allows the application (i.e. the client program) to @@ -395,11 +396,12 @@ * @return true if extension is available, false if not */ public static boolean alcIsExtensionPresent(ALCdevice device, String extName) { - boolean result = nalcIsExtensionPresent(getDevice(device), extName); + ByteBuffer buffer = MemoryUtil.encodeASCII(extName); + boolean result = nalcIsExtensionPresent(getDevice(device), MemoryUtil.getAddress(buffer)); Util.checkALCError(device); return result; } - static native boolean nalcIsExtensionPresent(long device, String extName); + private static native boolean nalcIsExtensionPresent(long device, long extName); /** * Enumeration/token values are device independend, but tokens defined for @@ -412,11 +414,12 @@ * @return value of enumeration */ public static int alcGetEnumValue(ALCdevice device, String enumName) { - int result = nalcGetEnumValue(getDevice(device), enumName); + ByteBuffer buffer = MemoryUtil.encodeASCII(enumName); + int result = nalcGetEnumValue(getDevice(device), MemoryUtil.getAddress(buffer)); Util.checkALCError(device); return result; } - static native int nalcGetEnumValue(long device, String enumName); + private static native int nalcGetEnumValue(long device, long enumName); static long getDevice(ALCdevice device) { if(device != null) { Modified: trunk/LWJGL/src/java/org/lwjgl/openal/ALC11.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/openal/ALC11.java 2011-08-15 19:24:39 UTC (rev 3615) +++ trunk/LWJGL/src/java/org/lwjgl/openal/ALC11.java 2011-08-16 22:17:32 UTC (rev 3616) @@ -92,7 +92,8 @@ * @return ALCdevice if it was possible to open a device */ public static ALCdevice alcCaptureOpenDevice(String devicename, int frequency, int format, int buffersize) { - long device_address = nalcCaptureOpenDevice(devicename, frequency, format, buffersize); + ByteBuffer buffer = MemoryUtil.encodeASCII(devicename); + long device_address = nalcCaptureOpenDevice(MemoryUtil.getAddress(buffer), frequency, format, buffersize); if(device_address != 0) { ALCdevice device = new ALCdevice(device_address); synchronized (ALC10.devices) { @@ -102,7 +103,7 @@ } return null; } - static native long nalcCaptureOpenDevice( String devicename, int frequency, int format, int buffersize); + private static native long nalcCaptureOpenDevice(long devicename, int frequency, int format, int buffersize); /** * The alcCaptureCloseDevice function allows the application to disconnect from a capture Modified: trunk/LWJGL/src/java/org/lwjgl/opencl/CL.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opencl/CL.java 2011-08-15 19:24:39 UTC (rev 3615) +++ trunk/LWJGL/src/java/org/lwjgl/opencl/CL.java 2011-08-16 22:17:32 UTC (rev 3616) @@ -33,6 +33,7 @@ import org.lwjgl.LWJGLException; import org.lwjgl.LWJGLUtil; +import org.lwjgl.MemoryUtil; import org.lwjgl.Sys; import java.nio.ByteBuffer; @@ -143,7 +144,12 @@ return 0; } - static native long getFunctionAddress(String name); + /** Helper method to get a pointer to a named function in the OpenCL library. */ + static long getFunctionAddress(String name) { + ByteBuffer buffer = MemoryUtil.encodeASCII(name); + return ngetFunctionAddress(MemoryUtil.getAddress(buffer)); + } + private static native long ngetFunctionAddress(long name); static native ByteBuffer getHostBuffer(final long address, final int size); Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/GLContext.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/GLContext.java 2011-08-15 19:24:39 UTC (rev 3615) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/GLContext.java 2011-08-16 22:17:32 UTC (rev 3616) @@ -33,9 +33,11 @@ import org.lwjgl.LWJGLException; import org.lwjgl.LWJGLUtil; +import org.lwjgl.MemoryUtil; import org.lwjgl.Sys; import java.lang.reflect.Method; +import java.nio.ByteBuffer; import java.security.AccessController; import java.security.PrivilegedAction; import java.security.PrivilegedExceptionAction; @@ -187,8 +189,12 @@ return 0; } - /** Helper method to get a pointer to a named function in the OpenGL library */ - static native long getFunctionAddress(String name); + /** Helper method to get a pointer to a named function in the OpenGL library. */ + static long getFunctionAddress(String name) { + ByteBuffer buffer = MemoryUtil.encodeASCII(name); + return ngetFunctionAddress(MemoryUtil.getAddress(buffer)); + } + private static native long ngetFunctionAddress(long name); /** * Determine which extensions are available and returns the context profile mask. Helper method to ContextCapabilities. Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2011-08-15 19:24:39 UTC (rev 3615) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2011-08-16 22:17:32 UTC (rev 3616) @@ -38,15 +38,13 @@ * @author elias_naur */ -import java.nio.ByteBuffer; -import java.nio.FloatBuffer; -import java.nio.IntBuffer; -import java.nio.LongBuffer; +import java.nio.*; import java.awt.Canvas; import org.lwjgl.LWJGLException; import org.lwjgl.LWJGLUtil; import org.lwjgl.BufferUtils; +import org.lwjgl.MemoryUtil; import org.lwjgl.input.Cursor; import org.lwjgl.input.Mouse; import org.lwjgl.opengles.EGL; @@ -141,11 +139,11 @@ private static final int SWP_FRAMECHANGED = 0x0020; private static final int GWL_STYLE = -16; - private static final int GWL_EXSTYLE = -20; - + private static final int GWL_EXSTYLE = -20; + private static final int WS_THICKFRAME = 0x00040000; - + private static WindowsDisplay current_display; private static boolean cursor_clipped; @@ -217,9 +215,9 @@ } peer_info.initDC(getHwnd(), getHdc()); showWindow(getHwnd(), SW_SHOWDEFAULT); - + updateWidthAndHeight(); - + if ( parent == null ) { if(Display.isResizable()) { setResizable(true); @@ -233,7 +231,7 @@ throw e; } } - + private void updateWidthAndHeight() { getClientRect(hwnd, rect_buffer); rect.copyFromBuffer(rect_buffer); @@ -440,9 +438,10 @@ private static native DisplayMode getCurrentDisplayMode() throws LWJGLException; public void setTitle(String title) { - nSetTitle(hwnd, title); + CharBuffer buffer = MemoryUtil.encodeUTF16(title); + nSetTitle(hwnd, MemoryUtil.getAddress0(buffer)); } - private static native void nSetTitle(long hwnd, String title); + private static native void nSetTitle(long hwnd, long title); public boolean isCloseRequested() { boolean saved = close_requested; @@ -786,7 +785,7 @@ byte state = (byte)(1 - ((lParam >>> 31) & 0x1)); boolean repeat = state == previous_state; if (keyboard != null) - keyboard.handleChar((int)(wParam & 0xFF), millis, repeat); + keyboard.handleChar((int)(wParam & 0xFFFF), millis, repeat); } private void handleKeyButton(long wParam, long lParam, long millis) { @@ -991,12 +990,12 @@ public boolean isInsideWindow() { return mouseInside; } - + public void setResizable(boolean resizable) { if(this.resizable != resizable) { long style = getWindowLongPtr(hwnd, GWL_STYLE); long styleex = getWindowLongPtr(hwnd, GWL_EXSTYLE); - + // update frame style if(resizable) { setWindowLongPtr(hwnd, GWL_STYLE, style |= WS_THICKFRAME); @@ -1010,16 +1009,16 @@ rect.copyFromBuffer(rect_buffer); adjustWindowRectEx(rect_buffer, style, false, styleex); rect.copyFromBuffer(rect_buffer); - + // force a frame update and resize accordingly setWindowPos(hwnd, HWND_TOP, 0, 0, rect.right - rect.left, rect.bottom - rect.top, SWP_NOMOVE | SWP_NOZORDER | SWP_FRAMECHANGED); - + updateWidthAndHeight(); resized = false; } - this.resizable = resizable; + this.resizable = resizable; } - + private native boolean adjustWindowRectEx(IntBuffer rectBuffer, long style, boolean menu, long styleex); public boolean wasResized() { Modified: trunk/LWJGL/src/java/org/lwjgl/util/generator/SignatureTranslator.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/generator/SignatureTranslator.java 2011-08-15 19:24:39 UTC (rev 3615) +++ trunk/LWJGL/src/java/org/lwjgl/util/generator/SignatureTranslator.java 2011-08-16 22:17:32 UTC (rev 3616) @@ -91,11 +91,13 @@ } else type_name = t.getDeclaration().getQualifiedName(); - signature.append("L"); - signature.append(getNativeNameFromClassName(type_name)); - signature.append(";"); - if ( add_position_signature && Utils.isAddressableType(type) && !String.class.equals(type) ) - signature.append("I"); + if ( Utils.isAddressableType(type) && !String.class.equals(type) ) + signature.append("J"); + else { + signature.append("L"); + signature.append(getNativeNameFromClassName(type_name)); + signature.append(";"); + } } public void visitDeclaredType(DeclaredType t) { Modified: trunk/LWJGL/src/native/common/opengl/org_lwjgl_opengl_GLContext.c =================================================================== --- trunk/LWJGL/src/native/common/opengl/org_lwjgl_opengl_GLContext.c 2011-08-15 19:24:39 UTC (rev 3615) +++ trunk/LWJGL/src/native/common/opengl/org_lwjgl_opengl_GLContext.c 2011-08-16 22:17:32 UTC (rev 3616) @@ -1,31 +1,31 @@ -/* +/* * Copyright (c) 2002-2008 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. */ @@ -35,13 +35,8 @@ #include "org_lwjgl_opengl_GLContext.h" #include "extgl.h" -JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_GLContext_getFunctionAddress(JNIEnv *env, jclass clazz, jstring function_name) { - jlong address_jlong; - char *function_name_pointer = GetStringNativeChars(env, function_name); - void *address = extgl_GetProcAddress(function_name_pointer); - free(function_name_pointer); - address_jlong = (jlong)(intptr_t)address; - return address_jlong; +JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_GLContext_ngetFunctionAddress(JNIEnv *env, jclass clazz, jlong function_name) { + return (jlong)(intptr_t)extgl_GetProcAddress((char *)(intptr_t)function_name); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GLContext_nLoadOpenGLLibrary(JNIEnv * env, jclass clazz) { Modified: trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC10.c =================================================================== --- trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC10.c 2011-08-15 19:24:39 UTC (rev 3615) +++ trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC10.c 2011-08-16 22:17:32 UTC (rev 3616) @@ -131,24 +131,8 @@ * C Specification: * ALCdevice *alcOpenDevice( const ALubyte *tokstr ); */ -static jlong JNICALL Java_org_lwjgl_openal_ALC10_nalcOpenDevice (JNIEnv *env, jclass clazz, jstring tokstr) { - char * tokenstring; - ALCdevice* device; - - if(tokstr != NULL) { - tokenstring = GetStringNativeChars(env, tokstr); - } else { - tokenstring = NULL; - } - - /* get device */ - device = alcOpenDevice((ALubyte *) tokenstring); - - if(tokenstring != NULL) { - free(tokenstring); - } - - return (jlong)((intptr_t)device); +static jlong JNICALL Java_org_lwjgl_openal_ALC10_nalcOpenDevice (JNIEnv *env, jclass clazz, jlong tokstr) { + return (jlong)(intptr_t)alcOpenDevice((ALubyte *)(intptr_t)tokstr); } /** @@ -255,15 +239,8 @@ * C Specification: * ALboolean alcIsExtensionPresent(ALCdevice *device, ALubyte *extName); */ -static jboolean JNICALL Java_org_lwjgl_openal_ALC10_nalcIsExtensionPresent (JNIEnv *env, jclass clazz, jlong deviceaddress, jstring extName) { - /* get extension */ - ALubyte* functionname = (ALubyte*) GetStringNativeChars(env, extName); - - jboolean result = (jboolean) alcIsExtensionPresent((ALCdevice*)((intptr_t)deviceaddress), functionname); - - free(functionname); - - return result; +static jboolean JNICALL Java_org_lwjgl_openal_ALC10_nalcIsExtensionPresent (JNIEnv *env, jclass clazz, jlong deviceaddress, jlong extName) { + return (jboolean) alcIsExtensionPresent((ALCdevice*)((intptr_t)deviceaddress), (ALubyte*)(intptr_t)extName); } /** @@ -272,15 +249,8 @@ * C Specification: * ALenum alcGetEnumValue(ALCdevice *device, ALubyte *enumName); */ -static jint JNICALL Java_org_lwjgl_openal_ALC10_nalcGetEnumValue (JNIEnv *env, jclass clazz, jlong deviceaddress, jstring enumName) { - /* get extension */ - ALubyte* enumerationname = (ALubyte*) GetStringNativeChars(env, enumName); - - jint result = (jint) alcGetEnumValue((ALCdevice*)((intptr_t)deviceaddress), enumerationname); - - free(enumerationname); - - return result; +static jint JNICALL Java_org_lwjgl_openal_ALC10_nalcGetEnumValue (JNIEnv *env, jclass clazz, jlong deviceaddress, jlong enumName) { + return (jint) alcGetEnumValue((ALCdevice*)((intptr_t)deviceaddress), (ALubyte*)(intptr_t)enumName); } /** @@ -294,10 +264,10 @@ JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC10_initNativeStubs(JNIEnv *env, jclass clazz) { JavaMethodAndExtFunction functions[] = { {"nalcGetString", "(JI)Ljava/lang/String;", (void*)&Java_org_lwjgl_openal_ALC10_nalcGetString, "alcGetString", (void*)&alcGetString}, - {"nalcGetIntegerv", "(JIILjava/nio/Buffer;I)V", (void*)&Java_org_lwjgl_openal_ALC10_nalcGetIntegerv, "alcGetIntegerv", (void*)&alcGetIntegerv}, - {"nalcOpenDevice", "(Ljava/lang/String;)J", (void*)&Java_org_lwjgl_openal_ALC10_nalcOpenDevice, "alcOpenDevice", (void*)&alcOpenDevice}, + {"nalcGetIntegerv", "(JIIJ)V", (void*)&Java_org_lwjgl_openal_ALC10_nalcGetIntegerv, "alcGetIntegerv", (void*)&alcGetIntegerv}, + {"nalcOpenDevice", "(J)J", (void*)&Java_org_lwjgl_openal_ALC10_nalcOpenDevice, "alcOpenDevice", (void*)&alcOpenDevice}, {"nalcCloseDevice", "(J)Z", (void*)&Java_org_lwjgl_openal_ALC10_nalcCloseDevice, "alcCloseDevice", (void*)&alcCloseDevice}, - {"nalcCreateContext", "(JLjava/nio/IntBuffer;)J", (void*)&Java_org_lwjgl_openal_ALC10_nalcCreateContext, "alcCreateContext", (void*)&alcCreateContext}, + {"nalcCreateContext", "(JJ)J", (void*)&Java_org_lwjgl_openal_ALC10_nalcCreateContext, "alcCreateContext", (void*)&alcCreateContext}, {"nalcMakeContextCurrent", "(J)I", (void*)&Java_org_lwjgl_openal_ALC10_nalcMakeContextCurrent, "alcMakeContextCurrent", (void*)&alcMakeContextCurrent}, {"nalcProcessContext", "(J)V", (void*)&Java_org_lwjgl_openal_ALC10_nalcProcessContext, "alcProcessContext", (void*)&alcProcessContext}, {"nalcGetCurrentContext", "()J", (void*)&Java_org_lwjgl_openal_ALC10_nalcGetCurrentContext, "alcGetCurrentContext", (void*)&alcGetCurrentContext}, @@ -305,8 +275,8 @@ {"nalcSuspendContext", "(J)V", (void*)&Java_org_lwjgl_openal_ALC10_nalcSuspendContext, "alcSuspendContext", (void*)&alcSuspendContext}, {"nalcDestroyContext", "(J)V", (void*)&Java_org_lwjgl_openal_ALC10_nalcDestroyContext, "alcDestroyContext", (void*)&alcDestroyContext}, {"nalcGetError", "(J)I", (void*)&Java_org_lwjgl_openal_ALC10_nalcGetError, "alcGetError", (void*)&alcGetError}, - {"nalcIsExtensionPresent", "(JLjava/lang/String;)Z", (void*)&Java_org_lwjgl_openal_ALC10_nalcIsExtensionPresent, "alcIsExtensionPresent", (void*)&alcIsExtensionPresent}, - {"nalcGetEnumValue", "(JLjava/lang/String;)I", (void*)&Java_org_lwjgl_openal_ALC10_nalcGetEnumValue, "alcGetEnumValue", (void*)&alcGetEnumValue} + {"nalcIsExtensionPresent", "(JJ)Z", (void*)&Java_org_lwjgl_openal_ALC10_nalcIsExtensionPresent, "alcIsExtensionPresent", (void*)&alcIsExtensionPresent}, + {"nalcGetEnumValue", "(JJ)I", (void*)&Java_org_lwjgl_openal_ALC10_nalcGetEnumValue, "alcGetEnumValue", (void*)&alcGetEnumValue} }; int num_functions = NUMFUNCTIONS(functions); extal_InitializeClass(env, clazz, num_functions, functions); Modified: trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC11.c =================================================================== --- trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC11.c 2011-08-15 19:24:39 UTC (rev 3615) +++ trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC11.c 2011-08-16 22:17:32 UTC (rev 3616) @@ -60,18 +60,8 @@ * Method: nalcCaptureOpenDevice * Signature: (Ljava/lang/String;III)J */ -static jlong JNICALL Java_org_lwjgl_openal_ALC11_nalcCaptureOpenDevice(JNIEnv *env, jclass clazz, jstring devicename, jint frequency, jint format, jint buffersize) { - ALubyte* dev_name = NULL; - ALCdevice* device = NULL; - - if(devicename != NULL) { - dev_name = (ALubyte*) GetStringNativeChars(env, devicename); - } - - device = alcCaptureOpenDevice((const char *)dev_name, (unsigned int) frequency, format, buffersize); - - free(dev_name); - return (jlong) ((intptr_t)device); +static jlong JNICALL Java_org_lwjgl_openal_ALC11_nalcCaptureOpenDevice(JNIEnv *env, jclass clazz, jlong devicename, jint frequency, jint format, jint buffersize) { + return (jlong)(intptr_t)alcCaptureOpenDevice((const char *)(intptr_t)devicename, (unsigned int) frequency, format, buffersize); } /* @@ -121,11 +111,11 @@ #endif JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC11_initNativeStubs(JNIEnv *env, jclass clazz) { JavaMethodAndExtFunction functions[] = { - {"nalcCaptureOpenDevice", "(Ljava/lang/String;III)J", (void*)&Java_org_lwjgl_openal_ALC11_nalcCaptureOpenDevice, "alcCaptureOpenDevice", (void*)&alcCaptureOpenDevice}, + {"nalcCaptureOpenDevice", "(JIII)J", (void*)&Java_org_lwjgl_openal_ALC11_nalcCaptureOpenDevice, "alcCaptureOpenDevice", (void*)&alcCaptureOpenDevice}, {"nalcCaptureCloseDevice", "(J)Z", (void*)&Java_org_lwjgl_openal_ALC11_nalcCaptureCloseDevice, "alcCaptureCloseDevice", (void*)&alcCaptureCloseDevice}, {"nalcCaptureStart", "(J)V", (void*)&Java_org_lwjgl_openal_ALC11_nalcCaptureStart, "alcCaptureStart", (void*)&alcCaptureStart}, {"nalcCaptureStop", "(J)V", (void*)&Java_org_lwjgl_openal_ALC11_nalcCaptureStop, "alcCaptureStop", (void*)&alcCaptureStop}, - {"nalcCaptureSamples", "(JLjava/nio/ByteBuffer;II)V", (void*)&Java_org_lwjgl_openal_ALC11_nalcCaptureSamples, "alcCaptureSamples", (void*)&alcCaptureSamples} + {"nalcCaptureSamples", "(JJI)V", (void*)&Java_org_lwjgl_openal_ALC11_nalcCaptureSamples, "alcCaptureSamples", (void*)&alcCaptureSamples} }; int num_functions = NUMFUNCTIONS(functions); extal_InitializeClass(env, clazz, num_functions, functions); Modified: trunk/LWJGL/src/native/common/org_lwjgl_opencl_CL.c =================================================================== --- trunk/LWJGL/src/native/common/org_lwjgl_opencl_CL.c 2011-08-15 19:24:39 UTC (rev 3615) +++ trunk/LWJGL/src/native/common/org_lwjgl_opencl_CL.c 2011-08-16 22:17:32 UTC (rev 3616) @@ -42,13 +42,8 @@ extcl_UnloadLibrary(); } -JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CL_getFunctionAddress(JNIEnv *env, jclass clazz, jstring function_name) { - jlong address_jlong; - char *function_name_pointer = GetStringNativeChars(env, function_name); - void *address = extcl_GetProcAddress(function_name_pointer); - free(function_name_pointer); - address_jlong = (jlong)(intptr_t)address; - return address_jlong; +JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CL_ngetFunctionAddress(JNIEnv *env, jclass clazz, jlong function_name) { + return (jlong)(intptr_t)extcl_GetProcAddress((char *)(intptr_t)function_name); } JNIEXPORT jobject JNICALL Java_org_lwjgl_opencl_CL_getHostBuffer(JNIEnv *env, jclass clazz, jlong address, jint size) { Modified: trunk/LWJGL/src/native/windows/Window.h =================================================================== --- trunk/LWJGL/src/native/windows/Window.h 2011-08-15 19:24:39 UTC (rev 3615) +++ trunk/LWJGL/src/native/windows/Window.h 2011-08-16 22:17:32 UTC (rev 3616) @@ -1,35 +1,35 @@ -/* +/* * Copyright (c) 2002-2008 LWJGL Project * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are + * modification, are permitted provided that the following conditions are * met: - * - * * Redistributions of source code must retain the above copyright + * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * * Neither the name of 'LWJGL' nor the names of - * its contributors may be used to endorse or promote products derived + * * Neither the name of 'LWJGL' nor the names of + * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - + /** * $Id$ * @@ -52,6 +52,10 @@ #define _WIN32_WINNT 0x0400 #endif + #define _UNICODE + #include <tchar.h> + + #define UNICODE #include <windows.h> #include <jni.h> #include "common_tools.h" Modified: trunk/LWJGL/src/native/windows/opengl/context.c =================================================================== --- trunk/LWJGL/src/native/windows/opengl/context.c 2011-08-15 19:24:39 UTC (rev 3615) +++ trunk/LWJGL/src/native/windows/opengl/context.c 2011-08-16 22:17:32 UTC (rev 3616) @@ -1,31 +1,31 @@ -/* +/* * Copyright (c) 2002-2008 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. */ @@ -38,15 +38,14 @@ */ #include <malloc.h> -#include <jni.h> -#include "common_tools.h" +#include "Window.h" #include "extgl.h" #include "extgl_wgl.h" #include "context.h" extern HINSTANCE dll_handle; // Handle to the LWJGL dll -#define _CONTEXT_PRIVATE_CLASS_NAME "__lwjgl_context_class_name" +#define _CONTEXT_PRIVATE_CLASS_NAME _T("__lwjgl_context_class_name") /* * Register the LWJGL window class. @@ -85,7 +84,7 @@ return false; } - // make that the pixel format of the device context + // make that the pixel format of the device context if (SetPixelFormat(hdc, iPixelFormat, &desc) == FALSE) { throwFormattedException(env, "SetPixelFormat failed (%d)", GetLastError()); return false; @@ -134,14 +133,14 @@ RECT clientSize; DWORD exstyle, windowflags; HWND new_hwnd; - + getWindowFlags(&windowflags, &exstyle, undecorated, child_window); clientSize.bottom = height; clientSize.left = 0; clientSize.right = width; clientSize.top = 0; - + AdjustWindowRectEx( &clientSize, // client-rectangle structure windowflags, // window styles @@ -150,9 +149,9 @@ ); // Create the window now, using that class: new_hwnd = CreateWindowEx ( - exstyle, + exstyle, window_class_name, - "", + _T(""), windowflags, x, y, clientSize.right - clientSize.left, clientSize.bottom - clientSize.top, parent, @@ -191,12 +190,12 @@ int num_aux_buffers = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "num_aux_buffers", "I")); int accum_bpp = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "accum_bpp", "I")); int accum_alpha = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "accum_alpha", "I")); - + jboolean stereo = (*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "stereo", "Z")); jboolean floating_point = (*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "floating_point", "Z")); jboolean floating_point_packed = (*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "floating_point_packed", "Z")); jboolean sRGB = (*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "sRGB", "Z")); - + int pixel_type; int iPixelFormat; unsigned int num_formats_returned; @@ -206,18 +205,18 @@ BOOL result; jlong i; int bpe = convertToBPE(bpp); - + if ( floating_point ) pixel_type = WGL_TYPE_RGBA_FLOAT_ARB; else if ( floating_point_packed ) pixel_type = WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT; else pixel_type = WGL_TYPE_RGBA_ARB; - + initAttribList(&attrib_list); if (window) { putAttrib(&attrib_list, WGL_DRAW_TO_WINDOW_ARB); putAttrib(&attrib_list, TRUE); - } + } if (pbuffer) { putAttrib(&attrib_list, WGL_DRAW_TO_PBUFFER_ARB); putAttrib(&attrib_list, TRUE); } @@ -299,31 +298,31 @@ int accum_bpp = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "accum_bpp", "I")); int accum_alpha = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "accum_alpha", "I")); jboolean stereo = (*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "stereo", "Z")); - unsigned int flags = PFD_DRAW_TO_WINDOW | // support window + unsigned int flags = PFD_DRAW_TO_WINDOW | // support window PFD_SUPPORT_OPENGL | (double_buffer ? PFD_DOUBLEBUFFER : 0) | (stereo ? PFD_STEREO : 0); PIXELFORMATDESCRIPTOR desc; int iPixelFormat; - PIXELFORMATDESCRIPTOR pfd = { - sizeof(PIXELFORMATDESCRIPTOR), // size of this pfd - 1, // version number - flags, // RGBA type + PIXELFORMATDESCRIPTOR pfd = { + sizeof(PIXELFORMATDESCRIPTOR), // size of this pfd + 1, // version number + flags, // RGBA type PFD_TYPE_RGBA, - (BYTE)bpp, - 0, 0, 0, 0, 0, 0, // color bits ignored - (BYTE)alpha, - 0, // shift bit ignored - accum_bpp + accum_alpha, // no accumulation buffer - 0, 0, 0, 0, // accum bits ignored - (BYTE)depth, - (BYTE)stencil, - num_aux_buffers, + (BYTE)bpp, + 0, 0, 0, 0, 0, 0, // color bits ignored + (BYTE)alpha, + 0, // shift bit ignored + accum_bpp + accum_alpha, // no accumulation buffer + 0, 0, 0, 0, // accum bits ignored + (BYTE)depth, + (BYTE)stencil, + num_aux_buffers, PFD_MAIN_PLANE, // main layer - 0, // reserved + 0, // reserved 0, 0, 0 // layer masks ignored }; - // get the best available match of pixel format for the device context + // get the best available match of pixel format for the device context iPixelFormat = ChoosePixelFormat(hdc, &pfd); if (iPixelFormat == 0) { throwException(env, "Failed to choose pixel format"); @@ -442,14 +441,14 @@ HDC dummy_hdc; int pixel_format_id; jclass cls_pixel_format = (*env)->GetObjectClass(env, pixel_format); - + int samples = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "samples", "I")); int colorSamples = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "colorSamples", "I")); bool floating_point = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "floating_point", "Z")); bool floating_point_packed = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "floating_point_packed", "Z")); bool sRGB = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "sRGB", "Z")); bool use_arb_selection = samples > 0 || floating_point || floating_point_packed || sRGB || pbuffer || pixelFormatCaps != NULL; - + pixel_format_id = findPixelFormatDefault(env, hdc, pixel_format, use_hdc_bpp, double_buffer); if (!(*env)->ExceptionOccurred(env) && use_arb_selection) { dummy_hwnd = createDummyWindow(origin_x, origin_y); Modified: trunk/LWJGL/src/native/windows/opengl/context.h =================================================================== --- trunk/LWJGL/src/native/windows/opengl/context.h 2011-08-15 19:24:39 UTC (rev 3615) +++ trunk/LWJGL/src/native/windows/opengl/context.h 2011-08-16 22:17:32 UTC (rev 3616) @@ -40,9 +40,7 @@ #ifndef __LWJGL_CONTEXT_H #define __LWJGL_CONTEXT_H -#include <windows.h> -#include <jni.h> -#include "common_tools.h" +#include "Window.h" #include "extgl.h" #include "extgl_wgl.h" Modified: trunk/LWJGL/src/native/windows/opengles/context.c =================================================================== --- trunk/LWJGL/src/native/windows/opengles/context.c 2011-08-15 19:24:39 UTC (rev 3615) +++ trunk/LWJGL/src/native/windows/opengles/context.c 2011-08-16 22:17:32 UTC (rev 3616) @@ -38,15 +38,14 @@ */ #include <malloc.h> -#include <jni.h> -#include "common_tools.h" +#include "Window.h" #include "extgl.h" /*#include "extgl_wgl.h"*/ #include "context.h" extern HINSTANCE dll_handle; // Handle to the LWJGL dll -#define _CONTEXT_PRIVATE_CLASS_NAME "__lwjgl_context_class_name" +#define _CONTEXT_PRIVATE_CLASS_NAME _T("__lwjgl_context_class_name") /* * Register the LWJGL window class. @@ -154,7 +153,7 @@ new_hwnd = CreateWindowEx ( exstyle, window_class_name, - "", + _T(""), windowflags, x, y, clientSize.right - clientSize.left, clientSize.bottom - clientSize.top, parent, Modified: trunk/LWJGL/src/native/windows/opengles/context.h =================================================================== --- trunk/LWJGL/src/native/windows/opengles/context.h 2011-08-15 19:24:39 UTC (rev 3615) +++ trunk/LWJGL/src/native/windows/opengles/context.h 2011-08-16 22:17:32 UTC (rev 3616) @@ -40,9 +40,7 @@ #ifndef __LWJGL_CONTEXT_H #define __LWJGL_CONTEXT_H -#include <windows.h> -#include <jni.h> -#include "common_tools.h" +#include "Window.h" #include "extgl.h" typedef struct { Modified: trunk/LWJGL/src/native/windows/org_lwjgl_Sys.c =================================================================== --- trunk/LWJGL/src/native/windows/org_lwjgl_Sys.c 2011-08-15 19:24:39 UTC (rev 3615) +++ trunk/LWJGL/src/native/windows/org_lwjgl_Sys.c 2011-08-16 22:17:32 UTC (rev 3616) @@ -1,35 +1,35 @@ -/* +/* * Copyright (c) 2002-2008 LWJGL Project * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are + * modification, are permitted provided that the following conditions are * met: - * - * * Redistributions of source code must retain the above copyright + * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * * Neither the name of 'LWJGL' nor the names of - * its contributors may be used to endorse or promote products derived + * * Neither the name of 'LWJGL' nor the names of + * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - + /** * $Id$ * @@ -56,16 +56,9 @@ return time; } -JNIEXPORT void JNICALL Java_org_lwjgl_WindowsSysImplementation_nAlert(JNIEnv * env, jclass unused, jlong hwnd_ptr, jstring title, jstring message) { +JNIEXPORT void JNICALL Java_org_lwjgl_WindowsSysImplementation_nAlert(JNIEnv * env, jclass unused, jlong hwnd_ptr, jlong title, jlong message) { HWND hwnd = (HWND)(INT_PTR)hwnd_ptr; - char * eMessageText = GetStringNativeChars(env, message); - char * cTitleBarText = GetStringNativeChars(env, title); - MessageBox(hwnd, eMessageText, cTitleBarText, MB_OK | MB_TOPMOST); - - printfDebugJava(env, "*** Alert ***%s\n%s\n", cTitleBarText, eMessageText); - - free(eMessageText); - free(cTitleBarText); + MessageBox(hwnd, (LPCTSTR)(intptr_t)message, (LPCTSTR)(intptr_t)title, MB_OK | MB_TOPMOST); } JNIEXPORT void JNICALL Java_org_lwjgl_WindowsSysImplementation_initCommonControls(JNIEnv * env, jclass unused) { Modified: trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c =================================================================== --- trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c 2011-08-15 19:24:39 UTC (rev 3615) +++ trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c 2011-08-16 22:17:32 UTC (rev 3616) @@ -40,9 +40,9 @@ */ #define _PRIVATE_WINDOW_H_ -#include <windowsx.h> #include <malloc.h> #include "Window.h" +#include <windowsx.h> /*#include "extgl_wgl.h"*/ #include "common_tools.h" #include "display.h" @@ -51,7 +51,7 @@ #include "context.h" #include <commctrl.h> -#define WINDOWCLASSNAME "LWJGL" +#define WINDOWCLASSNAME _T("LWJGL") /* * WindowProc for the GL window. @@ -134,11 +134,9 @@ } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nSetTitle - (JNIEnv * env, jclass unused, jlong hwnd_ptr, jstring title_obj) { + (JNIEnv * env, jclass unused, jlong hwnd_ptr, jlong title) { HWND hwnd = (HWND)(INT_PTR)hwnd_ptr; - char * title = GetStringNativeChars(env, title_obj); - SetWindowText(hwnd, title); - free(title); + SetWindowText(hwnd, (LPCTSTR)(intptr_t)title); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nUpdate(JNIEnv * env, jclass class) { @@ -429,22 +427,19 @@ JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_WindowsDisplay_setWindowLongPtr (JNIEnv *env, jclass clazz, jlong hwnd_ptr, jint nindex, jlong longPtr) { - HWND hwnd = (HWND)(INT_PTR)hwnd_ptr; return SetWindowLongPtr(hwnd, nindex, (LONG_PTR) longPtr); } JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_WindowsDisplay_getWindowLongPtr (JNIEnv *env, jclass clazz, jlong hwnd_ptr, jint nindex) { - HWND hwnd = (HWND)(INT_PTR)hwnd_ptr; jlong result = GetWindowLongPtr(hwnd, nindex); return result; } JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_WindowsDisplay_setWindowPos - (JNIEnv *env, jclass clazz, jlong hwnd_ptr, jlong hwnd_after_ptr, jint x, jint y, jint width, jint height, jlong uflags) { - + (JNIEnv *env, jclass clazz, jlong hwnd_ptr, jlong hwnd_after_ptr, jint x, jint y, jint width, jint height, jlong uflags) { jboolean result; HWND hwnd = (HWND)(INT_PTR)hwnd_ptr; HWND hwnd_after = (HWND)(INT_PTR)hwnd_after_ptr; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sp...@us...> - 2011-08-18 17:13:12
|
Revision: 3617 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3617&view=rev Author: spasi Date: 2011-08-18 17:13:05 +0000 (Thu, 18 Aug 2011) Log Message: ----------- Fixed GLX extension detection. Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/util/generator/RegisterStubsGenerator.java trunk/LWJGL/src/native/linux/opengl/extgl_glx.c Modified: trunk/LWJGL/src/java/org/lwjgl/util/generator/RegisterStubsGenerator.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/generator/RegisterStubsGenerator.java 2011-08-16 22:17:32 UTC (rev 3616) +++ trunk/LWJGL/src/java/org/lwjgl/util/generator/RegisterStubsGenerator.java 2011-08-18 17:13:05 UTC (rev 3617) @@ -41,8 +41,6 @@ * $Id$ */ -import org.lwjgl.opencl.CLMem; - import com.sun.mirror.declaration.*; import com.sun.mirror.type.*; Modified: trunk/LWJGL/src/native/linux/opengl/extgl_glx.c =================================================================== --- trunk/LWJGL/src/native/linux/opengl/extgl_glx.c 2011-08-16 22:17:32 UTC (rev 3616) +++ trunk/LWJGL/src/native/linux/opengl/extgl_glx.c 2011-08-18 17:13:05 UTC (rev 3617) @@ -97,9 +97,8 @@ static GLXExtensions symbols_flags; /** returns true if the extention is available */ -static bool GLXQueryExtension(Display *disp, int screen, const char *name) { - const GLubyte *exts = (const GLubyte *)lwjgl_glXQueryExtensionsString(disp, screen); - return extgl_QueryExtension(exts, name); +static bool GLXQueryExtension(const GLubyte *serverExts, const GLubyte *clientExts, const char *name) { + return extgl_QueryExtension(clientExts, name) || extgl_QueryExtension(serverExts, name); } static void extgl_InitGLX13() { @@ -184,17 +183,20 @@ } static void extgl_InitGLXSupportedExtensions(Display *disp, int screen, GLXExtensions *extension_flags) { -/* extension_flags.GLX_EXT_visual_info = GLXQueryExtension(disp, screen, "GLX_EXT_visual_info"); - extension_flags.GLX_EXT_visual_rating = GLXQueryExtension(disp, screen, "GLX_EXT_visual_rating");*/ - extension_flags->GLX_SGI_swap_control = symbols_flags.GLX_SGI_swap_control && GLXQueryExtension(disp, screen, "GLX_SGI_swap_control"); - extension_flags->GLX_ARB_multisample = GLXQueryExtension(disp, screen, "GLX_ARB_multisample"); - extension_flags->GLX_ARB_fbconfig_float = GLXQueryExtension(disp, screen, "GLX_ARB_fbconfig_float"); - extension_flags->GLX_EXT_fbconfig_packed_float = GLXQueryExtension(disp, screen, "GLX_EXT_fbconfig_packed_float"); - extension_flags->GLX_ARB_framebuffer_sRGB = GLXQueryExtension(disp, screen, "GLX_ARB_framebuffer_sRGB") || GLXQueryExtension(disp, screen, "GLX_EXT_framebuffer_sRGB"); - extension_flags->GLX_ARB_create_context = GLXQueryExtension(disp, screen, "GLX_ARB_create_context"); - extension_flags->GLX_NV_multisample_coverage = GLXQueryExtension(disp, screen, "GLX_NV_multisample_coverage"); - extension_flags->GLX_NV_present_video = GLXQueryExtension(disp, screen, "GLX_NV_present_video"); - extension_flags->GLX_NV_video_capture = GLXQueryExtension(disp, screen, "GLX_NV_video_capture"); + const GLubyte *serverExts = (const GLubyte *)lwjgl_glXQueryServerString(disp, screen, GLX_EXTENSIONS); + const GLubyte *clientExts = (const GLubyte *)lwjgl_glXGetClientString(disp, GLX_EXTENSIONS); + +/* extension_flags.GLX_EXT_visual_info = GLXQueryExtension(serverExts, clientExts, "GLX_EXT_visual_info"); + extension_flags.GLX_EXT_visual_rating = GLXQueryExtension(serverExts, clientExts, "GLX_EXT_visual_rating");*/ + extension_flags->GLX_SGI_swap_control = symbols_flags.GLX_SGI_swap_control && GLXQueryExtension(serverExts, clientExts, "GLX_SGI_swap_control"); + extension_flags->GLX_ARB_multisample = GLXQueryExtension(serverExts, clientExts, "GLX_ARB_multisample"); + extension_flags->GLX_ARB_fbconfig_float = GLXQueryExtension(serverExts, clientExts, "GLX_ARB_fbconfig_float"); + extension_flags->GLX_EXT_fbconfig_packed_float = GLXQueryExtension(serverExts, clientExts, "GLX_EXT_fbconfig_packed_float"); + extension_flags->GLX_ARB_framebuffer_sRGB = GLXQueryExtension(serverExts, clientExts, "GLX_ARB_framebuffer_sRGB") || GLXQueryExtension(serverExts, clientExts, "GLX_EXT_framebuffer_sRGB"); + extension_flags->GLX_ARB_create_context = GLXQueryExtension(serverExts, clientExts, "GLX_ARB_create_context"); + extension_flags->GLX_NV_multisample_coverage = GLXQueryExtension(serverExts, clientExts, "GLX_NV_multisample_coverage"); + extension_flags->GLX_NV_present_video = GLXQueryExtension(serverExts, clientExts, "GLX_NV_present_video"); + extension_flags->GLX_NV_video_capture = GLXQueryExtension(serverExts, clientExts, "GLX_NV_video_capture"); } bool extgl_Open(JNIEnv *env) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sp...@us...> - 2011-08-20 16:38:52
|
Revision: 3620 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3620&view=rev Author: spasi Date: 2011-08-20 16:38:45 +0000 (Sat, 20 Aug 2011) Log Message: ----------- Text encoding improvements. Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/MemoryUtil.java trunk/LWJGL/src/java/org/lwjgl/WindowsSysImplementation.java trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java trunk/LWJGL/src/native/linux/opengl/org_lwjgl_opengl_Display.c trunk/LWJGL/src/native/linux/opengles/org_lwjgl_opengl_Display.c Modified: trunk/LWJGL/src/java/org/lwjgl/MemoryUtil.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/MemoryUtil.java 2011-08-20 11:56:46 UTC (rev 3619) +++ trunk/LWJGL/src/java/org/lwjgl/MemoryUtil.java 2011-08-20 16:38:45 UTC (rev 3620) @@ -33,26 +33,28 @@ import java.lang.reflect.Field; import java.nio.*; +import java.nio.charset.CharacterCodingException; import java.nio.charset.Charset; import java.nio.charset.CharsetEncoder; +import java.nio.charset.CoderResult; /** * [INTERNAL USE ONLY] * <p/> - * This class provides utility methods for passing buffer addresses to JNI API calls. + * This class provides utility methods for passing buffers to JNI API calls. * * @author Spasi */ public final class MemoryUtil { - private static final CharsetEncoder textEncoder; + private static final Charset ascii; + private static final Charset utf8; + private static final Charset utf16; static { - CharsetEncoder encoder = Charset.defaultCharset().newEncoder(); - if ( 1.0f < encoder.maxBytesPerChar() ) - encoder = Charset.forName("ISO-8859-1").newEncoder(); - - textEncoder = encoder; + ascii = Charset.forName("ISO-8859-1"); + utf8 = Charset.forName("UTF-8"); + utf16 = Charset.forName("UTF-16LE"); } private static final Accessor memUtil; @@ -190,63 +192,128 @@ // --- [ String utilities ] --- /** - * Returns the specified text as a null-terminated CharBuffer. + * Returns a ByteBuffer containing the specified text ASCII encoded and null-terminated. + * If text is null, null is returned. * * @param text the text to encode * - * @return the encoded text + * @return the encoded text or null + * + * @see String#getBytes() */ - public static CharBuffer encodeUTF16(final CharSequence text) { - CharBuffer buffer = BufferUtils.createCharBuffer(text.length() + 1); - buffer.append(text).append('\0'); - buffer.flip(); - return buffer; + public static ByteBuffer encodeASCII(final CharSequence text) { + return encode(text, ascii); } /** - * Returns the specified text array as a CharBuffer. The CharBuffer is packed - * and each text is null-terminated. + * Returns a ByteBuffer containing the specified text UTF-8 encoded and null-terminated. + * If text is null, null is returned. * - * @param text the text array to encode + * @param text the text to encode * - * @return the encoded text + * @return the encoded text or null + * + * @see String#getBytes() */ - public static CharBuffer encodeUTF16(final CharSequence... text) { - int len = 0; - for ( CharSequence cs : text ) - len += cs.length(); - - final CharBuffer buffer = BufferUtils.createCharBuffer(len + text.length); - for ( CharSequence cs : text ) - buffer.append(cs).append('\0'); - - buffer.flip(); - return buffer; + public static ByteBuffer encodeUTF8(final CharSequence text) { + return encode(text, utf8); } /** - * Encodes and null-terminated the specified text and returns a ByteBuffer. + * Returns a ByteBuffer containing the specified text UTF-16LE encoded and null-terminated. * If text is null, null is returned. * * @param text the text to encode * - * @return the encoded text or null + * @return the encoded text + */ + public static ByteBuffer encodeUTF16(final CharSequence text) { + return encode(text, utf16); + } + + /** + * Wraps the specified text in a null-terminated CharBuffer and encodes it using the specified Charset. * - * @see String#getBytes() + * @param text the text to encode + * @param charset the charset to use for encoding + * + * @return the encoded text */ - public static ByteBuffer encodeASCII(final CharSequence text) { + private static ByteBuffer encode(final CharSequence text, final Charset charset) { if ( text == null ) return null; - final ByteBuffer buffer = BufferUtils.createByteBuffer(text.length() + 1); + return encode(CharBuffer.wrap(new CharSequenceNT(text)), charset); + } - textEncoder.encode(CharBuffer.wrap(text), buffer, true); - buffer.put((byte)0); - buffer.flip(); + /** + * A {@link CharsetEncoder#encode(java.nio.CharBuffer)} implementation that uses {@link BufferUtils#createByteBuffer(int)} + * instead of {@link ByteBuffer#allocate(int)}. + * + * @see CharsetEncoder#encode(java.nio.CharBuffer) + */ + private static ByteBuffer encode(final CharBuffer in, final Charset charset) { + final CharsetEncoder encoder = charset.newEncoder(); // encoders are not thread-safe, create a new one on every call - return buffer; + int n = (int)(in.remaining() * encoder.averageBytesPerChar()); + ByteBuffer out = BufferUtils.createByteBuffer(n); + + if ( n == 0 && in.remaining() == 0 ) + return out; + + encoder.reset(); + while ( true ) { + CoderResult cr = in.hasRemaining() ? encoder.encode(in, out, true) : CoderResult.UNDERFLOW; + if ( cr.isUnderflow() ) + cr = encoder.flush(out); + + if ( cr.isUnderflow() ) + break; + + if ( cr.isOverflow() ) { + n = 2 * n + 1; // Ensure progress; n might be 0! + ByteBuffer o = BufferUtils.createByteBuffer(n); + out.flip(); + o.put(out); + out = o; + continue; + } + + try { + cr.throwException(); + } catch (CharacterCodingException e) { + throw new RuntimeException(e); + } + } + out.flip(); + return out; } + /** A null-terminated CharSequence. */ + private static class CharSequenceNT implements CharSequence { + + final CharSequence source; + + CharSequenceNT(CharSequence source) { + this.source = source; + } + + public int length() { + return source.length() + 1; + + } + + public char charAt(final int index) { + return index == source.length() ? '\0' : source.charAt(index); + + } + + public CharSequence subSequence(final int start, final int end) { + return new CharSequenceNT(source.subSequence(start, Math.min(end, source.length()))); + } + + } + interface Accessor { long getAddress(Buffer buffer); @@ -307,4 +374,4 @@ throw new NoSuchFieldException(fieldName + " does not exist in " + type.getSimpleName() + " or any of its superclasses."); } -} \ No newline at end of file +} Modified: trunk/LWJGL/src/java/org/lwjgl/WindowsSysImplementation.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/WindowsSysImplementation.java 2011-08-20 11:56:46 UTC (rev 3619) +++ trunk/LWJGL/src/java/org/lwjgl/WindowsSysImplementation.java 2011-08-20 16:38:45 UTC (rev 3620) @@ -31,7 +31,7 @@ */ package org.lwjgl; -import java.nio.CharBuffer; +import java.nio.ByteBuffer; import java.security.PrivilegedExceptionAction; import java.security.PrivilegedActionException; import java.security.AccessController; @@ -99,10 +99,9 @@ LWJGLUtil.log(String.format("*** Alert *** %s\n%s\n", title, message)); - // Pack both strings in the same buffer - final CharBuffer buffer = MemoryUtil.encodeUTF16(title, message); - final long address = MemoryUtil.getAddress0(buffer); - nAlert(getHwnd(), address, address + (title.length() + 1) * 2); + final ByteBuffer titleText = MemoryUtil.encodeUTF16(title); + final ByteBuffer messageText = MemoryUtil.encodeUTF16(message); + nAlert(getHwnd(), MemoryUtil.getAddress(titleText), MemoryUtil.getAddress(messageText)); } private static native void nAlert(long parent_hwnd, long title, long message); private static native void initCommonControls(); Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2011-08-20 11:56:46 UTC (rev 3619) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2011-08-20 16:38:45 UTC (rev 3620) @@ -53,6 +53,7 @@ import org.lwjgl.BufferUtils; import org.lwjgl.LWJGLException; import org.lwjgl.LWJGLUtil; +import org.lwjgl.MemoryUtil; import org.lwjgl.opengl.XRandR.Screen; import org.lwjgl.opengles.EGL; @@ -138,7 +139,7 @@ private long current_cursor; private long blank_cursor; private boolean mouseInside = true; - + private Canvas parent; private long parent_window; private boolean xembedded; @@ -148,7 +149,7 @@ private LinuxKeyboard keyboard; private LinuxMouse mouse; - + private final FocusListener focus_listener = new FocusListener() { public void focusGained(FocusEvent e) { synchronized (GlobalLock.lock) { @@ -499,7 +500,7 @@ private static native void reparentWindow(long display, long window, long parent, int x, int y); private static native long nGetInputFocus(long display) throws LWJGLException; private static native void nSetInputFocus(long display, long window, long time); - + private static boolean isAncestorXEmbedded(long window) throws LWJGLException { long xembed_atom = internAtom("_XEMBED_INFO", true); if (xembed_atom != None) { @@ -728,12 +729,13 @@ public void setTitle(String title) { lockAWT(); try { - nSetTitle(getDisplay(), getWindow(), title); + final ByteBuffer titleText = MemoryUtil.encodeUTF8(title); + nSetTitle(getDisplay(), getWindow(), MemoryUtil.getAddress(titleText), titleText.remaining() - 1); } finally { unlockAWT(); } } - private static native void nSetTitle(long display, long window, String title); + private static native void nSetTitle(long display, long window, long title, int len); public boolean isCloseRequested() { boolean result = close_requested; @@ -915,19 +917,19 @@ unlockAWT(); } } - + private void checkInput() { if (parent == null) return; - + if (xembedded) { long current_focus_window = 0; - + try { current_focus_window = nGetInputFocus(getDisplay()); } catch (LWJGLException e) { return; // fail silently as it can fail whilst splitting browser tabs } - + if (last_window_focus != current_focus_window || parent_focused != focused) { if (isParentWindowActive(current_focus_window)) { if (parent_focused) { @@ -963,49 +965,49 @@ } } } - + /** * This method will check if the parent window is active when running - * in xembed mode. Every xembed embedder window has a focus proxy - * window that recieves all the input. This method will test whether - * the provided window handle is the focus proxy, if so it will get its + * in xembed mode. Every xembed embedder window has a focus proxy + * window that recieves all the input. This method will test whether + * the provided window handle is the focus proxy, if so it will get its * parent window and then test whether this is an ancestor to our * current_window. If so then parent window is active. - * + * * @param window - the window handle to test */ private boolean isParentWindowActive(long window) { try { // parent window already active as window is current_window if (window == current_window) return true; - + // xembed focus proxy will have no children if (getChildCount(getDisplay(), window) != 0) return false; - + // get parent, will be xembed embedder window and ancestor of current_window long parent_window = getParentWindow(getDisplay(), window); - + // parent must not be None if (parent_window == None) return false; - + // scroll current_window's ancestors to find parent_window long w = current_window; - + while (w != None) { w = getParentWindow(getDisplay(), w); if (w == parent_window) { parent_proxy_focus_window = window; // save focus proxy window return true; } - } + } } catch (LWJGLException e) { LWJGLUtil.log("Failed to detect if parent window is active: " + e.getMessage()); return true; // on failure assume still active } - + return false; // failed to find an active parent window } - + private void setFocused(boolean got_focus, int focus_detail) { if (focused == got_focus || focus_detail == NotifyDetailNone || focus_detail == NotifyPointer || focus_detail == NotifyPointerRoot || parent != null) return; @@ -1356,11 +1358,11 @@ public boolean isInsideWindow() { return mouseInside; } - + public void setResizable(boolean resizable) { - + } - + public boolean wasResized() { return false; } @@ -1552,4 +1554,4 @@ } } -} \ No newline at end of file +} Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2011-08-20 11:56:46 UTC (rev 3619) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2011-08-20 16:38:45 UTC (rev 3620) @@ -438,7 +438,7 @@ private static native DisplayMode getCurrentDisplayMode() throws LWJGLException; public void setTitle(String title) { - CharBuffer buffer = MemoryUtil.encodeUTF16(title); + ByteBuffer buffer = MemoryUtil.encodeUTF16(title); nSetTitle(hwnd, MemoryUtil.getAddress0(buffer)); } private static native void nSetTitle(long hwnd, long title); Modified: trunk/LWJGL/src/native/linux/opengl/org_lwjgl_opengl_Display.c =================================================================== --- trunk/LWJGL/src/native/linux/opengl/org_lwjgl_opengl_Display.c 2011-08-20 11:56:46 UTC (rev 3619) +++ trunk/LWJGL/src/native/linux/opengl/org_lwjgl_opengl_Display.c 2011-08-20 16:38:45 UTC (rev 3620) @@ -1,31 +1,31 @@ -/* +/* * Copyright (c) 2002-2008 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. */ @@ -72,8 +72,8 @@ static Colormap cmap; static int current_depth; -static Pixmap current_icon_pixmap; -static Pixmap current_icon_mask_pixmap; +static Pixmap current_icon_pixmap; +static Pixmap current_icon_mask_pixmap; static Visual *current_visual; @@ -94,7 +94,7 @@ jmethodID handler_method = (*env)->GetStaticMethodID(env, org_lwjgl_LinuxDisplay_class, "globalErrorHandler", "(JJJJJJJ)I"); if (handler_method == NULL) return 0; - return (*env)->CallStaticIntMethod(env, org_lwjgl_LinuxDisplay_class, handler_method, (jlong)(intptr_t)disp, (jlong)(intptr_t)error, + return (*env)->CallStaticIntMethod(env, org_lwjgl_LinuxDisplay_class, handler_method, (jlong)(intptr_t)disp, (jlong)(intptr_t)error, (jlong)(intptr_t)error->display, (jlong)error->serial, (jlong)error->error_code, (jlong)error->request_code, (jlong)error->minor_code); } else return 0; @@ -170,15 +170,16 @@ return window_mode == org_lwjgl_opengl_LinuxDisplay_FULLSCREEN_LEGACY; } -static void setWindowTitle(Display *disp, Window window, const char *title) { - XStoreName(disp, window, title); +static void setWindowTitle(Display *disp, Window window, jlong title, jint len) { + // ASCII fallback if XChangeProperty fails. + XStoreName(disp, window, (const char *)(intptr_t)title); - // tell WM to use Unicode + // Set the UTF-8 encoded title XChangeProperty(disp, window, XInternAtom(disp, "_NET_WM_NAME", False), XInternAtom(disp, "UTF8_STRING", False), - 8, PropModeReplace, (unsigned char *) title, - strlen(title)); + 8, PropModeReplace, (const char *)(intptr_t)title, + len); } JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_LinuxDisplay_openDisplay(JNIEnv *env, jclass clazz) { @@ -202,13 +203,11 @@ Display *disp = (Display *)(intptr_t)display; initPeerInfo(env, peer_info_handle, disp, screen, pixel_format, true, GLX_WINDOW_BIT, true, false); } - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSetTitle(JNIEnv * env, jclass clazz, jlong display, jlong window_ptr, jstring title_obj) { + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSetTitle(JNIEnv * env, jclass clazz, jlong display, jlong window_ptr, jlong title, jint len) { Display *disp = (Display *)(intptr_t)display; Window window = (Window)window_ptr; - char * title = GetStringNativeChars(env, title_obj); - setWindowTitle(disp, window, title); - free(title); + setWindowTitle(disp, window, title, len); } static void freeIconPixmap(Display *disp) { @@ -285,7 +284,7 @@ throwException(env, "XAllocWMHints failed"); return; } - + win_hints->flags = InputHint; win_hints->input = True; if (current_icon_pixmap != 0) { @@ -321,10 +320,10 @@ attribs.override_redirect = True; } win = XCreateWindow(disp, parent, x, y, width, height, 0, vis_info->depth, InputOutput, vis_info->visual, attribmask, &attribs); - + current_depth = vis_info->depth; current_visual = vis_info->visual; - + XFree(vis_info); if (!checkXError(env, disp)) { XFreeColormap(disp, cmap); @@ -511,7 +510,7 @@ throwException(env, "XCreateImage failed"); return None; } - + GC gc = XCreateGC(disp, pixmap, 0, NULL); XPutImage(disp, pixmap, gc, image, 0, 0, 0, 0, width, height); XFreeGC(disp, gc); @@ -530,7 +529,7 @@ freeIconPixmap(disp); return; } - + updateWindowHints(env, disp, window); } Modified: trunk/LWJGL/src/native/linux/opengles/org_lwjgl_opengl_Display.c =================================================================== --- trunk/LWJGL/src/native/linux/opengles/org_lwjgl_opengl_Display.c 2011-08-20 11:56:46 UTC (rev 3619) +++ trunk/LWJGL/src/native/linux/opengles/org_lwjgl_opengl_Display.c 2011-08-20 16:38:45 UTC (rev 3620) @@ -167,15 +167,16 @@ return window_mode == org_lwjgl_opengl_LinuxDisplay_FULLSCREEN_LEGACY; } -static void setWindowTitle(Display *disp, Window window, const char *title) { - XStoreName(disp, window, title); +static void setWindowTitle(Display *disp, Window window, jlong title, jint len) { + // ASCII fallback if XChangeProperty fails. + XStoreName(disp, window, (const char *)(intptr_t)title); - // tell WM to use Unicode + // Set the UTF-8 encoded title XChangeProperty(disp, window, XInternAtom(disp, "_NET_WM_NAME", False), XInternAtom(disp, "UTF8_STRING", False), - 8, PropModeReplace, (unsigned char *) title, - strlen(title)); + 8, PropModeReplace, (const char *)(intptr_t)title, + len); } JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_LinuxDisplay_openDisplay(JNIEnv *env, jclass clazz) { @@ -197,12 +198,10 @@ //initPeerInfo(env, peer_info_handle, disp, screen); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSetTitle(JNIEnv * env, jclass clazz, jlong display, jlong window_ptr, jstring title_obj) { +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSetTitle(JNIEnv * env, jclass clazz, jlong display, jlong window_ptr, jlong title, jint len) { Display *disp = (Display *)(intptr_t)display; Window window = (Window)window_ptr; - char * title = GetStringNativeChars(env, title_obj); - setWindowTitle(disp, window, title); - free(title); + setWindowTitle(disp, window, title, len); } static void freeIconPixmap(Display *disp) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sp...@us...> - 2011-09-03 18:52:53
|
Revision: 3632 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3632&view=rev Author: spasi Date: 2011-09-03 18:52:45 +0000 (Sat, 03 Sep 2011) Log Message: ----------- Added support for OpenGL 3.2 on MacOS X 10.7+. Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/AWTCanvasImplementation.java trunk/LWJGL/src/java/org/lwjgl/opengl/AWTGLCanvas.java trunk/LWJGL/src/java/org/lwjgl/opengl/ContextAttribs.java trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java trunk/LWJGL/src/java/org/lwjgl/opengl/DisplayImplementation.java trunk/LWJGL/src/java/org/lwjgl/opengl/DrawableGL.java trunk/LWJGL/src/java/org/lwjgl/opengl/DrawableLWJGL.java trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxCanvasImplementation.java trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxContextAttribs.java trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXAWTGLCanvasPeerInfo.java trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXCanvasImplementation.java trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXCanvasPeerInfo.java trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXContextImplementation.java trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXDisplay.java trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXDisplayPeerInfo.java trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXPbufferPeerInfo.java trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXPeerInfo.java trunk/LWJGL/src/java/org/lwjgl/opengl/Pbuffer.java trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsCanvasImplementation.java trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsContextAttribs.java trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java trunk/LWJGL/src/native/macosx/context.h trunk/LWJGL/src/native/macosx/context.m trunk/LWJGL/src/native/macosx/org_lwjgl_opengl_MacOSXContextImplementation.m trunk/LWJGL/src/native/macosx/org_lwjgl_opengl_MacOSXPeerInfo.m Removed Paths: ------------- trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXContextAttribs.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/AWTCanvasImplementation.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/AWTCanvasImplementation.java 2011-09-03 18:41:22 UTC (rev 3631) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/AWTCanvasImplementation.java 2011-09-03 18:52:45 UTC (rev 3632) @@ -47,7 +47,7 @@ /** * Return an opaque handle to the canvas peer information required to create a context from it. */ - PeerInfo createPeerInfo(Canvas component, PixelFormat pixel_format) throws LWJGLException; + PeerInfo createPeerInfo(Canvas component, PixelFormat pixel_format, ContextAttribs attribs) throws LWJGLException; /** * Find a proper GraphicsConfiguration from the given GraphicsDevice and PixelFormat. Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/AWTGLCanvas.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/AWTGLCanvas.java 2011-09-03 18:41:22 UTC (rev 3631) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/AWTGLCanvas.java 2011-09-03 18:52:45 UTC (rev 3632) @@ -107,7 +107,7 @@ } } - public void setPixelFormat(final PixelFormatLWJGL pf) throws LWJGLException { + public void setPixelFormat(final PixelFormatLWJGL pf, final ContextAttribs attribs) throws LWJGLException { throw new UnsupportedOperationException(); } @@ -311,7 +311,7 @@ return; try { if ( peer_info == null ) { - this.peer_info = implementation.createPeerInfo(this, pixel_format); + this.peer_info = implementation.createPeerInfo(this, pixel_format, attribs); } peer_info.lockAndGetHandle(); try { Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/ContextAttribs.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/ContextAttribs.java 2011-09-03 18:41:22 UTC (rev 3631) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/ContextAttribs.java 2011-09-03 18:52:45 UTC (rev 3632) @@ -51,6 +51,10 @@ * If the forwardCompatible * attribute is used, LWJGL will not load the deprecated functionality (as defined in the OpenGL 3.0 specification). This * means that developers can start working on cleaning up their applications without an OpenGL 3.0 complaint driver. + * <p/> + * This extension is not supported on MacOS X. However, in order to enable the GL 3.2 context on MacOS X 10.7 or newer, an + * instance of this class must be passed to LWJGL. The only valid configuration is <code>new ContextAttribs(3, 2).withProfileCore()</code>, + * anything else will be ignored. * * @author spasi <sp...@us...> */ @@ -243,14 +247,15 @@ return new LinuxContextAttribs(); case LWJGLUtil.PLATFORM_WINDOWS: return new WindowsContextAttribs(); - case LWJGLUtil.PLATFORM_MACOSX: - return new MacOSXContextAttribs(); default: throw new IllegalStateException("Unsupported platform"); } } IntBuffer getAttribList() { + if ( LWJGLUtil.getPlatform() == LWJGLUtil.PLATFORM_MACOSX ) + return null; + ContextAttribsImplementation implementation = getImplementation(); int attribCount = 0; Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java 2011-09-03 18:41:22 UTC (rev 3631) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java 2011-09-03 18:52:45 UTC (rev 3632) @@ -93,10 +93,10 @@ * unlike GL, where it is typically at the bottom of the display. */ private static int y = -1; - + /** the width of the Display window */ private static int width = 0; - + /** the height of the Display window */ private static int height = 0; @@ -115,9 +115,9 @@ private static boolean window_created; private static boolean parent_resized; - + private static boolean window_resized; - + private static boolean window_resizable; /** Initial Background Color of Display */ @@ -305,7 +305,7 @@ DisplayMode mode = getEffectiveMode(); display_impl.createWindow(drawable, mode, tmp_parent, getWindowX(), getWindowY()); window_created = true; - + width = Display.getDisplayMode().getWidth(); height = Display.getDisplayMode().getHeight(); @@ -674,9 +674,9 @@ throw new RuntimeException(e); } } - + window_resized = !isFullscreen() && parent == null && display_impl.wasResized(); - + if ( window_resized ) { width = display_impl.getWidth(); height = display_impl.getHeight(); @@ -894,7 +894,7 @@ Display.drawable = drawable; try { - drawable.setPixelFormat(pixel_format); + drawable.setPixelFormat(pixel_format, attribs); try { createWindow(); try { @@ -1008,6 +1008,11 @@ switchDisplayMode(); final DrawableGLES drawable = new DrawableGLES() { + + public void setPixelFormat(final PixelFormatLWJGL pf, final ContextAttribs attribs) throws LWJGLException { + throw new UnsupportedOperationException(); + } + public void destroy() { synchronized ( GlobalLock.lock ) { if ( !isCreated() ) @@ -1269,11 +1274,11 @@ } } } - + /** * Enable or disable the Display window to be resized. * - * @param set true to make the Display window resizable; + * @param resizable set to true to make the Display window resizable; * false to disable resizing on the Display window. */ public static void setResizable(boolean resizable) { @@ -1282,65 +1287,65 @@ display_impl.setResizable(resizable); } } - + /** * @return true if the Display window is resizable. */ public static boolean isResizable() { return window_resizable; } - + /** * @return true if the Display window has been resized. * This value will be updated after a call to Display.update(). - * + * * This will return false if running in fullscreen or with Display.setParent(Canvas parent) */ public static boolean wasResized() { return window_resized; } - + /** * @return this method will return the width of the Display window. - * + * * If running in fullscreen mode it will return the width of the current set DisplayMode. * If running Display.setParent(Canvas parent) is being used, the width of the parent * will be returned. - * + * * This value will be updated after a call to Display.update(). */ public static int getWidth() { - + if (Display.isFullscreen()) { return Display.getDisplayMode().getWidth(); } - + if (parent != null) { return parent.getWidth(); } - + return width; } - + /** * @return this method will return the height of the Display window. - * + * * If running in fullscreen mode it will return the height of the current set DisplayMode. * If running Display.setParent(Canvas parent) is being used, the height of the parent * will be returned. - * + * * This value will be updated after a call to Display.update(). */ public static int getHeight() { - + if (Display.isFullscreen()) { return Display.getDisplayMode().getHeight(); - } - + } + if (parent != null) { return parent.getHeight(); } - + return height; } } Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/DisplayImplementation.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/DisplayImplementation.java 2011-09-03 18:41:22 UTC (rev 3631) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/DisplayImplementation.java 2011-09-03 18:52:45 UTC (rev 3632) @@ -108,7 +108,7 @@ * Create the native PeerInfo. * @throws LWJGLException */ - PeerInfo createPeerInfo(PixelFormat pixel_format) throws LWJGLException; + PeerInfo createPeerInfo(PixelFormat pixel_format, ContextAttribs attribs) throws LWJGLException; // void destroyPeerInfo(); @@ -136,7 +136,7 @@ /** * Method to create a Pbuffer */ - PeerInfo createPbuffer(int width, int height, PixelFormat pixel_format, + PeerInfo createPbuffer(int width, int height, PixelFormat pixel_format, ContextAttribs attribs, IntBuffer pixelFormatCaps, IntBuffer pBufferAttribs) throws LWJGLException; @@ -159,25 +159,25 @@ * @return number of icons used. */ int setIcon(ByteBuffer[] icons); - + /** * Enable or disable the Display window to be resized. * - * @param set true to make the Display window resizable; + * @param resizable set to true to make the Display window resizable; * false to disable resizing on the Display window. */ void setResizable(boolean resizable); - + /** * @return true if the Display window has been resized since this method was last called. */ boolean wasResized(); - + /** * @return this method will return a the width of the Display window. */ int getWidth(); - + /** * @return this method will return a the height of the Display window. */ Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/DrawableGL.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/DrawableGL.java 2011-09-03 18:41:22 UTC (rev 3631) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/DrawableGL.java 2011-09-03 18:52:45 UTC (rev 3632) @@ -53,8 +53,12 @@ } public void setPixelFormat(final PixelFormatLWJGL pf) throws LWJGLException { + throw new UnsupportedOperationException(); + } + + public void setPixelFormat(final PixelFormatLWJGL pf, final ContextAttribs attribs) throws LWJGLException { this.pixel_format = (PixelFormat)pf; - this.peer_info = Display.getImplementation().createPeerInfo(pixel_format); + this.peer_info = Display.getImplementation().createPeerInfo(pixel_format, attribs); } public PixelFormatLWJGL getPixelFormat() { Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/DrawableLWJGL.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/DrawableLWJGL.java 2011-09-03 18:41:22 UTC (rev 3631) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/DrawableLWJGL.java 2011-09-03 18:52:45 UTC (rev 3632) @@ -42,6 +42,8 @@ void setPixelFormat(PixelFormatLWJGL pf) throws LWJGLException; + void setPixelFormat(PixelFormatLWJGL pf, ContextAttribs attribs) throws LWJGLException; + PixelFormatLWJGL getPixelFormat(); /** Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxCanvasImplementation.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxCanvasImplementation.java 2011-09-03 18:41:22 UTC (rev 3631) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxCanvasImplementation.java 2011-09-03 18:52:45 UTC (rev 3632) @@ -76,7 +76,7 @@ } } - public PeerInfo createPeerInfo(Canvas component, PixelFormat pixel_format) throws LWJGLException { + public PeerInfo createPeerInfo(Canvas component, PixelFormat pixel_format, ContextAttribs attribs) throws LWJGLException { return new LinuxAWTGLCanvasPeerInfo(component); } Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxContextAttribs.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxContextAttribs.java 2011-09-03 18:41:22 UTC (rev 3631) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxContextAttribs.java 2011-09-03 18:52:45 UTC (rev 3632) @@ -33,8 +33,6 @@ /** * An implementation of ContextAttribs using GLX_create_context. - * <p/><p/> - * ---- WIP - GLX_create_context has not been defined yet ---- * * @author spasi <sp...@us...> */ @@ -42,14 +40,13 @@ private static final int GLX_CONTEXT_MAJOR_VERSION_ARB = 0x2091; private static final int GLX_CONTEXT_MINOR_VERSION_ARB = 0x2092; - private static final int GLX_CONTEXT_LAYER_PLANE_ARB = 0x2093; - private static final int GLX_CONTEXT_FLAGS_ARB = 0x2094; - private static final int GLX_CONTEXT_PROFILE_MASK_ARB = 0x9126; + private static final int GLX_CONTEXT_FLAGS_ARB = 0x2094; + private static final int GLX_CONTEXT_PROFILE_MASK_ARB = 0x9126; - private static final int GLX_CONTEXT_DEBUG_BIT_ARB = 0x0001; + private static final int GLX_CONTEXT_DEBUG_BIT_ARB = 0x0001; private static final int GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB = 0x0002; - private static final int GLX_CONTEXT_CORE_PROFILE_BIT_ARB = 0x00000001; + private static final int GLX_CONTEXT_CORE_PROFILE_BIT_ARB = 0x00000001; private static final int GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB = 0x00000002; LinuxContextAttribs() { @@ -64,7 +61,7 @@ } public int getLayerPlaneAttrib() { - return GLX_CONTEXT_LAYER_PLANE_ARB; + throw new UnsupportedOperationException(); } public int getFlagsAttrib() { Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2011-09-03 18:41:22 UTC (rev 3631) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2011-09-03 18:52:45 UTC (rev 3632) @@ -516,7 +516,7 @@ private static long getHandle(Canvas parent) throws LWJGLException { AWTCanvasImplementation awt_impl = AWTGLCanvas.createImplementation(); - LinuxPeerInfo parent_peer_info = (LinuxPeerInfo)awt_impl.createPeerInfo(parent, null); + LinuxPeerInfo parent_peer_info = (LinuxPeerInfo)awt_impl.createPeerInfo(parent, null, null); ByteBuffer parent_peer_info_handle = parent_peer_info.lockAndGetHandle(); try { return parent_peer_info.getDrawable(); @@ -757,7 +757,7 @@ return result; } - public PeerInfo createPeerInfo(PixelFormat pixel_format) throws LWJGLException { + public PeerInfo createPeerInfo(PixelFormat pixel_format, ContextAttribs attribs) throws LWJGLException { peer_info = new LinuxDisplayPeerInfo(pixel_format); return peer_info; } @@ -1243,7 +1243,7 @@ return false; } - public PeerInfo createPbuffer(int width, int height, PixelFormat pixel_format, + public PeerInfo createPbuffer(int width, int height, PixelFormat pixel_format, ContextAttribs attribs, IntBuffer pixelFormatCaps, IntBuffer pBufferAttribs) throws LWJGLException { return new LinuxPbufferPeerInfo(width, height, pixel_format); Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXAWTGLCanvasPeerInfo.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXAWTGLCanvasPeerInfo.java 2011-09-03 18:41:22 UTC (rev 3631) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXAWTGLCanvasPeerInfo.java 2011-09-03 18:52:45 UTC (rev 3632) @@ -44,8 +44,8 @@ final class MacOSXAWTGLCanvasPeerInfo extends MacOSXCanvasPeerInfo { private final Canvas component; - MacOSXAWTGLCanvasPeerInfo(Canvas component, PixelFormat pixel_format, boolean support_pbuffer) throws LWJGLException { - super(pixel_format, support_pbuffer); + MacOSXAWTGLCanvasPeerInfo(Canvas component, PixelFormat pixel_format, ContextAttribs attribs, boolean support_pbuffer) throws LWJGLException { + super(pixel_format, attribs, support_pbuffer); this.component = component; } Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXCanvasImplementation.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXCanvasImplementation.java 2011-09-03 18:41:22 UTC (rev 3631) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXCanvasImplementation.java 2011-09-03 18:52:45 UTC (rev 3632) @@ -44,11 +44,11 @@ * $Id$ */ final class MacOSXCanvasImplementation implements AWTCanvasImplementation { - public PeerInfo createPeerInfo(Canvas component, PixelFormat pixel_format) throws LWJGLException { + public PeerInfo createPeerInfo(Canvas component, PixelFormat pixel_format, ContextAttribs attribs) throws LWJGLException { try { - return new MacOSXAWTGLCanvasPeerInfo(component, pixel_format, true); + return new MacOSXAWTGLCanvasPeerInfo(component, pixel_format, attribs, true); } catch (LWJGLException e) { - return new MacOSXAWTGLCanvasPeerInfo(component, pixel_format, false); + return new MacOSXAWTGLCanvasPeerInfo(component, pixel_format, attribs, false); } } Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXCanvasPeerInfo.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXCanvasPeerInfo.java 2011-09-03 18:41:22 UTC (rev 3631) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXCanvasPeerInfo.java 2011-09-03 18:52:45 UTC (rev 3632) @@ -45,8 +45,8 @@ abstract class MacOSXCanvasPeerInfo extends MacOSXPeerInfo { private final AWTSurfaceLock awt_surface = new AWTSurfaceLock(); - protected MacOSXCanvasPeerInfo(PixelFormat pixel_format, boolean support_pbuffer) throws LWJGLException { - super(pixel_format, true, true, support_pbuffer, true); + protected MacOSXCanvasPeerInfo(PixelFormat pixel_format, ContextAttribs attribs, boolean support_pbuffer) throws LWJGLException { + super(pixel_format, attribs, true, true, support_pbuffer, true); } protected void initHandle(Canvas component) throws LWJGLException { Deleted: trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXContextAttribs.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXContextAttribs.java 2011-09-03 18:41:22 UTC (rev 3631) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXContextAttribs.java 2011-09-03 18:52:45 UTC (rev 3632) @@ -1,94 +0,0 @@ -/* - * Copyright (c) 2002-2008 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; - -/** - * An implementation of ContextAttribs for MacOS X. - * <p/><p/> - * ---- WIP - No XGL_create_context has been defined for MacOS X yet ---- - * - * @author spasi <sp...@us...> - */ -final class MacOSXContextAttribs implements ContextAttribsImplementation { - - private static final int XGL_CONTEXT_MAJOR_VERSION_ARB = 0x2091; - private static final int XGL_CONTEXT_MINOR_VERSION_ARB = 0x2092; - private static final int XGL_CONTEXT_LAYER_PLANE_ARB = 0x2093; - private static final int XGL_CONTEXT_FLAGS_ARB = 0x2094; - private static final int XGL_CONTEXT_PROFILE_MASK_ARB = 0x9126; - - private static final int XGL_CONTEXT_DEBUG_BIT_ARB = 0x0001; - private static final int XGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB = 0x0002; - - private static final int XGL_CONTEXT_CORE_PROFILE_BIT_ARB = 0x00000001; - private static final int XGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB = 0x00000002; - - MacOSXContextAttribs() { - } - - public int getMajorVersionAttrib() { - return XGL_CONTEXT_MAJOR_VERSION_ARB; - } - - public int getMinorVersionAttrib() { - return XGL_CONTEXT_MINOR_VERSION_ARB; - } - - public int getLayerPlaneAttrib() { - return XGL_CONTEXT_LAYER_PLANE_ARB; - } - - public int getFlagsAttrib() { - return XGL_CONTEXT_FLAGS_ARB; - } - - public int getDebugBit() { - return XGL_CONTEXT_DEBUG_BIT_ARB; - } - - public int getForwardCompatibleBit() { - return XGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB; - } - - public int getProfileMaskAttrib() { - return XGL_CONTEXT_PROFILE_MASK_ARB; - } - - public int getProfileCoreBit() { - return XGL_CONTEXT_CORE_PROFILE_BIT_ARB; - } - - public int getProfileCompatibilityBit() { - return XGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB; - } - -} \ No newline at end of file Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXContextImplementation.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXContextImplementation.java 2011-09-03 18:41:22 UTC (rev 3631) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXContextImplementation.java 2011-09-03 18:52:45 UTC (rev 3632) @@ -46,13 +46,13 @@ public ByteBuffer create(PeerInfo peer_info, IntBuffer attribs, ByteBuffer shared_context_handle) throws LWJGLException { ByteBuffer peer_handle = peer_info.lockAndGetHandle(); try { - return nCreate(peer_handle, attribs, shared_context_handle); + return nCreate(peer_handle, shared_context_handle); } finally { peer_info.unlock(); } } - private static native ByteBuffer nCreate(ByteBuffer peer_handle, IntBuffer attribs, ByteBuffer shared_context_handle) throws LWJGLException; + private static native ByteBuffer nCreate(ByteBuffer peer_handle, ByteBuffer shared_context_handle) throws LWJGLException; public void swapBuffers() throws LWJGLException { ContextGL current_context = ContextGL.getCurrentContext(); Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXDisplay.java 2011-09-03 18:41:22 UTC (rev 3631) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXDisplay.java 2011-09-03 18:52:45 UTC (rev 3632) @@ -240,11 +240,11 @@ return frame != null && frame.getCanvas().syncIsDirty(); } - public PeerInfo createPeerInfo(PixelFormat pixel_format) throws LWJGLException { + public PeerInfo createPeerInfo(PixelFormat pixel_format, ContextAttribs attribs) throws LWJGLException { try { - return new MacOSXDisplayPeerInfo(pixel_format, true); + return new MacOSXDisplayPeerInfo(pixel_format, attribs, true); } catch (LWJGLException e) { - return new MacOSXDisplayPeerInfo(pixel_format, false); + return new MacOSXDisplayPeerInfo(pixel_format, attribs, false); } } @@ -434,10 +434,10 @@ return false; } - public PeerInfo createPbuffer(int width, int height, PixelFormat pixel_format, + public PeerInfo createPbuffer(int width, int height, PixelFormat pixel_format, ContextAttribs attribs, IntBuffer pixelFormatCaps, IntBuffer pBufferAttribs) throws LWJGLException { - return new MacOSXPbufferPeerInfo(width, height, pixel_format); + return new MacOSXPbufferPeerInfo(width, height, pixel_format, attribs); } public void setPbufferAttrib(PeerInfo handle, int attrib, int value) { @@ -507,13 +507,13 @@ public boolean isInsideWindow() { return true; } - + public void setResizable(boolean resizable) { frame.setResizable(resizable); } - + public boolean wasResized() { return canvas_listener.wasResized(); } - + } Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXDisplayPeerInfo.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXDisplayPeerInfo.java 2011-09-03 18:41:22 UTC (rev 3631) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXDisplayPeerInfo.java 2011-09-03 18:52:45 UTC (rev 3632) @@ -44,8 +44,8 @@ final class MacOSXDisplayPeerInfo extends MacOSXCanvasPeerInfo { private boolean locked; - MacOSXDisplayPeerInfo(PixelFormat pixel_format, boolean support_pbuffer) throws LWJGLException { - super(pixel_format, support_pbuffer); + MacOSXDisplayPeerInfo(PixelFormat pixel_format, ContextAttribs attribs, boolean support_pbuffer) throws LWJGLException { + super(pixel_format, attribs, support_pbuffer); } protected void doLockAndInitHandle() throws LWJGLException { Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXPbufferPeerInfo.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXPbufferPeerInfo.java 2011-09-03 18:41:22 UTC (rev 3631) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXPbufferPeerInfo.java 2011-09-03 18:52:45 UTC (rev 3632) @@ -42,8 +42,8 @@ * $Id$ */ final class MacOSXPbufferPeerInfo extends MacOSXPeerInfo { - MacOSXPbufferPeerInfo(int width, int height, PixelFormat pixel_format) throws LWJGLException { - super(pixel_format, false, false, true, false); + MacOSXPbufferPeerInfo(int width, int height, PixelFormat pixel_format, ContextAttribs attribs) throws LWJGLException { + super(pixel_format, attribs, false, false, true, false); nCreate(getHandle(), width, height); } private static native void nCreate(ByteBuffer handle, int width, int height) throws LWJGLException; Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXPeerInfo.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXPeerInfo.java 2011-09-03 18:41:22 UTC (rev 3631) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXPeerInfo.java 2011-09-03 18:52:45 UTC (rev 3632) @@ -43,18 +43,23 @@ * $Id$ */ abstract class MacOSXPeerInfo extends PeerInfo { - MacOSXPeerInfo(PixelFormat pixel_format, boolean use_display_bpp, boolean support_window, boolean support_pbuffer, boolean double_buffered) throws LWJGLException { + MacOSXPeerInfo(PixelFormat pixel_format, ContextAttribs attribs, boolean use_display_bpp, boolean support_window, boolean support_pbuffer, boolean double_buffered) throws LWJGLException { super(createHandle()); if (pixel_format.isFloatingPoint() && !LWJGLUtil.isMacOSXEqualsOrBetterThan(10, 4)) - throw new LWJGLException("Floating point pixel format requested, but is not supported"); - choosePixelFormat(pixel_format, use_display_bpp, support_window, support_pbuffer, double_buffered); + throw new LWJGLException("Floating point pixel format requested, but it requires MacOS X 10.4 or newer"); + + boolean gl32 = attribs.getMajorVersion() == 3 && attribs.getMinorVersion() == 2 && attribs.isProfileCore(); + if ( gl32 && !LWJGLUtil.isMacOSXEqualsOrBetterThan(10, 7) ) + throw new LWJGLException("OpenGL 3.2 requested, but it requires MacOS X 10.7 or newer"); + + choosePixelFormat(pixel_format, gl32, use_display_bpp, support_window, support_pbuffer, double_buffered); } private static native ByteBuffer createHandle(); - private void choosePixelFormat(PixelFormat pixel_format, boolean use_display_bpp, boolean support_window, boolean support_pbuffer, boolean double_buffered) throws LWJGLException { - nChoosePixelFormat(getHandle(), pixel_format, use_display_bpp, support_window, support_pbuffer, double_buffered); + private void choosePixelFormat(PixelFormat pixel_format, boolean gl32, boolean use_display_bpp, boolean support_window, boolean support_pbuffer, boolean double_buffered) throws LWJGLException { + nChoosePixelFormat(getHandle(), pixel_format, gl32, use_display_bpp, support_window, support_pbuffer, double_buffered); } - private static native void nChoosePixelFormat(ByteBuffer peer_info_handle, PixelFormat pixel_format, boolean use_display_bpp, boolean support_window, boolean support_pbuffer, boolean double_buffered) throws LWJGLException; + private static native void nChoosePixelFormat(ByteBuffer peer_info_handle, PixelFormat pixel_format, boolean gl32, boolean use_display_bpp, boolean support_window, boolean support_pbuffer, boolean double_buffered) throws LWJGLException; public void destroy() { nDestroy(getHandle()); Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/Pbuffer.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/Pbuffer.java 2011-09-03 18:41:22 UTC (rev 3631) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/Pbuffer.java 2011-09-03 18:52:45 UTC (rev 3632) @@ -216,7 +216,7 @@ throw new NullPointerException("Pixel format must be non-null"); this.width = width; this.height = height; - this.peer_info = createPbuffer(width, height, pixel_format, renderTexture); + this.peer_info = createPbuffer(width, height, pixel_format, attribs, renderTexture); Context shared_context = null; if ( shared_drawable == null ) shared_drawable = Display.getDrawable(); // May be null @@ -225,15 +225,15 @@ this.context = new ContextGL(peer_info, attribs, (ContextGL)shared_context); } - private static PeerInfo createPbuffer(int width, int height, PixelFormat pixel_format, RenderTexture renderTexture) throws LWJGLException { + private static PeerInfo createPbuffer(int width, int height, PixelFormat pixel_format, ContextAttribs attribs, RenderTexture renderTexture) throws LWJGLException { if ( renderTexture == null ) { // Though null is a perfectly valid argument, Matrox Parhelia drivers expect // a 0 terminated list, or else they crash. Supplying NULL or 0, should // cause the drivers to use default settings IntBuffer defaultAttribs = BufferUtils.createIntBuffer(1); - return Display.getImplementation().createPbuffer(width, height, pixel_format, null, defaultAttribs); + return Display.getImplementation().createPbuffer(width, height, pixel_format, attribs, null, defaultAttribs); } else - return Display.getImplementation().createPbuffer(width, height, pixel_format, + return Display.getImplementation().createPbuffer(width, height, pixel_format, attribs, renderTexture.pixelFormatCaps, renderTexture.pBufferAttribs); } Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsCanvasImplementation.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsCanvasImplementation.java 2011-09-03 18:41:22 UTC (rev 3631) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsCanvasImplementation.java 2011-09-03 18:52:45 UTC (rev 3632) @@ -66,7 +66,7 @@ }); } - public PeerInfo createPeerInfo(Canvas component, PixelFormat pixel_format) throws LWJGLException { + public PeerInfo createPeerInfo(Canvas component, PixelFormat pixel_format, ContextAttribs attribs) throws LWJGLException { return new WindowsAWTGLCanvasPeerInfo(component, pixel_format); } Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsContextAttribs.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsContextAttribs.java 2011-09-03 18:41:22 UTC (rev 3631) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsContextAttribs.java 2011-09-03 18:52:45 UTC (rev 3632) @@ -40,14 +40,14 @@ private static final int WGL_CONTEXT_MAJOR_VERSION_ARB = 0x2091; private static final int WGL_CONTEXT_MINOR_VERSION_ARB = 0x2092; - private static final int WGL_CONTEXT_LAYER_PLANE_ARB = 0x2093; - private static final int WGL_CONTEXT_FLAGS_ARB = 0x2094; - private static final int WGL_CONTEXT_PROFILE_MASK_ARB = 0x9126; + private static final int WGL_CONTEXT_LAYER_PLANE_ARB = 0x2093; + private static final int WGL_CONTEXT_FLAGS_ARB = 0x2094; + private static final int WGL_CONTEXT_PROFILE_MASK_ARB = 0x9126; - private static final int WGL_CONTEXT_DEBUG_BIT_ARB = 0x0001; + private static final int WGL_CONTEXT_DEBUG_BIT_ARB = 0x0001; private static final int WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB = 0x0002; - private static final int WGL_CONTEXT_CORE_PROFILE_BIT_ARB = 0x00000001; + private static final int WGL_CONTEXT_CORE_PROFILE_BIT_ARB = 0x00000001; private static final int WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB = 0x00000002; WindowsContextAttribs() { Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2011-09-03 18:41:22 UTC (rev 3631) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2011-09-03 18:52:45 UTC (rev 3632) @@ -247,7 +247,7 @@ private static long getHwnd(Canvas parent) throws LWJGLException { AWTCanvasImplementation awt_impl = AWTGLCanvas.createImplementation(); - WindowsPeerInfo parent_peer_info = (WindowsPeerInfo)awt_impl.createPeerInfo(parent, null); + WindowsPeerInfo parent_peer_info = (WindowsPeerInfo)awt_impl.createPeerInfo(parent, null, null); ByteBuffer parent_peer_info_handle = parent_peer_info.lockAndGetHandle(); try { return parent_peer_info.getHwnd(); @@ -463,7 +463,7 @@ return saved; } - public PeerInfo createPeerInfo(PixelFormat pixel_format) throws LWJGLException { + public PeerInfo createPeerInfo(PixelFormat pixel_format, ContextAttribs attribs) throws LWJGLException { peer_info = new WindowsDisplayPeerInfo(false); return peer_info; } @@ -657,7 +657,7 @@ return ((WindowsPbufferPeerInfo)handle).isBufferLost(); } - public PeerInfo createPbuffer(int width, int height, PixelFormat pixel_format, + public PeerInfo createPbuffer(int width, int height, PixelFormat pixel_format, ContextAttribs attribs, IntBuffer pixelFormatCaps, IntBuffer pBufferAttribs) throws LWJGLException { return new WindowsPbufferPeerInfo(width, height, pixel_format, pixelFormatCaps, pBufferAttribs); Modified: trunk/LWJGL/src/native/macosx/context.h =================================================================== --- trunk/LWJGL/src/native/macosx/context.h 2011-09-03 18:41:22 UTC (rev 3631) +++ trunk/LWJGL/src/native/macosx/context.h 2011-09-03 18:52:45 UTC (rev 3632) @@ -1,31 +1,31 @@ -/* +/* * Copyright (c) 2002-2008 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. */ @@ -57,5 +57,5 @@ }; } MacOSXPeerInfo; -NSOpenGLPixelFormat *choosePixelFormat(JNIEnv *env, jobject pixel_format, bool use_display_bpp, bool support_window, bool support_pbuffer, bool double_buffered); +NSOpenGLPixelFormat *choosePixelFormat(JNIEnv *env, jobject pixel_format, bool gl32, bool use_display_bpp, bool support_window, bool support_pbuffer, bool double_buffered); #endif Modified: trunk/LWJGL/src/native/macosx/context.m =================================================================== --- trunk/LWJGL/src/native/macosx/context.m 2011-09-03 18:41:22 UTC (rev 3631) +++ trunk/LWJGL/src/native/macosx/context.m 2011-09-03 18:52:45 UTC (rev 3632) @@ -1,31 +1,31 @@ -/* +/* * Copyright (c) 2002-2008 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. */ @@ -51,12 +51,12 @@ return address; } -static CFBundleRef loadFramework(JNIEnv *env) { +static CFBundleRef loadFramework(JNIEnv *env) { CFStringRef framework_path = CFSTR("/System/Library/Frameworks/OpenGL.framework"); if (framework_path == NULL) { printfDebugJava(env, "Failed to allocate string"); return NULL; - } + } CFURLRef url = CFURLCreateWithFileSystemPath(NULL, framework_path, kCFURLPOSIXPathStyle, TRUE); if (url == NULL) { printfDebugJava(env, "Failed to allocate URL"); @@ -87,14 +87,14 @@ } } -NSOpenGLPixelFormat *choosePixelFormat(JNIEnv *env, jobject pixel_format, bool use_display_bpp, bool support_window, bool support_pbuffer, bool double_buffered) { +NSOpenGLPixelFormat *choosePixelFormat(JNIEnv *env, jobject pixel_format, bool gl32, bool use_display_bpp, bool support_window, bool support_pbuffer, bool double_buffered) { int bpp; jclass cls_pixel_format = (*env)->GetObjectClass(env, pixel_format); if (use_display_bpp) bpp = CGDisplayBitsPerPixel(kCGDirectMainDisplay); else bpp = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "bpp", "I")); - + int alpha = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "alpha", "I")); int depth = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "depth", "I")); int stencil = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "stencil", "I")); @@ -125,6 +125,10 @@ putAttrib(&attribs, NSOpenGLPFASampleBuffers); putAttrib(&attribs, samples > 0 ? 1 : 0); putAttrib(&attribs, NSOpenGLPFASamples); putAttrib(&attribs, samples); putAttrib(&attribs, NSOpenGLPFAAuxBuffers); putAttrib(&attribs, num_aux_buffers); + if (gl32) { + putAttrib(&attribs, 99); // NSOpenGLPFAOpenGLProfile + putAttrib(&attribs, 0x3200); // NSOpenGLProfileVersion3_2Core + } if (support_window) putAttrib(&attribs, NSOpenGLPFAWindow); if (support_pbuffer) Modified: trunk/LWJGL/src/native/macosx/org_lwjgl_opengl_MacOSXContextImplementation.m =================================================================== --- trunk/LWJGL/src/native/macosx/org_lwjgl_opengl_MacOSXContextImplementation.m 2011-09-03 18:41:22 UTC (rev 3631) +++ trunk/LWJGL/src/native/macosx/org_lwjgl_opengl_MacOSXContextImplementation.m 2011-09-03 18:52:45 UTC (rev 3632) @@ -1,31 +1,31 @@ -/* +/* * Copyright (c) 2002-2008 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. */ @@ -49,7 +49,7 @@ } MacOSXContext; JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_MacOSXContextImplementation_nCreate - (JNIEnv *env, jclass clazz, jobject peer_info_handle, jobject attribs, jobject shared_context_handle) { + (JNIEnv *env, jclass clazz, jobject peer_info_handle, jobject shared_context_handle) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; MacOSXPeerInfo *peer_info; MacOSXContext *shared_context_info; @@ -75,7 +75,7 @@ context_info->context = context; context_info->peer_info = peer_info; [pool release]; - return context_handle; + return context_handle; } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXContextImplementation_nSwapBuffers Modified: trunk/LWJGL/src/native/macosx/org_lwjgl_opengl_MacOSXPeerInfo.m =================================================================== --- trunk/LWJGL/src/native/macosx/org_lwjgl_opengl_MacOSXPeerInfo.m 2011-09-03 18:41:22 UTC (rev 3631) +++ trunk/LWJGL/src/native/macosx/org_lwjgl_opengl_MacOSXPeerInfo.m 2011-09-03 18:52:45 UTC (rev 3632) @@ -1,31 +1,31 @@ -/* +/* * Copyright (c) 2002-2008 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. */ @@ -52,10 +52,10 @@ } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXPeerInfo_nChoosePixelFormat - (JNIEnv *env, jclass clazz, jobject peer_info_handle, jobject pixel_format, jboolean use_display_bpp, jboolean support_window, jboolean support_pbuffer, jboolean double_buffered) { + (JNIEnv *env, jclass clazz, jobject peer_info_handle, jobject pixel_format, jboolean gl32, jboolean use_display_bpp, jboolean support_window, jboolean support_pbuffer, jboolean double_buffered) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; MacOSXPeerInfo *peer_info = (MacOSXPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle); - NSOpenGLPixelFormat *macosx_pixel_format = choosePixelFormat(env, pixel_format, use_display_bpp, support_window, support_pbuffer, double_buffered); + NSOpenGLPixelFormat *macosx_pixel_format = choosePixelFormat(env, pixel_format, gl32, use_display_bpp, support_window, support_pbuffer, double_buffered); if (pixel_format == nil) { throwException(env, "Could not find pixel format"); return; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2011-10-02 20:41:40
|
Revision: 3645 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3645&view=rev Author: kappa1 Date: 2011-10-02 20:41:33 +0000 (Sun, 02 Oct 2011) Log Message: ----------- Implement Resizing API for Linux. Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java trunk/LWJGL/src/native/linux/opengl/org_lwjgl_opengl_Display.c trunk/LWJGL/src/native/linux/opengles/org_lwjgl_opengl_Display.c Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2011-09-30 11:28:53 UTC (rev 3644) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2011-10-02 20:41:33 UTC (rev 3645) @@ -141,7 +141,12 @@ private long current_cursor; private long blank_cursor; private boolean mouseInside = true; - + private boolean resizable; + private boolean resized; + + private int window_width; + private int window_height; + private Canvas parent; private long parent_window; private static boolean xembedded; @@ -461,7 +466,11 @@ boolean undecorated = Display.getPrivilegedBoolean("org.lwjgl.opengl.Window.undecorated") || (current_window_mode != WINDOWED && Display.getPrivilegedBoolean("org.lwjgl.opengl.Window.undecorated_fs")); this.parent = parent; parent_window = parent != null ? getHandle(parent) : getRootWindow(getDisplay(), getDefaultScreen()); - current_window = nCreateWindow(getDisplay(), getDefaultScreen(), handle, mode, current_window_mode, x, y, undecorated, parent_window); + resizable = Display.isResizable(); + resized = false; + window_width = mode.getWidth(); + window_height = mode.getHeight(); + current_window = nCreateWindow(getDisplay(), getDefaultScreen(), handle, mode, current_window_mode, x, y, undecorated, parent_window, resizable); mapRaised(getDisplay(), current_window); xembedded = parent != null && isAncestorXEmbedded(parent_window); blank_cursor = createBlankCursor(); @@ -495,7 +504,7 @@ unlockAWT(); } } - private static native long nCreateWindow(long display, int screen, ByteBuffer peer_info_handle, DisplayMode mode, int window_mode, int x, int y, boolean undecorated, long parent_handle) throws LWJGLException; + private static native long nCreateWindow(long display, int screen, ByteBuffer peer_info_handle, DisplayMode mode, int window_mode, int x, int y, boolean undecorated, long parent_handle, boolean resizable) throws LWJGLException; private static native long getRootWindow(long display, int screen); private static native boolean hasProperty(long display, long window, long property); private static native long getParentWindow(long display, long window) throws LWJGLException; @@ -504,6 +513,9 @@ private static native void reparentWindow(long display, long window, long parent, int x, int y); private static native long nGetInputFocus(long display) throws LWJGLException; private static native void nSetInputFocus(long display, long window, long time); + private static native void nSetWindowSize(long display, long window, int width, int height, boolean resizable); + private static native int nGetWidth(long display, long window); + private static native int nGetHeight(long display, long window); private static boolean isAncestorXEmbedded(long window) throws LWJGLException { long xembed_atom = internAtom("_XEMBED_INFO", true); @@ -823,6 +835,16 @@ break; case LinuxEvent.Expose: dirty = true; + + int width = nGetWidth(getDisplay(), getWindow()); + int height = nGetHeight(getDisplay(), getWindow()); + + if (window_width != width || window_height != height) { + resized = true; + window_width = width; + window_height = height; + } + break; case LinuxEvent.EnterNotify: mouseInside = true; @@ -1346,11 +1368,11 @@ private static native void nSetWindowIcon(long display, long window, ByteBuffer icon_rgb, int icon_rgb_size, ByteBuffer icon_mask, int icon_mask_size, int width, int height); public int getWidth() { - return Display.getDisplayMode().getWidth(); + return window_width; } public int getHeight() { - return Display.getDisplayMode().getHeight(); + return window_height; } public boolean isInsideWindow() { @@ -1358,10 +1380,20 @@ } public void setResizable(boolean resizable) { - + if (this.resizable == resizable) { + return; + } + + this.resizable = resizable; + nSetWindowSize(getDisplay(), getWindow(), window_width, window_height, resizable); } public boolean wasResized() { + if (resized) { + resized = false; + return true; + } + return false; } Modified: trunk/LWJGL/src/native/linux/opengl/org_lwjgl_opengl_Display.c =================================================================== --- trunk/LWJGL/src/native/linux/opengl/org_lwjgl_opengl_Display.c 2011-09-30 11:28:53 UTC (rev 3644) +++ trunk/LWJGL/src/native/linux/opengl/org_lwjgl_opengl_Display.c 2011-10-02 20:41:33 UTC (rev 3645) @@ -278,6 +278,26 @@ return RootWindow(disp, screen); } +JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetWidth(JNIEnv *env, jclass unused, jlong display_ptr, jlong window_ptr) { + Display *disp = (Display *)(intptr_t)display_ptr; + Window win = (Window)window_ptr; + XWindowAttributes win_attribs; + + XGetWindowAttributes(disp, win, &win_attribs); + + return win_attribs.width; +} + +JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetHeight(JNIEnv *env, jclass unused, jlong display_ptr, jlong window_ptr) { + Display *disp = (Display *)(intptr_t)display_ptr; + Window win = (Window)window_ptr; + XWindowAttributes win_attribs; + + XGetWindowAttributes(disp, win, &win_attribs); + + return win_attribs.height; +} + static void updateWindowHints(JNIEnv *env, Display *disp, Window window) { XWMHints* win_hints = XAllocWMHints(); if (win_hints == NULL) { @@ -301,7 +321,28 @@ XFlush(disp); } -static Window createWindow(JNIEnv* env, Display *disp, int screen, jint window_mode, X11PeerInfo *peer_info, int x, int y, int width, int height, jboolean undecorated, long parent_handle) { +static void updateWindowBounds(Display *disp, Window win, int x, int y, int width, int height, jboolean position, jboolean resizable) { + XSizeHints *window_hints = XAllocSizeHints(); + + if (position) { + window_hints->flags |= PPosition; + window_hints->x = x; + window_hints->y = y; + } + + if (!resizable) { + window_hints->flags |= PMinSize | PMaxSize; + window_hints->min_width = width; + window_hints->max_width = width; + window_hints->min_height = height; + window_hints->max_height = height; + } + + XSetWMNormalHints(disp, win, window_hints); + XFree(window_hints); +} + +static Window createWindow(JNIEnv* env, Display *disp, int screen, jint window_mode, X11PeerInfo *peer_info, int x, int y, int width, int height, jboolean undecorated, long parent_handle, jboolean resizable) { Window parent = (Window)parent_handle; Window win; XSetWindowAttributes attribs; @@ -334,17 +375,10 @@ // Use Motif decoration hint property and hope the window manager respects them setDecorations(disp, win, 0); } - XSizeHints * window_hints = XAllocSizeHints(); - window_hints->flags = PPosition | PMinSize | PMaxSize; - window_hints->x = x; - window_hints->y = y; - window_hints->min_width = width; - window_hints->max_width = width; - window_hints->min_height = height; - window_hints->max_height = height; - XSetWMNormalHints(disp, win, window_hints); + + updateWindowBounds(disp, win, x, y, width, height, JNI_TRUE, resizable); updateWindowHints(env, disp, win); - XFree(window_hints); + #define NUM_ATOMS 1 Atom protocol_atoms[NUM_ATOMS] = {XInternAtom(disp, "WM_DELETE_WINDOW", False)/*, XInternAtom(disp, "WM_TAKE_FOCUS", False)*/}; XSetWMProtocols(disp, win, protocol_atoms, NUM_ATOMS); @@ -437,7 +471,7 @@ XSetInputFocus(disp, window, RevertToParent, time); } -JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nCreateWindow(JNIEnv *env, jclass clazz, jlong display, jint screen, jobject peer_info_handle, jobject mode, jint window_mode, jint x, jint y, jboolean undecorated, jlong parent_handle) { +JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nCreateWindow(JNIEnv *env, jclass clazz, jlong display, jint screen, jobject peer_info_handle, jobject mode, jint window_mode, jint x, jint y, jboolean undecorated, jlong parent_handle, jboolean resizable) { Display *disp = (Display *)(intptr_t)display; X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_info_handle); GLXFBConfig *fb_config = NULL; @@ -451,7 +485,7 @@ jfieldID fid_height = (*env)->GetFieldID(env, cls_displayMode, "height", "I"); int width = (*env)->GetIntField(env, mode, fid_width); int height = (*env)->GetIntField(env, mode, fid_height); - Window win = createWindow(env, disp, screen, window_mode, peer_info, x, y, width, height, undecorated, parent_handle); + Window win = createWindow(env, disp, screen, window_mode, peer_info, x, y, width, height, undecorated, parent_handle, resizable); if ((*env)->ExceptionOccurred(env)) { return 0; } @@ -466,6 +500,12 @@ return win; } +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSetWindowSize(JNIEnv *env, jclass clazz, jlong display, jlong window_ptr, jint width, jint height, jboolean resizable) { + Display *disp = (Display *)(intptr_t)display; + Window win = (Window)window_ptr; + updateWindowBounds(disp, win, 0, 0, width, height, JNI_FALSE, resizable); +} + JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nDestroyWindow(JNIEnv *env, jclass clazz, jlong display, jlong window_ptr) { Display *disp = (Display *)(intptr_t)display; Window window = (Window)window_ptr; Modified: trunk/LWJGL/src/native/linux/opengles/org_lwjgl_opengl_Display.c =================================================================== --- trunk/LWJGL/src/native/linux/opengles/org_lwjgl_opengl_Display.c 2011-09-30 11:28:53 UTC (rev 3644) +++ trunk/LWJGL/src/native/linux/opengles/org_lwjgl_opengl_Display.c 2011-10-02 20:41:33 UTC (rev 3645) @@ -268,6 +268,26 @@ return RootWindow(disp, screen); } +JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetWidth(JNIEnv *env, jclass unused, jlong display_ptr, jlong window_ptr) { + Display *disp = (Display *)(intptr_t)display_ptr; + Window win = (Window)window_ptr; + XWindowAttributes win_attribs; + + XGetWindowAttributes(disp, win, &win_attribs); + + return win_attribs.width; +} + +JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetHeight(JNIEnv *env, jclass unused, jlong display_ptr, jlong window_ptr) { + Display *disp = (Display *)(intptr_t)display_ptr; + Window win = (Window)window_ptr; + XWindowAttributes win_attribs; + + XGetWindowAttributes(disp, win, &win_attribs); + + return win_attribs.height; +} + static void updateWindowHints(JNIEnv *env, Display *disp, Window window) { XWMHints* win_hints = XAllocWMHints(); if (win_hints == NULL) { @@ -291,7 +311,28 @@ XFlush(disp); } -static Window createWindow(JNIEnv* env, Display *disp, int screen, jint window_mode, X11PeerInfo *peer_info, int x, int y, int width, int height, jboolean undecorated, long parent_handle) { +static void updateWindowBounds(Display *disp, Window win, int x, int y, int width, int height, jboolean position, jboolean resizable) { + XSizeHints *window_hints = XAllocSizeHints(); + + if (position) { + window_hints->flags |= PPosition; + window_hints->x = x; + window_hints->y = y; + } + + if (!resizable) { + window_hints->flags |= PMinSize | PMaxSize; + window_hints->min_width = width; + window_hints->max_width = width; + window_hints->min_height = height; + window_hints->max_height = height; + } + + XSetWMNormalHints(disp, win, window_hints); + XFree(window_hints); +} + +static Window createWindow(JNIEnv* env, Display *disp, int screen, jint window_mode, X11PeerInfo *peer_info, int x, int y, int width, int height, jboolean undecorated, long parent_handle, jboolean resizable) { Window parent = (Window)parent_handle; Window win; XSetWindowAttributes attribs; @@ -328,17 +369,10 @@ // Use Motif decoration hint property and hope the window manager respects them setDecorations(disp, win, 0); } - XSizeHints * window_hints = XAllocSizeHints(); - window_hints->flags = PPosition | PMinSize | PMaxSize; - window_hints->x = x; - window_hints->y = y; - window_hints->min_width = width; - window_hints->max_width = width; - window_hints->min_height = height; - window_hints->max_height = height; - XSetWMNormalHints(disp, win, window_hints); + + updateWindowBounds(disp, win, x, y, width, height, JNI_TRUE, resizable); updateWindowHints(env, disp, win); - XFree(window_hints); + #define NUM_ATOMS 1 Atom protocol_atoms[NUM_ATOMS] = {XInternAtom(disp, "WM_DELETE_WINDOW", False)/*, XInternAtom(disp, "WM_TAKE_FOCUS", False)*/}; XSetWMProtocols(disp, win, protocol_atoms, NUM_ATOMS); @@ -431,7 +465,7 @@ XSetInputFocus(disp, window, RevertToParent, time); } -JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nCreateWindow(JNIEnv *env, jclass clazz, jlong display, jint screen, jobject peer_info_handle, jobject mode, jint window_mode, jint x, jint y, jboolean undecorated, jlong parent_handle) { +JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nCreateWindow(JNIEnv *env, jclass clazz, jlong display, jint screen, jobject peer_info_handle, jobject mode, jint window_mode, jint x, jint y, jboolean undecorated, jlong parent_handle, jboolean resizable) { Display *disp = (Display *)(intptr_t)display; X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_info_handle); @@ -443,7 +477,7 @@ int width = (*env)->GetIntField(env, mode, fid_width); int height = (*env)->GetIntField(env, mode, fid_height); - Window win = createWindow(env, disp, screen, window_mode, peer_info, x, y, width, height, undecorated, parent_handle); + Window win = createWindow(env, disp, screen, window_mode, peer_info, x, y, width, height, undecorated, parent_handle, resizable); if ((*env)->ExceptionOccurred(env)) return 0; @@ -454,6 +488,12 @@ return win; } +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSetWindowSize(JNIEnv *env, jclass clazz, jlong display, jlong window_ptr, jint width, jint height, jboolean resizable) { + Display *disp = (Display *)(intptr_t)display; + Window win = (Window)window_ptr; + updateWindowBounds(disp, win, 0, 0, width, height, JNI_FALSE, resizable); +} + JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nDestroyWindow(JNIEnv *env, jclass clazz, jlong display, jlong window_ptr) { Display *disp = (Display *)(intptr_t)display; Window window = (Window)window_ptr; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2011-10-06 20:16:43
|
Revision: 3650 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3650&view=rev Author: kappa1 Date: 2011-10-06 20:16:37 +0000 (Thu, 06 Oct 2011) Log Message: ----------- apply CL/GL interop patch for mac, thx to jaekwon for patch. Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/ContextGL.java trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXContextImplementation.java trunk/LWJGL/src/native/macosx/org_lwjgl_opengl_MacOSXContextImplementation.m Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/ContextGL.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/ContextGL.java 2011-10-05 19:19:00 UTC (rev 3649) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/ContextGL.java 2011-10-06 20:16:37 UTC (rev 3650) @@ -36,6 +36,7 @@ import org.lwjgl.PointerBuffer; import org.lwjgl.Sys; import org.lwjgl.opencl.KHRGLSharing; +import org.lwjgl.opencl.APPLEGLSharing; import java.nio.ByteBuffer; import java.nio.IntBuffer; @@ -275,8 +276,16 @@ properties.put(KHRGLSharing.CL_GL_CONTEXT_KHR).put(implLinux.getGLXContext(handle)); properties.put(KHRGLSharing.CL_GLX_DISPLAY_KHR).put(implLinux.getDisplay(peer_handle)); break; + case LWJGLUtil.PLATFORM_MACOSX: + if (LWJGLUtil.isMacOSXEqualsOrBetterThan(10, 6)) { // only supported on OS X 10.6+ + // http://oscarbg.blogspot.com/2009/10/about-opencl-opengl-interop.html + final MacOSXContextImplementation implMacOSX = (MacOSXContextImplementation)implementation; + final long CGLShareGroup = implMacOSX.getCGLShareGroup(handle); + properties.put(APPLEGLSharing.CL_CONTEXT_PROPERTY_USE_CGL_SHAREGROUP_APPLE).put(CGLShareGroup); + break; + } default: - throw new UnsupportedOperationException("CL/GL context sharing is not supposed on this platform."); + throw new UnsupportedOperationException("CL/GL context sharing is not supported on this platform."); } } finally { peer_info.unlock(); Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXContextImplementation.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXContextImplementation.java 2011-10-05 19:19:00 UTC (rev 3649) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXContextImplementation.java 2011-10-06 20:16:37 UTC (rev 3650) @@ -63,6 +63,8 @@ } } + native long getCGLShareGroup(ByteBuffer context_handle); + private static native void nSwapBuffers(ByteBuffer context_handle) throws LWJGLException; public void update(ByteBuffer context_handle) { Modified: trunk/LWJGL/src/native/macosx/org_lwjgl_opengl_MacOSXContextImplementation.m =================================================================== --- trunk/LWJGL/src/native/macosx/org_lwjgl_opengl_MacOSXContextImplementation.m 2011-10-05 19:19:00 UTC (rev 3649) +++ trunk/LWJGL/src/native/macosx/org_lwjgl_opengl_MacOSXContextImplementation.m 2011-10-06 20:16:37 UTC (rev 3650) @@ -38,6 +38,9 @@ */ #import <jni.h> +#import <OpenGL/CGLCurrent.h> +#import <OpenGL/CGLTypes.h> +#import <OpenGL/CGLDevice.h> #import <Cocoa/Cocoa.h> #import "org_lwjgl_opengl_MacOSXContextImplementation.h" #import "context.h" @@ -78,6 +81,16 @@ return context_handle; } +JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_MacOSXContextImplementation_getCGLShareGroup + (JNIEnv *env, jclass clazz, jobject context_handle) { + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + MacOSXContext *context_info = (MacOSXContext *)(*env)->GetDirectBufferAddress(env, context_handle); + CGLContextObj cgl_context = [context_info->context CGLContextObj]; + CGLShareGroupObj share_group = CGLGetShareGroup(cgl_context); + [pool release]; + return share_group; +} + JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXContextImplementation_nSwapBuffers (JNIEnv *env, jclass clazz, jobject context_handle) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2011-10-11 22:31:02
|
Revision: 3660 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3660&view=rev Author: kappa1 Date: 2011-10-11 22:30:55 +0000 (Tue, 11 Oct 2011) Log Message: ----------- Limit the use to CALayer only to when using Display.setParent(), an AWTGLCanvas in non fullscreen mode. Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/AWTSurfaceLock.java trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXCanvasPeerInfo.java trunk/LWJGL/src/native/common/org_lwjgl_opengl_AWTSurfaceLock.c trunk/LWJGL/src/native/macosx/org_lwjgl_opengl_MacOSXCanvasPeerInfo.m Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/AWTSurfaceLock.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/AWTSurfaceLock.java 2011-10-11 21:51:45 UTC (rev 3659) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/AWTSurfaceLock.java 2011-10-11 22:30:55 UTC (rev 3660) @@ -79,14 +79,17 @@ // http://192.18.37.44/forums/index.php?topic=10572 for a discussion. // It is only needed on first call, so we avoid it on all subsequent calls // due to performance.. - final Canvas parent = component instanceof AWTGLCanvas ? component : Display.getParent(); + + // Allow the use of a Core Animation Layer only when using Display.setParent() or AWTGLCanvas and when not in fullscreen + final boolean allowCALayer = (Display.getParent() != null || component instanceof AWTGLCanvas) && !Display.isFullscreen(); + if (firstLockSucceeded) - return lockAndInitHandle(lock_buffer, component, parent); + return lockAndInitHandle(lock_buffer, component, allowCALayer); else try { firstLockSucceeded = AccessController.doPrivileged(new PrivilegedExceptionAction<Boolean>() { public Boolean run() throws LWJGLException { - return lockAndInitHandle(lock_buffer, component, parent); + return lockAndInitHandle(lock_buffer, component, allowCALayer); } }); return firstLockSucceeded; @@ -95,7 +98,7 @@ } } - private static native boolean lockAndInitHandle(ByteBuffer lock_buffer, Canvas component, Canvas display_parent) throws LWJGLException; + private static native boolean lockAndInitHandle(ByteBuffer lock_buffer, Canvas component, boolean allowCALayer) throws LWJGLException; void unlock() throws LWJGLException { nUnlock(lock_buffer); Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXCanvasPeerInfo.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXCanvasPeerInfo.java 2011-10-11 21:51:45 UTC (rev 3659) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXCanvasPeerInfo.java 2011-10-11 22:30:55 UTC (rev 3660) @@ -50,9 +50,12 @@ } protected void initHandle(Canvas component) throws LWJGLException { - nInitHandle(awt_surface.lockAndGetHandle(component), getHandle()); + // Allow the use of a Core Animation Layer only when using Display.setParent() or AWTGLCanvas and when not in fullscreen + final boolean allowCALayer = (Display.getParent() != null || component instanceof AWTGLCanvas) && !Display.isFullscreen(); + + nInitHandle(awt_surface.lockAndGetHandle(component), getHandle(), allowCALayer); } - private static native void nInitHandle(ByteBuffer surface_buffer, ByteBuffer peer_info_handle) throws LWJGLException; + private static native void nInitHandle(ByteBuffer surface_buffer, ByteBuffer peer_info_handle, boolean allowCALayer) throws LWJGLException; protected void doUnlock() throws LWJGLException { awt_surface.unlock(); Modified: trunk/LWJGL/src/native/common/org_lwjgl_opengl_AWTSurfaceLock.c =================================================================== --- trunk/LWJGL/src/native/common/org_lwjgl_opengl_AWTSurfaceLock.c 2011-10-11 21:51:45 UTC (rev 3659) +++ trunk/LWJGL/src/native/common/org_lwjgl_opengl_AWTSurfaceLock.c 2011-10-11 22:30:55 UTC (rev 3660) @@ -49,7 +49,7 @@ } JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_AWTSurfaceLock_lockAndInitHandle - (JNIEnv *env, jclass clazz, jobject lock_buffer_handle, jobject canvas, jobject display_parent) { + (JNIEnv *env, jclass clazz, jobject lock_buffer_handle, jobject canvas, jboolean allowCALayer) { JAWT awt; JAWT_DrawingSurface* ds; JAWT_DrawingSurfaceInfo *dsi; @@ -58,7 +58,7 @@ jboolean result = JNI_FALSE; #ifdef __MACH__ - if (display_parent) { + if (allowCALayer) { //first try CALAYER awt.version = JAWT_VERSION_1_4 | 0x80000000;//JAWT_MACOSX_USE_CALAYER; result = JAWT_GetAWT(env, &awt); Modified: trunk/LWJGL/src/native/macosx/org_lwjgl_opengl_MacOSXCanvasPeerInfo.m =================================================================== --- trunk/LWJGL/src/native/macosx/org_lwjgl_opengl_MacOSXCanvasPeerInfo.m 2011-10-11 21:51:45 UTC (rev 3659) +++ trunk/LWJGL/src/native/macosx/org_lwjgl_opengl_MacOSXCanvasPeerInfo.m 2011-10-11 22:30:55 UTC (rev 3660) @@ -65,56 +65,60 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXCanvasPeerInfo_nInitHandle -(JNIEnv *env, jclass clazz, jobject lock_buffer_handle, jobject peer_info_handle) { +(JNIEnv *env, jclass clazz, jobject lock_buffer_handle, jobject peer_info_handle, jboolean allowCALayer) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; MacOSXPeerInfo *peer_info = (MacOSXPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle); AWTSurfaceLock *surface = (AWTSurfaceLock *)(*env)->GetDirectBufferAddress(env, lock_buffer_handle); JAWT_MacOSXDrawingSurfaceInfo *macosx_dsi = (JAWT_MacOSXDrawingSurfaceInfo *)surface->dsi->platformInfo; - // check for CALayer support - if(surface->awt.version & 0x80000000) { //JAWT_MACOSX_USE_CALAYER) { - jint width = surface->dsi->bounds.width; - jint height = surface->dsi->bounds.height; - - if(peer_info->pbuffer == NULL || - width != [peer_info->pbuffer pixelsWide] || height != [peer_info->pbuffer pixelsHigh]) { - if(peer_info->pbuffer != NULL) { - [peer_info->pbuffer release]; - } + if (allowCALayer) { + // check for CALayer support + if(surface->awt.version & 0x80000000) { //JAWT_MACOSX_USE_CALAYER) { + jint width = surface->dsi->bounds.width; + jint height = surface->dsi->bounds.height; + + if(peer_info->pbuffer == NULL || width != [peer_info->pbuffer pixelsWide] || height != [peer_info->pbuffer pixelsHigh]) { + if(peer_info->pbuffer != NULL) { + [peer_info->pbuffer release]; + } - // make pbuffer - NSOpenGLPixelBuffer *pbuffer = nil; - NSLog(@"Make pbuffer: %d x %d", width, height); - pbuffer = [[NSOpenGLPixelBuffer alloc] initWithTextureTarget:GL_TEXTURE_RECTANGLE_EXT - textureInternalFormat:GL_RGBA - textureMaxMipMapLevel:0 - pixelsWide:width - pixelsHigh:height]; + // make pbuffer + NSOpenGLPixelBuffer *pbuffer = nil; + NSLog(@"Make pbuffer: %d x %d", width, height); + pbuffer = [[NSOpenGLPixelBuffer alloc] initWithTextureTarget:GL_TEXTURE_RECTANGLE_EXT + textureInternalFormat:GL_RGBA + textureMaxMipMapLevel:0 + pixelsWide:width + pixelsHigh:height]; - peer_info->pbuffer = pbuffer; - peer_info->window = false; - peer_info->canDrawGL = true; - } + peer_info->pbuffer = pbuffer; + peer_info->window = false; + peer_info->canDrawGL = true; + } - if (macosx_dsi != NULL) { - [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){ - // attach the "root layer" to the AWT Canvas surface layers - id <JAWT_SurfaceLayers> surfaceLayers = (id <JAWT_SurfaceLayers>)macosx_dsi;//dsi->platformInfo; - if(surfaceLayers.layer == NULL) { - PBufferGLLayer *caGLLayer = [[PBufferGLLayer new] autorelease]; - caGLLayer.peer_info = peer_info; - caGLLayer.asynchronous = YES; - caGLLayer.needsDisplayOnBoundsChange = YES; - caGLLayer.opaque = YES; - surfaceLayers.layer = caGLLayer; - } - }]; - } - } else { - peer_info->nsview = macosx_dsi->cocoaViewRef; - peer_info->window = true; - } + if (macosx_dsi != NULL) { + [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){ + // attach the "root layer" to the AWT Canvas surface layers + id <JAWT_SurfaceLayers> surfaceLayers = (id <JAWT_SurfaceLayers>)macosx_dsi;//dsi->platformInfo; + if(surfaceLayers.layer == NULL) { + PBufferGLLayer *caGLLayer = [[PBufferGLLayer new] autorelease]; + caGLLayer.peer_info = peer_info; + caGLLayer.asynchronous = YES; + caGLLayer.needsDisplayOnBoundsChange = YES; + caGLLayer.opaque = YES; + surfaceLayers.layer = caGLLayer; + } + }]; + } + + [pool release]; + return; + } + } + + peer_info->nsview = macosx_dsi->cocoaViewRef; + peer_info->window = true; [pool release]; } @@ -122,9 +126,6 @@ // rotates a red square when asked to draw @implementation PBufferGLLayer -//@synthesize peer_info; -//@synthesize textureID; - // override to draw custom GL content -(void)drawInCGLContext:(CGLContextObj)glContext pixelFormat:(CGLPixelFormatObj)pixelFormat This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sp...@us...> - 2011-10-12 17:58:11
|
Revision: 3662 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3662&view=rev Author: spasi Date: 2011-10-12 17:58:04 +0000 (Wed, 12 Oct 2011) Log Message: ----------- Added @Optional support for AL and GLES. Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/util/generator/RegisterStubsGenerator.java trunk/LWJGL/src/native/common/common_tools.c trunk/LWJGL/src/native/common/common_tools.h trunk/LWJGL/src/native/common/opengles/org_lwjgl_opengles_EGLKHRFenceSync.c trunk/LWJGL/src/native/common/opengles/org_lwjgl_opengles_EGLKHRReusableSync.c trunk/LWJGL/src/native/common/opengles/org_lwjgl_opengles_EGLNVSync.c trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC10.c trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC11.c Modified: trunk/LWJGL/src/java/org/lwjgl/util/generator/RegisterStubsGenerator.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/generator/RegisterStubsGenerator.java 2011-10-11 22:39:32 UTC (rev 3661) +++ trunk/LWJGL/src/java/org/lwjgl/util/generator/RegisterStubsGenerator.java 2011-10-12 17:58:04 UTC (rev 3662) @@ -125,7 +125,7 @@ final Alternate alt_annotation = method.getAnnotation(Alternate.class); final String methodName = alt_annotation == null ? method.getSimpleName() : alt_annotation.value(); String opengl_handle_name = methodName.replaceFirst("gl", platform.getPrefix()); - writer.print(", \"" + opengl_handle_name + "\", (void *)&" + methodName + "}"); + writer.print(", \"" + opengl_handle_name + "\", (void *)&" + methodName + ", " + (method.getAnnotation(Optional.class) == null ? "false" : "true") + "}"); if (has_more) writer.println(","); } Modified: trunk/LWJGL/src/native/common/common_tools.c =================================================================== --- trunk/LWJGL/src/native/common/common_tools.c 2011-10-11 22:39:32 UTC (rev 3661) +++ trunk/LWJGL/src/native/common/common_tools.c 2011-10-12 17:58:04 UTC (rev 3662) @@ -297,7 +297,7 @@ void *ext_func_pointer; void **ext_function_pointer_pointer; JNINativeMethod *method; - int i; + int i, num_natives = 0; if (clazz == NULL) { throwException(env, "Null class"); return; @@ -308,6 +308,9 @@ if (function->ext_function_name != NULL) { ext_func_pointer = gpa(function->ext_function_name); if (ext_func_pointer == NULL) { + if ( function->optional ) + continue; + free(methods); throwException(env, "Missing driver symbols"); return; @@ -315,12 +318,14 @@ ext_function_pointer_pointer = function->ext_function_pointer; *ext_function_pointer_pointer = ext_func_pointer; } - method = methods + i; + method = methods + num_natives; method->name = function->method_name; method->signature = function->signature; method->fnPtr = function->method_pointer; + + num_natives++; } - (*env)->RegisterNatives(env, clazz, methods, num_functions); + (*env)->RegisterNatives(env, clazz, methods, num_natives); free(methods); } Modified: trunk/LWJGL/src/native/common/common_tools.h =================================================================== --- trunk/LWJGL/src/native/common/common_tools.h 2011-10-11 22:39:32 UTC (rev 3661) +++ trunk/LWJGL/src/native/common/common_tools.h 2011-10-12 17:58:04 UTC (rev 3662) @@ -109,6 +109,7 @@ char *ext_function_name; void **ext_function_pointer; + bool optional; } JavaMethodAndExtFunction; typedef struct { Modified: trunk/LWJGL/src/native/common/opengles/org_lwjgl_opengles_EGLKHRFenceSync.c =================================================================== --- trunk/LWJGL/src/native/common/opengles/org_lwjgl_opengles_EGLKHRFenceSync.c 2011-10-11 22:39:32 UTC (rev 3661) +++ trunk/LWJGL/src/native/common/opengles/org_lwjgl_opengles_EGLKHRFenceSync.c 2011-10-12 17:58:04 UTC (rev 3662) @@ -71,10 +71,10 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengles_EGLKHRFenceSync_initNativeStubs(JNIEnv *env, jclass clazz) { JavaMethodAndExtFunction functions[] = { - {"neglCreateSyncKHR", "(JIJ)J", (void *)&Java_org_lwjgl_opengles_EGLKHRFenceSync_neglCreateSyncKHR, "eglCreateSyncKHR", (void *)&eglCreateSyncKHR}, - {"neglDestroySyncKHR", "(JJ)Z", (void *)&Java_org_lwjgl_opengles_EGLKHRFenceSync_neglDestroySyncKHR, "eglDestroySyncKHR", (void *)&eglDestroySyncKHR}, - {"neglClientWaitSyncKHR", "(JJIJ)I", (void *)&Java_org_lwjgl_opengles_EGLKHRFenceSync_neglClientWaitSyncKHR, "eglClientWaitSyncKHR", (void *)&eglClientWaitSyncKHR}, - {"neglGetSyncAttribKHR", "(JJIJ)Z", (void *)&Java_org_lwjgl_opengles_EGLKHRFenceSync_neglGetSyncAttribKHR, "eglGetSyncAttribKHR", (void *)&eglGetSyncAttribKHR} + {"neglCreateSyncKHR", "(JIJ)J", (void *)&Java_org_lwjgl_opengles_EGLKHRFenceSync_neglCreateSyncKHR, "eglCreateSyncKHR", (void *)&eglCreateSyncKHR, false}, + {"neglDestroySyncKHR", "(JJ)Z", (void *)&Java_org_lwjgl_opengles_EGLKHRFenceSync_neglDestroySyncKHR, "eglDestroySyncKHR", (void *)&eglDestroySyncKHR, false}, + {"neglClientWaitSyncKHR", "(JJIJ)I", (void *)&Java_org_lwjgl_opengles_EGLKHRFenceSync_neglClientWaitSyncKHR, "eglClientWaitSyncKHR", (void *)&eglClientWaitSyncKHR, false}, + {"neglGetSyncAttribKHR", "(JJIJ)Z", (void *)&Java_org_lwjgl_opengles_EGLKHRFenceSync_neglGetSyncAttribKHR, "eglGetSyncAttribKHR", (void *)&eglGetSyncAttribKHR, false} }; int num_functions = NUMFUNCTIONS(functions); extgl_InitializeClass(env, clazz, num_functions, functions); Modified: trunk/LWJGL/src/native/common/opengles/org_lwjgl_opengles_EGLKHRReusableSync.c =================================================================== --- trunk/LWJGL/src/native/common/opengles/org_lwjgl_opengles_EGLKHRReusableSync.c 2011-10-11 22:39:32 UTC (rev 3661) +++ trunk/LWJGL/src/native/common/opengles/org_lwjgl_opengles_EGLKHRReusableSync.c 2011-10-12 17:58:04 UTC (rev 3662) @@ -45,7 +45,7 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengles_EGLKHRReusableSync_initNativeStubs(JNIEnv *env, jclass clazz) { JavaMethodAndExtFunction functions[] = { - {"neglSignalSyncKHR", "(JJI)Z", (void *)&Java_org_lwjgl_opengles_EGLKHRReusableSync_neglSignalSyncKHR, "eglSignalSyncKHR", (void *)&eglSignalSyncKHR} + {"neglSignalSyncKHR", "(JJI)Z", (void *)&Java_org_lwjgl_opengles_EGLKHRReusableSync_neglSignalSyncKHR, "eglSignalSyncKHR", (void *)&eglSignalSyncKHR, false} }; int num_functions = NUMFUNCTIONS(functions); extgl_InitializeClass(env, clazz, num_functions, functions); Modified: trunk/LWJGL/src/native/common/opengles/org_lwjgl_opengles_EGLNVSync.c =================================================================== --- trunk/LWJGL/src/native/common/opengles/org_lwjgl_opengles_EGLNVSync.c 2011-10-11 22:39:32 UTC (rev 3661) +++ trunk/LWJGL/src/native/common/opengles/org_lwjgl_opengles_EGLNVSync.c 2011-10-12 17:58:04 UTC (rev 3662) @@ -82,12 +82,12 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengles_EGLNVSync_initNativeStubs(JNIEnv *env, jclass clazz) { JavaMethodAndExtFunction functions[] = { - {"neglCreateFenceSyncNV", "(JIJ)J", (void *)&Java_org_lwjgl_opengles_EGLNVSync_neglCreateFenceSyncNV, "eglCreateFenceSyncNV", (void *)&eglCreateFenceSyncNV}, - {"neglDestroySyncNV", "(J)Z", (void *)&Java_org_lwjgl_opengles_EGLNVSync_neglDestroySyncNV, "eglDestroySyncNV", (void *)&eglDestroySyncNV}, - {"neglFenceNV", "(J)Z", (void *)&Java_org_lwjgl_opengles_EGLNVSync_neglFenceNV, "eglFenceNV", (void *)&eglFenceNV}, - {"neglClientWaitSyncNV", "(JIJ)I", (void *)&Java_org_lwjgl_opengles_EGLNVSync_neglClientWaitSyncNV, "eglClientWaitSyncNV", (void *)&eglClientWaitSyncNV}, - {"neglSignalSyncNV", "(JI)Z", (void *)&Java_org_lwjgl_opengles_EGLNVSync_neglSignalSyncNV, "eglSignalSyncNV", (void *)&eglSignalSyncNV}, - {"neglGetSyncAttribNV", "(JIJ)Z", (void *)&Java_org_lwjgl_opengles_EGLNVSync_neglGetSyncAttribNV, "eglGetSyncAttribNV", (void *)&eglGetSyncAttribNV} + {"neglCreateFenceSyncNV", "(JIJ)J", (void *)&Java_org_lwjgl_opengles_EGLNVSync_neglCreateFenceSyncNV, "eglCreateFenceSyncNV", (void *)&eglCreateFenceSyncNV, false}, + {"neglDestroySyncNV", "(J)Z", (void *)&Java_org_lwjgl_opengles_EGLNVSync_neglDestroySyncNV, "eglDestroySyncNV", (void *)&eglDestroySyncNV, false}, + {"neglFenceNV", "(J)Z", (void *)&Java_org_lwjgl_opengles_EGLNVSync_neglFenceNV, "eglFenceNV", (void *)&eglFenceNV, false}, + {"neglClientWaitSyncNV", "(JIJ)I", (void *)&Java_org_lwjgl_opengles_EGLNVSync_neglClientWaitSyncNV, "eglClientWaitSyncNV", (void *)&eglClientWaitSyncNV, false}, + {"neglSignalSyncNV", "(JI)Z", (void *)&Java_org_lwjgl_opengles_EGLNVSync_neglSignalSyncNV, "eglSignalSyncNV", (void *)&eglSignalSyncNV, false}, + {"neglGetSyncAttribNV", "(JIJ)Z", (void *)&Java_org_lwjgl_opengles_EGLNVSync_neglGetSyncAttribNV, "eglGetSyncAttribNV", (void *)&eglGetSyncAttribNV, false} }; int num_functions = NUMFUNCTIONS(functions); extgl_InitializeClass(env, clazz, num_functions, functions); Modified: trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC10.c =================================================================== --- trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC10.c 2011-10-11 22:39:32 UTC (rev 3661) +++ trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC10.c 2011-10-12 17:58:04 UTC (rev 3662) @@ -263,20 +263,20 @@ #endif JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC10_initNativeStubs(JNIEnv *env, jclass clazz) { JavaMethodAndExtFunction functions[] = { - {"nalcGetString", "(JI)Ljava/lang/String;", (void*)&Java_org_lwjgl_openal_ALC10_nalcGetString, "alcGetString", (void*)&alcGetString}, - {"nalcGetIntegerv", "(JIIJ)V", (void*)&Java_org_lwjgl_openal_ALC10_nalcGetIntegerv, "alcGetIntegerv", (void*)&alcGetIntegerv}, - {"nalcOpenDevice", "(J)J", (void*)&Java_org_lwjgl_openal_ALC10_nalcOpenDevice, "alcOpenDevice", (void*)&alcOpenDevice}, - {"nalcCloseDevice", "(J)Z", (void*)&Java_org_lwjgl_openal_ALC10_nalcCloseDevice, "alcCloseDevice", (void*)&alcCloseDevice}, - {"nalcCreateContext", "(JJ)J", (void*)&Java_org_lwjgl_openal_ALC10_nalcCreateContext, "alcCreateContext", (void*)&alcCreateContext}, - {"nalcMakeContextCurrent", "(J)I", (void*)&Java_org_lwjgl_openal_ALC10_nalcMakeContextCurrent, "alcMakeContextCurrent", (void*)&alcMakeContextCurrent}, - {"nalcProcessContext", "(J)V", (void*)&Java_org_lwjgl_openal_ALC10_nalcProcessContext, "alcProcessContext", (void*)&alcProcessContext}, - {"nalcGetCurrentContext", "()J", (void*)&Java_org_lwjgl_openal_ALC10_nalcGetCurrentContext, "alcGetCurrentContext", (void*)&alcGetCurrentContext}, - {"nalcGetContextsDevice", "(J)J", (void*)&Java_org_lwjgl_openal_ALC10_nalcGetContextsDevice, "alcGetContextsDevice", (void*)&alcGetContextsDevice}, - {"nalcSuspendContext", "(J)V", (void*)&Java_org_lwjgl_openal_ALC10_nalcSuspendContext, "alcSuspendContext", (void*)&alcSuspendContext}, - {"nalcDestroyContext", "(J)V", (void*)&Java_org_lwjgl_openal_ALC10_nalcDestroyContext, "alcDestroyContext", (void*)&alcDestroyContext}, - {"nalcGetError", "(J)I", (void*)&Java_org_lwjgl_openal_ALC10_nalcGetError, "alcGetError", (void*)&alcGetError}, - {"nalcIsExtensionPresent", "(JJ)Z", (void*)&Java_org_lwjgl_openal_ALC10_nalcIsExtensionPresent, "alcIsExtensionPresent", (void*)&alcIsExtensionPresent}, - {"nalcGetEnumValue", "(JJ)I", (void*)&Java_org_lwjgl_openal_ALC10_nalcGetEnumValue, "alcGetEnumValue", (void*)&alcGetEnumValue} + {"nalcGetString", "(JI)Ljava/lang/String;", (void*)&Java_org_lwjgl_openal_ALC10_nalcGetString, "alcGetString", (void*)&alcGetString, false}, + {"nalcGetIntegerv", "(JIIJ)V", (void*)&Java_org_lwjgl_openal_ALC10_nalcGetIntegerv, "alcGetIntegerv", (void*)&alcGetIntegerv, false}, + {"nalcOpenDevice", "(J)J", (void*)&Java_org_lwjgl_openal_ALC10_nalcOpenDevice, "alcOpenDevice", (void*)&alcOpenDevice, false}, + {"nalcCloseDevice", "(J)Z", (void*)&Java_org_lwjgl_openal_ALC10_nalcCloseDevice, "alcCloseDevice", (void*)&alcCloseDevice, false}, + {"nalcCreateContext", "(JJ)J", (void*)&Java_org_lwjgl_openal_ALC10_nalcCreateContext, "alcCreateContext", (void*)&alcCreateContext, false}, + {"nalcMakeContextCurrent", "(J)I", (void*)&Java_org_lwjgl_openal_ALC10_nalcMakeContextCurrent, "alcMakeContextCurrent", (void*)&alcMakeContextCurrent, false}, + {"nalcProcessContext", "(J)V", (void*)&Java_org_lwjgl_openal_ALC10_nalcProcessContext, "alcProcessContext", (void*)&alcProcessContext, false}, + {"nalcGetCurrentContext", "()J", (void*)&Java_org_lwjgl_openal_ALC10_nalcGetCurrentContext, "alcGetCurrentContext", (void*)&alcGetCurrentContext, false}, + {"nalcGetContextsDevice", "(J)J", (void*)&Java_org_lwjgl_openal_ALC10_nalcGetContextsDevice, "alcGetContextsDevice", (void*)&alcGetContextsDevice, false}, + {"nalcSuspendContext", "(J)V", (void*)&Java_org_lwjgl_openal_ALC10_nalcSuspendContext, "alcSuspendContext", (void*)&alcSuspendContext, false}, + {"nalcDestroyContext", "(J)V", (void*)&Java_org_lwjgl_openal_ALC10_nalcDestroyContext, "alcDestroyContext", (void*)&alcDestroyContext, false}, + {"nalcGetError", "(J)I", (void*)&Java_org_lwjgl_openal_ALC10_nalcGetError, "alcGetError", (void*)&alcGetError, false}, + {"nalcIsExtensionPresent", "(JJ)Z", (void*)&Java_org_lwjgl_openal_ALC10_nalcIsExtensionPresent, "alcIsExtensionPresent", (void*)&alcIsExtensionPresent, false}, + {"nalcGetEnumValue", "(JJ)I", (void*)&Java_org_lwjgl_openal_ALC10_nalcGetEnumValue, "alcGetEnumValue", (void*)&alcGetEnumValue, false} }; int num_functions = NUMFUNCTIONS(functions); extal_InitializeClass(env, clazz, num_functions, functions); Modified: trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC11.c =================================================================== --- trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC11.c 2011-10-11 22:39:32 UTC (rev 3661) +++ trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC11.c 2011-10-12 17:58:04 UTC (rev 3662) @@ -111,11 +111,11 @@ #endif JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC11_initNativeStubs(JNIEnv *env, jclass clazz) { JavaMethodAndExtFunction functions[] = { - {"nalcCaptureOpenDevice", "(JIII)J", (void*)&Java_org_lwjgl_openal_ALC11_nalcCaptureOpenDevice, "alcCaptureOpenDevice", (void*)&alcCaptureOpenDevice}, - {"nalcCaptureCloseDevice", "(J)Z", (void*)&Java_org_lwjgl_openal_ALC11_nalcCaptureCloseDevice, "alcCaptureCloseDevice", (void*)&alcCaptureCloseDevice}, - {"nalcCaptureStart", "(J)V", (void*)&Java_org_lwjgl_openal_ALC11_nalcCaptureStart, "alcCaptureStart", (void*)&alcCaptureStart}, - {"nalcCaptureStop", "(J)V", (void*)&Java_org_lwjgl_openal_ALC11_nalcCaptureStop, "alcCaptureStop", (void*)&alcCaptureStop}, - {"nalcCaptureSamples", "(JJI)V", (void*)&Java_org_lwjgl_openal_ALC11_nalcCaptureSamples, "alcCaptureSamples", (void*)&alcCaptureSamples} + {"nalcCaptureOpenDevice", "(JIII)J", (void*)&Java_org_lwjgl_openal_ALC11_nalcCaptureOpenDevice, "alcCaptureOpenDevice", (void*)&alcCaptureOpenDevice, false}, + {"nalcCaptureCloseDevice", "(J)Z", (void*)&Java_org_lwjgl_openal_ALC11_nalcCaptureCloseDevice, "alcCaptureCloseDevice", (void*)&alcCaptureCloseDevice, false}, + {"nalcCaptureStart", "(J)V", (void*)&Java_org_lwjgl_openal_ALC11_nalcCaptureStart, "alcCaptureStart", (void*)&alcCaptureStart, false}, + {"nalcCaptureStop", "(J)V", (void*)&Java_org_lwjgl_openal_ALC11_nalcCaptureStop, "alcCaptureStop", (void*)&alcCaptureStop, false}, + {"nalcCaptureSamples", "(JJI)V", (void*)&Java_org_lwjgl_openal_ALC11_nalcCaptureSamples, "alcCaptureSamples", (void*)&alcCaptureSamples, false} }; int num_functions = NUMFUNCTIONS(functions); extal_InitializeClass(env, clazz, num_functions, functions); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2011-10-30 14:44:59
|
Revision: 3689 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3689&view=rev Author: kappa1 Date: 2011-10-30 14:44:52 +0000 (Sun, 30 Oct 2011) Log Message: ----------- Fix keyboard handling when running Display.setParent() as an application on Linux. Thus allowing WM and system hot-keys to function again when the LWJGL app has focus. Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java trunk/LWJGL/src/native/linux/opengl/org_lwjgl_opengl_Display.c trunk/LWJGL/src/native/linux/opengles/org_lwjgl_opengl_Display.c Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2011-10-26 20:24:22 UTC (rev 3688) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2011-10-30 14:44:52 UTC (rev 3689) @@ -152,6 +152,7 @@ private static boolean xembedded; private long parent_proxy_focus_window; private boolean parent_focused; + private boolean parent_focus_changed; private long last_window_focus = 0; private LinuxKeyboard keyboard; @@ -161,11 +162,13 @@ public void focusGained(FocusEvent e) { synchronized (GlobalLock.lock) { parent_focused = true; + parent_focus_changed = true; } } public void focusLost(FocusEvent e) { synchronized (GlobalLock.lock) { parent_focused = false; + parent_focus_changed = true; } } }; @@ -489,9 +492,8 @@ if (parent != null) { parent.addFocusListener(focus_listener); - if (parent.isFocusOwner()) { - parent_focused = true; - } + parent_focused = parent.isFocusOwner(); + parent_focus_changed = true; } } finally { peer_info.unlock(); @@ -549,6 +551,9 @@ public void destroyWindow() { lockAWT(); try { + if (parent != null) { + parent.removeFocusListener(focus_listener); + } try { setNativeCursor(null); } catch (LWJGLException e) { @@ -971,20 +976,24 @@ } } else { - if (parent_focused != keyboard_grabbed) { - if (parent_focused) { - grabKeyboard(); - input_released = false; - focused = true; - } - else { - ungrabKeyboard(); - input_released = true; - focused = false; - } + if (parent_focus_changed && parent_focused) { + setInputFocusUnsafe(getWindow()); + parent_focus_changed = false; } } } + + private void setInputFocusUnsafe(long window) { + try { + nSetInputFocus(getDisplay(), window, CurrentTime); + nSync(getDisplay(), false); + } catch (LWJGLException e) { + // Since we don't have any event timings for XSetInputFocus, a race condition might give a BadMatch, which we'll catch and ignore + LWJGLUtil.log("Got exception while trying to focus: " + e); + } + } + + private static native void nSync(long display, boolean throw_away_events) throws LWJGLException; /** * This method will check if the parent window is active when running Modified: trunk/LWJGL/src/native/linux/opengl/org_lwjgl_opengl_Display.c =================================================================== --- trunk/LWJGL/src/native/linux/opengl/org_lwjgl_opengl_Display.c 2011-10-26 20:24:22 UTC (rev 3688) +++ trunk/LWJGL/src/native/linux/opengl/org_lwjgl_opengl_Display.c 2011-10-30 14:44:52 UTC (rev 3689) @@ -138,6 +138,11 @@ return (intptr_t)XSetErrorHandler(handler); } +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSync(JNIEnv *env, jclass unused, jlong display_ptr, jboolean throw_away_events) { + Display *disp = (Display *)(intptr_t)display_ptr; + XSync(disp, throw_away_events ? True : False); +} + JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_sync(JNIEnv *env, jclass unused, jlong display_ptr, jboolean throw_away_events) { Display *disp = (Display *)(intptr_t)display_ptr; XSync(disp, throw_away_events ? True : False); Modified: trunk/LWJGL/src/native/linux/opengles/org_lwjgl_opengl_Display.c =================================================================== --- trunk/LWJGL/src/native/linux/opengles/org_lwjgl_opengl_Display.c 2011-10-26 20:24:22 UTC (rev 3688) +++ trunk/LWJGL/src/native/linux/opengles/org_lwjgl_opengl_Display.c 2011-10-30 14:44:52 UTC (rev 3689) @@ -135,6 +135,11 @@ return (intptr_t)XSetErrorHandler(handler); } +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSync(JNIEnv *env, jclass unused, jlong display_ptr, jboolean throw_away_events) { + Display *disp = (Display *)(intptr_t)display_ptr; + XSync(disp, throw_away_events ? True : False); +} + JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_sync(JNIEnv *env, jclass unused, jlong display_ptr, jboolean throw_away_events) { Display *disp = (Display *)(intptr_t)display_ptr; XSync(disp, throw_away_events ? True : False); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2012-01-31 23:24:35
|
Revision: 3736 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3736&view=rev Author: kappa1 Date: 2012-01-31 23:24:28 +0000 (Tue, 31 Jan 2012) Log Message: ----------- Linux Mouse: added support for using more than 3 buttons on a mouse, supports mice with upto 256 buttons. Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxMouse.java trunk/LWJGL/src/native/linux/org_lwjgl_opengl_LinuxMouse.c Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxMouse.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxMouse.java 2012-01-29 20:35:22 UTC (rev 3735) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxMouse.java 2012-01-31 23:24:28 UTC (rev 3736) @@ -43,17 +43,23 @@ import org.lwjgl.input.Mouse; final class LinuxMouse { - private static final int NUM_BUTTONS = 3; private static final int POINTER_WARP_BORDER = 10; // scale the mouse wheel according to DirectInput private static final int WHEEL_SCALE = 120; + private int button_count; + /* X11 constants */ private static final int Button1 = 1; private static final int Button2 = 2; private static final int Button3 = 3; private static final int Button4 = 4; private static final int Button5 = 5; + + private static final int Button6 = 6; // wheel tilt left *rare* + private static final int Button7 = 7; // wheel tilt right *rare* + private static final int Button8 = 8; // back button + private static final int Button9 = 9; // forward button private static final int ButtonPress = 4; private static final int ButtonRelease = 5; @@ -70,7 +76,7 @@ private int accum_dx; private int accum_dy; private int accum_dz; - private byte[] buttons = new byte[NUM_BUTTONS]; + private byte[] buttons;// = new byte[NUM_BUTTONS]; private EventQueue event_queue; private long last_event_nanos; @@ -79,6 +85,8 @@ this.window = window; this.input_window = input_window; this.warp_atom = LinuxDisplay.nInternAtom(display, "_LWJGL", false); + button_count = nGetButtonCount(display); + buttons = new byte[button_count]; reset(false, false); } @@ -189,6 +197,8 @@ } private static native int nGetWindowHeight(long display, long window); private static native int nGetWindowWidth(long display, long window); + + private static native int nGetButtonCount(long display); private static native long nQueryPointer(long display, long window, IntBuffer result); @@ -213,7 +223,23 @@ case Button3: button_num = (byte)1; break; + case Button6: + button_num = (byte)5; + break; + case Button7: + button_num = (byte)6; + break; + case Button8: + button_num = (byte)3; // back button + break; + case Button9: + button_num = (byte)4; // forward button + break; default: + if (button > Button9 && button <= button_count) { + button_num = (byte)(button-1); + break; + } return; } buttons[button_num] = state; Modified: trunk/LWJGL/src/native/linux/org_lwjgl_opengl_LinuxMouse.c =================================================================== --- trunk/LWJGL/src/native/linux/org_lwjgl_opengl_LinuxMouse.c 2012-01-29 20:35:22 UTC (rev 3735) +++ trunk/LWJGL/src/native/linux/org_lwjgl_opengl_LinuxMouse.c 2012-01-31 23:24:28 UTC (rev 3736) @@ -103,3 +103,16 @@ warp_event.xclient.data.l[1] = y; XSendEvent(disp, win, False, 0, &warp_event); } + +JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxMouse_nGetButtonCount(JNIEnv *env, jclass unused, jlong display_ptr) { + Display *disp = (Display *)(intptr_t)display_ptr; + + int count = 256; + + unsigned char * pointer_map = malloc(sizeof(unsigned char) * count); + count = XGetPointerMapping(disp, pointer_map, count); + + free(pointer_map); + + return count; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2012-02-18 01:49:52
|
Revision: 3742 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3742&view=rev Author: kappa1 Date: 2012-02-18 01:49:46 +0000 (Sat, 18 Feb 2012) Log Message: ----------- Implement the ability for the native Display window on Linux to get its x and y position. In preparation for adding the new Display.getX() & getY() API's. Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxEvent.java trunk/LWJGL/src/native/linux/opengl/org_lwjgl_opengl_Display.c trunk/LWJGL/src/native/linux/opengles/org_lwjgl_opengl_Display.c Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2012-02-06 20:35:25 UTC (rev 3741) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2012-02-18 01:49:46 UTC (rev 3742) @@ -144,6 +144,8 @@ private boolean resizable; private boolean resized; + private int window_x; + private int window_y; private int window_width; private int window_height; @@ -516,6 +518,8 @@ private static native long nGetInputFocus(long display) throws LWJGLException; private static native void nSetInputFocus(long display, long window, long time); private static native void nSetWindowSize(long display, long window, int width, int height, boolean resizable); + private static native int nGetX(long display, long window); + private static native int nGetY(long display, long window); private static native int nGetWidth(long display, long window); private static native int nGetHeight(long display, long window); @@ -840,10 +844,17 @@ break; case LinuxEvent.Expose: dirty = true; + break; + case LinuxEvent.ConfigureNotify: + int x = nGetX(getDisplay(), getWindow()); + int y = nGetY(getDisplay(), getWindow()); int width = nGetWidth(getDisplay(), getWindow()); int height = nGetHeight(getDisplay(), getWindow()); + window_x = x; + window_y = y; + if (window_width != width || window_height != height) { resized = true; window_width = width; Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxEvent.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxEvent.java 2012-02-06 20:35:25 UTC (rev 3741) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxEvent.java 2012-02-18 01:49:46 UTC (rev 3742) @@ -53,6 +53,7 @@ public static final int UnmapNotify = 18; public static final int MapNotify = 19; public static final int Expose = 12; + public static final int ConfigureNotify = 22; public static final int ClientMessage = 33; private final ByteBuffer event_buffer; Modified: trunk/LWJGL/src/native/linux/opengl/org_lwjgl_opengl_Display.c =================================================================== --- trunk/LWJGL/src/native/linux/opengl/org_lwjgl_opengl_Display.c 2012-02-06 20:35:25 UTC (rev 3741) +++ trunk/LWJGL/src/native/linux/opengl/org_lwjgl_opengl_Display.c 2012-02-18 01:49:46 UTC (rev 3742) @@ -283,6 +283,49 @@ return RootWindow(disp, screen); } +static Window getCurrentWindow(JNIEnv *env, jlong display_ptr, jlong window_ptr) { + Display *disp = (Display *)(intptr_t)display_ptr; + + Window parent = (Window)window_ptr; + Window win, root; + + Window *children; + unsigned int nchildren; + + do { + win = parent; + + if (XQueryTree(disp, win, &root, &parent, &children, &nchildren) == 0) { + throwException(env, "XQueryTree failed"); + return 0; + } + + if (children != NULL) XFree(children); + } while (parent != root); + + return win; +} + +JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetX(JNIEnv *env, jclass unused, jlong display_ptr, jlong window_ptr) { + Display *disp = (Display *)(intptr_t)display_ptr; + Window win = getCurrentWindow(env, display_ptr, window_ptr); + + XWindowAttributes win_attribs; + XGetWindowAttributes(disp, win, &win_attribs); + + return win_attribs.x; +} + +JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetY(JNIEnv *env, jclass unused, jlong display_ptr, jlong window_ptr) { + Display *disp = (Display *)(intptr_t)display_ptr; + Window win = getCurrentWindow(env, display_ptr, window_ptr); + + XWindowAttributes win_attribs; + XGetWindowAttributes(disp, win, &win_attribs); + + return win_attribs.y; +} + JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetWidth(JNIEnv *env, jclass unused, jlong display_ptr, jlong window_ptr) { Display *disp = (Display *)(intptr_t)display_ptr; Window win = (Window)window_ptr; @@ -381,7 +424,7 @@ setDecorations(disp, win, 0); } - if (RootWindow(disp, screen) == parent_handle) { // on set hints when Display.setParent isn't used + if (RootWindow(disp, screen) == parent_handle) { // only set hints when Display.setParent isn't used updateWindowBounds(disp, win, x, y, width, height, JNI_TRUE, resizable); updateWindowHints(env, disp, win); } Modified: trunk/LWJGL/src/native/linux/opengles/org_lwjgl_opengl_Display.c =================================================================== --- trunk/LWJGL/src/native/linux/opengles/org_lwjgl_opengl_Display.c 2012-02-06 20:35:25 UTC (rev 3741) +++ trunk/LWJGL/src/native/linux/opengles/org_lwjgl_opengl_Display.c 2012-02-18 01:49:46 UTC (rev 3742) @@ -273,6 +273,49 @@ return RootWindow(disp, screen); } +static Window getCurrentWindow(JNIEnv *env, jlong display_ptr, jlong window_ptr) { + Display *disp = (Display *)(intptr_t)display_ptr; + + Window parent = (Window)window_ptr; + Window win, root; + + Window *children; + unsigned int nchildren; + + do { + win = parent; + + if (XQueryTree(disp, win, &root, &parent, &children, &nchildren) == 0) { + throwException(env, "XQueryTree failed"); + return 0; + } + + if (children != NULL) XFree(children); + } while (parent != root); + + return win; +} + +JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetX(JNIEnv *env, jclass unused, jlong display_ptr, jlong window_ptr) { + Display *disp = (Display *)(intptr_t)display_ptr; + Window win = getCurrentWindow(env, display_ptr, window_ptr); + + XWindowAttributes win_attribs; + XGetWindowAttributes(disp, win, &win_attribs); + + return win_attribs.x; +} + +JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetY(JNIEnv *env, jclass unused, jlong display_ptr, jlong window_ptr) { + Display *disp = (Display *)(intptr_t)display_ptr; + Window win = getCurrentWindow(env, display_ptr, window_ptr); + + XWindowAttributes win_attribs; + XGetWindowAttributes(disp, win, &win_attribs); + + return win_attribs.y; +} + JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetWidth(JNIEnv *env, jclass unused, jlong display_ptr, jlong window_ptr) { Display *disp = (Display *)(intptr_t)display_ptr; Window win = (Window)window_ptr; @@ -375,7 +418,7 @@ setDecorations(disp, win, 0); } - if (RootWindow(disp, screen) == parent_handle) { // on set hints when Display.setParent isn't used + if (RootWindow(disp, screen) == parent_handle) { // only set hints when Display.setParent isn't used updateWindowBounds(disp, win, x, y, width, height, JNI_TRUE, resizable); updateWindowHints(env, disp, win); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sp...@us...> - 2012-02-28 18:18:17
|
Revision: 3745 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3745&view=rev Author: spasi Date: 2012-02-28 18:18:06 +0000 (Tue, 28 Feb 2012) Log Message: ----------- Fixed clEnqueueNativeKernel crash. Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/MemoryUtil.java trunk/LWJGL/src/native/common/org_lwjgl_opencl_CallbackUtil.c trunk/LWJGL/src/templates/org/lwjgl/opencl/CL10.java Modified: trunk/LWJGL/src/java/org/lwjgl/MemoryUtil.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/MemoryUtil.java 2012-02-18 18:38:57 UTC (rev 3744) +++ trunk/LWJGL/src/java/org/lwjgl/MemoryUtil.java 2012-02-28 18:18:06 UTC (rev 3745) @@ -362,16 +362,18 @@ return getDeclaredFieldRecursive(ByteBuffer.class, "address"); } - private static Field getDeclaredFieldRecursive(Class<?> type, final String fieldName) throws NoSuchFieldException { - while ( type != null ) { + private static Field getDeclaredFieldRecursive(final Class<?> root, final String fieldName) throws NoSuchFieldException { + Class<?> type = root; + + do { try { return type.getDeclaredField(fieldName); } catch (NoSuchFieldException e) { type = type.getSuperclass(); } - } + } while ( type != null ); - throw new NoSuchFieldException(fieldName + " does not exist in " + type.getSimpleName() + " or any of its superclasses."); + throw new NoSuchFieldException(fieldName + " does not exist in " + root.getSimpleName() + " or any of its superclasses."); } } Modified: trunk/LWJGL/src/native/common/org_lwjgl_opencl_CallbackUtil.c =================================================================== --- trunk/LWJGL/src/native/common/org_lwjgl_opencl_CallbackUtil.c 2012-02-18 18:38:57 UTC (rev 3744) +++ trunk/LWJGL/src/native/common/org_lwjgl_opencl_CallbackUtil.c 2012-02-28 18:18:06 UTC (rev 3745) @@ -146,10 +146,10 @@ static void CL_CALLBACK nativeKernelCallback(void *args) { JNIEnv *env = attachCurrentThread(); jobject user_func = (jobject)(intptr_t)*(jlong *)args; - jint num_mem_objects = *(jint *)((char *)args + 8); + jsize num_mem_objects = *(jsize *)((char *)args + 8); jobjectArray memobjs = NULL; jobject buffer; - jint i; + jsize i; if ( env != NULL && !(*env)->ExceptionOccurred(env) && nativeKernelCallbackJ != NULL ) { if ( num_mem_objects > 0 ) { Modified: trunk/LWJGL/src/templates/org/lwjgl/opencl/CL10.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opencl/CL10.java 2012-02-18 18:38:57 UTC (rev 3744) +++ trunk/LWJGL/src/templates/org/lwjgl/opencl/CL10.java 2012-02-28 18:18:06 UTC (rev 3745) @@ -1073,7 +1073,7 @@ nativeAfterVars = "\tvoid **args_mem_loc = num_mem_objects == 0 ? NULL : (void **)malloc(num_mem_objects * sizeof(void *));", nativeBeforeCall = "\t_ptr_i = 0;\n" + "\twhile ( _ptr_i < num_mem_objects ) {\n" + - "\t\targs_mem_loc[_ptr_i] = (cl_void *)((char *)args_address + (4 + _ptr_i * (4 + sizeof(void *))));\n" + + "\t\targs_mem_loc[_ptr_i] = (cl_void *)((char *)args_address + (12 + 4 + _ptr_i * (4 + sizeof(void *))));\n" + "\t\t_ptr_i++;\n" + "\t}", nativeAfterCall = "\tfree(args_mem_loc);" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2012-03-04 03:40:39
|
Revision: 3748 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3748&view=rev Author: kappa1 Date: 2012-03-04 03:40:32 +0000 (Sun, 04 Mar 2012) Log Message: ----------- Implement GLX_EXT_swap_control for Linux Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/ContextGL.java trunk/LWJGL/src/java/org/lwjgl/opengl/ContextImplementation.java trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxContextImplementation.java trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXContextImplementation.java trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsContextImplementation.java trunk/LWJGL/src/native/linux/opengl/extgl_glx.c trunk/LWJGL/src/native/linux/opengl/extgl_glx.h trunk/LWJGL/src/native/linux/opengl/org_lwjgl_opengl_LinuxContextImplementation.c Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/ContextGL.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/ContextGL.java 2012-03-01 22:34:34 UTC (rev 3747) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/ContextGL.java 2012-03-04 03:40:32 UTC (rev 3748) @@ -64,7 +64,7 @@ /** Handle to the native GL rendering context */ private final ByteBuffer handle; - private final PeerInfo peer_info; + private static PeerInfo peer_info; private final ContextAttribs contextAttribs; private final boolean forwardCompatible; @@ -229,7 +229,7 @@ * A video frame period is the time required to display a full frame of video data. */ public static void setSwapInterval(int value) { - implementation.setSwapInterval(value); + implementation.setSwapInterval(peer_info, value); } /** Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/ContextImplementation.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/ContextImplementation.java 2012-03-01 22:34:34 UTC (rev 3747) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/ContextImplementation.java 2012-03-04 03:40:32 UTC (rev 3748) @@ -81,7 +81,7 @@ */ boolean isCurrent(ByteBuffer handle) throws LWJGLException; - void setSwapInterval(int value); + void setSwapInterval(PeerInfo peer_info, int value); /** * Destroys the Context. Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxContextImplementation.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxContextImplementation.java 2012-03-01 22:34:34 UTC (rev 3747) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxContextImplementation.java 2012-03-04 03:40:32 UTC (rev 3748) @@ -141,18 +141,29 @@ private static native boolean nIsCurrent(ByteBuffer context_handle) throws LWJGLException; - public void setSwapInterval(int value) { + public void setSwapInterval(PeerInfo peer_info, int value) { ContextGL current_context = ContextGL.getCurrentContext(); if ( current_context == null ) throw new IllegalStateException("No context is current"); synchronized ( current_context ) { LinuxDisplay.lockAWT(); - nSetSwapInterval(current_context.getHandle(), value); - LinuxDisplay.unlockAWT(); + try { + ByteBuffer peer_handle = peer_info.lockAndGetHandle(); + try { + nSetSwapInterval(peer_handle, current_context.getHandle(), value); + } finally { + peer_info.unlock(); + } + } catch (LWJGLException e) { + // API CHANGE - this methods should throw LWJGLException + e.printStackTrace(); + } finally { + LinuxDisplay.unlockAWT(); + } } } - private static native void nSetSwapInterval(ByteBuffer context_handle, int value); + private static native void nSetSwapInterval(ByteBuffer peer_handle, ByteBuffer context_handle, int value); public void destroy(PeerInfo peer_info, ByteBuffer handle) throws LWJGLException { LinuxDisplay.lockAWT(); Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXContextImplementation.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXContextImplementation.java 2012-03-01 22:34:34 UTC (rev 3747) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXContextImplementation.java 2012-03-04 03:40:32 UTC (rev 3748) @@ -118,7 +118,7 @@ private static native boolean nIsCurrent(ByteBuffer context_handle) throws LWJGLException; - public void setSwapInterval(int value) { + public void setSwapInterval(PeerInfo peer_info, int value) { ContextGL current_context = ContextGL.getCurrentContext(); synchronized ( current_context ) { nSetSwapInterval(current_context.getHandle(), value); Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsContextImplementation.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsContextImplementation.java 2012-03-01 22:34:34 UTC (rev 3747) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsContextImplementation.java 2012-03-04 03:40:32 UTC (rev 3748) @@ -106,7 +106,7 @@ private static native boolean nIsCurrent(ByteBuffer context_handle) throws LWJGLException; - public void setSwapInterval(int value) { + public void setSwapInterval(PeerInfo peer_info, int value) { boolean success = nSetSwapInterval(value); if ( !success ) LWJGLUtil.log("Failed to set swap interval"); Modified: trunk/LWJGL/src/native/linux/opengl/extgl_glx.c =================================================================== --- trunk/LWJGL/src/native/linux/opengl/extgl_glx.c 2012-03-01 22:34:34 UTC (rev 3747) +++ trunk/LWJGL/src/native/linux/opengl/extgl_glx.c 2012-03-04 03:40:32 UTC (rev 3748) @@ -74,6 +74,9 @@ /* GLX_SGI_swap_control */ glXSwapIntervalSGIPROC lwjgl_glXSwapIntervalSGI = NULL; +/* GLX_EXT_swap_control */ +glXSwapIntervalEXTPROC lwjgl_glXSwapIntervalEXT = NULL; + /* GLX_ARB_create_context */ glXCreateContextAttribsARBPROC lwjgl_glXCreateContextAttribsARB = NULL; @@ -155,6 +158,12 @@ symbols_flags.GLX_SGI_swap_control = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions); } +static void extgl_InitGLXEXTSwapControl() { + ExtFunction functions[] = { + {"glXSwapIntervalEXT", (void*)&lwjgl_glXSwapIntervalEXT}}; + symbols_flags.GLX_EXT_swap_control = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions); +} + static void extgl_InitGLXARBCreateContext() { ExtFunction functions[] = { {"glXCreateContextAttribsARB", (void*)&lwjgl_glXCreateContextAttribsARB}}; @@ -189,6 +198,7 @@ /* extension_flags.GLX_EXT_visual_info = GLXQueryExtension(serverExts, clientExts, "GLX_EXT_visual_info"); extension_flags.GLX_EXT_visual_rating = GLXQueryExtension(serverExts, clientExts, "GLX_EXT_visual_rating");*/ extension_flags->GLX_SGI_swap_control = symbols_flags.GLX_SGI_swap_control && GLXQueryExtension(serverExts, clientExts, "GLX_SGI_swap_control"); + extension_flags->GLX_EXT_swap_control = symbols_flags.GLX_EXT_swap_control && GLXQueryExtension(serverExts, clientExts, "GLX_EXT_swap_control"); extension_flags->GLX_ARB_multisample = GLXQueryExtension(serverExts, clientExts, "GLX_ARB_multisample"); extension_flags->GLX_ARB_fbconfig_float = GLXQueryExtension(serverExts, clientExts, "GLX_ARB_fbconfig_float"); extension_flags->GLX_EXT_fbconfig_packed_float = GLXQueryExtension(serverExts, clientExts, "GLX_EXT_fbconfig_packed_float"); Modified: trunk/LWJGL/src/native/linux/opengl/extgl_glx.h =================================================================== --- trunk/LWJGL/src/native/linux/opengl/extgl_glx.h 2012-03-01 22:34:34 UTC (rev 3747) +++ trunk/LWJGL/src/native/linux/opengl/extgl_glx.h 2012-03-04 03:40:32 UTC (rev 3748) @@ -343,6 +343,9 @@ /* GLX_SGI_swap_control */ typedef void (APIENTRY * glXSwapIntervalSGIPROC)(int interval); +/* GLX_EXT_swap_control */ +typedef void (APIENTRY * glXSwapIntervalEXTPROC)(Display *dpy, GLXDrawable drawable, int interval); + /* GLX_ARB_create_context */ typedef GLXContext (APIENTRY * glXCreateContextAttribsARBPROC) (Display *dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list); @@ -365,6 +368,7 @@ /* bool GLX_EXT_visual_info; bool GLX_EXT_visual_rating;*/ bool GLX_SGI_swap_control; + bool GLX_EXT_swap_control; bool GLX_ARB_multisample; bool GLX_ARB_fbconfig_float; bool GLX_EXT_fbconfig_packed_float; Modified: trunk/LWJGL/src/native/linux/opengl/org_lwjgl_opengl_LinuxContextImplementation.c =================================================================== --- trunk/LWJGL/src/native/linux/opengl/org_lwjgl_opengl_LinuxContextImplementation.c 2012-03-01 22:34:34 UTC (rev 3747) +++ trunk/LWJGL/src/native/linux/opengl/org_lwjgl_opengl_LinuxContextImplementation.c 2012-03-04 03:40:32 UTC (rev 3748) @@ -117,10 +117,15 @@ } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxContextImplementation_nSetSwapInterval - (JNIEnv *env, jclass clazz, jobject context_handle, jint value) + (JNIEnv *env, jclass clazz, jobject peer_info_handle, jobject context_handle, jint value) { + X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_info_handle); X11Context *context_info = (*env)->GetDirectBufferAddress(env, context_handle); - if (context_info->extension_flags.GLX_SGI_swap_control) { + + if (context_info->extension_flags.GLX_EXT_swap_control) { + lwjgl_glXSwapIntervalEXT(peer_info->display, peer_info->drawable, value); + } + else if (context_info->extension_flags.GLX_SGI_swap_control) { lwjgl_glXSwapIntervalSGI(value); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2012-07-14 23:29:28
|
Revision: 3782 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3782&view=rev Author: matzon Date: 2012-07-14 23:29:21 +0000 (Sat, 14 Jul 2012) Log Message: ----------- fixed issue with win32 get x/y returning client-area coords Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2012-06-29 10:25:36 UTC (rev 3781) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2012-07-14 23:29:21 UTC (rev 3782) @@ -52,6 +52,7 @@ final class WindowsDisplay implements DisplayImplementation { private static final int GAMMA_LENGTH = 256; + private static final int WM_WINDOWPOSCHANGED = 0x0047; private static final int WM_MOVE = 0x0003; private static final int WM_CANCELMODE = 0x001F; private static final int WM_MOUSEMOVE = 0x0200; @@ -1012,15 +1013,22 @@ captureMouse = -1; } return 0; - case WM_MOVE: - x = (int)(short)(lParam & 0xFFFF); - y = (int)(short)(lParam >> 16); - return defWindowProc(hwnd, msg, wParam, lParam); + case WM_WINDOWPOSCHANGED: + if(getWindowRect(hwnd, rect_buffer)) { + rect.copyFromBuffer(rect_buffer); + x = rect.top; + y = rect.bottom; + } else { + LWJGLUtil.log("WM_WINDOWPOSCHANGED: Unable to get window rect"); + } + return defWindowProc(hwnd, msg, wParam, lParam); default: return defWindowProc(hwnd, msg, wParam, lParam); } } + private native boolean getWindowRect(long hwnd, IntBuffer rectBuffer); + public int getX() { return x; } Modified: trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c =================================================================== --- trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c 2012-06-29 10:25:36 UTC (rev 3781) +++ trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c 2012-07-14 23:29:21 UTC (rev 3782) @@ -199,6 +199,18 @@ buffer[1] = point.y; } + +JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_WindowsDisplay_getWindowRect(JNIEnv *env, jclass unused, jlong hwnd_int, jobject buffer_handle) { + HWND hwnd = (HWND)(INT_PTR)hwnd_int; + RECT *buffer = (RECT *)(*env)->GetDirectBufferAddress(env, buffer_handle); + jlong size = (*env)->GetDirectBufferCapacity(env, buffer_handle); + if (size < 4) { + throwFormattedRuntimeException(env, "Buffer size < 4", size); + return false; + } + return GetWindowRect(hwnd, buffer); +} + JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_WindowsDisplay_getForegroundWindow(JNIEnv *env, jclass unused) { return (INT_PTR)GetForegroundWindow(); } @@ -509,4 +521,5 @@ tme.dwFlags = TME_LEAVE; tme.hwndTrack = hwnd; return TrackMouseEvent(&tme); -} \ No newline at end of file +} + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sp...@us...> - 2012-08-16 18:58:51
|
Revision: 3785 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3785&view=rev Author: spasi Date: 2012-08-16 18:58:41 +0000 (Thu, 16 Aug 2012) Log Message: ----------- Changed ALC10's alcGetString and alcOpenDevice to use UTF8 decoding/encoding. New GL extensions: NV_compute_program5, NV_shader_storage_buffer_object, NV_shader_atomic_counters, NV_deep_texture3D New GLES extension: QCOM_binning_control Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/MemoryUtil.java trunk/LWJGL/src/java/org/lwjgl/openal/ALC10.java trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC10.c Added Paths: ----------- trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_compute_program5.java trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_deep_texture3D.java trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_shader_atomic_counters.java trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_shader_storage_buffer_object.java trunk/LWJGL/src/templates/org/lwjgl/opengles/QCOM_binning_control.java Modified: trunk/LWJGL/src/java/org/lwjgl/MemoryUtil.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/MemoryUtil.java 2012-08-14 12:53:54 UTC (rev 3784) +++ trunk/LWJGL/src/java/org/lwjgl/MemoryUtil.java 2012-08-16 18:58:41 UTC (rev 3785) @@ -33,10 +33,7 @@ import java.lang.reflect.Field; import java.nio.*; -import java.nio.charset.CharacterCodingException; -import java.nio.charset.Charset; -import java.nio.charset.CharsetEncoder; -import java.nio.charset.CoderResult; +import java.nio.charset.*; /** * [INTERNAL USE ONLY] @@ -289,6 +286,60 @@ return out; } + public static String decodeASCII(final ByteBuffer buffer) { + return decode(buffer, ascii); + } + + public static String decodeUTF8(final ByteBuffer buffer) { + return decode(buffer, utf8); + } + + public static String decodeUTF16(final ByteBuffer buffer) { + return decode(buffer, utf16); + } + + private static String decode(final ByteBuffer buffer, final Charset charset) { + if ( buffer == null ) + return null; + + return decodeImpl(buffer, charset); + } + + private static String decodeImpl(final ByteBuffer in, final Charset charset) { + final CharsetDecoder decoder = charset.newDecoder(); // decoders are not thread-safe, create a new one on every call + + int n = (int)(in.remaining() * decoder.averageCharsPerByte()); + CharBuffer out = BufferUtils.createCharBuffer(n); + + if ( (n == 0) && (in.remaining() == 0) ) + return ""; + + decoder.reset(); + for (; ; ) { + CoderResult cr = in.hasRemaining() ? decoder.decode(in, out, true) : CoderResult.UNDERFLOW; + if ( cr.isUnderflow() ) + cr = decoder.flush(out); + + if ( cr.isUnderflow() ) + break; + if ( cr.isOverflow() ) { + n = 2 * n + 1; // Ensure progress; n might be 0! + CharBuffer o = BufferUtils.createCharBuffer(n); + out.flip(); + o.put(out); + out = o; + continue; + } + try { + cr.throwException(); + } catch (CharacterCodingException e) { + throw new RuntimeException(e); + } + } + out.flip(); + return out.toString(); + } + /** A null-terminated CharSequence. */ private static class CharSequenceNT implements CharSequence { Modified: trunk/LWJGL/src/java/org/lwjgl/openal/ALC10.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/openal/ALC10.java 2012-08-14 12:53:54 UTC (rev 3784) +++ trunk/LWJGL/src/java/org/lwjgl/openal/ALC10.java 2012-08-16 18:58:41 UTC (rev 3785) @@ -152,12 +152,11 @@ * @return String property from device */ public static String alcGetString(ALCdevice device, int pname) { - String result; - result = nalcGetString(getDevice(device), pname); + ByteBuffer buffer = nalcGetString(getDevice(device), pname); Util.checkALCError(device); - return result; + return MemoryUtil.decodeUTF8(buffer); } - static native String nalcGetString(long device, int pname); + static native ByteBuffer nalcGetString(long device, int pname); /** * The application can query ALC for information using an integer query function. @@ -199,7 +198,7 @@ * @return opened device, or null */ public static ALCdevice alcOpenDevice(String devicename) { - ByteBuffer buffer = MemoryUtil.encodeASCII(devicename); + ByteBuffer buffer = MemoryUtil.encodeUTF8(devicename); long device_address = nalcOpenDevice(MemoryUtil.getAddressSafe(buffer)); if(device_address != 0) { ALCdevice device = new ALCdevice(device_address); Modified: trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC10.c =================================================================== --- trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC10.c 2012-08-14 12:53:54 UTC (rev 3784) +++ trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC10.c 2012-08-16 18:58:41 UTC (rev 3785) @@ -81,8 +81,8 @@ * C Specification: * ALubyte * alcGetString(ALCdevice *device, ALenum token); */ -static jstring JNICALL Java_org_lwjgl_openal_ALC10_nalcGetString (JNIEnv *env, jclass clazz, jlong deviceaddress, jint token) { - const char* alcString = (const char*) alcGetString((ALCdevice*)((intptr_t)deviceaddress), (ALenum) token); +static jobject JNICALL Java_org_lwjgl_openal_ALC10_nalcGetString (JNIEnv *env, jclass clazz, jlong deviceaddress, jint token) { + char* alcString = (char*) alcGetString((ALCdevice*)((intptr_t)deviceaddress), (ALenum) token); int length; int i=1; @@ -111,7 +111,8 @@ default: // e.g. ALC_DEFAULT_ALL_DEVICES_SPECIFIER length = strlen(alcString); } - return NewStringNativeWithLength(env, alcString, length); + //return NewStringNativeWithLength(env, alcString, length); + return safeNewBuffer(env, alcString, length); } /** @@ -263,7 +264,7 @@ #endif JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC10_initNativeStubs(JNIEnv *env, jclass clazz) { JavaMethodAndExtFunction functions[] = { - {"nalcGetString", "(JI)Ljava/lang/String;", (void*)&Java_org_lwjgl_openal_ALC10_nalcGetString, "alcGetString", (void*)&alcGetString, false}, + {"nalcGetString", "(JI)Ljava/nio/ByteBuffer;", (void*)&Java_org_lwjgl_openal_ALC10_nalcGetString, "alcGetString", (void*)&alcGetString, false}, {"nalcGetIntegerv", "(JIIJ)V", (void*)&Java_org_lwjgl_openal_ALC10_nalcGetIntegerv, "alcGetIntegerv", (void*)&alcGetIntegerv, false}, {"nalcOpenDevice", "(J)J", (void*)&Java_org_lwjgl_openal_ALC10_nalcOpenDevice, "alcOpenDevice", (void*)&alcOpenDevice, false}, {"nalcCloseDevice", "(J)Z", (void*)&Java_org_lwjgl_openal_ALC10_nalcCloseDevice, "alcCloseDevice", (void*)&alcCloseDevice, false}, Added: trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_compute_program5.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_compute_program5.java (rev 0) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_compute_program5.java 2012-08-16 18:58:41 UTC (rev 3785) @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2002-2012 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 interface NV_compute_program5 { + + /** + * 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: + */ + int GL_COMPUTE_PROGRAM_NV = 0x90FB; + + /** + * Accepted by the <target> parameter of ProgramBufferParametersfvNV, + * ProgramBufferParametersIivNV, and ProgramBufferParametersIuivNV, + * BindBufferRangeNV, BindBufferOffsetNV, BindBufferBaseNV, and BindBuffer + * and the <value> parameter of GetIntegerIndexedvEXT: + */ + int GL_COMPUTE_PROGRAM_PARAMETER_BUFFER_NV = 0x90FC; + +} \ No newline at end of file Added: trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_deep_texture3D.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_deep_texture3D.java (rev 0) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_deep_texture3D.java 2012-08-16 18:58:41 UTC (rev 3785) @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2002-2012 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 interface NV_deep_texture3D { + + /** + * Accepted by the <pname> parameter of GetBooleanv, GetDoublev, GetIntegerv + * and GetFloatv: + */ + int GL_MAX_DEEP_3D_TEXTURE_WIDTH_HEIGHT_NV = 0x90D0, + GL_MAX_DEEP_3D_TEXTURE_DEPTH_NV = 0x90D1; + +} \ No newline at end of file Added: trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_shader_atomic_counters.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_shader_atomic_counters.java (rev 0) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_shader_atomic_counters.java 2012-08-16 18:58:41 UTC (rev 3785) @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2002-2012 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 interface NV_shader_atomic_counters { +} \ No newline at end of file Added: trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_shader_storage_buffer_object.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_shader_storage_buffer_object.java (rev 0) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_shader_storage_buffer_object.java 2012-08-16 18:58:41 UTC (rev 3785) @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2002-2012 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 interface NV_shader_storage_buffer_object { +} \ No newline at end of file Added: trunk/LWJGL/src/templates/org/lwjgl/opengles/QCOM_binning_control.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengles/QCOM_binning_control.java (rev 0) +++ trunk/LWJGL/src/templates/org/lwjgl/opengles/QCOM_binning_control.java 2012-08-16 18:58:41 UTC (rev 3785) @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2002-2011 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.opengles; + +public interface QCOM_binning_control { + + /** Accepted by the <target> parameter of Hint: */ + int GL_BINNING_CONTROL_HINT_QCOM = 0x8FB0; + + /** Accepted by the <hint> parameter of Hint: */ + int GL_CPU_OPTIMIZED_QCOM = 0x8FB1, + GL_GPU_OPTIMIZED_QCOM = 0x8FB2, + GL_RENDER_DIRECT_TO_FRAMEBUFFER_QCOM = 0x8FB3, + GL_DONT_CARE = 0x1100; + +} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sp...@us...> - 2012-08-18 14:00:52
|
Revision: 3787 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3787&view=rev Author: spasi Date: 2012-08-18 14:00:45 +0000 (Sat, 18 Aug 2012) Log Message: ----------- Fixes related to the new alternate signatures. Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/GLChecks.java trunk/LWJGL/src/java/org/lwjgl/opengles/GLChecks.java trunk/LWJGL/src/java/org/lwjgl/test/opengl/SyncTest.java trunk/LWJGL/src/java/org/lwjgl/test/opengl/shaders/ShaderUNI.java trunk/LWJGL/src/java/org/lwjgl/test/opengl/sprites/SpriteShootout.java trunk/LWJGL/src/java/org/lwjgl/test/opengl/sprites/SpriteShootout2P.java trunk/LWJGL/src/java/org/lwjgl/test/opengl/sprites/SpriteShootoutCL.java trunk/LWJGL/src/java/org/lwjgl/test/opengl/sprites/SpriteShootoutMapped.java trunk/LWJGL/src/java/org/lwjgl/test/opengles/util/Shader.java trunk/LWJGL/src/java/org/lwjgl/test/opengles/util/ShaderProgram.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_shader_subroutine.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_sync.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/GLChecks.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/GLChecks.java 2012-08-18 11:46:25 UTC (rev 3786) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/GLChecks.java 2012-08-18 14:00:45 UTC (rev 3787) @@ -66,15 +66,15 @@ } static int getBufferObjectSize(ContextCapabilities caps, int buffer_enum) { - return glGetBufferParameter(buffer_enum, GL_BUFFER_SIZE); + return glGetBufferParameteri(buffer_enum, GL_BUFFER_SIZE); } static int getBufferObjectSizeARB(ContextCapabilities caps, int buffer_enum) { - return glGetBufferParameterARB(buffer_enum, GL_BUFFER_SIZE_ARB); + return glGetBufferParameteriARB(buffer_enum, GL_BUFFER_SIZE_ARB); } static int getBufferObjectSizeATI(ContextCapabilities caps, int buffer) { - return glGetObjectBufferATI(buffer, GL_OBJECT_BUFFER_SIZE_ATI); + return glGetObjectBufferiATI(buffer, GL_OBJECT_BUFFER_SIZE_ATI); } static int getNamedBufferObjectSize(ContextCapabilities caps, int buffer) { Modified: trunk/LWJGL/src/java/org/lwjgl/opengles/GLChecks.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengles/GLChecks.java 2012-08-18 11:46:25 UTC (rev 3786) +++ trunk/LWJGL/src/java/org/lwjgl/opengles/GLChecks.java 2012-08-18 14:00:45 UTC (rev 3787) @@ -59,7 +59,7 @@ } static int getBufferObjectSize(int buffer_enum) { - return glGetBufferParameter(buffer_enum, GLES20.GL_BUFFER_SIZE); + return glGetBufferParameteri(buffer_enum, GLES20.GL_BUFFER_SIZE); } /** Helper method to ensure that array buffer objects are disabled. If they are enabled, we'll throw an OpenGLException */ Modified: trunk/LWJGL/src/java/org/lwjgl/test/opengl/SyncTest.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/test/opengl/SyncTest.java 2012-08-18 11:46:25 UTC (rev 3786) +++ trunk/LWJGL/src/java/org/lwjgl/test/opengl/SyncTest.java 2012-08-18 14:00:45 UTC (rev 3787) @@ -130,7 +130,7 @@ System.out.println("Unexpected wait status: 0x" + Integer.toHexString(status)); } - System.out.println("Sync Status: " + (glGetSync(sync, GL_SYNC_STATUS) == GL_UNSIGNALED ? "UNSIGNALED" : "SIGNALED")); + System.out.println("Sync Status: " + (glGetSynci(sync, GL_SYNC_STATUS) == GL_UNSIGNALED ? "UNSIGNALED" : "SIGNALED")); glDeleteSync(sync); Modified: trunk/LWJGL/src/java/org/lwjgl/test/opengl/shaders/ShaderUNI.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/test/opengl/shaders/ShaderUNI.java 2012-08-18 11:46:25 UTC (rev 3786) +++ trunk/LWJGL/src/java/org/lwjgl/test/opengl/shaders/ShaderUNI.java 2012-08-18 14:00:45 UTC (rev 3787) @@ -75,7 +75,7 @@ printShaderObjectInfoLog(file, shaderID); - if ( glGetShader(shaderID, GL_COMPILE_STATUS) == GL_FALSE ) + if ( glGetShaderi(shaderID, GL_COMPILE_STATUS) == GL_FALSE ) ShadersTest.kill("A compilation error occured in a vertex shader."); programID = glCreateProgram(); @@ -85,14 +85,14 @@ printShaderProgramInfoLog(programID); - if ( glGetProgram(programID, GL_LINK_STATUS) == GL_FALSE ) + if ( glGetProgrami(programID, GL_LINK_STATUS) == GL_FALSE ) ShadersTest.kill("A linking error occured in a shader program."); final String[] uniformNames = { "uniformA", "uniformB" }; // Get uniform block index and data size final int blockIndex = glGetUniformBlockIndex(programID, "test"); - final int blockSize = glGetActiveUniformBlock(programID, blockIndex, GL_UNIFORM_BLOCK_DATA_SIZE); + final int blockSize = glGetActiveUniformBlocki(programID, blockIndex, GL_UNIFORM_BLOCK_DATA_SIZE); System.out.println("blockSize = " + blockSize); Modified: trunk/LWJGL/src/java/org/lwjgl/test/opengl/sprites/SpriteShootout.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/test/opengl/sprites/SpriteShootout.java 2012-08-18 11:46:25 UTC (rev 3786) +++ trunk/LWJGL/src/java/org/lwjgl/test/opengl/sprites/SpriteShootout.java 2012-08-18 14:00:45 UTC (rev 3787) @@ -394,8 +394,8 @@ " gl_FragColor = texture2D(COLOR_MAP, gl_PointCoord);\n" + "}"); glCompileShader(fshID); - if ( glGetShader(fshID, GL_COMPILE_STATUS) == GL_FALSE ) { - System.out.println(glGetShaderInfoLog(fshID, glGetShader(fshID, GL_INFO_LOG_LENGTH))); + if ( glGetShaderi(fshID, GL_COMPILE_STATUS) == GL_FALSE ) { + System.out.println(glGetShaderInfoLog(fshID, glGetShaderi(fshID, GL_INFO_LOG_LENGTH))); throw new RuntimeException("Failed to compile fragment shader."); } @@ -403,8 +403,8 @@ glAttachShader(progID, vshID); glAttachShader(progID, fshID); glLinkProgram(progID); - if ( glGetProgram(progID, GL_LINK_STATUS) == GL_FALSE ) { - System.out.println(glGetProgramInfoLog(progID, glGetProgram(progID, GL_INFO_LOG_LENGTH))); + if ( glGetProgrami(progID, GL_LINK_STATUS) == GL_FALSE ) { + System.out.println(glGetProgramInfoLog(progID, glGetProgrami(progID, GL_INFO_LOG_LENGTH))); throw new RuntimeException("Failed to link shader program."); } @@ -491,8 +491,8 @@ " gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n" + "}"); glCompileShader(vshID); - if ( glGetShader(vshID, GL_COMPILE_STATUS) == GL_FALSE ) { - System.out.println(glGetShaderInfoLog(vshID, glGetShader(vshID, GL_INFO_LOG_LENGTH))); + if ( glGetShaderi(vshID, GL_COMPILE_STATUS) == GL_FALSE ) { + System.out.println(glGetShaderInfoLog(vshID, glGetShaderi(vshID, GL_INFO_LOG_LENGTH))); throw new RuntimeException("Failed to compile vertex shader."); } @@ -635,8 +635,8 @@ " gl_Position = vec4(animC, anim.zw);\n" + "}"); glCompileShader(vshID); - if ( glGetShader(vshID, GL_COMPILE_STATUS) == GL_FALSE ) { - System.out.println(glGetShaderInfoLog(vshID, glGetShader(vshID, GL_INFO_LOG_LENGTH))); + if ( glGetShaderi(vshID, GL_COMPILE_STATUS) == GL_FALSE ) { + System.out.println(glGetShaderInfoLog(vshID, glGetShaderi(vshID, GL_INFO_LOG_LENGTH))); throw new RuntimeException("Failed to compile vertex shader."); } @@ -644,8 +644,8 @@ glAttachShader(progIDTF, vshID); glTransformFeedbackVaryings(progIDTF, new CharSequence[] { "gl_Position" }, GL_SEPARATE_ATTRIBS); glLinkProgram(progIDTF); - if ( glGetProgram(progIDTF, GL_LINK_STATUS) == GL_FALSE ) { - System.out.println(glGetProgramInfoLog(progIDTF, glGetProgram(progIDTF, GL_INFO_LOG_LENGTH))); + if ( glGetProgrami(progIDTF, GL_LINK_STATUS) == GL_FALSE ) { + System.out.println(glGetProgramInfoLog(progIDTF, glGetProgrami(progIDTF, GL_INFO_LOG_LENGTH))); throw new RuntimeException("Failed to link shader program."); } @@ -663,8 +663,8 @@ " gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n" + "}"); glCompileShader(this.vshID); - if ( glGetShader(this.vshID, GL_COMPILE_STATUS) == GL_FALSE ) { - System.out.println(glGetShaderInfoLog(this.vshID, glGetShader(this.vshID, GL_INFO_LOG_LENGTH))); + if ( glGetShaderi(this.vshID, GL_COMPILE_STATUS) == GL_FALSE ) { + System.out.println(glGetShaderInfoLog(this.vshID, glGetShaderi(this.vshID, GL_INFO_LOG_LENGTH))); throw new RuntimeException("Failed to compile vertex shader."); } Modified: trunk/LWJGL/src/java/org/lwjgl/test/opengl/sprites/SpriteShootout2P.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/test/opengl/sprites/SpriteShootout2P.java 2012-08-18 11:46:25 UTC (rev 3786) +++ trunk/LWJGL/src/java/org/lwjgl/test/opengl/sprites/SpriteShootout2P.java 2012-08-18 14:00:45 UTC (rev 3787) @@ -392,8 +392,8 @@ " gl_FragColor = texture2D(COLOR_MAP, gl_PointCoord);\n" + "}"); glCompileShader(fshID); - if ( glGetShader(fshID, GL_COMPILE_STATUS) == GL_FALSE ) { - System.out.println(glGetShaderInfoLog(fshID, glGetShader(fshID, GL_INFO_LOG_LENGTH))); + if ( glGetShaderi(fshID, GL_COMPILE_STATUS) == GL_FALSE ) { + System.out.println(glGetShaderInfoLog(fshID, glGetShaderi(fshID, GL_INFO_LOG_LENGTH))); throw new RuntimeException("Failed to compile fragment shader."); } @@ -401,8 +401,8 @@ glAttachShader(progID, vshID); glAttachShader(progID, fshID); glLinkProgram(progID); - if ( glGetProgram(progID, GL_LINK_STATUS) == GL_FALSE ) { - System.out.println(glGetProgramInfoLog(progID, glGetProgram(progID, GL_INFO_LOG_LENGTH))); + if ( glGetProgrami(progID, GL_LINK_STATUS) == GL_FALSE ) { + System.out.println(glGetProgramInfoLog(progID, glGetProgrami(progID, GL_INFO_LOG_LENGTH))); throw new RuntimeException("Failed to link shader program."); } @@ -456,8 +456,8 @@ " gl_Position = vec4(animC, anim.zw);\n" + "}"); glCompileShader(vshID); - if ( glGetShader(vshID, GL_COMPILE_STATUS) == GL_FALSE ) { - System.out.println(glGetShaderInfoLog(vshID, glGetShader(vshID, GL_INFO_LOG_LENGTH))); + if ( glGetShaderi(vshID, GL_COMPILE_STATUS) == GL_FALSE ) { + System.out.println(glGetShaderInfoLog(vshID, glGetShaderi(vshID, GL_INFO_LOG_LENGTH))); throw new RuntimeException("Failed to compile vertex shader."); } @@ -465,8 +465,8 @@ glAttachShader(progIDTF, vshID); glTransformFeedbackVaryings(progIDTF, new CharSequence[] { "gl_Position" }, GL_SEPARATE_ATTRIBS); glLinkProgram(progIDTF); - if ( glGetProgram(progIDTF, GL_LINK_STATUS) == GL_FALSE ) { - System.out.println(glGetProgramInfoLog(progIDTF, glGetProgram(progIDTF, GL_INFO_LOG_LENGTH))); + if ( glGetProgrami(progIDTF, GL_LINK_STATUS) == GL_FALSE ) { + System.out.println(glGetProgramInfoLog(progIDTF, glGetProgrami(progIDTF, GL_INFO_LOG_LENGTH))); throw new RuntimeException("Failed to link shader program."); } @@ -486,8 +486,8 @@ " gl_Position = gl_ModelViewProjectionMatrix * vec4(gl_Vertex.xy, depth, gl_Vertex.w);\n" + "}"); glCompileShader(vshID); - if ( glGetShader(vshID, GL_COMPILE_STATUS) == GL_FALSE ) { - System.out.println(glGetShaderInfoLog(vshID, glGetShader(vshID, GL_INFO_LOG_LENGTH))); + if ( glGetShaderi(vshID, GL_COMPILE_STATUS) == GL_FALSE ) { + System.out.println(glGetShaderInfoLog(vshID, glGetShaderi(vshID, GL_INFO_LOG_LENGTH))); throw new RuntimeException("Failed to compile vertex shader."); } Modified: trunk/LWJGL/src/java/org/lwjgl/test/opengl/sprites/SpriteShootoutCL.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/test/opengl/sprites/SpriteShootoutCL.java 2012-08-18 11:46:25 UTC (rev 3786) +++ trunk/LWJGL/src/java/org/lwjgl/test/opengl/sprites/SpriteShootoutCL.java 2012-08-18 14:00:45 UTC (rev 3787) @@ -464,8 +464,8 @@ " gl_FragColor = texture2D(COLOR_MAP, gl_PointCoord);\n" + "}"); glCompileShader(fshID); - if ( glGetShader(fshID, GL_COMPILE_STATUS) == GL_FALSE ) { - System.out.println(glGetShaderInfoLog(fshID, glGetShader(fshID, GL_INFO_LOG_LENGTH))); + if ( glGetShaderi(fshID, GL_COMPILE_STATUS) == GL_FALSE ) { + System.out.println(glGetShaderInfoLog(fshID, glGetShaderi(fshID, GL_INFO_LOG_LENGTH))); throw new RuntimeException("Failed to compile fragment shader."); } @@ -473,8 +473,8 @@ glAttachShader(progID, vshID); glAttachShader(progID, fshID); glLinkProgram(progID); - if ( glGetProgram(progID, GL_LINK_STATUS) == GL_FALSE ) { - System.out.println(glGetProgramInfoLog(progID, glGetProgram(progID, GL_INFO_LOG_LENGTH))); + if ( glGetProgrami(progID, GL_LINK_STATUS) == GL_FALSE ) { + System.out.println(glGetProgramInfoLog(progID, glGetProgrami(progID, GL_INFO_LOG_LENGTH))); throw new RuntimeException("Failed to link shader program."); } @@ -534,8 +534,8 @@ " gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n" + "}"); glCompileShader(vshID); - if ( glGetShader(vshID, GL_COMPILE_STATUS) == GL_FALSE ) { - System.out.println(glGetShaderInfoLog(vshID, glGetShader(vshID, GL_INFO_LOG_LENGTH))); + if ( glGetShaderi(vshID, GL_COMPILE_STATUS) == GL_FALSE ) { + System.out.println(glGetShaderInfoLog(vshID, glGetShaderi(vshID, GL_INFO_LOG_LENGTH))); throw new RuntimeException("Failed to compile vertex shader."); } Modified: trunk/LWJGL/src/java/org/lwjgl/test/opengl/sprites/SpriteShootoutMapped.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/test/opengl/sprites/SpriteShootoutMapped.java 2012-08-18 11:46:25 UTC (rev 3786) +++ trunk/LWJGL/src/java/org/lwjgl/test/opengl/sprites/SpriteShootoutMapped.java 2012-08-18 14:00:45 UTC (rev 3787) @@ -445,8 +445,8 @@ " gl_FragColor = texture2D(COLOR_MAP, gl_PointCoord);\n" + "}"); glCompileShader(fshID); - if ( glGetShader(fshID, GL_COMPILE_STATUS) == GL_FALSE ) { - System.out.println(glGetShaderInfoLog(fshID, glGetShader(fshID, GL_INFO_LOG_LENGTH))); + if ( glGetShaderi(fshID, GL_COMPILE_STATUS) == GL_FALSE ) { + System.out.println(glGetShaderInfoLog(fshID, glGetShaderi(fshID, GL_INFO_LOG_LENGTH))); throw new RuntimeException("Failed to compile fragment shader."); } @@ -454,8 +454,8 @@ glAttachShader(progID, vshID); glAttachShader(progID, fshID); glLinkProgram(progID); - if ( glGetProgram(progID, GL_LINK_STATUS) == GL_FALSE ) { - System.out.println(glGetProgramInfoLog(progID, glGetProgram(progID, GL_INFO_LOG_LENGTH))); + if ( glGetProgrami(progID, GL_LINK_STATUS) == GL_FALSE ) { + System.out.println(glGetProgramInfoLog(progID, glGetProgrami(progID, GL_INFO_LOG_LENGTH))); throw new RuntimeException("Failed to link shader program."); } @@ -487,8 +487,8 @@ " gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n" + "}"); glCompileShader(vshID); - if ( glGetShader(vshID, GL_COMPILE_STATUS) == GL_FALSE ) { - System.out.println(glGetShaderInfoLog(vshID, glGetShader(vshID, GL_INFO_LOG_LENGTH))); + if ( glGetShaderi(vshID, GL_COMPILE_STATUS) == GL_FALSE ) { + System.out.println(glGetShaderInfoLog(vshID, glGetShaderi(vshID, GL_INFO_LOG_LENGTH))); throw new RuntimeException("Failed to compile vertex shader."); } @@ -708,8 +708,8 @@ " gl_Position = vec4(animC, anim.zw);\n" + "}"); glCompileShader(vshID); - if ( glGetShader(vshID, GL_COMPILE_STATUS) == GL_FALSE ) { - System.out.println(glGetShaderInfoLog(vshID, glGetShader(vshID, GL_INFO_LOG_LENGTH))); + if ( glGetShaderi(vshID, GL_COMPILE_STATUS) == GL_FALSE ) { + System.out.println(glGetShaderInfoLog(vshID, glGetShaderi(vshID, GL_INFO_LOG_LENGTH))); throw new RuntimeException("Failed to compile vertex shader."); } @@ -717,8 +717,8 @@ glAttachShader(progIDTF, vshID); glTransformFeedbackVaryings(progIDTF, new CharSequence[] { "gl_Position" }, GL_SEPARATE_ATTRIBS); glLinkProgram(progIDTF); - if ( glGetProgram(progIDTF, GL_LINK_STATUS) == GL_FALSE ) { - System.out.println(glGetProgramInfoLog(progIDTF, glGetProgram(progIDTF, GL_INFO_LOG_LENGTH))); + if ( glGetProgrami(progIDTF, GL_LINK_STATUS) == GL_FALSE ) { + System.out.println(glGetProgramInfoLog(progIDTF, glGetProgrami(progIDTF, GL_INFO_LOG_LENGTH))); throw new RuntimeException("Failed to link shader program."); } @@ -736,8 +736,8 @@ " gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n" + "}"); glCompileShader(this.vshID); - if ( glGetShader(this.vshID, GL_COMPILE_STATUS) == GL_FALSE ) { - System.out.println(glGetShaderInfoLog(this.vshID, glGetShader(this.vshID, GL_INFO_LOG_LENGTH))); + if ( glGetShaderi(this.vshID, GL_COMPILE_STATUS) == GL_FALSE ) { + System.out.println(glGetShaderInfoLog(this.vshID, glGetShaderi(this.vshID, GL_INFO_LOG_LENGTH))); throw new RuntimeException("Failed to compile vertex shader."); } Modified: trunk/LWJGL/src/java/org/lwjgl/test/opengles/util/Shader.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/test/opengles/util/Shader.java 2012-08-18 11:46:25 UTC (rev 3786) +++ trunk/LWJGL/src/java/org/lwjgl/test/opengles/util/Shader.java 2012-08-18 14:00:45 UTC (rev 3787) @@ -75,7 +75,7 @@ glCompileShader(ID); - if ( glGetShader(ID, GL_COMPILE_STATUS) == GL_FALSE ) { + if ( glGetShaderi(ID, GL_COMPILE_STATUS) == GL_FALSE ) { printInfoLog(); destroy(); throw new RuntimeException("A compilation error occured in a shader."); @@ -86,7 +86,7 @@ if ( ID == 0 ) throw new IllegalStateException("The shader has not been created"); - final int logLength = glGetShader(ID, GL_INFO_LOG_LENGTH); + final int logLength = glGetShaderi(ID, GL_INFO_LOG_LENGTH); if ( logLength <= 1 ) return; Modified: trunk/LWJGL/src/java/org/lwjgl/test/opengles/util/ShaderProgram.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/test/opengles/util/ShaderProgram.java 2012-08-18 11:46:25 UTC (rev 3786) +++ trunk/LWJGL/src/java/org/lwjgl/test/opengles/util/ShaderProgram.java 2012-08-18 14:00:45 UTC (rev 3787) @@ -14,7 +14,7 @@ glLinkProgram(ID); - if ( glGetProgram(ID, GL_LINK_STATUS) == GL_FALSE ) { + if ( glGetProgrami(ID, GL_LINK_STATUS) == GL_FALSE ) { printInfoLog(); destroy(); throw new RuntimeException("Failed to link a Shader Program: " + ID); @@ -24,7 +24,7 @@ public void validate() { glValidateProgram(ID); - final boolean error = glGetProgram(ID, GL_VALIDATE_STATUS) == GL_FALSE; + final boolean error = glGetProgrami(ID, GL_VALIDATE_STATUS) == GL_FALSE; if ( error ) { printInfoLog(); @@ -67,7 +67,7 @@ } private void printInfoLog() { - final int logLength = glGetProgram(ID, GL_INFO_LOG_LENGTH); + final int logLength = glGetProgrami(ID, GL_INFO_LOG_LENGTH); System.out.println(logLength); if ( logLength <= 1 ) Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_shader_subroutine.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_shader_subroutine.java 2012-08-18 11:46:25 UTC (rev 3786) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_shader_subroutine.java 2012-08-18 14:00:45 UTC (rev 3787) @@ -76,7 +76,7 @@ @Reuse("GL40") @Alternate("glGetActiveSubroutineUniformiv") @GLreturn("values") - @StripPostfix("values") + @StripPostfix(value = "values", postfix = "v") void glGetActiveSubroutineUniformiv2(@GLuint int program, @GLenum int shadertype, @GLuint int index, @GLenum int pname, @OutParameter IntBuffer values); @@ -125,7 +125,7 @@ @Reuse("GL40") @Alternate("glGetProgramStageiv") @GLreturn("values") - @StripPostfix("values") + @StripPostfix(value = "values", postfix = "v") void glGetProgramStageiv2(@GLuint int program, @GLenum int shadertype, @GLenum int pname, @OutParameter IntBuffer values); } \ No newline at end of file Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_sync.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_sync.java 2012-08-18 11:46:25 UTC (rev 3786) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_sync.java 2012-08-18 14:00:45 UTC (rev 3787) @@ -109,7 +109,7 @@ @Reuse("GL32") @Alternate("glGetSynciv") @GLreturn("values") - @StripPostfix("values") + @StripPostfix(value = "values", postfix = "v") void glGetSynciv2(@PointerWrapper("GLsync") GLSync sync, @GLenum int pname, @Constant("1") @GLsizei int bufSize, @OutParameter @GLsizei @Constant("0L") IntBuffer length, @OutParameter IntBuffer values); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sp...@us...> - 2012-08-19 06:56:33
|
Revision: 3788 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3788&view=rev Author: spasi Date: 2012-08-19 06:56:25 +0000 (Sun, 19 Aug 2012) Log Message: ----------- Restored (most of) the removed methods from the previous commit and added deprecation warnings. Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/util/generator/JavaMethodsGenerator.java trunk/LWJGL/src/java/org/lwjgl/util/generator/Reuse.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_buffer_object.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_framebuffer_object.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_occlusion_query.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_program.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_sync.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_uniform_buffer_object.java trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_framebuffer_object.java trunk/LWJGL/src/templates/org/lwjgl/opengl/GL15.java trunk/LWJGL/src/templates/org/lwjgl/opengl/GL20.java trunk/LWJGL/src/templates/org/lwjgl/opengl/GL30.java trunk/LWJGL/src/templates/org/lwjgl/opengl/GL31.java trunk/LWJGL/src/templates/org/lwjgl/opengl/GL32.java trunk/LWJGL/src/templates/org/lwjgl/opengl/GL33.java trunk/LWJGL/src/templates/org/lwjgl/opengl/GL40.java trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_program.java trunk/LWJGL/src/templates/org/lwjgl/opengles/GLES20.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_framebuffer_object.java Modified: trunk/LWJGL/src/java/org/lwjgl/util/generator/JavaMethodsGenerator.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/generator/JavaMethodsGenerator.java 2012-08-18 14:00:45 UTC (rev 3787) +++ trunk/LWJGL/src/java/org/lwjgl/util/generator/JavaMethodsGenerator.java 2012-08-19 06:56:25 UTC (rev 3788) @@ -258,7 +258,7 @@ if ( has_result || method.getAnnotation(GLreturn.class) != null ) writer.print("return "); - writer.print(reuse_annotation.value() + "." + method_name + "("); + writer.print(reuse_annotation.value() + "." + (reuse_annotation.method().length() > 0 ? reuse_annotation.method() : method_name) + "("); generateParametersJava(writer, method, typeinfos_instance, false, false, mode); writer.println(");\n\t}"); return; Modified: trunk/LWJGL/src/java/org/lwjgl/util/generator/Reuse.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/generator/Reuse.java 2012-08-18 14:00:45 UTC (rev 3787) +++ trunk/LWJGL/src/java/org/lwjgl/util/generator/Reuse.java 2012-08-19 06:56:25 UTC (rev 3788) @@ -45,5 +45,5 @@ public @interface Reuse { /** The extension Class that defines the method. */ String value(); - + String method() default ""; } \ No newline at end of file Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_buffer_object.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_buffer_object.java 2012-08-18 14:00:45 UTC (rev 3787) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_buffer_object.java 2012-08-19 06:56:25 UTC (rev 3788) @@ -142,11 +142,19 @@ @StripPostfix("params") void glGetBufferParameterivARB(@GLenum int target, @GLenum int pname, @OutParameter @Check("4") IntBuffer params); + /** @deprecated Will be removed in 3.0. Use {@link #glGetBufferParameteriARB} instead. */ @Alternate("glGetBufferParameterivARB") @GLreturn("params") - @StripPostfix(value = "params", postfix = "v") + @StripPostfix("params") + @Reuse(value = "ARBBufferObject", method = "glGetBufferParameteriARB") + @Deprecated void glGetBufferParameterivARB2(@GLenum int target, @GLenum int pname, @OutParameter IntBuffer params); + @Alternate("glGetBufferParameterivARB") + @GLreturn("params") + @StripPostfix(value = "params", postfix = "v") + void glGetBufferParameterivARB3(@GLenum int target, @GLenum int pname, @OutParameter IntBuffer params); + @StripPostfix("pointer") @AutoSize("GLChecks.getBufferObjectSizeARB(caps, target)") void glGetBufferPointervARB(@GLenum int target, @GLenum int pname, @Result @GLvoid ByteBuffer pointer); Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_framebuffer_object.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_framebuffer_object.java 2012-08-18 14:00:45 UTC (rev 3787) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_framebuffer_object.java 2012-08-19 06:56:25 UTC (rev 3788) @@ -220,11 +220,19 @@ @StripPostfix("params") void glGetRenderbufferParameteriv(@GLenum int target, @GLenum int pname, @Check("4") @OutParameter IntBuffer params); + /** @deprecated Will be removed in 3.0. Use {@link #glGetRenderbufferParameteri} instead. */ + @Alternate("glGetRenderbufferParameteriv") + @GLreturn("params") + @StripPostfix("params") + @Reuse(value = "ARBFramebufferObject", method = "glGetRenderbufferParameteri") + @Deprecated + void glGetRenderbufferParameteriv2(@GLenum int target, @GLenum int pname, @OutParameter IntBuffer params); + @Reuse("GL30") @Alternate("glGetRenderbufferParameteriv") @GLreturn("params") @StripPostfix(value = "params", postfix = "v") - void glGetRenderbufferParameteriv2(@GLenum int target, @GLenum int pname, @OutParameter IntBuffer params); + void glGetRenderbufferParameteriv3(@GLenum int target, @GLenum int pname, @OutParameter IntBuffer params); @Reuse("GL30") boolean glIsFramebuffer(@GLuint int framebuffer); @@ -277,11 +285,20 @@ void glGetFramebufferAttachmentParameteriv(@GLenum int target, @GLenum int attachment, @GLenum int pname, @Check("4") @OutParameter IntBuffer params); + /** @deprecated Will be removed in 3.0. Use {@link #glGetFramebufferAttachmentParameteri} instead. */ + @Alternate("glGetFramebufferAttachmentParameteriv") + @GLreturn("params") + @StripPostfix("params") + @Reuse(value = "GL30", method = "glGetFramebufferAttachmentParameteri") + @Deprecated + void glGetFramebufferAttachmentParameteriv2(@GLenum int target, @GLenum int attachment, + @GLenum int pname, @OutParameter IntBuffer params); + @Reuse("GL30") @Alternate("glGetFramebufferAttachmentParameteriv") @GLreturn("params") @StripPostfix(value = "params", postfix = "v") - void glGetFramebufferAttachmentParameteriv2(@GLenum int target, @GLenum int attachment, + void glGetFramebufferAttachmentParameteriv3(@GLenum int target, @GLenum int attachment, @GLenum int pname, @OutParameter IntBuffer params); @Reuse("GL30") Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_occlusion_query.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_occlusion_query.java 2012-08-18 14:00:45 UTC (rev 3787) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_occlusion_query.java 2012-08-19 06:56:25 UTC (rev 3788) @@ -79,11 +79,19 @@ @StripPostfix("params") void glGetQueryivARB(@GLenum int target, @GLenum int pname, @OutParameter @Check("1") IntBuffer params); + /** @deprecated Will be removed in 3.0. Use {@link #glGetQueryiARB} instead. */ @Alternate("glGetQueryivARB") @GLreturn("params") - @StripPostfix(value = "params", postfix = "v") + @StripPostfix("params") + @Reuse(value = "ARBOcclusionQuery", method = "glGetQueryiARB") + @Deprecated void glGetQueryivARB2(@GLenum int target, @GLenum int pname, @OutParameter IntBuffer params); + @Alternate("glGetQueryivARB") + @GLreturn("params") + @StripPostfix(value = "params", postfix = "v") + void glGetQueryivARB3(@GLenum int target, @GLenum int pname, @OutParameter IntBuffer params); + @StripPostfix("params") void glGetQueryObjectivARB(@GLuint int id, @GLenum int pname, @OutParameter @Check("1") IntBuffer params); Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_program.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_program.java 2012-08-18 14:00:45 UTC (rev 3787) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_program.java 2012-08-19 06:56:25 UTC (rev 3788) @@ -171,11 +171,19 @@ @StripPostfix("params") void glGetProgramivARB(@GLenum int target, @GLenum int parameterName, @OutParameter @Check("4") IntBuffer params); + /** @deprecated Will be removed in 3.0. Use {@link #glGetProgramiARB} instead. */ @Alternate("glGetProgramivARB") @GLreturn("params") - @StripPostfix(value = "params", postfix = "v") + @StripPostfix("params") + @Reuse(value = "ARBProgram", method = "glGetProgramiARB") + @Deprecated void glGetProgramivARB2(@GLenum int target, @GLenum int parameterName, @OutParameter IntBuffer params); + @Alternate("glGetProgramivARB") + @GLreturn("params") + @StripPostfix(value = "params", postfix = "v") + void glGetProgramivARB3(@GLenum int target, @GLenum int parameterName, @OutParameter IntBuffer params); + void glGetProgramStringARB(@GLenum int target, @GLenum int parameterName, @OutParameter @Check @GLbyte Buffer paramString); @Alternate("glGetProgramStringARB") Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_sync.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_sync.java 2012-08-18 14:00:45 UTC (rev 3787) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_sync.java 2012-08-19 06:56:25 UTC (rev 3788) @@ -106,11 +106,21 @@ @OutParameter @GLsizei @Check(value = "1", canBeNull = true) IntBuffer length, @OutParameter IntBuffer values); + /** @deprecated Will be removed in 3.0. Use {@link #glGetSynci} instead. */ + @Alternate("glGetSynciv") + @GLreturn("values") + @StripPostfix("values") + @Reuse(value = "GL32", method = "glGetSynci") + @Deprecated + void glGetSynciv2(@PointerWrapper("GLsync") GLSync sync, @GLenum int pname, @Constant("1") @GLsizei int bufSize, + @OutParameter @GLsizei @Constant("0L") IntBuffer length, + @OutParameter IntBuffer values); + @Reuse("GL32") @Alternate("glGetSynciv") @GLreturn("values") @StripPostfix(value = "values", postfix = "v") - void glGetSynciv2(@PointerWrapper("GLsync") GLSync sync, @GLenum int pname, @Constant("1") @GLsizei int bufSize, + void glGetSynciv3(@PointerWrapper("GLsync") GLSync sync, @GLenum int pname, @Constant("1") @GLsizei int bufSize, @OutParameter @GLsizei @Constant("0L") IntBuffer length, @OutParameter IntBuffer values); } \ No newline at end of file Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_uniform_buffer_object.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_uniform_buffer_object.java 2012-08-18 14:00:45 UTC (rev 3787) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_uniform_buffer_object.java 2012-08-19 06:56:25 UTC (rev 3788) @@ -118,16 +118,27 @@ @GLenum int pname, @OutParameter @Check("uniformIndices.remaining()") @GLint IntBuffer params); - @Reuse("GL31") + /** @deprecated Will be removed in 3.0. Use {@link #glGetActiveUniformsi} instead. */ @Alternate("glGetActiveUniformsiv") @GLreturn("params") - @StripPostfix(value = "params", postfix = "v") + @StripPostfix("params") + @Reuse(value = "GL31", method = "glGetActiveUniformsi") + @Deprecated void glGetActiveUniformsiv(@GLuint int program, @Constant("1") @GLsizei int uniformCount, @Constant(value = "params.put(1, uniformIndex), 1", keepParam = true) int uniformIndex, // Reuse params buffer @GLenum int pname, @OutParameter @GLint IntBuffer params); @Reuse("GL31") + @Alternate("glGetActiveUniformsiv") + @GLreturn("params") + @StripPostfix(value = "params", postfix = "v") + void glGetActiveUniformsiv2(@GLuint int program, @Constant("1") @GLsizei int uniformCount, + @Constant(value = "params.put(1, uniformIndex), 1", keepParam = true) int uniformIndex, // Reuse params buffer + @GLenum int pname, + @OutParameter @GLint IntBuffer params); + + @Reuse("GL31") void glGetActiveUniformName(@GLuint int program, @GLuint int uniformIndex, @AutoSize("uniformName") @GLsizei int bufSize, @OutParameter @GLsizei @Check(value = "1", canBeNull = true) IntBuffer length, @OutParameter @GLchar ByteBuffer uniformName); @@ -153,11 +164,20 @@ void glGetActiveUniformBlockiv(@GLuint int program, @GLuint int uniformBlockIndex, @GLenum int pname, @OutParameter @Check(value = "16") @GLint IntBuffer params); + /** @deprecated Will be removed in 3.0. Use {@link #glGetActiveUniformBlocki} instead. */ + @Alternate("glGetActiveUniformBlockiv") + @GLreturn("params") + @StripPostfix("params") + @Reuse(value = "GL31", method = "glGetActiveUniformBlocki") + @Deprecated + void glGetActiveUniformBlockiv2(@GLuint int program, @GLuint int uniformBlockIndex, @GLenum int pname, + @OutParameter @GLint IntBuffer params); + @Reuse("GL31") @Alternate("glGetActiveUniformBlockiv") @GLreturn("params") @StripPostfix(value = "params", postfix = "v") - void glGetActiveUniformBlockiv2(@GLuint int program, @GLuint int uniformBlockIndex, @GLenum int pname, + void glGetActiveUniformBlockiv3(@GLuint int program, @GLuint int uniformBlockIndex, @GLenum int pname, @OutParameter @GLint IntBuffer params); @Reuse("GL31") Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_framebuffer_object.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_framebuffer_object.java 2012-08-18 14:00:45 UTC (rev 3787) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_framebuffer_object.java 2012-08-19 06:56:25 UTC (rev 3788) @@ -149,11 +149,19 @@ @StripPostfix("params") void glGetRenderbufferParameterivEXT(@GLenum int target, @GLenum int pname, @OutParameter @Check("4") IntBuffer params); + /** @deprecated Will be removed in 3.0. Use {@link #glGetRenderbufferParameteriEXT} instead. */ @Alternate("glGetRenderbufferParameterivEXT") @GLreturn("params") - @StripPostfix(value = "params", postfix = "v") + @StripPostfix("params") + @Reuse(value = "EXTFramebufferObject", method = "glGetRenderbufferParameteriEXT") + @Deprecated void glGetRenderbufferParameterivEXT2(@GLenum int target, @GLenum int pname, @OutParameter IntBuffer params); + @Alternate("glGetRenderbufferParameterivEXT") + @GLreturn("params") + @StripPostfix(value = "params", postfix = "v") + void glGetRenderbufferParameterivEXT3(@GLenum int target, @GLenum int pname, @OutParameter IntBuffer params); + boolean glIsFramebufferEXT(@GLuint int framebuffer); void glBindFramebufferEXT(@GLenum int target, @GLuint int framebuffer); @@ -183,10 +191,18 @@ @StripPostfix("params") void glGetFramebufferAttachmentParameterivEXT(@GLenum int target, @GLenum int attachment, @GLenum int pname, @OutParameter @Check("4") IntBuffer params); + /** @deprecated Will be removed in 3.0. Use {@link #glGetFramebufferAttachmentParameteriEXT} instead. */ @Alternate("glGetFramebufferAttachmentParameterivEXT") @GLreturn("params") - @StripPostfix(value = "params", postfix = "v") + @StripPostfix("params") + @Reuse(value = "EXTFramebufferObject", method = "glGetFramebufferAttachmentParameteriEXT") + @Deprecated void glGetFramebufferAttachmentParameterivEXT2(@GLenum int target, @GLenum int attachment, @GLenum int pname, @OutParameter IntBuffer params); + @Alternate("glGetFramebufferAttachmentParameterivEXT") + @GLreturn("params") + @StripPostfix(value = "params", postfix = "v") + void glGetFramebufferAttachmentParameterivEXT3(@GLenum int target, @GLenum int attachment, @GLenum int pname, @OutParameter IntBuffer params); + void glGenerateMipmapEXT(@GLenum int target); } Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/GL15.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/GL15.java 2012-08-18 14:00:45 UTC (rev 3787) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/GL15.java 2012-08-19 06:56:25 UTC (rev 3788) @@ -32,7 +32,6 @@ package org.lwjgl.opengl; import org.lwjgl.util.generator.*; -import org.lwjgl.util.generator.Alternate; import org.lwjgl.util.generator.opengl.*; import java.nio.Buffer; @@ -167,11 +166,19 @@ @StripPostfix("params") void glGetBufferParameteriv(@GLenum int target, @GLenum int pname, @OutParameter @Check("4") IntBuffer params); + /** @deprecated Will be removed in 3.0. Use {@link #glGetBufferParameteri} instead. */ @Alternate("glGetBufferParameteriv") @GLreturn("params") - @StripPostfix(value = "params", postfix = "v") + @StripPostfix("params") + @Reuse(value = "GL15", method = "glGetBufferParameteri") + @Deprecated void glGetBufferParameteriv2(@GLenum int target, @GLenum int pname, @OutParameter IntBuffer params); + @Alternate("glGetBufferParameteriv") + @GLreturn("params") + @StripPostfix(value = "params", postfix = "v") + void glGetBufferParameteriv3(@GLenum int target, @GLenum int pname, @OutParameter IntBuffer params); + @StripPostfix("pointer") @AutoSize("GLChecks.getBufferObjectSize(caps, target)") void glGetBufferPointerv(@GLenum int target, @GLenum int pname, @OutParameter @Result @GLvoid ByteBuffer pointer); @@ -217,11 +224,19 @@ @StripPostfix("params") void glGetQueryiv(@GLenum int target, @GLenum int pname, @OutParameter @Check("1") IntBuffer params); + /** @deprecated Will be removed in 3.0. Use {@link #glGetQueryi} instead. */ @Alternate("glGetQueryiv") @GLreturn("params") - @StripPostfix(value = "params", postfix = "v") + @StripPostfix("params") + @Reuse(value = "GL15", method = "glGetQueryi") + @Deprecated void glGetQueryiv2(@GLenum int target, @GLenum int pname, @OutParameter IntBuffer params); + @Alternate("glGetQueryiv") + @GLreturn("params") + @StripPostfix(value = "params", postfix = "v") + void glGetQueryiv3(@GLenum int target, @GLenum int pname, @OutParameter IntBuffer params); + @StripPostfix("params") void glGetQueryObjectiv(@GLenum int id, @GLenum int pname, @OutParameter @Check("1") @GLint IntBuffer params); Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/GL20.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/GL20.java 2012-08-18 14:00:45 UTC (rev 3787) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/GL20.java 2012-08-19 06:56:25 UTC (rev 3788) @@ -189,19 +189,35 @@ @StripPostfix("params") void glGetShaderiv(@GLuint int shader, @GLenum int pname, @OutParameter @Check IntBuffer params); + /** @deprecated Will be removed in 3.0. Use {@link #glGetShaderi} instead. */ @Alternate("glGetShaderiv") @GLreturn("params") - @StripPostfix(value = "params", postfix = "v") + @StripPostfix("params") + @Reuse(value = "GL20", method = "glGetShaderi") + @Deprecated void glGetShaderiv2(@GLuint int shader, @GLenum int pname, @OutParameter IntBuffer params); + @Alternate("glGetShaderiv") + @GLreturn("params") + @StripPostfix(value = "params", postfix = "v") + void glGetShaderiv3(@GLuint int shader, @GLenum int pname, @OutParameter IntBuffer params); + @StripPostfix("params") void glGetProgramiv(@GLuint int program, @GLenum int pname, @OutParameter @Check IntBuffer params); + /** @deprecated Will be removed in 3.0. Use {@link #glGetProgrami} instead. */ @Alternate("glGetProgramiv") @GLreturn("params") - @StripPostfix(value = "params", postfix = "v") + @StripPostfix("params") + @Reuse(value = "GL20", method = "glGetProgrami") + @Deprecated void glGetProgramiv2(@GLuint int program, @GLenum int pname, @OutParameter IntBuffer params); + @Alternate("glGetProgramiv") + @GLreturn("params") + @StripPostfix(value = "params", postfix = "v") + void glGetProgramiv3(@GLuint int program, @GLenum int pname, @OutParameter IntBuffer params); + void glGetShaderInfoLog(@GLuint int shader, @AutoSize("infoLog") @GLsizei int maxLength, @OutParameter @GLsizei @Check(value = "1", canBeNull = true) IntBuffer length, @OutParameter @GLchar ByteBuffer infoLog); Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/GL30.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/GL30.java 2012-08-18 14:00:45 UTC (rev 3787) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/GL30.java 2012-08-19 06:56:25 UTC (rev 3788) @@ -541,11 +541,19 @@ @StripPostfix("params") void glGetRenderbufferParameteriv(@GLenum int target, @GLenum int pname, @OutParameter @Check("4") IntBuffer params); + /** @deprecated Will be removed in 3.0. Use {@link #glGetRenderbufferParameteri} instead. */ @Alternate("glGetRenderbufferParameteriv") @GLreturn("params") - @StripPostfix(value = "params", postfix = "v") + @StripPostfix("params") + @Reuse(value = "GL30", method = "glGetRenderbufferParameteri") + @Deprecated void glGetRenderbufferParameteriv2(@GLenum int target, @GLenum int pname, @OutParameter IntBuffer params); + @Alternate("glGetRenderbufferParameteriv") + @GLreturn("params") + @StripPostfix(value = "params", postfix = "v") + void glGetRenderbufferParameteriv3(@GLenum int target, @GLenum int pname, @OutParameter IntBuffer params); + boolean glIsFramebuffer(@GLuint int framebuffer); void glBindFramebuffer(@GLenum int target, @GLuint int framebuffer); @@ -575,11 +583,19 @@ @StripPostfix("params") void glGetFramebufferAttachmentParameteriv(@GLenum int target, @GLenum int attachment, @GLenum int pname, @OutParameter @Check("4") IntBuffer params); + /** @deprecated Will be removed in 3.0. Use {@link #glGetFramebufferAttachmentParameteri} instead. */ @Alternate("glGetFramebufferAttachmentParameteriv") @GLreturn("params") - @StripPostfix(value = "params", postfix = "v") + @StripPostfix("params") + @Reuse(value = "GL30", method = "glGetFramebufferAttachmentParameteri") + @Deprecated void glGetFramebufferAttachmentParameteriv2(@GLenum int target, @GLenum int attachment, @GLenum int pname, @OutParameter IntBuffer params); + @Alternate("glGetFramebufferAttachmentParameteriv") + @GLreturn("params") + @StripPostfix(value = "params", postfix = "v") + void glGetFramebufferAttachmentParameteriv3(@GLenum int target, @GLenum int attachment, @GLenum int pname, @OutParameter IntBuffer params); + void glGenerateMipmap(@GLenum int target); // -------------------------------------------------------------------------------------------- Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/GL31.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/GL31.java 2012-08-18 14:00:45 UTC (rev 3787) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/GL31.java 2012-08-19 06:56:25 UTC (rev 3788) @@ -251,14 +251,25 @@ @GLenum int pname, @OutParameter @Check("uniformIndices.remaining()") @GLint IntBuffer params); + /** @deprecated Will be removed in 3.0. Use {@link #glGetActiveUniformsi} instead. */ @Alternate("glGetActiveUniformsiv") @GLreturn("params") - @StripPostfix(value = "params", postfix = "v") + @StripPostfix("params") + @Reuse(value = "GL31", method = "glGetActiveUniformsi") + @Deprecated void glGetActiveUniformsiv(@GLuint int program, @Constant("1") @GLsizei int uniformCount, @Constant(value = "MemoryUtil.getAddress(params.put(1, uniformIndex), 1)", keepParam = true) int uniformIndex, // Reuse params buffer @GLenum int pname, @OutParameter @GLint IntBuffer params); + @Alternate("glGetActiveUniformsiv") + @GLreturn("params") + @StripPostfix(value = "params", postfix = "v") + void glGetActiveUniformsiv2(@GLuint int program, @Constant("1") @GLsizei int uniformCount, + @Constant(value = "MemoryUtil.getAddress(params.put(1, uniformIndex), 1)", keepParam = true) int uniformIndex, // Reuse params buffer + @GLenum int pname, + @OutParameter @GLint IntBuffer params); + void glGetActiveUniformName(@GLuint int program, @GLuint int uniformIndex, @AutoSize("uniformName") @GLsizei int bufSize, @OutParameter @GLsizei @Check(value = "1", canBeNull = true) IntBuffer length, @OutParameter @GLchar ByteBuffer uniformName); @@ -280,12 +291,21 @@ void glGetActiveUniformBlockiv(@GLuint int program, @GLuint int uniformBlockIndex, @GLenum int pname, @OutParameter @Check(value = "16") @GLint IntBuffer params); + /** @deprecated Will be removed in 3.0. Use {@link #glGetActiveUniformBlocki} instead. */ @Alternate("glGetActiveUniformBlockiv") @GLreturn("params") - @StripPostfix(value = "params", postfix = "v") + @StripPostfix("params") + @Reuse(value = "GL31", method = "glGetActiveUniformBlocki") + @Deprecated void glGetActiveUniformBlockiv2(@GLuint int program, @GLuint int uniformBlockIndex, @GLenum int pname, @OutParameter @GLint IntBuffer params); + @Alternate("glGetActiveUniformBlockiv") + @GLreturn("params") + @StripPostfix(value = "params", postfix = "v") + void glGetActiveUniformBlockiv3(@GLuint int program, @GLuint int uniformBlockIndex, @GLenum int pname, + @OutParameter @GLint IntBuffer params); + void glGetActiveUniformBlockName(@GLuint int program, @GLuint int uniformBlockIndex, @AutoSize("uniformBlockName") @GLsizei int bufSize, @OutParameter @GLsizei @Check(value = "1", canBeNull = true) IntBuffer length, @OutParameter @GLchar ByteBuffer uniformBlockName); Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/GL32.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/GL32.java 2012-08-18 14:00:45 UTC (rev 3787) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/GL32.java 2012-08-19 06:56:25 UTC (rev 3788) @@ -57,11 +57,19 @@ @StripPostfix("params") void glGetBufferParameteri64v(@GLenum int target, @GLenum int pname, @OutParameter @Check("4") LongBuffer params); + /** @deprecated Will be removed in 3.0. Use {@link #glGetBufferParameteri64} instead. */ @Alternate("glGetBufferParameteri64v") @GLreturn("params") - @StripPostfix(value = "params", postfix = "v") + @StripPostfix("params") + @Reuse(value = "GL32", method = "glGetBufferParameteri64") + @Deprecated void glGetBufferParameteri64v2(@GLenum int target, @GLenum int pname, @OutParameter LongBuffer params); + @Alternate("glGetBufferParameteri64v") + @GLreturn("params") + @StripPostfix(value = "params", postfix = "v") + void glGetBufferParameteri64v3(@GLenum int target, @GLenum int pname, @OutParameter LongBuffer params); + // --------------------------------------------------------------------- // ----------------------[ ARB_vertex_array_bgra ]---------------------- // --------------------------------------------------------------------- @@ -336,10 +344,20 @@ @OutParameter @GLsizei @Check(value = "1", canBeNull = true) IntBuffer length, @OutParameter IntBuffer values); + /** @deprecated Will be removed in 3.0. Use {@link #glGetSynci} instead. */ @Alternate("glGetSynciv") @GLreturn("values") - @StripPostfix(value = "values", postfix = "v") + @StripPostfix("values") + @Reuse(value = "GL32", method = "glGetSynci") + @Deprecated void glGetSynciv2(@PointerWrapper("GLsync") GLSync sync, @GLenum int pname, @Constant("1") @GLsizei int bufSize, @OutParameter @GLsizei @Constant("0L") IntBuffer length, @OutParameter IntBuffer values); + + @Alternate("glGetSynciv") + @GLreturn("values") + @StripPostfix(value = "values", postfix = "v") + void glGetSynciv3(@PointerWrapper("GLsync") GLSync sync, @GLenum int pname, @Constant("1") @GLsizei int bufSize, + @OutParameter @GLsizei @Constant("0L") IntBuffer length, + @OutParameter IntBuffer values); } \ No newline at end of file Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/GL33.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/GL33.java 2012-08-18 14:00:45 UTC (rev 3787) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/GL33.java 2012-08-19 06:56:25 UTC (rev 3788) @@ -209,19 +209,35 @@ @StripPostfix("params") void glGetQueryObjecti64v(@GLuint int id, @GLenum int pname, @OutParameter @Check("1") @GLint64 LongBuffer params); + /** @deprecated Will be removed in 3.0. Use {@link #glGetQueryObjecti64} instead. */ @Alternate("glGetQueryObjecti64v") @GLreturn("params") - @StripPostfix(value = "params", postfix = "v") + @StripPostfix("params") + @Reuse(value = "GL33", method = "glGetQueryObjecti64") + @Deprecated void glGetQueryObjecti64v2(@GLuint int id, @GLenum int pname, @OutParameter @GLint64 LongBuffer params); + @Alternate("glGetQueryObjecti64v") + @GLreturn("params") + @StripPostfix(value = "params", postfix = "v") + void glGetQueryObjecti64v3(@GLuint int id, @GLenum int pname, @OutParameter @GLint64 LongBuffer params); + @StripPostfix("params") void glGetQueryObjectui64v(@GLuint int id, @GLenum int pname, @OutParameter @Check("1") @GLuint64 LongBuffer params); + /** @deprecated Will be removed in 3.0. Use {@link #glGetQueryObjectui64} instead. */ @Alternate("glGetQueryObjectui64v") @GLreturn("params") - @StripPostfix(value = "params", postfix = "v") + @StripPostfix("params") + @Reuse(value = "GL33", method = "glGetQueryObjectui64") + @Deprecated void glGetQueryObjectui64v2(@GLuint int id, @GLenum int pname, @OutParameter @GLuint64 LongBuffer params); + @Alternate("glGetQueryObjectui64v") + @GLreturn("params") + @StripPostfix(value = "params", postfix = "v") + void glGetQueryObjectui64v3(@GLuint int id, @GLenum int pname, @OutParameter @GLuint64 LongBuffer params); + // -------------------------------------------------------------------- // ----------------------[ ARB_instanced_arrays ]---------------------- // -------------------------------------------------------------------- Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/GL40.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/GL40.java 2012-08-18 14:00:45 UTC (rev 3787) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/GL40.java 2012-08-19 06:56:25 UTC (rev 3788) @@ -225,12 +225,21 @@ void glGetActiveSubroutineUniformiv(@GLuint int program, @GLenum int shadertype, @GLuint int index, @GLenum int pname, @OutParameter @Check("1") IntBuffer values); + /** @deprecated Will be removed in 3.0. Use {@link #glGetActiveSubroutineUniformi} instead. */ @Alternate("glGetActiveSubroutineUniformiv") @GLreturn("values") - @StripPostfix(value = "values", postfix = "v") + @StripPostfix("values") + @Reuse(value = "GL40", method = "glGetActiveSubroutineUniformi") + @Deprecated void glGetActiveSubroutineUniformiv2(@GLuint int program, @GLenum int shadertype, @GLuint int index, @GLenum int pname, @OutParameter IntBuffer values); + @Alternate("glGetActiveSubroutineUniformiv") + @GLreturn("values") + @StripPostfix(value = "values", postfix = "v") + void glGetActiveSubroutineUniformiv3(@GLuint int program, @GLenum int shadertype, @GLuint int index, @GLenum int pname, + @OutParameter IntBuffer values); + void glGetActiveSubroutineUniformName(@GLuint int program, @GLenum int shadertype, @GLuint int index, @AutoSize("name") @GLsizei int bufsize, @OutParameter @Check(value = "1", canBeNull = true) @GLsizei IntBuffer length, @OutParameter @GLchar ByteBuffer name); @@ -257,19 +266,35 @@ @StripPostfix("params") void glGetUniformSubroutineuiv(@GLenum int shadertype, int location, @Check("1") @OutParameter @GLuint IntBuffer params); + /** @deprecated Will be removed in 3.0. Use {@link #glGetUniformSubroutineui} instead. */ @Alternate("glGetUniformSubroutineuiv") @GLreturn("params") - @StripPostfix(value = "params", postfix = "v") + @StripPostfix("params") + @Reuse(value = "GL40", method = "glGetUniformSubroutineui") + @Deprecated void glGetUniformSubroutineuiv2(@GLenum int shadertype, int location, @OutParameter @GLuint IntBuffer params); + @Alternate("glGetUniformSubroutineuiv") + @GLreturn("params") + @StripPostfix(value = "params", postfix = "v") + void glGetUniformSubroutineuiv3(@GLenum int shadertype, int location, @OutParameter @GLuint IntBuffer params); + @StripPostfix("values") void glGetProgramStageiv(@GLuint int program, @GLenum int shadertype, @GLenum int pname, @Check("1") @OutParameter IntBuffer values); + /** @deprecated Will be removed in 3.0. Use {@link #glGetProgramStagei} instead. */ @Alternate("glGetProgramStageiv") @GLreturn("values") - @StripPostfix(value = "values", postfix = "v") + @StripPostfix("values") + @Reuse(value = "GL40", method = "glGetProgramStagei") + @Deprecated void glGetProgramStageiv2(@GLuint int program, @GLenum int shadertype, @GLenum int pname, @OutParameter IntBuffer values); + @Alternate("glGetProgramStageiv") + @GLreturn("values") + @StripPostfix(value = "values", postfix = "v") + void glGetProgramStageiv3(@GLuint int program, @GLenum int shadertype, @GLenum int pname, @OutParameter IntBuffer values); + // ----------------------------------------------------------------------- // ----------------------[ ARB_tessellation_shader ]---------------------- // ----------------------------------------------------------------------- @@ -446,9 +471,17 @@ @StripPostfix("params") void glGetQueryIndexediv(@GLenum int target, @GLuint int index, @GLenum int pname, @OutParameter @Check("1") IntBuffer params); + /** @deprecated Will be removed in 3.0. Use {@link #glGetQueryIndexedi} instead. */ @Alternate("glGetQueryIndexediv") @GLreturn("params") - @StripPostfix(value = "params", postfix = "v") + @StripPostfix("params") + @Reuse(value = "GL40", method = "glGetQueryIndexedi") + @Deprecated void glGetQueryIndexediv2(@GLenum int target, @GLuint int index, @GLenum int pname, @OutParameter IntBuffer params); + @Alternate("glGetQueryIndexediv") + @GLreturn("params") + @StripPostfix(value = "params", postfix = "v") + void glGetQueryIndexediv3(@GLenum int target, @GLuint int index, @GLenum int pname, @OutParameter IntBuffer params); + } \ No newline at end of file Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_program.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_program.java 2012-08-18 14:00:45 UTC (rev 3787) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_program.java 2012-08-19 06:56:25 UTC (rev 3788) @@ -80,11 +80,19 @@ @StripPostfix("params") void glGetProgramivNV(@GLuint int programID, @GLenum int parameterName, @OutParameter @Check @GLint IntBuffer params); + /** @deprecated Will be removed in 3.0. Use {@link #glGetProgramiNV} instead. */ @Alternate("glGetProgramivNV") @GLreturn("params") - @StripPostfix(value = "params", postfix = "v") + @StripPostfix("params") + @Reuse(value = "NVProgram", method = "glGetProgramiNV") + @Deprecated void glGetProgramivNV2(@GLuint int programID, @GLenum int parameterName, @OutParameter @GLint IntBuffer params); + @Alternate("glGetProgramivNV") + @GLreturn("params") + @StripPostfix(value = "params", postfix = "v") + void glGetProgramivNV3(@GLuint int programID, @GLenum int parameterName, @OutParameter @GLint IntBuffer params); + void glGetProgramStringNV(@GLuint int programID, @GLenum int parameterName, @OutParameter @Check @GLubyte Buffer paramString); @Alternate("glGetProgramStringNV") Modified: trunk/LWJGL/src/templates/org/lwjgl/opengles/GLES20.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengles/GLES20.java 2012-08-18 14:00:45 UTC (rev 3787) +++ trunk/LWJGL/src/templates/org/lwjgl/opengles/GLES20.java 2012-08-19 06:56:25 UTC (rev 3788) @@ -699,11 +699,19 @@ @StripPostfix("params") void glGetBufferParameteriv(@GLenum int target, @GLenum int pname, @OutParameter @Check("1") IntBuffer params); + /** @deprecated Will be removed in 3.0. Use {@link #glGetBufferParameteri} instead. */ @Alternate("glGetBufferParameteriv") @GLreturn("params") - @StripPostfix(value = "params", postfix = "v") + @StripPostfix("params") + @Reuse(value = "GLES20", method = "glGetBufferParameteri") + @Deprecated void glGetBufferParameteriv2(@GLenum int target, @GLenum int pname, @OutParameter IntBuffer params); + @Alternate("glGetBufferParameteriv") + @GLreturn("params") + @StripPostfix(value = "params", postfix = "v") + void glGetBufferParameteriv3(@GLenum int target, @GLenum int pname, @OutParameter IntBuffer params); + @NoErrorCheck @GLenum int glGetError(); @@ -719,11 +727,19 @@ @StripPostfix("params") void glGetFramebufferAttachmentParameteriv(@GLenum int target, @GLenum int attachment, @GLenum int pname, @OutParameter @Check("1") IntBuffer params); + /** @deprecated Will be removed in 3.0. Use {@link #glGetFramebufferAttachmentParameteri} instead. */ @Alternate("glGetFramebufferAttachmentParameteriv") @GLreturn("params") - @StripPostfix(value = "params", postfix = "v") + @StripPostfix("params") + @Reuse(value = "GLES20", method = "glGetFramebufferAttachmentParameteri") + @Deprecated void glGetFramebufferAttachmentParameteriv2(@GLenum int target, @GLenum int attachment, @GLenum int pname, @OutParameter IntBuffer params); + @Alternate("glGetFramebufferAttachmentParameteriv") + @GLreturn("params") + @StripPostfix(value = "params", postfix = "v") + void glGetFramebufferAttachmentParameteriv3(@GLenum int target, @GLenum int attachment, @GLenum int pname, @OutParameter IntBuffer params); + @StripPostfix("params") void glGetIntegerv(@GLenum int pname, @OutParameter @Check("1") IntBuffer params); @@ -735,11 +751,19 @@ @StripPostfix("params") void glGetProgramiv(@GLuint int program, @GLenum int pname, @OutParameter @Check("1") IntBuffer params); + /** @deprecated Will be removed in 3.0. Use {@link #glGetProgrami} instead. */ @Alternate("glGetProgramiv") @GLreturn("params") - @StripPostfix(value = "params", postfix = "v") + @StripPostfix("params") + @Reuse(value = "GLES20", method = "glGetProgrami") + @Deprecated void glGetProgramiv2(@GLuint int program, @GLenum int pname, @OutParameter IntBuffer params); + @Alternate("glGetProgramiv") + @GLreturn("params") + @StripPostfix(value = "params", postfix = "v") + void glGetProgramiv3(@GLuint int program, @GLenum int pname, @OutParameter IntBuffer params); + void glGetProgramInfoLog(@GLuint int program, @AutoSize("infoLog") @GLsizei int bufsize, @OutParameter @Check(value = "1", canBeNull = true) @GLsizei IntBuffer length, @OutParameter @GLchar ByteBuffer infoLog); @@ -753,19 +777,35 @@ @StripPostfix("params") void glGetRenderbufferParameteriv(@GLenum int target, @GLenum int pname, @OutParameter @Check("1") IntBuffer params); + /** @deprecated Will be removed in 3.0. Use {@link #glGetRenderbufferParameteri} instead. */ @Alternate("glGetRenderbufferParameteriv") @GLreturn("params") - @StripPostfix(value = "params", postfix = "v") + @StripPostfix("params") + @Reuse(value = "GLES20", method = "glGetRenderbufferParameteri") + @Deprecated void glGetRenderbufferParameteriv2(@GLenum int target, @GLenum int pname, @OutParameter IntBuffer params); + @Alternate("glGetRenderbufferParameteriv") + @GLreturn("params") + @StripPostfix(value = "params", postfix = "v") + void glGetRenderbufferParameteriv3(@GLenum int target, @GLenum int pname, @OutParameter IntBuffer params); + @StripPostfix("params") void glGetShaderiv(@GLuint int shader, @GLenum int pname, @OutParameter @Check("1") IntBuffer params); + /** @deprecated Will be removed in 3.0. Use {@link #glGetShaderi} instead. */ @Alternate("glGetShaderiv") @GLreturn("params") - @StripPostfix(value = "params", postfix = "v") + @StripPostfix("params") + @Reuse(value = "GLES20", method = "glGetShaderi") + @Deprecated void glGetShaderiv2(@GLuint int shader, @GLenum int pname, @OutParameter IntBuffer params); + @Alternate("glGetShaderiv") + @GLreturn("params") + @StripPostfix(value = "params", postfix = "v") + void glGetShaderiv3(@GLuint int shader, @GLenum int pname, @OutParameter IntBuffer params); + void glGetShaderInfoLog(@GLuint int shader, @AutoSize("infoLog") @GLsizei int bufsize, @OutParameter @Check(value = "1", canBeNull = true) @GLsizei IntBuffer length, @OutParameter @GLchar ByteBuffer infoLog); Modified: trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_framebuffer_object.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_framebuffer_object.java 2012-08-18 14:00:45 UTC (rev 3787) +++ trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_framebuffer_object.java 2012-08-19 06:56:25 UTC (rev 3788) @@ -142,11 +142,19 @@ @StripPostfix("params") void glGetRenderbufferParameterivOES(@GLenum int target, @GLenum int pname, @OutParameter @Check("1") IntBuffer params); + /** @deprecated Will be removed in 3.0. Use {@link #glGetRenderbufferParameteriOES} instead. */ @Alternate("glGetRenderbufferParameterivOES") @GLreturn("params") - @StripPostfix(value = "params", postfix = "v") + @StripPostfix("params") + @Reuse(value = "OESFramebufferObject", method = "glGetRenderbufferParameteriOES") + @Deprecated void glGetRenderbufferParameterivOES2(@GLenum int target, @GLenum int pname, @OutParameter IntBuffer params); + @Alternate("glGetRenderbufferParameterivOES") + @GLreturn("params") + @StripPostfix(value = "params", postfix = "v") + void glGetRenderbufferParameterivOES3(@GLenum int target, @GLenum int pname, @OutParameter IntBuffer params); + boolean glIsFramebufferOES(@GLuint int framebuffer); void glBindFramebufferOES(@GLenum int target, @GLuint int framebuffer); @@ -172,11 +180,19 @@ @StripPostfix("params") void glGetFramebufferAttachmentParameterivOES(@GLenum int target, @GLenum int attachment, @GLenum int pname, @OutParameter @Check("1") IntBuffer params); + /** @deprecated Will be removed in 3.0. Use {@link #glGetFramebufferAttachmentParameteriOES} instead. */ @Alternate("glGetFramebufferAttachmentParameterivOES") @GLreturn("params") - @StripPostfix(value = "params", postfix = "v") + @StripPostfix("params") + @Reuse(value = "OESFramebufferObject", method = "glGetFramebufferAttachmentParameteriOES") + @Deprecated void glGetFramebufferAttachmentParameterivOES2(@GLenum int target, @GLenum int attachment, @GLenum int pname, @OutParameter IntBuffer params); + @Alternate("glGetFramebufferAttachmentParameterivOES") + @GLreturn("params") + @StripPostfix(value = "params", postfix = "v") + void glGetFramebufferAttachmentParameterivOES3(@GLenum int target, @GLenum int attachment, @GLenum int pname, @OutParameter IntBuffer params); + void glGenerateMipmapOES(@GLenum int target); } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sp...@us...> - 2012-08-23 10:36:23
|
Revision: 3789 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3789&view=rev Author: spasi Date: 2012-08-23 10:36:12 +0000 (Thu, 23 Aug 2012) Log Message: ----------- Attempt to fix lost key up events when Display is out of focus. (Windows) Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsKeyboard.java trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsKeyboard.c Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2012-08-19 06:56:25 UTC (rev 3788) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2012-08-23 10:36:12 UTC (rev 3789) @@ -345,6 +345,9 @@ redoMakeContextCurrent = true; if (Display.isFullscreen()) updateClipping(); + + if ( keyboard != null ) + keyboard.fireLostKeyEvents(); } else if (Display.isFullscreen()) { showWindow(getHwnd(), SW_SHOWMINNOACTIVE); resetDisplayMode(); @@ -1045,15 +1048,6 @@ return height; } - private int firstMouseButtonDown() { - for(int i=0; i<Mouse.getButtonCount(); i++) { - if(Mouse.isButtonDown(i)) { - return i; - } - } - return -1; - } - private native boolean nTrackMouseEvent(long hwnd); public boolean isInsideWindow() { Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsKeyboard.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsKeyboard.java 2012-08-19 06:56:25 UTC (rev 3788) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsKeyboard.java 2012-08-23 10:36:12 UTC (rev 3789) @@ -49,8 +49,8 @@ private static final int BUFFER_SIZE = 50; private final long hwnd; - private final ByteBuffer keyboard_state; private final byte[] key_down_buffer = new byte[Keyboard.KEYBOARD_SIZE]; + private final byte[] virt_key_down_buffer = new byte[Keyboard.KEYBOARD_SIZE]; private final EventQueue event_queue = new EventQueue(Keyboard.EVENT_SIZE); private final ByteBuffer tmp_event = ByteBuffer.allocate(Keyboard.EVENT_SIZE); @@ -65,7 +65,6 @@ WindowsKeyboard(long hwnd) throws LWJGLException { this.hwnd = hwnd; - keyboard_state = BufferUtils.createByteBuffer(256); } private static native boolean isWindowsNT(); @@ -99,6 +98,7 @@ private static native int ToAscii(int wVirtKey, int wScanCode, ByteBuffer lpKeyState, ByteBuffer lpChar, int flags); private static native int GetKeyboardState(ByteBuffer lpKeyState); private static native int GetKeyState(int virt_key); + private static native int GetAsyncKeyState(int virt_key); private void putEvent(int keycode, byte state, int ch, long millis, boolean repeat) { tmp_event.clear(); @@ -155,8 +155,10 @@ flushRetained(); has_retained_event = true; int keycode = WindowsKeycodes.mapVirtualKeyToLWJGLCode(virt_key); - if (keycode < key_down_buffer.length) + if (keycode < key_down_buffer.length) { key_down_buffer[keycode] = event_state; + virt_key_down_buffer[virt_key] = event_state; + } retained_key_code = keycode; retained_state = event_state; retained_millis = millis; @@ -164,6 +166,14 @@ retained_repeat = repeat; } + + public void fireLostKeyEvents() { + for ( int i = 0; i < virt_key_down_buffer.length; i++ ) { + if ( (virt_key_down_buffer[i] & 1) == 1 && (GetAsyncKeyState(i) & 1) == 0 ) + handleKey(i, 0, false, (byte)0, System.currentTimeMillis(), false); + } + } + public void handleChar(int event_char, long millis, boolean repeat) { if (has_retained_event && retained_char != 0) flushRetained(); Modified: trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsKeyboard.c =================================================================== --- trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsKeyboard.c 2012-08-19 06:56:25 UTC (rev 3788) +++ trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsKeyboard.c 2012-08-23 10:36:12 UTC (rev 3789) @@ -45,6 +45,10 @@ return GetKeyState(virt_key); } +JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_WindowsKeyboard_GetAsyncKeyState(JNIEnv *env, jclass unused, jint virt_key) { + return GetAsyncKeyState(virt_key); +} + JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_WindowsKeyboard_MapVirtualKey(JNIEnv *env, jclass unused, jint uCode, jint uMapType) { return MapVirtualKey(uCode, uMapType); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sp...@us...> - 2013-01-25 15:39:22
|
Revision: 3838 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3838&view=rev Author: spasi Date: 2013-01-25 15:39:08 +0000 (Fri, 25 Jan 2013) Log Message: ----------- Sync with recent Git changes. Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/AMDDebugOutputCallback.java trunk/LWJGL/src/java/org/lwjgl/opengl/ARBDebugOutputCallback.java trunk/LWJGL/src/java/org/lwjgl/opengl/KHRDebugCallback.java trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsKeyboard.java trunk/LWJGL/src/java/org/lwjgl/test/opengl/VersionTest.java trunk/LWJGL/src/java/org/lwjgl/util/generator/Utils.java trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsKeyboard.c trunk/LWJGL/src/templates/org/lwjgl/opencl/CL10.java trunk/LWJGL/src/templates/org/lwjgl/opencl/CL12.java trunk/LWJGL/src/templates/org/lwjgl/opengl/AMD_multi_draw_indirect.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_ES2_compatibility.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_draw_indirect.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_multi_draw_indirect.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_texture_compression_rgtc.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_texture_storage.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_vertex_attrib_64bit.java trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_direct_state_access.java trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_vertex_attrib_64bit.java trunk/LWJGL/src/templates/org/lwjgl/opengl/GL30.java trunk/LWJGL/src/templates/org/lwjgl/opengl/GL40.java trunk/LWJGL/src/templates/org/lwjgl/opengl/GL41.java trunk/LWJGL/src/templates/org/lwjgl/opengl/GL43.java trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_gpu_shader5.java trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_vertex_attrib_integer_64bit.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/AMDDebugOutputCallback.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/AMDDebugOutputCallback.java 2012-12-19 12:38:50 UTC (rev 3837) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/AMDDebugOutputCallback.java 2013-01-25 15:39:08 UTC (rev 3838) @@ -110,7 +110,7 @@ description = "OTHER"; break; default: - description = "Unknown (" + Integer.toHexString(category) + ")"; + description = printUnknownToken(category); } System.err.println("\tCategory: " + description); @@ -125,12 +125,16 @@ description = "LOW"; break; default: - description = "Unknown (" + Integer.toHexString(category) + ")"; + description = printUnknownToken(severity); } System.err.println("\tSeverity: " + description); System.err.println("\tMessage: " + message); } + + private String printUnknownToken(final int token) { + return "Unknown (0x" + Integer.toHexString(token).toUpperCase() + ")"; + } }); } Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/ARBDebugOutputCallback.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/ARBDebugOutputCallback.java 2012-12-19 12:38:50 UTC (rev 3837) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/ARBDebugOutputCallback.java 2013-01-25 15:39:08 UTC (rev 3838) @@ -113,7 +113,7 @@ description = "OTHER"; break; default: - description = "Unknown (" + Integer.toHexString(source) + ")"; + description = printUnknownToken(source); } System.err.println("\tSource: " + description); @@ -137,7 +137,7 @@ description = "OTHER"; break; default: - description = "Unknown (" + Integer.toHexString(source) + ")"; + description = printUnknownToken(type); } System.err.println("\tType: " + description); @@ -152,12 +152,16 @@ description = "LOW"; break; default: - description = "Unknown (" + Integer.toHexString(source) + ")"; + description = printUnknownToken(severity); } System.err.println("\tSeverity: " + description); System.err.println("\tMessage: " + message); } + + private String printUnknownToken(final int token) { + return "Unknown (0x" + Integer.toHexString(token).toUpperCase() + ")"; + } }); } @@ -184,9 +188,9 @@ /** * This method will be called when an ARB_debug_output message is generated. * - * @param id the message ID * @param source the message source * @param type the message type + * @param id the message ID * @param severity the message severity * @param message the string representation of the message. */ Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/KHRDebugCallback.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/KHRDebugCallback.java 2012-12-19 12:38:50 UTC (rev 3837) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/KHRDebugCallback.java 2013-01-25 15:39:08 UTC (rev 3838) @@ -115,7 +115,7 @@ description = "OTHER"; break; default: - description = "Unknown (" + Integer.toHexString(source) + ")"; + description = printUnknownToken(source); } System.err.println("\tSource: " + description); @@ -142,7 +142,7 @@ description = "MARKER"; break; default: - description = "Unknown (" + Integer.toHexString(source) + ")"; + description = printUnknownToken(type); } System.err.println("\tType: " + description); @@ -160,12 +160,16 @@ description = "NOTIFICATION"; break; default: - description = "Unknown (" + Integer.toHexString(source) + ")"; + description = printUnknownToken(severity); } System.err.println("\tSeverity: " + description); System.err.println("\tMessage: " + message); } + + private String printUnknownToken(final int token) { + return "Unknown (0x" + Integer.toHexString(token).toUpperCase() + ")"; + } }); } Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsKeyboard.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsKeyboard.java 2012-12-19 12:38:50 UTC (rev 3837) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsKeyboard.java 2013-01-25 15:39:08 UTC (rev 3838) @@ -39,7 +39,6 @@ import java.nio.ByteBuffer; import java.nio.CharBuffer; -import org.lwjgl.BufferUtils; import org.lwjgl.LWJGLException; import org.lwjgl.input.Keyboard; @@ -97,8 +96,8 @@ private static native int ToUnicode(int wVirtKey, int wScanCode, ByteBuffer lpKeyState, CharBuffer pwszBuff, int cchBuff, int flags); private static native int ToAscii(int wVirtKey, int wScanCode, ByteBuffer lpKeyState, ByteBuffer lpChar, int flags); private static native int GetKeyboardState(ByteBuffer lpKeyState); - private static native int GetKeyState(int virt_key); - private static native int GetAsyncKeyState(int virt_key); + private static native short GetKeyState(int virt_key); + private static native short GetAsyncKeyState(int virt_key); private void putEvent(int keycode, byte state, int ch, long millis, boolean repeat) { tmp_event.clear(); @@ -154,10 +153,6 @@ return (state & 1) == 1; } - private static boolean isKeyPressedAsync(int state) { - return (state >>> 31) == 1; - } - public void handleKey(int virt_key, int scan_code, boolean extended, byte event_state, long millis, boolean repeat) { virt_key = translateExtended(virt_key, scan_code, event_state, extended); if ( !repeat && isKeyPressed(event_state) == isKeyPressed(virt_key_down_buffer[virt_key]) ) @@ -180,7 +175,7 @@ public void fireLostKeyEvents() { for ( int i = 0; i < virt_key_down_buffer.length; i++ ) { - if ( isKeyPressed(virt_key_down_buffer[i]) && !isKeyPressedAsync(GetAsyncKeyState(i)) ) + if ( isKeyPressed(virt_key_down_buffer[i]) && (GetAsyncKeyState(i) & 0x8000) == 0 ) handleKey(i, 0, false, (byte)0, System.currentTimeMillis(), false); } } Modified: trunk/LWJGL/src/java/org/lwjgl/test/opengl/VersionTest.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/test/opengl/VersionTest.java 2012-12-19 12:38:50 UTC (rev 3837) +++ trunk/LWJGL/src/java/org/lwjgl/test/opengl/VersionTest.java 2013-01-25 15:39:08 UTC (rev 3838) @@ -120,6 +120,7 @@ boolean deprecated = false; try { glVertex3f(0.0f, 0.0f, 0.0f); + Util.checkGLError(); deprecated = true; } catch (Throwable t) {} Modified: trunk/LWJGL/src/java/org/lwjgl/util/generator/Utils.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/generator/Utils.java 2012-12-19 12:38:50 UTC (rev 3837) +++ trunk/LWJGL/src/java/org/lwjgl/util/generator/Utils.java 2013-01-25 15:39:08 UTC (rev 3838) @@ -233,6 +233,10 @@ } public static String getQualifiedNativeMethodName(String qualified_class_name, String method_name) { + // Escape '_' in method name + if ( method_name.indexOf('_') != -1 ) + method_name = method_name.replace("_", "_1"); + return "Java_" + getNativeQualifiedName(qualified_class_name) + "_" + method_name; } Modified: trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsKeyboard.c =================================================================== --- trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsKeyboard.c 2012-12-19 12:38:50 UTC (rev 3837) +++ trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsKeyboard.c 2013-01-25 15:39:08 UTC (rev 3838) @@ -41,11 +41,11 @@ #include <jni.h> #include "org_lwjgl_opengl_WindowsKeyboard.h" -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_WindowsKeyboard_GetKeyState(JNIEnv *env, jclass unused, jint virt_key) { +JNIEXPORT jshort JNICALL Java_org_lwjgl_opengl_WindowsKeyboard_GetKeyState(JNIEnv *env, jclass unused, jint virt_key) { return GetKeyState(virt_key); } -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_WindowsKeyboard_GetAsyncKeyState(JNIEnv *env, jclass unused, jint virt_key) { +JNIEXPORT jshort JNICALL Java_org_lwjgl_opengl_WindowsKeyboard_GetAsyncKeyState(JNIEnv *env, jclass unused, jint virt_key) { return GetAsyncKeyState(virt_key); } Modified: trunk/LWJGL/src/templates/org/lwjgl/opencl/CL10.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opencl/CL10.java 2012-12-19 12:38:50 UTC (rev 3837) +++ trunk/LWJGL/src/templates/org/lwjgl/opencl/CL10.java 2013-01-25 15:39:08 UTC (rev 3838) @@ -1149,11 +1149,11 @@ @Private @PointerWrapper("void *") - CLFunctionAddress clGetExtensionFunctionAddress(@Check("1") @Const @cl_char ByteBuffer func_name); + CLFunctionAddress clGetExtensionFunctionAddress(@NullTerminated @Const @cl_char ByteBuffer func_name); @Alternate("clGetExtensionFunctionAddress") @Private @PointerWrapper("void *") - CLFunctionAddress clGetExtensionFunctionAddress(CharSequence func_name); + CLFunctionAddress clGetExtensionFunctionAddress(@NullTerminated CharSequence func_name); } \ No newline at end of file Modified: trunk/LWJGL/src/templates/org/lwjgl/opencl/CL12.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opencl/CL12.java 2012-12-19 12:38:50 UTC (rev 3837) +++ trunk/LWJGL/src/templates/org/lwjgl/opencl/CL12.java 2013-01-25 15:39:08 UTC (rev 3838) @@ -435,12 +435,12 @@ @Private @PointerWrapper("void *") CLFunctionAddress clGetExtensionFunctionAddressForPlatform(@PointerWrapper("cl_platform_id") CLPlatform platform, - @Check("1") @Const @cl_char ByteBuffer func_name); + @NullTerminated @Const @cl_char ByteBuffer func_name); @Alternate("clGetExtensionFunctionAddressForPlatform") @Private @PointerWrapper("void *") CLFunctionAddress clGetExtensionFunctionAddressForPlatform(@PointerWrapper("cl_platform_id") CLPlatform platform, - CharSequence func_name); + @NullTerminated CharSequence func_name); } \ No newline at end of file Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/AMD_multi_draw_indirect.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/AMD_multi_draw_indirect.java 2012-12-19 12:38:50 UTC (rev 3837) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/AMD_multi_draw_indirect.java 2013-01-25 15:39:08 UTC (rev 3838) @@ -44,26 +44,26 @@ public interface AMD_multi_draw_indirect { void glMultiDrawArraysIndirectAMD(@GLenum int mode, - @BufferObject(BufferKind.IndirectBO) @Check("4 * primcount") @Const @GLvoid ByteBuffer indirect, + @BufferObject(BufferKind.IndirectBO) @Check("(stride == 0 ? 4 * 4 : stride) * primcount") @Const @GLvoid ByteBuffer indirect, @GLsizei int primcount, @GLsizei int stride); @Alternate("glMultiDrawArraysIndirectAMD") void glMultiDrawArraysIndirectAMD(@GLenum int mode, - @BufferObject(BufferKind.IndirectBO) @Check("4 * primcount") @Const @GLvoid(PrimitiveType.Kind.INT) IntBuffer indirect, + @BufferObject(BufferKind.IndirectBO) @Check("(stride == 0 ? 4 : stride >> 2) * primcount") @Const @GLvoid(PrimitiveType.Kind.INT) IntBuffer indirect, @GLsizei int primcount, @GLsizei int stride); void glMultiDrawElementsIndirectAMD(@GLenum int mode, @GLenum int type, - @BufferObject(BufferKind.IndirectBO) @Check("5 * primcount") @Const @GLvoid ByteBuffer indirect, + @BufferObject(BufferKind.IndirectBO) @Check("(stride == 0 ? 5 * 4 : stride) * primcount") @Const @GLvoid ByteBuffer indirect, @GLsizei int primcount, @GLsizei int stride); @Alternate("glMultiDrawElementsIndirectAMD") void glMultiDrawElementsIndirectAMD(@GLenum int mode, @GLenum int type, - @BufferObject(BufferKind.IndirectBO) @Check("5 * primcount") @Const @GLvoid(PrimitiveType.Kind.INT) IntBuffer indirect, + @BufferObject(BufferKind.IndirectBO) @Check("(stride == 0 ? 5 : stride >> 2) * primcount") @Const @GLvoid(PrimitiveType.Kind.INT) IntBuffer indirect, @GLsizei int primcount, @GLsizei int stride); Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_ES2_compatibility.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_ES2_compatibility.java 2012-12-19 12:38:50 UTC (rev 3837) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_ES2_compatibility.java 2013-01-25 15:39:08 UTC (rev 3838) @@ -65,6 +65,9 @@ GL_MEDIUM_INT = 0x8DF4, GL_HIGH_INT = 0x8DF5; + /** Accepted by the <format> parameter of most commands taking sized internal formats: */ + int GL_RGB565 = 0x8D62; + @Reuse("GL41") void glReleaseShaderCompiler(); Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_draw_indirect.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_draw_indirect.java 2012-12-19 12:38:50 UTC (rev 3837) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_draw_indirect.java 2013-01-25 15:39:08 UTC (rev 3838) @@ -58,17 +58,17 @@ int GL_DRAW_INDIRECT_BUFFER_BINDING = 0x8F43; @Reuse("GL40") - void glDrawArraysIndirect(@GLenum int mode, @BufferObject(BufferKind.IndirectBO) @Check("4") @NullTerminated @Const @GLvoid ByteBuffer indirect); + void glDrawArraysIndirect(@GLenum int mode, @BufferObject(BufferKind.IndirectBO) @Check("4 * 4") @Const @GLvoid ByteBuffer indirect); @Reuse("GL40") @Alternate("glDrawArraysIndirect") - void glDrawArraysIndirect(@GLenum int mode, @BufferObject(BufferKind.IndirectBO) @Check("4") @NullTerminated @Const @GLvoid(PrimitiveType.Kind.INT) IntBuffer indirect); + void glDrawArraysIndirect(@GLenum int mode, @BufferObject(BufferKind.IndirectBO) @Check("4") @Const @GLvoid(PrimitiveType.Kind.INT) IntBuffer indirect); @Reuse("GL40") - void glDrawElementsIndirect(@GLenum int mode, @GLenum int type, @BufferObject(BufferKind.IndirectBO) @Check("5") @NullTerminated @Const @GLvoid ByteBuffer indirect); + void glDrawElementsIndirect(@GLenum int mode, @GLenum int type, @BufferObject(BufferKind.IndirectBO) @Check("5 * 4") @Const @GLvoid ByteBuffer indirect); @Reuse("GL40") @Alternate("glDrawElementsIndirect") - void glDrawElementsIndirect(@GLenum int mode, @GLenum int type, @BufferObject(BufferKind.IndirectBO) @Check("5") @NullTerminated @Const @GLvoid(PrimitiveType.Kind.INT) IntBuffer indirect); + void glDrawElementsIndirect(@GLenum int mode, @GLenum int type, @BufferObject(BufferKind.IndirectBO) @Check("5") @Const @GLvoid(PrimitiveType.Kind.INT) IntBuffer indirect); } \ No newline at end of file Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_multi_draw_indirect.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_multi_draw_indirect.java 2012-12-19 12:38:50 UTC (rev 3837) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_multi_draw_indirect.java 2013-01-25 15:39:08 UTC (rev 3838) @@ -45,21 +45,21 @@ @Reuse("GL43") void glMultiDrawArraysIndirect(@GLenum int mode, - @BufferObject(BufferKind.IndirectBO) @Check("4 * 4 * primcount") @Const @GLvoid ByteBuffer indirect, + @BufferObject(BufferKind.IndirectBO) @Check("(stride == 0 ? 4 * 4 : stride) * primcount") @Const @GLvoid ByteBuffer indirect, @GLsizei int primcount, @GLsizei int stride); @Reuse("GL43") @Alternate("glMultiDrawArraysIndirect") void glMultiDrawArraysIndirect(@GLenum int mode, - @BufferObject(BufferKind.IndirectBO) @Check("4 * primcount") @Const @GLvoid(PrimitiveType.Kind.INT) IntBuffer indirect, + @BufferObject(BufferKind.IndirectBO) @Check("(stride == 0 ? 4 : stride >> 2) * primcount") @Const @GLvoid(PrimitiveType.Kind.INT) IntBuffer indirect, @GLsizei int primcount, @GLsizei int stride); @Reuse("GL43") void glMultiDrawElementsIndirect(@GLenum int mode, @GLenum int type, - @BufferObject(BufferKind.IndirectBO) @Check("5 * primcount") @Const @GLvoid ByteBuffer indirect, + @BufferObject(BufferKind.IndirectBO) @Check("(stride == 0 ? 5 * 4 : stride) * primcount") @Const @GLvoid ByteBuffer indirect, @GLsizei int primcount, @GLsizei int stride); @@ -67,7 +67,7 @@ @Alternate("glMultiDrawElementsIndirect") void glMultiDrawElementsIndirect(@GLenum int mode, @GLenum int type, - @BufferObject(BufferKind.IndirectBO) @Check("5 * primcount") @Const @GLvoid(PrimitiveType.Kind.INT) IntBuffer indirect, + @BufferObject(BufferKind.IndirectBO) @Check("(stride == 0 ? 5 : stride >> 2) * primcount") @Const @GLvoid(PrimitiveType.Kind.INT) IntBuffer indirect, @GLsizei int primcount, @GLsizei int stride); Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_texture_compression_rgtc.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_texture_compression_rgtc.java 2012-12-19 12:38:50 UTC (rev 3837) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_texture_compression_rgtc.java 2013-01-25 15:39:08 UTC (rev 3838) @@ -41,9 +41,9 @@ * CopyTexImage2D, and CompressedTexImage2D and the <format> parameter * of CompressedTexSubImage2D: */ - int GL_COMPRESSED_RED_RGTC1 = 0x8DBB; - int GL_COMPRESSED_SIGNED_RED_RGTC1 = 0x8DBC; - int GL_COMPRESSED_RED_GREEN_RGTC2 = 0x8DBD; - int GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2 = 0x8DBE; + int GL_COMPRESSED_RED_RGTC1 = 0x8DBB, + GL_COMPRESSED_SIGNED_RED_RGTC1 = 0x8DBC, + GL_COMPRESSED_RG_RGTC2 = 0x8DBD, + GL_COMPRESSED_SIGNED_RG_RGTC2 = 0x8DBE; } \ No newline at end of file Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_texture_storage.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_texture_storage.java 2012-12-19 12:38:50 UTC (rev 3837) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_texture_storage.java 2013-01-25 15:39:08 UTC (rev 3838) @@ -60,17 +60,17 @@ @GLenum int internalformat, @GLsizei int width, @GLsizei int height, @GLsizei int depth); - @Dependent("EXT_direct_state_access") + @Dependent("GL_EXT_direct_state_access") void glTextureStorage1DEXT(@GLuint int texture, @GLenum int target, @GLsizei int levels, @GLenum int internalformat, @GLsizei int width); - @Dependent("EXT_direct_state_access") + @Dependent("GL_EXT_direct_state_access") void glTextureStorage2DEXT(@GLuint int texture, @GLenum int target, @GLsizei int levels, @GLenum int internalformat, @GLsizei int width, @GLsizei int height); - @Dependent("EXT_direct_state_access") + @Dependent("GL_EXT_direct_state_access") void glTextureStorage3DEXT(@GLuint int texture, @GLenum int target, @GLsizei int levels, @GLenum int internalformat, @GLsizei int width, @GLsizei int height, @GLsizei int depth); Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_vertex_attrib_64bit.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_vertex_attrib_64bit.java 2012-12-19 12:38:50 UTC (rev 3837) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_vertex_attrib_64bit.java 2013-01-25 15:39:08 UTC (rev 3838) @@ -93,7 +93,7 @@ @StripPostfix("params") void glGetVertexAttribLdv(@GLuint int index, @GLenum int pname, @OutParameter @Check("4") DoubleBuffer params); - @Dependent("EXT_direct_state_access") + @Dependent("GL_EXT_direct_state_access") void glVertexArrayVertexAttribLOffsetEXT(@GLuint int vaobj, @GLuint int buffer, @GLuint int index, int size, @GLenum int type, @GLsizei int stride, @GLintptr long offset); } \ No newline at end of file Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_direct_state_access.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_direct_state_access.java 2012-12-19 12:38:50 UTC (rev 3837) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_direct_state_access.java 2013-01-25 15:39:08 UTC (rev 3838) @@ -1353,13 +1353,13 @@ framebuffer" */ - @Dependent("GL_EXT_geometry_shader4,NV_geometry_program4") + @Dependent("GL_EXT_geometry_shader4,GL_NV_geometry_program4") void glNamedFramebufferTextureEXT(@GLuint int framebuffer, @GLenum int attachment, @GLuint int texture, int level); - @Dependent("GL_EXT_geometry_shader4,NV_geometry_program4") + @Dependent("GL_EXT_geometry_shader4,GL_NV_geometry_program4") void glNamedFramebufferTextureLayerEXT(@GLuint int framebuffer, @GLenum int attachment, @GLuint int texture, int level, int layer); - @Dependent("GL_EXT_geometry_shader4,NV_geometry_program4") + @Dependent("GL_EXT_geometry_shader4,GL_NV_geometry_program4") void glNamedFramebufferTextureFaceEXT(@GLuint int framebuffer, @GLenum int attachment, @GLuint int texture, int level, @GLenum int face); /* Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_vertex_attrib_64bit.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_vertex_attrib_64bit.java 2012-12-19 12:38:50 UTC (rev 3837) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_vertex_attrib_64bit.java 2013-01-25 15:39:08 UTC (rev 3838) @@ -83,7 +83,7 @@ void glGetVertexAttribLdvEXT(@GLuint int index, @GLenum int pname, @OutParameter @Check("4") DoubleBuffer params); @Reuse("ARBVertexAttrib64bit") - @Dependent("EXT_direct_state_access") + @Dependent("GL_EXT_direct_state_access") void glVertexArrayVertexAttribLOffsetEXT(@GLuint int vaobj, @GLuint int buffer, @GLuint int index, int size, @GLenum int type, @GLsizei int stride, @GLintptr long offset); } \ No newline at end of file Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/GL30.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/GL30.java 2012-12-19 12:38:50 UTC (rev 3837) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/GL30.java 2013-01-25 15:39:08 UTC (rev 3838) @@ -319,7 +319,7 @@ void glClampColor(@GLenum int target, @GLenum int clamp); // ---------------------------------------------------------------------- - // ----------------------[ NV_depth_buffer_float ]---------------------- + // ----------------------[ ARB_depth_buffer_float ]---------------------- // ---------------------------------------------------------------------- /** @@ -328,8 +328,8 @@ * and returned in the <data> parameter of GetTexLevelParameter and * GetRenderbufferParameterivEXT: */ - int GL_DEPTH_COMPONENT32F = 0x8DAB; - int GL_DEPTH32F_STENCIL8 = 0x8DAC; + int GL_DEPTH_COMPONENT32F = 0x8CAC; + int GL_DEPTH32F_STENCIL8 = 0x8CAD; /** * Accepted by the <type> parameter of DrawPixels, ReadPixels, TexImage1D, @@ -876,10 +876,10 @@ * CopyTexImage2D, and CompressedTexImage2D and the <format> parameter * of CompressedTexSubImage2D: */ - int GL_COMPRESSED_RED_RGTC1 = 0x8DBB; - int GL_COMPRESSED_SIGNED_RED_RGTC1 = 0x8DBC; - int GL_COMPRESSED_RED_GREEN_RGTC2 = 0x8DBD; - int GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2 = 0x8DBE; + int GL_COMPRESSED_RED_RGTC1 = 0x8DBB, + GL_COMPRESSED_SIGNED_RED_RGTC1 = 0x8DBC, + GL_COMPRESSED_RG_RGTC2 = 0x8DBD, + GL_COMPRESSED_SIGNED_RG_RGTC2 = 0x8DBE; // -------------------------------------------------------------- // ----------------------[ ARB_texture_rg ]---------------------- Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/GL40.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/GL40.java 2012-12-19 12:38:50 UTC (rev 3837) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/GL40.java 2013-01-25 15:39:08 UTC (rev 3838) @@ -75,15 +75,15 @@ */ int GL_DRAW_INDIRECT_BUFFER_BINDING = 0x8F43; - void glDrawArraysIndirect(@GLenum int mode, @BufferObject(BufferKind.IndirectBO) @Check("4") @NullTerminated @Const @GLvoid ByteBuffer indirect); + void glDrawArraysIndirect(@GLenum int mode, @BufferObject(BufferKind.IndirectBO) @Check("4 * 4") @Const @GLvoid ByteBuffer indirect); @Alternate("glDrawArraysIndirect") - void glDrawArraysIndirect(@GLenum int mode, @BufferObject(BufferKind.IndirectBO) @Check("4") @NullTerminated @Const @GLvoid(PrimitiveType.Kind.INT) IntBuffer indirect); + void glDrawArraysIndirect(@GLenum int mode, @BufferObject(BufferKind.IndirectBO) @Check("4") @Const @GLvoid(PrimitiveType.Kind.INT) IntBuffer indirect); - void glDrawElementsIndirect(@GLenum int mode, @GLenum int type, @BufferObject(BufferKind.IndirectBO) @Check("5") @NullTerminated @Const @GLvoid ByteBuffer indirect); + void glDrawElementsIndirect(@GLenum int mode, @GLenum int type, @BufferObject(BufferKind.IndirectBO) @Check("5 * 4") @Const @GLvoid ByteBuffer indirect); @Alternate("glDrawElementsIndirect") - void glDrawElementsIndirect(@GLenum int mode, @GLenum int type, @BufferObject(BufferKind.IndirectBO) @Check("5") @NullTerminated @Const @GLvoid(PrimitiveType.Kind.INT) IntBuffer indirect); + void glDrawElementsIndirect(@GLenum int mode, @GLenum int type, @BufferObject(BufferKind.IndirectBO) @Check("5") @Const @GLvoid(PrimitiveType.Kind.INT) IntBuffer indirect); // --------------------------------------------------------------- // ----------------------[ ARB_gpu_shader5 ]---------------------- Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/GL41.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/GL41.java 2012-12-19 12:38:50 UTC (rev 3837) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/GL41.java 2013-01-25 15:39:08 UTC (rev 3838) @@ -68,6 +68,9 @@ GL_MEDIUM_INT = 0x8DF4, GL_HIGH_INT = 0x8DF5; + /** Accepted by the <format> parameter of most commands taking sized internal formats: */ + int GL_RGB565 = 0x8D62; + void glReleaseShaderCompiler(); void glShaderBinary(@AutoSize("shaders") @GLsizei int count, @Const @GLuint IntBuffer shaders, Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/GL43.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/GL43.java 2012-12-19 12:38:50 UTC (rev 3837) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/GL43.java 2013-01-25 15:39:08 UTC (rev 3838) @@ -568,26 +568,26 @@ // ----------------------------------------------------------------------- void glMultiDrawArraysIndirect(@GLenum int mode, - @BufferObject(BufferKind.IndirectBO) @Check("4 * 4 * primcount") @Const @GLvoid ByteBuffer indirect, + @BufferObject(BufferKind.IndirectBO) @Check("(stride == 0 ? 4 * 4 : stride) * primcount") @Const @GLvoid ByteBuffer indirect, @GLsizei int primcount, @GLsizei int stride); @Alternate("glMultiDrawArraysIndirect") void glMultiDrawArraysIndirect(@GLenum int mode, - @BufferObject(BufferKind.IndirectBO) @Check("4 * primcount") @Const @GLvoid(PrimitiveType.Kind.INT) IntBuffer indirect, + @BufferObject(BufferKind.IndirectBO) @Check("(stride == 0 ? 4 : stride >> 2) * primcount") @Const @GLvoid(PrimitiveType.Kind.INT) IntBuffer indirect, @GLsizei int primcount, @GLsizei int stride); void glMultiDrawElementsIndirect(@GLenum int mode, @GLenum int type, - @BufferObject(BufferKind.IndirectBO) @Check("5 * primcount") @Const @GLvoid ByteBuffer indirect, + @BufferObject(BufferKind.IndirectBO) @Check("(stride == 0 ? 5 * 4 : stride) * primcount") @Const @GLvoid ByteBuffer indirect, @GLsizei int primcount, @GLsizei int stride); @Alternate("glMultiDrawElementsIndirect") void glMultiDrawElementsIndirect(@GLenum int mode, @GLenum int type, - @BufferObject(BufferKind.IndirectBO) @Check("5 * primcount") @Const @GLvoid(PrimitiveType.Kind.INT) IntBuffer indirect, + @BufferObject(BufferKind.IndirectBO) @Check("(stride == 0 ? 5 : stride >> 2) * primcount") @Const @GLvoid(PrimitiveType.Kind.INT) IntBuffer indirect, @GLsizei int primcount, @GLsizei int stride); Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_gpu_shader5.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_gpu_shader5.java 2012-12-19 12:38:50 UTC (rev 3837) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_gpu_shader5.java 2013-01-25 15:39:08 UTC (rev 3838) @@ -127,59 +127,59 @@ // ------------- - @Dependent("EXT_direct_state_access") + @Dependent("GL_EXT_direct_state_access") void glProgramUniform1i64NV(@GLuint int program, int location, @GLint64EXT long x); - @Dependent("EXT_direct_state_access") + @Dependent("GL_EXT_direct_state_access") void glProgramUniform2i64NV(@GLuint int program, int location, @GLint64EXT long x, @GLint64EXT long y); - @Dependent("EXT_direct_state_access") + @Dependent("GL_EXT_direct_state_access") void glProgramUniform3i64NV(@GLuint int program, int location, @GLint64EXT long x, @GLint64EXT long y, @GLint64EXT long z); - @Dependent("EXT_direct_state_access") + @Dependent("GL_EXT_direct_state_access") void glProgramUniform4i64NV(@GLuint int program, int location, @GLint64EXT long x, @GLint64EXT long y, @GLint64EXT long z, @GLint64EXT long w); - @Dependent("EXT_direct_state_access") + @Dependent("GL_EXT_direct_state_access") @StripPostfix("value") void glProgramUniform1i64vNV(@GLuint int program, int location, @AutoSize("value") @GLsizei int count, @Const @GLint64EXT LongBuffer value); - @Dependent("EXT_direct_state_access") + @Dependent("GL_EXT_direct_state_access") @StripPostfix("value") void glProgramUniform2i64vNV(@GLuint int program, int location, @AutoSize(value = "value", expression = " >> 1") @GLsizei int count, @Const @GLint64EXT LongBuffer value); - @Dependent("EXT_direct_state_access") + @Dependent("GL_EXT_direct_state_access") @StripPostfix("value") void glProgramUniform3i64vNV(@GLuint int program, int location, @AutoSize(value = "value", expression = " / 3") @GLsizei int count, @Const @GLint64EXT LongBuffer value); - @Dependent("EXT_direct_state_access") + @Dependent("GL_EXT_direct_state_access") @StripPostfix("value") void glProgramUniform4i64vNV(@GLuint int program, int location, @AutoSize(value = "value", expression = " >> 2") @GLsizei int count, @Const @GLint64EXT LongBuffer value); - @Dependent("EXT_direct_state_access") + @Dependent("GL_EXT_direct_state_access") void glProgramUniform1ui64NV(@GLuint int program, int location, @GLuint64EXT long x); - @Dependent("EXT_direct_state_access") + @Dependent("GL_EXT_direct_state_access") void glProgramUniform2ui64NV(@GLuint int program, int location, @GLuint64EXT long x, @GLuint64EXT long y); - @Dependent("EXT_direct_state_access") + @Dependent("GL_EXT_direct_state_access") void glProgramUniform3ui64NV(@GLuint int program, int location, @GLuint64EXT long x, @GLuint64EXT long y, @GLuint64EXT long z); - @Dependent("EXT_direct_state_access") + @Dependent("GL_EXT_direct_state_access") void glProgramUniform4ui64NV(@GLuint int program, int location, @GLuint64EXT long x, @GLuint64EXT long y, @GLuint64EXT long z, @GLuint64EXT long w); - @Dependent("EXT_direct_state_access") + @Dependent("GL_EXT_direct_state_access") @StripPostfix("value") void glProgramUniform1ui64vNV(@GLuint int program, int location, @AutoSize("value") @GLsizei int count, @Const @GLuint64EXT LongBuffer value); - @Dependent("EXT_direct_state_access") + @Dependent("GL_EXT_direct_state_access") @StripPostfix("value") void glProgramUniform2ui64vNV(@GLuint int program, int location, @AutoSize(value = "value", expression = " >> 1") @GLsizei int count, @Const @GLuint64EXT LongBuffer value); - @Dependent("EXT_direct_state_access") + @Dependent("GL_EXT_direct_state_access") @StripPostfix("value") void glProgramUniform3ui64vNV(@GLuint int program, int location, @AutoSize(value = "value", expression = " / 3") @GLsizei int count, @Const @GLuint64EXT LongBuffer value); - @Dependent("EXT_direct_state_access") + @Dependent("GL_EXT_direct_state_access") @StripPostfix("value") void glProgramUniform4ui64vNV(@GLuint int program, int location, @AutoSize(value = "value", expression = " >> 2") @GLsizei int count, @Const @GLuint64EXT LongBuffer value); Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_vertex_attrib_integer_64bit.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_vertex_attrib_integer_64bit.java 2012-12-19 12:38:50 UTC (rev 3837) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_vertex_attrib_integer_64bit.java 2013-01-25 15:39:08 UTC (rev 3838) @@ -92,7 +92,7 @@ @StripPostfix("params") void glGetVertexAttribLui64vNV(@GLuint int index, @GLenum int pname, @OutParameter @GLuint64EXT @Check("4") LongBuffer params); - @Dependent("NV_vertex_buffer_unified_memory") + @Dependent("GL_NV_vertex_buffer_unified_memory") void glVertexAttribLFormatNV(@GLuint int index, int size, @GLenum int type, @GLsizei int stride); } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |