File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7575#include <GL/gl.h>
7676#include <GL/wglext.h>
7777
78- // undefined the glad_glGetString macro definition
79- #undef glGetString
80- // this should come from win32's GL/gl.h...not sure why it's not in this context
81- const GLubyte * WINAPI glGetString (GLenum );
82-
8378// --------------------------------------------------------------------------------
8479// This part of the file contains pure functions that never access global state.
8580// This distinction helps keep the backend maintainable as the inputs and outputs
@@ -490,8 +485,21 @@ static BOOL IsWindows10Version1703OrGreaterWin32(void)
490485
491486static void * FindProc (const char * name )
492487{
493- if (0 == strcmp (name , "glGetString" )) return glGetString ;
494- return wglGetProcAddress (name );
488+ {
489+ void * proc = wglGetProcAddress (name );
490+ if (proc ) return proc ;
491+ }
492+
493+ static HMODULE opengl = NULL ;
494+ if (!opengl ) {
495+ opengl = LoadLibraryW (L"opengl32" );
496+ }
497+ if (opengl ) {
498+ void * proc = GetProcAddress (opengl , name );
499+ if (proc ) return proc ;
500+ }
501+
502+ return NULL ;
495503}
496504static void * WglGetProcAddress (const char * name )
497505{
You can’t perform that action at this time.
0 commit comments