diff src/video/photon/SDL_photon.h @ 3193:64e4442676a6

Fixed problems with OpenGL ES window resizing.
author Mike Gorchak <lestat@i.com.ua>
date Thu, 11 Jun 2009 05:57:32 +0000
parents 7f684f249ec9
children 04af265172f9
line wrap: on
line diff
--- a/src/video/photon/SDL_photon.h	Wed Jun 10 18:32:42 2009 +0000
+++ b/src/video/photon/SDL_photon.h	Thu Jun 11 05:57:32 2009 +0000
@@ -55,7 +55,9 @@
     EGLDisplay egldisplay;      /* OpenGL ES display connection         */
     uint32_t egl_refcount;      /* OpenGL ES reference count            */
     uint32_t swapinterval;      /* OpenGL ES default swap interval      */
-#endif                          /* SDL_VIDEO_OPENGL_ES */
+    EGLContext lgles_context;   /* Last used OpenGL ES context          */
+    EGLSurface lgles_surface;   /* Last used OpenGL ES target surface   */
+#endif /* SDL_VIDEO_OPENGL_ES */
 } SDL_VideoData;
 
 /* This is hardcoded value in photon/Pg.h */
@@ -68,18 +70,18 @@
 typedef struct SDL_DisplayData
 {
     uint32_t device_id;
-    uint32_t custom_refresh;    /* Custom refresh rate for all modes  */
+    uint32_t custom_refresh;            /* Custom refresh rate for all modes  */
     SDL_DisplayMode current_mode;       /* Current video mode                 */
     uint8_t description[SDL_VIDEO_PHOTON_DEVICENAME_MAX];
-    /* Device description                 */
-    uint32_t caps;              /* Device capabilities                */
-    PhCursorDef_t *cursor;      /* Global cursor settings             */
-    SDL_bool cursor_visible;    /* SDL_TRUE if cursor visible         */
-    uint32_t cursor_size;       /* Cursor size in memory w/ structure */
+    /* Device description */
+    uint32_t caps;                      /* Device capabilities                */
+    PhCursorDef_t *cursor;              /* Global cursor settings             */
+    SDL_bool cursor_visible;            /* SDL_TRUE if cursor visible         */
+    uint32_t cursor_size;               /* Cursor size in memory w/ structure */
 #if defined(SDL_VIDEO_OPENGL_ES)
-    gf_display_t display;       /* GF display handle                  */
+    gf_display_t display;               /* GF display handle                  */
     gf_display_info_t display_info;     /* GF display information             */
-#endif                          /* SDL_VIDEO_OPENGL_ES */
+#endif /* SDL_VIDEO_OPENGL_ES */
 } SDL_DisplayData;
 
 /* Maximum amount of OpenGL ES framebuffer configurations */
@@ -88,17 +90,17 @@
 typedef struct SDL_WindowData
 {
     SDL_bool uses_gles;         /* if true window must support OpenGL ES */
-    PtWidget_t *window;         /* window handle                        */
+    PtWidget_t *window;         /* window handle                         */
 #if defined(SDL_VIDEO_OPENGL_ES)
     EGLConfig gles_configs[SDL_VIDEO_GF_OPENGLES_CONFS];
-    /* OpenGL ES framebuffer confs        */
-    EGLint gles_config;         /* OpenGL ES configuration index      */
-    EGLContext gles_context;    /* OpenGL ES context                  */
+    /* OpenGL ES framebuffer confs */
+    EGLint gles_config;                 /* OpenGL ES configuration index      */
+    EGLContext gles_context;            /* OpenGL ES context                  */
     EGLint gles_attributes[256];        /* OpenGL ES attributes for context   */
-    EGLSurface gles_surface;    /* OpenGL ES target rendering surface */
-    gf_surface_t gfsurface;     /* OpenGL ES GF's surface             */
+    EGLSurface gles_surface;            /* OpenGL ES target rendering surface */
+    gf_surface_t gfsurface;             /* OpenGL ES GF's surface             */
     PdOffscreenContext_t *phsurface;    /* OpenGL ES Photon's surface         */
-#endif                          /* SDL_VIDEO_OPENGL_ES */
+#endif /* SDL_VIDEO_OPENGL_ES */
 } SDL_WindowData;
 
 /****************************************************************************/
@@ -158,6 +160,9 @@
 void photon_gl_swapwindow(_THIS, SDL_Window * window);
 void photon_gl_deletecontext(_THIS, SDL_GLContext context);
 
+/* Helper function, which re-creates surface, not an API */
+int photon_gl_recreatesurface(_THIS, SDL_Window * window, uint32_t width, uint32_t height);
+
 /* Event handling function */
 void photon_pumpevents(_THIS);