[cogl/wip/cogl-1.14: 69/177] sdl: Support setting resizable before allocate in SDL 1



commit 28407e3c80c9d69d28eea9f70564c070a19091a2
Author: Neil Roberts <neil linux intel com>
Date:   Tue Nov 20 18:50:42 2012 +0000

    sdl: Support setting resizable before allocate in SDL 1
    
    The SDL 1 winsys now checks for the initial resizable state of the
    onscreen framebuffer when it is allocated and updates the video flags
    accordingly.
    
    Reviewed-by: Robert Bragg <robert linux intel com>
    
    (cherry picked from commit f5fb9be70a92f751886a94da0b34e14252ed197e)

 cogl/winsys/cogl-winsys-sdl.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/cogl/winsys/cogl-winsys-sdl.c b/cogl/winsys/cogl-winsys-sdl.c
index 63abbd0..8c4e2ac 100644
--- a/cogl/winsys/cogl-winsys-sdl.c
+++ b/cogl/winsys/cogl-winsys-sdl.c
@@ -287,6 +287,7 @@ _cogl_winsys_onscreen_init (CoglOnscreen *onscreen,
   CoglContext *context = framebuffer->context;
   CoglDisplay *display = context->display;
   CoglDisplaySdl *sdl_display = display->winsys;
+  CoglBool flags_changed = FALSE;
   int width, height;
 
   if (sdl_display->onscreen)
@@ -300,9 +301,16 @@ _cogl_winsys_onscreen_init (CoglOnscreen *onscreen,
   width = cogl_framebuffer_get_width (framebuffer);
   height = cogl_framebuffer_get_height (framebuffer);
 
+  if (cogl_onscreen_get_resizable (onscreen))
+    {
+      sdl_display->video_mode_flags |= SDL_RESIZABLE;
+      flags_changed = TRUE;
+    }
+
   /* Try to update the video size using the onscreen size */
   if (width != sdl_display->surface->w ||
-      height != sdl_display->surface->h)
+      height != sdl_display->surface->h ||
+      flags_changed)
     {
       sdl_display->surface = SDL_SetVideoMode (width, height,
                                                0, /* bitsperpixel */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]