comparison 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
comparison
equal deleted inserted replaced
5226:2ee8112bfc6b 5227:c66b2a778b7e
1069 static SDL_Renderer * 1069 static SDL_Renderer *
1070 GLES2_CreateRenderer(SDL_Window *window, Uint32 flags) 1070 GLES2_CreateRenderer(SDL_Window *window, Uint32 flags)
1071 { 1071 {
1072 SDL_Renderer *renderer; 1072 SDL_Renderer *renderer;
1073 GLES2_DriverContext *rdata; 1073 GLES2_DriverContext *rdata;
1074 Uint32 window_flags;
1074 GLint nFormats; 1075 GLint nFormats;
1075 #ifndef ZUNE_HD 1076 #ifndef ZUNE_HD
1076 GLboolean hasCompiler; 1077 GLboolean hasCompiler;
1077 #endif 1078 #endif
1079
1080 window_flags = SDL_GetWindowFlags(window);
1081 if (!(window_flags & SDL_WINDOW_OPENGL)) {
1082 if (SDL_RecreateWindow(window, window_flags | SDL_WINDOW_OPENGL) < 0) {
1083 return NULL;
1084 }
1085 }
1078 1086
1079 /* Create the renderer struct */ 1087 /* Create the renderer struct */
1080 renderer = (SDL_Renderer *)SDL_calloc(1, sizeof(SDL_Renderer)); 1088 renderer = (SDL_Renderer *)SDL_calloc(1, sizeof(SDL_Renderer));
1081 if (!renderer) { 1089 if (!renderer) {
1082 SDL_OutOfMemory(); 1090 SDL_OutOfMemory();