Improve fallback to GLESv2 on iOS (resolve #1154)

This commit is contained in:
Joshua Granick
2018-02-14 13:30:58 -08:00
parent 918552df9c
commit f22fa77431
2 changed files with 14 additions and 1 deletions

View File

@@ -48,7 +48,9 @@ namespace lime {
// }
} else {
}
if (!context) {
sdlFlags |= SDL_RENDERER_SOFTWARE;

View File

@@ -118,6 +118,17 @@ namespace lime {
sdlWindow = SDL_CreateWindow (title, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, width, height, sdlFlags);
#if defined (IPHONE) || defined (APPLETV)
if (sdlWindow && !SDL_GL_CreateContext (sdlWindow)) {
SDL_DestroyWindow (sdlWindow);
SDL_GL_SetAttribute (SDL_GL_CONTEXT_MAJOR_VERSION, 2);
sdlWindow = SDL_CreateWindow (title, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, width, height, sdlFlags);
}
#endif
if (!sdlWindow) {
printf ("Could not create SDL window: %s.\n", SDL_GetError ());