Applied Christian's change to drop unnecessary dependency to X11 libraries we
[freeglut] / src / fg_gl2.c
index deb4bb2..38b0acb 100644 (file)
@@ -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
 }