src/render/opengles/SDL_render_gles.c
changeset 6190 519380462400
parent 6188 e82023802002
child 6232 37e8d0736366
equal deleted inserted replaced
6189:b5a665fbaedc 6190:519380462400
    38 
    38 
    39 #endif /* PANDORA */
    39 #endif /* PANDORA */
    40 
    40 
    41 /* OpenGL ES 1.1 renderer implementation, based on the OpenGL renderer */
    41 /* OpenGL ES 1.1 renderer implementation, based on the OpenGL renderer */
    42 
    42 
    43 /* Used to re-create the window with OpenGL capability */
    43 /* Used to re-create the window with OpenGL ES capability */
    44 extern int SDL_RecreateWindow(SDL_Window * window, Uint32 flags);
    44 extern int SDL_RecreateWindow(SDL_Window * window, Uint32 flags);
    45 
    45 
    46 static const float inv255f = 1.0f / 255.0f;
    46 static const float inv255f = 1.0f / 255.0f;
    47 
    47 
    48 static SDL_Renderer *GLES_CreateRenderer(SDL_Window * window, Uint32 flags);
    48 static SDL_Renderer *GLES_CreateRenderer(SDL_Window * window, Uint32 flags);
   149     SDL_SetError("%s: %s", prefix, error);
   149     SDL_SetError("%s: %s", prefix, error);
   150 }
   150 }
   151 
   151 
   152 static int GLES_LoadFunctions(GLES_RenderData * data)
   152 static int GLES_LoadFunctions(GLES_RenderData * data)
   153 {
   153 {
       
   154 #if SDL_VIDEO_DRIVER_UIKIT
       
   155 #define __SDL_NOGETPROCADDR__
       
   156 #elif SDL_VIDEO_DRIVER_ANDROID
       
   157 #define __SDL_NOGETPROCADDR__
       
   158 #elif SDL_VIDEO_DRIVER_PANDORA
       
   159 #define __SDL_NOGETPROCADDR__
       
   160 #endif
       
   161 
   154 #ifdef __SDL_NOGETPROCADDR__
   162 #ifdef __SDL_NOGETPROCADDR__
   155 #define SDL_PROC(ret,func,params) data->func=func;
   163 #define SDL_PROC(ret,func,params) data->func=func;
   156 #else
   164 #else
   157 #define SDL_PROC(ret,func,params) \
   165 #define SDL_PROC(ret,func,params) \
   158     do { \
   166     do { \
   316 }
   324 }
   317 
   325 
   318 static void
   326 static void
   319 GLES_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event)
   327 GLES_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event)
   320 {
   328 {
       
   329     GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata;
       
   330     
   321     if (event->event == SDL_WINDOWEVENT_SIZE_CHANGED) {
   331     if (event->event == SDL_WINDOWEVENT_SIZE_CHANGED) {
   322         /* Rebind the context to the window area and update matrices */
   332         /* Rebind the context to the window area and update matrices */
   323         SDL_CurrentContext = NULL;
   333         SDL_CurrentContext = NULL;
   324     }
   334     }
   325 
   335 
   326     if (event->event == SDL_WINDOWEVENT_MINIMIZED) {
   336     if (event->event == SDL_WINDOWEVENT_MINIMIZED) {
   327         /* According to Apple documentation, we need to finish drawing NOW! */
   337         /* According to Apple documentation, we need to finish drawing NOW! */
   328 	glFinish();
   338 	data->glFinish();
   329     }
   339     }
   330 }
   340 }
   331 
   341 
   332 static __inline__ int
   342 static __inline__ int
   333 power_of_2(int input)
   343 power_of_2(int input)