src/video/windows/SDL_windowsopengl.c
changeset 11839 971881e55d61
parent 11811 5d94cb6b24d3
child 11872 e917e911dab6
     1.1 --- a/src/video/windows/SDL_windowsopengl.c	Tue Jan 30 16:53:24 2018 -0800
     1.2 +++ b/src/video/windows/SDL_windowsopengl.c	Tue Jan 30 18:08:34 2018 -0800
     1.3 @@ -119,15 +119,15 @@
     1.4  
     1.5      /* Load function pointers */
     1.6      handle = _this->gl_config.dll_handle;
     1.7 -    _this->gl_data->wglGetProcAddress = (void *(WINAPI *) (const char *))
     1.8 +    *(void**)&_this->gl_data->wglGetProcAddress =
     1.9          SDL_LoadFunction(handle, "wglGetProcAddress");
    1.10 -    _this->gl_data->wglCreateContext = (HGLRC(WINAPI *) (HDC))
    1.11 +    *(void**)&_this->gl_data->wglCreateContext =
    1.12          SDL_LoadFunction(handle, "wglCreateContext");
    1.13 -    _this->gl_data->wglDeleteContext = (BOOL(WINAPI *) (HGLRC))
    1.14 +    *(void**)&_this->gl_data->wglDeleteContext =
    1.15          SDL_LoadFunction(handle, "wglDeleteContext");
    1.16 -    _this->gl_data->wglMakeCurrent = (BOOL(WINAPI *) (HDC, HGLRC))
    1.17 +    *(void**)&_this->gl_data->wglMakeCurrent =
    1.18          SDL_LoadFunction(handle, "wglMakeCurrent");
    1.19 -    _this->gl_data->wglShareLists = (BOOL(WINAPI *) (HGLRC, HGLRC))
    1.20 +    *(void**)&_this->gl_data->wglShareLists =
    1.21          SDL_LoadFunction(handle, "wglShareLists");
    1.22  
    1.23      if (!_this->gl_data->wglGetProcAddress ||
    1.24 @@ -409,7 +409,7 @@
    1.25      }
    1.26      _this->gl_data->wglMakeCurrent(hdc, hglrc);
    1.27  
    1.28 -    wglGetExtensionsStringARB = (const char *(WINAPI *) (HDC))
    1.29 +    *(void**)&wglGetExtensionsStringARB =
    1.30          _this->gl_data->wglGetProcAddress("wglGetExtensionsStringARB");
    1.31      if (wglGetExtensionsStringARB) {
    1.32          extensions = wglGetExtensionsStringARB(hdc);
    1.33 @@ -420,13 +420,9 @@
    1.34      /* Check for WGL_ARB_pixel_format */
    1.35      _this->gl_data->HAS_WGL_ARB_pixel_format = SDL_FALSE;
    1.36      if (HasExtension("WGL_ARB_pixel_format", extensions)) {
    1.37 -        _this->gl_data->wglChoosePixelFormatARB = (BOOL(WINAPI *)
    1.38 -                                                   (HDC, const int *,
    1.39 -                                                    const FLOAT *, UINT,
    1.40 -                                                    int *, UINT *))
    1.41 +        *(void**)&_this->gl_data->wglChoosePixelFormatARB =
    1.42              WIN_GL_GetProcAddress(_this, "wglChoosePixelFormatARB");
    1.43 -        _this->gl_data->wglGetPixelFormatAttribivARB =
    1.44 -            (BOOL(WINAPI *) (HDC, int, int, UINT, const int *, int *))
    1.45 +        *(void**)&_this->gl_data->wglGetPixelFormatAttribivARB =
    1.46              WIN_GL_GetProcAddress(_this, "wglGetPixelFormatAttribivARB");
    1.47  
    1.48          if ((_this->gl_data->wglChoosePixelFormatARB != NULL) &&
    1.49 @@ -438,9 +434,9 @@
    1.50      /* Check for WGL_EXT_swap_control */
    1.51      _this->gl_data->HAS_WGL_EXT_swap_control_tear = SDL_FALSE;
    1.52      if (HasExtension("WGL_EXT_swap_control", extensions)) {
    1.53 -        _this->gl_data->wglSwapIntervalEXT =
    1.54 +        *(void**)&_this->gl_data->wglSwapIntervalEXT =
    1.55              WIN_GL_GetProcAddress(_this, "wglSwapIntervalEXT");
    1.56 -        _this->gl_data->wglGetSwapIntervalEXT =
    1.57 +        *(void**)&_this->gl_data->wglGetSwapIntervalEXT =
    1.58              WIN_GL_GetProcAddress(_this, "wglGetSwapIntervalEXT");
    1.59          if (HasExtension("WGL_EXT_swap_control_tear", extensions)) {
    1.60              _this->gl_data->HAS_WGL_EXT_swap_control_tear = SDL_TRUE;
    1.61 @@ -721,9 +717,8 @@
    1.62              return NULL;
    1.63          }
    1.64  
    1.65 -        wglCreateContextAttribsARB =
    1.66 -            (PFNWGLCREATECONTEXTATTRIBSARBPROC) _this->gl_data->
    1.67 -            wglGetProcAddress("wglCreateContextAttribsARB");
    1.68 +        *(void**)&wglCreateContextAttribsARB =
    1.69 +            _this->gl_data->wglGetProcAddress("wglCreateContextAttribsARB");
    1.70          if (!wglCreateContextAttribsARB) {
    1.71              SDL_SetError("GL 3.x is not supported");
    1.72              context = temp_context;