revert the recent typecast assignment changes (see bug #4079)

also change the void* typedefs for the two vulkan function
pointers added in vulkan_internal.h  into generic function
pointer typedefs.
This commit is contained in:
sezero
2018-02-12 17:00:00 +03:00
parent ba9ede12fb
commit 40b27fd51b
34 changed files with 174 additions and 146 deletions

View File

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