Set attrib to EGL_OPENGL_ES3_BIT_KRH if g_es3 is true

This commit is contained in:
twinaphex 2016-08-23 00:09:11 +02:00
parent cbbb840584
commit 035d006d62

View File

@ -45,6 +45,10 @@ int system_property_get(const char *cmd, const char *args, char *value);
#ifdef HAVE_OPENGLES
static bool g_es3;
#ifndef EGL_OPENGL_ES3_BIT_KHR
#define EGL_OPENGL_ES3_BIT_KHR 0x0040
#endif
#endif
typedef struct
@ -103,7 +107,7 @@ static void *android_gfx_ctx_init(void *video_driver)
EGL_CONTEXT_CLIENT_VERSION, g_es3 ? 3 : 2,
EGL_NONE
};
const EGLint attribs[] = {
EGLint attribs[] = {
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
EGL_BLUE_SIZE, 8,
@ -119,6 +123,11 @@ static void *android_gfx_ctx_init(void *video_driver)
if (!android_app || !and)
return false;
#ifdef HAVE_OPENGLES
if (g_es3)
attribs[1] = EGL_OPENGL_ES3_BIT_KHR;
#endif
switch (android_api)
{
case GFX_CTX_OPENGL_API: