|
@@ -189,29 +189,21 @@ X11_GL_LoadLibrary(_THIS, const char *path)
|
|
|
|
|
|
/* Load function pointers */
|
|
|
handle = _this->gl_config.dll_handle;
|
|
|
- _this->gl_data->glXQueryExtension =
|
|
|
- (Bool (*)(Display *, int *, int *))
|
|
|
+ *(void**)&_this->gl_data->glXQueryExtension =
|
|
|
GL_LoadFunction(handle, "glXQueryExtension");
|
|
|
- _this->gl_data->glXGetProcAddress =
|
|
|
- (void *(*)(const GLubyte *))
|
|
|
+ *(void**)&_this->gl_data->glXGetProcAddress =
|
|
|
GL_LoadFunction(handle, "glXGetProcAddressARB");
|
|
|
- _this->gl_data->glXChooseVisual =
|
|
|
- (XVisualInfo * (*)(Display *, int, int *))
|
|
|
+ *(void**)&_this->gl_data->glXChooseVisual =
|
|
|
X11_GL_GetProcAddress(_this, "glXChooseVisual");
|
|
|
- _this->gl_data->glXCreateContext =
|
|
|
- (GLXContext(*)(Display *, XVisualInfo *, GLXContext, int))
|
|
|
+ *(void**)&_this->gl_data->glXCreateContext =
|
|
|
X11_GL_GetProcAddress(_this, "glXCreateContext");
|
|
|
- _this->gl_data->glXDestroyContext =
|
|
|
- (void (*)(Display *, GLXContext))
|
|
|
+ *(void**)&_this->gl_data->glXDestroyContext =
|
|
|
X11_GL_GetProcAddress(_this, "glXDestroyContext");
|
|
|
- _this->gl_data->glXMakeCurrent =
|
|
|
- (int (*)(Display *, GLXDrawable, GLXContext))
|
|
|
+ *(void**)&_this->gl_data->glXMakeCurrent =
|
|
|
X11_GL_GetProcAddress(_this, "glXMakeCurrent");
|
|
|
- _this->gl_data->glXSwapBuffers =
|
|
|
- (void (*)(Display *, GLXDrawable))
|
|
|
+ *(void**)&_this->gl_data->glXSwapBuffers =
|
|
|
X11_GL_GetProcAddress(_this, "glXSwapBuffers");
|
|
|
- _this->gl_data->glXQueryDrawable =
|
|
|
- (void (*)(Display*,GLXDrawable,int,unsigned int*))
|
|
|
+ *(void**)&_this->gl_data->glXQueryDrawable =
|
|
|
X11_GL_GetProcAddress(_this, "glXQueryDrawable");
|
|
|
|
|
|
if (!_this->gl_data->glXQueryExtension ||
|
|
@@ -341,13 +333,11 @@ X11_GL_InitExtensions(_THIS)
|
|
|
|
|
|
vinfo = X11_GL_GetVisual(_this, display, screen);
|
|
|
if (vinfo) {
|
|
|
- GLXContext (*glXGetCurrentContextFunc) (void) =
|
|
|
- (GLXContext(*)(void))
|
|
|
- X11_GL_GetProcAddress(_this, "glXGetCurrentContext");
|
|
|
+ GLXContext (*glXGetCurrentContextFunc)(void);
|
|
|
+ GLXDrawable (*glXGetCurrentDrawableFunc)(void);
|
|
|
|
|
|
- GLXDrawable (*glXGetCurrentDrawableFunc) (void) =
|
|
|
- (GLXDrawable(*)(void))
|
|
|
- X11_GL_GetProcAddress(_this, "glXGetCurrentDrawable");
|
|
|
+ *(void**)&glXGetCurrentContextFunc = X11_GL_GetProcAddress(_this, "glXGetCurrentContext");
|
|
|
+ *(void**)&glXGetCurrentDrawableFunc = X11_GL_GetProcAddress(_this, "glXGetCurrentDrawable");
|
|
|
|
|
|
if (glXGetCurrentContextFunc && glXGetCurrentDrawableFunc) {
|
|
|
XSetWindowAttributes xattr;
|
|
@@ -373,9 +363,7 @@ X11_GL_InitExtensions(_THIS)
|
|
|
X11_XFree(vinfo);
|
|
|
}
|
|
|
|
|
|
- glXQueryExtensionsStringFunc =
|
|
|
- (const char *(*)(Display *, int)) X11_GL_GetProcAddress(_this,
|
|
|
- "glXQueryExtensionsString");
|
|
|
+ *(void**)&glXQueryExtensionsStringFunc = X11_GL_GetProcAddress(_this, "glXQueryExtensionsString");
|
|
|
if (glXQueryExtensionsStringFunc) {
|
|
|
extensions = glXQueryExtensionsStringFunc(display, screen);
|
|
|
} else {
|
|
@@ -385,8 +373,7 @@ X11_GL_InitExtensions(_THIS)
|
|
|
/* Check for GLX_EXT_swap_control(_tear) */
|
|
|
_this->gl_data->HAS_GLX_EXT_swap_control_tear = SDL_FALSE;
|
|
|
if (HasExtension("GLX_EXT_swap_control", extensions)) {
|
|
|
- _this->gl_data->glXSwapIntervalEXT =
|
|
|
- (void (*)(Display*,GLXDrawable,int))
|
|
|
+ *(void**)&_this->gl_data->glXSwapIntervalEXT =
|
|
|
X11_GL_GetProcAddress(_this, "glXSwapIntervalEXT");
|
|
|
if (HasExtension("GLX_EXT_swap_control_tear", extensions)) {
|
|
|
_this->gl_data->HAS_GLX_EXT_swap_control_tear = SDL_TRUE;
|
|
@@ -395,26 +382,23 @@ X11_GL_InitExtensions(_THIS)
|
|
|
|
|
|
/* Check for GLX_MESA_swap_control */
|
|
|
if (HasExtension("GLX_MESA_swap_control", extensions)) {
|
|
|
- _this->gl_data->glXSwapIntervalMESA =
|
|
|
- (int(*)(int)) X11_GL_GetProcAddress(_this, "glXSwapIntervalMESA");
|
|
|
- _this->gl_data->glXGetSwapIntervalMESA =
|
|
|
- (int(*)(void)) X11_GL_GetProcAddress(_this,
|
|
|
- "glXGetSwapIntervalMESA");
|
|
|
+ *(void**)&_this->gl_data->glXSwapIntervalMESA =
|
|
|
+ X11_GL_GetProcAddress(_this, "glXSwapIntervalMESA");
|
|
|
+ *(void**)&_this->gl_data->glXGetSwapIntervalMESA =
|
|
|
+ X11_GL_GetProcAddress(_this, "glXGetSwapIntervalMESA");
|
|
|
}
|
|
|
|
|
|
/* Check for GLX_SGI_swap_control */
|
|
|
if (HasExtension("GLX_SGI_swap_control", extensions)) {
|
|
|
- _this->gl_data->glXSwapIntervalSGI =
|
|
|
- (int (*)(int)) X11_GL_GetProcAddress(_this, "glXSwapIntervalSGI");
|
|
|
+ *(void**)&_this->gl_data->glXSwapIntervalSGI =
|
|
|
+ X11_GL_GetProcAddress(_this, "glXSwapIntervalSGI");
|
|
|
}
|
|
|
|
|
|
/* Check for GLX_ARB_create_context */
|
|
|
if (HasExtension("GLX_ARB_create_context", extensions)) {
|
|
|
- _this->gl_data->glXCreateContextAttribsARB =
|
|
|
- (GLXContext (*)(Display*,GLXFBConfig,GLXContext,Bool,const int *))
|
|
|
+ *(void**)&_this->gl_data->glXCreateContextAttribsARB =
|
|
|
X11_GL_GetProcAddress(_this, "glXCreateContextAttribsARB");
|
|
|
- _this->gl_data->glXChooseFBConfig =
|
|
|
- (GLXFBConfig *(*)(Display *, int, const int *, int *))
|
|
|
+ *(void**)&_this->gl_data->glXChooseFBConfig =
|
|
|
X11_GL_GetProcAddress(_this, "glXChooseFBConfig");
|
|
|
}
|
|
|
|