fixing conflicts with opengl headers on some systems, same solution as
[freeglut] / progs / demos / shapes / shapes.c
index 7326914..c22c055 100644 (file)
@@ -91,9 +91,12 @@ typedef char ourGLchar;
 #define APIENTRY
 #endif
 
+#ifndef GL_VERSION_1_5
 typedef void (APIENTRY *PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers);
 typedef void (APIENTRY *PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer);
 typedef void (APIENTRY *PFNGLBUFFERDATAPROC) (GLenum target, ourGLsizeiptr size, const GLvoid *data, GLenum usage);
+#endif
+#ifndef GL_VERSION_2_0
 typedef GLuint (APIENTRY *PFNGLCREATESHADERPROC) (GLenum type);
 typedef void (APIENTRY *PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const ourGLchar **string, const GLint *length);
 typedef void (APIENTRY *PFNGLCOMPILESHADERPROC) (GLuint shader);
@@ -109,6 +112,7 @@ typedef GLint (APIENTRY *PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const ourG
 typedef GLint (APIENTRY *PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const ourGLchar *name);
 typedef void (APIENTRY *PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
 typedef void (APIENTRY *PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+#endif
 
 PFNGLCREATESHADERPROC gl_CreateShader;
 PFNGLSHADERSOURCEPROC gl_ShaderSource;
@@ -190,13 +194,13 @@ const ourGLchar *fragmentShaderSource[] = {
     "};",
     "lightSource light0 = lightSource(",
     "  vec4(2.0, 5.0, 5.0, 0.0),",
-    "  vec4(1.0,  1.0,  1.0, 1.0),",
-    "  vec4(1.0,  1.0,  1.0, 1.0),",
-    "  0.0, 1.0, 0.0,",
+    "  vec4(1.0, 1.0, 1.0, 1.0),",
+    "  vec4(1.0, 1.0, 1.0, 1.0),",
+    "    0.0, 1.0, 0.0,",
     "  180.0, 0.0,",
     "  vec3(0.0, 0.0, 0.0)",
     ");",
-    "vec4 scene_ambient = vec4(0.0, 0.0, 0.0, 1.0);",
+    "vec4 scene_ambient = vec4(0.2, 0.2, 0.2, 1.0);",
     " ",
     "struct material",
     "{",