Mercurial > sdl-ios-xcode
diff src/render/opengles2/SDL_render_gles2.c @ 5227:c66b2a778b7e
Try to create an OpenGL ES 2.0 context on Android and successfully fall back to OpenGL ES 1.1 if that fails.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Mon, 07 Feb 2011 17:44:07 -0800 |
parents | b0797947dd1c |
children | 2178ffe17222 |
line wrap: on
line diff
--- a/src/render/opengles2/SDL_render_gles2.c Mon Feb 07 16:45:40 2011 -0800 +++ b/src/render/opengles2/SDL_render_gles2.c Mon Feb 07 17:44:07 2011 -0800 @@ -1071,11 +1071,19 @@ { SDL_Renderer *renderer; GLES2_DriverContext *rdata; + Uint32 window_flags; GLint nFormats; #ifndef ZUNE_HD GLboolean hasCompiler; #endif + window_flags = SDL_GetWindowFlags(window); + if (!(window_flags & SDL_WINDOW_OPENGL)) { + if (SDL_RecreateWindow(window, window_flags | SDL_WINDOW_OPENGL) < 0) { + return NULL; + } + } + /* Create the renderer struct */ renderer = (SDL_Renderer *)SDL_calloc(1, sizeof(SDL_Renderer)); if (!renderer) {