YaGL: OpenGL versioning support added 31/13131/1
authorStanislav Vorobiov <s.vorobiov@samsung.com>
Tue, 22 Oct 2013 10:18:04 +0000 (14:18 +0400)
committerStanislav Vorobiov <s.vorobiov@samsung.com>
Tue, 22 Oct 2013 10:18:04 +0000 (14:18 +0400)
In order to implement GLESv3 we need proper host
OpenGL versioning. There're 3 cases:
* If host OpenGL <= 3.1 and GL_ARB_ES3_compatibility not supported - GLESv2 only on target
* If host OpenGL >= 3.1 and GL_ARB_ES3_compatibility supported - GLESv3 on target - no shader patch
* If host OpenGL > 3.1 and GL_ARB_ES3_compatibility not supported - GLESv3 on target - shader patch

Change-Id: I5ccc554bf9f662fe29391e027d6299a4dd952a12

23 files changed:
hw/yagl_apis/egl/yagl_egl_config.c
hw/yagl_apis/gles/yagl_host_gles_calls.c
hw/yagl_backends/egl_offscreen/yagl_egl_offscreen.c
hw/yagl_backends/egl_onscreen/yagl_egl_onscreen.c
hw/yagl_device.c
hw/yagl_drivers/egl_glx/yagl_egl_glx.c
hw/yagl_drivers/gles_ogl/yagl_gles_ogl.c
hw/yagl_drivers/gles_ogl/yagl_gles_ogl.h
hw/yagl_drivers/gles_onscreen/yagl_gles_onscreen.c
hw/yagl_egl_backend.c
hw/yagl_egl_backend.h
hw/yagl_egl_driver.c
hw/yagl_egl_driver.h
hw/yagl_gles_driver.c
hw/yagl_gles_driver.h
hw/yagl_inc/EGL/eglext.h
hw/yagl_inc/EGL/eglmesaext.h
hw/yagl_inc/EGL/eglplatform.h
hw/yagl_inc/KHR/khrplatform.h
hw/yagl_server.c
hw/yagl_server.h
hw/yagl_types.h
hw/yagl_version.h

index 93bbb62..f8996f1 100644 (file)
@@ -132,6 +132,10 @@ static struct yagl_egl_config
     cfg->native.native_renderable = EGL_TRUE;
     cfg->native.renderable_type = EGL_OPENGL_ES_BIT | EGL_OPENGL_ES2_BIT;
 
+    if (dpy->backend->gl_version > yagl_gl_2) {
+        cfg->native.renderable_type |= EGL_OPENGL_ES3_BIT_KHR;
+    }
+
     cfg->native.conformant =
         (((cfg->native.red_size + cfg->native.green_size + cfg->native.blue_size + cfg->native.alpha_size) > 0) &&
          (cfg->native.caveat != EGL_NON_CONFORMANT_CONFIG)) ? cfg->native.renderable_type : 0;
index d1922f5..d46e628 100644 (file)
@@ -1486,7 +1486,48 @@ void yagl_host_glGetFloatv(GLenum pname,
 void yagl_host_glGetString(GLenum name,
     GLchar *str, int32_t str_maxcount, int32_t *str_count)
 {
-    const char *tmp = (const char*)gles_api_ts->driver->GetString(name);
+    const char *tmp;
+
+    if ((name == GL_EXTENSIONS) &&
+        (gles_api_ts->driver->gl_version > yagl_gl_2)) {
+        struct yagl_vector v;
+        uint32_t i;
+        char nb = '\0';
+
+        yagl_vector_init(&v, 1, 0);
+
+        for (i = 0, tmp = (const char*)gles_api_ts->driver->GetStringi(name, i);
+             tmp;
+             ++i, tmp = (const char*)gles_api_ts->driver->GetStringi(name, i)) {
+            int size = yagl_vector_size(&v);
+            int ext_len = strlen(tmp);
+
+            yagl_vector_resize(&v, size + ext_len + 1);
+
+            memcpy(yagl_vector_data(&v) + size, tmp, ext_len);
+
+            *(char*)(yagl_vector_data(&v) + size + ext_len) = ' ';
+        }
+
+        yagl_vector_push_back(&v, &nb);
+
+        tmp = yagl_vector_data(&v);
+
+        if (str_count) {
+            *str_count = strlen(tmp) + 1;
+        }
+
+        if (str && (str_maxcount > 0)) {
+            strncpy(str, tmp, str_maxcount);
+            str[str_maxcount - 1] = '\0';
+        }
+
+        yagl_vector_cleanup(&v);
+
+        return;
+    }
+
+    tmp = (const char*)gles_api_ts->driver->GetString(name);
 
     if (str_count) {
         *str_count = strlen(tmp) + 1;
index 1ccf98a..40d0366 100644 (file)
@@ -222,7 +222,9 @@ struct yagl_egl_backend *yagl_egl_offscreen_create(struct yagl_egl_driver *egl_d
 
     yagl_egl_pbuffer_attribs_init(&attribs);
 
-    yagl_egl_backend_init(&egl_offscreen->base, yagl_render_type_offscreen);
+    yagl_egl_backend_init(&egl_offscreen->base,
+                          yagl_render_type_offscreen,
+                          egl_driver->gl_version);
 
     dpy = egl_driver->display_open(egl_driver);
 
index 8d98f71..342c96e 100644 (file)
@@ -306,7 +306,9 @@ struct yagl_egl_backend *yagl_egl_onscreen_create(struct winsys_interface *wsi,
 
     yagl_egl_pbuffer_attribs_init(&attribs);
 
-    yagl_egl_backend_init(&egl_onscreen->base, yagl_render_type_onscreen);
+    yagl_egl_backend_init(&egl_onscreen->base,
+                          yagl_render_type_onscreen,
+                          egl_driver->gl_version);
 
     dpy = egl_driver->display_open(egl_driver);
 
index b6561d8..4395109 100644 (file)
@@ -209,7 +209,8 @@ static int yagl_device_init(PCIDevice *dev)
         goto fail;
     }
 
-    gles_driver = yagl_gles_ogl_create(egl_driver->dyn_lib);
+    gles_driver = yagl_gles_ogl_create(egl_driver->dyn_lib,
+                                       egl_driver->gl_version);
 
     if (!gles_driver) {
         goto fail;
index eb0d2dc..3f2e12a 100644 (file)
@@ -77,6 +77,7 @@ struct yagl_egl_glx
     PFNGLXGETFBCONFIGSPROC glXGetFBConfigs;
     PFNGLXGETFBCONFIGATTRIBPROC glXGetFBConfigAttrib;
     PFNGLXGETVISUALFROMFBCONFIGPROC glXGetVisualFromFBConfig;
+    PFNGLXCHOOSEFBCONFIGPROC glXChooseFBConfig;
     PFNGLXCREATEWINDOWPROC glXCreateWindow;
     PFNGLXDESTROYWINDOWPROC glXDestroyWindow;
     PFNGLXCREATEPIXMAPPROC glXCreatePixmap;
@@ -93,6 +94,181 @@ struct yagl_egl_glx
     PFNGLXCREATECONTEXTATTRIBSARBPROC glXCreateContextAttribsARB;
 };
 
+static bool yagl_egl_glx_get_gl_version(struct yagl_egl_glx *egl_glx,
+                                        yagl_gl_version *version)
+{
+    int config_attribs[] =
+    {
+        GLX_DOUBLEBUFFER, True,
+        GLX_RED_SIZE, 8,
+        GLX_GREEN_SIZE, 8,
+        GLX_BLUE_SIZE, 8,
+        GLX_ALPHA_SIZE, 8,
+        GLX_BUFFER_SIZE, 32,
+        GLX_DEPTH_SIZE, 24,
+        GLX_STENCIL_SIZE, 8,
+        GLX_RENDER_TYPE, GLX_RGBA_BIT,
+        GLX_DRAWABLE_TYPE, GLX_PBUFFER_BIT,
+        None
+    };
+    int ctx_attribs[] =
+    {
+        GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
+        GLX_CONTEXT_MINOR_VERSION_ARB, 1,
+        GLX_RENDER_TYPE, GLX_RGBA_TYPE,
+        GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
+        None
+    };
+    int surface_attribs[] = {
+        GLX_PBUFFER_WIDTH, 1,
+        GLX_PBUFFER_HEIGHT, 1,
+        GLX_LARGEST_PBUFFER, False,
+        GLX_PRESERVED_CONTENTS, False,
+        None
+    };
+    bool res = false;
+    const char *tmp;
+    int n = 0;
+    GLXFBConfig *configs = NULL;
+    GLXContext ctx = NULL;
+    GLXPbuffer pbuffer = 0;
+    const GLubyte *(GLAPIENTRY *GetStringi)(GLenum, GLuint) = NULL;
+    void (GLAPIENTRY *GetIntegerv)(GLenum, GLint*) = NULL;
+    uint32_t i;
+    GLint major = 0, minor = 0;
+
+    YAGL_EGL_GLX_ENTER(yagl_egl_glx_get_gl_version, NULL);
+
+    tmp = getenv("YAGL_GL_VERSION");
+
+    if (tmp) {
+        if (strcmp(tmp, "gl_2") == 0) {
+            YAGL_LOG_INFO("YAGL_GL_VERSION forces OpenGL version to 2.1");
+            *version = yagl_gl_2;
+            res = true;
+        } else if (strcmp(tmp, "gl_3") == 0) {
+            YAGL_LOG_INFO("YAGL_GL_VERSION forces OpenGL version to 3.2");
+            *version = yagl_gl_3;
+            res = true;
+        } else if (strcmp(tmp, "gl_3_es3") == 0) {
+            YAGL_LOG_INFO("YAGL_GL_VERSION forces OpenGL version to 3.1");
+            *version = yagl_gl_3_es3;
+            res = true;
+        } else {
+            YAGL_LOG_CRITICAL("Bad YAGL_GL_VERSION value = %s", tmp);
+        }
+
+        goto out;
+    }
+
+    configs = egl_glx->glXChooseFBConfig(egl_glx->global_dpy,
+                                         DefaultScreen(egl_glx->global_dpy),
+                                         config_attribs,
+                                         &n);
+
+    if (n <= 0) {
+        YAGL_LOG_ERROR("glXChooseFBConfig failed");
+        goto out;
+    }
+
+    ctx = egl_glx->glXCreateContextAttribsARB(egl_glx->global_dpy,
+                                              configs[0],
+                                              NULL,
+                                              True,
+                                              ctx_attribs);
+
+    if (!ctx) {
+        YAGL_LOG_INFO("glXCreateContextAttribsARB failed, using OpenGL 2.1");
+        *version = yagl_gl_2;
+        res = true;
+        goto out;
+    }
+
+    pbuffer = egl_glx->glXCreatePbuffer(egl_glx->global_dpy,
+                                        configs[0],
+                                        surface_attribs);
+
+    if (!pbuffer) {
+        YAGL_LOG_ERROR("glXCreatePbuffer failed");
+        goto out;
+    }
+
+    if (!egl_glx->glXMakeContextCurrent(egl_glx->global_dpy,
+                                        pbuffer, pbuffer, ctx)) {
+        YAGL_LOG_ERROR("glXMakeContextCurrent failed");
+        goto out;
+    }
+
+    GetStringi = yagl_dyn_lib_get_ogl_procaddr(egl_glx->base.dyn_lib,
+                                               "glGetStringi");
+
+    if (!GetStringi) {
+        YAGL_LOG_ERROR("Unable to get symbol: %s",
+                       yagl_dyn_lib_get_error(egl_glx->base.dyn_lib));
+        goto out;
+    }
+
+    for (i = 0, tmp = (const char*)GetStringi(GL_EXTENSIONS, i);
+         tmp;
+         ++i, tmp = (const char*)GetStringi(GL_EXTENSIONS, i)) {
+        if (strcmp(tmp, "GL_ARB_ES3_compatibility") == 0) {
+            YAGL_LOG_INFO("GL_ARB_ES3_compatibility supported, using OpenGL 3.1");
+            *version = yagl_gl_3_es3;
+            res = true;
+            goto out;
+        }
+    }
+
+    /*
+     * No GL_ARB_ES3_compatibility, so we need at least OpenGL 3.2 to be
+     * able to patch shaders and run them with GLSL 1.50.
+     */
+
+    GetIntegerv = yagl_dyn_lib_get_ogl_procaddr(egl_glx->base.dyn_lib,
+                                                "glGetIntegerv");
+
+    if (!GetIntegerv) {
+        YAGL_LOG_ERROR("Unable to get symbol: %s",
+                       yagl_dyn_lib_get_error(egl_glx->base.dyn_lib));
+        goto out;
+    }
+
+    GetIntegerv(GL_MAJOR_VERSION, &major);
+    GetIntegerv(GL_MINOR_VERSION, &minor);
+
+    if ((major > 3) ||
+        ((major == 3) && (minor >= 2))) {
+        YAGL_LOG_INFO("GL_ARB_ES3_compatibility not supported, using OpenGL 3.2");
+        *version = yagl_gl_3;
+        res = true;
+        goto out;
+    }
+
+    YAGL_LOG_INFO("GL_ARB_ES3_compatibility not supported, OpenGL 3.2 not supported, using OpenGL 2.1");
+    *version = yagl_gl_2;
+    res = true;
+
+out:
+    if (pbuffer) {
+        egl_glx->glXDestroyPbuffer(egl_glx->global_dpy, pbuffer);
+    }
+    if (ctx) {
+        egl_glx->glXMakeContextCurrent(egl_glx->global_dpy, 0, 0, NULL);
+        egl_glx->glXDestroyContext(egl_glx->global_dpy, ctx);
+    }
+    if (configs) {
+        XFree(configs);
+    }
+
+    if (res) {
+        YAGL_LOG_FUNC_EXIT("%d, version = %u", res, *version);
+    } else {
+        YAGL_LOG_FUNC_EXIT("%d", res);
+    }
+
+    return res;
+}
+
 /*
  * INTERNAL IMPLEMENTATION FUNCTIONS
  * @{
@@ -375,8 +551,9 @@ static EGLContext yagl_egl_glx_context_create(struct yagl_egl_driver *driver,
     int attribs[] =
     {
         GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
-        GLX_CONTEXT_MINOR_VERSION_ARB, 0,
+        GLX_CONTEXT_MINOR_VERSION_ARB, 1,
         GLX_RENDER_TYPE, GLX_RGBA_TYPE,
+        GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
         None
     };
 
@@ -385,16 +562,26 @@ static EGLContext yagl_egl_glx_context_create(struct yagl_egl_driver *driver,
                        dpy,
                        share_context);
 
-    ctx = egl_glx->glXCreateContextAttribsARB(dpy,
-                                              (GLXFBConfig)cfg->driver_data,
-                                              ((share_context == EGL_NO_CONTEXT) ?
-                                                  NULL
-                                                : (GLXContext)share_context),
-                                              True,
-                                              attribs);
+    if (egl_glx->base.gl_version > yagl_gl_2) {
+        ctx = egl_glx->glXCreateContextAttribsARB(dpy,
+                                                  (GLXFBConfig)cfg->driver_data,
+                                                  ((share_context == EGL_NO_CONTEXT) ?
+                                                      NULL
+                                                    : (GLXContext)share_context),
+                                                  True,
+                                                  attribs);
+    } else {
+        ctx = egl_glx->glXCreateNewContext(dpy,
+                                           (GLXFBConfig)cfg->driver_data,
+                                           GLX_RGBA_TYPE,
+                                           ((share_context == EGL_NO_CONTEXT) ?
+                                               NULL
+                                             : (GLXContext)share_context),
+                                           True);
+    }
 
     if (!ctx) {
-        YAGL_LOG_ERROR("glXCreateContextAttribsARB failed");
+        YAGL_LOG_ERROR("glXCreateContextAttribsARB/glXCreateNewContext failed");
 
         YAGL_LOG_FUNC_EXIT(NULL);
 
@@ -525,6 +712,7 @@ struct yagl_egl_driver *yagl_egl_driver_create(void *display)
     YAGL_EGL_GLX_GET_PROC(PFNGLXGETFBCONFIGSPROC, glXGetFBConfigs);
     YAGL_EGL_GLX_GET_PROC(PFNGLXGETFBCONFIGATTRIBPROC, glXGetFBConfigAttrib);
     YAGL_EGL_GLX_GET_PROC(PFNGLXGETVISUALFROMFBCONFIGPROC, glXGetVisualFromFBConfig);
+    YAGL_EGL_GLX_GET_PROC(PFNGLXCHOOSEFBCONFIGPROC, glXChooseFBConfig);
     YAGL_EGL_GLX_GET_PROC(PFNGLXCREATEWINDOWPROC, glXCreateWindow);
     YAGL_EGL_GLX_GET_PROC(PFNGLXDESTROYWINDOWPROC, glXDestroyWindow);
     YAGL_EGL_GLX_GET_PROC(PFNGLXCREATEPIXMAPPROC, glXCreatePixmap);
@@ -537,6 +725,10 @@ struct yagl_egl_driver *yagl_egl_driver_create(void *display)
     /* GLX_ARB_create_context */
     YAGL_EGL_GLX_GET_PROC(PFNGLXCREATECONTEXTATTRIBSARBPROC, glXCreateContextAttribsARB);
 
+    if (!yagl_egl_glx_get_gl_version(egl_glx, &egl_glx->base.gl_version)) {
+        goto fail;
+    }
+
     egl_glx->base.display_open = &yagl_egl_glx_display_open;
     egl_glx->base.display_close = &yagl_egl_glx_display_close;
     egl_glx->base.config_enum = &yagl_egl_glx_config_enum;
index 6a5fde6..a4833b6 100644 (file)
@@ -17,7 +17,8 @@ static void yagl_gles_ogl_destroy(struct yagl_gles_driver *driver)
     YAGL_LOG_FUNC_EXIT(NULL);
 }
 
-struct yagl_gles_driver *yagl_gles_ogl_create(struct yagl_dyn_lib *dyn_lib)
+struct yagl_gles_driver *yagl_gles_ogl_create(struct yagl_dyn_lib *dyn_lib,
+                                              yagl_gl_version gl_version)
 {
     struct yagl_gles_driver *driver = NULL;
 
@@ -25,7 +26,7 @@ struct yagl_gles_driver *yagl_gles_ogl_create(struct yagl_dyn_lib *dyn_lib)
 
     driver = g_malloc0(sizeof(*driver));
 
-    yagl_gles_driver_init(driver);
+    yagl_gles_driver_init(driver, gl_version);
 
     YAGL_GLES_OGL_GET_PROC(driver, DrawArrays, glDrawArrays);
     YAGL_GLES_OGL_GET_PROC(driver, DrawElements, glDrawElements);
@@ -165,11 +166,6 @@ struct yagl_gles_driver *yagl_gles_ogl_create(struct yagl_dyn_lib *dyn_lib)
     YAGL_GLES_OGL_GET_PROC(driver, StencilFuncSeparate, glStencilFuncSeparate);
     YAGL_GLES_OGL_GET_PROC(driver, StencilMaskSeparate, glStencilMaskSeparate);
     YAGL_GLES_OGL_GET_PROC(driver, StencilOpSeparate, glStencilOpSeparate);
-    YAGL_GLES_OGL_GET_PROC(driver, PushClientAttrib, glPushClientAttrib);
-    YAGL_GLES_OGL_GET_PROC(driver, PopClientAttrib, glPopClientAttrib);
-    YAGL_GLES_OGL_GET_PROC(driver, MapBuffer, glMapBuffer);
-    YAGL_GLES_OGL_GET_PROC(driver, UnmapBuffer, glUnmapBuffer);
-    YAGL_GLES_OGL_GET_PROC(driver, Finish, glFinish);
     YAGL_GLES_OGL_GET_PROC(driver, PointSize, glPointSize);
     YAGL_GLES_OGL_GET_PROC(driver, AlphaFunc, glAlphaFunc);
     YAGL_GLES_OGL_GET_PROC(driver, MatrixMode, glMatrixMode);
@@ -202,6 +198,15 @@ struct yagl_gles_driver *yagl_gles_ogl_create(struct yagl_dyn_lib *dyn_lib)
     YAGL_GLES_OGL_GET_PROC(driver, LoadMatrixf, glLoadMatrixf);
     YAGL_GLES_OGL_GET_PROC(driver, ClipPlane, glClipPlane);
     YAGL_GLES_OGL_GET_PROC(driver, GetClipPlane, glGetClipPlane);
+    YAGL_GLES_OGL_GET_PROC(driver, PushClientAttrib, glPushClientAttrib);
+    YAGL_GLES_OGL_GET_PROC(driver, PopClientAttrib, glPopClientAttrib);
+    YAGL_GLES_OGL_GET_PROC(driver, MapBuffer, glMapBuffer);
+    YAGL_GLES_OGL_GET_PROC(driver, UnmapBuffer, glUnmapBuffer);
+    YAGL_GLES_OGL_GET_PROC(driver, Finish, glFinish);
+
+    if (gl_version > yagl_gl_2) {
+        YAGL_GLES_OGL_GET_PROC(driver, GetStringi, glGetStringi);
+    }
 
     driver->destroy = &yagl_gles_ogl_destroy;
 
index d023574..7a75968 100644 (file)
@@ -6,6 +6,7 @@
 struct yagl_gles_driver;
 struct yagl_dyn_lib;
 
-struct yagl_gles_driver *yagl_gles_ogl_create(struct yagl_dyn_lib *dyn_lib);
+struct yagl_gles_driver *yagl_gles_ogl_create(struct yagl_dyn_lib *dyn_lib,
+                                              yagl_gl_version gl_version);
 
 #endif
index a889aec..a5d5e13 100644 (file)
@@ -63,7 +63,7 @@ struct yagl_gles_driver
     memcpy(&driver->base, orig_driver, sizeof(*orig_driver));
     driver->orig_driver = orig_driver;
 
-    yagl_gles_driver_init(&driver->base);
+    yagl_gles_driver_init(&driver->base, orig_driver->gl_version);
 
     driver->base.BindFramebuffer = &yagl_gles_onscreen_BindFramebuffer;
 
index 2791cb8..29a6379 100644 (file)
@@ -1,9 +1,11 @@
 #include "yagl_egl_backend.h"
 
 void yagl_egl_backend_init(struct yagl_egl_backend *backend,
-                           yagl_render_type render_type)
+                           yagl_render_type render_type,
+                           yagl_gl_version gl_version)
 {
     backend->render_type = render_type;
+    backend->gl_version = gl_version;
 }
 
 void yagl_egl_backend_cleanup(struct yagl_egl_backend *backend)
index 6188c42..582a798 100644 (file)
@@ -16,6 +16,8 @@ struct yagl_egl_backend
 {
     yagl_render_type render_type;
 
+    yagl_gl_version gl_version;
+
     void (*thread_init)(struct yagl_egl_backend */*backend*/);
 
     void (*batch_start)(struct yagl_egl_backend */*backend*/);
@@ -53,7 +55,8 @@ struct yagl_egl_backend
 };
 
 void yagl_egl_backend_init(struct yagl_egl_backend *backend,
-                           yagl_render_type render_type);
+                           yagl_render_type render_type,
+                           yagl_gl_version gl_version);
 void yagl_egl_backend_cleanup(struct yagl_egl_backend *backend);
 
 /*
index abd3348..d2acb7d 100644 (file)
@@ -3,6 +3,7 @@
 void yagl_egl_driver_init(struct yagl_egl_driver *driver)
 {
     driver->dyn_lib = NULL;
+    driver->gl_version = yagl_gl_2;
 }
 
 void yagl_egl_driver_cleanup(struct yagl_egl_driver *driver)
index 0bb7ade..8a18e9c 100644 (file)
@@ -74,6 +74,8 @@ struct yagl_egl_driver
     void (*destroy)(struct yagl_egl_driver */*driver*/);
 
     struct yagl_dyn_lib *dyn_lib;
+
+    yagl_gl_version gl_version;
 };
 
 /*
index aa99bbe..79601bd 100644 (file)
@@ -4,8 +4,10 @@
 #include "yagl_process.h"
 #include "yagl_egl_interface.h"
 
-void yagl_gles_driver_init(struct yagl_gles_driver *driver)
+void yagl_gles_driver_init(struct yagl_gles_driver *driver,
+                           yagl_gl_version gl_version)
 {
+    driver->gl_version = gl_version;
 }
 
 void yagl_gles_driver_cleanup(struct yagl_gles_driver *driver)
index 6dc3502..ceeb0a7 100644 (file)
@@ -69,6 +69,11 @@ typedef double yagl_GLdouble;
 
 struct yagl_gles_driver
 {
+    /*
+     * OpenGL 2.1
+     * @{
+     */
+
     YAGL_GLES_DRIVER_FUNC3(DrawArrays, GLenum, GLint, GLsizei, mode, first, count)
     YAGL_GLES_DRIVER_FUNC4(DrawElements, GLenum, GLsizei, GLenum, const GLvoid*, mode, count, type, indices)
     YAGL_GLES_DRIVER_FUNC7(ReadPixels, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLvoid*, x, y, width, height, format, type, pixels)
@@ -239,17 +244,33 @@ struct yagl_gles_driver
     YAGL_GLES_DRIVER_FUNC1(LoadMatrixf, const GLfloat*, m)
     YAGL_GLES_DRIVER_FUNC2(ClipPlane, GLenum, const yagl_GLdouble *, plane, equation)
     YAGL_GLES_DRIVER_FUNC2(GetClipPlane, GLenum, const yagl_GLdouble *, plane, equation)
-
     YAGL_GLES_DRIVER_FUNC1(PushClientAttrib, GLbitfield, mask)
     YAGL_GLES_DRIVER_FUNC0(PopClientAttrib)
     YAGL_GLES_DRIVER_FUNC_RET2(void*, MapBuffer, GLenum, GLenum, target, access)
     YAGL_GLES_DRIVER_FUNC_RET1(GLboolean, UnmapBuffer, GLenum, target)
     YAGL_GLES_DRIVER_FUNC0(Finish)
 
+    /*
+     * @}
+     */
+
+    /*
+     * OpenGL 3.1+ core.
+     */
+
+    YAGL_GLES_DRIVER_FUNC_RET2(const GLubyte*, GetStringi, GLenum, GLuint, name, index)
+
+    /*
+     * @}
+     */
+
+    yagl_gl_version gl_version;
+
     void (*destroy)(struct yagl_gles_driver */*driver*/);
 };
 
-void yagl_gles_driver_init(struct yagl_gles_driver *driver);
+void yagl_gles_driver_init(struct yagl_gles_driver *driver,
+                           yagl_gl_version gl_version);
 void yagl_gles_driver_cleanup(struct yagl_gles_driver *driver);
 
 /*
index a7ea2ea..a392b31 100644 (file)
@@ -1,12 +1,12 @@
 #ifndef __eglext_h_
-#define __eglext_h_
+#define __eglext_h_ 1
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 /*
-** Copyright (c) 2007-2010 The Khronos Group Inc.
+** Copyright (c) 2013 The Khronos Group Inc.
 **
 ** Permission is hereby granted, free of charge, to any person obtaining a
 ** copy of this software and/or associated documentation files (the
@@ -27,308 +27,599 @@ extern "C" {
 ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
 */
+/*
+** This header is generated from the Khronos OpenGL / OpenGL ES XML
+** API Registry. The current version of the Registry, generator scripts
+** used to make the header, and the header can be found at
+**   http://www.opengl.org/registry/
+**
+** Khronos $Revision: 23535 $ on $Date: 2013-10-16 10:29:40 -0700 (Wed, 16 Oct 2013) $
+*/
 
 #include <EGL/eglplatform.h>
 
-/*************************************************************/
+#define EGL_EGLEXT_VERSION 20131016
+
+/* Generated C header for:
+ * API: egl
+ * Versions considered: .*
+ * Versions emitted: _nomatch_^
+ * Default extensions included: egl
+ * Additional extensions included: _nomatch_^
+ * Extensions removed: _nomatch_^
+ */
+
+#ifndef EGL_KHR_cl_event
+#define EGL_KHR_cl_event 1
+#define EGL_CL_EVENT_HANDLE_KHR           0x309C
+#define EGL_SYNC_CL_EVENT_KHR             0x30FE
+#define EGL_SYNC_CL_EVENT_COMPLETE_KHR    0x30FF
+#endif /* EGL_KHR_cl_event */
 
-/* Header file version number */
-/* Current version at http://www.khronos.org/registry/egl/ */
-/* $Revision: 15052 $ on $Date: 2011-07-06 17:43:46 -0700 (Wed, 06 Jul 2011) $ */
-#define EGL_EGLEXT_VERSION 10
+#ifndef EGL_KHR_client_get_all_proc_addresses
+#define EGL_KHR_client_get_all_proc_addresses 1
+#endif /* EGL_KHR_client_get_all_proc_addresses */
 
 #ifndef EGL_KHR_config_attribs
 #define EGL_KHR_config_attribs 1
-#define EGL_CONFORMANT_KHR                     0x3042  /* EGLConfig attribute */
-#define EGL_VG_COLORSPACE_LINEAR_BIT_KHR       0x0020  /* EGL_SURFACE_TYPE bitfield */
-#define EGL_VG_ALPHA_FORMAT_PRE_BIT_KHR                0x0040  /* EGL_SURFACE_TYPE bitfield */
-#endif
+#define EGL_CONFORMANT_KHR                0x3042
+#define EGL_VG_COLORSPACE_LINEAR_BIT_KHR  0x0020
+#define EGL_VG_ALPHA_FORMAT_PRE_BIT_KHR   0x0040
+#endif /* EGL_KHR_config_attribs */
+
+#ifndef EGL_KHR_create_context
+#define EGL_KHR_create_context 1
+#define EGL_CONTEXT_MAJOR_VERSION_KHR     0x3098
+#define EGL_CONTEXT_MINOR_VERSION_KHR     0x30FB
+#define EGL_CONTEXT_FLAGS_KHR             0x30FC
+#define EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR 0x30FD
+#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR 0x31BD
+#define EGL_NO_RESET_NOTIFICATION_KHR     0x31BE
+#define EGL_LOSE_CONTEXT_ON_RESET_KHR     0x31BF
+#define EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR  0x00000001
+#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR 0x00000002
+#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR 0x00000004
+#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR 0x00000001
+#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR 0x00000002
+#define EGL_OPENGL_ES3_BIT_KHR            0x00000040
+#endif /* EGL_KHR_create_context */
 
-#ifndef EGL_KHR_lock_surface
-#define EGL_KHR_lock_surface 1
-#define EGL_READ_SURFACE_BIT_KHR               0x0001  /* EGL_LOCK_USAGE_HINT_KHR bitfield */
-#define EGL_WRITE_SURFACE_BIT_KHR              0x0002  /* EGL_LOCK_USAGE_HINT_KHR bitfield */
-#define EGL_LOCK_SURFACE_BIT_KHR               0x0080  /* EGL_SURFACE_TYPE bitfield */
-#define EGL_OPTIMAL_FORMAT_BIT_KHR             0x0100  /* EGL_SURFACE_TYPE bitfield */
-#define EGL_MATCH_FORMAT_KHR                   0x3043  /* EGLConfig attribute */
-#define EGL_FORMAT_RGB_565_EXACT_KHR           0x30C0  /* EGL_MATCH_FORMAT_KHR value */
-#define EGL_FORMAT_RGB_565_KHR                 0x30C1  /* EGL_MATCH_FORMAT_KHR value */
-#define EGL_FORMAT_RGBA_8888_EXACT_KHR         0x30C2  /* EGL_MATCH_FORMAT_KHR value */
-#define EGL_FORMAT_RGBA_8888_KHR               0x30C3  /* EGL_MATCH_FORMAT_KHR value */
-#define EGL_MAP_PRESERVE_PIXELS_KHR            0x30C4  /* eglLockSurfaceKHR attribute */
-#define EGL_LOCK_USAGE_HINT_KHR                        0x30C5  /* eglLockSurfaceKHR attribute */
-#define EGL_BITMAP_POINTER_KHR                 0x30C6  /* eglQuerySurface attribute */
-#define EGL_BITMAP_PITCH_KHR                   0x30C7  /* eglQuerySurface attribute */
-#define EGL_BITMAP_ORIGIN_KHR                  0x30C8  /* eglQuerySurface attribute */
-#define EGL_BITMAP_PIXEL_RED_OFFSET_KHR                0x30C9  /* eglQuerySurface attribute */
-#define EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR      0x30CA  /* eglQuerySurface attribute */
-#define EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR       0x30CB  /* eglQuerySurface attribute */
-#define EGL_BITMAP_PIXEL_ALPHA_OFFSET_KHR      0x30CC  /* eglQuerySurface attribute */
-#define EGL_BITMAP_PIXEL_LUMINANCE_OFFSET_KHR  0x30CD  /* eglQuerySurface attribute */
-#define EGL_LOWER_LEFT_KHR                     0x30CE  /* EGL_BITMAP_ORIGIN_KHR value */
-#define EGL_UPPER_LEFT_KHR                     0x30CF  /* EGL_BITMAP_ORIGIN_KHR value */
-#ifdef EGL_EGLEXT_PROTOTYPES
-EGLAPI EGLBoolean EGLAPIENTRY eglLockSurfaceKHR (EGLDisplay display, EGLSurface surface, const EGLint *attrib_list);
-EGLAPI EGLBoolean EGLAPIENTRY eglUnlockSurfaceKHR (EGLDisplay display, EGLSurface surface);
-#endif /* EGL_EGLEXT_PROTOTYPES */
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLLOCKSURFACEKHRPROC) (EGLDisplay display, EGLSurface surface, const EGLint *attrib_list);
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNLOCKSURFACEKHRPROC) (EGLDisplay display, EGLSurface surface);
-#endif
+#ifndef EGL_KHR_fence_sync
+#define EGL_KHR_fence_sync 1
+#ifdef KHRONOS_SUPPORT_INT64
+#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR 0x30F0
+#define EGL_SYNC_CONDITION_KHR            0x30F8
+#define EGL_SYNC_FENCE_KHR                0x30F9
+#endif /* KHRONOS_SUPPORT_INT64 */
+#endif /* EGL_KHR_fence_sync */
+
+#ifndef EGL_KHR_get_all_proc_addresses
+#define EGL_KHR_get_all_proc_addresses 1
+#endif /* EGL_KHR_get_all_proc_addresses */
+
+#ifndef EGL_KHR_gl_renderbuffer_image
+#define EGL_KHR_gl_renderbuffer_image 1
+#define EGL_GL_RENDERBUFFER_KHR           0x30B9
+#endif /* EGL_KHR_gl_renderbuffer_image */
+
+#ifndef EGL_KHR_gl_texture_2D_image
+#define EGL_KHR_gl_texture_2D_image 1
+#define EGL_GL_TEXTURE_2D_KHR             0x30B1
+#define EGL_GL_TEXTURE_LEVEL_KHR          0x30BC
+#endif /* EGL_KHR_gl_texture_2D_image */
+
+#ifndef EGL_KHR_gl_texture_3D_image
+#define EGL_KHR_gl_texture_3D_image 1
+#define EGL_GL_TEXTURE_3D_KHR             0x30B2
+#define EGL_GL_TEXTURE_ZOFFSET_KHR        0x30BD
+#endif /* EGL_KHR_gl_texture_3D_image */
+
+#ifndef EGL_KHR_gl_texture_cubemap_image
+#define EGL_KHR_gl_texture_cubemap_image 1
+#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X_KHR 0x30B3
+#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X_KHR 0x30B4
+#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y_KHR 0x30B5
+#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_KHR 0x30B6
+#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z_KHR 0x30B7
+#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_KHR 0x30B8
+#endif /* EGL_KHR_gl_texture_cubemap_image */
 
 #ifndef EGL_KHR_image
 #define EGL_KHR_image 1
-#define EGL_NATIVE_PIXMAP_KHR                  0x30B0  /* eglCreateImageKHR target */
 typedef void *EGLImageKHR;
-#define EGL_NO_IMAGE_KHR                       ((EGLImageKHR)0)
+#define EGL_NATIVE_PIXMAP_KHR             0x30B0
+#define EGL_NO_IMAGE_KHR                  ((EGLImageKHR)0)
+typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEIMAGEKHRPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGLImageKHR image);
 #ifdef EGL_EGLEXT_PROTOTYPES
 EGLAPI EGLImageKHR EGLAPIENTRY eglCreateImageKHR (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list);
 EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImageKHR (EGLDisplay dpy, EGLImageKHR image);
-#endif /* EGL_EGLEXT_PROTOTYPES */
-typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEIMAGEKHRPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list);
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGLImageKHR image);
-#endif
-
-#ifndef EGL_KHR_vg_parent_image
-#define EGL_KHR_vg_parent_image 1
-#define EGL_VG_PARENT_IMAGE_KHR                        0x30BA  /* eglCreateImageKHR target */
 #endif
+#endif /* EGL_KHR_image */
 
-#ifndef EGL_KHR_gl_texture_2D_image
-#define EGL_KHR_gl_texture_2D_image 1
-#define EGL_GL_TEXTURE_2D_KHR                  0x30B1  /* eglCreateImageKHR target */
-#define EGL_GL_TEXTURE_LEVEL_KHR               0x30BC  /* eglCreateImageKHR attribute */
-#endif
+#ifndef EGL_KHR_image_base
+#define EGL_KHR_image_base 1
+#define EGL_IMAGE_PRESERVED_KHR           0x30D2
+#endif /* EGL_KHR_image_base */
 
-#ifndef EGL_KHR_gl_texture_cubemap_image
-#define EGL_KHR_gl_texture_cubemap_image 1
-#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X_KHR 0x30B3  /* eglCreateImageKHR target */
-#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X_KHR 0x30B4  /* eglCreateImageKHR target */
-#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y_KHR 0x30B5  /* eglCreateImageKHR target */
-#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_KHR 0x30B6  /* eglCreateImageKHR target */
-#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z_KHR 0x30B7  /* eglCreateImageKHR target */
-#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_KHR 0x30B8  /* eglCreateImageKHR target */
-#endif
+#ifndef EGL_KHR_image_pixmap
+#define EGL_KHR_image_pixmap 1
+#endif /* EGL_KHR_image_pixmap */
 
-#ifndef EGL_KHR_gl_texture_3D_image
-#define EGL_KHR_gl_texture_3D_image 1
-#define EGL_GL_TEXTURE_3D_KHR                  0x30B2  /* eglCreateImageKHR target */
-#define EGL_GL_TEXTURE_ZOFFSET_KHR             0x30BD  /* eglCreateImageKHR attribute */
+#ifndef EGL_KHR_lock_surface
+#define EGL_KHR_lock_surface 1
+#define EGL_READ_SURFACE_BIT_KHR          0x0001
+#define EGL_WRITE_SURFACE_BIT_KHR         0x0002
+#define EGL_LOCK_SURFACE_BIT_KHR          0x0080
+#define EGL_OPTIMAL_FORMAT_BIT_KHR        0x0100
+#define EGL_MATCH_FORMAT_KHR              0x3043
+#define EGL_FORMAT_RGB_565_EXACT_KHR      0x30C0
+#define EGL_FORMAT_RGB_565_KHR            0x30C1
+#define EGL_FORMAT_RGBA_8888_EXACT_KHR    0x30C2
+#define EGL_FORMAT_RGBA_8888_KHR          0x30C3
+#define EGL_MAP_PRESERVE_PIXELS_KHR       0x30C4
+#define EGL_LOCK_USAGE_HINT_KHR           0x30C5
+#define EGL_BITMAP_POINTER_KHR            0x30C6
+#define EGL_BITMAP_PITCH_KHR              0x30C7
+#define EGL_BITMAP_ORIGIN_KHR             0x30C8
+#define EGL_BITMAP_PIXEL_RED_OFFSET_KHR   0x30C9
+#define EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR 0x30CA
+#define EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR  0x30CB
+#define EGL_BITMAP_PIXEL_ALPHA_OFFSET_KHR 0x30CC
+#define EGL_BITMAP_PIXEL_LUMINANCE_OFFSET_KHR 0x30CD
+#define EGL_LOWER_LEFT_KHR                0x30CE
+#define EGL_UPPER_LEFT_KHR                0x30CF
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLLOCKSURFACEKHRPROC) (EGLDisplay display, EGLSurface surface, const EGLint *attrib_list);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNLOCKSURFACEKHRPROC) (EGLDisplay display, EGLSurface surface);
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLBoolean EGLAPIENTRY eglLockSurfaceKHR (EGLDisplay display, EGLSurface surface, const EGLint *attrib_list);
+EGLAPI EGLBoolean EGLAPIENTRY eglUnlockSurfaceKHR (EGLDisplay display, EGLSurface surface);
 #endif
+#endif /* EGL_KHR_lock_surface */
 
-#ifndef EGL_KHR_gl_renderbuffer_image
-#define EGL_KHR_gl_renderbuffer_image 1
-#define EGL_GL_RENDERBUFFER_KHR                        0x30B9  /* eglCreateImageKHR target */
-#endif
+#ifndef EGL_KHR_lock_surface2
+#define EGL_KHR_lock_surface2 1
+#define EGL_BITMAP_PIXEL_SIZE_KHR         0x3110
+#endif /* EGL_KHR_lock_surface2 */
 
-#if KHRONOS_SUPPORT_INT64   /* EGLTimeKHR requires 64-bit uint support */
 #ifndef EGL_KHR_reusable_sync
 #define EGL_KHR_reusable_sync 1
-
-typedef void* EGLSyncKHR;
+typedef void *EGLSyncKHR;
 typedef khronos_utime_nanoseconds_t EGLTimeKHR;
-
-#define EGL_SYNC_STATUS_KHR                    0x30F1
-#define EGL_SIGNALED_KHR                       0x30F2
-#define EGL_UNSIGNALED_KHR                     0x30F3
-#define EGL_TIMEOUT_EXPIRED_KHR                        0x30F5
-#define EGL_CONDITION_SATISFIED_KHR            0x30F6
-#define EGL_SYNC_TYPE_KHR                      0x30F7
-#define EGL_SYNC_REUSABLE_KHR                  0x30FA
-#define EGL_SYNC_FLUSH_COMMANDS_BIT_KHR                0x0001  /* eglClientWaitSyncKHR <flags> bitfield */
-#define EGL_FOREVER_KHR                                0xFFFFFFFFFFFFFFFFull
-#define EGL_NO_SYNC_KHR                                ((EGLSyncKHR)0)
-#ifdef EGL_EGLEXT_PROTOTYPES
-EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list);
-EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync);
-EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout);
-EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode);
-EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value);
-#endif /* EGL_EGLEXT_PROTOTYPES */
+#ifdef KHRONOS_SUPPORT_INT64
+#define EGL_SYNC_STATUS_KHR               0x30F1
+#define EGL_SIGNALED_KHR                  0x30F2
+#define EGL_UNSIGNALED_KHR                0x30F3
+#define EGL_TIMEOUT_EXPIRED_KHR           0x30F5
+#define EGL_CONDITION_SATISFIED_KHR       0x30F6
+#define EGL_SYNC_TYPE_KHR                 0x30F7
+#define EGL_SYNC_REUSABLE_KHR             0x30FA
+#define EGL_SYNC_FLUSH_COMMANDS_BIT_KHR   0x0001
+#define EGL_FOREVER_KHR                   0xFFFFFFFFFFFFFFFFull
+#define EGL_NO_SYNC_KHR                   ((EGLSyncKHR)0)
 typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESYNCKHRPROC) (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list);
 typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync);
 typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout);
 typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode);
 typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value);
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSyncKHR (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list);
+EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncKHR (EGLDisplay dpy, EGLSyncKHR sync);
+EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout);
+EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode);
+EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value);
 #endif
+#endif /* KHRONOS_SUPPORT_INT64 */
+#endif /* EGL_KHR_reusable_sync */
+
+#ifndef EGL_KHR_stream
+#define EGL_KHR_stream 1
+typedef void *EGLStreamKHR;
+typedef khronos_uint64_t EGLuint64KHR;
+#ifdef KHRONOS_SUPPORT_INT64
+#define EGL_NO_STREAM_KHR                 ((EGLStreamKHR)0)
+#define EGL_CONSUMER_LATENCY_USEC_KHR     0x3210
+#define EGL_PRODUCER_FRAME_KHR            0x3212
+#define EGL_CONSUMER_FRAME_KHR            0x3213
+#define EGL_STREAM_STATE_KHR              0x3214
+#define EGL_STREAM_STATE_CREATED_KHR      0x3215
+#define EGL_STREAM_STATE_CONNECTING_KHR   0x3216
+#define EGL_STREAM_STATE_EMPTY_KHR        0x3217
+#define EGL_STREAM_STATE_NEW_FRAME_AVAILABLE_KHR 0x3218
+#define EGL_STREAM_STATE_OLD_FRAME_AVAILABLE_KHR 0x3219
+#define EGL_STREAM_STATE_DISCONNECTED_KHR 0x321A
+#define EGL_BAD_STREAM_KHR                0x321B
+#define EGL_BAD_STATE_KHR                 0x321C
+typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMKHRPROC) (EGLDisplay dpy, const EGLint *attrib_list);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSTREAMKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMATTRIBKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMU64KHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value);
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamKHR (EGLDisplay dpy, const EGLint *attrib_list);
+EGLAPI EGLBoolean EGLAPIENTRY eglDestroyStreamKHR (EGLDisplay dpy, EGLStreamKHR stream);
+EGLAPI EGLBoolean EGLAPIENTRY eglStreamAttribKHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value);
+EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamKHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value);
+EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamu64KHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value);
 #endif
-
-#ifndef EGL_KHR_image_base
-#define EGL_KHR_image_base 1
-/* Most interfaces defined by EGL_KHR_image_pixmap above */
-#define EGL_IMAGE_PRESERVED_KHR                        0x30D2  /* eglCreateImageKHR attribute */
+#endif /* KHRONOS_SUPPORT_INT64 */
+#endif /* EGL_KHR_stream */
+
+#ifndef EGL_KHR_stream_consumer_gltexture
+#define EGL_KHR_stream_consumer_gltexture 1
+#ifdef EGL_KHR_stream
+#define EGL_CONSUMER_ACQUIRE_TIMEOUT_USEC_KHR 0x321E
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERACQUIREKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERRELEASEKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream);
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerGLTextureExternalKHR (EGLDisplay dpy, EGLStreamKHR stream);
+EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerAcquireKHR (EGLDisplay dpy, EGLStreamKHR stream);
+EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerReleaseKHR (EGLDisplay dpy, EGLStreamKHR stream);
 #endif
-
-#ifndef EGL_KHR_image_pixmap
-#define EGL_KHR_image_pixmap 1
-/* Interfaces defined by EGL_KHR_image above */
+#endif /* EGL_KHR_stream */
+#endif /* EGL_KHR_stream_consumer_gltexture */
+
+#ifndef EGL_KHR_stream_cross_process_fd
+#define EGL_KHR_stream_cross_process_fd 1
+typedef int EGLNativeFileDescriptorKHR;
+#ifdef EGL_KHR_stream
+#define EGL_NO_FILE_DESCRIPTOR_KHR        ((EGLNativeFileDescriptorKHR)(-1))
+typedef EGLNativeFileDescriptorKHR (EGLAPIENTRYP PFNEGLGETSTREAMFILEDESCRIPTORKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream);
+typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMFROMFILEDESCRIPTORKHRPROC) (EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor);
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLNativeFileDescriptorKHR EGLAPIENTRY eglGetStreamFileDescriptorKHR (EGLDisplay dpy, EGLStreamKHR stream);
+EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamFromFileDescriptorKHR (EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor);
 #endif
-
-#ifndef EGL_IMG_context_priority
-#define EGL_IMG_context_priority 1
-#define EGL_CONTEXT_PRIORITY_LEVEL_IMG         0x3100
-#define EGL_CONTEXT_PRIORITY_HIGH_IMG          0x3101
-#define EGL_CONTEXT_PRIORITY_MEDIUM_IMG                0x3102
-#define EGL_CONTEXT_PRIORITY_LOW_IMG           0x3103
+#endif /* EGL_KHR_stream */
+#endif /* EGL_KHR_stream_cross_process_fd */
+
+#ifndef EGL_KHR_stream_fifo
+#define EGL_KHR_stream_fifo 1
+#ifdef EGL_KHR_stream
+#define EGL_STREAM_FIFO_LENGTH_KHR        0x31FC
+#define EGL_STREAM_TIME_NOW_KHR           0x31FD
+#define EGL_STREAM_TIME_CONSUMER_KHR      0x31FE
+#define EGL_STREAM_TIME_PRODUCER_KHR      0x31FF
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMTIMEKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR *value);
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamTimeKHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR *value);
 #endif
-
-#ifndef EGL_KHR_lock_surface2
-#define EGL_KHR_lock_surface2 1
-#define EGL_BITMAP_PIXEL_SIZE_KHR              0x3110
+#endif /* EGL_KHR_stream */
+#endif /* EGL_KHR_stream_fifo */
+
+#ifndef EGL_KHR_stream_producer_aldatalocator
+#define EGL_KHR_stream_producer_aldatalocator 1
+#ifdef EGL_KHR_stream
+#endif /* EGL_KHR_stream */
+#endif /* EGL_KHR_stream_producer_aldatalocator */
+
+#ifndef EGL_KHR_stream_producer_eglsurface
+#define EGL_KHR_stream_producer_eglsurface 1
+#ifdef EGL_KHR_stream
+#define EGL_STREAM_BIT_KHR                0x0800
+typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC) (EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint *attrib_list);
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLSurface EGLAPIENTRY eglCreateStreamProducerSurfaceKHR (EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint *attrib_list);
 #endif
+#endif /* EGL_KHR_stream */
+#endif /* EGL_KHR_stream_producer_eglsurface */
 
-#ifndef EGL_NV_coverage_sample
-#define EGL_NV_coverage_sample 1
-#define EGL_COVERAGE_BUFFERS_NV 0x30E0
-#define EGL_COVERAGE_SAMPLES_NV 0x30E1
-#endif
+#ifndef EGL_KHR_surfaceless_context
+#define EGL_KHR_surfaceless_context 1
+#endif /* EGL_KHR_surfaceless_context */
 
-#ifndef EGL_NV_depth_nonlinear
-#define EGL_NV_depth_nonlinear 1
-#define EGL_DEPTH_ENCODING_NV 0x30E2
-#define EGL_DEPTH_ENCODING_NONE_NV 0
-#define EGL_DEPTH_ENCODING_NONLINEAR_NV 0x30E3
-#endif
+#ifndef EGL_KHR_vg_parent_image
+#define EGL_KHR_vg_parent_image 1
+#define EGL_VG_PARENT_IMAGE_KHR           0x30BA
+#endif /* EGL_KHR_vg_parent_image */
 
-#if KHRONOS_SUPPORT_INT64   /* EGLTimeNV requires 64-bit uint support */
-#ifndef EGL_NV_sync
-#define EGL_NV_sync 1
-#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_NV    0x30E6
-#define EGL_SYNC_STATUS_NV                     0x30E7
-#define EGL_SIGNALED_NV                                0x30E8
-#define EGL_UNSIGNALED_NV                      0x30E9
-#define EGL_SYNC_FLUSH_COMMANDS_BIT_NV         0x0001
-#define EGL_FOREVER_NV                         0xFFFFFFFFFFFFFFFFull
-#define EGL_ALREADY_SIGNALED_NV                        0x30EA
-#define EGL_TIMEOUT_EXPIRED_NV                 0x30EB
-#define EGL_CONDITION_SATISFIED_NV             0x30EC
-#define EGL_SYNC_TYPE_NV                       0x30ED
-#define EGL_SYNC_CONDITION_NV                  0x30EE
-#define EGL_SYNC_FENCE_NV                      0x30EF
-#define EGL_NO_SYNC_NV                         ((EGLSyncNV)0)
-typedef void* EGLSyncNV;
-typedef khronos_utime_nanoseconds_t EGLTimeNV;
+#ifndef EGL_KHR_wait_sync
+#define EGL_KHR_wait_sync 1
+typedef EGLint (EGLAPIENTRYP PFNEGLWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags);
 #ifdef EGL_EGLEXT_PROTOTYPES
-EGLSyncNV eglCreateFenceSyncNV (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list);
-EGLBoolean eglDestroySyncNV (EGLSyncNV sync);
-EGLBoolean eglFenceNV (EGLSyncNV sync);
-EGLint eglClientWaitSyncNV (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout);
-EGLBoolean eglSignalSyncNV (EGLSyncNV sync, EGLenum mode);
-EGLBoolean eglGetSyncAttribNV (EGLSyncNV sync, EGLint attribute, EGLint *value);
-#endif /* EGL_EGLEXT_PROTOTYPES */
-typedef EGLSyncNV (EGLAPIENTRYP PFNEGLCREATEFENCESYNCNVPROC) (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list);
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCNVPROC) (EGLSyncNV sync);
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLFENCENVPROC) (EGLSyncNV sync);
-typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCNVPROC) (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout);
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCNVPROC) (EGLSyncNV sync, EGLenum mode);
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBNVPROC) (EGLSyncNV sync, EGLint attribute, EGLint *value);
+EGLAPI EGLint EGLAPIENTRY eglWaitSyncKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags);
 #endif
+#endif /* EGL_KHR_wait_sync */
+
+#ifndef EGL_ANDROID_blob_cache
+#define EGL_ANDROID_blob_cache 1
+typedef khronos_ssize_t EGLsizeiANDROID;
+typedef void (*EGLSetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, const void *value, EGLsizeiANDROID valueSize);
+typedef EGLsizeiANDROID (*EGLGetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, void *value, EGLsizeiANDROID valueSize);
+typedef void (EGLAPIENTRYP PFNEGLSETBLOBCACHEFUNCSANDROIDPROC) (EGLDisplay dpy, EGLSetBlobFuncANDROID set, EGLGetBlobFuncANDROID get);
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI void EGLAPIENTRY eglSetBlobCacheFuncsANDROID (EGLDisplay dpy, EGLSetBlobFuncANDROID set, EGLGetBlobFuncANDROID get);
+#endif
+#endif /* EGL_ANDROID_blob_cache */
+
+#ifndef EGL_ANDROID_framebuffer_target
+#define EGL_ANDROID_framebuffer_target 1
+#define EGL_FRAMEBUFFER_TARGET_ANDROID    0x3147
+#endif /* EGL_ANDROID_framebuffer_target */
+
+#ifndef EGL_ANDROID_image_native_buffer
+#define EGL_ANDROID_image_native_buffer 1
+#define EGL_NATIVE_BUFFER_ANDROID         0x3140
+#endif /* EGL_ANDROID_image_native_buffer */
+
+#ifndef EGL_ANDROID_native_fence_sync
+#define EGL_ANDROID_native_fence_sync 1
+#define EGL_SYNC_NATIVE_FENCE_ANDROID     0x3144
+#define EGL_SYNC_NATIVE_FENCE_FD_ANDROID  0x3145
+#define EGL_SYNC_NATIVE_FENCE_SIGNALED_ANDROID 0x3146
+#define EGL_NO_NATIVE_FENCE_FD_ANDROID    -1
+typedef EGLint (EGLAPIENTRYP PFNEGLDUPNATIVEFENCEFDANDROIDPROC) (EGLDisplay dpy, EGLSyncKHR sync);
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLint EGLAPIENTRY eglDupNativeFenceFDANDROID (EGLDisplay dpy, EGLSyncKHR sync);
 #endif
+#endif /* EGL_ANDROID_native_fence_sync */
 
-#if KHRONOS_SUPPORT_INT64   /* Dependent on EGL_KHR_reusable_sync which requires 64-bit uint support */
-#ifndef EGL_KHR_fence_sync
-#define EGL_KHR_fence_sync 1
-/* Reuses most tokens and entry points from EGL_KHR_reusable_sync */
-#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR   0x30F0
-#define EGL_SYNC_CONDITION_KHR                 0x30F8
-#define EGL_SYNC_FENCE_KHR                     0x30F9
+#ifndef EGL_ANDROID_recordable
+#define EGL_ANDROID_recordable 1
+#define EGL_RECORDABLE_ANDROID            0x3142
+#endif /* EGL_ANDROID_recordable */
+
+#ifndef EGL_ANGLE_d3d_share_handle_client_buffer
+#define EGL_ANGLE_d3d_share_handle_client_buffer 1
+#define EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE 0x3200
+#endif /* EGL_ANGLE_d3d_share_handle_client_buffer */
+
+#ifndef EGL_ANGLE_query_surface_pointer
+#define EGL_ANGLE_query_surface_pointer 1
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSURFACEPOINTERANGLEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value);
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurfacePointerANGLE (EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value);
 #endif
+#endif /* EGL_ANGLE_query_surface_pointer */
+
+#ifndef EGL_ANGLE_surface_d3d_texture_2d_share_handle
+#define EGL_ANGLE_surface_d3d_texture_2d_share_handle 1
+#endif /* EGL_ANGLE_surface_d3d_texture_2d_share_handle */
+
+#ifndef EGL_ARM_pixmap_multisample_discard
+#define EGL_ARM_pixmap_multisample_discard 1
+#define EGL_DISCARD_SAMPLES_ARM           0x3286
+#endif /* EGL_ARM_pixmap_multisample_discard */
+
+#ifndef EGL_EXT_buffer_age
+#define EGL_EXT_buffer_age 1
+#define EGL_BUFFER_AGE_EXT                0x313D
+#endif /* EGL_EXT_buffer_age */
+
+#ifndef EGL_EXT_client_extensions
+#define EGL_EXT_client_extensions 1
+#endif /* EGL_EXT_client_extensions */
+
+#ifndef EGL_EXT_create_context_robustness
+#define EGL_EXT_create_context_robustness 1
+#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT 0x30BF
+#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT 0x3138
+#define EGL_NO_RESET_NOTIFICATION_EXT     0x31BE
+#define EGL_LOSE_CONTEXT_ON_RESET_EXT     0x31BF
+#endif /* EGL_EXT_create_context_robustness */
+
+#ifndef EGL_EXT_image_dma_buf_import
+#define EGL_EXT_image_dma_buf_import 1
+#define EGL_LINUX_DMA_BUF_EXT             0x3270
+#define EGL_LINUX_DRM_FOURCC_EXT          0x3271
+#define EGL_DMA_BUF_PLANE0_FD_EXT         0x3272
+#define EGL_DMA_BUF_PLANE0_OFFSET_EXT     0x3273
+#define EGL_DMA_BUF_PLANE0_PITCH_EXT      0x3274
+#define EGL_DMA_BUF_PLANE1_FD_EXT         0x3275
+#define EGL_DMA_BUF_PLANE1_OFFSET_EXT     0x3276
+#define EGL_DMA_BUF_PLANE1_PITCH_EXT      0x3277
+#define EGL_DMA_BUF_PLANE2_FD_EXT         0x3278
+#define EGL_DMA_BUF_PLANE2_OFFSET_EXT     0x3279
+#define EGL_DMA_BUF_PLANE2_PITCH_EXT      0x327A
+#define EGL_YUV_COLOR_SPACE_HINT_EXT      0x327B
+#define EGL_SAMPLE_RANGE_HINT_EXT         0x327C
+#define EGL_YUV_CHROMA_HORIZONTAL_SITING_HINT_EXT 0x327D
+#define EGL_YUV_CHROMA_VERTICAL_SITING_HINT_EXT 0x327E
+#define EGL_ITU_REC601_EXT                0x327F
+#define EGL_ITU_REC709_EXT                0x3280
+#define EGL_ITU_REC2020_EXT               0x3281
+#define EGL_YUV_FULL_RANGE_EXT            0x3282
+#define EGL_YUV_NARROW_RANGE_EXT          0x3283
+#define EGL_YUV_CHROMA_SITING_0_EXT       0x3284
+#define EGL_YUV_CHROMA_SITING_0_5_EXT     0x3285
+#endif /* EGL_EXT_image_dma_buf_import */
+
+#ifndef EGL_EXT_multiview_window
+#define EGL_EXT_multiview_window 1
+#define EGL_MULTIVIEW_VIEW_COUNT_EXT      0x3134
+#endif /* EGL_EXT_multiview_window */
+
+#ifndef EGL_EXT_platform_base
+#define EGL_EXT_platform_base 1
+typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETPLATFORMDISPLAYEXTPROC) (EGLenum platform, void *native_display, const EGLint *attrib_list);
+typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC) (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLint *attrib_list);
+typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMPIXMAPSURFACEEXTPROC) (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLint *attrib_list);
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLDisplay EGLAPIENTRY eglGetPlatformDisplayEXT (EGLenum platform, void *native_display, const EGLint *attrib_list);
+EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformWindowSurfaceEXT (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLint *attrib_list);
+EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurfaceEXT (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLint *attrib_list);
+#endif
+#endif /* EGL_EXT_platform_base */
+
+#ifndef EGL_EXT_platform_wayland
+#define EGL_EXT_platform_wayland 1
+#define EGL_PLATFORM_WAYLAND_EXT          0x31D8
+#endif /* EGL_EXT_platform_wayland */
+
+#ifndef EGL_EXT_platform_x11
+#define EGL_EXT_platform_x11 1
+#define EGL_PLATFORM_X11_EXT              0x31D5
+#define EGL_PLATFORM_X11_SCREEN_EXT       0x31D6
+#endif /* EGL_EXT_platform_x11 */
+
+#ifndef EGL_EXT_swap_buffers_with_damage
+#define EGL_EXT_swap_buffers_with_damage 1
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC) (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects);
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageEXT (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects);
 #endif
+#endif /* EGL_EXT_swap_buffers_with_damage */
 
 #ifndef EGL_HI_clientpixmap
 #define EGL_HI_clientpixmap 1
-
-/* Surface Attribute */
-#define EGL_CLIENT_PIXMAP_POINTER_HI           0x8F74
-/*
- * Structure representing a client pixmap
- * (pixmap's data is in client-space memory).
- */
-struct EGLClientPixmapHI
-{
-       void*           pData;
-       EGLint          iWidth;
-       EGLint          iHeight;
-       EGLint          iStride;
+struct EGLClientPixmapHI {
+    void  *pData;
+    EGLint iWidth;
+    EGLint iHeight;
+    EGLint iStride;
 };
-
+#define EGL_CLIENT_PIXMAP_POINTER_HI      0x8F74
+typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPIXMAPSURFACEHIPROC) (EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI *pixmap);
 #ifdef EGL_EGLEXT_PROTOTYPES
-EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurfaceHI(EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI* pixmap);
-#endif /* EGL_EGLEXT_PROTOTYPES */
-typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPIXMAPSURFACEHIPROC) (EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI* pixmap);
-#endif /* EGL_HI_clientpixmap */
+EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurfaceHI (EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI *pixmap);
+#endif
+#endif /* EGL_HI_clientpixmap */
 
 #ifndef EGL_HI_colorformats
 #define EGL_HI_colorformats 1
-/* Config Attribute */
-#define EGL_COLOR_FORMAT_HI                    0x8F70
-/* Color Formats */
-#define EGL_COLOR_RGB_HI                       0x8F71
-#define EGL_COLOR_RGBA_HI                      0x8F72
-#define EGL_COLOR_ARGB_HI                      0x8F73
+#define EGL_COLOR_FORMAT_HI               0x8F70
+#define EGL_COLOR_RGB_HI                  0x8F71
+#define EGL_COLOR_RGBA_HI                 0x8F72
+#define EGL_COLOR_ARGB_HI                 0x8F73
 #endif /* EGL_HI_colorformats */
 
+#ifndef EGL_IMG_context_priority
+#define EGL_IMG_context_priority 1
+#define EGL_CONTEXT_PRIORITY_LEVEL_IMG    0x3100
+#define EGL_CONTEXT_PRIORITY_HIGH_IMG     0x3101
+#define EGL_CONTEXT_PRIORITY_MEDIUM_IMG   0x3102
+#define EGL_CONTEXT_PRIORITY_LOW_IMG      0x3103
+#endif /* EGL_IMG_context_priority */
+
 #ifndef EGL_MESA_drm_image
 #define EGL_MESA_drm_image 1
-#define EGL_DRM_BUFFER_FORMAT_MESA             0x31D0      /* CreateDRMImageMESA attribute */
-#define EGL_DRM_BUFFER_USE_MESA                        0x31D1      /* CreateDRMImageMESA attribute */
-#define EGL_DRM_BUFFER_FORMAT_ARGB32_MESA      0x31D2      /* EGL_IMAGE_FORMAT_MESA attribute value */
-#define EGL_DRM_BUFFER_MESA                    0x31D3      /* eglCreateImageKHR target */
-#define EGL_DRM_BUFFER_STRIDE_MESA             0x31D4
-#define EGL_DRM_BUFFER_USE_SCANOUT_MESA                0x00000001  /* EGL_DRM_BUFFER_USE_MESA bits */
-#define EGL_DRM_BUFFER_USE_SHARE_MESA          0x00000002  /* EGL_DRM_BUFFER_USE_MESA bits */
+#define EGL_DRM_BUFFER_FORMAT_MESA        0x31D0
+#define EGL_DRM_BUFFER_USE_MESA           0x31D1
+#define EGL_DRM_BUFFER_FORMAT_ARGB32_MESA 0x31D2
+#define EGL_DRM_BUFFER_MESA               0x31D3
+#define EGL_DRM_BUFFER_STRIDE_MESA        0x31D4
+#define EGL_DRM_BUFFER_USE_SCANOUT_MESA   0x00000001
+#define EGL_DRM_BUFFER_USE_SHARE_MESA     0x00000002
+typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEDRMIMAGEMESAPROC) (EGLDisplay dpy, const EGLint *attrib_list);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDRMIMAGEMESAPROC) (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride);
 #ifdef EGL_EGLEXT_PROTOTYPES
 EGLAPI EGLImageKHR EGLAPIENTRY eglCreateDRMImageMESA (EGLDisplay dpy, const EGLint *attrib_list);
 EGLAPI EGLBoolean EGLAPIENTRY eglExportDRMImageMESA (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride);
-#endif /* EGL_EGLEXT_PROTOTYPES */
-typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEDRMIMAGEMESAPROC) (EGLDisplay dpy, const EGLint *attrib_list);
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDRMIMAGEMESAPROC) (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride);
 #endif
+#endif /* EGL_MESA_drm_image */
+
+#ifndef EGL_MESA_platform_gbm
+#define EGL_MESA_platform_gbm 1
+#define EGL_PLATFORM_GBM_MESA             0x31D7
+#endif /* EGL_MESA_platform_gbm */
+
+#ifndef EGL_NV_3dvision_surface
+#define EGL_NV_3dvision_surface 1
+#define EGL_AUTO_STEREO_NV                0x3136
+#endif /* EGL_NV_3dvision_surface */
+
+#ifndef EGL_NV_coverage_sample
+#define EGL_NV_coverage_sample 1
+#define EGL_COVERAGE_BUFFERS_NV           0x30E0
+#define EGL_COVERAGE_SAMPLES_NV           0x30E1
+#endif /* EGL_NV_coverage_sample */
+
+#ifndef EGL_NV_coverage_sample_resolve
+#define EGL_NV_coverage_sample_resolve 1
+#define EGL_COVERAGE_SAMPLE_RESOLVE_NV    0x3131
+#define EGL_COVERAGE_SAMPLE_RESOLVE_DEFAULT_NV 0x3132
+#define EGL_COVERAGE_SAMPLE_RESOLVE_NONE_NV 0x3133
+#endif /* EGL_NV_coverage_sample_resolve */
+
+#ifndef EGL_NV_depth_nonlinear
+#define EGL_NV_depth_nonlinear 1
+#define EGL_DEPTH_ENCODING_NV             0x30E2
+#define EGL_DEPTH_ENCODING_NONE_NV        0
+#define EGL_DEPTH_ENCODING_NONLINEAR_NV   0x30E3
+#endif /* EGL_NV_depth_nonlinear */
+
+#ifndef EGL_NV_native_query
+#define EGL_NV_native_query 1
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEDISPLAYNVPROC) (EGLDisplay dpy, EGLNativeDisplayType *display_id);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEWINDOWNVPROC) (EGLDisplay dpy, EGLSurface surf, EGLNativeWindowType *window);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEPIXMAPNVPROC) (EGLDisplay dpy, EGLSurface surf, EGLNativePixmapType *pixmap);
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativeDisplayNV (EGLDisplay dpy, EGLNativeDisplayType *display_id);
+EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativeWindowNV (EGLDisplay dpy, EGLSurface surf, EGLNativeWindowType *window);
+EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativePixmapNV (EGLDisplay dpy, EGLSurface surf, EGLNativePixmapType *pixmap);
+#endif
+#endif /* EGL_NV_native_query */
+
+#ifndef EGL_NV_post_convert_rounding
+#define EGL_NV_post_convert_rounding 1
+#endif /* EGL_NV_post_convert_rounding */
 
 #ifndef EGL_NV_post_sub_buffer
 #define EGL_NV_post_sub_buffer 1
-#define EGL_POST_SUB_BUFFER_SUPPORTED_NV       0x30BE
+#define EGL_POST_SUB_BUFFER_SUPPORTED_NV  0x30BE
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLPOSTSUBBUFFERNVPROC) (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height);
 #ifdef EGL_EGLEXT_PROTOTYPES
 EGLAPI EGLBoolean EGLAPIENTRY eglPostSubBufferNV (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height);
-#endif /* EGL_EGLEXT_PROTOTYPES */
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLPOSTSUBBUFFERNVPROC) (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height);
 #endif
+#endif /* EGL_NV_post_sub_buffer */
 
-#ifndef EGL_ANGLE_query_surface_pointer
-#define EGL_ANGLE_query_surface_pointer 1
+#ifndef EGL_NV_stream_sync
+#define EGL_NV_stream_sync 1
+#define EGL_SYNC_NEW_FRAME_NV             0x321F
+typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESTREAMSYNCNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum type, const EGLint *attrib_list);
 #ifdef EGL_EGLEXT_PROTOTYPES
-EGLAPI EGLBoolean eglQuerySurfacePointerANGLE(EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value);
-#endif
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSURFACEPOINTERANGLEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value);
-#endif
-
-#ifndef EGL_ANGLE_surface_d3d_texture_2d_share_handle
-#define EGL_ANGLE_surface_d3d_texture_2d_share_handle 1
-#define EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE  0x3200
+EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateStreamSyncNV (EGLDisplay dpy, EGLStreamKHR stream, EGLenum type, const EGLint *attrib_list);
 #endif
+#endif /* EGL_NV_stream_sync */
 
-#ifndef EGL_NV_coverage_sample_resolve
-#define EGL_NV_coverage_sample_resolve 1
-#define EGL_COVERAGE_SAMPLE_RESOLVE_NV         0x3131
-#define EGL_COVERAGE_SAMPLE_RESOLVE_DEFAULT_NV 0x3132
-#define EGL_COVERAGE_SAMPLE_RESOLVE_NONE_NV    0x3133
+#ifndef EGL_NV_sync
+#define EGL_NV_sync 1
+typedef void *EGLSyncNV;
+typedef khronos_utime_nanoseconds_t EGLTimeNV;
+#ifdef KHRONOS_SUPPORT_INT64
+#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_NV 0x30E6
+#define EGL_SYNC_STATUS_NV                0x30E7
+#define EGL_SIGNALED_NV                   0x30E8
+#define EGL_UNSIGNALED_NV                 0x30E9
+#define EGL_SYNC_FLUSH_COMMANDS_BIT_NV    0x0001
+#define EGL_FOREVER_NV                    0xFFFFFFFFFFFFFFFFull
+#define EGL_ALREADY_SIGNALED_NV           0x30EA
+#define EGL_TIMEOUT_EXPIRED_NV            0x30EB
+#define EGL_CONDITION_SATISFIED_NV        0x30EC
+#define EGL_SYNC_TYPE_NV                  0x30ED
+#define EGL_SYNC_CONDITION_NV             0x30EE
+#define EGL_SYNC_FENCE_NV                 0x30EF
+#define EGL_NO_SYNC_NV                    ((EGLSyncNV)0)
+typedef EGLSyncNV (EGLAPIENTRYP PFNEGLCREATEFENCESYNCNVPROC) (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCNVPROC) (EGLSyncNV sync);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLFENCENVPROC) (EGLSyncNV sync);
+typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCNVPROC) (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCNVPROC) (EGLSyncNV sync, EGLenum mode);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBNVPROC) (EGLSyncNV sync, EGLint attribute, EGLint *value);
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLSyncNV EGLAPIENTRY eglCreateFenceSyncNV (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list);
+EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncNV (EGLSyncNV sync);
+EGLAPI EGLBoolean EGLAPIENTRY eglFenceNV (EGLSyncNV sync);
+EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncNV (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout);
+EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncNV (EGLSyncNV sync, EGLenum mode);
+EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribNV (EGLSyncNV sync, EGLint attribute, EGLint *value);
 #endif
+#endif /* KHRONOS_SUPPORT_INT64 */
+#endif /* EGL_NV_sync */
 
-#if KHRONOS_SUPPORT_INT64   /* EGLTimeKHR requires 64-bit uint support */
 #ifndef EGL_NV_system_time
 #define EGL_NV_system_time 1
-
 typedef khronos_utime_nanoseconds_t EGLuint64NV;
-
-#ifdef EGL_EGLEXT_PROTOTYPES
-EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeFrequencyNV(void);
-EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeNV(void);
-#endif /* EGL_EGLEXT_PROTOTYPES */
+#ifdef KHRONOS_SUPPORT_INT64
 typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC) (void);
 typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMENVPROC) (void);
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeFrequencyNV (void);
+EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeNV (void);
 #endif
-#endif
-
-#include <EGL/eglmesaext.h>
+#endif /* KHRONOS_SUPPORT_INT64 */
+#endif /* EGL_NV_system_time */
 
 #ifdef __cplusplus
 }
index 52dd5b1..1f07d4c 100644 (file)
@@ -112,14 +112,26 @@ typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETDRMDISPLAYMESA) (int fd);
 #ifndef EGL_WL_bind_wayland_display
 #define EGL_WL_bind_wayland_display 1
 
-#define EGL_WAYLAND_BUFFER_WL                  0x31D5 /* eglCreateImageKHR target */
+#define EGL_WAYLAND_BUFFER_WL          0x31D5 /* eglCreateImageKHR target */
+#define EGL_WAYLAND_PLANE_WL           0x31D6 /* eglCreateImageKHR target */
+
+#define EGL_WAYLAND_Y_INVERTED_WL      0x31DB /* eglQueryWaylandBufferWL attribute */
+
+#define EGL_TEXTURE_Y_U_V_WL            0x31D7
+#define EGL_TEXTURE_Y_UV_WL             0x31D8
+#define EGL_TEXTURE_Y_XUXV_WL           0x31D9
+
 struct wl_display;
+struct wl_resource;
 #ifdef EGL_EGLEXT_PROTOTYPES
 EGLAPI EGLBoolean EGLAPIENTRY eglBindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display);
 EGLAPI EGLBoolean EGLAPIENTRY eglUnbindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display);
+EGLAPI EGLBoolean EGLAPIENTRY eglQueryWaylandBufferWL(EGLDisplay dpy, struct wl_resource *buffer, EGLint attribute, EGLint *value);
 #endif
 typedef EGLBoolean (EGLAPIENTRYP PFNEGLBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display);
 typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYWAYLANDBUFFERWL) (EGLDisplay dpy, struct wl_resource *buffer, EGLint attribute, EGLint *value);
+
 #endif
 
 #ifndef EGL_NOK_swap_region
index 19d38d9..ef9153f 100644 (file)
@@ -2,7 +2,7 @@
 #define __eglplatform_h_
 
 /*
-** Copyright (c) 2007-2009 The Khronos Group Inc.
+** Copyright (c) 2007-2013 The Khronos Group Inc.
 **
 ** Permission is hereby granted, free of charge, to any person obtaining a
 ** copy of this software and/or associated documentation files (the
@@ -25,7 +25,7 @@
 */
 
 /* Platform-specific types and definitions for egl.h
- * $Revision: 12306 $ on $Date: 2010-08-25 09:51:28 -0700 (Wed, 25 Aug 2010) $
+ * $Revision: 23432 $ on $Date: 2013-10-09 00:57:24 -0700 (Wed, 09 Oct 2013) $
  *
  * Adopters may modify khrplatform.h and this file to suit their platform.
  * You are encouraged to submit all modifications to the Khronos group so that
@@ -83,26 +83,15 @@ typedef int   EGLNativeDisplayType;
 typedef void *EGLNativeWindowType;
 typedef void *EGLNativePixmapType;
 
-#elif defined(WL_EGL_PLATFORM)
+#elif defined(__ANDROID__) || defined(ANDROID)
 
-typedef struct wl_display     *EGLNativeDisplayType;
-typedef struct wl_egl_pixmap  *EGLNativePixmapType;
-typedef struct wl_egl_window  *EGLNativeWindowType;
+#include <android/native_window.h>
 
-#elif defined(__GBM__)
-
-typedef struct gbm_device  *EGLNativeDisplayType;
-typedef struct gbm_bo      *EGLNativePixmapType;
-typedef void               *EGLNativeWindowType;
-
-#elif defined(ANDROID) /* Android */
-
-struct ANativeWindow;
 struct egl_native_pixmap_t;
 
-typedef struct ANativeWindow        *EGLNativeWindowType;
-typedef struct egl_native_pixmap_t  *EGLNativePixmapType;
-typedef void                        *EGLNativeDisplayType;
+typedef struct ANativeWindow*           EGLNativeWindowType;
+typedef struct egl_native_pixmap_t*     EGLNativePixmapType;
+typedef void*                           EGLNativeDisplayType;
 
 #elif defined(__APPLE__) && defined (__MACH__) /* Mac OS X */
 
@@ -112,14 +101,6 @@ typedef void                *EGLNativeWindowType;
 
 #elif defined(__unix__)
 
-#ifdef MESA_EGL_NO_X11_HEADERS
-
-typedef void            *EGLNativeDisplayType;
-typedef khronos_uint32_t EGLNativePixmapType;
-typedef khronos_uint32_t EGLNativeWindowType;
-
-#else
-
 /* X11 (tentative)  */
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
@@ -128,8 +109,6 @@ typedef Display *EGLNativeDisplayType;
 typedef Pixmap   EGLNativePixmapType;
 typedef Window   EGLNativeWindowType;
 
-#endif /* MESA_EGL_NO_X11_HEADERS */
-
 #else
 #error "Platform not recognized"
 #endif
index 4479539..c9e6f17 100644 (file)
@@ -26,7 +26,7 @@
 
 /* Khronos platform-specific types and definitions.
  *
- * $Revision: 9356 $ on $Date: 2009-10-21 02:52:25 -0700 (Wed, 21 Oct 2009) $
+ * $Revision: 23298 $ on $Date: 2013-09-30 17:07:13 -0700 (Mon, 30 Sep 2013) $
  *
  * Adopters may modify this file to suit their platform. Adopters are
  * encouraged to submit platform specific modifications to the Khronos
  * This precedes the return type of the function in the function prototype.
  */
 #if defined(_WIN32) && !defined(__SCITECH_SNAP__)
-#   if defined(KHRONOS_DLL_EXPORTS)
-#      define KHRONOS_APICALL __declspec(dllexport)
-#   else
-#      define KHRONOS_APICALL __declspec(dllimport)
-#   endif
+#   define KHRONOS_APICALL __declspec(dllimport)
 #elif defined (__SYMBIAN32__)
 #   define KHRONOS_APICALL IMPORT_C
-#elif (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303) \
-       || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
-/* KHRONOS_APIATTRIBUTES is not used by the client API headers yet */
-#  define KHRONOS_APICALL __attribute__((visibility("default")))
 #else
 #   define KHRONOS_APICALL
 #endif
@@ -229,10 +221,23 @@ typedef signed   char          khronos_int8_t;
 typedef unsigned char          khronos_uint8_t;
 typedef signed   short int     khronos_int16_t;
 typedef unsigned short int     khronos_uint16_t;
+
+/*
+ * Types that differ between LLP64 and LP64 architectures - in LLP64, 
+ * pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
+ * to be the only LLP64 architecture in current use.
+ */
+#ifdef _WIN64
+typedef signed   long long int khronos_intptr_t;
+typedef unsigned long long int khronos_uintptr_t;
+typedef signed   long long int khronos_ssize_t;
+typedef unsigned long long int khronos_usize_t;
+#else
 typedef signed   long  int     khronos_intptr_t;
 typedef unsigned long  int     khronos_uintptr_t;
 typedef signed   long  int     khronos_ssize_t;
 typedef unsigned long  int     khronos_usize_t;
+#endif
 
 #if KHRONOS_SUPPORT_FLOAT
 /*
index 0638d31..2689ce6 100644 (file)
@@ -77,6 +77,7 @@ struct yagl_server_state
     }
 
     ss->render_type = egl_backend->render_type;
+    ss->gl_version = egl_backend->gl_version;
 
     return ss;
 
@@ -134,6 +135,7 @@ void yagl_server_reset(struct yagl_server_state *ss)
  *  IN (uint32_t) tid
  *  OUT (uint32_t) res: 1 - init ok, 0 - init error
  *  OUT (uint32_t) render_type: in case of init ok
+ *  OUT (uint32_t) gl_version: in case of init ok
  */
 bool yagl_server_dispatch_init(struct yagl_server_state *ss,
                                uint8_t *buff,
@@ -250,6 +252,7 @@ out:
 
     yagl_marshal_put_uint32_t(&buff, 1);
     yagl_marshal_put_uint32_t(&buff, ss->render_type);
+    yagl_marshal_put_uint32_t(&buff, ss->gl_version);
 
     YAGL_LOG_FUNC_EXIT(NULL);
 
index ccc56a8..8146f66 100644 (file)
@@ -14,6 +14,8 @@ struct yagl_server_state
 {
     yagl_render_type render_type;
 
+    yagl_gl_version gl_version;
+
     struct yagl_api *apis[YAGL_NUM_APIS];
 
     QLIST_HEAD(, yagl_process_state) processes;
index 8fa4ddf..b2b7a63 100644 (file)
@@ -32,6 +32,16 @@ typedef enum
 
 #define YAGL_NUM_APIS 2
 
+typedef enum
+{
+    /* OpenGL 2.1 or OpenGL >= 3.1 compatibility. */
+    yagl_gl_2 = 0,
+    /* OpenGL >= 3.2 core, no GL_ARB_ES3_compatibility support. */
+    yagl_gl_3 = 1,
+    /* OpenGL >= 3.1 core, GL_ARB_ES3_compatibility support. */
+    yagl_gl_3_es3 = 2
+} yagl_gl_version;
+
 typedef bool (*yagl_api_func)(struct yagl_transport */*t*/);
 
 #endif
index ae66752..bf8fb7e 100644 (file)
@@ -6,6 +6,6 @@
 /*
  * Whenever protocol changes be sure to bump this.
  */
-#define YAGL_VERSION 21
+#define YAGL_VERSION 22
 
 #endif