[Cogl] [PATCH 3/3] sdl: Support setting resizable before allocate in SDL 1
Robert Bragg
robert at sixbynine.org
Tue Nov 20 14:53:33 PST 2012
This looks good to me:
Reviewed-by: Robert Bragg <robert at linux.intel.com>
thanks,
- Robert
On Tue, Nov 20, 2012 at 6:53 PM, Neil Roberts <neil at linux.intel.com> wrote:
> 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.
> ---
> cogl/winsys/cogl-winsys-sdl.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/cogl/winsys/cogl-winsys-sdl.c b/cogl/winsys/cogl-winsys-sdl.c
> index ccb0764..e1dd528 100644
> --- a/cogl/winsys/cogl-winsys-sdl.c
> +++ b/cogl/winsys/cogl-winsys-sdl.c
> @@ -286,6 +286,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)
> @@ -299,9 +300,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 */
> --
> 1.7.11.3.g3c3efa5
>
> _______________________________________________
> Cogl mailing list
> Cogl at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/cogl
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/cogl/attachments/20121120/c61d60fc/attachment.html>
More information about the Cogl
mailing list