Skip to content

Commit

Permalink
Pull wglGetProcAdress from opengl32.dll runtime.
Browse files Browse the repository at this point in the history
  • Loading branch information
skaslev committed Dec 14, 2017
1 parent c8aad29 commit b65ad62
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gl3w_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,15 @@ def write(f, s):
#include <windows.h>
static HMODULE libgl;
static PROC (__stdcall *wgl_get_proc_address)(LPCSTR);
static int open_libgl(void)
{
libgl = LoadLibraryA("opengl32.dll");
if (!libgl)
return GL3W_ERROR_LIBRARY_OPEN;
*(void **)(&wgl_get_proc_address) = GetProcAddress(libgl, "wglGetProcAddress");
return GL3W_OK;
}
Expand All @@ -209,7 +211,7 @@ def write(f, s):
{
GL3WglProc res;
res = (GL3WglProc)wglGetProcAddress(proc);
res = (GL3WglProc)wgl_get_proc_address(proc);
if (!res)
res = (GL3WglProc)GetProcAddress(libgl, proc);
return res;
Expand Down

0 comments on commit b65ad62

Please sign in to comment.