From 1eecc41ef65300fb849e42110a2463fa2b3ce376 Mon Sep 17 00:00:00 2001 From: vanfanel Date: Fri, 4 Dec 2015 13:11:22 +0100 Subject: OPENGLSDL: Request GLES1.1 context with SDL2 for GLES targets. --- backends/graphics/openglsdl/openglsdl-graphics.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'backends/graphics/openglsdl/openglsdl-graphics.cpp') diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp index a2b172f14a..42327197b7 100644 --- a/backends/graphics/openglsdl/openglsdl-graphics.cpp +++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp @@ -386,6 +386,13 @@ bool OpenGLSdlGraphicsManager::setupMode(uint width, uint height) { } } +#ifdef USE_GLES + // SDL2 will create a GLES2 context by default, so this is needed for GLES1-profile + // functions to work. + SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES); + SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 1); + SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); +#endif _glContext = SDL_GL_CreateContext(_window->getSDLWindow()); if (!_glContext) { return false; -- cgit v1.2.3