mirror of
https://github.com/nigels-com/glew.git
synced 2024-11-11 08:43:49 +00:00
Direct linking of glGetString and glGetIntegerv is necessary for Windows/WGL
This commit is contained in:
parent
8042db9fa3
commit
f1a40e2fea
@ -81,11 +81,15 @@ static GLenum GLEWAPIENTRY glewContextInit ()
|
|||||||
GLint major, minor;
|
GLint major, minor;
|
||||||
size_t n;
|
size_t n;
|
||||||
|
|
||||||
/* query opengl version */
|
#ifdef _WIN32
|
||||||
getString = (PFNGLGETSTRINGPROC) glewGetProcAddress((const GLubyte*)"glGetString");
|
getString = glGetString;
|
||||||
|
#else
|
||||||
|
getString = (PFNGLGETSTRINGPROC) glewGetProcAddress((const GLubyte*)"glGetString");
|
||||||
if (!getString)
|
if (!getString)
|
||||||
return GLEW_ERROR_NO_GL_VERSION;
|
return GLEW_ERROR_NO_GL_VERSION;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* query opengl version */
|
||||||
s = getString(GL_VERSION);
|
s = getString(GL_VERSION);
|
||||||
dot = _glewStrCLen(s, '.');
|
dot = _glewStrCLen(s, '.');
|
||||||
if (dot == 0)
|
if (dot == 0)
|
||||||
@ -137,7 +141,12 @@ static GLenum GLEWAPIENTRY glewContextInit ()
|
|||||||
const char *ext;
|
const char *ext;
|
||||||
GLboolean *enable;
|
GLboolean *enable;
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
getIntegerv = glGetIntegerv;
|
||||||
|
#else
|
||||||
getIntegerv = (PFNGLGETINTEGERVPROC) glewGetProcAddress((const GLubyte*)"glGetIntegerv");
|
getIntegerv = (PFNGLGETINTEGERVPROC) glewGetProcAddress((const GLubyte*)"glGetIntegerv");
|
||||||
|
#endif
|
||||||
|
|
||||||
if (getIntegerv)
|
if (getIntegerv)
|
||||||
getIntegerv(GL_NUM_EXTENSIONS, &n);
|
getIntegerv(GL_NUM_EXTENSIONS, &n);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user