Commit f1a40e2f authored by Nigel Stewart's avatar Nigel Stewart
Browse files

Direct linking of glGetString and glGetIntegerv is necessary for Windows/WGL

parent 8042db9f
......@@ -81,11 +81,15 @@ static GLenum GLEWAPIENTRY glewContextInit ()
GLint major, minor;
size_t n;
/* query opengl version */
getString = (PFNGLGETSTRINGPROC) glewGetProcAddress((const GLubyte*)"glGetString");
#ifdef _WIN32
getString = glGetString;
#else
getString = (PFNGLGETSTRINGPROC) glewGetProcAddress((const GLubyte*)"glGetString");
if (!getString)
return GLEW_ERROR_NO_GL_VERSION;
#endif
/* query opengl version */
s = getString(GL_VERSION);
dot = _glewStrCLen(s, '.');
if (dot == 0)
......@@ -137,7 +141,12 @@ static GLenum GLEWAPIENTRY glewContextInit ()
const char *ext;
GLboolean *enable;
#ifdef _WIN32
getIntegerv = glGetIntegerv;
#else
getIntegerv = (PFNGLGETINTEGERVPROC) glewGetProcAddress((const GLubyte*)"glGetIntegerv");
#endif
if (getIntegerv)
getIntegerv(GL_NUM_EXTENSIONS, &n);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment