From: <ma...@us...> - 2006-08-31 16:41:11
|
Revision: 2567 http://svn.sourceforge.net/java-game-lib/?rev=2567&view=rev Author: matzon Date: 2006-08-31 09:40:53 -0700 (Thu, 31 Aug 2006) Log Message: ----------- fixed params (int -> float) Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/fmod3/FSound.java trunk/LWJGL/src/native/common/fmod3/org_lwjgl_fmod3_FSound.c Modified: trunk/LWJGL/src/java/org/lwjgl/fmod3/FSound.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/fmod3/FSound.java 2006-08-31 13:35:36 UTC (rev 2566) +++ trunk/LWJGL/src/java/org/lwjgl/fmod3/FSound.java 2006-08-31 16:40:53 UTC (rev 2567) @@ -1656,7 +1656,7 @@ * @param max The channels maximum volume distance in "units". See remarks for more on units. * @return On success, TRUE is returned. On failure, FALSE is returned. */ - public static native boolean FSOUND_3D_SetMinMaxDistance(int channel, int min, int max); + public static native boolean FSOUND_3D_SetMinMaxDistance(int channel, float min, float max); /** * Sets the current position of the sound in SAMPLES not bytes Modified: trunk/LWJGL/src/native/common/fmod3/org_lwjgl_fmod3_FSound.c =================================================================== --- trunk/LWJGL/src/native/common/fmod3/org_lwjgl_fmod3_FSound.c 2006-08-31 13:35:36 UTC (rev 2566) +++ trunk/LWJGL/src/native/common/fmod3/org_lwjgl_fmod3_FSound.c 2006-08-31 16:40:53 UTC (rev 2567) @@ -730,7 +730,7 @@ * Method: FSOUND_3D_SetMinMaxDistance * Signature: (III)Z */ -JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod3_FSound_FSOUND_13D_1SetMinMaxDistance(JNIEnv * env, jclass clazz, jint channel, jint min, jint max) { +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod3_FSound_FSOUND_13D_1SetMinMaxDistance(JNIEnv * env, jclass clazz, jint channel, jfloat min, jfloat max) { return fmod_instance->FSOUND_3D_SetMinMaxDistance(channel, min, max); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2006-09-19 14:17:27
|
Revision: 2575 http://svn.sourceforge.net/java-game-lib/?rev=2575&view=rev Author: elias_naur Date: 2006-09-19 07:17:13 -0700 (Tue, 19 Sep 2006) Log Message: ----------- Windows: Got rid of dummy window in WindowsDisplayPeerInfo Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplayPeerInfo.java trunk/LWJGL/src/native/windows/context.h trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Pbuffer.c trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsAWTGLCanvasPeerInfo.c trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsContextImplementation.c trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsDisplayPeerInfo.c trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsPeerInfo.c Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplayPeerInfo.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplayPeerInfo.java 2006-09-19 13:41:18 UTC (rev 2574) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplayPeerInfo.java 2006-09-19 14:17:13 UTC (rev 2575) @@ -42,30 +42,19 @@ * $Id$ */ final class WindowsDisplayPeerInfo extends WindowsPeerInfo { + private final PixelFormat pixel_format; + public WindowsDisplayPeerInfo(PixelFormat pixel_format) throws LWJGLException { + this.pixel_format = pixel_format; GLContext.loadOpenGLLibrary(); - try { - createDummyDC(getHandle()); - try { - choosePixelFormat(0, 0, pixel_format, null, true, true, false, true); - } catch (LWJGLException e) { - nDestroy(getHandle()); - throw e; - } - } catch (LWJGLException e) { - GLContext.unloadOpenGLLibrary(); - throw e; - } } - private static native void createDummyDC(ByteBuffer peer_info_handle) throws LWJGLException; - void initDC() { + void initDC() throws LWJGLException { nInitDC(getHandle()); + choosePixelFormat(0, 0, pixel_format, null, true, true, false, true); } private static native void nInitDC(ByteBuffer peer_info_handle); - private static native void nDestroy(ByteBuffer peer_info_handle); - protected void doLockAndInitHandle() throws LWJGLException { // NO-OP } @@ -76,7 +65,6 @@ public void destroy() { super.destroy(); - nDestroy(getHandle()); GLContext.unloadOpenGLLibrary(); } } Modified: trunk/LWJGL/src/native/windows/context.h =================================================================== --- trunk/LWJGL/src/native/windows/context.h 2006-09-19 13:41:18 UTC (rev 2574) +++ trunk/LWJGL/src/native/windows/context.h 2006-09-19 14:17:13 UTC (rev 2575) @@ -47,16 +47,12 @@ #include "extgl_wgl.h" typedef struct { - union { - HWND format_hwnd; - struct { - HPBUFFERARB pbuffer; - // Contains the function pointers that - // created the pbuffer - WGLExtensions extensions; - } pbuffer; - } u; - HDC format_hdc; + struct { + HPBUFFERARB pbuffer; + // Contains the function pointers that + // created the pbuffer + WGLExtensions extensions; + } pbuffer; HDC drawable_hdc; } WindowsPeerInfo; Modified: trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Pbuffer.c =================================================================== --- trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Pbuffer.c 2006-09-19 13:41:18 UTC (rev 2574) +++ trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Pbuffer.c 2006-09-19 14:17:13 UTC (rev 2575) @@ -165,24 +165,23 @@ throwException(env, "Could not get Pbuffer DC"); return; } - peer_info->format_hdc = Pbuffer_dc; - peer_info->u.pbuffer.extensions = extensions; - peer_info->u.pbuffer.pbuffer = Pbuffer; + peer_info->pbuffer.extensions = extensions; + peer_info->pbuffer.pbuffer = Pbuffer; peer_info->drawable_hdc = Pbuffer_dc; } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsPbufferPeerInfo_nDestroy (JNIEnv *env, jclass clazz, jobject peer_info_handle) { WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle); - peer_info->u.pbuffer.extensions.wglReleasePbufferDCARB(peer_info->u.pbuffer.pbuffer, peer_info->drawable_hdc); - peer_info->u.pbuffer.extensions.wglDestroyPbufferARB(peer_info->u.pbuffer.pbuffer); + peer_info->pbuffer.extensions.wglReleasePbufferDCARB(peer_info->pbuffer.pbuffer, peer_info->drawable_hdc); + peer_info->pbuffer.extensions.wglDestroyPbufferARB(peer_info->pbuffer.pbuffer); } JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_WindowsPbufferPeerInfo_nIsBufferLost (JNIEnv *env, jclass clazz, jobject peer_info_handle) { WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle); BOOL buffer_lost; - peer_info->u.pbuffer.extensions.wglQueryPbufferARB(peer_info->u.pbuffer.pbuffer, WGL_PBUFFER_LOST_ARB, &buffer_lost); + peer_info->pbuffer.extensions.wglQueryPbufferARB(peer_info->pbuffer.pbuffer, WGL_PBUFFER_LOST_ARB, &buffer_lost); return buffer_lost ? JNI_TRUE : JNI_FALSE; } @@ -195,17 +194,17 @@ attribs[1] = value; attribs[2] = 0; - peer_info->u.pbuffer.extensions.wglSetPbufferAttribARB(peer_info->u.pbuffer.pbuffer, attribs); + peer_info->pbuffer.extensions.wglSetPbufferAttribARB(peer_info->pbuffer.pbuffer, attribs); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsPbufferPeerInfo_nBindTexImageToPbuffer (JNIEnv *env, jclass clazz, jobject peer_info_handle, jint buffer) { WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle); - peer_info->u.pbuffer.extensions.wglBindTexImageARB(peer_info->u.pbuffer.pbuffer, buffer); + peer_info->pbuffer.extensions.wglBindTexImageARB(peer_info->pbuffer.pbuffer, buffer); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsPbufferPeerInfo_nReleaseTexImageFromPbuffer (JNIEnv *env, jclass clazz, jobject peer_info_handle, jint buffer) { WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle); - peer_info->u.pbuffer.extensions.wglReleaseTexImageARB(peer_info->u.pbuffer.pbuffer, buffer); + peer_info->pbuffer.extensions.wglReleaseTexImageARB(peer_info->pbuffer.pbuffer, buffer); } Modified: trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsAWTGLCanvasPeerInfo.c =================================================================== --- trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsAWTGLCanvasPeerInfo.c 2006-09-19 13:41:18 UTC (rev 2574) +++ trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsAWTGLCanvasPeerInfo.c 2006-09-19 14:17:13 UTC (rev 2575) @@ -50,7 +50,5 @@ WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle); AWTSurfaceLock *surface = (AWTSurfaceLock *)(*env)->GetDirectBufferAddress(env, lock_buffer_handle); JAWT_Win32DrawingSurfaceInfo *win32_dsi = (JAWT_Win32DrawingSurfaceInfo *)surface->dsi->platformInfo; - peer_info->u.format_hwnd = win32_dsi->hwnd; - peer_info->format_hdc = win32_dsi->hdc; peer_info->drawable_hdc = win32_dsi->hdc; } Modified: trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsContextImplementation.c =================================================================== --- trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsContextImplementation.c 2006-09-19 13:41:18 UTC (rev 2574) +++ trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsContextImplementation.c 2006-09-19 14:17:13 UTC (rev 2575) @@ -63,7 +63,7 @@ return NULL; } peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle); - context = wglCreateContext(peer_info->format_hdc); + context = wglCreateContext(peer_info->drawable_hdc); if (context == NULL) { throwException(env, "Could not create context"); return NULL; @@ -79,7 +79,7 @@ } saved_hdc = wglGetCurrentDC(); saved_context = wglGetCurrentContext(); - if (!wglMakeCurrent(peer_info->format_hdc, context)) { + if (!wglMakeCurrent(peer_info->drawable_hdc, context)) { wglMakeCurrent(saved_hdc, saved_context); wglDeleteContext(context); throwException(env, "Could not make context current"); Modified: trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsDisplayPeerInfo.c =================================================================== --- trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsDisplayPeerInfo.c 2006-09-19 13:41:18 UTC (rev 2574) +++ trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsDisplayPeerInfo.c 2006-09-19 14:17:13 UTC (rev 2575) @@ -43,36 +43,8 @@ #include "context.h" #include "common_tools.h" -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplayPeerInfo_createDummyDC - (JNIEnv *env, jclass clazz, jobject peer_info_handle) { - WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle); - HWND dummy_hwnd = createDummyWindow(0, 0); - HDC dummy_hdc; - if (dummy_hwnd == NULL) { - throwException(env, "Failed to create a dummy window."); - return; - } - dummy_hdc = GetDC(dummy_hwnd); - peer_info->u.format_hwnd = dummy_hwnd; - peer_info->format_hdc = dummy_hdc; -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplayPeerInfo_nDestroy - (JNIEnv *env, jclass clazz, jobject peer_info_handle) { - WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle); - closeWindow(&peer_info->u.format_hwnd, &peer_info->format_hdc); -} - JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplayPeerInfo_nInitDC (JNIEnv *env, jclass clazz, jobject peer_info_handle) { WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle); - int pixel_format; peer_info->drawable_hdc = getCurrentHDC(); - pixel_format = GetPixelFormat(peer_info->format_hdc); - if (pixel_format == 0) { - throwException(env, "Could not get pixel format from dummy hdc"); - return; - } - // If applyPixelFormat fails, just let it throw - applyPixelFormat(env, peer_info->drawable_hdc, pixel_format); } Modified: trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsPeerInfo.c =================================================================== --- trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsPeerInfo.c 2006-09-19 13:41:18 UTC (rev 2574) +++ trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsPeerInfo.c 2006-09-19 14:17:13 UTC (rev 2575) @@ -56,5 +56,5 @@ if (pixel_format_id == -1) return; // Let it throw - applyPixelFormat(env, peer_info->format_hdc, pixel_format_id); + applyPixelFormat(env, peer_info->drawable_hdc, pixel_format_id); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sp...@us...> - 2006-10-11 11:22:08
|
Revision: 2581 http://svn.sourceforge.net/java-game-lib/?rev=2581&view=rev Author: spasi Date: 2006-10-11 04:21:40 -0700 (Wed, 11 Oct 2006) Log Message: ----------- Added missing CURRENT_RASTER_SECONDARY_COLOR enum value (GL 2.1) Added EXT_gpu_program_parameters extension Modified Paths: -------------- trunk/LWJGL/src/generated/org/lwjgl/opengl/ContextCapabilities.java trunk/LWJGL/src/generated/org/lwjgl/opengl/GL21.java trunk/LWJGL/src/templates/org/lwjgl/opengl/GL21.java Added Paths: ----------- trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTGpuProgramParameters.java trunk/LWJGL/src/native/generated/org_lwjgl_opengl_EXTGpuProgramParameters.c trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_gpu_program_parameters.java Modified: trunk/LWJGL/src/generated/org/lwjgl/opengl/ContextCapabilities.java =================================================================== --- trunk/LWJGL/src/generated/org/lwjgl/opengl/ContextCapabilities.java 2006-10-08 09:05:16 UTC (rev 2580) +++ trunk/LWJGL/src/generated/org/lwjgl/opengl/ContextCapabilities.java 2006-10-11 11:21:40 UTC (rev 2581) @@ -77,6 +77,7 @@ public final boolean GL_EXT_framebuffer_blit; public final boolean GL_EXT_framebuffer_multisample; public final boolean GL_EXT_framebuffer_object; + public final boolean GL_EXT_gpu_program_parameters; public final boolean GL_EXT_multi_draw_arrays; public final boolean GL_EXT_packed_depth_stencil; public final boolean GL_EXT_packed_pixels; @@ -453,6 +454,8 @@ long EXT_framebuffer_object_glFramebufferRenderbufferEXT_pointer; long EXT_framebuffer_object_glGetFramebufferAttachmentParameterivEXT_pointer; long EXT_framebuffer_object_glGenerateMipmapEXT_pointer; + long EXT_gpu_program_parameters_glProgramEnvParameter4fvEXT_pointer; + long EXT_gpu_program_parameters_glProgramLocalParameter4fvEXT_pointer; long EXT_multi_draw_arrays_glMultiDrawArraysEXT_pointer; long EXT_paletted_texture_glColorTableEXT_pointer; long EXT_paletted_texture_glColorSubTableEXT_pointer; @@ -1464,6 +1467,12 @@ (EXT_framebuffer_object_glGenerateMipmapEXT_pointer = GLContext.getFunctionAddress("glGenerateMipmapEXT")) != 0; } + private boolean EXT_gpu_program_parameters_initNativeFunctionAddresses() { + return + (EXT_gpu_program_parameters_glProgramEnvParameter4fvEXT_pointer = GLContext.getFunctionAddress("glProgramEnvParameter4fvEXT")) != 0 && + (EXT_gpu_program_parameters_glProgramLocalParameter4fvEXT_pointer = GLContext.getFunctionAddress("glProgramLocalParameter4fvEXT")) != 0; + } + private boolean EXT_multi_draw_arrays_initNativeFunctionAddresses() { return (EXT_multi_draw_arrays_glMultiDrawArraysEXT_pointer = GLContext.getFunctionAddress("glMultiDrawArraysEXT")) != 0; @@ -2232,6 +2241,8 @@ supported_extensions.remove("GL_EXT_framebuffer_multisample"); if (supported_extensions.contains("GL_EXT_framebuffer_object") && !EXT_framebuffer_object_initNativeFunctionAddresses()) supported_extensions.remove("GL_EXT_framebuffer_object"); + if (supported_extensions.contains("GL_EXT_gpu_program_parameters") && !EXT_gpu_program_parameters_initNativeFunctionAddresses()) + supported_extensions.remove("GL_EXT_gpu_program_parameters"); if (supported_extensions.contains("GL_EXT_multi_draw_arrays") && !EXT_multi_draw_arrays_initNativeFunctionAddresses()) supported_extensions.remove("GL_EXT_multi_draw_arrays"); if (supported_extensions.contains("GL_EXT_paletted_texture") && !EXT_paletted_texture_initNativeFunctionAddresses()) @@ -2367,6 +2378,7 @@ this.GL_EXT_framebuffer_blit = supported_extensions.contains("GL_EXT_framebuffer_blit"); this.GL_EXT_framebuffer_multisample = supported_extensions.contains("GL_EXT_framebuffer_multisample"); this.GL_EXT_framebuffer_object = supported_extensions.contains("GL_EXT_framebuffer_object"); + this.GL_EXT_gpu_program_parameters = supported_extensions.contains("GL_EXT_gpu_program_parameters"); this.GL_EXT_multi_draw_arrays = supported_extensions.contains("GL_EXT_multi_draw_arrays"); this.GL_EXT_packed_depth_stencil = supported_extensions.contains("GL_EXT_packed_depth_stencil"); this.GL_EXT_packed_pixels = supported_extensions.contains("GL_EXT_packed_pixels"); Added: trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTGpuProgramParameters.java =================================================================== --- trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTGpuProgramParameters.java (rev 0) +++ trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTGpuProgramParameters.java 2006-10-11 11:21:40 UTC (rev 2581) @@ -0,0 +1,30 @@ +/* MACHINE GENERATED FILE, DO NOT EDIT */ + +package org.lwjgl.opengl; + +import org.lwjgl.LWJGLException; +import org.lwjgl.BufferChecks; +import java.nio.*; + +public final class EXTGpuProgramParameters { + + private EXTGpuProgramParameters() { + } + + + public static void glProgramEnvParameter4EXT(int target, int index, int count, FloatBuffer params) { + long function_pointer = GLContext.getCapabilities().EXT_gpu_program_parameters_glProgramEnvParameter4fvEXT_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkBuffer(params, count << 2); + nglProgramEnvParameter4fvEXT(target, index, count, params, params.position(), function_pointer); + } + private static native void nglProgramEnvParameter4fvEXT(int target, int index, int count, FloatBuffer params, int params_position, long function_pointer); + + public static void glProgramLocalParameter4EXT(int target, int index, int count, FloatBuffer params) { + long function_pointer = GLContext.getCapabilities().EXT_gpu_program_parameters_glProgramLocalParameter4fvEXT_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkBuffer(params, count << 2); + nglProgramLocalParameter4fvEXT(target, index, count, params, params.position(), function_pointer); + } + private static native void nglProgramLocalParameter4fvEXT(int target, int index, int count, FloatBuffer params, int params_position, long function_pointer); +} Modified: trunk/LWJGL/src/generated/org/lwjgl/opengl/GL21.java =================================================================== --- trunk/LWJGL/src/generated/org/lwjgl/opengl/GL21.java 2006-10-08 09:05:16 UTC (rev 2580) +++ trunk/LWJGL/src/generated/org/lwjgl/opengl/GL21.java 2006-10-11 11:21:40 UTC (rev 2581) @@ -39,7 +39,7 @@ /** * Accepted by the <pname> parameter of GetIntegerv and GetFloatv. */ - public static final int GL_CURRENT_RASTER_SECONDARY_COLOR = 0xffffffff; + public static final int GL_CURRENT_RASTER_SECONDARY_COLOR = 0x845f; private GL21() { } Added: trunk/LWJGL/src/native/generated/org_lwjgl_opengl_EXTGpuProgramParameters.c =================================================================== --- trunk/LWJGL/src/native/generated/org_lwjgl_opengl_EXTGpuProgramParameters.c (rev 0) +++ trunk/LWJGL/src/native/generated/org_lwjgl_opengl_EXTGpuProgramParameters.c 2006-10-11 11:21:40 UTC (rev 2581) @@ -0,0 +1,20 @@ +/* MACHINE GENERATED FILE, DO NOT EDIT */ + +#include <jni.h> +#include "extgl.h" + +typedef void (APIENTRY *glProgramEnvParameter4fvEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat * params); +typedef void (APIENTRY *glProgramLocalParameter4fvEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat * params); + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTGpuProgramParameters_nglProgramEnvParameter4fvEXT(JNIEnv *env, jclass clazz, jint target, jint index, jint count, jobject params, jint params_position, jlong function_pointer) { + const GLfloat *params_address = ((const GLfloat *)(*env)->GetDirectBufferAddress(env, params)) + params_position; + glProgramEnvParameter4fvEXTPROC glProgramEnvParameter4fvEXT = (glProgramEnvParameter4fvEXTPROC)((intptr_t)function_pointer); + glProgramEnvParameter4fvEXT(target, index, count, params_address); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTGpuProgramParameters_nglProgramLocalParameter4fvEXT(JNIEnv *env, jclass clazz, jint target, jint index, jint count, jobject params, jint params_position, jlong function_pointer) { + const GLfloat *params_address = ((const GLfloat *)(*env)->GetDirectBufferAddress(env, params)) + params_position; + glProgramLocalParameter4fvEXTPROC glProgramLocalParameter4fvEXT = (glProgramLocalParameter4fvEXTPROC)((intptr_t)function_pointer); + glProgramLocalParameter4fvEXT(target, index, count, params_address); +} + Added: trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_gpu_program_parameters.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_gpu_program_parameters.java (rev 0) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_gpu_program_parameters.java 2006-10-11 11:21:40 UTC (rev 2581) @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2002-2004 LWJGL Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'LWJGL' nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.lwjgl.opengl; + +import org.lwjgl.util.generator.*; + +import java.nio.*; + +public interface EXT_gpu_program_parameters { + + @StripPostfix("params") + void glProgramEnvParameter4fvEXT(@GLenum int target, @GLuint int index, @GLsizei int count, @Check("count << 2") @Const FloatBuffer params); + + @StripPostfix("params") + void glProgramLocalParameter4fvEXT(@GLenum int target, @GLuint int index, @GLsizei int count, @Check("count << 2") @Const FloatBuffer params); + +} \ No newline at end of file Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/GL21.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/GL21.java 2006-10-08 09:05:16 UTC (rev 2580) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/GL21.java 2006-10-11 11:21:40 UTC (rev 2581) @@ -112,6 +112,6 @@ /** * Accepted by the <pname> parameter of GetIntegerv and GetFloatv. */ - int GL_CURRENT_RASTER_SECONDARY_COLOR = -1; // TODO: Find this value + int GL_CURRENT_RASTER_SECONDARY_COLOR = 0x845F; } \ 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: <eli...@us...> - 2006-10-11 13:49:06
|
Revision: 2582 http://svn.sourceforge.net/java-game-lib/?rev=2582&view=rev Author: elias_naur Date: 2006-10-11 06:48:48 -0700 (Wed, 11 Oct 2006) Log Message: ----------- Windows: Don't use a dummy window (HDC) when finding a pixel format but use the actual window directly. This will avoid cases where the pixel format index for the dummy window's HDC wasn't valid for the actual window's HDC. It also avoid unnecessary complexity. Fix FullScreenWindowedTest to use the Display's current BPP to avoid 24/16 bpp weirdness Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/test/opengl/FullScreenWindowedTest.java trunk/LWJGL/src/native/windows/context.c trunk/LWJGL/src/native/windows/context.h trunk/LWJGL/src/native/windows/display.c trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Pbuffer.c trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsPeerInfo.c Modified: trunk/LWJGL/src/java/org/lwjgl/test/opengl/FullScreenWindowedTest.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/test/opengl/FullScreenWindowedTest.java 2006-10-11 11:21:40 UTC (rev 2581) +++ trunk/LWJGL/src/java/org/lwjgl/test/opengl/FullScreenWindowedTest.java 2006-10-11 13:48:48 UTC (rev 2582) @@ -80,7 +80,7 @@ private void initialize() { try { //find displaymode - mode = findDisplayMode(800, 600, 16); + mode = findDisplayMode(800, 600, Display.getDisplayMode().getBitsPerPixel()); // start of in windowed mode Display.create(); glInit(); Modified: trunk/LWJGL/src/native/windows/context.c =================================================================== --- trunk/LWJGL/src/native/windows/context.c 2006-10-11 11:21:40 UTC (rev 2581) +++ trunk/LWJGL/src/native/windows/context.c 2006-10-11 13:48:48 UTC (rev 2582) @@ -370,68 +370,76 @@ return findPixelFormatFromBPP(env, hdc, pixel_format, bpp, double_buffer); } -static int findPixelFormatOnDC(JNIEnv *env, HDC hdc, jobject pixel_format, jobject pixelFormatCaps, bool use_hdc_bpp, bool window, bool pbuffer, bool double_buffer, bool floating_point) { +static bool validateAndGetExtensions(JNIEnv *env, WGLExtensions *extensions, HDC dummy_hdc, HGLRC dummy_hglrc, int samples, bool floating_point, jobject pixelFormatCaps) { + if (!wglMakeCurrent(dummy_hdc, dummy_hglrc)) { + throwException(env, "Could not bind context to dummy window"); + return false; + } + extgl_InitWGL(extensions); + + if (!extensions->WGL_ARB_pixel_format) { + throwException(env, "No support for WGL_ARB_pixel_format"); + return false; + } + if (samples > 0 && !extensions->WGL_ARB_multisample) { + throwException(env, "No support for WGL_ARB_multisample"); + return false; + } + /* + * Apparently, some drivers don't report WGL_ARB_pixel_format_float + * even though GL_ARB_color_buffer_float and WGL_ATI_color_format_float + * is supported. + */ + if (floating_point && !(extensions->WGL_ARB_pixel_format_float || extensions->WGL_ATI_pixel_format_float)) { + throwException(env, "No support for WGL_ARB_pixel_format_float nor WGL_ATI_pixel_format_float"); + return false; + } + if (pixelFormatCaps != NULL && !extensions->WGL_ARB_render_texture) { + throwException(env, "No support for WGL_ARB_render_texture"); + return false; + } + return true; +} + +int findPixelFormatOnDC(JNIEnv *env, HDC hdc, int origin_x, int origin_y, jobject pixel_format, jobject pixelFormatCaps, bool use_hdc_bpp, bool window, bool pbuffer, bool double_buffer, bool floating_point) { HGLRC dummy_hglrc; HDC saved_current_hdc; HGLRC saved_current_hglrc; WGLExtensions extensions; + HWND dummy_hwnd; + 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")); bool use_arb_selection = samples > 0 || floating_point || pbuffer || pixelFormatCaps != NULL; pixel_format_id = findPixelFormatDefault(env, hdc, pixel_format, use_hdc_bpp, double_buffer); if (pixel_format_id != -1 && use_arb_selection) { - if (!applyPixelFormat(env, hdc, pixel_format_id)) { + dummy_hwnd = createDummyWindow(origin_x, origin_y); + if (dummy_hwnd == NULL) { + throwException(env, "Could not create dummy window"); return -1; } - dummy_hglrc = wglCreateContext(hdc); + dummy_hdc = GetDC(dummy_hwnd); + if (!applyPixelFormat(env, dummy_hdc, pixel_format_id)) { + closeWindow(&dummy_hwnd, &dummy_hdc); + return -1; + } + dummy_hglrc = wglCreateContext(dummy_hdc); if (dummy_hglrc == NULL) { + closeWindow(&dummy_hwnd, &dummy_hdc); throwException(env, "Failed to create OpenGL rendering context"); return -1; } // Save the current HDC and HGLRC to avoid disruption saved_current_hdc = wglGetCurrentDC(); saved_current_hglrc = wglGetCurrentContext(); - if (!wglMakeCurrent(hdc, dummy_hglrc)) { - wglMakeCurrent(saved_current_hdc, saved_current_hglrc); - wglDeleteContext(dummy_hglrc); - throwException(env, "Could not bind context to dummy window"); - return -1; - } - extgl_InitWGL(&extensions); - - if (!extensions.WGL_ARB_pixel_format) { - wglMakeCurrent(saved_current_hdc, saved_current_hglrc); - wglDeleteContext(dummy_hglrc); - throwException(env, "No support for WGL_ARB_pixel_format"); - return -1; - } - if (samples > 0 && !extensions.WGL_ARB_multisample) { - wglMakeCurrent(saved_current_hdc, saved_current_hglrc); - wglDeleteContext(dummy_hglrc); - throwException(env, "No support for WGL_ARB_multisample"); - return -1; - } - /* - * Apparently, some drivers don't report WGL_ARB_pixel_format_float - * even though GL_ARB_color_buffer_float and WGL_ATI_color_format_float - * is supported. - */ - if (floating_point && !(extensions.WGL_ARB_pixel_format_float || extensions.WGL_ATI_pixel_format_float)) { - wglMakeCurrent(saved_current_hdc, saved_current_hglrc); - wglDeleteContext(dummy_hglrc); - throwException(env, "No support for WGL_ARB_pixel_format_float nor WGL_ATI_pixel_format_float"); - return -1; - } - if (pixelFormatCaps != NULL && !extensions.WGL_ARB_render_texture) { - wglMakeCurrent(saved_current_hdc, saved_current_hglrc); - wglDeleteContext(dummy_hglrc); - throwException(env, "No support for WGL_ARB_render_texture"); - return -1; - } - pixel_format_id = findPixelFormatARB(env, hdc, &extensions, pixel_format, pixelFormatCaps, use_hdc_bpp, window, pbuffer, double_buffer, floating_point); + if (validateAndGetExtensions(env, &extensions, dummy_hdc, dummy_hglrc, samples, floating_point, pixelFormatCaps)) { + pixel_format_id = findPixelFormatARB(env, hdc, &extensions, pixel_format, pixelFormatCaps, use_hdc_bpp, window, pbuffer, double_buffer, floating_point); + } else + pixel_format_id = -1; wglMakeCurrent(saved_current_hdc, saved_current_hglrc); wglDeleteContext(dummy_hglrc); + closeWindow(&dummy_hwnd, &dummy_hdc); } if (pixel_format_id == -1) { throwException(env, "Could not find a valid pixel format"); @@ -455,18 +463,3 @@ return NULL; return createWindow(_CONTEXT_PRIVATE_CLASS_NAME, origin_x, origin_y, 1, 1, false, false); } - -int findPixelFormat(JNIEnv *env, int origin_x, int origin_y, jobject pixel_format, jobject pixelFormatCaps, bool use_hdc_bpp, bool window, bool pbuffer, bool double_buffer, bool floating_point) { - HWND dummy_hwnd; - HDC dummy_hdc; - int pixel_format_id; - dummy_hwnd = createDummyWindow(origin_x, origin_y); - if (dummy_hwnd == NULL) { - throwException(env, "Failed to create the dummy window."); - return -1; - } - dummy_hdc = GetDC(dummy_hwnd); - pixel_format_id = findPixelFormatOnDC(env, dummy_hdc, pixel_format, pixelFormatCaps, use_hdc_bpp, window, pbuffer, double_buffer, floating_point); - closeWindow(&dummy_hwnd, &dummy_hdc); - return pixel_format_id; -} Modified: trunk/LWJGL/src/native/windows/context.h =================================================================== --- trunk/LWJGL/src/native/windows/context.h 2006-10-11 11:21:40 UTC (rev 2581) +++ trunk/LWJGL/src/native/windows/context.h 2006-10-11 13:48:48 UTC (rev 2582) @@ -88,6 +88,6 @@ */ extern HWND createWindow(LPCTSTR window_class_name, int x, int y, int width, int height, bool fullscreen, bool undecorated); -extern int findPixelFormat(JNIEnv *env, int origin_x, int origin_y, jobject pixel_format, jobject pixelFormatCaps, bool use_hdc_bpp, bool window, bool pbuffer, bool double_buffer, bool floating_point); +extern int findPixelFormatOnDC(JNIEnv *env, HDC hdc, int origin_x, int origin_y, jobject pixel_format, jobject pixelFormatCaps, bool use_hdc_bpp, bool window, bool pbuffer, bool double_buffer, bool floating_point); #endif Modified: trunk/LWJGL/src/native/windows/display.c =================================================================== --- trunk/LWJGL/src/native/windows/display.c 2006-10-11 11:21:40 UTC (rev 2581) +++ trunk/LWJGL/src/native/windows/display.c 2006-10-11 13:48:48 UTC (rev 2582) @@ -40,10 +40,6 @@ */ #include <windows.h> -// Multimon.h enables multi monitor emulation on win95 and winnt4 -// So we only need the extended, multi-monitor aware path -//#define COMPILE_MULTIMON_STUBS -//#include <Multimon.h> #include <jni.h> #include "org_lwjgl_opengl_WindowsDisplay.h" #include "display.h" Modified: trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Pbuffer.c =================================================================== --- trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Pbuffer.c 2006-10-11 11:21:40 UTC (rev 2581) +++ trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Pbuffer.c 2006-10-11 13:48:48 UTC (rev 2582) @@ -62,15 +62,17 @@ HGLRC saved_context; int pixel_format_id; - pixel_format_id = findPixelFormat(env, origin_x, origin_y, pixel_format, pixelFormatCaps, false, true, false, false, false); - if (pixel_format_id == -1) - return false; dummy_hwnd = createDummyWindow(origin_x, origin_y); if (dummy_hwnd == NULL) { throwException(env, "Could not create dummy window"); return false; } dummy_hdc = GetDC(dummy_hwnd); + pixel_format_id = findPixelFormatOnDC(env, dummy_hdc, origin_x, origin_y, pixel_format, pixelFormatCaps, false, true, false, false, false); + if (pixel_format_id == -1) { + closeWindow(&dummy_hwnd, &dummy_hdc); + return false; + } if (!applyPixelFormat(env, dummy_hdc, pixel_format_id)) { closeWindow(&dummy_hwnd, &dummy_hdc); return false; @@ -142,9 +144,6 @@ } else { pBufferAttribs_ptr = NULL; } - pixel_format_id = findPixelFormat(env, origin_x, origin_y, pixel_format, pixelFormatCaps, false, false, true, false, floating_point); - if (pixel_format_id == -1) - return; if (!getExtensions(env, &extensions, pixel_format, pixelFormatCaps)) return; dummy_hwnd = createDummyWindow(origin_x, origin_y); @@ -153,6 +152,11 @@ return; } dummy_hdc = GetDC(dummy_hwnd); + pixel_format_id = findPixelFormatOnDC(env, dummy_hdc, origin_x, origin_y, pixel_format, pixelFormatCaps, false, false, true, false, floating_point); + if (pixel_format_id == -1) { + closeWindow(&dummy_hwnd, &dummy_hdc); + return; + } Pbuffer = extensions.wglCreatePbufferARB(dummy_hdc, pixel_format_id, width, height, pBufferAttribs_ptr); closeWindow(&dummy_hwnd, &dummy_hdc); if (Pbuffer == NULL) { Modified: trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsPeerInfo.c =================================================================== --- trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsPeerInfo.c 2006-10-11 11:21:40 UTC (rev 2581) +++ trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsPeerInfo.c 2006-10-11 13:48:48 UTC (rev 2582) @@ -52,7 +52,7 @@ WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle); jclass cls_pixel_format = (*env)->GetObjectClass(env, pixel_format); bool floating_point = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "floating_point", "Z")); - int pixel_format_id = findPixelFormat(env, origin_x, origin_y, pixel_format, pixel_format_caps, use_hdc_bpp, window, pbuffer, double_buffer, floating_point); + int pixel_format_id = findPixelFormatOnDC(env, peer_info->drawable_hdc, origin_x, origin_y, pixel_format, pixel_format_caps, use_hdc_bpp, window, pbuffer, double_buffer, floating_point); if (pixel_format_id == -1) return; // Let it throw This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2006-10-11 20:26:50
|
Revision: 2583 http://svn.sourceforge.net/java-game-lib/?rev=2583&view=rev Author: elias_naur Date: 2006-10-11 13:26:35 -0700 (Wed, 11 Oct 2006) Log Message: ----------- Windows: Restore the old ToAscii code used on win9x platforms in an attempt to fix broken keyboard input on win98se machines. Modified Paths: -------------- 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/WindowsKeyboard.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsKeyboard.java 2006-10-11 13:48:48 UTC (rev 2582) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsKeyboard.java 2006-10-11 20:26:35 UTC (rev 2583) @@ -51,7 +51,9 @@ private final WindowsDirectInputDevice keyboard; private final IntBuffer temp_data_buffer; private final ByteBuffer keyboard_state; + private final boolean unicode; private final CharBuffer unicode_buffer; + private final ByteBuffer ascii_buffer; public WindowsKeyboard(WindowsDirectInput dinput, long hwnd) throws LWJGLException { this.dinput = dinput; @@ -72,9 +74,19 @@ keyboard.acquire(); temp_data_buffer = BufferUtils.createIntBuffer(BUFFER_SIZE*WindowsDirectInputDevice.DATA_SIZE); keyboard_state = BufferUtils.createByteBuffer(256); - unicode_buffer = BufferUtils.createCharBuffer(BUFFER_SIZE); + unicode = isWindowsNT(); + if (unicode) { + unicode_buffer = BufferUtils.createCharBuffer(BUFFER_SIZE); + ascii_buffer = null; + } else { + unicode_buffer = null; + // ToAscii returns at most 2 characters + ascii_buffer = BufferUtils.createByteBuffer(2); + } } + private static native boolean isWindowsNT(); + public void destroy() { keyboard.unacquire(); keyboard.release(); @@ -117,12 +129,22 @@ if (virt_key != 0 && GetKeyboardState(keyboard_state) != 0) { // Mark key down in the scan code dwOfs = dwOfs & 0x7fff; - unicode_buffer.clear(); - int num_chars = ToUnicode(virt_key, + int num_chars; + if (unicode) { + unicode_buffer.clear(); + num_chars = ToUnicode(virt_key, dwOfs, keyboard_state, unicode_buffer, unicode_buffer.capacity(), 0); + } else { + ascii_buffer.clear(); + num_chars = ToAscii(virt_key, + dwOfs, + keyboard_state, + ascii_buffer, + 0); + } if (num_chars > 0) { int current_char = 0; do { @@ -130,7 +152,12 @@ dst.putInt(0); dst.put((byte)0); } - int char_int = ((int)unicode_buffer.get()) & 0xFFFF; + int char_int; + if (unicode) { + char_int = ((int)unicode_buffer.get()) & 0xFFFF; + } else { + char_int = ((int)ascii_buffer.get()) & 0xFF; + } dst.putInt(char_int); dst.putLong(nanos); current_char++; @@ -151,6 +178,7 @@ } private static native int MapVirtualKey(int uCode, int uMapType); 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); public void read(ByteBuffer buffer) { Modified: trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsKeyboard.c =================================================================== --- trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsKeyboard.c 2006-10-11 13:48:48 UTC (rev 2582) +++ trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsKeyboard.c 2006-10-11 20:26:35 UTC (rev 2583) @@ -45,12 +45,26 @@ return MapVirtualKey(uCode, uMapType); } +JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_WindowsKeyboard_isWindowsNT(JNIEnv *env, jclass unused) { + OSVERSIONINFO osvi; + + osvi.dwOSVersionInfoSize = sizeof(osvi); + GetVersionEx(&osvi); + return osvi.dwPlatformId == VER_PLATFORM_WIN32_NT ? JNI_TRUE : JNI_FALSE; +} + JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_WindowsKeyboard_ToUnicode(JNIEnv *env, jclass unused, jint wVirtKey, jint wScanCode, jobject lpKeyState_obj, jobject pwszBuff_obj, jint cchBuff, jint flags) { const PBYTE lpKeyState = (*env)->GetDirectBufferAddress(env, lpKeyState_obj); LPWSTR pwszBuff = (*env)->GetDirectBufferAddress(env, pwszBuff_obj); return ToUnicode(wVirtKey, wScanCode, lpKeyState, pwszBuff, cchBuff, flags); } +JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_WindowsKeyboard_ToAscii(JNIEnv *env, jclass unused, jint wVirtKey, jint wScanCode, jobject lpKeyState_obj, jobject lpChar_obj, jint flags) { + const PBYTE lpKeyState = (*env)->GetDirectBufferAddress(env, lpKeyState_obj); + LPWORD lpChar = (*env)->GetDirectBufferAddress(env, lpChar_obj); + return ToAscii(wVirtKey, wScanCode, lpKeyState, lpChar, flags); +} + JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_WindowsKeyboard_GetKeyboardState(JNIEnv *env, jclass unused, jobject lpKeyState_obj) { PBYTE lpKeyState = (*env)->GetDirectBufferAddress(env, lpKeyState_obj); return GetKeyboardState(lpKeyState); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2006-10-20 11:51:44
|
Revision: 2586 http://svn.sourceforge.net/java-game-lib/?rev=2586&view=rev Author: elias_naur Date: 2006-10-20 04:51:34 -0700 (Fri, 20 Oct 2006) Log Message: ----------- Linux: Don't use the SUN specific getScreenFromDevice in LinuxAWTCanvasPeerInfo. This avoids garbage creation per frame and avoids one bit of SUN JRE dependency. Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxAWTGLCanvasPeerInfo.java trunk/LWJGL/src/native/linux/org_lwjgl_opengl_LinuxAWTGLCanvasPeerInfo.c Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxAWTGLCanvasPeerInfo.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxAWTGLCanvasPeerInfo.java 2006-10-20 10:44:28 UTC (rev 2585) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxAWTGLCanvasPeerInfo.java 2006-10-20 11:51:34 UTC (rev 2586) @@ -45,20 +45,25 @@ final class LinuxAWTGLCanvasPeerInfo extends LinuxPeerInfo { private final AWTGLCanvas canvas; private final AWTSurfaceLock awt_surface = new AWTSurfaceLock(); + private int screen = -1; public LinuxAWTGLCanvasPeerInfo(AWTGLCanvas canvas) { this.canvas = canvas; } protected void doLockAndInitHandle() throws LWJGLException { - int screen = -1; - try { - screen = LinuxCanvasImplementation.getScreenFromDevice(canvas.getGraphicsConfiguration().getDevice()); - } catch (LWJGLException e) { - LWJGLUtil.log("Got exception while trying to determine screen: " + e); + ByteBuffer surface_handle = awt_surface.lockAndGetHandle(canvas); + if (screen == -1) { + try { + screen = getScreenFromSurfaceInfo(surface_handle); + } catch (LWJGLException e) { + LWJGLUtil.log("Got exception while trying to determine screen: " + e); + screen = 0; + } } - nInitHandle(screen, awt_surface.lockAndGetHandle(canvas), getHandle()); + nInitHandle(screen, surface_handle, getHandle()); } + private static native int getScreenFromSurfaceInfo(ByteBuffer surface_handle) throws LWJGLException; private static native void nInitHandle(int screen, ByteBuffer surface_buffer, ByteBuffer peer_info_handle) throws LWJGLException; protected void doUnlock() throws LWJGLException { Modified: trunk/LWJGL/src/native/linux/org_lwjgl_opengl_LinuxAWTGLCanvasPeerInfo.c =================================================================== --- trunk/LWJGL/src/native/linux/org_lwjgl_opengl_LinuxAWTGLCanvasPeerInfo.c 2006-10-20 10:44:28 UTC (rev 2585) +++ trunk/LWJGL/src/native/linux/org_lwjgl_opengl_LinuxAWTGLCanvasPeerInfo.c 2006-10-20 11:51:34 UTC (rev 2586) @@ -47,33 +47,33 @@ #include "org_lwjgl_opengl_LinuxAWTGLCanvasPeerInfo.h" #include "context.h" +JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxAWTGLCanvasPeerInfo_getScreenFromSurfaceInfo + (JNIEnv *env, jclass clazz, jobject lock_buffer_handle) { + const AWTSurfaceLock *awt_lock = (AWTSurfaceLock *)(*env)->GetDirectBufferAddress(env, lock_buffer_handle); + // Get the platform-specific drawing info + JAWT_X11DrawingSurfaceInfo *dsi_x11 = (JAWT_X11DrawingSurfaceInfo*)awt_lock->dsi->platformInfo; + + XVisualInfo template; + int num_infos; + template.visualid = dsi_x11->visualID; + template.depth = dsi_x11->depth; + XVisualInfo *vis_info = XGetVisualInfo(dsi_x11->display, VisualIDMask | VisualDepthMask, &template, &num_infos); + if (vis_info == NULL) { + throwException(env, "Could not determine screen"); + return -1; + } + int screen = vis_info[0].screen; + XFree(vis_info); + return screen; +} + JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxAWTGLCanvasPeerInfo_nInitHandle (JNIEnv *env, jclass clazz, int screen, jobject lock_buffer_handle, jobject peer_info_handle) { - if ((*env)->GetDirectBufferCapacity(env, peer_info_handle) < sizeof(X11PeerInfo)) { - throwException(env, "PeerInfo handle buffer not large enough"); - return; - } const AWTSurfaceLock *awt_lock = (AWTSurfaceLock *)(*env)->GetDirectBufferAddress(env, lock_buffer_handle); X11PeerInfo *peer_info = (X11PeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle); // Get the platform-specific drawing info JAWT_X11DrawingSurfaceInfo *dsi_x11 = (JAWT_X11DrawingSurfaceInfo*)awt_lock->dsi->platformInfo; - // If we couldn't get a screen from java side, attempt to determine a sane screen - // from the information we do have, namely the visualid and the depth - if (screen == -1) { - XVisualInfo template; - int num_infos; - template.visualid = dsi_x11->visualID; - template.depth = dsi_x11->depth; - XVisualInfo *vis_info = XGetVisualInfo(dsi_x11->display, VisualIDMask | VisualDepthMask, &template, &num_infos); - if (vis_info == NULL) { - throwException(env, "Could not determine screen"); - return; - } - screen = vis_info[0].screen; - XFree(vis_info); - } - peer_info->display = dsi_x11->display; peer_info->screen = screen; peer_info->drawable = dsi_x11->drawable; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2006-10-23 13:58:58
|
Revision: 2591 http://svn.sourceforge.net/java-game-lib/?rev=2591&view=rev Author: elias_naur Date: 2006-10-23 06:58:33 -0700 (Mon, 23 Oct 2006) Log Message: ----------- Linux: Moved Display pointer from native to java Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/Sys.java trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxCanvasImplementation.java trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplayPeerInfo.java trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxPbufferPeerInfo.java trunk/LWJGL/src/native/linux/display.c trunk/LWJGL/src/native/linux/org_lwjgl_input_Cursor.c trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c trunk/LWJGL/src/native/linux/org_lwjgl_opengl_LinuxCanvasImplementation.c trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Pbuffer.c Modified: trunk/LWJGL/src/java/org/lwjgl/Sys.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/Sys.java 2006-10-23 10:24:03 UTC (rev 2590) +++ trunk/LWJGL/src/java/org/lwjgl/Sys.java 2006-10-23 13:58:33 UTC (rev 2591) @@ -57,7 +57,7 @@ private static final String VERSION = "1.0beta3"; /** Current version of the JNI library */ - static final int JNI_VERSION = 4; + static final int JNI_VERSION = 5; /** The implementation instance to delegate platform specific behavior to */ private final static SysImplementation implementation; Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxCanvasImplementation.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxCanvasImplementation.java 2006-10-23 10:24:03 UTC (rev 2590) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxCanvasImplementation.java 2006-10-23 13:58:33 UTC (rev 2591) @@ -107,7 +107,7 @@ GLContext.loadOpenGLLibrary(); try { LinuxDisplay.incDisplay(); - return nFindVisualIDFromFormat(screen, pixel_format); + return nFindVisualIDFromFormat(LinuxDisplay.getDisplay(), screen, pixel_format); } finally { LinuxDisplay.decDisplay(); } @@ -118,5 +118,5 @@ LinuxDisplay.unlockAWT(); } } - private static native int nFindVisualIDFromFormat(int screen, PixelFormat pixel_format) throws LWJGLException; + private static native int nFindVisualIDFromFormat(long display, int screen, PixelFormat pixel_format) throws LWJGLException; } Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2006-10-23 10:24:03 UTC (rev 2590) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2006-10-23 13:58:33 UTC (rev 2591) @@ -75,6 +75,9 @@ */ private static Thread current_awt_lock_owner; private static int awt_lock_count; + + /** Current X11 Display pointer */ + private static long display; private static int display_connection_usage_count = 0; @@ -111,7 +114,7 @@ incDisplay(); try { if (isXF86VidModeSupported()) - return nGetCurrentGammaRamp(); + return nGetCurrentGammaRamp(getDisplay()); else return null; } finally { @@ -121,7 +124,7 @@ unlockAWT(); } } - private static native ByteBuffer nGetCurrentGammaRamp() throws LWJGLException; + private static native ByteBuffer nGetCurrentGammaRamp(long display) throws LWJGLException; private static int getBestDisplayModeExtension() { int result; @@ -145,7 +148,7 @@ try { incDisplay(); try { - return nIsXrandrSupported(); + return nIsXrandrSupported(getDisplay()); } finally { decDisplay(); } @@ -156,14 +159,14 @@ unlockAWT(); } } - private static native boolean nIsXrandrSupported() throws LWJGLException; + private static native boolean nIsXrandrSupported(long display) throws LWJGLException; private static boolean isXF86VidModeSupported() { lockAWT(); try { incDisplay(); try { - return nIsXF86VidModeSupported(); + return nIsXF86VidModeSupported(getDisplay()); } finally { decDisplay(); } @@ -174,7 +177,7 @@ unlockAWT(); } } - private static native boolean nIsXF86VidModeSupported() throws LWJGLException; + private static native boolean nIsXF86VidModeSupported(long display) throws LWJGLException; private static boolean isNetWMFullscreenSupported() throws LWJGLException { if (Display.getPrivilegedBoolean("LWJGL_DISABLE_NETWM")) @@ -183,7 +186,7 @@ try { incDisplay(); try { - return nIsNetWMFullscreenSupported(); + return nIsNetWMFullscreenSupported(getDisplay()); } finally { decDisplay(); } @@ -194,7 +197,7 @@ unlockAWT(); } } - private static native boolean nIsNetWMFullscreenSupported() throws LWJGLException; + private static native boolean nIsNetWMFullscreenSupported(long display) throws LWJGLException; /* Since Xlib is not guaranteed to be thread safe, we need a way to synchronize LWJGL * Xlib calls with AWT Xlib calls. Fortunately, JAWT implements Lock()/Unlock() to @@ -245,7 +248,7 @@ static void incDisplay() throws LWJGLException { if (display_connection_usage_count == 0) { GLContext.loadOpenGLLibrary(); - openDisplay(); + display = openDisplay(); } display_connection_usage_count++; } @@ -255,13 +258,14 @@ if (display_connection_usage_count < 0) throw new InternalError("display_connection_usage_count < 0: " + display_connection_usage_count); if (display_connection_usage_count == 0) { - closeDisplay(); + closeDisplay(getDisplay()); + display = 0; GLContext.unloadOpenGLLibrary(); } } - private static native void openDisplay() throws LWJGLException; - private static native void closeDisplay(); + private static native long openDisplay() throws LWJGLException; + private static native void closeDisplay(long display); private int getWindowMode(boolean fullscreen) throws LWJGLException { if (fullscreen) { @@ -276,7 +280,10 @@ return WINDOWED; } - private static native long getDisplay(); + static long getDisplay() { + return display; + } + private static native int getScreen(); private static native long getWindow(); @@ -367,7 +374,7 @@ ByteBuffer handle = peer_info.lockAndGetHandle(); try { current_window_mode = getWindowMode(fullscreen); - nCreateWindow(handle, mode, current_window_mode, x, y); + nCreateWindow(getDisplay(), handle, mode, current_window_mode, x, y); blank_cursor = createBlankCursor(); current_cursor = null; focused = true; @@ -391,7 +398,7 @@ unlockAWT(); } } - private static native void nCreateWindow(ByteBuffer peer_info_handle, DisplayMode mode, int window_mode, int x, int y) throws LWJGLException; + private static native void nCreateWindow(long display, ByteBuffer peer_info_handle, DisplayMode mode, int window_mode, int x, int y) throws LWJGLException; private void updateInputGrab() { updatePointerGrab(); @@ -406,17 +413,17 @@ } catch (LWJGLException e) { LWJGLUtil.log("Failed to reset cursor: " + e.getMessage()); } - nDestroyCursor(blank_cursor); + nDestroyCursor(getDisplay(), blank_cursor); blank_cursor = null; ungrabKeyboard(); - nDestroyWindow(); + nDestroyWindow(getDisplay()); nSetRepeatMode(getDisplay(), AutoRepeatModeDefault); decDisplay(); } finally { unlockAWT(); } } - private static native void nDestroyWindow(); + private static native void nDestroyWindow(long display); public void switchDisplayMode(DisplayMode mode) throws LWJGLException { lockAWT(); @@ -530,7 +537,7 @@ try { incDisplay(); try { - return nGetCurrentXRandrMode(); + return nGetCurrentXRandrMode(getDisplay()); } finally { decDisplay(); } @@ -540,17 +547,17 @@ } /** Assumes extension == XRANDR */ - private static native DisplayMode nGetCurrentXRandrMode() throws LWJGLException; + private static native DisplayMode nGetCurrentXRandrMode(long display) throws LWJGLException; public void setTitle(String title) { lockAWT(); try { - nSetTitle(title); + nSetTitle(getDisplay(), title); } finally { unlockAWT(); } } - private static native void nSetTitle(String title); + private static native void nSetTitle(long display, String title); public boolean isCloseRequested() { boolean result = close_requested; @@ -580,7 +587,7 @@ public void update() { lockAWT(); try { - nUpdate(); + nUpdate(getDisplay()); checkInput(); } catch (LWJGLException e) { LWJGLUtil.log("Caught exception while processing messages: " + e); @@ -588,24 +595,24 @@ unlockAWT(); } } - private native void nUpdate() throws LWJGLException; + private native void nUpdate(long display) throws LWJGLException; public void reshape(int x, int y, int width, int height) { lockAWT(); try { - nReshape(x, y, width, height); + nReshape(getDisplay(), x, y, width, height); } finally { unlockAWT(); } } - private static native void nReshape(int x, int y, int width, int height); + private static native void nReshape(long display, int x, int y, int width, int height); public DisplayMode[] getAvailableDisplayModes() throws LWJGLException { lockAWT(); try { incDisplay(); try { - DisplayMode[] modes = nGetAvailableDisplayModes(current_displaymode_extension); + DisplayMode[] modes = nGetAvailableDisplayModes(getDisplay(), current_displaymode_extension); return modes; } finally { decDisplay(); @@ -614,7 +621,7 @@ unlockAWT(); } } - private static native DisplayMode[] nGetAvailableDisplayModes(int extension) throws LWJGLException; + private static native DisplayMode[] nGetAvailableDisplayModes(long display, int extension) throws LWJGLException; /* Mouse */ public boolean hasWheel() { @@ -734,7 +741,7 @@ try { incDisplay(); try { - return nGetNativeCursorCapabilities(); + return nGetNativeCursorCapabilities(getDisplay()); } finally { decDisplay(); } @@ -744,7 +751,7 @@ unlockAWT(); } } - private static native int nGetNativeCursorCapabilities() throws LWJGLException; + private static native int nGetNativeCursorCapabilities(long display) throws LWJGLException; public void setNativeCursor(Object handle) throws LWJGLException { current_cursor = (ByteBuffer)handle; @@ -761,7 +768,7 @@ try { incDisplay(); try { - return nGetMinCursorSize(); + return nGetMinCursorSize(getDisplay()); } finally { decDisplay(); } @@ -772,14 +779,14 @@ unlockAWT(); } } - private static native int nGetMinCursorSize(); + private static native int nGetMinCursorSize(long display); public int getMaxCursorSize() { lockAWT(); try { incDisplay(); try { - return nGetMaxCursorSize(); + return nGetMaxCursorSize(getDisplay()); } finally { decDisplay(); } @@ -790,7 +797,7 @@ unlockAWT(); } } - private static native int nGetMaxCursorSize(); + private static native int nGetMaxCursorSize(long display); /* Keyboard */ public void createKeyboard() throws LWJGLException { @@ -836,7 +843,7 @@ return Keyboard.STATE_UNKNOWN; } */ - private static native ByteBuffer nCreateCursor(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, int images_offset, IntBuffer delays, int delays_offset) throws LWJGLException; + private static native ByteBuffer nCreateCursor(long display, int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, int images_offset, IntBuffer delays, int delays_offset) throws LWJGLException; private static ByteBuffer createBlankCursor() { return nCreateBlankCursor(getDisplay(), getWindow()); @@ -848,7 +855,7 @@ try { incDisplay(); try { - return nCreateCursor(width, height, xHotspot, yHotspot, numImages, images, images.position(), delays, delays != null ? delays.position() : -1); + return nCreateCursor(getDisplay(), width, height, xHotspot, yHotspot, numImages, images, images.position(), delays, delays != null ? delays.position() : -1); } catch (LWJGLException e) { decDisplay(); throw e; @@ -861,20 +868,20 @@ public void destroyCursor(Object cursorHandle) { lockAWT(); try { - nDestroyCursor(cursorHandle); + nDestroyCursor(getDisplay(), cursorHandle); decDisplay(); } finally { unlockAWT(); } } - private static native void nDestroyCursor(Object cursorHandle); + private static native void nDestroyCursor(long display, Object cursorHandle); public int getPbufferCapabilities() { lockAWT(); try { incDisplay(); try { - return nGetPbufferCapabilities(); + return nGetPbufferCapabilities(getDisplay()); } finally { decDisplay(); } @@ -885,7 +892,7 @@ unlockAWT(); } } - private static native int nGetPbufferCapabilities(); + private static native int nGetPbufferCapabilities(long display); public boolean isBufferLost(PeerInfo handle) { return false; @@ -954,7 +961,7 @@ int size = icons[i].limit() / 4; int dimension = (int)Math.sqrt(size); ByteBuffer icon = convertIcon(icons[i], dimension, dimension); - nSetWindowIcon(icon, icon.capacity(), dimension, dimension); + nSetWindowIcon(getDisplay(), icon, icon.capacity(), dimension, dimension); return 1; } return 0; @@ -969,7 +976,7 @@ } } - private static native void nSetWindowIcon(ByteBuffer icon, int icons_size, int width, int height); + private static native void nSetWindowIcon(long display, ByteBuffer icon, int icons_size, int width, int height); /* Callbacks from nUpdate() */ private void handleButtonEvent(long millis, int type, int button, int state) { Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplayPeerInfo.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplayPeerInfo.java 2006-10-23 10:24:03 UTC (rev 2590) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplayPeerInfo.java 2006-10-23 13:58:33 UTC (rev 2591) @@ -49,7 +49,7 @@ try { LinuxDisplay.incDisplay(); try { - initDefaultPeerInfo(getHandle(), pixel_format); + initDefaultPeerInfo(LinuxDisplay.getDisplay(), getHandle(), pixel_format); } catch (LWJGLException e) { LinuxDisplay.decDisplay(); throw e; @@ -62,7 +62,7 @@ LinuxDisplay.unlockAWT(); } } - private static native void initDefaultPeerInfo(ByteBuffer peer_info_handle, PixelFormat pixel_format) throws LWJGLException; + private static native void initDefaultPeerInfo(long display, ByteBuffer peer_info_handle, PixelFormat pixel_format) throws LWJGLException; protected void doLockAndInitHandle() throws LWJGLException { LinuxDisplay.lockAWT(); Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxPbufferPeerInfo.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxPbufferPeerInfo.java 2006-10-23 10:24:03 UTC (rev 2590) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxPbufferPeerInfo.java 2006-10-23 13:58:33 UTC (rev 2591) @@ -49,7 +49,7 @@ try { LinuxDisplay.incDisplay(); try { - nInitHandle(getHandle(), width, height, pixel_format); + nInitHandle(LinuxDisplay.getDisplay(), getHandle(), width, height, pixel_format); } catch (LWJGLException e) { LinuxDisplay.decDisplay(); throw e; @@ -62,7 +62,7 @@ LinuxDisplay.unlockAWT(); } } - private static native void nInitHandle(ByteBuffer handle, int width, int height, PixelFormat pixel_format) throws LWJGLException; + private static native void nInitHandle(long display, ByteBuffer handle, int width, int height, PixelFormat pixel_format) throws LWJGLException; public void destroy() { LinuxDisplay.lockAWT(); Modified: trunk/LWJGL/src/native/linux/display.c =================================================================== --- trunk/LWJGL/src/native/linux/display.c 2006-10-23 10:24:03 UTC (rev 2590) +++ trunk/LWJGL/src/native/linux/display.c 2006-10-23 13:58:33 UTC (rev 2591) @@ -108,13 +108,15 @@ return major_ver >= 2; } -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nIsXrandrSupported(JNIEnv *env, jclass unused) { - jboolean result = isXrandrSupported(env, getDisplay()) ? JNI_TRUE : JNI_FALSE; +JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nIsXrandrSupported(JNIEnv *env, jclass unused, jlong display) { + Display *disp = (Display *)(intptr_t)display; + jboolean result = isXrandrSupported(env, disp) ? JNI_TRUE : JNI_FALSE; return result; } -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nIsXF86VidModeSupported(JNIEnv *env, jclass unused) { - jboolean result = isXF86VidModeSupported(env, getDisplay()) ? JNI_TRUE : JNI_FALSE; +JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nIsXF86VidModeSupported(JNIEnv *env, jclass unused, jlong display) { + Display *disp = (Display *)(intptr_t)display; + jboolean result = isXF86VidModeSupported(env, disp) ? JNI_TRUE : JNI_FALSE; return result; } @@ -287,15 +289,16 @@ return native_ramp; } -JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetCurrentGammaRamp(JNIEnv *env, jclass unused) { - int ramp_size = getGammaRampLengthOfDisplay(env, getDisplay(), getCurrentScreen()); +JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetCurrentGammaRamp(JNIEnv *env, jclass unused, jlong display) { + Display *disp = (Display *)(intptr_t)display; + int ramp_size = getGammaRampLengthOfDisplay(env, disp, getCurrentScreen()); jobject ramp_buffer = newJavaManagedByteBuffer(env, sizeof(unsigned short)*3*ramp_size); if (ramp_buffer == NULL) { throwException(env, "Could not allocate gamma ramp buffer"); return NULL; } unsigned short *ramp = (unsigned short *)(*env)->GetDirectBufferAddress(env, ramp_buffer); - if (!XF86VidModeGetGammaRamp(getDisplay(), getCurrentScreen(), ramp_size, ramp, + if (!XF86VidModeGetGammaRamp(disp, getCurrentScreen(), ramp_size, ramp, ramp + ramp_size, ramp + ramp_size*2)) { throwException(env, "Could not get the current gamma ramp"); return NULL; @@ -400,12 +403,14 @@ return displayMode; } -JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetCurrentXRandrMode(JNIEnv *env, jclass unused) { - return getCurrentXRandrMode(env, getDisplay(), getCurrentScreen()); +JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetCurrentXRandrMode(JNIEnv *env, jclass unused, jlong display) { + Display *disp = (Display *)(intptr_t)display; + return getCurrentXRandrMode(env, disp, getCurrentScreen()); } -JNIEXPORT jobjectArray JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetAvailableDisplayModes(JNIEnv *env, jclass clazz, jint extension) { - return getAvailableDisplayModes(env, getDisplay(), getCurrentScreen(), extension); +JNIEXPORT jobjectArray JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetAvailableDisplayModes(JNIEnv *env, jclass clazz, jlong display, jint extension) { + Display *disp = (Display *)(intptr_t)display; + return getAvailableDisplayModes(env, disp, getCurrentScreen(), extension); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSwitchDisplayMode(JNIEnv *env, jclass clazz, jint screen, jint extension, jobject mode) { Modified: trunk/LWJGL/src/native/linux/org_lwjgl_input_Cursor.c =================================================================== --- trunk/LWJGL/src/native/linux/org_lwjgl_input_Cursor.c 2006-10-23 10:24:03 UTC (rev 2590) +++ trunk/LWJGL/src/native/linux/org_lwjgl_input_Cursor.c 2006-10-23 13:58:33 UTC (rev 2591) @@ -48,10 +48,11 @@ #include "common_tools.h" JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetNativeCursorCapabilities - (JNIEnv *env, jclass clazz) { + (JNIEnv *env, jclass clazz, jlong display) { + Display *disp = (Display *)(intptr_t)display; int caps = 0; - XcursorBool argb_supported = XcursorSupportsARGB(getDisplay()); - XcursorBool anim_supported = XcursorSupportsAnim(getDisplay()); + XcursorBool argb_supported = XcursorSupportsARGB(disp); + XcursorBool anim_supported = XcursorSupportsAnim(disp); if (argb_supported) caps |= org_lwjgl_input_Cursor_CURSOR_8_BIT_ALPHA | org_lwjgl_input_Cursor_CURSOR_ONE_BIT_TRANSPARENCY; if (anim_supported) @@ -60,26 +61,29 @@ } JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetMinCursorSize - (JNIEnv *env, jclass clazz) + (JNIEnv *env, jclass clazz, jlong display) { + Display *disp = (Display *)(intptr_t)display; unsigned int width_return = 0; unsigned int height_return = 0; - XQueryBestCursor(getDisplay(), getCurrentWindow(), 1, 1, &width_return, &height_return); + XQueryBestCursor(disp, getCurrentWindow(), 1, 1, &width_return, &height_return); return width_return > height_return ? width_return : height_return; } JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetMaxCursorSize - (JNIEnv *env, jclass clazz) + (JNIEnv *env, jclass clazz, jlong display) { + Display *disp = (Display *)(intptr_t)display; unsigned int width_return = 0; unsigned int height_return = 0; - XQueryBestCursor(getDisplay(), getCurrentWindow(), 0xffffffff, 0xffffffff, &width_return, &height_return); + XQueryBestCursor(disp, getCurrentWindow(), 0xffffffff, 0xffffffff, &width_return, &height_return); return width_return > height_return ? height_return : width_return; } JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nCreateCursor - (JNIEnv *env, jclass clazz, jint width, jint height, jint x_hotspot, jint y_hotspot, jint num_images, jobject image_buffer, jint images_offset, jobject delay_buffer, jint delays_offset) + (JNIEnv *env, jclass clazz, jlong display, jint width, jint height, jint x_hotspot, jint y_hotspot, jint num_images, jobject image_buffer, jint images_offset, jobject delay_buffer, jint delays_offset) { + Display *disp = (Display *)(intptr_t)display; jobject handle_buffer = newJavaManagedByteBuffer(env, sizeof(Cursor)); if (handle_buffer == NULL) { throwException(env, "Could not allocate handle buffer"); @@ -107,14 +111,15 @@ cursor_images->images[i] = cursor_image; } Cursor *cursor = (Cursor *)(*env)->GetDirectBufferAddress(env, handle_buffer); - *cursor = XcursorImagesLoadCursor(getDisplay(), cursor_images); + *cursor = XcursorImagesLoadCursor(disp, cursor_images); XcursorImagesDestroy(cursor_images); return handle_buffer; } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nDestroyCursor - (JNIEnv *env, jclass clazz, jobject cursor_handle_buffer) + (JNIEnv *env, jclass clazz, jlong display, jobject cursor_handle_buffer) { + Display *disp = (Display *)(intptr_t)display; Cursor *cursor = (Cursor *)(*env)->GetDirectBufferAddress(env, cursor_handle_buffer); - XFreeCursor(getDisplay(), *cursor); + XFreeCursor(disp, *cursor); } Modified: trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c =================================================================== --- trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c 2006-10-23 10:24:03 UTC (rev 2590) +++ trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c 2006-10-23 13:58:33 UTC (rev 2591) @@ -80,7 +80,6 @@ static Visual *current_visual; static int current_screen; -static Display *display_connection = NULL; static bool async_x_error; static char error_message[ERR_MSG_SIZE]; static Atom warp_atom; @@ -112,35 +111,27 @@ return 0; } -Display *getDisplay(void) { - return display_connection; -} - -static void openDisplay(JNIEnv *env) { +static jlong openDisplay(JNIEnv *env) { async_x_error = false; XSetErrorHandler(errorHandler); - display_connection = XOpenDisplay(NULL); + Display *display_connection = XOpenDisplay(NULL); if (display_connection == NULL) { throwException(env, "Could not open X display connection"); - return; + return (intptr_t)NULL; } - current_screen = XDefaultScreen(getDisplay()); + current_screen = XDefaultScreen(display_connection); warp_atom = XInternAtom(display_connection, "_LWJGL_WARP", False); + return (intptr_t)display_connection; } Atom getWarpAtom(void) { return warp_atom; } -static void closeDisplay(void) { - XCloseDisplay(display_connection); - display_connection = NULL; -} - -static void waitMapped(Window win) { +static void waitMapped(Display *disp, Window win) { XEvent event; do { - XMaskEvent(getDisplay(), StructureNotifyMask, &event); + XMaskEvent(disp, StructureNotifyMask, &event); } while ((event.type != MapNotify) || (event.xmap.event != win)); } @@ -155,19 +146,19 @@ XCloseDisplay(disp); } -static void setDecorations(int dec) { - Atom motif_hints_atom = XInternAtom(getDisplay(), "_MOTIF_WM_HINTS", False); +static void setDecorations(Display *disp, int dec) { + Atom motif_hints_atom = XInternAtom(disp, "_MOTIF_WM_HINTS", False); MotifWmHints motif_hints; motif_hints.flags = MWM_HINTS_DECORATIONS; motif_hints.decorations = dec; - XChangeProperty (getDisplay(), getCurrentWindow(), motif_hints_atom, motif_hints_atom, 32, PropModeReplace, (unsigned char *)&motif_hints, sizeof(MotifWmHints)/sizeof(long)); + XChangeProperty(disp, getCurrentWindow(), motif_hints_atom, motif_hints_atom, 32, PropModeReplace, (unsigned char *)&motif_hints, sizeof(MotifWmHints)/sizeof(long)); } static bool isLegacyFullscreen(jint window_mode) { return window_mode == org_lwjgl_opengl_LinuxDisplay_FULLSCREEN_LEGACY; } -static void handleMessages(JNIEnv *env, jobject disp_obj) { +static void handleMessages(JNIEnv *env, Display *disp, jobject disp_obj) { XEvent event; jclass disp_class = (*env)->GetObjectClass(env, disp_obj); if (disp_class == NULL) @@ -196,8 +187,8 @@ jmethodID handleCloseEvent_method = (*env)->GetMethodID(env, disp_class, "handleCloseEvent", "()V"); if (handleCloseEvent_method == NULL) return; - while (!(*env)->ExceptionOccurred(env) && XPending(getDisplay()) > 0) { - XNextEvent(getDisplay(), &event); + while (!(*env)->ExceptionOccurred(env) && XPending(disp) > 0) { + XNextEvent(disp, &event); if (XFilterEvent(&event, None) == True) continue; // Ignore events from old windows @@ -234,16 +225,17 @@ } } -static void setWindowTitle(const char *title) { - XStoreName(getDisplay(), current_win, title); +static void setWindowTitle(Display *disp, const char *title) { + XStoreName(disp, current_win, title); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_openDisplay(JNIEnv *env, jclass clazz) { - openDisplay(env); +JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_LinuxDisplay_openDisplay(JNIEnv *env, jclass clazz) { + return openDisplay(env); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_closeDisplay(JNIEnv *env, jclass clazz) { - closeDisplay(); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_closeDisplay(JNIEnv *env, jclass clazz, jlong display) { + Display *disp = (Display *)(intptr_t)display; + XCloseDisplay(disp); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplayPeerInfo_initDrawable(JNIEnv *env, jclass clazz, jobject peer_info_handle) { @@ -254,46 +246,48 @@ peer_info->drawable = getCurrentWindow(); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplayPeerInfo_initDefaultPeerInfo(JNIEnv *env, jclass clazz, jobject peer_info_handle, jobject pixel_format) { - initPeerInfo(env, peer_info_handle, getDisplay(), getCurrentScreen(), pixel_format, true, GLX_WINDOW_BIT, true, false); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplayPeerInfo_initDefaultPeerInfo(JNIEnv *env, jclass clazz, jlong display, jobject peer_info_handle, jobject pixel_format) { + Display *disp = (Display *)(intptr_t)display; + initPeerInfo(env, peer_info_handle, disp, getCurrentScreen(), pixel_format, true, GLX_WINDOW_BIT, true, false); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSetTitle(JNIEnv * env, jclass clazz, jstring title_obj) { +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSetTitle(JNIEnv * env, jclass clazz, jlong display, jstring title_obj) { + Display *disp = (Display *)(intptr_t)display; char * title = GetStringNativeChars(env, title_obj); - setWindowTitle(title); + setWindowTitle(disp, title); free(title); } -static void freeIconPixmap() { +static void freeIconPixmap(Display *disp) { if (current_icon_pixmap != 0) { - XFreePixmap(getDisplay(), current_icon_pixmap); + XFreePixmap(disp, current_icon_pixmap); current_icon_pixmap = 0; } } -static void destroyWindow(JNIEnv *env) { +static void destroyWindow(JNIEnv *env, Display *disp) { if (glx_window != None) { - lwjgl_glXDestroyWindow(getDisplay(), glx_window); + lwjgl_glXDestroyWindow(disp, glx_window); glx_window = None; } - XDestroyWindow(getDisplay(), current_win); - XFreeColormap(getDisplay(), cmap); - freeIconPixmap(); + XDestroyWindow(disp, current_win); + XFreeColormap(disp, cmap); + freeIconPixmap(disp); } -static bool isNetWMFullscreenSupported(JNIEnv *env) { +static bool isNetWMFullscreenSupported(JNIEnv *env, Display *disp) { unsigned long nitems; Atom actual_type; int actual_format; unsigned long bytes_after; Atom *supported_list; - Atom netwm_supported_atom = XInternAtom(getDisplay(), "_NET_SUPPORTED", False); - int result = XGetWindowProperty(getDisplay(), RootWindow(getDisplay(), getCurrentScreen()), netwm_supported_atom, 0, 10000, False, AnyPropertyType, &actual_type, &actual_format, &nitems, &bytes_after, (void *)&supported_list); + Atom netwm_supported_atom = XInternAtom(disp, "_NET_SUPPORTED", False); + int result = XGetWindowProperty(disp, RootWindow(disp, getCurrentScreen()), netwm_supported_atom, 0, 10000, False, AnyPropertyType, &actual_type, &actual_format, &nitems, &bytes_after, (void *)&supported_list); if (result != Success) { throwException(env, "Unable to query _NET_SUPPORTED window property"); return false; } - Atom fullscreen_atom = XInternAtom(getDisplay(), "_NET_WM_STATE_FULLSCREEN", False); + Atom fullscreen_atom = XInternAtom(disp, "_NET_WM_STATE_FULLSCREEN", False); bool supported = false; unsigned long i; for (i = 0; i < nitems; i++) { @@ -306,26 +300,28 @@ return supported; } -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nIsNetWMFullscreenSupported(JNIEnv *env, jclass unused) { - return isNetWMFullscreenSupported(env) ? JNI_TRUE : JNI_FALSE; +JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nIsNetWMFullscreenSupported(JNIEnv *env, jclass unused, jlong display) { + Display *disp = (Display *)(intptr_t)display; + return isNetWMFullscreenSupported(env, disp) ? JNI_TRUE : JNI_FALSE; } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nReshape(JNIEnv *env, jclass clazz, jint x, jint y, jint width, jint height) { - XMoveWindow(getDisplay(), getCurrentWindow(), x, y); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nReshape(JNIEnv *env, jclass clazz, jlong display, jint x, jint y, jint width, jint height) { + Display *disp = (Display *)(intptr_t)display; + XMoveWindow(disp, getCurrentWindow(), x, y); } -static bool createWindow(JNIEnv* env, jint window_mode, X11PeerInfo *peer_info, int x, int y, int width, int height) { +static bool createWindow(JNIEnv* env, Display *disp, jint window_mode, X11PeerInfo *peer_info, int x, int y, int width, int height) { bool undecorated = getBooleanProperty(env, "org.lwjgl.opengl.Window.undecorated"); Window root_win; Window win; XSetWindowAttributes attribs; int attribmask; - root_win = RootWindow(getDisplay(), getCurrentScreen()); + root_win = RootWindow(disp, getCurrentScreen()); XVisualInfo *vis_info = getVisualInfoFromPeerInfo(env, peer_info); if (vis_info == NULL) return false; - cmap = XCreateColormap(getDisplay(), root_win, vis_info->visual, AllocNone); + cmap = XCreateColormap(disp, root_win, vis_info->visual, AllocNone); attribs.colormap = cmap; attribs.event_mask = ExposureMask | /*FocusChangeMask | */VisibilityChangeMask | StructureNotifyMask | KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask; attribs.background_pixel = 0xFF000000; @@ -335,21 +331,21 @@ attribmask |= CWOverrideRedirect; attribs.override_redirect = True; } - win = XCreateWindow(getDisplay(), root_win, x, y, width, height, 0, vis_info->depth, InputOutput, vis_info->visual, attribmask, &attribs); + win = XCreateWindow(disp, root_win, 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, getDisplay())) { - XFreeColormap(getDisplay(), cmap); + if (!checkXError(env, disp)) { + XFreeColormap(disp, cmap); return false; } printfDebugJava(env, "Created window"); current_win = win; if (window_mode != org_lwjgl_opengl_LinuxDisplay_WINDOWED || undecorated) { // Use Motif decoration hint property and hope the window manager respects them - setDecorations(0); + setDecorations(disp, 0); } XSizeHints * size_hints = XAllocSizeHints(); size_hints->flags = PMinSize | PMaxSize; @@ -357,20 +353,20 @@ size_hints->max_width = width; size_hints->min_height = height; size_hints->max_height = height; - XSetWMNormalHints(getDisplay(), win, size_hints); + XSetWMNormalHints(disp, win, size_hints); XFree(size_hints); - delete_atom = XInternAtom(getDisplay(), "WM_DELETE_WINDOW", False); - XSetWMProtocols(getDisplay(), win, &delete_atom, 1); + delete_atom = XInternAtom(disp, "WM_DELETE_WINDOW", False); + XSetWMProtocols(disp, win, &delete_atom, 1); if (window_mode == org_lwjgl_opengl_LinuxDisplay_FULLSCREEN_NETWM) { - Atom fullscreen_atom = XInternAtom(getDisplay(), "_NET_WM_STATE_FULLSCREEN", False); - XChangeProperty(getDisplay(), getCurrentWindow(), XInternAtom(getDisplay(), "_NET_WM_STATE", False), - XInternAtom(getDisplay(), "ATOM", False), 32, PropModeReplace, (const unsigned char*)&fullscreen_atom, 1); + Atom fullscreen_atom = XInternAtom(disp, "_NET_WM_STATE_FULLSCREEN", False); + XChangeProperty(disp, getCurrentWindow(), XInternAtom(disp, "_NET_WM_STATE", False), + XInternAtom(disp, "ATOM", False), 32, PropModeReplace, (const unsigned char*)&fullscreen_atom, 1); } - XMapRaised(getDisplay(), win); - waitMapped(win); - XClearWindow(getDisplay(), win); - if (!checkXError(env, getDisplay())) { - destroyWindow(env); + XMapRaised(disp, win); + waitMapped(disp, win); + XClearWindow(disp, win); + if (!checkXError(env, disp)) { + destroyWindow(env, disp); return false; } return true; @@ -380,12 +376,13 @@ return current_win; } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nUpdate - (JNIEnv *env, jobject disp_obj) { - handleMessages(env, disp_obj); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nUpdate(JNIEnv *env, jobject disp_obj, jlong display) { + Display *disp = (Display *)(intptr_t)display; + handleMessages(env, disp, disp_obj); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nCreateWindow(JNIEnv *env, jclass clazz, jobject peer_info_handle, jobject mode, jint window_mode, jint x, jint y) { +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nCreateWindow(JNIEnv *env, jclass clazz, jlong display, jobject peer_info_handle, jobject mode, jint window_mode, jint x, jint y) { + Display *disp = (Display *)(intptr_t)display; X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_info_handle); GLXFBConfig *fb_config = NULL; if (peer_info->glx13) { @@ -398,22 +395,23 @@ 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); - bool window_created = createWindow(env, window_mode, peer_info, x, y, width, height); + bool window_created = createWindow(env, disp, window_mode, peer_info, x, y, width, height); if (!window_created) { return; } if (peer_info->glx13) { - glx_window = lwjgl_glXCreateWindow(getDisplay(), *fb_config, getCurrentWindow(), NULL); + glx_window = lwjgl_glXCreateWindow(disp, *fb_config, getCurrentWindow(), NULL); XFree(fb_config); } - if (!checkXError(env, getDisplay())) { - lwjgl_glXDestroyWindow(getDisplay(), glx_window); - destroyWindow(env); + if (!checkXError(env, disp)) { + lwjgl_glXDestroyWindow(disp, glx_window); + destroyWindow(env, disp); } } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nDestroyWindow(JNIEnv *env, jclass clazz) { - destroyWindow(env); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nDestroyWindow(JNIEnv *env, jclass clazz, jlong display) { + Display *disp = (Display *)(intptr_t)display; + destroyWindow(env, disp); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nLockAWT(JNIEnv *env, jclass clazz) { @@ -436,10 +434,10 @@ jawt.Unlock(env); } -static void setIcon(JNIEnv *env, char *data, int icon_size, int width,int height) { +static void setIcon(JNIEnv *env, Display *disp, char *data, int icon_size, int width,int height) { XWMHints* win_hints; - freeIconPixmap(); - current_icon_pixmap = XCreatePixmap(getDisplay(), getCurrentWindow(), width, height, current_depth); + freeIconPixmap(disp); + current_icon_pixmap = XCreatePixmap(disp, getCurrentWindow(), width, height, current_depth); /* We need to copy the image data since XDestroyImage will also free its data buffer, which can't be allowed * since the data buffer is managed by the jvm (it's the storage for the direct ByteBuffer) */ @@ -450,17 +448,17 @@ return; } memcpy(icon_copy, data, icon_size); - XImage *image = XCreateImage(getDisplay(), current_visual, current_depth, ZPixmap, 0, icon_copy, width, height, 32, 0); + XImage *image = XCreateImage(disp, current_visual, current_depth, ZPixmap, 0, icon_copy, width, height, 32, 0); if (image == NULL) { - freeIconPixmap(); + freeIconPixmap(disp); free(icon_copy); throwException(env, "XCreateImage failed"); return; } - GC gc = XCreateGC(getDisplay(), current_icon_pixmap, 0, NULL); - XPutImage(getDisplay(), current_icon_pixmap, gc, image, 0, 0, 0, 0, width, height); - XFreeGC(getDisplay(), gc); + GC gc = XCreateGC(disp, current_icon_pixmap, 0, NULL); + XPutImage(disp, current_icon_pixmap, gc, image, 0, 0, 0, 0, width, height); + XFreeGC(disp, gc); XDestroyImage(image); // We won't free icon_copy because it is freed by XDestroyImage @@ -473,23 +471,20 @@ win_hints->flags = IconPixmapHint; win_hints->icon_pixmap = current_icon_pixmap; - XSetWMHints(getDisplay(), getCurrentWindow(), win_hints); + XSetWMHints(disp, getCurrentWindow(), win_hints); XFree(win_hints); - XFlush(getDisplay()); + XFlush(disp); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSetWindowIcon - (JNIEnv *env, jclass clazz, jobject iconBuffer, jint icon_size, jint width, jint height) + (JNIEnv *env, jclass clazz, jlong display, jobject iconBuffer, jint icon_size, jint width, jint height) { + Display *disp = (Display *)(intptr_t)display; char *imgData = (char *)(*env)->GetDirectBufferAddress(env, iconBuffer); - setIcon(env, imgData, icon_size, width, height); + setIcon(env, disp, imgData, icon_size, width, height); } -JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_LinuxDisplay_getDisplay(JNIEnv *env, jclass unused) { - return (intptr_t)getDisplay(); -} - JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_LinuxDisplay_getWindow(JNIEnv *env, jclass unused) { return getCurrentWindow(); } Modified: trunk/LWJGL/src/native/linux/org_lwjgl_opengl_LinuxCanvasImplementation.c =================================================================== --- trunk/LWJGL/src/native/linux/org_lwjgl_opengl_LinuxCanvasImplementation.c 2006-10-23 10:24:03 UTC (rev 2590) +++ trunk/LWJGL/src/native/linux/org_lwjgl_opengl_LinuxCanvasImplementation.c 2006-10-23 13:58:33 UTC (rev 2591) @@ -47,13 +47,14 @@ #include "Window.h" JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxCanvasImplementation_nFindVisualIDFromFormat - (JNIEnv *env, jclass clazz, jint screen, jobject pixel_format) { + (JNIEnv *env, jclass clazz, jlong display, jint screen, jobject pixel_format) { + Display *disp = (Display *)(intptr_t)display; GLXExtensions extension_flags; - if (!extgl_InitGLX(getDisplay(), screen, &extension_flags)) { + if (!extgl_InitGLX(disp, screen, &extension_flags)) { throwException(env, "Could not initialize GLX"); return -1; } - XVisualInfo *vis_info = chooseVisualGLX(env, getDisplay(), screen, pixel_format, true, true); + XVisualInfo *vis_info = chooseVisualGLX(env, disp, screen, pixel_format, true, true); if (vis_info == NULL) { throwException(env, "Could not choose a VisualInfo"); return -1; Modified: trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Pbuffer.c =================================================================== --- trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Pbuffer.c 2006-10-23 10:24:03 UTC (rev 2590) +++ trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Pbuffer.c 2006-10-23 13:58:33 UTC (rev 2591) @@ -48,23 +48,25 @@ #include "common_tools.h" JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetPbufferCapabilities - (JNIEnv *env, jclass clazz) + (JNIEnv *env, jclass clazz, jlong display) { + Display *disp = (Display *)(intptr_t)display; GLXExtensions extension_flags; - if (!extgl_InitGLX(getDisplay(), getCurrentScreen(), &extension_flags)) + if (!extgl_InitGLX(disp, getCurrentScreen(), &extension_flags)) return 0; // Only support the GLX 1.3 Pbuffers and ignore the GLX_SGIX_pbuffer extension return extension_flags.GLX13 ? org_lwjgl_opengl_Pbuffer_PBUFFER_SUPPORTED : 0; } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxPbufferPeerInfo_nInitHandle - (JNIEnv *env, jclass clazz, jobject peer_info_handle, jint width, jint height, jobject pixel_format) { + (JNIEnv *env, jclass clazz, jlong display, jobject peer_info_handle, jint width, jint height, jobject pixel_format) { + Display *disp = (Display *)(intptr_t)display; GLXExtensions extension_flags; - if (!extgl_InitGLX(getDisplay(), getCurrentScreen(), &extension_flags) || !extension_flags.GLX13) { + if (!extgl_InitGLX(disp, getCurrentScreen(), &extension_flags) || !extension_flags.GLX13) { throwException(env, "No Pbuffer support"); return; } - bool result = initPeerInfo(env, peer_info_handle, getDisplay(), getCurrentScreen(), pixel_format, false, GLX_PBUFFER_BIT, false, true); + bool result = initPeerInfo(env, peer_info_handle, disp, getCurrentScreen(), pixel_format, false, GLX_PBUFFER_BIT, false, true); if (!result) return; const int buffer_attribs[] = {GLX_PBUFFER_WIDTH, width, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2006-10-23 14:16:51
|
Revision: 2593 http://svn.sourceforge.net/java-game-lib/?rev=2593&view=rev Author: elias_naur Date: 2006-10-23 07:16:40 -0700 (Mon, 23 Oct 2006) Log Message: ----------- Linux: Moved another Display instance to java Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java trunk/LWJGL/src/native/linux/display.c trunk/LWJGL/src/native/linux/display.h Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2006-10-23 14:05:40 UTC (rev 2592) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2006-10-23 14:16:40 UTC (rev 2593) @@ -485,14 +485,23 @@ private void doSetGamma(ByteBuffer native_gamma) throws LWJGLException { lockAWT(); try { - nSetGammaRamp(getScreen(), native_gamma); + setGammaRampOnTmpDisplay(native_gamma); current_gamma = native_gamma; } finally { unlockAWT(); } } - private static native void nSetGammaRamp(int screen, ByteBuffer gammaRamp) throws LWJGLException; + private void setGammaRampOnTmpDisplay(ByteBuffer native_gamma) throws LWJGLException { + long tmp_display = openDisplay(); + try { + nSetGammaRamp(tmp_display, getScreen(), native_gamma); + } finally { + closeDisplay(tmp_display); + } + } + private static native void nSetGammaRamp(long display, int screen, ByteBuffer gammaRamp) throws LWJGLException; + private static ByteBuffer convertToNativeRamp(FloatBuffer ramp) throws LWJGLException { return nConvertToNativeRamp(ramp, ramp.position(), ramp.remaining()); } @@ -696,7 +705,7 @@ nIconifyWindow(getDisplay(), getWindow(), getScreen()); try { nSwitchDisplayMode(getScreen(), current_displaymode_extension, saved_mode); - nSetGammaRamp(getScreen(), saved_gamma); + setGammaRampOnTmpDisplay(saved_gamma); } catch (LWJGLException e) { LWJGLUtil.log("Failed to restore saved mode: " + e.getMessage()); } @@ -713,7 +722,7 @@ if (current_window_mode == FULLSCREEN_NETWM) { try { nSwitchDisplayMode(getScreen(), current_displaymode_extension, current_mode); - nSetGammaRamp(getScreen(), current_gamma); + setGammaRampOnTmpDisplay(current_gamma); } catch (LWJGLException e) { LWJGLUtil.log("Failed to restore mode: " + e.getMessage()); } Modified: trunk/LWJGL/src/native/linux/display.c =================================================================== --- trunk/LWJGL/src/native/linux/display.c 2006-10-23 14:05:40 UTC (rev 2592) +++ trunk/LWJGL/src/native/linux/display.c 2006-10-23 14:16:40 UTC (rev 2593) @@ -319,16 +319,6 @@ } } -void setGammaRamp(JNIEnv *env, int screen, jobject gamma_ramp_buffer) { - Display * disp = XOpenDisplay(NULL); - if (disp == NULL) { - throwException(env, "Could not open display"); - return; - } - setGamma(env, disp, screen, gamma_ramp_buffer); - XCloseDisplay(disp); -} - bool switchDisplayMode(JNIEnv * env, int screen, jint extension, jobject mode) { if (mode == NULL) { throwException(env, "mode must be non-null"); @@ -422,7 +412,8 @@ return (jint)getGammaRampLengthOfDisplay(env, disp, screen); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSetGammaRamp(JNIEnv *env, jclass clazz, jint screen, jobject gamma_buffer) { - setGammaRamp(env, screen, gamma_buffer); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSetGammaRamp(JNIEnv *env, jclass clazz, jlong display, jint screen, jobject gamma_buffer) { + Display *disp = (Display *)(intptr_t)display; + setGamma(env, disp, screen, gamma_buffer); } Modified: trunk/LWJGL/src/native/linux/display.h =================================================================== --- trunk/LWJGL/src/native/linux/display.h 2006-10-23 14:05:40 UTC (rev 2592) +++ trunk/LWJGL/src/native/linux/display.h 2006-10-23 14:16:40 UTC (rev 2593) @@ -46,6 +46,5 @@ #include "common_tools.h" extern bool switchDisplayMode(JNIEnv * env, int screen, jint extension, jobject mode); -extern void setGammaRamp(JNIEnv *env, int screen, jobject gamma_ramp_buffer); #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2006-10-23 14:23:22
|
Revision: 2594 http://svn.sourceforge.net/java-game-lib/?rev=2594&view=rev Author: elias_naur Date: 2006-10-23 07:22:27 -0700 (Mon, 23 Oct 2006) Log Message: ----------- Linux: Moved another Display instance to java Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java trunk/LWJGL/src/native/linux/display.c trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c Removed Paths: ------------- trunk/LWJGL/src/native/linux/display.h Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2006-10-23 14:16:40 UTC (rev 2593) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2006-10-23 14:22:27 UTC (rev 2594) @@ -430,14 +430,23 @@ public void switchDisplayMode(DisplayMode mode) throws LWJGLException { lockAWT(); try { - nSwitchDisplayMode(getScreen(), current_displaymode_extension, mode); + switchDisplayModeOnTmpDisplay(mode); current_mode = mode; } finally { unlockAWT(); } } - private static native void nSwitchDisplayMode(int screen, int extension, DisplayMode mode) throws LWJGLException; + private void switchDisplayModeOnTmpDisplay(DisplayMode mode) throws LWJGLException { + long tmp_display = openDisplay(); + try { + nSwitchDisplayMode(tmp_display, getScreen(), current_displaymode_extension, mode); + } finally { + closeDisplay(tmp_display); + } + } + private static native void nSwitchDisplayMode(long display, int screen, int extension, DisplayMode mode) throws LWJGLException; + public void resetDisplayMode() { lockAWT(); try { @@ -704,7 +713,7 @@ if (current_window_mode == FULLSCREEN_NETWM) { nIconifyWindow(getDisplay(), getWindow(), getScreen()); try { - nSwitchDisplayMode(getScreen(), current_displaymode_extension, saved_mode); + switchDisplayModeOnTmpDisplay(saved_mode); setGammaRampOnTmpDisplay(saved_gamma); } catch (LWJGLException e) { LWJGLUtil.log("Failed to restore saved mode: " + e.getMessage()); @@ -721,7 +730,7 @@ updateInputGrab(); if (current_window_mode == FULLSCREEN_NETWM) { try { - nSwitchDisplayMode(getScreen(), current_displaymode_extension, current_mode); + switchDisplayModeOnTmpDisplay(current_mode); setGammaRampOnTmpDisplay(current_gamma); } catch (LWJGLException e) { LWJGLUtil.log("Failed to restore mode: " + e.getMessage()); Modified: trunk/LWJGL/src/native/linux/display.c =================================================================== --- trunk/LWJGL/src/native/linux/display.c 2006-10-23 14:16:40 UTC (rev 2593) +++ trunk/LWJGL/src/native/linux/display.c 2006-10-23 14:22:27 UTC (rev 2594) @@ -47,7 +47,6 @@ #include <stdio.h> #include <stdlib.h> #include <math.h> -#include "display.h" #include "common_tools.h" #include "Window.h" #include "org_lwjgl_opengl_LinuxDisplay.h" @@ -319,7 +318,7 @@ } } -bool switchDisplayMode(JNIEnv * env, int screen, jint extension, jobject mode) { +static bool switchDisplayMode(JNIEnv * env, Display *disp, int screen, jint extension, jobject mode) { if (mode == NULL) { throwException(env, "mode must be non-null"); return false; @@ -331,17 +330,11 @@ int width = (*env)->GetIntField(env, mode, fid_width); int height = (*env)->GetIntField(env, mode, fid_height); int freq = (*env)->GetIntField(env, mode, fid_freq); - Display *disp = XOpenDisplay(NULL); - if (disp == NULL) { - throwException(env, "Could not open display"); - return false; - } if (!setMode(env, disp, screen, extension, width, height, freq)) { XCloseDisplay(disp); throwException(env, "Could not switch mode."); return false; } - XCloseDisplay(disp); return true; } @@ -403,8 +396,9 @@ return getAvailableDisplayModes(env, disp, getCurrentScreen(), extension); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSwitchDisplayMode(JNIEnv *env, jclass clazz, jint screen, jint extension, jobject mode) { - switchDisplayMode(env, screen, extension, mode); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSwitchDisplayMode(JNIEnv *env, jclass clazz, jlong display, jint screen, jint extension, jobject mode) { + Display *disp = (Display *)(intptr_t)display; + switchDisplayMode(env, disp, screen, extension, mode); } JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetGammaRampLength(JNIEnv *env, jclass clazz, jlong display_ptr, jint screen) { Deleted: trunk/LWJGL/src/native/linux/display.h =================================================================== --- trunk/LWJGL/src/native/linux/display.h 2006-10-23 14:16:40 UTC (rev 2593) +++ trunk/LWJGL/src/native/linux/display.h 2006-10-23 14:22:27 UTC (rev 2594) @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2002-2004 LWJGL Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of 'LWJGL' nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * $Id$ - * - * Linux specific library for display handling. - * - * @author elias_naur <eli...@us...> - * @version $Revision$ - */ - -#ifndef _DISPLAY_H -#define _DISPLAY_H - -#include <jni.h> -#include "common_tools.h" - -extern bool switchDisplayMode(JNIEnv * env, int screen, jint extension, jobject mode); - -#endif Modified: trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c =================================================================== --- trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c 2006-10-23 14:16:40 UTC (rev 2593) +++ trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c 2006-10-23 14:22:27 UTC (rev 2594) @@ -53,7 +53,6 @@ #include "extgl_glx.h" #include "Window.h" #include "context.h" -#include "display.h" #include "org_lwjgl_opengl_LinuxDisplay.h" #include "org_lwjgl_opengl_LinuxDisplayPeerInfo.h" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2006-10-23 19:51:46
|
Revision: 2595 http://svn.sourceforge.net/java-game-lib/?rev=2595&view=rev Author: elias_naur Date: 2006-10-23 12:51:22 -0700 (Mon, 23 Oct 2006) Log Message: ----------- Linux: Moved the pointer warp X11 atom from native to java Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c trunk/LWJGL/src/native/linux/org_lwjgl_opengl_LinuxMouse.c Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2006-10-23 14:22:27 UTC (rev 2594) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2006-10-23 19:51:22 UTC (rev 2595) @@ -84,6 +84,9 @@ /** Current mode swithcing API */ private int current_displaymode_extension = NONE; + /** Atom used for the pointer warp messages */ + private long warp_atom; + private PeerInfo peer_info; /** Saved gamma used to restore display settings */ @@ -447,6 +450,20 @@ } private static native void nSwitchDisplayMode(long display, int screen, int extension, DisplayMode mode) throws LWJGLException; + static long getWarpAtom() throws LWJGLException { + return internAtom("_LWJGL", false); + } + + private static long internAtom(String atom_name, boolean only_if_exists) throws LWJGLException { + incDisplay(); + try { + return nInternAtom(getDisplay(), atom_name, only_if_exists); + } finally { + decDisplay(); + } + } + private static native long nInternAtom(long display, String atom_name, boolean only_if_exists); + public void resetDisplayMode() { lockAWT(); try { @@ -527,6 +544,7 @@ public DisplayMode init() throws LWJGLException { lockAWT(); try { + warp_atom = getWarpAtom(); current_displaymode_extension = getBestDisplayModeExtension(); if (current_displaymode_extension == NONE) throw new LWJGLException("No display mode extension is available"); @@ -607,7 +625,7 @@ public void update() { lockAWT(); try { - nUpdate(getDisplay()); + nUpdate(getDisplay(), warp_atom); checkInput(); } catch (LWJGLException e) { LWJGLUtil.log("Caught exception while processing messages: " + e); @@ -615,7 +633,7 @@ unlockAWT(); } } - private native void nUpdate(long display) throws LWJGLException; + private native void nUpdate(long display, long warp_atom) throws LWJGLException; public void reshape(int x, int y, int width, int height) { lockAWT(); @@ -655,7 +673,7 @@ public void createMouse() { lockAWT(); try { - mouse = new LinuxMouse(getDisplay(), getWindow()); + mouse = new LinuxMouse(getDisplay(), getWindow(), warp_atom); } finally { unlockAWT(); } Modified: trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c =================================================================== --- trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c 2006-10-23 14:22:27 UTC (rev 2594) +++ trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c 2006-10-23 19:51:22 UTC (rev 2595) @@ -81,7 +81,6 @@ static int current_screen; static bool async_x_error; static char error_message[ERR_MSG_SIZE]; -static Atom warp_atom; int getCurrentScreen(void) { return current_screen; @@ -119,12 +118,18 @@ return (intptr_t)NULL; } current_screen = XDefaultScreen(display_connection); - warp_atom = XInternAtom(display_connection, "_LWJGL_WARP", False); return (intptr_t)display_connection; } -Atom getWarpAtom(void) { - return warp_atom; + +JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nInternAtom(JNIEnv *env, jclass unused, jlong display_ptr, jstring atom_name_obj, jboolean only_if_exists) { + Display *disp = (Display *)(intptr_t)display_ptr; + char *atom_name = GetStringNativeChars(env, atom_name_obj); + if (atom_name == NULL) + return 0; + Atom atom = XInternAtom(disp, atom_name, only_if_exists ? True : False); + free(atom_name); + return atom; } static void waitMapped(Display *disp, Window win) { @@ -157,7 +162,7 @@ return window_mode == org_lwjgl_opengl_LinuxDisplay_FULLSCREEN_LEGACY; } -static void handleMessages(JNIEnv *env, Display *disp, jobject disp_obj) { +static void handleMessages(JNIEnv *env, Display *disp, jobject disp_obj, Atom warp_atom) { XEvent event; jclass disp_class = (*env)->GetObjectClass(env, disp_obj); if (disp_class == NULL) @@ -375,9 +380,10 @@ return current_win; } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nUpdate(JNIEnv *env, jobject disp_obj, jlong display) { +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nUpdate(JNIEnv *env, jobject disp_obj, jlong display, jlong warp_atom_ptr) { Display *disp = (Display *)(intptr_t)display; - handleMessages(env, disp, disp_obj); + Atom warp_atom = (Atom)warp_atom_ptr; + handleMessages(env, disp, disp_obj, warp_atom); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nCreateWindow(JNIEnv *env, jclass clazz, jlong display, jobject peer_info_handle, jobject mode, jint window_mode, jint x, jint y) { Modified: trunk/LWJGL/src/native/linux/org_lwjgl_opengl_LinuxMouse.c =================================================================== --- trunk/LWJGL/src/native/linux/org_lwjgl_opengl_LinuxMouse.c 2006-10-23 14:22:27 UTC (rev 2594) +++ trunk/LWJGL/src/native/linux/org_lwjgl_opengl_LinuxMouse.c 2006-10-23 19:51:22 UTC (rev 2595) @@ -91,13 +91,14 @@ return root_return; } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxMouse_nSendWarpEvent(JNIEnv *env, jclass unusued, jlong display_ptr, jlong window_ptr, jint x, jint y) { +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxMouse_nSendWarpEvent(JNIEnv *env, jclass unusued, jlong display_ptr, jlong window_ptr, jlong warp_atom_ptr, jint x, jint y) { + Atom warp_atom = (Atom)warp_atom_ptr; Display *disp = (Display *)(intptr_t)display_ptr; Window win = (Window)window_ptr; XEvent warp_event; warp_event.type = ClientMessage; warp_event.xclient.window = win; - warp_event.xclient.message_type = getWarpAtom(); + warp_event.xclient.message_type = warp_atom; warp_event.xclient.format = 32; warp_event.xclient.data.l[0] = x; warp_event.xclient.data.l[1] = y; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2006-10-23 20:30:39
|
Revision: 2596 http://svn.sourceforge.net/java-game-lib/?rev=2596&view=rev Author: elias_naur Date: 2006-10-23 13:14:45 -0700 (Mon, 23 Oct 2006) Log Message: ----------- Linux: Moved screen from native to java Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplayPeerInfo.java trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxMouse.java trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxPbufferPeerInfo.java trunk/LWJGL/src/native/linux/Window.h trunk/LWJGL/src/native/linux/display.c trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Pbuffer.c Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2006-10-23 19:51:22 UTC (rev 2595) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2006-10-23 20:14:45 UTC (rev 2596) @@ -117,7 +117,7 @@ incDisplay(); try { if (isXF86VidModeSupported()) - return nGetCurrentGammaRamp(getDisplay()); + return nGetCurrentGammaRamp(getDisplay(), getDefaultScreen()); else return null; } finally { @@ -127,7 +127,7 @@ unlockAWT(); } } - private static native ByteBuffer nGetCurrentGammaRamp(long display) throws LWJGLException; + private static native ByteBuffer nGetCurrentGammaRamp(long display, int screen) throws LWJGLException; private static int getBestDisplayModeExtension() { int result; @@ -189,7 +189,7 @@ try { incDisplay(); try { - return nIsNetWMFullscreenSupported(getDisplay()); + return nIsNetWMFullscreenSupported(getDisplay(), getDefaultScreen()); } finally { decDisplay(); } @@ -200,7 +200,7 @@ unlockAWT(); } } - private static native boolean nIsNetWMFullscreenSupported(long display) throws LWJGLException; + private static native boolean nIsNetWMFullscreenSupported(long display, int screen) throws LWJGLException; /* Since Xlib is not guaranteed to be thread safe, we need a way to synchronize LWJGL * Xlib calls with AWT Xlib calls. Fortunately, JAWT implements Lock()/Unlock() to @@ -289,7 +289,11 @@ return display; } - private static native int getScreen(); + static int getDefaultScreen() { + return nGetDefaultScreen(getDisplay()); + } + private static native int nGetDefaultScreen(long display); + private static native long getWindow(); private void ungrabKeyboard() { @@ -316,7 +320,7 @@ pointer_grabbed = true; // make sure we have a centered window if (isLegacyFullscreen()) { - nSetViewPort(getDisplay(), getWindow(), getScreen()); + nSetViewPort(getDisplay(), getWindow(), getDefaultScreen()); } } } @@ -379,7 +383,7 @@ ByteBuffer handle = peer_info.lockAndGetHandle(); try { current_window_mode = getWindowMode(fullscreen); - nCreateWindow(getDisplay(), handle, mode, current_window_mode, x, y); + nCreateWindow(getDisplay(), getDefaultScreen(), handle, mode, current_window_mode, x, y); blank_cursor = createBlankCursor(); current_cursor = null; focused = true; @@ -403,7 +407,7 @@ unlockAWT(); } } - private static native void nCreateWindow(long display, ByteBuffer peer_info_handle, DisplayMode mode, int window_mode, int x, int y) throws LWJGLException; + private static native void nCreateWindow(long display, int screen, ByteBuffer peer_info_handle, DisplayMode mode, int window_mode, int x, int y) throws LWJGLException; private void updateInputGrab() { updatePointerGrab(); @@ -443,7 +447,7 @@ private void switchDisplayModeOnTmpDisplay(DisplayMode mode) throws LWJGLException { long tmp_display = openDisplay(); try { - nSwitchDisplayMode(tmp_display, getScreen(), current_displaymode_extension, mode); + nSwitchDisplayMode(tmp_display, nGetDefaultScreen(tmp_display), current_displaymode_extension, mode); } finally { closeDisplay(tmp_display); } @@ -485,7 +489,7 @@ try { incDisplay(); try { - return nGetGammaRampLength(getDisplay(), getScreen()); + return nGetGammaRampLength(getDisplay(), getDefaultScreen()); } catch (LWJGLException e) { LWJGLUtil.log("Got exception while querying gamma length: " + e); return 0; @@ -521,7 +525,7 @@ private void setGammaRampOnTmpDisplay(ByteBuffer native_gamma) throws LWJGLException { long tmp_display = openDisplay(); try { - nSetGammaRamp(tmp_display, getScreen(), native_gamma); + nSetGammaRamp(tmp_display, nGetDefaultScreen(tmp_display), native_gamma); } finally { closeDisplay(tmp_display); } @@ -575,7 +579,7 @@ try { incDisplay(); try { - return nGetCurrentXRandrMode(getDisplay()); + return nGetCurrentXRandrMode(getDisplay(), getDefaultScreen()); } finally { decDisplay(); } @@ -585,7 +589,7 @@ } /** Assumes extension == XRANDR */ - private static native DisplayMode nGetCurrentXRandrMode(long display) throws LWJGLException; + private static native DisplayMode nGetCurrentXRandrMode(long display, int screen) throws LWJGLException; public void setTitle(String title) { lockAWT(); @@ -650,7 +654,7 @@ try { incDisplay(); try { - DisplayMode[] modes = nGetAvailableDisplayModes(getDisplay(), current_displaymode_extension); + DisplayMode[] modes = nGetAvailableDisplayModes(getDisplay(), getDefaultScreen(), current_displaymode_extension); return modes; } finally { decDisplay(); @@ -659,7 +663,7 @@ unlockAWT(); } } - private static native DisplayMode[] nGetAvailableDisplayModes(long display, int extension) throws LWJGLException; + private static native DisplayMode[] nGetAvailableDisplayModes(long display, int screen, int extension) throws LWJGLException; /* Mouse */ public boolean hasWheel() { @@ -729,7 +733,7 @@ nSetRepeatMode(getDisplay(), AutoRepeatModeDefault); updateInputGrab(); if (current_window_mode == FULLSCREEN_NETWM) { - nIconifyWindow(getDisplay(), getWindow(), getScreen()); + nIconifyWindow(getDisplay(), getWindow(), getDefaultScreen()); try { switchDisplayModeOnTmpDisplay(saved_mode); setGammaRampOnTmpDisplay(saved_gamma); @@ -919,7 +923,7 @@ try { incDisplay(); try { - return nGetPbufferCapabilities(getDisplay()); + return nGetPbufferCapabilities(getDisplay(), getDefaultScreen()); } finally { decDisplay(); } @@ -930,7 +934,7 @@ unlockAWT(); } } - private static native int nGetPbufferCapabilities(long display); + private static native int nGetPbufferCapabilities(long display, int screen); public boolean isBufferLost(PeerInfo handle) { return false; Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplayPeerInfo.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplayPeerInfo.java 2006-10-23 19:51:22 UTC (rev 2595) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplayPeerInfo.java 2006-10-23 20:14:45 UTC (rev 2596) @@ -49,7 +49,7 @@ try { LinuxDisplay.incDisplay(); try { - initDefaultPeerInfo(LinuxDisplay.getDisplay(), getHandle(), pixel_format); + initDefaultPeerInfo(LinuxDisplay.getDisplay(), LinuxDisplay.getDefaultScreen(), getHandle(), pixel_format); } catch (LWJGLException e) { LinuxDisplay.decDisplay(); throw e; @@ -62,7 +62,7 @@ LinuxDisplay.unlockAWT(); } } - private static native void initDefaultPeerInfo(long display, ByteBuffer peer_info_handle, PixelFormat pixel_format) throws LWJGLException; + private static native void initDefaultPeerInfo(long display, int screen, ByteBuffer peer_info_handle, PixelFormat pixel_format) throws LWJGLException; protected void doLockAndInitHandle() throws LWJGLException { LinuxDisplay.lockAWT(); Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxMouse.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxMouse.java 2006-10-23 19:51:22 UTC (rev 2595) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxMouse.java 2006-10-23 20:14:45 UTC (rev 2596) @@ -63,6 +63,7 @@ private final long display; private final long window; + private final long warp_atom; private final IntBuffer query_pointer_buffer = BufferUtils.createIntBuffer(4); private final ByteBuffer event_buffer = ByteBuffer.allocate(Mouse.EVENT_SIZE); @@ -75,9 +76,10 @@ private EventQueue event_queue; private long last_event_nanos; - public LinuxMouse(long display, long window) { + public LinuxMouse(long display, long window, long warp_atom) { this.display = display; this.window = window; + this.warp_atom = warp_atom; reset(); } @@ -130,10 +132,10 @@ } private void doWarpPointer(int center_x, int center_y) { - nSendWarpEvent(display, window, center_x, center_y); + nSendWarpEvent(display, window, warp_atom, center_x, center_y); nWarpCursor(display, window, center_x, center_y); } - private static native void nSendWarpEvent(long display, long window, int center_x, int center_y); + private static native void nSendWarpEvent(long display, long window, long warp_atom, int center_x, int center_y); private void doHandlePointerMotion(boolean grab, boolean warp_pointer, long root_window, int root_x, int root_y, int win_x, int win_y, long nanos) { setCursorPos(grab, win_x, win_y, nanos); Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxPbufferPeerInfo.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxPbufferPeerInfo.java 2006-10-23 19:51:22 UTC (rev 2595) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxPbufferPeerInfo.java 2006-10-23 20:14:45 UTC (rev 2596) @@ -49,7 +49,7 @@ try { LinuxDisplay.incDisplay(); try { - nInitHandle(LinuxDisplay.getDisplay(), getHandle(), width, height, pixel_format); + nInitHandle(LinuxDisplay.getDisplay(), LinuxDisplay.getDefaultScreen(), getHandle(), width, height, pixel_format); } catch (LWJGLException e) { LinuxDisplay.decDisplay(); throw e; @@ -62,7 +62,7 @@ LinuxDisplay.unlockAWT(); } } - private static native void nInitHandle(long display, ByteBuffer handle, int width, int height, PixelFormat pixel_format) throws LWJGLException; + private static native void nInitHandle(long display, int screen, ByteBuffer handle, int width, int height, PixelFormat pixel_format) throws LWJGLException; public void destroy() { LinuxDisplay.lockAWT(); Modified: trunk/LWJGL/src/native/linux/Window.h =================================================================== --- trunk/LWJGL/src/native/linux/Window.h 2006-10-23 19:51:22 UTC (rev 2595) +++ trunk/LWJGL/src/native/linux/Window.h 2006-10-23 20:14:45 UTC (rev 2596) @@ -50,19 +50,8 @@ #include "extgl_glx.h" extern bool checkXError(JNIEnv *, Display *); - extern Atom getWarpAtom(void); - - /* - * get the current display - */ - extern Display *getDisplay(void); /* - * get the current screen - */ - extern int getCurrentScreen(void); - - /* * get the current window */ extern Window getCurrentWindow(void); Modified: trunk/LWJGL/src/native/linux/display.c =================================================================== --- trunk/LWJGL/src/native/linux/display.c 2006-10-23 19:51:22 UTC (rev 2595) +++ trunk/LWJGL/src/native/linux/display.c 2006-10-23 20:14:45 UTC (rev 2596) @@ -288,16 +288,16 @@ return native_ramp; } -JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetCurrentGammaRamp(JNIEnv *env, jclass unused, jlong display) { +JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetCurrentGammaRamp(JNIEnv *env, jclass unused, jlong display, jint screen) { Display *disp = (Display *)(intptr_t)display; - int ramp_size = getGammaRampLengthOfDisplay(env, disp, getCurrentScreen()); + int ramp_size = getGammaRampLengthOfDisplay(env, disp, screen); jobject ramp_buffer = newJavaManagedByteBuffer(env, sizeof(unsigned short)*3*ramp_size); if (ramp_buffer == NULL) { throwException(env, "Could not allocate gamma ramp buffer"); return NULL; } unsigned short *ramp = (unsigned short *)(*env)->GetDirectBufferAddress(env, ramp_buffer); - if (!XF86VidModeGetGammaRamp(disp, getCurrentScreen(), ramp_size, ramp, + if (!XF86VidModeGetGammaRamp(disp, screen, ramp_size, ramp, ramp + ramp_size, ramp + ramp_size*2)) { throwException(env, "Could not get the current gamma ramp"); return NULL; @@ -386,14 +386,14 @@ return displayMode; } -JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetCurrentXRandrMode(JNIEnv *env, jclass unused, jlong display) { +JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetCurrentXRandrMode(JNIEnv *env, jclass unused, jlong display, jint screen) { Display *disp = (Display *)(intptr_t)display; - return getCurrentXRandrMode(env, disp, getCurrentScreen()); + return getCurrentXRandrMode(env, disp, screen); } -JNIEXPORT jobjectArray JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetAvailableDisplayModes(JNIEnv *env, jclass clazz, jlong display, jint extension) { +JNIEXPORT jobjectArray JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetAvailableDisplayModes(JNIEnv *env, jclass clazz, jlong display, jint screen, jint extension) { Display *disp = (Display *)(intptr_t)display; - return getAvailableDisplayModes(env, disp, getCurrentScreen(), extension); + return getAvailableDisplayModes(env, disp, screen, extension); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSwitchDisplayMode(JNIEnv *env, jclass clazz, jlong display, jint screen, jint extension, jobject mode) { Modified: trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c =================================================================== --- trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c 2006-10-23 19:51:22 UTC (rev 2595) +++ trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c 2006-10-23 20:14:45 UTC (rev 2596) @@ -78,14 +78,9 @@ static Visual *current_visual; -static int current_screen; static bool async_x_error; static char error_message[ERR_MSG_SIZE]; -int getCurrentScreen(void) { - return current_screen; -} - bool checkXError(JNIEnv *env, Display *disp) { XSync(disp, False); if (async_x_error) { @@ -117,10 +112,13 @@ throwException(env, "Could not open X display connection"); return (intptr_t)NULL; } - current_screen = XDefaultScreen(display_connection); return (intptr_t)display_connection; } +JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetDefaultScreen(JNIEnv *env, jclass unused, jlong display_ptr) { + Display *disp = (Display *)(intptr_t)display_ptr; + return XDefaultScreen(disp); +} JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nInternAtom(JNIEnv *env, jclass unused, jlong display_ptr, jstring atom_name_obj, jboolean only_if_exists) { Display *disp = (Display *)(intptr_t)display_ptr; @@ -250,9 +248,9 @@ peer_info->drawable = getCurrentWindow(); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplayPeerInfo_initDefaultPeerInfo(JNIEnv *env, jclass clazz, jlong display, jobject peer_info_handle, jobject pixel_format) { +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplayPeerInfo_initDefaultPeerInfo(JNIEnv *env, jclass clazz, jlong display, jint screen, jobject peer_info_handle, jobject pixel_format) { Display *disp = (Display *)(intptr_t)display; - initPeerInfo(env, peer_info_handle, disp, getCurrentScreen(), pixel_format, true, GLX_WINDOW_BIT, true, false); + 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, jstring title_obj) { @@ -279,14 +277,14 @@ freeIconPixmap(disp); } -static bool isNetWMFullscreenSupported(JNIEnv *env, Display *disp) { +static bool isNetWMFullscreenSupported(JNIEnv *env, Display *disp, int screen) { unsigned long nitems; Atom actual_type; int actual_format; unsigned long bytes_after; Atom *supported_list; Atom netwm_supported_atom = XInternAtom(disp, "_NET_SUPPORTED", False); - int result = XGetWindowProperty(disp, RootWindow(disp, getCurrentScreen()), netwm_supported_atom, 0, 10000, False, AnyPropertyType, &actual_type, &actual_format, &nitems, &bytes_after, (void *)&supported_list); + int result = XGetWindowProperty(disp, RootWindow(disp, screen), netwm_supported_atom, 0, 10000, False, AnyPropertyType, &actual_type, &actual_format, &nitems, &bytes_after, (void *)&supported_list); if (result != Success) { throwException(env, "Unable to query _NET_SUPPORTED window property"); return false; @@ -304,9 +302,9 @@ return supported; } -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nIsNetWMFullscreenSupported(JNIEnv *env, jclass unused, jlong display) { +JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nIsNetWMFullscreenSupported(JNIEnv *env, jclass unused, jlong display, jint screen) { Display *disp = (Display *)(intptr_t)display; - return isNetWMFullscreenSupported(env, disp) ? JNI_TRUE : JNI_FALSE; + return isNetWMFullscreenSupported(env, disp, screen) ? JNI_TRUE : JNI_FALSE; } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nReshape(JNIEnv *env, jclass clazz, jlong display, jint x, jint y, jint width, jint height) { @@ -314,14 +312,14 @@ XMoveWindow(disp, getCurrentWindow(), x, y); } -static bool createWindow(JNIEnv* env, Display *disp, jint window_mode, X11PeerInfo *peer_info, int x, int y, int width, int height) { +static bool createWindow(JNIEnv* env, Display *disp, int screen, jint window_mode, X11PeerInfo *peer_info, int x, int y, int width, int height) { bool undecorated = getBooleanProperty(env, "org.lwjgl.opengl.Window.undecorated"); Window root_win; Window win; XSetWindowAttributes attribs; int attribmask; - root_win = RootWindow(disp, getCurrentScreen()); + root_win = RootWindow(disp, screen); XVisualInfo *vis_info = getVisualInfoFromPeerInfo(env, peer_info); if (vis_info == NULL) return false; @@ -386,7 +384,7 @@ handleMessages(env, disp, disp_obj, warp_atom); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nCreateWindow(JNIEnv *env, jclass clazz, jlong display, jobject peer_info_handle, jobject mode, jint window_mode, jint x, jint y) { +JNIEXPORT void 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) { Display *disp = (Display *)(intptr_t)display; X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_info_handle); GLXFBConfig *fb_config = NULL; @@ -400,7 +398,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); - bool window_created = createWindow(env, disp, window_mode, peer_info, x, y, width, height); + bool window_created = createWindow(env, disp, screen, window_mode, peer_info, x, y, width, height); if (!window_created) { return; } @@ -562,10 +560,6 @@ return handle_buffer; } -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_getScreen(JNIEnv *env, jclass unsused) { - return getCurrentScreen(); -} - JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetInputFocus(JNIEnv *env, jclass unused, jlong display_ptr) { Display *disp = (Display *)(intptr_t)display_ptr; int revert_mode; Modified: trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Pbuffer.c =================================================================== --- trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Pbuffer.c 2006-10-23 19:51:22 UTC (rev 2595) +++ trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Pbuffer.c 2006-10-23 20:14:45 UTC (rev 2596) @@ -48,25 +48,25 @@ #include "common_tools.h" JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetPbufferCapabilities - (JNIEnv *env, jclass clazz, jlong display) + (JNIEnv *env, jclass clazz, jlong display, jint screen) { Display *disp = (Display *)(intptr_t)display; GLXExtensions extension_flags; - if (!extgl_InitGLX(disp, getCurrentScreen(), &extension_flags)) + if (!extgl_InitGLX(disp, screen, &extension_flags)) return 0; // Only support the GLX 1.3 Pbuffers and ignore the GLX_SGIX_pbuffer extension return extension_flags.GLX13 ? org_lwjgl_opengl_Pbuffer_PBUFFER_SUPPORTED : 0; } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxPbufferPeerInfo_nInitHandle - (JNIEnv *env, jclass clazz, jlong display, jobject peer_info_handle, jint width, jint height, jobject pixel_format) { + (JNIEnv *env, jclass clazz, jlong display, jint screen, jobject peer_info_handle, jint width, jint height, jobject pixel_format) { Display *disp = (Display *)(intptr_t)display; GLXExtensions extension_flags; - if (!extgl_InitGLX(disp, getCurrentScreen(), &extension_flags) || !extension_flags.GLX13) { + if (!extgl_InitGLX(disp, screen, &extension_flags) || !extension_flags.GLX13) { throwException(env, "No Pbuffer support"); return; } - bool result = initPeerInfo(env, peer_info_handle, disp, getCurrentScreen(), pixel_format, false, GLX_PBUFFER_BIT, false, true); + bool result = initPeerInfo(env, peer_info_handle, disp, screen, pixel_format, false, GLX_PBUFFER_BIT, false, true); if (!result) return; const int buffer_attribs[] = {GLX_PBUFFER_WIDTH, width, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2006-10-23 20:41:22
|
Revision: 2597 http://svn.sourceforge.net/java-game-lib/?rev=2597&view=rev Author: elias_naur Date: 2006-10-23 13:40:48 -0700 (Mon, 23 Oct 2006) Log Message: ----------- Linux: Moved current_win to java Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/input/Cursor.java trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplayPeerInfo.java trunk/LWJGL/src/native/linux/org_lwjgl_input_Cursor.c trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c Removed Paths: ------------- trunk/LWJGL/src/native/linux/Window.h Modified: trunk/LWJGL/src/java/org/lwjgl/input/Cursor.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/input/Cursor.java 2006-10-23 20:14:45 UTC (rev 2596) +++ trunk/LWJGL/src/java/org/lwjgl/input/Cursor.java 2006-10-23 20:40:48 UTC (rev 2597) @@ -115,6 +115,8 @@ * @return the maximum size of a native cursor */ public static int getMinCursorSize() { + if (!Mouse.isCreated()) + throw new IllegalStateException("Mouse must be created."); return Mouse.getImplementation().getMinCursorSize(); } @@ -126,6 +128,8 @@ * @return the maximum size of a native cursor */ public static int getMaxCursorSize() { + if (!Mouse.isCreated()) + throw new IllegalStateException("Mouse must be created."); return Mouse.getImplementation().getMaxCursorSize(); } Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2006-10-23 20:14:45 UTC (rev 2596) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2006-10-23 20:40:48 UTC (rev 2597) @@ -78,6 +78,7 @@ /** Current X11 Display pointer */ private static long display; + private static long current_window; private static int display_connection_usage_count = 0; @@ -294,7 +295,9 @@ } private static native int nGetDefaultScreen(long display); - private static native long getWindow(); + static long getWindow() { + return current_window; + } private void ungrabKeyboard() { if (keyboard_grabbed) { @@ -383,7 +386,7 @@ ByteBuffer handle = peer_info.lockAndGetHandle(); try { current_window_mode = getWindowMode(fullscreen); - nCreateWindow(getDisplay(), getDefaultScreen(), handle, mode, current_window_mode, x, y); + current_window = nCreateWindow(getDisplay(), getDefaultScreen(), handle, mode, current_window_mode, x, y); blank_cursor = createBlankCursor(); current_cursor = null; focused = true; @@ -407,7 +410,7 @@ unlockAWT(); } } - private static native void nCreateWindow(long display, int screen, ByteBuffer peer_info_handle, DisplayMode mode, int window_mode, int x, int y) throws LWJGLException; + private static native long nCreateWindow(long display, int screen, ByteBuffer peer_info_handle, DisplayMode mode, int window_mode, int x, int y) throws LWJGLException; private void updateInputGrab() { updatePointerGrab(); @@ -425,14 +428,14 @@ nDestroyCursor(getDisplay(), blank_cursor); blank_cursor = null; ungrabKeyboard(); - nDestroyWindow(getDisplay()); + nDestroyWindow(getDisplay(), getWindow()); nSetRepeatMode(getDisplay(), AutoRepeatModeDefault); decDisplay(); } finally { unlockAWT(); } } - private static native void nDestroyWindow(long display); + private static native void nDestroyWindow(long display, long window); public void switchDisplayMode(DisplayMode mode) throws LWJGLException { lockAWT(); @@ -594,12 +597,12 @@ public void setTitle(String title) { lockAWT(); try { - nSetTitle(getDisplay(), title); + nSetTitle(getDisplay(), getWindow(), title); } finally { unlockAWT(); } } - private static native void nSetTitle(long display, String title); + private static native void nSetTitle(long display, long window, String title); public boolean isCloseRequested() { boolean result = close_requested; @@ -629,7 +632,7 @@ public void update() { lockAWT(); try { - nUpdate(getDisplay(), warp_atom); + nUpdate(getDisplay(), getWindow(), warp_atom); checkInput(); } catch (LWJGLException e) { LWJGLUtil.log("Caught exception while processing messages: " + e); @@ -637,17 +640,17 @@ unlockAWT(); } } - private native void nUpdate(long display, long warp_atom) throws LWJGLException; + private native void nUpdate(long display, long window, long warp_atom) throws LWJGLException; public void reshape(int x, int y, int width, int height) { lockAWT(); try { - nReshape(getDisplay(), x, y, width, height); + nReshape(getDisplay(), getWindow(), x, y, width, height); } finally { unlockAWT(); } } - private static native void nReshape(long display, int x, int y, int width, int height); + private static native void nReshape(long display, long window, int x, int y, int width, int height); public DisplayMode[] getAvailableDisplayModes() throws LWJGLException { lockAWT(); @@ -810,7 +813,7 @@ try { incDisplay(); try { - return nGetMinCursorSize(getDisplay()); + return nGetMinCursorSize(getDisplay(), getWindow()); } finally { decDisplay(); } @@ -821,14 +824,14 @@ unlockAWT(); } } - private static native int nGetMinCursorSize(long display); + private static native int nGetMinCursorSize(long display, long window); public int getMaxCursorSize() { lockAWT(); try { incDisplay(); try { - return nGetMaxCursorSize(getDisplay()); + return nGetMaxCursorSize(getDisplay(), getWindow()); } finally { decDisplay(); } @@ -839,7 +842,7 @@ unlockAWT(); } } - private static native int nGetMaxCursorSize(long display); + private static native int nGetMaxCursorSize(long display, long window); /* Keyboard */ public void createKeyboard() throws LWJGLException { @@ -1003,7 +1006,7 @@ int size = icons[i].limit() / 4; int dimension = (int)Math.sqrt(size); ByteBuffer icon = convertIcon(icons[i], dimension, dimension); - nSetWindowIcon(getDisplay(), icon, icon.capacity(), dimension, dimension); + nSetWindowIcon(getDisplay(), getWindow(), icon, icon.capacity(), dimension, dimension); return 1; } return 0; @@ -1018,7 +1021,7 @@ } } - private static native void nSetWindowIcon(long display, ByteBuffer icon, int icons_size, int width, int height); + private static native void nSetWindowIcon(long display, long window, ByteBuffer icon, int icons_size, int width, int height); /* Callbacks from nUpdate() */ private void handleButtonEvent(long millis, int type, int button, int state) { Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplayPeerInfo.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplayPeerInfo.java 2006-10-23 20:14:45 UTC (rev 2596) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplayPeerInfo.java 2006-10-23 20:40:48 UTC (rev 2597) @@ -67,12 +67,12 @@ protected void doLockAndInitHandle() throws LWJGLException { LinuxDisplay.lockAWT(); try { - initDrawable(getHandle()); + initDrawable(LinuxDisplay.getWindow(), getHandle()); } finally { LinuxDisplay.unlockAWT(); } } - private static native void initDrawable(ByteBuffer peer_info_handle); + private static native void initDrawable(long window, ByteBuffer peer_info_handle); protected void doUnlock() throws LWJGLException { // NO-OP Deleted: trunk/LWJGL/src/native/linux/Window.h =================================================================== --- trunk/LWJGL/src/native/linux/Window.h 2006-10-23 20:14:45 UTC (rev 2596) +++ trunk/LWJGL/src/native/linux/Window.h 2006-10-23 20:40:48 UTC (rev 2597) @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2002-2004 LWJGL Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of 'LWJGL' nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * $Id$ - * - * Include file to access public window features - * - * @author elias_naur <eli...@us...> - * @version $Revision$ - */ - -#ifndef _LWJGL_WINDOW_H_INCLUDED_ - #define _LWJGL_WINDOW_H_INCLUDED_ - - #include <jni.h> - #include <X11/X.h> - #include <X11/Xlib.h> - #include <X11/Xutil.h> - #include "extgl.h" - #include "extgl_glx.h" - - extern bool checkXError(JNIEnv *, Display *); - - /* - * get the current window - */ - extern Window getCurrentWindow(void); - -#endif /* _LWJGL_WINDOW_H_INCLUDED_ */ Modified: trunk/LWJGL/src/native/linux/org_lwjgl_input_Cursor.c =================================================================== --- trunk/LWJGL/src/native/linux/org_lwjgl_input_Cursor.c 2006-10-23 20:14:45 UTC (rev 2596) +++ trunk/LWJGL/src/native/linux/org_lwjgl_input_Cursor.c 2006-10-23 20:40:48 UTC (rev 2597) @@ -61,22 +61,24 @@ } JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetMinCursorSize - (JNIEnv *env, jclass clazz, jlong display) + (JNIEnv *env, jclass clazz, jlong display, jlong window_ptr) { Display *disp = (Display *)(intptr_t)display; + Window window = (Window)window_ptr; unsigned int width_return = 0; unsigned int height_return = 0; - XQueryBestCursor(disp, getCurrentWindow(), 1, 1, &width_return, &height_return); + XQueryBestCursor(disp, window, 1, 1, &width_return, &height_return); return width_return > height_return ? width_return : height_return; } JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetMaxCursorSize - (JNIEnv *env, jclass clazz, jlong display) + (JNIEnv *env, jclass clazz, jlong display, jlong window_ptr) { Display *disp = (Display *)(intptr_t)display; + Window window = (Window)window_ptr; unsigned int width_return = 0; unsigned int height_return = 0; - XQueryBestCursor(disp, getCurrentWindow(), 0xffffffff, 0xffffffff, &width_return, &height_return); + XQueryBestCursor(disp, window, 0xffffffff, 0xffffffff, &width_return, &height_return); return width_return > height_return ? height_return : width_return; } Modified: trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c =================================================================== --- trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c 2006-10-23 20:14:45 UTC (rev 2596) +++ trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c 2006-10-23 20:40:48 UTC (rev 2597) @@ -72,7 +72,6 @@ static Atom delete_atom; static Colormap cmap; -static Window current_win; static int current_depth; static Pixmap current_icon_pixmap; @@ -148,19 +147,19 @@ XCloseDisplay(disp); } -static void setDecorations(Display *disp, int dec) { +static void setDecorations(Display *disp, Window window, int dec) { Atom motif_hints_atom = XInternAtom(disp, "_MOTIF_WM_HINTS", False); MotifWmHints motif_hints; motif_hints.flags = MWM_HINTS_DECORATIONS; motif_hints.decorations = dec; - XChangeProperty(disp, getCurrentWindow(), motif_hints_atom, motif_hints_atom, 32, PropModeReplace, (unsigned char *)&motif_hints, sizeof(MotifWmHints)/sizeof(long)); + XChangeProperty(disp, window, motif_hints_atom, motif_hints_atom, 32, PropModeReplace, (unsigned char *)&motif_hints, sizeof(MotifWmHints)/sizeof(long)); } static bool isLegacyFullscreen(jint window_mode) { return window_mode == org_lwjgl_opengl_LinuxDisplay_FULLSCREEN_LEGACY; } -static void handleMessages(JNIEnv *env, Display *disp, jobject disp_obj, Atom warp_atom) { +static void handleMessages(JNIEnv *env, jobject disp_obj, Display *disp, Window window, Atom warp_atom) { XEvent event; jclass disp_class = (*env)->GetObjectClass(env, disp_obj); if (disp_class == NULL) @@ -194,7 +193,7 @@ if (XFilterEvent(&event, None) == True) continue; // Ignore events from old windows - if (event.xany.window != getCurrentWindow()) + if (event.xany.window != window) continue; switch (event.type) { case ClientMessage: @@ -227,8 +226,8 @@ } } -static void setWindowTitle(Display *disp, const char *title) { - XStoreName(disp, current_win, title); +static void setWindowTitle(Display *disp, Window window, const char *title) { + XStoreName(disp, window, title); } JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_LinuxDisplay_openDisplay(JNIEnv *env, jclass clazz) { @@ -240,12 +239,12 @@ XCloseDisplay(disp); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplayPeerInfo_initDrawable(JNIEnv *env, jclass clazz, jobject peer_info_handle) { +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplayPeerInfo_initDrawable(JNIEnv *env, jclass clazz, jlong window, jobject peer_info_handle) { X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_info_handle); if (peer_info->glx13) peer_info->drawable = glx_window; else - peer_info->drawable = getCurrentWindow(); + peer_info->drawable = window; } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplayPeerInfo_initDefaultPeerInfo(JNIEnv *env, jclass clazz, jlong display, jint screen, jobject peer_info_handle, jobject pixel_format) { @@ -253,10 +252,11 @@ 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, jstring title_obj) { +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSetTitle(JNIEnv * env, jclass clazz, jlong display, jlong window_ptr, jstring title_obj) { Display *disp = (Display *)(intptr_t)display; + Window window = (Window)window_ptr; char * title = GetStringNativeChars(env, title_obj); - setWindowTitle(disp, title); + setWindowTitle(disp, window, title); free(title); } @@ -267,12 +267,12 @@ } } -static void destroyWindow(JNIEnv *env, Display *disp) { +static void destroyWindow(JNIEnv *env, Display *disp, Window window) { if (glx_window != None) { lwjgl_glXDestroyWindow(disp, glx_window); glx_window = None; } - XDestroyWindow(disp, current_win); + XDestroyWindow(disp, window); XFreeColormap(disp, cmap); freeIconPixmap(disp); } @@ -307,12 +307,13 @@ return isNetWMFullscreenSupported(env, disp, screen) ? JNI_TRUE : JNI_FALSE; } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nReshape(JNIEnv *env, jclass clazz, jlong display, jint x, jint y, jint width, jint height) { +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nReshape(JNIEnv *env, jclass clazz, jlong display, jlong window_ptr, jint x, jint y, jint width, jint height) { Display *disp = (Display *)(intptr_t)display; - XMoveWindow(disp, getCurrentWindow(), x, y); + Window window = (Window)window_ptr; + XMoveWindow(disp, window, x, y); } -static bool createWindow(JNIEnv* env, Display *disp, int screen, jint window_mode, X11PeerInfo *peer_info, int x, int y, int width, int height) { +static Window createWindow(JNIEnv* env, Display *disp, int screen, jint window_mode, X11PeerInfo *peer_info, int x, int y, int width, int height) { bool undecorated = getBooleanProperty(env, "org.lwjgl.opengl.Window.undecorated"); Window root_win; Window win; @@ -344,10 +345,9 @@ return false; } printfDebugJava(env, "Created window"); - current_win = win; if (window_mode != org_lwjgl_opengl_LinuxDisplay_WINDOWED || undecorated) { // Use Motif decoration hint property and hope the window manager respects them - setDecorations(disp, 0); + setDecorations(disp, win, 0); } XSizeHints * size_hints = XAllocSizeHints(); size_hints->flags = PMinSize | PMaxSize; @@ -361,60 +361,59 @@ XSetWMProtocols(disp, win, &delete_atom, 1); if (window_mode == org_lwjgl_opengl_LinuxDisplay_FULLSCREEN_NETWM) { Atom fullscreen_atom = XInternAtom(disp, "_NET_WM_STATE_FULLSCREEN", False); - XChangeProperty(disp, getCurrentWindow(), XInternAtom(disp, "_NET_WM_STATE", False), + XChangeProperty(disp, win, XInternAtom(disp, "_NET_WM_STATE", False), XInternAtom(disp, "ATOM", False), 32, PropModeReplace, (const unsigned char*)&fullscreen_atom, 1); } XMapRaised(disp, win); waitMapped(disp, win); XClearWindow(disp, win); if (!checkXError(env, disp)) { - destroyWindow(env, disp); - return false; + destroyWindow(env, disp, win); + return 0; } - return true; + return win; } -Window getCurrentWindow(void) { - return current_win; -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nUpdate(JNIEnv *env, jobject disp_obj, jlong display, jlong warp_atom_ptr) { +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nUpdate(JNIEnv *env, jobject disp_obj, jlong display, jlong window_ptr, jlong warp_atom_ptr) { Display *disp = (Display *)(intptr_t)display; + Window window = (Window)window_ptr; Atom warp_atom = (Atom)warp_atom_ptr; - handleMessages(env, disp, disp_obj, warp_atom); + handleMessages(env, disp_obj, disp, window, warp_atom); } -JNIEXPORT void 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) { +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) { Display *disp = (Display *)(intptr_t)display; X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_info_handle); GLXFBConfig *fb_config = NULL; if (peer_info->glx13) { fb_config = getFBConfigFromPeerInfo(env, peer_info); if (fb_config == NULL) - return; + return 0; } jclass cls_displayMode = (*env)->GetObjectClass(env, mode); jfieldID fid_width = (*env)->GetFieldID(env, cls_displayMode, "width", "I"); jfieldID fid_height = (*env)->GetFieldID(env, cls_displayMode, "height", "I"); int width = (*env)->GetIntField(env, mode, fid_width); int height = (*env)->GetIntField(env, mode, fid_height); - bool window_created = createWindow(env, disp, screen, window_mode, peer_info, x, y, width, height); - if (!window_created) { - return; + Window win = createWindow(env, disp, screen, window_mode, peer_info, x, y, width, height); + if ((*env)->ExceptionOccurred(env)) { + return 0; } if (peer_info->glx13) { - glx_window = lwjgl_glXCreateWindow(disp, *fb_config, getCurrentWindow(), NULL); + glx_window = lwjgl_glXCreateWindow(disp, *fb_config, win, NULL); XFree(fb_config); } if (!checkXError(env, disp)) { lwjgl_glXDestroyWindow(disp, glx_window); - destroyWindow(env, disp); + destroyWindow(env, disp, win); } + return win; } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nDestroyWindow(JNIEnv *env, jclass clazz, jlong display) { +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nDestroyWindow(JNIEnv *env, jclass clazz, jlong display, jlong window_ptr) { Display *disp = (Display *)(intptr_t)display; - destroyWindow(env, disp); + Window window = (Window)window_ptr; + destroyWindow(env, disp, window); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nLockAWT(JNIEnv *env, jclass clazz) { @@ -437,10 +436,10 @@ jawt.Unlock(env); } -static void setIcon(JNIEnv *env, Display *disp, char *data, int icon_size, int width,int height) { +static void setIcon(JNIEnv *env, Display *disp, Window window, char *data, int icon_size, int width,int height) { XWMHints* win_hints; freeIconPixmap(disp); - current_icon_pixmap = XCreatePixmap(disp, getCurrentWindow(), width, height, current_depth); + current_icon_pixmap = XCreatePixmap(disp, window, width, height, current_depth); /* We need to copy the image data since XDestroyImage will also free its data buffer, which can't be allowed * since the data buffer is managed by the jvm (it's the storage for the direct ByteBuffer) */ @@ -474,24 +473,21 @@ win_hints->flags = IconPixmapHint; win_hints->icon_pixmap = current_icon_pixmap; - XSetWMHints(disp, getCurrentWindow(), win_hints); + XSetWMHints(disp, window, win_hints); XFree(win_hints); XFlush(disp); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSetWindowIcon - (JNIEnv *env, jclass clazz, jlong display, jobject iconBuffer, jint icon_size, jint width, jint height) + (JNIEnv *env, jclass clazz, jlong display, jlong window_ptr, jobject iconBuffer, jint icon_size, jint width, jint height) { Display *disp = (Display *)(intptr_t)display; + Window window = (Window)window_ptr; char *imgData = (char *)(*env)->GetDirectBufferAddress(env, iconBuffer); - setIcon(env, disp, imgData, icon_size, width, height); + setIcon(env, disp, window, imgData, icon_size, width, height); } -JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_LinuxDisplay_getWindow(JNIEnv *env, jclass unused) { - return getCurrentWindow(); -} - JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nUngrabKeyboard(JNIEnv *env, jclass unused, jlong display_ptr) { Display *disp = (Display *)(intptr_t)display_ptr; return XUngrabKeyboard(disp, CurrentTime); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2006-10-26 12:14:52
|
Revision: 2604 http://svn.sourceforge.net/java-game-lib/?rev=2604&view=rev Author: elias_naur Date: 2006-10-26 05:14:37 -0700 (Thu, 26 Oct 2006) Log Message: ----------- Linux: Made cursor handles longs instead of ByteBuffers Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxMouse.java trunk/LWJGL/src/native/linux/org_lwjgl_input_Cursor.c trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2006-10-24 11:17:44 UTC (rev 2603) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2006-10-26 12:14:37 UTC (rev 2604) @@ -49,10 +49,11 @@ final class LinuxDisplay implements DisplayImplementation { /* X11 constants */ - private final static int GrabSuccess = 0; + public final static int GrabSuccess = 0; private final static int AutoRepeatModeOff = 0; private final static int AutoRepeatModeOn = 1; private final static int AutoRepeatModeDefault = 2; + public final static int None = 0; /** Window mode enum */ private static final int FULLSCREEN_LEGACY = 1; @@ -109,8 +110,8 @@ private boolean minimized; private boolean dirty; private boolean close_requested; - private ByteBuffer current_cursor; - private ByteBuffer blank_cursor; + private long current_cursor; + private long blank_cursor; private LinuxKeyboard keyboard; private LinuxMouse mouse; @@ -296,7 +297,7 @@ static int getDefaultScreen() { return nGetDefaultScreen(getDisplay()); } - private static native int nGetDefaultScreen(long display); + static native int nGetDefaultScreen(long display); static long getWindow() { return current_window; @@ -308,7 +309,7 @@ keyboard_grabbed = false; } } - private static native int nUngrabKeyboard(long display); + static native int nUngrabKeyboard(long display); private void grabKeyboard() { if (!keyboard_grabbed) { @@ -317,11 +318,11 @@ keyboard_grabbed = true; } } - private static native int nGrabKeyboard(long display, long window); + static native int nGrabKeyboard(long display, long window); private void grabPointer() { if (!pointer_grabbed) { - int result = nGrabPointer(getDisplay(), getWindow()); + int result = nGrabPointer(getDisplay(), getWindow(), None); if (result == GrabSuccess) { pointer_grabbed = true; // make sure we have a centered window @@ -331,7 +332,7 @@ } } } - private static native int nGrabPointer(long display, long window); + static native int nGrabPointer(long display, long window, long cursor); private static native void nSetViewPort(long display, long window, int screen); private void ungrabPointer() { @@ -340,7 +341,7 @@ nUngrabPointer(getDisplay()); } } - private static native int nUngrabPointer(long display); + static native int nUngrabPointer(long display); private boolean isFullscreen() { return current_window_mode == FULLSCREEN_LEGACY || current_window_mode == FULLSCREEN_NETWM; @@ -360,7 +361,7 @@ } private void updateCursor() { - ByteBuffer cursor; + long cursor; if (shouldGrab()) { cursor = blank_cursor; } else { @@ -368,7 +369,7 @@ } nDefineCursor(getDisplay(), getWindow(), cursor); } - private static native void nDefineCursor(long display, long window, ByteBuffer cursor_handle); + private static native void nDefineCursor(long display, long window, long cursor_handle); private boolean isLegacyFullscreen() { return current_window_mode == FULLSCREEN_LEGACY; @@ -391,7 +392,7 @@ current_window_mode = getWindowMode(fullscreen); current_window = nCreateWindow(getDisplay(), getDefaultScreen(), handle, mode, current_window_mode, x, y); blank_cursor = createBlankCursor(); - current_cursor = null; + current_cursor = None; focused = true; input_released = false; pointer_grabbed = false; @@ -429,7 +430,7 @@ LWJGLUtil.log("Failed to reset cursor: " + e.getMessage()); } nDestroyCursor(getDisplay(), blank_cursor); - blank_cursor = null; + blank_cursor = None; ungrabKeyboard(); nDestroyWindow(getDisplay(), getWindow()); nSetRepeatMode(getDisplay(), AutoRepeatModeDefault); @@ -438,7 +439,7 @@ unlockAWT(); } } - private static native void nDestroyWindow(long display, long window); + static native void nDestroyWindow(long display, long window); public void switchDisplayMode(DisplayMode mode) throws LWJGLException { lockAWT(); @@ -706,7 +707,7 @@ public void createMouse() throws LWJGLException { lockAWT(); try { - mouse = new LinuxMouse(getDisplay(), getWindow()); + mouse = new LinuxMouse(getDisplay(), getWindow(), getWindow()); } finally { unlockAWT(); } @@ -825,7 +826,7 @@ private static native int nGetNativeCursorCapabilities(long display) throws LWJGLException; public void setNativeCursor(Object handle) throws LWJGLException { - current_cursor = (ByteBuffer)handle; + current_cursor = getCursorHandle(handle); lockAWT(); try { updateCursor(); @@ -914,19 +915,20 @@ return Keyboard.STATE_UNKNOWN; } */ - private static native ByteBuffer nCreateCursor(long display, int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, int images_offset, IntBuffer delays, int delays_offset) throws LWJGLException; + private static native long nCreateCursor(long display, int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, int images_offset, IntBuffer delays, int delays_offset) throws LWJGLException; - private static ByteBuffer createBlankCursor() { + private static long createBlankCursor() { return nCreateBlankCursor(getDisplay(), getWindow()); } - private static native ByteBuffer nCreateBlankCursor(long display, long window); + static native long nCreateBlankCursor(long display, long window); public Object createCursor(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, IntBuffer delays) throws LWJGLException { lockAWT(); try { incDisplay(); try { - return nCreateCursor(getDisplay(), width, height, xHotspot, yHotspot, numImages, images, images.position(), delays, delays != null ? delays.position() : -1); + long cursor = nCreateCursor(getDisplay(), width, height, xHotspot, yHotspot, numImages, images, images.position(), delays, delays != null ? delays.position() : -1); + return new Long(cursor); } catch (LWJGLException e) { decDisplay(); throw e; @@ -936,16 +938,20 @@ } } + private static long getCursorHandle(Object cursor_handle) { + return cursor_handle != null ? ((Long)cursor_handle).longValue() : None; + } + public void destroyCursor(Object cursorHandle) { lockAWT(); try { - nDestroyCursor(getDisplay(), cursorHandle); + nDestroyCursor(getDisplay(), getCursorHandle(cursorHandle)); decDisplay(); } finally { unlockAWT(); } } - private static native void nDestroyCursor(long display, Object cursorHandle); + static native void nDestroyCursor(long display, long cursorHandle); public int getPbufferCapabilities() { lockAWT(); Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxMouse.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxMouse.java 2006-10-24 11:17:44 UTC (rev 2603) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxMouse.java 2006-10-26 12:14:37 UTC (rev 2604) @@ -64,6 +64,7 @@ private final long display; private final long window; + private final long input_window; private final long warp_atom; private final IntBuffer query_pointer_buffer = BufferUtils.createIntBuffer(4); private final ByteBuffer event_buffer = ByteBuffer.allocate(Mouse.EVENT_SIZE); @@ -77,15 +78,11 @@ private EventQueue event_queue; private long last_event_nanos; - public LinuxMouse(long display, long window) throws LWJGLException { + public LinuxMouse(long display, long window, long input_window) throws LWJGLException { this.display = display; this.window = window; - LinuxDisplay.lockAWT(); - try { - this.warp_atom = LinuxDisplay.nInternAtom(display, "_LWJGL", false); - } finally { - LinuxDisplay.unlockAWT(); - } + this.input_window = input_window; + this.warp_atom = LinuxDisplay.nInternAtom(display, "_LWJGL", false); reset(); } @@ -138,7 +135,7 @@ } private void doWarpPointer(int center_x, int center_y) { - nSendWarpEvent(display, window, warp_atom, center_x, center_y); + nSendWarpEvent(display, input_window, warp_atom, center_x, center_y); nWarpCursor(display, window, center_x, center_y); } private static native void nSendWarpEvent(long display, long window, long warp_atom, int center_x, int center_y); Modified: trunk/LWJGL/src/native/linux/org_lwjgl_input_Cursor.c =================================================================== --- trunk/LWJGL/src/native/linux/org_lwjgl_input_Cursor.c 2006-10-24 11:17:44 UTC (rev 2603) +++ trunk/LWJGL/src/native/linux/org_lwjgl_input_Cursor.c 2006-10-26 12:14:37 UTC (rev 2604) @@ -81,15 +81,10 @@ return width_return > height_return ? height_return : width_return; } -JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nCreateCursor +JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nCreateCursor (JNIEnv *env, jclass clazz, jlong display, jint width, jint height, jint x_hotspot, jint y_hotspot, jint num_images, jobject image_buffer, jint images_offset, jobject delay_buffer, jint delays_offset) { Display *disp = (Display *)(intptr_t)display; - jobject handle_buffer = newJavaManagedByteBuffer(env, sizeof(Cursor)); - if (handle_buffer == NULL) { - throwException(env, "Could not allocate handle buffer"); - return NULL; - } const int *delays = NULL; if (delay_buffer != NULL) delays = (const int *)(*env)->GetDirectBufferAddress(env, delay_buffer) + delays_offset; @@ -98,7 +93,7 @@ XcursorImages *cursor_images = XcursorImagesCreate(num_images); if (cursor_images == NULL) { throwException(env, "Could not allocate cursor."); - return NULL; + return None; } cursor_images->nimage = num_images; int i; @@ -111,16 +106,15 @@ cursor_image->delay = delays[i]; cursor_images->images[i] = cursor_image; } - Cursor *cursor = (Cursor *)(*env)->GetDirectBufferAddress(env, handle_buffer); - *cursor = XcursorImagesLoadCursor(disp, cursor_images); + Cursor cursor = XcursorImagesLoadCursor(disp, cursor_images); XcursorImagesDestroy(cursor_images); - return handle_buffer; + return cursor; } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nDestroyCursor - (JNIEnv *env, jclass clazz, jlong display, jobject cursor_handle_buffer) + (JNIEnv *env, jclass clazz, jlong display, jlong cursor_ptr) { Display *disp = (Display *)(intptr_t)display; - Cursor *cursor = (Cursor *)(*env)->GetDirectBufferAddress(env, cursor_handle_buffer); - XFreeCursor(disp, *cursor); + Cursor cursor = (Cursor)cursor_ptr; + XFreeCursor(disp, cursor); } Modified: trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c =================================================================== --- trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c 2006-10-24 11:17:44 UTC (rev 2603) +++ trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c 2006-10-26 12:14:37 UTC (rev 2604) @@ -423,11 +423,12 @@ return XGrabKeyboard(disp, win, False, GrabModeAsync, GrabModeAsync, CurrentTime); } -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGrabPointer(JNIEnv *env, jclass unused, jlong display_ptr, jlong window_ptr) { +JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGrabPointer(JNIEnv *env, jclass unused, jlong display_ptr, jlong window_ptr, jlong cursor_ptr) { Display *disp = (Display *)(intptr_t)display_ptr; Window win = (Window)window_ptr; + Cursor cursor = (Cursor)cursor_ptr; int grab_mask = PointerMotionMask | ButtonPressMask | ButtonReleaseMask; - return XGrabPointer(disp, win, False, grab_mask, GrabModeAsync, GrabModeAsync, win, None, CurrentTime); + return XGrabPointer(disp, win, False, grab_mask, GrabModeAsync, GrabModeAsync, win, cursor, CurrentTime); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSetViewPort(JNIEnv *env, jclass unused, jlong display_ptr, jlong window_ptr, jint screen) { @@ -444,25 +445,16 @@ return XUngrabPointer(disp, CurrentTime); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nDefineCursor(JNIEnv *env, jclass unused, jlong display_ptr, jlong window_ptr, jobject cursor_handle) { +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nDefineCursor(JNIEnv *env, jclass unused, jlong display_ptr, jlong window_ptr, jlong cursor_ptr) { Display *disp = (Display *)(intptr_t)display_ptr; Window win = (Window)window_ptr; - Cursor cursor; - if (cursor_handle != NULL) - cursor = *((Cursor *)(*env)->GetDirectBufferAddress(env, cursor_handle)); - else - cursor = None; + Cursor cursor = (Cursor)cursor_ptr; XDefineCursor(disp, win, cursor); } -JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nCreateBlankCursor(JNIEnv *env, jclass unused, jlong display_ptr, jlong window_ptr) { +JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nCreateBlankCursor(JNIEnv *env, jclass unused, jlong display_ptr, jlong window_ptr) { Display *disp = (Display *)(intptr_t)display_ptr; Window win = (Window)window_ptr; - jobject handle_buffer = newJavaManagedByteBuffer(env, sizeof(Cursor)); - if (handle_buffer == NULL) { - return NULL; - } - Cursor *cursor = (Cursor *)(*env)->GetDirectBufferAddress(env, handle_buffer); unsigned int best_width, best_height; if (XQueryBestCursor(disp, win, 1, 1, &best_width, &best_height) == 0) { throwException(env, "Could not query best cursor size"); @@ -475,9 +467,9 @@ XFillRectangle(disp, mask, gc, 0, 0, best_width, best_height); XFreeGC(disp, gc); XColor dummy_color; - *cursor = XCreatePixmapCursor(disp, mask, mask, &dummy_color, &dummy_color, 0, 0); + Cursor cursor = XCreatePixmapCursor(disp, mask, mask, &dummy_color, &dummy_color, 0, 0); XFreePixmap(disp, mask); - return handle_buffer; + return cursor; } JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetInputFocus(JNIEnv *env, jclass unused, jlong display_ptr) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sp...@us...> - 2006-11-09 22:36:10
|
Revision: 2636 http://svn.sourceforge.net/java-game-lib/?rev=2636&view=rev Author: spasi Date: 2006-11-09 14:34:30 -0800 (Thu, 09 Nov 2006) Log Message: ----------- Added 21 new extensions: EXT_bindable_uniform EXT_draw_buffers2 EXT_draw_instanced EXT_framebuffer_sRGB EXT_geometry_shader4 EXT_gpu_shader4 EXT_packed_float EXT_texture_array EXT_texture_buffer_object EXT_texture_compression_latc EXT_texture_compression_rgtc EXT_texture_integer EXT_texture_shared_exponent NV_depth_buffer_float NV_fragment_program4 NV_framebuffer_multisample_coverage NV_geometry_program4 NV_gpu_program4 NV_parameter_buffer_object NV_transform_feeback NV_vertex_program4 Modified Paths: -------------- trunk/LWJGL/src/generated/org/lwjgl/opengl/ContextCapabilities.java trunk/LWJGL/src/generated/org/lwjgl/opengl/References.java Added Paths: ----------- trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTBindableUniform.java trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTDrawBuffers2.java trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTDrawInstanced.java trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTFramebufferSRGB.java trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTGeometryShader4.java trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTGpuShader4.java trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTPackedFloat.java trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTTextureArray.java trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTTextureBufferObject.java trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTTextureCompressionLATC.java trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTTextureCompressionRGTC.java trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTTextureInteger.java trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTTextureSharedExponent.java trunk/LWJGL/src/generated/org/lwjgl/opengl/NVDepthBufferFloat.java trunk/LWJGL/src/generated/org/lwjgl/opengl/NVFramebufferMultisampleCoverage.java trunk/LWJGL/src/generated/org/lwjgl/opengl/NVGeometryProgram4.java trunk/LWJGL/src/generated/org/lwjgl/opengl/NVGpuProgram4.java trunk/LWJGL/src/generated/org/lwjgl/opengl/NVParameterBufferObject.java trunk/LWJGL/src/generated/org/lwjgl/opengl/NVTransformFeeback.java trunk/LWJGL/src/native/generated/org_lwjgl_opengl_EXTBindableUniform.c trunk/LWJGL/src/native/generated/org_lwjgl_opengl_EXTDrawBuffers2.c trunk/LWJGL/src/native/generated/org_lwjgl_opengl_EXTDrawInstanced.c trunk/LWJGL/src/native/generated/org_lwjgl_opengl_EXTGeometryShader4.c trunk/LWJGL/src/native/generated/org_lwjgl_opengl_EXTGpuShader4.c trunk/LWJGL/src/native/generated/org_lwjgl_opengl_EXTTextureArray.c trunk/LWJGL/src/native/generated/org_lwjgl_opengl_EXTTextureBufferObject.c trunk/LWJGL/src/native/generated/org_lwjgl_opengl_EXTTextureInteger.c trunk/LWJGL/src/native/generated/org_lwjgl_opengl_NVDepthBufferFloat.c trunk/LWJGL/src/native/generated/org_lwjgl_opengl_NVFramebufferMultisampleCoverage.c trunk/LWJGL/src/native/generated/org_lwjgl_opengl_NVGeometryProgram4.c trunk/LWJGL/src/native/generated/org_lwjgl_opengl_NVGpuProgram4.c trunk/LWJGL/src/native/generated/org_lwjgl_opengl_NVParameterBufferObject.c trunk/LWJGL/src/native/generated/org_lwjgl_opengl_NVTransformFeeback.c trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_bindable_uniform.java trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_draw_buffers2.java trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_draw_instanced.java trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_framebuffer_sRGB.java trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_geometry_shader4.java trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_gpu_shader4.java trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_packed_float.java trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_texture_array.java trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_texture_buffer_object.java trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_texture_compression_latc.java trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_texture_compression_rgtc.java trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_texture_integer.java trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_texture_shared_exponent.java trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_depth_buffer_float.java trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_fragment_program4.java trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_framebuffer_multisample_coverage.java trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_geometry_program4.java trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_gpu_program4.java trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_parameter_buffer_object.java trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_transform_feeback.java trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_vertex_program4.java Modified: trunk/LWJGL/src/generated/org/lwjgl/opengl/ContextCapabilities.java =================================================================== --- trunk/LWJGL/src/generated/org/lwjgl/opengl/ContextCapabilities.java 2006-11-09 21:41:58 UTC (rev 2635) +++ trunk/LWJGL/src/generated/org/lwjgl/opengl/ContextCapabilities.java 2006-11-09 22:34:30 UTC (rev 2636) @@ -64,6 +64,7 @@ public final boolean GL_ATI_vertex_streams; public final boolean GL_EXT_abgr; public final boolean GL_EXT_bgra; + public final boolean GL_EXT_bindable_uniform; public final boolean GL_EXT_blend_color; public final boolean GL_EXT_blend_equation_separate; public final boolean GL_EXT_blend_func_separate; @@ -72,14 +73,20 @@ public final boolean GL_EXT_cg_shader; public final boolean GL_EXT_compiled_vertex_array; public final boolean GL_EXT_depth_bounds_test; + public final boolean GL_EXT_draw_buffers2; + public final boolean GL_EXT_draw_instanced; public final boolean GL_EXT_draw_range_elements; public final boolean GL_EXT_fog_coord; public final boolean GL_EXT_framebuffer_blit; public final boolean GL_EXT_framebuffer_multisample; public final boolean GL_EXT_framebuffer_object; + public final boolean GL_EXT_framebuffer_sRGB; + public final boolean GL_EXT_geometry_shader4; public final boolean GL_EXT_gpu_program_parameters; + public final boolean GL_EXT_gpu_shader4; public final boolean GL_EXT_multi_draw_arrays; public final boolean GL_EXT_packed_depth_stencil; + public final boolean GL_EXT_packed_float; public final boolean GL_EXT_packed_pixels; public final boolean GL_EXT_paletted_texture; public final boolean GL_EXT_pixel_buffer_object; @@ -93,14 +100,20 @@ public final boolean GL_EXT_stencil_two_side; public final boolean GL_EXT_stencil_wrap; public final boolean GL_EXT_texture_3d; + public final boolean GL_EXT_texture_array; + public final boolean GL_EXT_texture_buffer_object; + public final boolean GL_EXT_texture_compression_latc; + public final boolean GL_EXT_texture_compression_rgtc; public final boolean GL_EXT_texture_compression_s3tc; public final boolean GL_EXT_texture_env_combine; public final boolean GL_EXT_texture_env_dot3; public final boolean GL_EXT_texture_filter_anisotropic; + public final boolean GL_EXT_texture_integer; public final boolean GL_EXT_texture_lod_bias; public final boolean GL_EXT_texture_mirror_clamp; public final boolean GL_EXT_texture_rectangle; public final boolean GL_EXT_texture_sRGB; + public final boolean GL_EXT_texture_shared_exponent; public final boolean GL_EXT_timer_query; public final boolean GL_EXT_vertex_shader; public final boolean GL_EXT_vertex_weighting; @@ -115,6 +128,7 @@ public final boolean GL_IBM_rasterpos_clip; public final boolean GL_NV_blend_square; public final boolean GL_NV_copy_depth_to_color; + public final boolean GL_NV_depth_buffer_float; public final boolean GL_NV_depth_clamp; public final boolean GL_NV_evaluators; public final boolean GL_NV_fence; @@ -122,12 +136,17 @@ public final boolean GL_NV_fog_distance; public final boolean GL_NV_fragment_program; public final boolean GL_NV_fragment_program2; + public final boolean GL_NV_fragment_program4; public final boolean GL_NV_fragment_program_option; + public final boolean GL_NV_framebuffer_multisample_coverage; + public final boolean GL_NV_geometry_program4; + public final boolean GL_NV_gpu_program4; public final boolean GL_NV_half_float; public final boolean GL_NV_light_max_exponent; public final boolean GL_NV_multisample_filter_hint; public final boolean GL_NV_occlusion_query; public final boolean GL_NV_packed_depth_stencil; + public final boolean GL_NV_parameter_buffer_object; public final boolean GL_NV_pixel_data_range; public final boolean GL_NV_point_sprite; public final boolean GL_NV_primitive_restart; @@ -141,6 +160,7 @@ public final boolean GL_NV_texture_shader; public final boolean GL_NV_texture_shader2; public final boolean GL_NV_texture_shader3; + public final boolean GL_NV_transform_feeback; public final boolean GL_NV_vertex_array_range; public final boolean GL_NV_vertex_array_range2; public final boolean GL_NV_vertex_program; @@ -148,6 +168,7 @@ public final boolean GL_NV_vertex_program2; public final boolean GL_NV_vertex_program2_option; public final boolean GL_NV_vertex_program3; + public final boolean GL_NV_vertex_program4; public final boolean GL_SGIS_generate_mipmap; public final boolean GL_SGIS_texture_lod; public final boolean GL_SUN_slice_accum; @@ -424,6 +445,9 @@ long ATI_vertex_streams_glClientActiveVertexStreamATI_pointer; long ATI_vertex_streams_glVertexBlendEnvfATI_pointer; long ATI_vertex_streams_glVertexBlendEnviATI_pointer; + long EXT_bindable_uniform_glUniformBufferEXT_pointer; + long EXT_bindable_uniform_glGetUniformBufferSizeEXT_pointer; + long EXT_bindable_uniform_glGetUniformOffsetEXT_pointer; long EXT_blend_color_glBlendColorEXT_pointer; long EXT_blend_equation_separate_glBlendEquationSeparateEXT_pointer; long EXT_blend_func_separate_glBlendFuncSeparateEXT_pointer; @@ -431,6 +455,14 @@ long EXT_compiled_vertex_array_glLockArraysEXT_pointer; long EXT_compiled_vertex_array_glUnlockArraysEXT_pointer; long EXT_depth_bounds_test_glDepthBoundsEXT_pointer; + long EXT_draw_buffers2_glColorMaskIndexedEXT_pointer; + long EXT_draw_buffers2_glGetBooleanIndexedvEXT_pointer; + long EXT_draw_buffers2_glGetIntegerIndexedvEXT_pointer; + long EXT_draw_buffers2_glEnableIndexedEXT_pointer; + long EXT_draw_buffers2_glDisableIndexedEXT_pointer; + long EXT_draw_buffers2_glIsEnabledIndexedEXT_pointer; + long EXT_draw_instanced_glDrawArraysInstancedEXT_pointer; + long EXT_draw_instanced_glDrawElementsInstancedEXT_pointer; long EXT_draw_range_elements_glDrawRangeElementsEXT_pointer; long EXT_fog_coord_glFogCoordfEXT_pointer; long EXT_fog_coord_glFogCoorddEXT_pointer; @@ -454,8 +486,46 @@ long EXT_framebuffer_object_glFramebufferRenderbufferEXT_pointer; long EXT_framebuffer_object_glGetFramebufferAttachmentParameterivEXT_pointer; long EXT_framebuffer_object_glGenerateMipmapEXT_pointer; + long EXT_geometry_shader4_glProgramParameteriEXT_pointer; + long EXT_geometry_shader4_glFramebufferTextureEXT_pointer; + long EXT_geometry_shader4_glFramebufferTextureLayerEXT_pointer; + long EXT_geometry_shader4_glFramebufferTextureFaceEXT_pointer; long EXT_gpu_program_parameters_glProgramEnvParameter4fvEXT_pointer; long EXT_gpu_program_parameters_glProgramLocalParameter4fvEXT_pointer; + long EXT_gpu_shader4_glVertexAttribI1iEXT_pointer; + long EXT_gpu_shader4_glVertexAttribI2iEXT_pointer; + long EXT_gpu_shader4_glVertexAttribI3iEXT_pointer; + long EXT_gpu_shader4_glVertexAttribI4iEXT_pointer; + long EXT_gpu_shader4_glVertexAttribI1uiEXT_pointer; + long EXT_gpu_shader4_glVertexAttribI2uiEXT_pointer; + long EXT_gpu_shader4_glVertexAttribI3uiEXT_pointer; + long EXT_gpu_shader4_glVertexAttribI4uiEXT_pointer; + long EXT_gpu_shader4_glVertexAttribI1ivEXT_pointer; + long EXT_gpu_shader4_glVertexAttribI2ivEXT_pointer; + long EXT_gpu_shader4_glVertexAttribI3ivEXT_pointer; + long EXT_gpu_shader4_glVertexAttribI4ivEXT_pointer; + long EXT_gpu_shader4_glVertexAttribI1uivEXT_pointer; + long EXT_gpu_shader4_glVertexAttribI2uivEXT_pointer; + long EXT_gpu_shader4_glVertexAttribI3uivEXT_pointer; + long EXT_gpu_shader4_glVertexAttribI4uivEXT_pointer; + long EXT_gpu_shader4_glVertexAttribI4bvEXT_pointer; + long EXT_gpu_shader4_glVertexAttribI4svEXT_pointer; + long EXT_gpu_shader4_glVertexAttribI4ubvEXT_pointer; + long EXT_gpu_shader4_glVertexAttribI4usvEXT_pointer; + long EXT_gpu_shader4_glVertexAttribIPointerEXT_pointer; + long EXT_gpu_shader4_glGetVertexAttribIivEXT_pointer; + long EXT_gpu_shader4_glGetVertexAttribIuivEXT_pointer; + long EXT_gpu_shader4_glUniform1uiEXT_pointer; + long EXT_gpu_shader4_glUniform2uiEXT_pointer; + long EXT_gpu_shader4_glUniform3uiEXT_pointer; + long EXT_gpu_shader4_glUniform4uiEXT_pointer; + long EXT_gpu_shader4_glUniform1uivEXT_pointer; + long EXT_gpu_shader4_glUniform2uivEXT_pointer; + long EXT_gpu_shader4_glUniform3uivEXT_pointer; + long EXT_gpu_shader4_glUniform4uivEXT_pointer; + long EXT_gpu_shader4_glGetUniformuivEXT_pointer; + long EXT_gpu_shader4_glBindFragDataLocationEXT_pointer; + long EXT_gpu_shader4_glGetFragDataLocationEXT_pointer; long EXT_multi_draw_arrays_glMultiDrawArraysEXT_pointer; long EXT_paletted_texture_glColorTableEXT_pointer; long EXT_paletted_texture_glColorSubTableEXT_pointer; @@ -471,6 +541,14 @@ long EXT_secondary_color_glSecondaryColorPointerEXT_pointer; long EXT_stencil_clear_tag_glStencilClearTagEXT_pointer; long EXT_stencil_two_side_glActiveStencilFaceEXT_pointer; + long EXT_texture_array_glFramebufferTextureLayerEXT_pointer; + long EXT_texture_buffer_object_glTexBufferEXT_pointer; + long EXT_texture_integer_glClearColorIiEXT_pointer; + long EXT_texture_integer_glClearColorIuiEXT_pointer; + long EXT_texture_integer_glTexParameterIivEXT_pointer; + long EXT_texture_integer_glTexParameterIuivEXT_pointer; + long EXT_texture_integer_glGetTexParameterIivEXT_pointer; + long EXT_texture_integer_glGetTexParameterIuivEXT_pointer; long EXT_timer_query_glGetQueryObjecti64vEXT_pointer; long EXT_timer_query_glGetQueryObjectui64vEXT_pointer; long EXT_vertex_shader_glBeginVertexShaderEXT_pointer; @@ -888,6 +966,9 @@ long GL21_glUniformMatrix4x2fv_pointer; long GL21_glUniformMatrix3x4fv_pointer; long GL21_glUniformMatrix4x3fv_pointer; + long NV_depth_buffer_float_glDepthRangedNV_pointer; + long NV_depth_buffer_float_glClearDepthdNV_pointer; + long NV_depth_buffer_float_glDepthBoundsdNV_pointer; long NV_evaluators_glGetMapControlPointsNV_pointer; long NV_evaluators_glMapControlPointsNV_pointer; long NV_evaluators_glMapParameterfvNV_pointer; @@ -908,6 +989,26 @@ long NV_fragment_program_glProgramNamedParameter4dNV_pointer; long NV_fragment_program_glGetProgramNamedParameterfvNV_pointer; long NV_fragment_program_glGetProgramNamedParameterdvNV_pointer; + long NV_framebuffer_multisample_coverage_glRenderbufferStorageMultsampleCoverageNV_pointer; + long NV_geometry_program4_glProgramVertexLimitNV_pointer; + long NV_geometry_program4_glFramebufferTextureEXT_pointer; + long NV_geometry_program4_glFramebufferTextureLayerEXT_pointer; + long NV_gpu_program4_glProgramLocalParameterI4iNV_pointer; + long NV_gpu_program4_glProgramLocalParameterI4ivNV_pointer; + long NV_gpu_program4_glProgramLocalParametersI4ivNV_pointer; + long NV_gpu_program4_glProgramLocalParameterI4uiNV_pointer; + long NV_gpu_program4_glProgramLocalParameterI4uivNV_pointer; + long NV_gpu_program4_glProgramLocalParametersI4uivNV_pointer; + long NV_gpu_program4_glProgramEnvParameterI4iNV_pointer; + long NV_gpu_program4_glProgramEnvParameterI4ivNV_pointer; + long NV_gpu_program4_glProgramEnvParametersI4ivNV_pointer; + long NV_gpu_program4_glProgramEnvParameterI4uiNV_pointer; + long NV_gpu_program4_glProgramEnvParameterI4uivNV_pointer; + long NV_gpu_program4_glProgramEnvParametersI4uivNV_pointer; + long NV_gpu_program4_glGetProgramLocalParameterIivNV_pointer; + long NV_gpu_program4_glGetProgramLocalParameterIuivNV_pointer; + long NV_gpu_program4_glGetProgramEnvParameterIivNV_pointer; + long NV_gpu_program4_glGetProgramEnvParameterIuivNV_pointer; long NV_half_float_glVertex2hNV_pointer; long NV_half_float_glVertex3hNV_pointer; long NV_half_float_glVertex4hNV_pointer; @@ -939,6 +1040,12 @@ long NV_occlusion_query_glEndOcclusionQueryNV_pointer; long NV_occlusion_query_glGetOcclusionQueryuivNV_pointer; long NV_occlusion_query_glGetOcclusionQueryivNV_pointer; + long NV_parameter_buffer_object_glBindBufferRangeNV_pointer; + long NV_parameter_buffer_object_glBindBufferOffsetNV_pointer; + long NV_parameter_buffer_object_glBindBufferBaseNV_pointer; + long NV_parameter_buffer_object_glProgramBufferParametersfvNV_pointer; + long NV_parameter_buffer_object_glProgramBufferParametersIivNV_pointer; + long NV_parameter_buffer_object_glProgramBufferParametersIuivNV_pointer; long NV_pixel_data_range_glPixelDataRangeNV_pointer; long NV_pixel_data_range_glFlushPixelDataRangeNV_pointer; long NV_point_sprite_glPointParameteriNV_pointer; @@ -969,6 +1076,17 @@ long NV_register_combiners_glGetFinalCombinerInputParameterivNV_pointer; long NV_register_combiners2_glCombinerStageParameterfvNV_pointer; long NV_register_combiners2_glGetCombinerStageParameterfvNV_pointer; + long NV_transform_feeback_glBindBufferRangeNV_pointer; + long NV_transform_feeback_glBindBufferOffsetNV_pointer; + long NV_transform_feeback_glBindBufferBaseNV_pointer; + long NV_transform_feeback_glTransformFeedbackAttribsNV_pointer; + long NV_transform_feeback_glTransformFeedbackVaryingsNV_pointer; + long NV_transform_feeback_glBeginTransformFeedbackNV_pointer; + long NV_transform_feeback_glEndTransformFeedbackNV_pointer; + long NV_transform_feeback_glGetVaryingLocationNV_pointer; + long NV_transform_feeback_glGetActiveVaryingNV_pointer; + long NV_transform_feeback_glActiveVaryingNV_pointer; + long NV_transform_feeback_glGetTransformFeedbackVaryingNV_pointer; long NV_vertex_array_range_glVertexArrayRangeNV_pointer; long NV_vertex_array_range_glFlushVertexArrayRangeNV_pointer; long NV_vertex_array_range_glAllocateMemoryNV_pointer; @@ -1393,6 +1511,13 @@ (ATI_vertex_streams_glVertexBlendEnviATI_pointer = GLContext.getFunctionAddress("glVertexBlendEnviATI")) != 0; } + private boolean EXT_bindable_uniform_initNativeFunctionAddresses() { + return + (EXT_bindable_uniform_glUniformBufferEXT_pointer = GLContext.getFunctionAddress("glUniformBufferEXT")) != 0 && + (EXT_bindable_uniform_glGetUniformBufferSizeEXT_pointer = GLContext.getFunctionAddress("glGetUniformBufferSizeEXT")) != 0 && + (EXT_bindable_uniform_glGetUniformOffsetEXT_pointer = GLContext.getFunctionAddress("glGetUniformOffsetEXT")) != 0; + } + private boolean EXT_blend_color_initNativeFunctionAddresses() { return (EXT_blend_color_glBlendColorEXT_pointer = GLContext.getFunctionAddress("glBlendColorEXT")) != 0; @@ -1424,6 +1549,22 @@ (EXT_depth_bounds_test_glDepthBoundsEXT_pointer = GLContext.getFunctionAddress("glDepthBoundsEXT")) != 0; } + private boolean EXT_draw_buffers2_initNativeFunctionAddresses() { + return + (EXT_draw_buffers2_glColorMaskIndexedEXT_pointer = GLContext.getFunctionAddress("glColorMaskIndexedEXT")) != 0 && + (EXT_draw_buffers2_glGetBooleanIndexedvEXT_pointer = GLContext.getFunctionAddress("glGetBooleanIndexedvEXT")) != 0 && + (EXT_draw_buffers2_glGetIntegerIndexedvEXT_pointer = GLContext.getFunctionAddress("glGetIntegerIndexedvEXT")) != 0 && + (EXT_draw_buffers2_glEnableIndexedEXT_pointer = GLContext.getFunctionAddress("glEnableIndexedEXT")) != 0 && + (EXT_draw_buffers2_glDisableIndexedEXT_pointer = GLContext.getFunctionAddress("glDisableIndexedEXT")) != 0 && + (EXT_draw_buffers2_glIsEnabledIndexedEXT_pointer = GLContext.getFunctionAddress("glIsEnabledIndexedEXT")) != 0; + } + + private boolean EXT_draw_instanced_initNativeFunctionAddresses() { + return + (EXT_draw_instanced_glDrawArraysInstancedEXT_pointer = GLContext.getFunctionAddress("glDrawArraysInstancedEXT")) != 0 && + (EXT_draw_instanced_glDrawElementsInstancedEXT_pointer = GLContext.getFunctionAddress("glDrawElementsInstancedEXT")) != 0; + } + private boolean EXT_draw_range_elements_initNativeFunctionAddresses() { return (EXT_draw_range_elements_glDrawRangeElementsEXT_pointer = GLContext.getFunctionAddress("glDrawRangeElementsEXT")) != 0; @@ -1467,12 +1608,58 @@ (EXT_framebuffer_object_glGenerateMipmapEXT_pointer = GLContext.getFunctionAddress("glGenerateMipmapEXT")) != 0; } + private boolean EXT_geometry_shader4_initNativeFunctionAddresses() { + return + (EXT_geometry_shader4_glProgramParameteriEXT_pointer = GLContext.getFunctionAddress("glProgramParameteriEXT")) != 0 && + (EXT_geometry_shader4_glFramebufferTextureEXT_pointer = GLContext.getFunctionAddress("glFramebufferTextureEXT")) != 0 && + (EXT_geometry_shader4_glFramebufferTextureLayerEXT_pointer = GLContext.getFunctionAddress("glFramebufferTextureLayerEXT")) != 0 && + (EXT_geometry_shader4_glFramebufferTextureFaceEXT_pointer = GLContext.getFunctionAddress("glFramebufferTextureFaceEXT")) != 0; + } + private boolean EXT_gpu_program_parameters_initNativeFunctionAddresses() { return (EXT_gpu_program_parameters_glProgramEnvParameter4fvEXT_pointer = GLContext.getFunctionAddress("glProgramEnvParameter4fvEXT")) != 0 && (EXT_gpu_program_parameters_glProgramLocalParameter4fvEXT_pointer = GLContext.getFunctionAddress("glProgramLocalParameter4fvEXT")) != 0; } + private boolean EXT_gpu_shader4_initNativeFunctionAddresses() { + return + (EXT_gpu_shader4_glVertexAttribI1iEXT_pointer = GLContext.getFunctionAddress("glVertexAttribI1iEXT")) != 0 && + (EXT_gpu_shader4_glVertexAttribI2iEXT_pointer = GLContext.getFunctionAddress("glVertexAttribI2iEXT")) != 0 && + (EXT_gpu_shader4_glVertexAttribI3iEXT_pointer = GLContext.getFunctionAddress("glVertexAttribI3iEXT")) != 0 && + (EXT_gpu_shader4_glVertexAttribI4iEXT_pointer = GLContext.getFunctionAddress("glVertexAttribI4iEXT")) != 0 && + (EXT_gpu_shader4_glVertexAttribI1uiEXT_pointer = GLContext.getFunctionAddress("glVertexAttribI1uiEXT")) != 0 && + (EXT_gpu_shader4_glVertexAttribI2uiEXT_pointer = GLContext.getFunctionAddress("glVertexAttribI2uiEXT")) != 0 && + (EXT_gpu_shader4_glVertexAttribI3uiEXT_pointer = GLContext.getFunctionAddress("glVertexAttribI3uiEXT")) != 0 && + (EXT_gpu_shader4_glVertexAttribI4uiEXT_pointer = GLContext.getFunctionAddress("glVertexAttribI4uiEXT")) != 0 && + (EXT_gpu_shader4_glVertexAttribI1ivEXT_pointer = GLContext.getFunctionAddress("glVertexAttribI1ivEXT")) != 0 && + (EXT_gpu_shader4_glVertexAttribI2ivEXT_pointer = GLContext.getFunctionAddress("glVertexAttribI2ivEXT")) != 0 && + (EXT_gpu_shader4_glVertexAttribI3ivEXT_pointer = GLContext.getFunctionAddress("glVertexAttribI3ivEXT")) != 0 && + (EXT_gpu_shader4_glVertexAttribI4ivEXT_pointer = GLContext.getFunctionAddress("glVertexAttribI4ivEXT")) != 0 && + (EXT_gpu_shader4_glVertexAttribI1uivEXT_pointer = GLContext.getFunctionAddress("glVertexAttribI1uivEXT")) != 0 && + (EXT_gpu_shader4_glVertexAttribI2uivEXT_pointer = GLContext.getFunctionAddress("glVertexAttribI2uivEXT")) != 0 && + (EXT_gpu_shader4_glVertexAttribI3uivEXT_pointer = GLContext.getFunctionAddress("glVertexAttribI3uivEXT")) != 0 && + (EXT_gpu_shader4_glVertexAttribI4uivEXT_pointer = GLContext.getFunctionAddress("glVertexAttribI4uivEXT")) != 0 && + (EXT_gpu_shader4_glVertexAttribI4bvEXT_pointer = GLContext.getFunctionAddress("glVertexAttribI4bvEXT")) != 0 && + (EXT_gpu_shader4_glVertexAttribI4svEXT_pointer = GLContext.getFunctionAddress("glVertexAttribI4svEXT")) != 0 && + (EXT_gpu_shader4_glVertexAttribI4ubvEXT_pointer = GLContext.getFunctionAddress("glVertexAttribI4ubvEXT")) != 0 && + (EXT_gpu_shader4_glVertexAttribI4usvEXT_pointer = GLContext.getFunctionAddress("glVertexAttribI4usvEXT")) != 0 && + (EXT_gpu_shader4_glVertexAttribIPointerEXT_pointer = GLContext.getFunctionAddress("glVertexAttribIPointerEXT")) != 0 && + (EXT_gpu_shader4_glGetVertexAttribIivEXT_pointer = GLContext.getFunctionAddress("glGetVertexAttribIivEXT")) != 0 && + (EXT_gpu_shader4_glGetVertexAttribIuivEXT_pointer = GLContext.getFunctionAddress("glGetVertexAttribIuivEXT")) != 0 && + (EXT_gpu_shader4_glUniform1uiEXT_pointer = GLContext.getFunctionAddress("glUniform1uiEXT")) != 0 && + (EXT_gpu_shader4_glUniform2uiEXT_pointer = GLContext.getFunctionAddress("glUniform2uiEXT")) != 0 && + (EXT_gpu_shader4_glUniform3uiEXT_pointer = GLContext.getFunctionAddress("glUniform3uiEXT")) != 0 && + (EXT_gpu_shader4_glUniform4uiEXT_pointer = GLContext.getFunctionAddress("glUniform4uiEXT")) != 0 && + (EXT_gpu_shader4_glUniform1uivEXT_pointer = GLContext.getFunctionAddress("glUniform1uivEXT")) != 0 && + (EXT_gpu_shader4_glUniform2uivEXT_pointer = GLContext.getFunctionAddress("glUniform2uivEXT")) != 0 && + (EXT_gpu_shader4_glUniform3uivEXT_pointer = GLContext.getFunctionAddress("glUniform3uivEXT")) != 0 && + (EXT_gpu_shader4_glUniform4uivEXT_pointer = GLContext.getFunctionAddress("glUniform4uivEXT")) != 0 && + (EXT_gpu_shader4_glGetUniformuivEXT_pointer = GLContext.getFunctionAddress("glGetUniformuivEXT")) != 0 && + (EXT_gpu_shader4_glBindFragDataLocationEXT_pointer = GLContext.getFunctionAddress("glBindFragDataLocationEXT")) != 0 && + (EXT_gpu_shader4_glGetFragDataLocationEXT_pointer = GLContext.getFunctionAddress("glGetFragDataLocationEXT")) != 0; + } + private boolean EXT_multi_draw_arrays_initNativeFunctionAddresses() { return (EXT_multi_draw_arrays_glMultiDrawArraysEXT_pointer = GLContext.getFunctionAddress("glMultiDrawArraysEXT")) != 0; @@ -1512,6 +1699,26 @@ (EXT_stencil_two_side_glActiveStencilFaceEXT_pointer = GLContext.getFunctionAddress("glActiveStencilFaceEXT")) != 0; } + private boolean EXT_texture_array_initNativeFunctionAddresses() { + return + (EXT_texture_array_glFramebufferTextureLayerEXT_pointer = GLContext.getFunctionAddress("glFramebufferTextureLayerEXT")) != 0; + } + + private boolean EXT_texture_buffer_object_initNativeFunctionAddresses() { + return + (EXT_texture_buffer_object_glTexBufferEXT_pointer = GLContext.getFunctionAddress("glTexBufferEXT")) != 0; + } + + private boolean EXT_texture_integer_initNativeFunctionAddresses() { + return + (EXT_texture_integer_glClearColorIiEXT_pointer = GLContext.getFunctionAddress("glClearColorIiEXT")) != 0 && + (EXT_texture_integer_glClearColorIuiEXT_pointer = GLContext.getFunctionAddress("glClearColorIuiEXT")) != 0 && + (EXT_texture_integer_glTexParameterIivEXT_pointer = GLContext.getFunctionAddress("glTexParameterIivEXT")) != 0 && + (EXT_texture_integer_glTexParameterIuivEXT_pointer = GLContext.getFunctionAddress("glTexParameterIuivEXT")) != 0 && + (EXT_texture_integer_glGetTexParameterIivEXT_pointer = GLContext.getFunctionAddress("glGetTexParameterIivEXT")) != 0 && + (EXT_texture_integer_glGetTexParameterIuivEXT_pointer = GLContext.getFunctionAddress("glGetTexParameterIuivEXT")) != 0; + } + private boolean EXT_timer_query_initNativeFunctionAddresses() { return (EXT_timer_query_glGetQueryObjecti64vEXT_pointer = GLContext.getFunctionAddress("glGetQueryObjecti64vEXT")) != 0 && @@ -1969,6 +2176,13 @@ (GL21_glUniformMatrix4x3fv_pointer = GLContext.getFunctionAddress("glUniformMatrix4x3fv")) != 0; } + private boolean NV_depth_buffer_float_initNativeFunctionAddresses() { + return + (NV_depth_buffer_float_glDepthRangedNV_pointer = GLContext.getFunctionAddress("glDepthRangedNV")) != 0 && + (NV_depth_buffer_float_glClearDepthdNV_pointer = GLContext.getFunctionAddress("glClearDepthdNV")) != 0 && + (NV_depth_buffer_float_glDepthBoundsdNV_pointer = GLContext.getFunctionAddress("glDepthBoundsdNV")) != 0; + } + private boolean NV_evaluators_initNativeFunctionAddresses() { return (NV_evaluators_glGetMapControlPointsNV_pointer = GLContext.getFunctionAddress("glGetMapControlPointsNV")) != 0 && @@ -2001,6 +2215,38 @@ (NV_fragment_program_glGetProgramNamedParameterdvNV_pointer = GLContext.getFunctionAddress("glGetProgramNamedParameterdvNV")) != 0; } + private boolean NV_framebuffer_multisample_coverage_initNativeFunctionAddresses() { + return + (NV_framebuffer_multisample_coverage_glRenderbufferStorageMultsampleCoverageNV_pointer = GLContext.getFunctionAddress("glRenderbufferStorageMultsampleCoverageNV")) != 0; + } + + private boolean NV_geometry_program4_initNativeFunctionAddresses() { + return + (NV_geometry_program4_glProgramVertexLimitNV_pointer = GLContext.getFunctionAddress("glProgramVertexLimitNV")) != 0 && + (NV_geometry_program4_glFramebufferTextureEXT_pointer = GLContext.getFunctionAddress("glFramebufferTextureEXT")) != 0 && + (NV_geometry_program4_glFramebufferTextureLayerEXT_pointer = GLContext.getFunctionAddress("glFramebufferTextureLayerEXT")) != 0; + } + + private boolean NV_gpu_program4_initNativeFunctionAddresses() { + return + (NV_gpu_program4_glProgramLocalParameterI4iNV_pointer = GLContext.getFunctionAddress("glProgramLocalParameterI4iNV")) != 0 && + (NV_gpu_program4_glProgramLocalParameterI4ivNV_pointer = GLContext.getFunctionAddress("glProgramLocalParameterI4ivNV")) != 0 && + (NV_gpu_program4_glProgramLocalParametersI4ivNV_pointer = GLContext.getFunctionAddress("glProgramLocalParametersI4ivNV")) != 0 && + (NV_gpu_program4_glProgramLocalParameterI4uiNV_pointer = GLContext.getFunctionAddress("glProgramLocalParameterI4uiNV")) != 0 && + (NV_gpu_program4_glProgramLocalParameterI4uivNV_pointer = GLContext.getFunctionAddress("glProgramLocalParameterI4uivNV")) != 0 && + (NV_gpu_program4_glProgramLocalParametersI4uivNV_pointer = GLContext.getFunctionAddress("glProgramLocalParametersI4uivNV")) != 0 && + (NV_gpu_program4_glProgramEnvParameterI4iNV_pointer = GLContext.getFunctionAddress("glProgramEnvParameterI4iNV")) != 0 && + (NV_gpu_program4_glProgramEnvParameterI4ivNV_pointer = GLContext.getFunctionAddress("glProgramEnvParameterI4ivNV")) != 0 && + (NV_gpu_program4_glProgramEnvParametersI4ivNV_pointer = GLContext.getFunctionAddress("glProgramEnvParametersI4ivNV")) != 0 && + (NV_gpu_program4_glProgramEnvParameterI4uiNV_pointer = GLContext.getFunctionAddress("glProgramEnvParameterI4uiNV")) != 0 && + (NV_gpu_program4_glProgramEnvParameterI4uivNV_pointer = GLContext.getFunctionAddress("glProgramEnvParameterI4uivNV")) != 0 && + (NV_gpu_program4_glProgramEnvParametersI4uivNV_pointer = GLContext.getFunctionAddress("glProgramEnvParametersI4uivNV")) != 0 && + (NV_gpu_program4_glGetProgramLocalParameterIivNV_pointer = GLContext.getFunctionAddress("glGetProgramLocalParameterIivNV")) != 0 && + (NV_gpu_program4_glGetProgramLocalParameterIuivNV_pointer = GLContext.getFunctionAddress("glGetProgramLocalParameterIuivNV")) != 0 && + (NV_gpu_program4_glGetProgramEnvParameterIivNV_pointer = GLContext.getFunctionAddress("glGetProgramEnvParameterIivNV")) != 0 && + (NV_gpu_program4_glGetProgramEnvParameterIuivNV_pointer = GLContext.getFunctionAddress("glGetProgramEnvParameterIuivNV")) != 0; + } + private boolean NV_half_float_initNativeFunctionAddresses() { return (NV_half_float_glVertex2hNV_pointer = GLContext.getFunctionAddress("glVertex2hNV")) != 0 && @@ -2040,6 +2286,16 @@ (NV_occlusion_query_glGetOcclusionQueryivNV_pointer = GLContext.getFunctionAddress("glGetOcclusionQueryivNV")) != 0; } + private boolean NV_parameter_buffer_object_initNativeFunctionAddresses() { + return + (NV_parameter_buffer_object_glBindBufferRangeNV_pointer = GLContext.getFunctionAddress("glBindBufferRangeNV")) != 0 && + (NV_parameter_buffer_object_glBindBufferOffsetNV_pointer = GLContext.getFunctionAddress("glBindBufferOffsetNV")) != 0 && + (NV_parameter_buffer_object_glBindBufferBaseNV_pointer = GLContext.getFunctionAddress("glBindBufferBaseNV")) != 0 && + (NV_parameter_buffer_object_glProgramBufferParametersfvNV_pointer = GLContext.getFunctionAddress("glProgramBufferParametersfvNV")) != 0 && + (NV_parameter_buffer_object_glProgramBufferParametersIivNV_pointer = GLContext.getFunctionAddress("glProgramBufferParametersIivNV")) != 0 && + (NV_parameter_buffer_object_glProgramBufferParametersIuivNV_pointer = GLContext.getFunctionAddress("glProgramBufferParametersIuivNV")) != 0; + } + private boolean NV_pixel_data_range_initNativeFunctionAddresses() { return (NV_pixel_data_range_glPixelDataRangeNV_pointer = GLContext.getFunctionAddress("glPixelDataRangeNV")) != 0 && @@ -2094,6 +2350,21 @@ (NV_register_combiners2_glGetCombinerStageParameterfvNV_pointer = GLContext.getFunctionAddress("glGetCombinerStageParameterfvNV")) != 0; } + private boolean NV_transform_feeback_initNativeFunctionAddresses() { + return + (NV_transform_feeback_glBindBufferRangeNV_pointer = GLContext.getFunctionAddress("glBindBufferRangeNV")) != 0 && + (NV_transform_feeback_glBindBufferOffsetNV_pointer = GLContext.getFunctionAddress("glBindBufferOffsetNV")) != 0 && + (NV_transform_feeback_glBindBufferBaseNV_pointer = GLContext.getFunctionAddress("glBindBufferBaseNV")) != 0 && + (NV_transform_feeback_glTransformFeedbackAttribsNV_pointer = GLContext.getFunctionAddress("glTransformFeedbackAttribsNV")) != 0 && + (NV_transform_feeback_glTransformFeedbackVaryingsNV_pointer = GLContext.getFunctionAddress("glTransformFeedbackVaryingsNV")) != 0 && + (NV_transform_feeback_glBeginTransformFeedbackNV_pointer = GLContext.getFunctionAddress("glBeginTransformFeedbackNV")) != 0 && + (NV_transform_feeback_glEndTransformFeedbackNV_pointer = GLContext.getFunctionAddress("glEndTransformFeedbackNV")) != 0 && + (NV_transform_feeback_glGetVaryingLocationNV_pointer = GLContext.getFunctionAddress("glGetVaryingLocationNV")) != 0 && + (NV_transform_feeback_glGetActiveVaryingNV_pointer = GLContext.getFunctionAddress("glGetActiveVaryingNV")) != 0 && + (NV_transform_feeback_glActiveVaryingNV_pointer = GLContext.getFunctionAddress("glActiveVaryingNV")) != 0 && + (NV_transform_feeback_glGetTransformFeedbackVaryingNV_pointer = GLContext.getFunctionAddress("glGetTransformFeedbackVaryingNV")) != 0; + } + private boolean NV_vertex_array_range_initNativeFunctionAddresses() { return (NV_vertex_array_range_glVertexArrayRangeNV_pointer = GLContext.getFunctionAddress("glVertexArrayRangeNV")) != 0 && @@ -2219,6 +2490,8 @@ supported_extensions.remove("GL_ATI_vertex_attrib_array_object"); if (supported_extensions.contains("GL_ATI_vertex_streams") && !ATI_vertex_streams_initNativeFunctionAddresses()) supported_extensions.remove("GL_ATI_vertex_streams"); + if (supported_extensions.contains("GL_EXT_bindable_uniform") && !EXT_bindable_uniform_initNativeFunctionAddresses()) + supported_extensions.remove("GL_EXT_bindable_uniform"); if (supported_extensions.contains("GL_EXT_blend_color") && !EXT_blend_color_initNativeFunctionAddresses()) supported_extensions.remove("GL_EXT_blend_color"); if (supported_extensions.contains("GL_EXT_blend_equation_separate") && !EXT_blend_equation_separate_initNativeFunctionAddresses()) @@ -2231,6 +2504,10 @@ supported_extensions.remove("GL_EXT_compiled_vertex_array"); if (supported_extensions.contains("GL_EXT_depth_bounds_test") && !EXT_depth_bounds_test_initNativeFunctionAddresses()) supported_extensions.remove("GL_EXT_depth_bounds_test"); + if (supported_extensions.contains("GL_EXT_draw_buffers2") && !EXT_draw_buffers2_initNativeFunctionAddresses()) + supported_extensions.remove("GL_EXT_draw_buffers2"); + if (supported_extensions.contains("GL_EXT_draw_instanced") && !EXT_draw_instanced_initNativeFunctionAddresses()) + supported_extensions.remove("GL_EXT_draw_instanced"); if (supported_extensions.contains("GL_EXT_draw_range_elements") && !EXT_draw_range_elements_initNativeFunctionAddresses()) supported_extensions.remove("GL_EXT_draw_range_elements"); if (supported_extensions.contains("GL_EXT_fog_coord") && !EXT_fog_coord_initNativeFunctionAddresses()) @@ -2241,8 +2518,12 @@ supported_extensions.remove("GL_EXT_framebuffer_multisample"); if (supported_extensions.contains("GL_EXT_framebuffer_object") && !EXT_framebuffer_object_initNativeFunctionAddresses()) supported_extensions.remove("GL_EXT_framebuffer_object"); + if (supported_extensions.contains("GL_EXT_geometry_shader4") && !EXT_geometry_shader4_initNativeFunctionAddresses()) + supported_extensions.remove("GL_EXT_geometry_shader4"); if (supported_extensions.contains("GL_EXT_gpu_program_parameters") && !EXT_gpu_program_parameters_initNativeFunctionAddresses()) supported_extensions.remove("GL_EXT_gpu_program_parameters"); + if (supported_extensions.contains("GL_EXT_gpu_shader4") && !EXT_gpu_shader4_initNativeFunctionAddresses()) + supported_extensions.remove("GL_EXT_gpu_shader4"); if (supported_extensions.contains("GL_EXT_multi_draw_arrays") && !EXT_multi_draw_arrays_initNativeFunctionAddresses()) supported_extensions.remove("GL_EXT_multi_draw_arrays"); if (supported_extensions.contains("GL_EXT_paletted_texture") && !EXT_paletted_texture_initNativeFunctionAddresses()) @@ -2255,6 +2536,12 @@ supported_extensions.remove("GL_EXT_stencil_clear_tag"); if (supported_extensions.contains("GL_EXT_stencil_two_side") && !EXT_stencil_two_side_initNativeFunctionAddresses()) supported_extensions.remove("GL_EXT_stencil_two_side"); + if (supported_extensions.contains("GL_EXT_texture_array") && !EXT_texture_array_initNativeFunctionAddresses()) + supported_extensions.remove("GL_EXT_texture_array"); + if (supported_extensions.contains("GL_EXT_texture_buffer_object") && !EXT_texture_buffer_object_initNativeFunctionAddresses()) + supported_extensions.remove("GL_EXT_texture_buffer_object"); + if (supported_extensions.contains("GL_EXT_texture_integer") && !EXT_texture_integer_initNativeFunctionAddresses()) + supported_extensions.remove("GL_EXT_texture_integer"); if (supported_extensions.contains("GL_EXT_timer_query") && !EXT_timer_query_initNativeFunctionAddresses()) supported_extensions.remove("GL_EXT_timer_query"); if (supported_extensions.contains("GL_EXT_vertex_shader") && !EXT_vertex_shader_initNativeFunctionAddresses()) @@ -2273,16 +2560,26 @@ supported_extensions.remove("OpenGL20"); if (supported_extensions.contains("OpenGL21") && !GL21_initNativeFunctionAddresses()) supported_extensions.remove("OpenGL21"); + if (supported_extensions.contains("GL_NV_depth_buffer_float") && !NV_depth_buffer_float_initNativeFunctionAddresses()) + supported_extensions.remove("GL_NV_depth_buffer_float"); if (supported_extensions.contains("GL_NV_evaluators") && !NV_evaluators_initNativeFunctionAddresses()) supported_extensions.remove("GL_NV_evaluators"); if (supported_extensions.contains("GL_NV_fence") && !NV_fence_initNativeFunctionAddresses()) supported_extensions.remove("GL_NV_fence"); if (supported_extensions.contains("GL_NV_fragment_program") && !NV_fragment_program_initNativeFunctionAddresses()) supported_extensions.remove("GL_NV_fragment_program"); + if (supported_extensions.contains("GL_NV_framebuffer_multisample_coverage") && !NV_framebuffer_multisample_coverage_initNativeFunctionAddresses()) + supported_extensions.remove("GL_NV_framebuffer_multisample_coverage"); + if (supported_extensions.contains("GL_NV_geometry_program4") && !NV_geometry_program4_initNativeFunctionAddresses()) + supported_extensions.remove("GL_NV_geometry_program4"); + if (supported_extensions.contains("GL_NV_gpu_program4") && !NV_gpu_program4_initNativeFunctionAddresses()) + supported_extensions.remove("GL_NV_gpu_program4"); if (supported_extensions.contains("GL_NV_half_float") && !NV_half_float_initNativeFunctionAddresses()) supported_extensions.remove("GL_NV_half_float"); if (supported_extensions.contains("GL_NV_occlusion_query") && !NV_occlusion_query_initNativeFunctionAddresses()) supported_extensions.remove("GL_NV_occlusion_query"); + if (supported_extensions.contains("GL_NV_parameter_buffer_object") && !NV_parameter_buffer_object_initNativeFunctionAddresses()) + supported_extensions.remove("GL_NV_parameter_buffer_object"); if (supported_extensions.contains("GL_NV_pixel_data_range") && !NV_pixel_data_range_initNativeFunctionAddresses()) supported_extensions.remove("GL_NV_pixel_data_range"); if (supported_extensions.contains("GL_NV_point_sprite") && !NV_point_sprite_initNativeFunctionAddresses()) @@ -2295,6 +2592,8 @@ supported_extensions.remove("GL_NV_register_combiners"); if (supported_extensions.contains("GL_NV_register_combiners2") && !NV_register_combiners2_initNativeFunctionAddresses()) supported_extensions.remove("GL_NV_register_combiners2"); + if (supported_extensions.contains("GL_NV_transform_feeback") && !NV_transform_feeback_initNativeFunctionAddresses()) + supported_extensions.remove("GL_NV_transform_feeback"); if (supported_extensions.contains("GL_NV_vertex_array_range") && !NV_vertex_array_range_initNativeFunctionAddresses()) supported_extensions.remove("GL_NV_vertex_array_range"); if (supported_extensions.contains("GL_NV_vertex_program") && !NV_vertex_program_initNativeFunctionAddresses()) @@ -2365,6 +2664,7 @@ this.GL_ATI_vertex_streams = supported_extensions.contains("GL_ATI_vertex_streams"); this.GL_EXT_abgr = supported_extensions.contains("GL_EXT_abgr"); this.GL_EXT_bgra = supported_extensions.contains("GL_EXT_bgra"); + this.GL_EXT_bindable_uniform = supported_extensions.contains("GL_EXT_bindable_uniform"); this.GL_EXT_blend_color = supported_extensions.contains("GL_EXT_blend_color"); this.GL_EXT_blend_equation_separate = supported_extensions.contains("GL_EXT_blend_equation_separate"); this.GL_EXT_blend_func_separate = supported_extensions.contains("GL_EXT_blend_func_separate"); @@ -2373,14 +2673,20 @@ this.GL_EXT_cg_shader = supported_extensions.contains("GL_EXT_cg_shader"); this.GL_EXT_compiled_vertex_array = supported_extensions.contains("GL_EXT_compiled_vertex_array"); this.GL_EXT_depth_bounds_test = supported_extensions.contains("GL_EXT_depth_bounds_test"); + this.GL_EXT_draw_buffers2 = supported_extensions.contains("GL_EXT_draw_buffers2"); + this.GL_EXT_draw_instanced = supported_extensions.contains("GL_EXT_draw_instanced"); this.GL_EXT_draw_range_elements = supported_extensions.contains("GL_EXT_draw_range_elements"); this.GL_EXT_fog_coord = supported_extensions.contains("GL_EXT_fog_coord"); this.GL_EXT_framebuffer_blit = supported_extensions.contains("GL_EXT_framebuffer_blit"); this.GL_EXT_framebuffer_multisample = supported_extensions.contains("GL_EXT_framebuffer_multisample"); this.GL_EXT_framebuffer_object = supported_extensions.contains("GL_EXT_framebuffer_object"); + this.GL_EXT_framebuffer_sRGB = supported_extensions.contains("GL_EXT_framebuffer_sRGB"); + this.GL_EXT_geometry_shader4 = supported_extensions.contains("GL_EXT_geometry_shader4"); this.GL_EXT_gpu_program_parameters = supported_extensions.contains("GL_EXT_gpu_program_parameters"); + this.GL_EXT_gpu_shader4 = supported_extensions.contains("GL_EXT_gpu_shader4"); this.GL_EXT_multi_draw_arrays = supported_extensions.contains("GL_EXT_multi_draw_arrays"); this.GL_EXT_packed_depth_stencil = supported_extensions.contains("GL_EXT_packed_depth_stencil"); + this.GL_EXT_packed_float = supported_extensions.contains("GL_EXT_packed_float"); this.GL_EXT_packed_pixels = supported_extensions.contains("GL_EXT_packed_pixels"); this.GL_EXT_paletted_texture = supported_extensions.contains("GL_EXT_paletted_texture"); this.GL_EXT_pixel_buffer_object = supported_extensions.contains("GL_EXT_pixel_buffer_object") @@ -2395,14 +2701,20 @@ this.GL_EXT_stencil_two_side = supported_extensions.contains("GL_EXT_stencil_two_side"); this.GL_EXT_stencil_wrap = supported_extensions.contains("GL_EXT_stencil_wrap"); this.GL_EXT_texture_3d = supported_extensions.contains("GL_EXT_texture_3d"); + this.GL_EXT_texture_array = supported_extensions.contains("GL_EXT_texture_array"); + this.GL_EXT_texture_buffer_object = supported_extensions.contains("GL_EXT_texture_buffer_object"); + this.GL_EXT_texture_compression_latc = supported_extensions.contains("GL_EXT_texture_compression_latc"); + this.GL_EXT_texture_compression_rgtc = supported_extensions.contains("GL_EXT_texture_compression_rgtc"); this.GL_EXT_texture_compression_s3tc = supported_extensions.contains("GL_EXT_texture_compression_s3tc"); this.GL_EXT_texture_env_combine = supported_extensions.contains("GL_EXT_texture_env_combine"); this.GL_EXT_texture_env_dot3 = supported_extensions.contains("GL_EXT_texture_env_dot3"); this.GL_EXT_texture_filter_anisotropic = supported_extensions.contains("GL_EXT_texture_filter_anisotropic"); + this.GL_EXT_texture_integer = supported_extensions.contains("GL_EXT_texture_integer"); this.GL_EXT_texture_lod_bias = supported_extensions.contains("GL_EXT_texture_lod_bias"); this.GL_EXT_texture_mirror_clamp = supported_extensions.contains("GL_EXT_texture_mirror_clamp"); this.GL_EXT_texture_rectangle = supported_extensions.contains("GL_EXT_texture_rectangle"); this.GL_EXT_texture_sRGB = supported_extensions.contains("GL_EXT_texture_sRGB"); + this.GL_EXT_texture_shared_exponent = supported_extensions.contains("GL_EXT_texture_shared_exponent"); this.GL_EXT_timer_query = supported_extensions.contains("GL_EXT_timer_query"); this.GL_EXT_vertex_shader = supported_extensions.contains("GL_EXT_vertex_shader"); this.GL_EXT_vertex_weighting = supported_extensions.contains("GL_EXT_vertex_weighting"); @@ -2417,6 +2729,7 @@ this.GL_IBM_rasterpos_clip = supported_extensions.contains("GL_IBM_rasterpos_clip"); this.GL_NV_blend_square = supported_extensions.contains("GL_NV_blend_square"); this.GL_NV_copy_depth_to_color = supported_extensions.contains("GL_NV_copy_depth_to_color"); + this.GL_NV_depth_buffer_float = supported_extensions.contains("GL_NV_depth_buffer_float"); this.GL_NV_depth_clamp = supported_extensions.contains("GL_NV_depth_clamp"); this.GL_NV_evaluators = supported_extensions.contains("GL_NV_evaluators"); this.GL_NV_fence = supported_extensions.contains("GL_NV_fence"); @@ -2425,12 +2738,17 @@ this.GL_NV_fragment_program = supported_extensions.contains("GL_NV_fragment_program") && supported_extensions.contains("GL_NV_program"); this.GL_NV_fragment_program2 = supported_extensions.contains("GL_NV_fragment_program2"); + this.GL_NV_fragment_program4 = supported_extensions.contains("GL_NV_fragment_program4"); this.GL_NV_fragment_program_option = supported_extensions.contains("GL_NV_fragment_program_option"); + this.GL_NV_framebuffer_multisample_coverage = supported_extensions.contains("GL_NV_framebuffer_multisample_coverage"); + this.GL_NV_geometry_program4 = supported_extensions.contains("GL_NV_geometry_program4"); + this.GL_NV_gpu_program4 = supported_extensions.contains("GL_NV_gpu_program4"); this.GL_NV_half_float = supported_extensions.contains("GL_NV_half_float"); this.GL_NV_light_max_exponent = supported_extensions.contains("GL_NV_light_max_exponent"); this.GL_NV_multisample_filter_hint = supported_extensions.contains("GL_NV_multisample_filter_hint"); this.GL_NV_occlusion_query = supported_extensions.contains("GL_NV_occlusion_query"); this.GL_NV_packed_depth_stencil = supported_extensions.contains("GL_NV_packed_depth_stencil"); + this.GL_NV_parameter_buffer_object = supported_extensions.contains("GL_NV_parameter_buffer_object"); this.GL_NV_pixel_data_range = supported_extensions.contains("GL_NV_pixel_data_range"); this.GL_NV_point_sprite = supported_extensions.contains("GL_NV_point_sprite"); this.GL_NV_primitive_restart = supported_extensions.contains("GL_NV_primitive_restart"); @@ -2444,6 +2762,7 @@ this.GL_NV_texture_shader = supported_extensions.contains("GL_NV_texture_shader"); this.GL_NV_texture_shader2 = supported_extensions.contains("GL_NV_texture_shader2"); this.GL_NV_texture_shader3 = supported_extensions.contains("GL_NV_texture_shader3"); + this.GL_NV_transform_feeback = supported_extensions.contains("GL_NV_transform_feeback"); this.GL_NV_vertex_array_range = supported_extensions.contains("GL_NV_vertex_array_range"); this.GL_NV_vertex_array_range2 = supported_extensions.contains("GL_NV_vertex_array_range2"); this.GL_NV_vertex_program = supported_extensions.contains("GL_NV_vertex_program") @@ -2452,6 +2771,7 @@ this.GL_NV_vertex_program2 = supported_extensions.contains("GL_NV_vertex_program2"); this.GL_NV_vertex_program2_option = supported_extensions.contains("GL_NV_vertex_program2_option"); this.GL_NV_vertex_program3 = supported_extensions.contains("GL_NV_vertex_program3"); + this.GL_NV_vertex_program4 = supported_extensions.contains("GL_NV_vertex_program4"); this.GL_SGIS_generate_mipmap = supported_extensions.contains("GL_SGIS_generate_mipmap"); this.GL_SGIS_texture_lod = supported_extensions.contains("GL_SGIS_texture_lod"); this.GL_SUN_slice_accum = supported_extensions.contains("GL_SUN_slice_accum"); Added: trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTBindableUniform.java =================================================================== --- trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTBindableUniform.java (rev 0) +++ trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTBindableUniform.java 2006-11-09 22:34:30 UTC (rev 2636) @@ -0,0 +1,52 @@ +/* MACHINE GENERATED FILE, DO NOT EDIT */ + +package org.lwjgl.opengl; + +import org.lwjgl.LWJGLException; +import org.lwjgl.BufferChecks; +import java.nio.*; + +public final class EXTBindableUniform { + /** + * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, + * and GetDoublev: + */ + public static final int GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT = 0x8de2; + public static final int GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT = 0x8de3; + public static final int GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT = 0x8de4; + public static final int GL_MAX_BINDABLE_UNIFORM_SIZE_EXT = 0x8ded; + public static final int GL_UNIFORM_BUFFER_BINDING_EXT = 0x8def; + /** + * Accepted by the <target> parameters of BindBuffer, BufferData, + * BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, and + * GetBufferPointerv: + */ + public static final int GL_UNIFORM_BUFFER_EXT = 0x8dee; + + private EXTBindableUniform() { + } + + + public static void glUniformBufferEXT(int program, int location, int buffer) { + long function_pointer = GLContext.getCapabilities().EXT_bindable_uniform_glUniformBufferEXT_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + nglUniformBufferEXT(program, location, buffer, function_pointer); + } + private static native void nglUniformBufferEXT(int program, int location, int buffer, long function_pointer); + + public static int glGetUniformBufferSizeEXT(int program, int location) { + long function_pointer = GLContext.getCapabilities().EXT_bindable_uniform_glGetUniformBufferSizeEXT_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + int __result = nglGetUniformBufferSizeEXT(program, location, function_pointer); + return __result; + } + private static native int nglGetUniformBufferSizeEXT(int program, int location, long function_pointer); + + public static long glGetUniformOffsetEXT(int program, int location) { + long function_pointer = GLContext.getCapabilities().EXT_bindable_uniform_glGetUniformOffsetEXT_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + long __result = nglGetUniformOffsetEXT(program, location, function_pointer); + return __result; + } + private static native long nglGetUniformOffsetEXT(int program, int location, long function_pointer); +} Added: trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTDrawBuffers2.java =================================================================== --- trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTDrawBuffers2.java (rev 0) +++ trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTDrawBuffers2.java 2006-11-09 22:34:30 UTC (rev 2636) @@ -0,0 +1,59 @@ +/* MACHINE GENERATED FILE, DO NOT EDIT */ + +package org.lwjgl.opengl; + +import org.lwjgl.LWJGLException; +import org.lwjgl.BufferChecks; +import java.nio.*; + +public final class EXTDrawBuffers2 { + + private EXTDrawBuffers2() { + } + + + public static void glColorMaskIndexedEXT(int buf, boolean r, boolean g, boolean b, boolean a) { + long function_pointer = GLContext.getCapabilities().EXT_draw_buffers2_glColorMaskIndexedEXT_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + nglColorMaskIndexedEXT(buf, r, g, b, a, function_pointer); + } + private static native void nglColorMaskIndexedEXT(int buf, boolean r, boolean g, boolean b, boolean a, long function_pointer); + + public static void glGetBooleanIndexedEXT(int value, int index, ByteBuffer data) { + long function_pointer = GLContext.getCapabilities().EXT_draw_buffers2_glGetBooleanIndexedvEXT_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkBuffer(data, 4); + nglGetBooleanIndexedvEXT(value, index, data, data.position(), function_pointer); + } + private static native void nglGetBooleanIndexedvEXT(int value, int index, ByteBuffer data, int data_position, long function_pointer); + + public static void glGetIntegerIndexedEXT(int value, int index, IntBuffer data) { + long function_pointer = GLContext.getCapabilities().EXT_draw_buffers2_glGetIntegerIndexedvEXT_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkBuffer(data, 4); + nglGetIntegerIndexedvEXT(value, index, data, data.position(), function_pointer); + } + private static native void nglGetIntegerIndexedvEXT(int value, int index, IntBuffer data, int data_position, long function_pointer); + + public static void glEnableIndexedEXT(int target, int index) { + long function_pointer = GLContext.getCapabilities().EXT_draw_buffers2_glEnableIndexedEXT_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + nglEnableIndexedEXT(target, index, function_pointer); + } + private static native void nglEnableIndexedEXT(int target, int index, long function_pointer); + + public static void glDisableIndexedEXT(int target, int index) { + long function_pointer = GLContext.getCapabilities().EXT_draw_buffers2_glDisableIndexedEXT_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + nglDisableIndexedEXT(target, index, function_pointer); + } + private static native void nglDisableIndexedEXT(int target, int index, long function_pointer); + + public static boolean glIsEnabledIndexedEXT(int target, int index) { + long function_pointer = GLContext.getCapabilities().EXT_draw_buffers2_glIsEnabledIndexedEXT_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + boolean __result = nglIsEnabledIndexedEXT(target, index, function_pointer); + return __result; + } + private static native boolean nglIsEnabledIndexedEXT(int target, int index, long function_pointer); +} Added: trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTDrawInstanced.java =================================================================== --- trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTDrawInstanced.java (rev 0) +++ trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTDrawInstanced.java 2006-11-09 22:34:30 UTC (rev 2636) @@ -0,0 +1,51 @@ +/* MACHINE GENERATED FILE, DO NOT EDIT */ + +package org.lwjgl.opengl; + +import org.lwjgl.LWJGLException; +import org.lwjgl.BufferChecks; +import java.nio.*; + +public final class EXTDrawInstanced { + + private EXTDrawInstanced() { + } + + + public static void glDrawArraysInstancedEXT(int mode, int first, int count, int primcount) { + long function_pointer = GLContext.getCapabilities().EXT_draw_instanced_glDrawArraysInstancedEXT_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + nglDrawArraysInstancedEXT(mode, first, count, primcount, function_pointer); + } + private static native void nglDrawArraysInstancedEXT(int mode, int first, int count, int primcount, long function_pointer); + + public static void glDrawElementsInstancedEXT(int mode, ByteBuffer indices, int primcount) { + long function_pointer = GLContext.getCapabilities().EXT_draw_instanced_glDrawElementsInstancedEXT_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + GLChecks.ensureElementVBOdisabled(); + BufferChecks.checkDirect(indices); + nglDrawElementsInstancedEXT(mode, (indices.remaining()), GL11.GL_UNSIGNED_BYTE, indices, indices.position(), primcount, function_pointer); + } + public static void glDrawElementsInstancedEXT(int mode, IntBuffer indices, int primcount) { + long function_pointer = GLContext.getCapabilities().EXT_draw_instanced_glDrawElementsInstancedEXT_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + GLChecks.ensureElementVBOdisabled(); + BufferChecks.checkDirect(indices); + nglDrawElementsInstancedEXT(mode, (indices.remaining()), GL11.GL_UNSIGNED_INT, indices, indices.position() << 2, primcount, function_pointer); + } + public static void glDrawElementsInstancedEXT(int mode, ShortBuffer indices, int primcount) { + long function_pointer = GLContext.getCapabilities().EXT_draw_instanced_glDrawElementsInstancedEXT_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + GLChecks.ensureElementVBOdisabled(); + BufferChecks.checkDirect(indices); + nglDrawElementsInstancedEXT(mode, (indices.remaining()), GL11.GL_UNSIGNED_SHORT, indices, indices.position() << 1, primcount, function_pointer); + } + private static native void nglDrawElementsInstancedEXT(int mode, int count, int type, Buffer indices, int indices_position, int primcount, long function_pointer); + public static void glDrawElementsInstancedEXT(int mode, int count, int type, long indices_buffer_offset, int primcount) { + long function_pointer = GLContext.getCapabilities().EXT_draw_instanced_glDrawElementsInstancedEXT_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + GLChecks.ensureElementVBOenabled(); + nglDrawElementsInstancedEXTBO(mode, count, type, indices_buffer_offset, primcount, function_pointer); + } + private static native void nglDrawElementsInstancedEXTBO(int mode, int count, int type, long indices_buffer_offset, int primcount, long function_pointer); +} Added: trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTFramebufferSRGB.java =================================================================== --- trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTFramebufferSRGB.java (rev 0) +++ trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTFramebufferSRGB.java 2006-11-09 22:34:30 UTC (rev 2636) @@ -0,0 +1,36 @@ +/* MACHINE GENERATED FILE, DO NOT EDIT */ + +package org.lwjgl.opengl; + +import org.lwjgl.LWJGLException; +import org.lwjgl.BufferChecks; +import java.nio.*; + +public final class EXTFramebufferSRGB { + /** + * Accepted by the <attribList> parameter of glXChooseVisual, and by + * the <attrib> parameter of glXGetConfig: + */ + public static final int GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT = 0x20b2; + /** + * Accepted by the <piAttributes> parameter of + * wglGetPixelFormatAttribivEXT, wglGetPixelFormatAttribfvEXT, and + * the <piAttribIList> and <pfAttribIList> of wglChoosePixelFormatEXT: + */ + public static final int WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT = 0x20a9; + /** + * Accepted by the <cap> parameter of Enable, Disable, and IsEnabled, + * and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, + * and GetDoublev: + */ + public static final int GL_FRAMEBUFFER_SRGB_EXT = 0x8db9; + /** + * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, + * GetFloatv, and GetDoublev: + */ + public static final int GL_FRAMEBUFFER_SRGB_CAPABLE_EXT = 0x8dba; + + private EXTFramebufferSRGB() { + } + +} Added: trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTGeometryShader4.java =================================================================== --- trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTGeometryShader4.java (rev 0) +++ trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTGeometryShader4.java 2006-11-09 22:34:30 UTC (rev 2636) @@ -0,0 +1,91 @@ +/* MACHINE GENERATED FILE, DO NOT EDIT */ + +package org.lwjgl.opengl; + +import org.lwjgl.LWJGLException; +import org.lwjgl.BufferChecks; +import java.nio.*; + +public final class EXTGeometryShader4 { + /** + * Accepted by the <type> parameter of CreateShader and returned by the + * <params> parameter of GetShaderiv: + */ + public static final int GL_GEOM... [truncated message content] |
From: <sp...@us...> - 2006-11-15 18:47:17
|
Revision: 2645 http://svn.sourceforge.net/java-game-lib/?rev=2645&view=rev Author: spasi Date: 2006-11-15 10:46:22 -0800 (Wed, 15 Nov 2006) Log Message: ----------- Removed duplicate functions (based on NVIDIA's glext.h) Modified Paths: -------------- trunk/LWJGL/src/generated/org/lwjgl/opengl/ContextCapabilities.java trunk/LWJGL/src/generated/org/lwjgl/opengl/NVParameterBufferObject.java trunk/LWJGL/src/native/generated/org_lwjgl_opengl_NVParameterBufferObject.c trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_parameter_buffer_object.java Modified: trunk/LWJGL/src/generated/org/lwjgl/opengl/ContextCapabilities.java =================================================================== --- trunk/LWJGL/src/generated/org/lwjgl/opengl/ContextCapabilities.java 2006-11-14 09:32:04 UTC (rev 2644) +++ trunk/LWJGL/src/generated/org/lwjgl/opengl/ContextCapabilities.java 2006-11-15 18:46:22 UTC (rev 2645) @@ -1040,9 +1040,6 @@ long NV_occlusion_query_glEndOcclusionQueryNV_pointer; long NV_occlusion_query_glGetOcclusionQueryuivNV_pointer; long NV_occlusion_query_glGetOcclusionQueryivNV_pointer; - long NV_parameter_buffer_object_glBindBufferRangeNV_pointer; - long NV_parameter_buffer_object_glBindBufferOffsetNV_pointer; - long NV_parameter_buffer_object_glBindBufferBaseNV_pointer; long NV_parameter_buffer_object_glProgramBufferParametersfvNV_pointer; long NV_parameter_buffer_object_glProgramBufferParametersIivNV_pointer; long NV_parameter_buffer_object_glProgramBufferParametersIuivNV_pointer; @@ -2288,9 +2285,6 @@ private boolean NV_parameter_buffer_object_initNativeFunctionAddresses() { return - (NV_parameter_buffer_object_glBindBufferRangeNV_pointer = GLContext.getFunctionAddress("glBindBufferRangeNV")) != 0 && - (NV_parameter_buffer_object_glBindBufferOffsetNV_pointer = GLContext.getFunctionAddress("glBindBufferOffsetNV")) != 0 && - (NV_parameter_buffer_object_glBindBufferBaseNV_pointer = GLContext.getFunctionAddress("glBindBufferBaseNV")) != 0 && (NV_parameter_buffer_object_glProgramBufferParametersfvNV_pointer = GLContext.getFunctionAddress("glProgramBufferParametersfvNV")) != 0 && (NV_parameter_buffer_object_glProgramBufferParametersIivNV_pointer = GLContext.getFunctionAddress("glProgramBufferParametersIivNV")) != 0 && (NV_parameter_buffer_object_glProgramBufferParametersIuivNV_pointer = GLContext.getFunctionAddress("glProgramBufferParametersIuivNV")) != 0; Modified: trunk/LWJGL/src/generated/org/lwjgl/opengl/NVParameterBufferObject.java =================================================================== --- trunk/LWJGL/src/generated/org/lwjgl/opengl/NVParameterBufferObject.java 2006-11-14 09:32:04 UTC (rev 2644) +++ trunk/LWJGL/src/generated/org/lwjgl/opengl/NVParameterBufferObject.java 2006-11-15 18:46:22 UTC (rev 2645) @@ -26,27 +26,6 @@ } - public static void glBindBufferRangeNV(int target, int index, int buffer, long offset, long size) { - long function_pointer = GLContext.getCapabilities().NV_parameter_buffer_object_glBindBufferRangeNV_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - nglBindBufferRangeNV(target, index, buffer, offset, size, function_pointer); - } - private static native void nglBindBufferRangeNV(int target, int index, int buffer, long offset, long size, long function_pointer); - - public static void glBindBufferOffsetNV(int target, int index, int buffer, long offset) { - long function_pointer = GLContext.getCapabilities().NV_parameter_buffer_object_glBindBufferOffsetNV_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - nglBindBufferOffsetNV(target, index, buffer, offset, function_pointer); - } - private static native void nglBindBufferOffsetNV(int target, int index, int buffer, long offset, long function_pointer); - - public static void glBindBufferBaseNV(int target, int index, int buffer) { - long function_pointer = GLContext.getCapabilities().NV_parameter_buffer_object_glBindBufferBaseNV_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - nglBindBufferBaseNV(target, index, buffer, function_pointer); - } - private static native void nglBindBufferBaseNV(int target, int index, int buffer, long function_pointer); - public static void glProgramBufferParametersNV(int target, int buffer, int index, FloatBuffer params) { long function_pointer = GLContext.getCapabilities().NV_parameter_buffer_object_glProgramBufferParametersfvNV_pointer; BufferChecks.checkFunctionAddress(function_pointer); Modified: trunk/LWJGL/src/native/generated/org_lwjgl_opengl_NVParameterBufferObject.c =================================================================== --- trunk/LWJGL/src/native/generated/org_lwjgl_opengl_NVParameterBufferObject.c 2006-11-14 09:32:04 UTC (rev 2644) +++ trunk/LWJGL/src/native/generated/org_lwjgl_opengl_NVParameterBufferObject.c 2006-11-15 18:46:22 UTC (rev 2645) @@ -3,28 +3,10 @@ #include <jni.h> #include "extgl.h" -typedef void (APIENTRY *glBindBufferRangeNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef void (APIENTRY *glBindBufferOffsetNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); -typedef void (APIENTRY *glBindBufferBaseNVPROC) (GLenum target, GLuint index, GLuint buffer); typedef void (APIENTRY *glProgramBufferParametersfvNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat * params); typedef void (APIENTRY *glProgramBufferParametersIivNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint * params); typedef void (APIENTRY *glProgramBufferParametersIuivNVPROC) (GLenum target, GLuint buffer, GLuint index, GLuint count, const GLuint * params); -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVParameterBufferObject_nglBindBufferRangeNV(JNIEnv *env, jclass clazz, jint target, jint index, jint buffer, jlong offset, jlong size, jlong function_pointer) { - glBindBufferRangeNVPROC glBindBufferRangeNV = (glBindBufferRangeNVPROC)((intptr_t)function_pointer); - glBindBufferRangeNV(target, index, buffer, offset, size); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVParameterBufferObject_nglBindBufferOffsetNV(JNIEnv *env, jclass clazz, jint target, jint index, jint buffer, jlong offset, jlong function_pointer) { - glBindBufferOffsetNVPROC glBindBufferOffsetNV = (glBindBufferOffsetNVPROC)((intptr_t)function_pointer); - glBindBufferOffsetNV(target, index, buffer, offset); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVParameterBufferObject_nglBindBufferBaseNV(JNIEnv *env, jclass clazz, jint target, jint index, jint buffer, jlong function_pointer) { - glBindBufferBaseNVPROC glBindBufferBaseNV = (glBindBufferBaseNVPROC)((intptr_t)function_pointer); - glBindBufferBaseNV(target, index, buffer); -} - JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVParameterBufferObject_nglProgramBufferParametersfvNV(JNIEnv *env, jclass clazz, jint target, jint buffer, jint index, jint count, jobject params, jint params_position, jlong function_pointer) { const GLfloat *params_address = ((const GLfloat *)(*env)->GetDirectBufferAddress(env, params)) + params_position; glProgramBufferParametersfvNVPROC glProgramBufferParametersfvNV = (glProgramBufferParametersfvNVPROC)((intptr_t)function_pointer); Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_parameter_buffer_object.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_parameter_buffer_object.java 2006-11-14 09:32:04 UTC (rev 2644) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_parameter_buffer_object.java 2006-11-15 18:46:22 UTC (rev 2645) @@ -52,12 +52,6 @@ int GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV = 0x8DA3; int GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV = 0x8DA4; - void glBindBufferRangeNV(@GLenum int target, @GLuint int index, @GLuint int buffer, @GLintptr long offset, @GLsizeiptr long size); - - void glBindBufferOffsetNV(@GLenum int target, @GLuint int index, @GLuint int buffer, @GLintptr long offset); - - void glBindBufferBaseNV(@GLenum int target, @GLuint int index, @GLuint int buffer); - @StripPostfix("params") void glProgramBufferParametersfvNV(@GLenum int target, @GLuint int buffer, @GLuint int index, @AutoSize(value = "params", expression = " >> 2") @GLsizei int count, @Const FloatBuffer params); @@ -70,8 +64,4 @@ void glProgramBufferParametersIuivNV(@GLenum int target, @GLuint int buffer, @GLuint int index, @AutoSize(value = "params", expression = " >> 2") @GLuint int count, @Const @GLuint IntBuffer params); - // TODO: This is weird and breaks the generator, re-examine when the spec's final version is out - //@StripPostfix("data") - //void glGetIntegerIndexedvEXT(@GLenum int value, @GLuint int index, @Check("4") @GLboolean ByteBuffer data); - } \ 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: <ma...@us...> - 2006-11-18 21:56:32
|
Revision: 2653 http://svn.sourceforge.net/java-game-lib/?rev=2653&view=rev Author: matzon Date: 2006-11-18 13:56:31 -0800 (Sat, 18 Nov 2006) Log Message: ----------- JNI_VERSION restructure Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/fmod3/FMOD.java trunk/LWJGL/src/native/common/fmod3/org_lwjgl_fmod3_FMOD.c Modified: trunk/LWJGL/src/java/org/lwjgl/fmod3/FMOD.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/fmod3/FMOD.java 2006-11-18 21:28:17 UTC (rev 2652) +++ trunk/LWJGL/src/java/org/lwjgl/fmod3/FMOD.java 2006-11-18 21:56:31 UTC (rev 2653) @@ -194,6 +194,9 @@ /** Version of FMOD */ public static final String VERSION = "1.0beta3"; + + /** Current version of the JNI library */ + static final int JNI_VERSION = 1; static { initialize(); @@ -211,10 +214,10 @@ loadLibrary(JNI_LIBRARY_NAME); // check for mismatch - String nativeVersion = getNativeLibraryVersion(); - if (!nativeVersion.equals(VERSION)) { + int nativeVersion = getNativeLibraryVersion(); + if (nativeVersion != JNI_VERSION) { throw new LinkageError( - "Version mismatch: jar version is '" + VERSION + + "Version mismatch: jar version is '" + JNI_VERSION + "', native libary version is '" + nativeVersion + "'"); } @@ -242,7 +245,7 @@ /** * Return the version of the native library */ - private static native String getNativeLibraryVersion(); + private static native int getNativeLibraryVersion(); /** * @return true if AL has been created Modified: trunk/LWJGL/src/native/common/fmod3/org_lwjgl_fmod3_FMOD.c =================================================================== --- trunk/LWJGL/src/native/common/fmod3/org_lwjgl_fmod3_FMOD.c 2006-11-18 21:28:17 UTC (rev 2652) +++ trunk/LWJGL/src/native/common/fmod3/org_lwjgl_fmod3_FMOD.c 2006-11-18 21:56:31 UTC (rev 2653) @@ -38,10 +38,10 @@ /* * Class: org_lwjgl_fmod3_FMOD * Method: getNativeLibraryVersion - * Signature: ()Ljava/lang/String; + * Signature: ()I */ -JNIEXPORT jstring JNICALL Java_org_lwjgl_fmod3_FMOD_getNativeLibraryVersion(JNIEnv * env, jclass clazz) { - return NewStringNative(env, VERSION); +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod3_FMOD_getNativeLibraryVersion(JNIEnv * env, jclass clazz) { + return org_lwjgl_fmod3_FMOD_JNI_VERSION; } /* This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2006-11-18 22:03:04
|
Revision: 2654 http://svn.sourceforge.net/java-game-lib/?rev=2654&view=rev Author: matzon Date: 2006-11-18 14:03:02 -0800 (Sat, 18 Nov 2006) Log Message: ----------- JNI_VERSION restructure Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/devil/ILNative.java trunk/LWJGL/src/native/common/devil/extil.c Modified: trunk/LWJGL/src/java/org/lwjgl/devil/ILNative.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/devil/ILNative.java 2006-11-18 21:56:31 UTC (rev 2653) +++ trunk/LWJGL/src/java/org/lwjgl/devil/ILNative.java 2006-11-18 22:03:02 UTC (rev 2654) @@ -54,6 +54,9 @@ /** Version of IL */ public static final String VERSION = "1.0beta3"; + + /** Current version of the JNI library */ + static final int JNI_VERSION = 1; private static void loadLibrary(final String lib_name) { AccessController.doPrivileged(new PrivilegedAction() { @@ -74,10 +77,10 @@ loadLibrary(JNI_LIBRARY_NAME); // check for mismatch - String nativeVersion = getNativeLibraryVersion(); - if (!nativeVersion.equals(VERSION)) { + int nativeVersion = getNativeLibraryVersion(); + if (nativeVersion != JNI_VERSION) { throw new LinkageError( - "Version mismatch: jar version is '" + VERSION + + "Version mismatch: jar version is '" + JNI_VERSION + "', native libary version is '" + nativeVersion + "'"); } } @@ -88,7 +91,7 @@ static native void resetNativeStubsIL(Class clazz); static native void nCreateIL(String[] ilPaths) throws LWJGLException; static native void nDestroyIL(); - private static native String getNativeLibraryVersion(); + private static native int getNativeLibraryVersion(); static void createIL() throws LWJGLException { String[] illPaths = LWJGLUtil.getLibraryPaths(new String[]{ Modified: trunk/LWJGL/src/native/common/devil/extil.c =================================================================== --- trunk/LWJGL/src/native/common/devil/extil.c 2006-11-18 21:56:31 UTC (rev 2653) +++ trunk/LWJGL/src/native/common/devil/extil.c 2006-11-18 22:03:02 UTC (rev 2654) @@ -8,16 +8,17 @@ #include <libgen.h> static void* devILhandle; #endif +#include "org_lwjgl_devil_ILNative.h"; static const char* VERSION = "1.0beta3"; /* * Class: org_lwjgl_devil_ILNative * Method: getNativeLibraryVersion - * Signature: ()Ljava/lang/String; + * Signature: ()I */ -JNIEXPORT jstring JNICALL Java_org_lwjgl_devil_ILNative_getNativeLibraryVersion(JNIEnv *env, jclass clazz) { - return NewStringNative(env, VERSION); +JNIEXPORT jint JNICALL Java_org_lwjgl_devil_ILNative_getNativeLibraryVersion(JNIEnv *env, jclass clazz) { + return org_lwjgl_devil_ILNative_JNI_VERSION; } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2006-11-19 13:33:49
|
Revision: 2662 http://svn.sourceforge.net/java-game-lib/?rev=2662&view=rev Author: elias_naur Date: 2006-11-19 05:33:45 -0800 (Sun, 19 Nov 2006) Log Message: ----------- Made all GL functions only query ContextCapabilities.getCapabilities() once. Now all GLCheck checks will take the ContextCapabilities instance as an argument instead of querying for it. Inspired by MatthiasM, who just don't seem to be content with LWJGL performance, ever ;) Modified Paths: -------------- trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBBufferObject.java trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBColorBufferFloat.java trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBDrawBuffers.java trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBImaging.java trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBMatrixPalette.java trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBMultisample.java trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBMultitexture.java trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBOcclusionQuery.java trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBPointParameters.java trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBProgram.java trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBShaderObjects.java trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBTextureCompression.java trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBTransposeMatrix.java trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBVertexBlend.java trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBVertexProgram.java trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBVertexShader.java trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBWindowPos.java trunk/LWJGL/src/generated/org/lwjgl/opengl/ATIDrawBuffers.java trunk/LWJGL/src/generated/org/lwjgl/opengl/ATIElementArray.java trunk/LWJGL/src/generated/org/lwjgl/opengl/ATIEnvmapBumpmap.java trunk/LWJGL/src/generated/org/lwjgl/opengl/ATIFragmentShader.java trunk/LWJGL/src/generated/org/lwjgl/opengl/ATIMapObjectBuffer.java trunk/LWJGL/src/generated/org/lwjgl/opengl/ATIPnTriangles.java trunk/LWJGL/src/generated/org/lwjgl/opengl/ATISeparateStencil.java trunk/LWJGL/src/generated/org/lwjgl/opengl/ATITextFragmentShader.java trunk/LWJGL/src/generated/org/lwjgl/opengl/ATIVertexArrayObject.java trunk/LWJGL/src/generated/org/lwjgl/opengl/ATIVertexAttribArrayObject.java trunk/LWJGL/src/generated/org/lwjgl/opengl/ATIVertexStreams.java trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTBindableUniform.java trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTBlendColor.java trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTBlendEquationSeparate.java trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTBlendFuncSeparate.java trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTBlendMinmax.java trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTCompiledVertexArray.java trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTDepthBoundsTest.java trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTDrawBuffers2.java trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTDrawInstanced.java trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTDrawRangeElements.java trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTFogCoord.java trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTFramebufferBlit.java trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTFramebufferMultisample.java trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTFramebufferObject.java trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTFramebufferSRGB.java trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTGeometryShader4.java trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTGpuProgramParameters.java trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTGpuShader4.java trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTMultiDrawArrays.java trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTPackedFloat.java trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTPalettedTexture.java trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTPointParameters.java trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTSecondaryColor.java trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTStencilClearTag.java trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTStencilTwoSide.java trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTTextureArray.java trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTTextureBufferObject.java trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTTextureCompressionLATC.java trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTTextureCompressionRGTC.java trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTTextureInteger.java trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTTextureSharedExponent.java trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTTimerQuery.java trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTVertexShader.java trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTVertexWeighting.java trunk/LWJGL/src/generated/org/lwjgl/opengl/GL11.java trunk/LWJGL/src/generated/org/lwjgl/opengl/GL12.java trunk/LWJGL/src/generated/org/lwjgl/opengl/GL13.java trunk/LWJGL/src/generated/org/lwjgl/opengl/GL14.java trunk/LWJGL/src/generated/org/lwjgl/opengl/GL15.java trunk/LWJGL/src/generated/org/lwjgl/opengl/GL20.java trunk/LWJGL/src/generated/org/lwjgl/opengl/GL21.java trunk/LWJGL/src/generated/org/lwjgl/opengl/NVDepthBufferFloat.java trunk/LWJGL/src/generated/org/lwjgl/opengl/NVEvaluators.java trunk/LWJGL/src/generated/org/lwjgl/opengl/NVFence.java trunk/LWJGL/src/generated/org/lwjgl/opengl/NVFragmentProgram.java trunk/LWJGL/src/generated/org/lwjgl/opengl/NVFramebufferMultisampleCoverage.java trunk/LWJGL/src/generated/org/lwjgl/opengl/NVGeometryProgram4.java trunk/LWJGL/src/generated/org/lwjgl/opengl/NVGpuProgram4.java trunk/LWJGL/src/generated/org/lwjgl/opengl/NVHalfFloat.java trunk/LWJGL/src/generated/org/lwjgl/opengl/NVOcclusionQuery.java trunk/LWJGL/src/generated/org/lwjgl/opengl/NVParameterBufferObject.java trunk/LWJGL/src/generated/org/lwjgl/opengl/NVPixelDataRange.java trunk/LWJGL/src/generated/org/lwjgl/opengl/NVPointSprite.java trunk/LWJGL/src/generated/org/lwjgl/opengl/NVPrimitiveRestart.java trunk/LWJGL/src/generated/org/lwjgl/opengl/NVProgram.java trunk/LWJGL/src/generated/org/lwjgl/opengl/NVRegisterCombiners.java trunk/LWJGL/src/generated/org/lwjgl/opengl/NVRegisterCombiners2.java trunk/LWJGL/src/generated/org/lwjgl/opengl/NVTransformFeeback.java trunk/LWJGL/src/generated/org/lwjgl/opengl/NVVertexArrayRange.java trunk/LWJGL/src/generated/org/lwjgl/opengl/NVVertexProgram.java trunk/LWJGL/src/generated/org/lwjgl/opengl/SGISGenerateMipmap.java trunk/LWJGL/src/generated/org/lwjgl/opengl/SGISTextureLOD.java trunk/LWJGL/src/java/org/lwjgl/opengl/GLChecks.java trunk/LWJGL/src/java/org/lwjgl/opengl/StateTracker.java trunk/LWJGL/src/java/org/lwjgl/util/generator/JavaMethodsGenerator.java trunk/LWJGL/src/native/generated/org_lwjgl_opengl_EXTBindableUniform.c trunk/LWJGL/src/native/generated/org_lwjgl_opengl_EXTBlendColor.c trunk/LWJGL/src/native/generated/org_lwjgl_opengl_EXTBlendMinmax.c trunk/LWJGL/src/native/generated/org_lwjgl_opengl_EXTDrawBuffers2.c trunk/LWJGL/src/native/generated/org_lwjgl_opengl_EXTDrawInstanced.c trunk/LWJGL/src/native/generated/org_lwjgl_opengl_EXTGeometryShader4.c trunk/LWJGL/src/native/generated/org_lwjgl_opengl_EXTGpuProgramParameters.c trunk/LWJGL/src/native/generated/org_lwjgl_opengl_EXTGpuShader4.c trunk/LWJGL/src/native/generated/org_lwjgl_opengl_EXTTextureArray.c trunk/LWJGL/src/native/generated/org_lwjgl_opengl_EXTTextureBufferObject.c trunk/LWJGL/src/native/generated/org_lwjgl_opengl_EXTTextureInteger.c trunk/LWJGL/src/native/generated/org_lwjgl_opengl_EXTTimerQuery.c trunk/LWJGL/src/native/generated/org_lwjgl_opengl_GL21.c trunk/LWJGL/src/native/generated/org_lwjgl_opengl_NVDepthBufferFloat.c trunk/LWJGL/src/native/generated/org_lwjgl_opengl_NVFramebufferMultisampleCoverage.c trunk/LWJGL/src/native/generated/org_lwjgl_opengl_NVGeometryProgram4.c trunk/LWJGL/src/native/generated/org_lwjgl_opengl_NVGpuProgram4.c trunk/LWJGL/src/native/generated/org_lwjgl_opengl_NVParameterBufferObject.c trunk/LWJGL/src/native/generated/org_lwjgl_opengl_NVTransformFeeback.c trunk/LWJGL/src/templates/org/lwjgl/opengl/GL11.java Modified: trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBBufferObject.java =================================================================== --- trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBBufferObject.java 2006-11-19 12:48:57 UTC (rev 2661) +++ trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBBufferObject.java 2006-11-19 13:33:45 UTC (rev 2662) @@ -36,14 +36,16 @@ public static void glBindBufferARB(int target, int buffer) { - long function_pointer = GLContext.getCapabilities().ARB_buffer_object_glBindBufferARB_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_buffer_object_glBindBufferARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); nglBindBufferARB(target, buffer, function_pointer); } private static native void nglBindBufferARB(int target, int buffer, long function_pointer); public static void glDeleteBuffersARB(IntBuffer buffers) { - long function_pointer = GLContext.getCapabilities().ARB_buffer_object_glDeleteBuffersARB_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_buffer_object_glDeleteBuffersARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); BufferChecks.checkDirect(buffers); nglDeleteBuffersARB((buffers.remaining()), buffers, buffers.position(), function_pointer); @@ -51,7 +53,8 @@ private static native void nglDeleteBuffersARB(int n, IntBuffer buffers, int buffers_position, long function_pointer); public static void glGenBuffersARB(IntBuffer buffers) { - long function_pointer = GLContext.getCapabilities().ARB_buffer_object_glGenBuffersARB_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_buffer_object_glGenBuffersARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); BufferChecks.checkDirect(buffers); nglGenBuffersARB((buffers.remaining()), buffers, buffers.position(), function_pointer); @@ -59,7 +62,8 @@ private static native void nglGenBuffersARB(int n, IntBuffer buffers, int buffers_position, long function_pointer); public static boolean glIsBufferARB(int buffer) { - long function_pointer = GLContext.getCapabilities().ARB_buffer_object_glIsBufferARB_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_buffer_object_glIsBufferARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); boolean __result = nglIsBufferARB(buffer, function_pointer); return __result; @@ -67,36 +71,42 @@ private static native boolean nglIsBufferARB(int buffer, long function_pointer); public static void glBufferDataARB(int target, long size, int usage) { - long function_pointer = GLContext.getCapabilities().ARB_buffer_object_glBufferDataARB_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_buffer_object_glBufferDataARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); nglBufferDataARB(target, size, null, 0, usage, function_pointer); } public static void glBufferDataARB(int target, ByteBuffer data, int usage) { - long function_pointer = GLContext.getCapabilities().ARB_buffer_object_glBufferDataARB_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_buffer_object_glBufferDataARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); BufferChecks.checkDirect(data); nglBufferDataARB(target, (data.remaining()), data, data.position(), usage, function_pointer); } public static void glBufferDataARB(int target, DoubleBuffer data, int usage) { - long function_pointer = GLContext.getCapabilities().ARB_buffer_object_glBufferDataARB_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_buffer_object_glBufferDataARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); BufferChecks.checkDirect(data); nglBufferDataARB(target, (data.remaining() << 3), data, data.position() << 3, usage, function_pointer); } public static void glBufferDataARB(int target, FloatBuffer data, int usage) { - long function_pointer = GLContext.getCapabilities().ARB_buffer_object_glBufferDataARB_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_buffer_object_glBufferDataARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); BufferChecks.checkDirect(data); nglBufferDataARB(target, (data.remaining() << 2), data, data.position() << 2, usage, function_pointer); } public static void glBufferDataARB(int target, IntBuffer data, int usage) { - long function_pointer = GLContext.getCapabilities().ARB_buffer_object_glBufferDataARB_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_buffer_object_glBufferDataARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); BufferChecks.checkDirect(data); nglBufferDataARB(target, (data.remaining() << 2), data, data.position() << 2, usage, function_pointer); } public static void glBufferDataARB(int target, ShortBuffer data, int usage) { - long function_pointer = GLContext.getCapabilities().ARB_buffer_object_glBufferDataARB_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_buffer_object_glBufferDataARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); BufferChecks.checkDirect(data); nglBufferDataARB(target, (data.remaining() << 1), data, data.position() << 1, usage, function_pointer); @@ -104,31 +114,36 @@ private static native void nglBufferDataARB(int target, long size, Buffer data, int data_position, int usage, long function_pointer); public static void glBufferSubDataARB(int target, long offset, ByteBuffer data) { - long function_pointer = GLContext.getCapabilities().ARB_buffer_object_glBufferSubDataARB_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_buffer_object_glBufferSubDataARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); BufferChecks.checkDirect(data); nglBufferSubDataARB(target, offset, (data.remaining()), data, data.position(), function_pointer); } public static void glBufferSubDataARB(int target, long offset, DoubleBuffer data) { - long function_pointer = GLContext.getCapabilities().ARB_buffer_object_glBufferSubDataARB_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_buffer_object_glBufferSubDataARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); BufferChecks.checkDirect(data); nglBufferSubDataARB(target, offset, (data.remaining() << 3), data, data.position() << 3, function_pointer); } public static void glBufferSubDataARB(int target, long offset, FloatBuffer data) { - long function_pointer = GLContext.getCapabilities().ARB_buffer_object_glBufferSubDataARB_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_buffer_object_glBufferSubDataARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); BufferChecks.checkDirect(data); nglBufferSubDataARB(target, offset, (data.remaining() << 2), data, data.position() << 2, function_pointer); } public static void glBufferSubDataARB(int target, long offset, IntBuffer data) { - long function_pointer = GLContext.getCapabilities().ARB_buffer_object_glBufferSubDataARB_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_buffer_object_glBufferSubDataARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); BufferChecks.checkDirect(data); nglBufferSubDataARB(target, offset, (data.remaining() << 2), data, data.position() << 2, function_pointer); } public static void glBufferSubDataARB(int target, long offset, ShortBuffer data) { - long function_pointer = GLContext.getCapabilities().ARB_buffer_object_glBufferSubDataARB_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_buffer_object_glBufferSubDataARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); BufferChecks.checkDirect(data); nglBufferSubDataARB(target, offset, (data.remaining() << 1), data, data.position() << 1, function_pointer); @@ -136,31 +151,36 @@ private static native void nglBufferSubDataARB(int target, long offset, long size, Buffer data, int data_position, long function_pointer); public static void glGetBufferSubDataARB(int target, long offset, ByteBuffer data) { - long function_pointer = GLContext.getCapabilities().ARB_buffer_object_glGetBufferSubDataARB_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_buffer_object_glGetBufferSubDataARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); BufferChecks.checkDirect(data); nglGetBufferSubDataARB(target, offset, (data.remaining()), data, data.position(), function_pointer); } public static void glGetBufferSubDataARB(int target, long offset, DoubleBuffer data) { - long function_pointer = GLContext.getCapabilities().ARB_buffer_object_glGetBufferSubDataARB_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_buffer_object_glGetBufferSubDataARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); BufferChecks.checkDirect(data); nglGetBufferSubDataARB(target, offset, (data.remaining() << 3), data, data.position() << 3, function_pointer); } public static void glGetBufferSubDataARB(int target, long offset, FloatBuffer data) { - long function_pointer = GLContext.getCapabilities().ARB_buffer_object_glGetBufferSubDataARB_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_buffer_object_glGetBufferSubDataARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); BufferChecks.checkDirect(data); nglGetBufferSubDataARB(target, offset, (data.remaining() << 2), data, data.position() << 2, function_pointer); } public static void glGetBufferSubDataARB(int target, long offset, IntBuffer data) { - long function_pointer = GLContext.getCapabilities().ARB_buffer_object_glGetBufferSubDataARB_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_buffer_object_glGetBufferSubDataARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); BufferChecks.checkDirect(data); nglGetBufferSubDataARB(target, offset, (data.remaining() << 2), data, data.position() << 2, function_pointer); } public static void glGetBufferSubDataARB(int target, long offset, ShortBuffer data) { - long function_pointer = GLContext.getCapabilities().ARB_buffer_object_glGetBufferSubDataARB_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_buffer_object_glGetBufferSubDataARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); BufferChecks.checkDirect(data); nglGetBufferSubDataARB(target, offset, (data.remaining() << 1), data, data.position() << 1, function_pointer); @@ -179,7 +199,8 @@ * @return A ByteBuffer representing the mapped buffer memory. */ public static java.nio.ByteBuffer glMapBufferARB(int target, int access, int result_size, java.nio.ByteBuffer old_buffer) { - long function_pointer = GLContext.getCapabilities().ARB_buffer_object_glMapBufferARB_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_buffer_object_glMapBufferARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); if (old_buffer != null) BufferChecks.checkDirect(old_buffer); @@ -189,7 +210,8 @@ private static native java.nio.ByteBuffer nglMapBufferARB(int target, int access, int result_size, java.nio.ByteBuffer old_buffer, long function_pointer); public static boolean glUnmapBufferARB(int target) { - long function_pointer = GLContext.getCapabilities().ARB_buffer_object_glUnmapBufferARB_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_buffer_object_glUnmapBufferARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); boolean __result = nglUnmapBufferARB(target, function_pointer); return __result; @@ -197,7 +219,8 @@ private static native boolean nglUnmapBufferARB(int target, long function_pointer); public static void glGetBufferParameterARB(int target, int pname, IntBuffer params) { - long function_pointer = GLContext.getCapabilities().ARB_buffer_object_glGetBufferParameterivARB_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_buffer_object_glGetBufferParameterivARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); BufferChecks.checkBuffer(params, 4); nglGetBufferParameterivARB(target, pname, params, params.position(), function_pointer); @@ -205,7 +228,8 @@ private static native void nglGetBufferParameterivARB(int target, int pname, IntBuffer params, int params_position, long function_pointer); public static java.nio.ByteBuffer glGetBufferPointerARB(int target, int pname, int result_size) { - long function_pointer = GLContext.getCapabilities().ARB_buffer_object_glGetBufferPointervARB_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_buffer_object_glGetBufferPointervARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); java.nio.ByteBuffer __result = nglGetBufferPointervARB(target, pname, result_size, function_pointer); return __result; Modified: trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBColorBufferFloat.java =================================================================== --- trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBColorBufferFloat.java 2006-11-19 12:48:57 UTC (rev 2661) +++ trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBColorBufferFloat.java 2006-11-19 13:33:45 UTC (rev 2662) @@ -32,7 +32,8 @@ * Accepted as a bit set in the GLX_RENDER_TYPE variable */ public static void glClampColorARB(int target, int clamp) { - long function_pointer = GLContext.getCapabilities().ARB_color_buffer_float_glClampColorARB_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_color_buffer_float_glClampColorARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); nglClampColorARB(target, clamp, function_pointer); } Modified: trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBDrawBuffers.java =================================================================== --- trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBDrawBuffers.java 2006-11-19 12:48:57 UTC (rev 2661) +++ trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBDrawBuffers.java 2006-11-19 13:33:45 UTC (rev 2662) @@ -34,7 +34,8 @@ public static void glDrawBuffersARB(IntBuffer buffers) { - long function_pointer = GLContext.getCapabilities().ARB_draw_buffers_glDrawBuffersARB_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_draw_buffers_glDrawBuffersARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); BufferChecks.checkDirect(buffers); nglDrawBuffersARB((buffers.remaining()), buffers, buffers.position(), function_pointer); Modified: trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBImaging.java =================================================================== --- trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBImaging.java 2006-11-19 12:48:57 UTC (rev 2661) +++ trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBImaging.java 2006-11-19 13:33:45 UTC (rev 2662) @@ -88,67 +88,76 @@ public static void glColorTable(int target, int internalFormat, int width, int format, int type, ByteBuffer data) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glColorTable_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glColorTable_pointer; BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(); + GLChecks.ensureUnpackPBOdisabled(caps); BufferChecks.checkBuffer(data, 256); nglColorTable(target, internalFormat, width, format, type, data, data.position(), function_pointer); } public static void glColorTable(int target, int internalFormat, int width, int format, int type, DoubleBuffer data) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glColorTable_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glColorTable_pointer; BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(); + GLChecks.ensureUnpackPBOdisabled(caps); BufferChecks.checkBuffer(data, 256); nglColorTable(target, internalFormat, width, format, type, data, data.position() << 3, function_pointer); } public static void glColorTable(int target, int internalFormat, int width, int format, int type, FloatBuffer data) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glColorTable_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glColorTable_pointer; BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(); + GLChecks.ensureUnpackPBOdisabled(caps); BufferChecks.checkBuffer(data, 256); nglColorTable(target, internalFormat, width, format, type, data, data.position() << 2, function_pointer); } private static native void nglColorTable(int target, int internalFormat, int width, int format, int type, Buffer data, int data_position, long function_pointer); public static void glColorTable(int target, int internalFormat, int width, int format, int type, long data_buffer_offset) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glColorTable_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glColorTable_pointer; BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOenabled(); + GLChecks.ensureUnpackPBOenabled(caps); nglColorTableBO(target, internalFormat, width, format, type, data_buffer_offset, function_pointer); } private static native void nglColorTableBO(int target, int internalFormat, int width, int format, int type, long data_buffer_offset, long function_pointer); public static void glColorSubTable(int target, int start, int count, int format, int type, ByteBuffer data) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glColorSubTable_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glColorSubTable_pointer; BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(); + GLChecks.ensureUnpackPBOdisabled(caps); BufferChecks.checkBuffer(data, 256); nglColorSubTable(target, start, count, format, type, data, data.position(), function_pointer); } public static void glColorSubTable(int target, int start, int count, int format, int type, DoubleBuffer data) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glColorSubTable_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glColorSubTable_pointer; BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(); + GLChecks.ensureUnpackPBOdisabled(caps); BufferChecks.checkBuffer(data, 256); nglColorSubTable(target, start, count, format, type, data, data.position() << 3, function_pointer); } public static void glColorSubTable(int target, int start, int count, int format, int type, FloatBuffer data) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glColorSubTable_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glColorSubTable_pointer; BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(); + GLChecks.ensureUnpackPBOdisabled(caps); BufferChecks.checkBuffer(data, 256); nglColorSubTable(target, start, count, format, type, data, data.position() << 2, function_pointer); } private static native void nglColorSubTable(int target, int start, int count, int format, int type, Buffer data, int data_position, long function_pointer); public static void glColorSubTable(int target, int start, int count, int format, int type, long data_buffer_offset) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glColorSubTable_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glColorSubTable_pointer; BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOenabled(); + GLChecks.ensureUnpackPBOenabled(caps); nglColorSubTableBO(target, start, count, format, type, data_buffer_offset, function_pointer); } private static native void nglColorSubTableBO(int target, int start, int count, int format, int type, long data_buffer_offset, long function_pointer); public static void glColorTableParameter(int target, int pname, IntBuffer params) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glColorTableParameteriv_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glColorTableParameteriv_pointer; BufferChecks.checkFunctionAddress(function_pointer); BufferChecks.checkBuffer(params, 4); nglColorTableParameteriv(target, pname, params, params.position(), function_pointer); @@ -156,7 +165,8 @@ private static native void nglColorTableParameteriv(int target, int pname, IntBuffer params, int params_position, long function_pointer); public static void glColorTableParameter(int target, int pname, FloatBuffer params) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glColorTableParameterfv_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glColorTableParameterfv_pointer; BufferChecks.checkFunctionAddress(function_pointer); BufferChecks.checkBuffer(params, 4); nglColorTableParameterfv(target, pname, params, params.position(), function_pointer); @@ -164,33 +174,38 @@ private static native void nglColorTableParameterfv(int target, int pname, FloatBuffer params, int params_position, long function_pointer); public static void glCopyColorSubTable(int target, int start, int x, int y, int width) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glCopyColorSubTable_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glCopyColorSubTable_pointer; BufferChecks.checkFunctionAddress(function_pointer); nglCopyColorSubTable(target, start, x, y, width, function_pointer); } private static native void nglCopyColorSubTable(int target, int start, int x, int y, int width, long function_pointer); public static void glCopyColorTable(int target, int internalformat, int x, int y, int width) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glCopyColorTable_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glCopyColorTable_pointer; BufferChecks.checkFunctionAddress(function_pointer); nglCopyColorTable(target, internalformat, x, y, width, function_pointer); } private static native void nglCopyColorTable(int target, int internalformat, int x, int y, int width, long function_pointer); public static void glGetColorTable(int target, int format, int type, ByteBuffer data) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glGetColorTable_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glGetColorTable_pointer; BufferChecks.checkFunctionAddress(function_pointer); BufferChecks.checkBuffer(data, 256); nglGetColorTable(target, format, type, data, data.position(), function_pointer); } public static void glGetColorTable(int target, int format, int type, DoubleBuffer data) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glGetColorTable_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glGetColorTable_pointer; BufferChecks.checkFunctionAddress(function_pointer); BufferChecks.checkBuffer(data, 256); nglGetColorTable(target, format, type, data, data.position() << 3, function_pointer); } public static void glGetColorTable(int target, int format, int type, FloatBuffer data) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glGetColorTable_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glGetColorTable_pointer; BufferChecks.checkFunctionAddress(function_pointer); BufferChecks.checkBuffer(data, 256); nglGetColorTable(target, format, type, data, data.position() << 2, function_pointer); @@ -198,7 +213,8 @@ private static native void nglGetColorTable(int target, int format, int type, Buffer data, int data_position, long function_pointer); public static void glGetColorTableParameter(int target, int pname, IntBuffer params) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glGetColorTableParameteriv_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glGetColorTableParameteriv_pointer; BufferChecks.checkFunctionAddress(function_pointer); BufferChecks.checkBuffer(params, 4); nglGetColorTableParameteriv(target, pname, params, params.position(), function_pointer); @@ -206,7 +222,8 @@ private static native void nglGetColorTableParameteriv(int target, int pname, IntBuffer params, int params_position, long function_pointer); public static void glGetColorTableParameter(int target, int pname, FloatBuffer params) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glGetColorTableParameterfv_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glGetColorTableParameterfv_pointer; BufferChecks.checkFunctionAddress(function_pointer); BufferChecks.checkBuffer(params, 4); nglGetColorTableParameterfv(target, pname, params, params.position(), function_pointer); @@ -214,79 +231,90 @@ private static native void nglGetColorTableParameterfv(int target, int pname, FloatBuffer params, int params_position, long function_pointer); public static void glBlendEquation(int mode) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glBlendEquation_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glBlendEquation_pointer; BufferChecks.checkFunctionAddress(function_pointer); nglBlendEquation(mode, function_pointer); } private static native void nglBlendEquation(int mode, long function_pointer); public static void glBlendColor(float red, float green, float blue, float alpha) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glBlendColor_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glBlendColor_pointer; BufferChecks.checkFunctionAddress(function_pointer); nglBlendColor(red, green, blue, alpha, function_pointer); } private static native void nglBlendColor(float red, float green, float blue, float alpha, long function_pointer); public static void glHistogram(int target, int width, int internalformat, boolean sink) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glHistogram_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glHistogram_pointer; BufferChecks.checkFunctionAddress(function_pointer); nglHistogram(target, width, internalformat, sink, function_pointer); } private static native void nglHistogram(int target, int width, int internalformat, boolean sink, long function_pointer); public static void glResetHistogram(int target) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glResetHistogram_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glResetHistogram_pointer; BufferChecks.checkFunctionAddress(function_pointer); nglResetHistogram(target, function_pointer); } private static native void nglResetHistogram(int target, long function_pointer); public static void glGetHistogram(int target, boolean reset, int format, int type, ByteBuffer values) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glGetHistogram_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glGetHistogram_pointer; BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensurePackPBOdisabled(); + GLChecks.ensurePackPBOdisabled(caps); BufferChecks.checkBuffer(values, 256); nglGetHistogram(target, reset, format, type, values, values.position(), function_pointer); } public static void glGetHistogram(int target, boolean reset, int format, int type, DoubleBuffer values) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glGetHistogram_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glGetHistogram_pointer; BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensurePackPBOdisabled(); + GLChecks.ensurePackPBOdisabled(caps); BufferChecks.checkBuffer(values, 256); nglGetHistogram(target, reset, format, type, values, values.position() << 3, function_pointer); } public static void glGetHistogram(int target, boolean reset, int format, int type, FloatBuffer values) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glGetHistogram_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glGetHistogram_pointer; BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensurePackPBOdisabled(); + GLChecks.ensurePackPBOdisabled(caps); BufferChecks.checkBuffer(values, 256); nglGetHistogram(target, reset, format, type, values, values.position() << 2, function_pointer); } public static void glGetHistogram(int target, boolean reset, int format, int type, IntBuffer values) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glGetHistogram_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glGetHistogram_pointer; BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensurePackPBOdisabled(); + GLChecks.ensurePackPBOdisabled(caps); BufferChecks.checkBuffer(values, 256); nglGetHistogram(target, reset, format, type, values, values.position() << 2, function_pointer); } public static void glGetHistogram(int target, boolean reset, int format, int type, ShortBuffer values) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glGetHistogram_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glGetHistogram_pointer; BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensurePackPBOdisabled(); + GLChecks.ensurePackPBOdisabled(caps); BufferChecks.checkBuffer(values, 256); nglGetHistogram(target, reset, format, type, values, values.position() << 1, function_pointer); } private static native void nglGetHistogram(int target, boolean reset, int format, int type, Buffer values, int values_position, long function_pointer); public static void glGetHistogram(int target, boolean reset, int format, int type, long values_buffer_offset) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glGetHistogram_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glGetHistogram_pointer; BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensurePackPBOenabled(); + GLChecks.ensurePackPBOenabled(caps); nglGetHistogramBO(target, reset, format, type, values_buffer_offset, function_pointer); } private static native void nglGetHistogramBO(int target, boolean reset, int format, int type, long values_buffer_offset, long function_pointer); public static void glGetHistogramParameter(int target, int pname, FloatBuffer params) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glGetHistogramParameterfv_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glGetHistogramParameterfv_pointer; BufferChecks.checkFunctionAddress(function_pointer); BufferChecks.checkBuffer(params, 256); nglGetHistogramParameterfv(target, pname, params, params.position(), function_pointer); @@ -294,7 +322,8 @@ private static native void nglGetHistogramParameterfv(int target, int pname, FloatBuffer params, int params_position, long function_pointer); public static void glGetHistogramParameter(int target, int pname, IntBuffer params) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glGetHistogramParameteriv_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glGetHistogramParameteriv_pointer; BufferChecks.checkFunctionAddress(function_pointer); BufferChecks.checkBuffer(params, 256); nglGetHistogramParameteriv(target, pname, params, params.position(), function_pointer); @@ -302,65 +331,74 @@ private static native void nglGetHistogramParameteriv(int target, int pname, IntBuffer params, int params_position, long function_pointer); public static void glMinmax(int target, int internalformat, boolean sink) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glMinmax_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glMinmax_pointer; BufferChecks.checkFunctionAddress(function_pointer); nglMinmax(target, internalformat, sink, function_pointer); } private static native void nglMinmax(int target, int internalformat, boolean sink, long function_pointer); public static void glResetMinmax(int target) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glResetMinmax_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glResetMinmax_pointer; BufferChecks.checkFunctionAddress(function_pointer); nglResetMinmax(target, function_pointer); } private static native void nglResetMinmax(int target, long function_pointer); public static void glGetMinmax(int target, boolean reset, int format, int types, ByteBuffer values) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glGetMinmax_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glGetMinmax_pointer; BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensurePackPBOdisabled(); + GLChecks.ensurePackPBOdisabled(caps); BufferChecks.checkBuffer(values, 4); nglGetMinmax(target, reset, format, types, values, values.position(), function_pointer); } public static void glGetMinmax(int target, boolean reset, int format, int types, DoubleBuffer values) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glGetMinmax_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glGetMinmax_pointer; BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensurePackPBOdisabled(); + GLChecks.ensurePackPBOdisabled(caps); BufferChecks.checkBuffer(values, 4); nglGetMinmax(target, reset, format, types, values, values.position() << 3, function_pointer); } public static void glGetMinmax(int target, boolean reset, int format, int types, FloatBuffer values) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glGetMinmax_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glGetMinmax_pointer; BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensurePackPBOdisabled(); + GLChecks.ensurePackPBOdisabled(caps); BufferChecks.checkBuffer(values, 4); nglGetMinmax(target, reset, format, types, values, values.position() << 2, function_pointer); } public static void glGetMinmax(int target, boolean reset, int format, int types, IntBuffer values) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glGetMinmax_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glGetMinmax_pointer; BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensurePackPBOdisabled(); + GLChecks.ensurePackPBOdisabled(caps); BufferChecks.checkBuffer(values, 4); nglGetMinmax(target, reset, format, types, values, values.position() << 2, function_pointer); } public static void glGetMinmax(int target, boolean reset, int format, int types, ShortBuffer values) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glGetMinmax_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glGetMinmax_pointer; BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensurePackPBOdisabled(); + GLChecks.ensurePackPBOdisabled(caps); BufferChecks.checkBuffer(values, 4); nglGetMinmax(target, reset, format, types, values, values.position() << 1, function_pointer); } private static native void nglGetMinmax(int target, boolean reset, int format, int types, Buffer values, int values_position, long function_pointer); public static void glGetMinmax(int target, boolean reset, int format, int types, long values_buffer_offset) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glGetMinmax_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glGetMinmax_pointer; BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensurePackPBOenabled(); + GLChecks.ensurePackPBOenabled(caps); nglGetMinmaxBO(target, reset, format, types, values_buffer_offset, function_pointer); } private static native void nglGetMinmaxBO(int target, boolean reset, int format, int types, long values_buffer_offset, long function_pointer); public static void glGetMinmaxParameter(int target, int pname, FloatBuffer params) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glGetMinmaxParameterfv_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glGetMinmaxParameterfv_pointer; BufferChecks.checkFunctionAddress(function_pointer); BufferChecks.checkBuffer(params, 4); nglGetMinmaxParameterfv(target, pname, params, params.position(), function_pointer); @@ -368,7 +406,8 @@ private static native void nglGetMinmaxParameterfv(int target, int pname, FloatBuffer params, int params_position, long function_pointer); public static void glGetMinmaxParameter(int target, int pname, IntBuffer params) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glGetMinmaxParameteriv_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glGetMinmaxParameteriv_pointer; BufferChecks.checkFunctionAddress(function_pointer); BufferChecks.checkBuffer(params, 4); nglGetMinmaxParameteriv(target, pname, params, params.position(), function_pointer); @@ -376,88 +415,100 @@ private static native void nglGetMinmaxParameteriv(int target, int pname, IntBuffer params, int params_position, long function_pointer); public static void glConvolutionFilter1D(int target, int internalformat, int width, int format, int type, ByteBuffer image) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glConvolutionFilter1D_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glConvolutionFilter1D_pointer; BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(); + GLChecks.ensureUnpackPBOdisabled(caps); BufferChecks.checkBuffer(image, GLChecks.calculateImageStorage(image, format, type, width, 1, 1)); nglConvolutionFilter1D(target, internalformat, width, format, type, image, image.position(), function_pointer); } public static void glConvolutionFilter1D(int target, int internalformat, int width, int format, int type, DoubleBuffer image) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glConvolutionFilter1D_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glConvolutionFilter1D_pointer; BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(); + GLChecks.ensureUnpackPBOdisabled(caps); BufferChecks.checkBuffer(image, GLChecks.calculateImageStorage(image, format, type, width, 1, 1)); nglConvolutionFilter1D(target, internalformat, width, format, type, image, image.position() << 3, function_pointer); } public static void glConvolutionFilter1D(int target, int internalformat, int width, int format, int type, FloatBuffer image) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glConvolutionFilter1D_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glConvolutionFilter1D_pointer; BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(); + GLChecks.ensureUnpackPBOdisabled(caps); BufferChecks.checkBuffer(image, GLChecks.calculateImageStorage(image, format, type, width, 1, 1)); nglConvolutionFilter1D(target, internalformat, width, format, type, image, image.position() << 2, function_pointer); } public static void glConvolutionFilter1D(int target, int internalformat, int width, int format, int type, IntBuffer image) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glConvolutionFilter1D_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glConvolutionFilter1D_pointer; BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(); + GLChecks.ensureUnpackPBOdisabled(caps); BufferChecks.checkBuffer(image, GLChecks.calculateImageStorage(image, format, type, width, 1, 1)); nglConvolutionFilter1D(target, internalformat, width, format, type, image, image.position() << 2, function_pointer); } public static void glConvolutionFilter1D(int target, int internalformat, int width, int format, int type, ShortBuffer image) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glConvolutionFilter1D_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glConvolutionFilter1D_pointer; BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(); + GLChecks.ensureUnpackPBOdisabled(caps); BufferChecks.checkBuffer(image, GLChecks.calculateImageStorage(image, format, type, width, 1, 1)); nglConvolutionFilter1D(target, internalformat, width, format, type, image, image.position() << 1, function_pointer); } private static native void nglConvolutionFilter1D(int target, int internalformat, int width, int format, int type, Buffer image, int image_position, long function_pointer); public static void glConvolutionFilter1D(int target, int internalformat, int width, int format, int type, long image_buffer_offset) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glConvolutionFilter1D_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glConvolutionFilter1D_pointer; BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOenabled(); + GLChecks.ensureUnpackPBOenabled(caps); nglConvolutionFilter1DBO(target, internalformat, width, format, type, image_buffer_offset, function_pointer); } private static native void nglConvolutionFilter1DBO(int target, int internalformat, int width, int format, int type, long image_buffer_offset, long function_pointer); public static void glConvolutionFilter2D(int target, int internalformat, int width, int height, int format, int type, ByteBuffer image) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glConvolutionFilter2D_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glConvolutionFilter2D_pointer; BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(); + GLChecks.ensureUnpackPBOdisabled(caps); BufferChecks.checkBuffer(image, GLChecks.calculateImageStorage(image, format, type, width, height, 1)); nglConvolutionFilter2D(target, internalformat, width, height, format, type, image, image.position(), function_pointer); } public static void glConvolutionFilter2D(int target, int internalformat, int width, int height, int format, int type, IntBuffer image) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glConvolutionFilter2D_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glConvolutionFilter2D_pointer; BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(); + GLChecks.ensureUnpackPBOdisabled(caps); BufferChecks.checkBuffer(image, GLChecks.calculateImageStorage(image, format, type, width, height, 1)); nglConvolutionFilter2D(target, internalformat, width, height, format, type, image, image.position() << 2, function_pointer); } public static void glConvolutionFilter2D(int target, int internalformat, int width, int height, int format, int type, ShortBuffer image) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glConvolutionFilter2D_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glConvolutionFilter2D_pointer; BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(); + GLChecks.ensureUnpackPBOdisabled(caps); BufferChecks.checkBuffer(image, GLChecks.calculateImageStorage(image, format, type, width, height, 1)); nglConvolutionFilter2D(target, internalformat, width, height, format, type, image, image.position() << 1, function_pointer); } private static native void nglConvolutionFilter2D(int target, int internalformat, int width, int height, int format, int type, Buffer image, int image_position, long function_pointer); public static void glConvolutionFilter2D(int target, int internalformat, int width, int height, int format, int type, long image_buffer_offset) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glConvolutionFilter2D_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glConvolutionFilter2D_pointer; BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOenabled(); + GLChecks.ensureUnpackPBOenabled(caps); nglConvolutionFilter2DBO(target, internalformat, width, height, format, type, image_buffer_offset, function_pointer); } private static native void nglConvolutionFilter2DBO(int target, int internalformat, int width, int height, int format, int type, long image_buffer_offset, long function_pointer); public static void glConvolutionParameterf(int target, int pname, float params) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glConvolutionParameterf_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glConvolutionParameterf_pointer; BufferChecks.checkFunctionAddress(function_pointer); nglConvolutionParameterf(target, pname, params, function_pointer); } private static native void nglConvolutionParameterf(int target, int pname, float params, long function_pointer); public static void glConvolutionParameter(int target, int pname, FloatBuffer params) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glConvolutionParameterfv_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glConvolutionParameterfv_pointer; BufferChecks.checkFunctionAddress(function_pointer); BufferChecks.checkBuffer(params, 4); nglConvolutionParameterfv(target, pname, params, params.position(), function_pointer); @@ -465,14 +516,16 @@ private static native void nglConvolutionParameterfv(int target, int pname, FloatBuffer params, int params_position, long function_pointer); public static void glConvolutionParameteri(int target, int pname, int params) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glConvolutionParameteri_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glConvolutionParameteri_pointer; BufferChecks.checkFunctionAddress(function_pointer); nglConvolutionParameteri(target, pname, params, function_pointer); } private static native void nglConvolutionParameteri(int target, int pname, int params, long function_pointer); public static void glConvolutionParameter(int target, int pname, IntBuffer params) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glConvolutionParameteriv_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glConvolutionParameteriv_pointer; BufferChecks.checkFunctionAddress(function_pointer); BufferChecks.checkBuffer(params, 4); nglConvolutionParameteriv(target, pname, params, params.position(), function_pointer); @@ -480,65 +533,74 @@ private static native void nglConvolutionParameteriv(int target, int pname, IntBuffer params, int params_position, long function_pointer); public static void glCopyConvolutionFilter1D(int target, int internalformat, int x, int y, int width) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glCopyConvolutionFilter1D_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glCopyConvolutionFilter1D_pointer; BufferChecks.checkFunctionAddress(function_pointer); nglCopyConvolutionFilter1D(target, internalformat, x, y, width, function_pointer); } private static native void nglCopyConvolutionFilter1D(int target, int internalformat, int x, int y, int width, long function_pointer); public static void glCopyConvolutionFilter2D(int target, int internalformat, int x, int y, int width, int height) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glCopyConvolutionFilter2D_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glCopyConvolutionFilter2D_pointer; BufferChecks.checkFunctionAddress(function_pointer); nglCopyConvolutionFilter2D(target, internalformat, x, y, width, height, function_pointer); } private static native void nglCopyConvolutionFilter2D(int target, int internalformat, int x, int y, int width, int height, long function_pointer); public static void glGetConvolutionFilter(int target, int format, int type, ByteBuffer image) { - long function_pointer = GLContext.getCapabilities().ARB_imaging_glGetConvolutionFilter_pointer; + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.ARB_imaging_glGetConvolutionFilter_pointer; BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensurePackPBOdisabled(); + GLChecks.ensurePackPBOdisabled(caps); Buffe... [truncated message content] |
From: <eli...@us...> - 2006-11-19 22:06:48
|
Revision: 2668 http://svn.sourceforge.net/java-game-lib/?rev=2668&view=rev Author: elias_naur Date: 2006-11-19 14:06:46 -0800 (Sun, 19 Nov 2006) Log Message: ----------- Autogen changes from previous commit Modified Paths: -------------- trunk/LWJGL/src/generated/org/lwjgl/opengl/ContextCapabilities.java Added Paths: ----------- trunk/LWJGL/src/generated/org/lwjgl/opengl/NVTransformFeedback.java trunk/LWJGL/src/native/generated/org_lwjgl_opengl_NVTransformFeedback.c Removed Paths: ------------- trunk/LWJGL/src/generated/org/lwjgl/opengl/NVTransformFeeback.java trunk/LWJGL/src/native/generated/org_lwjgl_opengl_NVTransformFeeback.c Modified: trunk/LWJGL/src/generated/org/lwjgl/opengl/ContextCapabilities.java =================================================================== --- trunk/LWJGL/src/generated/org/lwjgl/opengl/ContextCapabilities.java 2006-11-19 22:01:56 UTC (rev 2667) +++ trunk/LWJGL/src/generated/org/lwjgl/opengl/ContextCapabilities.java 2006-11-19 22:06:46 UTC (rev 2668) @@ -160,7 +160,7 @@ public final boolean GL_NV_texture_shader; public final boolean GL_NV_texture_shader2; public final boolean GL_NV_texture_shader3; - public final boolean GL_NV_transform_feeback; + public final boolean GL_NV_transform_feedback; public final boolean GL_NV_vertex_array_range; public final boolean GL_NV_vertex_array_range2; public final boolean GL_NV_vertex_program; @@ -1073,17 +1073,17 @@ long NV_register_combiners_glGetFinalCombinerInputParameterivNV_pointer; long NV_register_combiners2_glCombinerStageParameterfvNV_pointer; long NV_register_combiners2_glGetCombinerStageParameterfvNV_pointer; - long NV_transform_feeback_glBindBufferRangeNV_pointer; - long NV_transform_feeback_glBindBufferOffsetNV_pointer; - long NV_transform_feeback_glBindBufferBaseNV_pointer; - long NV_transform_feeback_glTransformFeedbackAttribsNV_pointer; - long NV_transform_feeback_glTransformFeedbackVaryingsNV_pointer; - long NV_transform_feeback_glBeginTransformFeedbackNV_pointer; - long NV_transform_feeback_glEndTransformFeedbackNV_pointer; - long NV_transform_feeback_glGetVaryingLocationNV_pointer; - long NV_transform_feeback_glGetActiveVaryingNV_pointer; - long NV_transform_feeback_glActiveVaryingNV_pointer; - long NV_transform_feeback_glGetTransformFeedbackVaryingNV_pointer; + long NV_transform_feedback_glBindBufferRangeNV_pointer; + long NV_transform_feedback_glBindBufferOffsetNV_pointer; + long NV_transform_feedback_glBindBufferBaseNV_pointer; + long NV_transform_feedback_glTransformFeedbackAttribsNV_pointer; + long NV_transform_feedback_glTransformFeedbackVaryingsNV_pointer; + long NV_transform_feedback_glBeginTransformFeedbackNV_pointer; + long NV_transform_feedback_glEndTransformFeedbackNV_pointer; + long NV_transform_feedback_glGetVaryingLocationNV_pointer; + long NV_transform_feedback_glGetActiveVaryingNV_pointer; + long NV_transform_feedback_glActiveVaryingNV_pointer; + long NV_transform_feedback_glGetTransformFeedbackVaryingNV_pointer; long NV_vertex_array_range_glVertexArrayRangeNV_pointer; long NV_vertex_array_range_glFlushVertexArrayRangeNV_pointer; long NV_vertex_array_range_glAllocateMemoryNV_pointer; @@ -2344,19 +2344,19 @@ (NV_register_combiners2_glGetCombinerStageParameterfvNV_pointer = GLContext.getFunctionAddress("glGetCombinerStageParameterfvNV")) != 0; } - private boolean NV_transform_feeback_initNativeFunctionAddresses() { + private boolean NV_transform_feedback_initNativeFunctionAddresses() { return - (NV_transform_feeback_glBindBufferRangeNV_pointer = GLContext.getFunctionAddress("glBindBufferRangeNV")) != 0 && - (NV_transform_feeback_glBindBufferOffsetNV_pointer = GLContext.getFunctionAddress("glBindBufferOffsetNV")) != 0 && - (NV_transform_feeback_glBindBufferBaseNV_pointer = GLContext.getFunctionAddress("glBindBufferBaseNV")) != 0 && - (NV_transform_feeback_glTransformFeedbackAttribsNV_pointer = GLContext.getFunctionAddress("glTransformFeedbackAttribsNV")) != 0 && - (NV_transform_feeback_glTransformFeedbackVaryingsNV_pointer = GLContext.getFunctionAddress("glTransformFeedbackVaryingsNV")) != 0 && - (NV_transform_feeback_glBeginTransformFeedbackNV_pointer = GLContext.getFunctionAddress("glBeginTransformFeedbackNV")) != 0 && - (NV_transform_feeback_glEndTransformFeedbackNV_pointer = GLContext.getFunctionAddress("glEndTransformFeedbackNV")) != 0 && - (NV_transform_feeback_glGetVaryingLocationNV_pointer = GLContext.getFunctionAddress("glGetVaryingLocationNV")) != 0 && - (NV_transform_feeback_glGetActiveVaryingNV_pointer = GLContext.getFunctionAddress("glGetActiveVaryingNV")) != 0 && - (NV_transform_feeback_glActiveVaryingNV_pointer = GLContext.getFunctionAddress("glActiveVaryingNV")) != 0 && - (NV_transform_feeback_glGetTransformFeedbackVaryingNV_pointer = GLContext.getFunctionAddress("glGetTransformFeedbackVaryingNV")) != 0; + (NV_transform_feedback_glBindBufferRangeNV_pointer = GLContext.getFunctionAddress("glBindBufferRangeNV")) != 0 && + (NV_transform_feedback_glBindBufferOffsetNV_pointer = GLContext.getFunctionAddress("glBindBufferOffsetNV")) != 0 && + (NV_transform_feedback_glBindBufferBaseNV_pointer = GLContext.getFunctionAddress("glBindBufferBaseNV")) != 0 && + (NV_transform_feedback_glTransformFeedbackAttribsNV_pointer = GLContext.getFunctionAddress("glTransformFeedbackAttribsNV")) != 0 && + (NV_transform_feedback_glTransformFeedbackVaryingsNV_pointer = GLContext.getFunctionAddress("glTransformFeedbackVaryingsNV")) != 0 && + (NV_transform_feedback_glBeginTransformFeedbackNV_pointer = GLContext.getFunctionAddress("glBeginTransformFeedbackNV")) != 0 && + (NV_transform_feedback_glEndTransformFeedbackNV_pointer = GLContext.getFunctionAddress("glEndTransformFeedbackNV")) != 0 && + (NV_transform_feedback_glGetVaryingLocationNV_pointer = GLContext.getFunctionAddress("glGetVaryingLocationNV")) != 0 && + (NV_transform_feedback_glGetActiveVaryingNV_pointer = GLContext.getFunctionAddress("glGetActiveVaryingNV")) != 0 && + (NV_transform_feedback_glActiveVaryingNV_pointer = GLContext.getFunctionAddress("glActiveVaryingNV")) != 0 && + (NV_transform_feedback_glGetTransformFeedbackVaryingNV_pointer = GLContext.getFunctionAddress("glGetTransformFeedbackVaryingNV")) != 0; } private boolean NV_vertex_array_range_initNativeFunctionAddresses() { @@ -2586,8 +2586,8 @@ supported_extensions.remove("GL_NV_register_combiners"); if (supported_extensions.contains("GL_NV_register_combiners2") && !NV_register_combiners2_initNativeFunctionAddresses()) supported_extensions.remove("GL_NV_register_combiners2"); - if (supported_extensions.contains("GL_NV_transform_feeback") && !NV_transform_feeback_initNativeFunctionAddresses()) - supported_extensions.remove("GL_NV_transform_feeback"); + if (supported_extensions.contains("GL_NV_transform_feedback") && !NV_transform_feedback_initNativeFunctionAddresses()) + supported_extensions.remove("GL_NV_transform_feedback"); if (supported_extensions.contains("GL_NV_vertex_array_range") && !NV_vertex_array_range_initNativeFunctionAddresses()) supported_extensions.remove("GL_NV_vertex_array_range"); if (supported_extensions.contains("GL_NV_vertex_program") && !NV_vertex_program_initNativeFunctionAddresses()) @@ -2756,7 +2756,7 @@ this.GL_NV_texture_shader = supported_extensions.contains("GL_NV_texture_shader"); this.GL_NV_texture_shader2 = supported_extensions.contains("GL_NV_texture_shader2"); this.GL_NV_texture_shader3 = supported_extensions.contains("GL_NV_texture_shader3"); - this.GL_NV_transform_feeback = supported_extensions.contains("GL_NV_transform_feeback"); + this.GL_NV_transform_feedback = supported_extensions.contains("GL_NV_transform_feedback"); this.GL_NV_vertex_array_range = supported_extensions.contains("GL_NV_vertex_array_range"); this.GL_NV_vertex_array_range2 = supported_extensions.contains("GL_NV_vertex_array_range2"); this.GL_NV_vertex_program = supported_extensions.contains("GL_NV_vertex_program") Deleted: trunk/LWJGL/src/generated/org/lwjgl/opengl/NVTransformFeeback.java =================================================================== --- trunk/LWJGL/src/generated/org/lwjgl/opengl/NVTransformFeeback.java 2006-11-19 22:01:56 UTC (rev 2667) +++ trunk/LWJGL/src/generated/org/lwjgl/opengl/NVTransformFeeback.java 2006-11-19 22:06:46 UTC (rev 2668) @@ -1,181 +0,0 @@ -/* MACHINE GENERATED FILE, DO NOT EDIT */ - -package org.lwjgl.opengl; - -import org.lwjgl.LWJGLException; -import org.lwjgl.BufferChecks; -import java.nio.*; - -public final class NVTransformFeeback { - /** - * Accepted by the <target> parameters of BindBuffer, BufferData, - * BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, - * GetBufferPointerv, BindBufferRangeNV, BindBufferOffsetNV and - * BindBufferBaseNV: - */ - public static final int GL_TRANSFORM_FEEDBACK_BUFFER_NV = 0x8c8e; - /** - * Accepted by the <param> parameter of GetIntegerIndexedvEXT and - * GetBooleanIndexedvEXT: - */ - public static final int GL_TRANSFORM_FEEDBACK_BUFFER_START_NV = 0x8c84; - public static final int GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV = 0x8c85; - public static final int GL_TRANSFORM_FEEDBACK_RECORD_NV = 0x8c86; - /** - * Accepted by the <param> parameter of GetIntegerIndexedvEXT and - * GetBooleanIndexedvEXT, and by the <pname> parameter of GetBooleanv, - * GetDoublev, GetIntegerv, and GetFloatv: - */ - public static final int GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV = 0x8c8f; - /** - * Accepted by the <bufferMode> parameter of TransformFeedbackAttribsNV and - * TransformFeedbackVaryingsNV: - */ - public static final int GL_INTERLEAVED_ATTRIBS_NV = 0x8c8c; - public static final int GL_SEPARATE_ATTRIBS_NV = 0x8c8d; - /** - * Accepted by the <target> parameter of BeginQuery, EndQuery, and - * GetQueryiv: - */ - public static final int GL_PRIMITIVES_GENERATED_NV = 0x8c87; - public static final int GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV = 0x8c88; - /** - * Accepted by the <cap> parameter of Enable, Disable, and IsEnabled, and by - * the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and - * GetDoublev: - */ - public static final int GL_RASTERIZER_DISCARD_NV = 0x8c89; - /** - * Accepted by the <pname> parameter of GetBooleanv, GetDoublev, GetIntegerv, - * and GetFloatv: - */ - public static final int GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV = 0x8c8a; - public static final int GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV = 0x8c8b; - public static final int GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV = 0x8c80; - public static final int GL_TRANSFORM_FEEDBACK_ATTRIBS_NV = 0x8c7e; - /** - *Accepted by the <pname> parameter of GetProgramiv: - */ - public static final int GL_ACTIVE_VARYINGS_NV = 0x8c81; - public static final int GL_ACTIVE_VARYING_MAX_LENGTH_NV = 0x8c82; - public static final int GL_TRANSFORM_FEEDBACK_VARYINGS_NV = 0x8c83; - /** - * Accepted by the <pname> parameter of GetBooleanv, GetDoublev, GetIntegerv, - * GetFloatv, and GetProgramiv: - */ - public static final int GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV = 0x8c7f; - /** - *Accepted by the <attribs> parameter of TransformFeedbackAttribsNV: - */ - public static final int GL_BACK_PRIMARY_COLOR_NV = 0x8c77; - public static final int GL_BACK_SECONDARY_COLOR_NV = 0x8c78; - public static final int GL_TEXTURE_COORD_NV = 0x8c79; - public static final int GL_CLIP_DISTANCE_NV = 0x8c7a; - public static final int GL_VERTEX_ID_NV = 0x8c7b; - public static final int GL_PRIMITIVE_ID_NV = 0x8c7c; - public static final int GL_GENERIC_ATTRIB_NV = 0x8c7d; - - private NVTransformFeeback() { - } - - - public static void glBindBufferRangeNV(int target, int index, int buffer, long offset, long size) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.NV_transform_feeback_glBindBufferRangeNV_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - nglBindBufferRangeNV(target, index, buffer, offset, size, function_pointer); - } - private static native void nglBindBufferRangeNV(int target, int index, int buffer, long offset, long size, long function_pointer); - - public static void glBindBufferOffsetNV(int target, int index, int buffer, long offset) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.NV_transform_feeback_glBindBufferOffsetNV_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - nglBindBufferOffsetNV(target, index, buffer, offset, function_pointer); - } - private static native void nglBindBufferOffsetNV(int target, int index, int buffer, long offset, long function_pointer); - - public static void glBindBufferBaseNV(int target, int index, int buffer) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.NV_transform_feeback_glBindBufferBaseNV_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - nglBindBufferBaseNV(target, index, buffer, function_pointer); - } - private static native void nglBindBufferBaseNV(int target, int index, int buffer, long function_pointer); - - public static void glTransformFeedbackAttribsNV(IntBuffer attribs, int bufferMode) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.NV_transform_feeback_glTransformFeedbackAttribsNV_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - BufferChecks.checkDirect(attribs); - nglTransformFeedbackAttribsNV((attribs.remaining()), attribs, attribs.position(), bufferMode, function_pointer); - } - private static native void nglTransformFeedbackAttribsNV(int count, IntBuffer attribs, int attribs_position, int bufferMode, long function_pointer); - - public static void glTransformFeedbackVaryingsNV(int program, IntBuffer locations, int bufferMode) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.NV_transform_feeback_glTransformFeedbackVaryingsNV_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - BufferChecks.checkDirect(locations); - nglTransformFeedbackVaryingsNV(program, (locations.remaining()), locations, locations.position(), bufferMode, function_pointer); - } - private static native void nglTransformFeedbackVaryingsNV(int program, int count, IntBuffer locations, int locations_position, int bufferMode, long function_pointer); - - public static void glBeginTransformFeedbackNV(int primitiveMode) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.NV_transform_feeback_glBeginTransformFeedbackNV_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - nglBeginTransformFeedbackNV(primitiveMode, function_pointer); - } - private static native void nglBeginTransformFeedbackNV(int primitiveMode, long function_pointer); - - public static void glEndTransformFeedbackNV() { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.NV_transform_feeback_glEndTransformFeedbackNV_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - nglEndTransformFeedbackNV(function_pointer); - } - private static native void nglEndTransformFeedbackNV(long function_pointer); - - public static int glGetVaryingLocationNV(int program, ByteBuffer name) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.NV_transform_feeback_glGetVaryingLocationNV_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - BufferChecks.checkDirect(name); - BufferChecks.checkNullTerminated(name); - int __result = nglGetVaryingLocationNV(program, name, name.position(), function_pointer); - return __result; - } - private static native int nglGetVaryingLocationNV(int program, ByteBuffer name, int name_position, long function_pointer); - - public static void glGetActiveVaryingNV(int program, int index, IntBuffer length, IntBuffer size, IntBuffer type, ByteBuffer name) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.NV_transform_feeback_glGetActiveVaryingNV_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - BufferChecks.checkBuffer(length, 1); - BufferChecks.checkBuffer(size, 1); - BufferChecks.checkBuffer(type, 1); - BufferChecks.checkDirect(name); - nglGetActiveVaryingNV(program, index, (name.remaining()), length, length.position(), size, size.position(), type, type.position(), name, name.position(), function_pointer); - } - private static native void nglGetActiveVaryingNV(int program, int index, int bufSize, IntBuffer length, int length_position, IntBuffer size, int size_position, IntBuffer type, int type_position, ByteBuffer name, int name_position, long function_pointer); - - public static void glActiveVaryingNV(int program, ByteBuffer name) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.NV_transform_feeback_glActiveVaryingNV_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - BufferChecks.checkDirect(name); - BufferChecks.checkNullTerminated(name); - nglActiveVaryingNV(program, name, name.position(), function_pointer); - } - private static native void nglActiveVaryingNV(int program, ByteBuffer name, int name_position, long function_pointer); - - public static void glGetTransformFeedbackVaryingNV(int program, int index, IntBuffer location) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.NV_transform_feeback_glGetTransformFeedbackVaryingNV_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - BufferChecks.checkBuffer(location, 1); - nglGetTransformFeedbackVaryingNV(program, index, location, location.position(), function_pointer); - } - private static native void nglGetTransformFeedbackVaryingNV(int program, int index, IntBuffer location, int location_position, long function_pointer); -} Added: trunk/LWJGL/src/generated/org/lwjgl/opengl/NVTransformFeedback.java =================================================================== --- trunk/LWJGL/src/generated/org/lwjgl/opengl/NVTransformFeedback.java (rev 0) +++ trunk/LWJGL/src/generated/org/lwjgl/opengl/NVTransformFeedback.java 2006-11-19 22:06:46 UTC (rev 2668) @@ -0,0 +1,181 @@ +/* MACHINE GENERATED FILE, DO NOT EDIT */ + +package org.lwjgl.opengl; + +import org.lwjgl.LWJGLException; +import org.lwjgl.BufferChecks; +import java.nio.*; + +public final class NVTransformFeedback { + /** + * Accepted by the <target> parameters of BindBuffer, BufferData, + * BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, + * GetBufferPointerv, BindBufferRangeNV, BindBufferOffsetNV and + * BindBufferBaseNV: + */ + public static final int GL_TRANSFORM_FEEDBACK_BUFFER_NV = 0x8c8e; + /** + * Accepted by the <param> parameter of GetIntegerIndexedvEXT and + * GetBooleanIndexedvEXT: + */ + public static final int GL_TRANSFORM_FEEDBACK_BUFFER_START_NV = 0x8c84; + public static final int GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV = 0x8c85; + public static final int GL_TRANSFORM_FEEDBACK_RECORD_NV = 0x8c86; + /** + * Accepted by the <param> parameter of GetIntegerIndexedvEXT and + * GetBooleanIndexedvEXT, and by the <pname> parameter of GetBooleanv, + * GetDoublev, GetIntegerv, and GetFloatv: + */ + public static final int GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV = 0x8c8f; + /** + * Accepted by the <bufferMode> parameter of TransformFeedbackAttribsNV and + * TransformFeedbackVaryingsNV: + */ + public static final int GL_INTERLEAVED_ATTRIBS_NV = 0x8c8c; + public static final int GL_SEPARATE_ATTRIBS_NV = 0x8c8d; + /** + * Accepted by the <target> parameter of BeginQuery, EndQuery, and + * GetQueryiv: + */ + public static final int GL_PRIMITIVES_GENERATED_NV = 0x8c87; + public static final int GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV = 0x8c88; + /** + * Accepted by the <cap> parameter of Enable, Disable, and IsEnabled, and by + * the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev: + */ + public static final int GL_RASTERIZER_DISCARD_NV = 0x8c89; + /** + * Accepted by the <pname> parameter of GetBooleanv, GetDoublev, GetIntegerv, + * and GetFloatv: + */ + public static final int GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV = 0x8c8a; + public static final int GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV = 0x8c8b; + public static final int GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV = 0x8c80; + public static final int GL_TRANSFORM_FEEDBACK_ATTRIBS_NV = 0x8c7e; + /** + *Accepted by the <pname> parameter of GetProgramiv: + */ + public static final int GL_ACTIVE_VARYINGS_NV = 0x8c81; + public static final int GL_ACTIVE_VARYING_MAX_LENGTH_NV = 0x8c82; + public static final int GL_TRANSFORM_FEEDBACK_VARYINGS_NV = 0x8c83; + /** + * Accepted by the <pname> parameter of GetBooleanv, GetDoublev, GetIntegerv, + * GetFloatv, and GetProgramiv: + */ + public static final int GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV = 0x8c7f; + /** + *Accepted by the <attribs> parameter of TransformFeedbackAttribsNV: + */ + public static final int GL_BACK_PRIMARY_COLOR_NV = 0x8c77; + public static final int GL_BACK_SECONDARY_COLOR_NV = 0x8c78; + public static final int GL_TEXTURE_COORD_NV = 0x8c79; + public static final int GL_CLIP_DISTANCE_NV = 0x8c7a; + public static final int GL_VERTEX_ID_NV = 0x8c7b; + public static final int GL_PRIMITIVE_ID_NV = 0x8c7c; + public static final int GL_GENERIC_ATTRIB_NV = 0x8c7d; + + private NVTransformFeedback() { + } + + + public static void glBindBufferRangeNV(int target, int index, int buffer, long offset, long size) { + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.NV_transform_feedback_glBindBufferRangeNV_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + nglBindBufferRangeNV(target, index, buffer, offset, size, function_pointer); + } + private static native void nglBindBufferRangeNV(int target, int index, int buffer, long offset, long size, long function_pointer); + + public static void glBindBufferOffsetNV(int target, int index, int buffer, long offset) { + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.NV_transform_feedback_glBindBufferOffsetNV_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + nglBindBufferOffsetNV(target, index, buffer, offset, function_pointer); + } + private static native void nglBindBufferOffsetNV(int target, int index, int buffer, long offset, long function_pointer); + + public static void glBindBufferBaseNV(int target, int index, int buffer) { + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.NV_transform_feedback_glBindBufferBaseNV_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + nglBindBufferBaseNV(target, index, buffer, function_pointer); + } + private static native void nglBindBufferBaseNV(int target, int index, int buffer, long function_pointer); + + public static void glTransformFeedbackAttribsNV(IntBuffer attribs, int bufferMode) { + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.NV_transform_feedback_glTransformFeedbackAttribsNV_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkDirect(attribs); + nglTransformFeedbackAttribsNV((attribs.remaining()), attribs, attribs.position(), bufferMode, function_pointer); + } + private static native void nglTransformFeedbackAttribsNV(int count, IntBuffer attribs, int attribs_position, int bufferMode, long function_pointer); + + public static void glTransformFeedbackVaryingsNV(int program, IntBuffer locations, int bufferMode) { + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.NV_transform_feedback_glTransformFeedbackVaryingsNV_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkDirect(locations); + nglTransformFeedbackVaryingsNV(program, (locations.remaining()), locations, locations.position(), bufferMode, function_pointer); + } + private static native void nglTransformFeedbackVaryingsNV(int program, int count, IntBuffer locations, int locations_position, int bufferMode, long function_pointer); + + public static void glBeginTransformFeedbackNV(int primitiveMode) { + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.NV_transform_feedback_glBeginTransformFeedbackNV_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + nglBeginTransformFeedbackNV(primitiveMode, function_pointer); + } + private static native void nglBeginTransformFeedbackNV(int primitiveMode, long function_pointer); + + public static void glEndTransformFeedbackNV() { + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.NV_transform_feedback_glEndTransformFeedbackNV_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + nglEndTransformFeedbackNV(function_pointer); + } + private static native void nglEndTransformFeedbackNV(long function_pointer); + + public static int glGetVaryingLocationNV(int program, ByteBuffer name) { + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.NV_transform_feedback_glGetVaryingLocationNV_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkDirect(name); + BufferChecks.checkNullTerminated(name); + int __result = nglGetVaryingLocationNV(program, name, name.position(), function_pointer); + return __result; + } + private static native int nglGetVaryingLocationNV(int program, ByteBuffer name, int name_position, long function_pointer); + + public static void glGetActiveVaryingNV(int program, int index, IntBuffer length, IntBuffer size, IntBuffer type, ByteBuffer name) { + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.NV_transform_feedback_glGetActiveVaryingNV_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkBuffer(length, 1); + BufferChecks.checkBuffer(size, 1); + BufferChecks.checkBuffer(type, 1); + BufferChecks.checkDirect(name); + nglGetActiveVaryingNV(program, index, (name.remaining()), length, length.position(), size, size.position(), type, type.position(), name, name.position(), function_pointer); + } + private static native void nglGetActiveVaryingNV(int program, int index, int bufSize, IntBuffer length, int length_position, IntBuffer size, int size_position, IntBuffer type, int type_position, ByteBuffer name, int name_position, long function_pointer); + + public static void glActiveVaryingNV(int program, ByteBuffer name) { + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.NV_transform_feedback_glActiveVaryingNV_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkDirect(name); + BufferChecks.checkNullTerminated(name); + nglActiveVaryingNV(program, name, name.position(), function_pointer); + } + private static native void nglActiveVaryingNV(int program, ByteBuffer name, int name_position, long function_pointer); + + public static void glGetTransformFeedbackVaryingNV(int program, int index, IntBuffer location) { + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.NV_transform_feedback_glGetTransformFeedbackVaryingNV_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkBuffer(location, 1); + nglGetTransformFeedbackVaryingNV(program, index, location, location.position(), function_pointer); + } + private static native void nglGetTransformFeedbackVaryingNV(int program, int index, IntBuffer location, int location_position, long function_pointer); +} Deleted: trunk/LWJGL/src/native/generated/org_lwjgl_opengl_NVTransformFeeback.c =================================================================== --- trunk/LWJGL/src/native/generated/org_lwjgl_opengl_NVTransformFeeback.c 2006-11-19 22:01:56 UTC (rev 2667) +++ trunk/LWJGL/src/native/generated/org_lwjgl_opengl_NVTransformFeeback.c 2006-11-19 22:06:46 UTC (rev 2668) @@ -1,82 +0,0 @@ -/* MACHINE GENERATED FILE, DO NOT EDIT */ - -#include <jni.h> -#include "extgl.h" - -typedef void (APIENTRY *glBindBufferRangeNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef void (APIENTRY *glBindBufferOffsetNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); -typedef void (APIENTRY *glBindBufferBaseNVPROC) (GLenum target, GLuint index, GLuint buffer); -typedef void (APIENTRY *glTransformFeedbackAttribsNVPROC) (GLsizei count, const GLint * attribs, GLenum bufferMode); -typedef void (APIENTRY *glTransformFeedbackVaryingsNVPROC) (GLuint program, GLsizei count, const GLint * locations, GLenum bufferMode); -typedef void (APIENTRY *glBeginTransformFeedbackNVPROC) (GLenum primitiveMode); -typedef void (APIENTRY *glEndTransformFeedbackNVPROC) (); -typedef GLint (APIENTRY *glGetVaryingLocationNVPROC) (GLuint program, const GLchar * name); -typedef void (APIENTRY *glGetActiveVaryingNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, GLchar * name); -typedef void (APIENTRY *glActiveVaryingNVPROC) (GLuint program, const GLchar * name); -typedef void (APIENTRY *glGetTransformFeedbackVaryingNVPROC) (GLuint program, GLuint index, GLint * location); - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeeback_nglBindBufferRangeNV(JNIEnv *env, jclass clazz, jint target, jint index, jint buffer, jlong offset, jlong size, jlong function_pointer) { - glBindBufferRangeNVPROC glBindBufferRangeNV = (glBindBufferRangeNVPROC)((intptr_t)function_pointer); - glBindBufferRangeNV(target, index, buffer, offset, size); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeeback_nglBindBufferOffsetNV(JNIEnv *env, jclass clazz, jint target, jint index, jint buffer, jlong offset, jlong function_pointer) { - glBindBufferOffsetNVPROC glBindBufferOffsetNV = (glBindBufferOffsetNVPROC)((intptr_t)function_pointer); - glBindBufferOffsetNV(target, index, buffer, offset); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeeback_nglBindBufferBaseNV(JNIEnv *env, jclass clazz, jint target, jint index, jint buffer, jlong function_pointer) { - glBindBufferBaseNVPROC glBindBufferBaseNV = (glBindBufferBaseNVPROC)((intptr_t)function_pointer); - glBindBufferBaseNV(target, index, buffer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeeback_nglTransformFeedbackAttribsNV(JNIEnv *env, jclass clazz, jint count, jobject attribs, jint attribs_position, jint bufferMode, jlong function_pointer) { - const GLint *attribs_address = ((const GLint *)(*env)->GetDirectBufferAddress(env, attribs)) + attribs_position; - glTransformFeedbackAttribsNVPROC glTransformFeedbackAttribsNV = (glTransformFeedbackAttribsNVPROC)((intptr_t)function_pointer); - glTransformFeedbackAttribsNV(count, attribs_address, bufferMode); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeeback_nglTransformFeedbackVaryingsNV(JNIEnv *env, jclass clazz, jint program, jint count, jobject locations, jint locations_position, jint bufferMode, jlong function_pointer) { - const GLint *locations_address = ((const GLint *)(*env)->GetDirectBufferAddress(env, locations)) + locations_position; - glTransformFeedbackVaryingsNVPROC glTransformFeedbackVaryingsNV = (glTransformFeedbackVaryingsNVPROC)((intptr_t)function_pointer); - glTransformFeedbackVaryingsNV(program, count, locations_address, bufferMode); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeeback_nglBeginTransformFeedbackNV(JNIEnv *env, jclass clazz, jint primitiveMode, jlong function_pointer) { - glBeginTransformFeedbackNVPROC glBeginTransformFeedbackNV = (glBeginTransformFeedbackNVPROC)((intptr_t)function_pointer); - glBeginTransformFeedbackNV(primitiveMode); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeeback_nglEndTransformFeedbackNV(JNIEnv *env, jclass clazz, jlong function_pointer) { - glEndTransformFeedbackNVPROC glEndTransformFeedbackNV = (glEndTransformFeedbackNVPROC)((intptr_t)function_pointer); - glEndTransformFeedbackNV(); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_NVTransformFeeback_nglGetVaryingLocationNV(JNIEnv *env, jclass clazz, jint program, jobject name, jint name_position, jlong function_pointer) { - const GLchar *name_address = ((const GLchar *)(*env)->GetDirectBufferAddress(env, name)) + name_position; - glGetVaryingLocationNVPROC glGetVaryingLocationNV = (glGetVaryingLocationNVPROC)((intptr_t)function_pointer); - GLint __result = glGetVaryingLocationNV(program, name_address); - return __result; -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeeback_nglGetActiveVaryingNV(JNIEnv *env, jclass clazz, jint program, jint index, jint bufSize, jobject length, jint length_position, jobject size, jint size_position, jobject type, jint type_position, jobject name, jint name_position, jlong function_pointer) { - GLsizei *length_address = ((GLsizei *)(*env)->GetDirectBufferAddress(env, length)) + length_position; - GLsizei *size_address = ((GLsizei *)(*env)->GetDirectBufferAddress(env, size)) + size_position; - GLenum *type_address = ((GLenum *)(*env)->GetDirectBufferAddress(env, type)) + type_position; - GLchar *name_address = ((GLchar *)(*env)->GetDirectBufferAddress(env, name)) + name_position; - glGetActiveVaryingNVPROC glGetActiveVaryingNV = (glGetActiveVaryingNVPROC)((intptr_t)function_pointer); - glGetActiveVaryingNV(program, index, bufSize, length_address, size_address, type_address, name_address); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeeback_nglActiveVaryingNV(JNIEnv *env, jclass clazz, jint program, jobject name, jint name_position, jlong function_pointer) { - const GLchar *name_address = ((const GLchar *)(*env)->GetDirectBufferAddress(env, name)) + name_position; - glActiveVaryingNVPROC glActiveVaryingNV = (glActiveVaryingNVPROC)((intptr_t)function_pointer); - glActiveVaryingNV(program, name_address); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeeback_nglGetTransformFeedbackVaryingNV(JNIEnv *env, jclass clazz, jint program, jint index, jobject location, jint location_position, jlong function_pointer) { - GLint *location_address = ((GLint *)(*env)->GetDirectBufferAddress(env, location)) + location_position; - glGetTransformFeedbackVaryingNVPROC glGetTransformFeedbackVaryingNV = (glGetTransformFeedbackVaryingNVPROC)((intptr_t)function_pointer); - glGetTransformFeedbackVaryingNV(program, index, location_address); -} - Added: trunk/LWJGL/src/native/generated/org_lwjgl_opengl_NVTransformFeedback.c =================================================================== --- trunk/LWJGL/src/native/generated/org_lwjgl_opengl_NVTransformFeedback.c (rev 0) +++ trunk/LWJGL/src/native/generated/org_lwjgl_opengl_NVTransformFeedback.c 2006-11-19 22:06:46 UTC (rev 2668) @@ -0,0 +1,82 @@ +/* MACHINE GENERATED FILE, DO NOT EDIT */ + +#include <jni.h> +#include "extgl.h" + +typedef void (APIENTRY *glBindBufferRangeNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (APIENTRY *glBindBufferOffsetNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +typedef void (APIENTRY *glBindBufferBaseNVPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (APIENTRY *glTransformFeedbackAttribsNVPROC) (GLsizei count, const GLint * attribs, GLenum bufferMode); +typedef void (APIENTRY *glTransformFeedbackVaryingsNVPROC) (GLuint program, GLsizei count, const GLint * locations, GLenum bufferMode); +typedef void (APIENTRY *glBeginTransformFeedbackNVPROC) (GLenum primitiveMode); +typedef void (APIENTRY *glEndTransformFeedbackNVPROC) (); +typedef GLint (APIENTRY *glGetVaryingLocationNVPROC) (GLuint program, const GLchar * name); +typedef void (APIENTRY *glGetActiveVaryingNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, GLchar * name); +typedef void (APIENTRY *glActiveVaryingNVPROC) (GLuint program, const GLchar * name); +typedef void (APIENTRY *glGetTransformFeedbackVaryingNVPROC) (GLuint program, GLuint index, GLint * location); + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeedback_nglBindBufferRangeNV(JNIEnv *env, jclass clazz, jint target, jint index, jint buffer, jlong offset, jlong size, jlong function_pointer) { + glBindBufferRangeNVPROC glBindBufferRangeNV = (glBindBufferRangeNVPROC)((intptr_t)function_pointer); + glBindBufferRangeNV(target, index, buffer, offset, size); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeedback_nglBindBufferOffsetNV(JNIEnv *env, jclass clazz, jint target, jint index, jint buffer, jlong offset, jlong function_pointer) { + glBindBufferOffsetNVPROC glBindBufferOffsetNV = (glBindBufferOffsetNVPROC)((intptr_t)function_pointer); + glBindBufferOffsetNV(target, index, buffer, offset); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeedback_nglBindBufferBaseNV(JNIEnv *env, jclass clazz, jint target, jint index, jint buffer, jlong function_pointer) { + glBindBufferBaseNVPROC glBindBufferBaseNV = (glBindBufferBaseNVPROC)((intptr_t)function_pointer); + glBindBufferBaseNV(target, index, buffer); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeedback_nglTransformFeedbackAttribsNV(JNIEnv *env, jclass clazz, jint count, jobject attribs, jint attribs_position, jint bufferMode, jlong function_pointer) { + const GLint *attribs_address = ((const GLint *)(*env)->GetDirectBufferAddress(env, attribs)) + attribs_position; + glTransformFeedbackAttribsNVPROC glTransformFeedbackAttribsNV = (glTransformFeedbackAttribsNVPROC)((intptr_t)function_pointer); + glTransformFeedbackAttribsNV(count, attribs_address, bufferMode); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeedback_nglTransformFeedbackVaryingsNV(JNIEnv *env, jclass clazz, jint program, jint count, jobject locations, jint locations_position, jint bufferMode, jlong function_pointer) { + const GLint *locations_address = ((const GLint *)(*env)->GetDirectBufferAddress(env, locations)) + locations_position; + glTransformFeedbackVaryingsNVPROC glTransformFeedbackVaryingsNV = (glTransformFeedbackVaryingsNVPROC)((intptr_t)function_pointer); + glTransformFeedbackVaryingsNV(program, count, locations_address, bufferMode); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeedback_nglBeginTransformFeedbackNV(JNIEnv *env, jclass clazz, jint primitiveMode, jlong function_pointer) { + glBeginTransformFeedbackNVPROC glBeginTransformFeedbackNV = (glBeginTransformFeedbackNVPROC)((intptr_t)function_pointer); + glBeginTransformFeedbackNV(primitiveMode); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeedback_nglEndTransformFeedbackNV(JNIEnv *env, jclass clazz, jlong function_pointer) { + glEndTransformFeedbackNVPROC glEndTransformFeedbackNV = (glEndTransformFeedbackNVPROC)((intptr_t)function_pointer); + glEndTransformFeedbackNV(); +} + +JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_NVTransformFeedback_nglGetVaryingLocationNV(JNIEnv *env, jclass clazz, jint program, jobject name, jint name_position, jlong function_pointer) { + const GLchar *name_address = ((const GLchar *)(*env)->GetDirectBufferAddress(env, name)) + name_position; + glGetVaryingLocationNVPROC glGetVaryingLocationNV = (glGetVaryingLocationNVPROC)((intptr_t)function_pointer); + GLint __result = glGetVaryingLocationNV(program, name_address); + return __result; +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeedback_nglGetActiveVaryingNV(JNIEnv *env, jclass clazz, jint program, jint index, jint bufSize, jobject length, jint length_position, jobject size, jint size_position, jobject type, jint type_position, jobject name, jint name_position, jlong function_pointer) { + GLsizei *length_address = ((GLsizei *)(*env)->GetDirectBufferAddress(env, length)) + length_position; + GLsizei *size_address = ((GLsizei *)(*env)->GetDirectBufferAddress(env, size)) + size_position; + GLenum *type_address = ((GLenum *)(*env)->GetDirectBufferAddress(env, type)) + type_position; + GLchar *name_address = ((GLchar *)(*env)->GetDirectBufferAddress(env, name)) + name_position; + glGetActiveVaryingNVPROC glGetActiveVaryingNV = (glGetActiveVaryingNVPROC)((intptr_t)function_pointer); + glGetActiveVaryingNV(program, index, bufSize, length_address, size_address, type_address, name_address); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeedback_nglActiveVaryingNV(JNIEnv *env, jclass clazz, jint program, jobject name, jint name_position, jlong function_pointer) { + const GLchar *name_address = ((const GLchar *)(*env)->GetDirectBufferAddress(env, name)) + name_position; + glActiveVaryingNVPROC glActiveVaryingNV = (glActiveVaryingNVPROC)((intptr_t)function_pointer); + glActiveVaryingNV(program, name_address); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeedback_nglGetTransformFeedbackVaryingNV(JNIEnv *env, jclass clazz, jint program, jint index, jobject location, jint location_position, jlong function_pointer) { + GLint *location_address = ((GLint *)(*env)->GetDirectBufferAddress(env, location)) + location_position; + glGetTransformFeedbackVaryingNVPROC glGetTransformFeedbackVaryingNV = (glGetTransformFeedbackVaryingNVPROC)((intptr_t)function_pointer); + glGetTransformFeedbackVaryingNV(program, index, location_address); +} + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2006-11-27 23:04:39
|
Revision: 2685 http://svn.sourceforge.net/java-game-lib/?rev=2685&view=rev Author: elias_naur Date: 2006-11-27 15:04:37 -0800 (Mon, 27 Nov 2006) Log Message: ----------- ARBTextureCompression, GL13: Only allow ByteBuffer for glCompressedTex*Image*D since the spec defines that the image data is interpreted as (unsigned) bytes anyway. Also let the imageSize parameter be automatically determined Modified Paths: -------------- trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBTextureCompression.java trunk/LWJGL/src/generated/org/lwjgl/opengl/GL13.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_texture_compression.java trunk/LWJGL/src/templates/org/lwjgl/opengl/GL13.java Modified: trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBTextureCompression.java =================================================================== --- trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBTextureCompression.java 2006-11-27 23:01:01 UTC (rev 2684) +++ trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBTextureCompression.java 2006-11-27 23:04:37 UTC (rev 2685) @@ -23,47 +23,15 @@ } - public static void glCompressedTexImage1DARB(int target, int level, int internalformat, int width, int border, int imageSize, ByteBuffer pData) { + public static void glCompressedTexImage1DARB(int target, int level, int internalformat, int width, int border, ByteBuffer pData) { ContextCapabilities caps = GLContext.getCapabilities(); long function_pointer = caps.ARB_texture_compression_glCompressedTexImage1DARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); GLChecks.ensureUnpackPBOdisabled(caps); BufferChecks.checkDirect(pData); - nglCompressedTexImage1DARB(target, level, internalformat, width, border, imageSize, pData, pData.position(), function_pointer); + nglCompressedTexImage1DARB(target, level, internalformat, width, border, (pData.remaining()), pData, pData.position(), function_pointer); } - public static void glCompressedTexImage1DARB(int target, int level, int internalformat, int width, int border, int imageSize, DoubleBuffer pData) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.ARB_texture_compression_glCompressedTexImage1DARB_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(pData); - nglCompressedTexImage1DARB(target, level, internalformat, width, border, imageSize, pData, pData.position() << 3, function_pointer); - } - public static void glCompressedTexImage1DARB(int target, int level, int internalformat, int width, int border, int imageSize, FloatBuffer pData) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.ARB_texture_compression_glCompressedTexImage1DARB_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(pData); - nglCompressedTexImage1DARB(target, level, internalformat, width, border, imageSize, pData, pData.position() << 2, function_pointer); - } - public static void glCompressedTexImage1DARB(int target, int level, int internalformat, int width, int border, int imageSize, IntBuffer pData) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.ARB_texture_compression_glCompressedTexImage1DARB_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(pData); - nglCompressedTexImage1DARB(target, level, internalformat, width, border, imageSize, pData, pData.position() << 2, function_pointer); - } - public static void glCompressedTexImage1DARB(int target, int level, int internalformat, int width, int border, int imageSize, ShortBuffer pData) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.ARB_texture_compression_glCompressedTexImage1DARB_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(pData); - nglCompressedTexImage1DARB(target, level, internalformat, width, border, imageSize, pData, pData.position() << 1, function_pointer); - } - private static native void nglCompressedTexImage1DARB(int target, int level, int internalformat, int width, int border, int imageSize, Buffer pData, int pData_position, long function_pointer); + private static native void nglCompressedTexImage1DARB(int target, int level, int internalformat, int width, int border, int imageSize, ByteBuffer pData, int pData_position, long function_pointer); public static void glCompressedTexImage1DARB(int target, int level, int internalformat, int width, int border, int imageSize, long pData_buffer_offset) { ContextCapabilities caps = GLContext.getCapabilities(); long function_pointer = caps.ARB_texture_compression_glCompressedTexImage1DARB_pointer; @@ -73,47 +41,15 @@ } private static native void nglCompressedTexImage1DARBBO(int target, int level, int internalformat, int width, int border, int imageSize, long pData_buffer_offset, long function_pointer); - public static void glCompressedTexImage2DARB(int target, int level, int internalformat, int width, int height, int border, int imageSize, ByteBuffer pData) { + public static void glCompressedTexImage2DARB(int target, int level, int internalformat, int width, int height, int border, ByteBuffer pData) { ContextCapabilities caps = GLContext.getCapabilities(); long function_pointer = caps.ARB_texture_compression_glCompressedTexImage2DARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); GLChecks.ensureUnpackPBOdisabled(caps); BufferChecks.checkDirect(pData); - nglCompressedTexImage2DARB(target, level, internalformat, width, height, border, imageSize, pData, pData.position(), function_pointer); + nglCompressedTexImage2DARB(target, level, internalformat, width, height, border, (pData.remaining()), pData, pData.position(), function_pointer); } - public static void glCompressedTexImage2DARB(int target, int level, int internalformat, int width, int height, int border, int imageSize, DoubleBuffer pData) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.ARB_texture_compression_glCompressedTexImage2DARB_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(pData); - nglCompressedTexImage2DARB(target, level, internalformat, width, height, border, imageSize, pData, pData.position() << 3, function_pointer); - } - public static void glCompressedTexImage2DARB(int target, int level, int internalformat, int width, int height, int border, int imageSize, FloatBuffer pData) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.ARB_texture_compression_glCompressedTexImage2DARB_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(pData); - nglCompressedTexImage2DARB(target, level, internalformat, width, height, border, imageSize, pData, pData.position() << 2, function_pointer); - } - public static void glCompressedTexImage2DARB(int target, int level, int internalformat, int width, int height, int border, int imageSize, IntBuffer pData) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.ARB_texture_compression_glCompressedTexImage2DARB_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(pData); - nglCompressedTexImage2DARB(target, level, internalformat, width, height, border, imageSize, pData, pData.position() << 2, function_pointer); - } - public static void glCompressedTexImage2DARB(int target, int level, int internalformat, int width, int height, int border, int imageSize, ShortBuffer pData) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.ARB_texture_compression_glCompressedTexImage2DARB_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(pData); - nglCompressedTexImage2DARB(target, level, internalformat, width, height, border, imageSize, pData, pData.position() << 1, function_pointer); - } - private static native void nglCompressedTexImage2DARB(int target, int level, int internalformat, int width, int height, int border, int imageSize, Buffer pData, int pData_position, long function_pointer); + private static native void nglCompressedTexImage2DARB(int target, int level, int internalformat, int width, int height, int border, int imageSize, ByteBuffer pData, int pData_position, long function_pointer); public static void glCompressedTexImage2DARB(int target, int level, int internalformat, int width, int height, int border, int imageSize, long pData_buffer_offset) { ContextCapabilities caps = GLContext.getCapabilities(); long function_pointer = caps.ARB_texture_compression_glCompressedTexImage2DARB_pointer; @@ -123,47 +59,15 @@ } private static native void nglCompressedTexImage2DARBBO(int target, int level, int internalformat, int width, int height, int border, int imageSize, long pData_buffer_offset, long function_pointer); - public static void glCompressedTexImage3DARB(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, ByteBuffer pData) { + public static void glCompressedTexImage3DARB(int target, int level, int internalformat, int width, int height, int depth, int border, ByteBuffer pData) { ContextCapabilities caps = GLContext.getCapabilities(); long function_pointer = caps.ARB_texture_compression_glCompressedTexImage3DARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); GLChecks.ensureUnpackPBOdisabled(caps); BufferChecks.checkDirect(pData); - nglCompressedTexImage3DARB(target, level, internalformat, width, height, depth, border, imageSize, pData, pData.position(), function_pointer); + nglCompressedTexImage3DARB(target, level, internalformat, width, height, depth, border, (pData.remaining()), pData, pData.position(), function_pointer); } - public static void glCompressedTexImage3DARB(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, DoubleBuffer pData) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.ARB_texture_compression_glCompressedTexImage3DARB_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(pData); - nglCompressedTexImage3DARB(target, level, internalformat, width, height, depth, border, imageSize, pData, pData.position() << 3, function_pointer); - } - public static void glCompressedTexImage3DARB(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, FloatBuffer pData) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.ARB_texture_compression_glCompressedTexImage3DARB_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(pData); - nglCompressedTexImage3DARB(target, level, internalformat, width, height, depth, border, imageSize, pData, pData.position() << 2, function_pointer); - } - public static void glCompressedTexImage3DARB(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, IntBuffer pData) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.ARB_texture_compression_glCompressedTexImage3DARB_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(pData); - nglCompressedTexImage3DARB(target, level, internalformat, width, height, depth, border, imageSize, pData, pData.position() << 2, function_pointer); - } - public static void glCompressedTexImage3DARB(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, ShortBuffer pData) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.ARB_texture_compression_glCompressedTexImage3DARB_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(pData); - nglCompressedTexImage3DARB(target, level, internalformat, width, height, depth, border, imageSize, pData, pData.position() << 1, function_pointer); - } - private static native void nglCompressedTexImage3DARB(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, Buffer pData, int pData_position, long function_pointer); + private static native void nglCompressedTexImage3DARB(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, ByteBuffer pData, int pData_position, long function_pointer); public static void glCompressedTexImage3DARB(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, long pData_buffer_offset) { ContextCapabilities caps = GLContext.getCapabilities(); long function_pointer = caps.ARB_texture_compression_glCompressedTexImage3DARB_pointer; @@ -173,47 +77,15 @@ } private static native void nglCompressedTexImage3DARBBO(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, long pData_buffer_offset, long function_pointer); - public static void glCompressedTexSubImage1DARB(int target, int level, int xoffset, int width, int format, int imageSize, ByteBuffer pData) { + public static void glCompressedTexSubImage1DARB(int target, int level, int xoffset, int width, int format, ByteBuffer pData) { ContextCapabilities caps = GLContext.getCapabilities(); long function_pointer = caps.ARB_texture_compression_glCompressedTexSubImage1DARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); GLChecks.ensureUnpackPBOdisabled(caps); BufferChecks.checkDirect(pData); - nglCompressedTexSubImage1DARB(target, level, xoffset, width, format, imageSize, pData, pData.position(), function_pointer); + nglCompressedTexSubImage1DARB(target, level, xoffset, width, format, (pData.remaining()), pData, pData.position(), function_pointer); } - public static void glCompressedTexSubImage1DARB(int target, int level, int xoffset, int width, int format, int imageSize, DoubleBuffer pData) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.ARB_texture_compression_glCompressedTexSubImage1DARB_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(pData); - nglCompressedTexSubImage1DARB(target, level, xoffset, width, format, imageSize, pData, pData.position() << 3, function_pointer); - } - public static void glCompressedTexSubImage1DARB(int target, int level, int xoffset, int width, int format, int imageSize, FloatBuffer pData) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.ARB_texture_compression_glCompressedTexSubImage1DARB_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(pData); - nglCompressedTexSubImage1DARB(target, level, xoffset, width, format, imageSize, pData, pData.position() << 2, function_pointer); - } - public static void glCompressedTexSubImage1DARB(int target, int level, int xoffset, int width, int format, int imageSize, IntBuffer pData) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.ARB_texture_compression_glCompressedTexSubImage1DARB_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(pData); - nglCompressedTexSubImage1DARB(target, level, xoffset, width, format, imageSize, pData, pData.position() << 2, function_pointer); - } - public static void glCompressedTexSubImage1DARB(int target, int level, int xoffset, int width, int format, int imageSize, ShortBuffer pData) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.ARB_texture_compression_glCompressedTexSubImage1DARB_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(pData); - nglCompressedTexSubImage1DARB(target, level, xoffset, width, format, imageSize, pData, pData.position() << 1, function_pointer); - } - private static native void nglCompressedTexSubImage1DARB(int target, int level, int xoffset, int width, int format, int imageSize, Buffer pData, int pData_position, long function_pointer); + private static native void nglCompressedTexSubImage1DARB(int target, int level, int xoffset, int width, int format, int imageSize, ByteBuffer pData, int pData_position, long function_pointer); public static void glCompressedTexSubImage1DARB(int target, int level, int xoffset, int width, int format, int imageSize, long pData_buffer_offset) { ContextCapabilities caps = GLContext.getCapabilities(); long function_pointer = caps.ARB_texture_compression_glCompressedTexSubImage1DARB_pointer; @@ -223,47 +95,15 @@ } private static native void nglCompressedTexSubImage1DARBBO(int target, int level, int xoffset, int width, int format, int imageSize, long pData_buffer_offset, long function_pointer); - public static void glCompressedTexSubImage2DARB(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, ByteBuffer pData) { + public static void glCompressedTexSubImage2DARB(int target, int level, int xoffset, int yoffset, int width, int height, int format, ByteBuffer pData) { ContextCapabilities caps = GLContext.getCapabilities(); long function_pointer = caps.ARB_texture_compression_glCompressedTexSubImage2DARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); GLChecks.ensureUnpackPBOdisabled(caps); BufferChecks.checkDirect(pData); - nglCompressedTexSubImage2DARB(target, level, xoffset, yoffset, width, height, format, imageSize, pData, pData.position(), function_pointer); + nglCompressedTexSubImage2DARB(target, level, xoffset, yoffset, width, height, format, (pData.remaining()), pData, pData.position(), function_pointer); } - public static void glCompressedTexSubImage2DARB(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, DoubleBuffer pData) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.ARB_texture_compression_glCompressedTexSubImage2DARB_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(pData); - nglCompressedTexSubImage2DARB(target, level, xoffset, yoffset, width, height, format, imageSize, pData, pData.position() << 3, function_pointer); - } - public static void glCompressedTexSubImage2DARB(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, FloatBuffer pData) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.ARB_texture_compression_glCompressedTexSubImage2DARB_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(pData); - nglCompressedTexSubImage2DARB(target, level, xoffset, yoffset, width, height, format, imageSize, pData, pData.position() << 2, function_pointer); - } - public static void glCompressedTexSubImage2DARB(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, IntBuffer pData) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.ARB_texture_compression_glCompressedTexSubImage2DARB_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(pData); - nglCompressedTexSubImage2DARB(target, level, xoffset, yoffset, width, height, format, imageSize, pData, pData.position() << 2, function_pointer); - } - public static void glCompressedTexSubImage2DARB(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, ShortBuffer pData) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.ARB_texture_compression_glCompressedTexSubImage2DARB_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(pData); - nglCompressedTexSubImage2DARB(target, level, xoffset, yoffset, width, height, format, imageSize, pData, pData.position() << 1, function_pointer); - } - private static native void nglCompressedTexSubImage2DARB(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, Buffer pData, int pData_position, long function_pointer); + private static native void nglCompressedTexSubImage2DARB(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, ByteBuffer pData, int pData_position, long function_pointer); public static void glCompressedTexSubImage2DARB(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, long pData_buffer_offset) { ContextCapabilities caps = GLContext.getCapabilities(); long function_pointer = caps.ARB_texture_compression_glCompressedTexSubImage2DARB_pointer; @@ -273,47 +113,15 @@ } private static native void nglCompressedTexSubImage2DARBBO(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, long pData_buffer_offset, long function_pointer); - public static void glCompressedTexSubImage3DARB(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, ByteBuffer pData) { + public static void glCompressedTexSubImage3DARB(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, ByteBuffer pData) { ContextCapabilities caps = GLContext.getCapabilities(); long function_pointer = caps.ARB_texture_compression_glCompressedTexSubImage3DARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); GLChecks.ensureUnpackPBOdisabled(caps); BufferChecks.checkDirect(pData); - nglCompressedTexSubImage3DARB(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, pData, pData.position(), function_pointer); + nglCompressedTexSubImage3DARB(target, level, xoffset, yoffset, zoffset, width, height, depth, format, (pData.remaining()), pData, pData.position(), function_pointer); } - public static void glCompressedTexSubImage3DARB(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, DoubleBuffer pData) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.ARB_texture_compression_glCompressedTexSubImage3DARB_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(pData); - nglCompressedTexSubImage3DARB(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, pData, pData.position() << 3, function_pointer); - } - public static void glCompressedTexSubImage3DARB(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, FloatBuffer pData) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.ARB_texture_compression_glCompressedTexSubImage3DARB_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(pData); - nglCompressedTexSubImage3DARB(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, pData, pData.position() << 2, function_pointer); - } - public static void glCompressedTexSubImage3DARB(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, IntBuffer pData) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.ARB_texture_compression_glCompressedTexSubImage3DARB_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(pData); - nglCompressedTexSubImage3DARB(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, pData, pData.position() << 2, function_pointer); - } - public static void glCompressedTexSubImage3DARB(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, ShortBuffer pData) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.ARB_texture_compression_glCompressedTexSubImage3DARB_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(pData); - nglCompressedTexSubImage3DARB(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, pData, pData.position() << 1, function_pointer); - } - private static native void nglCompressedTexSubImage3DARB(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, Buffer pData, int pData_position, long function_pointer); + private static native void nglCompressedTexSubImage3DARB(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, ByteBuffer pData, int pData_position, long function_pointer); public static void glCompressedTexSubImage3DARB(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, long pData_buffer_offset) { ContextCapabilities caps = GLContext.getCapabilities(); long function_pointer = caps.ARB_texture_compression_glCompressedTexSubImage3DARB_pointer; @@ -331,39 +139,7 @@ BufferChecks.checkDirect(pImg); nglGetCompressedTexImageARB(target, lod, pImg, pImg.position(), function_pointer); } - public static void glGetCompressedTexImageARB(int target, int lod, DoubleBuffer pImg) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.ARB_texture_compression_glGetCompressedTexImageARB_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensurePackPBOdisabled(caps); - BufferChecks.checkDirect(pImg); - nglGetCompressedTexImageARB(target, lod, pImg, pImg.position() << 3, function_pointer); - } - public static void glGetCompressedTexImageARB(int target, int lod, FloatBuffer pImg) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.ARB_texture_compression_glGetCompressedTexImageARB_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensurePackPBOdisabled(caps); - BufferChecks.checkDirect(pImg); - nglGetCompressedTexImageARB(target, lod, pImg, pImg.position() << 2, function_pointer); - } - public static void glGetCompressedTexImageARB(int target, int lod, IntBuffer pImg) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.ARB_texture_compression_glGetCompressedTexImageARB_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensurePackPBOdisabled(caps); - BufferChecks.checkDirect(pImg); - nglGetCompressedTexImageARB(target, lod, pImg, pImg.position() << 2, function_pointer); - } - public static void glGetCompressedTexImageARB(int target, int lod, ShortBuffer pImg) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.ARB_texture_compression_glGetCompressedTexImageARB_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensurePackPBOdisabled(caps); - BufferChecks.checkDirect(pImg); - nglGetCompressedTexImageARB(target, lod, pImg, pImg.position() << 1, function_pointer); - } - private static native void nglGetCompressedTexImageARB(int target, int lod, Buffer pImg, int pImg_position, long function_pointer); + private static native void nglGetCompressedTexImageARB(int target, int lod, ByteBuffer pImg, int pImg_position, long function_pointer); public static void glGetCompressedTexImageARB(int target, int lod, long pImg_buffer_offset) { ContextCapabilities caps = GLContext.getCapabilities(); long function_pointer = caps.ARB_texture_compression_glGetCompressedTexImageARB_pointer; Modified: trunk/LWJGL/src/generated/org/lwjgl/opengl/GL13.java =================================================================== --- trunk/LWJGL/src/generated/org/lwjgl/opengl/GL13.java 2006-11-27 23:01:01 UTC (rev 2684) +++ trunk/LWJGL/src/generated/org/lwjgl/opengl/GL13.java 2006-11-27 23:04:37 UTC (rev 2685) @@ -124,46 +124,14 @@ } private static native void nglClientActiveTexture(int texture, long function_pointer); - public static void glCompressedTexImage1D(int target, int level, int internalformat, int width, int border, int imageSize, ByteBuffer data) { + public static void glCompressedTexImage1D(int target, int level, int internalformat, int width, int border, ByteBuffer data) { ContextCapabilities caps = GLContext.getCapabilities(); long function_pointer = caps.GL13_glCompressedTexImage1D_pointer; BufferChecks.checkFunctionAddress(function_pointer); GLChecks.ensureUnpackPBOdisabled(caps); BufferChecks.checkDirect(data); - nglCompressedTexImage1D(target, level, internalformat, width, border, imageSize, data, data.position(), function_pointer); + nglCompressedTexImage1D(target, level, internalformat, width, border, (data.remaining()), data, data.position(), function_pointer); } - public static void glCompressedTexImage1D(int target, int level, int internalformat, int width, int border, int imageSize, DoubleBuffer data) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.GL13_glCompressedTexImage1D_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(data); - nglCompressedTexImage1D(target, level, internalformat, width, border, imageSize, data, data.position() << 3, function_pointer); - } - public static void glCompressedTexImage1D(int target, int level, int internalformat, int width, int border, int imageSize, FloatBuffer data) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.GL13_glCompressedTexImage1D_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(data); - nglCompressedTexImage1D(target, level, internalformat, width, border, imageSize, data, data.position() << 2, function_pointer); - } - public static void glCompressedTexImage1D(int target, int level, int internalformat, int width, int border, int imageSize, IntBuffer data) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.GL13_glCompressedTexImage1D_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(data); - nglCompressedTexImage1D(target, level, internalformat, width, border, imageSize, data, data.position() << 2, function_pointer); - } - public static void glCompressedTexImage1D(int target, int level, int internalformat, int width, int border, int imageSize, ShortBuffer data) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.GL13_glCompressedTexImage1D_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(data); - nglCompressedTexImage1D(target, level, internalformat, width, border, imageSize, data, data.position() << 1, function_pointer); - } private static native void nglCompressedTexImage1D(int target, int level, int internalformat, int width, int border, int imageSize, Buffer data, int data_position, long function_pointer); public static void glCompressedTexImage1D(int target, int level, int internalformat, int width, int border, int imageSize, long data_buffer_offset) { ContextCapabilities caps = GLContext.getCapabilities(); @@ -174,47 +142,15 @@ } private static native void nglCompressedTexImage1DBO(int target, int level, int internalformat, int width, int border, int imageSize, long data_buffer_offset, long function_pointer); - public static void glCompressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, int imageSize, ByteBuffer data) { + public static void glCompressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, ByteBuffer data) { ContextCapabilities caps = GLContext.getCapabilities(); long function_pointer = caps.GL13_glCompressedTexImage2D_pointer; BufferChecks.checkFunctionAddress(function_pointer); GLChecks.ensureUnpackPBOdisabled(caps); BufferChecks.checkDirect(data); - nglCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data, data.position(), function_pointer); + nglCompressedTexImage2D(target, level, internalformat, width, height, border, (data.remaining()), data, data.position(), function_pointer); } - public static void glCompressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, int imageSize, DoubleBuffer data) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.GL13_glCompressedTexImage2D_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(data); - nglCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data, data.position() << 3, function_pointer); - } - public static void glCompressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, int imageSize, FloatBuffer data) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.GL13_glCompressedTexImage2D_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(data); - nglCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data, data.position() << 2, function_pointer); - } - public static void glCompressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, int imageSize, IntBuffer data) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.GL13_glCompressedTexImage2D_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(data); - nglCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data, data.position() << 2, function_pointer); - } - public static void glCompressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, int imageSize, ShortBuffer data) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.GL13_glCompressedTexImage2D_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(data); - nglCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data, data.position() << 1, function_pointer); - } - private static native void nglCompressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, int imageSize, Buffer data, int data_position, long function_pointer); + private static native void nglCompressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, int imageSize, ByteBuffer data, int data_position, long function_pointer); public static void glCompressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, int imageSize, long data_buffer_offset) { ContextCapabilities caps = GLContext.getCapabilities(); long function_pointer = caps.GL13_glCompressedTexImage2D_pointer; @@ -224,47 +160,15 @@ } private static native void nglCompressedTexImage2DBO(int target, int level, int internalformat, int width, int height, int border, int imageSize, long data_buffer_offset, long function_pointer); - public static void glCompressedTexImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, ByteBuffer data) { + public static void glCompressedTexImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, ByteBuffer data) { ContextCapabilities caps = GLContext.getCapabilities(); long function_pointer = caps.GL13_glCompressedTexImage3D_pointer; BufferChecks.checkFunctionAddress(function_pointer); GLChecks.ensureUnpackPBOdisabled(caps); BufferChecks.checkDirect(data); - nglCompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data, data.position(), function_pointer); + nglCompressedTexImage3D(target, level, internalformat, width, height, depth, border, (data.remaining()), data, data.position(), function_pointer); } - public static void glCompressedTexImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, DoubleBuffer data) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.GL13_glCompressedTexImage3D_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(data); - nglCompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data, data.position() << 3, function_pointer); - } - public static void glCompressedTexImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, FloatBuffer data) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.GL13_glCompressedTexImage3D_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(data); - nglCompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data, data.position() << 2, function_pointer); - } - public static void glCompressedTexImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, IntBuffer data) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.GL13_glCompressedTexImage3D_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(data); - nglCompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data, data.position() << 2, function_pointer); - } - public static void glCompressedTexImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, ShortBuffer data) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.GL13_glCompressedTexImage3D_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(data); - nglCompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data, data.position() << 1, function_pointer); - } - private static native void nglCompressedTexImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, Buffer data, int data_position, long function_pointer); + private static native void nglCompressedTexImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, ByteBuffer data, int data_position, long function_pointer); public static void glCompressedTexImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, long data_buffer_offset) { ContextCapabilities caps = GLContext.getCapabilities(); long function_pointer = caps.GL13_glCompressedTexImage3D_pointer; @@ -274,47 +178,15 @@ } private static native void nglCompressedTexImage3DBO(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, long data_buffer_offset, long function_pointer); - public static void glCompressedTexSubImage1D(int target, int level, int xoffset, int width, int format, int imageSize, ByteBuffer data) { + public static void glCompressedTexSubImage1D(int target, int level, int xoffset, int width, int format, ByteBuffer data) { ContextCapabilities caps = GLContext.getCapabilities(); long function_pointer = caps.GL13_glCompressedTexSubImage1D_pointer; BufferChecks.checkFunctionAddress(function_pointer); GLChecks.ensureUnpackPBOdisabled(caps); BufferChecks.checkDirect(data); - nglCompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, data, data.position(), function_pointer); + nglCompressedTexSubImage1D(target, level, xoffset, width, format, (data.remaining()), data, data.position(), function_pointer); } - public static void glCompressedTexSubImage1D(int target, int level, int xoffset, int width, int format, int imageSize, DoubleBuffer data) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.GL13_glCompressedTexSubImage1D_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(data); - nglCompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, data, data.position() << 3, function_pointer); - } - public static void glCompressedTexSubImage1D(int target, int level, int xoffset, int width, int format, int imageSize, FloatBuffer data) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.GL13_glCompressedTexSubImage1D_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(data); - nglCompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, data, data.position() << 2, function_pointer); - } - public static void glCompressedTexSubImage1D(int target, int level, int xoffset, int width, int format, int imageSize, IntBuffer data) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.GL13_glCompressedTexSubImage1D_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(data); - nglCompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, data, data.position() << 2, function_pointer); - } - public static void glCompressedTexSubImage1D(int target, int level, int xoffset, int width, int format, int imageSize, ShortBuffer data) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.GL13_glCompressedTexSubImage1D_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(data); - nglCompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, data, data.position() << 1, function_pointer); - } - private static native void nglCompressedTexSubImage1D(int target, int level, int xoffset, int width, int format, int imageSize, Buffer data, int data_position, long function_pointer); + private static native void nglCompressedTexSubImage1D(int target, int level, int xoffset, int width, int format, int imageSize, ByteBuffer data, int data_position, long function_pointer); public static void glCompressedTexSubImage1D(int target, int level, int xoffset, int width, int format, int imageSize, long data_buffer_offset) { ContextCapabilities caps = GLContext.getCapabilities(); long function_pointer = caps.GL13_glCompressedTexSubImage1D_pointer; @@ -324,47 +196,15 @@ } private static native void nglCompressedTexSubImage1DBO(int target, int level, int xoffset, int width, int format, int imageSize, long data_buffer_offset, long function_pointer); - public static void glCompressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, ByteBuffer data) { + public static void glCompressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, ByteBuffer data) { ContextCapabilities caps = GLContext.getCapabilities(); long function_pointer = caps.GL13_glCompressedTexSubImage2D_pointer; BufferChecks.checkFunctionAddress(function_pointer); GLChecks.ensureUnpackPBOdisabled(caps); BufferChecks.checkDirect(data); - nglCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data, data.position(), function_pointer); + nglCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, (data.remaining()), data, data.position(), function_pointer); } - public static void glCompressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, DoubleBuffer data) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.GL13_glCompressedTexSubImage2D_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(data); - nglCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data, data.position() << 3, function_pointer); - } - public static void glCompressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, FloatBuffer data) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.GL13_glCompressedTexSubImage2D_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(data); - nglCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data, data.position() << 2, function_pointer); - } - public static void glCompressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, IntBuffer data) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.GL13_glCompressedTexSubImage2D_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(data); - nglCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data, data.position() << 2, function_pointer); - } - public static void glCompressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, ShortBuffer data) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.GL13_glCompressedTexSubImage2D_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(data); - nglCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data, data.position() << 1, function_pointer); - } - private static native void nglCompressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, Buffer data, int data_position, long function_pointer); + private static native void nglCompressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, ByteBuffer data, int data_position, long function_pointer); public static void glCompressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, long data_buffer_offset) { ContextCapabilities caps = GLContext.getCapabilities(); long function_pointer = caps.GL13_glCompressedTexSubImage2D_pointer; @@ -374,47 +214,15 @@ } private static native void nglCompressedTexSubImage2DBO(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, long data_buffer_offset, long function_pointer); - public static void glCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, ByteBuffer data) { + public static void glCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, ByteBuffer data) { ContextCapabilities caps = GLContext.getCapabilities(); long function_pointer = caps.GL13_glCompressedTexSubImage3D_pointer; BufferChecks.checkFunctionAddress(function_pointer); GLChecks.ensureUnpackPBOdisabled(caps); BufferChecks.checkDirect(data); - nglCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data, data.position(), function_pointer); + nglCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, (data.remaining()), data, data.position(), function_pointer); } - public static void glCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, DoubleBuffer data) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.GL13_glCompressedTexSubImage3D_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(data); - nglCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data, data.position() << 3, function_pointer); - } - public static void glCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, FloatBuffer data) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.GL13_glCompressedTexSubImage3D_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(data); - nglCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data, data.position() << 2, function_pointer); - } - public static void glCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, IntBuffer data) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.GL13_glCompressedTexSubImage3D_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(data); - nglCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data, data.position() << 2, function_pointer); - } - public static void glCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, ShortBuffer data) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.GL13_glCompressedTexSubImage3D_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - GLChecks.ensureUnpackPBOdisabled(caps); - BufferChecks.checkDirect(data); - nglCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data, data.position() << 1, function_pointer); - } - private static native void nglCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, Buffer data, int data_position, long function_pointer); + private static native void nglCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, ByteBuffer data, int data_position, long function_pointer); public static void glCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, long data_buffer_offset) { ContextCapabilities caps = GLContext.getCapabilities(); long function_pointer = caps.GL13_glCompressedTexSubImage3D_pointer; Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_texture_compression.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_texture_compression.java 2006-11-27 23:01:01 UTC (rev 2684) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_texture_compression.java 2006-11-27 23:04:37 UTC (rev 2685) @@ -48,72 +48,51 @@ int GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB = 0x86A2; int GL_COMPRESSED_TEXTURE_FORMATS_ARB = 0x86A3; - void glCompressedTexImage1DARB(@GLenum int target, int level, @GLenum int internalformat, @GLsizei int width, int border, @GLsizei int imageSize, + void glCompressedTexImage1DARB(@GLenum int target, int level, @GLenum int internalformat, @GLsizei int width, int border, @AutoSize("pData") @GLsizei int imageSize, @BufferObject(BufferKind.UnpackPBO) @Check @Const - @GLbyte - @GLshort - @GLint - @GLfloat - @GLdouble Buffer pData); + @GLvoid + ByteBuffer pData); - void glCompressedTexImage2DARB(@GLenum int target, int level, @GLenum int internalformat, @GLsizei int width, @GLsizei int height, int border, @GLsizei int imageSize, + void glCompressedTexImage2DARB(@GLenum int target, int level, @GLenum int internalformat, @GLsizei int width, @GLsizei int height, int border, @AutoSize("pData") @GLsizei int imageSize, @BufferObject(BufferKind.UnpackPBO) @Check @Const - @GLbyte - @GLshort - @GLint - @GLfloat - @GLdouble Buffer pData); + @GLvoid + ByteBuffer pData); - void glCompressedTexImage3DARB(@GLenum int target, int level, @GLenum int internalformat, @GLsizei int width, @GLsizei int height, @GLsizei int depth, int border, @GLsizei int imageSize, + void glCompressedTexImage3DARB(@GLenum int target, int level, @GLenum int internalformat, @GLsizei int width, @GLsizei int height, @GLsizei int depth, int border, @AutoSize("pData") @GLsizei int imageSize, @BufferObject(BufferKind.UnpackPBO) @Check @Const - @GLbyte - @GLshort - @GLint - @GLfloat - @GLdouble Buffer pData); + @GLvoid + ByteBuffer pData); - void glCompressedTexSubImage1DARB(@GLenum int target, int level, int xoffset, @GLsizei int width, @GLenum int format, @GLsizei int imageSize, + void glCompressedTexSubImage1DARB(@GLenum int target, int level, int xoffset, @GLsizei int width, @GLenum int format, @AutoSize("pData") @GLsizei int imageSize, @BufferObject(BufferKind.UnpackPBO) @Check @Const - @GLbyte - @GLshort - @GLint - @GLfloat - @GLdouble Buffer pData); + @GLvoid + ByteBuffer pData); - void glCompressedTexSubImage2DARB(@GLenum int target, int level, int xoffset, int yoffset, @GLsizei int width, @GLsizei int height, @GLenum int format, @GLsizei int imageSize, + void glCompressedTexSubImage2DARB(@GLenum int target, int level, int xoffset, int yoffset, @GLsizei int width, @GLsizei int height, @GLenum int format, @AutoSize("pData") @GLsizei int imageSize, @BufferObject(BufferKind.UnpackPBO) @Check @Const - @GLbyte - @GLshort - @GLint - @GLfloat - @GLdouble Buffer pData); + @GLvoid + ByteBuffer pData); - void glCompressedTexSubImage3DARB(@GLenum int target, int level, int xoffset, int yoffset, int zoffset, @GLsizei int width, @GLsizei int height, @GLsizei int depth, @GLenum int format, @GLsizei int imageSize, + void glCompressedTexSubImage3DARB(@GLenum int target, int level, int xoffset, int yoffset, int zoffset, @GLsizei int width, @GLsizei int height, @GLsizei int depth, @GLenum int format, @AutoSize("pData") @GLsizei int imageSize, @BufferObject(BufferKind.UnpackPBO) @Check @Const - @GLbyte - @GLshort - @GLint - @GLfloat - @GLdouble Buffer pData); + @GLvoid + ByteBuffer pData); void glGetCompressedTexImageARB(@GLenum int target, int lod, @BufferObject(BufferKind.PackPBO) @Check - @GLbyte - @GLshort - @GLint - @GLfloat - @GLdouble Buffer pImg); + @GLvoid + ByteBuffer pImg); } Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/GL13.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/GL13.java 2006-11-27 23:01:01 UTC (rev 2684) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/GL13.java 2006-11-27 23:04:37 UTC (rev 2685) @@ -150,65 +150,47 @@ void glClientActiveTexture(@GLenum int texture); - void glCompressedTexImage1D(@GLenum int target, int level, @GLenum int internalformat, @GLsizei int width, int border, @GLsizei int imageSize, + void glCompressedTexImage1D(@GLenum int target, int level, @GLenum int internalformat, @GLsizei int width, int border, @AutoSize("data") @GLsizei int imageSize, @BufferObject(BufferKind.UnpackPBO) @Check @Const - @GLbyte - @GLshort - @GLint - @GLfloat - @GLdouble Buffer data); + @GLvoid + Buffer data); - void glCompressedTexImage2D(@GLenum int target, int level,... [truncated message content] |
From: <eli...@us...> - 2006-12-20 17:55:12
|
Revision: 2696 http://svn.sourceforge.net/java-game-lib/?rev=2696&view=rev Author: elias_naur Date: 2006-12-20 09:55:10 -0800 (Wed, 20 Dec 2006) Log Message: ----------- Check cached buffer results in OpenGL functions for matching capacity Modified Paths: -------------- trunk/LWJGL/src/native/common/common_tools.h trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_buffer_object.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ATI_map_object_buffer.java trunk/LWJGL/src/templates/org/lwjgl/opengl/GL15.java Modified: trunk/LWJGL/src/native/common/common_tools.h =================================================================== --- trunk/LWJGL/src/native/common/common_tools.h 2006-12-18 18:27:15 UTC (rev 2695) +++ trunk/LWJGL/src/native/common/common_tools.h 2006-12-20 17:55:10 UTC (rev 2696) @@ -89,7 +89,8 @@ static inline jobject safeNewBufferCached(JNIEnv *env, void *p, int size, jobject old_buffer) { if (old_buffer != NULL) { void *old_buffer_address = (*env)->GetDirectBufferAddress(env, old_buffer); - if (old_buffer_address == p) + jlong capacity = (*env)->GetDirectBufferCapacity(env, old_buffer); + if (old_buffer_address == p && capacity == size) return old_buffer; } return safeNewBuffer(env, p, size); Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_buffer_object.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_buffer_object.java 2006-12-18 18:27:15 UTC (rev 2695) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_buffer_object.java 2006-12-20 17:55:10 UTC (rev 2696) @@ -110,7 +110,7 @@ * ByteBuffer mapped_buffer; mapped_buffer = glMapBufferARB(..., ..., ..., null); ... // Another map on the same buffer mapped_buffer = glMapBufferARB(..., ..., ..., mapped_buffer); * * @param result_size The size of the buffer area. - * @param old_buffer A ByteBuffer. If this argument points to the same address as the new mapping, it will be returned and no new buffer will be created. In that case, size is ignored. + * @param old_buffer A ByteBuffer. If this argument points to the same address and has the same capacity as the new mapping, it will be returned and no new buffer will be created. * * @return A ByteBuffer representing the mapped buffer memory. */ Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/ATI_map_object_buffer.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/ATI_map_object_buffer.java 2006-12-18 18:27:15 UTC (rev 2695) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/ATI_map_object_buffer.java 2006-12-20 17:55:10 UTC (rev 2696) @@ -44,9 +44,8 @@ * new ByteBuffer is created. * * @param result_size The size of the buffer area. - * @param old_buffer A ByteBuffer. If this argument points to the same address as the new mapping, - * it will be returned and no new buffer will be created. In that case, size is - * ignored. + * @param old_buffer A ByteBuffer. If this argument points to the same address and has the same capacity as the new mapping, + * it will be returned and no new buffer will be created. * * @return A ByteBuffer representing the mapped object buffer memory. */ Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/GL15.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/GL15.java 2006-12-18 18:27:15 UTC (rev 2695) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/GL15.java 2006-12-20 17:55:10 UTC (rev 2696) @@ -116,8 +116,8 @@ * mapped_buffer = glMapBuffer(..., ..., ..., mapped_buffer); * * @param result_size The size of the buffer area. - * @param old_buffer A ByteBuffer. If this argument points to the same address as the new mapping, it will be returned and no - * new buffer will be created. In that case, size is ignored. + * @param old_buffer A ByteBuffer. If this argument points to the same address and has the same capacity as the new mapping, it will be returned and no + * new buffer will be created. * * @return A ByteBuffer representing the mapped buffer memory. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2006-12-20 19:23:36
|
Revision: 2700 http://svn.sourceforge.net/java-game-lib/?rev=2700&view=rev Author: elias_naur Date: 2006-12-20 11:23:35 -0800 (Wed, 20 Dec 2006) Log Message: ----------- Commit changes in automatically generated files Modified Paths: -------------- trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBBufferObject.java trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBVertexProgram.java trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBVertexShader.java trunk/LWJGL/src/generated/org/lwjgl/opengl/ATIMapObjectBuffer.java trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTVertexShader.java trunk/LWJGL/src/generated/org/lwjgl/opengl/GL11.java trunk/LWJGL/src/generated/org/lwjgl/opengl/GL15.java trunk/LWJGL/src/generated/org/lwjgl/opengl/GL20.java trunk/LWJGL/src/generated/org/lwjgl/opengl/NVTransformFeedback.java trunk/LWJGL/src/generated/org/lwjgl/opengl/NVVertexArrayRange.java trunk/LWJGL/src/generated/org/lwjgl/opengl/NVVertexProgram.java trunk/LWJGL/src/native/generated/org_lwjgl_opengl_ARBBufferObject.c trunk/LWJGL/src/native/generated/org_lwjgl_opengl_ARBVertexProgram.c trunk/LWJGL/src/native/generated/org_lwjgl_opengl_ARBVertexShader.c trunk/LWJGL/src/native/generated/org_lwjgl_opengl_ATIMapObjectBuffer.c trunk/LWJGL/src/native/generated/org_lwjgl_opengl_EXTVertexShader.c trunk/LWJGL/src/native/generated/org_lwjgl_opengl_GL11.c trunk/LWJGL/src/native/generated/org_lwjgl_opengl_GL15.c trunk/LWJGL/src/native/generated/org_lwjgl_opengl_GL20.c trunk/LWJGL/src/native/generated/org_lwjgl_opengl_NVTransformFeedback.c trunk/LWJGL/src/native/generated/org_lwjgl_opengl_NVVertexArrayRange.c trunk/LWJGL/src/native/generated/org_lwjgl_opengl_NVVertexProgram.c Modified: trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBBufferObject.java =================================================================== --- trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBBufferObject.java 2006-12-20 19:22:33 UTC (rev 2699) +++ trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBBufferObject.java 2006-12-20 19:23:35 UTC (rev 2700) @@ -195,19 +195,19 @@ * <p/> * ByteBuffer mapped_buffer; mapped_buffer = glMapBufferARB(..., ..., ..., null); ... // Another map on the same buffer mapped_buffer = glMapBufferARB(..., ..., ..., mapped_buffer); * @param result_size The size of the buffer area. - * @param old_buffer A ByteBuffer. If this argument points to the same address as the new mapping, it will be returned and no new buffer will be created. In that case, size is ignored. + * @param old_buffer A ByteBuffer. If this argument points to the same address and has the same capacity as the new mapping, it will be returned and no new buffer will be created. * @return A ByteBuffer representing the mapped buffer memory. */ - public static java.nio.ByteBuffer glMapBufferARB(int target, int access, int result_size, java.nio.ByteBuffer old_buffer) { + public static java.nio.ByteBuffer glMapBufferARB(int target, int access, java.nio.ByteBuffer old_buffer) { ContextCapabilities caps = GLContext.getCapabilities(); long function_pointer = caps.ARB_buffer_object_glMapBufferARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); if (old_buffer != null) BufferChecks.checkDirect(old_buffer); - java.nio.ByteBuffer __result = nglMapBufferARB(target, access, result_size, old_buffer, function_pointer); + java.nio.ByteBuffer __result = nglMapBufferARB(target, access, GLChecks.getBufferObjectSizeARB(caps, target), old_buffer, function_pointer); return __result; } - private static native java.nio.ByteBuffer nglMapBufferARB(int target, int access, int result_size, java.nio.ByteBuffer old_buffer, long function_pointer); + private static native java.nio.ByteBuffer nglMapBufferARB(int target, int access, long result_size, java.nio.ByteBuffer old_buffer, long function_pointer); public static boolean glUnmapBufferARB(int target) { ContextCapabilities caps = GLContext.getCapabilities(); @@ -227,12 +227,12 @@ } private static native void nglGetBufferParameterivARB(int target, int pname, IntBuffer params, int params_position, long function_pointer); - public static java.nio.ByteBuffer glGetBufferPointerARB(int target, int pname, int result_size) { + public static java.nio.ByteBuffer glGetBufferPointerARB(int target, int pname) { ContextCapabilities caps = GLContext.getCapabilities(); long function_pointer = caps.ARB_buffer_object_glGetBufferPointervARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); - java.nio.ByteBuffer __result = nglGetBufferPointervARB(target, pname, result_size, function_pointer); + java.nio.ByteBuffer __result = nglGetBufferPointervARB(target, pname, GLChecks.getBufferObjectSizeARB(caps, target), function_pointer); return __result; } - private static native java.nio.ByteBuffer nglGetBufferPointervARB(int target, int pname, int result_size, long function_pointer); + private static native java.nio.ByteBuffer nglGetBufferPointervARB(int target, int pname, long result_size, long function_pointer); } Modified: trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBVertexProgram.java =================================================================== --- trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBVertexProgram.java 2006-12-20 19:22:33 UTC (rev 2699) +++ trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBVertexProgram.java 2006-12-20 19:23:35 UTC (rev 2700) @@ -256,12 +256,12 @@ } private static native void nglGetVertexAttribivARB(int index, int pname, IntBuffer params, int params_position, long function_pointer); - public static java.nio.ByteBuffer glGetVertexAttribPointerARB(int index, int pname, int result_size) { + public static java.nio.ByteBuffer glGetVertexAttribPointerARB(int index, int pname, long result_size) { ContextCapabilities caps = GLContext.getCapabilities(); long function_pointer = caps.ARB_vertex_program_glGetVertexAttribPointervARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); java.nio.ByteBuffer __result = nglGetVertexAttribPointervARB(index, pname, result_size, function_pointer); return __result; } - private static native java.nio.ByteBuffer nglGetVertexAttribPointervARB(int index, int pname, int result_size, long function_pointer); + private static native java.nio.ByteBuffer nglGetVertexAttribPointervARB(int index, int pname, long result_size, long function_pointer); } Modified: trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBVertexShader.java =================================================================== --- trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBVertexShader.java 2006-12-20 19:22:33 UTC (rev 2699) +++ trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBVertexShader.java 2006-12-20 19:23:35 UTC (rev 2700) @@ -299,12 +299,12 @@ } private static native void nglGetVertexAttribivARB(int index, int pname, IntBuffer params, int params_position, long function_pointer); - public static java.nio.ByteBuffer glGetVertexAttribPointerARB(int index, int pname, int result_size) { + public static java.nio.ByteBuffer glGetVertexAttribPointerARB(int index, int pname, long result_size) { ContextCapabilities caps = GLContext.getCapabilities(); long function_pointer = caps.ARB_vertex_shader_glGetVertexAttribPointervARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); java.nio.ByteBuffer __result = nglGetVertexAttribPointervARB(index, pname, result_size, function_pointer); return __result; } - private static native java.nio.ByteBuffer nglGetVertexAttribPointervARB(int index, int pname, int result_size, long function_pointer); + private static native java.nio.ByteBuffer nglGetVertexAttribPointervARB(int index, int pname, long result_size, long function_pointer); } Modified: trunk/LWJGL/src/generated/org/lwjgl/opengl/ATIMapObjectBuffer.java =================================================================== --- trunk/LWJGL/src/generated/org/lwjgl/opengl/ATIMapObjectBuffer.java 2006-12-20 19:22:33 UTC (rev 2699) +++ trunk/LWJGL/src/generated/org/lwjgl/opengl/ATIMapObjectBuffer.java 2006-12-20 19:23:35 UTC (rev 2700) @@ -18,12 +18,11 @@ * oldBuffer is non-null, it will be returned if it points to the same mapped memory, otherwise a * new ByteBuffer is created. * @param result_size The size of the buffer area. - * @param old_buffer A ByteBuffer. If this argument points to the same address as the new mapping, - * it will be returned and no new buffer will be created. In that case, size is - * ignored. + * @param old_buffer A ByteBuffer. If this argument points to the same address and has the same capacity as the new mapping, + * it will be returned and no new buffer will be created. * @return A ByteBuffer representing the mapped object buffer memory. */ - public static java.nio.ByteBuffer glMapObjectBufferATI(int buffer, int result_size, java.nio.ByteBuffer old_buffer) { + public static java.nio.ByteBuffer glMapObjectBufferATI(int buffer, long result_size, java.nio.ByteBuffer old_buffer) { ContextCapabilities caps = GLContext.getCapabilities(); long function_pointer = caps.ATI_map_object_buffer_glMapObjectBufferATI_pointer; BufferChecks.checkFunctionAddress(function_pointer); @@ -32,7 +31,7 @@ java.nio.ByteBuffer __result = nglMapObjectBufferATI(buffer, result_size, old_buffer, function_pointer); return __result; } - private static native java.nio.ByteBuffer nglMapObjectBufferATI(int buffer, int result_size, java.nio.ByteBuffer old_buffer, long function_pointer); + private static native java.nio.ByteBuffer nglMapObjectBufferATI(int buffer, long result_size, java.nio.ByteBuffer old_buffer, long function_pointer); public static void glUnmapObjectBufferATI(int buffer) { ContextCapabilities caps = GLContext.getCapabilities(); Modified: trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTVertexShader.java =================================================================== --- trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTVertexShader.java 2006-12-20 19:22:33 UTC (rev 2699) +++ trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTVertexShader.java 2006-12-20 19:23:35 UTC (rev 2700) @@ -526,14 +526,14 @@ } private static native void nglGetVariantFloatvEXT(int id, int value, FloatBuffer pbData, int pbData_position, long function_pointer); - public static java.nio.ByteBuffer glGetVariantPointerEXT(int id, int value, int result_size) { + public static java.nio.ByteBuffer glGetVariantPointerEXT(int id, int value, long result_size) { ContextCapabilities caps = GLContext.getCapabilities(); long function_pointer = caps.EXT_vertex_shader_glGetVariantPointervEXT_pointer; BufferChecks.checkFunctionAddress(function_pointer); java.nio.ByteBuffer __result = nglGetVariantPointervEXT(id, value, result_size, function_pointer); return __result; } - private static native java.nio.ByteBuffer nglGetVariantPointervEXT(int id, int value, int result_size, long function_pointer); + private static native java.nio.ByteBuffer nglGetVariantPointervEXT(int id, int value, long result_size, long function_pointer); public static void glGetInvariantBooleanEXT(int id, int value, ByteBuffer pbData) { ContextCapabilities caps = GLContext.getCapabilities(); Modified: trunk/LWJGL/src/generated/org/lwjgl/opengl/GL11.java =================================================================== --- trunk/LWJGL/src/generated/org/lwjgl/opengl/GL11.java 2006-12-20 19:22:33 UTC (rev 2699) +++ trunk/LWJGL/src/generated/org/lwjgl/opengl/GL11.java 2006-12-20 19:23:35 UTC (rev 2700) @@ -1396,14 +1396,14 @@ } private static native void nglFinish(long function_pointer); - public static java.nio.ByteBuffer glGetPointer(int pname, int result_size) { + public static java.nio.ByteBuffer glGetPointer(int pname, long result_size) { ContextCapabilities caps = GLContext.getCapabilities(); long function_pointer = caps.GL11_glGetPointerv_pointer; BufferChecks.checkFunctionAddress(function_pointer); java.nio.ByteBuffer __result = nglGetPointerv(pname, result_size, function_pointer); return __result; } - private static native java.nio.ByteBuffer nglGetPointerv(int pname, int result_size, long function_pointer); + private static native java.nio.ByteBuffer nglGetPointerv(int pname, long result_size, long function_pointer); public static boolean glIsEnabled(int cap) { ContextCapabilities caps = GLContext.getCapabilities(); Modified: trunk/LWJGL/src/generated/org/lwjgl/opengl/GL15.java =================================================================== --- trunk/LWJGL/src/generated/org/lwjgl/opengl/GL15.java 2006-12-20 19:22:33 UTC (rev 2699) +++ trunk/LWJGL/src/generated/org/lwjgl/opengl/GL15.java 2006-12-20 19:23:35 UTC (rev 2700) @@ -220,20 +220,20 @@ * ByteBuffer mapped_buffer; mapped_buffer = glMapBuffer(..., ..., ..., null); ... // Another map on the same buffer * mapped_buffer = glMapBuffer(..., ..., ..., mapped_buffer); * @param result_size The size of the buffer area. - * @param old_buffer A ByteBuffer. If this argument points to the same address as the new mapping, it will be returned and no - * new buffer will be created. In that case, size is ignored. + * @param old_buffer A ByteBuffer. If this argument points to the same address and has the same capacity as the new mapping, it will be returned and no + * new buffer will be created. * @return A ByteBuffer representing the mapped buffer memory. */ - public static java.nio.ByteBuffer glMapBuffer(int target, int access, int result_size, java.nio.ByteBuffer old_buffer) { + public static java.nio.ByteBuffer glMapBuffer(int target, int access, java.nio.ByteBuffer old_buffer) { ContextCapabilities caps = GLContext.getCapabilities(); long function_pointer = caps.GL15_glMapBuffer_pointer; BufferChecks.checkFunctionAddress(function_pointer); if (old_buffer != null) BufferChecks.checkDirect(old_buffer); - java.nio.ByteBuffer __result = nglMapBuffer(target, access, result_size, old_buffer, function_pointer); + java.nio.ByteBuffer __result = nglMapBuffer(target, access, GLChecks.getBufferObjectSize(caps, target), old_buffer, function_pointer); return __result; } - private static native java.nio.ByteBuffer nglMapBuffer(int target, int access, int result_size, java.nio.ByteBuffer old_buffer, long function_pointer); + private static native java.nio.ByteBuffer nglMapBuffer(int target, int access, long result_size, java.nio.ByteBuffer old_buffer, long function_pointer); public static boolean glUnmapBuffer(int target) { ContextCapabilities caps = GLContext.getCapabilities(); @@ -253,14 +253,14 @@ } private static native void nglGetBufferParameteriv(int target, int pname, IntBuffer params, int params_position, long function_pointer); - public static java.nio.ByteBuffer glGetBufferPointer(int target, int pname, int result_size) { + public static java.nio.ByteBuffer glGetBufferPointer(int target, int pname) { ContextCapabilities caps = GLContext.getCapabilities(); long function_pointer = caps.GL15_glGetBufferPointerv_pointer; BufferChecks.checkFunctionAddress(function_pointer); - java.nio.ByteBuffer __result = nglGetBufferPointerv(target, pname, result_size, function_pointer); + java.nio.ByteBuffer __result = nglGetBufferPointerv(target, pname, GLChecks.getBufferObjectSize(caps, target), function_pointer); return __result; } - private static native java.nio.ByteBuffer nglGetBufferPointerv(int target, int pname, int result_size, long function_pointer); + private static native java.nio.ByteBuffer nglGetBufferPointerv(int target, int pname, long result_size, long function_pointer); public static void glGenQueries(IntBuffer ids) { ContextCapabilities caps = GLContext.getCapabilities(); Modified: trunk/LWJGL/src/generated/org/lwjgl/opengl/GL20.java =================================================================== --- trunk/LWJGL/src/generated/org/lwjgl/opengl/GL20.java 2006-12-20 19:22:33 UTC (rev 2699) +++ trunk/LWJGL/src/generated/org/lwjgl/opengl/GL20.java 2006-12-20 19:23:35 UTC (rev 2700) @@ -757,14 +757,14 @@ } private static native void nglGetVertexAttribiv(int index, int pname, IntBuffer params, int params_position, long function_pointer); - public static java.nio.ByteBuffer glGetVertexAttribPointer(int index, int pname, int result_size) { + public static java.nio.ByteBuffer glGetVertexAttribPointer(int index, int pname, long result_size) { ContextCapabilities caps = GLContext.getCapabilities(); long function_pointer = caps.GL20_glGetVertexAttribPointerv_pointer; BufferChecks.checkFunctionAddress(function_pointer); java.nio.ByteBuffer __result = nglGetVertexAttribPointerv(index, pname, result_size, function_pointer); return __result; } - private static native java.nio.ByteBuffer nglGetVertexAttribPointerv(int index, int pname, int result_size, long function_pointer); + private static native java.nio.ByteBuffer nglGetVertexAttribPointerv(int index, int pname, long result_size, long function_pointer); public static void glBindAttribLocation(int program, int index, ByteBuffer name) { ContextCapabilities caps = GLContext.getCapabilities(); Modified: trunk/LWJGL/src/generated/org/lwjgl/opengl/NVTransformFeedback.java =================================================================== --- trunk/LWJGL/src/generated/org/lwjgl/opengl/NVTransformFeedback.java 2006-12-20 19:22:33 UTC (rev 2699) +++ trunk/LWJGL/src/generated/org/lwjgl/opengl/NVTransformFeedback.java 2006-12-20 19:23:35 UTC (rev 2700) @@ -1,181 +1,181 @@ -/* MACHINE GENERATED FILE, DO NOT EDIT */ - -package org.lwjgl.opengl; - -import org.lwjgl.LWJGLException; -import org.lwjgl.BufferChecks; -import java.nio.*; - -public final class NVTransformFeedback { - /** - * Accepted by the <target> parameters of BindBuffer, BufferData, - * BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, - * GetBufferPointerv, BindBufferRangeNV, BindBufferOffsetNV and - * BindBufferBaseNV: - */ - public static final int GL_TRANSFORM_FEEDBACK_BUFFER_NV = 0x8c8e; - /** - * Accepted by the <param> parameter of GetIntegerIndexedvEXT and - * GetBooleanIndexedvEXT: - */ - public static final int GL_TRANSFORM_FEEDBACK_BUFFER_START_NV = 0x8c84; - public static final int GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV = 0x8c85; - public static final int GL_TRANSFORM_FEEDBACK_RECORD_NV = 0x8c86; - /** - * Accepted by the <param> parameter of GetIntegerIndexedvEXT and - * GetBooleanIndexedvEXT, and by the <pname> parameter of GetBooleanv, - * GetDoublev, GetIntegerv, and GetFloatv: - */ - public static final int GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV = 0x8c8f; - /** - * Accepted by the <bufferMode> parameter of TransformFeedbackAttribsNV and - * TransformFeedbackVaryingsNV: - */ - public static final int GL_INTERLEAVED_ATTRIBS_NV = 0x8c8c; - public static final int GL_SEPARATE_ATTRIBS_NV = 0x8c8d; - /** - * Accepted by the <target> parameter of BeginQuery, EndQuery, and - * GetQueryiv: - */ - public static final int GL_PRIMITIVES_GENERATED_NV = 0x8c87; - public static final int GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV = 0x8c88; - /** - * Accepted by the <cap> parameter of Enable, Disable, and IsEnabled, and by - * the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and - * GetDoublev: - */ - public static final int GL_RASTERIZER_DISCARD_NV = 0x8c89; - /** - * Accepted by the <pname> parameter of GetBooleanv, GetDoublev, GetIntegerv, - * and GetFloatv: - */ - public static final int GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV = 0x8c8a; - public static final int GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV = 0x8c8b; - public static final int GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV = 0x8c80; - public static final int GL_TRANSFORM_FEEDBACK_ATTRIBS_NV = 0x8c7e; - /** - *Accepted by the <pname> parameter of GetProgramiv: - */ - public static final int GL_ACTIVE_VARYINGS_NV = 0x8c81; - public static final int GL_ACTIVE_VARYING_MAX_LENGTH_NV = 0x8c82; - public static final int GL_TRANSFORM_FEEDBACK_VARYINGS_NV = 0x8c83; - /** - * Accepted by the <pname> parameter of GetBooleanv, GetDoublev, GetIntegerv, - * GetFloatv, and GetProgramiv: - */ - public static final int GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV = 0x8c7f; - /** - *Accepted by the <attribs> parameter of TransformFeedbackAttribsNV: - */ - public static final int GL_BACK_PRIMARY_COLOR_NV = 0x8c77; - public static final int GL_BACK_SECONDARY_COLOR_NV = 0x8c78; - public static final int GL_TEXTURE_COORD_NV = 0x8c79; - public static final int GL_CLIP_DISTANCE_NV = 0x8c7a; - public static final int GL_VERTEX_ID_NV = 0x8c7b; - public static final int GL_PRIMITIVE_ID_NV = 0x8c7c; - public static final int GL_GENERIC_ATTRIB_NV = 0x8c7d; - - private NVTransformFeedback() { - } - - - public static void glBindBufferRangeNV(int target, int index, int buffer, long offset, long size) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.NV_transform_feedback_glBindBufferRangeNV_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - nglBindBufferRangeNV(target, index, buffer, offset, size, function_pointer); - } - private static native void nglBindBufferRangeNV(int target, int index, int buffer, long offset, long size, long function_pointer); - - public static void glBindBufferOffsetNV(int target, int index, int buffer, long offset) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.NV_transform_feedback_glBindBufferOffsetNV_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - nglBindBufferOffsetNV(target, index, buffer, offset, function_pointer); - } - private static native void nglBindBufferOffsetNV(int target, int index, int buffer, long offset, long function_pointer); - - public static void glBindBufferBaseNV(int target, int index, int buffer) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.NV_transform_feedback_glBindBufferBaseNV_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - nglBindBufferBaseNV(target, index, buffer, function_pointer); - } - private static native void nglBindBufferBaseNV(int target, int index, int buffer, long function_pointer); - - public static void glTransformFeedbackAttribsNV(IntBuffer attribs, int bufferMode) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.NV_transform_feedback_glTransformFeedbackAttribsNV_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - BufferChecks.checkDirect(attribs); - nglTransformFeedbackAttribsNV((attribs.remaining()), attribs, attribs.position(), bufferMode, function_pointer); - } - private static native void nglTransformFeedbackAttribsNV(int count, IntBuffer attribs, int attribs_position, int bufferMode, long function_pointer); - - public static void glTransformFeedbackVaryingsNV(int program, IntBuffer locations, int bufferMode) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.NV_transform_feedback_glTransformFeedbackVaryingsNV_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - BufferChecks.checkDirect(locations); - nglTransformFeedbackVaryingsNV(program, (locations.remaining()), locations, locations.position(), bufferMode, function_pointer); - } - private static native void nglTransformFeedbackVaryingsNV(int program, int count, IntBuffer locations, int locations_position, int bufferMode, long function_pointer); - - public static void glBeginTransformFeedbackNV(int primitiveMode) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.NV_transform_feedback_glBeginTransformFeedbackNV_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - nglBeginTransformFeedbackNV(primitiveMode, function_pointer); - } - private static native void nglBeginTransformFeedbackNV(int primitiveMode, long function_pointer); - - public static void glEndTransformFeedbackNV() { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.NV_transform_feedback_glEndTransformFeedbackNV_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - nglEndTransformFeedbackNV(function_pointer); - } - private static native void nglEndTransformFeedbackNV(long function_pointer); - - public static int glGetVaryingLocationNV(int program, ByteBuffer name) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.NV_transform_feedback_glGetVaryingLocationNV_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - BufferChecks.checkDirect(name); - BufferChecks.checkNullTerminated(name); - int __result = nglGetVaryingLocationNV(program, name, name.position(), function_pointer); - return __result; - } - private static native int nglGetVaryingLocationNV(int program, ByteBuffer name, int name_position, long function_pointer); - - public static void glGetActiveVaryingNV(int program, int index, IntBuffer length, IntBuffer size, IntBuffer type, ByteBuffer name) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.NV_transform_feedback_glGetActiveVaryingNV_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - BufferChecks.checkBuffer(length, 1); - BufferChecks.checkBuffer(size, 1); - BufferChecks.checkBuffer(type, 1); - BufferChecks.checkDirect(name); - nglGetActiveVaryingNV(program, index, (name.remaining()), length, length.position(), size, size.position(), type, type.position(), name, name.position(), function_pointer); - } - private static native void nglGetActiveVaryingNV(int program, int index, int bufSize, IntBuffer length, int length_position, IntBuffer size, int size_position, IntBuffer type, int type_position, ByteBuffer name, int name_position, long function_pointer); - - public static void glActiveVaryingNV(int program, ByteBuffer name) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.NV_transform_feedback_glActiveVaryingNV_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - BufferChecks.checkDirect(name); - BufferChecks.checkNullTerminated(name); - nglActiveVaryingNV(program, name, name.position(), function_pointer); - } - private static native void nglActiveVaryingNV(int program, ByteBuffer name, int name_position, long function_pointer); - - public static void glGetTransformFeedbackVaryingNV(int program, int index, IntBuffer location) { - ContextCapabilities caps = GLContext.getCapabilities(); - long function_pointer = caps.NV_transform_feedback_glGetTransformFeedbackVaryingNV_pointer; - BufferChecks.checkFunctionAddress(function_pointer); - BufferChecks.checkBuffer(location, 1); - nglGetTransformFeedbackVaryingNV(program, index, location, location.position(), function_pointer); - } - private static native void nglGetTransformFeedbackVaryingNV(int program, int index, IntBuffer location, int location_position, long function_pointer); -} +/* MACHINE GENERATED FILE, DO NOT EDIT */ + +package org.lwjgl.opengl; + +import org.lwjgl.LWJGLException; +import org.lwjgl.BufferChecks; +import java.nio.*; + +public final class NVTransformFeedback { + /** + * Accepted by the <target> parameters of BindBuffer, BufferData, + * BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, + * GetBufferPointerv, BindBufferRangeNV, BindBufferOffsetNV and + * BindBufferBaseNV: + */ + public static final int GL_TRANSFORM_FEEDBACK_BUFFER_NV = 0x8c8e; + /** + * Accepted by the <param> parameter of GetIntegerIndexedvEXT and + * GetBooleanIndexedvEXT: + */ + public static final int GL_TRANSFORM_FEEDBACK_BUFFER_START_NV = 0x8c84; + public static final int GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV = 0x8c85; + public static final int GL_TRANSFORM_FEEDBACK_RECORD_NV = 0x8c86; + /** + * Accepted by the <param> parameter of GetIntegerIndexedvEXT and + * GetBooleanIndexedvEXT, and by the <pname> parameter of GetBooleanv, + * GetDoublev, GetIntegerv, and GetFloatv: + */ + public static final int GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV = 0x8c8f; + /** + * Accepted by the <bufferMode> parameter of TransformFeedbackAttribsNV and + * TransformFeedbackVaryingsNV: + */ + public static final int GL_INTERLEAVED_ATTRIBS_NV = 0x8c8c; + public static final int GL_SEPARATE_ATTRIBS_NV = 0x8c8d; + /** + * Accepted by the <target> parameter of BeginQuery, EndQuery, and + * GetQueryiv: + */ + public static final int GL_PRIMITIVES_GENERATED_NV = 0x8c87; + public static final int GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV = 0x8c88; + /** + * Accepted by the <cap> parameter of Enable, Disable, and IsEnabled, and by + * the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev: + */ + public static final int GL_RASTERIZER_DISCARD_NV = 0x8c89; + /** + * Accepted by the <pname> parameter of GetBooleanv, GetDoublev, GetIntegerv, + * and GetFloatv: + */ + public static final int GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV = 0x8c8a; + public static final int GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV = 0x8c8b; + public static final int GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV = 0x8c80; + public static final int GL_TRANSFORM_FEEDBACK_ATTRIBS_NV = 0x8c7e; + /** + *Accepted by the <pname> parameter of GetProgramiv: + */ + public static final int GL_ACTIVE_VARYINGS_NV = 0x8c81; + public static final int GL_ACTIVE_VARYING_MAX_LENGTH_NV = 0x8c82; + public static final int GL_TRANSFORM_FEEDBACK_VARYINGS_NV = 0x8c83; + /** + * Accepted by the <pname> parameter of GetBooleanv, GetDoublev, GetIntegerv, + * GetFloatv, and GetProgramiv: + */ + public static final int GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV = 0x8c7f; + /** + *Accepted by the <attribs> parameter of TransformFeedbackAttribsNV: + */ + public static final int GL_BACK_PRIMARY_COLOR_NV = 0x8c77; + public static final int GL_BACK_SECONDARY_COLOR_NV = 0x8c78; + public static final int GL_TEXTURE_COORD_NV = 0x8c79; + public static final int GL_CLIP_DISTANCE_NV = 0x8c7a; + public static final int GL_VERTEX_ID_NV = 0x8c7b; + public static final int GL_PRIMITIVE_ID_NV = 0x8c7c; + public static final int GL_GENERIC_ATTRIB_NV = 0x8c7d; + + private NVTransformFeedback() { + } + + + public static void glBindBufferRangeNV(int target, int index, int buffer, long offset, long size) { + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.NV_transform_feedback_glBindBufferRangeNV_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + nglBindBufferRangeNV(target, index, buffer, offset, size, function_pointer); + } + private static native void nglBindBufferRangeNV(int target, int index, int buffer, long offset, long size, long function_pointer); + + public static void glBindBufferOffsetNV(int target, int index, int buffer, long offset) { + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.NV_transform_feedback_glBindBufferOffsetNV_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + nglBindBufferOffsetNV(target, index, buffer, offset, function_pointer); + } + private static native void nglBindBufferOffsetNV(int target, int index, int buffer, long offset, long function_pointer); + + public static void glBindBufferBaseNV(int target, int index, int buffer) { + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.NV_transform_feedback_glBindBufferBaseNV_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + nglBindBufferBaseNV(target, index, buffer, function_pointer); + } + private static native void nglBindBufferBaseNV(int target, int index, int buffer, long function_pointer); + + public static void glTransformFeedbackAttribsNV(IntBuffer attribs, int bufferMode) { + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.NV_transform_feedback_glTransformFeedbackAttribsNV_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkDirect(attribs); + nglTransformFeedbackAttribsNV((attribs.remaining()), attribs, attribs.position(), bufferMode, function_pointer); + } + private static native void nglTransformFeedbackAttribsNV(int count, IntBuffer attribs, int attribs_position, int bufferMode, long function_pointer); + + public static void glTransformFeedbackVaryingsNV(int program, IntBuffer locations, int bufferMode) { + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.NV_transform_feedback_glTransformFeedbackVaryingsNV_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkDirect(locations); + nglTransformFeedbackVaryingsNV(program, (locations.remaining()), locations, locations.position(), bufferMode, function_pointer); + } + private static native void nglTransformFeedbackVaryingsNV(int program, int count, IntBuffer locations, int locations_position, int bufferMode, long function_pointer); + + public static void glBeginTransformFeedbackNV(int primitiveMode) { + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.NV_transform_feedback_glBeginTransformFeedbackNV_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + nglBeginTransformFeedbackNV(primitiveMode, function_pointer); + } + private static native void nglBeginTransformFeedbackNV(int primitiveMode, long function_pointer); + + public static void glEndTransformFeedbackNV() { + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.NV_transform_feedback_glEndTransformFeedbackNV_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + nglEndTransformFeedbackNV(function_pointer); + } + private static native void nglEndTransformFeedbackNV(long function_pointer); + + public static int glGetVaryingLocationNV(int program, ByteBuffer name) { + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.NV_transform_feedback_glGetVaryingLocationNV_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkDirect(name); + BufferChecks.checkNullTerminated(name); + int __result = nglGetVaryingLocationNV(program, name, name.position(), function_pointer); + return __result; + } + private static native int nglGetVaryingLocationNV(int program, ByteBuffer name, int name_position, long function_pointer); + + public static void glGetActiveVaryingNV(int program, int index, IntBuffer length, IntBuffer size, IntBuffer type, ByteBuffer name) { + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.NV_transform_feedback_glGetActiveVaryingNV_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkBuffer(length, 1); + BufferChecks.checkBuffer(size, 1); + BufferChecks.checkBuffer(type, 1); + BufferChecks.checkDirect(name); + nglGetActiveVaryingNV(program, index, (name.remaining()), length, length.position(), size, size.position(), type, type.position(), name, name.position(), function_pointer); + } + private static native void nglGetActiveVaryingNV(int program, int index, int bufSize, IntBuffer length, int length_position, IntBuffer size, int size_position, IntBuffer type, int type_position, ByteBuffer name, int name_position, long function_pointer); + + public static void glActiveVaryingNV(int program, ByteBuffer name) { + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.NV_transform_feedback_glActiveVaryingNV_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkDirect(name); + BufferChecks.checkNullTerminated(name); + nglActiveVaryingNV(program, name, name.position(), function_pointer); + } + private static native void nglActiveVaryingNV(int program, ByteBuffer name, int name_position, long function_pointer); + + public static void glGetTransformFeedbackVaryingNV(int program, int index, IntBuffer location) { + ContextCapabilities caps = GLContext.getCapabilities(); + long function_pointer = caps.NV_transform_feedback_glGetTransformFeedbackVaryingNV_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkBuffer(location, 1); + nglGetTransformFeedbackVaryingNV(program, index, location, location.position(), function_pointer); + } + private static native void nglGetTransformFeedbackVaryingNV(int program, int index, IntBuffer location, int location_position, long function_pointer); +} Modified: trunk/LWJGL/src/generated/org/lwjgl/opengl/NVVertexArrayRange.java =================================================================== --- trunk/LWJGL/src/generated/org/lwjgl/opengl/NVVertexArrayRange.java 2006-12-20 19:22:33 UTC (rev 2699) +++ trunk/LWJGL/src/generated/org/lwjgl/opengl/NVVertexArrayRange.java 2006-12-20 19:23:35 UTC (rev 2700) @@ -69,7 +69,7 @@ java.nio.ByteBuffer __result = nglAllocateMemoryNV(size, readFrequency, writeFrequency, priority, size, function_pointer); return __result; } - private static native java.nio.ByteBuffer nglAllocateMemoryNV(int size, float readFrequency, float writeFrequency, float priority, int result_size, long function_pointer); + private static native java.nio.ByteBuffer nglAllocateMemoryNV(int size, float readFrequency, float writeFrequency, float priority, long result_size, long function_pointer); public static void glFreeMemoryNV(ByteBuffer pointer) { ContextCapabilities caps = GLContext.getCapabilities(); Modified: trunk/LWJGL/src/generated/org/lwjgl/opengl/NVVertexProgram.java =================================================================== --- trunk/LWJGL/src/generated/org/lwjgl/opengl/NVVertexProgram.java 2006-12-20 19:22:33 UTC (rev 2699) +++ trunk/LWJGL/src/generated/org/lwjgl/opengl/NVVertexProgram.java 2006-12-20 19:23:35 UTC (rev 2700) @@ -214,14 +214,14 @@ } private static native void nglGetVertexAttribivNV(int index, int parameterName, IntBuffer params, int params_position, long function_pointer); - public static java.nio.ByteBuffer glGetVertexAttribPointerNV(int index, int parameterName, int result_size) { + public static java.nio.ByteBuffer glGetVertexAttribPointerNV(int index, int parameterName, long result_size) { ContextCapabilities caps = GLContext.getCapabilities(); long function_pointer = caps.NV_vertex_program_glGetVertexAttribPointervNV_pointer; BufferChecks.checkFunctionAddress(function_pointer); java.nio.ByteBuffer __result = nglGetVertexAttribPointervNV(index, parameterName, result_size, function_pointer); return __result; } - private static native java.nio.ByteBuffer nglGetVertexAttribPointervNV(int index, int parameterName, int result_size, long function_pointer); + private static native java.nio.ByteBuffer nglGetVertexAttribPointervNV(int index, int parameterName, long result_size, long function_pointer); public static void glProgramParameter4fNV(int target, int index, float x, float y, float z, float w) { ContextCapabilities caps = GLContext.getCapabilities(); Modified: trunk/LWJGL/src/native/generated/org_lwjgl_opengl_ARBBufferObject.c =================================================================== --- trunk/LWJGL/src/native/generated/org_lwjgl_opengl_ARBBufferObject.c 2006-12-20 19:22:33 UTC (rev 2699) +++ trunk/LWJGL/src/native/generated/org_lwjgl_opengl_ARBBufferObject.c 2006-12-20 19:23:35 UTC (rev 2700) @@ -56,7 +56,7 @@ glGetBufferSubDataARB(target, offset, size, data_address); } -JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_ARBBufferObject_nglMapBufferARB(JNIEnv *env, jclass clazz, jint target, jint access, jint result_size, jobject old_buffer, jlong function_pointer) { +JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_ARBBufferObject_nglMapBufferARB(JNIEnv *env, jclass clazz, jint target, jint access, jlong result_size, jobject old_buffer, jlong function_pointer) { glMapBufferARBPROC glMapBufferARB = (glMapBufferARBPROC)((intptr_t)function_pointer); GLvoid * __result = glMapBufferARB(target, access); return safeNewBufferCached(env, __result, result_size, old_buffer); @@ -74,7 +74,7 @@ glGetBufferParameterivARB(target, pname, params_address); } -JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_ARBBufferObject_nglGetBufferPointervARB(JNIEnv *env, jclass clazz, jint target, jint pname, jint result_size, jlong function_pointer) { +JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_ARBBufferObject_nglGetBufferPointervARB(JNIEnv *env, jclass clazz, jint target, jint pname, jlong result_size, jlong function_pointer) { glGetBufferPointervARBPROC glGetBufferPointervARB = (glGetBufferPointervARBPROC)((intptr_t)function_pointer); GLvoid * __result; glGetBufferPointervARB(target, pname, &__result); Modified: trunk/LWJGL/src/native/generated/org_lwjgl_opengl_ARBVertexProgram.c =================================================================== --- trunk/LWJGL/src/native/generated/org_lwjgl_opengl_ARBVertexProgram.c 2006-12-20 19:22:33 UTC (rev 2699) +++ trunk/LWJGL/src/native/generated/org_lwjgl_opengl_ARBVertexProgram.c 2006-12-20 19:23:35 UTC (rev 2700) @@ -129,7 +129,7 @@ glGetVertexAttribivARB(index, pname, params_address); } -JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_ARBVertexProgram_nglGetVertexAttribPointervARB(JNIEnv *env, jclass clazz, jint index, jint pname, jint result_size, jlong function_pointer) { +JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_ARBVertexProgram_nglGetVertexAttribPointervARB(JNIEnv *env, jclass clazz, jint index, jint pname, jlong result_size, jlong function_pointer) { glGetVertexAttribPointervARBPROC glGetVertexAttribPointervARB = (glGetVertexAttribPointervARBPROC)((intptr_t)function_pointer); GLvoid * __result; glGetVertexAttribPointervARB(index, pname, &__result); Modified: trunk/LWJGL/src/native/generated/org_lwjgl_opengl_ARBVertexShader.c =================================================================== --- trunk/LWJGL/src/native/generated/org_lwjgl_opengl_ARBVertexShader.c 2006-12-20 19:22:33 UTC (rev 2699) +++ trunk/LWJGL/src/native/generated/org_lwjgl_opengl_ARBVertexShader.c 2006-12-20 19:23:35 UTC (rev 2700) @@ -154,7 +154,7 @@ glGetVertexAttribivARB(index, pname, params_address); } -JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglGetVertexAttribPointervARB(JNIEnv *env, jclass clazz, jint index, jint pname, jint result_size, jlong function_pointer) { +JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglGetVertexAttribPointervARB(JNIEnv *env, jclass clazz, jint index, jint pname, jlong result_size, jlong function_pointer) { glGetVertexAttribPointervARBPROC glGetVertexAttribPointervARB = (glGetVertexAttribPointervARBPROC)((intptr_t)function_pointer); GLvoid * __result; glGetVertexAttribPointervARB(index, pname, &__result); Modified: trunk/LWJGL/src/native/generated/org_lwjgl_opengl_ATIMapObjectBuffer.c =================================================================== --- trunk/LWJGL/src/native/generated/org_lwjgl_opengl_ATIMapObjectBuffer.c 2006-12-20 19:22:33 UTC (rev 2699) +++ trunk/LWJGL/src/native/generated/org_lwjgl_opengl_ATIMapObjectBuffer.c 2006-12-20 19:23:35 UTC (rev 2700) @@ -6,7 +6,7 @@ typedef GLvoid * (APIENTRY *glMapObjectBufferATIPROC) (GLuint buffer); typedef void (APIENTRY *glUnmapObjectBufferATIPROC) (GLuint buffer); -JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_ATIMapObjectBuffer_nglMapObjectBufferATI(JNIEnv *env, jclass clazz, jint buffer, jint result_size, jobject old_buffer, jlong function_pointer) { +JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_ATIMapObjectBuffer_nglMapObjectBufferATI(JNIEnv *env, jclass clazz, jint buffer, jlong result_size, jobject old_buffer, jlong function_pointer) { glMapObjectBufferATIPROC glMapObjectBufferATI = (glMapObjectBufferATIPROC)((intptr_t)function_pointer); GLvoid * __result = glMapObjectBufferATI(buffer); return safeNewBufferCached(env, __result, result_size, old_buffer); Modified: trunk/LWJGL/src/native/generated/org_lwjgl_opengl_EXTVertexShader.c =================================================================== --- trunk/LWJGL/src/native/generated/org_lwjgl_opengl_EXTVertexShader.c 2006-12-20 19:22:33 UTC (rev 2699) +++ trunk/LWJGL/src/native/generated/org_lwjgl_opengl_EXTVertexShader.c 2006-12-20 19:23:35 UTC (rev 2700) @@ -249,7 +249,7 @@ glGetVariantFloatvEXT(id, value, pbData_address); } -JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_EXTVertexShader_nglGetVariantPointervEXT(JNIEnv *env, jclass clazz, jint id, jint value, jint result_size, jlong function_pointer) { +JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_EXTVertexShader_nglGetVariantPointervEXT(JNIEnv *env, jclass clazz, jint id, jint value, jlong result_size, jlong function_pointer) { glGetVariantPointervEXTPROC glGetVariantPointervEXT = (glGetVariantPointervEXTPROC)((intptr_t)function_pointer); GLvoid * __result; glGetVariantPointervEXT(id, value, &__result); Modified: trunk/LWJGL/src/native/generated/org_lwjgl_opengl_GL11.c =================================================================== --- trunk/LWJGL/src/native/generated/org_lwjgl_opengl_GL11.c 2006-12-20 19:22:33 UTC (rev 2699) +++ trunk/LWJGL/src/native/generated/org_lwjgl_opengl_GL11.c 2006-12-20 19:23:35 UTC (rev 2700) @@ -739,7 +739,7 @@ glFinish(); } -JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_GL11_nglGetPointerv(JNIEnv *env, jclass clazz, jint pname, jint result_size, jlong function_pointer) { +JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_GL11_nglGetPointerv(JNIEnv *env, jclass clazz, jint pname, jlong result_size, jlong function_pointer) { glGetPointervPROC glGetPointerv = (glGetPointervPROC)((intptr_t)function_pointer); GLvoid * __result; glGetPointerv(pname, &__result); Modified: trunk/LWJGL/src/native/generated/org_lwjgl_opengl_GL15.c =================================================================== --- trunk/LWJGL/src/native/generated/org_lwjgl_opengl_GL15.c 2006-12-20 19:22:33 UTC (rev 2699) +++ trunk/LWJGL/src/native/generated/org_lwjgl_opengl_GL15.c 2006-12-20 19:23:35 UTC (rev 2700) @@ -64,7 +64,7 @@ glGetBufferSubData(target, offset, size, data_address); } -JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_GL15_nglMapBuffer(JNIEnv *env, jclass clazz, jint target, jint access, jint result_size, jobject old_buffer, jlong function_pointer) { +JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_GL15_nglMapBuffer(JNIEnv *env, jclass clazz, jint target, jint access, jlong result_size, jobject old_buffer, jlong function_pointer) { glMapBufferPROC glMapBuffer = (glMapBufferPROC)((intptr_t)function_pointer); GLvoid * __result = glMapBuffer(target, access); return safeNewBufferCached(env, __result, result_size, old_buffer); @@ -82,7 +82,7 @@ glGetBufferParameteriv(target, pname, params_address); } -JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_GL15_nglGetBufferPointerv(JNIEnv *env, jclass clazz, jint target, jint pname, jint result_size, jlong function_pointer) { +JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_GL15_nglGetBufferPointerv(JNIEnv *env, jclass clazz, jint target, jint pname, jlong result_size, jlong function_pointer) { glGetBufferPointervPROC glGetBufferPointerv = (glGetBufferPointervPROC)((intptr_t)function_pointer); GLvoid * __result; glGetBufferPointerv(target, pname, &__result); Modified: trunk/LWJGL/src/native/generated/org_lwjgl_opengl_GL20.c =================================================================== --- trunk/LWJGL/src/native/generated/org_lwjgl_opengl_GL20.c 2006-12-20 19:22:33 UTC (rev 2699) +++ trunk/LWJGL/src/native/generated/org_lwjgl_opengl_GL20.c 2006-12-20 19:23:35 UTC (rev 2700) @@ -423,7 +423,7 @@ glGetVertexAttribiv(index, pname, params_address); } -JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_GL20_nglGetVertexAttribPointerv(JNIEnv *env, jclass clazz, jint index, jint pname, jint result_size, jlong function_pointer) { +JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_GL20_nglGetVertexAttribPointerv(JNIEnv *env, jclass clazz, jint index, jint pname, jlong result_size, jlong function_pointer) { glGetVertexAttribPointervPROC glGetVertexAttribPointerv = (glGetVertexAttribPointervPROC)((intptr_t)function_pointer); GLvoid * __result; glGetVertexAttribPointerv(index, pname, &__result); Modified: trunk/LWJGL/src/native/generated/org_lwjgl_opengl_NVTransformFeedback.c =================================================================== --- trunk/LWJGL/src/native/generated/org_lwjgl_opengl_NVTransformFeedback.c 2006-12-20 19:22:33 UTC (rev 2699) +++ trunk/LWJGL/src/native/generated/org_lwjgl_opengl_NVTransformFeedback.c 2006-12-20 19:23:35 UTC (rev 2700) @@ -1,82 +1,82 @@ -/* MACHINE GENERATED FILE, DO NOT EDIT */ - -#include <jni.h> -#include "extgl.h" - -typedef void (APIENTRY *glBindBufferRangeNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef void (APIENTRY *glBindBufferOffsetNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); -typedef void (APIENTRY *glBindBufferBaseNVPROC) (GLenum target, GLuint index, GLuint buffer); -typedef void (APIENTRY *glTransformFeedbackAttribsNVPROC) (GLsizei count, const GLint * attribs, GLenum bufferMode); -typedef void (APIENTRY *glTransformFeedbackVaryingsNVPROC) (GLuint program, GLsizei count, const GLint * locations, GLenum bufferMode); -typedef void (APIENTRY *glBeginTransformFeedbackNVPROC) (GLenum primitiveMode); -typedef void (APIENTRY *glEndTransformFeedbackNVPROC) (); -typedef GLint (APIENTRY *glGetVaryingLocationNVPROC) (GLuint program, const GLchar * name); -typedef void (APIENTRY *glGetActiveVaryingNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, GLchar * name); -typedef void (APIENTRY *glActiveVaryingNVPROC) (GLuint program, const GLchar * name); -typedef void (APIENTRY *glGetTransformFeedbackVaryingNVPROC) (GLuint program, GLuint index, GLint * location); - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeedback_nglBindBufferRangeNV(JNIEnv *env, jclass clazz, jint target, jint index, jint buffer, jlong offset, jlong size, jlong function_pointer) { - glBindBufferRangeNVPROC glBindBufferRangeNV = (glBindBufferRangeNVPROC)((intptr_t)function_pointer); - glBindBufferRangeNV(target, index, buffer, offset, size); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeedback_nglBindBufferOffsetNV(JNIEnv *env, jclass clazz, jint target, jint index, jint buffer, jlong offset, jlong function_pointer) { - glBindBufferOffsetNVPROC glBindBufferOffsetNV = (glBindBufferOffsetNVPROC)((intptr_t)function_pointer); - glBindBufferOffsetNV(target, index, buffer, offset); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeedback_nglBindBufferBaseNV(JNIEnv *env, jclass clazz, jint target, jint index, jint buffer, jlong function_pointer) { - glBindBufferBaseNVPROC glBindBufferBaseNV = (glBindBufferBaseNVPROC)((intptr_t)function_pointer); - glBindBufferBaseNV(target, index, buffer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeedback_nglTransformFeedbackAttribsNV(JNIEnv *env, jclass clazz, jint count, jobject attribs, jint attribs_position, jint bufferMode, jlong function_pointer) { - const GLint *attribs_address = ((const GLint *)(*env)->GetDirectBufferAddress(env, attribs)) + attribs_position; - glTransformFeedbackAttribsNVPROC glTransformFeedbackAttribsNV = (glTransformFeedbackAttribsNVPROC)((intptr_t)function_pointer); - glTransformFeedbackAttribsNV(count, attribs_address, bufferMode); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeedback_nglTransformFeedbackVaryingsNV(JNIEnv *env, jclass clazz, jint program, jint count, jobject locations, jint locations_position, jint bufferMode, jlong function_pointer) { - const GLint *locations_address = ((const GLint *)(*env)->GetDirectBufferAddress(env, locations)) + locations_position; - glTransformFeedbackVaryingsNVPROC glTransformFeedbackVaryingsNV = (glTransformFeedbackVaryingsNVPROC)((intptr_t)function_pointer); - glTransformFeedbackVaryingsNV(program, count, locations_address, bufferMode); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeedback_nglBeginTransformFeedbackNV(JNIEnv *env, jclass clazz, jint primitiveMode, jlong function_pointer) { - glBeginTransformFeedbackNVPROC glBeginTransformFeedbackNV = (glBeginTransformFeedbackNVPROC)((intptr_t)function_pointer); - glBeginTransformFeedbackNV(primitiveMode); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeedback_nglEndTransformFeedbackNV(JNIEnv *env, jclass clazz, jlong function_pointer) { - glEndTransformFeedbackNVPROC glEndTransformFeedbackNV = (glEndTransformFeedbackNVPROC)((intptr_t)function_pointer); - glEndTransformFeedbackNV(); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_NVTransformFeedback_nglGetVaryingLocationNV(JNIEnv *env, jclass clazz, jint program, jobject name, jint name_position, jlong function_pointer) { - const GLchar *name_address = ((const GLchar *)(*env)->GetDirectBufferAddress(env, name)) + name_position; - glGetVaryingLocationNVPROC glGetVaryingLocationNV = (glGetVaryingLocationNVPROC)((intptr_t)function_pointer); - GLint __result = glGetVaryingLocationNV(program, name_address); - return __result; -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeedback_nglGetActiveVaryingNV(JNIEnv *env, jclass clazz, jint program, jint index, jint bufSize, jobject length, jint length_position, jobject size, jint size_position, jobject type, jint type_position, jobject name, jint name_position, jlong function_pointer) { - GLsizei *length_address = ((GLsizei *)(*env)->GetDirectBufferAddress(env, length)) + length_position; - GLsizei *size_address = ((GLsizei *)(*env)->GetDirectBufferAddress(env, size)) + size_position; - GLenum *type_address = ((GLenum *)(*env)->GetDirectBufferAddress(env, type)) + type_position; - GLchar *name_address = ((GLchar *)(*env)->GetDirectBufferAddress(env, name)) + name_position; - glGetActiveVaryingNVPROC glGetActiveVaryingNV = (glGetActiveVaryingNVPROC)((intptr_t)function_pointer); - glGetActiveVaryingNV(program, index, bufSize, length_address, size_address, type_address, name_address); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeedback_nglActiveVaryingNV(JNIEnv *env, jclass clazz, jint program, jobject name, jint name_position, jlong function_pointer) { - const GLchar *name_address = ((const GLchar *)(*env)->GetDirectBufferAddress(env, name)) + name_position; - glActiveVaryingNVPROC glActiveVaryingNV = (glActiveVaryingNVPROC)((intptr_t)function_pointer); - glActiveVaryingNV(program, name_address); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeedback_nglGetTransformFeedbackVaryingNV(JNIEnv *env, jclass clazz, jint program, jint index, jobject location, jint location_position, jlong function_pointer) { - GLint *location_address = ((GLint *)(*env)->GetDirectBufferAddress(env, location)) + location_position; - glGetTransformFeedbackVaryingNVPROC glGetTransformFeedbackVaryingNV = (glGetTransformFeedbackVaryingNVPROC)((intptr_t)function_pointer); - glGetTransformFeedbackVaryingNV(program, index, location_address); -} - +/* MACHINE GENERATED FILE, DO NOT EDIT */ + +#include <jni.h> +#include "extgl.h" + +typedef void (APIENTRY *glBindBufferRangeNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (APIENTRY *glBindBufferOffsetNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +typedef void (APIENTRY *glBindBufferBaseNVPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (APIENTRY *glTransformFeedbackAttribsNVPROC) (GLsizei count, const GLint * attribs, GLenum bufferMode); +typedef void (APIENTRY *glTransformFeedbackVaryingsNVPROC) (GLuint program, GLsizei count, const GLint * locations, GLenum bufferMode); +typedef void (APIENTRY *glBeginTransformFeedbackNVPROC) (GLenum primitiveMode); +typedef void (APIENTRY *glEndTransformFeedbackNVPROC) (); +typedef GLint (APIENTRY *glGetVaryingLocationNVPROC) (GLuint program, const GLchar * name); +typedef void (APIENTRY *glGetActiveVaryingNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, GLchar * name); +typedef void (APIENTRY *glActiveVaryingNVPROC) (GLuint program, const GLchar * name); +typedef void (APIENTRY *glGetTransformFeedbackVaryingNVPROC) (GLuint program, GLuint index, GLint * location); + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeedback_nglBindBufferRangeNV(JNIEnv *env, jclass clazz, jint target, jint index, jint buffer, jlong offset, jlong size, jlong function_pointer) { + glBindBufferRangeNVPROC glBindBufferRangeNV = (glBindBufferRangeNVPROC)((intptr_t)function_pointer); + glBindBufferRangeNV(target, index, buffer, offset, size); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeedback_nglBindBufferOffsetNV(JNIEnv *env, jclass clazz, jint target, jint index, jint buffer, jlong offset, jlong function_pointer) { + glBindBufferOffsetNVPROC glBindBufferOffsetNV = (glBindBufferOffsetNVPROC)((intptr_t)function_pointer); + glBindBufferOffsetNV(target, index, buffer, offset); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeedback_nglBindBufferBaseNV(JNIEnv *env, jclass clazz, jint target, jint index, jint buffer, jlong function_pointer) { + glBindBufferBaseNVPROC glBindBufferBaseNV = (glBindBufferBaseNVPROC)((intptr_t)function_pointer); + glBindBufferBaseNV(target, index, buffer); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeedback_nglTransformFeedbackAttribsNV(JNIEnv *env, jclass clazz, jint count, jobject attribs, jint attribs_position, jint bufferMode, jlong function_pointer) { + const GLint *attribs_address = ((const GLint *)(*env)->GetDirectBufferAddress(env, attribs)) + attribs_position; + glTransformFeedbackAttribsNVPROC glTransformFeedbackAttribsNV = (glTransformFeedbackAttribsNVPROC)((intptr_t)function_pointer); + glTransformFeedbackAttribsNV(count, attribs_address, bufferMode); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeedback_nglTransformFeedbackVaryingsNV(JNIEnv *env, jclass clazz, jint program, jint count, jobject locations, jint locations_position, jint bufferMode, jlong function_pointer) { + const GLint *locations_address = ((const GLint *)(*env)->GetDirectBufferAddress(env, locations)) + locations_position; + glTransformFeedbackVaryingsNVPROC glTransformFeedbackVaryingsNV = (glTransformFeedbackVaryingsNVPROC)((intptr_t)function_pointer); + glTransformFeedbackVaryingsNV(program, count, locations_address, bufferMode); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeedback_nglBeginTransformFeedbackNV(JNIEnv *env, jclass clazz, jint primitiveMode, jlong function_pointer) { + glBeginTransformFeedbackNVPROC glBeginTransformFeedbackNV = (glBeginTransformFeedbackNVPROC)((intptr_t)function_pointer); + glBeginTransformFeedbackNV(primitiveMode); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeedback_nglEndTransformFeedbackNV(JNIEnv *env, jclass clazz, jlong function_pointer) { + glEndTransformFeedbackNVPROC glEndTransformFeedbackNV = (glEndTransformFeedbackNVPROC)((intptr_t)function_pointer); + glEndTransformFeedbackNV(); +} + +JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_NVTransformFeedback_nglGetVaryingLocationNV(JNIEnv *env, jclass clazz, jint program, jobject name, jint name_position, jlong function_pointer) { + const GLchar *name_address = ((const GLchar *)(*env)->GetDirectBufferAddress(env, name)) + name_position; + glGetVaryingLocationNVPROC glGetVaryingLocationNV = (glGetVaryingLocationNVPROC)((intptr_t)function_pointer); + GLint __result = glGetVaryingLocationNV(program, name_address); + return __result; +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeedback_nglGetActiveVaryingNV(JNIEnv *env, jclass clazz, jint program, jint index, jint bufSize, jobject length, jint length_position, jobject size, jint size_position, jobject type, jint type_position, jobject name, jint name_position, jlong function_pointer) { + GLsizei *length_address = ((GLsizei *)(*env)->GetDirectBufferAddress(env, length)) + length_position; + GLsizei *size_address = ((GLsizei *)(*env)->GetDirectBufferAddress(env, size)) + size_position; + GLenum *type_address = ((GLenum *)(*env)->GetDirectBufferAddress(env, type)) + type_position; + GLchar... [truncated message content] |
From: <eli...@us...> - 2006-12-22 10:45:40
|
Revision: 2705 http://svn.sourceforge.net/java-game-lib/?rev=2705&view=rev Author: elias_naur Date: 2006-12-22 02:45:39 -0800 (Fri, 22 Dec 2006) Log Message: ----------- Windows: Make window visible after pixel format selection and move code from native WindowsDisplay.nCreate to java side. 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 2006-12-22 10:36:04 UTC (rev 2704) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2006-12-22 10:45:39 UTC (rev 2705) @@ -96,6 +96,7 @@ private final static int WA_ACTIVE = 1; private final static int WA_CLICKACTIVE = 2; private final static int SW_SHOWMINNOACTIVE = 7; + private final static int SW_SHOWDEFAULT = 10; private final static int SW_RESTORE = 9; private static WindowsDisplay current_display; @@ -132,6 +133,9 @@ did_maximize = false; nCreateWindow(mode, fullscreen, x, y); peer_info.initDC(); + showWindow(getHwnd(), SW_SHOWDEFAULT); + setForegroundWindow(getHwnd()); + setFocus(getHwnd()); } private native void nCreateWindow(DisplayMode mode, boolean fullscreen, int x, int y) throws LWJGLException; Modified: trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c =================================================================== --- trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c 2006-12-22 10:36:04 UTC (rev 2704) +++ trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c 2006-12-22 10:45:39 UTC (rev 2705) @@ -199,10 +199,6 @@ return; } display_hdc = GetDC(display_hwnd); - ShowWindow(display_hwnd, SW_SHOWDEFAULT); - UpdateWindow(display_hwnd); - SetForegroundWindow(display_hwnd); - SetFocus(display_hwnd); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nDestroyWindow(JNIEnv *env, jclass clazz) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2007-01-04 13:44:25
|
Revision: 2715 http://svn.sourceforge.net/java-game-lib/?rev=2715&view=rev Author: elias_naur Date: 2007-01-04 05:44:23 -0800 (Thu, 04 Jan 2007) Log Message: ----------- Windows: Re-add UpdateWindow to make sure fullscreen windows are cleared faster 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 2007-01-03 09:16:13 UTC (rev 2714) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2007-01-04 13:44:23 UTC (rev 2715) @@ -136,6 +136,7 @@ showWindow(getHwnd(), SW_SHOWDEFAULT); setForegroundWindow(getHwnd()); setFocus(getHwnd()); + updateWindow(getHwnd()); } private native void nCreateWindow(DisplayMode mode, boolean fullscreen, int x, int y) throws LWJGLException; @@ -181,6 +182,7 @@ private static native void showWindow(long hwnd, int mode); private static native void setForegroundWindow(long hwnd); private static native void setFocus(long hwnd); + private static native void updateWindow(long hwnd); private void restoreDisplayMode() { try { Modified: trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c =================================================================== --- trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c 2007-01-03 09:16:13 UTC (rev 2714) +++ trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c 2007-01-04 13:44:23 UTC (rev 2715) @@ -247,6 +247,11 @@ setGammaRamp(env, gamma_buffer); } +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_updateWindow(JNIEnv *env, jclass unused, jlong hwnd_ptr) { + HWND hwnd = (HWND)(INT_PTR)hwnd_ptr; + UpdateWindow(hwnd); +} + JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_showWindow(JNIEnv *env, jclass unused, jlong hwnd_ptr, jint mode) { HWND hwnd = (HWND)(INT_PTR)hwnd_ptr; ShowWindow(hwnd, mode); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2007-01-04 14:00:47
|
Revision: 2716 http://svn.sourceforge.net/java-game-lib/?rev=2716&view=rev Author: elias_naur Date: 2007-01-04 06:00:45 -0800 (Thu, 04 Jan 2007) Log Message: ----------- Windows: Don't use UpdateWindow after all. Instead, don't use a background brush at all to avoid windows clearing windows with non OpenGL drawing commands. Hopefully this will improve compatibility (The NeHe tutorials also don't specify a background brush). Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java trunk/LWJGL/src/native/windows/context.c 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 2007-01-04 13:44:23 UTC (rev 2715) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2007-01-04 14:00:45 UTC (rev 2716) @@ -136,7 +136,6 @@ showWindow(getHwnd(), SW_SHOWDEFAULT); setForegroundWindow(getHwnd()); setFocus(getHwnd()); - updateWindow(getHwnd()); } private native void nCreateWindow(DisplayMode mode, boolean fullscreen, int x, int y) throws LWJGLException; @@ -182,7 +181,6 @@ private static native void showWindow(long hwnd, int mode); private static native void setForegroundWindow(long hwnd); private static native void setFocus(long hwnd); - private static native void updateWindow(long hwnd); private void restoreDisplayMode() { try { Modified: trunk/LWJGL/src/native/windows/context.c =================================================================== --- trunk/LWJGL/src/native/windows/context.c 2007-01-04 13:44:23 UTC (rev 2715) +++ trunk/LWJGL/src/native/windows/context.c 2007-01-04 14:00:45 UTC (rev 2716) @@ -55,6 +55,7 @@ bool registerWindow(WNDPROC win_proc, LPCTSTR class_name) { WNDCLASS windowClass; + memset(&windowClass, 0, sizeof(windowClass)); windowClass.style = CS_OWNDC; windowClass.lpfnWndProc = win_proc; windowClass.cbClsExtra = 0; @@ -62,7 +63,7 @@ windowClass.hInstance = dll_handle; windowClass.hIcon = LoadIcon(NULL, IDI_APPLICATION); windowClass.hCursor = LoadCursor(NULL, IDC_ARROW); - windowClass.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); + windowClass.hbrBackground = NULL; windowClass.lpszMenuName = NULL; windowClass.lpszClassName = class_name; Modified: trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c =================================================================== --- trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c 2007-01-04 13:44:23 UTC (rev 2715) +++ trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c 2007-01-04 14:00:45 UTC (rev 2716) @@ -247,11 +247,6 @@ setGammaRamp(env, gamma_buffer); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_updateWindow(JNIEnv *env, jclass unused, jlong hwnd_ptr) { - HWND hwnd = (HWND)(INT_PTR)hwnd_ptr; - UpdateWindow(hwnd); -} - JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_showWindow(JNIEnv *env, jclass unused, jlong hwnd_ptr, jint mode) { HWND hwnd = (HWND)(INT_PTR)hwnd_ptr; ShowWindow(hwnd, mode); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |