Try to create an OpenGL ES 2.0 context on Android and successfully fall back to OpenGL ES 1.1 if that fails.

This commit is contained in:
Sam Lantinga 2011-02-07 17:44:07 -08:00
parent f582f9e58e
commit 9127589299
6 changed files with 61 additions and 14 deletions

View file

@ -1071,11 +1071,19 @@ GLES2_CreateRenderer(SDL_Window *window, Uint32 flags)
{
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) {