diff --git a/src/native/common/extgl.c b/src/native/common/extgl.c index 26da7030..cc301902 100644 --- a/src/native/common/extgl.c +++ b/src/native/common/extgl.c @@ -46,7 +46,7 @@ bool extgl_InitializeFunctions(int num_functions, ExtFunction *functions) { return ext_InitializeFunctions(&extgl_GetProcAddress, num_functions, functions); } -bool extgl_QueryExtension(JNIEnv *env, const GLubyte*extensions, const char *name) +bool extgl_QueryExtension(const GLubyte*extensions, const char *name) { const GLubyte *start; GLubyte *where, *terminator; diff --git a/src/native/common/extgl.h b/src/native/common/extgl.h index c5a809bc..5c39c239 100644 --- a/src/native/common/extgl.h +++ b/src/native/common/extgl.h @@ -72,7 +72,6 @@ THE POSSIBILITY OF SUCH DAMAGE. #include - /*-----------------------------------------*/ /*-----------------------------------------*/ @@ -162,7 +161,7 @@ extern bool extgl_Open(JNIEnv *env); extern void extgl_Close(void); extern void extgl_InitializeClass(JNIEnv *env, jclass clazz, int num_functions, JavaMethodAndExtFunction *functions); extern bool extgl_InitializeFunctions(int num_functions, ExtFunction *functions); -extern bool extgl_QueryExtension(JNIEnv *env, const GLubyte*extensions, const char *name); +extern bool extgl_QueryExtension(const GLubyte*extensions, const char *name); extern void *extgl_GetProcAddress(const char *name); #ifdef __cplusplus diff --git a/src/native/linux/context.c b/src/native/linux/context.c index 39db0ec2..5746b843 100644 --- a/src/native/linux/context.c +++ b/src/native/linux/context.c @@ -247,7 +247,7 @@ bool initPeerInfo(JNIEnv *env, jobject peer_info_handle, Display *display, int s return false; } X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_info_handle); - if (!extgl_InitGLX(env, display, screen)) { + if (!extgl_InitGLX(display, screen)) { throwException(env, "Could not init GLX"); return false; } diff --git a/src/native/linux/extgl_glx.c b/src/native/linux/extgl_glx.c index 1e9df2c1..5f063c40 100644 --- a/src/native/linux/extgl_glx.c +++ b/src/native/linux/extgl_glx.c @@ -125,13 +125,13 @@ void extgl_Close(void) } /** returns true if the extention is available */ -static bool GLXQueryExtension(JNIEnv* env, Display *disp, int screen, const char *name) +static bool GLXQueryExtension(Display *disp, int screen, const char *name) { const GLubyte *exts = (const GLubyte *)glXQueryExtensionsString(disp, screen); - return extgl_QueryExtension(env, exts, name); + return extgl_QueryExtension(exts, name); } -static void extgl_InitGLX13(JNIEnv *env) +static void extgl_InitGLX13() { ExtFunction functions[] = { {"glXGetFBConfigs", (void*)&glXGetFBConfigs}, @@ -182,15 +182,15 @@ static bool extgl_InitGLX12(void) return extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions); } -static void extgl_InitGLXSupportedExtensions(JNIEnv *env, Display *disp, int screen) +static void extgl_InitGLXSupportedExtensions(Display *disp, int screen) { - extension_flags.GLX_EXT_visual_info = GLXQueryExtension(env, disp, screen, "GLX_EXT_visual_info"); - extension_flags.GLX_EXT_visual_rating = GLXQueryExtension(env, disp, screen, "GLX_EXT_visual_rating"); - extension_flags.GLX_SGI_swap_control = GLXQueryExtension(env, disp, screen, "GLX_SGI_swap_control"); - extension_flags.GLX_ARB_multisample = GLXQueryExtension(env, disp, screen, "GLX_ARB_multisample"); + extension_flags.GLX_EXT_visual_info = GLXQueryExtension(disp, screen, "GLX_EXT_visual_info"); + extension_flags.GLX_EXT_visual_rating = GLXQueryExtension(disp, screen, "GLX_EXT_visual_rating"); + extension_flags.GLX_SGI_swap_control = GLXQueryExtension(disp, screen, "GLX_SGI_swap_control"); + extension_flags.GLX_ARB_multisample = GLXQueryExtension(disp, screen, "GLX_ARB_multisample"); } -static void extgl_InitGLXSGISwapControl(JNIEnv *env) +static void extgl_InitGLXSGISwapControl() { ExtFunction functions[] = { {"glXSwapIntervalSGI", (void*)&glXSwapIntervalSGI}}; @@ -198,7 +198,7 @@ static void extgl_InitGLXSGISwapControl(JNIEnv *env) extension_flags.GLX_SGI_swap_control = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions); } -bool extgl_InitGLX(JNIEnv *env, Display *disp, int screen) +bool extgl_InitGLX(Display *disp, int screen) { int major, minor; /* Assume glx ver >= 1.2 */ @@ -209,8 +209,8 @@ bool extgl_InitGLX(JNIEnv *env, Display *disp, int screen) return false; if (major > 1 || (major == 1 && minor >= 3)) extension_flags.GLX13 = true; - extgl_InitGLX13(env); - extgl_InitGLXSupportedExtensions(env, disp, screen); - extgl_InitGLXSGISwapControl(env); + extgl_InitGLX13(); + extgl_InitGLXSupportedExtensions(disp, screen); + extgl_InitGLXSGISwapControl(); return true; } diff --git a/src/native/linux/extgl_glx.h b/src/native/linux/extgl_glx.h index ff460114..9f5a1e9e 100644 --- a/src/native/linux/extgl_glx.h +++ b/src/native/linux/extgl_glx.h @@ -365,6 +365,6 @@ extern glXQueryExtensionsStringPROC glXQueryExtensionsString; extern glXSwapIntervalSGIPROC glXSwapIntervalSGI; -extern bool extgl_InitGLX(JNIEnv *env, Display *disp, int screen); +extern bool extgl_InitGLX(Display *disp, int screen); #endif diff --git a/src/native/linux/org_lwjgl_opengl_LinuxCanvasImplementation.c b/src/native/linux/org_lwjgl_opengl_LinuxCanvasImplementation.c index 17374780..d7490f52 100644 --- a/src/native/linux/org_lwjgl_opengl_LinuxCanvasImplementation.c +++ b/src/native/linux/org_lwjgl_opengl_LinuxCanvasImplementation.c @@ -48,7 +48,7 @@ JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxCanvasImplementation_nFindVisualIDFromFormat (JNIEnv *env, jclass clazz, jint screen, jobject pixel_format) { - if (!extgl_InitGLX(env, getDisplay(), screen)) { + if (!extgl_InitGLX(getDisplay(), screen)) { throwException(env, "Could not initialize GLX"); return -1; } diff --git a/src/native/linux/org_lwjgl_opengl_LinuxContextImplementation.c b/src/native/linux/org_lwjgl_opengl_LinuxContextImplementation.c index 6193fd2c..755d3b75 100644 --- a/src/native/linux/org_lwjgl_opengl_LinuxContextImplementation.c +++ b/src/native/linux/org_lwjgl_opengl_LinuxContextImplementation.c @@ -109,7 +109,7 @@ JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_LinuxContextImplementation_nCrea X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_handle); X11Context *context_info = (*env)->GetDirectBufferAddress(env, context_handle); - if (!extgl_InitGLX(env, peer_info->display, peer_info->screen)) { + if (!extgl_InitGLX(peer_info->display, peer_info->screen)) { throwException(env, "Could not initialize GLX"); return NULL; } diff --git a/src/native/linux/org_lwjgl_opengl_Pbuffer.c b/src/native/linux/org_lwjgl_opengl_Pbuffer.c index db41f568..9ba51191 100644 --- a/src/native/linux/org_lwjgl_opengl_Pbuffer.c +++ b/src/native/linux/org_lwjgl_opengl_Pbuffer.c @@ -60,7 +60,7 @@ JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetPbufferCapabilitie JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxPbufferPeerInfo_nInitHandle (JNIEnv *env, jclass clazz, jobject peer_info_handle, jint width, jint height, jobject pixel_format) { - if (!extgl_InitGLX(env, getDisplay(), getCurrentScreen()) || !isPbuffersSupported()) { + if (!extgl_InitGLX(getDisplay(), getCurrentScreen()) || !isPbuffersSupported()) { throwException(env, "No Pbuffer support"); return; } diff --git a/src/native/win32/context.c b/src/native/win32/context.c index e76a4177..825fe338 100644 --- a/src/native/win32/context.c +++ b/src/native/win32/context.c @@ -368,7 +368,7 @@ int findPixelFormatOnDC(JNIEnv *env, HDC hdc, jobject pixel_format, jobject pixe throwException(env, "Could not bind context to dummy window"); return -1; } - extgl_InitWGL(env); + extgl_InitWGL(); if (!extension_flags.WGL_ARB_pixel_format) { throwException(env, "No support for WGL_ARB_pixel_format"); diff --git a/src/native/win32/extgl_wgl.c b/src/native/win32/extgl_wgl.c index a76cf373..92b5b83a 100644 --- a/src/native/win32/extgl_wgl.c +++ b/src/native/win32/extgl_wgl.c @@ -114,7 +114,7 @@ void extgl_Close(void) } /** returns true if the extension is available */ -static bool WGLQueryExtension(JNIEnv *env, const char *name) +static bool WGLQueryExtension(const char *name) { const GLubyte *extensions; @@ -125,10 +125,10 @@ static bool WGLQueryExtension(JNIEnv *env, const char *name) extensions = (GLubyte*)wglGetExtensionsStringEXT(); else extensions = (GLubyte*)wglGetExtensionsStringARB(wglGetCurrentDC()); - return extgl_QueryExtension(env, extensions, name); + return extgl_QueryExtension(extensions, name); } -static void extgl_InitWGLARBPbuffer(JNIEnv *env) +static void extgl_InitWGLARBPbuffer() { ExtFunction functions[] = { {"wglCreatePbufferARB", (void **)&wglCreatePbufferARB}, @@ -140,7 +140,7 @@ static void extgl_InitWGLARBPbuffer(JNIEnv *env) extension_flags.WGL_ARB_pbuffer = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions); } -static void extgl_InitWGLARBPixelFormat(JNIEnv *env) +static void extgl_InitWGLARBPixelFormat() { ExtFunction functions[] = { {"wglGetPixelFormatAttribivARB", (void **)&wglGetPixelFormatAttribivARB}, @@ -150,7 +150,7 @@ static void extgl_InitWGLARBPixelFormat(JNIEnv *env) extension_flags.WGL_ARB_pixel_format = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions); } -static void extgl_InitWGLARBRenderTexture(JNIEnv *env) +static void extgl_InitWGLARBRenderTexture() { ExtFunction functions[] = { {"wglBindTexImageARB", (void **)&wglBindTexImageARB}, @@ -160,7 +160,7 @@ static void extgl_InitWGLARBRenderTexture(JNIEnv *env) extension_flags.WGL_ARB_render_texture = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions); } -static void extgl_InitWGLEXTSwapControl(JNIEnv *env) +static void extgl_InitWGLEXTSwapControl() { ExtFunction functions[] = { {"wglSwapIntervalEXT", (void **)&wglSwapIntervalEXT}, @@ -169,7 +169,7 @@ static void extgl_InitWGLEXTSwapControl(JNIEnv *env) extension_flags.WGL_EXT_swap_control = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions); } -static void extgl_InitWGLARBMakeCurrentRead(JNIEnv *env) +static void extgl_InitWGLARBMakeCurrentRead() { ExtFunction functions[] = { {"wglMakeContextCurrentARB", (void **)&wglMakeContextCurrentARB}, @@ -178,20 +178,20 @@ static void extgl_InitWGLARBMakeCurrentRead(JNIEnv *env) extension_flags.WGL_ARB_make_current_read = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions); } -static void extgl_InitSupportedWGLExtensions(JNIEnv *env) +static void extgl_InitSupportedWGLExtensions() { - extension_flags.WGL_ARB_buffer_region = WGLQueryExtension(env, "WGL_ARB_buffer_region"); - extension_flags.WGL_ARB_make_current_read = WGLQueryExtension(env, "WGL_ARB_make_current_read"); - extension_flags.WGL_ARB_multisample = WGLQueryExtension(env, "WGL_ARB_multisample"); - extension_flags.WGL_ARB_pbuffer = WGLQueryExtension(env, "WGL_ARB_pbuffer"); - extension_flags.WGL_ARB_pixel_format = WGLQueryExtension(env, "WGL_ARB_pixel_format"); - extension_flags.WGL_ARB_render_texture = WGLQueryExtension(env, "WGL_ARB_render_texture"); - extension_flags.WGL_EXT_swap_control = WGLQueryExtension(env, "WGL_EXT_swap_control"); - extension_flags.WGL_NV_render_depth_texture = WGLQueryExtension(env, "WGL_NV_render_depth_texture"); - extension_flags.WGL_NV_render_texture_rectangle = WGLQueryExtension(env, "WGL_NV_render_texture_rectangle"); + extension_flags.WGL_ARB_buffer_region = WGLQueryExtension("WGL_ARB_buffer_region"); + extension_flags.WGL_ARB_make_current_read = WGLQueryExtension("WGL_ARB_make_current_read"); + extension_flags.WGL_ARB_multisample = WGLQueryExtension("WGL_ARB_multisample"); + extension_flags.WGL_ARB_pbuffer = WGLQueryExtension("WGL_ARB_pbuffer"); + extension_flags.WGL_ARB_pixel_format = WGLQueryExtension("WGL_ARB_pixel_format"); + extension_flags.WGL_ARB_render_texture = WGLQueryExtension("WGL_ARB_render_texture"); + extension_flags.WGL_EXT_swap_control = WGLQueryExtension("WGL_EXT_swap_control"); + extension_flags.WGL_NV_render_depth_texture = WGLQueryExtension("WGL_NV_render_depth_texture"); + extension_flags.WGL_NV_render_texture_rectangle = WGLQueryExtension("WGL_NV_render_texture_rectangle"); } -void extgl_InitWGL(JNIEnv *env) +void extgl_InitWGL() { ExtFunction functions[] = { {"wglGetExtensionsStringARB", (void **)&wglGetExtensionsStringARB}, @@ -200,12 +200,11 @@ void extgl_InitWGL(JNIEnv *env) extension_flags.WGL_ARB_extensions_string = wglGetExtensionsStringARB != NULL; extension_flags.WGL_EXT_extensions_string = wglGetExtensionsStringEXT != NULL; - extgl_InitSupportedWGLExtensions(env); + extgl_InitSupportedWGLExtensions(); - extgl_InitWGLARBMakeCurrentRead(env); - extgl_InitWGLEXTSwapControl(env); - extgl_InitWGLARBRenderTexture(env); - extgl_InitWGLARBPixelFormat(env); - extgl_InitWGLARBPbuffer(env); - //extgl_InitWGLARBBufferRegion(env); + extgl_InitWGLARBMakeCurrentRead(); + extgl_InitWGLEXTSwapControl(); + extgl_InitWGLARBRenderTexture(); + extgl_InitWGLARBPixelFormat(); + extgl_InitWGLARBPbuffer(); }