File tree 1 file changed +15
-7
lines changed 1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change 75
75
#include <GL/gl.h>
76
76
#include <GL/wglext.h>
77
77
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
-
83
78
// --------------------------------------------------------------------------------
84
79
// This part of the file contains pure functions that never access global state.
85
80
// This distinction helps keep the backend maintainable as the inputs and outputs
@@ -490,8 +485,21 @@ static BOOL IsWindows10Version1703OrGreaterWin32(void)
490
485
491
486
static void * FindProc (const char * name )
492
487
{
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 ;
495
503
}
496
504
static void * WglGetProcAddress (const char * name )
497
505
{
You can’t perform that action at this time.
0 commit comments