X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffg_gl2.c;h=38b0acbb26e4f8e102aaea4d68e150feb1217ac7;hb=a67edfb64096e4da7f8b7d6cd34de78c7fc72c54;hp=4ef87be392a7a7345bb2c941a0a3bc8cc76f4066;hpb=b180b2a7d0d012ff8dc6a8c823dc358c378c4509;p=freeglut diff --git a/src/fg_gl2.c b/src/fg_gl2.c index 4ef87be..38b0acb 100644 --- a/src/fg_gl2.c +++ b/src/fg_gl2.c @@ -43,8 +43,9 @@ void FGAPIENTRY glutSetVertexAttribTexCoord2(GLint attrib) { } void fgInitGL2() { -#ifndef GL_ES_VERSION_2_0 - fgState.HasOpenGL20 = 0; +#ifdef GL_ES_VERSION_2_0 + fgState.HasOpenGL20 = (fgState.MajorVersion >= 2); +#else /* TODO: Mesa returns a valid stub function, rather than NULL, when we request a non-existent function */ #define CHECK(func, a) if ((a) == NULL) { fgWarning("fgInitGL2: " func " is NULL"); return; } @@ -56,6 +57,6 @@ void fgInitGL2() { CHECK("fghEnableVertexAttribArray", fghEnableVertexAttribArray = (FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC)glutGetProcAddress("glEnableVertexAttribArray")); CHECK("fghDisableVertexAttribArray", fghDisableVertexAttribArray = (FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC)glutGetProcAddress("glDisableVertexAttribArray")); #undef CHECK -#endif fgState.HasOpenGL20 = 1; +#endif }