X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffg_gl2.c;h=38b0acbb26e4f8e102aaea4d68e150feb1217ac7;hb=207c3128bf025b5e025bace5c0425d380dd72aa9;hp=deb4bb2abcdc01591a3086e3465e504caa34edfd;hpb=cb1e59cf5e6ac8034ae91abfd320874004a44c88;p=freeglut diff --git a/src/fg_gl2.c b/src/fg_gl2.c index deb4bb2..38b0acb 100644 --- a/src/fg_gl2.c +++ b/src/fg_gl2.c @@ -37,9 +37,15 @@ void FGAPIENTRY glutSetVertexAttribNormal(GLint attrib) { fgStructure.CurrentWindow->Window.attribute_v_normal = attrib; } +void FGAPIENTRY glutSetVertexAttribTexCoord2(GLint attrib) { + if (fgStructure.CurrentWindow != NULL) + fgStructure.CurrentWindow->Window.attribute_v_texture = 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; } @@ -51,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 }