Load glGetString before trying to use it.

This commit is contained in:
bearoso 2018-05-29 16:20:54 -05:00 committed by GitHub
parent 2b4806b9ca
commit fb7c599bd4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -3187,12 +3187,11 @@ int ogl_LoadFunctions()
{ {
int numFailed = 0; int numFailed = 0;
ClearExtensionVars(); ClearExtensionVars();
if (ogl_GetMajorVersion() < 3)
{
_ptrc_glGetString = (const GLubyte * (CODEGEN_FUNCPTR *)(GLenum))IntGetProcAddress("glGetString"); _ptrc_glGetString = (const GLubyte * (CODEGEN_FUNCPTR *)(GLenum))IntGetProcAddress("glGetString");
if(!_ptrc_glGetString) return ogl_LOAD_FAILED; if(!_ptrc_glGetString) return ogl_LOAD_FAILED;
if (ogl_GetMajorVersion() < 3)
{
ProcExtsFromExtString((const char *)_ptrc_glGetString(GL_EXTENSIONS)); ProcExtsFromExtString((const char *)_ptrc_glGetString(GL_EXTENSIONS));
} }
else else