src/render/opengles/SDL_render_gles.c
changeset 5333 5d3a2cd4e8c9
parent 5330 874c671c8043
child 5355 cc2215cda170
--- a/src/render/opengles/SDL_render_gles.c	Thu Feb 17 02:18:41 2011 -0800
+++ b/src/render/opengles/SDL_render_gles.c	Thu Feb 17 02:23:48 2011 -0800
@@ -54,6 +54,7 @@
 static void GLES_UnlockTexture(SDL_Renderer * renderer,
                                SDL_Texture * texture);
 static int GLES_UpdateViewport(SDL_Renderer * renderer);
+static int GLES_RenderClear(SDL_Renderer * renderer);
 static int GLES_RenderDrawPoints(SDL_Renderer * renderer,
                                  const SDL_Point * points, int count);
 static int GLES_RenderDrawLines(SDL_Renderer * renderer,
@@ -180,6 +181,7 @@
     renderer->LockTexture = GLES_LockTexture;
     renderer->UnlockTexture = GLES_UnlockTexture;
     renderer->UpdateViewport = GLES_UpdateViewport;
+    renderer->RenderClear = GLES_RenderClear;
     renderer->RenderDrawPoints = GLES_RenderDrawPoints;
     renderer->RenderDrawLines = GLES_RenderDrawLines;
     renderer->RenderFillRects = GLES_RenderFillRects;
@@ -451,6 +453,21 @@
     return 0;
 }
 
+static int
+GLES_RenderClear(SDL_Renderer * renderer)
+{
+    GLES_ActivateRenderer(renderer);
+
+    glClearColor((GLfloat) renderer->r * inv255f,
+                 (GLfloat) renderer->g * inv255f,
+                 (GLfloat) renderer->b * inv255f,
+                 (GLfloat) renderer->a * inv255f);
+
+    glClear(GL_COLOR_BUFFER_BIT);
+
+    return 0;
+}
+
 static void
 GLES_SetBlendMode(GLES_RenderData * data, int blendMode)
 {