Added support for creating OpenGL ES 2 and 3 contexts, and updated the OpenGL context creation code to be more robust in general.

If the LOVE_GRAPHICS_USE_OPENGLES environment variable is set, then love will try to create an OpenGL ES context before falling back to regular OpenGL. If it's not set (or set to 0), then the opposite happens except when love is run on backends that should always use OpenGL ES.

--HG--
branch : minor
This commit is contained in:
Alex Szpakowski
2015-01-22 01:02:01 -04:00
parent be8b7dd504
commit 15538426d7
4 changed files with 212 additions and 113 deletions
+13 -1
View File
@@ -103,8 +103,18 @@ public:
private:
struct ContextAttribs
{
int versionMajor;
int versionMinor;
bool gles;
bool debug;
};
void setGLFramebufferAttributes(int msaa, bool sRGB);
void setGLContextAttributes(const ContextAttribs &attribs);
bool checkGLVersion(int versionmajor, int versionminor);
bool setContext(int msaa, bool vsync, bool sRGB);
void setWindowGLAttributes(int msaa, bool sRGB) const;
// Update the saved window settings based on the window's actual state.
void updateSettings(const WindowSettings &newsettings);
@@ -129,6 +139,8 @@ private:
SDL_Window *window;
SDL_GLContext context;
bool displayedContextError;
}; // Window
} // sdl