src/render/opengles2/SDL_render_gles2.c
changeset 5333 5d3a2cd4e8c9
parent 5332 ae8b6fb1feaf
child 5355 cc2215cda170
equal deleted inserted replaced
5332:ae8b6fb1feaf 5333:5d3a2cd4e8c9
   768 static int GLES2_RenderFillRects(SDL_Renderer *renderer, const SDL_Rect *rects, int count);
   768 static int GLES2_RenderFillRects(SDL_Renderer *renderer, const SDL_Rect *rects, int count);
   769 static int GLES2_RenderCopy(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *srcrect,
   769 static int GLES2_RenderCopy(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *srcrect,
   770                             const SDL_Rect *dstrect);
   770                             const SDL_Rect *dstrect);
   771 static void GLES2_RenderPresent(SDL_Renderer *renderer);
   771 static void GLES2_RenderPresent(SDL_Renderer *renderer);
   772 
   772 
       
   773 
   773 static int
   774 static int
   774 GLES2_RenderClear(SDL_Renderer *renderer)
   775 GLES2_RenderClear(SDL_Renderer * renderer)
   775 {
   776 {
   776     float r = (float)renderer->r * inv255f;
       
   777     float g = (float)renderer->g * inv255f;
       
   778     float b = (float)renderer->b * inv255f;
       
   779     float a = (float)renderer->a * inv255f;
       
   780 
       
   781     GLES2_ActivateRenderer(renderer);
   777     GLES2_ActivateRenderer(renderer);
   782 
   778 
   783     /* Clear the backbuffer with the selected color */
   779     glClearColor((GLfloat) renderer->r * inv255f,
   784     glClearColor(r, g, b, a);
   780                  (GLfloat) renderer->g * inv255f,
       
   781                  (GLfloat) renderer->b * inv255f,
       
   782                  (GLfloat) renderer->a * inv255f);
       
   783 
   785     glClear(GL_COLOR_BUFFER_BIT);
   784     glClear(GL_COLOR_BUFFER_BIT);
       
   785 
   786     return 0;
   786     return 0;
   787 }
   787 }
   788 
   788 
   789 static void
   789 static void
   790 GLES2_SetBlendMode(int blendMode)
   790 GLES2_SetBlendMode(int blendMode)