提交 fe1adfce 编写于 作者: Z Zachary Lund

Broke Windows, here's a fix.

上级 5c3b5680
......@@ -26,7 +26,20 @@ static void* AppleGLGetProcAddress (const const char *name)
#pragma warning(disable: 4996)
#endif
#define IntGetProcAddress(name) wglGetProcAddress((LPCSTR)name)
static PROC WinGetProcAddress(const char *name)
{
static HMODULE glMod = NULL;
PROC pFunc = wglGetProcAddress((LPCSTR)name);
if (pFunc) return pFunc;
if (NULL == glMod)
glMod = GetModuleHandleA("OpenGL32.dll");
return (PROC)GetProcAddress(glMod, (LPCSTR)name);
}
#define IntGetProcAddress(name) WinGetProcAddress(name)
#endif
/* Linux, FreeBSD, other */
......
......@@ -26,7 +26,20 @@ static void* AppleGLGetProcAddress (const const char *name)
#pragma warning(disable: 4996)
#endif
#define IntGetProcAddress(name) wglGetProcAddress((LPCSTR)name)
static PROC WinGetProcAddress(const char *name)
{
static HMODULE glMod = NULL;
PROC pFunc = wglGetProcAddress((LPCSTR)name);
if (pFunc) return pFunc;
if (NULL == glMod)
glMod = GetModuleHandleA("OpenGL32.dll");
return (PROC)GetProcAddress(glMod, (LPCSTR)name);
}
#define IntGetProcAddress(name) WinGetProcAddress(name)
#endif
/* Linux, FreeBSD, other */
......
......@@ -26,7 +26,20 @@ static void* AppleGLGetProcAddress (const const char *name)
#pragma warning(disable: 4996)
#endif
#define IntGetProcAddress(name) wglGetProcAddress((LPCSTR)name)
static PROC WinGetProcAddress(const char *name)
{
static HMODULE glMod = NULL;
PROC pFunc = wglGetProcAddress((LPCSTR)name);
if (pFunc) return pFunc;
if (NULL == glMod)
glMod = GetModuleHandleA("OpenGL32.dll");
return (PROC)GetProcAddress(glMod, (LPCSTR)name);
}
#define IntGetProcAddress(name) WinGetProcAddress(name)
#endif
/* Linux, FreeBSD, other */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册