Fix remaining errors when compiling against GL ES 1.1 headers
authorparasti <parasti@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Sat, 9 Apr 2011 17:42:16 +0000 (17:42 +0000)
committerparasti <parasti@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Sat, 9 Apr 2011 17:42:16 +0000 (17:42 +0000)
git-svn-id: https://s.snth.net/svn/neverball/branches/gles@3567 78b8d119-cf0a-0410-b17c-f493084dd1d7

ball/game_draw.c
ball/main.c
putt/game.c
putt/main.c
share/glext.h
share/gui.c
share/image.c
share/item.c

index 32f0c2f..0e71446 100644 (file)
@@ -295,7 +295,7 @@ static void game_clip_refl(int d)
 
 static void game_clip_ball(const struct game_draw *gd, int d, const float *p)
 {
-    GLdouble r, c[3], pz[4], nz[4];
+    GLfloat r, c[3], pz[4], nz[4];
 
     /* Compute the plane giving the front of the ball, as seen from view.p. */
 
index 398d39c..d06092d 100644 (file)
@@ -54,7 +54,7 @@ static void shot(void)
 
 static void toggle_wire(void)
 {
-/*
+#ifndef CONF_OPENGLES
     static int wire = 0;
 
     if (wire)
@@ -71,7 +71,7 @@ static void toggle_wire(void)
         glDisable(GL_LIGHTING);
         wire = 1;
     }
-*/
+#endif
 }
 
 /*---------------------------------------------------------------------------*/
index 1a85ee1..84d3792 100644 (file)
@@ -177,7 +177,10 @@ static const struct d_mtrl *game_draw_balls(const struct d_mtrl *mq,
                          fp->uv[ui].r,
                          fp->uv[ui].r);
 
-                glColor4fv(color[ui]);
+                glColor4f(color[ui][0],
+                          color[ui][1],
+                          color[ui][2],
+                          color[ui][3]);
                 mq = ball_draw(mq, ball_M, pend_M, bill_M, t);
             }
             glPopMatrix();
index 3bf6aef..fe4a97c 100644 (file)
@@ -54,6 +54,7 @@ static int shot(void)
 
 static void toggle_wire(void)
 {
+#ifndef CONF_OPENGLES
     static int wire = 0;
 
     if (wire)
@@ -70,6 +71,7 @@ static void toggle_wire(void)
         glDisable(GL_LIGHTING);
         wire = 1;
     }
+#endif
 }
 /*---------------------------------------------------------------------------*/
 
index 06b54e3..7aec78e 100644 (file)
@@ -107,7 +107,7 @@ void glext_init(void);
 #define glIsBuffer_            glIsBuffer
 #define glPointParameterfv_    glPointParameterfv
 
-#define glOrtho_               glOrtho
+#define glOrtho_               glOrthof
 
 #else /* No native linkage?  Define the extension API. */
 
index 5197a57..8ac72d5 100644 (file)
@@ -1297,7 +1297,7 @@ static void gui_paint_rect(int id, int st)
             glTranslatef((GLfloat) (widget[id].x + widget[id].w / 2),
                          (GLfloat) (widget[id].y + widget[id].h / 2), 0.f);
 
-            glColor4fv(back[i]);
+            glColor4f(back[i][0], back[i][1], back[i][2], back[i][3]);
             draw_rect(id);
         }
         glPopMatrix();
@@ -1535,7 +1535,7 @@ void gui_paint(int id)
                 gui_paint_text(id);
 
                 draw_disable();
-                glColor4ubv(gui_wht);
+                glColor4ub(gui_wht[0], gui_wht[1], gui_wht[2], gui_wht[3]);
             }
             glEnable(GL_DEPTH_TEST);
             glEnable(GL_LIGHTING);
index 1a0e091..42a937a 100644 (file)
@@ -113,7 +113,9 @@ static GLuint make_texture(const void *p, int w, int h, int b)
 #ifdef GL_TEXTURE_MAX_ANISOTROPY_EXT
     int a = config_get_d(CONFIG_ANISO);
 #endif
+#ifdef GL_GENERATE_MIPMAP_SGIS
     int m = config_get_d(CONFIG_MIPMAP);
+#endif
     int k = config_get_d(CONFIG_TEXTURES);
     int W = w;
     int H = h;
index 1d49e3b..d1b8aea 100644 (file)
@@ -114,7 +114,7 @@ const struct d_mtrl *item_draw(const struct d_mtrl *mq,
 
     item_color(hp, c);
 
-    glColor4fv(c);
+    glColor4f(c[0], c[1], c[2], c[3]);
 
     glDepthMask(GL_FALSE);
     {