You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-12 13:20:55 +00:00
Add (void *) cast directly to GetProcAddress calls.
This commit is contained in:
@@ -53,11 +53,6 @@
|
||||
#define WGL_RENDERER 0x1F01
|
||||
#define WGL_VERSION 0x1F02
|
||||
|
||||
#if defined(__GNUC__)
|
||||
// Workaround GCC warning from -Wcast-function-type.
|
||||
#define GetProcAddress (void *)GetProcAddress
|
||||
#endif
|
||||
|
||||
typedef HGLRC(APIENTRY *PFNWGLCREATECONTEXT)(HDC);
|
||||
typedef BOOL(APIENTRY *PFNWGLDELETECONTEXT)(HGLRC);
|
||||
typedef BOOL(APIENTRY *PFNWGLMAKECURRENT)(HDC, HGLRC);
|
||||
@@ -80,10 +75,10 @@ Dictionary detect_wgl() {
|
||||
if (!module) {
|
||||
return gl_info;
|
||||
}
|
||||
gd_wglCreateContext = (PFNWGLCREATECONTEXT)GetProcAddress(module, "wglCreateContext");
|
||||
gd_wglMakeCurrent = (PFNWGLMAKECURRENT)GetProcAddress(module, "wglMakeCurrent");
|
||||
gd_wglDeleteContext = (PFNWGLDELETECONTEXT)GetProcAddress(module, "wglDeleteContext");
|
||||
gd_wglGetProcAddress = (PFNWGLGETPROCADDRESS)GetProcAddress(module, "wglGetProcAddress");
|
||||
gd_wglCreateContext = (PFNWGLCREATECONTEXT)(void *)GetProcAddress(module, "wglCreateContext");
|
||||
gd_wglMakeCurrent = (PFNWGLMAKECURRENT)(void *)GetProcAddress(module, "wglMakeCurrent");
|
||||
gd_wglDeleteContext = (PFNWGLDELETECONTEXT)(void *)GetProcAddress(module, "wglDeleteContext");
|
||||
gd_wglGetProcAddress = (PFNWGLGETPROCADDRESS)(void *)GetProcAddress(module, "wglGetProcAddress");
|
||||
if (!gd_wglCreateContext || !gd_wglMakeCurrent || !gd_wglDeleteContext || !gd_wglGetProcAddress) {
|
||||
return gl_info;
|
||||
}
|
||||
@@ -143,7 +138,7 @@ Dictionary detect_wgl() {
|
||||
HGLRC new_hRC = gd_wglCreateContextAttribsARB(hDC, nullptr, attribs);
|
||||
if (new_hRC) {
|
||||
if (gd_wglMakeCurrent(hDC, new_hRC)) {
|
||||
PFNWGLGETSTRINGPROC gd_wglGetString = (PFNWGLGETSTRINGPROC)GetProcAddress(module, "glGetString");
|
||||
PFNWGLGETSTRINGPROC gd_wglGetString = (PFNWGLGETSTRINGPROC)(void *)GetProcAddress(module, "glGetString");
|
||||
if (gd_wglGetString) {
|
||||
const char *prefixes[] = {
|
||||
"OpenGL ES-CM ",
|
||||
|
||||
Reference in New Issue
Block a user