From http://www.jwz.org/xscreensaver/xscreensaver-5.35.tar.gz
[xscreensaver] / hacks / glx / tangram_shapes.c
index 916d0a88735ba517b4261dcd0e4c2d49e1e307a2..267b1873b3e154103790cb31ee4488a793ddbbf4 100644 (file)
@@ -9,12 +9,22 @@
  * implied warranty.
  */
 
-#ifdef HAVE_COCOA
-# include <OpenGL/gl.h>
-#else
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+#ifndef HAVE_JWXYZ
 # include <GL/gl.h>
 #endif
 
+#ifdef HAVE_ANDROID
+#include <GLES/gl.h>
+#endif
+
+#ifdef HAVE_JWZGLES
+# include "jwzgles.h"
+#endif /* HAVE_JWZGLES */
+
 #include "tangram_shapes.h"
 
 #define small_scale  ( 1 )
@@ -23,7 +33,8 @@
 
 #define alpha (0.05)
 
-static void tri_45_90(int wire)
+static void
+tri_45_90(int wire)
 {
     GLfloat vertices[][3] = {
         {0, alpha, 0},
@@ -81,8 +92,8 @@ static void tri_45_90(int wire)
     glEnd();
 }
 
-static
-void unit_cube(int wire)
+static void
+unit_cube(int wire)
 {
     glBegin((wire) ? GL_LINE_LOOP : GL_QUADS);
 
@@ -126,8 +137,8 @@ void unit_cube(int wire)
     glEnd();
 }
 
-static
-void unit_rhomboid(int wire)
+static void
+unit_rhomboid(int wire)
 {
     glBegin((wire) ? GL_LINE_LOOP : GL_QUADS);
 
@@ -173,7 +184,8 @@ void unit_rhomboid(int wire)
 
 /* All of the pieces have the same thickness so all of the Y values are the same */
 
-GLuint get_sm_tri_dl(int wire)
+GLuint
+tangram_get_sm_tri_dl(int wire)
 {
     GLuint triangle = glGenLists(1);
     glNewList(triangle, GL_COMPILE);
@@ -183,7 +195,8 @@ GLuint get_sm_tri_dl(int wire)
     return triangle;
 }
 
-GLuint get_lg_tri_dl(int wire)
+GLuint
+tangram_get_lg_tri_dl(int wire)
 {
     GLuint triangle = glGenLists(1);
     glNewList(triangle, GL_COMPILE);
@@ -193,7 +206,8 @@ GLuint get_lg_tri_dl(int wire)
     return triangle;
 }
 
-GLuint get_md_tri_dl(int wire)
+GLuint
+tangram_get_md_tri_dl(int wire)
 {
     GLuint triangle = glGenLists(1);
     glNewList(triangle, GL_COMPILE);
@@ -203,7 +217,8 @@ GLuint get_md_tri_dl(int wire)
     return triangle;
 }
 
-GLuint get_square_dl(int wire)
+GLuint
+tangram_get_square_dl(int wire)
 {
     GLuint square = glGenLists(1);
     glNewList(square, GL_COMPILE);
@@ -213,7 +228,8 @@ GLuint get_square_dl(int wire)
     return square;
 }
 
-GLuint get_rhomboid_dl(int wire)
+GLuint
+tangram_get_rhomboid_dl(int wire)
 {
     GLuint rhomboid = glGenLists(1);
     glNewList(rhomboid, GL_COMPILE);