summaryrefslogtreecommitdiff
path: root/hw/yagl
diff options
context:
space:
mode:
Diffstat (limited to 'hw/yagl')
-rw-r--r--hw/yagl/Makefile.objs32
-rw-r--r--hw/yagl/yagl_api.c48
-rw-r--r--hw/yagl/yagl_api.h85
-rw-r--r--hw/yagl/yagl_apis/Makefile.objs2
-rw-r--r--hw/yagl/yagl_apis/egl/Makefile.objs11
-rw-r--r--hw/yagl/yagl_apis/egl/yagl_egl_api.c58
-rw-r--r--hw/yagl/yagl_apis/egl/yagl_egl_api.h49
-rw-r--r--hw/yagl/yagl_apis/egl/yagl_egl_api_ps.c96
-rw-r--r--hw/yagl/yagl_apis/egl/yagl_egl_api_ps.h63
-rw-r--r--hw/yagl/yagl_apis/egl/yagl_egl_api_ts.c73
-rw-r--r--hw/yagl/yagl_apis/egl/yagl_egl_api_ts.h67
-rw-r--r--hw/yagl/yagl_apis/egl/yagl_egl_calls.c696
-rw-r--r--hw/yagl/yagl_apis/egl/yagl_egl_calls.h42
-rw-r--r--hw/yagl/yagl_apis/egl/yagl_egl_config.c441
-rw-r--r--hw/yagl/yagl_apis/egl/yagl_egl_config.h94
-rw-r--r--hw/yagl/yagl_apis/egl/yagl_egl_context.c114
-rw-r--r--hw/yagl/yagl_apis/egl/yagl_egl_context.h87
-rw-r--r--hw/yagl/yagl_apis/egl/yagl_egl_display.c251
-rw-r--r--hw/yagl/yagl_apis/egl/yagl_egl_display.h168
-rw-r--r--hw/yagl/yagl_apis/egl/yagl_egl_surface.c77
-rw-r--r--hw/yagl/yagl_apis/egl/yagl_egl_surface.h78
-rw-r--r--hw/yagl/yagl_apis/egl/yagl_egl_validate.c35
-rw-r--r--hw/yagl/yagl_apis/egl/yagl_egl_validate.h38
-rw-r--r--hw/yagl/yagl_apis/egl/yagl_host_egl_calls.c1844
-rw-r--r--hw/yagl/yagl_apis/egl/yagl_host_egl_calls.h151
-rw-r--r--hw/yagl/yagl_apis/gles/Makefile.objs6
-rw-r--r--hw/yagl/yagl_apis/gles/yagl_gles_api.c58
-rw-r--r--hw/yagl/yagl_apis/gles/yagl_gles_api.h49
-rw-r--r--hw/yagl/yagl_apis/gles/yagl_gles_api_ps.c125
-rw-r--r--hw/yagl/yagl_apis/gles/yagl_gles_api_ps.h63
-rw-r--r--hw/yagl/yagl_apis/gles/yagl_gles_api_ts.c51
-rw-r--r--hw/yagl/yagl_apis/gles/yagl_gles_api_ts.h55
-rw-r--r--hw/yagl/yagl_apis/gles/yagl_gles_calls.c3542
-rw-r--r--hw/yagl/yagl_apis/gles/yagl_gles_calls.h42
-rw-r--r--hw/yagl/yagl_apis/gles/yagl_host_gles_calls.c2041
-rw-r--r--hw/yagl/yagl_apis/gles/yagl_host_gles_calls.h542
-rw-r--r--hw/yagl/yagl_avl.c873
-rw-r--r--hw/yagl/yagl_avl.h130
-rw-r--r--hw/yagl/yagl_backends/Makefile.objs2
-rw-r--r--hw/yagl/yagl_backends/egl_offscreen/Makefile.objs6
-rw-r--r--hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen.c342
-rw-r--r--hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen.h72
-rw-r--r--hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen_context.c239
-rw-r--r--hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen_context.h62
-rw-r--r--hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen_display.c217
-rw-r--r--hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen_display.h48
-rw-r--r--hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen_surface.c276
-rw-r--r--hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen_surface.h81
-rw-r--r--hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen_ts.c43
-rw-r--r--hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen_ts.h52
-rw-r--r--hw/yagl/yagl_backends/egl_onscreen/Makefile.objs7
-rw-r--r--hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen.c428
-rw-r--r--hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen.h76
-rw-r--r--hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen_context.c154
-rw-r--r--hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen_context.h82
-rw-r--r--hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen_display.c248
-rw-r--r--hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen_display.h47
-rw-r--r--hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen_surface.c426
-rw-r--r--hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen_surface.h89
-rw-r--r--hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen_ts.c50
-rw-r--r--hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen_ts.h54
-rw-r--r--hw/yagl/yagl_compiled_transfer.c199
-rw-r--r--hw/yagl/yagl_compiled_transfer.h66
-rw-r--r--hw/yagl/yagl_device.c382
-rw-r--r--hw/yagl/yagl_drivers/Makefile.objs6
-rw-r--r--hw/yagl/yagl_drivers/egl_agl/Makefile.objs3
-rw-r--r--hw/yagl/yagl_drivers/egl_agl/yagl_egl_agl.c407
-rw-r--r--hw/yagl/yagl_drivers/egl_glx/Makefile.objs2
-rw-r--r--hw/yagl/yagl_drivers/egl_glx/yagl_egl_glx.c601
-rw-r--r--hw/yagl/yagl_drivers/egl_wgl/Makefile.objs2
-rw-r--r--hw/yagl/yagl_drivers/egl_wgl/yagl_egl_wgl.c1060
-rw-r--r--hw/yagl/yagl_drivers/gles_ogl/Makefile.objs2
-rw-r--r--hw/yagl/yagl_drivers/gles_ogl/yagl_gles_ogl.c248
-rw-r--r--hw/yagl/yagl_drivers/gles_ogl/yagl_gles_ogl.h40
-rw-r--r--hw/yagl/yagl_drivers/gles_ogl/yagl_gles_ogl_macros.h54
-rw-r--r--hw/yagl/yagl_drivers/gles_onscreen/Makefile.objs3
-rw-r--r--hw/yagl/yagl_drivers/gles_onscreen/yagl_gles_onscreen.c104
-rw-r--r--hw/yagl/yagl_drivers/gles_onscreen/yagl_gles_onscreen.h43
-rw-r--r--hw/yagl/yagl_dyn_lib.c152
-rw-r--r--hw/yagl/yagl_dyn_lib.h52
-rw-r--r--hw/yagl/yagl_egl_backend.c40
-rw-r--r--hw/yagl/yagl_egl_backend.h92
-rw-r--r--hw/yagl/yagl_egl_driver.c42
-rw-r--r--hw/yagl/yagl_egl_driver.h120
-rw-r--r--hw/yagl/yagl_egl_interface.h42
-rw-r--r--hw/yagl/yagl_egl_native_config.c50
-rw-r--r--hw/yagl/yagl_egl_native_config.h86
-rw-r--r--hw/yagl/yagl_egl_surface_attribs.c46
-rw-r--r--hw/yagl/yagl_egl_surface_attribs.h67
-rw-r--r--hw/yagl/yagl_eglb_context.c40
-rw-r--r--hw/yagl/yagl_eglb_context.h48
-rw-r--r--hw/yagl/yagl_eglb_display.c40
-rw-r--r--hw/yagl/yagl_eglb_display.h96
-rw-r--r--hw/yagl/yagl_eglb_surface.c58
-rw-r--r--hw/yagl/yagl_eglb_surface.h89
-rw-r--r--hw/yagl/yagl_event.c93
-rw-r--r--hw/yagl/yagl_event.h58
-rw-r--r--hw/yagl/yagl_gles_driver.c54
-rw-r--r--hw/yagl/yagl_gles_driver.h300
-rw-r--r--hw/yagl/yagl_handle_gen.c62
-rw-r--r--hw/yagl/yagl_handle_gen.h43
-rw-r--r--hw/yagl/yagl_inc/EGL/egl.h329
-rw-r--r--hw/yagl/yagl_inc/EGL/eglext.h337
-rw-r--r--hw/yagl/yagl_inc/EGL/eglmesaext.h150
-rw-r--r--hw/yagl/yagl_inc/EGL/eglplatform.h152
-rw-r--r--hw/yagl/yagl_inc/GL/gl.h2235
-rw-r--r--hw/yagl/yagl_inc/GL/gl_mangle.h2311
-rw-r--r--hw/yagl/yagl_inc/GL/glext.h11488
-rw-r--r--hw/yagl/yagl_inc/GL/glu.h353
-rw-r--r--hw/yagl/yagl_inc/GL/glu_mangle.h86
-rw-r--r--hw/yagl/yagl_inc/GL/glx.h526
-rw-r--r--hw/yagl/yagl_inc/GL/glx_mangle.h82
-rw-r--r--hw/yagl/yagl_inc/GL/glxext.h993
-rw-r--r--hw/yagl/yagl_inc/GL/internal/dri_interface.h986
-rw-r--r--hw/yagl/yagl_inc/GL/internal/sarea.h92
-rw-r--r--hw/yagl/yagl_inc/GL/osmesa.h283
-rw-r--r--hw/yagl/yagl_inc/GL/vms_x_fix.h1224
-rw-r--r--hw/yagl/yagl_inc/GL/wglext.h901
-rw-r--r--hw/yagl/yagl_inc/GL/wmesa.h141
-rw-r--r--hw/yagl/yagl_inc/GLES/egl.h15
-rw-r--r--hw/yagl/yagl_inc/GLES/gl.h770
-rw-r--r--hw/yagl/yagl_inc/GLES/glext.h1073
-rw-r--r--hw/yagl/yagl_inc/GLES/glplatform.h30
-rw-r--r--hw/yagl/yagl_inc/GLES2/gl2.h621
-rw-r--r--hw/yagl/yagl_inc/GLES2/gl2ext.h1138
-rw-r--r--hw/yagl/yagl_inc/GLES2/gl2platform.h30
-rw-r--r--hw/yagl/yagl_inc/KHR/khrplatform.h277
-rw-r--r--hw/yagl/yagl_log.c581
-rw-r--r--hw/yagl/yagl_log.h265
-rw-r--r--hw/yagl/yagl_mem.c152
-rw-r--r--hw/yagl/yagl_mem.h61
-rw-r--r--hw/yagl/yagl_object_map.c137
-rw-r--r--hw/yagl/yagl_object_map.h65
-rw-r--r--hw/yagl/yagl_process.c174
-rw-r--r--hw/yagl/yagl_process.h87
-rw-r--r--hw/yagl/yagl_ref.c72
-rw-r--r--hw/yagl/yagl_ref.h63
-rw-r--r--hw/yagl/yagl_resource.c58
-rw-r--r--hw/yagl/yagl_resource.h69
-rw-r--r--hw/yagl/yagl_resource_list.c110
-rw-r--r--hw/yagl/yagl_resource_list.h94
-rw-r--r--hw/yagl/yagl_server.c409
-rw-r--r--hw/yagl/yagl_server.h111
-rw-r--r--hw/yagl/yagl_stats.c107
-rw-r--r--hw/yagl/yagl_stats.h51
-rw-r--r--hw/yagl/yagl_thread.c240
-rw-r--r--hw/yagl/yagl_thread.h78
-rw-r--r--hw/yagl/yagl_tls.h38
-rw-r--r--hw/yagl/yagl_transport.c296
-rw-r--r--hw/yagl/yagl_transport.h182
-rw-r--r--hw/yagl/yagl_transport_egl.h47
-rw-r--r--hw/yagl/yagl_transport_gl.h81
-rw-r--r--hw/yagl/yagl_types.h79
-rw-r--r--hw/yagl/yagl_vector.c113
-rw-r--r--hw/yagl/yagl_vector.h69
-rw-r--r--hw/yagl/yagl_version.h40
156 files changed, 50922 insertions, 0 deletions
diff --git a/hw/yagl/Makefile.objs b/hw/yagl/Makefile.objs
new file mode 100644
index 0000000000..39434fc1cc
--- /dev/null
+++ b/hw/yagl/Makefile.objs
@@ -0,0 +1,32 @@
+QEMU_CFLAGS += -I$(SRC_PATH)/hw/yagl -I$(SRC_PATH)/hw/yagl/yagl_inc
+
+obj-y += yagl_device.o
+obj-y += yagl_log.o
+obj-y += yagl_process.o
+obj-y += yagl_thread.o
+obj-y += yagl_server.o
+obj-y += yagl_ref.o
+obj-y += yagl_mem.o
+obj-y += yagl_event.o
+obj-y += yagl_handle_gen.o
+obj-y += yagl_dyn_lib.o
+obj-y += yagl_api.o
+obj-y += yagl_vector.o
+obj-y += yagl_avl.o
+obj-y += yagl_transport.o
+obj-y += yagl_egl_backend.o
+obj-y += yagl_eglb_display.o
+obj-y += yagl_eglb_context.o
+obj-y += yagl_eglb_surface.o
+obj-y += yagl_egl_driver.o
+obj-y += yagl_gles_driver.o
+obj-y += yagl_resource.o
+obj-y += yagl_resource_list.o
+obj-y += yagl_object_map.o
+obj-y += yagl_stats.o
+obj-y += yagl_compiled_transfer.o
+obj-y += yagl_egl_native_config.o
+obj-y += yagl_egl_surface_attribs.o
+obj-y += yagl_apis/
+obj-y += yagl_backends/
+obj-y += yagl_drivers/
diff --git a/hw/yagl/yagl_api.c b/hw/yagl/yagl_api.c
new file mode 100644
index 0000000000..64be0220a9
--- /dev/null
+++ b/hw/yagl/yagl_api.c
@@ -0,0 +1,48 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "yagl_api.h"
+
+void yagl_api_ps_init(struct yagl_api_ps *api_ps,
+ struct yagl_api *api)
+{
+ api_ps->api = api;
+}
+
+void yagl_api_ps_cleanup(struct yagl_api_ps *api_ps)
+{
+}
+
+void yagl_api_init(struct yagl_api *api)
+{
+}
+
+void yagl_api_cleanup(struct yagl_api *api)
+{
+}
diff --git a/hw/yagl/yagl_api.h b/hw/yagl/yagl_api.h
new file mode 100644
index 0000000000..bf11c0a159
--- /dev/null
+++ b/hw/yagl/yagl_api.h
@@ -0,0 +1,85 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_API_H
+#define _QEMU_YAGL_API_H
+
+#include "yagl_types.h"
+
+/*
+ * YaGL API per-process state.
+ * @{
+ */
+
+struct yagl_api_ps
+{
+ struct yagl_api *api;
+
+ void (*thread_init)(struct yagl_api_ps */*api_ps*/);
+
+ void (*batch_start)(struct yagl_api_ps */*api_ps*/);
+
+ yagl_api_func (*get_func)(struct yagl_api_ps */*api_ps*/,
+ uint32_t /*func_id*/);
+
+ void (*batch_end)(struct yagl_api_ps */*api_ps*/);
+
+ void (*thread_fini)(struct yagl_api_ps */*api_ps*/);
+
+ void (*destroy)(struct yagl_api_ps */*api_ps*/);
+};
+
+void yagl_api_ps_init(struct yagl_api_ps *api_ps,
+ struct yagl_api *api);
+void yagl_api_ps_cleanup(struct yagl_api_ps *api_ps);
+
+/*
+ * @}
+ */
+
+/*
+ * YaGL API.
+ * @{
+ */
+
+struct yagl_api
+{
+ struct yagl_api_ps *(*process_init)(struct yagl_api */*api*/);
+
+ void (*destroy)(struct yagl_api */*api*/);
+};
+
+void yagl_api_init(struct yagl_api *api);
+void yagl_api_cleanup(struct yagl_api *api);
+
+/*
+ * @}
+ */
+
+#endif
diff --git a/hw/yagl/yagl_apis/Makefile.objs b/hw/yagl/yagl_apis/Makefile.objs
new file mode 100644
index 0000000000..9e6fc3fd17
--- /dev/null
+++ b/hw/yagl/yagl_apis/Makefile.objs
@@ -0,0 +1,2 @@
+obj-y += egl/
+obj-y += gles/
diff --git a/hw/yagl/yagl_apis/egl/Makefile.objs b/hw/yagl/yagl_apis/egl/Makefile.objs
new file mode 100644
index 0000000000..570a379379
--- /dev/null
+++ b/hw/yagl/yagl_apis/egl/Makefile.objs
@@ -0,0 +1,11 @@
+# EGL api
+obj-y += yagl_egl_api.o
+obj-y += yagl_egl_api_ps.o
+obj-y += yagl_egl_api_ts.o
+obj-y += yagl_egl_calls.o
+obj-y += yagl_egl_display.o
+obj-y += yagl_egl_config.o
+obj-y += yagl_egl_surface.o
+obj-y += yagl_egl_context.o
+obj-y += yagl_egl_validate.o
+obj-y += yagl_host_egl_calls.o
diff --git a/hw/yagl/yagl_apis/egl/yagl_egl_api.c b/hw/yagl/yagl_apis/egl/yagl_egl_api.c
new file mode 100644
index 0000000000..3587685150
--- /dev/null
+++ b/hw/yagl/yagl_apis/egl/yagl_egl_api.c
@@ -0,0 +1,58 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "yagl_egl_api.h"
+#include "yagl_host_egl_calls.h"
+#include "yagl_egl_backend.h"
+
+static void yagl_egl_api_destroy(struct yagl_api *api)
+{
+ struct yagl_egl_api *egl_api = (struct yagl_egl_api*)api;
+
+ egl_api->backend->destroy(egl_api->backend);
+ egl_api->backend = NULL;
+
+ yagl_api_cleanup(&egl_api->base);
+
+ g_free(egl_api);
+}
+
+struct yagl_api *yagl_egl_api_create(struct yagl_egl_backend *backend)
+{
+ struct yagl_egl_api *egl_api = g_malloc0(sizeof(struct yagl_egl_api));
+
+ yagl_api_init(&egl_api->base);
+
+ egl_api->base.process_init = &yagl_host_egl_process_init;
+ egl_api->base.destroy = &yagl_egl_api_destroy;
+
+ egl_api->backend = backend;
+
+ return &egl_api->base;
+}
diff --git a/hw/yagl/yagl_apis/egl/yagl_egl_api.h b/hw/yagl/yagl_apis/egl/yagl_egl_api.h
new file mode 100644
index 0000000000..e7051760f0
--- /dev/null
+++ b/hw/yagl/yagl_apis/egl/yagl_egl_api.h
@@ -0,0 +1,49 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_EGL_API_H
+#define _QEMU_YAGL_EGL_API_H
+
+#include "yagl_api.h"
+
+struct yagl_egl_backend;
+
+struct yagl_egl_api
+{
+ struct yagl_api base;
+
+ struct yagl_egl_backend *backend;
+};
+
+/*
+ * Takes ownership of 'backend'
+ */
+struct yagl_api *yagl_egl_api_create(struct yagl_egl_backend *backend);
+
+#endif
diff --git a/hw/yagl/yagl_apis/egl/yagl_egl_api_ps.c b/hw/yagl/yagl_apis/egl/yagl_egl_api_ps.c
new file mode 100644
index 0000000000..ab10cae325
--- /dev/null
+++ b/hw/yagl/yagl_apis/egl/yagl_egl_api_ps.c
@@ -0,0 +1,96 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "yagl_egl_api_ps.h"
+#include "yagl_egl_display.h"
+#include "yagl_egl_backend.h"
+#include "yagl_process.h"
+#include "yagl_thread.h"
+
+void yagl_egl_api_ps_init(struct yagl_egl_api_ps *egl_api_ps,
+ struct yagl_egl_backend *backend,
+ struct yagl_egl_interface *egl_iface)
+{
+ egl_api_ps->backend = backend;
+ egl_api_ps->egl_iface = egl_iface;
+
+ yagl_process_register_egl_interface(cur_ts->ps, egl_api_ps->egl_iface);
+
+ QLIST_INIT(&egl_api_ps->displays);
+}
+
+void yagl_egl_api_ps_cleanup(struct yagl_egl_api_ps *egl_api_ps)
+{
+ struct yagl_egl_display *dpy, *next;
+
+ QLIST_FOREACH_SAFE(dpy, &egl_api_ps->displays, entry, next) {
+ QLIST_REMOVE(dpy, entry);
+ yagl_egl_display_destroy(dpy);
+ }
+
+ assert(QLIST_EMPTY(&egl_api_ps->displays));
+
+ yagl_process_unregister_egl_interface(cur_ts->ps);
+}
+
+struct yagl_egl_display *yagl_egl_api_ps_display_get(struct yagl_egl_api_ps *egl_api_ps,
+ yagl_host_handle handle)
+{
+ struct yagl_egl_display *dpy;
+
+ QLIST_FOREACH(dpy, &egl_api_ps->displays, entry) {
+ if (dpy->handle == handle) {
+ return dpy;
+ }
+ }
+
+ return NULL;
+}
+
+struct yagl_egl_display *yagl_egl_api_ps_display_add(struct yagl_egl_api_ps *egl_api_ps,
+ uint32_t display_id)
+{
+ struct yagl_egl_display *dpy;
+
+ QLIST_FOREACH(dpy, &egl_api_ps->displays, entry) {
+ if (dpy->display_id == display_id) {
+ return dpy;
+ }
+ }
+
+ dpy = yagl_egl_display_create(egl_api_ps->backend, display_id);
+
+ if (!dpy) {
+ return NULL;
+ }
+
+ QLIST_INSERT_HEAD(&egl_api_ps->displays, dpy, entry);
+
+ return dpy;
+}
diff --git a/hw/yagl/yagl_apis/egl/yagl_egl_api_ps.h b/hw/yagl/yagl_apis/egl/yagl_egl_api_ps.h
new file mode 100644
index 0000000000..f963540bd2
--- /dev/null
+++ b/hw/yagl/yagl_apis/egl/yagl_egl_api_ps.h
@@ -0,0 +1,63 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_EGL_API_PS_H
+#define _QEMU_YAGL_EGL_API_PS_H
+
+#include "yagl_api.h"
+#include "qemu/queue.h"
+
+struct yagl_egl_interface;
+struct yagl_egl_backend;
+struct yagl_egl_display;
+
+struct yagl_egl_api_ps
+{
+ struct yagl_api_ps base;
+
+ struct yagl_egl_backend *backend;
+
+ struct yagl_egl_interface *egl_iface;
+
+ QLIST_HEAD(, yagl_egl_display) displays;
+};
+
+void yagl_egl_api_ps_init(struct yagl_egl_api_ps *egl_api_ps,
+ struct yagl_egl_backend *backend,
+ struct yagl_egl_interface *egl_iface);
+
+void yagl_egl_api_ps_cleanup(struct yagl_egl_api_ps *egl_api_ps);
+
+struct yagl_egl_display *yagl_egl_api_ps_display_get(struct yagl_egl_api_ps *egl_api_ps,
+ yagl_host_handle handle);
+
+struct yagl_egl_display *yagl_egl_api_ps_display_add(struct yagl_egl_api_ps *egl_api_ps,
+ uint32_t display_id);
+
+#endif
diff --git a/hw/yagl/yagl_apis/egl/yagl_egl_api_ts.c b/hw/yagl/yagl_apis/egl/yagl_egl_api_ts.c
new file mode 100644
index 0000000000..0b938d0fd0
--- /dev/null
+++ b/hw/yagl/yagl_apis/egl/yagl_egl_api_ts.c
@@ -0,0 +1,73 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "yagl_egl_api_ts.h"
+#include "yagl_egl_api_ps.h"
+#include "yagl_egl_context.h"
+#include "yagl_eglb_context.h"
+#include "yagl_egl_backend.h"
+
+void yagl_egl_api_ts_init(struct yagl_egl_api_ts *egl_api_ts,
+ struct yagl_egl_api_ps *api_ps)
+{
+ egl_api_ts->api_ps = api_ps;
+ egl_api_ts->backend = api_ps->backend;
+ egl_api_ts->context = NULL;
+
+ yagl_egl_api_ts_reset(egl_api_ts);
+}
+
+void yagl_egl_api_ts_cleanup(struct yagl_egl_api_ts *egl_api_ts)
+{
+ if (egl_api_ts->context) {
+ /*
+ * Force release current.
+ */
+ egl_api_ts->backend->release_current(egl_api_ts->backend, true);
+
+ yagl_egl_context_update_surfaces(egl_api_ts->context, NULL, NULL);
+ }
+
+ yagl_egl_api_ts_update_context(egl_api_ts, NULL);
+}
+
+void yagl_egl_api_ts_update_context(struct yagl_egl_api_ts *egl_api_ts,
+ struct yagl_egl_context *ctx)
+{
+ yagl_egl_context_acquire(ctx);
+
+ yagl_egl_context_release(egl_api_ts->context);
+
+ egl_api_ts->context = ctx;
+}
+
+void yagl_egl_api_ts_reset(struct yagl_egl_api_ts *egl_api_ts)
+{
+ egl_api_ts->api = EGL_OPENGL_ES_API;
+}
diff --git a/hw/yagl/yagl_apis/egl/yagl_egl_api_ts.h b/hw/yagl/yagl_apis/egl/yagl_egl_api_ts.h
new file mode 100644
index 0000000000..86b6bc0e03
--- /dev/null
+++ b/hw/yagl/yagl_apis/egl/yagl_egl_api_ts.h
@@ -0,0 +1,67 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_EGL_API_TS_H
+#define _QEMU_YAGL_EGL_API_TS_H
+
+#include "yagl_api.h"
+#include <EGL/egl.h>
+
+struct yagl_egl_backend;
+struct yagl_egl_context;
+
+struct yagl_egl_api_ts
+{
+ struct yagl_egl_api_ps *api_ps;
+
+ /*
+ * From 'api_ps->backend' for speed.
+ */
+ struct yagl_egl_backend *backend;
+
+ EGLenum api;
+
+ /*
+ * This is GLES or OpenGL context, only one GLES or OpenGL context
+ * can be current to a thread at the same time.
+ */
+ struct yagl_egl_context *context;
+};
+
+void yagl_egl_api_ts_init(struct yagl_egl_api_ts *egl_api_ts,
+ struct yagl_egl_api_ps *api_ps);
+
+void yagl_egl_api_ts_cleanup(struct yagl_egl_api_ts *egl_api_ts);
+
+void yagl_egl_api_ts_update_context(struct yagl_egl_api_ts *egl_api_ts,
+ struct yagl_egl_context *ctx);
+
+void yagl_egl_api_ts_reset(struct yagl_egl_api_ts *egl_api_ts);
+
+#endif
diff --git a/hw/yagl/yagl_apis/egl/yagl_egl_calls.c b/hw/yagl/yagl_apis/egl/yagl_egl_calls.c
new file mode 100644
index 0000000000..66c19574ed
--- /dev/null
+++ b/hw/yagl/yagl_apis/egl/yagl_egl_calls.c
@@ -0,0 +1,696 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+/*
+ * Generated by gen-yagl-calls.py, do not modify!
+ */
+#include "yagl_egl_calls.h"
+#include "yagl_host_egl_calls.h"
+#include "yagl_transport_egl.h"
+#include "yagl_thread.h"
+#include "yagl_process.h"
+#include "yagl_log.h"
+
+/*
+ * eglGetDisplay dispatcher. id = 1
+ */
+static bool yagl_func_eglGetDisplay(struct yagl_transport *t)
+{
+ uint32_t display_id;
+ EGLint *error;
+ yagl_host_handle *retval;
+ display_id = yagl_transport_get_out_uint32_t(t);
+ yagl_transport_get_in_arg(t, (void**)&error);
+ yagl_transport_get_in_arg(t, (void**)&retval);
+ YAGL_LOG_FUNC_ENTER_SPLIT2(eglGetDisplay, uint32_t, void*, display_id, error);
+ *retval = yagl_host_eglGetDisplay(display_id, error);
+ YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, *retval);
+
+ return true;
+}
+
+/*
+ * eglInitialize dispatcher. id = 2
+ */
+static bool yagl_func_eglInitialize(struct yagl_transport *t)
+{
+ yagl_host_handle dpy;
+ EGLint *major;
+ EGLint *minor;
+ EGLint *error;
+ EGLBoolean *retval;
+ dpy = yagl_transport_get_out_yagl_host_handle(t);
+ yagl_transport_get_in_arg(t, (void**)&major);
+ yagl_transport_get_in_arg(t, (void**)&minor);
+ yagl_transport_get_in_arg(t, (void**)&error);
+ yagl_transport_get_in_arg(t, (void**)&retval);
+ YAGL_LOG_FUNC_ENTER_SPLIT4(eglInitialize, yagl_host_handle, void*, void*, void*, dpy, major, minor, error);
+ *retval = yagl_host_eglInitialize(dpy, major, minor, error);
+ YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
+
+ return true;
+}
+
+/*
+ * eglTerminate dispatcher. id = 3
+ */
+static bool yagl_func_eglTerminate(struct yagl_transport *t)
+{
+ yagl_host_handle dpy;
+ EGLint *error;
+ EGLBoolean *retval;
+ dpy = yagl_transport_get_out_yagl_host_handle(t);
+ yagl_transport_get_in_arg(t, (void**)&error);
+ yagl_transport_get_in_arg(t, (void**)&retval);
+ YAGL_LOG_FUNC_ENTER_SPLIT2(eglTerminate, yagl_host_handle, void*, dpy, error);
+ *retval = yagl_host_eglTerminate(dpy, error);
+ YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
+
+ return true;
+}
+
+/*
+ * eglGetConfigs dispatcher. id = 4
+ */
+static bool yagl_func_eglGetConfigs(struct yagl_transport *t)
+{
+ yagl_host_handle dpy;
+ yagl_host_handle *configs;
+ int32_t configs_maxcount;
+ int32_t *configs_count;
+ EGLint *error;
+ EGLBoolean *retval;
+ dpy = yagl_transport_get_out_yagl_host_handle(t);
+ if (!yagl_transport_get_in_array(t, sizeof(yagl_host_handle), (void**)&configs, &configs_maxcount, &configs_count)) {
+ return false;
+ }
+ yagl_transport_get_in_arg(t, (void**)&error);
+ yagl_transport_get_in_arg(t, (void**)&retval);
+ YAGL_LOG_FUNC_ENTER_SPLIT3(eglGetConfigs, yagl_host_handle, void*, void*, dpy, configs, error);
+ *configs_count = 0;
+ *retval = yagl_host_eglGetConfigs(dpy, configs, configs_maxcount, configs_count, error);
+ YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
+
+ return true;
+}
+
+/*
+ * eglChooseConfig dispatcher. id = 5
+ */
+static bool yagl_func_eglChooseConfig(struct yagl_transport *t)
+{
+ yagl_host_handle dpy;
+ const EGLint *attrib_list;
+ int32_t attrib_list_count;
+ yagl_host_handle *configs;
+ int32_t configs_maxcount;
+ int32_t *configs_count;
+ EGLint *error;
+ EGLBoolean *retval;
+ dpy = yagl_transport_get_out_yagl_host_handle(t);
+ if (!yagl_transport_get_out_array(t, sizeof(EGLint), (const void**)&attrib_list, &attrib_list_count)) {
+ return false;
+ }
+ if (!yagl_transport_get_in_array(t, sizeof(yagl_host_handle), (void**)&configs, &configs_maxcount, &configs_count)) {
+ return false;
+ }
+ yagl_transport_get_in_arg(t, (void**)&error);
+ yagl_transport_get_in_arg(t, (void**)&retval);
+ YAGL_LOG_FUNC_ENTER_SPLIT4(eglChooseConfig, yagl_host_handle, void*, void*, void*, dpy, attrib_list, configs, error);
+ *configs_count = 0;
+ *retval = yagl_host_eglChooseConfig(dpy, attrib_list, attrib_list_count, configs, configs_maxcount, configs_count, error);
+ YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
+
+ return true;
+}
+
+/*
+ * eglGetConfigAttrib dispatcher. id = 6
+ */
+static bool yagl_func_eglGetConfigAttrib(struct yagl_transport *t)
+{
+ yagl_host_handle dpy;
+ yagl_host_handle config;
+ EGLint attribute;
+ EGLint *value;
+ EGLint *error;
+ EGLBoolean *retval;
+ dpy = yagl_transport_get_out_yagl_host_handle(t);
+ config = yagl_transport_get_out_yagl_host_handle(t);
+ attribute = yagl_transport_get_out_EGLint(t);
+ yagl_transport_get_in_arg(t, (void**)&value);
+ yagl_transport_get_in_arg(t, (void**)&error);
+ yagl_transport_get_in_arg(t, (void**)&retval);
+ YAGL_LOG_FUNC_ENTER_SPLIT5(eglGetConfigAttrib, yagl_host_handle, yagl_host_handle, EGLint, void*, void*, dpy, config, attribute, value, error);
+ *retval = yagl_host_eglGetConfigAttrib(dpy, config, attribute, value, error);
+ YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
+
+ return true;
+}
+
+/*
+ * eglDestroySurface dispatcher. id = 7
+ */
+static bool yagl_func_eglDestroySurface(struct yagl_transport *t)
+{
+ yagl_host_handle dpy;
+ yagl_host_handle surface;
+ EGLint *error;
+ EGLBoolean *retval;
+ dpy = yagl_transport_get_out_yagl_host_handle(t);
+ surface = yagl_transport_get_out_yagl_host_handle(t);
+ yagl_transport_get_in_arg(t, (void**)&error);
+ yagl_transport_get_in_arg(t, (void**)&retval);
+ YAGL_LOG_FUNC_ENTER_SPLIT3(eglDestroySurface, yagl_host_handle, yagl_host_handle, void*, dpy, surface, error);
+ *retval = yagl_host_eglDestroySurface(dpy, surface, error);
+ YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
+
+ return true;
+}
+
+/*
+ * eglQuerySurface dispatcher. id = 8
+ */
+static bool yagl_func_eglQuerySurface(struct yagl_transport *t)
+{
+ yagl_host_handle dpy;
+ yagl_host_handle surface;
+ EGLint attribute;
+ EGLint *value;
+ EGLint *error;
+ EGLBoolean *retval;
+ dpy = yagl_transport_get_out_yagl_host_handle(t);
+ surface = yagl_transport_get_out_yagl_host_handle(t);
+ attribute = yagl_transport_get_out_EGLint(t);
+ yagl_transport_get_in_arg(t, (void**)&value);
+ yagl_transport_get_in_arg(t, (void**)&error);
+ yagl_transport_get_in_arg(t, (void**)&retval);
+ YAGL_LOG_FUNC_ENTER_SPLIT5(eglQuerySurface, yagl_host_handle, yagl_host_handle, EGLint, void*, void*, dpy, surface, attribute, value, error);
+ *retval = yagl_host_eglQuerySurface(dpy, surface, attribute, value, error);
+ YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
+
+ return true;
+}
+
+/*
+ * eglBindAPI dispatcher. id = 9
+ */
+static bool yagl_func_eglBindAPI(struct yagl_transport *t)
+{
+ EGLenum api;
+ api = yagl_transport_get_out_EGLenum(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT1(eglBindAPI, EGLenum, api);
+ (void)yagl_host_eglBindAPI(api);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * eglWaitClient dispatcher. id = 10
+ */
+static bool yagl_func_eglWaitClient(struct yagl_transport *t)
+{
+ YAGL_LOG_FUNC_ENTER_SPLIT0(eglWaitClient);
+ (void)yagl_host_eglWaitClient();
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * eglReleaseThread dispatcher. id = 11
+ */
+static bool yagl_func_eglReleaseThread(struct yagl_transport *t)
+{
+ EGLint *error;
+ EGLBoolean *retval;
+ yagl_transport_get_in_arg(t, (void**)&error);
+ yagl_transport_get_in_arg(t, (void**)&retval);
+ YAGL_LOG_FUNC_ENTER_SPLIT1(eglReleaseThread, void*, error);
+ *retval = yagl_host_eglReleaseThread(error);
+ YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
+
+ return true;
+}
+
+/*
+ * eglSurfaceAttrib dispatcher. id = 12
+ */
+static bool yagl_func_eglSurfaceAttrib(struct yagl_transport *t)
+{
+ yagl_host_handle dpy;
+ yagl_host_handle surface;
+ EGLint attribute;
+ EGLint value;
+ EGLint *error;
+ EGLBoolean *retval;
+ dpy = yagl_transport_get_out_yagl_host_handle(t);
+ surface = yagl_transport_get_out_yagl_host_handle(t);
+ attribute = yagl_transport_get_out_EGLint(t);
+ value = yagl_transport_get_out_EGLint(t);
+ yagl_transport_get_in_arg(t, (void**)&error);
+ yagl_transport_get_in_arg(t, (void**)&retval);
+ YAGL_LOG_FUNC_ENTER_SPLIT5(eglSurfaceAttrib, yagl_host_handle, yagl_host_handle, EGLint, EGLint, void*, dpy, surface, attribute, value, error);
+ *retval = yagl_host_eglSurfaceAttrib(dpy, surface, attribute, value, error);
+ YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
+
+ return true;
+}
+
+/*
+ * eglCreateContext dispatcher. id = 13
+ */
+static bool yagl_func_eglCreateContext(struct yagl_transport *t)
+{
+ yagl_host_handle dpy;
+ yagl_host_handle config;
+ yagl_host_handle share_context;
+ const EGLint *attrib_list;
+ int32_t attrib_list_count;
+ EGLint *error;
+ yagl_host_handle *retval;
+ dpy = yagl_transport_get_out_yagl_host_handle(t);
+ config = yagl_transport_get_out_yagl_host_handle(t);
+ share_context = yagl_transport_get_out_yagl_host_handle(t);
+ if (!yagl_transport_get_out_array(t, sizeof(EGLint), (const void**)&attrib_list, &attrib_list_count)) {
+ return false;
+ }
+ yagl_transport_get_in_arg(t, (void**)&error);
+ yagl_transport_get_in_arg(t, (void**)&retval);
+ YAGL_LOG_FUNC_ENTER_SPLIT5(eglCreateContext, yagl_host_handle, yagl_host_handle, yagl_host_handle, void*, void*, dpy, config, share_context, attrib_list, error);
+ *retval = yagl_host_eglCreateContext(dpy, config, share_context, attrib_list, attrib_list_count, error);
+ YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, *retval);
+
+ return true;
+}
+
+/*
+ * eglDestroyContext dispatcher. id = 14
+ */
+static bool yagl_func_eglDestroyContext(struct yagl_transport *t)
+{
+ yagl_host_handle dpy;
+ yagl_host_handle ctx;
+ EGLint *error;
+ EGLBoolean *retval;
+ dpy = yagl_transport_get_out_yagl_host_handle(t);
+ ctx = yagl_transport_get_out_yagl_host_handle(t);
+ yagl_transport_get_in_arg(t, (void**)&error);
+ yagl_transport_get_in_arg(t, (void**)&retval);
+ YAGL_LOG_FUNC_ENTER_SPLIT3(eglDestroyContext, yagl_host_handle, yagl_host_handle, void*, dpy, ctx, error);
+ *retval = yagl_host_eglDestroyContext(dpy, ctx, error);
+ YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
+
+ return true;
+}
+
+/*
+ * eglMakeCurrent dispatcher. id = 15
+ */
+static bool yagl_func_eglMakeCurrent(struct yagl_transport *t)
+{
+ yagl_host_handle dpy;
+ yagl_host_handle draw;
+ yagl_host_handle read;
+ yagl_host_handle ctx;
+ dpy = yagl_transport_get_out_yagl_host_handle(t);
+ draw = yagl_transport_get_out_yagl_host_handle(t);
+ read = yagl_transport_get_out_yagl_host_handle(t);
+ ctx = yagl_transport_get_out_yagl_host_handle(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT4(eglMakeCurrent, yagl_host_handle, yagl_host_handle, yagl_host_handle, yagl_host_handle, dpy, draw, read, ctx);
+ (void)yagl_host_eglMakeCurrent(dpy, draw, read, ctx);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * eglQueryContext dispatcher. id = 16
+ */
+static bool yagl_func_eglQueryContext(struct yagl_transport *t)
+{
+ yagl_host_handle dpy;
+ yagl_host_handle ctx;
+ EGLint attribute;
+ EGLint *value;
+ EGLint *error;
+ EGLBoolean *retval;
+ dpy = yagl_transport_get_out_yagl_host_handle(t);
+ ctx = yagl_transport_get_out_yagl_host_handle(t);
+ attribute = yagl_transport_get_out_EGLint(t);
+ yagl_transport_get_in_arg(t, (void**)&value);
+ yagl_transport_get_in_arg(t, (void**)&error);
+ yagl_transport_get_in_arg(t, (void**)&retval);
+ YAGL_LOG_FUNC_ENTER_SPLIT5(eglQueryContext, yagl_host_handle, yagl_host_handle, EGLint, void*, void*, dpy, ctx, attribute, value, error);
+ *retval = yagl_host_eglQueryContext(dpy, ctx, attribute, value, error);
+ YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
+
+ return true;
+}
+
+/*
+ * eglSwapBuffers dispatcher. id = 17
+ */
+static bool yagl_func_eglSwapBuffers(struct yagl_transport *t)
+{
+ yagl_host_handle dpy;
+ yagl_host_handle surface;
+ EGLint *error;
+ EGLBoolean *retval;
+ dpy = yagl_transport_get_out_yagl_host_handle(t);
+ surface = yagl_transport_get_out_yagl_host_handle(t);
+ yagl_transport_get_in_arg(t, (void**)&error);
+ yagl_transport_get_in_arg(t, (void**)&retval);
+ YAGL_LOG_FUNC_ENTER_SPLIT3(eglSwapBuffers, yagl_host_handle, yagl_host_handle, void*, dpy, surface, error);
+ *retval = yagl_host_eglSwapBuffers(dpy, surface, error);
+ YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
+
+ return true;
+}
+
+/*
+ * eglCopyBuffers dispatcher. id = 18
+ */
+static bool yagl_func_eglCopyBuffers(struct yagl_transport *t)
+{
+ yagl_host_handle dpy;
+ yagl_host_handle surface;
+ EGLint *error;
+ EGLBoolean *retval;
+ dpy = yagl_transport_get_out_yagl_host_handle(t);
+ surface = yagl_transport_get_out_yagl_host_handle(t);
+ yagl_transport_get_in_arg(t, (void**)&error);
+ yagl_transport_get_in_arg(t, (void**)&retval);
+ YAGL_LOG_FUNC_ENTER_SPLIT3(eglCopyBuffers, yagl_host_handle, yagl_host_handle, void*, dpy, surface, error);
+ *retval = yagl_host_eglCopyBuffers(dpy, surface, error);
+ YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
+
+ return true;
+}
+
+/*
+ * eglCreateWindowSurfaceOffscreenYAGL dispatcher. id = 19
+ */
+static bool yagl_func_eglCreateWindowSurfaceOffscreenYAGL(struct yagl_transport *t)
+{
+ yagl_host_handle dpy;
+ yagl_host_handle config;
+ uint32_t width;
+ uint32_t height;
+ uint32_t bpp;
+ target_ulong pixels;
+ const EGLint *attrib_list;
+ int32_t attrib_list_count;
+ EGLint *error;
+ yagl_host_handle *retval;
+ dpy = yagl_transport_get_out_yagl_host_handle(t);
+ config = yagl_transport_get_out_yagl_host_handle(t);
+ width = yagl_transport_get_out_uint32_t(t);
+ height = yagl_transport_get_out_uint32_t(t);
+ bpp = yagl_transport_get_out_uint32_t(t);
+ pixels = yagl_transport_get_out_va(t);
+ if (!yagl_transport_get_out_array(t, sizeof(EGLint), (const void**)&attrib_list, &attrib_list_count)) {
+ return false;
+ }
+ yagl_transport_get_in_arg(t, (void**)&error);
+ yagl_transport_get_in_arg(t, (void**)&retval);
+ YAGL_LOG_FUNC_ENTER_SPLIT8(eglCreateWindowSurfaceOffscreenYAGL, yagl_host_handle, yagl_host_handle, uint32_t, uint32_t, uint32_t, target_ulong, void*, void*, dpy, config, width, height, bpp, pixels, attrib_list, error);
+ *retval = yagl_host_eglCreateWindowSurfaceOffscreenYAGL(dpy, config, width, height, bpp, pixels, attrib_list, attrib_list_count, error);
+ YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, *retval);
+
+ return true;
+}
+
+/*
+ * eglCreatePbufferSurfaceOffscreenYAGL dispatcher. id = 20
+ */
+static bool yagl_func_eglCreatePbufferSurfaceOffscreenYAGL(struct yagl_transport *t)
+{
+ yagl_host_handle dpy;
+ yagl_host_handle config;
+ uint32_t width;
+ uint32_t height;
+ uint32_t bpp;
+ target_ulong pixels;
+ const EGLint *attrib_list;
+ int32_t attrib_list_count;
+ EGLint *error;
+ yagl_host_handle *retval;
+ dpy = yagl_transport_get_out_yagl_host_handle(t);
+ config = yagl_transport_get_out_yagl_host_handle(t);
+ width = yagl_transport_get_out_uint32_t(t);
+ height = yagl_transport_get_out_uint32_t(t);
+ bpp = yagl_transport_get_out_uint32_t(t);
+ pixels = yagl_transport_get_out_va(t);
+ if (!yagl_transport_get_out_array(t, sizeof(EGLint), (const void**)&attrib_list, &attrib_list_count)) {
+ return false;
+ }
+ yagl_transport_get_in_arg(t, (void**)&error);
+ yagl_transport_get_in_arg(t, (void**)&retval);
+ YAGL_LOG_FUNC_ENTER_SPLIT8(eglCreatePbufferSurfaceOffscreenYAGL, yagl_host_handle, yagl_host_handle, uint32_t, uint32_t, uint32_t, target_ulong, void*, void*, dpy, config, width, height, bpp, pixels, attrib_list, error);
+ *retval = yagl_host_eglCreatePbufferSurfaceOffscreenYAGL(dpy, config, width, height, bpp, pixels, attrib_list, attrib_list_count, error);
+ YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, *retval);
+
+ return true;
+}
+
+/*
+ * eglCreatePixmapSurfaceOffscreenYAGL dispatcher. id = 21
+ */
+static bool yagl_func_eglCreatePixmapSurfaceOffscreenYAGL(struct yagl_transport *t)
+{
+ yagl_host_handle dpy;
+ yagl_host_handle config;
+ uint32_t width;
+ uint32_t height;
+ uint32_t bpp;
+ target_ulong pixels;
+ const EGLint *attrib_list;
+ int32_t attrib_list_count;
+ EGLint *error;
+ yagl_host_handle *retval;
+ dpy = yagl_transport_get_out_yagl_host_handle(t);
+ config = yagl_transport_get_out_yagl_host_handle(t);
+ width = yagl_transport_get_out_uint32_t(t);
+ height = yagl_transport_get_out_uint32_t(t);
+ bpp = yagl_transport_get_out_uint32_t(t);
+ pixels = yagl_transport_get_out_va(t);
+ if (!yagl_transport_get_out_array(t, sizeof(EGLint), (const void**)&attrib_list, &attrib_list_count)) {
+ return false;
+ }
+ yagl_transport_get_in_arg(t, (void**)&error);
+ yagl_transport_get_in_arg(t, (void**)&retval);
+ YAGL_LOG_FUNC_ENTER_SPLIT8(eglCreatePixmapSurfaceOffscreenYAGL, yagl_host_handle, yagl_host_handle, uint32_t, uint32_t, uint32_t, target_ulong, void*, void*, dpy, config, width, height, bpp, pixels, attrib_list, error);
+ *retval = yagl_host_eglCreatePixmapSurfaceOffscreenYAGL(dpy, config, width, height, bpp, pixels, attrib_list, attrib_list_count, error);
+ YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, *retval);
+
+ return true;
+}
+
+/*
+ * eglResizeOffscreenSurfaceYAGL dispatcher. id = 22
+ */
+static bool yagl_func_eglResizeOffscreenSurfaceYAGL(struct yagl_transport *t)
+{
+ yagl_host_handle dpy;
+ yagl_host_handle surface;
+ uint32_t width;
+ uint32_t height;
+ uint32_t bpp;
+ target_ulong pixels;
+ EGLint *error;
+ EGLBoolean *retval;
+ dpy = yagl_transport_get_out_yagl_host_handle(t);
+ surface = yagl_transport_get_out_yagl_host_handle(t);
+ width = yagl_transport_get_out_uint32_t(t);
+ height = yagl_transport_get_out_uint32_t(t);
+ bpp = yagl_transport_get_out_uint32_t(t);
+ pixels = yagl_transport_get_out_va(t);
+ yagl_transport_get_in_arg(t, (void**)&error);
+ yagl_transport_get_in_arg(t, (void**)&retval);
+ YAGL_LOG_FUNC_ENTER_SPLIT7(eglResizeOffscreenSurfaceYAGL, yagl_host_handle, yagl_host_handle, uint32_t, uint32_t, uint32_t, target_ulong, void*, dpy, surface, width, height, bpp, pixels, error);
+ *retval = yagl_host_eglResizeOffscreenSurfaceYAGL(dpy, surface, width, height, bpp, pixels, error);
+ YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
+
+ return true;
+}
+
+/*
+ * eglCreateWindowSurfaceOnscreenYAGL dispatcher. id = 23
+ */
+static bool yagl_func_eglCreateWindowSurfaceOnscreenYAGL(struct yagl_transport *t)
+{
+ yagl_host_handle dpy;
+ yagl_host_handle config;
+ yagl_winsys_id win;
+ const EGLint *attrib_list;
+ int32_t attrib_list_count;
+ EGLint *error;
+ yagl_host_handle *retval;
+ dpy = yagl_transport_get_out_yagl_host_handle(t);
+ config = yagl_transport_get_out_yagl_host_handle(t);
+ win = yagl_transport_get_out_yagl_winsys_id(t);
+ if (!yagl_transport_get_out_array(t, sizeof(EGLint), (const void**)&attrib_list, &attrib_list_count)) {
+ return false;
+ }
+ yagl_transport_get_in_arg(t, (void**)&error);
+ yagl_transport_get_in_arg(t, (void**)&retval);
+ YAGL_LOG_FUNC_ENTER_SPLIT5(eglCreateWindowSurfaceOnscreenYAGL, yagl_host_handle, yagl_host_handle, yagl_winsys_id, void*, void*, dpy, config, win, attrib_list, error);
+ *retval = yagl_host_eglCreateWindowSurfaceOnscreenYAGL(dpy, config, win, attrib_list, attrib_list_count, error);
+ YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, *retval);
+
+ return true;
+}
+
+/*
+ * eglCreatePbufferSurfaceOnscreenYAGL dispatcher. id = 24
+ */
+static bool yagl_func_eglCreatePbufferSurfaceOnscreenYAGL(struct yagl_transport *t)
+{
+ yagl_host_handle dpy;
+ yagl_host_handle config;
+ yagl_winsys_id buffer;
+ const EGLint *attrib_list;
+ int32_t attrib_list_count;
+ EGLint *error;
+ yagl_host_handle *retval;
+ dpy = yagl_transport_get_out_yagl_host_handle(t);
+ config = yagl_transport_get_out_yagl_host_handle(t);
+ buffer = yagl_transport_get_out_yagl_winsys_id(t);
+ if (!yagl_transport_get_out_array(t, sizeof(EGLint), (const void**)&attrib_list, &attrib_list_count)) {
+ return false;
+ }
+ yagl_transport_get_in_arg(t, (void**)&error);
+ yagl_transport_get_in_arg(t, (void**)&retval);
+ YAGL_LOG_FUNC_ENTER_SPLIT5(eglCreatePbufferSurfaceOnscreenYAGL, yagl_host_handle, yagl_host_handle, yagl_winsys_id, void*, void*, dpy, config, buffer, attrib_list, error);
+ *retval = yagl_host_eglCreatePbufferSurfaceOnscreenYAGL(dpy, config, buffer, attrib_list, attrib_list_count, error);
+ YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, *retval);
+
+ return true;
+}
+
+/*
+ * eglCreatePixmapSurfaceOnscreenYAGL dispatcher. id = 25
+ */
+static bool yagl_func_eglCreatePixmapSurfaceOnscreenYAGL(struct yagl_transport *t)
+{
+ yagl_host_handle dpy;
+ yagl_host_handle config;
+ yagl_winsys_id pixmap;
+ const EGLint *attrib_list;
+ int32_t attrib_list_count;
+ EGLint *error;
+ yagl_host_handle *retval;
+ dpy = yagl_transport_get_out_yagl_host_handle(t);
+ config = yagl_transport_get_out_yagl_host_handle(t);
+ pixmap = yagl_transport_get_out_yagl_winsys_id(t);
+ if (!yagl_transport_get_out_array(t, sizeof(EGLint), (const void**)&attrib_list, &attrib_list_count)) {
+ return false;
+ }
+ yagl_transport_get_in_arg(t, (void**)&error);
+ yagl_transport_get_in_arg(t, (void**)&retval);
+ YAGL_LOG_FUNC_ENTER_SPLIT5(eglCreatePixmapSurfaceOnscreenYAGL, yagl_host_handle, yagl_host_handle, yagl_winsys_id, void*, void*, dpy, config, pixmap, attrib_list, error);
+ *retval = yagl_host_eglCreatePixmapSurfaceOnscreenYAGL(dpy, config, pixmap, attrib_list, attrib_list_count, error);
+ YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, *retval);
+
+ return true;
+}
+
+/*
+ * eglInvalidateOnscreenSurfaceYAGL dispatcher. id = 26
+ */
+static bool yagl_func_eglInvalidateOnscreenSurfaceYAGL(struct yagl_transport *t)
+{
+ yagl_host_handle dpy;
+ yagl_host_handle surface;
+ yagl_winsys_id buffer;
+ dpy = yagl_transport_get_out_yagl_host_handle(t);
+ surface = yagl_transport_get_out_yagl_host_handle(t);
+ buffer = yagl_transport_get_out_yagl_winsys_id(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT3(eglInvalidateOnscreenSurfaceYAGL, yagl_host_handle, yagl_host_handle, yagl_winsys_id, dpy, surface, buffer);
+ (void)yagl_host_eglInvalidateOnscreenSurfaceYAGL(dpy, surface, buffer);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * eglCreateImageYAGL dispatcher. id = 27
+ */
+static bool yagl_func_eglCreateImageYAGL(struct yagl_transport *t)
+{
+ uint32_t texture;
+ yagl_host_handle dpy;
+ yagl_winsys_id buffer;
+ EGLint *error;
+ EGLBoolean *retval;
+ texture = yagl_transport_get_out_uint32_t(t);
+ dpy = yagl_transport_get_out_yagl_host_handle(t);
+ buffer = yagl_transport_get_out_yagl_winsys_id(t);
+ yagl_transport_get_in_arg(t, (void**)&error);
+ yagl_transport_get_in_arg(t, (void**)&retval);
+ YAGL_LOG_FUNC_ENTER_SPLIT4(eglCreateImageYAGL, uint32_t, yagl_host_handle, yagl_winsys_id, void*, texture, dpy, buffer, error);
+ *retval = yagl_host_eglCreateImageYAGL(texture, dpy, buffer, error);
+ YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
+
+ return true;
+}
+
+const uint32_t yagl_egl_api_num_funcs = 27;
+
+yagl_api_func yagl_egl_api_funcs[] = {
+ &yagl_func_eglGetDisplay,
+ &yagl_func_eglInitialize,
+ &yagl_func_eglTerminate,
+ &yagl_func_eglGetConfigs,
+ &yagl_func_eglChooseConfig,
+ &yagl_func_eglGetConfigAttrib,
+ &yagl_func_eglDestroySurface,
+ &yagl_func_eglQuerySurface,
+ &yagl_func_eglBindAPI,
+ &yagl_func_eglWaitClient,
+ &yagl_func_eglReleaseThread,
+ &yagl_func_eglSurfaceAttrib,
+ &yagl_func_eglCreateContext,
+ &yagl_func_eglDestroyContext,
+ &yagl_func_eglMakeCurrent,
+ &yagl_func_eglQueryContext,
+ &yagl_func_eglSwapBuffers,
+ &yagl_func_eglCopyBuffers,
+ &yagl_func_eglCreateWindowSurfaceOffscreenYAGL,
+ &yagl_func_eglCreatePbufferSurfaceOffscreenYAGL,
+ &yagl_func_eglCreatePixmapSurfaceOffscreenYAGL,
+ &yagl_func_eglResizeOffscreenSurfaceYAGL,
+ &yagl_func_eglCreateWindowSurfaceOnscreenYAGL,
+ &yagl_func_eglCreatePbufferSurfaceOnscreenYAGL,
+ &yagl_func_eglCreatePixmapSurfaceOnscreenYAGL,
+ &yagl_func_eglInvalidateOnscreenSurfaceYAGL,
+ &yagl_func_eglCreateImageYAGL,
+};
diff --git a/hw/yagl/yagl_apis/egl/yagl_egl_calls.h b/hw/yagl/yagl_apis/egl/yagl_egl_calls.h
new file mode 100644
index 0000000000..fae9af5bb7
--- /dev/null
+++ b/hw/yagl/yagl_apis/egl/yagl_egl_calls.h
@@ -0,0 +1,42 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+/*
+ * Generated by gen-yagl-calls.py, do not modify!
+ */
+#ifndef _QEMU_YAGL_EGL_CALLS_H_
+#define _QEMU_YAGL_EGL_CALLS_H_
+
+#include "yagl_types.h"
+
+extern const uint32_t yagl_egl_api_num_funcs;
+
+extern yagl_api_func yagl_egl_api_funcs[];
+
+#endif
diff --git a/hw/yagl/yagl_apis/egl/yagl_egl_config.c b/hw/yagl/yagl_apis/egl/yagl_egl_config.c
new file mode 100644
index 0000000000..30a9922699
--- /dev/null
+++ b/hw/yagl/yagl_apis/egl/yagl_egl_config.c
@@ -0,0 +1,441 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "yagl_egl_config.h"
+#include "yagl_egl_backend.h"
+#include "yagl_egl_display.h"
+#include "yagl_eglb_display.h"
+#include "yagl_resource.h"
+#include "yagl_process.h"
+#include "yagl_thread.h"
+#include <EGL/eglext.h>
+
+static void yagl_egl_config_destroy(struct yagl_ref *ref)
+{
+ struct yagl_egl_config *cfg = (struct yagl_egl_config*)ref;
+
+ cfg->dpy->backend_dpy->config_cleanup(cfg->dpy->backend_dpy,
+ &cfg->native);
+
+ yagl_resource_cleanup(&cfg->res);
+
+ g_free(cfg);
+}
+
+static bool yagl_egl_config_is_less(struct yagl_egl_native_config *lhs_cfg,
+ struct yagl_egl_native_config *rhs_cfg)
+{
+ /*
+ * 1. EGL_NONE < EGL_SLOW_CONFIG < EGL_NON_CONFORMANT_CONFIG
+ * Conformant first.
+ */
+ if (lhs_cfg->conformant != rhs_cfg->conformant) {
+ return lhs_cfg->conformant != 0;
+ }
+
+ /*
+ * 1. EGL_NONE < EGL_SLOW_CONFIG < EGL_NON_CONFORMANT_CONFIG
+ * EGL_NONE first.
+ */
+ if (lhs_cfg->caveat != rhs_cfg->caveat) {
+ return lhs_cfg->caveat < rhs_cfg->caveat;
+ }
+
+ /*
+ * 2, 3. skip
+ */
+
+ /*
+ * 4. Smaller EGL_BUFFER_SIZE.
+ */
+ if (lhs_cfg->buffer_size != rhs_cfg->buffer_size) {
+ return lhs_cfg->buffer_size < rhs_cfg->buffer_size;
+ }
+
+ /*
+ * 5. Smaller EGL_SAMPLE_BUFFERS.
+ */
+ if (lhs_cfg->sample_buffers_num != rhs_cfg->sample_buffers_num) {
+ return lhs_cfg->sample_buffers_num <
+ rhs_cfg->sample_buffers_num;
+ }
+
+ /*
+ * 6. Smaller EGL_SAMPLES.
+ */
+ if (lhs_cfg->samples_per_pixel != rhs_cfg->samples_per_pixel) {
+ return lhs_cfg->samples_per_pixel < rhs_cfg->samples_per_pixel;
+ }
+
+ /*
+ * 7. Smaller EGL_DEPTH_SIZE.
+ */
+ if (lhs_cfg->depth_size != rhs_cfg->depth_size) {
+ return lhs_cfg->depth_size < rhs_cfg->depth_size;
+ }
+
+ /*
+ * 8. Smaller EGL_STENCIL_SIZE.
+ */
+ if (lhs_cfg->stencil_size != rhs_cfg->stencil_size) {
+ return lhs_cfg->stencil_size < rhs_cfg->stencil_size;
+ }
+
+ /*
+ * 9. skip
+ */
+
+ /*
+ * 10. EGL_NATIVE_VISUAL_TYPE
+ */
+
+ if (lhs_cfg->native_visual_type != rhs_cfg->native_visual_type) {
+ return lhs_cfg->native_visual_type < rhs_cfg->native_visual_type;
+ }
+
+ /*
+ * 11. Smaller EGL_CONFIG_ID. Last rule.
+ */
+
+ return lhs_cfg->config_id < rhs_cfg->config_id;
+}
+
+static int yagl_egl_config_sort_func(const void *lhs, const void *rhs)
+{
+ struct yagl_egl_config *lhs_cfg = *(struct yagl_egl_config**)lhs;
+ struct yagl_egl_config *rhs_cfg = *(struct yagl_egl_config**)rhs;
+
+ if (yagl_egl_config_is_less(&lhs_cfg->native, &rhs_cfg->native)) {
+ return -1;
+ } else {
+ return yagl_egl_config_is_less(&rhs_cfg->native, &lhs_cfg->native) ? 1 : 0;
+ }
+}
+
+/*
+ * 'native_cfg' is byte-copied into allocated config.
+ */
+static struct yagl_egl_config
+ *yagl_egl_config_create(struct yagl_egl_display *dpy,
+ const struct yagl_egl_native_config *native_cfg)
+{
+ struct yagl_egl_config *cfg = g_malloc0(sizeof(struct yagl_egl_config));
+
+ yagl_resource_init(&cfg->res, &yagl_egl_config_destroy);
+ cfg->dpy = dpy;
+ cfg->native = *native_cfg;
+
+ cfg->native.surface_type = EGL_PBUFFER_BIT |
+ EGL_PIXMAP_BIT |
+ EGL_WINDOW_BIT |
+ EGL_SWAP_BEHAVIOR_PRESERVED_BIT |
+ EGL_LOCK_SURFACE_BIT_KHR |
+ EGL_OPTIMAL_FORMAT_BIT_KHR;
+
+ cfg->native.native_renderable = EGL_TRUE;
+ cfg->native.renderable_type = EGL_OPENGL_ES_BIT | EGL_OPENGL_ES2_BIT;
+
+ 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;
+
+ cfg->native.sample_buffers_num = (cfg->native.samples_per_pixel > 0) ? 1 : 0;
+
+ cfg->native.bind_to_texture_rgb = EGL_TRUE;
+ cfg->native.bind_to_texture_rgba = EGL_TRUE;
+
+ return cfg;
+}
+
+struct yagl_egl_config
+ **yagl_egl_config_enum(struct yagl_egl_display *dpy,
+ int* num_configs )
+{
+ struct yagl_egl_native_config *native_configs;
+ int num_native_configs, i;
+ struct yagl_egl_config **configs;
+
+ native_configs = dpy->backend_dpy->config_enum(dpy->backend_dpy, &num_native_configs);
+
+ if (num_native_configs <= 0) {
+ return NULL;
+ }
+
+ configs = g_malloc0(num_native_configs * sizeof(*configs));
+
+ *num_configs = 0;
+
+ for (i = 0; i < num_native_configs; ++i) {
+ /*
+ * We only accept RGBA8888, that's to be sure we can handle all kinds
+ * of formats.
+ */
+ if ((native_configs[i].buffer_size != 32) ||
+ (native_configs[i].red_size != 8) ||
+ (native_configs[i].green_size != 8) ||
+ (native_configs[i].blue_size != 8) ||
+ (native_configs[i].alpha_size != 8)) {
+ dpy->backend_dpy->config_cleanup(dpy->backend_dpy,
+ &native_configs[i]);
+ continue;
+ }
+
+ /*
+ * A bugfix for Tizen's WebKit. When it chooses a config it
+ * doesn't always pass EGL_DEPTH_SIZE, thus, if host GPU has at least
+ * one config without a depth buffer it gets chosen (EGL_DEPTH_SIZE is
+ * 0 by default and has an AtLeast,Smaller sorting rule). But WebKit
+ * WANTS THE DEPTH BUFFER! If someone wants to have a depth buffer
+ * a value greater than zero must be passed with EGL_DEPTH_SIZE,
+ * read the manual goddamit!
+ *
+ * P.S: We just drop all configs with depth_size == 0 and
+ * also with stencil_size == 0, just in case.
+ */
+ if ((native_configs[i].depth_size == 0) ||
+ (native_configs[i].stencil_size == 0)) {
+ dpy->backend_dpy->config_cleanup(dpy->backend_dpy,
+ &native_configs[i]);
+ continue;
+ }
+
+ configs[*num_configs] = yagl_egl_config_create(dpy, &native_configs[i]);
+
+ ++*num_configs;
+ }
+
+ g_free(native_configs);
+
+ return configs;
+}
+
+void yagl_egl_config_sort(struct yagl_egl_config **cfgs, int num_configs)
+{
+ qsort(cfgs, num_configs, sizeof(*cfgs), &yagl_egl_config_sort_func);
+}
+
+#define YAGL_CHECK_ATTRIB(attrib, op) \
+ if ((dummy->attrib != EGL_DONT_CARE) && (dummy->attrib op cfg->native.attrib)) { \
+ return false; \
+ }
+
+#define YAGL_CHECK_ATTRIB_CAST(attrib, op) \
+ if (((EGLint)(dummy->attrib) != EGL_DONT_CARE) && (dummy->attrib op cfg->native.attrib)) { \
+ return false; \
+ }
+
+bool yagl_egl_config_is_chosen_by(const struct yagl_egl_config *cfg,
+ const struct yagl_egl_native_config *dummy)
+{
+ /*
+ * AtLeast.
+ */
+
+ YAGL_CHECK_ATTRIB(red_size, >);
+ YAGL_CHECK_ATTRIB(green_size, >);
+ YAGL_CHECK_ATTRIB(blue_size, >);
+ YAGL_CHECK_ATTRIB(alpha_size, >);
+ YAGL_CHECK_ATTRIB(buffer_size, >);
+ YAGL_CHECK_ATTRIB(depth_size, >);
+ YAGL_CHECK_ATTRIB(stencil_size, >);
+ YAGL_CHECK_ATTRIB(samples_per_pixel, >);
+ YAGL_CHECK_ATTRIB(sample_buffers_num, >);
+
+ /*
+ * Exact.
+ */
+
+ YAGL_CHECK_ATTRIB(frame_buffer_level, !=);
+ YAGL_CHECK_ATTRIB(config_id, !=);
+ YAGL_CHECK_ATTRIB(native_visual_type, !=);
+ YAGL_CHECK_ATTRIB(max_swap_interval, !=);
+ YAGL_CHECK_ATTRIB(min_swap_interval, !=);
+ YAGL_CHECK_ATTRIB(trans_red_val, !=);
+ YAGL_CHECK_ATTRIB(trans_green_val, !=);
+ YAGL_CHECK_ATTRIB(trans_blue_val, !=);
+ /*
+ * Exact with cast.
+ */
+ YAGL_CHECK_ATTRIB_CAST(caveat, !=);
+ YAGL_CHECK_ATTRIB_CAST(native_renderable, !=);
+ YAGL_CHECK_ATTRIB_CAST(transparent_type, !=);
+ YAGL_CHECK_ATTRIB_CAST(bind_to_texture_rgb, !=);
+ YAGL_CHECK_ATTRIB_CAST(bind_to_texture_rgba, !=);
+
+ /*
+ * Mask.
+ */
+
+ if (dummy->surface_type != EGL_DONT_CARE &&
+ ((dummy->surface_type & cfg->native.surface_type) != dummy->surface_type)) {
+ return false;
+ }
+
+ if (dummy->conformant != (EGLenum)EGL_DONT_CARE &&
+ ((dummy->conformant & cfg->native.conformant) != dummy->conformant)) {
+ return false;
+ }
+
+ if (dummy->renderable_type != EGL_DONT_CARE &&
+ ((dummy->renderable_type & cfg->native.renderable_type) != dummy->renderable_type)) {
+ return false;
+ }
+
+ /*
+ * EGL_MATCH_FORMAT_KHR.
+ */
+
+ if ((dummy->match_format_khr != EGL_DONT_CARE) &&
+ (dummy->match_format_khr != EGL_FORMAT_RGBA_8888_EXACT_KHR) &&
+ (dummy->match_format_khr != EGL_FORMAT_RGBA_8888_KHR)) {
+ return false;
+ }
+
+ return true;
+}
+bool yagl_egl_config_get_attrib(const struct yagl_egl_config *cfg,
+ EGLint attrib,
+ EGLint *value)
+{
+ switch (attrib) {
+ case EGL_BUFFER_SIZE:
+ *value = cfg->native.buffer_size;
+ break;
+ case EGL_RED_SIZE:
+ *value = cfg->native.red_size;
+ break;
+ case EGL_GREEN_SIZE:
+ *value = cfg->native.green_size;
+ break;
+ case EGL_BLUE_SIZE:
+ *value = cfg->native.blue_size;
+ break;
+ case EGL_ALPHA_SIZE:
+ *value = cfg->native.alpha_size;
+ break;
+ case EGL_ALPHA_MASK_SIZE:
+ *value = 0;
+ break;
+ case EGL_BIND_TO_TEXTURE_RGB:
+ *value = cfg->native.bind_to_texture_rgb;
+ break;
+ case EGL_BIND_TO_TEXTURE_RGBA:
+ *value = cfg->native.bind_to_texture_rgba;
+ break;
+ case EGL_CONFIG_CAVEAT:
+ *value = cfg->native.caveat;
+ break;
+ case EGL_CONFIG_ID:
+ *value = cfg->native.config_id;
+ break;
+ case EGL_DEPTH_SIZE:
+ *value = cfg->native.depth_size;
+ break;
+ case EGL_LEVEL:
+ *value = cfg->native.frame_buffer_level;
+ break;
+ case EGL_MAX_PBUFFER_WIDTH:
+ *value = cfg->native.max_pbuffer_width;
+ break;
+ case EGL_MAX_PBUFFER_HEIGHT:
+ *value = cfg->native.max_pbuffer_height;
+ break;
+ case EGL_MAX_PBUFFER_PIXELS:
+ *value = cfg->native.max_pbuffer_size;
+ break;
+ case EGL_MAX_SWAP_INTERVAL:
+ *value = cfg->native.max_swap_interval;
+ break;
+ case EGL_MIN_SWAP_INTERVAL:
+ *value = cfg->native.min_swap_interval;
+ break;
+ case EGL_NATIVE_RENDERABLE:
+ *value = cfg->native.native_renderable;
+ break;
+ case EGL_NATIVE_VISUAL_ID:
+ *value = cfg->native.native_visual_id;
+ break;
+ case EGL_NATIVE_VISUAL_TYPE:
+ *value = cfg->native.native_visual_type;
+ break;
+ case EGL_RENDERABLE_TYPE:
+ *value = cfg->native.renderable_type;
+ break;
+ case EGL_SAMPLE_BUFFERS:
+ *value = cfg->native.sample_buffers_num;
+ break;
+ case EGL_SAMPLES:
+ *value = cfg->native.samples_per_pixel;
+ break;
+ case EGL_STENCIL_SIZE:
+ *value = cfg->native.stencil_size;
+ break;
+ case EGL_SURFACE_TYPE:
+ *value = cfg->native.surface_type;
+ break;
+ case EGL_TRANSPARENT_TYPE:
+ *value = cfg->native.transparent_type;
+ break;
+ case EGL_TRANSPARENT_RED_VALUE:
+ *value = cfg->native.trans_red_val;
+ break;
+ case EGL_TRANSPARENT_GREEN_VALUE:
+ *value = cfg->native.trans_green_val;
+ break;
+ case EGL_TRANSPARENT_BLUE_VALUE:
+ *value = cfg->native.trans_blue_val;
+ break;
+ case EGL_CONFORMANT:
+ *value = cfg->native.conformant;
+ break;
+ case EGL_COLOR_BUFFER_TYPE:
+ *value = EGL_RGB_BUFFER;
+ break;
+ case EGL_MATCH_FORMAT_KHR:
+ *value = EGL_FORMAT_RGBA_8888_EXACT_KHR;
+ break;
+ default:
+ return false;
+ }
+ return true;
+}
+
+void yagl_egl_config_acquire(struct yagl_egl_config *cfg)
+{
+ if (cfg) {
+ yagl_resource_acquire(&cfg->res);
+ }
+}
+
+void yagl_egl_config_release(struct yagl_egl_config *cfg)
+{
+ if (cfg) {
+ yagl_resource_release(&cfg->res);
+ }
+}
diff --git a/hw/yagl/yagl_apis/egl/yagl_egl_config.h b/hw/yagl/yagl_apis/egl/yagl_egl_config.h
new file mode 100644
index 0000000000..c58548566c
--- /dev/null
+++ b/hw/yagl/yagl_apis/egl/yagl_egl_config.h
@@ -0,0 +1,94 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_EGL_CONFIG_H
+#define _QEMU_YAGL_EGL_CONFIG_H
+
+#include "yagl_types.h"
+#include "yagl_resource.h"
+#include "yagl_egl_native_config.h"
+
+struct yagl_egl_display;
+
+struct yagl_egl_config
+{
+ struct yagl_resource res;
+
+ struct yagl_egl_display *dpy;
+
+ struct yagl_egl_native_config native;
+};
+
+/*
+ * Returns an array of EGL configs. The array itself must
+ * be freed by 'g_free' as usual. EGL configs must be
+ * released using YaGL resource release mechanism.
+ *
+ * Note that config list is unsorted, use 'yagl_egl_config_sort'
+ * to sort.
+ */
+struct yagl_egl_config
+ **yagl_egl_config_enum(struct yagl_egl_display *dpy,
+ int* num_configs );
+
+/*
+ * Sort according to 'EGL 1.4: 3.4.1. Sorting of EGLConfigs'
+ */
+void yagl_egl_config_sort(struct yagl_egl_config **cfgs, int num_configs);
+
+/*
+ * Choose according to 'EGL 1.4: 3.4.1. Selection of EGLConfigs'
+ */
+bool yagl_egl_config_is_chosen_by(const struct yagl_egl_config *cfg,
+ const struct yagl_egl_native_config *dummy);
+
+bool yagl_egl_config_get_attrib(const struct yagl_egl_config *cfg,
+ EGLint attrib,
+ EGLint *value);
+
+/*
+ * Helper functions that simply acquire/release yagl_egl_config::res
+ * @{
+ */
+
+/*
+ * Passing NULL won't hurt, this is for convenience.
+ */
+void yagl_egl_config_acquire(struct yagl_egl_config *cfg);
+
+/*
+ * Passing NULL won't hurt, this is for convenience.
+ */
+void yagl_egl_config_release(struct yagl_egl_config *cfg);
+
+/*
+ * @}
+ */
+
+#endif
diff --git a/hw/yagl/yagl_apis/egl/yagl_egl_context.c b/hw/yagl/yagl_apis/egl/yagl_egl_context.c
new file mode 100644
index 0000000000..f9e3bf7f14
--- /dev/null
+++ b/hw/yagl/yagl_apis/egl/yagl_egl_context.c
@@ -0,0 +1,114 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "yagl_egl_context.h"
+#include "yagl_egl_surface.h"
+#include "yagl_egl_display.h"
+#include "yagl_egl_config.h"
+#include "yagl_eglb_context.h"
+#include "yagl_eglb_display.h"
+
+static void yagl_egl_context_destroy(struct yagl_ref *ref)
+{
+ struct yagl_egl_context *ctx = (struct yagl_egl_context*)ref;
+
+ assert(!ctx->draw);
+ assert(!ctx->read);
+
+ ctx->backend_ctx->destroy(ctx->backend_ctx);
+
+ yagl_egl_config_release(ctx->cfg);
+
+ yagl_resource_cleanup(&ctx->res);
+
+ g_free(ctx);
+}
+
+struct yagl_egl_context
+ *yagl_egl_context_create(struct yagl_egl_display *dpy,
+ struct yagl_egl_config *cfg,
+ struct yagl_eglb_context *backend_share_ctx)
+{
+ struct yagl_eglb_context *backend_ctx;
+ struct yagl_egl_context *ctx;
+
+ backend_ctx = dpy->backend_dpy->create_context(dpy->backend_dpy,
+ &cfg->native,
+ backend_share_ctx);
+
+ if (!backend_ctx) {
+ return NULL;
+ }
+
+ ctx = g_malloc0(sizeof(*ctx));
+
+ yagl_resource_init(&ctx->res, &yagl_egl_context_destroy);
+
+ ctx->dpy = dpy;
+ yagl_egl_config_acquire(cfg);
+ ctx->cfg = cfg;
+ ctx->backend_ctx = backend_ctx;
+ ctx->read = NULL;
+ ctx->draw = NULL;
+
+ return ctx;
+}
+
+void yagl_egl_context_update_surfaces(struct yagl_egl_context *ctx,
+ struct yagl_egl_surface *draw,
+ struct yagl_egl_surface *read)
+{
+ struct yagl_egl_surface *tmp_draw, *tmp_read;
+
+ yagl_egl_surface_acquire(draw);
+ yagl_egl_surface_acquire(read);
+
+ tmp_draw = ctx->draw;
+ tmp_read = ctx->read;
+
+ ctx->draw = draw;
+ ctx->read = read;
+
+ yagl_egl_surface_release(tmp_draw);
+ yagl_egl_surface_release(tmp_read);
+}
+
+void yagl_egl_context_acquire(struct yagl_egl_context *ctx)
+{
+ if (ctx) {
+ yagl_resource_acquire(&ctx->res);
+ }
+}
+
+void yagl_egl_context_release(struct yagl_egl_context *ctx)
+{
+ if (ctx) {
+ yagl_resource_release(&ctx->res);
+ }
+}
diff --git a/hw/yagl/yagl_apis/egl/yagl_egl_context.h b/hw/yagl/yagl_apis/egl/yagl_egl_context.h
new file mode 100644
index 0000000000..7271442bbe
--- /dev/null
+++ b/hw/yagl/yagl_apis/egl/yagl_egl_context.h
@@ -0,0 +1,87 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_EGL_CONTEXT_H
+#define _QEMU_YAGL_EGL_CONTEXT_H
+
+#include "yagl_types.h"
+#include "yagl_resource.h"
+
+struct yagl_egl_display;
+struct yagl_egl_config;
+struct yagl_egl_surface;
+struct yagl_eglb_context;
+
+struct yagl_egl_context
+{
+ struct yagl_resource res;
+
+ struct yagl_egl_display *dpy;
+
+ struct yagl_egl_config *cfg;
+
+ struct yagl_eglb_context *backend_ctx;
+
+ struct yagl_egl_surface *read;
+
+ struct yagl_egl_surface *draw;
+};
+
+/*
+ * Takes ownership of 'client_ctx'.
+ */
+struct yagl_egl_context
+ *yagl_egl_context_create(struct yagl_egl_display *dpy,
+ struct yagl_egl_config *cfg,
+ struct yagl_eglb_context *backend_share_ctx);
+
+void yagl_egl_context_update_surfaces(struct yagl_egl_context *ctx,
+ struct yagl_egl_surface *draw,
+ struct yagl_egl_surface *read);
+
+/*
+ * Helper functions that simply acquire/release yagl_egl_context::res
+ * @{
+ */
+
+/*
+ * Passing NULL won't hurt, this is for convenience.
+ */
+void yagl_egl_context_acquire(struct yagl_egl_context *ctx);
+
+/*
+ * Passing NULL won't hurt, this is for convenience.
+ */
+void yagl_egl_context_release(struct yagl_egl_context *ctx);
+
+/*
+ * @}
+ */
+
+#endif
diff --git a/hw/yagl/yagl_apis/egl/yagl_egl_display.c b/hw/yagl/yagl_apis/egl/yagl_egl_display.c
new file mode 100644
index 0000000000..11fed5278a
--- /dev/null
+++ b/hw/yagl/yagl_apis/egl/yagl_egl_display.c
@@ -0,0 +1,251 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "yagl_egl_display.h"
+#include "yagl_egl_backend.h"
+#include "yagl_eglb_display.h"
+#include "yagl_egl_config.h"
+#include "yagl_egl_surface.h"
+#include "yagl_egl_context.h"
+#include "yagl_process.h"
+#include "yagl_thread.h"
+#include "yagl_log.h"
+#include "yagl_handle_gen.h"
+
+struct yagl_egl_display
+ *yagl_egl_display_create(struct yagl_egl_backend *backend,
+ uint32_t display_id)
+{
+ struct yagl_eglb_display *backend_dpy;
+ struct yagl_egl_display *dpy;
+
+ backend_dpy = backend->create_display(backend);
+
+ if (!backend_dpy) {
+ return NULL;
+ }
+
+ dpy = g_malloc0(sizeof(*dpy));
+
+ dpy->backend = backend;
+ dpy->display_id = display_id;
+ dpy->handle = yagl_handle_gen();
+ dpy->backend_dpy = backend_dpy;
+
+ dpy->initialized = false;
+
+ yagl_resource_list_init(&dpy->configs);
+ yagl_resource_list_init(&dpy->contexts);
+ yagl_resource_list_init(&dpy->surfaces);
+
+ return dpy;
+}
+
+void yagl_egl_display_destroy(struct yagl_egl_display *dpy)
+{
+ yagl_egl_display_terminate(dpy);
+
+ yagl_resource_list_cleanup(&dpy->surfaces);
+ yagl_resource_list_cleanup(&dpy->contexts);
+ yagl_resource_list_cleanup(&dpy->configs);
+
+ dpy->backend_dpy->destroy(dpy->backend_dpy);
+
+ g_free(dpy);
+}
+
+void yagl_egl_display_initialize(struct yagl_egl_display *dpy)
+{
+ struct yagl_egl_config **cfgs;
+ int i, num_configs = 0;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_display_initialize, NULL);
+
+ if (dpy->initialized) {
+ goto out;
+ }
+
+ cfgs = yagl_egl_config_enum(dpy, &num_configs);
+
+ if (num_configs <= 0) {
+ goto out;
+ }
+
+ yagl_egl_config_sort(cfgs, num_configs);
+
+ for (i = 0; i < num_configs; ++i) {
+ yagl_resource_list_add(&dpy->configs, &cfgs[i]->res);
+ yagl_egl_config_release(cfgs[i]);
+ }
+
+ g_free(cfgs);
+
+ YAGL_LOG_TRACE("initialized with %d configs", num_configs);
+
+out:
+ dpy->initialized = true;
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+bool yagl_egl_display_is_initialized(struct yagl_egl_display *dpy)
+{
+ bool ret;
+
+ ret = dpy->initialized;
+
+ return ret;
+}
+
+void yagl_egl_display_terminate(struct yagl_egl_display *dpy)
+{
+ struct yagl_resource_list tmp_list;
+
+ /*
+ * First, move all resources to a temporary list to release later.
+ */
+
+ yagl_resource_list_init(&tmp_list);
+
+ yagl_resource_list_move(&dpy->surfaces, &tmp_list);
+ yagl_resource_list_move(&dpy->contexts, &tmp_list);
+ yagl_resource_list_move(&dpy->configs, &tmp_list);
+
+ dpy->initialized = false;
+
+ yagl_resource_list_cleanup(&tmp_list);
+}
+
+int32_t yagl_egl_display_get_config_count(struct yagl_egl_display *dpy)
+{
+ return yagl_resource_list_get_count(&dpy->configs);
+}
+
+void yagl_egl_display_get_config_handles(struct yagl_egl_display *dpy,
+ yagl_host_handle *handles,
+ int32_t *num_configs)
+{
+ struct yagl_resource *res;
+ int32_t i = 0;
+
+ QTAILQ_FOREACH(res, &dpy->configs.resources, entry) {
+ if (i >= *num_configs) {
+ break;
+ }
+ handles[i] = res->handle;
+ ++i;
+ }
+
+ *num_configs = i;
+}
+
+void yagl_egl_display_choose_configs(struct yagl_egl_display *dpy,
+ const struct yagl_egl_native_config *dummy,
+ yagl_host_handle *handles,
+ int32_t *num_configs)
+{
+ struct yagl_resource *res;
+ int32_t i = 0;
+
+ QTAILQ_FOREACH(res, &dpy->configs.resources, entry) {
+ if (handles && (i >= *num_configs)) {
+ break;
+ }
+ if (yagl_egl_config_is_chosen_by((struct yagl_egl_config*)res, dummy)) {
+ if (handles) {
+ handles[i] = res->handle;
+ }
+ ++i;
+ }
+ }
+
+ *num_configs = i;
+}
+
+struct yagl_egl_config
+ *yagl_egl_display_acquire_config(struct yagl_egl_display *dpy,
+ yagl_host_handle handle)
+{
+ return (struct yagl_egl_config*)yagl_resource_list_acquire(&dpy->configs, handle);
+}
+
+struct yagl_egl_config
+ *yagl_egl_display_acquire_config_by_id(struct yagl_egl_display *dpy,
+ EGLint config_id)
+{
+ struct yagl_resource *res;
+
+ QTAILQ_FOREACH(res, &dpy->configs.resources, entry) {
+ if (((struct yagl_egl_config*)res)->native.config_id == config_id) {
+ yagl_resource_acquire(res);
+
+ return (struct yagl_egl_config*)res;
+ }
+ }
+
+ return NULL;
+}
+
+void yagl_egl_display_add_context(struct yagl_egl_display *dpy,
+ struct yagl_egl_context *ctx)
+{
+ yagl_resource_list_add(&dpy->contexts, &ctx->res);
+}
+
+struct yagl_egl_context
+ *yagl_egl_display_acquire_context(struct yagl_egl_display *dpy,
+ yagl_host_handle handle)
+{
+ return (struct yagl_egl_context*)yagl_resource_list_acquire(&dpy->contexts, handle);
+}
+
+bool yagl_egl_display_remove_context(struct yagl_egl_display *dpy,
+ yagl_host_handle handle)
+{
+ return yagl_resource_list_remove(&dpy->contexts, handle);
+}
+
+void yagl_egl_display_add_surface(struct yagl_egl_display *dpy,
+ struct yagl_egl_surface *sfc)
+{
+ yagl_resource_list_add(&dpy->surfaces, &sfc->res);
+}
+
+struct yagl_egl_surface
+ *yagl_egl_display_acquire_surface(struct yagl_egl_display *dpy,
+ yagl_host_handle handle)
+{
+ return (struct yagl_egl_surface*)yagl_resource_list_acquire(&dpy->surfaces, handle);
+}
+
+bool yagl_egl_display_remove_surface(struct yagl_egl_display *dpy,
+ yagl_host_handle handle)
+{
+ return yagl_resource_list_remove(&dpy->surfaces, handle);
+}
diff --git a/hw/yagl/yagl_apis/egl/yagl_egl_display.h b/hw/yagl/yagl_apis/egl/yagl_egl_display.h
new file mode 100644
index 0000000000..182af02b0d
--- /dev/null
+++ b/hw/yagl/yagl_apis/egl/yagl_egl_display.h
@@ -0,0 +1,168 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_EGL_DISPLAY_H
+#define _QEMU_YAGL_EGL_DISPLAY_H
+
+#include "yagl_types.h"
+#include "yagl_resource_list.h"
+#include "qemu/queue.h"
+#include <EGL/egl.h>
+
+struct yagl_egl_backend;
+struct yagl_egl_config;
+struct yagl_egl_native_config;
+struct yagl_egl_surface;
+struct yagl_egl_context;
+struct yagl_eglb_display;
+
+struct yagl_egl_display
+{
+ QLIST_ENTRY(yagl_egl_display) entry;
+
+ struct yagl_egl_backend *backend;
+
+ uint32_t display_id;
+
+ yagl_host_handle handle;
+
+ struct yagl_eglb_display *backend_dpy;
+
+ bool initialized;
+
+ struct yagl_resource_list configs;
+
+ struct yagl_resource_list contexts;
+
+ struct yagl_resource_list surfaces;
+};
+
+struct yagl_egl_display
+ *yagl_egl_display_create(struct yagl_egl_backend *backend,
+ uint32_t display_id);
+
+void yagl_egl_display_destroy(struct yagl_egl_display *dpy);
+
+void yagl_egl_display_initialize(struct yagl_egl_display *dpy);
+
+bool yagl_egl_display_is_initialized(struct yagl_egl_display *dpy);
+
+void yagl_egl_display_terminate(struct yagl_egl_display *dpy);
+
+/*
+ * Configs.
+ * @{
+ */
+
+int32_t yagl_egl_display_get_config_count(struct yagl_egl_display *dpy);
+
+/*
+ * Gets at most '*num_configs' config handles and updates
+ * 'num_configs' with number of configs actually returned.
+ * The configs themselves are not acquired.
+ */
+void yagl_egl_display_get_config_handles(struct yagl_egl_display *dpy,
+ yagl_host_handle *handles,
+ int32_t *num_configs);
+
+/*
+ * Gets at most '*num_configs' config handles and updates
+ * 'num_configs' with number of configs actually returned.
+ * The configs themselves are not acquired.
+ *
+ * 'dummy' is used for matching, only handles of configs that matched
+ * 'dummy' will be returned. if 'handles' is NULL then no handles are
+ * returned, but 'num_configs' is still updated.
+ */
+void yagl_egl_display_choose_configs(struct yagl_egl_display *dpy,
+ const struct yagl_egl_native_config *dummy,
+ yagl_host_handle *handles,
+ int32_t *num_configs);
+
+struct yagl_egl_config
+ *yagl_egl_display_acquire_config(struct yagl_egl_display *dpy,
+ yagl_host_handle handle);
+
+struct yagl_egl_config
+ *yagl_egl_display_acquire_config_by_id(struct yagl_egl_display *dpy,
+ EGLint config_id);
+
+/*
+ * @}
+ */
+
+/*
+ * Contexts.
+ * @{
+ */
+
+/*
+ * This acquires 'ctx', so the caller should
+ * release 'ctx' if he doesn't want to use it and wants it to belong to the
+ * display alone.
+ */
+void yagl_egl_display_add_context(struct yagl_egl_display *dpy,
+ struct yagl_egl_context *ctx);
+
+struct yagl_egl_context
+ *yagl_egl_display_acquire_context(struct yagl_egl_display *dpy,
+ yagl_host_handle handle);
+
+bool yagl_egl_display_remove_context(struct yagl_egl_display *dpy,
+ yagl_host_handle handle);
+
+/*
+ * @}
+ */
+
+/*
+ * Surfaces.
+ * @{
+ */
+
+/*
+ * This acquires 'sfc', so the caller should
+ * release 'sfc' if he doesn't want to use it and wants it to belong to the
+ * display alone.
+ */
+void yagl_egl_display_add_surface(struct yagl_egl_display *dpy,
+ struct yagl_egl_surface *sfc);
+
+struct yagl_egl_surface
+ *yagl_egl_display_acquire_surface(struct yagl_egl_display *dpy,
+ yagl_host_handle handle);
+
+bool yagl_egl_display_remove_surface(struct yagl_egl_display *dpy,
+ yagl_host_handle handle);
+
+/*
+ * @}
+ */
+
+#endif
diff --git a/hw/yagl/yagl_apis/egl/yagl_egl_surface.c b/hw/yagl/yagl_apis/egl/yagl_egl_surface.c
new file mode 100644
index 0000000000..386dc903db
--- /dev/null
+++ b/hw/yagl/yagl_apis/egl/yagl_egl_surface.c
@@ -0,0 +1,77 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "yagl_egl_surface.h"
+#include "yagl_egl_display.h"
+#include "yagl_egl_config.h"
+#include "yagl_eglb_surface.h"
+
+static void yagl_egl_surface_destroy(struct yagl_ref *ref)
+{
+ struct yagl_egl_surface *sfc = (struct yagl_egl_surface*)ref;
+
+ sfc->backend_sfc->destroy(sfc->backend_sfc);
+
+ yagl_egl_config_release(sfc->cfg);
+
+ yagl_resource_cleanup(&sfc->res);
+
+ g_free(sfc);
+}
+
+struct yagl_egl_surface
+ *yagl_egl_surface_create(struct yagl_egl_display *dpy,
+ struct yagl_egl_config *cfg,
+ struct yagl_eglb_surface *backend_sfc)
+{
+ struct yagl_egl_surface *sfc = g_malloc0(sizeof(struct yagl_egl_surface));
+
+ yagl_resource_init(&sfc->res, &yagl_egl_surface_destroy);
+
+ sfc->dpy = dpy;
+ yagl_egl_config_acquire(cfg);
+ sfc->cfg = cfg;
+ sfc->backend_sfc = backend_sfc;
+
+ return sfc;
+}
+
+void yagl_egl_surface_acquire(struct yagl_egl_surface *sfc)
+{
+ if (sfc) {
+ yagl_resource_acquire(&sfc->res);
+ }
+}
+
+void yagl_egl_surface_release(struct yagl_egl_surface *sfc)
+{
+ if (sfc) {
+ yagl_resource_release(&sfc->res);
+ }
+}
diff --git a/hw/yagl/yagl_apis/egl/yagl_egl_surface.h b/hw/yagl/yagl_apis/egl/yagl_egl_surface.h
new file mode 100644
index 0000000000..c16fb04194
--- /dev/null
+++ b/hw/yagl/yagl_apis/egl/yagl_egl_surface.h
@@ -0,0 +1,78 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_EGL_SURFACE_H
+#define _QEMU_YAGL_EGL_SURFACE_H
+
+#include "yagl_types.h"
+#include "yagl_resource.h"
+
+struct yagl_egl_display;
+struct yagl_egl_config;
+struct yagl_eglb_surface;
+
+struct yagl_egl_surface
+{
+ struct yagl_resource res;
+
+ struct yagl_egl_display *dpy;
+
+ struct yagl_egl_config *cfg;
+
+ struct yagl_eglb_surface *backend_sfc;
+};
+
+/*
+ * Takes ownership of 'backend_sfc'.
+ */
+struct yagl_egl_surface
+ *yagl_egl_surface_create(struct yagl_egl_display *dpy,
+ struct yagl_egl_config *cfg,
+ struct yagl_eglb_surface *backend_sfc);
+
+/*
+ * Helper functions that simply acquire/release yagl_egl_surface::res
+ * @{
+ */
+
+/*
+ * Passing NULL won't hurt, this is for convenience.
+ */
+void yagl_egl_surface_acquire(struct yagl_egl_surface *sfc);
+
+/*
+ * Passing NULL won't hurt, this is for convenience.
+ */
+void yagl_egl_surface_release(struct yagl_egl_surface *sfc);
+
+/*
+ * @}
+ */
+
+#endif
diff --git a/hw/yagl/yagl_apis/egl/yagl_egl_validate.c b/hw/yagl/yagl_apis/egl/yagl_egl_validate.c
new file mode 100644
index 0000000000..2d74fc502a
--- /dev/null
+++ b/hw/yagl/yagl_apis/egl/yagl_egl_validate.c
@@ -0,0 +1,35 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "yagl_egl_validate.h"
+
+bool yagl_egl_is_attrib_list_empty(const EGLint *attrib_list)
+{
+ return !attrib_list || (attrib_list[0] == EGL_NONE);
+}
diff --git a/hw/yagl/yagl_apis/egl/yagl_egl_validate.h b/hw/yagl/yagl_apis/egl/yagl_egl_validate.h
new file mode 100644
index 0000000000..55dbdaa39c
--- /dev/null
+++ b/hw/yagl/yagl_apis/egl/yagl_egl_validate.h
@@ -0,0 +1,38 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_EGL_VALIDATE_H
+#define _QEMU_YAGL_EGL_VALIDATE_H
+
+#include "yagl_types.h"
+#include <EGL/egl.h>
+
+bool yagl_egl_is_attrib_list_empty(const EGLint *attrib_list);
+
+#endif
diff --git a/hw/yagl/yagl_apis/egl/yagl_host_egl_calls.c b/hw/yagl/yagl_apis/egl/yagl_host_egl_calls.c
new file mode 100644
index 0000000000..23c18b5429
--- /dev/null
+++ b/hw/yagl/yagl_apis/egl/yagl_host_egl_calls.c
@@ -0,0 +1,1844 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "yagl_host_egl_calls.h"
+#include "yagl_egl_calls.h"
+#include "yagl_egl_api_ps.h"
+#include "yagl_egl_api_ts.h"
+#include "yagl_egl_api.h"
+#include "yagl_egl_display.h"
+#include "yagl_egl_backend.h"
+#include "yagl_egl_interface.h"
+#include "yagl_egl_config.h"
+#include "yagl_egl_surface.h"
+#include "yagl_egl_context.h"
+#include "yagl_egl_validate.h"
+#include "yagl_eglb_display.h"
+#include "yagl_eglb_context.h"
+#include "yagl_eglb_surface.h"
+#include "yagl_log.h"
+#include "yagl_tls.h"
+#include "yagl_thread.h"
+#include "yagl_process.h"
+#include "yagl_object_map.h"
+#include <EGL/eglext.h>
+
+#define YAGL_EGL_VERSION_MAJOR 1
+#define YAGL_EGL_VERSION_MINOR 4
+
+#define YAGL_SET_ERR(err) \
+ *error = err; \
+ YAGL_LOG_ERROR("error = 0x%X", err)
+
+#define YAGL_UNIMPLEMENTED(func, ret) \
+ YAGL_LOG_FUNC_SET(func); \
+ YAGL_LOG_WARN("NOT IMPLEMENTED!!!"); \
+ *retval = ret; \
+ return true;
+
+struct yagl_egl_interface_impl
+{
+ struct yagl_egl_interface base;
+
+ struct yagl_egl_backend *backend;
+};
+
+static void yagl_egl_ensure_current(struct yagl_egl_interface *iface)
+{
+ struct yagl_egl_interface_impl *egl_iface = (struct yagl_egl_interface_impl*)iface;
+ egl_iface->backend->ensure_current(egl_iface->backend);
+}
+
+static void yagl_egl_unensure_current(struct yagl_egl_interface *iface)
+{
+ struct yagl_egl_interface_impl *egl_iface = (struct yagl_egl_interface_impl*)iface;
+ egl_iface->backend->unensure_current(egl_iface->backend);
+}
+
+static YAGL_DEFINE_TLS(struct yagl_egl_api_ts*, egl_api_ts);
+
+static __inline bool yagl_validate_display(yagl_host_handle dpy_,
+ struct yagl_egl_display **dpy,
+ EGLint *error)
+{
+ YAGL_LOG_FUNC_SET(yagl_validate_display);
+
+ *dpy = yagl_egl_api_ps_display_get(egl_api_ts->api_ps, dpy_);
+
+ if (!*dpy) {
+ YAGL_SET_ERR(EGL_BAD_DISPLAY);
+ return false;
+ }
+
+ if (!yagl_egl_display_is_initialized(*dpy)) {
+ YAGL_SET_ERR(EGL_NOT_INITIALIZED);
+ return false;
+ }
+
+ return true;
+}
+
+static __inline bool yagl_validate_config(struct yagl_egl_display *dpy,
+ yagl_host_handle cfg_,
+ struct yagl_egl_config **cfg,
+ EGLint *error)
+{
+ YAGL_LOG_FUNC_SET(yagl_validate_config);
+
+ *cfg = yagl_egl_display_acquire_config(dpy, cfg_);
+
+ if (!*cfg) {
+ YAGL_SET_ERR(EGL_BAD_CONFIG);
+ return false;
+ }
+
+ return true;
+}
+
+static __inline bool yagl_validate_surface(struct yagl_egl_display *dpy,
+ yagl_host_handle sfc_,
+ struct yagl_egl_surface **sfc,
+ EGLint *error)
+{
+ YAGL_LOG_FUNC_SET(yagl_validate_surface);
+
+ *sfc = yagl_egl_display_acquire_surface(dpy, sfc_);
+
+ if (!*sfc) {
+ YAGL_SET_ERR(EGL_BAD_SURFACE);
+ return false;
+ }
+
+ return true;
+}
+
+static __inline bool yagl_validate_context(struct yagl_egl_display *dpy,
+ yagl_host_handle ctx_,
+ struct yagl_egl_context **ctx,
+ EGLint *error)
+{
+ YAGL_LOG_FUNC_SET(yagl_validate_context);
+
+ *ctx = yagl_egl_display_acquire_context(dpy, ctx_);
+
+ if (!*ctx) {
+ YAGL_SET_ERR(EGL_BAD_CONTEXT);
+ return false;
+ }
+
+ return true;
+}
+
+static bool yagl_egl_release_current_context(struct yagl_egl_display *dpy)
+{
+ if (!egl_api_ts->context) {
+ return true;
+ }
+
+ if (!egl_api_ts->backend->release_current(egl_api_ts->backend, false)) {
+ return false;
+ }
+
+ yagl_egl_context_update_surfaces(egl_api_ts->context, NULL, NULL);
+
+ yagl_egl_api_ts_update_context(egl_api_ts, NULL);
+
+ return true;
+}
+
+static yagl_api_func yagl_host_egl_get_func(struct yagl_api_ps *api_ps,
+ uint32_t func_id)
+{
+ if ((func_id <= 0) || (func_id > yagl_egl_api_num_funcs)) {
+ return NULL;
+ } else {
+ return yagl_egl_api_funcs[func_id - 1];
+ }
+}
+
+static void yagl_host_egl_thread_init(struct yagl_api_ps *api_ps)
+{
+ struct yagl_egl_api_ps *egl_api_ps = (struct yagl_egl_api_ps*)api_ps;
+
+ YAGL_LOG_FUNC_ENTER(yagl_host_egl_thread_init, NULL);
+
+ egl_api_ps->backend->thread_init(egl_api_ps->backend);
+
+ egl_api_ts = g_malloc0(sizeof(*egl_api_ts));
+
+ yagl_egl_api_ts_init(egl_api_ts, egl_api_ps);
+
+ cur_ts->egl_api_ts = egl_api_ts;
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+static void yagl_host_egl_batch_start(struct yagl_api_ps *api_ps)
+{
+ struct yagl_egl_api_ps *egl_api_ps = (struct yagl_egl_api_ps*)api_ps;
+
+ egl_api_ts = cur_ts->egl_api_ts;
+
+ egl_api_ps->backend->batch_start(egl_api_ps->backend);
+}
+
+static void yagl_host_egl_batch_end(struct yagl_api_ps *api_ps)
+{
+ struct yagl_egl_api_ps *egl_api_ps = (struct yagl_egl_api_ps*)api_ps;
+
+ egl_api_ps->backend->batch_end(egl_api_ps->backend);
+}
+
+static void yagl_host_egl_thread_fini(struct yagl_api_ps *api_ps)
+{
+ struct yagl_egl_api_ps *egl_api_ps = (struct yagl_egl_api_ps*)api_ps;
+
+ YAGL_LOG_FUNC_ENTER(yagl_host_egl_thread_fini, NULL);
+
+ egl_api_ts = cur_ts->egl_api_ts;
+
+ egl_api_ps->backend->batch_start(egl_api_ps->backend);
+
+ yagl_egl_api_ts_cleanup(egl_api_ts);
+
+ g_free(egl_api_ts);
+
+ egl_api_ts = cur_ts->egl_api_ts = NULL;
+
+ egl_api_ps->backend->batch_end(egl_api_ps->backend);
+ egl_api_ps->backend->thread_fini(egl_api_ps->backend);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+static void yagl_host_egl_process_destroy(struct yagl_api_ps *api_ps)
+{
+ struct yagl_egl_api_ps *egl_api_ps = (struct yagl_egl_api_ps*)api_ps;
+
+ YAGL_LOG_FUNC_ENTER(yagl_host_egl_process_destroy, NULL);
+
+ yagl_egl_api_ps_cleanup(egl_api_ps);
+
+ g_free(egl_api_ps->egl_iface);
+
+ yagl_api_ps_cleanup(&egl_api_ps->base);
+
+ g_free(egl_api_ps);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+struct yagl_api_ps *yagl_host_egl_process_init(struct yagl_api *api)
+{
+ struct yagl_egl_api *egl_api = (struct yagl_egl_api*)api;
+ struct yagl_egl_interface_impl *egl_iface;
+ struct yagl_egl_api_ps *egl_api_ps;
+
+ YAGL_LOG_FUNC_ENTER(yagl_host_egl_process_init, NULL);
+
+ /*
+ * Create EGL interface.
+ */
+
+ egl_iface = g_malloc0(sizeof(*egl_iface));
+
+ egl_iface->base.ensure_ctx = &yagl_egl_ensure_current;
+ egl_iface->base.unensure_ctx = &yagl_egl_unensure_current;
+ egl_iface->backend = egl_api->backend;
+
+ /*
+ * Finally, create API ps.
+ */
+
+ egl_api_ps = g_malloc0(sizeof(*egl_api_ps));
+
+ yagl_api_ps_init(&egl_api_ps->base, api);
+
+ egl_api_ps->base.thread_init = &yagl_host_egl_thread_init;
+ egl_api_ps->base.batch_start = &yagl_host_egl_batch_start;
+ egl_api_ps->base.get_func = &yagl_host_egl_get_func;
+ egl_api_ps->base.batch_end = &yagl_host_egl_batch_end;
+ egl_api_ps->base.thread_fini = &yagl_host_egl_thread_fini;
+ egl_api_ps->base.destroy = &yagl_host_egl_process_destroy;
+
+ yagl_egl_api_ps_init(egl_api_ps, egl_api->backend, &egl_iface->base);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return &egl_api_ps->base;
+}
+
+yagl_host_handle yagl_host_eglGetDisplay(uint32_t display_id,
+ EGLint *error)
+{
+ struct yagl_egl_display *dpy;
+
+ dpy = yagl_egl_api_ps_display_add(egl_api_ts->api_ps, display_id);
+
+ return (dpy ? dpy->handle : 0);
+}
+
+EGLBoolean yagl_host_eglInitialize(yagl_host_handle dpy_,
+ EGLint *major,
+ EGLint *minor,
+ EGLint *error)
+{
+ struct yagl_egl_display *dpy;
+
+ YAGL_LOG_FUNC_SET(eglInitialize);
+
+ dpy = yagl_egl_api_ps_display_get(egl_api_ts->api_ps, dpy_);
+
+ if (!dpy) {
+ YAGL_SET_ERR(EGL_BAD_DISPLAY);
+ return EGL_FALSE;
+ }
+
+ yagl_egl_display_initialize(dpy);
+
+ if (major) {
+ *major = YAGL_EGL_VERSION_MAJOR;
+ }
+
+ if (minor) {
+ *minor = YAGL_EGL_VERSION_MINOR;
+ }
+
+ return EGL_TRUE;
+}
+
+EGLBoolean yagl_host_eglTerminate(yagl_host_handle dpy_,
+ EGLint *error)
+{
+ struct yagl_egl_display *dpy = NULL;
+
+ if (!yagl_validate_display(dpy_, &dpy, error)) {
+ return EGL_FALSE;
+ }
+
+ yagl_egl_display_terminate(dpy);
+
+ return EGL_TRUE;
+}
+
+EGLBoolean yagl_host_eglGetConfigs(yagl_host_handle dpy_,
+ yagl_host_handle *configs, int32_t configs_maxcount, int32_t *configs_count,
+ EGLint *error)
+{
+ struct yagl_egl_display *dpy = NULL;
+
+ if (!yagl_validate_display(dpy_, &dpy, error)) {
+ return EGL_FALSE;
+ }
+
+ if (configs) {
+ *configs_count = configs_maxcount;
+ yagl_egl_display_get_config_handles(dpy, configs, configs_count);
+ } else {
+ *configs_count = yagl_egl_display_get_config_count(dpy);
+ }
+
+ return EGL_TRUE;
+}
+
+EGLBoolean yagl_host_eglChooseConfig(yagl_host_handle dpy_,
+ const EGLint *attrib_list, int32_t attrib_list_count,
+ yagl_host_handle *configs, int32_t configs_maxcount, int32_t *configs_count,
+ EGLint *error)
+{
+ EGLBoolean res = EGL_FALSE;
+ struct yagl_egl_display *dpy = NULL;
+ struct yagl_egl_native_config dummy;
+ int i = 0;
+
+ YAGL_LOG_FUNC_SET(eglChooseConfig);
+
+ yagl_egl_native_config_init(&dummy);
+
+ if (!yagl_validate_display(dpy_, &dpy, error)) {
+ goto out;
+ }
+
+ /*
+ * Selection defaults.
+ */
+
+ dummy.surface_type = EGL_WINDOW_BIT;
+ dummy.renderable_type = EGL_OPENGL_ES_BIT;
+ dummy.caveat = EGL_DONT_CARE;
+ dummy.config_id = EGL_DONT_CARE;
+ dummy.native_renderable = EGL_DONT_CARE;
+ dummy.native_visual_type = EGL_DONT_CARE;
+ dummy.max_swap_interval = EGL_DONT_CARE;
+ dummy.min_swap_interval = EGL_DONT_CARE;
+ dummy.trans_red_val = EGL_DONT_CARE;
+ dummy.trans_green_val = EGL_DONT_CARE;
+ dummy.trans_blue_val = EGL_DONT_CARE;
+ dummy.transparent_type = EGL_NONE;
+ dummy.match_format_khr = EGL_DONT_CARE;
+ dummy.bind_to_texture_rgb = EGL_DONT_CARE;
+ dummy.bind_to_texture_rgba = EGL_DONT_CARE;
+
+ if (!yagl_egl_is_attrib_list_empty(attrib_list)) {
+ bool has_config_id = false;
+ EGLint config_id = 0;
+
+ while ((attrib_list[i] != EGL_NONE) && !has_config_id) {
+ switch (attrib_list[i]) {
+ case EGL_MAX_PBUFFER_WIDTH:
+ case EGL_MAX_PBUFFER_HEIGHT:
+ case EGL_MAX_PBUFFER_PIXELS:
+ case EGL_NATIVE_VISUAL_ID:
+ break;
+ case EGL_BIND_TO_TEXTURE_RGB:
+ dummy.bind_to_texture_rgb = attrib_list[i + 1];
+ break;
+ case EGL_BIND_TO_TEXTURE_RGBA:
+ dummy.bind_to_texture_rgba = attrib_list[i + 1];
+ break;
+ case EGL_SURFACE_TYPE:
+ dummy.surface_type = attrib_list[i + 1];
+ break;
+ case EGL_LEVEL:
+ if (attrib_list[i + 1] == EGL_DONT_CARE) {
+ YAGL_SET_ERR(EGL_BAD_ATTRIBUTE);
+ goto out;
+ }
+ dummy.frame_buffer_level = attrib_list[i + 1];
+ break;
+ case EGL_BUFFER_SIZE:
+ if (attrib_list[i + 1] < 0) {
+ YAGL_SET_ERR(EGL_BAD_ATTRIBUTE);
+ goto out;
+ }
+ dummy.buffer_size = attrib_list[i + 1];
+ break;
+ case EGL_RED_SIZE:
+ if (attrib_list[i + 1] < 0) {
+ YAGL_SET_ERR(EGL_BAD_ATTRIBUTE);
+ goto out;
+ }
+ dummy.red_size = attrib_list[i + 1];
+ break;
+ case EGL_GREEN_SIZE:
+ if (attrib_list[i + 1] < 0) {
+ YAGL_SET_ERR(EGL_BAD_ATTRIBUTE);
+ goto out;
+ }
+ dummy.green_size = attrib_list[i + 1];
+ break;
+ case EGL_BLUE_SIZE:
+ if (attrib_list[i + 1] < 0) {
+ YAGL_SET_ERR(EGL_BAD_ATTRIBUTE);
+ goto out;
+ }
+ dummy.blue_size = attrib_list[i + 1];
+ break;
+ case EGL_ALPHA_SIZE:
+ if (attrib_list[i + 1] < 0) {
+ YAGL_SET_ERR(EGL_BAD_ATTRIBUTE);
+ goto out;
+ }
+ dummy.alpha_size = attrib_list[i + 1];
+ break;
+ case EGL_CONFIG_CAVEAT:
+ if ((attrib_list[i + 1] != EGL_NONE) &&
+ (attrib_list[i + 1] != EGL_SLOW_CONFIG) &&
+ (attrib_list[i + 1] != EGL_NON_CONFORMANT_CONFIG)) {
+ YAGL_SET_ERR(EGL_BAD_ATTRIBUTE);
+ goto out;
+ }
+ dummy.caveat = attrib_list[i + 1];
+ break;
+ case EGL_CONFIG_ID:
+ if (attrib_list[i + 1] < 0) {
+ YAGL_SET_ERR(EGL_BAD_ATTRIBUTE);
+ goto out;
+ }
+ config_id = attrib_list[i + 1];
+ has_config_id = true;
+ break;
+ case EGL_DEPTH_SIZE:
+ if (attrib_list[i + 1] < 0) {
+ YAGL_SET_ERR(EGL_BAD_ATTRIBUTE);
+ goto out;
+ }
+ dummy.depth_size = attrib_list[i + 1];
+ break;
+ case EGL_MAX_SWAP_INTERVAL:
+ if (attrib_list[i + 1] < 0) {
+ YAGL_SET_ERR(EGL_BAD_ATTRIBUTE);
+ goto out;
+ }
+ dummy.max_swap_interval = attrib_list[i + 1];
+ break;
+ case EGL_MIN_SWAP_INTERVAL:
+ if (attrib_list[i + 1] < 0) {
+ YAGL_SET_ERR(EGL_BAD_ATTRIBUTE);
+ goto out;
+ }
+ dummy.min_swap_interval = attrib_list[i + 1];
+ break;
+ case EGL_CONFORMANT:
+ if ((attrib_list[i + 1] &
+ ~(EGL_OPENGL_ES_BIT|
+ EGL_OPENVG_BIT|
+ EGL_OPENGL_ES2_BIT|
+ EGL_OPENGL_BIT)) != 0) {
+ YAGL_SET_ERR(EGL_BAD_ATTRIBUTE);
+ goto out;
+ }
+ dummy.conformant = attrib_list[i + 1];
+ break;
+ case EGL_NATIVE_RENDERABLE:
+ dummy.native_renderable = attrib_list[i + 1];
+ break;
+ case EGL_RENDERABLE_TYPE:
+ dummy.renderable_type = attrib_list[i + 1];
+ break;
+ case EGL_NATIVE_VISUAL_TYPE:
+ dummy.native_visual_type = attrib_list[i + 1];
+ if ((attrib_list[i + 1] < 0) || (attrib_list[i + 1] > 1)) {
+ YAGL_SET_ERR(EGL_BAD_ATTRIBUTE);
+ goto out;
+ }
+ break;
+ case EGL_SAMPLE_BUFFERS:
+ if (attrib_list[i + 1] < 0) {
+ YAGL_SET_ERR(EGL_BAD_ATTRIBUTE);
+ goto out;
+ }
+ dummy.sample_buffers_num = attrib_list[i + 1];
+ break;
+ case EGL_SAMPLES:
+ if (attrib_list[i + 1] < 0) {
+ YAGL_SET_ERR(EGL_BAD_ATTRIBUTE);
+ goto out;
+ }
+ dummy.samples_per_pixel = attrib_list[i + 1];
+ break;
+ case EGL_STENCIL_SIZE:
+ if (attrib_list[i + 1] < 0) {
+ YAGL_SET_ERR(EGL_BAD_ATTRIBUTE);
+ goto out;
+ }
+ dummy.stencil_size = attrib_list[i + 1];
+ break;
+ case EGL_TRANSPARENT_TYPE:
+ if ((attrib_list[i + 1] != EGL_NONE) &&
+ (attrib_list[i + 1] != EGL_TRANSPARENT_RGB)) {
+ YAGL_SET_ERR(EGL_BAD_ATTRIBUTE);
+ goto out;
+ }
+ dummy.transparent_type = attrib_list[i + 1];
+ break;
+ case EGL_TRANSPARENT_RED_VALUE:
+ dummy.trans_red_val = attrib_list[i + 1];
+ break;
+ case EGL_TRANSPARENT_GREEN_VALUE:
+ dummy.trans_green_val = attrib_list[i + 1];
+ break;
+ case EGL_TRANSPARENT_BLUE_VALUE:
+ dummy.trans_blue_val = attrib_list[i + 1];
+ break;
+ case EGL_MATCH_FORMAT_KHR:
+ dummy.match_format_khr = attrib_list[i + 1];
+ break;
+ default:
+ YAGL_SET_ERR(EGL_BAD_ATTRIBUTE);
+ goto out;
+ }
+
+ i += 2;
+ }
+
+ if (has_config_id) {
+ yagl_host_handle handle = 0;
+ struct yagl_egl_config *cfg =
+ yagl_egl_display_acquire_config_by_id(dpy, config_id);
+
+ if (cfg) {
+ handle = cfg->res.handle;
+ yagl_egl_config_release(cfg);
+ }
+
+ YAGL_LOG_DEBUG("requesting config with id = %d", config_id);
+
+ if (handle) {
+ if (configs) {
+ *configs = handle;
+ }
+
+ *configs_count = 1;
+
+ res = EGL_TRUE;
+ goto out;
+ } else {
+ YAGL_SET_ERR(EGL_BAD_ATTRIBUTE);
+ goto out;
+ }
+ }
+ }
+
+ *configs_count = configs_maxcount;
+ yagl_egl_display_choose_configs(dpy, &dummy, configs, configs_count);
+
+ YAGL_LOG_DEBUG("chosen %d configs", *configs_count);
+
+ res = EGL_TRUE;
+
+out:
+ return res;
+}
+
+EGLBoolean yagl_host_eglGetConfigAttrib(yagl_host_handle dpy_,
+ yagl_host_handle config_,
+ EGLint attribute,
+ EGLint *value,
+ EGLint *error)
+{
+ EGLBoolean res = EGL_FALSE;
+ struct yagl_egl_display *dpy = NULL;
+ struct yagl_egl_config *config = NULL;
+ EGLint tmp;
+
+ YAGL_LOG_FUNC_SET(eglGetConfigAttrib);
+
+ if (!yagl_validate_display(dpy_, &dpy, error)) {
+ goto out;
+ }
+
+ if (!yagl_validate_config(dpy, config_, &config, error)) {
+ goto out;
+ }
+
+ if (!yagl_egl_config_get_attrib(config, attribute, &tmp)) {
+ YAGL_SET_ERR(EGL_BAD_ATTRIBUTE);
+ goto out;
+ }
+
+ if (value) {
+ *value = tmp;
+ }
+
+ res = EGL_TRUE;
+
+out:
+ yagl_egl_config_release(config);
+
+ return res;
+}
+
+EGLBoolean yagl_host_eglDestroySurface(yagl_host_handle dpy_,
+ yagl_host_handle surface_,
+ EGLint *error)
+{
+ EGLBoolean res = EGL_FALSE;
+ struct yagl_egl_display *dpy = NULL;
+ struct yagl_egl_surface *surface = NULL;
+
+ YAGL_LOG_FUNC_SET(eglDestroySurface);
+
+ if (!yagl_validate_display(dpy_, &dpy, error)) {
+ goto out;
+ }
+
+ if (!yagl_validate_surface(dpy, surface_, &surface, error)) {
+ goto out;
+ }
+
+ if (!yagl_egl_display_remove_surface(dpy, surface->res.handle)) {
+ YAGL_SET_ERR(EGL_BAD_SURFACE);
+ goto out;
+ }
+
+ res = EGL_TRUE;
+
+out:
+ yagl_egl_surface_release(surface);
+
+ return res;
+}
+
+EGLBoolean yagl_host_eglQuerySurface(yagl_host_handle dpy_,
+ yagl_host_handle surface_,
+ EGLint attribute,
+ EGLint *value,
+ EGLint *error)
+{
+ EGLBoolean res = EGL_FALSE;
+ struct yagl_egl_display *dpy = NULL;
+ struct yagl_egl_surface *surface = NULL;
+ EGLint tmp;
+
+ YAGL_LOG_FUNC_SET(eglQuerySurface);
+
+ if (!yagl_validate_display(dpy_, &dpy, error)) {
+ goto out;
+ }
+
+ if (!yagl_validate_surface(dpy, surface_, &surface, error)) {
+ goto out;
+ }
+
+ switch (attribute) {
+ case EGL_CONFIG_ID:
+ if (value) {
+ *value = surface->cfg->native.config_id;
+ }
+ break;
+ case EGL_LARGEST_PBUFFER:
+ if ((surface->backend_sfc->type == EGL_PBUFFER_BIT) && value) {
+ *value = surface->backend_sfc->attribs.pbuffer.largest;
+ }
+ break;
+ case EGL_TEXTURE_FORMAT:
+ if ((surface->backend_sfc->type == EGL_PBUFFER_BIT) && value) {
+ *value = surface->backend_sfc->attribs.pbuffer.tex_format;
+ }
+ break;
+ case EGL_TEXTURE_TARGET:
+ if ((surface->backend_sfc->type == EGL_PBUFFER_BIT) && value) {
+ *value = surface->backend_sfc->attribs.pbuffer.tex_target;
+ }
+ break;
+ case EGL_MIPMAP_TEXTURE:
+ if ((surface->backend_sfc->type == EGL_PBUFFER_BIT) && value) {
+ *value = surface->backend_sfc->attribs.pbuffer.tex_mipmap;
+ }
+ break;
+ case EGL_MIPMAP_LEVEL:
+ if ((surface->backend_sfc->type == EGL_PBUFFER_BIT) && value) {
+ *value = 0;
+ }
+ break;
+ case EGL_RENDER_BUFFER:
+ switch (surface->backend_sfc->type) {
+ case EGL_PBUFFER_BIT:
+ case EGL_WINDOW_BIT:
+ if (value) {
+ *value = EGL_BACK_BUFFER;
+ }
+ break;
+ case EGL_PIXMAP_BIT:
+ if (value) {
+ *value = EGL_SINGLE_BUFFER;
+ }
+ break;
+ default:
+ break;
+ }
+ break;
+ case EGL_HORIZONTAL_RESOLUTION:
+ case EGL_VERTICAL_RESOLUTION:
+ case EGL_PIXEL_ASPECT_RATIO:
+ if (value) {
+ *value = EGL_UNKNOWN;
+ }
+ break;
+ case EGL_SWAP_BEHAVIOR:
+ if (value) {
+ *value = EGL_BUFFER_PRESERVED;
+ }
+ break;
+ case EGL_MULTISAMPLE_RESOLVE:
+ if (value) {
+ *value = EGL_MULTISAMPLE_RESOLVE_DEFAULT;
+ }
+ break;
+ default:
+ if (!surface->backend_sfc->query(surface->backend_sfc,
+ attribute,
+ &tmp)) {
+ YAGL_SET_ERR(EGL_BAD_ATTRIBUTE);
+ goto out;
+ }
+ if (value) {
+ *value = tmp;
+ }
+ break;
+ }
+
+ res = EGL_TRUE;
+
+out:
+ yagl_egl_surface_release(surface);
+
+ return res;
+}
+
+void yagl_host_eglBindAPI(EGLenum api)
+{
+ egl_api_ts->api = api;
+}
+
+void yagl_host_eglWaitClient(void)
+{
+ struct yagl_egl_surface *sfc = NULL;
+
+ if (!egl_api_ts->context) {
+ return;
+ }
+
+ sfc = egl_api_ts->context->draw;
+
+ if (!sfc) {
+ return;
+ }
+
+ sfc->backend_sfc->wait_gl(sfc->backend_sfc);
+}
+
+EGLBoolean yagl_host_eglReleaseThread(EGLint *error)
+{
+ EGLBoolean res = EGL_FALSE;
+
+ YAGL_LOG_FUNC_SET(eglReleaseThread);
+
+ if (egl_api_ts->context) {
+ if (!yagl_egl_release_current_context(egl_api_ts->context->dpy)) {
+ YAGL_SET_ERR(EGL_BAD_ACCESS);
+ goto out;
+ }
+ }
+
+ yagl_egl_api_ts_reset(egl_api_ts);
+
+ res = EGL_TRUE;
+
+out:
+ return res;
+}
+
+EGLBoolean yagl_host_eglSurfaceAttrib(yagl_host_handle dpy_,
+ yagl_host_handle surface_,
+ EGLint attribute,
+ EGLint value,
+ EGLint *error)
+{
+ EGLBoolean res = EGL_FALSE;
+ struct yagl_egl_display *dpy = NULL;
+ struct yagl_egl_surface *surface = NULL;
+
+ if (!yagl_validate_display(dpy_, &dpy, error)) {
+ goto out;
+ }
+
+ if (!yagl_validate_surface(dpy, surface_, &surface, error)) {
+ goto out;
+ }
+
+ /*
+ * TODO: implement.
+ */
+
+ res = EGL_TRUE;
+
+out:
+ yagl_egl_surface_release(surface);
+
+ return res;
+}
+
+yagl_host_handle yagl_host_eglCreateContext(yagl_host_handle dpy_,
+ yagl_host_handle config_,
+ yagl_host_handle share_context_,
+ const EGLint *attrib_list, int32_t attrib_list_count,
+ EGLint *error)
+{
+ yagl_host_handle res = 0;
+ struct yagl_egl_display *dpy = NULL;
+ struct yagl_egl_config *config = NULL;
+ struct yagl_egl_context *share_context = NULL;
+ struct yagl_egl_context *ctx = NULL;
+
+ YAGL_LOG_FUNC_SET(eglCreateContext);
+
+ if (!yagl_validate_display(dpy_, &dpy, error)) {
+ goto out;
+ }
+
+ if (!yagl_validate_config(dpy, config_, &config, error)) {
+ goto out;
+ }
+
+ if (share_context_) {
+ if (!yagl_validate_context(dpy, share_context_, &share_context, error)) {
+ goto out;
+ }
+ }
+
+ ctx = yagl_egl_context_create(dpy,
+ config,
+ (share_context ? share_context->backend_ctx
+ : NULL));
+
+ if (!ctx) {
+ YAGL_SET_ERR(EGL_BAD_MATCH);
+ goto out;
+ }
+
+ yagl_egl_display_add_context(dpy, ctx);
+ yagl_egl_context_release(ctx);
+
+ res = ctx->res.handle;
+
+out:
+ yagl_egl_context_release(share_context);
+ yagl_egl_config_release(config);
+
+ return res;
+}
+
+EGLBoolean yagl_host_eglDestroyContext(yagl_host_handle dpy_,
+ yagl_host_handle ctx_,
+ EGLint *error)
+{
+ EGLBoolean res = EGL_FALSE;
+ struct yagl_egl_display *dpy = NULL;
+ struct yagl_egl_context *ctx = NULL;
+
+ YAGL_LOG_FUNC_SET(eglDestroyContext);
+
+ if (!yagl_validate_display(dpy_, &dpy, error)) {
+ goto out;
+ }
+
+ if (!yagl_validate_context(dpy, ctx_, &ctx, error)) {
+ goto out;
+ }
+
+ if (yagl_egl_display_remove_context(dpy, ctx->res.handle)) {
+ res = EGL_TRUE;
+ } else {
+ YAGL_SET_ERR(EGL_BAD_CONTEXT);
+ }
+
+out:
+ yagl_egl_context_release(ctx);
+
+ return res;
+}
+
+void yagl_host_eglMakeCurrent(yagl_host_handle dpy_,
+ yagl_host_handle draw_,
+ yagl_host_handle read_,
+ yagl_host_handle ctx_)
+{
+ EGLint error = 0;
+ bool release_context = !draw_ && !read_ && !ctx_;
+ struct yagl_egl_display *dpy = NULL;
+ struct yagl_egl_context *prev_ctx = NULL;
+ struct yagl_egl_context *ctx = NULL;
+ struct yagl_egl_surface *draw = NULL;
+ struct yagl_egl_surface *read = NULL;
+
+ YAGL_LOG_FUNC_SET(eglMakeCurrent);
+
+ if (!yagl_validate_display(dpy_, &dpy, &error)) {
+ goto out;
+ }
+
+ prev_ctx = egl_api_ts->context;
+ yagl_egl_context_acquire(prev_ctx);
+
+ if (release_context) {
+ if (!yagl_egl_release_current_context(dpy)) {
+ YAGL_LOG_ERROR("cannot release current context");
+ goto out;
+ }
+ } else {
+ if (!yagl_validate_context(dpy, ctx_, &ctx, &error)) {
+ goto out;
+ }
+
+ if (draw_ && !yagl_validate_surface(dpy, draw_, &draw, &error)) {
+ goto out;
+ }
+
+ if (read_ && !yagl_validate_surface(dpy, read_, &read, &error)) {
+ goto out;
+ }
+
+ if (prev_ctx != ctx) {
+ /*
+ * Previous context must be detached from its surfaces.
+ */
+
+ release_context = true;
+ }
+
+ if (!egl_api_ts->backend->make_current(egl_api_ts->backend,
+ dpy->backend_dpy,
+ ctx->backend_ctx,
+ (draw ? draw->backend_sfc : NULL),
+ (read ? read->backend_sfc : NULL))) {
+ YAGL_LOG_ERROR("make_current failed");
+ goto out;
+ }
+
+ yagl_egl_context_update_surfaces(ctx, draw, read);
+
+ yagl_egl_api_ts_update_context(egl_api_ts, ctx);
+ }
+
+ if (release_context && prev_ctx) {
+ yagl_egl_context_update_surfaces(prev_ctx, NULL, NULL);
+ }
+
+ YAGL_LOG_TRACE("Context switched (%u, %u, %u, %u)",
+ dpy_,
+ draw_,
+ read_,
+ ctx_);
+
+out:
+ yagl_egl_surface_release(read);
+ yagl_egl_surface_release(draw);
+ yagl_egl_context_release(ctx);
+ yagl_egl_context_release(prev_ctx);
+}
+
+EGLBoolean yagl_host_eglQueryContext(yagl_host_handle dpy_,
+ yagl_host_handle ctx_,
+ EGLint attribute,
+ EGLint *value,
+ EGLint *error)
+{
+ EGLBoolean res = EGL_FALSE;
+ struct yagl_egl_display *dpy = NULL;
+ struct yagl_egl_context *ctx = NULL;
+
+ YAGL_LOG_FUNC_SET(eglQueryContext);
+
+ if (!yagl_validate_display(dpy_, &dpy, error)) {
+ goto out;
+ }
+
+ if (!yagl_validate_context(dpy, ctx_, &ctx, error)) {
+ goto out;
+ }
+
+ switch (attribute) {
+ case EGL_CONFIG_ID:
+ if (value) {
+ *value = ctx->cfg->native.config_id;
+ }
+ break;
+ case EGL_RENDER_BUFFER:
+ if (ctx->draw) {
+ switch (ctx->draw->backend_sfc->type) {
+ case EGL_PBUFFER_BIT:
+ case EGL_WINDOW_BIT:
+ if (value) {
+ *value = EGL_BACK_BUFFER;
+ }
+ break;
+ case EGL_PIXMAP_BIT:
+ if (value) {
+ *value = EGL_SINGLE_BUFFER;
+ }
+ break;
+ default:
+ if (value) {
+ *value = EGL_NONE;
+ }
+ break;
+ }
+ } else if (value) {
+ *value = EGL_NONE;
+ }
+ break;
+ default:
+ YAGL_SET_ERR(EGL_BAD_ATTRIBUTE);
+ goto out;
+ }
+
+ res = EGL_TRUE;
+
+out:
+ yagl_egl_context_release(ctx);
+
+ return res;
+}
+
+EGLBoolean yagl_host_eglSwapBuffers(yagl_host_handle dpy_,
+ yagl_host_handle surface_,
+ EGLint *error)
+{
+ EGLBoolean res = EGL_FALSE;
+ struct yagl_egl_display *dpy = NULL;
+ struct yagl_egl_surface *surface = NULL;
+
+ YAGL_LOG_FUNC_SET(eglSwapBuffers);
+
+ if (!yagl_validate_display(dpy_, &dpy, error)) {
+ goto out;
+ }
+
+ if (!yagl_validate_surface(dpy, surface_, &surface, error)) {
+ goto out;
+ }
+
+ if (!surface->backend_sfc->swap_buffers(surface->backend_sfc)) {
+ YAGL_SET_ERR(EGL_BAD_ALLOC);
+ goto out;
+ }
+
+ res = EGL_TRUE;
+
+out:
+ yagl_egl_surface_release(surface);
+
+ return res;
+}
+
+EGLBoolean yagl_host_eglCopyBuffers(yagl_host_handle dpy_,
+ yagl_host_handle surface_,
+ EGLint *error)
+{
+ EGLBoolean res = EGL_FALSE;
+ struct yagl_egl_display *dpy = NULL;
+ struct yagl_egl_surface *surface = NULL;
+
+ YAGL_LOG_FUNC_SET(eglCopyBuffers);
+
+ if (!yagl_validate_display(dpy_, &dpy, error)) {
+ goto out;
+ }
+
+ if (!yagl_validate_surface(dpy, surface_, &surface, error)) {
+ goto out;
+ }
+
+ if (!surface->backend_sfc->copy_buffers(surface->backend_sfc)) {
+ YAGL_SET_ERR(EGL_BAD_NATIVE_PIXMAP);
+ goto out;
+ }
+
+ res = EGL_TRUE;
+
+out:
+ yagl_egl_surface_release(surface);
+
+ return res;
+}
+
+yagl_host_handle yagl_host_eglCreateWindowSurfaceOffscreenYAGL(yagl_host_handle dpy_,
+ yagl_host_handle config_,
+ uint32_t width,
+ uint32_t height,
+ uint32_t bpp,
+ target_ulong pixels,
+ const EGLint *attrib_list, int32_t attrib_list_count,
+ EGLint *error)
+{
+ yagl_host_handle res = 0;
+ struct yagl_eglb_surface *backend_sfc = NULL;
+ struct yagl_egl_window_attribs attribs;
+ int i = 0;
+ struct yagl_egl_display *dpy = NULL;
+ struct yagl_egl_config *config = NULL;
+ struct yagl_egl_surface *surface = NULL;
+
+ YAGL_LOG_FUNC_SET(eglCreateWindowSurfaceOffscreenYAGL);
+
+ yagl_egl_window_attribs_init(&attribs);
+
+ if (!yagl_egl_is_attrib_list_empty(attrib_list)) {
+ while (attrib_list[i] != EGL_NONE) {
+ switch (attrib_list[i]) {
+ case EGL_RENDER_BUFFER:
+ break;
+ default:
+ YAGL_SET_ERR(EGL_BAD_ATTRIBUTE);
+ goto out;
+ }
+
+ i += 2;
+ }
+ }
+
+ if (!yagl_validate_display(dpy_, &dpy, error)) {
+ goto out;
+ }
+
+ if (!yagl_validate_config(dpy, config_, &config, error)) {
+ goto out;
+ }
+
+ if (!dpy->backend_dpy->create_offscreen_surface) {
+ YAGL_LOG_CRITICAL("Offscreen surfaces not supported");
+ YAGL_SET_ERR(EGL_BAD_NATIVE_WINDOW);
+ goto out;
+ }
+
+ backend_sfc = dpy->backend_dpy->create_offscreen_surface(dpy->backend_dpy,
+ &config->native,
+ EGL_WINDOW_BIT,
+ &attribs,
+ width,
+ height,
+ bpp,
+ pixels);
+
+ if (!backend_sfc) {
+ YAGL_SET_ERR(EGL_BAD_NATIVE_WINDOW);
+ goto out;
+ }
+
+ surface = yagl_egl_surface_create(dpy, config, backend_sfc);
+
+ if (!surface) {
+ YAGL_SET_ERR(EGL_BAD_ALLOC);
+ goto out;
+ }
+
+ /*
+ * Owned by 'surface' now.
+ */
+ backend_sfc = NULL;
+
+ yagl_egl_display_add_surface(dpy, surface);
+ yagl_egl_surface_release(surface);
+
+ res = surface->res.handle;
+
+out:
+ yagl_egl_config_release(config);
+ if (backend_sfc) {
+ backend_sfc->destroy(backend_sfc);
+ }
+
+ return res;
+}
+
+yagl_host_handle yagl_host_eglCreatePbufferSurfaceOffscreenYAGL(yagl_host_handle dpy_,
+ yagl_host_handle config_,
+ uint32_t width,
+ uint32_t height,
+ uint32_t bpp,
+ target_ulong pixels,
+ const EGLint *attrib_list, int32_t attrib_list_count,
+ EGLint *error)
+{
+ yagl_host_handle res = 0;
+ struct yagl_eglb_surface *backend_sfc = NULL;
+ struct yagl_egl_pbuffer_attribs attribs;
+ struct yagl_egl_display *dpy = NULL;
+ struct yagl_egl_config *config = NULL;
+ struct yagl_egl_surface *surface = NULL;
+ int i = 0;
+
+ YAGL_LOG_FUNC_SET(eglCreatePbufferSurfaceOffscreenYAGL);
+
+ yagl_egl_pbuffer_attribs_init(&attribs);
+
+ if (!yagl_egl_is_attrib_list_empty(attrib_list)) {
+ while (attrib_list[i] != EGL_NONE) {
+ switch (attrib_list[i]) {
+ case EGL_LARGEST_PBUFFER:
+ attribs.largest = (attrib_list[i + 1] ? EGL_TRUE : EGL_FALSE);
+ break;
+ case EGL_MIPMAP_TEXTURE:
+ attribs.tex_mipmap = (attrib_list[i + 1] ? EGL_TRUE : EGL_FALSE);
+ break;
+ case EGL_TEXTURE_FORMAT:
+ switch (attrib_list[i + 1]) {
+ case EGL_NO_TEXTURE:
+ case EGL_TEXTURE_RGB:
+ case EGL_TEXTURE_RGBA:
+ attribs.tex_format = attrib_list[i + 1];
+ break;
+ default:
+ YAGL_SET_ERR(EGL_BAD_ATTRIBUTE);
+ goto out;
+ }
+ break;
+ case EGL_TEXTURE_TARGET:
+ switch (attrib_list[i + 1]) {
+ case EGL_NO_TEXTURE:
+ case EGL_TEXTURE_2D:
+ attribs.tex_target = attrib_list[i + 1];
+ break;
+ default:
+ YAGL_SET_ERR(EGL_BAD_ATTRIBUTE);
+ goto out;
+ }
+ break;
+ case EGL_HEIGHT:
+ case EGL_WIDTH:
+ break;
+ default:
+ YAGL_SET_ERR(EGL_BAD_ATTRIBUTE);
+ goto out;
+ }
+
+ i += 2;
+ }
+ }
+
+ if (!yagl_validate_display(dpy_, &dpy, error)) {
+ goto out;
+ }
+
+ if (!yagl_validate_config(dpy, config_, &config, error)) {
+ goto out;
+ }
+
+ if (!dpy->backend_dpy->create_offscreen_surface) {
+ YAGL_LOG_CRITICAL("Offscreen surfaces not supported");
+ YAGL_SET_ERR(EGL_BAD_ALLOC);
+ goto out;
+ }
+
+ backend_sfc = dpy->backend_dpy->create_offscreen_surface(dpy->backend_dpy,
+ &config->native,
+ EGL_PBUFFER_BIT,
+ &attribs,
+ width,
+ height,
+ bpp,
+ pixels);
+
+ if (!backend_sfc) {
+ YAGL_SET_ERR(EGL_BAD_ALLOC);
+ goto out;
+ }
+
+ surface = yagl_egl_surface_create(dpy, config, backend_sfc);
+
+ if (!surface) {
+ YAGL_SET_ERR(EGL_BAD_ALLOC);
+ goto out;
+ }
+
+ /*
+ * Owned by 'surface' now.
+ */
+ backend_sfc = NULL;
+
+ yagl_egl_display_add_surface(dpy, surface);
+ yagl_egl_surface_release(surface);
+
+ res = surface->res.handle;
+
+out:
+ yagl_egl_config_release(config);
+ if (backend_sfc) {
+ backend_sfc->destroy(backend_sfc);
+ }
+
+ return res;
+}
+
+yagl_host_handle yagl_host_eglCreatePixmapSurfaceOffscreenYAGL(yagl_host_handle dpy_,
+ yagl_host_handle config_,
+ uint32_t width,
+ uint32_t height,
+ uint32_t bpp,
+ target_ulong pixels,
+ const EGLint *attrib_list, int32_t attrib_list_count,
+ EGLint *error)
+{
+ yagl_host_handle res = 0;
+ struct yagl_eglb_surface *backend_sfc = NULL;
+ struct yagl_egl_pixmap_attribs attribs;
+ struct yagl_egl_display *dpy = NULL;
+ struct yagl_egl_config *config = NULL;
+ struct yagl_egl_surface *surface = NULL;
+
+ YAGL_LOG_FUNC_SET(eglCreatePixmapSurfaceOffscreenYAGL);
+
+ yagl_egl_pixmap_attribs_init(&attribs);
+
+ if (!yagl_egl_is_attrib_list_empty(attrib_list)) {
+ YAGL_SET_ERR(EGL_BAD_ATTRIBUTE);
+ goto out;
+ }
+
+ if (!yagl_validate_display(dpy_, &dpy, error)) {
+ goto out;
+ }
+
+ if (!yagl_validate_config(dpy, config_, &config, error)) {
+ goto out;
+ }
+
+ if (!dpy->backend_dpy->create_offscreen_surface) {
+ YAGL_LOG_CRITICAL("Offscreen surfaces not supported");
+ YAGL_SET_ERR(EGL_BAD_NATIVE_PIXMAP);
+ goto out;
+ }
+
+ backend_sfc = dpy->backend_dpy->create_offscreen_surface(dpy->backend_dpy,
+ &config->native,
+ EGL_PIXMAP_BIT,
+ &attribs,
+ width,
+ height,
+ bpp,
+ pixels);
+
+ if (!backend_sfc) {
+ YAGL_SET_ERR(EGL_BAD_NATIVE_PIXMAP);
+ goto out;
+ }
+
+ surface = yagl_egl_surface_create(dpy, config, backend_sfc);
+
+ if (!surface) {
+ YAGL_SET_ERR(EGL_BAD_NATIVE_PIXMAP);
+ goto out;
+ }
+
+ /*
+ * Owned by 'surface' now.
+ */
+ backend_sfc = NULL;
+
+ yagl_egl_display_add_surface(dpy, surface);
+ yagl_egl_surface_release(surface);
+
+ res = surface->res.handle;
+
+out:
+ yagl_egl_config_release(config);
+ if (backend_sfc) {
+ backend_sfc->destroy(backend_sfc);
+ }
+
+ return res;
+}
+
+EGLBoolean yagl_host_eglResizeOffscreenSurfaceYAGL(yagl_host_handle dpy_,
+ yagl_host_handle surface_,
+ uint32_t width,
+ uint32_t height,
+ uint32_t bpp,
+ target_ulong pixels,
+ EGLint *error)
+{
+ EGLBoolean res = EGL_FALSE;
+ struct yagl_egl_display *dpy = NULL;
+ struct yagl_egl_surface *surface = NULL;
+ struct yagl_eglb_surface *backend_sfc = NULL;
+ struct yagl_eglb_surface *draw_sfc = NULL;
+ struct yagl_eglb_surface *read_sfc = NULL;
+
+ YAGL_LOG_FUNC_SET(eglResizeOffscreenSurfaceYAGL);
+
+ if (!yagl_validate_display(dpy_, &dpy, error)) {
+ goto out;
+ }
+
+ if (!yagl_validate_surface(dpy, surface_, &surface, error)) {
+ goto out;
+ }
+
+ if (!dpy->backend_dpy->create_offscreen_surface) {
+ YAGL_LOG_CRITICAL("Offscreen surfaces not supported");
+ YAGL_SET_ERR(EGL_BAD_ALLOC);
+ goto out;
+ }
+
+ backend_sfc = dpy->backend_dpy->create_offscreen_surface(dpy->backend_dpy,
+ &surface->cfg->native,
+ surface->backend_sfc->type,
+ &surface->backend_sfc->attribs,
+ width,
+ height,
+ bpp,
+ pixels);
+
+ if (!backend_sfc) {
+ YAGL_SET_ERR(EGL_BAD_ALLOC);
+ goto out;
+ }
+
+ if (egl_api_ts->context->draw) {
+ if (egl_api_ts->context->draw == surface) {
+ draw_sfc = backend_sfc;
+ } else {
+ draw_sfc = egl_api_ts->context->draw->backend_sfc;
+ }
+ }
+
+ if (egl_api_ts->context->read) {
+ if (egl_api_ts->context->read == surface) {
+ read_sfc = backend_sfc;
+ } else {
+ read_sfc = egl_api_ts->context->read->backend_sfc;
+ }
+ }
+
+ if (!egl_api_ts->backend->make_current(egl_api_ts->backend,
+ dpy->backend_dpy,
+ egl_api_ts->context->backend_ctx,
+ draw_sfc,
+ read_sfc)) {
+ YAGL_LOG_ERROR("make_current failed");
+ YAGL_SET_ERR(EGL_BAD_ALLOC);
+ goto out;
+ }
+
+ surface->backend_sfc->replace(surface->backend_sfc, backend_sfc);
+
+ backend_sfc = NULL;
+
+ res = EGL_TRUE;
+
+out:
+ if (backend_sfc) {
+ backend_sfc->destroy(backend_sfc);
+ }
+ yagl_egl_surface_release(surface);
+
+ return res;
+}
+
+yagl_host_handle yagl_host_eglCreateWindowSurfaceOnscreenYAGL(yagl_host_handle dpy_,
+ yagl_host_handle config_,
+ yagl_winsys_id win,
+ const EGLint *attrib_list, int32_t attrib_list_count,
+ EGLint *error)
+{
+ yagl_host_handle res = 0;
+ struct yagl_eglb_surface *backend_sfc = NULL;
+ struct yagl_egl_window_attribs attribs;
+ int i = 0;
+ struct yagl_egl_display *dpy = NULL;
+ struct yagl_egl_config *config = NULL;
+ struct yagl_egl_surface *surface = NULL;
+
+ YAGL_LOG_FUNC_SET(eglCreateWindowSurfaceOnscreenYAGL);
+
+ yagl_egl_window_attribs_init(&attribs);
+
+ if (!yagl_egl_is_attrib_list_empty(attrib_list)) {
+ while (attrib_list[i] != EGL_NONE) {
+ switch (attrib_list[i]) {
+ case EGL_RENDER_BUFFER:
+ break;
+ default:
+ YAGL_SET_ERR(EGL_BAD_ATTRIBUTE);
+ goto out;
+ }
+
+ i += 2;
+ }
+ }
+
+ if (!yagl_validate_display(dpy_, &dpy, error)) {
+ goto out;
+ }
+
+ if (!yagl_validate_config(dpy, config_, &config, error)) {
+ goto out;
+ }
+
+ if (!dpy->backend_dpy->create_onscreen_window_surface) {
+ YAGL_LOG_CRITICAL("Onscreen window surfaces not supported");
+ YAGL_SET_ERR(EGL_BAD_NATIVE_WINDOW);
+ goto out;
+ }
+
+ backend_sfc = dpy->backend_dpy->create_onscreen_window_surface(dpy->backend_dpy,
+ &config->native,
+ &attribs,
+ win);
+
+ if (!backend_sfc) {
+ YAGL_LOG_ERROR("Unable to create window surface for 0x%X", win);
+ YAGL_SET_ERR(EGL_BAD_NATIVE_WINDOW);
+ goto out;
+ }
+
+ surface = yagl_egl_surface_create(dpy, config, backend_sfc);
+
+ if (!surface) {
+ YAGL_SET_ERR(EGL_BAD_ALLOC);
+ goto out;
+ }
+
+ /*
+ * Owned by 'surface' now.
+ */
+ backend_sfc = NULL;
+
+ yagl_egl_display_add_surface(dpy, surface);
+ yagl_egl_surface_release(surface);
+
+ res = surface->res.handle;
+
+out:
+ yagl_egl_config_release(config);
+ if (backend_sfc) {
+ backend_sfc->destroy(backend_sfc);
+ }
+
+ return res;
+}
+
+yagl_host_handle yagl_host_eglCreatePbufferSurfaceOnscreenYAGL(yagl_host_handle dpy_,
+ yagl_host_handle config_,
+ yagl_winsys_id buffer,
+ const EGLint *attrib_list, int32_t attrib_list_count,
+ EGLint *error)
+{
+ yagl_host_handle res = 0;
+ struct yagl_eglb_surface *backend_sfc = NULL;
+ struct yagl_egl_pbuffer_attribs attribs;
+ struct yagl_egl_display *dpy = NULL;
+ struct yagl_egl_config *config = NULL;
+ struct yagl_egl_surface *surface = NULL;
+ int i = 0;
+
+ YAGL_LOG_FUNC_SET(eglCreatePbufferSurfaceOnscreenYAGL);
+
+ yagl_egl_pbuffer_attribs_init(&attribs);
+
+ if (!yagl_egl_is_attrib_list_empty(attrib_list)) {
+ while (attrib_list[i] != EGL_NONE) {
+ switch (attrib_list[i]) {
+ case EGL_LARGEST_PBUFFER:
+ attribs.largest = (attrib_list[i + 1] ? EGL_TRUE : EGL_FALSE);
+ break;
+ case EGL_MIPMAP_TEXTURE:
+ attribs.tex_mipmap = (attrib_list[i + 1] ? EGL_TRUE : EGL_FALSE);
+ break;
+ case EGL_TEXTURE_FORMAT:
+ switch (attrib_list[i + 1]) {
+ case EGL_NO_TEXTURE:
+ case EGL_TEXTURE_RGB:
+ case EGL_TEXTURE_RGBA:
+ attribs.tex_format = attrib_list[i + 1];
+ break;
+ default:
+ YAGL_SET_ERR(EGL_BAD_ATTRIBUTE);
+ goto out;
+ }
+ break;
+ case EGL_TEXTURE_TARGET:
+ switch (attrib_list[i + 1]) {
+ case EGL_NO_TEXTURE:
+ case EGL_TEXTURE_2D:
+ attribs.tex_target = attrib_list[i + 1];
+ break;
+ default:
+ YAGL_SET_ERR(EGL_BAD_ATTRIBUTE);
+ goto out;
+ }
+ break;
+ case EGL_HEIGHT:
+ case EGL_WIDTH:
+ break;
+ default:
+ YAGL_SET_ERR(EGL_BAD_ATTRIBUTE);
+ goto out;
+ }
+
+ i += 2;
+ }
+ }
+
+ if (!yagl_validate_display(dpy_, &dpy, error)) {
+ goto out;
+ }
+
+ if (!yagl_validate_config(dpy, config_, &config, error)) {
+ goto out;
+ }
+
+ if (!dpy->backend_dpy->create_onscreen_pbuffer_surface) {
+ YAGL_LOG_CRITICAL("Onscreen pbuffer surfaces not supported");
+ YAGL_SET_ERR(EGL_BAD_ALLOC);
+ goto out;
+ }
+
+ backend_sfc = dpy->backend_dpy->create_onscreen_pbuffer_surface(dpy->backend_dpy,
+ &config->native,
+ &attribs,
+ buffer);
+
+ if (!backend_sfc) {
+ YAGL_SET_ERR(EGL_BAD_ALLOC);
+ goto out;
+ }
+
+ surface = yagl_egl_surface_create(dpy, config, backend_sfc);
+
+ if (!surface) {
+ YAGL_SET_ERR(EGL_BAD_ALLOC);
+ goto out;
+ }
+
+ /*
+ * Owned by 'surface' now.
+ */
+ backend_sfc = NULL;
+
+ yagl_egl_display_add_surface(dpy, surface);
+ yagl_egl_surface_release(surface);
+
+ res = surface->res.handle;
+
+out:
+ yagl_egl_config_release(config);
+ if (backend_sfc) {
+ backend_sfc->destroy(backend_sfc);
+ }
+
+ return res;
+}
+
+yagl_host_handle yagl_host_eglCreatePixmapSurfaceOnscreenYAGL(yagl_host_handle dpy_,
+ yagl_host_handle config_,
+ yagl_winsys_id pixmap,
+ const EGLint *attrib_list, int32_t attrib_list_count,
+ EGLint *error)
+{
+ yagl_host_handle res = 0;
+ struct yagl_eglb_surface *backend_sfc = NULL;
+ struct yagl_egl_pixmap_attribs attribs;
+ struct yagl_egl_display *dpy = NULL;
+ struct yagl_egl_config *config = NULL;
+ struct yagl_egl_surface *surface = NULL;
+
+ YAGL_LOG_FUNC_SET(eglCreatePixmapSurfaceOnscreenYAGL);
+
+ yagl_egl_pixmap_attribs_init(&attribs);
+
+ if (!yagl_egl_is_attrib_list_empty(attrib_list)) {
+ YAGL_SET_ERR(EGL_BAD_ATTRIBUTE);
+ goto out;
+ }
+
+ if (!yagl_validate_display(dpy_, &dpy, error)) {
+ goto out;
+ }
+
+ if (!yagl_validate_config(dpy, config_, &config, error)) {
+ goto out;
+ }
+
+ if (!dpy->backend_dpy->create_onscreen_pixmap_surface) {
+ YAGL_LOG_CRITICAL("Onscreen pixmap surfaces not supported");
+ YAGL_SET_ERR(EGL_BAD_NATIVE_PIXMAP);
+ goto out;
+ }
+
+ backend_sfc = dpy->backend_dpy->create_onscreen_pixmap_surface(dpy->backend_dpy,
+ &config->native,
+ &attribs,
+ pixmap);
+
+ if (!backend_sfc) {
+ YAGL_LOG_ERROR("Unable to create pixmap surface for 0x%X", pixmap);
+ YAGL_SET_ERR(EGL_BAD_NATIVE_PIXMAP);
+ goto out;
+ }
+
+ surface = yagl_egl_surface_create(dpy, config, backend_sfc);
+
+ if (!surface) {
+ YAGL_SET_ERR(EGL_BAD_NATIVE_PIXMAP);
+ goto out;
+ }
+
+ /*
+ * Owned by 'surface' now.
+ */
+ backend_sfc = NULL;
+
+ yagl_egl_display_add_surface(dpy, surface);
+ yagl_egl_surface_release(surface);
+
+ res = surface->res.handle;
+
+out:
+ yagl_egl_config_release(config);
+ if (backend_sfc) {
+ backend_sfc->destroy(backend_sfc);
+ }
+
+ return res;
+}
+
+void yagl_host_eglInvalidateOnscreenSurfaceYAGL(yagl_host_handle dpy_,
+ yagl_host_handle surface_,
+ yagl_winsys_id buffer)
+{
+ EGLint error = 0;
+ struct yagl_egl_display *dpy = NULL;
+ struct yagl_egl_surface *surface = NULL;
+
+ if (!yagl_validate_display(dpy_, &dpy, &error)) {
+ goto out;
+ }
+
+ if (!yagl_validate_surface(dpy, surface_, &surface, &error)) {
+ goto out;
+ }
+
+ surface->backend_sfc->invalidate(surface->backend_sfc, buffer);
+
+out:
+ yagl_egl_surface_release(surface);
+}
+
+EGLBoolean yagl_host_eglCreateImageYAGL(uint32_t texture,
+ yagl_host_handle dpy_,
+ yagl_winsys_id buffer,
+ EGLint *error)
+{
+ EGLBoolean res = EGL_FALSE;
+ struct yagl_egl_display *dpy = NULL;
+ struct yagl_object *image;
+
+ YAGL_LOG_FUNC_SET(eglCreateImageYAGL);
+
+ if (!yagl_validate_display(dpy_, &dpy, error)) {
+ goto out;
+ }
+
+ image = dpy->backend_dpy->create_image(dpy->backend_dpy, buffer);
+
+ if (!image) {
+ YAGL_SET_ERR(EGL_BAD_ALLOC);
+ goto out;
+ }
+
+ yagl_object_map_add(cur_ts->ps->object_map, texture, image);
+
+ res = EGL_TRUE;
+
+out:
+ return res;
+}
diff --git a/hw/yagl/yagl_apis/egl/yagl_host_egl_calls.h b/hw/yagl/yagl_apis/egl/yagl_host_egl_calls.h
new file mode 100644
index 0000000000..306c117ccd
--- /dev/null
+++ b/hw/yagl/yagl_apis/egl/yagl_host_egl_calls.h
@@ -0,0 +1,151 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_HOST_EGL_CALLS_H
+#define _QEMU_YAGL_HOST_EGL_CALLS_H
+
+#include "yagl_api.h"
+#include <EGL/egl.h>
+
+struct yagl_api_ps *yagl_host_egl_process_init(struct yagl_api *api);
+
+yagl_host_handle yagl_host_eglGetDisplay(uint32_t display_id,
+ EGLint *error);
+EGLBoolean yagl_host_eglInitialize(yagl_host_handle dpy,
+ EGLint *major,
+ EGLint *minor,
+ EGLint *error);
+EGLBoolean yagl_host_eglTerminate(yagl_host_handle dpy,
+ EGLint *error);
+EGLBoolean yagl_host_eglGetConfigs(yagl_host_handle dpy,
+ yagl_host_handle *configs, int32_t configs_maxcount, int32_t *configs_count,
+ EGLint *error);
+EGLBoolean yagl_host_eglChooseConfig(yagl_host_handle dpy,
+ const EGLint *attrib_list, int32_t attrib_list_count,
+ yagl_host_handle *configs, int32_t configs_maxcount, int32_t *configs_count,
+ EGLint *error);
+EGLBoolean yagl_host_eglGetConfigAttrib(yagl_host_handle dpy,
+ yagl_host_handle config,
+ EGLint attribute,
+ EGLint *value,
+ EGLint *error);
+EGLBoolean yagl_host_eglDestroySurface(yagl_host_handle dpy,
+ yagl_host_handle surface,
+ EGLint *error);
+EGLBoolean yagl_host_eglQuerySurface(yagl_host_handle dpy,
+ yagl_host_handle surface,
+ EGLint attribute,
+ EGLint *value,
+ EGLint *error);
+void yagl_host_eglBindAPI(EGLenum api);
+void yagl_host_eglWaitClient(void);
+EGLBoolean yagl_host_eglReleaseThread(EGLint *error);
+EGLBoolean yagl_host_eglSurfaceAttrib(yagl_host_handle dpy,
+ yagl_host_handle surface,
+ EGLint attribute,
+ EGLint value,
+ EGLint *error);
+yagl_host_handle yagl_host_eglCreateContext(yagl_host_handle dpy,
+ yagl_host_handle config,
+ yagl_host_handle share_context,
+ const EGLint *attrib_list, int32_t attrib_list_count,
+ EGLint *error);
+EGLBoolean yagl_host_eglDestroyContext(yagl_host_handle dpy,
+ yagl_host_handle ctx,
+ EGLint *error);
+void yagl_host_eglMakeCurrent(yagl_host_handle dpy,
+ yagl_host_handle draw,
+ yagl_host_handle read,
+ yagl_host_handle ctx);
+EGLBoolean yagl_host_eglQueryContext(yagl_host_handle dpy,
+ yagl_host_handle ctx,
+ EGLint attribute,
+ EGLint *value,
+ EGLint *error);
+EGLBoolean yagl_host_eglSwapBuffers(yagl_host_handle dpy,
+ yagl_host_handle surface,
+ EGLint *error);
+EGLBoolean yagl_host_eglCopyBuffers(yagl_host_handle dpy,
+ yagl_host_handle surface,
+ EGLint *error);
+yagl_host_handle yagl_host_eglCreateWindowSurfaceOffscreenYAGL(yagl_host_handle dpy,
+ yagl_host_handle config,
+ uint32_t width,
+ uint32_t height,
+ uint32_t bpp,
+ target_ulong pixels,
+ const EGLint *attrib_list, int32_t attrib_list_count,
+ EGLint *error);
+yagl_host_handle yagl_host_eglCreatePbufferSurfaceOffscreenYAGL(yagl_host_handle dpy,
+ yagl_host_handle config,
+ uint32_t width,
+ uint32_t height,
+ uint32_t bpp,
+ target_ulong pixels,
+ const EGLint *attrib_list, int32_t attrib_list_count,
+ EGLint *error);
+yagl_host_handle yagl_host_eglCreatePixmapSurfaceOffscreenYAGL(yagl_host_handle dpy,
+ yagl_host_handle config,
+ uint32_t width,
+ uint32_t height,
+ uint32_t bpp,
+ target_ulong pixels,
+ const EGLint *attrib_list, int32_t attrib_list_count,
+ EGLint *error);
+EGLBoolean yagl_host_eglResizeOffscreenSurfaceYAGL(yagl_host_handle dpy,
+ yagl_host_handle surface,
+ uint32_t width,
+ uint32_t height,
+ uint32_t bpp,
+ target_ulong pixels,
+ EGLint *error);
+yagl_host_handle yagl_host_eglCreateWindowSurfaceOnscreenYAGL(yagl_host_handle dpy,
+ yagl_host_handle config,
+ yagl_winsys_id win,
+ const EGLint *attrib_list, int32_t attrib_list_count,
+ EGLint *error);
+yagl_host_handle yagl_host_eglCreatePbufferSurfaceOnscreenYAGL(yagl_host_handle dpy,
+ yagl_host_handle config,
+ yagl_winsys_id buffer,
+ const EGLint *attrib_list, int32_t attrib_list_count,
+ EGLint *error);
+yagl_host_handle yagl_host_eglCreatePixmapSurfaceOnscreenYAGL(yagl_host_handle dpy,
+ yagl_host_handle config,
+ yagl_winsys_id pixmap,
+ const EGLint *attrib_list, int32_t attrib_list_count,
+ EGLint *error);
+void yagl_host_eglInvalidateOnscreenSurfaceYAGL(yagl_host_handle dpy,
+ yagl_host_handle surface,
+ yagl_winsys_id buffer);
+EGLBoolean yagl_host_eglCreateImageYAGL(uint32_t texture,
+ yagl_host_handle dpy,
+ yagl_winsys_id buffer,
+ EGLint *error);
+
+#endif
diff --git a/hw/yagl/yagl_apis/gles/Makefile.objs b/hw/yagl/yagl_apis/gles/Makefile.objs
new file mode 100644
index 0000000000..1147c7f063
--- /dev/null
+++ b/hw/yagl/yagl_apis/gles/Makefile.objs
@@ -0,0 +1,6 @@
+# GLES api
+obj-y += yagl_gles_api.o
+obj-y += yagl_gles_api_ps.o
+obj-y += yagl_gles_api_ts.o
+obj-y += yagl_gles_calls.o
+obj-y += yagl_host_gles_calls.o
diff --git a/hw/yagl/yagl_apis/gles/yagl_gles_api.c b/hw/yagl/yagl_apis/gles/yagl_gles_api.c
new file mode 100644
index 0000000000..af0eb99c2e
--- /dev/null
+++ b/hw/yagl/yagl_apis/gles/yagl_gles_api.c
@@ -0,0 +1,58 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "yagl_gles_api.h"
+#include "yagl_host_gles_calls.h"
+#include "yagl_gles_driver.h"
+
+static void yagl_gles_api_destroy(struct yagl_api *api)
+{
+ struct yagl_gles_api *gles_api = (struct yagl_gles_api*)api;
+
+ gles_api->driver->destroy(gles_api->driver);
+ gles_api->driver = NULL;
+
+ yagl_api_cleanup(&gles_api->base);
+
+ g_free(gles_api);
+}
+
+struct yagl_api *yagl_gles_api_create(struct yagl_gles_driver *driver)
+{
+ struct yagl_gles_api *gles_api = g_malloc0(sizeof(struct yagl_gles_api));
+
+ yagl_api_init(&gles_api->base);
+
+ gles_api->base.process_init = &yagl_host_gles_process_init;
+ gles_api->base.destroy = &yagl_gles_api_destroy;
+
+ gles_api->driver = driver;
+
+ return &gles_api->base;
+}
diff --git a/hw/yagl/yagl_apis/gles/yagl_gles_api.h b/hw/yagl/yagl_apis/gles/yagl_gles_api.h
new file mode 100644
index 0000000000..5f196a8e84
--- /dev/null
+++ b/hw/yagl/yagl_apis/gles/yagl_gles_api.h
@@ -0,0 +1,49 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_GLES_API_H
+#define _QEMU_YAGL_GLES_API_H
+
+#include "yagl_api.h"
+
+struct yagl_gles_driver;
+
+struct yagl_gles_api
+{
+ struct yagl_api base;
+
+ struct yagl_gles_driver *driver;
+};
+
+/*
+ * Takes ownership of 'driver'
+ */
+struct yagl_api *yagl_gles_api_create(struct yagl_gles_driver *driver);
+
+#endif
diff --git a/hw/yagl/yagl_apis/gles/yagl_gles_api_ps.c b/hw/yagl/yagl_apis/gles/yagl_gles_api_ps.c
new file mode 100644
index 0000000000..7af362253f
--- /dev/null
+++ b/hw/yagl/yagl_apis/gles/yagl_gles_api_ps.c
@@ -0,0 +1,125 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include <GL/gl.h>
+#include "yagl_gles_api_ps.h"
+#include "yagl_process.h"
+#include "yagl_thread.h"
+#include "yagl_avl.h"
+
+struct yagl_location
+{
+ uint32_t location;
+
+ GLint actual_location;
+};
+
+static int yagl_location_compare(const void *avl_a,
+ const void *avl_b,
+ void *avl_param)
+{
+ const struct yagl_location *a = avl_a;
+ const struct yagl_location *b = avl_b;
+
+ if (a->location < b->location) {
+ return -1;
+ } else if (a->location > b->location) {
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
+static void yagl_location_destroy(void *avl_item, void *avl_param)
+{
+ g_free(avl_item);
+}
+
+void yagl_gles_api_ps_init(struct yagl_gles_api_ps *gles_api_ps,
+ struct yagl_gles_driver *driver)
+{
+ gles_api_ps->driver = driver;
+ gles_api_ps->locations = yagl_avl_create(&yagl_location_compare,
+ NULL,
+ NULL);
+ assert(gles_api_ps->locations);
+}
+
+void yagl_gles_api_ps_cleanup(struct yagl_gles_api_ps *gles_api_ps)
+{
+ yagl_avl_destroy(gles_api_ps->locations, &yagl_location_destroy);
+}
+
+void yagl_gles_api_ps_add_location(struct yagl_gles_api_ps *gles_api_ps,
+ uint32_t location,
+ GLint actual_location)
+{
+ struct yagl_location *item = g_malloc0(sizeof(struct yagl_location));
+
+ item->location = location;
+ item->actual_location = actual_location;
+
+ yagl_avl_assert_insert(gles_api_ps->locations, item);
+}
+
+GLint yagl_gles_api_ps_translate_location(struct yagl_gles_api_ps *gles_api_ps,
+ GLboolean tl,
+ uint32_t location)
+{
+ struct yagl_location *item;
+ struct yagl_location dummy;
+
+ if (!tl) {
+ return location;
+ }
+
+ dummy.location = location;
+
+ item = yagl_avl_find(gles_api_ps->locations, &dummy);
+
+ if (item) {
+ return item->actual_location;
+ } else {
+ assert(0);
+ return -1;
+ }
+}
+
+void yagl_gles_api_ps_remove_location(struct yagl_gles_api_ps *gles_api_ps,
+ uint32_t location)
+{
+ void *item;
+ struct yagl_location dummy;
+
+ dummy.location = location;
+
+ item = yagl_avl_assert_delete(gles_api_ps->locations, &dummy);
+
+ yagl_location_destroy(item, gles_api_ps->locations->avl_param);
+}
diff --git a/hw/yagl/yagl_apis/gles/yagl_gles_api_ps.h b/hw/yagl/yagl_apis/gles/yagl_gles_api_ps.h
new file mode 100644
index 0000000000..50ac2bbe4a
--- /dev/null
+++ b/hw/yagl/yagl_apis/gles/yagl_gles_api_ps.h
@@ -0,0 +1,63 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_GLES_API_PS_H
+#define _QEMU_YAGL_GLES_API_PS_H
+
+#include "yagl_api.h"
+
+struct yagl_gles_driver;
+struct yagl_avl_table;
+
+struct yagl_gles_api_ps
+{
+ struct yagl_api_ps base;
+
+ struct yagl_gles_driver *driver;
+
+ struct yagl_avl_table *locations;
+};
+
+void yagl_gles_api_ps_init(struct yagl_gles_api_ps *gles_api_ps,
+ struct yagl_gles_driver *driver);
+
+void yagl_gles_api_ps_cleanup(struct yagl_gles_api_ps *gles_api_ps);
+
+void yagl_gles_api_ps_add_location(struct yagl_gles_api_ps *gles_api_ps,
+ uint32_t location,
+ GLint actual_location);
+
+GLint yagl_gles_api_ps_translate_location(struct yagl_gles_api_ps *gles_api_ps,
+ GLboolean tl,
+ uint32_t location);
+
+void yagl_gles_api_ps_remove_location(struct yagl_gles_api_ps *gles_api_ps,
+ uint32_t location);
+
+#endif
diff --git a/hw/yagl/yagl_apis/gles/yagl_gles_api_ts.c b/hw/yagl/yagl_apis/gles/yagl_gles_api_ts.c
new file mode 100644
index 0000000000..0e404008c8
--- /dev/null
+++ b/hw/yagl/yagl_apis/gles/yagl_gles_api_ts.c
@@ -0,0 +1,51 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "yagl_gles_api_ts.h"
+#include "yagl_process.h"
+#include "yagl_thread.h"
+#include "yagl_vector.h"
+
+void yagl_gles_api_ts_init(struct yagl_gles_api_ts *gles_api_ts,
+ struct yagl_gles_driver *driver,
+ struct yagl_gles_api_ps *ps)
+{
+ gles_api_ts->driver = driver;
+ gles_api_ts->ps = ps;
+}
+
+void yagl_gles_api_ts_cleanup(struct yagl_gles_api_ts *gles_api_ts)
+{
+ uint32_t i;
+
+ for (i = 0; i < gles_api_ts->num_arrays; ++i) {
+ yagl_vector_cleanup(&gles_api_ts->arrays[i]);
+ }
+ g_free(gles_api_ts->arrays);
+}
diff --git a/hw/yagl/yagl_apis/gles/yagl_gles_api_ts.h b/hw/yagl/yagl_apis/gles/yagl_gles_api_ts.h
new file mode 100644
index 0000000000..73906645a3
--- /dev/null
+++ b/hw/yagl/yagl_apis/gles/yagl_gles_api_ts.h
@@ -0,0 +1,55 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_GLES_API_TS_H
+#define _QEMU_YAGL_GLES_API_TS_H
+
+#include "yagl_types.h"
+
+struct yagl_gles_driver;
+struct yagl_gles_api_ps;
+struct yagl_vector;
+
+struct yagl_gles_api_ts
+{
+ struct yagl_gles_driver *driver;
+
+ struct yagl_gles_api_ps *ps;
+
+ struct yagl_vector *arrays;
+ uint32_t num_arrays;
+};
+
+void yagl_gles_api_ts_init(struct yagl_gles_api_ts *gles_api_ts,
+ struct yagl_gles_driver *driver,
+ struct yagl_gles_api_ps *ps);
+
+void yagl_gles_api_ts_cleanup(struct yagl_gles_api_ts *gles_api_ts);
+
+#endif
diff --git a/hw/yagl/yagl_apis/gles/yagl_gles_calls.c b/hw/yagl/yagl_apis/gles/yagl_gles_calls.c
new file mode 100644
index 0000000000..b9ad65671b
--- /dev/null
+++ b/hw/yagl/yagl_apis/gles/yagl_gles_calls.c
@@ -0,0 +1,3542 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+/*
+ * Generated by gen-yagl-calls.py, do not modify!
+ */
+#include "yagl_gles_calls.h"
+#include "yagl_host_gles_calls.h"
+#include "yagl_transport_gl.h"
+#include "yagl_thread.h"
+#include "yagl_process.h"
+#include "yagl_log.h"
+
+/*
+ * glDrawArrays dispatcher. id = 1
+ */
+static bool yagl_func_glDrawArrays(struct yagl_transport *t)
+{
+ GLenum mode;
+ GLint first;
+ GLsizei count;
+ mode = yagl_transport_get_out_GLenum(t);
+ first = yagl_transport_get_out_GLint(t);
+ count = yagl_transport_get_out_GLsizei(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT3(glDrawArrays, GLenum, GLint, GLsizei, mode, first, count);
+ (void)yagl_host_glDrawArrays(mode, first, count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glDrawElements dispatcher. id = 2
+ */
+static bool yagl_func_glDrawElements(struct yagl_transport *t)
+{
+ GLenum mode;
+ GLsizei count;
+ GLenum type;
+ const GLvoid *indices;
+ int32_t indices_count;
+ mode = yagl_transport_get_out_GLenum(t);
+ count = yagl_transport_get_out_GLsizei(t);
+ type = yagl_transport_get_out_GLenum(t);
+ if (!yagl_transport_get_out_array(t, 1, (const void**)&indices, &indices_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT4(glDrawElements, GLenum, GLsizei, GLenum, void*, mode, count, type, indices);
+ (void)yagl_host_glDrawElements(mode, count, type, indices, indices_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glReadPixels dispatcher. id = 3
+ */
+static bool yagl_func_glReadPixels(struct yagl_transport *t)
+{
+ GLint x;
+ GLint y;
+ GLsizei width;
+ GLsizei height;
+ GLenum format;
+ GLenum type;
+ GLvoid *pixels;
+ int32_t pixels_maxcount;
+ int32_t *pixels_count;
+ x = yagl_transport_get_out_GLint(t);
+ y = yagl_transport_get_out_GLint(t);
+ width = yagl_transport_get_out_GLsizei(t);
+ height = yagl_transport_get_out_GLsizei(t);
+ format = yagl_transport_get_out_GLenum(t);
+ type = yagl_transport_get_out_GLenum(t);
+ if (!yagl_transport_get_in_array(t, 1, (void**)&pixels, &pixels_maxcount, &pixels_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT7(glReadPixels, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, void*, x, y, width, height, format, type, pixels);
+ *pixels_count = 0;
+ (void)yagl_host_glReadPixels(x, y, width, height, format, type, pixels, pixels_maxcount, pixels_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glDisableVertexAttribArray dispatcher. id = 4
+ */
+static bool yagl_func_glDisableVertexAttribArray(struct yagl_transport *t)
+{
+ GLuint index;
+ index = yagl_transport_get_out_GLuint(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT1(glDisableVertexAttribArray, GLuint, index);
+ (void)yagl_host_glDisableVertexAttribArray(index);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glEnableVertexAttribArray dispatcher. id = 5
+ */
+static bool yagl_func_glEnableVertexAttribArray(struct yagl_transport *t)
+{
+ GLuint index;
+ index = yagl_transport_get_out_GLuint(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT1(glEnableVertexAttribArray, GLuint, index);
+ (void)yagl_host_glEnableVertexAttribArray(index);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glVertexAttribPointerData dispatcher. id = 6
+ */
+static bool yagl_func_glVertexAttribPointerData(struct yagl_transport *t)
+{
+ GLuint indx;
+ GLint size;
+ GLenum type;
+ GLboolean normalized;
+ GLsizei stride;
+ GLint first;
+ const GLvoid *data;
+ int32_t data_count;
+ indx = yagl_transport_get_out_GLuint(t);
+ size = yagl_transport_get_out_GLint(t);
+ type = yagl_transport_get_out_GLenum(t);
+ normalized = yagl_transport_get_out_GLboolean(t);
+ stride = yagl_transport_get_out_GLsizei(t);
+ first = yagl_transport_get_out_GLint(t);
+ if (!yagl_transport_get_out_array(t, 1, (const void**)&data, &data_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT7(glVertexAttribPointerData, GLuint, GLint, GLenum, GLboolean, GLsizei, GLint, void*, indx, size, type, normalized, stride, first, data);
+ (void)yagl_host_glVertexAttribPointerData(indx, size, type, normalized, stride, first, data, data_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glVertexAttribPointerOffset dispatcher. id = 7
+ */
+static bool yagl_func_glVertexAttribPointerOffset(struct yagl_transport *t)
+{
+ GLuint indx;
+ GLint size;
+ GLenum type;
+ GLboolean normalized;
+ GLsizei stride;
+ GLsizei offset;
+ indx = yagl_transport_get_out_GLuint(t);
+ size = yagl_transport_get_out_GLint(t);
+ type = yagl_transport_get_out_GLenum(t);
+ normalized = yagl_transport_get_out_GLboolean(t);
+ stride = yagl_transport_get_out_GLsizei(t);
+ offset = yagl_transport_get_out_GLsizei(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT6(glVertexAttribPointerOffset, GLuint, GLint, GLenum, GLboolean, GLsizei, GLsizei, indx, size, type, normalized, stride, offset);
+ (void)yagl_host_glVertexAttribPointerOffset(indx, size, type, normalized, stride, offset);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glVertexPointerData dispatcher. id = 8
+ */
+static bool yagl_func_glVertexPointerData(struct yagl_transport *t)
+{
+ GLint size;
+ GLenum type;
+ GLsizei stride;
+ GLint first;
+ const GLvoid *data;
+ int32_t data_count;
+ size = yagl_transport_get_out_GLint(t);
+ type = yagl_transport_get_out_GLenum(t);
+ stride = yagl_transport_get_out_GLsizei(t);
+ first = yagl_transport_get_out_GLint(t);
+ if (!yagl_transport_get_out_array(t, 1, (const void**)&data, &data_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT5(glVertexPointerData, GLint, GLenum, GLsizei, GLint, void*, size, type, stride, first, data);
+ (void)yagl_host_glVertexPointerData(size, type, stride, first, data, data_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glVertexPointerOffset dispatcher. id = 9
+ */
+static bool yagl_func_glVertexPointerOffset(struct yagl_transport *t)
+{
+ GLint size;
+ GLenum type;
+ GLsizei stride;
+ GLsizei offset;
+ size = yagl_transport_get_out_GLint(t);
+ type = yagl_transport_get_out_GLenum(t);
+ stride = yagl_transport_get_out_GLsizei(t);
+ offset = yagl_transport_get_out_GLsizei(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT4(glVertexPointerOffset, GLint, GLenum, GLsizei, GLsizei, size, type, stride, offset);
+ (void)yagl_host_glVertexPointerOffset(size, type, stride, offset);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glNormalPointerData dispatcher. id = 10
+ */
+static bool yagl_func_glNormalPointerData(struct yagl_transport *t)
+{
+ GLenum type;
+ GLsizei stride;
+ GLint first;
+ const GLvoid *data;
+ int32_t data_count;
+ type = yagl_transport_get_out_GLenum(t);
+ stride = yagl_transport_get_out_GLsizei(t);
+ first = yagl_transport_get_out_GLint(t);
+ if (!yagl_transport_get_out_array(t, 1, (const void**)&data, &data_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT4(glNormalPointerData, GLenum, GLsizei, GLint, void*, type, stride, first, data);
+ (void)yagl_host_glNormalPointerData(type, stride, first, data, data_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glNormalPointerOffset dispatcher. id = 11
+ */
+static bool yagl_func_glNormalPointerOffset(struct yagl_transport *t)
+{
+ GLenum type;
+ GLsizei stride;
+ GLsizei offset;
+ type = yagl_transport_get_out_GLenum(t);
+ stride = yagl_transport_get_out_GLsizei(t);
+ offset = yagl_transport_get_out_GLsizei(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT3(glNormalPointerOffset, GLenum, GLsizei, GLsizei, type, stride, offset);
+ (void)yagl_host_glNormalPointerOffset(type, stride, offset);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glColorPointerData dispatcher. id = 12
+ */
+static bool yagl_func_glColorPointerData(struct yagl_transport *t)
+{
+ GLint size;
+ GLenum type;
+ GLsizei stride;
+ GLint first;
+ const GLvoid *data;
+ int32_t data_count;
+ size = yagl_transport_get_out_GLint(t);
+ type = yagl_transport_get_out_GLenum(t);
+ stride = yagl_transport_get_out_GLsizei(t);
+ first = yagl_transport_get_out_GLint(t);
+ if (!yagl_transport_get_out_array(t, 1, (const void**)&data, &data_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT5(glColorPointerData, GLint, GLenum, GLsizei, GLint, void*, size, type, stride, first, data);
+ (void)yagl_host_glColorPointerData(size, type, stride, first, data, data_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glColorPointerOffset dispatcher. id = 13
+ */
+static bool yagl_func_glColorPointerOffset(struct yagl_transport *t)
+{
+ GLint size;
+ GLenum type;
+ GLsizei stride;
+ GLsizei offset;
+ size = yagl_transport_get_out_GLint(t);
+ type = yagl_transport_get_out_GLenum(t);
+ stride = yagl_transport_get_out_GLsizei(t);
+ offset = yagl_transport_get_out_GLsizei(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT4(glColorPointerOffset, GLint, GLenum, GLsizei, GLsizei, size, type, stride, offset);
+ (void)yagl_host_glColorPointerOffset(size, type, stride, offset);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glTexCoordPointerData dispatcher. id = 14
+ */
+static bool yagl_func_glTexCoordPointerData(struct yagl_transport *t)
+{
+ GLint tex_id;
+ GLint size;
+ GLenum type;
+ GLsizei stride;
+ GLint first;
+ const GLvoid *data;
+ int32_t data_count;
+ tex_id = yagl_transport_get_out_GLint(t);
+ size = yagl_transport_get_out_GLint(t);
+ type = yagl_transport_get_out_GLenum(t);
+ stride = yagl_transport_get_out_GLsizei(t);
+ first = yagl_transport_get_out_GLint(t);
+ if (!yagl_transport_get_out_array(t, 1, (const void**)&data, &data_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT6(glTexCoordPointerData, GLint, GLint, GLenum, GLsizei, GLint, void*, tex_id, size, type, stride, first, data);
+ (void)yagl_host_glTexCoordPointerData(tex_id, size, type, stride, first, data, data_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glTexCoordPointerOffset dispatcher. id = 15
+ */
+static bool yagl_func_glTexCoordPointerOffset(struct yagl_transport *t)
+{
+ GLint size;
+ GLenum type;
+ GLsizei stride;
+ GLsizei offset;
+ size = yagl_transport_get_out_GLint(t);
+ type = yagl_transport_get_out_GLenum(t);
+ stride = yagl_transport_get_out_GLsizei(t);
+ offset = yagl_transport_get_out_GLsizei(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT4(glTexCoordPointerOffset, GLint, GLenum, GLsizei, GLsizei, size, type, stride, offset);
+ (void)yagl_host_glTexCoordPointerOffset(size, type, stride, offset);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glDisableClientState dispatcher. id = 16
+ */
+static bool yagl_func_glDisableClientState(struct yagl_transport *t)
+{
+ GLenum array;
+ array = yagl_transport_get_out_GLenum(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT1(glDisableClientState, GLenum, array);
+ (void)yagl_host_glDisableClientState(array);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glEnableClientState dispatcher. id = 17
+ */
+static bool yagl_func_glEnableClientState(struct yagl_transport *t)
+{
+ GLenum array;
+ array = yagl_transport_get_out_GLenum(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT1(glEnableClientState, GLenum, array);
+ (void)yagl_host_glEnableClientState(array);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glGenBuffers dispatcher. id = 18
+ */
+static bool yagl_func_glGenBuffers(struct yagl_transport *t)
+{
+ const GLuint *buffers;
+ int32_t buffers_count;
+ if (!yagl_transport_get_out_array(t, sizeof(GLuint), (const void**)&buffers, &buffers_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT1(glGenBuffers, void*, buffers);
+ (void)yagl_host_glGenBuffers(buffers, buffers_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glBindBuffer dispatcher. id = 19
+ */
+static bool yagl_func_glBindBuffer(struct yagl_transport *t)
+{
+ GLenum target;
+ GLuint buffer;
+ target = yagl_transport_get_out_GLenum(t);
+ buffer = yagl_transport_get_out_GLuint(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT2(glBindBuffer, GLenum, GLuint, target, buffer);
+ (void)yagl_host_glBindBuffer(target, buffer);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glBufferData dispatcher. id = 20
+ */
+static bool yagl_func_glBufferData(struct yagl_transport *t)
+{
+ GLenum target;
+ const GLvoid *data;
+ int32_t data_count;
+ GLenum usage;
+ target = yagl_transport_get_out_GLenum(t);
+ if (!yagl_transport_get_out_array(t, 1, (const void**)&data, &data_count)) {
+ return false;
+ }
+ usage = yagl_transport_get_out_GLenum(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT3(glBufferData, GLenum, void*, GLenum, target, data, usage);
+ (void)yagl_host_glBufferData(target, data, data_count, usage);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glBufferSubData dispatcher. id = 21
+ */
+static bool yagl_func_glBufferSubData(struct yagl_transport *t)
+{
+ GLenum target;
+ GLsizei offset;
+ const GLvoid *data;
+ int32_t data_count;
+ target = yagl_transport_get_out_GLenum(t);
+ offset = yagl_transport_get_out_GLsizei(t);
+ if (!yagl_transport_get_out_array(t, 1, (const void**)&data, &data_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT3(glBufferSubData, GLenum, GLsizei, void*, target, offset, data);
+ (void)yagl_host_glBufferSubData(target, offset, data, data_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glGenTextures dispatcher. id = 22
+ */
+static bool yagl_func_glGenTextures(struct yagl_transport *t)
+{
+ const GLuint *textures;
+ int32_t textures_count;
+ if (!yagl_transport_get_out_array(t, sizeof(GLuint), (const void**)&textures, &textures_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT1(glGenTextures, void*, textures);
+ (void)yagl_host_glGenTextures(textures, textures_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glBindTexture dispatcher. id = 23
+ */
+static bool yagl_func_glBindTexture(struct yagl_transport *t)
+{
+ GLenum target;
+ GLuint texture;
+ target = yagl_transport_get_out_GLenum(t);
+ texture = yagl_transport_get_out_GLuint(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT2(glBindTexture, GLenum, GLuint, target, texture);
+ (void)yagl_host_glBindTexture(target, texture);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glActiveTexture dispatcher. id = 24
+ */
+static bool yagl_func_glActiveTexture(struct yagl_transport *t)
+{
+ GLenum texture;
+ texture = yagl_transport_get_out_GLenum(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT1(glActiveTexture, GLenum, texture);
+ (void)yagl_host_glActiveTexture(texture);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glCompressedTexImage2D dispatcher. id = 25
+ */
+static bool yagl_func_glCompressedTexImage2D(struct yagl_transport *t)
+{
+ GLenum target;
+ GLint level;
+ GLenum internalformat;
+ GLsizei width;
+ GLsizei height;
+ GLint border;
+ const GLvoid *data;
+ int32_t data_count;
+ target = yagl_transport_get_out_GLenum(t);
+ level = yagl_transport_get_out_GLint(t);
+ internalformat = yagl_transport_get_out_GLenum(t);
+ width = yagl_transport_get_out_GLsizei(t);
+ height = yagl_transport_get_out_GLsizei(t);
+ border = yagl_transport_get_out_GLint(t);
+ if (!yagl_transport_get_out_array(t, 1, (const void**)&data, &data_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT7(glCompressedTexImage2D, GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, void*, target, level, internalformat, width, height, border, data);
+ (void)yagl_host_glCompressedTexImage2D(target, level, internalformat, width, height, border, data, data_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glCompressedTexSubImage2D dispatcher. id = 26
+ */
+static bool yagl_func_glCompressedTexSubImage2D(struct yagl_transport *t)
+{
+ GLenum target;
+ GLint level;
+ GLint xoffset;
+ GLint yoffset;
+ GLsizei width;
+ GLsizei height;
+ GLenum format;
+ const GLvoid *data;
+ int32_t data_count;
+ target = yagl_transport_get_out_GLenum(t);
+ level = yagl_transport_get_out_GLint(t);
+ xoffset = yagl_transport_get_out_GLint(t);
+ yoffset = yagl_transport_get_out_GLint(t);
+ width = yagl_transport_get_out_GLsizei(t);
+ height = yagl_transport_get_out_GLsizei(t);
+ format = yagl_transport_get_out_GLenum(t);
+ if (!yagl_transport_get_out_array(t, 1, (const void**)&data, &data_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT8(glCompressedTexSubImage2D, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, void*, target, level, xoffset, yoffset, width, height, format, data);
+ (void)yagl_host_glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, data, data_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glCopyTexImage2D dispatcher. id = 27
+ */
+static bool yagl_func_glCopyTexImage2D(struct yagl_transport *t)
+{
+ GLenum target;
+ GLint level;
+ GLenum internalformat;
+ GLint x;
+ GLint y;
+ GLsizei width;
+ GLsizei height;
+ GLint border;
+ target = yagl_transport_get_out_GLenum(t);
+ level = yagl_transport_get_out_GLint(t);
+ internalformat = yagl_transport_get_out_GLenum(t);
+ x = yagl_transport_get_out_GLint(t);
+ y = yagl_transport_get_out_GLint(t);
+ width = yagl_transport_get_out_GLsizei(t);
+ height = yagl_transport_get_out_GLsizei(t);
+ border = yagl_transport_get_out_GLint(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT8(glCopyTexImage2D, GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint, target, level, internalformat, x, y, width, height, border);
+ (void)yagl_host_glCopyTexImage2D(target, level, internalformat, x, y, width, height, border);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glCopyTexSubImage2D dispatcher. id = 28
+ */
+static bool yagl_func_glCopyTexSubImage2D(struct yagl_transport *t)
+{
+ GLenum target;
+ GLint level;
+ GLint xoffset;
+ GLint yoffset;
+ GLint x;
+ GLint y;
+ GLsizei width;
+ GLsizei height;
+ target = yagl_transport_get_out_GLenum(t);
+ level = yagl_transport_get_out_GLint(t);
+ xoffset = yagl_transport_get_out_GLint(t);
+ yoffset = yagl_transport_get_out_GLint(t);
+ x = yagl_transport_get_out_GLint(t);
+ y = yagl_transport_get_out_GLint(t);
+ width = yagl_transport_get_out_GLsizei(t);
+ height = yagl_transport_get_out_GLsizei(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT8(glCopyTexSubImage2D, GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, target, level, xoffset, yoffset, x, y, width, height);
+ (void)yagl_host_glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glGetTexParameterfv dispatcher. id = 29
+ */
+static bool yagl_func_glGetTexParameterfv(struct yagl_transport *t)
+{
+ GLenum target;
+ GLenum pname;
+ GLfloat *param;
+ target = yagl_transport_get_out_GLenum(t);
+ pname = yagl_transport_get_out_GLenum(t);
+ yagl_transport_get_in_arg(t, (void**)&param);
+ YAGL_LOG_FUNC_ENTER_SPLIT3(glGetTexParameterfv, GLenum, GLenum, void*, target, pname, param);
+ (void)yagl_host_glGetTexParameterfv(target, pname, param);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glGetTexParameteriv dispatcher. id = 30
+ */
+static bool yagl_func_glGetTexParameteriv(struct yagl_transport *t)
+{
+ GLenum target;
+ GLenum pname;
+ GLint *param;
+ target = yagl_transport_get_out_GLenum(t);
+ pname = yagl_transport_get_out_GLenum(t);
+ yagl_transport_get_in_arg(t, (void**)&param);
+ YAGL_LOG_FUNC_ENTER_SPLIT3(glGetTexParameteriv, GLenum, GLenum, void*, target, pname, param);
+ (void)yagl_host_glGetTexParameteriv(target, pname, param);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glTexImage2D dispatcher. id = 31
+ */
+static bool yagl_func_glTexImage2D(struct yagl_transport *t)
+{
+ GLenum target;
+ GLint level;
+ GLint internalformat;
+ GLsizei width;
+ GLsizei height;
+ GLint border;
+ GLenum format;
+ GLenum type;
+ const GLvoid *pixels;
+ int32_t pixels_count;
+ target = yagl_transport_get_out_GLenum(t);
+ level = yagl_transport_get_out_GLint(t);
+ internalformat = yagl_transport_get_out_GLint(t);
+ width = yagl_transport_get_out_GLsizei(t);
+ height = yagl_transport_get_out_GLsizei(t);
+ border = yagl_transport_get_out_GLint(t);
+ format = yagl_transport_get_out_GLenum(t);
+ type = yagl_transport_get_out_GLenum(t);
+ if (!yagl_transport_get_out_array(t, 1, (const void**)&pixels, &pixels_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT9(glTexImage2D, GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, void*, target, level, internalformat, width, height, border, format, type, pixels);
+ (void)yagl_host_glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels, pixels_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glTexParameterf dispatcher. id = 32
+ */
+static bool yagl_func_glTexParameterf(struct yagl_transport *t)
+{
+ GLenum target;
+ GLenum pname;
+ GLfloat param;
+ target = yagl_transport_get_out_GLenum(t);
+ pname = yagl_transport_get_out_GLenum(t);
+ param = yagl_transport_get_out_GLfloat(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT3(glTexParameterf, GLenum, GLenum, GLfloat, target, pname, param);
+ (void)yagl_host_glTexParameterf(target, pname, param);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glTexParameterfv dispatcher. id = 33
+ */
+static bool yagl_func_glTexParameterfv(struct yagl_transport *t)
+{
+ GLenum target;
+ GLenum pname;
+ const GLfloat *params;
+ int32_t params_count;
+ target = yagl_transport_get_out_GLenum(t);
+ pname = yagl_transport_get_out_GLenum(t);
+ if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&params, &params_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT3(glTexParameterfv, GLenum, GLenum, void*, target, pname, params);
+ (void)yagl_host_glTexParameterfv(target, pname, params, params_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glTexParameteri dispatcher. id = 34
+ */
+static bool yagl_func_glTexParameteri(struct yagl_transport *t)
+{
+ GLenum target;
+ GLenum pname;
+ GLint param;
+ target = yagl_transport_get_out_GLenum(t);
+ pname = yagl_transport_get_out_GLenum(t);
+ param = yagl_transport_get_out_GLint(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT3(glTexParameteri, GLenum, GLenum, GLint, target, pname, param);
+ (void)yagl_host_glTexParameteri(target, pname, param);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glTexParameteriv dispatcher. id = 35
+ */
+static bool yagl_func_glTexParameteriv(struct yagl_transport *t)
+{
+ GLenum target;
+ GLenum pname;
+ const GLint *params;
+ int32_t params_count;
+ target = yagl_transport_get_out_GLenum(t);
+ pname = yagl_transport_get_out_GLenum(t);
+ if (!yagl_transport_get_out_array(t, sizeof(GLint), (const void**)&params, &params_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT3(glTexParameteriv, GLenum, GLenum, void*, target, pname, params);
+ (void)yagl_host_glTexParameteriv(target, pname, params, params_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glTexSubImage2D dispatcher. id = 36
+ */
+static bool yagl_func_glTexSubImage2D(struct yagl_transport *t)
+{
+ GLenum target;
+ GLint level;
+ GLint xoffset;
+ GLint yoffset;
+ GLsizei width;
+ GLsizei height;
+ GLenum format;
+ GLenum type;
+ const GLvoid *pixels;
+ int32_t pixels_count;
+ target = yagl_transport_get_out_GLenum(t);
+ level = yagl_transport_get_out_GLint(t);
+ xoffset = yagl_transport_get_out_GLint(t);
+ yoffset = yagl_transport_get_out_GLint(t);
+ width = yagl_transport_get_out_GLsizei(t);
+ height = yagl_transport_get_out_GLsizei(t);
+ format = yagl_transport_get_out_GLenum(t);
+ type = yagl_transport_get_out_GLenum(t);
+ if (!yagl_transport_get_out_array(t, 1, (const void**)&pixels, &pixels_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT9(glTexSubImage2D, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, void*, target, level, xoffset, yoffset, width, height, format, type, pixels);
+ (void)yagl_host_glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels, pixels_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glClientActiveTexture dispatcher. id = 37
+ */
+static bool yagl_func_glClientActiveTexture(struct yagl_transport *t)
+{
+ GLenum texture;
+ texture = yagl_transport_get_out_GLenum(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT1(glClientActiveTexture, GLenum, texture);
+ (void)yagl_host_glClientActiveTexture(texture);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glTexEnvi dispatcher. id = 38
+ */
+static bool yagl_func_glTexEnvi(struct yagl_transport *t)
+{
+ GLenum target;
+ GLenum pname;
+ GLint param;
+ target = yagl_transport_get_out_GLenum(t);
+ pname = yagl_transport_get_out_GLenum(t);
+ param = yagl_transport_get_out_GLint(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT3(glTexEnvi, GLenum, GLenum, GLint, target, pname, param);
+ (void)yagl_host_glTexEnvi(target, pname, param);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glTexEnvf dispatcher. id = 39
+ */
+static bool yagl_func_glTexEnvf(struct yagl_transport *t)
+{
+ GLenum target;
+ GLenum pname;
+ GLfloat param;
+ target = yagl_transport_get_out_GLenum(t);
+ pname = yagl_transport_get_out_GLenum(t);
+ param = yagl_transport_get_out_GLfloat(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT3(glTexEnvf, GLenum, GLenum, GLfloat, target, pname, param);
+ (void)yagl_host_glTexEnvf(target, pname, param);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glMultiTexCoord4f dispatcher. id = 40
+ */
+static bool yagl_func_glMultiTexCoord4f(struct yagl_transport *t)
+{
+ GLenum target;
+ GLfloat s;
+ GLfloat tt;
+ GLfloat r;
+ GLfloat q;
+ target = yagl_transport_get_out_GLenum(t);
+ s = yagl_transport_get_out_GLfloat(t);
+ tt = yagl_transport_get_out_GLfloat(t);
+ r = yagl_transport_get_out_GLfloat(t);
+ q = yagl_transport_get_out_GLfloat(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT5(glMultiTexCoord4f, GLenum, GLfloat, GLfloat, GLfloat, GLfloat, target, s, tt, r, q);
+ (void)yagl_host_glMultiTexCoord4f(target, s, tt, r, q);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glTexEnviv dispatcher. id = 41
+ */
+static bool yagl_func_glTexEnviv(struct yagl_transport *t)
+{
+ GLenum target;
+ GLenum pname;
+ const GLint *params;
+ int32_t params_count;
+ target = yagl_transport_get_out_GLenum(t);
+ pname = yagl_transport_get_out_GLenum(t);
+ if (!yagl_transport_get_out_array(t, sizeof(GLint), (const void**)&params, &params_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT3(glTexEnviv, GLenum, GLenum, void*, target, pname, params);
+ (void)yagl_host_glTexEnviv(target, pname, params, params_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glTexEnvfv dispatcher. id = 42
+ */
+static bool yagl_func_glTexEnvfv(struct yagl_transport *t)
+{
+ GLenum target;
+ GLenum pname;
+ const GLfloat *params;
+ int32_t params_count;
+ target = yagl_transport_get_out_GLenum(t);
+ pname = yagl_transport_get_out_GLenum(t);
+ if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&params, &params_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT3(glTexEnvfv, GLenum, GLenum, void*, target, pname, params);
+ (void)yagl_host_glTexEnvfv(target, pname, params, params_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glGetTexEnviv dispatcher. id = 43
+ */
+static bool yagl_func_glGetTexEnviv(struct yagl_transport *t)
+{
+ GLenum env;
+ GLenum pname;
+ GLint *params;
+ int32_t params_maxcount;
+ int32_t *params_count;
+ env = yagl_transport_get_out_GLenum(t);
+ pname = yagl_transport_get_out_GLenum(t);
+ if (!yagl_transport_get_in_array(t, sizeof(GLint), (void**)&params, &params_maxcount, &params_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT3(glGetTexEnviv, GLenum, GLenum, void*, env, pname, params);
+ *params_count = 0;
+ (void)yagl_host_glGetTexEnviv(env, pname, params, params_maxcount, params_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glGetTexEnvfv dispatcher. id = 44
+ */
+static bool yagl_func_glGetTexEnvfv(struct yagl_transport *t)
+{
+ GLenum env;
+ GLenum pname;
+ GLfloat *params;
+ int32_t params_maxcount;
+ int32_t *params_count;
+ env = yagl_transport_get_out_GLenum(t);
+ pname = yagl_transport_get_out_GLenum(t);
+ if (!yagl_transport_get_in_array(t, sizeof(GLfloat), (void**)&params, &params_maxcount, &params_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT3(glGetTexEnvfv, GLenum, GLenum, void*, env, pname, params);
+ *params_count = 0;
+ (void)yagl_host_glGetTexEnvfv(env, pname, params, params_maxcount, params_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glGenFramebuffers dispatcher. id = 45
+ */
+static bool yagl_func_glGenFramebuffers(struct yagl_transport *t)
+{
+ const GLuint *framebuffers;
+ int32_t framebuffers_count;
+ if (!yagl_transport_get_out_array(t, sizeof(GLuint), (const void**)&framebuffers, &framebuffers_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT1(glGenFramebuffers, void*, framebuffers);
+ (void)yagl_host_glGenFramebuffers(framebuffers, framebuffers_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glBindFramebuffer dispatcher. id = 46
+ */
+static bool yagl_func_glBindFramebuffer(struct yagl_transport *t)
+{
+ GLenum target;
+ GLuint framebuffer;
+ target = yagl_transport_get_out_GLenum(t);
+ framebuffer = yagl_transport_get_out_GLuint(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT2(glBindFramebuffer, GLenum, GLuint, target, framebuffer);
+ (void)yagl_host_glBindFramebuffer(target, framebuffer);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glFramebufferTexture2D dispatcher. id = 47
+ */
+static bool yagl_func_glFramebufferTexture2D(struct yagl_transport *t)
+{
+ GLenum target;
+ GLenum attachment;
+ GLenum textarget;
+ GLuint texture;
+ GLint level;
+ target = yagl_transport_get_out_GLenum(t);
+ attachment = yagl_transport_get_out_GLenum(t);
+ textarget = yagl_transport_get_out_GLenum(t);
+ texture = yagl_transport_get_out_GLuint(t);
+ level = yagl_transport_get_out_GLint(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT5(glFramebufferTexture2D, GLenum, GLenum, GLenum, GLuint, GLint, target, attachment, textarget, texture, level);
+ (void)yagl_host_glFramebufferTexture2D(target, attachment, textarget, texture, level);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glFramebufferRenderbuffer dispatcher. id = 48
+ */
+static bool yagl_func_glFramebufferRenderbuffer(struct yagl_transport *t)
+{
+ GLenum target;
+ GLenum attachment;
+ GLenum renderbuffertarget;
+ GLuint renderbuffer;
+ target = yagl_transport_get_out_GLenum(t);
+ attachment = yagl_transport_get_out_GLenum(t);
+ renderbuffertarget = yagl_transport_get_out_GLenum(t);
+ renderbuffer = yagl_transport_get_out_GLuint(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT4(glFramebufferRenderbuffer, GLenum, GLenum, GLenum, GLuint, target, attachment, renderbuffertarget, renderbuffer);
+ (void)yagl_host_glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glGenRenderbuffers dispatcher. id = 49
+ */
+static bool yagl_func_glGenRenderbuffers(struct yagl_transport *t)
+{
+ const GLuint *renderbuffers;
+ int32_t renderbuffers_count;
+ if (!yagl_transport_get_out_array(t, sizeof(GLuint), (const void**)&renderbuffers, &renderbuffers_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT1(glGenRenderbuffers, void*, renderbuffers);
+ (void)yagl_host_glGenRenderbuffers(renderbuffers, renderbuffers_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glBindRenderbuffer dispatcher. id = 50
+ */
+static bool yagl_func_glBindRenderbuffer(struct yagl_transport *t)
+{
+ GLenum target;
+ GLuint renderbuffer;
+ target = yagl_transport_get_out_GLenum(t);
+ renderbuffer = yagl_transport_get_out_GLuint(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT2(glBindRenderbuffer, GLenum, GLuint, target, renderbuffer);
+ (void)yagl_host_glBindRenderbuffer(target, renderbuffer);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glRenderbufferStorage dispatcher. id = 51
+ */
+static bool yagl_func_glRenderbufferStorage(struct yagl_transport *t)
+{
+ GLenum target;
+ GLenum internalformat;
+ GLsizei width;
+ GLsizei height;
+ target = yagl_transport_get_out_GLenum(t);
+ internalformat = yagl_transport_get_out_GLenum(t);
+ width = yagl_transport_get_out_GLsizei(t);
+ height = yagl_transport_get_out_GLsizei(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT4(glRenderbufferStorage, GLenum, GLenum, GLsizei, GLsizei, target, internalformat, width, height);
+ (void)yagl_host_glRenderbufferStorage(target, internalformat, width, height);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glGetRenderbufferParameteriv dispatcher. id = 52
+ */
+static bool yagl_func_glGetRenderbufferParameteriv(struct yagl_transport *t)
+{
+ GLenum target;
+ GLenum pname;
+ GLint *param;
+ target = yagl_transport_get_out_GLenum(t);
+ pname = yagl_transport_get_out_GLenum(t);
+ yagl_transport_get_in_arg(t, (void**)&param);
+ YAGL_LOG_FUNC_ENTER_SPLIT3(glGetRenderbufferParameteriv, GLenum, GLenum, void*, target, pname, param);
+ (void)yagl_host_glGetRenderbufferParameteriv(target, pname, param);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glCreateProgram dispatcher. id = 53
+ */
+static bool yagl_func_glCreateProgram(struct yagl_transport *t)
+{
+ GLuint program;
+ program = yagl_transport_get_out_GLuint(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT1(glCreateProgram, GLuint, program);
+ (void)yagl_host_glCreateProgram(program);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glCreateShader dispatcher. id = 54
+ */
+static bool yagl_func_glCreateShader(struct yagl_transport *t)
+{
+ GLuint shader;
+ GLenum type;
+ shader = yagl_transport_get_out_GLuint(t);
+ type = yagl_transport_get_out_GLenum(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT2(glCreateShader, GLuint, GLenum, shader, type);
+ (void)yagl_host_glCreateShader(shader, type);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glShaderSource dispatcher. id = 55
+ */
+static bool yagl_func_glShaderSource(struct yagl_transport *t)
+{
+ GLuint shader;
+ const GLchar *string;
+ int32_t string_count;
+ shader = yagl_transport_get_out_GLuint(t);
+ if (!yagl_transport_get_out_array(t, sizeof(GLchar), (const void**)&string, &string_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT2(glShaderSource, GLuint, void*, shader, string);
+ (void)yagl_host_glShaderSource(shader, string, string_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glAttachShader dispatcher. id = 56
+ */
+static bool yagl_func_glAttachShader(struct yagl_transport *t)
+{
+ GLuint program;
+ GLuint shader;
+ program = yagl_transport_get_out_GLuint(t);
+ shader = yagl_transport_get_out_GLuint(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT2(glAttachShader, GLuint, GLuint, program, shader);
+ (void)yagl_host_glAttachShader(program, shader);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glDetachShader dispatcher. id = 57
+ */
+static bool yagl_func_glDetachShader(struct yagl_transport *t)
+{
+ GLuint program;
+ GLuint shader;
+ program = yagl_transport_get_out_GLuint(t);
+ shader = yagl_transport_get_out_GLuint(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT2(glDetachShader, GLuint, GLuint, program, shader);
+ (void)yagl_host_glDetachShader(program, shader);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glCompileShader dispatcher. id = 58
+ */
+static bool yagl_func_glCompileShader(struct yagl_transport *t)
+{
+ GLuint shader;
+ shader = yagl_transport_get_out_GLuint(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT1(glCompileShader, GLuint, shader);
+ (void)yagl_host_glCompileShader(shader);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glBindAttribLocation dispatcher. id = 59
+ */
+static bool yagl_func_glBindAttribLocation(struct yagl_transport *t)
+{
+ GLuint program;
+ GLuint index;
+ const GLchar *name;
+ int32_t name_count;
+ program = yagl_transport_get_out_GLuint(t);
+ index = yagl_transport_get_out_GLuint(t);
+ if (!yagl_transport_get_out_array(t, sizeof(GLchar), (const void**)&name, &name_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT3(glBindAttribLocation, GLuint, GLuint, void*, program, index, name);
+ (void)yagl_host_glBindAttribLocation(program, index, name, name_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glGetActiveAttrib dispatcher. id = 60
+ */
+static bool yagl_func_glGetActiveAttrib(struct yagl_transport *t)
+{
+ GLuint program;
+ GLuint index;
+ GLint *size;
+ GLenum *type;
+ GLchar *name;
+ int32_t name_maxcount;
+ int32_t *name_count;
+ GLboolean *retval;
+ program = yagl_transport_get_out_GLuint(t);
+ index = yagl_transport_get_out_GLuint(t);
+ yagl_transport_get_in_arg(t, (void**)&size);
+ yagl_transport_get_in_arg(t, (void**)&type);
+ if (!yagl_transport_get_in_array(t, sizeof(GLchar), (void**)&name, &name_maxcount, &name_count)) {
+ return false;
+ }
+ yagl_transport_get_in_arg(t, (void**)&retval);
+ YAGL_LOG_FUNC_ENTER_SPLIT5(glGetActiveAttrib, GLuint, GLuint, void*, void*, void*, program, index, size, type, name);
+ *name_count = 0;
+ *retval = yagl_host_glGetActiveAttrib(program, index, size, type, name, name_maxcount, name_count);
+ YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, *retval);
+
+ return true;
+}
+
+/*
+ * glGetActiveUniform dispatcher. id = 61
+ */
+static bool yagl_func_glGetActiveUniform(struct yagl_transport *t)
+{
+ GLuint program;
+ GLuint index;
+ GLint *size;
+ GLenum *type;
+ GLchar *name;
+ int32_t name_maxcount;
+ int32_t *name_count;
+ GLboolean *retval;
+ program = yagl_transport_get_out_GLuint(t);
+ index = yagl_transport_get_out_GLuint(t);
+ yagl_transport_get_in_arg(t, (void**)&size);
+ yagl_transport_get_in_arg(t, (void**)&type);
+ if (!yagl_transport_get_in_array(t, sizeof(GLchar), (void**)&name, &name_maxcount, &name_count)) {
+ return false;
+ }
+ yagl_transport_get_in_arg(t, (void**)&retval);
+ YAGL_LOG_FUNC_ENTER_SPLIT5(glGetActiveUniform, GLuint, GLuint, void*, void*, void*, program, index, size, type, name);
+ *name_count = 0;
+ *retval = yagl_host_glGetActiveUniform(program, index, size, type, name, name_maxcount, name_count);
+ YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, *retval);
+
+ return true;
+}
+
+/*
+ * glGetAttribLocation dispatcher. id = 62
+ */
+static bool yagl_func_glGetAttribLocation(struct yagl_transport *t)
+{
+ GLuint program;
+ const GLchar *name;
+ int32_t name_count;
+ int *retval;
+ program = yagl_transport_get_out_GLuint(t);
+ if (!yagl_transport_get_out_array(t, sizeof(GLchar), (const void**)&name, &name_count)) {
+ return false;
+ }
+ yagl_transport_get_in_arg(t, (void**)&retval);
+ YAGL_LOG_FUNC_ENTER_SPLIT2(glGetAttribLocation, GLuint, void*, program, name);
+ *retval = yagl_host_glGetAttribLocation(program, name, name_count);
+ YAGL_LOG_FUNC_EXIT_SPLIT(int, *retval);
+
+ return true;
+}
+
+/*
+ * glGetProgramiv dispatcher. id = 63
+ */
+static bool yagl_func_glGetProgramiv(struct yagl_transport *t)
+{
+ GLuint program;
+ GLenum pname;
+ GLint *param;
+ program = yagl_transport_get_out_GLuint(t);
+ pname = yagl_transport_get_out_GLenum(t);
+ yagl_transport_get_in_arg(t, (void**)&param);
+ YAGL_LOG_FUNC_ENTER_SPLIT3(glGetProgramiv, GLuint, GLenum, void*, program, pname, param);
+ (void)yagl_host_glGetProgramiv(program, pname, param);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glGetProgramInfoLog dispatcher. id = 64
+ */
+static bool yagl_func_glGetProgramInfoLog(struct yagl_transport *t)
+{
+ GLuint program;
+ GLchar *infolog;
+ int32_t infolog_maxcount;
+ int32_t *infolog_count;
+ GLboolean *retval;
+ program = yagl_transport_get_out_GLuint(t);
+ if (!yagl_transport_get_in_array(t, sizeof(GLchar), (void**)&infolog, &infolog_maxcount, &infolog_count)) {
+ return false;
+ }
+ yagl_transport_get_in_arg(t, (void**)&retval);
+ YAGL_LOG_FUNC_ENTER_SPLIT2(glGetProgramInfoLog, GLuint, void*, program, infolog);
+ *infolog_count = 0;
+ *retval = yagl_host_glGetProgramInfoLog(program, infolog, infolog_maxcount, infolog_count);
+ YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, *retval);
+
+ return true;
+}
+
+/*
+ * glGetShaderiv dispatcher. id = 65
+ */
+static bool yagl_func_glGetShaderiv(struct yagl_transport *t)
+{
+ GLuint shader;
+ GLenum pname;
+ GLint *param;
+ shader = yagl_transport_get_out_GLuint(t);
+ pname = yagl_transport_get_out_GLenum(t);
+ yagl_transport_get_in_arg(t, (void**)&param);
+ YAGL_LOG_FUNC_ENTER_SPLIT3(glGetShaderiv, GLuint, GLenum, void*, shader, pname, param);
+ (void)yagl_host_glGetShaderiv(shader, pname, param);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glGetShaderInfoLog dispatcher. id = 66
+ */
+static bool yagl_func_glGetShaderInfoLog(struct yagl_transport *t)
+{
+ GLuint shader;
+ GLchar *infolog;
+ int32_t infolog_maxcount;
+ int32_t *infolog_count;
+ GLboolean *retval;
+ shader = yagl_transport_get_out_GLuint(t);
+ if (!yagl_transport_get_in_array(t, sizeof(GLchar), (void**)&infolog, &infolog_maxcount, &infolog_count)) {
+ return false;
+ }
+ yagl_transport_get_in_arg(t, (void**)&retval);
+ YAGL_LOG_FUNC_ENTER_SPLIT2(glGetShaderInfoLog, GLuint, void*, shader, infolog);
+ *infolog_count = 0;
+ *retval = yagl_host_glGetShaderInfoLog(shader, infolog, infolog_maxcount, infolog_count);
+ YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, *retval);
+
+ return true;
+}
+
+/*
+ * glGetUniformfv dispatcher. id = 67
+ */
+static bool yagl_func_glGetUniformfv(struct yagl_transport *t)
+{
+ GLboolean tl;
+ GLuint program;
+ uint32_t location;
+ GLfloat *params;
+ int32_t params_maxcount;
+ int32_t *params_count;
+ tl = yagl_transport_get_out_GLboolean(t);
+ program = yagl_transport_get_out_GLuint(t);
+ location = yagl_transport_get_out_uint32_t(t);
+ if (!yagl_transport_get_in_array(t, sizeof(GLfloat), (void**)&params, &params_maxcount, &params_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT4(glGetUniformfv, GLboolean, GLuint, uint32_t, void*, tl, program, location, params);
+ *params_count = 0;
+ (void)yagl_host_glGetUniformfv(tl, program, location, params, params_maxcount, params_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glGetUniformiv dispatcher. id = 68
+ */
+static bool yagl_func_glGetUniformiv(struct yagl_transport *t)
+{
+ GLboolean tl;
+ GLuint program;
+ uint32_t location;
+ GLint *params;
+ int32_t params_maxcount;
+ int32_t *params_count;
+ tl = yagl_transport_get_out_GLboolean(t);
+ program = yagl_transport_get_out_GLuint(t);
+ location = yagl_transport_get_out_uint32_t(t);
+ if (!yagl_transport_get_in_array(t, sizeof(GLint), (void**)&params, &params_maxcount, &params_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT4(glGetUniformiv, GLboolean, GLuint, uint32_t, void*, tl, program, location, params);
+ *params_count = 0;
+ (void)yagl_host_glGetUniformiv(tl, program, location, params, params_maxcount, params_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glGetUniformLocation dispatcher. id = 69
+ */
+static bool yagl_func_glGetUniformLocation(struct yagl_transport *t)
+{
+ GLuint program;
+ const GLchar *name;
+ int32_t name_count;
+ int *retval;
+ program = yagl_transport_get_out_GLuint(t);
+ if (!yagl_transport_get_out_array(t, sizeof(GLchar), (const void**)&name, &name_count)) {
+ return false;
+ }
+ yagl_transport_get_in_arg(t, (void**)&retval);
+ YAGL_LOG_FUNC_ENTER_SPLIT2(glGetUniformLocation, GLuint, void*, program, name);
+ *retval = yagl_host_glGetUniformLocation(program, name, name_count);
+ YAGL_LOG_FUNC_EXIT_SPLIT(int, *retval);
+
+ return true;
+}
+
+/*
+ * glGetVertexAttribfv dispatcher. id = 70
+ */
+static bool yagl_func_glGetVertexAttribfv(struct yagl_transport *t)
+{
+ GLuint index;
+ GLenum pname;
+ GLfloat *params;
+ int32_t params_maxcount;
+ int32_t *params_count;
+ index = yagl_transport_get_out_GLuint(t);
+ pname = yagl_transport_get_out_GLenum(t);
+ if (!yagl_transport_get_in_array(t, sizeof(GLfloat), (void**)&params, &params_maxcount, &params_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT3(glGetVertexAttribfv, GLuint, GLenum, void*, index, pname, params);
+ *params_count = 0;
+ (void)yagl_host_glGetVertexAttribfv(index, pname, params, params_maxcount, params_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glGetVertexAttribiv dispatcher. id = 71
+ */
+static bool yagl_func_glGetVertexAttribiv(struct yagl_transport *t)
+{
+ GLuint index;
+ GLenum pname;
+ GLint *params;
+ int32_t params_maxcount;
+ int32_t *params_count;
+ index = yagl_transport_get_out_GLuint(t);
+ pname = yagl_transport_get_out_GLenum(t);
+ if (!yagl_transport_get_in_array(t, sizeof(GLint), (void**)&params, &params_maxcount, &params_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT3(glGetVertexAttribiv, GLuint, GLenum, void*, index, pname, params);
+ *params_count = 0;
+ (void)yagl_host_glGetVertexAttribiv(index, pname, params, params_maxcount, params_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glLinkProgram dispatcher. id = 72
+ */
+static bool yagl_func_glLinkProgram(struct yagl_transport *t)
+{
+ GLuint program;
+ program = yagl_transport_get_out_GLuint(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT1(glLinkProgram, GLuint, program);
+ (void)yagl_host_glLinkProgram(program);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glUniform1f dispatcher. id = 73
+ */
+static bool yagl_func_glUniform1f(struct yagl_transport *t)
+{
+ GLboolean tl;
+ uint32_t location;
+ GLfloat x;
+ tl = yagl_transport_get_out_GLboolean(t);
+ location = yagl_transport_get_out_uint32_t(t);
+ x = yagl_transport_get_out_GLfloat(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT3(glUniform1f, GLboolean, uint32_t, GLfloat, tl, location, x);
+ (void)yagl_host_glUniform1f(tl, location, x);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glUniform1fv dispatcher. id = 74
+ */
+static bool yagl_func_glUniform1fv(struct yagl_transport *t)
+{
+ GLboolean tl;
+ uint32_t location;
+ const GLfloat *v;
+ int32_t v_count;
+ tl = yagl_transport_get_out_GLboolean(t);
+ location = yagl_transport_get_out_uint32_t(t);
+ if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&v, &v_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT3(glUniform1fv, GLboolean, uint32_t, void*, tl, location, v);
+ (void)yagl_host_glUniform1fv(tl, location, v, v_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glUniform1i dispatcher. id = 75
+ */
+static bool yagl_func_glUniform1i(struct yagl_transport *t)
+{
+ GLboolean tl;
+ uint32_t location;
+ GLint x;
+ tl = yagl_transport_get_out_GLboolean(t);
+ location = yagl_transport_get_out_uint32_t(t);
+ x = yagl_transport_get_out_GLint(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT3(glUniform1i, GLboolean, uint32_t, GLint, tl, location, x);
+ (void)yagl_host_glUniform1i(tl, location, x);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glUniform1iv dispatcher. id = 76
+ */
+static bool yagl_func_glUniform1iv(struct yagl_transport *t)
+{
+ GLboolean tl;
+ uint32_t location;
+ const GLint *v;
+ int32_t v_count;
+ tl = yagl_transport_get_out_GLboolean(t);
+ location = yagl_transport_get_out_uint32_t(t);
+ if (!yagl_transport_get_out_array(t, sizeof(GLint), (const void**)&v, &v_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT3(glUniform1iv, GLboolean, uint32_t, void*, tl, location, v);
+ (void)yagl_host_glUniform1iv(tl, location, v, v_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glUniform2f dispatcher. id = 77
+ */
+static bool yagl_func_glUniform2f(struct yagl_transport *t)
+{
+ GLboolean tl;
+ uint32_t location;
+ GLfloat x;
+ GLfloat y;
+ tl = yagl_transport_get_out_GLboolean(t);
+ location = yagl_transport_get_out_uint32_t(t);
+ x = yagl_transport_get_out_GLfloat(t);
+ y = yagl_transport_get_out_GLfloat(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT4(glUniform2f, GLboolean, uint32_t, GLfloat, GLfloat, tl, location, x, y);
+ (void)yagl_host_glUniform2f(tl, location, x, y);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glUniform2fv dispatcher. id = 78
+ */
+static bool yagl_func_glUniform2fv(struct yagl_transport *t)
+{
+ GLboolean tl;
+ uint32_t location;
+ const GLfloat *v;
+ int32_t v_count;
+ tl = yagl_transport_get_out_GLboolean(t);
+ location = yagl_transport_get_out_uint32_t(t);
+ if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&v, &v_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT3(glUniform2fv, GLboolean, uint32_t, void*, tl, location, v);
+ (void)yagl_host_glUniform2fv(tl, location, v, v_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glUniform2i dispatcher. id = 79
+ */
+static bool yagl_func_glUniform2i(struct yagl_transport *t)
+{
+ GLboolean tl;
+ uint32_t location;
+ GLint x;
+ GLint y;
+ tl = yagl_transport_get_out_GLboolean(t);
+ location = yagl_transport_get_out_uint32_t(t);
+ x = yagl_transport_get_out_GLint(t);
+ y = yagl_transport_get_out_GLint(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT4(glUniform2i, GLboolean, uint32_t, GLint, GLint, tl, location, x, y);
+ (void)yagl_host_glUniform2i(tl, location, x, y);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glUniform2iv dispatcher. id = 80
+ */
+static bool yagl_func_glUniform2iv(struct yagl_transport *t)
+{
+ GLboolean tl;
+ uint32_t location;
+ const GLint *v;
+ int32_t v_count;
+ tl = yagl_transport_get_out_GLboolean(t);
+ location = yagl_transport_get_out_uint32_t(t);
+ if (!yagl_transport_get_out_array(t, sizeof(GLint), (const void**)&v, &v_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT3(glUniform2iv, GLboolean, uint32_t, void*, tl, location, v);
+ (void)yagl_host_glUniform2iv(tl, location, v, v_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glUniform3f dispatcher. id = 81
+ */
+static bool yagl_func_glUniform3f(struct yagl_transport *t)
+{
+ GLboolean tl;
+ uint32_t location;
+ GLfloat x;
+ GLfloat y;
+ GLfloat z;
+ tl = yagl_transport_get_out_GLboolean(t);
+ location = yagl_transport_get_out_uint32_t(t);
+ x = yagl_transport_get_out_GLfloat(t);
+ y = yagl_transport_get_out_GLfloat(t);
+ z = yagl_transport_get_out_GLfloat(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT5(glUniform3f, GLboolean, uint32_t, GLfloat, GLfloat, GLfloat, tl, location, x, y, z);
+ (void)yagl_host_glUniform3f(tl, location, x, y, z);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glUniform3fv dispatcher. id = 82
+ */
+static bool yagl_func_glUniform3fv(struct yagl_transport *t)
+{
+ GLboolean tl;
+ uint32_t location;
+ const GLfloat *v;
+ int32_t v_count;
+ tl = yagl_transport_get_out_GLboolean(t);
+ location = yagl_transport_get_out_uint32_t(t);
+ if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&v, &v_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT3(glUniform3fv, GLboolean, uint32_t, void*, tl, location, v);
+ (void)yagl_host_glUniform3fv(tl, location, v, v_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glUniform3i dispatcher. id = 83
+ */
+static bool yagl_func_glUniform3i(struct yagl_transport *t)
+{
+ GLboolean tl;
+ uint32_t location;
+ GLint x;
+ GLint y;
+ GLint z;
+ tl = yagl_transport_get_out_GLboolean(t);
+ location = yagl_transport_get_out_uint32_t(t);
+ x = yagl_transport_get_out_GLint(t);
+ y = yagl_transport_get_out_GLint(t);
+ z = yagl_transport_get_out_GLint(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT5(glUniform3i, GLboolean, uint32_t, GLint, GLint, GLint, tl, location, x, y, z);
+ (void)yagl_host_glUniform3i(tl, location, x, y, z);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glUniform3iv dispatcher. id = 84
+ */
+static bool yagl_func_glUniform3iv(struct yagl_transport *t)
+{
+ GLboolean tl;
+ uint32_t location;
+ const GLint *v;
+ int32_t v_count;
+ tl = yagl_transport_get_out_GLboolean(t);
+ location = yagl_transport_get_out_uint32_t(t);
+ if (!yagl_transport_get_out_array(t, sizeof(GLint), (const void**)&v, &v_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT3(glUniform3iv, GLboolean, uint32_t, void*, tl, location, v);
+ (void)yagl_host_glUniform3iv(tl, location, v, v_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glUniform4f dispatcher. id = 85
+ */
+static bool yagl_func_glUniform4f(struct yagl_transport *t)
+{
+ GLboolean tl;
+ uint32_t location;
+ GLfloat x;
+ GLfloat y;
+ GLfloat z;
+ GLfloat w;
+ tl = yagl_transport_get_out_GLboolean(t);
+ location = yagl_transport_get_out_uint32_t(t);
+ x = yagl_transport_get_out_GLfloat(t);
+ y = yagl_transport_get_out_GLfloat(t);
+ z = yagl_transport_get_out_GLfloat(t);
+ w = yagl_transport_get_out_GLfloat(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT6(glUniform4f, GLboolean, uint32_t, GLfloat, GLfloat, GLfloat, GLfloat, tl, location, x, y, z, w);
+ (void)yagl_host_glUniform4f(tl, location, x, y, z, w);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glUniform4fv dispatcher. id = 86
+ */
+static bool yagl_func_glUniform4fv(struct yagl_transport *t)
+{
+ GLboolean tl;
+ uint32_t location;
+ const GLfloat *v;
+ int32_t v_count;
+ tl = yagl_transport_get_out_GLboolean(t);
+ location = yagl_transport_get_out_uint32_t(t);
+ if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&v, &v_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT3(glUniform4fv, GLboolean, uint32_t, void*, tl, location, v);
+ (void)yagl_host_glUniform4fv(tl, location, v, v_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glUniform4i dispatcher. id = 87
+ */
+static bool yagl_func_glUniform4i(struct yagl_transport *t)
+{
+ GLboolean tl;
+ uint32_t location;
+ GLint x;
+ GLint y;
+ GLint z;
+ GLint w;
+ tl = yagl_transport_get_out_GLboolean(t);
+ location = yagl_transport_get_out_uint32_t(t);
+ x = yagl_transport_get_out_GLint(t);
+ y = yagl_transport_get_out_GLint(t);
+ z = yagl_transport_get_out_GLint(t);
+ w = yagl_transport_get_out_GLint(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT6(glUniform4i, GLboolean, uint32_t, GLint, GLint, GLint, GLint, tl, location, x, y, z, w);
+ (void)yagl_host_glUniform4i(tl, location, x, y, z, w);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glUniform4iv dispatcher. id = 88
+ */
+static bool yagl_func_glUniform4iv(struct yagl_transport *t)
+{
+ GLboolean tl;
+ uint32_t location;
+ const GLint *v;
+ int32_t v_count;
+ tl = yagl_transport_get_out_GLboolean(t);
+ location = yagl_transport_get_out_uint32_t(t);
+ if (!yagl_transport_get_out_array(t, sizeof(GLint), (const void**)&v, &v_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT3(glUniform4iv, GLboolean, uint32_t, void*, tl, location, v);
+ (void)yagl_host_glUniform4iv(tl, location, v, v_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glUniformMatrix2fv dispatcher. id = 89
+ */
+static bool yagl_func_glUniformMatrix2fv(struct yagl_transport *t)
+{
+ GLboolean tl;
+ uint32_t location;
+ GLboolean transpose;
+ const GLfloat *value;
+ int32_t value_count;
+ tl = yagl_transport_get_out_GLboolean(t);
+ location = yagl_transport_get_out_uint32_t(t);
+ transpose = yagl_transport_get_out_GLboolean(t);
+ if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&value, &value_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT4(glUniformMatrix2fv, GLboolean, uint32_t, GLboolean, void*, tl, location, transpose, value);
+ (void)yagl_host_glUniformMatrix2fv(tl, location, transpose, value, value_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glUniformMatrix3fv dispatcher. id = 90
+ */
+static bool yagl_func_glUniformMatrix3fv(struct yagl_transport *t)
+{
+ GLboolean tl;
+ uint32_t location;
+ GLboolean transpose;
+ const GLfloat *value;
+ int32_t value_count;
+ tl = yagl_transport_get_out_GLboolean(t);
+ location = yagl_transport_get_out_uint32_t(t);
+ transpose = yagl_transport_get_out_GLboolean(t);
+ if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&value, &value_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT4(glUniformMatrix3fv, GLboolean, uint32_t, GLboolean, void*, tl, location, transpose, value);
+ (void)yagl_host_glUniformMatrix3fv(tl, location, transpose, value, value_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glUniformMatrix4fv dispatcher. id = 91
+ */
+static bool yagl_func_glUniformMatrix4fv(struct yagl_transport *t)
+{
+ GLboolean tl;
+ uint32_t location;
+ GLboolean transpose;
+ const GLfloat *value;
+ int32_t value_count;
+ tl = yagl_transport_get_out_GLboolean(t);
+ location = yagl_transport_get_out_uint32_t(t);
+ transpose = yagl_transport_get_out_GLboolean(t);
+ if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&value, &value_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT4(glUniformMatrix4fv, GLboolean, uint32_t, GLboolean, void*, tl, location, transpose, value);
+ (void)yagl_host_glUniformMatrix4fv(tl, location, transpose, value, value_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glUseProgram dispatcher. id = 92
+ */
+static bool yagl_func_glUseProgram(struct yagl_transport *t)
+{
+ GLuint program;
+ program = yagl_transport_get_out_GLuint(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT1(glUseProgram, GLuint, program);
+ (void)yagl_host_glUseProgram(program);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glValidateProgram dispatcher. id = 93
+ */
+static bool yagl_func_glValidateProgram(struct yagl_transport *t)
+{
+ GLuint program;
+ program = yagl_transport_get_out_GLuint(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT1(glValidateProgram, GLuint, program);
+ (void)yagl_host_glValidateProgram(program);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glVertexAttrib1f dispatcher. id = 94
+ */
+static bool yagl_func_glVertexAttrib1f(struct yagl_transport *t)
+{
+ GLuint indx;
+ GLfloat x;
+ indx = yagl_transport_get_out_GLuint(t);
+ x = yagl_transport_get_out_GLfloat(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT2(glVertexAttrib1f, GLuint, GLfloat, indx, x);
+ (void)yagl_host_glVertexAttrib1f(indx, x);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glVertexAttrib1fv dispatcher. id = 95
+ */
+static bool yagl_func_glVertexAttrib1fv(struct yagl_transport *t)
+{
+ GLuint indx;
+ const GLfloat *values;
+ int32_t values_count;
+ indx = yagl_transport_get_out_GLuint(t);
+ if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&values, &values_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT2(glVertexAttrib1fv, GLuint, void*, indx, values);
+ (void)yagl_host_glVertexAttrib1fv(indx, values, values_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glVertexAttrib2f dispatcher. id = 96
+ */
+static bool yagl_func_glVertexAttrib2f(struct yagl_transport *t)
+{
+ GLuint indx;
+ GLfloat x;
+ GLfloat y;
+ indx = yagl_transport_get_out_GLuint(t);
+ x = yagl_transport_get_out_GLfloat(t);
+ y = yagl_transport_get_out_GLfloat(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT3(glVertexAttrib2f, GLuint, GLfloat, GLfloat, indx, x, y);
+ (void)yagl_host_glVertexAttrib2f(indx, x, y);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glVertexAttrib2fv dispatcher. id = 97
+ */
+static bool yagl_func_glVertexAttrib2fv(struct yagl_transport *t)
+{
+ GLuint indx;
+ const GLfloat *values;
+ int32_t values_count;
+ indx = yagl_transport_get_out_GLuint(t);
+ if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&values, &values_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT2(glVertexAttrib2fv, GLuint, void*, indx, values);
+ (void)yagl_host_glVertexAttrib2fv(indx, values, values_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glVertexAttrib3f dispatcher. id = 98
+ */
+static bool yagl_func_glVertexAttrib3f(struct yagl_transport *t)
+{
+ GLuint indx;
+ GLfloat x;
+ GLfloat y;
+ GLfloat z;
+ indx = yagl_transport_get_out_GLuint(t);
+ x = yagl_transport_get_out_GLfloat(t);
+ y = yagl_transport_get_out_GLfloat(t);
+ z = yagl_transport_get_out_GLfloat(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT4(glVertexAttrib3f, GLuint, GLfloat, GLfloat, GLfloat, indx, x, y, z);
+ (void)yagl_host_glVertexAttrib3f(indx, x, y, z);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glVertexAttrib3fv dispatcher. id = 99
+ */
+static bool yagl_func_glVertexAttrib3fv(struct yagl_transport *t)
+{
+ GLuint indx;
+ const GLfloat *values;
+ int32_t values_count;
+ indx = yagl_transport_get_out_GLuint(t);
+ if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&values, &values_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT2(glVertexAttrib3fv, GLuint, void*, indx, values);
+ (void)yagl_host_glVertexAttrib3fv(indx, values, values_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glVertexAttrib4f dispatcher. id = 100
+ */
+static bool yagl_func_glVertexAttrib4f(struct yagl_transport *t)
+{
+ GLuint indx;
+ GLfloat x;
+ GLfloat y;
+ GLfloat z;
+ GLfloat w;
+ indx = yagl_transport_get_out_GLuint(t);
+ x = yagl_transport_get_out_GLfloat(t);
+ y = yagl_transport_get_out_GLfloat(t);
+ z = yagl_transport_get_out_GLfloat(t);
+ w = yagl_transport_get_out_GLfloat(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT5(glVertexAttrib4f, GLuint, GLfloat, GLfloat, GLfloat, GLfloat, indx, x, y, z, w);
+ (void)yagl_host_glVertexAttrib4f(indx, x, y, z, w);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glVertexAttrib4fv dispatcher. id = 101
+ */
+static bool yagl_func_glVertexAttrib4fv(struct yagl_transport *t)
+{
+ GLuint indx;
+ const GLfloat *values;
+ int32_t values_count;
+ indx = yagl_transport_get_out_GLuint(t);
+ if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&values, &values_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT2(glVertexAttrib4fv, GLuint, void*, indx, values);
+ (void)yagl_host_glVertexAttrib4fv(indx, values, values_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glGetIntegerv dispatcher. id = 102
+ */
+static bool yagl_func_glGetIntegerv(struct yagl_transport *t)
+{
+ GLenum pname;
+ GLint *params;
+ int32_t params_maxcount;
+ int32_t *params_count;
+ pname = yagl_transport_get_out_GLenum(t);
+ if (!yagl_transport_get_in_array(t, sizeof(GLint), (void**)&params, &params_maxcount, &params_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT2(glGetIntegerv, GLenum, void*, pname, params);
+ *params_count = 0;
+ (void)yagl_host_glGetIntegerv(pname, params, params_maxcount, params_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glGetFloatv dispatcher. id = 103
+ */
+static bool yagl_func_glGetFloatv(struct yagl_transport *t)
+{
+ GLenum pname;
+ GLfloat *params;
+ int32_t params_maxcount;
+ int32_t *params_count;
+ pname = yagl_transport_get_out_GLenum(t);
+ if (!yagl_transport_get_in_array(t, sizeof(GLfloat), (void**)&params, &params_maxcount, &params_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT2(glGetFloatv, GLenum, void*, pname, params);
+ *params_count = 0;
+ (void)yagl_host_glGetFloatv(pname, params, params_maxcount, params_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glGetString dispatcher. id = 104
+ */
+static bool yagl_func_glGetString(struct yagl_transport *t)
+{
+ GLenum name;
+ GLchar *str;
+ int32_t str_maxcount;
+ int32_t *str_count;
+ name = yagl_transport_get_out_GLenum(t);
+ if (!yagl_transport_get_in_array(t, sizeof(GLchar), (void**)&str, &str_maxcount, &str_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT2(glGetString, GLenum, void*, name, str);
+ *str_count = 0;
+ (void)yagl_host_glGetString(name, str, str_maxcount, str_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glIsEnabled dispatcher. id = 105
+ */
+static bool yagl_func_glIsEnabled(struct yagl_transport *t)
+{
+ GLenum cap;
+ GLboolean *retval;
+ cap = yagl_transport_get_out_GLenum(t);
+ yagl_transport_get_in_arg(t, (void**)&retval);
+ YAGL_LOG_FUNC_ENTER_SPLIT1(glIsEnabled, GLenum, cap);
+ *retval = yagl_host_glIsEnabled(cap);
+ YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, *retval);
+
+ return true;
+}
+
+/*
+ * glDeleteObjects dispatcher. id = 106
+ */
+static bool yagl_func_glDeleteObjects(struct yagl_transport *t)
+{
+ const GLuint *objects;
+ int32_t objects_count;
+ if (!yagl_transport_get_out_array(t, sizeof(GLuint), (const void**)&objects, &objects_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT1(glDeleteObjects, void*, objects);
+ (void)yagl_host_glDeleteObjects(objects, objects_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glBlendEquation dispatcher. id = 107
+ */
+static bool yagl_func_glBlendEquation(struct yagl_transport *t)
+{
+ GLenum mode;
+ mode = yagl_transport_get_out_GLenum(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT1(glBlendEquation, GLenum, mode);
+ (void)yagl_host_glBlendEquation(mode);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glBlendEquationSeparate dispatcher. id = 108
+ */
+static bool yagl_func_glBlendEquationSeparate(struct yagl_transport *t)
+{
+ GLenum modeRGB;
+ GLenum modeAlpha;
+ modeRGB = yagl_transport_get_out_GLenum(t);
+ modeAlpha = yagl_transport_get_out_GLenum(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT2(glBlendEquationSeparate, GLenum, GLenum, modeRGB, modeAlpha);
+ (void)yagl_host_glBlendEquationSeparate(modeRGB, modeAlpha);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glBlendFunc dispatcher. id = 109
+ */
+static bool yagl_func_glBlendFunc(struct yagl_transport *t)
+{
+ GLenum sfactor;
+ GLenum dfactor;
+ sfactor = yagl_transport_get_out_GLenum(t);
+ dfactor = yagl_transport_get_out_GLenum(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT2(glBlendFunc, GLenum, GLenum, sfactor, dfactor);
+ (void)yagl_host_glBlendFunc(sfactor, dfactor);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glBlendFuncSeparate dispatcher. id = 110
+ */
+static bool yagl_func_glBlendFuncSeparate(struct yagl_transport *t)
+{
+ GLenum srcRGB;
+ GLenum dstRGB;
+ GLenum srcAlpha;
+ GLenum dstAlpha;
+ srcRGB = yagl_transport_get_out_GLenum(t);
+ dstRGB = yagl_transport_get_out_GLenum(t);
+ srcAlpha = yagl_transport_get_out_GLenum(t);
+ dstAlpha = yagl_transport_get_out_GLenum(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT4(glBlendFuncSeparate, GLenum, GLenum, GLenum, GLenum, srcRGB, dstRGB, srcAlpha, dstAlpha);
+ (void)yagl_host_glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glBlendColor dispatcher. id = 111
+ */
+static bool yagl_func_glBlendColor(struct yagl_transport *t)
+{
+ GLclampf red;
+ GLclampf green;
+ GLclampf blue;
+ GLclampf alpha;
+ red = yagl_transport_get_out_GLclampf(t);
+ green = yagl_transport_get_out_GLclampf(t);
+ blue = yagl_transport_get_out_GLclampf(t);
+ alpha = yagl_transport_get_out_GLclampf(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT4(glBlendColor, GLclampf, GLclampf, GLclampf, GLclampf, red, green, blue, alpha);
+ (void)yagl_host_glBlendColor(red, green, blue, alpha);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glClear dispatcher. id = 112
+ */
+static bool yagl_func_glClear(struct yagl_transport *t)
+{
+ GLbitfield mask;
+ mask = yagl_transport_get_out_GLbitfield(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT1(glClear, GLbitfield, mask);
+ (void)yagl_host_glClear(mask);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glClearColor dispatcher. id = 113
+ */
+static bool yagl_func_glClearColor(struct yagl_transport *t)
+{
+ GLclampf red;
+ GLclampf green;
+ GLclampf blue;
+ GLclampf alpha;
+ red = yagl_transport_get_out_GLclampf(t);
+ green = yagl_transport_get_out_GLclampf(t);
+ blue = yagl_transport_get_out_GLclampf(t);
+ alpha = yagl_transport_get_out_GLclampf(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT4(glClearColor, GLclampf, GLclampf, GLclampf, GLclampf, red, green, blue, alpha);
+ (void)yagl_host_glClearColor(red, green, blue, alpha);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glClearDepthf dispatcher. id = 114
+ */
+static bool yagl_func_glClearDepthf(struct yagl_transport *t)
+{
+ GLclampf depth;
+ depth = yagl_transport_get_out_GLclampf(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT1(glClearDepthf, GLclampf, depth);
+ (void)yagl_host_glClearDepthf(depth);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glClearStencil dispatcher. id = 115
+ */
+static bool yagl_func_glClearStencil(struct yagl_transport *t)
+{
+ GLint s;
+ s = yagl_transport_get_out_GLint(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT1(glClearStencil, GLint, s);
+ (void)yagl_host_glClearStencil(s);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glColorMask dispatcher. id = 116
+ */
+static bool yagl_func_glColorMask(struct yagl_transport *t)
+{
+ GLboolean red;
+ GLboolean green;
+ GLboolean blue;
+ GLboolean alpha;
+ red = yagl_transport_get_out_GLboolean(t);
+ green = yagl_transport_get_out_GLboolean(t);
+ blue = yagl_transport_get_out_GLboolean(t);
+ alpha = yagl_transport_get_out_GLboolean(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT4(glColorMask, GLboolean, GLboolean, GLboolean, GLboolean, red, green, blue, alpha);
+ (void)yagl_host_glColorMask(red, green, blue, alpha);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glCullFace dispatcher. id = 117
+ */
+static bool yagl_func_glCullFace(struct yagl_transport *t)
+{
+ GLenum mode;
+ mode = yagl_transport_get_out_GLenum(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT1(glCullFace, GLenum, mode);
+ (void)yagl_host_glCullFace(mode);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glDepthFunc dispatcher. id = 118
+ */
+static bool yagl_func_glDepthFunc(struct yagl_transport *t)
+{
+ GLenum func;
+ func = yagl_transport_get_out_GLenum(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT1(glDepthFunc, GLenum, func);
+ (void)yagl_host_glDepthFunc(func);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glDepthMask dispatcher. id = 119
+ */
+static bool yagl_func_glDepthMask(struct yagl_transport *t)
+{
+ GLboolean flag;
+ flag = yagl_transport_get_out_GLboolean(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT1(glDepthMask, GLboolean, flag);
+ (void)yagl_host_glDepthMask(flag);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glDepthRangef dispatcher. id = 120
+ */
+static bool yagl_func_glDepthRangef(struct yagl_transport *t)
+{
+ GLclampf zNear;
+ GLclampf zFar;
+ zNear = yagl_transport_get_out_GLclampf(t);
+ zFar = yagl_transport_get_out_GLclampf(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT2(glDepthRangef, GLclampf, GLclampf, zNear, zFar);
+ (void)yagl_host_glDepthRangef(zNear, zFar);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glEnable dispatcher. id = 121
+ */
+static bool yagl_func_glEnable(struct yagl_transport *t)
+{
+ GLenum cap;
+ cap = yagl_transport_get_out_GLenum(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT1(glEnable, GLenum, cap);
+ (void)yagl_host_glEnable(cap);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glDisable dispatcher. id = 122
+ */
+static bool yagl_func_glDisable(struct yagl_transport *t)
+{
+ GLenum cap;
+ cap = yagl_transport_get_out_GLenum(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT1(glDisable, GLenum, cap);
+ (void)yagl_host_glDisable(cap);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glFlush dispatcher. id = 123
+ */
+static bool yagl_func_glFlush(struct yagl_transport *t)
+{
+ YAGL_LOG_FUNC_ENTER_SPLIT0(glFlush);
+ (void)yagl_host_glFlush();
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glFrontFace dispatcher. id = 124
+ */
+static bool yagl_func_glFrontFace(struct yagl_transport *t)
+{
+ GLenum mode;
+ mode = yagl_transport_get_out_GLenum(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT1(glFrontFace, GLenum, mode);
+ (void)yagl_host_glFrontFace(mode);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glGenerateMipmap dispatcher. id = 125
+ */
+static bool yagl_func_glGenerateMipmap(struct yagl_transport *t)
+{
+ GLenum target;
+ target = yagl_transport_get_out_GLenum(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT1(glGenerateMipmap, GLenum, target);
+ (void)yagl_host_glGenerateMipmap(target);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glHint dispatcher. id = 126
+ */
+static bool yagl_func_glHint(struct yagl_transport *t)
+{
+ GLenum target;
+ GLenum mode;
+ target = yagl_transport_get_out_GLenum(t);
+ mode = yagl_transport_get_out_GLenum(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT2(glHint, GLenum, GLenum, target, mode);
+ (void)yagl_host_glHint(target, mode);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glLineWidth dispatcher. id = 127
+ */
+static bool yagl_func_glLineWidth(struct yagl_transport *t)
+{
+ GLfloat width;
+ width = yagl_transport_get_out_GLfloat(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT1(glLineWidth, GLfloat, width);
+ (void)yagl_host_glLineWidth(width);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glPixelStorei dispatcher. id = 128
+ */
+static bool yagl_func_glPixelStorei(struct yagl_transport *t)
+{
+ GLenum pname;
+ GLint param;
+ pname = yagl_transport_get_out_GLenum(t);
+ param = yagl_transport_get_out_GLint(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT2(glPixelStorei, GLenum, GLint, pname, param);
+ (void)yagl_host_glPixelStorei(pname, param);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glPolygonOffset dispatcher. id = 129
+ */
+static bool yagl_func_glPolygonOffset(struct yagl_transport *t)
+{
+ GLfloat factor;
+ GLfloat units;
+ factor = yagl_transport_get_out_GLfloat(t);
+ units = yagl_transport_get_out_GLfloat(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT2(glPolygonOffset, GLfloat, GLfloat, factor, units);
+ (void)yagl_host_glPolygonOffset(factor, units);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glScissor dispatcher. id = 130
+ */
+static bool yagl_func_glScissor(struct yagl_transport *t)
+{
+ GLint x;
+ GLint y;
+ GLsizei width;
+ GLsizei height;
+ x = yagl_transport_get_out_GLint(t);
+ y = yagl_transport_get_out_GLint(t);
+ width = yagl_transport_get_out_GLsizei(t);
+ height = yagl_transport_get_out_GLsizei(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT4(glScissor, GLint, GLint, GLsizei, GLsizei, x, y, width, height);
+ (void)yagl_host_glScissor(x, y, width, height);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glStencilFunc dispatcher. id = 131
+ */
+static bool yagl_func_glStencilFunc(struct yagl_transport *t)
+{
+ GLenum func;
+ GLint ref;
+ GLuint mask;
+ func = yagl_transport_get_out_GLenum(t);
+ ref = yagl_transport_get_out_GLint(t);
+ mask = yagl_transport_get_out_GLuint(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT3(glStencilFunc, GLenum, GLint, GLuint, func, ref, mask);
+ (void)yagl_host_glStencilFunc(func, ref, mask);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glStencilMask dispatcher. id = 132
+ */
+static bool yagl_func_glStencilMask(struct yagl_transport *t)
+{
+ GLuint mask;
+ mask = yagl_transport_get_out_GLuint(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT1(glStencilMask, GLuint, mask);
+ (void)yagl_host_glStencilMask(mask);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glStencilOp dispatcher. id = 133
+ */
+static bool yagl_func_glStencilOp(struct yagl_transport *t)
+{
+ GLenum fail;
+ GLenum zfail;
+ GLenum zpass;
+ fail = yagl_transport_get_out_GLenum(t);
+ zfail = yagl_transport_get_out_GLenum(t);
+ zpass = yagl_transport_get_out_GLenum(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT3(glStencilOp, GLenum, GLenum, GLenum, fail, zfail, zpass);
+ (void)yagl_host_glStencilOp(fail, zfail, zpass);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glSampleCoverage dispatcher. id = 134
+ */
+static bool yagl_func_glSampleCoverage(struct yagl_transport *t)
+{
+ GLclampf value;
+ GLboolean invert;
+ value = yagl_transport_get_out_GLclampf(t);
+ invert = yagl_transport_get_out_GLboolean(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT2(glSampleCoverage, GLclampf, GLboolean, value, invert);
+ (void)yagl_host_glSampleCoverage(value, invert);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glViewport dispatcher. id = 135
+ */
+static bool yagl_func_glViewport(struct yagl_transport *t)
+{
+ GLint x;
+ GLint y;
+ GLsizei width;
+ GLsizei height;
+ x = yagl_transport_get_out_GLint(t);
+ y = yagl_transport_get_out_GLint(t);
+ width = yagl_transport_get_out_GLsizei(t);
+ height = yagl_transport_get_out_GLsizei(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT4(glViewport, GLint, GLint, GLsizei, GLsizei, x, y, width, height);
+ (void)yagl_host_glViewport(x, y, width, height);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glStencilFuncSeparate dispatcher. id = 136
+ */
+static bool yagl_func_glStencilFuncSeparate(struct yagl_transport *t)
+{
+ GLenum face;
+ GLenum func;
+ GLint ref;
+ GLuint mask;
+ face = yagl_transport_get_out_GLenum(t);
+ func = yagl_transport_get_out_GLenum(t);
+ ref = yagl_transport_get_out_GLint(t);
+ mask = yagl_transport_get_out_GLuint(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT4(glStencilFuncSeparate, GLenum, GLenum, GLint, GLuint, face, func, ref, mask);
+ (void)yagl_host_glStencilFuncSeparate(face, func, ref, mask);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glStencilMaskSeparate dispatcher. id = 137
+ */
+static bool yagl_func_glStencilMaskSeparate(struct yagl_transport *t)
+{
+ GLenum face;
+ GLuint mask;
+ face = yagl_transport_get_out_GLenum(t);
+ mask = yagl_transport_get_out_GLuint(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT2(glStencilMaskSeparate, GLenum, GLuint, face, mask);
+ (void)yagl_host_glStencilMaskSeparate(face, mask);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glStencilOpSeparate dispatcher. id = 138
+ */
+static bool yagl_func_glStencilOpSeparate(struct yagl_transport *t)
+{
+ GLenum face;
+ GLenum fail;
+ GLenum zfail;
+ GLenum zpass;
+ face = yagl_transport_get_out_GLenum(t);
+ fail = yagl_transport_get_out_GLenum(t);
+ zfail = yagl_transport_get_out_GLenum(t);
+ zpass = yagl_transport_get_out_GLenum(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT4(glStencilOpSeparate, GLenum, GLenum, GLenum, GLenum, face, fail, zfail, zpass);
+ (void)yagl_host_glStencilOpSeparate(face, fail, zfail, zpass);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glPointSize dispatcher. id = 139
+ */
+static bool yagl_func_glPointSize(struct yagl_transport *t)
+{
+ GLfloat size;
+ size = yagl_transport_get_out_GLfloat(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT1(glPointSize, GLfloat, size);
+ (void)yagl_host_glPointSize(size);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glAlphaFunc dispatcher. id = 140
+ */
+static bool yagl_func_glAlphaFunc(struct yagl_transport *t)
+{
+ GLenum func;
+ GLclampf ref;
+ func = yagl_transport_get_out_GLenum(t);
+ ref = yagl_transport_get_out_GLclampf(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT2(glAlphaFunc, GLenum, GLclampf, func, ref);
+ (void)yagl_host_glAlphaFunc(func, ref);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glMatrixMode dispatcher. id = 141
+ */
+static bool yagl_func_glMatrixMode(struct yagl_transport *t)
+{
+ GLenum mode;
+ mode = yagl_transport_get_out_GLenum(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT1(glMatrixMode, GLenum, mode);
+ (void)yagl_host_glMatrixMode(mode);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glLoadIdentity dispatcher. id = 142
+ */
+static bool yagl_func_glLoadIdentity(struct yagl_transport *t)
+{
+ YAGL_LOG_FUNC_ENTER_SPLIT0(glLoadIdentity);
+ (void)yagl_host_glLoadIdentity();
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glPopMatrix dispatcher. id = 143
+ */
+static bool yagl_func_glPopMatrix(struct yagl_transport *t)
+{
+ YAGL_LOG_FUNC_ENTER_SPLIT0(glPopMatrix);
+ (void)yagl_host_glPopMatrix();
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glPushMatrix dispatcher. id = 144
+ */
+static bool yagl_func_glPushMatrix(struct yagl_transport *t)
+{
+ YAGL_LOG_FUNC_ENTER_SPLIT0(glPushMatrix);
+ (void)yagl_host_glPushMatrix();
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glRotatef dispatcher. id = 145
+ */
+static bool yagl_func_glRotatef(struct yagl_transport *t)
+{
+ GLfloat angle;
+ GLfloat x;
+ GLfloat y;
+ GLfloat z;
+ angle = yagl_transport_get_out_GLfloat(t);
+ x = yagl_transport_get_out_GLfloat(t);
+ y = yagl_transport_get_out_GLfloat(t);
+ z = yagl_transport_get_out_GLfloat(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT4(glRotatef, GLfloat, GLfloat, GLfloat, GLfloat, angle, x, y, z);
+ (void)yagl_host_glRotatef(angle, x, y, z);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glTranslatef dispatcher. id = 146
+ */
+static bool yagl_func_glTranslatef(struct yagl_transport *t)
+{
+ GLfloat x;
+ GLfloat y;
+ GLfloat z;
+ x = yagl_transport_get_out_GLfloat(t);
+ y = yagl_transport_get_out_GLfloat(t);
+ z = yagl_transport_get_out_GLfloat(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT3(glTranslatef, GLfloat, GLfloat, GLfloat, x, y, z);
+ (void)yagl_host_glTranslatef(x, y, z);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glScalef dispatcher. id = 147
+ */
+static bool yagl_func_glScalef(struct yagl_transport *t)
+{
+ GLfloat x;
+ GLfloat y;
+ GLfloat z;
+ x = yagl_transport_get_out_GLfloat(t);
+ y = yagl_transport_get_out_GLfloat(t);
+ z = yagl_transport_get_out_GLfloat(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT3(glScalef, GLfloat, GLfloat, GLfloat, x, y, z);
+ (void)yagl_host_glScalef(x, y, z);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glOrthof dispatcher. id = 148
+ */
+static bool yagl_func_glOrthof(struct yagl_transport *t)
+{
+ GLfloat left;
+ GLfloat right;
+ GLfloat bottom;
+ GLfloat top;
+ GLfloat zNear;
+ GLfloat zFar;
+ left = yagl_transport_get_out_GLfloat(t);
+ right = yagl_transport_get_out_GLfloat(t);
+ bottom = yagl_transport_get_out_GLfloat(t);
+ top = yagl_transport_get_out_GLfloat(t);
+ zNear = yagl_transport_get_out_GLfloat(t);
+ zFar = yagl_transport_get_out_GLfloat(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT6(glOrthof, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, left, right, bottom, top, zNear, zFar);
+ (void)yagl_host_glOrthof(left, right, bottom, top, zNear, zFar);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glColor4f dispatcher. id = 149
+ */
+static bool yagl_func_glColor4f(struct yagl_transport *t)
+{
+ GLfloat red;
+ GLfloat green;
+ GLfloat blue;
+ GLfloat alpha;
+ red = yagl_transport_get_out_GLfloat(t);
+ green = yagl_transport_get_out_GLfloat(t);
+ blue = yagl_transport_get_out_GLfloat(t);
+ alpha = yagl_transport_get_out_GLfloat(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT4(glColor4f, GLfloat, GLfloat, GLfloat, GLfloat, red, green, blue, alpha);
+ (void)yagl_host_glColor4f(red, green, blue, alpha);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glColor4ub dispatcher. id = 150
+ */
+static bool yagl_func_glColor4ub(struct yagl_transport *t)
+{
+ GLubyte red;
+ GLubyte green;
+ GLubyte blue;
+ GLubyte alpha;
+ red = yagl_transport_get_out_GLubyte(t);
+ green = yagl_transport_get_out_GLubyte(t);
+ blue = yagl_transport_get_out_GLubyte(t);
+ alpha = yagl_transport_get_out_GLubyte(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT4(glColor4ub, GLubyte, GLubyte, GLubyte, GLubyte, red, green, blue, alpha);
+ (void)yagl_host_glColor4ub(red, green, blue, alpha);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glNormal3f dispatcher. id = 151
+ */
+static bool yagl_func_glNormal3f(struct yagl_transport *t)
+{
+ GLfloat nx;
+ GLfloat ny;
+ GLfloat nz;
+ nx = yagl_transport_get_out_GLfloat(t);
+ ny = yagl_transport_get_out_GLfloat(t);
+ nz = yagl_transport_get_out_GLfloat(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT3(glNormal3f, GLfloat, GLfloat, GLfloat, nx, ny, nz);
+ (void)yagl_host_glNormal3f(nx, ny, nz);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glPointParameterf dispatcher. id = 152
+ */
+static bool yagl_func_glPointParameterf(struct yagl_transport *t)
+{
+ GLenum pname;
+ GLfloat param;
+ pname = yagl_transport_get_out_GLenum(t);
+ param = yagl_transport_get_out_GLfloat(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT2(glPointParameterf, GLenum, GLfloat, pname, param);
+ (void)yagl_host_glPointParameterf(pname, param);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glPointParameterfv dispatcher. id = 153
+ */
+static bool yagl_func_glPointParameterfv(struct yagl_transport *t)
+{
+ GLenum pname;
+ const GLfloat *params;
+ int32_t params_count;
+ pname = yagl_transport_get_out_GLenum(t);
+ if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&params, &params_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT2(glPointParameterfv, GLenum, void*, pname, params);
+ (void)yagl_host_glPointParameterfv(pname, params, params_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glFogf dispatcher. id = 154
+ */
+static bool yagl_func_glFogf(struct yagl_transport *t)
+{
+ GLenum pname;
+ GLfloat param;
+ pname = yagl_transport_get_out_GLenum(t);
+ param = yagl_transport_get_out_GLfloat(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT2(glFogf, GLenum, GLfloat, pname, param);
+ (void)yagl_host_glFogf(pname, param);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glFogfv dispatcher. id = 155
+ */
+static bool yagl_func_glFogfv(struct yagl_transport *t)
+{
+ GLenum pname;
+ const GLfloat *params;
+ int32_t params_count;
+ pname = yagl_transport_get_out_GLenum(t);
+ if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&params, &params_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT2(glFogfv, GLenum, void*, pname, params);
+ (void)yagl_host_glFogfv(pname, params, params_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glFrustumf dispatcher. id = 156
+ */
+static bool yagl_func_glFrustumf(struct yagl_transport *t)
+{
+ GLfloat left;
+ GLfloat right;
+ GLfloat bottom;
+ GLfloat top;
+ GLfloat zNear;
+ GLfloat zFar;
+ left = yagl_transport_get_out_GLfloat(t);
+ right = yagl_transport_get_out_GLfloat(t);
+ bottom = yagl_transport_get_out_GLfloat(t);
+ top = yagl_transport_get_out_GLfloat(t);
+ zNear = yagl_transport_get_out_GLfloat(t);
+ zFar = yagl_transport_get_out_GLfloat(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT6(glFrustumf, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, left, right, bottom, top, zNear, zFar);
+ (void)yagl_host_glFrustumf(left, right, bottom, top, zNear, zFar);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glLightf dispatcher. id = 157
+ */
+static bool yagl_func_glLightf(struct yagl_transport *t)
+{
+ GLenum light;
+ GLenum pname;
+ GLfloat param;
+ light = yagl_transport_get_out_GLenum(t);
+ pname = yagl_transport_get_out_GLenum(t);
+ param = yagl_transport_get_out_GLfloat(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT3(glLightf, GLenum, GLenum, GLfloat, light, pname, param);
+ (void)yagl_host_glLightf(light, pname, param);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glLightfv dispatcher. id = 158
+ */
+static bool yagl_func_glLightfv(struct yagl_transport *t)
+{
+ GLenum light;
+ GLenum pname;
+ const GLfloat *params;
+ int32_t params_count;
+ light = yagl_transport_get_out_GLenum(t);
+ pname = yagl_transport_get_out_GLenum(t);
+ if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&params, &params_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT3(glLightfv, GLenum, GLenum, void*, light, pname, params);
+ (void)yagl_host_glLightfv(light, pname, params, params_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glGetLightfv dispatcher. id = 159
+ */
+static bool yagl_func_glGetLightfv(struct yagl_transport *t)
+{
+ GLenum light;
+ GLenum pname;
+ GLfloat *params;
+ int32_t params_maxcount;
+ int32_t *params_count;
+ light = yagl_transport_get_out_GLenum(t);
+ pname = yagl_transport_get_out_GLenum(t);
+ if (!yagl_transport_get_in_array(t, sizeof(GLfloat), (void**)&params, &params_maxcount, &params_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT3(glGetLightfv, GLenum, GLenum, void*, light, pname, params);
+ *params_count = 0;
+ (void)yagl_host_glGetLightfv(light, pname, params, params_maxcount, params_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glLightModelf dispatcher. id = 160
+ */
+static bool yagl_func_glLightModelf(struct yagl_transport *t)
+{
+ GLenum pname;
+ GLfloat param;
+ pname = yagl_transport_get_out_GLenum(t);
+ param = yagl_transport_get_out_GLfloat(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT2(glLightModelf, GLenum, GLfloat, pname, param);
+ (void)yagl_host_glLightModelf(pname, param);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glLightModelfv dispatcher. id = 161
+ */
+static bool yagl_func_glLightModelfv(struct yagl_transport *t)
+{
+ GLenum pname;
+ const GLfloat *params;
+ int32_t params_count;
+ pname = yagl_transport_get_out_GLenum(t);
+ if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&params, &params_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT2(glLightModelfv, GLenum, void*, pname, params);
+ (void)yagl_host_glLightModelfv(pname, params, params_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glMaterialf dispatcher. id = 162
+ */
+static bool yagl_func_glMaterialf(struct yagl_transport *t)
+{
+ GLenum face;
+ GLenum pname;
+ GLfloat param;
+ face = yagl_transport_get_out_GLenum(t);
+ pname = yagl_transport_get_out_GLenum(t);
+ param = yagl_transport_get_out_GLfloat(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT3(glMaterialf, GLenum, GLenum, GLfloat, face, pname, param);
+ (void)yagl_host_glMaterialf(face, pname, param);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glMaterialfv dispatcher. id = 163
+ */
+static bool yagl_func_glMaterialfv(struct yagl_transport *t)
+{
+ GLenum face;
+ GLenum pname;
+ const GLfloat *params;
+ int32_t params_count;
+ face = yagl_transport_get_out_GLenum(t);
+ pname = yagl_transport_get_out_GLenum(t);
+ if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&params, &params_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT3(glMaterialfv, GLenum, GLenum, void*, face, pname, params);
+ (void)yagl_host_glMaterialfv(face, pname, params, params_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glGetMaterialfv dispatcher. id = 164
+ */
+static bool yagl_func_glGetMaterialfv(struct yagl_transport *t)
+{
+ GLenum face;
+ GLenum pname;
+ GLfloat *params;
+ int32_t params_maxcount;
+ int32_t *params_count;
+ face = yagl_transport_get_out_GLenum(t);
+ pname = yagl_transport_get_out_GLenum(t);
+ if (!yagl_transport_get_in_array(t, sizeof(GLfloat), (void**)&params, &params_maxcount, &params_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT3(glGetMaterialfv, GLenum, GLenum, void*, face, pname, params);
+ *params_count = 0;
+ (void)yagl_host_glGetMaterialfv(face, pname, params, params_maxcount, params_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glShadeModel dispatcher. id = 165
+ */
+static bool yagl_func_glShadeModel(struct yagl_transport *t)
+{
+ GLenum mode;
+ mode = yagl_transport_get_out_GLenum(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT1(glShadeModel, GLenum, mode);
+ (void)yagl_host_glShadeModel(mode);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glLogicOp dispatcher. id = 166
+ */
+static bool yagl_func_glLogicOp(struct yagl_transport *t)
+{
+ GLenum opcode;
+ opcode = yagl_transport_get_out_GLenum(t);
+ YAGL_LOG_FUNC_ENTER_SPLIT1(glLogicOp, GLenum, opcode);
+ (void)yagl_host_glLogicOp(opcode);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glMultMatrixf dispatcher. id = 167
+ */
+static bool yagl_func_glMultMatrixf(struct yagl_transport *t)
+{
+ const GLfloat *m;
+ int32_t m_count;
+ if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&m, &m_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT1(glMultMatrixf, void*, m);
+ (void)yagl_host_glMultMatrixf(m, m_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glLoadMatrixf dispatcher. id = 168
+ */
+static bool yagl_func_glLoadMatrixf(struct yagl_transport *t)
+{
+ const GLfloat *m;
+ int32_t m_count;
+ if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&m, &m_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT1(glLoadMatrixf, void*, m);
+ (void)yagl_host_glLoadMatrixf(m, m_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glClipPlanef dispatcher. id = 169
+ */
+static bool yagl_func_glClipPlanef(struct yagl_transport *t)
+{
+ GLenum plane;
+ const GLfloat *equation;
+ int32_t equation_count;
+ plane = yagl_transport_get_out_GLenum(t);
+ if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&equation, &equation_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT2(glClipPlanef, GLenum, void*, plane, equation);
+ (void)yagl_host_glClipPlanef(plane, equation, equation_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glGetClipPlanef dispatcher. id = 170
+ */
+static bool yagl_func_glGetClipPlanef(struct yagl_transport *t)
+{
+ GLenum pname;
+ GLfloat *eqn;
+ int32_t eqn_maxcount;
+ int32_t *eqn_count;
+ pname = yagl_transport_get_out_GLenum(t);
+ if (!yagl_transport_get_in_array(t, sizeof(GLfloat), (void**)&eqn, &eqn_maxcount, &eqn_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT2(glGetClipPlanef, GLenum, void*, pname, eqn);
+ *eqn_count = 0;
+ (void)yagl_host_glGetClipPlanef(pname, eqn, eqn_maxcount, eqn_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glUpdateOffscreenImageYAGL dispatcher. id = 171
+ */
+static bool yagl_func_glUpdateOffscreenImageYAGL(struct yagl_transport *t)
+{
+ GLuint texture;
+ uint32_t width;
+ uint32_t height;
+ uint32_t bpp;
+ const void *pixels;
+ int32_t pixels_count;
+ texture = yagl_transport_get_out_GLuint(t);
+ width = yagl_transport_get_out_uint32_t(t);
+ height = yagl_transport_get_out_uint32_t(t);
+ bpp = yagl_transport_get_out_uint32_t(t);
+ if (!yagl_transport_get_out_array(t, 1, (const void**)&pixels, &pixels_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT5(glUpdateOffscreenImageYAGL, GLuint, uint32_t, uint32_t, uint32_t, void*, texture, width, height, bpp, pixels);
+ (void)yagl_host_glUpdateOffscreenImageYAGL(texture, width, height, bpp, pixels, pixels_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glGenUniformLocationYAGL dispatcher. id = 172
+ */
+static bool yagl_func_glGenUniformLocationYAGL(struct yagl_transport *t)
+{
+ uint32_t location;
+ GLuint program;
+ const GLchar *name;
+ int32_t name_count;
+ location = yagl_transport_get_out_uint32_t(t);
+ program = yagl_transport_get_out_GLuint(t);
+ if (!yagl_transport_get_out_array(t, sizeof(GLchar), (const void**)&name, &name_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT3(glGenUniformLocationYAGL, uint32_t, GLuint, void*, location, program, name);
+ (void)yagl_host_glGenUniformLocationYAGL(location, program, name, name_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * glDeleteUniformLocationsYAGL dispatcher. id = 173
+ */
+static bool yagl_func_glDeleteUniformLocationsYAGL(struct yagl_transport *t)
+{
+ const uint32_t *locations;
+ int32_t locations_count;
+ if (!yagl_transport_get_out_array(t, sizeof(uint32_t), (const void**)&locations, &locations_count)) {
+ return false;
+ }
+ YAGL_LOG_FUNC_ENTER_SPLIT1(glDeleteUniformLocationsYAGL, void*, locations);
+ (void)yagl_host_glDeleteUniformLocationsYAGL(locations, locations_count);
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+const uint32_t yagl_gles_api_num_funcs = 173;
+
+yagl_api_func yagl_gles_api_funcs[] = {
+ &yagl_func_glDrawArrays,
+ &yagl_func_glDrawElements,
+ &yagl_func_glReadPixels,
+ &yagl_func_glDisableVertexAttribArray,
+ &yagl_func_glEnableVertexAttribArray,
+ &yagl_func_glVertexAttribPointerData,
+ &yagl_func_glVertexAttribPointerOffset,
+ &yagl_func_glVertexPointerData,
+ &yagl_func_glVertexPointerOffset,
+ &yagl_func_glNormalPointerData,
+ &yagl_func_glNormalPointerOffset,
+ &yagl_func_glColorPointerData,
+ &yagl_func_glColorPointerOffset,
+ &yagl_func_glTexCoordPointerData,
+ &yagl_func_glTexCoordPointerOffset,
+ &yagl_func_glDisableClientState,
+ &yagl_func_glEnableClientState,
+ &yagl_func_glGenBuffers,
+ &yagl_func_glBindBuffer,
+ &yagl_func_glBufferData,
+ &yagl_func_glBufferSubData,
+ &yagl_func_glGenTextures,
+ &yagl_func_glBindTexture,
+ &yagl_func_glActiveTexture,
+ &yagl_func_glCompressedTexImage2D,
+ &yagl_func_glCompressedTexSubImage2D,
+ &yagl_func_glCopyTexImage2D,
+ &yagl_func_glCopyTexSubImage2D,
+ &yagl_func_glGetTexParameterfv,
+ &yagl_func_glGetTexParameteriv,
+ &yagl_func_glTexImage2D,
+ &yagl_func_glTexParameterf,
+ &yagl_func_glTexParameterfv,
+ &yagl_func_glTexParameteri,
+ &yagl_func_glTexParameteriv,
+ &yagl_func_glTexSubImage2D,
+ &yagl_func_glClientActiveTexture,
+ &yagl_func_glTexEnvi,
+ &yagl_func_glTexEnvf,
+ &yagl_func_glMultiTexCoord4f,
+ &yagl_func_glTexEnviv,
+ &yagl_func_glTexEnvfv,
+ &yagl_func_glGetTexEnviv,
+ &yagl_func_glGetTexEnvfv,
+ &yagl_func_glGenFramebuffers,
+ &yagl_func_glBindFramebuffer,
+ &yagl_func_glFramebufferTexture2D,
+ &yagl_func_glFramebufferRenderbuffer,
+ &yagl_func_glGenRenderbuffers,
+ &yagl_func_glBindRenderbuffer,
+ &yagl_func_glRenderbufferStorage,
+ &yagl_func_glGetRenderbufferParameteriv,
+ &yagl_func_glCreateProgram,
+ &yagl_func_glCreateShader,
+ &yagl_func_glShaderSource,
+ &yagl_func_glAttachShader,
+ &yagl_func_glDetachShader,
+ &yagl_func_glCompileShader,
+ &yagl_func_glBindAttribLocation,
+ &yagl_func_glGetActiveAttrib,
+ &yagl_func_glGetActiveUniform,
+ &yagl_func_glGetAttribLocation,
+ &yagl_func_glGetProgramiv,
+ &yagl_func_glGetProgramInfoLog,
+ &yagl_func_glGetShaderiv,
+ &yagl_func_glGetShaderInfoLog,
+ &yagl_func_glGetUniformfv,
+ &yagl_func_glGetUniformiv,
+ &yagl_func_glGetUniformLocation,
+ &yagl_func_glGetVertexAttribfv,
+ &yagl_func_glGetVertexAttribiv,
+ &yagl_func_glLinkProgram,
+ &yagl_func_glUniform1f,
+ &yagl_func_glUniform1fv,
+ &yagl_func_glUniform1i,
+ &yagl_func_glUniform1iv,
+ &yagl_func_glUniform2f,
+ &yagl_func_glUniform2fv,
+ &yagl_func_glUniform2i,
+ &yagl_func_glUniform2iv,
+ &yagl_func_glUniform3f,
+ &yagl_func_glUniform3fv,
+ &yagl_func_glUniform3i,
+ &yagl_func_glUniform3iv,
+ &yagl_func_glUniform4f,
+ &yagl_func_glUniform4fv,
+ &yagl_func_glUniform4i,
+ &yagl_func_glUniform4iv,
+ &yagl_func_glUniformMatrix2fv,
+ &yagl_func_glUniformMatrix3fv,
+ &yagl_func_glUniformMatrix4fv,
+ &yagl_func_glUseProgram,
+ &yagl_func_glValidateProgram,
+ &yagl_func_glVertexAttrib1f,
+ &yagl_func_glVertexAttrib1fv,
+ &yagl_func_glVertexAttrib2f,
+ &yagl_func_glVertexAttrib2fv,
+ &yagl_func_glVertexAttrib3f,
+ &yagl_func_glVertexAttrib3fv,
+ &yagl_func_glVertexAttrib4f,
+ &yagl_func_glVertexAttrib4fv,
+ &yagl_func_glGetIntegerv,
+ &yagl_func_glGetFloatv,
+ &yagl_func_glGetString,
+ &yagl_func_glIsEnabled,
+ &yagl_func_glDeleteObjects,
+ &yagl_func_glBlendEquation,
+ &yagl_func_glBlendEquationSeparate,
+ &yagl_func_glBlendFunc,
+ &yagl_func_glBlendFuncSeparate,
+ &yagl_func_glBlendColor,
+ &yagl_func_glClear,
+ &yagl_func_glClearColor,
+ &yagl_func_glClearDepthf,
+ &yagl_func_glClearStencil,
+ &yagl_func_glColorMask,
+ &yagl_func_glCullFace,
+ &yagl_func_glDepthFunc,
+ &yagl_func_glDepthMask,
+ &yagl_func_glDepthRangef,
+ &yagl_func_glEnable,
+ &yagl_func_glDisable,
+ &yagl_func_glFlush,
+ &yagl_func_glFrontFace,
+ &yagl_func_glGenerateMipmap,
+ &yagl_func_glHint,
+ &yagl_func_glLineWidth,
+ &yagl_func_glPixelStorei,
+ &yagl_func_glPolygonOffset,
+ &yagl_func_glScissor,
+ &yagl_func_glStencilFunc,
+ &yagl_func_glStencilMask,
+ &yagl_func_glStencilOp,
+ &yagl_func_glSampleCoverage,
+ &yagl_func_glViewport,
+ &yagl_func_glStencilFuncSeparate,
+ &yagl_func_glStencilMaskSeparate,
+ &yagl_func_glStencilOpSeparate,
+ &yagl_func_glPointSize,
+ &yagl_func_glAlphaFunc,
+ &yagl_func_glMatrixMode,
+ &yagl_func_glLoadIdentity,
+ &yagl_func_glPopMatrix,
+ &yagl_func_glPushMatrix,
+ &yagl_func_glRotatef,
+ &yagl_func_glTranslatef,
+ &yagl_func_glScalef,
+ &yagl_func_glOrthof,
+ &yagl_func_glColor4f,
+ &yagl_func_glColor4ub,
+ &yagl_func_glNormal3f,
+ &yagl_func_glPointParameterf,
+ &yagl_func_glPointParameterfv,
+ &yagl_func_glFogf,
+ &yagl_func_glFogfv,
+ &yagl_func_glFrustumf,
+ &yagl_func_glLightf,
+ &yagl_func_glLightfv,
+ &yagl_func_glGetLightfv,
+ &yagl_func_glLightModelf,
+ &yagl_func_glLightModelfv,
+ &yagl_func_glMaterialf,
+ &yagl_func_glMaterialfv,
+ &yagl_func_glGetMaterialfv,
+ &yagl_func_glShadeModel,
+ &yagl_func_glLogicOp,
+ &yagl_func_glMultMatrixf,
+ &yagl_func_glLoadMatrixf,
+ &yagl_func_glClipPlanef,
+ &yagl_func_glGetClipPlanef,
+ &yagl_func_glUpdateOffscreenImageYAGL,
+ &yagl_func_glGenUniformLocationYAGL,
+ &yagl_func_glDeleteUniformLocationsYAGL,
+};
diff --git a/hw/yagl/yagl_apis/gles/yagl_gles_calls.h b/hw/yagl/yagl_apis/gles/yagl_gles_calls.h
new file mode 100644
index 0000000000..453b1743b9
--- /dev/null
+++ b/hw/yagl/yagl_apis/gles/yagl_gles_calls.h
@@ -0,0 +1,42 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+/*
+ * Generated by gen-yagl-calls.py, do not modify!
+ */
+#ifndef _QEMU_YAGL_GLES_CALLS_H_
+#define _QEMU_YAGL_GLES_CALLS_H_
+
+#include "yagl_types.h"
+
+extern const uint32_t yagl_gles_api_num_funcs;
+
+extern yagl_api_func yagl_gles_api_funcs[];
+
+#endif
diff --git a/hw/yagl/yagl_apis/gles/yagl_host_gles_calls.c b/hw/yagl/yagl_apis/gles/yagl_host_gles_calls.c
new file mode 100644
index 0000000000..1dfb18fe3f
--- /dev/null
+++ b/hw/yagl/yagl_apis/gles/yagl_host_gles_calls.c
@@ -0,0 +1,2041 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "yagl_host_gles_calls.h"
+#include "yagl_gles_calls.h"
+#include "yagl_gles_api.h"
+#include "yagl_gles_driver.h"
+#include "yagl_gles_api_ps.h"
+#include "yagl_gles_api_ts.h"
+#include "yagl_tls.h"
+#include "yagl_log.h"
+#include "yagl_process.h"
+#include "yagl_thread.h"
+#include "yagl_vector.h"
+#include "yagl_object_map.h"
+
+static YAGL_DEFINE_TLS(struct yagl_gles_api_ts*, gles_api_ts);
+
+struct yagl_gles_object
+{
+ struct yagl_object base;
+
+ struct yagl_gles_driver *driver;
+};
+
+typedef enum
+{
+ yagl_gles1_array_vertex = 0,
+ yagl_gles1_array_color,
+ yagl_gles1_array_normal,
+ yagl_gles1_array_pointsize,
+ yagl_gles1_array_texcoord,
+} yagl_gles1_array_type;
+
+static void *yagl_gles_get_array(uint32_t indx, uint32_t size)
+{
+ struct yagl_vector *array;
+
+ if (indx >= gles_api_ts->num_arrays) {
+ struct yagl_vector *arrays;
+ uint32_t i;
+
+ arrays = g_malloc((indx + 1) * sizeof(arrays[0]));
+
+ memcpy(arrays,
+ gles_api_ts->arrays,
+ gles_api_ts->num_arrays * sizeof(arrays[0]));
+
+ for (i = gles_api_ts->num_arrays; i < (indx + 1); ++i) {
+ yagl_vector_init(&arrays[i], 1, 0);
+ }
+
+ g_free(gles_api_ts->arrays);
+
+ gles_api_ts->arrays = arrays;
+ gles_api_ts->num_arrays = indx + 1;
+ }
+
+ array = &gles_api_ts->arrays[indx];
+
+ yagl_vector_resize(array, size);
+
+ return yagl_vector_data(array);
+}
+
+static bool yagl_gles_program_get_uniform_type(GLuint program,
+ GLint location,
+ GLenum *type)
+{
+ GLint link_status = GL_FALSE;
+ GLint i = 0, num_active_uniforms = 0;
+ GLint uniform_name_max_length = 0;
+ GLchar *uniform_name = NULL;
+ bool res = false;
+
+ YAGL_LOG_FUNC_SET(yagl_gles_program_get_uniform_type);
+
+ if (location < 0) {
+ return false;
+ }
+
+ gles_api_ts->driver->GetProgramiv(program,
+ GL_LINK_STATUS,
+ &link_status);
+
+ if (link_status == GL_FALSE) {
+ return false;
+ }
+
+ gles_api_ts->driver->GetProgramiv(program,
+ GL_ACTIVE_UNIFORMS,
+ &num_active_uniforms);
+
+ gles_api_ts->driver->GetProgramiv(program,
+ GL_ACTIVE_UNIFORM_MAX_LENGTH,
+ &uniform_name_max_length);
+
+ uniform_name = g_malloc(uniform_name_max_length + 1);
+
+ for (i = 0; i < num_active_uniforms; ++i) {
+ GLsizei length = 0;
+ GLint size = 0;
+ GLenum tmp_type = 0;
+
+ gles_api_ts->driver->GetActiveUniform(program,
+ i,
+ uniform_name_max_length,
+ &length,
+ &size,
+ &tmp_type,
+ uniform_name);
+
+ if (length == 0) {
+ YAGL_LOG_ERROR("Cannot get active uniform %d for program %d", i, program);
+ continue;
+ }
+
+ if (gles_api_ts->driver->GetUniformLocation(program,
+ uniform_name) == location) {
+ *type = tmp_type;
+ res = true;
+ break;
+ }
+ }
+
+ g_free(uniform_name);
+
+ return res;
+}
+
+static bool yagl_gles_get_uniform_type_count(GLenum uniform_type, int *count)
+{
+ switch (uniform_type) {
+ case GL_FLOAT: *count = 1; break;
+ case GL_FLOAT_VEC2: *count = 2; break;
+ case GL_FLOAT_VEC3: *count = 3; break;
+ case GL_FLOAT_VEC4: *count = 4; break;
+ case GL_FLOAT_MAT2: *count = 2*2; break;
+ case GL_FLOAT_MAT3: *count = 3*3; break;
+ case GL_FLOAT_MAT4: *count = 4*4; break;
+ case GL_INT: *count = 1; break;
+ case GL_INT_VEC2: *count = 2; break;
+ case GL_INT_VEC3: *count = 3; break;
+ case GL_INT_VEC4: *count = 4; break;
+ case GL_BOOL: *count = 1; break;
+ case GL_BOOL_VEC2: *count = 2; break;
+ case GL_BOOL_VEC3: *count = 3; break;
+ case GL_BOOL_VEC4: *count = 4; break;
+ case GL_SAMPLER_2D: *count = 1; break;
+ case GL_SAMPLER_CUBE: *count = 1; break;
+ default: return false;
+ }
+ return true;
+}
+
+static bool yagl_gles_get_array_param_count(GLenum pname, int *count)
+{
+ switch (pname) {
+ case GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: *count = 1; break;
+ case GL_VERTEX_ATTRIB_ARRAY_ENABLED: *count = 1; break;
+ case GL_VERTEX_ATTRIB_ARRAY_SIZE: *count = 1; break;
+ case GL_VERTEX_ATTRIB_ARRAY_STRIDE: *count = 1; break;
+ case GL_VERTEX_ATTRIB_ARRAY_TYPE: *count = 1; break;
+ case GL_VERTEX_ATTRIB_ARRAY_NORMALIZED: *count = 1; break;
+ case GL_CURRENT_VERTEX_ATTRIB: *count = 4; break;
+ default: return false;
+ }
+ return true;
+}
+
+static void yagl_gles_object_add(GLuint local_name,
+ GLuint global_name,
+ void (*destroy_func)(struct yagl_object */*obj*/))
+{
+ struct yagl_gles_object *obj;
+
+ obj = g_malloc(sizeof(*obj));
+
+ obj->base.global_name = global_name;
+ obj->base.destroy = destroy_func;
+ obj->driver = gles_api_ts->driver;
+
+ yagl_object_map_add(cur_ts->ps->object_map,
+ local_name,
+ &obj->base);
+}
+
+static void yagl_gles_buffer_destroy(struct yagl_object *obj)
+{
+ struct yagl_gles_object *gles_obj = (struct yagl_gles_object*)obj;
+
+ YAGL_LOG_FUNC_ENTER(yagl_gles_buffer_destroy, "%u", obj->global_name);
+
+ yagl_ensure_ctx();
+ gles_obj->driver->DeleteBuffers(1, &obj->global_name);
+ yagl_unensure_ctx();
+
+ g_free(gles_obj);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+static void yagl_gles_texture_destroy(struct yagl_object *obj)
+{
+ struct yagl_gles_object *gles_obj = (struct yagl_gles_object*)obj;
+
+ YAGL_LOG_FUNC_ENTER(yagl_gles_texture_destroy, "%u", obj->global_name);
+
+ yagl_ensure_ctx();
+ gles_obj->driver->DeleteTextures(1, &obj->global_name);
+ yagl_unensure_ctx();
+
+ g_free(gles_obj);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+static void yagl_gles_framebuffer_destroy(struct yagl_object *obj)
+{
+ struct yagl_gles_object *gles_obj = (struct yagl_gles_object*)obj;
+
+ YAGL_LOG_FUNC_ENTER(yagl_gles_framebuffer_destroy, "%u", obj->global_name);
+
+ yagl_ensure_ctx();
+ gles_obj->driver->DeleteFramebuffers(1, &obj->global_name);
+ yagl_unensure_ctx();
+
+ g_free(gles_obj);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+static void yagl_gles_renderbuffer_destroy(struct yagl_object *obj)
+{
+ struct yagl_gles_object *gles_obj = (struct yagl_gles_object*)obj;
+
+ YAGL_LOG_FUNC_ENTER(yagl_gles_renderbuffer_destroy, "%u", obj->global_name);
+
+ yagl_ensure_ctx();
+ gles_obj->driver->DeleteRenderbuffers(1, &obj->global_name);
+ yagl_unensure_ctx();
+
+ g_free(gles_obj);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+static void yagl_gles_program_destroy(struct yagl_object *obj)
+{
+ struct yagl_gles_object *gles_obj = (struct yagl_gles_object*)obj;
+
+ YAGL_LOG_FUNC_ENTER(yagl_gles_program_destroy, "%u", obj->global_name);
+
+ yagl_ensure_ctx();
+ gles_obj->driver->DeleteProgram(obj->global_name);
+ yagl_unensure_ctx();
+
+ g_free(gles_obj);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+static void yagl_gles_shader_destroy(struct yagl_object *obj)
+{
+ struct yagl_gles_object *gles_obj = (struct yagl_gles_object*)obj;
+
+ YAGL_LOG_FUNC_ENTER(yagl_gles_shader_destroy, "%u", obj->global_name);
+
+ yagl_ensure_ctx();
+ gles_obj->driver->DeleteShader(obj->global_name);
+ yagl_unensure_ctx();
+
+ g_free(gles_obj);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+static __inline GLuint yagl_gles_object_get(GLuint local_name)
+{
+ return (local_name > 0) ? yagl_object_map_get(cur_ts->ps->object_map, local_name) : 0;
+}
+
+static yagl_api_func yagl_host_gles_get_func(struct yagl_api_ps *api_ps,
+ uint32_t func_id)
+{
+ if ((func_id <= 0) || (func_id > yagl_gles_api_num_funcs)) {
+ return NULL;
+ } else {
+ return yagl_gles_api_funcs[func_id - 1];
+ }
+}
+
+static void yagl_host_gles_thread_init(struct yagl_api_ps *api_ps)
+{
+ struct yagl_gles_api_ps *gles_api_ps = (struct yagl_gles_api_ps*)api_ps;
+
+ YAGL_LOG_FUNC_ENTER(yagl_host_gles_thread_init, NULL);
+
+ gles_api_ts = g_malloc0(sizeof(*gles_api_ts));
+
+ yagl_gles_api_ts_init(gles_api_ts, gles_api_ps->driver, gles_api_ps);
+
+ cur_ts->gles_api_ts = gles_api_ts;
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+static void yagl_host_gles_batch_start(struct yagl_api_ps *api_ps)
+{
+ gles_api_ts = cur_ts->gles_api_ts;
+}
+
+static void yagl_host_gles_batch_end(struct yagl_api_ps *api_ps)
+{
+}
+
+static void yagl_host_gles_thread_fini(struct yagl_api_ps *api_ps)
+{
+ YAGL_LOG_FUNC_ENTER(yagl_host_gles_thread_fini, NULL);
+
+ gles_api_ts = cur_ts->gles_api_ts;
+
+ yagl_gles_api_ts_cleanup(gles_api_ts);
+
+ g_free(gles_api_ts);
+
+ gles_api_ts = cur_ts->gles_api_ts = NULL;
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+static void yagl_host_gles_process_destroy(struct yagl_api_ps *api_ps)
+{
+ struct yagl_gles_api_ps *gles_api_ps = (struct yagl_gles_api_ps*)api_ps;
+
+ YAGL_LOG_FUNC_ENTER(yagl_host_gles_process_destroy, NULL);
+
+ yagl_gles_api_ps_cleanup(gles_api_ps);
+ yagl_api_ps_cleanup(&gles_api_ps->base);
+
+ g_free(gles_api_ps);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+struct yagl_api_ps *yagl_host_gles_process_init(struct yagl_api *api)
+{
+ struct yagl_gles_api *gles_api = (struct yagl_gles_api*)api;
+ struct yagl_gles_api_ps *gles_api_ps;
+
+ YAGL_LOG_FUNC_ENTER(yagl_host_gles_process_init, NULL);
+
+ gles_api_ps = g_malloc0(sizeof(*gles_api_ps));
+
+ yagl_api_ps_init(&gles_api_ps->base, api);
+
+ gles_api_ps->base.thread_init = &yagl_host_gles_thread_init;
+ gles_api_ps->base.batch_start = &yagl_host_gles_batch_start;
+ gles_api_ps->base.get_func = &yagl_host_gles_get_func;
+ gles_api_ps->base.batch_end = &yagl_host_gles_batch_end;
+ gles_api_ps->base.thread_fini = &yagl_host_gles_thread_fini;
+ gles_api_ps->base.destroy = &yagl_host_gles_process_destroy;
+
+ yagl_gles_api_ps_init(gles_api_ps, gles_api->driver);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return &gles_api_ps->base;
+}
+
+void yagl_host_glDrawArrays(GLenum mode,
+ GLint first,
+ GLsizei count)
+{
+ gles_api_ts->driver->DrawArrays(mode, first, count);
+}
+
+void yagl_host_glDrawElements(GLenum mode,
+ GLsizei count,
+ GLenum type,
+ const GLvoid *indices, int32_t indices_count)
+{
+ if (indices) {
+ gles_api_ts->driver->DrawElements(mode, count, type, indices);
+ } else {
+ gles_api_ts->driver->DrawElements(mode, count, type,
+ (const GLvoid*)(uintptr_t)indices_count);
+ }
+}
+
+void yagl_host_glReadPixels(GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height,
+ GLenum format,
+ GLenum type,
+ GLvoid *pixels, int32_t pixels_maxcount, int32_t *pixels_count)
+{
+ GLuint current_pbo = 0;
+
+ gles_api_ts->driver->GetIntegerv(GL_PIXEL_PACK_BUFFER_BINDING_ARB,
+ (GLint*)&current_pbo);
+ if (current_pbo != 0) {
+ gles_api_ts->driver->BindBuffer(GL_PIXEL_PACK_BUFFER_ARB,
+ 0);
+ }
+
+ gles_api_ts->driver->ReadPixels(x,
+ y,
+ width,
+ height,
+ format,
+ type,
+ pixels);
+
+ *pixels_count = pixels_maxcount;
+
+ if (current_pbo != 0) {
+ gles_api_ts->driver->BindBuffer(GL_PIXEL_PACK_BUFFER_ARB,
+ current_pbo);
+ }
+}
+
+void yagl_host_glDisableVertexAttribArray(GLuint index)
+{
+ gles_api_ts->driver->DisableVertexAttribArray(index);
+}
+
+void yagl_host_glEnableVertexAttribArray(GLuint index)
+{
+ gles_api_ts->driver->EnableVertexAttribArray(index);
+}
+
+void yagl_host_glVertexAttribPointerData(GLuint indx,
+ GLint size,
+ GLenum type,
+ GLboolean normalized,
+ GLsizei stride,
+ GLint first,
+ const GLvoid *data, int32_t data_count)
+{
+ void *array_data = yagl_gles_get_array(indx, first * stride + data_count);
+
+ memcpy(array_data + (first * stride), data, data_count);
+
+ gles_api_ts->driver->VertexAttribPointer(indx, size, type, normalized,
+ stride, array_data);
+}
+
+void yagl_host_glVertexAttribPointerOffset(GLuint indx,
+ GLint size,
+ GLenum type,
+ GLboolean normalized,
+ GLsizei stride,
+ GLsizei offset)
+{
+ gles_api_ts->driver->VertexAttribPointer(indx, size, type, normalized,
+ stride, (const GLvoid*)(uintptr_t)offset);
+}
+
+void yagl_host_glVertexPointerData(GLint size,
+ GLenum type,
+ GLsizei stride,
+ GLint first,
+ const GLvoid *data, int32_t data_count)
+{
+ void *array_data = yagl_gles_get_array(yagl_gles1_array_vertex, first * stride + data_count);
+
+ memcpy(array_data + (first * stride), data, data_count);
+
+ gles_api_ts->driver->VertexPointer(size, type, stride, array_data);
+}
+
+void yagl_host_glVertexPointerOffset(GLint size,
+ GLenum type,
+ GLsizei stride,
+ GLsizei offset)
+{
+ gles_api_ts->driver->VertexPointer(size, type, stride, (const GLvoid*)(uintptr_t)offset);
+}
+
+void yagl_host_glNormalPointerData(GLenum type,
+ GLsizei stride,
+ GLint first,
+ const GLvoid *data, int32_t data_count)
+{
+ void *array_data = yagl_gles_get_array(yagl_gles1_array_normal, first * stride + data_count);
+
+ memcpy(array_data + (first * stride), data, data_count);
+
+ gles_api_ts->driver->NormalPointer(type, stride, array_data);
+}
+
+void yagl_host_glNormalPointerOffset(GLenum type,
+ GLsizei stride,
+ GLsizei offset)
+{
+ gles_api_ts->driver->NormalPointer(type, stride, (const GLvoid*)(uintptr_t)offset);
+}
+
+void yagl_host_glColorPointerData(GLint size,
+ GLenum type,
+ GLsizei stride,
+ GLint first,
+ const GLvoid *data, int32_t data_count)
+{
+ void *array_data = yagl_gles_get_array(yagl_gles1_array_color, first * stride + data_count);
+
+ memcpy(array_data + (first * stride), data, data_count);
+
+ gles_api_ts->driver->ColorPointer(size, type, stride, array_data);
+}
+
+void yagl_host_glColorPointerOffset(GLint size,
+ GLenum type,
+ GLsizei stride,
+ GLsizei offset)
+{
+ gles_api_ts->driver->ColorPointer(size, type, stride, (const GLvoid*)(uintptr_t)offset);
+}
+
+void yagl_host_glTexCoordPointerData(GLint tex_id,
+ GLint size,
+ GLenum type,
+ GLsizei stride,
+ GLint first,
+ const GLvoid *data, int32_t data_count)
+{
+ void *array_data = yagl_gles_get_array(yagl_gles1_array_texcoord + tex_id,
+ first * stride + data_count);
+
+ memcpy(array_data + (first * stride), data, data_count);
+
+ gles_api_ts->driver->TexCoordPointer(size, type, stride, array_data);
+}
+
+void yagl_host_glTexCoordPointerOffset(GLint size,
+ GLenum type,
+ GLsizei stride,
+ GLsizei offset)
+{
+ gles_api_ts->driver->TexCoordPointer(size, type, stride, (const GLvoid*)(uintptr_t)offset);
+}
+
+void yagl_host_glDisableClientState(GLenum array)
+{
+ gles_api_ts->driver->DisableClientState(array);
+}
+
+void yagl_host_glEnableClientState(GLenum array)
+{
+ gles_api_ts->driver->EnableClientState(array);
+}
+
+void yagl_host_glGenBuffers(const GLuint *buffers, int32_t buffers_count)
+{
+ int i;
+
+ for (i = 0; i < buffers_count; ++i) {
+ GLuint global_name;
+
+ gles_api_ts->driver->GenBuffers(1, &global_name);
+
+ yagl_gles_object_add(buffers[i],
+ global_name,
+ &yagl_gles_buffer_destroy);
+ }
+}
+
+void yagl_host_glBindBuffer(GLenum target,
+ GLuint buffer)
+{
+ gles_api_ts->driver->BindBuffer(target, yagl_gles_object_get(buffer));
+}
+
+void yagl_host_glBufferData(GLenum target,
+ const GLvoid *data, int32_t data_count,
+ GLenum usage)
+{
+ gles_api_ts->driver->BufferData(target, data_count, data, usage);
+}
+
+void yagl_host_glBufferSubData(GLenum target,
+ GLsizei offset,
+ const GLvoid *data, int32_t data_count)
+{
+ gles_api_ts->driver->BufferSubData(target, offset, data_count, data);
+}
+
+void yagl_host_glGenTextures(const GLuint *textures, int32_t textures_count)
+{
+ int i;
+
+ for (i = 0; i < textures_count; ++i) {
+ GLuint global_name;
+
+ /*
+ * We need ensure/unensure here for eglReleaseTexImage that
+ * might be called without an active context, but
+ * which needs to create a texture.
+ */
+ yagl_ensure_ctx();
+ gles_api_ts->driver->GenTextures(1, &global_name);
+ yagl_unensure_ctx();
+
+ yagl_gles_object_add(textures[i],
+ global_name,
+ &yagl_gles_texture_destroy);
+ }
+}
+
+void yagl_host_glBindTexture(GLenum target,
+ GLuint texture)
+{
+ gles_api_ts->driver->BindTexture(target, yagl_gles_object_get(texture));
+}
+
+void yagl_host_glActiveTexture(GLenum texture)
+{
+ gles_api_ts->driver->ActiveTexture(texture);
+}
+
+void yagl_host_glCompressedTexImage2D(GLenum target,
+ GLint level,
+ GLenum internalformat,
+ GLsizei width,
+ GLsizei height,
+ GLint border,
+ const GLvoid *data, int32_t data_count)
+{
+ gles_api_ts->driver->CompressedTexImage2D(target,
+ level,
+ internalformat,
+ width,
+ height,
+ border,
+ data_count,
+ data);
+}
+
+void yagl_host_glCompressedTexSubImage2D(GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLsizei width,
+ GLsizei height,
+ GLenum format,
+ const GLvoid *data, int32_t data_count)
+{
+ gles_api_ts->driver->CompressedTexSubImage2D(target,
+ level,
+ xoffset,
+ yoffset,
+ width,
+ height,
+ format,
+ data_count,
+ data);
+}
+
+void yagl_host_glCopyTexImage2D(GLenum target,
+ GLint level,
+ GLenum internalformat,
+ GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height,
+ GLint border)
+{
+ gles_api_ts->driver->CopyTexImage2D(target,
+ level,
+ internalformat,
+ x,
+ y,
+ width,
+ height,
+ border);
+}
+
+void yagl_host_glCopyTexSubImage2D(GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height)
+{
+ gles_api_ts->driver->CopyTexSubImage2D(target,
+ level,
+ xoffset,
+ yoffset,
+ x,
+ y,
+ width,
+ height);
+}
+
+void yagl_host_glGetTexParameterfv(GLenum target,
+ GLenum pname,
+ GLfloat *param)
+{
+ GLfloat params[10];
+
+ gles_api_ts->driver->GetTexParameterfv(target,
+ pname,
+ params);
+
+ if (param) {
+ *param = params[0];
+ }
+}
+
+void yagl_host_glGetTexParameteriv(GLenum target,
+ GLenum pname,
+ GLint *param)
+{
+ GLint params[10];
+
+ gles_api_ts->driver->GetTexParameteriv(target,
+ pname,
+ params);
+
+ if (param) {
+ *param = params[0];
+ }
+}
+
+void yagl_host_glTexImage2D(GLenum target,
+ GLint level,
+ GLint internalformat,
+ GLsizei width,
+ GLsizei height,
+ GLint border,
+ GLenum format,
+ GLenum type,
+ const GLvoid *pixels, int32_t pixels_count)
+{
+ gles_api_ts->driver->TexImage2D(target,
+ level,
+ internalformat,
+ width,
+ height,
+ border,
+ format,
+ type,
+ pixels);
+}
+
+void yagl_host_glTexParameterf(GLenum target,
+ GLenum pname,
+ GLfloat param)
+{
+ gles_api_ts->driver->TexParameterf(target, pname, param);
+}
+
+void yagl_host_glTexParameterfv(GLenum target,
+ GLenum pname,
+ const GLfloat *params, int32_t params_count)
+{
+ GLfloat tmp[10];
+
+ memset(tmp, 0, sizeof(tmp));
+
+ if (params) {
+ tmp[0] = *params;
+ }
+
+ gles_api_ts->driver->TexParameterfv(target,
+ pname,
+ (params ? tmp : NULL));
+}
+
+void yagl_host_glTexParameteri(GLenum target,
+ GLenum pname,
+ GLint param)
+{
+ gles_api_ts->driver->TexParameteri(target, pname, param);
+}
+
+void yagl_host_glTexParameteriv(GLenum target,
+ GLenum pname,
+ const GLint *params, int32_t params_count)
+{
+ GLint tmp[10];
+
+ memset(tmp, 0, sizeof(tmp));
+
+ if (params) {
+ tmp[0] = *params;
+ }
+
+ gles_api_ts->driver->TexParameteriv(target,
+ pname,
+ (params ? tmp : NULL));
+}
+
+void yagl_host_glTexSubImage2D(GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLsizei width,
+ GLsizei height,
+ GLenum format,
+ GLenum type,
+ const GLvoid *pixels, int32_t pixels_count)
+{
+ gles_api_ts->driver->TexSubImage2D(target,
+ level,
+ xoffset,
+ yoffset,
+ width,
+ height,
+ format,
+ type,
+ pixels);
+}
+
+void yagl_host_glClientActiveTexture(GLenum texture)
+{
+ gles_api_ts->driver->ClientActiveTexture(texture);
+}
+
+void yagl_host_glTexEnvi(GLenum target,
+ GLenum pname,
+ GLint param)
+{
+ gles_api_ts->driver->TexEnvi(target, pname, param);
+}
+
+void yagl_host_glTexEnvf(GLenum target,
+ GLenum pname,
+ GLfloat param)
+{
+ gles_api_ts->driver->TexEnvf(target, pname, param);
+}
+
+void yagl_host_glMultiTexCoord4f(GLenum target,
+ GLfloat s,
+ GLfloat tt,
+ GLfloat r,
+ GLfloat q)
+{
+ gles_api_ts->driver->MultiTexCoord4f(target, s, tt, r, q);
+}
+
+void yagl_host_glTexEnviv(GLenum target,
+ GLenum pname,
+ const GLint *params, int32_t params_count)
+{
+ gles_api_ts->driver->TexEnviv(target, pname, params);
+}
+
+void yagl_host_glTexEnvfv(GLenum target,
+ GLenum pname,
+ const GLfloat *params, int32_t params_count)
+{
+ gles_api_ts->driver->TexEnvfv(target, pname, params);
+}
+
+void yagl_host_glGetTexEnviv(GLenum env,
+ GLenum pname,
+ GLint *params, int32_t params_maxcount, int32_t *params_count)
+{
+ gles_api_ts->driver->GetTexEnviv(env, pname, params);
+ *params_count = params_maxcount;
+}
+
+void yagl_host_glGetTexEnvfv(GLenum env,
+ GLenum pname,
+ GLfloat *params, int32_t params_maxcount, int32_t *params_count)
+{
+ gles_api_ts->driver->GetTexEnvfv(env, pname, params);
+ *params_count = params_maxcount;
+}
+
+void yagl_host_glGenFramebuffers(const GLuint *framebuffers, int32_t framebuffers_count)
+{
+ int i;
+
+ for (i = 0; i < framebuffers_count; ++i) {
+ GLuint global_name;
+
+ gles_api_ts->driver->GenFramebuffers(1, &global_name);
+
+ yagl_gles_object_add(framebuffers[i],
+ global_name,
+ &yagl_gles_framebuffer_destroy);
+ }
+}
+
+void yagl_host_glBindFramebuffer(GLenum target,
+ GLuint framebuffer)
+{
+ gles_api_ts->driver->BindFramebuffer(target,
+ yagl_gles_object_get(framebuffer));
+}
+
+void yagl_host_glFramebufferTexture2D(GLenum target,
+ GLenum attachment,
+ GLenum textarget,
+ GLuint texture,
+ GLint level)
+{
+ gles_api_ts->driver->FramebufferTexture2D(target, attachment,
+ textarget,
+ yagl_gles_object_get(texture),
+ level);
+}
+
+void yagl_host_glFramebufferRenderbuffer(GLenum target,
+ GLenum attachment,
+ GLenum renderbuffertarget,
+ GLuint renderbuffer)
+{
+ gles_api_ts->driver->FramebufferRenderbuffer(target,
+ attachment,
+ renderbuffertarget,
+ yagl_gles_object_get(renderbuffer));
+}
+
+void yagl_host_glGenRenderbuffers(const GLuint *renderbuffers, int32_t renderbuffers_count)
+{
+ int i;
+
+ for (i = 0; i < renderbuffers_count; ++i) {
+ GLuint global_name;
+
+ gles_api_ts->driver->GenRenderbuffers(1, &global_name);
+
+ yagl_gles_object_add(renderbuffers[i],
+ global_name,
+ &yagl_gles_renderbuffer_destroy);
+ }
+}
+
+void yagl_host_glBindRenderbuffer(GLenum target,
+ GLuint renderbuffer)
+{
+ gles_api_ts->driver->BindRenderbuffer(target,
+ yagl_gles_object_get(renderbuffer));
+}
+
+void yagl_host_glRenderbufferStorage(GLenum target,
+ GLenum internalformat,
+ GLsizei width,
+ GLsizei height)
+{
+ gles_api_ts->driver->RenderbufferStorage(target, internalformat, width, height);
+}
+
+void yagl_host_glGetRenderbufferParameteriv(GLenum target,
+ GLenum pname,
+ GLint *param)
+{
+ GLint params[10];
+
+ gles_api_ts->driver->GetRenderbufferParameteriv(target,
+ pname,
+ params);
+
+ if (param) {
+ *param = params[0];
+ }
+}
+
+void yagl_host_glCreateProgram(GLuint program)
+{
+ GLuint global_name = gles_api_ts->driver->CreateProgram();
+
+ yagl_gles_object_add(program,
+ global_name,
+ &yagl_gles_program_destroy);
+}
+
+void yagl_host_glCreateShader(GLuint shader,
+ GLenum type)
+{
+ GLuint global_name = gles_api_ts->driver->CreateShader(type);
+
+ yagl_gles_object_add(shader,
+ global_name,
+ &yagl_gles_shader_destroy);
+}
+
+void yagl_host_glShaderSource(GLuint shader,
+ const GLchar *string, int32_t string_count)
+{
+ const GLchar *strings[1];
+ GLint lenghts[1];
+
+ strings[0] = string;
+ lenghts[0] = string_count - 1;
+
+ gles_api_ts->driver->ShaderSource(yagl_gles_object_get(shader),
+ 1,
+ strings,
+ lenghts);
+}
+
+void yagl_host_glAttachShader(GLuint program,
+ GLuint shader)
+{
+ gles_api_ts->driver->AttachShader(yagl_gles_object_get(program),
+ yagl_gles_object_get(shader));
+}
+
+void yagl_host_glDetachShader(GLuint program,
+ GLuint shader)
+{
+ gles_api_ts->driver->DetachShader(yagl_gles_object_get(program),
+ yagl_gles_object_get(shader));
+}
+
+void yagl_host_glCompileShader(GLuint shader)
+{
+ gles_api_ts->driver->CompileShader(yagl_gles_object_get(shader));
+}
+
+void yagl_host_glBindAttribLocation(GLuint program,
+ GLuint index,
+ const GLchar *name, int32_t name_count)
+{
+ gles_api_ts->driver->BindAttribLocation(yagl_gles_object_get(program),
+ index,
+ name);
+}
+
+GLboolean yagl_host_glGetActiveAttrib(GLuint program,
+ GLuint index,
+ GLint *size,
+ GLenum *type,
+ GLchar *name, int32_t name_maxcount, int32_t *name_count)
+{
+ GLsizei tmp = -1;
+
+ gles_api_ts->driver->GetActiveAttrib(yagl_gles_object_get(program),
+ index,
+ name_maxcount,
+ &tmp,
+ size,
+ type,
+ name);
+
+ if (tmp >= 0) {
+ *name_count = MIN(tmp + 1, name_maxcount);
+ return GL_TRUE;
+ } else {
+ return GL_FALSE;
+ }
+}
+
+GLboolean yagl_host_glGetActiveUniform(GLuint program,
+ GLuint index,
+ GLint *size,
+ GLenum *type,
+ GLchar *name, int32_t name_maxcount, int32_t *name_count)
+{
+ GLsizei tmp = -1;
+
+ gles_api_ts->driver->GetActiveUniform(yagl_gles_object_get(program),
+ index,
+ name_maxcount,
+ &tmp,
+ size,
+ type,
+ name);
+
+ if (tmp >= 0) {
+ *name_count = MIN(tmp + 1, name_maxcount);
+ return GL_TRUE;
+ } else {
+ return GL_FALSE;
+ }
+}
+
+int yagl_host_glGetAttribLocation(GLuint program,
+ const GLchar *name, int32_t name_count)
+{
+ return gles_api_ts->driver->GetAttribLocation(yagl_gles_object_get(program),
+ name);
+}
+
+void yagl_host_glGetProgramiv(GLuint program,
+ GLenum pname,
+ GLint *param)
+{
+ gles_api_ts->driver->GetProgramiv(yagl_gles_object_get(program),
+ pname,
+ param);
+}
+
+GLboolean yagl_host_glGetProgramInfoLog(GLuint program,
+ GLchar *infolog, int32_t infolog_maxcount, int32_t *infolog_count)
+{
+ GLsizei tmp = -1;
+
+ gles_api_ts->driver->GetProgramInfoLog(yagl_gles_object_get(program),
+ infolog_maxcount,
+ &tmp,
+ infolog);
+
+ if (tmp >= 0) {
+ *infolog_count = MIN(tmp + 1, infolog_maxcount);
+ return GL_TRUE;
+ } else {
+ return GL_FALSE;
+ }
+}
+
+void yagl_host_glGetShaderiv(GLuint shader,
+ GLenum pname,
+ GLint *param)
+{
+ gles_api_ts->driver->GetShaderiv(yagl_gles_object_get(shader),
+ pname,
+ param);
+}
+
+GLboolean yagl_host_glGetShaderInfoLog(GLuint shader,
+ GLchar *infolog, int32_t infolog_maxcount, int32_t *infolog_count)
+{
+ GLsizei tmp = -1;
+
+ gles_api_ts->driver->GetShaderInfoLog(yagl_gles_object_get(shader),
+ infolog_maxcount,
+ &tmp,
+ infolog);
+
+ if (tmp >= 0) {
+ *infolog_count = MIN(tmp + 1, infolog_maxcount);
+ return GL_TRUE;
+ } else {
+ return GL_FALSE;
+ }
+}
+
+void yagl_host_glGetUniformfv(GLboolean tl,
+ GLuint program,
+ uint32_t location,
+ GLfloat *params, int32_t params_maxcount, int32_t *params_count)
+{
+ GLenum type;
+ GLuint global_name = yagl_gles_object_get(program);
+ GLint actual_location = yagl_gles_api_ps_translate_location(gles_api_ts->ps,
+ tl,
+ location);
+
+ if (!yagl_gles_program_get_uniform_type(global_name,
+ actual_location,
+ &type)) {
+ return;
+ }
+
+ if (!yagl_gles_get_uniform_type_count(type, params_count)) {
+ return;
+ }
+
+ gles_api_ts->driver->GetUniformfv(global_name,
+ actual_location,
+ params);
+}
+
+void yagl_host_glGetUniformiv(GLboolean tl,
+ GLuint program,
+ uint32_t location,
+ GLint *params, int32_t params_maxcount, int32_t *params_count)
+{
+ GLenum type;
+ GLuint global_name = yagl_gles_object_get(program);
+ GLint actual_location = yagl_gles_api_ps_translate_location(gles_api_ts->ps,
+ tl,
+ location);
+
+ if (!yagl_gles_program_get_uniform_type(global_name,
+ actual_location,
+ &type)) {
+ return;
+ }
+
+ if (!yagl_gles_get_uniform_type_count(type, params_count)) {
+ return;
+ }
+
+ gles_api_ts->driver->GetUniformiv(global_name,
+ actual_location,
+ params);
+}
+
+int yagl_host_glGetUniformLocation(GLuint program,
+ const GLchar *name, int32_t name_count)
+{
+ return gles_api_ts->driver->GetUniformLocation(yagl_gles_object_get(program),
+ name);
+}
+
+void yagl_host_glGetVertexAttribfv(GLuint index,
+ GLenum pname,
+ GLfloat *params, int32_t params_maxcount, int32_t *params_count)
+{
+ if (!yagl_gles_get_array_param_count(pname, params_count)) {
+ return;
+ }
+
+ gles_api_ts->driver->GetVertexAttribfv(index, pname, params);
+}
+
+void yagl_host_glGetVertexAttribiv(GLuint index,
+ GLenum pname,
+ GLint *params, int32_t params_maxcount, int32_t *params_count)
+{
+ if (!yagl_gles_get_array_param_count(pname, params_count)) {
+ return;
+ }
+
+ gles_api_ts->driver->GetVertexAttribiv(index, pname, params);
+}
+
+void yagl_host_glLinkProgram(GLuint program)
+{
+ gles_api_ts->driver->LinkProgram(yagl_gles_object_get(program));
+}
+
+void yagl_host_glUniform1f(GLboolean tl,
+ uint32_t location,
+ GLfloat x)
+{
+ gles_api_ts->driver->Uniform1f(
+ yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location), x);
+}
+
+void yagl_host_glUniform1fv(GLboolean tl,
+ uint32_t location,
+ const GLfloat *v, int32_t v_count)
+{
+ gles_api_ts->driver->Uniform1fv(
+ yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ v_count, v);
+}
+
+void yagl_host_glUniform1i(GLboolean tl,
+ uint32_t location,
+ GLint x)
+{
+ gles_api_ts->driver->Uniform1i(
+ yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ x);
+}
+
+void yagl_host_glUniform1iv(GLboolean tl,
+ uint32_t location,
+ const GLint *v, int32_t v_count)
+{
+ gles_api_ts->driver->Uniform1iv(
+ yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ v_count, v);
+}
+
+void yagl_host_glUniform2f(GLboolean tl,
+ uint32_t location,
+ GLfloat x,
+ GLfloat y)
+{
+ gles_api_ts->driver->Uniform2f(
+ yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ x, y);
+}
+
+void yagl_host_glUniform2fv(GLboolean tl,
+ uint32_t location,
+ const GLfloat *v, int32_t v_count)
+{
+ gles_api_ts->driver->Uniform2fv(
+ yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ (v_count / 2), v);
+}
+
+void yagl_host_glUniform2i(GLboolean tl,
+ uint32_t location,
+ GLint x,
+ GLint y)
+{
+ gles_api_ts->driver->Uniform2i(
+ yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ x, y);
+}
+
+void yagl_host_glUniform2iv(GLboolean tl,
+ uint32_t location,
+ const GLint *v, int32_t v_count)
+{
+ gles_api_ts->driver->Uniform2iv(
+ yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ (v_count / 2), v);
+}
+
+void yagl_host_glUniform3f(GLboolean tl,
+ uint32_t location,
+ GLfloat x,
+ GLfloat y,
+ GLfloat z)
+{
+ gles_api_ts->driver->Uniform3f(
+ yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ x, y, z);
+}
+
+void yagl_host_glUniform3fv(GLboolean tl,
+ uint32_t location,
+ const GLfloat *v, int32_t v_count)
+{
+ gles_api_ts->driver->Uniform3fv(
+ yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ (v_count / 3), v);
+}
+
+void yagl_host_glUniform3i(GLboolean tl,
+ uint32_t location,
+ GLint x,
+ GLint y,
+ GLint z)
+{
+ gles_api_ts->driver->Uniform3i(
+ yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ x, y, z);
+}
+
+void yagl_host_glUniform3iv(GLboolean tl,
+ uint32_t location,
+ const GLint *v, int32_t v_count)
+{
+ gles_api_ts->driver->Uniform3iv(
+ yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ (v_count / 3), v);
+}
+
+void yagl_host_glUniform4f(GLboolean tl,
+ uint32_t location,
+ GLfloat x,
+ GLfloat y,
+ GLfloat z,
+ GLfloat w)
+{
+ gles_api_ts->driver->Uniform4f(
+ yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ x, y, z, w);
+}
+
+void yagl_host_glUniform4fv(GLboolean tl,
+ uint32_t location,
+ const GLfloat *v, int32_t v_count)
+{
+ gles_api_ts->driver->Uniform4fv(
+ yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ (v_count / 4), v);
+}
+
+void yagl_host_glUniform4i(GLboolean tl,
+ uint32_t location,
+ GLint x,
+ GLint y,
+ GLint z,
+ GLint w)
+{
+ gles_api_ts->driver->Uniform4i(
+ yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ x, y, z, w);
+}
+
+void yagl_host_glUniform4iv(GLboolean tl,
+ uint32_t location,
+ const GLint *v, int32_t v_count)
+{
+ gles_api_ts->driver->Uniform4iv(
+ yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ (v_count / 4), v);
+}
+
+void yagl_host_glUniformMatrix2fv(GLboolean tl,
+ uint32_t location,
+ GLboolean transpose,
+ const GLfloat *value, int32_t value_count)
+{
+ gles_api_ts->driver->UniformMatrix2fv(
+ yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ value_count / (2 * 2), transpose, value);
+}
+
+void yagl_host_glUniformMatrix3fv(GLboolean tl,
+ uint32_t location,
+ GLboolean transpose,
+ const GLfloat *value, int32_t value_count)
+{
+ gles_api_ts->driver->UniformMatrix3fv(
+ yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ value_count / (3 * 3), transpose, value);
+}
+
+void yagl_host_glUniformMatrix4fv(GLboolean tl,
+ uint32_t location,
+ GLboolean transpose,
+ const GLfloat *value, int32_t value_count)
+{
+ gles_api_ts->driver->UniformMatrix4fv(
+ yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ value_count / (4 * 4), transpose, value);
+}
+
+void yagl_host_glUseProgram(GLuint program)
+{
+ gles_api_ts->driver->UseProgram(yagl_gles_object_get(program));
+}
+
+void yagl_host_glValidateProgram(GLuint program)
+{
+ gles_api_ts->driver->ValidateProgram(yagl_gles_object_get(program));
+}
+
+void yagl_host_glVertexAttrib1f(GLuint indx,
+ GLfloat x)
+{
+ gles_api_ts->driver->VertexAttrib1f(indx, x);
+}
+
+void yagl_host_glVertexAttrib1fv(GLuint indx,
+ const GLfloat *values, int32_t values_count)
+{
+ gles_api_ts->driver->VertexAttrib1fv(indx, values);
+}
+
+void yagl_host_glVertexAttrib2f(GLuint indx,
+ GLfloat x,
+ GLfloat y)
+{
+ gles_api_ts->driver->VertexAttrib2f(indx, x, y);
+}
+
+void yagl_host_glVertexAttrib2fv(GLuint indx,
+ const GLfloat *values, int32_t values_count)
+{
+ gles_api_ts->driver->VertexAttrib2fv(indx, values);
+}
+
+void yagl_host_glVertexAttrib3f(GLuint indx,
+ GLfloat x,
+ GLfloat y,
+ GLfloat z)
+{
+ gles_api_ts->driver->VertexAttrib3f(indx, x, y, z);
+}
+
+void yagl_host_glVertexAttrib3fv(GLuint indx,
+ const GLfloat *values, int32_t values_count)
+{
+ gles_api_ts->driver->VertexAttrib3fv(indx, values);
+}
+
+void yagl_host_glVertexAttrib4f(GLuint indx,
+ GLfloat x,
+ GLfloat y,
+ GLfloat z,
+ GLfloat w)
+{
+ gles_api_ts->driver->VertexAttrib4f(indx, x, y, z, w);
+}
+
+void yagl_host_glVertexAttrib4fv(GLuint indx,
+ const GLfloat *values, int32_t values_count)
+{
+ gles_api_ts->driver->VertexAttrib4fv(indx, values);
+}
+
+void yagl_host_glGetIntegerv(GLenum pname,
+ GLint *params, int32_t params_maxcount, int32_t *params_count)
+{
+ gles_api_ts->driver->GetIntegerv(pname, params);
+
+ *params_count = params_maxcount;
+}
+
+void yagl_host_glGetFloatv(GLenum pname,
+ GLfloat *params, int32_t params_maxcount, int32_t *params_count)
+{
+ gles_api_ts->driver->GetFloatv(pname, params);
+
+ *params_count = params_maxcount;
+}
+
+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);
+
+ if (str_count) {
+ *str_count = strlen(tmp) + 1;
+ }
+
+ if (str && (str_maxcount > 0)) {
+ strncpy(str, tmp, str_maxcount);
+ str[str_maxcount - 1] = '\0';
+ }
+}
+
+GLboolean yagl_host_glIsEnabled(GLenum cap)
+{
+ return gles_api_ts->driver->IsEnabled(cap);
+}
+
+void yagl_host_glDeleteObjects(const GLuint *objects, int32_t objects_count)
+{
+ int i;
+
+ for (i = 0; i < objects_count; ++i) {
+ yagl_object_map_remove(cur_ts->ps->object_map, objects[i]);
+ }
+}
+
+void yagl_host_glBlendEquation(GLenum mode)
+{
+ gles_api_ts->driver->BlendEquation(mode);
+}
+
+void yagl_host_glBlendEquationSeparate(GLenum modeRGB,
+ GLenum modeAlpha)
+{
+ gles_api_ts->driver->BlendEquationSeparate(modeRGB, modeAlpha);
+}
+
+void yagl_host_glBlendFunc(GLenum sfactor,
+ GLenum dfactor)
+{
+ gles_api_ts->driver->BlendFunc(sfactor, dfactor);
+}
+
+void yagl_host_glBlendFuncSeparate(GLenum srcRGB,
+ GLenum dstRGB,
+ GLenum srcAlpha,
+ GLenum dstAlpha)
+{
+ gles_api_ts->driver->BlendFuncSeparate(srcRGB,
+ dstRGB,
+ srcAlpha,
+ dstAlpha);
+}
+
+void yagl_host_glBlendColor(GLclampf red,
+ GLclampf green,
+ GLclampf blue,
+ GLclampf alpha)
+{
+ gles_api_ts->driver->BlendColor(red, green, blue, alpha);
+}
+
+void yagl_host_glClear(GLbitfield mask)
+{
+ gles_api_ts->driver->Clear(mask);
+}
+
+void yagl_host_glClearColor(GLclampf red,
+ GLclampf green,
+ GLclampf blue,
+ GLclampf alpha)
+{
+ gles_api_ts->driver->ClearColor(red, green, blue, alpha);
+}
+
+void yagl_host_glClearDepthf(GLclampf depth)
+{
+ gles_api_ts->driver->ClearDepth(depth);
+}
+
+void yagl_host_glClearStencil(GLint s)
+{
+ gles_api_ts->driver->ClearStencil(s);
+}
+
+void yagl_host_glColorMask(GLboolean red,
+ GLboolean green,
+ GLboolean blue,
+ GLboolean alpha)
+{
+ gles_api_ts->driver->ColorMask(red, green, blue, alpha);
+}
+
+void yagl_host_glCullFace(GLenum mode)
+{
+ gles_api_ts->driver->CullFace(mode);
+}
+
+void yagl_host_glDepthFunc(GLenum func)
+{
+ gles_api_ts->driver->DepthFunc(func);
+}
+
+void yagl_host_glDepthMask(GLboolean flag)
+{
+ gles_api_ts->driver->DepthMask(flag);
+}
+
+void yagl_host_glDepthRangef(GLclampf zNear,
+ GLclampf zFar)
+{
+ gles_api_ts->driver->DepthRange(zNear, zFar);
+}
+
+void yagl_host_glEnable(GLenum cap)
+{
+ gles_api_ts->driver->Enable(cap);
+}
+
+void yagl_host_glDisable(GLenum cap)
+{
+ gles_api_ts->driver->Disable(cap);
+}
+
+void yagl_host_glFlush(void)
+{
+ gles_api_ts->driver->Flush();
+}
+
+void yagl_host_glFrontFace(GLenum mode)
+{
+ gles_api_ts->driver->FrontFace(mode);
+}
+
+void yagl_host_glGenerateMipmap(GLenum target)
+{
+ gles_api_ts->driver->GenerateMipmap(target);
+}
+
+void yagl_host_glHint(GLenum target,
+ GLenum mode)
+{
+ gles_api_ts->driver->Hint(target, mode);
+}
+
+void yagl_host_glLineWidth(GLfloat width)
+{
+ gles_api_ts->driver->LineWidth(width);
+}
+
+void yagl_host_glPixelStorei(GLenum pname,
+ GLint param)
+{
+ gles_api_ts->driver->PixelStorei(pname, param);
+}
+
+void yagl_host_glPolygonOffset(GLfloat factor,
+ GLfloat units)
+{
+ gles_api_ts->driver->PolygonOffset(factor, units);
+}
+
+void yagl_host_glScissor(GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height)
+{
+ gles_api_ts->driver->Scissor(x, y, width, height);
+}
+
+void yagl_host_glStencilFunc(GLenum func,
+ GLint ref,
+ GLuint mask)
+{
+ gles_api_ts->driver->StencilFunc(func, ref, mask);
+}
+
+void yagl_host_glStencilMask(GLuint mask)
+{
+ gles_api_ts->driver->StencilMask(mask);
+}
+
+void yagl_host_glStencilOp(GLenum fail,
+ GLenum zfail,
+ GLenum zpass)
+{
+ gles_api_ts->driver->StencilOp(fail, zfail, zpass);
+}
+
+void yagl_host_glSampleCoverage(GLclampf value,
+ GLboolean invert)
+{
+ gles_api_ts->driver->SampleCoverage(value, invert);
+}
+
+void yagl_host_glViewport(GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height)
+{
+ gles_api_ts->driver->Viewport(x, y, width, height);
+}
+
+void yagl_host_glStencilFuncSeparate(GLenum face,
+ GLenum func,
+ GLint ref,
+ GLuint mask)
+{
+ gles_api_ts->driver->StencilFuncSeparate(face, func, ref, mask);
+}
+
+void yagl_host_glStencilMaskSeparate(GLenum face,
+ GLuint mask)
+{
+ gles_api_ts->driver->StencilMaskSeparate(face, mask);
+}
+
+void yagl_host_glStencilOpSeparate(GLenum face,
+ GLenum fail,
+ GLenum zfail,
+ GLenum zpass)
+{
+ gles_api_ts->driver->StencilOpSeparate(face, fail, zfail, zpass);
+}
+
+void yagl_host_glPointSize(GLfloat size)
+{
+ gles_api_ts->driver->PointSize(size);
+}
+
+void yagl_host_glAlphaFunc(GLenum func,
+ GLclampf ref)
+{
+ gles_api_ts->driver->AlphaFunc(func, ref);
+}
+
+void yagl_host_glMatrixMode(GLenum mode)
+{
+ gles_api_ts->driver->MatrixMode(mode);
+}
+
+void yagl_host_glLoadIdentity(void)
+{
+ gles_api_ts->driver->LoadIdentity();
+}
+
+void yagl_host_glPopMatrix(void)
+{
+ gles_api_ts->driver->PopMatrix();
+}
+
+void yagl_host_glPushMatrix(void)
+{
+ gles_api_ts->driver->PushMatrix();
+}
+
+void yagl_host_glRotatef(GLfloat angle,
+ GLfloat x,
+ GLfloat y,
+ GLfloat z)
+{
+ gles_api_ts->driver->Rotatef(angle, x, y, z);
+}
+
+void yagl_host_glTranslatef(GLfloat x,
+ GLfloat y,
+ GLfloat z)
+{
+ gles_api_ts->driver->Translatef(x, y, z);
+}
+
+void yagl_host_glScalef(GLfloat x,
+ GLfloat y,
+ GLfloat z)
+{
+ gles_api_ts->driver->Scalef(x, y, z);
+}
+
+void yagl_host_glOrthof(GLfloat left,
+ GLfloat right,
+ GLfloat bottom,
+ GLfloat top,
+ GLfloat zNear,
+ GLfloat zFar)
+{
+ gles_api_ts->driver->Ortho(left, right, bottom, top, zNear, zFar);
+}
+
+void yagl_host_glColor4f(GLfloat red,
+ GLfloat green,
+ GLfloat blue,
+ GLfloat alpha)
+{
+ gles_api_ts->driver->Color4f(red, green, blue, alpha);
+}
+
+void yagl_host_glColor4ub(GLubyte red,
+ GLubyte green,
+ GLubyte blue,
+ GLubyte alpha)
+{
+ gles_api_ts->driver->Color4ub(red, green, blue, alpha);
+}
+
+void yagl_host_glNormal3f(GLfloat nx,
+ GLfloat ny,
+ GLfloat nz)
+{
+ gles_api_ts->driver->Normal3f(nx, ny, nz);
+}
+
+void yagl_host_glPointParameterf(GLenum pname,
+ GLfloat param)
+{
+ gles_api_ts->driver->PointParameterf(pname, param);
+}
+
+void yagl_host_glPointParameterfv(GLenum pname,
+ const GLfloat *params, int32_t params_count)
+{
+ gles_api_ts->driver->PointParameterfv(pname, params);
+}
+
+void yagl_host_glFogf(GLenum pname,
+ GLfloat param)
+{
+ gles_api_ts->driver->Fogf(pname, param);
+}
+
+void yagl_host_glFogfv(GLenum pname,
+ const GLfloat *params, int32_t params_count)
+{
+ gles_api_ts->driver->Fogfv(pname, params);
+}
+
+void yagl_host_glFrustumf(GLfloat left,
+ GLfloat right,
+ GLfloat bottom,
+ GLfloat top,
+ GLfloat zNear,
+ GLfloat zFar)
+{
+ gles_api_ts->driver->Frustum(left, right, bottom, top, zNear, zFar);
+}
+
+void yagl_host_glLightf(GLenum light,
+ GLenum pname,
+ GLfloat param)
+{
+ gles_api_ts->driver->Lightf(light, pname, param);
+}
+
+void yagl_host_glLightfv(GLenum light,
+ GLenum pname,
+ const GLfloat *params, int32_t params_count)
+{
+ gles_api_ts->driver->Lightfv(light, pname, params);
+}
+
+void yagl_host_glGetLightfv(GLenum light,
+ GLenum pname,
+ GLfloat *params, int32_t params_maxcount, int32_t *params_count)
+{
+ gles_api_ts->driver->GetLightfv(light, pname, params);
+ *params_count = params_maxcount;
+}
+
+void yagl_host_glLightModelf(GLenum pname,
+ GLfloat param)
+{
+ gles_api_ts->driver->LightModelf(pname, param);
+}
+
+void yagl_host_glLightModelfv(GLenum pname,
+ const GLfloat *params, int32_t params_count)
+{
+ gles_api_ts->driver->LightModelfv(pname, params);
+}
+
+void yagl_host_glMaterialf(GLenum face,
+ GLenum pname,
+ GLfloat param)
+{
+ gles_api_ts->driver->Materialf(face, pname, param);
+}
+
+void yagl_host_glMaterialfv(GLenum face,
+ GLenum pname,
+ const GLfloat *params, int32_t params_count)
+{
+ gles_api_ts->driver->Materialfv(face, pname, params);
+}
+
+void yagl_host_glGetMaterialfv(GLenum face,
+ GLenum pname,
+ GLfloat *params, int32_t params_maxcount, int32_t *params_count)
+{
+ gles_api_ts->driver->GetMaterialfv(face, pname, params);
+ *params_count = params_maxcount;
+}
+
+void yagl_host_glShadeModel(GLenum mode)
+{
+ gles_api_ts->driver->ShadeModel(mode);
+}
+
+void yagl_host_glLogicOp(GLenum opcode)
+{
+ gles_api_ts->driver->LogicOp(opcode);
+}
+
+void yagl_host_glMultMatrixf(const GLfloat *m, int32_t m_count)
+{
+ gles_api_ts->driver->MultMatrixf(m);
+}
+
+void yagl_host_glLoadMatrixf(const GLfloat *m, int32_t m_count)
+{
+ gles_api_ts->driver->LoadMatrixf(m);
+}
+
+void yagl_host_glClipPlanef(GLenum plane,
+ const GLfloat *equation, int32_t equation_count)
+{
+ yagl_GLdouble equationd[4];
+
+ if (equation) {
+ equationd[0] = equation[0];
+ equationd[1] = equation[1];
+ equationd[2] = equation[2];
+ equationd[3] = equation[3];
+ gles_api_ts->driver->ClipPlane(plane, equationd);
+ } else {
+ gles_api_ts->driver->ClipPlane(plane, NULL);
+ }
+}
+
+void yagl_host_glGetClipPlanef(GLenum pname,
+ GLfloat *eqn, int32_t eqn_maxcount, int32_t *eqn_count)
+{
+ yagl_GLdouble eqnd[4];
+
+ gles_api_ts->driver->GetClipPlane(pname, eqnd);
+
+ if (eqn) {
+ eqn[0] = eqnd[0];
+ eqn[1] = eqnd[1];
+ eqn[2] = eqnd[2];
+ eqn[3] = eqnd[3];
+ *eqn_count = 4;
+ }
+}
+
+void yagl_host_glUpdateOffscreenImageYAGL(GLuint texture,
+ uint32_t width,
+ uint32_t height,
+ uint32_t bpp,
+ const void *pixels, int32_t pixels_count)
+{
+ GLenum format = 0;
+ GLuint cur_tex = 0;
+ GLsizei unpack_alignment = 0;
+
+ YAGL_LOG_FUNC_SET(glUpdateOffscreenImageYAGL);
+
+ switch (bpp) {
+ case 3:
+ format = GL_RGB;
+ break;
+ case 4:
+ format = GL_BGRA;
+ break;
+ default:
+ YAGL_LOG_ERROR("bad bpp - %u", bpp);
+ return;
+ }
+
+ gles_api_ts->driver->GetIntegerv(GL_TEXTURE_BINDING_2D,
+ (GLint*)&cur_tex);
+
+ gles_api_ts->driver->GetIntegerv(GL_UNPACK_ALIGNMENT,
+ &unpack_alignment);
+
+ gles_api_ts->driver->PixelStorei(GL_UNPACK_ALIGNMENT, 1);
+
+ gles_api_ts->driver->BindTexture(GL_TEXTURE_2D,
+ yagl_gles_object_get(texture));
+
+ gles_api_ts->driver->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ gles_api_ts->driver->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+
+ gles_api_ts->driver->TexImage2D(GL_TEXTURE_2D,
+ 0,
+ GL_RGB,
+ width,
+ height,
+ 0,
+ format,
+ GL_UNSIGNED_BYTE,
+ pixels);
+
+ gles_api_ts->driver->PixelStorei(GL_UNPACK_ALIGNMENT,
+ unpack_alignment);
+
+ gles_api_ts->driver->BindTexture(GL_TEXTURE_2D, cur_tex);
+}
+
+void yagl_host_glGenUniformLocationYAGL(uint32_t location,
+ GLuint program,
+ const GLchar *name, int32_t name_count)
+{
+ yagl_gles_api_ps_add_location(gles_api_ts->ps,
+ location,
+ gles_api_ts->driver->GetUniformLocation(yagl_gles_object_get(program), name));
+}
+
+void yagl_host_glDeleteUniformLocationsYAGL(const uint32_t *locations, int32_t locations_count)
+{
+ int i;
+
+ for (i = 0; i < locations_count; ++i) {
+ yagl_gles_api_ps_remove_location(gles_api_ts->ps, locations[i]);
+ }
+}
diff --git a/hw/yagl/yagl_apis/gles/yagl_host_gles_calls.h b/hw/yagl/yagl_apis/gles/yagl_host_gles_calls.h
new file mode 100644
index 0000000000..655aa0e99a
--- /dev/null
+++ b/hw/yagl/yagl_apis/gles/yagl_host_gles_calls.h
@@ -0,0 +1,542 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_HOST_GLES_CALLS_H
+#define _QEMU_YAGL_HOST_GLES_CALLS_H
+
+#include "yagl_api.h"
+#include <GL/gl.h>
+
+struct yagl_api_ps *yagl_host_gles_process_init(struct yagl_api *api);
+
+void yagl_host_glDrawArrays(GLenum mode,
+ GLint first,
+ GLsizei count);
+void yagl_host_glDrawElements(GLenum mode,
+ GLsizei count,
+ GLenum type,
+ const GLvoid *indices, int32_t indices_count);
+void yagl_host_glReadPixels(GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height,
+ GLenum format,
+ GLenum type,
+ GLvoid *pixels, int32_t pixels_maxcount, int32_t *pixels_count);
+void yagl_host_glDisableVertexAttribArray(GLuint index);
+void yagl_host_glEnableVertexAttribArray(GLuint index);
+void yagl_host_glVertexAttribPointerData(GLuint indx,
+ GLint size,
+ GLenum type,
+ GLboolean normalized,
+ GLsizei stride,
+ GLint first,
+ const GLvoid *data, int32_t data_count);
+void yagl_host_glVertexAttribPointerOffset(GLuint indx,
+ GLint size,
+ GLenum type,
+ GLboolean normalized,
+ GLsizei stride,
+ GLsizei offset);
+void yagl_host_glVertexPointerData(GLint size,
+ GLenum type,
+ GLsizei stride,
+ GLint first,
+ const GLvoid *data, int32_t data_count);
+void yagl_host_glVertexPointerOffset(GLint size,
+ GLenum type,
+ GLsizei stride,
+ GLsizei offset);
+void yagl_host_glNormalPointerData(GLenum type,
+ GLsizei stride,
+ GLint first,
+ const GLvoid *data, int32_t data_count);
+void yagl_host_glNormalPointerOffset(GLenum type,
+ GLsizei stride,
+ GLsizei offset);
+void yagl_host_glColorPointerData(GLint size,
+ GLenum type,
+ GLsizei stride,
+ GLint first,
+ const GLvoid *data, int32_t data_count);
+void yagl_host_glColorPointerOffset(GLint size,
+ GLenum type,
+ GLsizei stride,
+ GLsizei offset);
+void yagl_host_glTexCoordPointerData(GLint tex_id,
+ GLint size,
+ GLenum type,
+ GLsizei stride,
+ GLint first,
+ const GLvoid *data, int32_t data_count);
+void yagl_host_glTexCoordPointerOffset(GLint size,
+ GLenum type,
+ GLsizei stride,
+ GLsizei offset);
+void yagl_host_glDisableClientState(GLenum array);
+void yagl_host_glEnableClientState(GLenum array);
+void yagl_host_glGenBuffers(const GLuint *buffers, int32_t buffers_count);
+void yagl_host_glBindBuffer(GLenum target,
+ GLuint buffer);
+void yagl_host_glBufferData(GLenum target,
+ const GLvoid *data, int32_t data_count,
+ GLenum usage);
+void yagl_host_glBufferSubData(GLenum target,
+ GLsizei offset,
+ const GLvoid *data, int32_t data_count);
+void yagl_host_glGenTextures(const GLuint *textures, int32_t textures_count);
+void yagl_host_glBindTexture(GLenum target,
+ GLuint texture);
+void yagl_host_glActiveTexture(GLenum texture);
+void yagl_host_glCompressedTexImage2D(GLenum target,
+ GLint level,
+ GLenum internalformat,
+ GLsizei width,
+ GLsizei height,
+ GLint border,
+ const GLvoid *data, int32_t data_count);
+void yagl_host_glCompressedTexSubImage2D(GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLsizei width,
+ GLsizei height,
+ GLenum format,
+ const GLvoid *data, int32_t data_count);
+void yagl_host_glCopyTexImage2D(GLenum target,
+ GLint level,
+ GLenum internalformat,
+ GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height,
+ GLint border);
+void yagl_host_glCopyTexSubImage2D(GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height);
+void yagl_host_glGetTexParameterfv(GLenum target,
+ GLenum pname,
+ GLfloat *param);
+void yagl_host_glGetTexParameteriv(GLenum target,
+ GLenum pname,
+ GLint *param);
+void yagl_host_glTexImage2D(GLenum target,
+ GLint level,
+ GLint internalformat,
+ GLsizei width,
+ GLsizei height,
+ GLint border,
+ GLenum format,
+ GLenum type,
+ const GLvoid *pixels, int32_t pixels_count);
+void yagl_host_glTexParameterf(GLenum target,
+ GLenum pname,
+ GLfloat param);
+void yagl_host_glTexParameterfv(GLenum target,
+ GLenum pname,
+ const GLfloat *params, int32_t params_count);
+void yagl_host_glTexParameteri(GLenum target,
+ GLenum pname,
+ GLint param);
+void yagl_host_glTexParameteriv(GLenum target,
+ GLenum pname,
+ const GLint *params, int32_t params_count);
+void yagl_host_glTexSubImage2D(GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLsizei width,
+ GLsizei height,
+ GLenum format,
+ GLenum type,
+ const GLvoid *pixels, int32_t pixels_count);
+void yagl_host_glClientActiveTexture(GLenum texture);
+void yagl_host_glTexEnvi(GLenum target,
+ GLenum pname,
+ GLint param);
+void yagl_host_glTexEnvf(GLenum target,
+ GLenum pname,
+ GLfloat param);
+void yagl_host_glMultiTexCoord4f(GLenum target,
+ GLfloat s,
+ GLfloat tt,
+ GLfloat r,
+ GLfloat q);
+void yagl_host_glTexEnviv(GLenum target,
+ GLenum pname,
+ const GLint *params, int32_t params_count);
+void yagl_host_glTexEnvfv(GLenum target,
+ GLenum pname,
+ const GLfloat *params, int32_t params_count);
+void yagl_host_glGetTexEnviv(GLenum env,
+ GLenum pname,
+ GLint *params, int32_t params_maxcount, int32_t *params_count);
+void yagl_host_glGetTexEnvfv(GLenum env,
+ GLenum pname,
+ GLfloat *params, int32_t params_maxcount, int32_t *params_count);
+void yagl_host_glGenFramebuffers(const GLuint *framebuffers, int32_t framebuffers_count);
+void yagl_host_glBindFramebuffer(GLenum target,
+ GLuint framebuffer);
+void yagl_host_glFramebufferTexture2D(GLenum target,
+ GLenum attachment,
+ GLenum textarget,
+ GLuint texture,
+ GLint level);
+void yagl_host_glFramebufferRenderbuffer(GLenum target,
+ GLenum attachment,
+ GLenum renderbuffertarget,
+ GLuint renderbuffer);
+void yagl_host_glGenRenderbuffers(const GLuint *renderbuffers, int32_t renderbuffers_count);
+void yagl_host_glBindRenderbuffer(GLenum target,
+ GLuint renderbuffer);
+void yagl_host_glRenderbufferStorage(GLenum target,
+ GLenum internalformat,
+ GLsizei width,
+ GLsizei height);
+void yagl_host_glGetRenderbufferParameteriv(GLenum target,
+ GLenum pname,
+ GLint *param);
+void yagl_host_glCreateProgram(GLuint program);
+void yagl_host_glCreateShader(GLuint shader,
+ GLenum type);
+void yagl_host_glShaderSource(GLuint shader,
+ const GLchar *string, int32_t string_count);
+void yagl_host_glAttachShader(GLuint program,
+ GLuint shader);
+void yagl_host_glDetachShader(GLuint program,
+ GLuint shader);
+void yagl_host_glCompileShader(GLuint shader);
+void yagl_host_glBindAttribLocation(GLuint program,
+ GLuint index,
+ const GLchar *name, int32_t name_count);
+GLboolean yagl_host_glGetActiveAttrib(GLuint program,
+ GLuint index,
+ GLint *size,
+ GLenum *type,
+ GLchar *name, int32_t name_maxcount, int32_t *name_count);
+GLboolean yagl_host_glGetActiveUniform(GLuint program,
+ GLuint index,
+ GLint *size,
+ GLenum *type,
+ GLchar *name, int32_t name_maxcount, int32_t *name_count);
+int yagl_host_glGetAttribLocation(GLuint program,
+ const GLchar *name, int32_t name_count);
+void yagl_host_glGetProgramiv(GLuint program,
+ GLenum pname,
+ GLint *param);
+GLboolean yagl_host_glGetProgramInfoLog(GLuint program,
+ GLchar *infolog, int32_t infolog_maxcount, int32_t *infolog_count);
+void yagl_host_glGetShaderiv(GLuint shader,
+ GLenum pname,
+ GLint *param);
+GLboolean yagl_host_glGetShaderInfoLog(GLuint shader,
+ GLchar *infolog, int32_t infolog_maxcount, int32_t *infolog_count);
+void yagl_host_glGetUniformfv(GLboolean tl,
+ GLuint program,
+ uint32_t location,
+ GLfloat *params, int32_t params_maxcount, int32_t *params_count);
+void yagl_host_glGetUniformiv(GLboolean tl,
+ GLuint program,
+ uint32_t location,
+ GLint *params, int32_t params_maxcount, int32_t *params_count);
+int yagl_host_glGetUniformLocation(GLuint program,
+ const GLchar *name, int32_t name_count);
+void yagl_host_glGetVertexAttribfv(GLuint index,
+ GLenum pname,
+ GLfloat *params, int32_t params_maxcount, int32_t *params_count);
+void yagl_host_glGetVertexAttribiv(GLuint index,
+ GLenum pname,
+ GLint *params, int32_t params_maxcount, int32_t *params_count);
+void yagl_host_glLinkProgram(GLuint program);
+void yagl_host_glUniform1f(GLboolean tl,
+ uint32_t location,
+ GLfloat x);
+void yagl_host_glUniform1fv(GLboolean tl,
+ uint32_t location,
+ const GLfloat *v, int32_t v_count);
+void yagl_host_glUniform1i(GLboolean tl,
+ uint32_t location,
+ GLint x);
+void yagl_host_glUniform1iv(GLboolean tl,
+ uint32_t location,
+ const GLint *v, int32_t v_count);
+void yagl_host_glUniform2f(GLboolean tl,
+ uint32_t location,
+ GLfloat x,
+ GLfloat y);
+void yagl_host_glUniform2fv(GLboolean tl,
+ uint32_t location,
+ const GLfloat *v, int32_t v_count);
+void yagl_host_glUniform2i(GLboolean tl,
+ uint32_t location,
+ GLint x,
+ GLint y);
+void yagl_host_glUniform2iv(GLboolean tl,
+ uint32_t location,
+ const GLint *v, int32_t v_count);
+void yagl_host_glUniform3f(GLboolean tl,
+ uint32_t location,
+ GLfloat x,
+ GLfloat y,
+ GLfloat z);
+void yagl_host_glUniform3fv(GLboolean tl,
+ uint32_t location,
+ const GLfloat *v, int32_t v_count);
+void yagl_host_glUniform3i(GLboolean tl,
+ uint32_t location,
+ GLint x,
+ GLint y,
+ GLint z);
+void yagl_host_glUniform3iv(GLboolean tl,
+ uint32_t location,
+ const GLint *v, int32_t v_count);
+void yagl_host_glUniform4f(GLboolean tl,
+ uint32_t location,
+ GLfloat x,
+ GLfloat y,
+ GLfloat z,
+ GLfloat w);
+void yagl_host_glUniform4fv(GLboolean tl,
+ uint32_t location,
+ const GLfloat *v, int32_t v_count);
+void yagl_host_glUniform4i(GLboolean tl,
+ uint32_t location,
+ GLint x,
+ GLint y,
+ GLint z,
+ GLint w);
+void yagl_host_glUniform4iv(GLboolean tl,
+ uint32_t location,
+ const GLint *v, int32_t v_count);
+void yagl_host_glUniformMatrix2fv(GLboolean tl,
+ uint32_t location,
+ GLboolean transpose,
+ const GLfloat *value, int32_t value_count);
+void yagl_host_glUniformMatrix3fv(GLboolean tl,
+ uint32_t location,
+ GLboolean transpose,
+ const GLfloat *value, int32_t value_count);
+void yagl_host_glUniformMatrix4fv(GLboolean tl,
+ uint32_t location,
+ GLboolean transpose,
+ const GLfloat *value, int32_t value_count);
+void yagl_host_glUseProgram(GLuint program);
+void yagl_host_glValidateProgram(GLuint program);
+void yagl_host_glVertexAttrib1f(GLuint indx,
+ GLfloat x);
+void yagl_host_glVertexAttrib1fv(GLuint indx,
+ const GLfloat *values, int32_t values_count);
+void yagl_host_glVertexAttrib2f(GLuint indx,
+ GLfloat x,
+ GLfloat y);
+void yagl_host_glVertexAttrib2fv(GLuint indx,
+ const GLfloat *values, int32_t values_count);
+void yagl_host_glVertexAttrib3f(GLuint indx,
+ GLfloat x,
+ GLfloat y,
+ GLfloat z);
+void yagl_host_glVertexAttrib3fv(GLuint indx,
+ const GLfloat *values, int32_t values_count);
+void yagl_host_glVertexAttrib4f(GLuint indx,
+ GLfloat x,
+ GLfloat y,
+ GLfloat z,
+ GLfloat w);
+void yagl_host_glVertexAttrib4fv(GLuint indx,
+ const GLfloat *values, int32_t values_count);
+void yagl_host_glGetIntegerv(GLenum pname,
+ GLint *params, int32_t params_maxcount, int32_t *params_count);
+void yagl_host_glGetFloatv(GLenum pname,
+ GLfloat *params, int32_t params_maxcount, int32_t *params_count);
+void yagl_host_glGetString(GLenum name,
+ GLchar *str, int32_t str_maxcount, int32_t *str_count);
+GLboolean yagl_host_glIsEnabled(GLenum cap);
+void yagl_host_glDeleteObjects(const GLuint *objects, int32_t objects_count);
+void yagl_host_glBlendEquation(GLenum mode);
+void yagl_host_glBlendEquationSeparate(GLenum modeRGB,
+ GLenum modeAlpha);
+void yagl_host_glBlendFunc(GLenum sfactor,
+ GLenum dfactor);
+void yagl_host_glBlendFuncSeparate(GLenum srcRGB,
+ GLenum dstRGB,
+ GLenum srcAlpha,
+ GLenum dstAlpha);
+void yagl_host_glBlendColor(GLclampf red,
+ GLclampf green,
+ GLclampf blue,
+ GLclampf alpha);
+void yagl_host_glClear(GLbitfield mask);
+void yagl_host_glClearColor(GLclampf red,
+ GLclampf green,
+ GLclampf blue,
+ GLclampf alpha);
+void yagl_host_glClearDepthf(GLclampf depth);
+void yagl_host_glClearStencil(GLint s);
+void yagl_host_glColorMask(GLboolean red,
+ GLboolean green,
+ GLboolean blue,
+ GLboolean alpha);
+void yagl_host_glCullFace(GLenum mode);
+void yagl_host_glDepthFunc(GLenum func);
+void yagl_host_glDepthMask(GLboolean flag);
+void yagl_host_glDepthRangef(GLclampf zNear,
+ GLclampf zFar);
+void yagl_host_glEnable(GLenum cap);
+void yagl_host_glDisable(GLenum cap);
+void yagl_host_glFlush(void);
+void yagl_host_glFrontFace(GLenum mode);
+void yagl_host_glGenerateMipmap(GLenum target);
+void yagl_host_glHint(GLenum target,
+ GLenum mode);
+void yagl_host_glLineWidth(GLfloat width);
+void yagl_host_glPixelStorei(GLenum pname,
+ GLint param);
+void yagl_host_glPolygonOffset(GLfloat factor,
+ GLfloat units);
+void yagl_host_glScissor(GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height);
+void yagl_host_glStencilFunc(GLenum func,
+ GLint ref,
+ GLuint mask);
+void yagl_host_glStencilMask(GLuint mask);
+void yagl_host_glStencilOp(GLenum fail,
+ GLenum zfail,
+ GLenum zpass);
+void yagl_host_glSampleCoverage(GLclampf value,
+ GLboolean invert);
+void yagl_host_glViewport(GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height);
+void yagl_host_glStencilFuncSeparate(GLenum face,
+ GLenum func,
+ GLint ref,
+ GLuint mask);
+void yagl_host_glStencilMaskSeparate(GLenum face,
+ GLuint mask);
+void yagl_host_glStencilOpSeparate(GLenum face,
+ GLenum fail,
+ GLenum zfail,
+ GLenum zpass);
+void yagl_host_glPointSize(GLfloat size);
+void yagl_host_glAlphaFunc(GLenum func,
+ GLclampf ref);
+void yagl_host_glMatrixMode(GLenum mode);
+void yagl_host_glLoadIdentity(void);
+void yagl_host_glPopMatrix(void);
+void yagl_host_glPushMatrix(void);
+void yagl_host_glRotatef(GLfloat angle,
+ GLfloat x,
+ GLfloat y,
+ GLfloat z);
+void yagl_host_glTranslatef(GLfloat x,
+ GLfloat y,
+ GLfloat z);
+void yagl_host_glScalef(GLfloat x,
+ GLfloat y,
+ GLfloat z);
+void yagl_host_glOrthof(GLfloat left,
+ GLfloat right,
+ GLfloat bottom,
+ GLfloat top,
+ GLfloat zNear,
+ GLfloat zFar);
+void yagl_host_glColor4f(GLfloat red,
+ GLfloat green,
+ GLfloat blue,
+ GLfloat alpha);
+void yagl_host_glColor4ub(GLubyte red,
+ GLubyte green,
+ GLubyte blue,
+ GLubyte alpha);
+void yagl_host_glNormal3f(GLfloat nx,
+ GLfloat ny,
+ GLfloat nz);
+void yagl_host_glPointParameterf(GLenum pname,
+ GLfloat param);
+void yagl_host_glPointParameterfv(GLenum pname,
+ const GLfloat *params, int32_t params_count);
+void yagl_host_glFogf(GLenum pname,
+ GLfloat param);
+void yagl_host_glFogfv(GLenum pname,
+ const GLfloat *params, int32_t params_count);
+void yagl_host_glFrustumf(GLfloat left,
+ GLfloat right,
+ GLfloat bottom,
+ GLfloat top,
+ GLfloat zNear,
+ GLfloat zFar);
+void yagl_host_glLightf(GLenum light,
+ GLenum pname,
+ GLfloat param);
+void yagl_host_glLightfv(GLenum light,
+ GLenum pname,
+ const GLfloat *params, int32_t params_count);
+void yagl_host_glGetLightfv(GLenum light,
+ GLenum pname,
+ GLfloat *params, int32_t params_maxcount, int32_t *params_count);
+void yagl_host_glLightModelf(GLenum pname,
+ GLfloat param);
+void yagl_host_glLightModelfv(GLenum pname,
+ const GLfloat *params, int32_t params_count);
+void yagl_host_glMaterialf(GLenum face,
+ GLenum pname,
+ GLfloat param);
+void yagl_host_glMaterialfv(GLenum face,
+ GLenum pname,
+ const GLfloat *params, int32_t params_count);
+void yagl_host_glGetMaterialfv(GLenum face,
+ GLenum pname,
+ GLfloat *params, int32_t params_maxcount, int32_t *params_count);
+void yagl_host_glShadeModel(GLenum mode);
+void yagl_host_glLogicOp(GLenum opcode);
+void yagl_host_glMultMatrixf(const GLfloat *m, int32_t m_count);
+void yagl_host_glLoadMatrixf(const GLfloat *m, int32_t m_count);
+void yagl_host_glClipPlanef(GLenum plane,
+ const GLfloat *equation, int32_t equation_count);
+void yagl_host_glGetClipPlanef(GLenum pname,
+ GLfloat *eqn, int32_t eqn_maxcount, int32_t *eqn_count);
+void yagl_host_glUpdateOffscreenImageYAGL(GLuint texture,
+ uint32_t width,
+ uint32_t height,
+ uint32_t bpp,
+ const void *pixels, int32_t pixels_count);
+void yagl_host_glGenUniformLocationYAGL(uint32_t location,
+ GLuint program,
+ const GLchar *name, int32_t name_count);
+void yagl_host_glDeleteUniformLocationsYAGL(const uint32_t *locations, int32_t locations_count);
+
+#endif
diff --git a/hw/yagl/yagl_avl.c b/hw/yagl/yagl_avl.c
new file mode 100644
index 0000000000..0c19a3a974
--- /dev/null
+++ b/hw/yagl/yagl_avl.c
@@ -0,0 +1,873 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+/*
+ * AVL tree implementation from libavl project.
+ */
+
+#include "yagl_avl.h"
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+/*
+ * Creates and returns a new table
+ * with comparison function |compare| using parameter |param|
+ * and memory allocator |allocator|.
+ * Returns |NULL| if memory allocation failed.
+ */
+struct yagl_avl_table *yagl_avl_create(yagl_avl_comparison_func *compare,
+ void *param,
+ struct yagl_libavl_allocator *allocator)
+{
+ struct yagl_avl_table *tree;
+
+ assert(compare != NULL);
+
+ if (allocator == NULL) {
+ allocator = &yagl_avl_allocator_default;
+ }
+
+ tree = allocator->libavl_malloc(allocator, sizeof(*tree));
+ if (tree == NULL) {
+ return NULL;
+ }
+
+ tree->avl_root = NULL;
+ tree->avl_compare = compare;
+ tree->avl_param = param;
+ tree->avl_alloc = allocator;
+ tree->avl_count = 0;
+ tree->avl_generation = 0;
+
+ return tree;
+}
+
+/*
+ * Search |tree| for an item matching |item|, and return it if found.
+ * Otherwise return |NULL|.
+ */
+void *yagl_avl_find(const struct yagl_avl_table *tree, const void *item)
+{
+ const struct yagl_avl_node *p;
+
+ assert(tree != NULL && item != NULL);
+ for (p = tree->avl_root; p != NULL;) {
+ int cmp = tree->avl_compare(item, p->avl_data, tree->avl_param);
+
+ if (cmp < 0) {
+ p = p->avl_link[0];
+ } else if (cmp > 0) {
+ p = p->avl_link[1];
+ } else {
+ return p->avl_data;
+ }
+ }
+
+ return NULL;
+}
+
+/*
+ * Inserts |item| into |tree| and returns a pointer to |item|'s address.
+ * If a duplicate item is found in the tree,
+ * returns a pointer to the duplicate without inserting |item|.
+ * Returns |NULL| in case of memory allocation failure.
+ */
+void **yagl_avl_probe(struct yagl_avl_table *tree, void *item)
+{
+ struct yagl_avl_node *y, *z; /* Top node to update balance factor, and parent. */
+ struct yagl_avl_node *p, *q; /* Iterator, and parent. */
+ struct yagl_avl_node *n; /* Newly inserted node. */
+ struct yagl_avl_node *w; /* New root of rebalanced subtree. */
+ int dir; /* Direction to descend. */
+
+ unsigned char da[YAGL_AVL_MAX_HEIGHT]; /* Cached comparison results. */
+ int k = 0; /* Number of cached results. */
+
+ assert(tree != NULL && item != NULL);
+
+ z = (struct yagl_avl_node *) &tree->avl_root;
+ y = tree->avl_root;
+ dir = 0;
+ for (q = z, p = y; p != NULL; q = p, p = p->avl_link[dir]) {
+ int cmp = tree->avl_compare(item, p->avl_data, tree->avl_param);
+ if (cmp == 0) {
+ return &p->avl_data;
+ }
+
+ if (p->avl_balance != 0) {
+ z = q, y = p, k = 0;
+ }
+ da[k++] = dir = cmp > 0;
+ }
+
+ n = q->avl_link[dir] = tree->avl_alloc->libavl_malloc(tree->avl_alloc,
+ sizeof(*n));
+ if (n == NULL) {
+ return NULL;
+ }
+
+ tree->avl_count++;
+ n->avl_data = item;
+ n->avl_link[0] = n->avl_link[1] = NULL;
+ n->avl_balance = 0;
+ if (y == NULL) {
+ return &n->avl_data;
+ }
+
+ for (p = y, k = 0; p != n; p = p->avl_link[da[k]], k++) {
+ if (da[k] == 0) {
+ p->avl_balance--;
+ } else {
+ p->avl_balance++;
+ }
+ }
+
+ if (y->avl_balance == -2) {
+ struct yagl_avl_node *x = y->avl_link[0];
+ if (x->avl_balance == -1) {
+ w = x;
+ y->avl_link[0] = x->avl_link[1];
+ x->avl_link[1] = y;
+ x->avl_balance = y->avl_balance = 0;
+ } else {
+ assert(x->avl_balance == 1);
+ w = x->avl_link[1];
+ x->avl_link[1] = w->avl_link[0];
+ w->avl_link[0] = x;
+ y->avl_link[0] = w->avl_link[1];
+ w->avl_link[1] = y;
+ if (w->avl_balance == -1) {
+ x->avl_balance = 0, y->avl_balance = 1;
+ } else if (w->avl_balance == 0) {
+ x->avl_balance = y->avl_balance = 0;
+ } else {
+ x->avl_balance = -1, y->avl_balance = 0;
+ }
+ w->avl_balance = 0;
+ }
+ } else if (y->avl_balance == 2) {
+ struct yagl_avl_node *x = y->avl_link[1];
+ if (x->avl_balance == 1) {
+ w = x;
+ y->avl_link[1] = x->avl_link[0];
+ x->avl_link[0] = y;
+ x->avl_balance = y->avl_balance = 0;
+ } else {
+ assert(x->avl_balance == -1);
+ w = x->avl_link[0];
+ x->avl_link[0] = w->avl_link[1];
+ w->avl_link[1] = x;
+ y->avl_link[1] = w->avl_link[0];
+ w->avl_link[0] = y;
+ if (w->avl_balance == 1) {
+ x->avl_balance = 0, y->avl_balance = -1;
+ } else if (w->avl_balance == 0) {
+ x->avl_balance = y->avl_balance = 0;
+ } else {
+ x->avl_balance = 1, y->avl_balance = 0;
+ }
+ w->avl_balance = 0;
+ }
+ } else {
+ return &n->avl_data;
+ }
+ z->avl_link[y != z->avl_link[0]] = w;
+
+ tree->avl_generation++;
+ return &n->avl_data;
+}
+
+/*
+ * Inserts |item| into |table|.
+ * Returns |NULL| if |item| was successfully inserted
+ * or if a memory allocation error occurred.
+ * Otherwise, returns the duplicate item.
+ */
+void *yagl_avl_insert(struct yagl_avl_table *table, void *item)
+{
+ void **p = yagl_avl_probe(table, item);
+ return p == NULL || *p == item ? NULL : *p;
+}
+
+/*
+ * Inserts |item| into |table|, replacing any duplicate item.
+ * Returns |NULL| if |item| was inserted without replacing a duplicate,
+ * or if a memory allocation error occurred.
+ * Otherwise, returns the item that was replaced.
+ */
+void *yagl_avl_replace(struct yagl_avl_table *table, void *item)
+{
+ void **p = yagl_avl_probe(table, item);
+ if (p == NULL || *p == item) {
+ return NULL;
+ } else {
+ void *r = *p;
+ *p = item;
+ return r;
+ }
+}
+
+/*
+ * Deletes from |tree| and returns an item matching |item|.
+ * Returns a null pointer if no matching item found.
+ */
+void *yagl_avl_delete(struct yagl_avl_table *tree, const void *item)
+{
+ /* Stack of nodes. */
+ struct yagl_avl_node *pa[YAGL_AVL_MAX_HEIGHT]; /* Nodes. */
+ unsigned char da[YAGL_AVL_MAX_HEIGHT]; /* |avl_link[]| indexes. */
+ int k; /* Stack pointer. */
+
+ struct yagl_avl_node *p; /* Traverses tree to find node to delete. */
+ int cmp; /* Result of comparison between |item| and |p|. */
+
+ assert(tree != NULL && item != NULL);
+
+ k = 0;
+ p = (struct yagl_avl_node *) &tree->avl_root;
+ for (cmp = -1; cmp != 0;
+ cmp = tree->avl_compare(item, p->avl_data, tree->avl_param)) {
+ int dir = cmp > 0;
+
+ pa[k] = p;
+ da[k++] = dir;
+
+ p = p->avl_link[dir];
+ if (p == NULL) {
+ return NULL;
+ }
+ }
+ item = p->avl_data;
+
+ if (p->avl_link[1] == NULL) {
+ pa[k - 1]->avl_link[da[k - 1]] = p->avl_link[0];
+ } else {
+ struct yagl_avl_node *r = p->avl_link[1];
+ if (r->avl_link[0] == NULL) {
+ r->avl_link[0] = p->avl_link[0];
+ r->avl_balance = p->avl_balance;
+ pa[k - 1]->avl_link[da[k - 1]] = r;
+ da[k] = 1;
+ pa[k++] = r;
+ } else {
+ struct yagl_avl_node *s;
+ int j = k++;
+
+ for (;;) {
+ da[k] = 0;
+ pa[k++] = r;
+ s = r->avl_link[0];
+ if (s->avl_link[0] == NULL) {
+ break;
+ }
+
+ r = s;
+ }
+
+ s->avl_link[0] = p->avl_link[0];
+ r->avl_link[0] = s->avl_link[1];
+ s->avl_link[1] = p->avl_link[1];
+ s->avl_balance = p->avl_balance;
+
+ pa[j - 1]->avl_link[da[j - 1]] = s;
+ da[j] = 1;
+ pa[j] = s;
+ }
+ }
+
+ tree->avl_alloc->libavl_free(tree->avl_alloc, p);
+
+ assert(k > 0);
+ while (--k > 0) {
+ struct yagl_avl_node *y = pa[k];
+
+ if (da[k] == 0) {
+ y->avl_balance++;
+ if (y->avl_balance == 1) {
+ break;
+ } else if (y->avl_balance == 2) {
+ struct yagl_avl_node *x = y->avl_link[1];
+ if (x->avl_balance == -1) {
+ struct yagl_avl_node *w;
+ assert(x->avl_balance == -1);
+ w = x->avl_link[0];
+ x->avl_link[0] = w->avl_link[1];
+ w->avl_link[1] = x;
+ y->avl_link[1] = w->avl_link[0];
+ w->avl_link[0] = y;
+ if (w->avl_balance == 1) {
+ x->avl_balance = 0, y->avl_balance = -1;
+ } else if (w->avl_balance == 0) {
+ x->avl_balance = y->avl_balance = 0;
+ } else {
+ x->avl_balance = 1, y->avl_balance = 0;
+ }
+ w->avl_balance = 0;
+ pa[k - 1]->avl_link[da[k - 1]] = w;
+ } else {
+ y->avl_link[1] = x->avl_link[0];
+ x->avl_link[0] = y;
+ pa[k - 1]->avl_link[da[k - 1]] = x;
+ if (x->avl_balance == 0) {
+ x->avl_balance = -1;
+ y->avl_balance = 1;
+ break;
+ } else {
+ x->avl_balance = y->avl_balance = 0;
+ }
+ }
+ }
+ } else {
+ y->avl_balance--;
+ if (y->avl_balance == -1) {
+ break;
+ } else if (y->avl_balance == -2) {
+ struct yagl_avl_node *x = y->avl_link[0];
+ if (x->avl_balance == 1) {
+ struct yagl_avl_node *w;
+ assert(x->avl_balance == 1);
+ w = x->avl_link[1];
+ x->avl_link[1] = w->avl_link[0];
+ w->avl_link[0] = x;
+ y->avl_link[0] = w->avl_link[1];
+ w->avl_link[1] = y;
+ if (w->avl_balance == -1) {
+ x->avl_balance = 0, y->avl_balance = 1;
+ } else if (w->avl_balance == 0) {
+ x->avl_balance = y->avl_balance = 0;
+ } else {
+ x->avl_balance = -1, y->avl_balance = 0;
+ }
+ w->avl_balance = 0;
+ pa[k - 1]->avl_link[da[k - 1]] = w;
+ } else {
+ y->avl_link[0] = x->avl_link[1];
+ x->avl_link[1] = y;
+ pa[k - 1]->avl_link[da[k - 1]] = x;
+ if (x->avl_balance == 0) {
+ x->avl_balance = 1;
+ y->avl_balance = -1;
+ break;
+ } else {
+ x->avl_balance = y->avl_balance = 0;
+ }
+ }
+ }
+ }
+ }
+
+ tree->avl_count--;
+ tree->avl_generation++;
+ return (void *) item;
+}
+
+/*
+ * Refreshes the stack of parent pointers in |trav|
+ * and updates its generation number.
+ */
+static void yagl_trav_refresh(struct yagl_avl_traverser *trav)
+{
+ assert(trav != NULL);
+
+ trav->avl_generation = trav->avl_table->avl_generation;
+
+ if (trav->avl_node != NULL) {
+ yagl_avl_comparison_func *cmp = trav->avl_table->avl_compare;
+ void *param = trav->avl_table->avl_param;
+ struct yagl_avl_node *node = trav->avl_node;
+ struct yagl_avl_node *i;
+
+ trav->avl_height = 0;
+ for (i = trav->avl_table->avl_root; i != node;) {
+ assert(trav->avl_height < YAGL_AVL_MAX_HEIGHT);
+ assert(i != NULL);
+
+ trav->avl_stack[trav->avl_height++] = i;
+ i = i->avl_link[cmp(node->avl_data, i->avl_data, param) > 0];
+ }
+ }
+}
+
+/*
+ * Initializes |trav| for use with |tree|
+ * and selects the null node.
+ */
+void yagl_avl_t_init(struct yagl_avl_traverser *trav,
+ struct yagl_avl_table *tree)
+{
+ trav->avl_table = tree;
+ trav->avl_node = NULL;
+ trav->avl_height = 0;
+ trav->avl_generation = tree->avl_generation;
+}
+
+/*
+ * Initializes |trav| for |tree|
+ * and selects and returns a pointer to its least-valued item.
+ * Returns |NULL| if |tree| contains no nodes.
+ */
+void *yagl_avl_t_first(struct yagl_avl_traverser *trav,
+ struct yagl_avl_table *tree)
+{
+ struct yagl_avl_node *x;
+
+ assert(tree != NULL && trav != NULL);
+
+ trav->avl_table = tree;
+ trav->avl_height = 0;
+ trav->avl_generation = tree->avl_generation;
+
+ x = tree->avl_root;
+ if (x != NULL) {
+ while (x->avl_link[0] != NULL) {
+ assert(trav->avl_height < YAGL_AVL_MAX_HEIGHT);
+ trav->avl_stack[trav->avl_height++] = x;
+ x = x->avl_link[0];
+ }
+ }
+ trav->avl_node = x;
+
+ return x != NULL ? x->avl_data : NULL;
+}
+
+/*
+ * Initializes |trav| for |tree|
+ * and selects and returns a pointer to its greatest-valued item.
+ * Returns |NULL| if |tree| contains no nodes.
+ */
+void *yagl_avl_t_last(struct yagl_avl_traverser *trav,
+ struct yagl_avl_table *tree)
+{
+ struct yagl_avl_node *x;
+
+ assert(tree != NULL && trav != NULL);
+
+ trav->avl_table = tree;
+ trav->avl_height = 0;
+ trav->avl_generation = tree->avl_generation;
+
+ x = tree->avl_root;
+ if (x != NULL) {
+ while (x->avl_link[1] != NULL) {
+ assert(trav->avl_height < YAGL_AVL_MAX_HEIGHT);
+ trav->avl_stack[trav->avl_height++] = x;
+ x = x->avl_link[1];
+ }
+ }
+ trav->avl_node = x;
+
+ return x != NULL ? x->avl_data : NULL;
+}
+
+/*
+ * Searches for |item| in |tree|.
+ * If found, initializes |trav| to the item found and returns the item
+ * as well.
+ * If there is no matching item, initializes |trav| to the null item
+ * and returns |NULL|.
+ */
+void *yagl_avl_t_find(struct yagl_avl_traverser *trav,
+ struct yagl_avl_table *tree, void *item)
+{
+ struct yagl_avl_node *p, *q;
+
+ assert(trav != NULL && tree != NULL && item != NULL);
+ trav->avl_table = tree;
+ trav->avl_height = 0;
+ trav->avl_generation = tree->avl_generation;
+ for (p = tree->avl_root; p != NULL; p = q) {
+ int cmp = tree->avl_compare(item, p->avl_data, tree->avl_param);
+
+ if (cmp < 0) {
+ q = p->avl_link[0];
+ } else if (cmp > 0) {
+ q = p->avl_link[1];
+ } else {
+ trav->avl_node = p;
+ return p->avl_data;
+ }
+
+ assert(trav->avl_height < YAGL_AVL_MAX_HEIGHT);
+ trav->avl_stack[trav->avl_height++] = p;
+ }
+
+ trav->avl_height = 0;
+ trav->avl_node = NULL;
+ return NULL;
+}
+
+/*
+ * Attempts to insert |item| into |tree|.
+ * If |item| is inserted successfully, it is returned and |trav| is
+ * initialized to its location.
+ * If a duplicate is found, it is returned and |trav| is initialized to
+ * its location. No replacement of the item occurs.
+ * If a memory allocation failure occurs, |NULL| is returned and |trav|
+ * is initialized to the null item.
+ */
+void
+*yagl_avl_t_insert(struct yagl_avl_traverser *trav,
+ struct yagl_avl_table *tree, void *item)
+{
+ void **p;
+
+ assert(trav != NULL && tree != NULL && item != NULL);
+
+ p = yagl_avl_probe(tree, item);
+ if (p != NULL) {
+ trav->avl_table = tree;
+ trav->avl_node = ((struct yagl_avl_node *) ((char *) p
+ - offsetof(struct yagl_avl_node, avl_data)));
+ trav->avl_generation = tree->avl_generation - 1;
+ return *p;
+ } else {
+ yagl_avl_t_init(trav, tree);
+ return NULL;
+ }
+}
+
+/* Initializes |trav| to have the same current node as |src|. */
+void *yagl_avl_t_copy(struct yagl_avl_traverser *trav,
+ const struct yagl_avl_traverser *src)
+{
+ assert(trav != NULL && src != NULL);
+
+ if (trav != src) {
+ trav->avl_table = src->avl_table;
+ trav->avl_node = src->avl_node;
+ trav->avl_generation = src->avl_generation;
+ if (trav->avl_generation == trav->avl_table->avl_generation) {
+ trav->avl_height = src->avl_height;
+ memcpy(trav->avl_stack, (const void *) src->avl_stack,
+ sizeof(*trav->avl_stack) * trav->avl_height);
+ }
+ }
+
+ return trav->avl_node != NULL ? trav->avl_node->avl_data : NULL;
+}
+
+/*
+ * Returns the next data item in inorder
+ * within the tree being traversed with |trav|,
+ * or if there are no more data items returns |NULL|.
+ */
+void *yagl_avl_t_next(struct yagl_avl_traverser *trav)
+{
+ struct yagl_avl_node *x;
+
+ assert(trav != NULL);
+
+ if (trav->avl_generation != trav->avl_table->avl_generation) {
+ yagl_trav_refresh(trav);
+ }
+
+ x = trav->avl_node;
+ if (x == NULL) {
+ return yagl_avl_t_first(trav, trav->avl_table);
+ } else if (x->avl_link[1] != NULL) {
+ assert(trav->avl_height < YAGL_AVL_MAX_HEIGHT);
+ trav->avl_stack[trav->avl_height++] = x;
+ x = x->avl_link[1];
+
+ while (x->avl_link[0] != NULL) {
+ assert(trav->avl_height < YAGL_AVL_MAX_HEIGHT);
+ trav->avl_stack[trav->avl_height++] = x;
+ x = x->avl_link[0];
+ }
+ } else {
+ struct yagl_avl_node *y;
+
+ do {
+ if (trav->avl_height == 0) {
+ trav->avl_node = NULL;
+ return NULL;
+ }
+
+ y = x;
+ x = trav->avl_stack[--trav->avl_height];
+ } while (y == x->avl_link[1]);
+ }
+ trav->avl_node = x;
+
+ return x->avl_data;
+}
+
+/*
+ * Returns the previous data item in inorder
+ * within the tree being traversed with |trav|,
+ * or if there are no more data items returns |NULL|.
+ */
+void *yagl_avl_t_prev(struct yagl_avl_traverser *trav)
+{
+ struct yagl_avl_node *x;
+
+ assert(trav != NULL);
+
+ if (trav->avl_generation != trav->avl_table->avl_generation) {
+ yagl_trav_refresh(trav);
+ }
+
+ x = trav->avl_node;
+ if (x == NULL) {
+ return yagl_avl_t_last(trav, trav->avl_table);
+ } else if (x->avl_link[0] != NULL) {
+ assert(trav->avl_height < YAGL_AVL_MAX_HEIGHT);
+ trav->avl_stack[trav->avl_height++] = x;
+ x = x->avl_link[0];
+
+ while (x->avl_link[1] != NULL) {
+ assert(trav->avl_height < YAGL_AVL_MAX_HEIGHT);
+ trav->avl_stack[trav->avl_height++] = x;
+ x = x->avl_link[1];
+ }
+ } else {
+ struct yagl_avl_node *y;
+
+ do {
+ if (trav->avl_height == 0) {
+ trav->avl_node = NULL;
+ return NULL;
+ }
+
+ y = x;
+ x = trav->avl_stack[--trav->avl_height];
+ } while (y == x->avl_link[0]);
+ }
+ trav->avl_node = x;
+
+ return x->avl_data;
+}
+
+/* Returns |trav|'s current item. */
+void *yagl_avl_t_cur(struct yagl_avl_traverser *trav)
+{
+ assert(trav != NULL);
+
+ return trav->avl_node != NULL ? trav->avl_node->avl_data : NULL;
+}
+
+/*
+ * Replaces the current item in |trav| by |new| and returns the item replaced.
+ * |trav| must not have the null item selected.
+ * The new item must not upset the ordering of the tree.
+ */
+void *yagl_avl_t_replace(struct yagl_avl_traverser *trav, void *new)
+{
+ void *old;
+
+ assert(trav != NULL && trav->avl_node != NULL && new != NULL);
+ old = trav->avl_node->avl_data;
+ trav->avl_node->avl_data = new;
+ return old;
+}
+
+/*
+ * Destroys |new| with |avl_destroy (new, destroy)|,
+ * first setting right links of nodes in |stack| within |new|
+ * to null pointers to avoid touching uninitialized data.
+ */
+static void yagl_copy_error_recovery(struct yagl_avl_node **stack, int height,
+ struct yagl_avl_table *new, yagl_avl_item_func *destroy)
+{
+ assert(stack != NULL && height >= 0 && new != NULL);
+
+ for (; height > 2; height -= 2) {
+ stack[height - 1]->avl_link[1] = NULL;
+ }
+ yagl_avl_destroy(new, destroy);
+}
+
+/*
+ * Copies |org| to a newly created tree, which is returned.
+ * If |copy != NULL|, each data item in |org| is first passed to |copy|,
+ * and the return values are inserted into the tree,
+ * with |NULL| return values taken as indications of failure.
+ * On failure, destroys the partially created new tree,
+ * applying |destroy|, if non-null, to each item in the new tree so far,
+ * and returns |NULL|.
+ * If |allocator != NULL|, it is used for allocation in the new tree.
+ * Otherwise, the same allocator used for |org| is used.
+ */
+struct yagl_avl_table *yagl_avl_copy(const struct yagl_avl_table *org,
+ yagl_avl_copy_func *copy,
+ yagl_avl_item_func *destroy,
+ struct yagl_libavl_allocator *allocator)
+{
+ struct yagl_avl_node *stack[2 * (YAGL_AVL_MAX_HEIGHT + 1)];
+ int height = 0;
+
+ struct yagl_avl_table *new;
+ const struct yagl_avl_node *x;
+ struct yagl_avl_node *y;
+
+ assert(org != NULL);
+ new = yagl_avl_create(org->avl_compare, org->avl_param,
+ allocator != NULL ? allocator : org->avl_alloc);
+ if (new == NULL) {
+ return NULL;
+ }
+ new->avl_count = org->avl_count;
+ if (new->avl_count == 0) {
+ return new;
+ }
+
+ x = (const struct yagl_avl_node *) &org->avl_root;
+ y = (struct yagl_avl_node *) &new->avl_root;
+ for (;;) {
+ while (x->avl_link[0] != NULL) {
+ assert(height < 2 * (YAGL_AVL_MAX_HEIGHT + 1));
+
+ y->avl_link[0] = new->avl_alloc->libavl_malloc(new->avl_alloc,
+ sizeof(*y->avl_link[0]));
+ if (y->avl_link[0] == NULL) {
+ if (y != (struct yagl_avl_node *) &new->avl_root) {
+ y->avl_data = NULL;
+ y->avl_link[1] = NULL;
+ }
+
+ yagl_copy_error_recovery(stack, height, new, destroy);
+ return NULL;
+ }
+
+ stack[height++] = (struct yagl_avl_node *) x;
+ stack[height++] = y;
+ x = x->avl_link[0];
+ y = y->avl_link[0];
+ }
+ y->avl_link[0] = NULL;
+
+ for (;;) {
+ y->avl_balance = x->avl_balance;
+ if (copy == NULL) {
+ y->avl_data = x->avl_data;
+ } else {
+ y->avl_data = copy(x->avl_data, org->avl_param);
+ if (y->avl_data == NULL) {
+ y->avl_link[1] = NULL;
+ yagl_copy_error_recovery(stack, height, new, destroy);
+ return NULL;
+ }
+ }
+
+ if (x->avl_link[1] != NULL) {
+ y->avl_link[1] = new->avl_alloc->libavl_malloc(new->avl_alloc,
+ sizeof(*y->avl_link[1]));
+ if (y->avl_link[1] == NULL) {
+ yagl_copy_error_recovery(stack, height, new, destroy);
+ return NULL;
+ }
+
+ x = x->avl_link[1];
+ y = y->avl_link[1];
+ break;
+ } else {
+ y->avl_link[1] = NULL;
+ }
+
+ if (height <= 2) {
+ return new;
+ }
+
+ y = stack[--height];
+ x = stack[--height];
+ }
+ }
+}
+
+/*
+ * Frees storage allocated for |tree|.
+ * If |destroy != NULL|, applies it to each data item in inorder.
+ */
+void yagl_avl_destroy(struct yagl_avl_table *tree, yagl_avl_item_func *destroy)
+{
+ struct yagl_avl_node *p, *q;
+
+ assert(tree != NULL);
+
+ for (p = tree->avl_root; p != NULL; p = q) {
+ if (p->avl_link[0] == NULL) {
+ q = p->avl_link[1];
+ if (destroy != NULL && p->avl_data != NULL) {
+ destroy(p->avl_data, tree->avl_param);
+ }
+ tree->avl_alloc->libavl_free(tree->avl_alloc, p);
+ } else {
+ q = p->avl_link[0];
+ p->avl_link[0] = q->avl_link[1];
+ q->avl_link[1] = p;
+ }
+ }
+
+ tree->avl_alloc->libavl_free(tree->avl_alloc, tree);
+}
+
+/*
+ * Allocates |size| bytes of space using |malloc()|.
+ * Returns a null pointer if allocation fails.
+ */
+void *yagl_avl_malloc(struct yagl_libavl_allocator *allocator, size_t size)
+{
+ assert(allocator != NULL && size > 0);
+ return g_malloc(size);
+}
+
+/* Frees |block|. */
+void yagl_avl_free(struct yagl_libavl_allocator *allocator, void *block)
+{
+ assert(allocator != NULL && block != NULL);
+ g_free(block);
+}
+
+/* Default memory allocator that uses |g_malloc()| and |g_free()|. */
+struct yagl_libavl_allocator yagl_avl_allocator_default = {
+ yagl_avl_malloc, yagl_avl_free
+};
+
+#undef NDEBUG
+#include <assert.h>
+
+/* Asserts that |avl_insert()| succeeds at inserting |item| into |table|. */
+void (yagl_avl_assert_insert)(struct yagl_avl_table *table, void *item)
+{
+ void **p = yagl_avl_probe(table, item);
+ assert(p != NULL && *p == item);
+}
+
+/*
+ * Asserts that |avl_delete()| really removes |item| from |table|,
+ * and returns the removed item.
+ */
+void *(yagl_avl_assert_delete)(struct yagl_avl_table *table, void *item)
+{
+ void *p = yagl_avl_delete(table, item);
+ assert(p != NULL);
+ return p;
+}
diff --git a/hw/yagl/yagl_avl.h b/hw/yagl/yagl_avl.h
new file mode 100644
index 0000000000..bb605fd4af
--- /dev/null
+++ b/hw/yagl/yagl_avl.h
@@ -0,0 +1,130 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+/*
+ * AVL tree implementation from libavl project.
+ */
+
+#ifndef _QEMU_YAGL_AVL_H
+#define _QEMU_YAGL_AVL_H
+
+#include "yagl_types.h"
+
+/* Function types. */
+typedef int yagl_avl_comparison_func(const void */*avl_a*/, const void */*avl_b*/,
+ void */*avl_param*/);
+typedef void yagl_avl_item_func(void */*avl_item*/, void */*avl_param*/);
+typedef void *yagl_avl_copy_func(void */*avl_item*/, void */*avl_param*/);
+
+/* Memory allocator. */
+struct yagl_libavl_allocator
+{
+ void *(*libavl_malloc)(struct yagl_libavl_allocator */*allocator*/,
+ size_t /*libavl_size*/);
+ void (*libavl_free)(struct yagl_libavl_allocator */*allocator*/,
+ void */*libavl_block*/);
+};
+
+/* Default memory allocator. */
+extern struct yagl_libavl_allocator yagl_avl_allocator_default;
+void *yagl_avl_malloc(struct yagl_libavl_allocator *allocator, size_t libavl_size);
+void yagl_avl_free(struct yagl_libavl_allocator *allocator, void *libavl_block);
+
+/* Maximum AVL tree height. */
+#define YAGL_AVL_MAX_HEIGHT 92
+
+/* Tree data structure. */
+struct yagl_avl_table
+{
+ struct yagl_avl_node *avl_root; /* Tree's root. */
+ yagl_avl_comparison_func *avl_compare; /* Comparison function. */
+ void *avl_param; /* Extra argument to |avl_compare|. */
+ struct yagl_libavl_allocator *avl_alloc; /* Memory allocator. */
+ size_t avl_count; /* Number of items in tree. */
+ unsigned long avl_generation; /* Generation number. */
+};
+
+/* An AVL tree node. */
+struct yagl_avl_node
+{
+ struct yagl_avl_node *avl_link[2]; /* Subtrees. */
+ void *avl_data; /* Pointer to data. */
+ signed char avl_balance; /* Balance factor. */
+};
+
+/* AVL traverser structure. */
+struct yagl_avl_traverser
+{
+ struct yagl_avl_table *avl_table; /* Tree being traversed. */
+ struct yagl_avl_node *avl_node; /* Current node in tree. */
+ struct yagl_avl_node *avl_stack[YAGL_AVL_MAX_HEIGHT];
+ /* All the nodes above |avl_node|. */
+ size_t avl_height; /* Number of nodes in |avl_parent|. */
+ unsigned long avl_generation; /* Generation number. */
+};
+
+/* Table functions. */
+struct yagl_avl_table *yagl_avl_create(yagl_avl_comparison_func *compare,
+ void *param,
+ struct yagl_libavl_allocator *allocator);
+struct yagl_avl_table *yagl_avl_copy(const struct yagl_avl_table *org,
+ yagl_avl_copy_func *copy,
+ yagl_avl_item_func *destroy, struct yagl_libavl_allocator *allocator);
+void yagl_avl_destroy(struct yagl_avl_table *tree, yagl_avl_item_func *destroy);
+void **yagl_avl_probe(struct yagl_avl_table *tree, void *item);
+void *yagl_avl_insert(struct yagl_avl_table *table, void *item);
+void *yagl_avl_replace(struct yagl_avl_table *table, void *item);
+void *yagl_avl_delete(struct yagl_avl_table *tree, const void *item);
+void *yagl_avl_find(const struct yagl_avl_table *tree, const void *item);
+void yagl_avl_assert_insert(struct yagl_avl_table *table, void *item);
+void *yagl_avl_assert_delete(struct yagl_avl_table *table, void *item);
+
+#define yagl_avl_count(table) ((size_t)(table)->avl_count)
+
+/* Table traverser functions. */
+void yagl_avl_t_init(struct yagl_avl_traverser *trav,
+ struct yagl_avl_table *tree);
+void *yagl_avl_t_first(struct yagl_avl_traverser *trav,
+ struct yagl_avl_table *tree);
+void *yagl_avl_t_last(struct yagl_avl_traverser *trav,
+ struct yagl_avl_table *tree);
+void *yagl_avl_t_find(struct yagl_avl_traverser *trav,
+ struct yagl_avl_table *tree,
+ void *item);
+void *yagl_avl_t_insert(struct yagl_avl_traverser *trav,
+ struct yagl_avl_table *tree,
+ void *item);
+void *yagl_avl_t_copy(struct yagl_avl_traverser *trav,
+ const struct yagl_avl_traverser *src);
+void *yagl_avl_t_next(struct yagl_avl_traverser *trav);
+void *yagl_avl_t_prev(struct yagl_avl_traverser *trav);
+void *yagl_avl_t_cur(struct yagl_avl_traverser *trav);
+void *yagl_avl_t_replace(struct yagl_avl_traverser *trav, void *new_item);
+
+#endif
diff --git a/hw/yagl/yagl_backends/Makefile.objs b/hw/yagl/yagl_backends/Makefile.objs
new file mode 100644
index 0000000000..db6d768ec2
--- /dev/null
+++ b/hw/yagl/yagl_backends/Makefile.objs
@@ -0,0 +1,2 @@
+obj-y += egl_offscreen/
+obj-y += egl_onscreen/
diff --git a/hw/yagl/yagl_backends/egl_offscreen/Makefile.objs b/hw/yagl/yagl_backends/egl_offscreen/Makefile.objs
new file mode 100644
index 0000000000..5121b9f67b
--- /dev/null
+++ b/hw/yagl/yagl_backends/egl_offscreen/Makefile.objs
@@ -0,0 +1,6 @@
+# EGL offscreen backend
+obj-y += yagl_egl_offscreen.o
+obj-y += yagl_egl_offscreen_ts.o
+obj-y += yagl_egl_offscreen_display.o
+obj-y += yagl_egl_offscreen_context.o
+obj-y += yagl_egl_offscreen_surface.o
diff --git a/hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen.c b/hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen.c
new file mode 100644
index 0000000000..2045945799
--- /dev/null
+++ b/hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen.c
@@ -0,0 +1,342 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include <GL/gl.h>
+#include "yagl_egl_offscreen.h"
+#include "yagl_egl_offscreen_display.h"
+#include "yagl_egl_offscreen_context.h"
+#include "yagl_egl_offscreen_surface.h"
+#include "yagl_egl_offscreen_ts.h"
+#include "yagl_log.h"
+#include "yagl_process.h"
+#include "yagl_thread.h"
+
+YAGL_DEFINE_TLS(struct yagl_egl_offscreen_ts*, egl_offscreen_ts);
+
+static void yagl_egl_offscreen_thread_init(struct yagl_egl_backend *backend)
+{
+ YAGL_LOG_FUNC_ENTER(yagl_egl_offscreen_thread_init, NULL);
+
+ egl_offscreen_ts = yagl_egl_offscreen_ts_create();
+
+ cur_ts->egl_offscreen_ts = egl_offscreen_ts;
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+static void yagl_egl_offscreen_batch_start(struct yagl_egl_backend *backend)
+{
+ struct yagl_egl_offscreen *egl_offscreen = (struct yagl_egl_offscreen*)backend;
+
+ egl_offscreen_ts = cur_ts->egl_offscreen_ts;
+
+ if (!egl_offscreen_ts->dpy) {
+ return;
+ }
+
+ egl_offscreen->egl_driver->make_current(egl_offscreen->egl_driver,
+ egl_offscreen_ts->dpy->native_dpy,
+ egl_offscreen_ts->sfc_draw,
+ egl_offscreen_ts->sfc_read,
+ egl_offscreen_ts->ctx->native_ctx);
+}
+
+static void yagl_egl_offscreen_batch_end(struct yagl_egl_backend *backend)
+{
+ struct yagl_egl_offscreen *egl_offscreen = (struct yagl_egl_offscreen*)backend;
+
+ if (!egl_offscreen_ts->dpy) {
+ return;
+ }
+
+ egl_offscreen->egl_driver->make_current(egl_offscreen->egl_driver,
+ egl_offscreen_ts->dpy->native_dpy,
+ EGL_NO_SURFACE,
+ EGL_NO_SURFACE,
+ EGL_NO_CONTEXT);
+}
+
+static struct yagl_eglb_display *yagl_egl_offscreen_create_display(struct yagl_egl_backend *backend)
+{
+ struct yagl_egl_offscreen *egl_offscreen = (struct yagl_egl_offscreen*)backend;
+ struct yagl_egl_offscreen_display *dpy =
+ yagl_egl_offscreen_display_create(egl_offscreen);
+
+ return dpy ? &dpy->base : NULL;
+}
+
+static bool yagl_egl_offscreen_make_current(struct yagl_egl_backend *backend,
+ struct yagl_eglb_display *dpy,
+ struct yagl_eglb_context *ctx,
+ struct yagl_eglb_surface *draw,
+ struct yagl_eglb_surface *read)
+{
+ struct yagl_egl_offscreen *egl_offscreen = (struct yagl_egl_offscreen*)backend;
+ struct yagl_egl_offscreen_display *egl_offscreen_dpy = (struct yagl_egl_offscreen_display*)dpy;
+ struct yagl_egl_offscreen_context *egl_offscreen_ctx = (struct yagl_egl_offscreen_context*)ctx;
+ struct yagl_egl_offscreen_surface *egl_offscreen_draw = (struct yagl_egl_offscreen_surface*)draw;
+ struct yagl_egl_offscreen_surface *egl_offscreen_read = (struct yagl_egl_offscreen_surface*)read;
+ bool res = false;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_offscreen_make_current, NULL);
+
+ if (draw && read) {
+ res = egl_offscreen->egl_driver->make_current(egl_offscreen->egl_driver,
+ egl_offscreen_dpy->native_dpy,
+ egl_offscreen_draw->native_sfc,
+ egl_offscreen_read->native_sfc,
+ egl_offscreen_ctx->native_ctx);
+
+ if (res) {
+ egl_offscreen_ts->dpy = egl_offscreen_dpy;
+ egl_offscreen_ts->ctx = egl_offscreen_ctx;
+ egl_offscreen_ts->sfc_draw = egl_offscreen_draw->native_sfc;
+ egl_offscreen_ts->sfc_read = egl_offscreen_read->native_sfc;
+ }
+ } else {
+ /*
+ * EGL_KHR_surfaceless_context not supported for offscreen yet.
+ */
+
+ YAGL_LOG_ERROR("EGL_KHR_surfaceless_context not supported");
+ }
+
+ YAGL_LOG_FUNC_EXIT("%d", res);
+
+ return res;
+}
+
+static bool yagl_egl_offscreen_release_current(struct yagl_egl_backend *backend, bool force)
+{
+ struct yagl_egl_offscreen *egl_offscreen = (struct yagl_egl_offscreen*)backend;
+ bool res;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_offscreen_release_current, NULL);
+
+ assert(egl_offscreen_ts->dpy);
+
+ if (!egl_offscreen_ts->dpy) {
+ return false;
+ }
+
+ res = egl_offscreen->egl_driver->make_current(egl_offscreen->egl_driver,
+ egl_offscreen_ts->dpy->native_dpy,
+ EGL_NO_SURFACE,
+ EGL_NO_SURFACE,
+ EGL_NO_CONTEXT);
+
+ if (res || force) {
+ egl_offscreen_ts->dpy = NULL;
+ egl_offscreen_ts->ctx = NULL;
+ egl_offscreen_ts->sfc_draw = NULL;
+ egl_offscreen_ts->sfc_read = NULL;
+ }
+
+ YAGL_LOG_FUNC_EXIT("%d", res);
+
+ return res || force;
+}
+
+static void yagl_egl_offscreen_thread_fini(struct yagl_egl_backend *backend)
+{
+ YAGL_LOG_FUNC_ENTER(yagl_egl_offscreen_thread_fini, NULL);
+
+ yagl_egl_offscreen_ts_destroy(egl_offscreen_ts);
+ egl_offscreen_ts = cur_ts->egl_offscreen_ts = NULL;
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+static void yagl_egl_offscreen_ensure_current(struct yagl_egl_backend *backend)
+{
+ struct yagl_egl_offscreen *egl_offscreen = (struct yagl_egl_offscreen*)backend;
+
+ if (egl_offscreen_ts && egl_offscreen_ts->dpy) {
+ return;
+ }
+
+ egl_offscreen->egl_driver->make_current(egl_offscreen->egl_driver,
+ egl_offscreen->ensure_dpy,
+ egl_offscreen->ensure_sfc,
+ egl_offscreen->ensure_sfc,
+ egl_offscreen->ensure_ctx);
+}
+
+static void yagl_egl_offscreen_unensure_current(struct yagl_egl_backend *backend)
+{
+ struct yagl_egl_offscreen *egl_offscreen = (struct yagl_egl_offscreen*)backend;
+
+ if (egl_offscreen_ts && egl_offscreen_ts->dpy) {
+ return;
+ }
+
+ egl_offscreen->egl_driver->make_current(egl_offscreen->egl_driver,
+ egl_offscreen->ensure_dpy,
+ EGL_NO_SURFACE,
+ EGL_NO_SURFACE,
+ EGL_NO_CONTEXT);
+}
+
+static void yagl_egl_offscreen_destroy(struct yagl_egl_backend *backend)
+{
+ struct yagl_egl_offscreen *egl_offscreen = (struct yagl_egl_offscreen*)backend;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_offscreen_destroy, NULL);
+
+ egl_offscreen->egl_driver->context_destroy(egl_offscreen->egl_driver,
+ egl_offscreen->ensure_dpy,
+ egl_offscreen->global_ctx);
+ egl_offscreen->egl_driver->context_destroy(egl_offscreen->egl_driver,
+ egl_offscreen->ensure_dpy,
+ egl_offscreen->ensure_ctx);
+ egl_offscreen->egl_driver->pbuffer_surface_destroy(egl_offscreen->egl_driver,
+ egl_offscreen->ensure_dpy,
+ egl_offscreen->ensure_sfc);
+ egl_offscreen->egl_driver->config_cleanup(egl_offscreen->egl_driver,
+ egl_offscreen->ensure_dpy,
+ &egl_offscreen->ensure_config);
+ egl_offscreen->egl_driver->display_close(egl_offscreen->egl_driver,
+ egl_offscreen->ensure_dpy);
+
+ egl_offscreen->egl_driver->destroy(egl_offscreen->egl_driver);
+ egl_offscreen->egl_driver = NULL;
+ egl_offscreen->gles_driver = NULL;
+
+ yagl_egl_backend_cleanup(&egl_offscreen->base);
+
+ g_free(egl_offscreen);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+struct yagl_egl_backend *yagl_egl_offscreen_create(struct yagl_egl_driver *egl_driver,
+ struct yagl_gles_driver *gles_driver)
+{
+ struct yagl_egl_offscreen *egl_offscreen = g_malloc0(sizeof(struct yagl_egl_offscreen));
+ EGLNativeDisplayType dpy = NULL;
+ struct yagl_egl_native_config *configs = NULL;
+ int i, num_configs = 0;
+ struct yagl_egl_pbuffer_attribs attribs;
+ EGLSurface sfc = EGL_NO_SURFACE;
+ EGLContext ctx = EGL_NO_CONTEXT;
+ EGLContext global_ctx = EGL_NO_CONTEXT;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_offscreen_create, NULL);
+
+ yagl_egl_pbuffer_attribs_init(&attribs);
+
+ yagl_egl_backend_init(&egl_offscreen->base, yagl_render_type_offscreen);
+
+ dpy = egl_driver->display_open(egl_driver);
+
+ if (!dpy) {
+ goto fail;
+ }
+
+ configs = egl_driver->config_enum(egl_driver, dpy, &num_configs);
+
+ if (!configs || (num_configs <= 0)) {
+ goto fail;
+ }
+
+ sfc = egl_driver->pbuffer_surface_create(egl_driver, dpy, &configs[0],
+ 1, 1, &attribs);
+
+ if (sfc == EGL_NO_SURFACE) {
+ goto fail;
+ }
+
+ ctx = egl_driver->context_create(egl_driver, dpy, &configs[0], NULL);
+
+ if (ctx == EGL_NO_CONTEXT) {
+ goto fail;
+ }
+
+ global_ctx = egl_driver->context_create(egl_driver, dpy, &configs[0], ctx);
+
+ if (global_ctx == EGL_NO_CONTEXT) {
+ goto fail;
+ }
+
+ egl_offscreen->base.thread_init = &yagl_egl_offscreen_thread_init;
+ egl_offscreen->base.batch_start = &yagl_egl_offscreen_batch_start;
+ egl_offscreen->base.create_display = &yagl_egl_offscreen_create_display;
+ egl_offscreen->base.make_current = &yagl_egl_offscreen_make_current;
+ egl_offscreen->base.release_current = &yagl_egl_offscreen_release_current;
+ egl_offscreen->base.batch_end = &yagl_egl_offscreen_batch_end;
+ egl_offscreen->base.thread_fini = &yagl_egl_offscreen_thread_fini;
+ egl_offscreen->base.ensure_current = &yagl_egl_offscreen_ensure_current;
+ egl_offscreen->base.unensure_current = &yagl_egl_offscreen_unensure_current;
+ egl_offscreen->base.destroy = &yagl_egl_offscreen_destroy;
+
+ egl_offscreen->egl_driver = egl_driver;
+ egl_offscreen->gles_driver = gles_driver;
+ egl_offscreen->ensure_dpy = dpy;
+ egl_offscreen->ensure_config = configs[0];
+ egl_offscreen->ensure_ctx = ctx;
+ egl_offscreen->ensure_sfc = sfc;
+ egl_offscreen->global_ctx = global_ctx;
+
+ for (i = 1; i < num_configs; ++i) {
+ egl_driver->config_cleanup(egl_driver, dpy, &configs[i]);
+ }
+ g_free(configs);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return &egl_offscreen->base;
+
+fail:
+ if (ctx != EGL_NO_CONTEXT) {
+ egl_driver->context_destroy(egl_driver, dpy, ctx);
+ }
+
+ if (sfc != EGL_NO_SURFACE) {
+ egl_driver->pbuffer_surface_destroy(egl_driver, dpy, sfc);
+ }
+
+ if (configs) {
+ for (i = 0; i < num_configs; ++i) {
+ egl_driver->config_cleanup(egl_driver, dpy, &configs[i]);
+ }
+ g_free(configs);
+ }
+
+ if (dpy) {
+ egl_driver->display_close(egl_driver, dpy);
+ }
+
+ yagl_egl_backend_cleanup(&egl_offscreen->base);
+
+ g_free(egl_offscreen);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return NULL;
+}
diff --git a/hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen.h b/hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen.h
new file mode 100644
index 0000000000..1b443cf000
--- /dev/null
+++ b/hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen.h
@@ -0,0 +1,72 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_EGL_OFFSCREEN_H
+#define _QEMU_YAGL_EGL_OFFSCREEN_H
+
+#include "yagl_egl_backend.h"
+#include "yagl_egl_driver.h"
+#include "yagl_egl_native_config.h"
+
+struct yagl_gles_driver;
+
+struct yagl_egl_offscreen
+{
+ struct yagl_egl_backend base;
+
+ struct yagl_egl_driver *egl_driver;
+
+ struct yagl_gles_driver *gles_driver;
+
+ /*
+ * Display, config, context and surface which'll be used
+ * when we need to ensure that at least some context
+ * is current.
+ */
+ EGLNativeDisplayType ensure_dpy;
+ struct yagl_egl_native_config ensure_config;
+ EGLContext ensure_ctx;
+ EGLSurface ensure_sfc;
+
+ /*
+ * Global context, all created contexts share with it. This
+ * context is never current to any thread (And never make it
+ * current because on windows it's impossible to share with
+ * a context that's current).
+ */
+ EGLContext global_ctx;
+};
+
+/*
+ * Takes ownership of 'egl_driver'
+ */
+struct yagl_egl_backend *yagl_egl_offscreen_create(struct yagl_egl_driver *egl_driver,
+ struct yagl_gles_driver *gles_driver);
+
+#endif
diff --git a/hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen_context.c b/hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen_context.c
new file mode 100644
index 0000000000..dc9fb3d1bb
--- /dev/null
+++ b/hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen_context.c
@@ -0,0 +1,239 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include <GL/gl.h>
+#include "yagl_egl_offscreen_context.h"
+#include "yagl_egl_offscreen_display.h"
+#include "yagl_egl_offscreen.h"
+#include "yagl_egl_native_config.h"
+#include "yagl_gles_driver.h"
+#include "yagl_log.h"
+#include "yagl_tls.h"
+#include "yagl_process.h"
+#include "yagl_thread.h"
+
+static void yagl_egl_offscreen_context_destroy(struct yagl_eglb_context *ctx)
+{
+ struct yagl_egl_offscreen_context *egl_offscreen_ctx =
+ (struct yagl_egl_offscreen_context*)ctx;
+ struct yagl_egl_offscreen_display *dpy =
+ (struct yagl_egl_offscreen_display*)ctx->dpy;
+ struct yagl_egl_offscreen *egl_offscreen =
+ (struct yagl_egl_offscreen*)ctx->dpy->backend;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_offscreen_context_destroy, NULL);
+
+ if (egl_offscreen_ctx->rp_pbo) {
+ yagl_ensure_ctx();
+ egl_offscreen->gles_driver->DeleteBuffers(1, &egl_offscreen_ctx->rp_pbo);
+ yagl_unensure_ctx();
+ }
+
+ egl_offscreen->egl_driver->context_destroy(egl_offscreen->egl_driver,
+ dpy->native_dpy,
+ egl_offscreen_ctx->native_ctx);
+
+ yagl_eglb_context_cleanup(ctx);
+
+ g_free(egl_offscreen_ctx);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+struct yagl_egl_offscreen_context
+ *yagl_egl_offscreen_context_create(struct yagl_egl_offscreen_display *dpy,
+ const struct yagl_egl_native_config *cfg,
+ struct yagl_egl_offscreen_context *share_context)
+{
+ struct yagl_egl_offscreen *egl_offscreen =
+ (struct yagl_egl_offscreen*)dpy->base.backend;
+ struct yagl_egl_offscreen_context *ctx;
+ EGLContext native_ctx;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_offscreen_context_create,
+ "dpy = %p, cfg = %d",
+ dpy,
+ cfg->config_id);
+
+ native_ctx = egl_offscreen->egl_driver->context_create(
+ egl_offscreen->egl_driver,
+ dpy->native_dpy,
+ cfg,
+ egl_offscreen->global_ctx);
+
+ if (!native_ctx) {
+ YAGL_LOG_FUNC_EXIT(NULL);
+ return NULL;
+ }
+
+ ctx = g_malloc0(sizeof(*ctx));
+
+ yagl_eglb_context_init(&ctx->base, &dpy->base);
+
+ ctx->base.destroy = &yagl_egl_offscreen_context_destroy;
+
+ ctx->native_ctx = native_ctx;
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return ctx;
+}
+
+bool yagl_egl_offscreen_context_read_pixels(struct yagl_egl_offscreen_context *ctx,
+ uint32_t width,
+ uint32_t height,
+ uint32_t bpp,
+ void *pixels)
+{
+ struct yagl_gles_driver *gles_driver =
+ ((struct yagl_egl_offscreen*)ctx->base.dpy->backend)->gles_driver;
+ bool ret = false;
+ GLuint current_fb = 0;
+ GLuint current_pbo = 0;
+ uint32_t rp_line_size = width * bpp;
+ uint32_t rp_size = rp_line_size * height;
+ GLenum format = 0;
+ bool pop_attrib = false;
+ void *mapped_pixels = NULL;
+ uint32_t i;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_offscreen_context_read_pixels,
+ "%ux%ux%u", width, height, bpp);
+
+ gles_driver->GetIntegerv(GL_FRAMEBUFFER_BINDING,
+ (GLint*)&current_fb);
+
+ gles_driver->BindFramebuffer(GL_FRAMEBUFFER, 0);
+
+ if (!ctx->rp_pbo) {
+ /*
+ * No buffer yet, create one.
+ */
+
+ gles_driver->GenBuffers(1, &ctx->rp_pbo);
+
+ if (!ctx->rp_pbo) {
+ YAGL_LOG_ERROR("GenBuffers failed");
+ goto out;
+ }
+
+ YAGL_LOG_TRACE("Created pbo %u", ctx->rp_pbo);
+ }
+
+ gles_driver->GetIntegerv(GL_PIXEL_PACK_BUFFER_BINDING_ARB,
+ (GLint*)&current_pbo);
+
+ if (current_pbo != ctx->rp_pbo) {
+ YAGL_LOG_TRACE("Binding pbo");
+ gles_driver->BindBuffer(GL_PIXEL_PACK_BUFFER_ARB, ctx->rp_pbo);
+ }
+
+ if ((width != ctx->rp_pbo_width) ||
+ (height != ctx->rp_pbo_height) ||
+ (bpp != ctx->rp_pbo_bpp)) {
+ /*
+ * The surface was resized/changed, recreate pbo data accordingly.
+ */
+
+ ctx->rp_pbo_width = width;
+ ctx->rp_pbo_height = height;
+ ctx->rp_pbo_bpp = bpp;
+
+ YAGL_LOG_TRACE("Recreating pbo storage");
+
+ gles_driver->BufferData(GL_PIXEL_PACK_BUFFER_ARB,
+ rp_size,
+ 0,
+ GL_STREAM_READ);
+ }
+
+ switch (bpp) {
+ case 3:
+ format = GL_RGB;
+ break;
+ case 4:
+ format = GL_BGRA;
+ break;
+ default:
+ assert(0);
+ goto out;
+ }
+
+ gles_driver->PushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
+
+ pop_attrib = true;
+
+ gles_driver->PixelStorei(GL_PACK_ALIGNMENT,
+ ((bpp == 4) ? 4 : 1));
+
+ gles_driver->ReadPixels(0, 0,
+ width, height, format, GL_UNSIGNED_BYTE,
+ NULL);
+
+ mapped_pixels = gles_driver->MapBuffer(GL_PIXEL_PACK_BUFFER_ARB,
+ GL_READ_ONLY);
+
+ if (!mapped_pixels) {
+ YAGL_LOG_ERROR("MapBuffer failed");
+ goto out;
+ }
+
+ if (height > 0) {
+ pixels += (height - 1) * rp_line_size;
+
+ for (i = 0; i < height; ++i)
+ {
+ memcpy(pixels, mapped_pixels, rp_line_size);
+ pixels -= rp_line_size;
+ mapped_pixels += rp_line_size;
+ }
+ }
+
+ ret = true;
+
+out:
+ if (mapped_pixels) {
+ gles_driver->UnmapBuffer(GL_PIXEL_PACK_BUFFER_ARB);
+ }
+ if (pop_attrib) {
+ gles_driver->PopClientAttrib();
+ }
+ if ((current_pbo != 0) &&
+ (current_pbo != ctx->rp_pbo)) {
+ YAGL_LOG_ERROR("Target binded a pbo ?");
+ gles_driver->BindBuffer(GL_PIXEL_PACK_BUFFER_ARB,
+ current_pbo);
+ }
+
+ gles_driver->BindFramebuffer(GL_FRAMEBUFFER, current_fb);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return ret;
+}
diff --git a/hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen_context.h b/hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen_context.h
new file mode 100644
index 0000000000..2736f2b533
--- /dev/null
+++ b/hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen_context.h
@@ -0,0 +1,62 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_EGL_OFFSCREEN_CONTEXT_H
+#define _QEMU_YAGL_EGL_OFFSCREEN_CONTEXT_H
+
+#include "yagl_eglb_context.h"
+#include "yagl_egl_driver.h"
+
+struct yagl_egl_offscreen_display;
+struct yagl_egl_native_config;
+
+struct yagl_egl_offscreen_context
+{
+ struct yagl_eglb_context base;
+
+ EGLContext native_ctx;
+
+ GLuint rp_pbo;
+ uint32_t rp_pbo_width;
+ uint32_t rp_pbo_height;
+ uint32_t rp_pbo_bpp;
+};
+
+struct yagl_egl_offscreen_context
+ *yagl_egl_offscreen_context_create(struct yagl_egl_offscreen_display *dpy,
+ const struct yagl_egl_native_config *cfg,
+ struct yagl_egl_offscreen_context *share_context);
+
+bool yagl_egl_offscreen_context_read_pixels(struct yagl_egl_offscreen_context *ctx,
+ uint32_t width,
+ uint32_t height,
+ uint32_t bpp,
+ void *pixels);
+
+#endif
diff --git a/hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen_display.c b/hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen_display.c
new file mode 100644
index 0000000000..d4ddfd20de
--- /dev/null
+++ b/hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen_display.c
@@ -0,0 +1,217 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include <GL/gl.h>
+#include "yagl_egl_offscreen_display.h"
+#include "yagl_egl_offscreen_context.h"
+#include "yagl_egl_offscreen_surface.h"
+#include "yagl_egl_offscreen.h"
+#include "yagl_egl_native_config.h"
+#include "yagl_log.h"
+#include "yagl_tls.h"
+#include "yagl_process.h"
+#include "yagl_thread.h"
+#include "yagl_object_map.h"
+#include "yagl_gles_driver.h"
+
+struct yagl_egl_offscreen_image
+{
+ struct yagl_object base;
+
+ struct yagl_gles_driver *driver;
+};
+
+static void yagl_egl_offscreen_image_destroy(struct yagl_object *obj)
+{
+ struct yagl_egl_offscreen_image *image = (struct yagl_egl_offscreen_image*)obj;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_offscreen_image_destroy, "%u", obj->global_name);
+
+ yagl_ensure_ctx();
+ image->driver->DeleteTextures(1, &obj->global_name);
+ yagl_unensure_ctx();
+
+ g_free(image);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+static struct yagl_egl_native_config
+ *yagl_egl_offscreen_display_config_enum(struct yagl_eglb_display *dpy,
+ int *num_configs)
+{
+ struct yagl_egl_offscreen_display *egl_offscreen_dpy =
+ (struct yagl_egl_offscreen_display*)dpy;
+ struct yagl_egl_offscreen *egl_offscreen =
+ (struct yagl_egl_offscreen*)dpy->backend;
+ struct yagl_egl_native_config *native_configs;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_offscreen_display_config_enum,
+ "dpy = %p", dpy);
+
+ native_configs =
+ egl_offscreen->egl_driver->config_enum(egl_offscreen->egl_driver,
+ egl_offscreen_dpy->native_dpy,
+ num_configs);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return native_configs;
+}
+
+static void yagl_egl_offscreen_display_config_cleanup(struct yagl_eglb_display *dpy,
+ const struct yagl_egl_native_config *cfg)
+{
+ struct yagl_egl_offscreen_display *egl_offscreen_dpy =
+ (struct yagl_egl_offscreen_display*)dpy;
+ struct yagl_egl_offscreen *egl_offscreen =
+ (struct yagl_egl_offscreen*)dpy->backend;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_offscreen_display_config_cleanup,
+ "dpy = %p, cfg = %d",
+ dpy,
+ cfg->config_id);
+
+ egl_offscreen->egl_driver->config_cleanup(egl_offscreen->egl_driver,
+ egl_offscreen_dpy->native_dpy,
+ cfg);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+static struct yagl_eglb_context
+ *yagl_egl_offscreen_display_create_context(struct yagl_eglb_display *dpy,
+ const struct yagl_egl_native_config *cfg,
+ struct yagl_eglb_context *share_context)
+{
+ struct yagl_egl_offscreen_display *egl_offscreen_dpy =
+ (struct yagl_egl_offscreen_display*)dpy;
+ struct yagl_egl_offscreen_context *ctx =
+ yagl_egl_offscreen_context_create(egl_offscreen_dpy,
+ cfg,
+ (struct yagl_egl_offscreen_context*)share_context);
+
+ return ctx ? &ctx->base : NULL;
+}
+
+static struct yagl_eglb_surface
+ *yagl_egl_offscreen_display_create_surface(struct yagl_eglb_display *dpy,
+ const struct yagl_egl_native_config *cfg,
+ EGLenum type,
+ const void *attribs,
+ uint32_t width,
+ uint32_t height,
+ uint32_t bpp,
+ target_ulong pixels)
+{
+ struct yagl_egl_offscreen_display *egl_offscreen_dpy =
+ (struct yagl_egl_offscreen_display*)dpy;
+ struct yagl_egl_offscreen_surface *sfc =
+ yagl_egl_offscreen_surface_create(egl_offscreen_dpy,
+ cfg,
+ type,
+ attribs,
+ width,
+ height,
+ bpp,
+ pixels);
+
+ return sfc ? &sfc->base : NULL;
+}
+
+static struct yagl_object *yagl_egl_offscreen_display_create_image(struct yagl_eglb_display *dpy,
+ yagl_winsys_id buffer)
+{
+ struct yagl_egl_offscreen *egl_offscreen =
+ (struct yagl_egl_offscreen*)dpy->backend;
+ struct yagl_egl_offscreen_image *image;
+
+ image = g_malloc(sizeof(*image));
+
+ yagl_ensure_ctx();
+ egl_offscreen->gles_driver->GenTextures(1, &image->base.global_name);
+ yagl_unensure_ctx();
+ image->base.destroy = &yagl_egl_offscreen_image_destroy;
+ image->driver = egl_offscreen->gles_driver;
+
+ return &image->base;
+}
+
+static void yagl_egl_offscreen_display_destroy(struct yagl_eglb_display *dpy)
+{
+ struct yagl_egl_offscreen_display *egl_offscreen_dpy =
+ (struct yagl_egl_offscreen_display*)dpy;
+ struct yagl_egl_offscreen *egl_offscreen =
+ (struct yagl_egl_offscreen*)dpy->backend;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_offscreen_display_destroy,
+ "dpy = %p", dpy);
+
+ egl_offscreen->egl_driver->display_close(egl_offscreen->egl_driver,
+ egl_offscreen_dpy->native_dpy);
+
+ yagl_eglb_display_cleanup(dpy);
+
+ g_free(egl_offscreen_dpy);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+struct yagl_egl_offscreen_display
+ *yagl_egl_offscreen_display_create(struct yagl_egl_offscreen *egl_offscreen)
+{
+ struct yagl_egl_offscreen_display *dpy;
+ EGLNativeDisplayType native_dpy;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_offscreen_display_create, NULL);
+
+ native_dpy = egl_offscreen->egl_driver->display_open(egl_offscreen->egl_driver);
+
+ if (!native_dpy) {
+ YAGL_LOG_FUNC_EXIT(NULL);
+ return NULL;
+ }
+
+ dpy = g_malloc0(sizeof(*dpy));
+
+ yagl_eglb_display_init(&dpy->base, &egl_offscreen->base);
+
+ dpy->base.config_enum = &yagl_egl_offscreen_display_config_enum;
+ dpy->base.config_cleanup = &yagl_egl_offscreen_display_config_cleanup;
+ dpy->base.create_context = &yagl_egl_offscreen_display_create_context;
+ dpy->base.create_offscreen_surface = &yagl_egl_offscreen_display_create_surface;
+ dpy->base.create_image = &yagl_egl_offscreen_display_create_image;
+ dpy->base.destroy = &yagl_egl_offscreen_display_destroy;
+
+ dpy->native_dpy = native_dpy;
+
+ YAGL_LOG_FUNC_EXIT("%p", dpy);
+
+ return dpy;
+}
diff --git a/hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen_display.h b/hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen_display.h
new file mode 100644
index 0000000000..f2895ea305
--- /dev/null
+++ b/hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen_display.h
@@ -0,0 +1,48 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_EGL_OFFSCREEN_DISPLAY_H
+#define _QEMU_YAGL_EGL_OFFSCREEN_DISPLAY_H
+
+#include "yagl_eglb_display.h"
+#include "yagl_egl_driver.h"
+
+struct yagl_egl_offscreen;
+
+struct yagl_egl_offscreen_display
+{
+ struct yagl_eglb_display base;
+
+ EGLNativeDisplayType native_dpy;
+};
+
+struct yagl_egl_offscreen_display
+ *yagl_egl_offscreen_display_create(struct yagl_egl_offscreen *egl_offscreen);
+
+#endif
diff --git a/hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen_surface.c b/hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen_surface.c
new file mode 100644
index 0000000000..d02fadba6d
--- /dev/null
+++ b/hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen_surface.c
@@ -0,0 +1,276 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include <GL/gl.h>
+#include "yagl_egl_offscreen_surface.h"
+#include "yagl_egl_offscreen_display.h"
+#include "yagl_egl_offscreen_context.h"
+#include "yagl_egl_offscreen_ts.h"
+#include "yagl_egl_offscreen.h"
+#include "yagl_egl_native_config.h"
+#include "yagl_tls.h"
+#include "yagl_log.h"
+#include "yagl_process.h"
+#include "yagl_thread.h"
+#include "yagl_compiled_transfer.h"
+
+YAGL_DECLARE_TLS(struct yagl_egl_offscreen_ts*, egl_offscreen_ts);
+
+static void yagl_egl_offscreen_surface_cleanup(struct yagl_egl_offscreen_surface *sfc)
+{
+ struct yagl_egl_offscreen_display *dpy =
+ (struct yagl_egl_offscreen_display*)sfc->base.dpy;
+ struct yagl_egl_offscreen *egl_offscreen =
+ (struct yagl_egl_offscreen*)sfc->base.dpy->backend;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_offscreen_surface_cleanup, NULL);
+
+ g_free(sfc->host_pixels);
+ sfc->host_pixels = NULL;
+
+ egl_offscreen->egl_driver->pbuffer_surface_destroy(egl_offscreen->egl_driver,
+ dpy->native_dpy,
+ sfc->native_sfc);
+ sfc->native_sfc = EGL_NO_SURFACE;
+
+ if (sfc->bimage_ct) {
+ yagl_compiled_transfer_destroy(sfc->bimage_ct);
+ sfc->bimage_ct = NULL;
+ }
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+static void yagl_egl_offscreen_surface_invalidate(struct yagl_eglb_surface *sfc,
+ yagl_winsys_id id)
+{
+}
+
+static void yagl_egl_offscreen_surface_replace(struct yagl_eglb_surface *sfc,
+ struct yagl_eglb_surface *with)
+{
+ struct yagl_egl_offscreen_surface *osfc =
+ (struct yagl_egl_offscreen_surface*)sfc;
+ struct yagl_egl_offscreen_surface *owith =
+ (struct yagl_egl_offscreen_surface*)with;
+
+ yagl_egl_offscreen_surface_cleanup(osfc);
+
+ osfc->bimage_ct = owith->bimage_ct;
+ osfc->width = owith->width;
+ osfc->height = owith->height;
+ osfc->bpp = owith->bpp;
+ osfc->host_pixels = owith->host_pixels;
+ osfc->native_sfc = owith->native_sfc;
+ osfc->native_sfc_attribs = owith->native_sfc_attribs;
+
+ yagl_eglb_surface_cleanup(with);
+
+ g_free(owith);
+}
+
+static bool yagl_egl_offscreen_surface_query(struct yagl_eglb_surface *sfc,
+ EGLint attribute,
+ EGLint *value)
+{
+ struct yagl_egl_offscreen_surface *osfc =
+ (struct yagl_egl_offscreen_surface*)sfc;
+
+ switch (attribute) {
+ case EGL_HEIGHT:
+ *value = osfc->height;
+ break;
+ case EGL_WIDTH:
+ *value = osfc->width;
+ break;
+ default:
+ return false;
+ }
+
+ return true;
+}
+
+static bool yagl_egl_offscreen_surface_swap_buffers(struct yagl_eglb_surface *sfc)
+{
+ struct yagl_egl_offscreen_surface *osfc =
+ (struct yagl_egl_offscreen_surface*)sfc;
+ struct yagl_egl_offscreen_context *octx = egl_offscreen_ts->ctx;
+
+ YAGL_LOG_FUNC_SET(yagl_egl_offscreen_surface_swap_buffers);
+
+ assert(octx);
+
+ if (!yagl_egl_offscreen_context_read_pixels(octx,
+ osfc->width,
+ osfc->height,
+ osfc->bpp,
+ osfc->host_pixels)) {
+ YAGL_LOG_ERROR("read_pixels failed");
+ return false;
+ }
+
+ assert(osfc->bimage_ct);
+
+ yagl_compiled_transfer_exec(osfc->bimage_ct, osfc->host_pixels);
+
+ return true;
+}
+
+static bool yagl_egl_offscreen_surface_copy_buffers(struct yagl_eglb_surface *sfc)
+{
+ struct yagl_egl_offscreen_surface *osfc =
+ (struct yagl_egl_offscreen_surface*)sfc;
+ struct yagl_egl_offscreen_context *octx = egl_offscreen_ts->ctx;
+
+ YAGL_LOG_FUNC_SET(yagl_egl_offscreen_surface_copy_buffers);
+
+ assert(octx);
+
+ if (!yagl_egl_offscreen_context_read_pixels(octx,
+ osfc->width,
+ osfc->height,
+ osfc->bpp,
+ osfc->host_pixels)) {
+ YAGL_LOG_ERROR("read_pixels failed");
+ return false;
+ }
+
+ assert(osfc->bimage_ct);
+
+ yagl_compiled_transfer_exec(osfc->bimage_ct, osfc->host_pixels);
+
+ return true;
+}
+
+static void yagl_egl_offscreen_surface_wait_gl(struct yagl_eglb_surface *sfc)
+{
+}
+
+static void yagl_egl_offscreen_surface_destroy(struct yagl_eglb_surface *sfc)
+{
+ struct yagl_egl_offscreen_surface *egl_offscreen_sfc =
+ (struct yagl_egl_offscreen_surface*)sfc;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_offscreen_surface_destroy, NULL);
+
+ yagl_egl_offscreen_surface_cleanup(egl_offscreen_sfc);
+
+ yagl_eglb_surface_cleanup(sfc);
+
+ g_free(egl_offscreen_sfc);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+struct yagl_egl_offscreen_surface
+ *yagl_egl_offscreen_surface_create(struct yagl_egl_offscreen_display *dpy,
+ const struct yagl_egl_native_config *cfg,
+ EGLenum type,
+ const void *attribs,
+ uint32_t width,
+ uint32_t height,
+ uint32_t bpp,
+ target_ulong pixels)
+{
+ struct yagl_egl_offscreen *egl_offscreen =
+ (struct yagl_egl_offscreen*)dpy->base.backend;
+ struct yagl_egl_offscreen_surface *sfc;
+ struct yagl_egl_pbuffer_attribs pbuffer_attribs;
+ EGLSurface native_sfc;
+ struct yagl_compiled_transfer *bimage_ct;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_offscreen_surface_create,
+ "dpy = %p, cfg = %d, type = %u, width = %u, height = %u, bpp = %u",
+ dpy,
+ cfg->config_id,
+ type,
+ width,
+ height,
+ bpp);
+
+ switch (type) {
+ case EGL_PBUFFER_BIT:
+ memcpy(&pbuffer_attribs, attribs, sizeof(pbuffer_attribs));
+ break;
+ case EGL_PIXMAP_BIT:
+ case EGL_WINDOW_BIT:
+ yagl_egl_pbuffer_attribs_init(&pbuffer_attribs);
+ break;
+ default:
+ assert(0);
+ YAGL_LOG_FUNC_EXIT(NULL);
+ return NULL;
+ }
+
+ bimage_ct = yagl_compiled_transfer_create(pixels,
+ (width * height * bpp),
+ true);
+
+ if (!bimage_ct) {
+ YAGL_LOG_FUNC_EXIT(NULL);
+ return NULL;
+ }
+
+ native_sfc = egl_offscreen->egl_driver->pbuffer_surface_create(egl_offscreen->egl_driver,
+ dpy->native_dpy,
+ cfg,
+ width,
+ height,
+ &pbuffer_attribs);
+
+ if (!native_sfc) {
+ yagl_compiled_transfer_destroy(bimage_ct);
+ YAGL_LOG_FUNC_EXIT(NULL);
+ return NULL;
+ }
+
+ sfc = g_malloc0(sizeof(*sfc));
+
+ yagl_eglb_surface_init(&sfc->base, &dpy->base, type, attribs);
+
+ sfc->bimage_ct = bimage_ct;
+ sfc->width = width;
+ sfc->height = height;
+ sfc->bpp = bpp;
+ sfc->host_pixels = g_malloc(width * height * bpp);
+ sfc->native_sfc = native_sfc;
+ memcpy(&sfc->native_sfc_attribs, &pbuffer_attribs, sizeof(pbuffer_attribs));
+
+ sfc->base.invalidate = &yagl_egl_offscreen_surface_invalidate;
+ sfc->base.replace = &yagl_egl_offscreen_surface_replace;
+ sfc->base.query = &yagl_egl_offscreen_surface_query;
+ sfc->base.swap_buffers = &yagl_egl_offscreen_surface_swap_buffers;
+ sfc->base.copy_buffers = &yagl_egl_offscreen_surface_copy_buffers;
+ sfc->base.wait_gl = &yagl_egl_offscreen_surface_wait_gl;
+ sfc->base.destroy = &yagl_egl_offscreen_surface_destroy;
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return sfc;
+}
diff --git a/hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen_surface.h b/hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen_surface.h
new file mode 100644
index 0000000000..789b56c5b6
--- /dev/null
+++ b/hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen_surface.h
@@ -0,0 +1,81 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_EGL_OFFSCREEN_SURFACE_H
+#define _QEMU_YAGL_EGL_OFFSCREEN_SURFACE_H
+
+#include "yagl_eglb_surface.h"
+#include "yagl_egl_driver.h"
+#include "yagl_egl_surface_attribs.h"
+
+struct yagl_egl_offscreen_display;
+struct yagl_compiled_transfer;
+struct yagl_egl_native_config;
+
+struct yagl_egl_offscreen_surface
+{
+ struct yagl_eglb_surface base;
+
+ /*
+ * Compiled transfer for backing image. It'll become NULL
+ * after eglDestroySurface is called.
+ */
+ struct yagl_compiled_transfer *bimage_ct;
+ uint32_t width;
+ uint32_t height;
+ uint32_t bpp;
+
+ /*
+ * Host pre-allocated storage for backing image.
+ * This will go to compiled transfer above.
+ */
+ void *host_pixels;
+
+ /*
+ * Native pbuffer surface.
+ */
+ EGLSurface native_sfc;
+
+ /*
+ * Attribs with which this 'native_sfc' was created with.
+ */
+ struct yagl_egl_pbuffer_attribs native_sfc_attribs;
+};
+
+struct yagl_egl_offscreen_surface
+ *yagl_egl_offscreen_surface_create(struct yagl_egl_offscreen_display *dpy,
+ const struct yagl_egl_native_config *cfg,
+ EGLenum type,
+ const void *attribs,
+ uint32_t width,
+ uint32_t height,
+ uint32_t bpp,
+ target_ulong pixels);
+
+#endif
diff --git a/hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen_ts.c b/hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen_ts.c
new file mode 100644
index 0000000000..4547e8e4fd
--- /dev/null
+++ b/hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen_ts.c
@@ -0,0 +1,43 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "yagl_egl_offscreen_ts.h"
+
+struct yagl_egl_offscreen_ts *yagl_egl_offscreen_ts_create(void)
+{
+ struct yagl_egl_offscreen_ts *egl_offscreen_ts =
+ g_malloc0(sizeof(struct yagl_egl_offscreen_ts));
+
+ return egl_offscreen_ts;
+}
+
+void yagl_egl_offscreen_ts_destroy(struct yagl_egl_offscreen_ts *egl_offscreen_ts)
+{
+ g_free(egl_offscreen_ts);
+}
diff --git a/hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen_ts.h b/hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen_ts.h
new file mode 100644
index 0000000000..7c3f34118b
--- /dev/null
+++ b/hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen_ts.h
@@ -0,0 +1,52 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_EGL_OFFSCREEN_TS_H
+#define _QEMU_YAGL_EGL_OFFSCREEN_TS_H
+
+#include "yagl_types.h"
+#include <EGL/egl.h>
+
+struct yagl_egl_offscreen_display;
+struct yagl_egl_offscreen_context;
+struct yagl_egl_offscreen_surface;
+
+struct yagl_egl_offscreen_ts
+{
+ struct yagl_egl_offscreen_display *dpy;
+ struct yagl_egl_offscreen_context *ctx;
+ EGLSurface sfc_draw;
+ EGLSurface sfc_read;
+};
+
+struct yagl_egl_offscreen_ts *yagl_egl_offscreen_ts_create(void);
+
+void yagl_egl_offscreen_ts_destroy(struct yagl_egl_offscreen_ts *egl_offscreen_ts);
+
+#endif
diff --git a/hw/yagl/yagl_backends/egl_onscreen/Makefile.objs b/hw/yagl/yagl_backends/egl_onscreen/Makefile.objs
new file mode 100644
index 0000000000..922fc679ad
--- /dev/null
+++ b/hw/yagl/yagl_backends/egl_onscreen/Makefile.objs
@@ -0,0 +1,7 @@
+# EGL onscreen backend
+obj-y += yagl_egl_onscreen.o
+obj-y += yagl_egl_onscreen_ts.o
+obj-y += yagl_egl_onscreen_display.o
+obj-y += yagl_egl_onscreen_context.o
+obj-y += yagl_egl_onscreen_surface.o
+
diff --git a/hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen.c b/hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen.c
new file mode 100644
index 0000000000..c700f13abe
--- /dev/null
+++ b/hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen.c
@@ -0,0 +1,428 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "yagl_egl_onscreen.h"
+#include <GL/gl.h>
+#include "yagl_egl_onscreen_ts.h"
+#include "yagl_egl_onscreen_display.h"
+#include "yagl_egl_onscreen_context.h"
+#include "yagl_egl_onscreen_surface.h"
+#include "yagl_tls.h"
+#include "yagl_log.h"
+#include "yagl_process.h"
+#include "yagl_thread.h"
+#include "yagl_gles_driver.h"
+#include "winsys_gl.h"
+
+YAGL_DEFINE_TLS(struct yagl_egl_onscreen_ts*, egl_onscreen_ts);
+
+static void yagl_egl_onscreen_setup_framebuffer_zero(struct yagl_egl_onscreen *egl_onscreen)
+{
+ GLuint cur_fb = 0;
+
+ assert(egl_onscreen_ts->dpy);
+
+ yagl_egl_onscreen_context_setup(egl_onscreen_ts->ctx);
+
+ if (!egl_onscreen_ts->sfc_draw) {
+ return;
+ }
+
+ yagl_egl_onscreen_surface_setup(egl_onscreen_ts->sfc_draw);
+
+ egl_onscreen->gles_driver->GetIntegerv(GL_FRAMEBUFFER_BINDING,
+ (GLint*)&cur_fb);
+
+ egl_onscreen->gles_driver->BindFramebuffer(GL_FRAMEBUFFER,
+ egl_onscreen_ts->ctx->fb);
+
+ yagl_egl_onscreen_surface_attach_to_framebuffer(egl_onscreen_ts->sfc_draw);
+
+ egl_onscreen->gles_driver->BindFramebuffer(GL_FRAMEBUFFER,
+ cur_fb);
+}
+
+static void yagl_egl_onscreen_thread_init(struct yagl_egl_backend *backend)
+{
+ struct yagl_egl_onscreen *egl_onscreen = (struct yagl_egl_onscreen*)backend;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_onscreen_thread_init, NULL);
+
+ egl_onscreen_ts = yagl_egl_onscreen_ts_create(egl_onscreen->gles_driver);
+
+ cur_ts->egl_onscreen_ts = egl_onscreen_ts;
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+static void yagl_egl_onscreen_batch_start(struct yagl_egl_backend *backend)
+{
+ struct yagl_egl_onscreen *egl_onscreen = (struct yagl_egl_onscreen*)backend;
+
+ egl_onscreen_ts = cur_ts->egl_onscreen_ts;
+
+ if (!egl_onscreen_ts->dpy) {
+ return;
+ }
+
+ if (egl_onscreen_ts->sfc_draw && egl_onscreen_ts->sfc_read) {
+ egl_onscreen->egl_driver->make_current(egl_onscreen->egl_driver,
+ egl_onscreen_ts->dpy->native_dpy,
+ egl_onscreen_ts->sfc_draw->dummy_native_sfc,
+ egl_onscreen_ts->sfc_read->dummy_native_sfc,
+ egl_onscreen_ts->ctx->native_ctx);
+ } else {
+ egl_onscreen->egl_driver->make_current(egl_onscreen->egl_driver,
+ egl_onscreen_ts->dpy->native_dpy,
+ egl_onscreen_ts->ctx->null_sfc,
+ egl_onscreen_ts->ctx->null_sfc,
+ egl_onscreen_ts->ctx->native_ctx);
+ }
+}
+
+static void yagl_egl_onscreen_batch_end(struct yagl_egl_backend *backend)
+{
+ struct yagl_egl_onscreen *egl_onscreen = (struct yagl_egl_onscreen*)backend;
+
+ if (!egl_onscreen_ts->dpy) {
+ return;
+ }
+
+ egl_onscreen->egl_driver->make_current(egl_onscreen->egl_driver,
+ egl_onscreen_ts->dpy->native_dpy,
+ EGL_NO_SURFACE,
+ EGL_NO_SURFACE,
+ EGL_NO_CONTEXT);
+}
+
+static struct yagl_eglb_display *yagl_egl_onscreen_create_display(struct yagl_egl_backend *backend)
+{
+ struct yagl_egl_onscreen *egl_onscreen = (struct yagl_egl_onscreen*)backend;
+ struct yagl_egl_onscreen_display *dpy =
+ yagl_egl_onscreen_display_create(egl_onscreen);
+
+ return dpy ? &dpy->base : NULL;
+}
+
+static bool yagl_egl_onscreen_make_current(struct yagl_egl_backend *backend,
+ struct yagl_eglb_display *dpy,
+ struct yagl_eglb_context *ctx,
+ struct yagl_eglb_surface *draw,
+ struct yagl_eglb_surface *read)
+{
+ struct yagl_egl_onscreen *egl_onscreen = (struct yagl_egl_onscreen*)backend;
+ struct yagl_egl_onscreen_display *egl_onscreen_dpy = (struct yagl_egl_onscreen_display*)dpy;
+ struct yagl_egl_onscreen_context *egl_onscreen_ctx = (struct yagl_egl_onscreen_context*)ctx;
+ struct yagl_egl_onscreen_surface *egl_onscreen_draw = (struct yagl_egl_onscreen_surface*)draw;
+ struct yagl_egl_onscreen_surface *egl_onscreen_read = (struct yagl_egl_onscreen_surface*)read;
+ bool res;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_onscreen_make_current, NULL);
+
+ if (draw && read) {
+ res = egl_onscreen->egl_driver->make_current(egl_onscreen->egl_driver,
+ egl_onscreen_dpy->native_dpy,
+ egl_onscreen_draw->dummy_native_sfc,
+ egl_onscreen_read->dummy_native_sfc,
+ egl_onscreen_ctx->native_ctx);
+ } else {
+ res = yagl_egl_onscreen_context_setup_surfaceless(egl_onscreen_ctx);
+
+ if (res) {
+ res = egl_onscreen->egl_driver->make_current(egl_onscreen->egl_driver,
+ egl_onscreen_dpy->native_dpy,
+ egl_onscreen_ctx->null_sfc,
+ egl_onscreen_ctx->null_sfc,
+ egl_onscreen_ctx->native_ctx);
+ }
+ }
+
+ if (res) {
+ GLuint cur_fb = 0;
+
+ egl_onscreen_ts->dpy = egl_onscreen_dpy;
+ egl_onscreen_ts->ctx = egl_onscreen_ctx;
+ egl_onscreen_ts->sfc_draw = egl_onscreen_draw;
+ egl_onscreen_ts->sfc_read = egl_onscreen_read;
+
+ yagl_egl_onscreen_setup_framebuffer_zero(egl_onscreen);
+
+ egl_onscreen->gles_driver->GetIntegerv(GL_FRAMEBUFFER_BINDING,
+ (GLint*)&cur_fb);
+
+ if (cur_fb == 0) {
+ /*
+ * No framebuffer, then bind our framebuffer zero.
+ */
+
+ egl_onscreen->gles_driver->BindFramebuffer(GL_FRAMEBUFFER,
+ egl_onscreen_ctx->fb);
+
+ /*
+ * Setup default viewport and scissor.
+ */
+ if (draw) {
+ egl_onscreen->gles_driver->Viewport(0,
+ 0,
+ yagl_egl_onscreen_surface_width(egl_onscreen_draw),
+ yagl_egl_onscreen_surface_height(egl_onscreen_draw));
+ egl_onscreen->gles_driver->Scissor(0,
+ 0,
+ yagl_egl_onscreen_surface_width(egl_onscreen_draw),
+ yagl_egl_onscreen_surface_height(egl_onscreen_draw));
+ } else {
+ /*
+ * "If the first time <ctx> is made current, it is without a default
+ * framebuffer (e.g. both <draw> and <read> are EGL_NO_SURFACE), then
+ * the viewport and scissor regions are set as though
+ * glViewport(0,0,0,0) and glScissor(0,0,0,0) were called."
+ */
+ egl_onscreen->gles_driver->Viewport(0, 0, 0, 0);
+ egl_onscreen->gles_driver->Scissor(0, 0, 0, 0);
+ }
+ }
+ }
+
+ YAGL_LOG_FUNC_EXIT("%d", res);
+
+ return res;
+}
+
+static bool yagl_egl_onscreen_release_current(struct yagl_egl_backend *backend, bool force)
+{
+ struct yagl_egl_onscreen *egl_onscreen = (struct yagl_egl_onscreen*)backend;
+ bool res;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_onscreen_release_current, NULL);
+
+ assert(egl_onscreen_ts->dpy);
+
+ if (!egl_onscreen_ts->dpy) {
+ return false;
+ }
+
+ res = egl_onscreen->egl_driver->make_current(egl_onscreen->egl_driver,
+ egl_onscreen_ts->dpy->native_dpy,
+ EGL_NO_SURFACE,
+ EGL_NO_SURFACE,
+ EGL_NO_CONTEXT);
+
+ if (res || force) {
+ egl_onscreen_ts->dpy = NULL;
+ egl_onscreen_ts->ctx = NULL;
+ egl_onscreen_ts->sfc_draw = NULL;
+ egl_onscreen_ts->sfc_read = NULL;
+ }
+
+ YAGL_LOG_FUNC_EXIT("%d", res);
+
+ return res || force;
+}
+
+static void yagl_egl_onscreen_thread_fini(struct yagl_egl_backend *backend)
+{
+ YAGL_LOG_FUNC_ENTER(yagl_egl_onscreen_thread_fini, NULL);
+
+ yagl_egl_onscreen_ts_destroy(egl_onscreen_ts);
+ egl_onscreen_ts = cur_ts->egl_onscreen_ts = NULL;
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+static void yagl_egl_onscreen_ensure_current(struct yagl_egl_backend *backend)
+{
+ struct yagl_egl_onscreen *egl_onscreen = (struct yagl_egl_onscreen*)backend;
+
+ if (egl_onscreen_ts && egl_onscreen_ts->dpy) {
+ return;
+ }
+
+ egl_onscreen->egl_driver->make_current(egl_onscreen->egl_driver,
+ egl_onscreen->ensure_dpy,
+ egl_onscreen->ensure_sfc,
+ egl_onscreen->ensure_sfc,
+ egl_onscreen->ensure_ctx);
+}
+
+static void yagl_egl_onscreen_unensure_current(struct yagl_egl_backend *backend)
+{
+ struct yagl_egl_onscreen *egl_onscreen = (struct yagl_egl_onscreen*)backend;
+
+ if (egl_onscreen_ts && egl_onscreen_ts->dpy) {
+ return;
+ }
+
+ egl_onscreen->egl_driver->make_current(egl_onscreen->egl_driver,
+ egl_onscreen->ensure_dpy,
+ EGL_NO_SURFACE,
+ EGL_NO_SURFACE,
+ EGL_NO_CONTEXT);
+}
+
+static void yagl_egl_onscreen_destroy(struct yagl_egl_backend *backend)
+{
+ struct yagl_egl_onscreen *egl_onscreen = (struct yagl_egl_onscreen*)backend;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_onscreen_destroy, NULL);
+
+ egl_onscreen->egl_driver->context_destroy(egl_onscreen->egl_driver,
+ egl_onscreen->ensure_dpy,
+ egl_onscreen->global_ctx);
+ egl_onscreen->egl_driver->context_destroy(egl_onscreen->egl_driver,
+ egl_onscreen->ensure_dpy,
+ egl_onscreen->ensure_ctx);
+ egl_onscreen->egl_driver->pbuffer_surface_destroy(egl_onscreen->egl_driver,
+ egl_onscreen->ensure_dpy,
+ egl_onscreen->ensure_sfc);
+ egl_onscreen->egl_driver->config_cleanup(egl_onscreen->egl_driver,
+ egl_onscreen->ensure_dpy,
+ &egl_onscreen->ensure_config);
+ egl_onscreen->egl_driver->display_close(egl_onscreen->egl_driver,
+ egl_onscreen->ensure_dpy);
+
+ egl_onscreen->egl_driver->destroy(egl_onscreen->egl_driver);
+ egl_onscreen->egl_driver = NULL;
+ egl_onscreen->gles_driver = NULL;
+
+ yagl_egl_backend_cleanup(&egl_onscreen->base);
+
+ g_free(egl_onscreen);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+struct yagl_egl_backend *yagl_egl_onscreen_create(struct winsys_interface *wsi,
+ struct yagl_egl_driver *egl_driver,
+ struct yagl_gles_driver *gles_driver)
+{
+ struct yagl_egl_onscreen *egl_onscreen = g_malloc0(sizeof(struct yagl_egl_onscreen));
+ EGLNativeDisplayType dpy = NULL;
+ struct yagl_egl_native_config *configs = NULL;
+ int i, num_configs = 0;
+ struct yagl_egl_pbuffer_attribs attribs;
+ EGLSurface sfc = EGL_NO_SURFACE;
+ EGLContext ctx = EGL_NO_CONTEXT;
+ EGLContext global_ctx = EGL_NO_CONTEXT;
+ struct winsys_gl_info *ws_info = (struct winsys_gl_info*)wsi->ws_info;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_onscreen_create, NULL);
+
+ yagl_egl_pbuffer_attribs_init(&attribs);
+
+ yagl_egl_backend_init(&egl_onscreen->base, yagl_render_type_onscreen);
+
+ dpy = egl_driver->display_open(egl_driver);
+
+ if (!dpy) {
+ goto fail;
+ }
+
+ configs = egl_driver->config_enum(egl_driver, dpy, &num_configs);
+
+ if (!configs || (num_configs <= 0)) {
+ goto fail;
+ }
+
+ sfc = egl_driver->pbuffer_surface_create(egl_driver, dpy, &configs[0],
+ 1, 1, &attribs);
+
+ if (sfc == EGL_NO_SURFACE) {
+ goto fail;
+ }
+
+ ctx = egl_driver->context_create(egl_driver, dpy, &configs[0],
+ (EGLContext)ws_info->context);
+
+ if (ctx == EGL_NO_CONTEXT) {
+ goto fail;
+ }
+
+ global_ctx = egl_driver->context_create(egl_driver, dpy, &configs[0], ctx);
+
+ if (global_ctx == EGL_NO_CONTEXT) {
+ goto fail;
+ }
+
+ egl_onscreen->base.thread_init = &yagl_egl_onscreen_thread_init;
+ egl_onscreen->base.batch_start = &yagl_egl_onscreen_batch_start;
+ egl_onscreen->base.create_display = &yagl_egl_onscreen_create_display;
+ egl_onscreen->base.make_current = &yagl_egl_onscreen_make_current;
+ egl_onscreen->base.release_current = &yagl_egl_onscreen_release_current;
+ egl_onscreen->base.batch_end = &yagl_egl_onscreen_batch_end;
+ egl_onscreen->base.thread_fini = &yagl_egl_onscreen_thread_fini;
+ egl_onscreen->base.ensure_current = &yagl_egl_onscreen_ensure_current;
+ egl_onscreen->base.unensure_current = &yagl_egl_onscreen_unensure_current;
+ egl_onscreen->base.destroy = &yagl_egl_onscreen_destroy;
+
+ egl_onscreen->wsi = wsi;
+ egl_onscreen->egl_driver = egl_driver;
+ egl_onscreen->gles_driver = gles_driver;
+ egl_onscreen->ensure_dpy = dpy;
+ egl_onscreen->ensure_config = configs[0];
+ egl_onscreen->ensure_ctx = ctx;
+ egl_onscreen->ensure_sfc = sfc;
+ egl_onscreen->global_ctx = global_ctx;
+
+ for (i = 1; i < num_configs; ++i) {
+ egl_driver->config_cleanup(egl_driver, dpy, &configs[i]);
+ }
+ g_free(configs);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return &egl_onscreen->base;
+
+fail:
+ if (ctx != EGL_NO_CONTEXT) {
+ egl_driver->context_destroy(egl_driver, dpy, ctx);
+ }
+
+ if (sfc != EGL_NO_SURFACE) {
+ egl_driver->pbuffer_surface_destroy(egl_driver, dpy, sfc);
+ }
+
+ if (configs) {
+ for (i = 0; i < num_configs; ++i) {
+ egl_driver->config_cleanup(egl_driver, dpy, &configs[i]);
+ }
+ g_free(configs);
+ }
+
+ if (dpy) {
+ egl_driver->display_close(egl_driver, dpy);
+ }
+
+ yagl_egl_backend_cleanup(&egl_onscreen->base);
+
+ g_free(egl_onscreen);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return NULL;
+}
diff --git a/hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen.h b/hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen.h
new file mode 100644
index 0000000000..83c68f2269
--- /dev/null
+++ b/hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen.h
@@ -0,0 +1,76 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_EGL_ONSCREEN_H
+#define _QEMU_YAGL_EGL_ONSCREEN_H
+
+#include "yagl_egl_backend.h"
+#include "yagl_egl_driver.h"
+#include "yagl_egl_native_config.h"
+
+struct winsys_interface;
+struct yagl_gles_driver;
+
+struct yagl_egl_onscreen
+{
+ struct yagl_egl_backend base;
+
+ struct winsys_interface *wsi;
+
+ struct yagl_egl_driver *egl_driver;
+
+ struct yagl_gles_driver *gles_driver;
+
+ /*
+ * Display, config, context and surface which'll be used
+ * when we need to ensure that at least some context
+ * is current.
+ */
+ EGLNativeDisplayType ensure_dpy;
+ struct yagl_egl_native_config ensure_config;
+ EGLContext ensure_ctx;
+ EGLSurface ensure_sfc;
+
+ /*
+ * Global context, all created contexts share with it. This
+ * context is never current to any thread (And never make it
+ * current because on windows it's impossible to share with
+ * a context that's current).
+ */
+ EGLContext global_ctx;
+};
+
+/*
+ * Takes ownership of 'egl_driver'.
+ */
+struct yagl_egl_backend *yagl_egl_onscreen_create(struct winsys_interface *wsi,
+ struct yagl_egl_driver *egl_driver,
+ struct yagl_gles_driver *gles_driver);
+
+#endif
diff --git a/hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen_context.c b/hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen_context.c
new file mode 100644
index 0000000000..99c1fba3a0
--- /dev/null
+++ b/hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen_context.c
@@ -0,0 +1,154 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include <GL/gl.h>
+#include "yagl_egl_onscreen_context.h"
+#include "yagl_egl_onscreen_display.h"
+#include "yagl_egl_onscreen.h"
+#include "yagl_egl_surface_attribs.h"
+#include "yagl_gles_driver.h"
+#include "yagl_log.h"
+#include "yagl_tls.h"
+#include "yagl_process.h"
+#include "yagl_thread.h"
+
+static void yagl_egl_onscreen_context_destroy(struct yagl_eglb_context *ctx)
+{
+ struct yagl_egl_onscreen_context *egl_onscreen_ctx =
+ (struct yagl_egl_onscreen_context*)ctx;
+ struct yagl_egl_onscreen_display *dpy =
+ (struct yagl_egl_onscreen_display*)ctx->dpy;
+ struct yagl_egl_onscreen *egl_onscreen =
+ (struct yagl_egl_onscreen*)ctx->dpy->backend;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_onscreen_context_destroy, NULL);
+
+ if (egl_onscreen_ctx->fb) {
+ yagl_ensure_ctx();
+ egl_onscreen->gles_driver->DeleteFramebuffers(1, &egl_onscreen_ctx->fb);
+ yagl_unensure_ctx();
+ }
+
+ if (egl_onscreen_ctx->null_sfc != EGL_NO_SURFACE) {
+ egl_onscreen->egl_driver->pbuffer_surface_destroy(
+ egl_onscreen->egl_driver,
+ dpy->native_dpy,
+ egl_onscreen_ctx->null_sfc);
+ egl_onscreen_ctx->null_sfc = EGL_NO_SURFACE;
+ }
+
+ egl_onscreen->egl_driver->context_destroy(egl_onscreen->egl_driver,
+ dpy->native_dpy,
+ egl_onscreen_ctx->native_ctx);
+
+ yagl_eglb_context_cleanup(ctx);
+
+ g_free(egl_onscreen_ctx);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+struct yagl_egl_onscreen_context
+ *yagl_egl_onscreen_context_create(struct yagl_egl_onscreen_display *dpy,
+ const struct yagl_egl_native_config *cfg,
+ struct yagl_egl_onscreen_context *share_context)
+{
+ struct yagl_egl_onscreen *egl_onscreen =
+ (struct yagl_egl_onscreen*)dpy->base.backend;
+ struct yagl_egl_onscreen_context *ctx;
+ EGLContext native_ctx;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_onscreen_context_create,
+ "dpy = %p, cfg = %d",
+ dpy,
+ cfg->config_id);
+
+ native_ctx = egl_onscreen->egl_driver->context_create(
+ egl_onscreen->egl_driver,
+ dpy->native_dpy,
+ cfg,
+ egl_onscreen->global_ctx);
+
+ if (!native_ctx) {
+ YAGL_LOG_FUNC_EXIT(NULL);
+ return NULL;
+ }
+
+ ctx = g_malloc0(sizeof(*ctx));
+
+ yagl_eglb_context_init(&ctx->base, &dpy->base);
+
+ ctx->base.destroy = &yagl_egl_onscreen_context_destroy;
+
+ ctx->native_ctx = native_ctx;
+
+ memcpy(&ctx->cfg, cfg, sizeof(*cfg));
+
+ ctx->null_sfc = EGL_NO_SURFACE;
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return ctx;
+}
+
+void yagl_egl_onscreen_context_setup(struct yagl_egl_onscreen_context *ctx)
+{
+ struct yagl_egl_onscreen *egl_onscreen =
+ (struct yagl_egl_onscreen*)ctx->base.dpy->backend;
+
+ if (ctx->fb) {
+ return;
+ }
+
+ egl_onscreen->gles_driver->GenFramebuffers(1, &ctx->fb);
+}
+
+bool yagl_egl_onscreen_context_setup_surfaceless(struct yagl_egl_onscreen_context *ctx)
+{
+ struct yagl_egl_onscreen *egl_onscreen =
+ (struct yagl_egl_onscreen*)ctx->base.dpy->backend;
+ struct yagl_egl_onscreen_display *dpy =
+ (struct yagl_egl_onscreen_display*)ctx->base.dpy;
+ struct yagl_egl_pbuffer_attribs pbuffer_attribs;
+
+ if (ctx->null_sfc != EGL_NO_SURFACE) {
+ return true;
+ }
+
+ yagl_egl_pbuffer_attribs_init(&pbuffer_attribs);
+
+ ctx->null_sfc = egl_onscreen->egl_driver->pbuffer_surface_create(egl_onscreen->egl_driver,
+ dpy->native_dpy,
+ &ctx->cfg,
+ 1,
+ 1,
+ &pbuffer_attribs);
+
+ return ctx->null_sfc != EGL_NO_SURFACE;
+}
diff --git a/hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen_context.h b/hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen_context.h
new file mode 100644
index 0000000000..0097240bee
--- /dev/null
+++ b/hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen_context.h
@@ -0,0 +1,82 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_EGL_ONSCREEN_CONTEXT_H
+#define _QEMU_YAGL_EGL_ONSCREEN_CONTEXT_H
+
+#include "yagl_eglb_context.h"
+#include "yagl_egl_native_config.h"
+#include <EGL/egl.h>
+
+struct yagl_egl_onscreen_display;
+struct yagl_egl_onscreen_surface;
+
+struct yagl_egl_onscreen_context
+{
+ struct yagl_eglb_context base;
+
+ EGLContext native_ctx;
+
+ /*
+ * Framebuffer that is used to render to window/pixmap/pbuffer texture.
+ * Allocated when this context is made current for the first time.
+ *
+ * Onscreen GLES API redirects framebuffer zero to this framebuffer.
+ */
+ GLuint fb;
+
+ /*
+ * Config with which this context was created, used
+ * for 'null_sfc' creation.
+ *
+ * TODO: It's not very nice to copy 'cfg' into this. It works
+ * only because all configs are display resources and context
+ * is also a display resource and contexts always outlive configs.
+ * But it could change someday...
+ */
+ struct yagl_egl_native_config cfg;
+
+ /*
+ * 1x1 native pbuffer surface, used to implement
+ * EGL_KHR_surfaceless_context. Allocated on first
+ * surfaceless eglMakeCurrent.
+ */
+ EGLSurface null_sfc;
+};
+
+struct yagl_egl_onscreen_context
+ *yagl_egl_onscreen_context_create(struct yagl_egl_onscreen_display *dpy,
+ const struct yagl_egl_native_config *cfg,
+ struct yagl_egl_onscreen_context *share_context);
+
+void yagl_egl_onscreen_context_setup(struct yagl_egl_onscreen_context *ctx);
+
+bool yagl_egl_onscreen_context_setup_surfaceless(struct yagl_egl_onscreen_context *ctx);
+
+#endif
diff --git a/hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen_display.c b/hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen_display.c
new file mode 100644
index 0000000000..dacbedeeb2
--- /dev/null
+++ b/hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen_display.c
@@ -0,0 +1,248 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "yagl_egl_onscreen_display.h"
+#include <GL/gl.h>
+#include "yagl_egl_onscreen_context.h"
+#include "yagl_egl_onscreen_surface.h"
+#include "yagl_egl_onscreen.h"
+#include "yagl_egl_native_config.h"
+#include "yagl_log.h"
+#include "yagl_tls.h"
+#include "yagl_process.h"
+#include "yagl_thread.h"
+#include "yagl_object_map.h"
+#include "winsys_gl.h"
+
+struct yagl_egl_onscreen_image
+{
+ struct yagl_object base;
+
+ struct winsys_gl_surface *ws_sfc;
+};
+
+static void yagl_egl_onscreen_image_destroy(struct yagl_object *obj)
+{
+ struct yagl_egl_onscreen_image *image = (struct yagl_egl_onscreen_image*)obj;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_onscreen_image_destroy, "%u", obj->global_name);
+
+ image->ws_sfc->base.release(&image->ws_sfc->base);
+
+ g_free(image);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+static struct yagl_egl_native_config
+ *yagl_egl_onscreen_display_config_enum(struct yagl_eglb_display *dpy,
+ int *num_configs)
+{
+ struct yagl_egl_onscreen_display *egl_onscreen_dpy =
+ (struct yagl_egl_onscreen_display*)dpy;
+ struct yagl_egl_onscreen *egl_onscreen =
+ (struct yagl_egl_onscreen*)dpy->backend;
+ struct yagl_egl_native_config *native_configs;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_onscreen_display_config_enum,
+ "dpy = %p", dpy);
+
+ native_configs =
+ egl_onscreen->egl_driver->config_enum(egl_onscreen->egl_driver,
+ egl_onscreen_dpy->native_dpy,
+ num_configs);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return native_configs;
+}
+
+static void yagl_egl_onscreen_display_config_cleanup(struct yagl_eglb_display *dpy,
+ const struct yagl_egl_native_config *cfg)
+{
+ struct yagl_egl_onscreen_display *egl_onscreen_dpy =
+ (struct yagl_egl_onscreen_display*)dpy;
+ struct yagl_egl_onscreen *egl_onscreen =
+ (struct yagl_egl_onscreen*)dpy->backend;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_onscreen_display_config_cleanup,
+ "dpy = %p, cfg = %d",
+ dpy,
+ cfg->config_id);
+
+ egl_onscreen->egl_driver->config_cleanup(egl_onscreen->egl_driver,
+ egl_onscreen_dpy->native_dpy,
+ cfg);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+static struct yagl_eglb_context
+ *yagl_egl_onscreen_display_create_context(struct yagl_eglb_display *dpy,
+ const struct yagl_egl_native_config *cfg,
+ struct yagl_eglb_context *share_context)
+{
+ struct yagl_egl_onscreen_display *egl_onscreen_dpy =
+ (struct yagl_egl_onscreen_display*)dpy;
+ struct yagl_egl_onscreen_context *ctx =
+ yagl_egl_onscreen_context_create(egl_onscreen_dpy,
+ cfg,
+ (struct yagl_egl_onscreen_context*)share_context);
+
+ return ctx ? &ctx->base : NULL;
+}
+
+static struct yagl_eglb_surface
+ *yagl_egl_onscreen_display_create_window_surface(struct yagl_eglb_display *dpy,
+ const struct yagl_egl_native_config *cfg,
+ const struct yagl_egl_window_attribs *attribs,
+ yagl_winsys_id id)
+{
+ struct yagl_egl_onscreen_display *egl_onscreen_dpy =
+ (struct yagl_egl_onscreen_display*)dpy;
+ struct yagl_egl_onscreen_surface *sfc =
+ yagl_egl_onscreen_surface_create_window(egl_onscreen_dpy,
+ cfg,
+ attribs,
+ id);
+
+ return sfc ? &sfc->base : NULL;
+}
+
+static struct yagl_eglb_surface
+ *yagl_egl_onscreen_display_create_pixmap_surface(struct yagl_eglb_display *dpy,
+ const struct yagl_egl_native_config *cfg,
+ const struct yagl_egl_pixmap_attribs *attribs,
+ yagl_winsys_id id)
+{
+ struct yagl_egl_onscreen_display *egl_onscreen_dpy =
+ (struct yagl_egl_onscreen_display*)dpy;
+ struct yagl_egl_onscreen_surface *sfc =
+ yagl_egl_onscreen_surface_create_pixmap(egl_onscreen_dpy,
+ cfg,
+ attribs,
+ id);
+
+ return sfc ? &sfc->base : NULL;
+}
+
+static struct yagl_eglb_surface
+ *yagl_egl_onscreen_display_create_pbuffer_surface(struct yagl_eglb_display *dpy,
+ const struct yagl_egl_native_config *cfg,
+ const struct yagl_egl_pbuffer_attribs *attribs,
+ yagl_winsys_id id)
+{
+ struct yagl_egl_onscreen_display *egl_onscreen_dpy =
+ (struct yagl_egl_onscreen_display*)dpy;
+ struct yagl_egl_onscreen_surface *sfc =
+ yagl_egl_onscreen_surface_create_pbuffer(egl_onscreen_dpy,
+ cfg,
+ attribs,
+ id);
+
+ return sfc ? &sfc->base : NULL;
+}
+
+static struct yagl_object *yagl_egl_onscreen_display_create_image(struct yagl_eglb_display *dpy,
+ yagl_winsys_id buffer)
+{
+ struct yagl_egl_onscreen *egl_onscreen =
+ (struct yagl_egl_onscreen*)dpy->backend;
+ struct winsys_gl_surface *ws_sfc = NULL;
+ struct yagl_egl_onscreen_image *image;
+
+ ws_sfc = (struct winsys_gl_surface*)egl_onscreen->wsi->acquire_surface(egl_onscreen->wsi, buffer);
+
+ if (!ws_sfc) {
+ return NULL;
+ }
+
+ image = g_malloc(sizeof(*image));
+
+ image->base.global_name = ws_sfc->get_texture(ws_sfc);
+ image->base.destroy = &yagl_egl_onscreen_image_destroy;
+ image->ws_sfc = ws_sfc;
+
+ return &image->base;
+}
+
+static void yagl_egl_onscreen_display_destroy(struct yagl_eglb_display *dpy)
+{
+ struct yagl_egl_onscreen_display *egl_onscreen_dpy =
+ (struct yagl_egl_onscreen_display*)dpy;
+ struct yagl_egl_onscreen *egl_onscreen =
+ (struct yagl_egl_onscreen*)dpy->backend;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_onscreen_display_destroy,
+ "dpy = %p", dpy);
+
+ egl_onscreen->egl_driver->display_close(egl_onscreen->egl_driver,
+ egl_onscreen_dpy->native_dpy);
+
+ yagl_eglb_display_cleanup(dpy);
+
+ g_free(egl_onscreen_dpy);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+struct yagl_egl_onscreen_display
+ *yagl_egl_onscreen_display_create(struct yagl_egl_onscreen *egl_onscreen)
+{
+ struct yagl_egl_onscreen_display *dpy;
+ EGLNativeDisplayType native_dpy;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_onscreen_display_create, NULL);
+
+ native_dpy = egl_onscreen->egl_driver->display_open(egl_onscreen->egl_driver);
+
+ if (!native_dpy) {
+ YAGL_LOG_FUNC_EXIT(NULL);
+ return NULL;
+ }
+
+ dpy = g_malloc0(sizeof(*dpy));
+
+ yagl_eglb_display_init(&dpy->base, &egl_onscreen->base);
+
+ dpy->base.config_enum = &yagl_egl_onscreen_display_config_enum;
+ dpy->base.config_cleanup = &yagl_egl_onscreen_display_config_cleanup;
+ dpy->base.create_context = &yagl_egl_onscreen_display_create_context;
+ dpy->base.create_onscreen_window_surface = &yagl_egl_onscreen_display_create_window_surface;
+ dpy->base.create_onscreen_pixmap_surface = &yagl_egl_onscreen_display_create_pixmap_surface;
+ dpy->base.create_onscreen_pbuffer_surface = &yagl_egl_onscreen_display_create_pbuffer_surface;
+ dpy->base.create_image = &yagl_egl_onscreen_display_create_image;
+ dpy->base.destroy = &yagl_egl_onscreen_display_destroy;
+
+ dpy->native_dpy = native_dpy;
+
+ YAGL_LOG_FUNC_EXIT("%p", dpy);
+
+ return dpy;
+}
diff --git a/hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen_display.h b/hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen_display.h
new file mode 100644
index 0000000000..23e3853d65
--- /dev/null
+++ b/hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen_display.h
@@ -0,0 +1,47 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_EGL_ONSCREEN_DISPLAY_H
+#define _QEMU_YAGL_EGL_ONSCREEN_DISPLAY_H
+
+#include "yagl_eglb_display.h"
+
+struct yagl_egl_onscreen;
+
+struct yagl_egl_onscreen_display
+{
+ struct yagl_eglb_display base;
+
+ EGLNativeDisplayType native_dpy;
+};
+
+struct yagl_egl_onscreen_display
+ *yagl_egl_onscreen_display_create(struct yagl_egl_onscreen *egl_onscreen);
+
+#endif
diff --git a/hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen_surface.c b/hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen_surface.c
new file mode 100644
index 0000000000..428f7857c5
--- /dev/null
+++ b/hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen_surface.c
@@ -0,0 +1,426 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include <GL/gl.h>
+#include "yagl_egl_onscreen_surface.h"
+#include "yagl_egl_onscreen_context.h"
+#include "yagl_egl_onscreen_display.h"
+#include "yagl_egl_onscreen_ts.h"
+#include "yagl_egl_onscreen.h"
+#include "yagl_log.h"
+#include "yagl_process.h"
+#include "yagl_thread.h"
+#include "yagl_gles_driver.h"
+#include "winsys_gl.h"
+
+YAGL_DECLARE_TLS(struct yagl_egl_onscreen_ts*, egl_onscreen_ts);
+
+static void yagl_egl_onscreen_surface_invalidate(struct yagl_eglb_surface *sfc,
+ yagl_winsys_id id)
+{
+ struct yagl_egl_onscreen_surface *osfc =
+ (struct yagl_egl_onscreen_surface*)sfc;
+ struct yagl_egl_onscreen *egl_onscreen =
+ (struct yagl_egl_onscreen*)sfc->dpy->backend;
+ struct winsys_gl_surface *ws_sfc = NULL;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_onscreen_surface_invalidate, NULL);
+
+ ws_sfc = (struct winsys_gl_surface*)egl_onscreen->wsi->acquire_surface(egl_onscreen->wsi, id);
+
+ if (!ws_sfc) {
+ YAGL_LOG_WARN("winsys surface %u not found", id);
+ YAGL_LOG_FUNC_EXIT(NULL);
+ return;
+ }
+
+ if (ws_sfc == osfc->ws_sfc) {
+ ws_sfc->base.release(&ws_sfc->base);
+ YAGL_LOG_FUNC_EXIT(NULL);
+ return;
+ }
+
+ if (((osfc->ws_sfc->base.width != ws_sfc->base.width) ||
+ (osfc->ws_sfc->base.height != ws_sfc->base.height)) &&
+ osfc->rb) {
+ yagl_ensure_ctx();
+ egl_onscreen->gles_driver->DeleteRenderbuffers(1, &osfc->rb);
+ yagl_unensure_ctx();
+ osfc->rb = 0;
+ }
+
+ osfc->ws_sfc->base.release(&osfc->ws_sfc->base);
+ osfc->ws_sfc = ws_sfc;
+
+ if (egl_onscreen_ts->sfc_draw == osfc) {
+ yagl_egl_onscreen_surface_setup(osfc);
+ yagl_egl_onscreen_surface_attach_to_framebuffer(osfc);
+ }
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+static bool yagl_egl_onscreen_surface_query(struct yagl_eglb_surface *sfc,
+ EGLint attribute,
+ EGLint *value)
+{
+ struct yagl_egl_onscreen_surface *osfc =
+ (struct yagl_egl_onscreen_surface*)sfc;
+
+ switch (attribute) {
+ case EGL_HEIGHT:
+ *value = yagl_egl_onscreen_surface_height(osfc);
+ break;
+ case EGL_WIDTH:
+ *value = yagl_egl_onscreen_surface_width(osfc);
+ break;
+ default:
+ return false;
+ }
+
+ return true;
+}
+
+static bool yagl_egl_onscreen_surface_swap_buffers(struct yagl_eglb_surface *sfc)
+{
+ struct yagl_egl_onscreen_surface *osfc =
+ (struct yagl_egl_onscreen_surface*)sfc;
+
+ osfc->ws_sfc->base.set_dirty(&osfc->ws_sfc->base);
+
+ return true;
+}
+
+static bool yagl_egl_onscreen_surface_copy_buffers(struct yagl_eglb_surface *sfc)
+{
+ struct yagl_egl_onscreen_surface *osfc =
+ (struct yagl_egl_onscreen_surface*)sfc;
+
+ osfc->ws_sfc->base.set_dirty(&osfc->ws_sfc->base);
+
+ return true;
+}
+
+static void yagl_egl_onscreen_surface_wait_gl(struct yagl_eglb_surface *sfc)
+{
+ struct yagl_egl_onscreen_surface *osfc =
+ (struct yagl_egl_onscreen_surface*)sfc;
+
+ /*
+ * M.b. glFinish here ?
+ */
+
+ osfc->ws_sfc->base.set_dirty(&osfc->ws_sfc->base);
+}
+
+static void yagl_egl_onscreen_surface_destroy(struct yagl_eglb_surface *sfc)
+{
+ struct yagl_egl_onscreen_surface *osfc =
+ (struct yagl_egl_onscreen_surface*)sfc;
+ struct yagl_egl_onscreen *egl_onscreen =
+ (struct yagl_egl_onscreen*)sfc->dpy->backend;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_onscreen_surface_destroy, NULL);
+
+ egl_onscreen->egl_driver->pbuffer_surface_destroy(
+ egl_onscreen->egl_driver,
+ ((struct yagl_egl_onscreen_display*)sfc->dpy)->native_dpy,
+ osfc->dummy_native_sfc);
+ osfc->dummy_native_sfc = EGL_NO_SURFACE;
+
+ if (osfc->ws_sfc) {
+ osfc->ws_sfc->base.release(&osfc->ws_sfc->base);
+ osfc->ws_sfc = NULL;
+ }
+
+ if (osfc->rb) {
+ yagl_ensure_ctx();
+ egl_onscreen->gles_driver->DeleteRenderbuffers(1, &osfc->rb);
+ yagl_unensure_ctx();
+ }
+
+ yagl_eglb_surface_cleanup(sfc);
+
+ g_free(osfc);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+struct yagl_egl_onscreen_surface
+ *yagl_egl_onscreen_surface_create_window(struct yagl_egl_onscreen_display *dpy,
+ const struct yagl_egl_native_config *cfg,
+ const struct yagl_egl_window_attribs *attribs,
+ yagl_winsys_id id)
+{
+ struct yagl_egl_onscreen *egl_onscreen =
+ (struct yagl_egl_onscreen*)dpy->base.backend;
+ struct winsys_gl_surface *ws_sfc = NULL;
+ struct yagl_egl_onscreen_surface *sfc = NULL;
+ EGLSurface dummy_native_sfc = EGL_NO_SURFACE;
+ struct yagl_egl_pbuffer_attribs pbuffer_attribs;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_onscreen_surface_create_window,
+ "dpy = %p, cfg = %d, id = %u",
+ dpy,
+ cfg->config_id,
+ id);
+
+ ws_sfc = (struct winsys_gl_surface*)egl_onscreen->wsi->acquire_surface(egl_onscreen->wsi, id);
+
+ if (!ws_sfc) {
+ goto fail;
+ }
+
+ yagl_egl_pbuffer_attribs_init(&pbuffer_attribs);
+
+ dummy_native_sfc = egl_onscreen->egl_driver->pbuffer_surface_create(egl_onscreen->egl_driver,
+ dpy->native_dpy,
+ cfg,
+ 1,
+ 1,
+ &pbuffer_attribs);
+
+ if (!dummy_native_sfc) {
+ goto fail;
+ }
+
+ sfc = g_malloc0(sizeof(*sfc));
+
+ yagl_eglb_surface_init(&sfc->base, &dpy->base, EGL_WINDOW_BIT, attribs);
+
+ sfc->dummy_native_sfc = dummy_native_sfc;
+ sfc->ws_sfc = ws_sfc;
+
+ sfc->base.invalidate = &yagl_egl_onscreen_surface_invalidate;
+ sfc->base.query = &yagl_egl_onscreen_surface_query;
+ sfc->base.swap_buffers = &yagl_egl_onscreen_surface_swap_buffers;
+ sfc->base.copy_buffers = &yagl_egl_onscreen_surface_copy_buffers;
+ sfc->base.wait_gl = &yagl_egl_onscreen_surface_wait_gl;
+ sfc->base.destroy = &yagl_egl_onscreen_surface_destroy;
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return sfc;
+
+fail:
+ if (ws_sfc) {
+ ws_sfc->base.release(&ws_sfc->base);
+ }
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return NULL;
+}
+
+struct yagl_egl_onscreen_surface
+ *yagl_egl_onscreen_surface_create_pixmap(struct yagl_egl_onscreen_display *dpy,
+ const struct yagl_egl_native_config *cfg,
+ const struct yagl_egl_pixmap_attribs *attribs,
+ yagl_winsys_id id)
+{
+ struct yagl_egl_onscreen *egl_onscreen =
+ (struct yagl_egl_onscreen*)dpy->base.backend;
+ struct winsys_gl_surface *ws_sfc = NULL;
+ struct yagl_egl_onscreen_surface *sfc = NULL;
+ EGLSurface dummy_native_sfc = EGL_NO_SURFACE;
+ struct yagl_egl_pbuffer_attribs pbuffer_attribs;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_onscreen_surface_create_pixmap,
+ "dpy = %p, cfg = %d, id = %u",
+ dpy,
+ cfg->config_id,
+ id);
+
+ ws_sfc = (struct winsys_gl_surface*)egl_onscreen->wsi->acquire_surface(egl_onscreen->wsi, id);
+
+ if (!ws_sfc) {
+ goto fail;
+ }
+
+ yagl_egl_pbuffer_attribs_init(&pbuffer_attribs);
+
+ dummy_native_sfc = egl_onscreen->egl_driver->pbuffer_surface_create(egl_onscreen->egl_driver,
+ dpy->native_dpy,
+ cfg,
+ 1,
+ 1,
+ &pbuffer_attribs);
+
+ if (!dummy_native_sfc) {
+ goto fail;
+ }
+
+ sfc = g_malloc0(sizeof(*sfc));
+
+ yagl_eglb_surface_init(&sfc->base, &dpy->base, EGL_PIXMAP_BIT, attribs);
+
+ sfc->dummy_native_sfc = dummy_native_sfc;
+ sfc->ws_sfc = ws_sfc;
+
+ sfc->base.invalidate = &yagl_egl_onscreen_surface_invalidate;
+ sfc->base.query = &yagl_egl_onscreen_surface_query;
+ sfc->base.swap_buffers = &yagl_egl_onscreen_surface_swap_buffers;
+ sfc->base.copy_buffers = &yagl_egl_onscreen_surface_copy_buffers;
+ sfc->base.wait_gl = &yagl_egl_onscreen_surface_wait_gl;
+ sfc->base.destroy = &yagl_egl_onscreen_surface_destroy;
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return sfc;
+
+fail:
+ if (ws_sfc) {
+ ws_sfc->base.release(&ws_sfc->base);
+ }
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return NULL;
+}
+
+struct yagl_egl_onscreen_surface
+ *yagl_egl_onscreen_surface_create_pbuffer(struct yagl_egl_onscreen_display *dpy,
+ const struct yagl_egl_native_config *cfg,
+ const struct yagl_egl_pbuffer_attribs *attribs,
+ yagl_winsys_id id)
+{
+ struct yagl_egl_onscreen *egl_onscreen =
+ (struct yagl_egl_onscreen*)dpy->base.backend;
+ struct winsys_gl_surface *ws_sfc = NULL;
+ struct yagl_egl_onscreen_surface *sfc = NULL;
+ EGLSurface dummy_native_sfc = EGL_NO_SURFACE;
+ struct yagl_egl_pbuffer_attribs pbuffer_attribs;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_onscreen_surface_create_pbuffer,
+ "dpy = %p, cfg = %d, id = %u",
+ dpy,
+ cfg->config_id,
+ id);
+
+ ws_sfc = (struct winsys_gl_surface*)egl_onscreen->wsi->acquire_surface(egl_onscreen->wsi, id);
+
+ if (!ws_sfc) {
+ goto fail;
+ }
+
+ yagl_egl_pbuffer_attribs_init(&pbuffer_attribs);
+
+ dummy_native_sfc = egl_onscreen->egl_driver->pbuffer_surface_create(egl_onscreen->egl_driver,
+ dpy->native_dpy,
+ cfg,
+ 1,
+ 1,
+ &pbuffer_attribs);
+
+ if (!dummy_native_sfc) {
+ goto fail;
+ }
+
+ sfc = g_malloc0(sizeof(*sfc));
+
+ yagl_eglb_surface_init(&sfc->base, &dpy->base, EGL_PBUFFER_BIT, attribs);
+
+ sfc->dummy_native_sfc = dummy_native_sfc;
+ sfc->ws_sfc = ws_sfc;
+
+ sfc->base.invalidate = &yagl_egl_onscreen_surface_invalidate;
+ sfc->base.query = &yagl_egl_onscreen_surface_query;
+ sfc->base.swap_buffers = &yagl_egl_onscreen_surface_swap_buffers;
+ sfc->base.copy_buffers = &yagl_egl_onscreen_surface_copy_buffers;
+ sfc->base.wait_gl = &yagl_egl_onscreen_surface_wait_gl;
+ sfc->base.destroy = &yagl_egl_onscreen_surface_destroy;
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return sfc;
+
+fail:
+ if (ws_sfc) {
+ ws_sfc->base.release(&ws_sfc->base);
+ }
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return NULL;
+}
+
+void yagl_egl_onscreen_surface_setup(struct yagl_egl_onscreen_surface *sfc)
+{
+ struct yagl_egl_onscreen *egl_onscreen =
+ (struct yagl_egl_onscreen*)sfc->base.dpy->backend;
+ GLuint cur_rb = 0;
+
+ if (sfc->rb) {
+ return;
+ }
+
+ egl_onscreen->gles_driver->GenRenderbuffers(1, &sfc->rb);
+
+ egl_onscreen->gles_driver->GetIntegerv(GL_RENDERBUFFER_BINDING,
+ (GLint*)&cur_rb);
+
+ egl_onscreen->gles_driver->BindRenderbuffer(GL_RENDERBUFFER, sfc->rb);
+
+ egl_onscreen->gles_driver->RenderbufferStorage(GL_RENDERBUFFER,
+ GL_DEPTH24_STENCIL8,
+ sfc->ws_sfc->base.width,
+ sfc->ws_sfc->base.height);
+
+ egl_onscreen->gles_driver->BindRenderbuffer(GL_RENDERBUFFER, cur_rb);
+}
+
+void yagl_egl_onscreen_surface_attach_to_framebuffer(struct yagl_egl_onscreen_surface *sfc)
+{
+ struct yagl_egl_onscreen *egl_onscreen =
+ (struct yagl_egl_onscreen*)sfc->base.dpy->backend;
+
+ egl_onscreen->gles_driver->FramebufferTexture2D(GL_FRAMEBUFFER,
+ GL_COLOR_ATTACHMENT0,
+ GL_TEXTURE_2D,
+ sfc->ws_sfc->get_texture(sfc->ws_sfc),
+ 0);
+ egl_onscreen->gles_driver->FramebufferRenderbuffer(GL_FRAMEBUFFER,
+ GL_DEPTH_ATTACHMENT,
+ GL_RENDERBUFFER,
+ sfc->rb);
+ egl_onscreen->gles_driver->FramebufferRenderbuffer(GL_FRAMEBUFFER,
+ GL_STENCIL_ATTACHMENT,
+ GL_RENDERBUFFER,
+ sfc->rb);
+}
+
+uint32_t yagl_egl_onscreen_surface_width(struct yagl_egl_onscreen_surface *sfc)
+{
+ return sfc->ws_sfc->base.width;
+}
+
+uint32_t yagl_egl_onscreen_surface_height(struct yagl_egl_onscreen_surface *sfc)
+{
+ return sfc->ws_sfc->base.height;
+}
diff --git a/hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen_surface.h b/hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen_surface.h
new file mode 100644
index 0000000000..92875a513c
--- /dev/null
+++ b/hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen_surface.h
@@ -0,0 +1,89 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_EGL_ONSCREEN_SURFACE_H
+#define _QEMU_YAGL_EGL_ONSCREEN_SURFACE_H
+
+#include "yagl_eglb_surface.h"
+#include "yagl_egl_surface_attribs.h"
+
+struct yagl_egl_onscreen_display;
+struct yagl_egl_native_config;
+
+struct winsys_gl_surface;
+
+struct yagl_egl_onscreen_surface
+{
+ struct yagl_eglb_surface base;
+
+ /*
+ * 1x1 native pbuffer surface, used just to be able to make
+ * this surface current.
+ */
+ EGLSurface dummy_native_sfc;
+
+ /*
+ * winsys surface.
+ */
+ struct winsys_gl_surface *ws_sfc;
+
+ /*
+ * Depth and stencil renderbuffer for 'ws_sfc'. Allocated
+ * when this surface is made current for the first time.
+ */
+ GLuint rb;
+};
+
+struct yagl_egl_onscreen_surface
+ *yagl_egl_onscreen_surface_create_window(struct yagl_egl_onscreen_display *dpy,
+ const struct yagl_egl_native_config *cfg,
+ const struct yagl_egl_window_attribs *attribs,
+ yagl_winsys_id id);
+
+struct yagl_egl_onscreen_surface
+ *yagl_egl_onscreen_surface_create_pixmap(struct yagl_egl_onscreen_display *dpy,
+ const struct yagl_egl_native_config *cfg,
+ const struct yagl_egl_pixmap_attribs *attribs,
+ yagl_winsys_id id);
+
+struct yagl_egl_onscreen_surface
+ *yagl_egl_onscreen_surface_create_pbuffer(struct yagl_egl_onscreen_display *dpy,
+ const struct yagl_egl_native_config *cfg,
+ const struct yagl_egl_pbuffer_attribs *attribs,
+ yagl_winsys_id id);
+
+void yagl_egl_onscreen_surface_setup(struct yagl_egl_onscreen_surface *sfc);
+
+void yagl_egl_onscreen_surface_attach_to_framebuffer(struct yagl_egl_onscreen_surface *sfc);
+
+uint32_t yagl_egl_onscreen_surface_width(struct yagl_egl_onscreen_surface *sfc);
+
+uint32_t yagl_egl_onscreen_surface_height(struct yagl_egl_onscreen_surface *sfc);
+
+#endif
diff --git a/hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen_ts.c b/hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen_ts.c
new file mode 100644
index 0000000000..41fd02f584
--- /dev/null
+++ b/hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen_ts.c
@@ -0,0 +1,50 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "yagl_egl_onscreen_ts.h"
+#include <GL/gl.h>
+#include "yagl_egl_onscreen.h"
+#include "yagl_egl_onscreen_context.h"
+#include "yagl_egl_onscreen_surface.h"
+#include "yagl_gles_driver.h"
+
+struct yagl_egl_onscreen_ts *yagl_egl_onscreen_ts_create(struct yagl_gles_driver *gles_driver)
+{
+ struct yagl_egl_onscreen_ts *egl_onscreen_ts =
+ g_malloc0(sizeof(struct yagl_egl_onscreen_ts));
+
+ egl_onscreen_ts->gles_driver = gles_driver;
+
+ return egl_onscreen_ts;
+}
+
+void yagl_egl_onscreen_ts_destroy(struct yagl_egl_onscreen_ts *egl_onscreen_ts)
+{
+ g_free(egl_onscreen_ts);
+}
diff --git a/hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen_ts.h b/hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen_ts.h
new file mode 100644
index 0000000000..9b1ce8bd50
--- /dev/null
+++ b/hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen_ts.h
@@ -0,0 +1,54 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_EGL_ONSCREEN_TS_H
+#define _QEMU_YAGL_EGL_ONSCREEN_TS_H
+
+#include "yagl_types.h"
+
+struct yagl_gles_driver;
+struct yagl_egl_onscreen_display;
+struct yagl_egl_onscreen_context;
+struct yagl_egl_onscreen_surface;
+
+struct yagl_egl_onscreen_ts
+{
+ struct yagl_gles_driver *gles_driver;
+
+ struct yagl_egl_onscreen_display *dpy;
+ struct yagl_egl_onscreen_context *ctx;
+ struct yagl_egl_onscreen_surface *sfc_draw;
+ struct yagl_egl_onscreen_surface *sfc_read;
+};
+
+struct yagl_egl_onscreen_ts *yagl_egl_onscreen_ts_create(struct yagl_gles_driver *gles_driver);
+
+void yagl_egl_onscreen_ts_destroy(struct yagl_egl_onscreen_ts *egl_onscreen_ts);
+
+#endif
diff --git a/hw/yagl/yagl_compiled_transfer.c b/hw/yagl/yagl_compiled_transfer.c
new file mode 100644
index 0000000000..32d08b20a7
--- /dev/null
+++ b/hw/yagl/yagl_compiled_transfer.c
@@ -0,0 +1,199 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "yagl_compiled_transfer.h"
+#include "yagl_vector.h"
+#include "yagl_thread.h"
+#include "yagl_process.h"
+#include "yagl_log.h"
+#include "exec/cpu-all.h"
+
+#define YAGL_TARGET_PAGE_VA(addr) ((addr) & ~(TARGET_PAGE_SIZE - 1))
+
+#define YAGL_TARGET_PAGE_OFFSET(addr) ((addr) & (TARGET_PAGE_SIZE - 1))
+
+static hwaddr yagl_pa(target_ulong va)
+{
+ hwaddr ret =
+ cpu_get_phys_page_debug(current_cpu, va);
+
+ if (ret == -1) {
+ return 0;
+ } else {
+ return ret;
+ }
+}
+
+struct yagl_compiled_transfer
+ *yagl_compiled_transfer_create(target_ulong va,
+ uint32_t len,
+ bool is_write)
+{
+ struct yagl_compiled_transfer *ct;
+ struct yagl_vector v;
+ target_ulong last_page_va = YAGL_TARGET_PAGE_VA(va + len - 1);
+ target_ulong cur_va = va;
+ int i, num_sections;
+
+ YAGL_LOG_FUNC_ENTER(yagl_compiled_transfer_init,
+ "va = 0x%X, len = 0x%X, is_write = %u",
+ (uint32_t)va,
+ len,
+ (uint32_t)is_write);
+
+ yagl_vector_init(&v, sizeof(struct yagl_compiled_transfer_section), 0);
+
+ while (len) {
+ target_ulong start_page_va = YAGL_TARGET_PAGE_VA(cur_va);
+ hwaddr start_page_pa = yagl_pa(start_page_va);
+ target_ulong end_page_va;
+ struct yagl_compiled_transfer_section section;
+
+ if (!start_page_pa) {
+ YAGL_LOG_ERROR("yagl_pa of va 0x%X failed", (uint32_t)start_page_va);
+ goto fail;
+ }
+
+ end_page_va = start_page_va;
+
+ while (end_page_va < last_page_va) {
+ target_ulong next_page_va = end_page_va + TARGET_PAGE_SIZE;
+ hwaddr next_page_pa = yagl_pa(next_page_va);
+
+ if (!next_page_pa) {
+ YAGL_LOG_ERROR("yagl_pa of va 0x%X failed", (uint32_t)next_page_va);
+ goto fail;
+ }
+
+ /*
+ * If the target pages are not linearly spaced, stop.
+ */
+
+ if ((next_page_pa < start_page_pa) ||
+ ((next_page_pa - start_page_pa) >
+ (next_page_va - start_page_va))) {
+ break;
+ }
+
+ end_page_va = next_page_va;
+ }
+
+ section.map_len = end_page_va + TARGET_PAGE_SIZE - start_page_va;
+ section.map_base = cpu_physical_memory_map(start_page_pa, &section.map_len, 0);
+
+ if (!section.map_base || !section.map_len) {
+ YAGL_LOG_ERROR("cpu_physical_memory_map(0x%X, %u) failed",
+ (uint32_t)start_page_pa,
+ (uint32_t)section.map_len);
+ goto fail;
+ }
+
+ section.len = end_page_va + TARGET_PAGE_SIZE - cur_va;
+
+ if (section.len > len) {
+ section.len = len;
+ }
+
+ section.base = (char*)section.map_base + YAGL_TARGET_PAGE_OFFSET(cur_va);
+
+ yagl_vector_push_back(&v, &section);
+
+ len -= section.len;
+ cur_va += section.len;
+ }
+
+ ct = g_malloc0(sizeof(*ct));
+
+ ct->num_sections = yagl_vector_size(&v);
+ ct->sections = yagl_vector_detach(&v);
+ ct->is_write = is_write;
+
+ YAGL_LOG_FUNC_EXIT("num_sections = %d", ct->num_sections);
+
+ return ct;
+
+fail:
+ num_sections = yagl_vector_size(&v);
+
+ for (i = 0; i < num_sections; ++i) {
+ struct yagl_compiled_transfer_section *section =
+ (struct yagl_compiled_transfer_section*)
+ ((char*)yagl_vector_data(&v) +
+ (i * sizeof(struct yagl_compiled_transfer_section)));
+
+ cpu_physical_memory_unmap(section->map_base,
+ section->map_len,
+ 0,
+ section->map_len);
+ }
+
+ yagl_vector_cleanup(&v);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return NULL;
+}
+
+void yagl_compiled_transfer_destroy(struct yagl_compiled_transfer *ct)
+{
+ int i;
+
+ for (i = 0; i < ct->num_sections; ++i) {
+ cpu_physical_memory_unmap(ct->sections[i].map_base,
+ ct->sections[i].map_len,
+ 0,
+ ct->sections[i].map_len);
+ }
+
+ g_free(ct->sections);
+
+ ct->sections = NULL;
+ ct->num_sections = 0;
+ ct->is_write = false;
+
+ g_free(ct);
+}
+
+void yagl_compiled_transfer_exec(struct yagl_compiled_transfer *ct, void* data)
+{
+ int i;
+
+ for (i = 0; i < ct->num_sections; ++i) {
+ void *base = ct->sections[i].base;
+ uint32_t len = ct->sections[i].len;
+
+ if (ct->is_write) {
+ memcpy(base, data, len);
+ } else {
+ memcpy(data, base, len);
+ }
+
+ data = (char*)data + len;
+ }
+}
diff --git a/hw/yagl/yagl_compiled_transfer.h b/hw/yagl/yagl_compiled_transfer.h
new file mode 100644
index 0000000000..adfe537a1b
--- /dev/null
+++ b/hw/yagl/yagl_compiled_transfer.h
@@ -0,0 +1,66 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_COMPILED_TRANSFER_H
+#define _QEMU_YAGL_COMPILED_TRANSFER_H
+
+#include "yagl_types.h"
+
+struct yagl_compiled_transfer_section
+{
+ /*
+ * For 'cpy_physical_memory_unmap'.
+ */
+ void *map_base;
+ hwaddr map_len;
+
+ /*
+ * For actual I/O.
+ */
+ void *base;
+ uint32_t len;
+};
+
+struct yagl_compiled_transfer
+{
+ struct yagl_compiled_transfer_section *sections;
+ int num_sections;
+ bool is_write;
+};
+
+struct yagl_compiled_transfer
+ *yagl_compiled_transfer_create(target_ulong va,
+ uint32_t len,
+ bool is_write);
+
+void yagl_compiled_transfer_destroy(struct yagl_compiled_transfer *ct);
+
+void yagl_compiled_transfer_exec(struct yagl_compiled_transfer *ct, void* data);
+
+#endif
diff --git a/hw/yagl/yagl_device.c b/hw/yagl/yagl_device.c
new file mode 100644
index 0000000000..f7a5dab723
--- /dev/null
+++ b/hw/yagl/yagl_device.c
@@ -0,0 +1,382 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "yagl_server.h"
+#include "yagl_log.h"
+#include "yagl_handle_gen.h"
+#include "yagl_stats.h"
+#include "yagl_process.h"
+#include "yagl_thread.h"
+#include "yagl_egl_driver.h"
+#include "yagl_drivers/gles_ogl/yagl_gles_ogl.h"
+#include "yagl_drivers/gles_onscreen/yagl_gles_onscreen.h"
+#include "yagl_backends/egl_offscreen/yagl_egl_offscreen.h"
+#include "yagl_backends/egl_onscreen/yagl_egl_onscreen.h"
+#include "exec/cpu-all.h"
+#include "hw/hw.h"
+#include "hw/pci/pci.h"
+#include <GL/gl.h>
+#include "winsys.h"
+#include "yagl_gles_driver.h"
+
+#define PCI_VENDOR_ID_YAGL 0x19B1
+#define PCI_DEVICE_ID_YAGL 0x1010
+
+#define YAGL_REG_BUFFPTR 0
+#define YAGL_REG_TRIGGER 4
+#define YAGL_REGS_SIZE 8
+
+#define YAGL_MEM_SIZE 0x1000
+
+#define YAGL_MAX_USERS (YAGL_MEM_SIZE / YAGL_REGS_SIZE)
+
+struct yagl_user
+{
+ bool activated;
+ yagl_pid process_id;
+ yagl_tid thread_id;
+};
+
+typedef struct YaGLState
+{
+ PCIDevice dev;
+ void *display;
+ struct winsys_interface *wsi;
+ MemoryRegion iomem;
+ struct yagl_server_state *ss;
+ struct yagl_user users[YAGL_MAX_USERS];
+} YaGLState;
+
+#define TYPE_YAGL_DEVICE "yagl"
+
+static void yagl_device_operate(YaGLState *s, int user_index, hwaddr buff_pa)
+{
+ yagl_pid target_pid;
+ yagl_tid target_tid;
+ hwaddr buff_len = TARGET_PAGE_SIZE;
+ uint8_t *buff = NULL;
+
+ YAGL_LOG_FUNC_ENTER(yagl_device_operate,
+ "user_index = %d, buff_pa = 0x%X",
+ user_index,
+ (uint32_t)buff_pa);
+
+ if (!buff_pa && !s->users[user_index].activated) {
+ YAGL_LOG_CRITICAL("user %d is not activated", user_index);
+ goto out;
+ }
+
+ if (buff_pa) {
+ buff = cpu_physical_memory_map(buff_pa, &buff_len, false);
+
+ if (!buff || (buff_len != TARGET_PAGE_SIZE)) {
+ YAGL_LOG_CRITICAL("cpu_physical_memory_map(read) failed for user %d, buff_pa = 0x%X",
+ user_index,
+ (uint32_t)buff_pa);
+ goto out;
+ }
+
+ if (s->users[user_index].activated) {
+ /*
+ * Update user.
+ */
+
+ yagl_server_dispatch_update(s->ss,
+ s->users[user_index].process_id,
+ s->users[user_index].thread_id,
+ buff);
+ } else {
+ /*
+ * Activate user.
+ */
+
+ if (yagl_server_dispatch_init(s->ss,
+ buff,
+ &target_pid,
+ &target_tid)) {
+ s->users[user_index].activated = true;
+ s->users[user_index].process_id = target_pid;
+ s->users[user_index].thread_id = target_tid;
+
+ YAGL_LOG_INFO("user %d activated", user_index);
+
+ /*
+ * The buff is now owned by client.
+ */
+ buff = NULL;
+ }
+ }
+ } else {
+ /*
+ * Deactivate user.
+ */
+
+ yagl_server_dispatch_exit(s->ss,
+ s->users[user_index].process_id,
+ s->users[user_index].thread_id);
+
+ memset(&s->users[user_index], 0, sizeof(s->users[user_index]));
+
+ YAGL_LOG_INFO("user %d deactivated", user_index);
+ }
+
+out:
+ if (buff) {
+ cpu_physical_memory_unmap(buff,
+ TARGET_PAGE_SIZE,
+ 0,
+ TARGET_PAGE_SIZE);
+ }
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+static void yagl_device_trigger(YaGLState *s, int user_index, uint32_t offset)
+{
+ YAGL_LOG_FUNC_ENTER(yagl_device_trigger, "%d, %u", user_index, offset);
+
+ if (s->users[user_index].activated) {
+ yagl_server_dispatch_batch(s->ss,
+ s->users[user_index].process_id,
+ s->users[user_index].thread_id,
+ offset);
+ } else {
+ YAGL_LOG_CRITICAL("user %d not activated", user_index);
+ }
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+static uint64_t yagl_device_read(void *opaque, hwaddr offset,
+ unsigned size)
+{
+ return 0;
+}
+
+static void yagl_device_write(void *opaque, hwaddr offset,
+ uint64_t value, unsigned size)
+{
+ YaGLState *s = (YaGLState*)opaque;
+ int user_index = (offset / YAGL_REGS_SIZE);
+ offset -= user_index * YAGL_REGS_SIZE;
+
+ assert(user_index < YAGL_MAX_USERS);
+
+ if (user_index >= YAGL_MAX_USERS) {
+ YAGL_LOG_CRITICAL("bad user index = %d", user_index);
+ return;
+ }
+
+ switch (offset) {
+ case YAGL_REG_BUFFPTR:
+ yagl_device_operate(s, user_index, value);
+ break;
+ case YAGL_REG_TRIGGER:
+ yagl_device_trigger(s, user_index, value);
+ break;
+ default:
+ YAGL_LOG_CRITICAL("user %d, bad offset = %d", user_index, offset);
+ break;
+ }
+}
+
+static const MemoryRegionOps yagl_device_ops =
+{
+ .read = yagl_device_read,
+ .write = yagl_device_write,
+ .endianness = DEVICE_NATIVE_ENDIAN,
+};
+
+static int yagl_device_init(PCIDevice *dev)
+{
+ YaGLState *s = DO_UPCAST(YaGLState, dev, dev);
+ struct yagl_egl_driver *egl_driver = NULL;
+ struct yagl_egl_backend *egl_backend = NULL;
+ struct yagl_gles_driver *gles_driver = NULL;
+
+ yagl_log_init();
+
+ YAGL_LOG_FUNC_ENTER(yagl_device_init, NULL);
+
+ memory_region_init_io(&s->iomem, OBJECT(s),
+ &yagl_device_ops,
+ s,
+ TYPE_YAGL_DEVICE,
+ YAGL_MEM_SIZE);
+
+ yagl_handle_gen_init();
+
+ egl_driver = yagl_egl_driver_create(s->display);
+
+ if (!egl_driver) {
+ goto fail;
+ }
+
+ gles_driver = yagl_gles_ogl_create(egl_driver->dyn_lib);
+
+ if (!gles_driver) {
+ goto fail;
+ }
+
+ if (s->wsi) {
+ egl_backend = yagl_egl_onscreen_create(s->wsi,
+ egl_driver,
+ gles_driver);
+ gles_driver = yagl_gles_onscreen_create(gles_driver);
+ } else {
+ egl_backend = yagl_egl_offscreen_create(egl_driver, gles_driver);
+ }
+
+ if (!egl_backend) {
+ goto fail;
+ }
+
+ /*
+ * Now owned by EGL backend.
+ */
+ egl_driver = NULL;
+
+ s->ss = yagl_server_state_create(egl_backend, gles_driver);
+
+ /*
+ * Owned/destroyed by server state.
+ */
+ egl_backend = NULL;
+ gles_driver = NULL;
+
+ if (!s->ss) {
+ goto fail;
+ }
+
+ pci_register_bar(&s->dev, 0, PCI_BASE_ADDRESS_SPACE_MEMORY, &s->iomem);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return 0;
+
+fail:
+ if (egl_backend) {
+ egl_backend->destroy(egl_backend);
+ }
+
+ if (gles_driver) {
+ gles_driver->destroy(gles_driver);
+ }
+
+ if (egl_driver) {
+ egl_driver->destroy(egl_driver);
+ }
+
+ yagl_handle_gen_cleanup();
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ yagl_log_cleanup();
+
+ return -1;
+}
+
+static void yagl_device_reset(DeviceState *d)
+{
+ YaGLState *s = container_of(d, YaGLState, dev.qdev);
+ int i;
+
+ YAGL_LOG_FUNC_ENTER(yagl_device_reset, NULL);
+
+ yagl_server_reset(s->ss);
+
+ yagl_handle_gen_reset();
+
+ for (i = 0; i < YAGL_MAX_USERS; ++i) {
+ memset(&s->users[i], 0, sizeof(s->users[i]));
+ }
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+static void yagl_device_exit(PCIDevice *dev)
+{
+ YaGLState *s = DO_UPCAST(YaGLState, dev, dev);
+
+ YAGL_LOG_FUNC_ENTER(yagl_device_exit, NULL);
+
+ memory_region_destroy(&s->iomem);
+
+ yagl_server_state_destroy(s->ss);
+
+ yagl_handle_gen_cleanup();
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ yagl_log_cleanup();
+}
+
+static Property yagl_properties[] = {
+ {
+ .name = "display",
+ .info = &qdev_prop_ptr,
+ .offset = offsetof(YaGLState, display),
+ },
+ {
+ .name = "winsys_gl_interface",
+ .info = &qdev_prop_ptr,
+ .offset = offsetof(YaGLState, wsi),
+ },
+ DEFINE_PROP_END_OF_LIST(),
+};
+
+static void yagl_class_init(ObjectClass *klass, void *data)
+{
+ DeviceClass *dc = DEVICE_CLASS(klass);
+ PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
+
+ k->init = yagl_device_init;
+ k->exit = yagl_device_exit;
+ k->vendor_id = PCI_VENDOR_ID_YAGL;
+ k->device_id = PCI_DEVICE_ID_YAGL;
+ k->class_id = PCI_CLASS_OTHERS;
+ dc->reset = yagl_device_reset;
+ dc->props = yagl_properties;
+ dc->desc = "YaGL device";
+}
+
+static TypeInfo yagl_device_info =
+{
+ .name = TYPE_YAGL_DEVICE,
+ .parent = TYPE_PCI_DEVICE,
+ .instance_size = sizeof(YaGLState),
+ .class_init = yagl_class_init,
+};
+
+static void yagl_register_types(void)
+{
+ type_register_static(&yagl_device_info);
+}
+
+type_init(yagl_register_types)
diff --git a/hw/yagl/yagl_drivers/Makefile.objs b/hw/yagl/yagl_drivers/Makefile.objs
new file mode 100644
index 0000000000..f3544e70aa
--- /dev/null
+++ b/hw/yagl/yagl_drivers/Makefile.objs
@@ -0,0 +1,6 @@
+obj-$(CONFIG_LINUX) += egl_glx/
+obj-$(CONFIG_WIN32) += egl_wgl/
+obj-$(CONFIG_DARWIN) += egl_agl/
+obj-y += gles_ogl/
+obj-y += gles_onscreen/
+
diff --git a/hw/yagl/yagl_drivers/egl_agl/Makefile.objs b/hw/yagl/yagl_drivers/egl_agl/Makefile.objs
new file mode 100644
index 0000000000..61fc900f32
--- /dev/null
+++ b/hw/yagl/yagl_drivers/egl_agl/Makefile.objs
@@ -0,0 +1,3 @@
+# EGL AGL driver
+QEMU_CFLAGS += -Wno-comment
+obj-y += yagl_egl_agl.o
diff --git a/hw/yagl/yagl_drivers/egl_agl/yagl_egl_agl.c b/hw/yagl/yagl_drivers/egl_agl/yagl_egl_agl.c
new file mode 100644
index 0000000000..f3593a360e
--- /dev/null
+++ b/hw/yagl/yagl_drivers/egl_agl/yagl_egl_agl.c
@@ -0,0 +1,407 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include <OpenGL/OpenGL.h>
+#include <AGL/agl.h>
+#include <glib.h>
+#include "yagl_egl_driver.h"
+#include "yagl_dyn_lib.h"
+#include "yagl_log.h"
+#include "yagl_egl_native_config.h"
+#include "yagl_egl_surface_attribs.h"
+#include "yagl_process.h"
+#include "yagl_tls.h"
+#include "yagl_thread.h"
+
+#define LIBGL_IMAGE_NAME \
+"/System/Library/Frameworks/OpenGL.framework/Libraries/libGL.dylib"
+
+#define YAGL_LOG_AGL_STATUS() \
+ YAGL_LOG_ERROR("AGL status: %s", aglErrorString(aglGetError()))
+
+typedef struct YaglEglAglContext {
+ AGLContext context;
+} YaglEglAglContext;
+
+typedef struct YaglEglAglDriver {
+ struct yagl_egl_driver base;
+} YaglEglAglDriver;
+
+static EGLNativeDisplayType
+yagl_egl_agl_display_open(struct yagl_egl_driver *driver)
+{
+ void *dpy = (void *)0x1;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_agl_display_open, NULL);
+
+ YAGL_LOG_FUNC_EXIT("Display created: %p", dpy);
+
+ return (EGLNativeDisplayType) dpy;
+}
+
+static void yagl_egl_agl_display_close(struct yagl_egl_driver *driver,
+ EGLNativeDisplayType egl_dpy)
+{
+ YAGL_LOG_FUNC_ENTER(yagl_egl_agl_display_close, "%p", egl_dpy);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+static struct yagl_egl_native_config
+*yagl_egl_agl_config_enum(struct yagl_egl_driver *driver,
+ EGLNativeDisplayType egl_dpy, int *num_configs)
+{
+ struct yagl_egl_native_config *egl_configs = NULL;
+ struct yagl_egl_native_config *cur_config;
+ int usable_configs = 0;
+
+ const int attrib_list[] = {
+ AGL_RGBA,
+ AGL_ACCELERATED,
+ AGL_MINIMUM_POLICY,
+ AGL_BUFFER_SIZE, 32,
+ AGL_RED_SIZE, 8,
+ AGL_GREEN_SIZE, 8,
+ AGL_BLUE_SIZE, 8,
+ AGL_ALPHA_SIZE, 8,
+ AGL_DEPTH_SIZE, 24,
+ AGL_STENCIL_SIZE, 8,
+ AGL_NO_RECOVERY,
+ AGL_DOUBLEBUFFER,
+ AGL_PBUFFER,
+ AGL_NONE
+ };
+ AGLPixelFormat pixfmt;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_agl_config_enum, "display %p", egl_dpy);
+
+ /* Enumerate AGL pixel formats matching our constraints */
+
+ pixfmt = aglChoosePixelFormat(NULL, 0, attrib_list);
+
+ while (pixfmt) {
+ egl_configs = g_renew(struct yagl_egl_native_config,
+ egl_configs, usable_configs + 1);
+
+ cur_config = &egl_configs[usable_configs];
+
+ /* Initialize fields */
+ yagl_egl_native_config_init(cur_config);
+
+ cur_config->transparent_type = EGL_NONE;
+ cur_config->config_id = usable_configs;
+
+ aglDescribePixelFormat(pixfmt, AGL_BUFFER_SIZE,
+ &cur_config->buffer_size);
+ aglDescribePixelFormat(pixfmt, AGL_RED_SIZE, &cur_config->red_size);
+ aglDescribePixelFormat(pixfmt, AGL_GREEN_SIZE, &cur_config->green_size);
+ aglDescribePixelFormat(pixfmt, AGL_BLUE_SIZE, &cur_config->blue_size);
+ aglDescribePixelFormat(pixfmt, AGL_ALPHA_SIZE, &cur_config->alpha_size);
+ aglDescribePixelFormat(pixfmt, AGL_DEPTH_SIZE, &cur_config->depth_size);
+ aglDescribePixelFormat(pixfmt, AGL_STENCIL_SIZE,
+ &cur_config->stencil_size);
+
+ cur_config->max_pbuffer_width = 4096;
+ cur_config->max_pbuffer_height = 4096;
+ cur_config->max_pbuffer_size = 4096 * 4096;
+ cur_config->native_visual_type = EGL_NONE;
+ cur_config->native_visual_id = 0;
+ cur_config->caveat = EGL_NONE;
+ cur_config->frame_buffer_level = 0;
+ cur_config->samples_per_pixel = 0;
+ cur_config->max_swap_interval = 1000;
+ cur_config->min_swap_interval = 0;
+
+ cur_config->driver_data = (void *)pixfmt;
+
+ usable_configs++;
+
+ pixfmt = aglNextPixelFormat(pixfmt);
+ }
+
+ YAGL_LOG_FUNC_EXIT("Enumerated %d configs", usable_configs);
+
+ /* It's up to the caller to call config_cleanup on each
+ of the returned entries, as well as call g_free on the array */
+
+ *num_configs = usable_configs;
+ return egl_configs;
+}
+
+static void yagl_egl_agl_config_cleanup(struct yagl_egl_driver *driver,
+ EGLNativeDisplayType egl_dpy,
+ const struct yagl_egl_native_config
+ *cfg)
+{
+ YAGL_LOG_FUNC_ENTER(yagl_egl_agl_config_cleanup,
+ "dpy = %p, cfg = %d", egl_dpy, cfg->config_id);
+
+ aglDestroyPixelFormat(cfg->driver_data);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+static EGLContext yagl_egl_agl_context_create(struct yagl_egl_driver *driver,
+ EGLNativeDisplayType egl_dpy,
+ const struct yagl_egl_native_config *cfg,
+ EGLContext share_context)
+{
+ YaglEglAglContext *egl_glc;
+ AGLContext agl_share_glc;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_agl_context_create,
+ "dpy = %p, share_context = %p, cfgid=%d",
+ egl_dpy, share_context, cfg->config_id);
+
+ egl_glc = g_new0(YaglEglAglContext, 1);
+
+ if (share_context != EGL_NO_CONTEXT) {
+ agl_share_glc = ((YaglEglAglContext *) share_context)->context;
+ } else
+ agl_share_glc = NULL;
+
+ egl_glc->context = aglCreateContext(cfg->driver_data, agl_share_glc);
+
+ if (!egl_glc->context)
+ goto fail;
+
+ YAGL_LOG_FUNC_EXIT("Context created: %p", egl_glc);
+
+ return (EGLContext) egl_glc;
+
+ fail:
+ g_free(egl_glc);
+
+ YAGL_LOG_AGL_STATUS();
+ YAGL_LOG_FUNC_EXIT("Failed to create new context");
+
+ return EGL_NO_CONTEXT;
+}
+
+static bool yagl_egl_agl_make_current(struct yagl_egl_driver *driver,
+ EGLNativeDisplayType egl_dpy,
+ EGLSurface egl_draw_surf,
+ EGLSurface egl_read_surf,
+ EGLContext egl_glc)
+{
+ AGLContext context = NULL;
+ AGLPbuffer draw_buf = NULL;
+ AGLPbuffer read_buf = NULL;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_agl_make_current,
+ "dpy = %p, draw = %p, read = %p, ctx = %p",
+ egl_dpy, egl_draw_surf, egl_read_surf, egl_glc);
+
+ if (egl_glc != EGL_NO_CONTEXT) {
+ context = ((YaglEglAglContext *) egl_glc)->context;
+ }
+
+ if (egl_read_surf != EGL_NO_SURFACE) {
+ read_buf = (AGLPbuffer) egl_read_surf;
+
+ if (aglSetPBuffer(context, read_buf, 0, 0, 0) == GL_FALSE) {
+ goto fail;
+ }
+ }
+
+ if (egl_draw_surf != EGL_NO_SURFACE) {
+ draw_buf = (AGLPbuffer) egl_draw_surf;
+
+ if (aglSetPBuffer(context, draw_buf, 0, 0, 0) == GL_FALSE) {
+ goto fail;
+ }
+ }
+
+ if (aglSetCurrentContext(context) == GL_FALSE) {
+ goto fail;
+ }
+
+ YAGL_LOG_FUNC_EXIT("context %p was made current", context);
+
+ return true;
+
+ fail:
+ YAGL_LOG_AGL_STATUS();
+
+ YAGL_LOG_FUNC_EXIT("Failed to make context %p current", context);
+
+ return false;
+}
+
+static void yagl_egl_agl_context_destroy(struct yagl_egl_driver *driver,
+ EGLNativeDisplayType egl_dpy,
+ EGLContext egl_glc)
+{
+ AGLContext context;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_agl_context_destroy,
+ "dpy = %p, ctx = %p", egl_dpy, egl_glc);
+
+ if (egl_glc != EGL_NO_CONTEXT) {
+ context = ((YaglEglAglContext *) egl_glc)->context;
+
+ if (aglDestroyContext(context) == GL_TRUE) {
+ g_free(egl_glc);
+ YAGL_LOG_FUNC_EXIT("Context destroyed");
+ return;
+ }
+
+ g_free(egl_glc);
+ YAGL_LOG_AGL_STATUS();
+ }
+
+ YAGL_LOG_FUNC_EXIT("Could not destroy context");
+}
+
+static EGLSurface yagl_egl_agl_pbuffer_surface_create(struct yagl_egl_driver
+ *driver,
+ EGLNativeDisplayType
+ egl_dpy,
+ const struct
+ yagl_egl_native_config
+ *cfg, EGLint width,
+ EGLint height,
+ const struct
+ yagl_egl_pbuffer_attribs
+ *attribs)
+{
+ AGLPbuffer pbuffer = NULL;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_agl_pbuffer_surface_create,
+ "dpy = %p, width = %d, height = %d, cfgid=%d",
+ egl_dpy, width, height, cfg->config_id);
+
+ if (aglCreatePBuffer(width, height, GL_TEXTURE_2D, GL_RGBA, 0, &pbuffer) ==
+ GL_FALSE)
+ goto fail;
+
+ YAGL_LOG_FUNC_EXIT("Surface created: %p", pbuffer);
+
+ return (EGLSurface) pbuffer;
+
+ fail:
+ YAGL_LOG_AGL_STATUS();
+ YAGL_LOG_FUNC_EXIT("Surface creation failed");
+
+ return EGL_NO_SURFACE;
+}
+
+static void yagl_egl_agl_pbuffer_surface_destroy(struct yagl_egl_driver *driver,
+ EGLNativeDisplayType egl_dpy,
+ EGLSurface surf)
+{
+ YAGL_LOG_FUNC_ENTER(yagl_egl_agl_pbuffer_surface_destroy,
+ "dpy = %p, sfc = %p", egl_dpy, (AGLPbuffer) surf);
+
+ if (aglDestroyPBuffer((AGLPbuffer) surf) == GL_FALSE) {
+ YAGL_LOG_AGL_STATUS();
+ YAGL_LOG_FUNC_EXIT("Failed to destroy surface");
+ } else {
+ YAGL_LOG_FUNC_EXIT("Surface destroyed");
+ }
+}
+
+static void yagl_egl_agl_destroy(struct yagl_egl_driver *driver)
+{
+ YAGL_LOG_FUNC_ENTER(yagl_egl_agl_destroy, NULL);
+
+ yagl_egl_driver_cleanup(driver);
+
+ g_free(driver);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+struct yagl_egl_driver *yagl_egl_driver_create(void *display)
+{
+ YaglEglAglDriver *egl_agl;
+ struct yagl_egl_driver *egl_driver;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_agl_create, NULL);
+
+ egl_agl = g_try_new0(YaglEglAglDriver, 1);
+
+ if (!egl_agl)
+ goto inconceivable;
+
+ egl_driver = &egl_agl->base;
+
+ /* Initialize portable YaGL machinery */
+ yagl_egl_driver_init(egl_driver);
+
+ egl_driver->display_open = &yagl_egl_agl_display_open;
+ egl_driver->display_close = &yagl_egl_agl_display_close;
+ egl_driver->config_enum = &yagl_egl_agl_config_enum;
+ egl_driver->config_cleanup = &yagl_egl_agl_config_cleanup;
+ egl_driver->pbuffer_surface_create = &yagl_egl_agl_pbuffer_surface_create;
+ egl_driver->pbuffer_surface_destroy = &yagl_egl_agl_pbuffer_surface_destroy;
+ egl_driver->context_create = &yagl_egl_agl_context_create;
+ egl_driver->context_destroy = &yagl_egl_agl_context_destroy;
+ egl_driver->make_current = &yagl_egl_agl_make_current;
+ egl_driver->destroy = &yagl_egl_agl_destroy;
+
+ egl_driver->dyn_lib = yagl_dyn_lib_create();
+
+ if (!yagl_dyn_lib_load(egl_driver->dyn_lib, LIBGL_IMAGE_NAME)) {
+ YAGL_LOG_ERROR("Loading %s failed with error: %s",
+ LIBGL_IMAGE_NAME,
+ yagl_dyn_lib_get_error(egl_driver->dyn_lib));
+ goto fail;
+ }
+
+ YAGL_LOG_FUNC_EXIT("EGL AGL driver created (%p)", egl_driver);
+
+ return egl_driver;
+
+ fail:
+ yagl_egl_driver_cleanup(egl_driver);
+ g_free(egl_agl);
+
+ inconceivable:
+ YAGL_LOG_AGL_STATUS();
+ YAGL_LOG_FUNC_EXIT("EGL_AGL driver creation failed");
+
+ return NULL;
+}
+
+void *yagl_dyn_lib_get_ogl_procaddr(struct yagl_dyn_lib *dyn_lib,
+ const char *sym)
+{
+ void *proc;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_agl_get_procaddr,
+ "Retrieving %s address", sym);
+
+ /* The dlsym code path is shared by Linux and Mac builds */
+ proc = yagl_dyn_lib_get_sym(dyn_lib, sym);
+
+ YAGL_LOG_FUNC_EXIT("%s address: %p", sym, proc);
+
+ return proc;
+}
diff --git a/hw/yagl/yagl_drivers/egl_glx/Makefile.objs b/hw/yagl/yagl_drivers/egl_glx/Makefile.objs
new file mode 100644
index 0000000000..15df65cd51
--- /dev/null
+++ b/hw/yagl/yagl_drivers/egl_glx/Makefile.objs
@@ -0,0 +1,2 @@
+# EGL GLX driver
+obj-y += yagl_egl_glx.o
diff --git a/hw/yagl/yagl_drivers/egl_glx/yagl_egl_glx.c b/hw/yagl/yagl_drivers/egl_glx/yagl_egl_glx.c
new file mode 100644
index 0000000000..8b29c8286b
--- /dev/null
+++ b/hw/yagl/yagl_drivers/egl_glx/yagl_egl_glx.c
@@ -0,0 +1,601 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "yagl_egl_driver.h"
+#include "yagl_dyn_lib.h"
+#include "yagl_log.h"
+#include "yagl_tls.h"
+#include "yagl_thread.h"
+#include "yagl_process.h"
+#include "yagl_egl_native_config.h"
+#include "yagl_egl_surface_attribs.h"
+#include <GL/glx.h>
+
+#define YAGL_EGL_GLX_ENTER(func, format, ...) \
+ YAGL_LOG_FUNC_ENTER(func, format,##__VA_ARGS__)
+
+#define YAGL_EGL_GLX_GET_PROC(proc_type, proc_name) \
+ do { \
+ egl_glx->proc_name = \
+ (proc_type)egl_glx->glXGetProcAddress((const GLubyte*)#proc_name); \
+ if (!egl_glx->proc_name) { \
+ YAGL_LOG_ERROR("Unable to get symbol: %s", \
+ yagl_dyn_lib_get_error(egl_driver->dyn_lib)); \
+ goto fail; \
+ } \
+ } while (0)
+
+#define YAGL_EGL_GLX_GET_CONFIG_ATTRIB_RET(attribute, value) \
+ if (egl_glx->glXGetFBConfigAttrib(dpy, glx_cfg, (attribute), (value)) != Success) { \
+ YAGL_LOG_WARN("glXGetFBConfigAttrib failed to get " #attribute); \
+ YAGL_LOG_FUNC_EXIT(NULL); \
+ return false; \
+ }
+
+#ifndef GLX_VERSION_1_4
+#error GL/glx.h must be equal to or greater than GLX 1.4
+#endif
+
+/* GLX 1.0 */
+typedef GLXContext (*GLXCREATECONTEXTPROC)( Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct );
+typedef void (*GLXDESTROYCONTEXTPROC)( Display *dpy, GLXContext ctx );
+typedef Bool (*GLXMAKECURRENTPROC)( Display *dpy, GLXDrawable drawable, GLXContext ctx);
+typedef void (*GLXSWAPBUFFERSPROC)( Display *dpy, GLXDrawable drawable );
+typedef GLXPixmap (*GLXCREATEGLXPIXMAPPROC)( Display *dpy, XVisualInfo *visual, Pixmap pixmap );
+typedef void (*GLXDESTROYGLXPIXMAPPROC)( Display *dpy, GLXPixmap pixmap );
+typedef Bool (*GLXQUERYVERSIONPROC)( Display *dpy, int *maj, int *min );
+typedef int (*GLXGETCONFIGPROC)( Display *dpy, XVisualInfo *visual, int attrib, int *value );
+typedef void (*GLXWAITGLPROC)( void );
+typedef void (*GLXWAITXPROC)( void );
+
+/* GLX 1.1 */
+typedef const char *(*GLXQUERYEXTENSIONSSTRINGPROC)( Display *dpy, int screen );
+typedef const char *(*GLXQUERYSERVERSTRINGPROC)( Display *dpy, int screen, int name );
+typedef const char *(*GLXGETCLIENTSTRINGPROC)( Display *dpy, int name );
+
+struct yagl_egl_glx
+{
+ struct yagl_egl_driver base;
+
+ EGLNativeDisplayType global_dpy;
+
+ /* GLX 1.0 */
+ GLXCREATECONTEXTPROC glXCreateContext;
+ GLXDESTROYCONTEXTPROC glXDestroyContext;
+ GLXMAKECURRENTPROC glXMakeCurrent;
+ GLXSWAPBUFFERSPROC glXSwapBuffers;
+ GLXCREATEGLXPIXMAPPROC glXCreateGLXPixmap;
+ GLXDESTROYGLXPIXMAPPROC glXDestroyGLXPixmap;
+ GLXQUERYVERSIONPROC glXQueryVersion;
+ GLXGETCONFIGPROC glXGetConfig;
+ GLXWAITGLPROC glXWaitGL;
+ GLXWAITXPROC glXWaitX;
+
+ /* GLX 1.1 */
+ GLXQUERYEXTENSIONSSTRINGPROC glXQueryExtensionsString;
+ GLXQUERYSERVERSTRINGPROC glXQueryServerString;
+ GLXGETCLIENTSTRINGPROC glXGetClientString;
+
+ /* GLX 1.3 or (GLX_SGI_make_current_read and GLX_SGIX_fbconfig) */
+ PFNGLXGETFBCONFIGSPROC glXGetFBConfigs;
+ PFNGLXGETFBCONFIGATTRIBPROC glXGetFBConfigAttrib;
+ PFNGLXGETVISUALFROMFBCONFIGPROC glXGetVisualFromFBConfig;
+ PFNGLXCREATEWINDOWPROC glXCreateWindow;
+ PFNGLXDESTROYWINDOWPROC glXDestroyWindow;
+ PFNGLXCREATEPIXMAPPROC glXCreatePixmap;
+ PFNGLXDESTROYPIXMAPPROC glXDestroyPixmap;
+ PFNGLXCREATEPBUFFERPROC glXCreatePbuffer;
+ PFNGLXDESTROYPBUFFERPROC glXDestroyPbuffer;
+ PFNGLXCREATENEWCONTEXTPROC glXCreateNewContext;
+ PFNGLXMAKECONTEXTCURRENTPROC glXMakeContextCurrent;
+
+ /* GLX 1.4 or GLX_ARB_get_proc_address */
+ PFNGLXGETPROCADDRESSPROC glXGetProcAddress;
+};
+
+/*
+ * INTERNAL IMPLEMENTATION FUNCTIONS
+ * @{
+ */
+
+static bool yagl_egl_glx_config_fill(struct yagl_egl_driver *driver,
+ EGLNativeDisplayType dpy,
+ struct yagl_egl_native_config *cfg,
+ GLXFBConfig glx_cfg)
+{
+ struct yagl_egl_glx *egl_glx = (struct yagl_egl_glx*)driver;
+ int tmp = 0;
+ int transparent_type = 0;
+ int trans_red_val = 0;
+ int trans_green_val = 0;
+ int trans_blue_val = 0;
+ int buffer_size = 0;
+ int red_size = 0;
+ int green_size = 0;
+ int blue_size = 0;
+ int alpha_size = 0;
+ int depth_size = 0;
+ int stencil_size = 0;
+ int native_visual_id = 0;
+ int native_visual_type = 0;
+ int caveat = 0;
+ int max_pbuffer_width = 0;
+ int max_pbuffer_height = 0;
+ int max_pbuffer_size = 0;
+ int frame_buffer_level = 0;
+ int config_id = 0;
+ int samples_per_pixel = 0;
+
+ YAGL_EGL_GLX_ENTER(yagl_egl_glx_config_fill, NULL);
+
+ YAGL_EGL_GLX_GET_CONFIG_ATTRIB_RET(GLX_FBCONFIG_ID, &config_id);
+
+ YAGL_LOG_TRACE("id = %d", config_id);
+
+ YAGL_EGL_GLX_GET_CONFIG_ATTRIB_RET(GLX_RENDER_TYPE, &tmp);
+
+ if ((tmp & GLX_RGBA_BIT) == 0) {
+ YAGL_LOG_FUNC_EXIT(NULL);
+ return false;
+ }
+
+ YAGL_EGL_GLX_GET_CONFIG_ATTRIB_RET(GLX_DRAWABLE_TYPE, &tmp);
+
+ if ((tmp & GLX_PBUFFER_BIT) == 0) {
+ YAGL_LOG_FUNC_EXIT(NULL);
+ return false;
+ }
+
+ YAGL_EGL_GLX_GET_CONFIG_ATTRIB_RET(GLX_TRANSPARENT_TYPE, &tmp);
+
+ if (tmp == GLX_TRANSPARENT_INDEX) {
+ YAGL_LOG_FUNC_EXIT(NULL);
+ return false;
+ } else if(tmp == GLX_NONE) {
+ transparent_type = EGL_NONE;
+ } else {
+ transparent_type = EGL_TRANSPARENT_RGB;
+
+ YAGL_EGL_GLX_GET_CONFIG_ATTRIB_RET(GLX_TRANSPARENT_RED_VALUE, &trans_red_val);
+ YAGL_EGL_GLX_GET_CONFIG_ATTRIB_RET(GLX_TRANSPARENT_GREEN_VALUE, &trans_green_val);
+ YAGL_EGL_GLX_GET_CONFIG_ATTRIB_RET(GLX_TRANSPARENT_BLUE_VALUE, &trans_blue_val);
+ }
+
+ YAGL_EGL_GLX_GET_CONFIG_ATTRIB_RET(GLX_BUFFER_SIZE, &buffer_size);
+ YAGL_EGL_GLX_GET_CONFIG_ATTRIB_RET(GLX_RED_SIZE, &red_size);
+ YAGL_EGL_GLX_GET_CONFIG_ATTRIB_RET(GLX_GREEN_SIZE, &green_size);
+ YAGL_EGL_GLX_GET_CONFIG_ATTRIB_RET(GLX_BLUE_SIZE, &blue_size);
+ YAGL_EGL_GLX_GET_CONFIG_ATTRIB_RET(GLX_ALPHA_SIZE, &alpha_size);
+ YAGL_EGL_GLX_GET_CONFIG_ATTRIB_RET(GLX_DEPTH_SIZE, &depth_size);
+ YAGL_EGL_GLX_GET_CONFIG_ATTRIB_RET(GLX_STENCIL_SIZE, &stencil_size);
+ YAGL_EGL_GLX_GET_CONFIG_ATTRIB_RET(GLX_X_VISUAL_TYPE, &native_visual_type);
+ YAGL_EGL_GLX_GET_CONFIG_ATTRIB_RET(GLX_VISUAL_ID, &native_visual_id);
+
+ YAGL_EGL_GLX_GET_CONFIG_ATTRIB_RET(GLX_CONFIG_CAVEAT, &tmp);
+
+ if (tmp == GLX_NONE) {
+ caveat = EGL_NONE;
+ } else if (tmp == GLX_SLOW_CONFIG) {
+ caveat = EGL_SLOW_CONFIG;
+ } else if (tmp == GLX_NON_CONFORMANT_CONFIG) {
+ caveat = EGL_NON_CONFORMANT_CONFIG;
+ }
+
+ YAGL_EGL_GLX_GET_CONFIG_ATTRIB_RET(GLX_MAX_PBUFFER_WIDTH, &max_pbuffer_width);
+ YAGL_EGL_GLX_GET_CONFIG_ATTRIB_RET(GLX_MAX_PBUFFER_HEIGHT, &max_pbuffer_height);
+ YAGL_EGL_GLX_GET_CONFIG_ATTRIB_RET(GLX_MAX_PBUFFER_PIXELS, &max_pbuffer_size);
+
+ YAGL_EGL_GLX_GET_CONFIG_ATTRIB_RET(GLX_LEVEL, &frame_buffer_level);
+ YAGL_EGL_GLX_GET_CONFIG_ATTRIB_RET(GLX_SAMPLES, &samples_per_pixel);
+
+ yagl_egl_native_config_init(cfg);
+
+ cfg->red_size = red_size;
+ cfg->green_size = green_size;
+ cfg->blue_size = blue_size;
+ cfg->alpha_size = alpha_size;
+ cfg->buffer_size = buffer_size;
+ cfg->caveat = caveat;
+ cfg->config_id = config_id;
+ cfg->frame_buffer_level = frame_buffer_level;
+ cfg->depth_size = depth_size;
+ cfg->max_pbuffer_width = max_pbuffer_width;
+ cfg->max_pbuffer_height = max_pbuffer_height;
+ cfg->max_pbuffer_size = max_pbuffer_size;
+ cfg->max_swap_interval = 1000;
+ cfg->min_swap_interval = 0;
+ cfg->native_visual_id = native_visual_id;
+ cfg->native_visual_type = native_visual_type;
+ cfg->samples_per_pixel = samples_per_pixel;
+ cfg->stencil_size = stencil_size;
+ cfg->transparent_type = transparent_type;
+ cfg->trans_red_val = trans_red_val;
+ cfg->trans_green_val = trans_green_val;
+ cfg->trans_blue_val = trans_blue_val;
+
+ cfg->driver_data = glx_cfg;
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * @}
+ */
+
+/*
+ * PUBLIC FUNCTIONS
+ * @{
+ */
+
+static EGLNativeDisplayType yagl_egl_glx_display_open(struct yagl_egl_driver *driver)
+{
+ struct yagl_egl_glx *egl_glx = (struct yagl_egl_glx*)driver;
+
+ YAGL_EGL_GLX_ENTER(yagl_egl_glx_display_open, NULL);
+
+ YAGL_LOG_FUNC_EXIT("%p", egl_glx->global_dpy);
+
+ return egl_glx->global_dpy;
+}
+
+static void yagl_egl_glx_display_close(struct yagl_egl_driver *driver,
+ EGLNativeDisplayType dpy)
+{
+ YAGL_EGL_GLX_ENTER(yagl_egl_glx_display_close, "%p", dpy);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+static struct yagl_egl_native_config
+ *yagl_egl_glx_config_enum(struct yagl_egl_driver *driver,
+ EGLNativeDisplayType dpy,
+ int *num_configs)
+{
+ struct yagl_egl_glx *egl_glx = (struct yagl_egl_glx*)driver;
+ struct yagl_egl_native_config *configs = NULL;
+ int glx_cfg_index, cfg_index, n;
+ GLXFBConfig *glx_configs;
+
+ YAGL_EGL_GLX_ENTER(yagl_egl_glx_config_enum, "%p", dpy);
+
+ *num_configs = 0;
+
+ glx_configs = egl_glx->glXGetFBConfigs(dpy, DefaultScreen(dpy), &n);
+
+ YAGL_LOG_TRACE("got %d configs", n);
+
+ configs = g_malloc0(n * sizeof(*configs));
+
+ for (glx_cfg_index = 0, cfg_index = 0; glx_cfg_index < n; ++glx_cfg_index) {
+ if (yagl_egl_glx_config_fill(driver,
+ dpy,
+ &configs[cfg_index],
+ glx_configs[glx_cfg_index])) {
+ ++cfg_index;
+ } else {
+ /*
+ * Clean up so we could construct here again.
+ */
+ memset(&configs[cfg_index],
+ 0,
+ sizeof(struct yagl_egl_native_config));
+ }
+ }
+
+ *num_configs = cfg_index;
+
+ XFree(glx_configs);
+
+ YAGL_LOG_DEBUG("glXGetFBConfigs returned %d configs, %d are usable",
+ n,
+ *num_configs);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return configs;
+}
+
+static void yagl_egl_glx_config_cleanup(struct yagl_egl_driver *driver,
+ EGLNativeDisplayType dpy,
+ const struct yagl_egl_native_config *cfg)
+{
+ YAGL_EGL_GLX_ENTER(yagl_egl_glx_config_cleanup,
+ "dpy = %p, cfg = %d",
+ dpy,
+ cfg->config_id);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+static EGLSurface yagl_egl_glx_pbuffer_surface_create(struct yagl_egl_driver *driver,
+ EGLNativeDisplayType dpy,
+ const struct yagl_egl_native_config *cfg,
+ EGLint width,
+ EGLint height,
+ const struct yagl_egl_pbuffer_attribs *attribs)
+{
+ struct yagl_egl_glx *egl_glx = (struct yagl_egl_glx*)driver;
+ int glx_attribs[] = {
+ GLX_PBUFFER_WIDTH, width,
+ GLX_PBUFFER_HEIGHT, height,
+ GLX_LARGEST_PBUFFER, False,
+ GLX_PRESERVED_CONTENTS, True,
+ None
+ };
+ GLXPbuffer pbuffer;
+
+ YAGL_EGL_GLX_ENTER(yagl_egl_glx_pbuffer_surface_create,
+ "dpy = %p, width = %d, height = %d",
+ dpy,
+ width,
+ height);
+
+ pbuffer = egl_glx->glXCreatePbuffer(dpy,
+ (GLXFBConfig)cfg->driver_data,
+ glx_attribs);
+
+ if (!pbuffer) {
+ YAGL_LOG_ERROR("glXCreatePbuffer failed");
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return EGL_NO_SURFACE;
+ } else {
+ YAGL_LOG_FUNC_EXIT("%p", (EGLSurface)pbuffer);
+
+ return (EGLSurface)pbuffer;
+ }
+}
+
+static void yagl_egl_glx_pbuffer_surface_destroy(struct yagl_egl_driver *driver,
+ EGLNativeDisplayType dpy,
+ EGLSurface sfc)
+{
+ struct yagl_egl_glx *egl_glx = (struct yagl_egl_glx*)driver;
+
+ YAGL_EGL_GLX_ENTER(yagl_egl_glx_pbuffer_surface_destroy,
+ "dpy = %p, sfc = %p",
+ dpy,
+ sfc);
+
+ egl_glx->glXDestroyPbuffer(dpy, (GLXPbuffer)sfc);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+static EGLContext yagl_egl_glx_context_create(struct yagl_egl_driver *driver,
+ EGLNativeDisplayType dpy,
+ const struct yagl_egl_native_config *cfg,
+ EGLContext share_context)
+{
+ struct yagl_egl_glx *egl_glx = (struct yagl_egl_glx*)driver;
+ GLXContext ctx;
+
+ YAGL_EGL_GLX_ENTER(yagl_egl_glx_context_create,
+ "dpy = %p, share_context = %p",
+ dpy,
+ share_context);
+
+ 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("glXCreateNewContext failed");
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return EGL_NO_CONTEXT;
+ } else {
+ YAGL_LOG_FUNC_EXIT("%p", (EGLContext)ctx);
+
+ return (EGLContext)ctx;
+ }
+}
+
+static void yagl_egl_glx_context_destroy(struct yagl_egl_driver *driver,
+ EGLNativeDisplayType dpy,
+ EGLContext ctx)
+{
+ struct yagl_egl_glx *egl_glx = (struct yagl_egl_glx*)driver;
+
+ YAGL_EGL_GLX_ENTER(yagl_egl_glx_context_destroy,
+ "dpy = %p, ctx = %p",
+ dpy,
+ ctx);
+
+ egl_glx->glXDestroyContext(dpy, (GLXContext)ctx);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+static bool yagl_egl_glx_make_current(struct yagl_egl_driver *driver,
+ EGLNativeDisplayType dpy,
+ EGLSurface draw,
+ EGLSurface read,
+ EGLContext ctx)
+{
+ struct yagl_egl_glx *egl_glx = (struct yagl_egl_glx*)driver;
+ bool ret;
+
+ YAGL_EGL_GLX_ENTER(yagl_egl_glx_make_current,
+ "dpy = %p, draw = %p, read = %p, ctx = %p",
+ dpy,
+ draw,
+ read,
+ ctx);
+
+ ret = egl_glx->glXMakeContextCurrent(dpy, (GLXDrawable)draw, (GLXDrawable)read, (GLXContext)ctx);
+
+ YAGL_LOG_FUNC_EXIT("%u", (uint32_t)ret);
+
+ return ret;
+}
+
+/*
+ * @}
+ */
+
+static void yagl_egl_glx_destroy(struct yagl_egl_driver *driver)
+{
+ struct yagl_egl_glx *egl_glx = (struct yagl_egl_glx*)driver;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_glx_destroy, NULL);
+
+ yagl_egl_driver_cleanup(&egl_glx->base);
+
+ g_free(egl_glx);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+struct yagl_egl_driver *yagl_egl_driver_create(void *display)
+{
+ struct yagl_egl_driver *egl_driver;
+ struct yagl_egl_glx *egl_glx;
+ Display *x_display = display;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_glx_create, NULL);
+
+ egl_glx = g_malloc0(sizeof(*egl_glx));
+
+ egl_glx->global_dpy = x_display;
+
+ egl_driver = &egl_glx->base;
+
+ yagl_egl_driver_init(egl_driver);
+
+ egl_driver->dyn_lib = yagl_dyn_lib_create();
+
+ if (!egl_driver->dyn_lib) {
+ goto fail;
+ }
+
+ if (!yagl_dyn_lib_load(egl_driver->dyn_lib, "libGL.so.1")) {
+ YAGL_LOG_ERROR("Unable to load libGL.so.1: %s",
+ yagl_dyn_lib_get_error(egl_driver->dyn_lib));
+ goto fail;
+ }
+
+ egl_glx->glXGetProcAddress =
+ yagl_dyn_lib_get_sym(egl_driver->dyn_lib, "glXGetProcAddress");
+
+ if (!egl_glx->glXGetProcAddress) {
+ egl_glx->glXGetProcAddress =
+ yagl_dyn_lib_get_sym(egl_driver->dyn_lib, "glXGetProcAddressARB");
+ }
+
+ if (!egl_glx->glXGetProcAddress) {
+ YAGL_LOG_ERROR("Unable to get symbol: %s",
+ yagl_dyn_lib_get_error(egl_driver->dyn_lib));
+ goto fail;
+ }
+
+ /* GLX 1.0 */
+ YAGL_EGL_GLX_GET_PROC(GLXCREATECONTEXTPROC, glXCreateContext);
+ YAGL_EGL_GLX_GET_PROC(GLXDESTROYCONTEXTPROC, glXDestroyContext);
+ YAGL_EGL_GLX_GET_PROC(GLXMAKECURRENTPROC, glXMakeCurrent);
+ YAGL_EGL_GLX_GET_PROC(GLXSWAPBUFFERSPROC, glXSwapBuffers);
+ YAGL_EGL_GLX_GET_PROC(GLXCREATEGLXPIXMAPPROC, glXCreateGLXPixmap);
+ YAGL_EGL_GLX_GET_PROC(GLXDESTROYGLXPIXMAPPROC, glXDestroyGLXPixmap);
+ YAGL_EGL_GLX_GET_PROC(GLXQUERYVERSIONPROC, glXQueryVersion);
+ YAGL_EGL_GLX_GET_PROC(GLXGETCONFIGPROC, glXGetConfig);
+ YAGL_EGL_GLX_GET_PROC(GLXWAITGLPROC, glXWaitGL);
+ YAGL_EGL_GLX_GET_PROC(GLXWAITXPROC, glXWaitX);
+
+ /* GLX 1.1 */
+ YAGL_EGL_GLX_GET_PROC(GLXQUERYEXTENSIONSSTRINGPROC, glXQueryExtensionsString);
+ YAGL_EGL_GLX_GET_PROC(GLXQUERYSERVERSTRINGPROC, glXQueryServerString);
+ YAGL_EGL_GLX_GET_PROC(GLXGETCLIENTSTRINGPROC, glXGetClientString);
+
+ /* GLX 1.3 */
+ 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(PFNGLXCREATEWINDOWPROC, glXCreateWindow);
+ YAGL_EGL_GLX_GET_PROC(PFNGLXDESTROYWINDOWPROC, glXDestroyWindow);
+ YAGL_EGL_GLX_GET_PROC(PFNGLXCREATEPIXMAPPROC, glXCreatePixmap);
+ YAGL_EGL_GLX_GET_PROC(PFNGLXDESTROYPIXMAPPROC, glXDestroyPixmap);
+ YAGL_EGL_GLX_GET_PROC(PFNGLXCREATEPBUFFERPROC, glXCreatePbuffer);
+ YAGL_EGL_GLX_GET_PROC(PFNGLXDESTROYPBUFFERPROC, glXDestroyPbuffer);
+ YAGL_EGL_GLX_GET_PROC(PFNGLXCREATENEWCONTEXTPROC, glXCreateNewContext);
+ YAGL_EGL_GLX_GET_PROC(PFNGLXMAKECONTEXTCURRENTPROC, glXMakeContextCurrent);
+
+ 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;
+ egl_glx->base.config_cleanup = &yagl_egl_glx_config_cleanup;
+ egl_glx->base.pbuffer_surface_create = &yagl_egl_glx_pbuffer_surface_create;
+ egl_glx->base.pbuffer_surface_destroy = &yagl_egl_glx_pbuffer_surface_destroy;
+ egl_glx->base.context_create = &yagl_egl_glx_context_create;
+ egl_glx->base.context_destroy = &yagl_egl_glx_context_destroy;
+ egl_glx->base.make_current = &yagl_egl_glx_make_current;
+ egl_glx->base.destroy = &yagl_egl_glx_destroy;
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return &egl_glx->base;
+
+fail:
+ yagl_egl_driver_cleanup(&egl_glx->base);
+ g_free(egl_glx);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return NULL;
+}
+
+void *yagl_dyn_lib_get_ogl_procaddr(struct yagl_dyn_lib *dyn_lib,
+ const char *sym_name)
+{
+ PFNGLXGETPROCADDRESSPROC get_proc_addr;
+ void *res = NULL;
+
+ get_proc_addr = yagl_dyn_lib_get_sym(dyn_lib, "glXGetProcAddress");
+
+ if (!get_proc_addr) {
+ get_proc_addr = yagl_dyn_lib_get_sym(dyn_lib, "glXGetProcAddressARB");
+ }
+
+ if (get_proc_addr) {
+ res = get_proc_addr((const GLubyte*)sym_name);
+ }
+
+ if (!res) {
+ res = yagl_dyn_lib_get_sym(dyn_lib, sym_name);
+ }
+
+ return res;
+}
diff --git a/hw/yagl/yagl_drivers/egl_wgl/Makefile.objs b/hw/yagl/yagl_drivers/egl_wgl/Makefile.objs
new file mode 100644
index 0000000000..811e319a3a
--- /dev/null
+++ b/hw/yagl/yagl_drivers/egl_wgl/Makefile.objs
@@ -0,0 +1,2 @@
+# EGL WGL driver
+obj-y += yagl_egl_wgl.o
diff --git a/hw/yagl/yagl_drivers/egl_wgl/yagl_egl_wgl.c b/hw/yagl/yagl_drivers/egl_wgl/yagl_egl_wgl.c
new file mode 100644
index 0000000000..ae9abb0180
--- /dev/null
+++ b/hw/yagl/yagl_drivers/egl_wgl/yagl_egl_wgl.c
@@ -0,0 +1,1060 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include <windows.h>
+#include <wingdi.h>
+#include <GL/gl.h>
+#include <GL/wglext.h>
+#include <glib.h>
+#include "yagl_egl_driver.h"
+#include "yagl_dyn_lib.h"
+#include "yagl_log.h"
+#include "yagl_egl_native_config.h"
+#include "yagl_egl_surface_attribs.h"
+#include "yagl_process.h"
+#include "yagl_tls.h"
+#include "yagl_thread.h"
+
+#define YAGL_EGL_WGL_WIN_CLASS "YaGLwinClass"
+
+#define YAGL_EGL_WGL_ENTER(func, format, ...) \
+ YAGL_LOG_FUNC_ENTER(func, format,##__VA_ARGS__)
+
+/* Get a core WGL function address */
+#define YAGL_EGL_WGL_GET_PROC(proc_type, proc_name) \
+ do { \
+ egl_wgl->proc_name = \
+ (proc_type)yagl_dyn_lib_get_sym(egl_driver->dyn_lib, #proc_name); \
+ if (!egl_wgl->proc_name) { \
+ YAGL_LOG_ERROR("%s not found!", #proc_name); \
+ goto fail; \
+ } \
+ YAGL_LOG_TRACE("Got %s address", #proc_name); \
+ } while (0)
+
+/* Get a mandatory WGL extension function pointer */
+#define YAGL_EGL_WGL_GET_EXT_PROC(ext_name, proc_name, proc_type) \
+ do { \
+ if (!yagl_egl_wgl_search_ext(ext_str, #ext_name)) { \
+ YAGL_LOG_ERROR("%s extension not supported", #ext_name); \
+ goto out; \
+ } \
+ egl_wgl->proc_name = (proc_type) \
+ egl_wgl->wglGetProcAddress((LPCSTR)#proc_name); \
+ if (!egl_wgl->proc_name) { \
+ YAGL_LOG_ERROR("Mandatory function %s not found", #proc_name); \
+ goto out; \
+ } \
+ YAGL_LOG_TRACE("Got %s address", #proc_name); \
+ } while (0)
+
+typedef HGLRC (WINAPI *WGLCREATECONTEXTPROC)(HDC hdl);
+typedef BOOL (WINAPI *WGLDELETECONTEXTPROC)(HGLRC hdl);
+typedef PROC (WINAPI *WGLGETPROCADDRESSPROC)(LPCSTR sym);
+typedef BOOL (WINAPI *WGLMAKECURRENTPROC)(HDC dev_ctx, HGLRC rend_ctx);
+typedef BOOL (WINAPI *WGLSHARELISTSPROC)(HGLRC ctx1, HGLRC ctx2);
+
+typedef struct YaglEglWglDC {
+ HWND win;
+ HDC dc;
+} YaglEglWglDC;
+
+typedef struct YaglEglWglDpy {
+ GHashTable *dc_table;
+} YaglEglWglDpy;
+
+typedef struct YaglEglWglDriver {
+ struct yagl_egl_driver base;
+
+ HWND win;
+
+ WGLCREATECONTEXTPROC wglCreateContext;
+ WGLDELETECONTEXTPROC wglDeleteContext;
+ WGLGETPROCADDRESSPROC wglGetProcAddress;
+ WGLMAKECURRENTPROC wglMakeCurrent;
+ WGLSHARELISTSPROC wglShareLists;
+
+ /* WGL extensions */
+ PFNWGLGETEXTENSIONSSTRINGEXTPROC wglGetExtensionsStringEXT;
+ PFNWGLGETEXTENSIONSSTRINGARBPROC wglGetExtensionsStringARB;
+ PFNWGLGETPIXELFORMATATTRIBIVARBPROC wglGetPixelFormatAttribivARB;
+ PFNWGLCHOOSEPIXELFORMATARBPROC wglChoosePixelFormatARB;
+ PFNWGLCREATEPBUFFERARBPROC wglCreatePbufferARB;
+ PFNWGLGETPBUFFERDCARBPROC wglGetPbufferDCARB;
+ PFNWGLRELEASEPBUFFERDCARBPROC wglReleasePbufferDCARB;
+ PFNWGLDESTROYPBUFFERARBPROC wglDestroyPbufferARB;
+ PFNWGLMAKECONTEXTCURRENTARBPROC wglMakeContextCurrentARB;
+} YaglEglWglDriver;
+
+static inline HWND yagl_egl_wgl_dummy_win_create(void)
+{
+ return CreateWindow(YAGL_EGL_WGL_WIN_CLASS, "YaGLwin",
+ WS_DISABLED | WS_POPUP, 0, 0, 1, 1, NULL, NULL, 0, 0);
+}
+
+static inline bool yagl_egl_wgl_dc_set_def_pixfmt(HDC dc)
+{
+ INT pixfmt_idx;
+ PIXELFORMATDESCRIPTOR pixfmt = {
+ .nSize = sizeof(PIXELFORMATDESCRIPTOR),
+ .nVersion = 1,
+ .dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER,
+ .iPixelType = PFD_TYPE_RGBA,
+ .cColorBits = 32,
+ .cDepthBits = 24,
+ .cStencilBits = 8,
+ .iLayerType = PFD_MAIN_PLANE,
+ };
+
+ pixfmt_idx = ChoosePixelFormat(dc, &pixfmt);
+
+ if (pixfmt_idx == 0) {
+ return false;
+ }
+
+ if (SetPixelFormat(dc, pixfmt_idx, &pixfmt) == FALSE) {
+ return false;
+ }
+
+ return true;
+}
+
+static void yagl_egl_wgl_cfgdc_free(gpointer data)
+{
+ YaglEglWglDC *dc = data;
+
+ ReleaseDC(dc->win, dc->dc);
+ DestroyWindow(dc->win);
+
+ g_free(dc);
+}
+
+static EGLNativeDisplayType
+yagl_egl_wgl_display_open(struct yagl_egl_driver *driver)
+{
+ YaglEglWglDpy *dpy;
+
+ YAGL_EGL_WGL_ENTER(yagl_egl_wgl_display_open, NULL);
+
+ dpy = g_try_new0(YaglEglWglDpy, 1);
+
+ if (!dpy) {
+ goto fail;
+ }
+
+ dpy->dc_table = g_hash_table_new_full(g_direct_hash, g_direct_equal,
+ NULL,
+ &yagl_egl_wgl_cfgdc_free);
+
+ YAGL_LOG_FUNC_EXIT("Display created: %p", dpy);
+
+ return (EGLNativeDisplayType)dpy;
+
+fail:
+ YAGL_LOG_FUNC_EXIT("Display creation failed");
+
+ return NULL;
+}
+
+static void yagl_egl_wgl_display_close(struct yagl_egl_driver *driver,
+ EGLNativeDisplayType egl_dpy)
+{
+ YaglEglWglDpy *dpy = (YaglEglWglDpy *)egl_dpy;
+
+ YAGL_EGL_WGL_ENTER(yagl_egl_wgl_display_close, "%p", dpy);
+
+ g_hash_table_destroy(dpy->dc_table);
+
+ g_free(dpy);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+static bool yagl_egl_wgl_config_fill(YaglEglWglDriver *egl_wgl,
+ HDC dc,
+ struct yagl_egl_native_config *cfg,
+ int fmt_idx)
+{
+ PIXELFORMATDESCRIPTOR *pix_fmt = NULL;
+ bool filled = false;
+
+ enum {
+ YAGL_WGL_PIXEL_TYPE = 0,
+ YAGL_WGL_DRAW_TO_PBUFFER,
+ YAGL_WGL_DOUBLE_BUFFER,
+ YAGL_WGL_SUPPORT_OPENGL,
+ YAGL_WGL_ACCELERATION,
+ YAGL_WGL_NEED_PALETTE,
+ YAGL_WGL_TRANSPARENT,
+ YAGL_WGL_TRANSPARENT_RED_VALUE,
+ YAGL_WGL_TRANSPARENT_GREEN_VALUE,
+ YAGL_WGL_TRANSPARENT_BLUE_VALUE,
+ YAGL_WGL_COLOR_BITS,
+ YAGL_WGL_RED_BITS,
+ YAGL_WGL_GREEN_BITS,
+ YAGL_WGL_BLUE_BITS,
+ YAGL_WGL_ALPHA_BITS,
+ YAGL_WGL_DEPTH_BITS,
+ YAGL_WGL_STENCIL_BITS,
+ YAGL_WGL_MAX_PBUFFER_PIXELS,
+ YAGL_WGL_MAX_PBUFFER_WIDTH,
+ YAGL_WGL_MAX_PBUFFER_HEIGHT,
+ YAGL_WGL_NUMBER_OVERLAYS,
+ YAGL_WGL_NUMBER_UNDERLAYS,
+ YAGL_WGL_NUM_OF_QUERY_ATTRIBS,
+ };
+
+ const int query_list[YAGL_WGL_NUM_OF_QUERY_ATTRIBS] = {
+ [YAGL_WGL_PIXEL_TYPE] = WGL_PIXEL_TYPE_ARB,
+ [YAGL_WGL_DRAW_TO_PBUFFER] = WGL_DRAW_TO_PBUFFER_ARB,
+ [YAGL_WGL_DOUBLE_BUFFER] = WGL_DOUBLE_BUFFER_ARB,
+ [YAGL_WGL_SUPPORT_OPENGL] = WGL_SUPPORT_OPENGL_ARB,
+ [YAGL_WGL_ACCELERATION] = WGL_ACCELERATION_ARB,
+ [YAGL_WGL_NEED_PALETTE] = WGL_NEED_PALETTE_ARB,
+ [YAGL_WGL_TRANSPARENT] = WGL_TRANSPARENT_ARB,
+ [YAGL_WGL_TRANSPARENT_RED_VALUE] = WGL_TRANSPARENT_RED_VALUE_ARB,
+ [YAGL_WGL_TRANSPARENT_GREEN_VALUE] = WGL_TRANSPARENT_GREEN_VALUE_ARB,
+ [YAGL_WGL_TRANSPARENT_BLUE_VALUE] = WGL_TRANSPARENT_BLUE_VALUE_ARB,
+ [YAGL_WGL_COLOR_BITS] = WGL_COLOR_BITS_ARB,
+ [YAGL_WGL_RED_BITS] = WGL_RED_BITS_ARB,
+ [YAGL_WGL_GREEN_BITS] = WGL_GREEN_BITS_ARB,
+ [YAGL_WGL_BLUE_BITS] = WGL_BLUE_BITS_ARB,
+ [YAGL_WGL_ALPHA_BITS] = WGL_ALPHA_BITS_ARB,
+ [YAGL_WGL_DEPTH_BITS] = WGL_DEPTH_BITS_ARB,
+ [YAGL_WGL_STENCIL_BITS] = WGL_STENCIL_BITS_ARB,
+ [YAGL_WGL_MAX_PBUFFER_PIXELS] = WGL_MAX_PBUFFER_PIXELS_ARB,
+ [YAGL_WGL_MAX_PBUFFER_WIDTH] = WGL_MAX_PBUFFER_WIDTH_ARB,
+ [YAGL_WGL_MAX_PBUFFER_HEIGHT] = WGL_MAX_PBUFFER_HEIGHT_ARB,
+ [YAGL_WGL_NUMBER_OVERLAYS] = WGL_NUMBER_OVERLAYS_ARB,
+ [YAGL_WGL_NUMBER_UNDERLAYS] = WGL_NUMBER_UNDERLAYS_ARB,
+ };
+
+ int attr_vals[YAGL_WGL_NUM_OF_QUERY_ATTRIBS];
+
+ if (egl_wgl->wglGetPixelFormatAttribivARB(dc, fmt_idx, 0,
+ YAGL_WGL_NUM_OF_QUERY_ATTRIBS,
+ query_list, attr_vals) == FALSE) {
+ GetLastError(); /* Clear last error */
+ goto out;
+ }
+
+ if (attr_vals[YAGL_WGL_PIXEL_TYPE] != WGL_TYPE_RGBA_ARB ||
+ attr_vals[YAGL_WGL_DRAW_TO_PBUFFER] != TRUE ||
+ attr_vals[YAGL_WGL_DOUBLE_BUFFER] != TRUE ||
+ attr_vals[YAGL_WGL_SUPPORT_OPENGL] != TRUE ||
+ attr_vals[YAGL_WGL_ACCELERATION] != WGL_FULL_ACCELERATION_ARB ||
+ attr_vals[YAGL_WGL_NEED_PALETTE] != FALSE) {
+ goto out;
+ }
+
+ /* This structure is used as a config driver data to pass it to
+ * ChoosePixelFormat later */
+ pix_fmt = g_try_new0(PIXELFORMATDESCRIPTOR, 1);
+ if (!pix_fmt) {
+ goto out;
+ }
+
+ if (!DescribePixelFormat(dc, fmt_idx,
+ sizeof(PIXELFORMATDESCRIPTOR),
+ pix_fmt)) {
+ GetLastError(); /* Clear last error */
+ g_free(pix_fmt);
+ goto out;
+ }
+
+ yagl_egl_native_config_init(cfg);
+
+ if (attr_vals[YAGL_WGL_TRANSPARENT] == TRUE) {
+ cfg->transparent_type = EGL_TRANSPARENT_RGB;
+ cfg->trans_red_val = attr_vals[YAGL_WGL_TRANSPARENT_RED_VALUE];
+ cfg->trans_green_val = attr_vals[YAGL_WGL_TRANSPARENT_GREEN_VALUE];
+ cfg->trans_blue_val = attr_vals[YAGL_WGL_TRANSPARENT_BLUE_VALUE];
+ } else {
+ cfg->transparent_type = EGL_NONE;
+ }
+
+ cfg->config_id = fmt_idx;
+ cfg->buffer_size = attr_vals[YAGL_WGL_COLOR_BITS];
+ cfg->red_size = attr_vals[YAGL_WGL_RED_BITS];
+ cfg->green_size = attr_vals[YAGL_WGL_GREEN_BITS];
+ cfg->blue_size = attr_vals[YAGL_WGL_BLUE_BITS];
+ cfg->alpha_size = attr_vals[YAGL_WGL_ALPHA_BITS];
+ cfg->depth_size = attr_vals[YAGL_WGL_DEPTH_BITS];
+ cfg->stencil_size = attr_vals[YAGL_WGL_STENCIL_BITS];
+ cfg->max_pbuffer_width = attr_vals[YAGL_WGL_MAX_PBUFFER_WIDTH];
+ cfg->max_pbuffer_height = attr_vals[YAGL_WGL_MAX_PBUFFER_HEIGHT];
+ cfg->max_pbuffer_size = attr_vals[YAGL_WGL_MAX_PBUFFER_PIXELS];
+ cfg->native_visual_type = EGL_NONE;
+ cfg->native_visual_id = 0;
+ cfg->caveat = EGL_NONE;
+ cfg->frame_buffer_level = 0;
+ cfg->samples_per_pixel = 0;
+ cfg->max_swap_interval = 1000;
+ cfg->min_swap_interval = 0;
+ cfg->driver_data = pix_fmt;
+
+ filled = true;
+
+out:
+ return filled;
+}
+
+static struct yagl_egl_native_config
+ *yagl_egl_wgl_config_enum(struct yagl_egl_driver *driver,
+ EGLNativeDisplayType egl_dpy,
+ int *num_configs)
+{
+ YaglEglWglDriver *egl_wgl = (YaglEglWglDriver *)(driver);
+ YaglEglWglDpy *dpy = (YaglEglWglDpy *)egl_dpy;
+ HDC dc;
+ struct yagl_egl_native_config *egl_configs = NULL;
+ UINT pixfmt_cnt = 0;
+ int pixfmt_cnt_max = 0, curr_fmt_idx, cfg_index = 0;
+ int *pixfmt_arr;
+ const int query_num_of_formats = WGL_NUMBER_PIXEL_FORMATS_ARB;
+ const int attrib_list[] = {
+ WGL_SUPPORT_OPENGL_ARB, TRUE,
+ WGL_DOUBLE_BUFFER_ARB, TRUE,
+ WGL_DRAW_TO_PBUFFER_ARB, TRUE,
+ WGL_ACCELERATION_ARB, WGL_FULL_ACCELERATION_ARB,
+ WGL_PIXEL_TYPE_ARB, WGL_TYPE_RGBA_ARB,
+ 0,
+ };
+
+ YAGL_EGL_WGL_ENTER(yagl_egl_wgl_config_enum, "display %p", dpy);
+
+ *num_configs = 0;
+
+ dc = GetDC(egl_wgl->win);
+ if (!dc) {
+ goto out;
+ }
+
+ /* Query number of pixel formats */
+ if (egl_wgl->wglGetPixelFormatAttribivARB(dc, 0, 0, 1,
+ &query_num_of_formats,
+ &pixfmt_cnt_max) == FALSE ||
+ !pixfmt_cnt_max) {
+ YAGL_LOG_ERROR_WIN();
+ pixfmt_cnt_max = DescribePixelFormat(dc, 1, 0, NULL);
+ }
+
+ if (pixfmt_cnt_max == 0) {
+ YAGL_LOG_ERROR_WIN();
+ YAGL_LOG_ERROR("No pixel formats found");
+ goto out;
+ }
+
+ pixfmt_arr = g_try_new0(int, pixfmt_cnt_max);
+ if (!pixfmt_arr) {
+ goto out;
+ }
+
+ if (egl_wgl->wglChoosePixelFormatARB(dc, attrib_list, NULL,
+ pixfmt_cnt_max,
+ pixfmt_arr,
+ &pixfmt_cnt) == FALSE) {
+ YAGL_LOG_ERROR_WIN();
+
+ pixfmt_cnt = pixfmt_cnt_max;
+
+ for (curr_fmt_idx = 0; curr_fmt_idx < pixfmt_cnt; ++curr_fmt_idx) {
+ pixfmt_arr[curr_fmt_idx] = curr_fmt_idx + 1;
+ }
+ }
+
+ YAGL_LOG_DEBUG("got %d pixel formats", pixfmt_cnt);
+
+ egl_configs = g_try_new0(struct yagl_egl_native_config, pixfmt_cnt);
+ if (!egl_configs) {
+ g_free(pixfmt_arr);
+ goto out;
+ }
+
+ for (curr_fmt_idx = 0; curr_fmt_idx < pixfmt_cnt; ++curr_fmt_idx) {
+ if (yagl_egl_wgl_config_fill(egl_wgl, dc,
+ &egl_configs[cfg_index],
+ pixfmt_arr[curr_fmt_idx])) {
+ YAGL_LOG_TRACE("Added config with pixfmt=%d",
+ pixfmt_arr[curr_fmt_idx]);
+ ++cfg_index;
+ }
+ }
+
+ if (cfg_index < pixfmt_cnt) {
+ egl_configs = g_renew(struct yagl_egl_native_config,
+ egl_configs,
+ cfg_index);
+ }
+
+ *num_configs = cfg_index;
+
+ g_free(pixfmt_arr);
+
+out:
+ if (dc) {
+ ReleaseDC(egl_wgl->win, dc);
+ }
+
+ YAGL_LOG_INFO("WGL returned %d configs, %d are usable",
+ pixfmt_cnt, cfg_index);
+
+ YAGL_LOG_FUNC_EXIT("Enumerated %d configs", cfg_index);
+
+ return egl_configs;
+}
+
+static void yagl_egl_wgl_config_cleanup(struct yagl_egl_driver *driver,
+ EGLNativeDisplayType dpy,
+ const struct yagl_egl_native_config *cfg)
+{
+ YAGL_EGL_WGL_ENTER(yagl_egl_wgl_config_cleanup,
+ "dpy = %p, cfg = %d",
+ dpy, cfg->config_id);
+
+ g_free(cfg->driver_data);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+static HDC yagl_egl_wgl_get_dc_by_cfgid(YaglEglWglDpy *dpy,
+ const struct yagl_egl_native_config *cfg)
+{
+ YaglEglWglDC *dc = NULL;
+
+ dc = g_hash_table_lookup(dpy->dc_table, GINT_TO_POINTER(cfg->config_id));
+
+ if (dc) {
+ return dc->dc;
+ }
+
+ dc = g_malloc0(sizeof(*dc));
+
+ dc->win = yagl_egl_wgl_dummy_win_create();
+
+ if (!dc->win) {
+ goto fail;
+ }
+
+ dc->dc = GetDC(dc->win);
+ if (!dc->dc) {
+ goto fail;
+ }
+
+ if (!SetPixelFormat(dc->dc, cfg->config_id,
+ (PIXELFORMATDESCRIPTOR *)cfg->driver_data)) {
+ goto fail;
+ }
+
+ g_hash_table_insert(dpy->dc_table,
+ GINT_TO_POINTER(cfg->config_id),
+ dc);
+
+ return dc->dc;
+
+fail:
+ if (dc) {
+ if (dc->dc) {
+ ReleaseDC(dc->win, dc->dc);
+ }
+ if (dc->win) {
+ DestroyWindow(dc->win);
+ }
+ g_free(dc);
+ }
+
+ return NULL;
+}
+
+static EGLContext yagl_egl_wgl_context_create(struct yagl_egl_driver *driver,
+ EGLNativeDisplayType egl_dpy,
+ const struct yagl_egl_native_config *cfg,
+ EGLContext share_context)
+{
+ YaglEglWglDriver *egl_wgl = (YaglEglWglDriver *)(driver);
+ YaglEglWglDpy *dpy = (YaglEglWglDpy *)egl_dpy;
+ HGLRC egl_wgl_ctx;
+ HDC dc;
+
+ YAGL_EGL_WGL_ENTER(yagl_egl_wgl_context_create,
+ "dpy = %p, share_context = %p, cfgid=%d",
+ dpy, share_context, cfg->config_id);
+
+ dc = yagl_egl_wgl_get_dc_by_cfgid(dpy, cfg);
+ if (!dc) {
+ YAGL_LOG_ERROR("failed to get DC with cfgid=%d", cfg->config_id);
+ goto fail;
+ }
+
+ egl_wgl_ctx = egl_wgl->wglCreateContext(dc);
+ if (!egl_wgl_ctx) {
+ goto fail;
+ }
+
+ if (share_context != EGL_NO_CONTEXT) {
+ if(!egl_wgl->wglShareLists((HGLRC)share_context,
+ egl_wgl_ctx)) {
+ egl_wgl->wglDeleteContext(egl_wgl_ctx);
+ goto fail;
+ }
+ }
+
+ YAGL_LOG_FUNC_EXIT("Context created: %p", egl_wgl_ctx);
+
+ return (EGLContext)egl_wgl_ctx;
+
+fail:
+ YAGL_LOG_ERROR_WIN();
+
+ YAGL_LOG_FUNC_EXIT("Failed to create new context");
+
+ return EGL_NO_CONTEXT;
+}
+
+static bool yagl_egl_wgl_make_current(struct yagl_egl_driver *driver,
+ EGLNativeDisplayType dc,
+ EGLSurface egl_draw_surf,
+ EGLSurface egl_read_surf,
+ EGLContext egl_glc)
+{
+ YaglEglWglDriver *egl_wgl = (YaglEglWglDriver *)(driver);
+ HDC draw_dc = NULL, read_dc = NULL;
+ HGLRC glc = NULL;
+
+ YAGL_EGL_WGL_ENTER(yagl_egl_wgl_make_current,
+ "dpy = %p, draw = %p, read = %p, ctx = %p",
+ dc,
+ egl_draw_surf,
+ egl_read_surf,
+ egl_glc);
+
+ if (egl_glc != EGL_NO_CONTEXT) {
+ glc = (HGLRC)egl_glc;
+ }
+
+ if (egl_draw_surf != EGL_NO_SURFACE) {
+ draw_dc = egl_wgl->wglGetPbufferDCARB((HPBUFFERARB)egl_draw_surf);
+
+ if (!draw_dc) {
+ goto fail;
+ }
+ }
+
+ if (egl_read_surf != EGL_NO_SURFACE) {
+ if (egl_read_surf == egl_draw_surf) {
+ read_dc = draw_dc;
+ } else {
+ read_dc = egl_wgl->wglGetPbufferDCARB((HPBUFFERARB)egl_read_surf);
+
+ if (!read_dc) {
+ goto fail;
+ }
+ }
+ }
+
+ if (egl_wgl->wglMakeContextCurrentARB(draw_dc, read_dc, glc) == FALSE) {
+ goto fail;
+ }
+
+ YAGL_LOG_FUNC_EXIT("context %p was made current", glc);
+
+ return true;
+
+fail:
+ YAGL_LOG_ERROR_WIN();
+
+ if (draw_dc) {
+ egl_wgl->wglReleasePbufferDCARB((HPBUFFERARB)egl_draw_surf, draw_dc);
+ }
+
+ if (read_dc && (egl_read_surf != egl_draw_surf)) {
+ egl_wgl->wglReleasePbufferDCARB((HPBUFFERARB)egl_read_surf, read_dc);
+ }
+
+ YAGL_LOG_FUNC_EXIT("Failed to make context %p current", glc);
+
+ return false;
+}
+
+static void yagl_egl_wgl_context_destroy(struct yagl_egl_driver *driver,
+ EGLNativeDisplayType egl_dpy,
+ EGLContext egl_glc)
+{
+ YaglEglWglDriver *egl_wgl = (YaglEglWglDriver *)(driver);
+
+ YAGL_EGL_WGL_ENTER(yagl_egl_wgl_context_destroy,
+ "dpy = %p, ctx = %p",
+ egl_dpy, egl_glc);
+
+ if (egl_wgl->wglDeleteContext((HGLRC)egl_glc) == FALSE) {
+ YAGL_LOG_ERROR_WIN();
+ }
+
+ YAGL_LOG_FUNC_EXIT("Context destroyed");
+}
+
+static EGLSurface yagl_egl_wgl_pbuffer_surface_create(struct yagl_egl_driver *driver,
+ EGLNativeDisplayType egl_dpy,
+ const struct yagl_egl_native_config *cfg,
+ EGLint width,
+ EGLint height,
+ const struct yagl_egl_pbuffer_attribs *attribs)
+{
+ YaglEglWglDriver *egl_wgl = (YaglEglWglDriver *)(driver);
+ HDC dc = NULL;
+ YaglEglWglDpy * dpy = (YaglEglWglDpy *)egl_dpy;
+ HPBUFFERARB pbuffer;
+ int pbuff_attribs[] = {
+ WGL_PBUFFER_LARGEST_ARB, FALSE,
+ WGL_TEXTURE_TARGET_ARB, WGL_NO_TEXTURE_ARB,
+ WGL_TEXTURE_FORMAT_ARB, WGL_NO_TEXTURE_ARB,
+ 0
+ };
+
+ YAGL_EGL_WGL_ENTER(yagl_egl_wgl_pbuffer_surface_create,
+ "dpy = %p, width = %d, height = %d, cfgid=%d",
+ egl_dpy,
+ width,
+ height,
+ cfg->config_id);
+
+ if (attribs->largest) {
+ pbuff_attribs[1] = TRUE;
+ }
+
+ if (attribs->tex_target == EGL_TEXTURE_2D) {
+ pbuff_attribs[3] = WGL_TEXTURE_2D_ARB;
+ }
+
+ switch (attribs->tex_format) {
+ case EGL_TEXTURE_RGB:
+ pbuff_attribs[5] = WGL_TEXTURE_RGB_ARB;
+ break;
+ case EGL_TEXTURE_RGBA:
+ pbuff_attribs[5] = WGL_TEXTURE_RGBA_ARB;
+ break;
+ }
+
+ dc = yagl_egl_wgl_get_dc_by_cfgid(dpy, cfg);
+ if (!dc) {
+ YAGL_LOG_ERROR("failed to get DC with cfgid=%d", cfg->config_id);
+ goto fail;
+ }
+
+ pbuffer = egl_wgl->wglCreatePbufferARB(dc, cfg->config_id,
+ width, height, pbuff_attribs);
+
+ if (!pbuffer) {
+ goto fail;
+ }
+
+ YAGL_LOG_FUNC_EXIT("Surface created: %p", pbuffer);
+
+ return (EGLSurface)pbuffer;
+
+fail:
+ YAGL_LOG_ERROR_WIN();
+
+ YAGL_LOG_FUNC_EXIT("Surface creation failed");
+
+ return EGL_NO_SURFACE;
+}
+
+static void yagl_egl_wgl_pbuffer_surface_destroy(struct yagl_egl_driver *driver,
+ EGLNativeDisplayType egl_dpy,
+ EGLSurface surf)
+{
+ YaglEglWglDriver *egl_wgl = (YaglEglWglDriver *)(driver);
+ HDC pbuf_dc = NULL;
+
+ YAGL_EGL_WGL_ENTER(yagl_egl_wgl_pbuffer_surface_destroy,
+ "dpy = %p, sfc = %p",
+ egl_dpy,
+ surf);
+
+ pbuf_dc = egl_wgl->wglGetPbufferDCARB((HPBUFFERARB)surf);
+
+ if (!pbuf_dc ||
+ egl_wgl->wglReleasePbufferDCARB((HPBUFFERARB)surf, pbuf_dc) != 1) {
+ YAGL_LOG_ERROR_WIN();
+ }
+
+ if (egl_wgl->wglDestroyPbufferARB((HPBUFFERARB)surf) == FALSE) {
+ YAGL_LOG_ERROR_WIN();
+ YAGL_LOG_FUNC_EXIT("Failed to destroy surface");
+ } else {
+ YAGL_LOG_FUNC_EXIT("Surface destroyed");
+ }
+}
+
+static void yagl_egl_wgl_destroy(struct yagl_egl_driver *driver)
+{
+ YaglEglWglDriver *egl_wgl = (YaglEglWglDriver *)driver;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_wgl_destroy, NULL);
+
+ DestroyWindow(egl_wgl->win);
+
+ UnregisterClassA((LPCTSTR)YAGL_EGL_WGL_WIN_CLASS, NULL);
+
+ yagl_egl_driver_cleanup(driver);
+
+ g_free(egl_wgl);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+/*
+ * Check if extension string 'ext_string' contains extension name 'ext_name'.
+ * Needed because extension name could be a substring of a longer extension
+ * name.
+ */
+static bool yagl_egl_wgl_search_ext(const gchar *ext_string,
+ const gchar *ext_name)
+{
+ const size_t name_len = strlen(ext_name);
+ gchar *ext = g_strstr_len(ext_string, -1, ext_name);
+
+ while (ext) {
+ if (ext[name_len] == '\0' || ext[name_len] == ' ') {
+ break;
+ }
+
+ ext += name_len;
+ ext = g_strstr_len(ext, -1, ext_name);
+ }
+
+ return ext != NULL;
+}
+
+/*
+ * A stub for YaGL window class window procedure callback
+ */
+static LRESULT CALLBACK yagl_egl_wgl_winproc(HWND win, UINT msg, WPARAM wparam,
+ LPARAM lparam)
+{
+ return DefWindowProcA(win, msg, wparam, lparam);
+}
+
+/*
+ * Initialize pointers to WGL extension functions.
+ * Pointers are acquired with wglGetProcAddress() function, which works only
+ * in a presence of a valid openGL context. Pointers returned by
+ * wglGetProcAddress() are themselves context-specific, but we assume that
+ * if two contexts refer to the same GPU, then the function pointers pulled
+ * from one context will work in another.
+ * Note that we only need current context to ACQUIRE function pointers,
+ * we don't need a context to use them.
+ */
+static bool yagl_egl_wgl_init_ext(YaglEglWglDriver *egl_wgl)
+{
+ HWND win;
+ HDC dc = NULL;
+ HGLRC glc = NULL;
+ const char *ext_str = NULL;
+ bool ext_initialized = false;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_wgl_init_ext, NULL);
+
+ win = yagl_egl_wgl_dummy_win_create();
+ if (!win) {
+ goto out;
+ }
+
+ dc = GetDC(win);
+ if (!dc) {
+ goto out;
+ }
+
+ if (!yagl_egl_wgl_dc_set_def_pixfmt(dc)) {
+ goto out;
+ }
+
+ glc = egl_wgl->wglCreateContext(dc);
+ if (!glc) {
+ goto out;
+ }
+
+ if (!egl_wgl->wglMakeCurrent(dc, glc)) {
+ goto out;
+ }
+
+ /* WGL extensions couldn't be queried by glGetString(), we need to use
+ * wglGetExtensionsStringARB or wglGetExtensionsStringEXT for this, which
+ * themselves are extensions */
+ egl_wgl->wglGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)
+ egl_wgl->wglGetProcAddress((LPCSTR)"wglGetExtensionsStringARB");
+ egl_wgl->wglGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)
+ egl_wgl->wglGetProcAddress((LPCSTR)"wglGetExtensionsStringEXT");
+
+ if (egl_wgl->wglGetExtensionsStringARB) {
+ ext_str = egl_wgl->wglGetExtensionsStringARB(dc);
+ } else if (egl_wgl->wglGetExtensionsStringEXT) {
+ ext_str = egl_wgl->wglGetExtensionsStringEXT();
+ }
+
+ if (!ext_str) {
+ YAGL_LOG_ERROR("Couldn't acquire WGL extensions string");
+ goto out;
+ }
+
+ YAGL_LOG_INFO("WGL extensions: %s", ext_str);
+
+ YAGL_EGL_WGL_GET_EXT_PROC(WGL_ARB_pixel_format, wglGetPixelFormatAttribivARB, PFNWGLGETPIXELFORMATATTRIBIVARBPROC);
+ YAGL_EGL_WGL_GET_EXT_PROC(WGL_ARB_pbuffer, wglCreatePbufferARB, PFNWGLCREATEPBUFFERARBPROC);
+ YAGL_EGL_WGL_GET_EXT_PROC(WGL_ARB_pbuffer, wglGetPbufferDCARB, PFNWGLGETPBUFFERDCARBPROC);
+ YAGL_EGL_WGL_GET_EXT_PROC(WGL_ARB_pbuffer, wglReleasePbufferDCARB, PFNWGLRELEASEPBUFFERDCARBPROC);
+ YAGL_EGL_WGL_GET_EXT_PROC(WGL_ARB_pbuffer, wglDestroyPbufferARB, PFNWGLDESTROYPBUFFERARBPROC);
+ YAGL_EGL_WGL_GET_EXT_PROC(WGL_ARB_pixel_format, wglChoosePixelFormatARB, PFNWGLCHOOSEPIXELFORMATARBPROC);
+ YAGL_EGL_WGL_GET_EXT_PROC(WGL_ARB_make_current_read, wglMakeContextCurrentARB, PFNWGLMAKECONTEXTCURRENTARBPROC);
+
+ ext_initialized = true;
+
+out:
+ if (glc) {
+ if (egl_wgl->wglMakeCurrent(NULL, NULL) == FALSE) {
+ YAGL_LOG_ERROR_WIN();
+ }
+
+ if (egl_wgl->wglDeleteContext(glc) == FALSE) {
+ YAGL_LOG_ERROR_WIN();
+ }
+ }
+
+ if (win) {
+ if (dc) {
+ ReleaseDC(win, dc);
+ }
+ DestroyWindow(win);
+ }
+
+ YAGL_LOG_FUNC_EXIT("Extensions initialized status: %u", ext_initialized);
+
+ return ext_initialized;
+}
+
+struct yagl_egl_driver *yagl_egl_driver_create(void *display)
+{
+ YaglEglWglDriver *egl_wgl;
+ struct yagl_egl_driver *egl_driver;
+ WNDCLASSEXA yagl_win_class;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_wgl_create, NULL);
+
+ egl_wgl = g_new0(YaglEglWglDriver, 1);
+
+ egl_driver = &egl_wgl->base;
+
+ yagl_egl_driver_init(egl_driver);
+
+ egl_driver->dyn_lib = yagl_dyn_lib_create();
+
+ if (!yagl_dyn_lib_load(egl_driver->dyn_lib, "opengl32")) {
+ YAGL_LOG_ERROR("Loading opengl32.dll failed with error: %s",
+ yagl_dyn_lib_get_error(egl_driver->dyn_lib));
+ goto fail;
+ }
+
+ yagl_win_class.cbSize = sizeof(WNDCLASSEXA);
+ yagl_win_class.style = 0;
+ yagl_win_class.lpfnWndProc = &yagl_egl_wgl_winproc;
+ yagl_win_class.cbClsExtra = 0;
+ yagl_win_class.cbWndExtra = 0;
+ yagl_win_class.hInstance = NULL;
+ yagl_win_class.hIcon = NULL;
+ yagl_win_class.hCursor = NULL;
+ yagl_win_class.hbrBackground = NULL;
+ yagl_win_class.lpszMenuName = NULL;
+ yagl_win_class.lpszClassName = YAGL_EGL_WGL_WIN_CLASS;
+ yagl_win_class.hIconSm = NULL;
+
+ if (!RegisterClassExA(&yagl_win_class)) {
+ goto fail;
+ }
+
+ egl_wgl->win = yagl_egl_wgl_dummy_win_create();
+
+ if (!egl_wgl->win) {
+ goto fail;
+ }
+
+ YAGL_EGL_WGL_GET_PROC(WGLCREATECONTEXTPROC, wglCreateContext);
+ YAGL_EGL_WGL_GET_PROC(WGLDELETECONTEXTPROC, wglDeleteContext);
+ YAGL_EGL_WGL_GET_PROC(WGLGETPROCADDRESSPROC, wglGetProcAddress);
+ YAGL_EGL_WGL_GET_PROC(WGLMAKECURRENTPROC, wglMakeCurrent);
+ YAGL_EGL_WGL_GET_PROC(WGLSHARELISTSPROC, wglShareLists);
+
+ egl_driver->display_open = &yagl_egl_wgl_display_open;
+ egl_driver->display_close = &yagl_egl_wgl_display_close;
+ egl_driver->config_enum = &yagl_egl_wgl_config_enum;
+ egl_driver->config_cleanup = &yagl_egl_wgl_config_cleanup;
+ egl_driver->pbuffer_surface_create = &yagl_egl_wgl_pbuffer_surface_create;
+ egl_driver->pbuffer_surface_destroy = &yagl_egl_wgl_pbuffer_surface_destroy;
+ egl_driver->context_create = &yagl_egl_wgl_context_create;
+ egl_driver->context_destroy = &yagl_egl_wgl_context_destroy;
+ egl_driver->make_current = &yagl_egl_wgl_make_current;
+ egl_driver->destroy = &yagl_egl_wgl_destroy;
+
+ if (!yagl_egl_wgl_init_ext(egl_wgl)) {
+ goto fail;
+ }
+
+ YAGL_LOG_FUNC_EXIT("EGL WGL driver created (%p)", egl_driver);
+
+ return egl_driver;
+
+fail:
+ yagl_egl_driver_cleanup(egl_driver);
+ g_free(egl_wgl);
+
+ YAGL_LOG_ERROR_WIN();
+
+ YAGL_LOG_FUNC_EXIT("EGL_WGL driver creation failed");
+
+ return NULL;
+}
+
+static void *yagl_egl_wgl_extaddr_get(struct yagl_dyn_lib *dyn_lib,
+ const char *sym)
+{
+ static WGLGETPROCADDRESSPROC wgl_get_procaddr_fn = NULL;
+ static WGLCREATECONTEXTPROC wgl_create_context_fn = NULL;
+ static WGLMAKECURRENTPROC wgl_make_current_fn = NULL;
+ static WGLDELETECONTEXTPROC wgl_delete_context_fn = NULL;
+ void *proc = NULL;
+ HWND win = NULL;
+ HDC dc = NULL;
+ HGLRC glc;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_wgl_extaddr_get, "%s", sym);
+
+ if (!wgl_get_procaddr_fn) {
+ wgl_get_procaddr_fn = (WGLGETPROCADDRESSPROC)
+ yagl_dyn_lib_get_sym(dyn_lib, "wglGetProcAddress");
+ }
+
+ if (!wgl_create_context_fn) {
+ wgl_create_context_fn = (WGLCREATECONTEXTPROC)
+ yagl_dyn_lib_get_sym(dyn_lib, "wglCreateContext");
+ }
+
+ if (!wgl_make_current_fn) {
+ wgl_make_current_fn = (WGLMAKECURRENTPROC)
+ yagl_dyn_lib_get_sym(dyn_lib, "wglMakeCurrent");
+ }
+
+ if (!wgl_delete_context_fn) {
+ wgl_delete_context_fn = (WGLDELETECONTEXTPROC)
+ yagl_dyn_lib_get_sym(dyn_lib, "wglDeleteContext");
+ }
+
+ if (!wgl_get_procaddr_fn || !wgl_create_context_fn ||
+ !wgl_make_current_fn || !wgl_delete_context_fn) {
+ goto out;
+ }
+
+ /* To use wglGetProcAddress, create a temporary openGL context
+ * and make it current */
+
+ win = yagl_egl_wgl_dummy_win_create();
+ if (!win) {
+ goto out;
+ }
+
+ dc = GetDC(win);
+ if (!dc) {
+ goto out;
+ }
+
+ /* We need to set pixel format of dc before we can create GL context */
+ if (!yagl_egl_wgl_dc_set_def_pixfmt(dc)) {
+ goto out;
+ }
+
+ glc = wgl_create_context_fn(dc);
+ if (!glc) {
+ goto out;
+ }
+
+ if (wgl_make_current_fn(dc, glc) == FALSE) {
+ wgl_make_current_fn(NULL, NULL);
+ wgl_delete_context_fn(glc);
+ goto out;
+ }
+
+ proc = (void *)wgl_get_procaddr_fn((LPCSTR)sym);
+
+ if (wgl_make_current_fn(NULL, NULL) == FALSE) {
+ YAGL_LOG_ERROR_WIN();
+ }
+
+ if (wgl_delete_context_fn(glc) == FALSE) {
+ YAGL_LOG_ERROR_WIN();
+ }
+
+out:
+ if (!proc) {
+ YAGL_LOG_ERROR_WIN();
+ }
+
+ if (win) {
+ if (dc) {
+ ReleaseDC(win, dc);
+ }
+ DestroyWindow(win);
+ }
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return proc;
+}
+
+/* GetProcAddress only works for core OpenGL v.1.1 functions, while
+ * wglGetProcAddress will fail for <=v1.1 openGL functions, so we need them
+ * both */
+void *yagl_dyn_lib_get_ogl_procaddr(struct yagl_dyn_lib *dyn_lib,
+ const char *sym)
+{
+ void *proc = NULL;
+
+ YAGL_LOG_FUNC_ENTER(yagl_egl_wgl_get_procaddr,
+ "Retrieving %s address", sym);
+
+ proc = yagl_egl_wgl_extaddr_get(dyn_lib, sym);
+
+ if (!proc) {
+ YAGL_LOG_TRACE("wglGetProcAddress failed for %s, trying GetProcAddress",
+ sym);
+ proc = yagl_dyn_lib_get_sym(dyn_lib, sym);
+ }
+
+ YAGL_LOG_FUNC_EXIT("%s address: %p", sym, proc);
+
+ return proc;
+}
diff --git a/hw/yagl/yagl_drivers/gles_ogl/Makefile.objs b/hw/yagl/yagl_drivers/gles_ogl/Makefile.objs
new file mode 100644
index 0000000000..a4391feb00
--- /dev/null
+++ b/hw/yagl/yagl_drivers/gles_ogl/Makefile.objs
@@ -0,0 +1,2 @@
+# GLES OpenGL driver
+obj-y += yagl_gles_ogl.o
diff --git a/hw/yagl/yagl_drivers/gles_ogl/yagl_gles_ogl.c b/hw/yagl/yagl_drivers/gles_ogl/yagl_gles_ogl.c
new file mode 100644
index 0000000000..dd46369ed7
--- /dev/null
+++ b/hw/yagl/yagl_drivers/gles_ogl/yagl_gles_ogl.c
@@ -0,0 +1,248 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include <GL/gl.h>
+#include "yagl_gles_driver.h"
+#include "yagl_gles_ogl.h"
+#include "yagl_gles_ogl_macros.h"
+#include "yagl_log.h"
+#include "yagl_dyn_lib.h"
+#include "yagl_process.h"
+#include "yagl_thread.h"
+
+static void yagl_gles_ogl_destroy(struct yagl_gles_driver *driver)
+{
+ YAGL_LOG_FUNC_ENTER(yagl_gles_ogl_destroy, NULL);
+
+ yagl_gles_driver_cleanup(driver);
+ g_free(driver);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+struct yagl_gles_driver *yagl_gles_ogl_create(struct yagl_dyn_lib *dyn_lib)
+{
+ struct yagl_gles_driver *driver = NULL;
+
+ YAGL_LOG_FUNC_ENTER(yagl_gles_ogl_create, NULL);
+
+ driver = g_malloc0(sizeof(*driver));
+
+ yagl_gles_driver_init(driver);
+
+ YAGL_GLES_OGL_GET_PROC(driver, DrawArrays, glDrawArrays);
+ YAGL_GLES_OGL_GET_PROC(driver, DrawElements, glDrawElements);
+ YAGL_GLES_OGL_GET_PROC(driver, ReadPixels, glReadPixels);
+ YAGL_GLES_OGL_GET_PROC(driver, DisableVertexAttribArray, glDisableVertexAttribArray);
+ YAGL_GLES_OGL_GET_PROC(driver, EnableVertexAttribArray, glEnableVertexAttribArray);
+ YAGL_GLES_OGL_GET_PROC(driver, VertexAttribPointer, glVertexAttribPointer);
+ YAGL_GLES_OGL_GET_PROC(driver, VertexPointer, glVertexPointer);
+ YAGL_GLES_OGL_GET_PROC(driver, NormalPointer, glNormalPointer);
+ YAGL_GLES_OGL_GET_PROC(driver, ColorPointer, glColorPointer);
+ YAGL_GLES_OGL_GET_PROC(driver, TexCoordPointer, glTexCoordPointer);
+ YAGL_GLES_OGL_GET_PROC(driver, DisableClientState, glDisableClientState);
+ YAGL_GLES_OGL_GET_PROC(driver, EnableClientState, glEnableClientState);
+ YAGL_GLES_OGL_GET_PROC(driver, GenBuffers, glGenBuffers);
+ YAGL_GLES_OGL_GET_PROC(driver, BindBuffer, glBindBuffer);
+ YAGL_GLES_OGL_GET_PROC(driver, BufferData, glBufferData);
+ YAGL_GLES_OGL_GET_PROC(driver, BufferSubData, glBufferSubData);
+ YAGL_GLES_OGL_GET_PROC(driver, DeleteBuffers, glDeleteBuffers);
+ YAGL_GLES_OGL_GET_PROC(driver, GenTextures, glGenTextures);
+ YAGL_GLES_OGL_GET_PROC(driver, BindTexture, glBindTexture);
+ YAGL_GLES_OGL_GET_PROC(driver, DeleteTextures, glDeleteTextures);
+ YAGL_GLES_OGL_GET_PROC(driver, ActiveTexture, glActiveTexture);
+ YAGL_GLES_OGL_GET_PROC(driver, CompressedTexImage2D, glCompressedTexImage2D);
+ YAGL_GLES_OGL_GET_PROC(driver, CompressedTexSubImage2D, glCompressedTexSubImage2D);
+ YAGL_GLES_OGL_GET_PROC(driver, CopyTexImage2D, glCopyTexImage2D);
+ YAGL_GLES_OGL_GET_PROC(driver, CopyTexSubImage2D, glCopyTexSubImage2D);
+ YAGL_GLES_OGL_GET_PROC(driver, GetTexParameterfv, glGetTexParameterfv);
+ YAGL_GLES_OGL_GET_PROC(driver, GetTexParameteriv, glGetTexParameteriv);
+ YAGL_GLES_OGL_GET_PROC(driver, TexImage2D, glTexImage2D);
+ YAGL_GLES_OGL_GET_PROC(driver, TexParameterf, glTexParameterf);
+ YAGL_GLES_OGL_GET_PROC(driver, TexParameterfv, glTexParameterfv);
+ YAGL_GLES_OGL_GET_PROC(driver, TexParameteri, glTexParameteri);
+ YAGL_GLES_OGL_GET_PROC(driver, TexParameteriv, glTexParameteriv);
+ YAGL_GLES_OGL_GET_PROC(driver, TexSubImage2D, glTexSubImage2D);
+ YAGL_GLES_OGL_GET_PROC(driver, ClientActiveTexture, glClientActiveTexture);
+ YAGL_GLES_OGL_GET_PROC(driver, TexEnvi, glTexEnvi);
+ YAGL_GLES_OGL_GET_PROC(driver, TexEnvf, glTexEnvf);
+ YAGL_GLES_OGL_GET_PROC(driver, MultiTexCoord4f, glMultiTexCoord4f);
+ YAGL_GLES_OGL_GET_PROC(driver, TexEnviv, glTexEnviv);
+ YAGL_GLES_OGL_GET_PROC(driver, TexEnvfv, glTexEnvfv);
+ YAGL_GLES_OGL_GET_PROC(driver, GetTexEnviv, glGetTexEnviv);
+ YAGL_GLES_OGL_GET_PROC(driver, GetTexEnvfv, glGetTexEnvfv);
+ YAGL_GLES_OGL_GET_PROC(driver, GenFramebuffers, glGenFramebuffersEXT);
+ YAGL_GLES_OGL_GET_PROC(driver, BindFramebuffer, glBindFramebufferEXT);
+ YAGL_GLES_OGL_GET_PROC(driver, FramebufferTexture2D, glFramebufferTexture2DEXT);
+ YAGL_GLES_OGL_GET_PROC(driver, FramebufferRenderbuffer, glFramebufferRenderbufferEXT);
+ YAGL_GLES_OGL_GET_PROC(driver, DeleteFramebuffers, glDeleteFramebuffersEXT);
+ YAGL_GLES_OGL_GET_PROC(driver, GenRenderbuffers, glGenRenderbuffersEXT);
+ YAGL_GLES_OGL_GET_PROC(driver, BindRenderbuffer, glBindRenderbufferEXT);
+ YAGL_GLES_OGL_GET_PROC(driver, RenderbufferStorage, glRenderbufferStorageEXT);
+ YAGL_GLES_OGL_GET_PROC(driver, DeleteRenderbuffers, glDeleteRenderbuffersEXT);
+ YAGL_GLES_OGL_GET_PROC(driver, GetRenderbufferParameteriv, glGetRenderbufferParameterivEXT);
+ YAGL_GLES_OGL_GET_PROC(driver, CreateProgram, glCreateProgram);
+ YAGL_GLES_OGL_GET_PROC(driver, CreateShader, glCreateShader);
+ YAGL_GLES_OGL_GET_PROC(driver, DeleteProgram, glDeleteProgram);
+ YAGL_GLES_OGL_GET_PROC(driver, DeleteShader, glDeleteShader);
+ YAGL_GLES_OGL_GET_PROC(driver, ShaderSource, glShaderSource);
+ YAGL_GLES_OGL_GET_PROC(driver, AttachShader, glAttachShader);
+ YAGL_GLES_OGL_GET_PROC(driver, DetachShader, glDetachShader);
+ YAGL_GLES_OGL_GET_PROC(driver, CompileShader, glCompileShader);
+ YAGL_GLES_OGL_GET_PROC(driver, BindAttribLocation, glBindAttribLocation);
+ YAGL_GLES_OGL_GET_PROC(driver, GetActiveAttrib, glGetActiveAttrib);
+ YAGL_GLES_OGL_GET_PROC(driver, GetActiveUniform, glGetActiveUniform);
+ YAGL_GLES_OGL_GET_PROC(driver, GetAttribLocation, glGetAttribLocation);
+ YAGL_GLES_OGL_GET_PROC(driver, GetProgramiv, glGetProgramiv);
+ YAGL_GLES_OGL_GET_PROC(driver, GetProgramInfoLog, glGetProgramInfoLog);
+ YAGL_GLES_OGL_GET_PROC(driver, GetShaderiv, glGetShaderiv);
+ YAGL_GLES_OGL_GET_PROC(driver, GetShaderInfoLog, glGetShaderInfoLog);
+ YAGL_GLES_OGL_GET_PROC(driver, GetUniformfv, glGetUniformfv);
+ YAGL_GLES_OGL_GET_PROC(driver, GetUniformiv, glGetUniformiv);
+ YAGL_GLES_OGL_GET_PROC(driver, GetUniformLocation, glGetUniformLocation);
+ YAGL_GLES_OGL_GET_PROC(driver, GetVertexAttribfv, glGetVertexAttribfv);
+ YAGL_GLES_OGL_GET_PROC(driver, GetVertexAttribiv, glGetVertexAttribiv);
+ YAGL_GLES_OGL_GET_PROC(driver, LinkProgram, glLinkProgram);
+ YAGL_GLES_OGL_GET_PROC(driver, Uniform1f, glUniform1f);
+ YAGL_GLES_OGL_GET_PROC(driver, Uniform1fv, glUniform1fv);
+ YAGL_GLES_OGL_GET_PROC(driver, Uniform1i, glUniform1i);
+ YAGL_GLES_OGL_GET_PROC(driver, Uniform1iv, glUniform1iv);
+ YAGL_GLES_OGL_GET_PROC(driver, Uniform2f, glUniform2f);
+ YAGL_GLES_OGL_GET_PROC(driver, Uniform2fv, glUniform2fv);
+ YAGL_GLES_OGL_GET_PROC(driver, Uniform2i, glUniform2i);
+ YAGL_GLES_OGL_GET_PROC(driver, Uniform2iv, glUniform2iv);
+ YAGL_GLES_OGL_GET_PROC(driver, Uniform3f, glUniform3f);
+ YAGL_GLES_OGL_GET_PROC(driver, Uniform3fv, glUniform3fv);
+ YAGL_GLES_OGL_GET_PROC(driver, Uniform3i, glUniform3i);
+ YAGL_GLES_OGL_GET_PROC(driver, Uniform3iv, glUniform3iv);
+ YAGL_GLES_OGL_GET_PROC(driver, Uniform4f, glUniform4f);
+ YAGL_GLES_OGL_GET_PROC(driver, Uniform4fv, glUniform4fv);
+ YAGL_GLES_OGL_GET_PROC(driver, Uniform4i, glUniform4i);
+ YAGL_GLES_OGL_GET_PROC(driver, Uniform4iv, glUniform4iv);
+ YAGL_GLES_OGL_GET_PROC(driver, UniformMatrix2fv, glUniformMatrix2fv);
+ YAGL_GLES_OGL_GET_PROC(driver, UniformMatrix3fv, glUniformMatrix3fv);
+ YAGL_GLES_OGL_GET_PROC(driver, UniformMatrix4fv, glUniformMatrix4fv);
+ YAGL_GLES_OGL_GET_PROC(driver, UseProgram, glUseProgram);
+ YAGL_GLES_OGL_GET_PROC(driver, ValidateProgram, glValidateProgram);
+ YAGL_GLES_OGL_GET_PROC(driver, VertexAttrib1f, glVertexAttrib1f);
+ YAGL_GLES_OGL_GET_PROC(driver, VertexAttrib1fv, glVertexAttrib1fv);
+ YAGL_GLES_OGL_GET_PROC(driver, VertexAttrib2f, glVertexAttrib2f);
+ YAGL_GLES_OGL_GET_PROC(driver, VertexAttrib2fv, glVertexAttrib2fv);
+ YAGL_GLES_OGL_GET_PROC(driver, VertexAttrib3f, glVertexAttrib3f);
+ YAGL_GLES_OGL_GET_PROC(driver, VertexAttrib3fv, glVertexAttrib3fv);
+ YAGL_GLES_OGL_GET_PROC(driver, VertexAttrib4f, glVertexAttrib4f);
+ YAGL_GLES_OGL_GET_PROC(driver, VertexAttrib4fv, glVertexAttrib4fv);
+ YAGL_GLES_OGL_GET_PROC(driver, GetIntegerv, glGetIntegerv);
+ YAGL_GLES_OGL_GET_PROC(driver, GetFloatv, glGetFloatv);
+ YAGL_GLES_OGL_GET_PROC(driver, GetString, glGetString);
+ YAGL_GLES_OGL_GET_PROC(driver, IsEnabled, glIsEnabled);
+ YAGL_GLES_OGL_GET_PROC(driver, BlendEquation, glBlendEquation);
+ YAGL_GLES_OGL_GET_PROC(driver, BlendEquationSeparate, glBlendEquationSeparate);
+ YAGL_GLES_OGL_GET_PROC(driver, BlendFunc, glBlendFunc);
+ YAGL_GLES_OGL_GET_PROC(driver, BlendFuncSeparate, glBlendFuncSeparate);
+ YAGL_GLES_OGL_GET_PROC(driver, BlendColor, glBlendColor);
+ YAGL_GLES_OGL_GET_PROC(driver, Clear, glClear);
+ YAGL_GLES_OGL_GET_PROC(driver, ClearColor, glClearColor);
+ YAGL_GLES_OGL_GET_PROC(driver, ClearDepth, glClearDepth);
+ YAGL_GLES_OGL_GET_PROC(driver, ClearStencil, glClearStencil);
+ YAGL_GLES_OGL_GET_PROC(driver, ColorMask, glColorMask);
+ YAGL_GLES_OGL_GET_PROC(driver, CullFace, glCullFace);
+ YAGL_GLES_OGL_GET_PROC(driver, DepthFunc, glDepthFunc);
+ YAGL_GLES_OGL_GET_PROC(driver, DepthMask, glDepthMask);
+ YAGL_GLES_OGL_GET_PROC(driver, DepthRange, glDepthRange);
+ YAGL_GLES_OGL_GET_PROC(driver, Enable, glEnable);
+ YAGL_GLES_OGL_GET_PROC(driver, Disable, glDisable);
+ YAGL_GLES_OGL_GET_PROC(driver, Flush, glFlush);
+ YAGL_GLES_OGL_GET_PROC(driver, FrontFace, glFrontFace);
+ YAGL_GLES_OGL_GET_PROC(driver, GenerateMipmap, glGenerateMipmapEXT);
+ YAGL_GLES_OGL_GET_PROC(driver, Hint, glHint);
+ YAGL_GLES_OGL_GET_PROC(driver, LineWidth, glLineWidth);
+ YAGL_GLES_OGL_GET_PROC(driver, PixelStorei, glPixelStorei);
+ YAGL_GLES_OGL_GET_PROC(driver, PolygonOffset, glPolygonOffset);
+ YAGL_GLES_OGL_GET_PROC(driver, Scissor, glScissor);
+ YAGL_GLES_OGL_GET_PROC(driver, StencilFunc, glStencilFunc);
+ YAGL_GLES_OGL_GET_PROC(driver, StencilMask, glStencilMask);
+ YAGL_GLES_OGL_GET_PROC(driver, StencilOp, glStencilOp);
+ YAGL_GLES_OGL_GET_PROC(driver, SampleCoverage, glSampleCoverage);
+ YAGL_GLES_OGL_GET_PROC(driver, Viewport, glViewport);
+ 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);
+ YAGL_GLES_OGL_GET_PROC(driver, LoadIdentity, glLoadIdentity);
+ YAGL_GLES_OGL_GET_PROC(driver, PopMatrix, glPopMatrix);
+ YAGL_GLES_OGL_GET_PROC(driver, PushMatrix, glPushMatrix);
+ YAGL_GLES_OGL_GET_PROC(driver, Rotatef, glRotatef);
+ YAGL_GLES_OGL_GET_PROC(driver, Translatef, glTranslatef);
+ YAGL_GLES_OGL_GET_PROC(driver, Scalef, glScalef);
+ YAGL_GLES_OGL_GET_PROC(driver, Ortho, glOrtho);
+ YAGL_GLES_OGL_GET_PROC(driver, Color4f, glColor4f);
+ YAGL_GLES_OGL_GET_PROC(driver, Color4ub, glColor4ub);
+ YAGL_GLES_OGL_GET_PROC(driver, Normal3f, glNormal3f);
+ YAGL_GLES_OGL_GET_PROC(driver, PointParameterf, glPointParameterf);
+ YAGL_GLES_OGL_GET_PROC(driver, PointParameterfv, glPointParameterfv);
+ YAGL_GLES_OGL_GET_PROC(driver, Fogf, glFogf);
+ YAGL_GLES_OGL_GET_PROC(driver, Fogfv, glFogfv);
+ YAGL_GLES_OGL_GET_PROC(driver, Frustum, glFrustum);
+ YAGL_GLES_OGL_GET_PROC(driver, Lightf, glLightf);
+ YAGL_GLES_OGL_GET_PROC(driver, Lightfv, glLightfv);
+ YAGL_GLES_OGL_GET_PROC(driver, GetLightfv, glGetLightfv);
+ YAGL_GLES_OGL_GET_PROC(driver, LightModelf, glLightModelf);
+ YAGL_GLES_OGL_GET_PROC(driver, LightModelfv, glLightModelfv);
+ YAGL_GLES_OGL_GET_PROC(driver, Materialf, glMaterialf);
+ YAGL_GLES_OGL_GET_PROC(driver, Materialfv, glMaterialfv);
+ YAGL_GLES_OGL_GET_PROC(driver, GetMaterialfv, glGetMaterialfv);
+ YAGL_GLES_OGL_GET_PROC(driver, ShadeModel, glShadeModel);
+ YAGL_GLES_OGL_GET_PROC(driver, LogicOp, glLogicOp);
+ YAGL_GLES_OGL_GET_PROC(driver, MultMatrixf, glMultMatrixf);
+ YAGL_GLES_OGL_GET_PROC(driver, LoadMatrixf, glLoadMatrixf);
+ YAGL_GLES_OGL_GET_PROC(driver, ClipPlane, glClipPlane);
+ YAGL_GLES_OGL_GET_PROC(driver, GetClipPlane, glGetClipPlane);
+
+ driver->destroy = &yagl_gles_ogl_destroy;
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return driver;
+
+fail:
+ yagl_gles_driver_cleanup(driver);
+ g_free(driver);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return NULL;
+}
diff --git a/hw/yagl/yagl_drivers/gles_ogl/yagl_gles_ogl.h b/hw/yagl/yagl_drivers/gles_ogl/yagl_gles_ogl.h
new file mode 100644
index 0000000000..3fcec518a0
--- /dev/null
+++ b/hw/yagl/yagl_drivers/gles_ogl/yagl_gles_ogl.h
@@ -0,0 +1,40 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_GLES_OGL_H
+#define _QEMU_YAGL_GLES_OGL_H
+
+#include "yagl_types.h"
+
+struct yagl_gles_driver;
+struct yagl_dyn_lib;
+
+struct yagl_gles_driver *yagl_gles_ogl_create(struct yagl_dyn_lib *dyn_lib);
+
+#endif
diff --git a/hw/yagl/yagl_drivers/gles_ogl/yagl_gles_ogl_macros.h b/hw/yagl/yagl_drivers/gles_ogl/yagl_gles_ogl_macros.h
new file mode 100644
index 0000000000..e6e187864a
--- /dev/null
+++ b/hw/yagl/yagl_drivers/gles_ogl/yagl_gles_ogl_macros.h
@@ -0,0 +1,54 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_GLES_OGL_MACROS_H
+#define _QEMU_YAGL_GLES_OGL_MACROS_H
+
+#include <GL/gl.h>
+
+/*
+ * GLES OpenGL function loading/assigning macros.
+ * @{
+ */
+
+#define YAGL_GLES_OGL_GET_PROC(driver, func, sym) \
+ do { \
+ *(void**)(&driver->func) = yagl_dyn_lib_get_ogl_procaddr(dyn_lib, #sym); \
+ if (!driver->func) { \
+ YAGL_LOG_ERROR("Unable to get symbol: %s", \
+ yagl_dyn_lib_get_error(dyn_lib)); \
+ goto fail; \
+ } \
+ } while (0)
+
+/*
+ * @}
+ */
+
+#endif
diff --git a/hw/yagl/yagl_drivers/gles_onscreen/Makefile.objs b/hw/yagl/yagl_drivers/gles_onscreen/Makefile.objs
new file mode 100644
index 0000000000..5878ee9a7b
--- /dev/null
+++ b/hw/yagl/yagl_drivers/gles_onscreen/Makefile.objs
@@ -0,0 +1,3 @@
+# GLES onscreen driver
+obj-y += yagl_gles_onscreen.o
+
diff --git a/hw/yagl/yagl_drivers/gles_onscreen/yagl_gles_onscreen.c b/hw/yagl/yagl_drivers/gles_onscreen/yagl_gles_onscreen.c
new file mode 100644
index 0000000000..67e48c0e46
--- /dev/null
+++ b/hw/yagl/yagl_drivers/gles_onscreen/yagl_gles_onscreen.c
@@ -0,0 +1,104 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include <GL/gl.h>
+#include "yagl_gles_onscreen.h"
+#include "yagl_gles_driver.h"
+#include "yagl_log.h"
+#include "yagl_tls.h"
+#include "yagl_process.h"
+#include "yagl_thread.h"
+#include "yagl_backends/egl_onscreen/yagl_egl_onscreen_ts.h"
+#include "yagl_backends/egl_onscreen/yagl_egl_onscreen_context.h"
+
+struct yagl_gles_onscreen
+{
+ struct yagl_gles_driver base;
+
+ struct yagl_gles_driver *orig_driver;
+};
+
+YAGL_DECLARE_TLS(struct yagl_egl_onscreen_ts*, egl_onscreen_ts);
+
+static void YAGL_GLES_APIENTRY yagl_gles_onscreen_BindFramebuffer(GLenum target,
+ GLuint framebuffer)
+{
+ if (!egl_onscreen_ts || !egl_onscreen_ts->dpy) {
+ return;
+ }
+
+ assert(framebuffer != egl_onscreen_ts->ctx->fb);
+
+ if (framebuffer == 0) {
+ framebuffer = egl_onscreen_ts->ctx->fb;
+ }
+
+ egl_onscreen_ts->gles_driver->BindFramebuffer(target, framebuffer);
+}
+
+static void yagl_gles_onscreen_destroy(struct yagl_gles_driver *driver)
+{
+ struct yagl_gles_onscreen *gles_onscreen = (struct yagl_gles_onscreen*)driver;
+
+ YAGL_LOG_FUNC_ENTER(yagl_gles_onscreen_destroy, NULL);
+
+ gles_onscreen->orig_driver->destroy(gles_onscreen->orig_driver);
+ gles_onscreen->orig_driver = NULL;
+
+ yagl_gles_driver_cleanup(driver);
+ g_free(gles_onscreen);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+struct yagl_gles_driver
+ *yagl_gles_onscreen_create(struct yagl_gles_driver *orig_driver)
+{
+ struct yagl_gles_onscreen *driver = NULL;
+
+ YAGL_LOG_FUNC_ENTER(yagl_gles_onscreen_create, NULL);
+
+ driver = g_malloc0(sizeof(*driver));
+
+ /*
+ * Just copy over everything, then init our fields.
+ */
+ memcpy(&driver->base, orig_driver, sizeof(*orig_driver));
+ driver->orig_driver = orig_driver;
+
+ yagl_gles_driver_init(&driver->base);
+
+ driver->base.BindFramebuffer = &yagl_gles_onscreen_BindFramebuffer;
+
+ driver->base.destroy = &yagl_gles_onscreen_destroy;
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return &driver->base;
+}
diff --git a/hw/yagl/yagl_drivers/gles_onscreen/yagl_gles_onscreen.h b/hw/yagl/yagl_drivers/gles_onscreen/yagl_gles_onscreen.h
new file mode 100644
index 0000000000..8560d5e205
--- /dev/null
+++ b/hw/yagl/yagl_drivers/gles_onscreen/yagl_gles_onscreen.h
@@ -0,0 +1,43 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_GLES_ONSCREEN_H
+#define _QEMU_YAGL_GLES_ONSCREEN_H
+
+#include "yagl_types.h"
+
+struct yagl_gles_driver;
+
+/*
+ * Takes ownership of 'orig_driver'.
+ */
+struct yagl_gles_driver
+ *yagl_gles_onscreen_create(struct yagl_gles_driver *orig_driver);
+
+#endif
diff --git a/hw/yagl/yagl_dyn_lib.c b/hw/yagl/yagl_dyn_lib.c
new file mode 100644
index 0000000000..caa118dc08
--- /dev/null
+++ b/hw/yagl/yagl_dyn_lib.c
@@ -0,0 +1,152 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "yagl_dyn_lib.h"
+#ifdef _WIN32
+#include <Windows.h>
+#else
+#include <dlfcn.h>
+#endif
+
+#ifdef _WIN32
+typedef HINSTANCE yagl_dyn_lib_handle;
+#else
+typedef void* yagl_dyn_lib_handle;
+#endif
+
+struct yagl_dyn_lib
+{
+ yagl_dyn_lib_handle handle;
+ char *last_error;
+};
+
+struct yagl_dyn_lib *yagl_dyn_lib_create(void)
+{
+ return g_malloc0(sizeof(struct yagl_dyn_lib));
+}
+
+void yagl_dyn_lib_destroy(struct yagl_dyn_lib *dyn_lib)
+{
+ yagl_dyn_lib_unload(dyn_lib);
+ g_free(dyn_lib);
+}
+
+bool yagl_dyn_lib_load(struct yagl_dyn_lib *dyn_lib, const char *name)
+{
+ yagl_dyn_lib_handle handle;
+#ifdef _WIN32
+ handle = LoadLibraryA(name);
+
+ if (!handle) {
+ free(dyn_lib->last_error);
+ dyn_lib->last_error = strdup("Unable to load library"); // TODO: replace with real error message
+ }
+#else
+ handle = dlopen(name, RTLD_NOW | RTLD_GLOBAL);
+
+ if (!handle) {
+ const char *err;
+
+ free(dyn_lib->last_error);
+
+ err = dlerror();
+
+ if (err) {
+ dyn_lib->last_error = strdup(err);
+ } else {
+ dyn_lib->last_error = strdup("Unable to load library");
+ }
+ }
+#endif
+ else {
+ yagl_dyn_lib_unload(dyn_lib);
+ dyn_lib->handle = handle;
+ free(dyn_lib->last_error);
+ dyn_lib->last_error = NULL;
+ }
+
+ return (handle != 0);
+}
+
+void yagl_dyn_lib_unload(struct yagl_dyn_lib *dyn_lib)
+{
+ if (dyn_lib->handle != 0) {
+#ifdef _WIN32
+ FreeLibrary(dyn_lib->handle);
+#else
+ dlclose(dyn_lib->handle);
+#endif
+ dyn_lib->handle = 0;
+ }
+ free(dyn_lib->last_error);
+ dyn_lib->last_error = NULL;
+}
+
+void *yagl_dyn_lib_get_sym(struct yagl_dyn_lib *dyn_lib, const char *sym_name)
+{
+ void *sym = NULL;
+
+ if (!dyn_lib->handle) {
+ free(dyn_lib->last_error);
+ dyn_lib->last_error = strdup("Library not loaded");
+
+ return NULL;
+ }
+
+#ifdef _WIN32
+ sym = GetProcAddress(dyn_lib->handle, sym_name);
+
+ if (!sym) {
+ free(dyn_lib->last_error);
+ dyn_lib->last_error = strdup("Unable to find symbol"); // TODO: replace with real error message
+ }
+#else
+ sym = dlsym(dyn_lib->handle, sym_name);
+
+ if (!sym) {
+ const char *err;
+
+ free(dyn_lib->last_error);
+
+ err = dlerror();
+
+ if (err) {
+ dyn_lib->last_error = strdup(err);
+ } else {
+ dyn_lib->last_error = strdup("Unable to load library");
+ }
+ }
+#endif
+ return sym;
+}
+
+const char *yagl_dyn_lib_get_error(struct yagl_dyn_lib *dyn_lib)
+{
+ return dyn_lib->last_error;
+}
diff --git a/hw/yagl/yagl_dyn_lib.h b/hw/yagl/yagl_dyn_lib.h
new file mode 100644
index 0000000000..e89b072b91
--- /dev/null
+++ b/hw/yagl/yagl_dyn_lib.h
@@ -0,0 +1,52 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_DYN_LIB_H
+#define _QEMU_YAGL_DYN_LIB_H
+
+#include "yagl_types.h"
+
+struct yagl_dyn_lib;
+
+struct yagl_dyn_lib *yagl_dyn_lib_create(void);
+
+void yagl_dyn_lib_destroy(struct yagl_dyn_lib *dyn_lib);
+
+bool yagl_dyn_lib_load(struct yagl_dyn_lib *dyn_lib, const char *name);
+
+void yagl_dyn_lib_unload(struct yagl_dyn_lib *dyn_lib);
+
+void *yagl_dyn_lib_get_sym(struct yagl_dyn_lib *dyn_lib, const char* sym_name);
+
+const char *yagl_dyn_lib_get_error(struct yagl_dyn_lib *dyn_lib);
+
+void *yagl_dyn_lib_get_ogl_procaddr(struct yagl_dyn_lib *dyn_lib,
+ const char *sym_name);
+
+#endif
diff --git a/hw/yagl/yagl_egl_backend.c b/hw/yagl/yagl_egl_backend.c
new file mode 100644
index 0000000000..f849ba4095
--- /dev/null
+++ b/hw/yagl/yagl_egl_backend.c
@@ -0,0 +1,40 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "yagl_egl_backend.h"
+
+void yagl_egl_backend_init(struct yagl_egl_backend *backend,
+ yagl_render_type render_type)
+{
+ backend->render_type = render_type;
+}
+
+void yagl_egl_backend_cleanup(struct yagl_egl_backend *backend)
+{
+}
diff --git a/hw/yagl/yagl_egl_backend.h b/hw/yagl/yagl_egl_backend.h
new file mode 100644
index 0000000000..677735d9be
--- /dev/null
+++ b/hw/yagl/yagl_egl_backend.h
@@ -0,0 +1,92 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_EGL_BACKEND_H
+#define _QEMU_YAGL_EGL_BACKEND_H
+
+#include "yagl_types.h"
+
+struct yagl_eglb_display;
+struct yagl_eglb_context;
+struct yagl_eglb_surface;
+
+/*
+ * YaGL EGL backend.
+ * @{
+ */
+
+struct yagl_egl_backend
+{
+ yagl_render_type render_type;
+
+ void (*thread_init)(struct yagl_egl_backend */*backend*/);
+
+ void (*batch_start)(struct yagl_egl_backend */*backend*/);
+
+ struct yagl_eglb_display *(*create_display)(struct yagl_egl_backend */*backend*/);
+
+ bool (*make_current)(struct yagl_egl_backend */*backend*/,
+ struct yagl_eglb_display */*dpy*/,
+ struct yagl_eglb_context */*ctx*/,
+ struct yagl_eglb_surface */*draw*/,
+ struct yagl_eglb_surface */*read*/);
+
+ bool (*release_current)(struct yagl_egl_backend */*backend*/,
+ bool /*force*/);
+
+ void (*batch_end)(struct yagl_egl_backend */*backend*/);
+
+ void (*thread_fini)(struct yagl_egl_backend */*backend*/);
+
+ /*
+ * Make sure that some GL context is currently active. Can
+ * be called before/after thread_init/thread_fini.
+ * @{
+ */
+
+ void (*ensure_current)(struct yagl_egl_backend */*backend*/);
+
+ void (*unensure_current)(struct yagl_egl_backend */*backend*/);
+
+ /*
+ * @}
+ */
+
+ void (*destroy)(struct yagl_egl_backend */*backend*/);
+};
+
+void yagl_egl_backend_init(struct yagl_egl_backend *backend,
+ yagl_render_type render_type);
+void yagl_egl_backend_cleanup(struct yagl_egl_backend *backend);
+
+/*
+ * @}
+ */
+
+#endif
diff --git a/hw/yagl/yagl_egl_driver.c b/hw/yagl/yagl_egl_driver.c
new file mode 100644
index 0000000000..7bb295b7e2
--- /dev/null
+++ b/hw/yagl/yagl_egl_driver.c
@@ -0,0 +1,42 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "yagl_egl_driver.h"
+
+void yagl_egl_driver_init(struct yagl_egl_driver *driver)
+{
+ driver->dyn_lib = NULL;
+}
+
+void yagl_egl_driver_cleanup(struct yagl_egl_driver *driver)
+{
+ if (driver->dyn_lib) {
+ yagl_dyn_lib_destroy(driver->dyn_lib);
+ }
+}
diff --git a/hw/yagl/yagl_egl_driver.h b/hw/yagl/yagl_egl_driver.h
new file mode 100644
index 0000000000..0deed4081a
--- /dev/null
+++ b/hw/yagl/yagl_egl_driver.h
@@ -0,0 +1,120 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_EGL_DRIVER_H
+#define _QEMU_YAGL_EGL_DRIVER_H
+
+#include "yagl_types.h"
+#include "yagl_dyn_lib.h"
+#include <EGL/egl.h>
+
+struct yagl_egl_native_config;
+struct yagl_egl_pbuffer_attribs;
+
+/*
+ * YaGL EGL driver.
+ * @{
+ */
+
+struct yagl_egl_driver
+{
+ /*
+ * Open/close one and only display.
+ * @{
+ */
+
+ EGLNativeDisplayType (*display_open)(struct yagl_egl_driver */*driver*/);
+ void (*display_close)(struct yagl_egl_driver */*driver*/,
+ EGLNativeDisplayType /*dpy*/);
+
+ /*
+ * @}
+ */
+
+ /*
+ * Returns a list of supported configs, must be freed with 'g_free'
+ * after use. Note that you also must call 'config_cleanup' on each
+ * returned config before freeing to cleanup the driver data in config.
+ *
+ * Configs returned must:
+ * + Support RGBA
+ * + Support at least PBUFFER surface type
+ */
+ struct yagl_egl_native_config *(*config_enum)(struct yagl_egl_driver */*driver*/,
+ EGLNativeDisplayType /*dpy*/,
+ int */*num_configs*/);
+
+ void (*config_cleanup)(struct yagl_egl_driver */*driver*/,
+ EGLNativeDisplayType /*dpy*/,
+ const struct yagl_egl_native_config */*cfg*/);
+
+ EGLSurface (*pbuffer_surface_create)(struct yagl_egl_driver */*driver*/,
+ EGLNativeDisplayType /*dpy*/,
+ const struct yagl_egl_native_config */*cfg*/,
+ EGLint /*width*/,
+ EGLint /*height*/,
+ const struct yagl_egl_pbuffer_attribs */*attribs*/);
+
+ void (*pbuffer_surface_destroy)(struct yagl_egl_driver */*driver*/,
+ EGLNativeDisplayType /*dpy*/,
+ EGLSurface /*sfc*/);
+
+ EGLContext (*context_create)(struct yagl_egl_driver */*driver*/,
+ EGLNativeDisplayType /*dpy*/,
+ const struct yagl_egl_native_config */*cfg*/,
+ EGLContext /*share_context*/);
+
+ void (*context_destroy)(struct yagl_egl_driver */*driver*/,
+ EGLNativeDisplayType /*dpy*/,
+ EGLContext /*ctx*/);
+
+ bool (*make_current)(struct yagl_egl_driver */*driver*/,
+ EGLNativeDisplayType /*dpy*/,
+ EGLSurface /*draw*/,
+ EGLSurface /*read*/,
+ EGLContext /*ctx*/);
+
+ void (*destroy)(struct yagl_egl_driver */*driver*/);
+
+ struct yagl_dyn_lib *dyn_lib;
+};
+
+/*
+ * 'display' is Display* on linux and HWND on windows.
+ */
+struct yagl_egl_driver *yagl_egl_driver_create(void *display);
+
+void yagl_egl_driver_init(struct yagl_egl_driver *driver);
+void yagl_egl_driver_cleanup(struct yagl_egl_driver *driver);
+
+/*
+ * @}
+ */
+
+#endif
diff --git a/hw/yagl/yagl_egl_interface.h b/hw/yagl/yagl_egl_interface.h
new file mode 100644
index 0000000000..bd70110c96
--- /dev/null
+++ b/hw/yagl/yagl_egl_interface.h
@@ -0,0 +1,42 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_EGL_INTERFACE_H
+#define _QEMU_YAGL_EGL_INTERFACE_H
+
+#include "yagl_types.h"
+
+struct yagl_egl_interface
+{
+ void (*ensure_ctx)(struct yagl_egl_interface */*iface*/);
+
+ void (*unensure_ctx)(struct yagl_egl_interface */*iface*/);
+};
+
+#endif
diff --git a/hw/yagl/yagl_egl_native_config.c b/hw/yagl/yagl_egl_native_config.c
new file mode 100644
index 0000000000..83c407acfa
--- /dev/null
+++ b/hw/yagl/yagl_egl_native_config.c
@@ -0,0 +1,50 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "yagl_egl_native_config.h"
+#include "yagl_process.h"
+
+void yagl_egl_native_config_init(struct yagl_egl_native_config *cfg)
+{
+ memset(cfg, 0, sizeof(*cfg));
+
+ cfg->surface_type = EGL_WINDOW_BIT;
+ cfg->caveat = EGL_DONT_CARE;
+ cfg->config_id = EGL_DONT_CARE;
+ cfg->max_swap_interval = EGL_DONT_CARE;
+ cfg->min_swap_interval = EGL_DONT_CARE;
+ cfg->native_visual_type = EGL_DONT_CARE;
+ cfg->transparent_type = EGL_NONE;
+ cfg->trans_red_val = EGL_DONT_CARE;
+ cfg->trans_green_val = EGL_DONT_CARE;
+ cfg->trans_blue_val = EGL_DONT_CARE;
+ cfg->match_format_khr = EGL_DONT_CARE;
+ cfg->bind_to_texture_rgb = EGL_DONT_CARE;
+ cfg->bind_to_texture_rgba = EGL_DONT_CARE;
+}
diff --git a/hw/yagl/yagl_egl_native_config.h b/hw/yagl/yagl_egl_native_config.h
new file mode 100644
index 0000000000..3dd356cbb5
--- /dev/null
+++ b/hw/yagl/yagl_egl_native_config.h
@@ -0,0 +1,86 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_EGL_NATIVE_CONFIG_H
+#define _QEMU_YAGL_EGL_NATIVE_CONFIG_H
+
+#include "yagl_types.h"
+#include <EGL/egl.h>
+
+struct yagl_egl_native_config
+{
+ /*
+ * Filled by the driver.
+ */
+
+ EGLint red_size;
+ EGLint green_size;
+ EGLint blue_size;
+ EGLint alpha_size;
+ EGLint buffer_size;
+ EGLenum caveat;
+ EGLint config_id;
+ EGLint frame_buffer_level;
+ EGLint depth_size;
+ EGLint max_pbuffer_width;
+ EGLint max_pbuffer_height;
+ EGLint max_pbuffer_size;
+ EGLint max_swap_interval;
+ EGLint min_swap_interval;
+ EGLint native_visual_id;
+ EGLint native_visual_type;
+ EGLint samples_per_pixel;
+ EGLint stencil_size;
+ EGLenum transparent_type;
+ EGLint trans_red_val;
+ EGLint trans_green_val;
+ EGLint trans_blue_val;
+
+ void *driver_data;
+
+ /*
+ * Filled automatically by 'yagl_egl_config_xxx'.
+ */
+
+ EGLint surface_type;
+ EGLBoolean native_renderable;
+ EGLint renderable_type;
+ EGLenum conformant;
+ EGLint sample_buffers_num;
+ EGLint match_format_khr;
+ EGLBoolean bind_to_texture_rgb;
+ EGLBoolean bind_to_texture_rgba;
+};
+
+/*
+ * Initialize to default values.
+ */
+void yagl_egl_native_config_init(struct yagl_egl_native_config *cfg);
+
+#endif
diff --git a/hw/yagl/yagl_egl_surface_attribs.c b/hw/yagl/yagl_egl_surface_attribs.c
new file mode 100644
index 0000000000..762aaa8492
--- /dev/null
+++ b/hw/yagl/yagl_egl_surface_attribs.c
@@ -0,0 +1,46 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "yagl_egl_surface_attribs.h"
+
+void yagl_egl_pbuffer_attribs_init(struct yagl_egl_pbuffer_attribs *attribs)
+{
+ attribs->largest = EGL_FALSE;
+ attribs->tex_format = EGL_NO_TEXTURE;
+ attribs->tex_target = EGL_NO_TEXTURE;
+ attribs->tex_mipmap = EGL_FALSE;
+}
+
+void yagl_egl_pixmap_attribs_init(struct yagl_egl_pixmap_attribs *attribs)
+{
+}
+
+void yagl_egl_window_attribs_init(struct yagl_egl_window_attribs *attribs)
+{
+}
diff --git a/hw/yagl/yagl_egl_surface_attribs.h b/hw/yagl/yagl_egl_surface_attribs.h
new file mode 100644
index 0000000000..900e4a4aba
--- /dev/null
+++ b/hw/yagl/yagl_egl_surface_attribs.h
@@ -0,0 +1,67 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_EGL_SURFACE_ATTRIBS_H
+#define _QEMU_YAGL_EGL_SURFACE_ATTRIBS_H
+
+#include "yagl_types.h"
+#include <EGL/egl.h>
+
+struct yagl_egl_pbuffer_attribs
+{
+ EGLint largest;
+ EGLint tex_format;
+ EGLint tex_target;
+ EGLint tex_mipmap;
+};
+
+/*
+ * Initialize to default values.
+ */
+void yagl_egl_pbuffer_attribs_init(struct yagl_egl_pbuffer_attribs *attribs);
+
+struct yagl_egl_pixmap_attribs
+{
+};
+
+/*
+ * Initialize to default values.
+ */
+void yagl_egl_pixmap_attribs_init(struct yagl_egl_pixmap_attribs *attribs);
+
+struct yagl_egl_window_attribs
+{
+};
+
+/*
+ * Initialize to default values.
+ */
+void yagl_egl_window_attribs_init(struct yagl_egl_window_attribs *attribs);
+
+#endif
diff --git a/hw/yagl/yagl_eglb_context.c b/hw/yagl/yagl_eglb_context.c
new file mode 100644
index 0000000000..d773ea1931
--- /dev/null
+++ b/hw/yagl/yagl_eglb_context.c
@@ -0,0 +1,40 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "yagl_eglb_context.h"
+
+void yagl_eglb_context_init(struct yagl_eglb_context *ctx,
+ struct yagl_eglb_display *dpy)
+{
+ ctx->dpy = dpy;
+}
+
+void yagl_eglb_context_cleanup(struct yagl_eglb_context *ctx)
+{
+}
diff --git a/hw/yagl/yagl_eglb_context.h b/hw/yagl/yagl_eglb_context.h
new file mode 100644
index 0000000000..75131c0a28
--- /dev/null
+++ b/hw/yagl/yagl_eglb_context.h
@@ -0,0 +1,48 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_EGLB_CONTEXT_H
+#define _QEMU_YAGL_EGLB_CONTEXT_H
+
+#include "yagl_types.h"
+
+struct yagl_eglb_display;
+
+struct yagl_eglb_context
+{
+ struct yagl_eglb_display *dpy;
+
+ void (*destroy)(struct yagl_eglb_context */*ctx*/);
+};
+
+void yagl_eglb_context_init(struct yagl_eglb_context *ctx,
+ struct yagl_eglb_display *dpy);
+void yagl_eglb_context_cleanup(struct yagl_eglb_context *ctx);
+
+#endif
diff --git a/hw/yagl/yagl_eglb_display.c b/hw/yagl/yagl_eglb_display.c
new file mode 100644
index 0000000000..21bf5abe53
--- /dev/null
+++ b/hw/yagl/yagl_eglb_display.c
@@ -0,0 +1,40 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "yagl_eglb_display.h"
+
+void yagl_eglb_display_init(struct yagl_eglb_display *dpy,
+ struct yagl_egl_backend *backend)
+{
+ dpy->backend = backend;
+}
+
+void yagl_eglb_display_cleanup(struct yagl_eglb_display *dpy)
+{
+}
diff --git a/hw/yagl/yagl_eglb_display.h b/hw/yagl/yagl_eglb_display.h
new file mode 100644
index 0000000000..e73afee369
--- /dev/null
+++ b/hw/yagl/yagl_eglb_display.h
@@ -0,0 +1,96 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_EGLB_DISPLAY_H
+#define _QEMU_YAGL_EGLB_DISPLAY_H
+
+#include "yagl_types.h"
+#include <EGL/egl.h>
+
+struct yagl_egl_backend;
+struct yagl_eglb_context;
+struct yagl_eglb_surface;
+struct yagl_egl_native_config;
+struct yagl_egl_window_attribs;
+struct yagl_egl_pixmap_attribs;
+struct yagl_egl_pbuffer_attribs;
+struct yagl_object;
+
+struct yagl_eglb_display
+{
+ struct yagl_egl_backend *backend;
+
+ struct yagl_egl_native_config *(*config_enum)(struct yagl_eglb_display */*dpy*/,
+ int */*num_configs*/);
+
+ void (*config_cleanup)(struct yagl_eglb_display */*dpy*/,
+ const struct yagl_egl_native_config */*cfg*/);
+
+ struct yagl_eglb_context *(*create_context)(struct yagl_eglb_display */*dpy*/,
+ const struct yagl_egl_native_config */*cfg*/,
+ struct yagl_eglb_context */*share_context*/);
+
+ /*
+ * 'pixels' are locked in target's memory, no page fault possible.
+ */
+ struct yagl_eglb_surface *(*create_offscreen_surface)(struct yagl_eglb_display */*dpy*/,
+ const struct yagl_egl_native_config */*cfg*/,
+ EGLenum /*type*/,
+ const void */*attribs*/,
+ uint32_t /*width*/,
+ uint32_t /*height*/,
+ uint32_t /*bpp*/,
+ target_ulong /*pixels*/);
+
+ struct yagl_eglb_surface *(*create_onscreen_window_surface)(struct yagl_eglb_display */*dpy*/,
+ const struct yagl_egl_native_config */*cfg*/,
+ const struct yagl_egl_window_attribs */*attribs*/,
+ yagl_winsys_id /*id*/);
+
+ struct yagl_eglb_surface *(*create_onscreen_pixmap_surface)(struct yagl_eglb_display */*dpy*/,
+ const struct yagl_egl_native_config */*cfg*/,
+ const struct yagl_egl_pixmap_attribs */*attribs*/,
+ yagl_winsys_id /*id*/);
+
+ struct yagl_eglb_surface *(*create_onscreen_pbuffer_surface)(struct yagl_eglb_display */*dpy*/,
+ const struct yagl_egl_native_config */*cfg*/,
+ const struct yagl_egl_pbuffer_attribs */*attribs*/,
+ yagl_winsys_id /*id*/);
+
+ struct yagl_object *(*create_image)(struct yagl_eglb_display */*dpy*/,
+ yagl_winsys_id /*buffer*/);
+
+ void (*destroy)(struct yagl_eglb_display */*dpy*/);
+};
+
+void yagl_eglb_display_init(struct yagl_eglb_display *dpy,
+ struct yagl_egl_backend *backend);
+void yagl_eglb_display_cleanup(struct yagl_eglb_display *dpy);
+
+#endif
diff --git a/hw/yagl/yagl_eglb_surface.c b/hw/yagl/yagl_eglb_surface.c
new file mode 100644
index 0000000000..bdecdcec0d
--- /dev/null
+++ b/hw/yagl/yagl_eglb_surface.c
@@ -0,0 +1,58 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "yagl_eglb_surface.h"
+
+void yagl_eglb_surface_init(struct yagl_eglb_surface *sfc,
+ struct yagl_eglb_display *dpy,
+ EGLenum type,
+ const void *attribs)
+{
+ sfc->dpy = dpy;
+ sfc->type = type;
+
+ switch (sfc->type) {
+ case EGL_PBUFFER_BIT:
+ memcpy(&sfc->attribs.pbuffer, attribs, sizeof(sfc->attribs.pbuffer));
+ break;
+ case EGL_PIXMAP_BIT:
+ memcpy(&sfc->attribs.pixmap, attribs, sizeof(sfc->attribs.pixmap));
+ break;
+ case EGL_WINDOW_BIT:
+ memcpy(&sfc->attribs.window, attribs, sizeof(sfc->attribs.window));
+ break;
+ default:
+ assert(0);
+ memset(&sfc->attribs, 0, sizeof(sfc->attribs));
+ }
+}
+
+void yagl_eglb_surface_cleanup(struct yagl_eglb_surface *sfc)
+{
+}
diff --git a/hw/yagl/yagl_eglb_surface.h b/hw/yagl/yagl_eglb_surface.h
new file mode 100644
index 0000000000..fa9de86677
--- /dev/null
+++ b/hw/yagl/yagl_eglb_surface.h
@@ -0,0 +1,89 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_EGLB_SURFACE_H
+#define _QEMU_YAGL_EGLB_SURFACE_H
+
+#include "yagl_types.h"
+#include "yagl_egl_surface_attribs.h"
+#include <EGL/egl.h>
+
+struct yagl_eglb_display;
+
+struct yagl_eglb_surface
+{
+ struct yagl_eglb_display *dpy;
+
+ EGLenum type;
+
+ union
+ {
+ struct yagl_egl_window_attribs window;
+ struct yagl_egl_pixmap_attribs pixmap;
+ struct yagl_egl_pbuffer_attribs pbuffer;
+ } attribs;
+
+ /*
+ * Surface has been invalidated on target, update it
+ * from 'id'.
+ */
+ void (*invalidate)(struct yagl_eglb_surface */*sfc*/,
+ yagl_winsys_id /*id*/);
+
+ /*
+ * Replaces 'sfc' with 'with', destroying 'with' afterwards.
+ * 'sfc' and 'with' must be of same type, but can have
+ * different formats.
+ */
+ void (*replace)(struct yagl_eglb_surface */*sfc*/,
+ struct yagl_eglb_surface */*with*/);
+
+ /*
+ * Can be called for surfaces that were reset.
+ */
+ bool (*query)(struct yagl_eglb_surface */*sfc*/,
+ EGLint /*attribute*/,
+ EGLint */*value*/);
+
+ bool (*swap_buffers)(struct yagl_eglb_surface */*sfc*/);
+
+ bool (*copy_buffers)(struct yagl_eglb_surface */*sfc*/);
+
+ void (*wait_gl)(struct yagl_eglb_surface */*sfc*/);
+
+ void (*destroy)(struct yagl_eglb_surface */*sfc*/);
+};
+
+void yagl_eglb_surface_init(struct yagl_eglb_surface *sfc,
+ struct yagl_eglb_display *dpy,
+ EGLenum type,
+ const void *attribs);
+void yagl_eglb_surface_cleanup(struct yagl_eglb_surface *sfc);
+
+#endif
diff --git a/hw/yagl/yagl_event.c b/hw/yagl/yagl_event.c
new file mode 100644
index 0000000000..546bddfa58
--- /dev/null
+++ b/hw/yagl/yagl_event.c
@@ -0,0 +1,93 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "yagl_event.h"
+#include <assert.h>
+
+void yagl_event_init(struct yagl_event *event,
+ bool manual_reset,
+ bool initial_state)
+{
+ assert(event);
+
+ memset(event, 0, sizeof(*event));
+
+ event->manual_reset = manual_reset;
+ event->state = initial_state;
+ qemu_mutex_init(&event->mutex);
+ qemu_cond_init(&event->cond);
+}
+
+void yagl_event_cleanup(struct yagl_event *event)
+{
+ assert(event);
+
+ qemu_cond_destroy(&event->cond);
+ qemu_mutex_destroy(&event->mutex);
+}
+
+void yagl_event_set(struct yagl_event *event)
+{
+ assert(event);
+ qemu_mutex_lock(&event->mutex);
+ event->state = true;
+ qemu_cond_broadcast(&event->cond);
+ qemu_mutex_unlock(&event->mutex);
+}
+
+void yagl_event_reset(struct yagl_event *event)
+{
+ assert(event);
+ qemu_mutex_lock(&event->mutex);
+ event->state = false;
+ qemu_mutex_unlock(&event->mutex);
+}
+
+void yagl_event_wait(struct yagl_event *event)
+{
+ assert(event);
+ qemu_mutex_lock(&event->mutex);
+ while (!event->state) {
+ qemu_cond_wait(&event->cond, &event->mutex);
+ }
+ if (!event->manual_reset) {
+ event->state = false;
+ }
+ qemu_mutex_unlock(&event->mutex);
+}
+
+bool yagl_event_is_set(struct yagl_event *event)
+{
+ bool ret;
+ assert(event);
+ qemu_mutex_lock(&event->mutex);
+ ret = event->state;
+ qemu_mutex_unlock(&event->mutex);
+ return ret;
+}
diff --git a/hw/yagl/yagl_event.h b/hw/yagl/yagl_event.h
new file mode 100644
index 0000000000..ac85d28364
--- /dev/null
+++ b/hw/yagl/yagl_event.h
@@ -0,0 +1,58 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_EVENT_H
+#define _QEMU_YAGL_EVENT_H
+
+#include "yagl_types.h"
+#include "qemu/thread.h"
+
+struct yagl_event
+{
+ bool manual_reset;
+ volatile bool state;
+ QemuMutex mutex;
+ QemuCond cond;
+};
+
+void yagl_event_init(struct yagl_event *event,
+ bool manual_reset,
+ bool initial_state);
+
+void yagl_event_cleanup(struct yagl_event *event);
+
+void yagl_event_set(struct yagl_event *event);
+
+void yagl_event_reset(struct yagl_event *event);
+
+void yagl_event_wait(struct yagl_event *event);
+
+bool yagl_event_is_set(struct yagl_event *event);
+
+#endif
diff --git a/hw/yagl/yagl_gles_driver.c b/hw/yagl/yagl_gles_driver.c
new file mode 100644
index 0000000000..049c648642
--- /dev/null
+++ b/hw/yagl/yagl_gles_driver.c
@@ -0,0 +1,54 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include <GL/gl.h>
+#include "yagl_gles_driver.h"
+#include "yagl_thread.h"
+#include "yagl_process.h"
+#include "yagl_egl_interface.h"
+
+void yagl_gles_driver_init(struct yagl_gles_driver *driver)
+{
+}
+
+void yagl_gles_driver_cleanup(struct yagl_gles_driver *driver)
+{
+}
+
+void yagl_ensure_ctx(void)
+{
+ assert(cur_ts);
+ cur_ts->ps->egl_iface->ensure_ctx(cur_ts->ps->egl_iface);
+}
+
+void yagl_unensure_ctx(void)
+{
+ assert(cur_ts);
+ cur_ts->ps->egl_iface->unensure_ctx(cur_ts->ps->egl_iface);
+}
diff --git a/hw/yagl/yagl_gles_driver.h b/hw/yagl/yagl_gles_driver.h
new file mode 100644
index 0000000000..434ac19d20
--- /dev/null
+++ b/hw/yagl/yagl_gles_driver.h
@@ -0,0 +1,300 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_GLES_DRIVER_H
+#define _QEMU_YAGL_GLES_DRIVER_H
+
+#include "yagl_types.h"
+
+#ifdef GL_APIENTRY
+#define YAGL_GLES_APIENTRY GL_APIENTRY
+#else
+#define YAGL_GLES_APIENTRY GLAPIENTRY
+#endif
+
+#define YAGL_GLES_DRIVER_FUNC0(func) \
+void (YAGL_GLES_APIENTRY *func)(void);
+
+#define YAGL_GLES_DRIVER_FUNC_RET0(ret_type, func) \
+ret_type (YAGL_GLES_APIENTRY *func)(void);
+
+#define YAGL_GLES_DRIVER_FUNC1(func, arg0_type, arg0) \
+void (YAGL_GLES_APIENTRY *func)(arg0_type arg0);
+
+#define YAGL_GLES_DRIVER_FUNC_RET1(ret_type, func, arg0_type, arg0) \
+ret_type (YAGL_GLES_APIENTRY *func)(arg0_type arg0);
+
+#define YAGL_GLES_DRIVER_FUNC2(func, arg0_type, arg1_type, arg0, arg1) \
+void (YAGL_GLES_APIENTRY *func)(arg0_type arg0, arg1_type arg1);
+
+#define YAGL_GLES_DRIVER_FUNC_RET2(ret_type, func, arg0_type, arg1_type, arg0, arg1) \
+ret_type (YAGL_GLES_APIENTRY *func)(arg0_type arg0, arg1_type arg1);
+
+#define YAGL_GLES_DRIVER_FUNC3(func, arg0_type, arg1_type, arg2_type, arg0, arg1, arg2) \
+void (YAGL_GLES_APIENTRY *func)(arg0_type arg0, arg1_type arg1, arg2_type arg2);
+
+#define YAGL_GLES_DRIVER_FUNC4(func, arg0_type, arg1_type, arg2_type, arg3_type, arg0, arg1, arg2, arg3) \
+void (YAGL_GLES_APIENTRY *func)(arg0_type arg0, arg1_type arg1, arg2_type arg2, arg3_type arg3);
+
+#define YAGL_GLES_DRIVER_FUNC5(func, arg0_type, arg1_type, arg2_type, arg3_type, arg4_type, arg0, arg1, arg2, arg3, arg4) \
+void (YAGL_GLES_APIENTRY *func)(arg0_type arg0, arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4);
+
+#define YAGL_GLES_DRIVER_FUNC6(func, arg0_type, arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg0, arg1, arg2, arg3, arg4, arg5) \
+void (YAGL_GLES_APIENTRY *func)(arg0_type arg0, arg1_type arg1, arg2_type arg2, arg3_type arg3, \
+ arg4_type arg4, arg5_type arg5);
+
+#define YAGL_GLES_DRIVER_FUNC7(func, arg0_type, arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg0, arg1, arg2, arg3, arg4, arg5, arg6) \
+void (YAGL_GLES_APIENTRY *func)(arg0_type arg0, arg1_type arg1, arg2_type arg2, arg3_type arg3, \
+ arg4_type arg4, arg5_type arg5, arg6_type arg6);
+
+#define YAGL_GLES_DRIVER_FUNC8(func, arg0_type, arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
+void (YAGL_GLES_APIENTRY *func)(arg0_type arg0, arg1_type arg1, arg2_type arg2, arg3_type arg3, \
+ arg4_type arg4, arg5_type arg5, arg6_type arg6, arg7_type arg7);
+
+#define YAGL_GLES_DRIVER_FUNC9(func, arg0_type, arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, arg8_type, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \
+void (YAGL_GLES_APIENTRY *func)(arg0_type arg0, arg1_type arg1, arg2_type arg2, arg3_type arg3, \
+ arg4_type arg4, arg5_type arg5, arg6_type arg6, arg7_type arg7, \
+ arg8_type arg8);
+
+#define YAGL_GLES_DRIVER_FUNC10(func, arg0_type, arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, arg8_type, arg9_type, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) \
+void (YAGL_GLES_APIENTRY *func)(arg0_type arg0, arg1_type arg1, arg2_type arg2, arg3_type arg3, \
+ arg4_type arg4, arg5_type arg5, arg6_type arg6, arg7_type arg7, \
+ arg8_type arg8, arg9_type arg9);
+
+/* We need this because we can't include <GL/gl.h> (which has GLdouble
+ * definition) and <GLES/gl.h> (which has GLfixed definition) simultaneously */
+typedef double yagl_GLdouble;
+
+/*
+ * YaGL GLES driver.
+ * @{
+ */
+
+struct yagl_gles_driver
+{
+ 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)
+ YAGL_GLES_DRIVER_FUNC1(DisableVertexAttribArray, GLuint, index)
+ YAGL_GLES_DRIVER_FUNC1(EnableVertexAttribArray, GLuint, index)
+ YAGL_GLES_DRIVER_FUNC6(VertexAttribPointer, GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid*, indx, size, type, normalized, stride, ptr)
+ YAGL_GLES_DRIVER_FUNC4(VertexPointer, GLint, GLenum, GLsizei, const GLvoid*, size, type, stride, pointer)
+ YAGL_GLES_DRIVER_FUNC3(NormalPointer, GLenum, GLsizei, const GLvoid*, type, stride, pointer)
+ YAGL_GLES_DRIVER_FUNC4(ColorPointer, GLint, GLenum, GLsizei, const GLvoid*, size, type, stride, pointer)
+ YAGL_GLES_DRIVER_FUNC4(TexCoordPointer, GLint, GLenum, GLsizei, const GLvoid*, size, type, stride, pointer)
+ YAGL_GLES_DRIVER_FUNC1(DisableClientState, GLenum, array)
+ YAGL_GLES_DRIVER_FUNC1(EnableClientState, GLenum, array)
+ YAGL_GLES_DRIVER_FUNC2(GenBuffers, GLsizei, GLuint*, n, buffers)
+ YAGL_GLES_DRIVER_FUNC2(BindBuffer, GLenum, GLuint, target, buffer)
+ YAGL_GLES_DRIVER_FUNC4(BufferData, GLenum, GLsizeiptr, const GLvoid*, GLenum, target, size, data, usage)
+ YAGL_GLES_DRIVER_FUNC4(BufferSubData, GLenum, GLintptr, GLsizeiptr, const GLvoid*, target, offset, size, data)
+ YAGL_GLES_DRIVER_FUNC2(DeleteBuffers, GLsizei, const GLuint*, n, buffers)
+ YAGL_GLES_DRIVER_FUNC2(GenTextures, GLsizei, GLuint*, n, textures)
+ YAGL_GLES_DRIVER_FUNC2(BindTexture, GLenum, GLuint, target, texture)
+ YAGL_GLES_DRIVER_FUNC2(DeleteTextures, GLsizei, const GLuint*, n, textures)
+ YAGL_GLES_DRIVER_FUNC1(ActiveTexture, GLenum, texture)
+ YAGL_GLES_DRIVER_FUNC8(CompressedTexImage2D, GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid*, target, level, internalformat, width, height, border, imageSize, data)
+ YAGL_GLES_DRIVER_FUNC9(CompressedTexSubImage2D, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid*, target, level, xoffset, yoffset, width, height, format, imageSize, data)
+ YAGL_GLES_DRIVER_FUNC8(CopyTexImage2D, GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint, target, level, internalformat, x, y, width, height, border)
+ YAGL_GLES_DRIVER_FUNC8(CopyTexSubImage2D, GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, target, level, xoffset, yoffset, x, y, width, height)
+ YAGL_GLES_DRIVER_FUNC3(GetTexParameterfv, GLenum, GLenum, GLfloat*, target, pname, params)
+ YAGL_GLES_DRIVER_FUNC3(GetTexParameteriv, GLenum, GLenum, GLint*, target, pname, params)
+ YAGL_GLES_DRIVER_FUNC9(TexImage2D, GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid*, target, level, internalformat, width, height, border, format, type, pixels)
+ YAGL_GLES_DRIVER_FUNC3(TexParameterf, GLenum, GLenum, GLfloat, target, pname, param)
+ YAGL_GLES_DRIVER_FUNC3(TexParameterfv, GLenum, GLenum, const GLfloat*, target, pname, params)
+ YAGL_GLES_DRIVER_FUNC3(TexParameteri, GLenum, GLenum, GLint, target, pname, param)
+ YAGL_GLES_DRIVER_FUNC3(TexParameteriv, GLenum, GLenum, const GLint*, target, pname, params)
+ YAGL_GLES_DRIVER_FUNC9(TexSubImage2D, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid*, target, level, xoffset, yoffset, width, height, format, type, pixels)
+ YAGL_GLES_DRIVER_FUNC1(ClientActiveTexture, GLenum, texture)
+ YAGL_GLES_DRIVER_FUNC3(TexEnvi, GLenum, GLenum, GLint, target, pname, param)
+ YAGL_GLES_DRIVER_FUNC3(TexEnvf, GLenum, GLenum, GLfloat, target, pname, param)
+ YAGL_GLES_DRIVER_FUNC5(MultiTexCoord4f, GLenum, GLfloat, GLfloat, GLfloat, GLfloat, target, s, t, r, q)
+ YAGL_GLES_DRIVER_FUNC3(TexEnviv, GLenum, GLenum, const GLint*, target, pname, params)
+ YAGL_GLES_DRIVER_FUNC3(TexEnvfv, GLenum, GLenum, const GLfloat*, target, pname, params)
+ YAGL_GLES_DRIVER_FUNC3(GetTexEnviv, GLenum, GLenum, GLint*, env, pname, params)
+ YAGL_GLES_DRIVER_FUNC3(GetTexEnvfv, GLenum, GLenum, GLfloat*, env, pname, params)
+ YAGL_GLES_DRIVER_FUNC2(GenFramebuffers, GLsizei, GLuint*, n, framebuffers)
+ YAGL_GLES_DRIVER_FUNC2(BindFramebuffer, GLenum, GLuint, target, framebuffer)
+ YAGL_GLES_DRIVER_FUNC5(FramebufferTexture2D, GLenum, GLenum, GLenum, GLuint, GLint, target, attachment, textarget, texture, level)
+ YAGL_GLES_DRIVER_FUNC4(FramebufferRenderbuffer, GLenum, GLenum, GLenum, GLuint, target, attachment, renderbuffertarget, renderbuffer)
+ YAGL_GLES_DRIVER_FUNC2(DeleteFramebuffers, GLsizei, const GLuint*, n, framebuffers)
+ YAGL_GLES_DRIVER_FUNC2(GenRenderbuffers, GLsizei, GLuint*, n, renderbuffers)
+ YAGL_GLES_DRIVER_FUNC2(BindRenderbuffer, GLenum, GLuint, target, renderbuffer)
+ YAGL_GLES_DRIVER_FUNC4(RenderbufferStorage, GLenum, GLenum, GLsizei, GLsizei, target, internalformat, width, height)
+ YAGL_GLES_DRIVER_FUNC2(DeleteRenderbuffers, GLsizei, const GLuint*, n, renderbuffers)
+ YAGL_GLES_DRIVER_FUNC3(GetRenderbufferParameteriv, GLenum, GLenum, GLint*, target, pname, params);
+ YAGL_GLES_DRIVER_FUNC_RET0(GLuint, CreateProgram)
+ YAGL_GLES_DRIVER_FUNC_RET1(GLuint, CreateShader, GLenum, type)
+ YAGL_GLES_DRIVER_FUNC1(DeleteProgram, GLuint, program)
+ YAGL_GLES_DRIVER_FUNC1(DeleteShader, GLuint, shader)
+ YAGL_GLES_DRIVER_FUNC4(ShaderSource, GLuint, GLsizei, const GLchar**, const GLint*, shader, count, string, length)
+ YAGL_GLES_DRIVER_FUNC2(AttachShader, GLuint, GLuint, program, shader)
+ YAGL_GLES_DRIVER_FUNC2(DetachShader, GLuint, GLuint, program, shader)
+ YAGL_GLES_DRIVER_FUNC1(CompileShader, GLuint, shader)
+ YAGL_GLES_DRIVER_FUNC3(BindAttribLocation, GLuint, GLuint, const GLchar*, program, index, name)
+ YAGL_GLES_DRIVER_FUNC7(GetActiveAttrib, GLuint, GLuint, GLsizei, GLsizei*, GLint*, GLenum*, GLchar*, program, index, bufsize, length, size, type, name)
+ YAGL_GLES_DRIVER_FUNC7(GetActiveUniform, GLuint, GLuint, GLsizei, GLsizei*, GLint*, GLenum*, GLchar*, program, index, bufsize, length, size, type, name)
+ YAGL_GLES_DRIVER_FUNC_RET2(int, GetAttribLocation, GLuint, const GLchar*, program, name)
+ YAGL_GLES_DRIVER_FUNC3(GetProgramiv, GLuint, GLenum, GLint*, program, pname, params)
+ YAGL_GLES_DRIVER_FUNC4(GetProgramInfoLog, GLuint, GLsizei, GLsizei*, GLchar*, program, bufsize, length, infolog)
+ YAGL_GLES_DRIVER_FUNC3(GetShaderiv, GLuint, GLenum, GLint*, shader, pname, params)
+ YAGL_GLES_DRIVER_FUNC4(GetShaderInfoLog, GLuint, GLsizei, GLsizei*, GLchar*, shader, bufsize, length, infolog)
+ YAGL_GLES_DRIVER_FUNC3(GetUniformfv, GLuint, GLint, GLfloat*, program, location, params)
+ YAGL_GLES_DRIVER_FUNC3(GetUniformiv, GLuint, GLint, GLint*, program, location, params)
+ YAGL_GLES_DRIVER_FUNC_RET2(int, GetUniformLocation, GLuint, const GLchar*, program, name)
+ YAGL_GLES_DRIVER_FUNC3(GetVertexAttribfv, GLuint, GLenum, GLfloat*, index, pname, params)
+ YAGL_GLES_DRIVER_FUNC3(GetVertexAttribiv, GLuint, GLenum, GLint*, index, pname, params)
+ YAGL_GLES_DRIVER_FUNC1(LinkProgram, GLuint, program)
+ YAGL_GLES_DRIVER_FUNC2(Uniform1f, GLint, GLfloat, location, x)
+ YAGL_GLES_DRIVER_FUNC3(Uniform1fv, GLint, GLsizei, const GLfloat*, location, count, v)
+ YAGL_GLES_DRIVER_FUNC2(Uniform1i, GLint, GLint, location, x)
+ YAGL_GLES_DRIVER_FUNC3(Uniform1iv, GLint, GLsizei, const GLint*, location, count, v)
+ YAGL_GLES_DRIVER_FUNC3(Uniform2f, GLint, GLfloat, GLfloat, location, x, y)
+ YAGL_GLES_DRIVER_FUNC3(Uniform2fv, GLint, GLsizei, const GLfloat*, location, count, v)
+ YAGL_GLES_DRIVER_FUNC3(Uniform2i, GLint, GLint, GLint, location, x, y)
+ YAGL_GLES_DRIVER_FUNC3(Uniform2iv, GLint, GLsizei, const GLint*, location, count, v)
+ YAGL_GLES_DRIVER_FUNC4(Uniform3f, GLint, GLfloat, GLfloat, GLfloat, location, x, y, z)
+ YAGL_GLES_DRIVER_FUNC3(Uniform3fv, GLint, GLsizei, const GLfloat*, location, count, v)
+ YAGL_GLES_DRIVER_FUNC4(Uniform3i, GLint, GLint, GLint, GLint, location, x, y, z)
+ YAGL_GLES_DRIVER_FUNC3(Uniform3iv, GLint, GLsizei, const GLint*, location, count, v)
+ YAGL_GLES_DRIVER_FUNC5(Uniform4f, GLint, GLfloat, GLfloat, GLfloat, GLfloat, location, x, y, z, w)
+ YAGL_GLES_DRIVER_FUNC3(Uniform4fv, GLint, GLsizei, const GLfloat*, location, count, v)
+ YAGL_GLES_DRIVER_FUNC5(Uniform4i, GLint, GLint, GLint, GLint, GLint, location, x, y, z, w)
+ YAGL_GLES_DRIVER_FUNC3(Uniform4iv, GLint, GLsizei, const GLint*, location, count, v)
+ YAGL_GLES_DRIVER_FUNC4(UniformMatrix2fv, GLint, GLsizei, GLboolean, const GLfloat*, location, count, transpose, value)
+ YAGL_GLES_DRIVER_FUNC4(UniformMatrix3fv, GLint, GLsizei, GLboolean, const GLfloat*, location, count, transpose, value)
+ YAGL_GLES_DRIVER_FUNC4(UniformMatrix4fv, GLint, GLsizei, GLboolean, const GLfloat*, location, count, transpose, value)
+ YAGL_GLES_DRIVER_FUNC1(UseProgram, GLuint, program)
+ YAGL_GLES_DRIVER_FUNC1(ValidateProgram, GLuint, program)
+ YAGL_GLES_DRIVER_FUNC2(VertexAttrib1f, GLuint, GLfloat, indx, x)
+ YAGL_GLES_DRIVER_FUNC2(VertexAttrib1fv, GLuint, const GLfloat*, indx, values)
+ YAGL_GLES_DRIVER_FUNC3(VertexAttrib2f, GLuint, GLfloat, GLfloat, indx, x, y)
+ YAGL_GLES_DRIVER_FUNC2(VertexAttrib2fv, GLuint, const GLfloat*, indx, values)
+ YAGL_GLES_DRIVER_FUNC4(VertexAttrib3f, GLuint, GLfloat, GLfloat, GLfloat, indx, x, y, z)
+ YAGL_GLES_DRIVER_FUNC2(VertexAttrib3fv, GLuint, const GLfloat*, indx, values)
+ YAGL_GLES_DRIVER_FUNC5(VertexAttrib4f, GLuint, GLfloat, GLfloat, GLfloat, GLfloat, indx, x, y, z, w)
+ YAGL_GLES_DRIVER_FUNC2(VertexAttrib4fv, GLuint, const GLfloat*, indx, values)
+ YAGL_GLES_DRIVER_FUNC2(GetIntegerv, GLenum, GLint*, pname, params)
+ YAGL_GLES_DRIVER_FUNC2(GetFloatv, GLenum, GLfloat*, pname, params)
+ YAGL_GLES_DRIVER_FUNC_RET1(const GLubyte*, GetString, GLenum, name)
+ YAGL_GLES_DRIVER_FUNC_RET1(GLboolean, IsEnabled, GLenum, cap)
+ YAGL_GLES_DRIVER_FUNC1(BlendEquation, GLenum, mode)
+ YAGL_GLES_DRIVER_FUNC2(BlendEquationSeparate, GLenum, GLenum, modeRGB, modeAlpha)
+ YAGL_GLES_DRIVER_FUNC2(BlendFunc, GLenum, GLenum, sfactor, dfactor)
+ YAGL_GLES_DRIVER_FUNC4(BlendFuncSeparate, GLenum, GLenum, GLenum, GLenum, srcRGB, dstRGB, srcAlpha, dstAlpha)
+ YAGL_GLES_DRIVER_FUNC4(BlendColor, GLclampf, GLclampf, GLclampf, GLclampf, red, green, blue, alpha)
+ YAGL_GLES_DRIVER_FUNC1(Clear, GLbitfield, mask)
+ YAGL_GLES_DRIVER_FUNC4(ClearColor, GLclampf, GLclampf, GLclampf, GLclampf, red, green, blue, alpha)
+ YAGL_GLES_DRIVER_FUNC1(ClearDepth, yagl_GLdouble, depth)
+ YAGL_GLES_DRIVER_FUNC1(ClearStencil, GLint, s)
+ YAGL_GLES_DRIVER_FUNC4(ColorMask, GLboolean, GLboolean, GLboolean, GLboolean, red, green, blue, alpha)
+ YAGL_GLES_DRIVER_FUNC1(CullFace, GLenum, mode)
+ YAGL_GLES_DRIVER_FUNC1(DepthFunc, GLenum, func)
+ YAGL_GLES_DRIVER_FUNC1(DepthMask, GLboolean, flag)
+ YAGL_GLES_DRIVER_FUNC2(DepthRange, yagl_GLdouble, yagl_GLdouble, zNear, zFar)
+ YAGL_GLES_DRIVER_FUNC1(Enable, GLenum, cap)
+ YAGL_GLES_DRIVER_FUNC1(Disable, GLenum, cap)
+ YAGL_GLES_DRIVER_FUNC0(Flush)
+ YAGL_GLES_DRIVER_FUNC1(FrontFace, GLenum, mode)
+ YAGL_GLES_DRIVER_FUNC1(GenerateMipmap, GLenum, target)
+ YAGL_GLES_DRIVER_FUNC2(Hint, GLenum, GLenum, target, mode)
+ YAGL_GLES_DRIVER_FUNC1(LineWidth, GLfloat, width)
+ YAGL_GLES_DRIVER_FUNC2(PixelStorei, GLenum, GLint, pname, param)
+ YAGL_GLES_DRIVER_FUNC2(PolygonOffset, GLfloat, GLfloat, factor, units)
+ YAGL_GLES_DRIVER_FUNC4(Scissor, GLint, GLint, GLsizei, GLsizei, x, y, width, height)
+ YAGL_GLES_DRIVER_FUNC3(StencilFunc, GLenum, GLint, GLuint, func, ref, mask)
+ YAGL_GLES_DRIVER_FUNC1(StencilMask, GLuint, mask)
+ YAGL_GLES_DRIVER_FUNC3(StencilOp, GLenum, GLenum, GLenum, fail, zfail, zpass)
+ YAGL_GLES_DRIVER_FUNC2(SampleCoverage, GLclampf, GLboolean, value, invert)
+ YAGL_GLES_DRIVER_FUNC4(Viewport, GLint, GLint, GLsizei, GLsizei, x, y, width, height)
+ YAGL_GLES_DRIVER_FUNC4(StencilFuncSeparate, GLenum, GLenum, GLint, GLuint, face, func, ref, mask)
+ YAGL_GLES_DRIVER_FUNC2(StencilMaskSeparate, GLenum, GLuint, face, mask)
+ YAGL_GLES_DRIVER_FUNC4(StencilOpSeparate, GLenum, GLenum, GLenum, GLenum, face, fail, zfail, zpass)
+ YAGL_GLES_DRIVER_FUNC1(PointSize, GLfloat, size)
+ YAGL_GLES_DRIVER_FUNC2(AlphaFunc, GLenum, GLclampf, func, ref)
+ YAGL_GLES_DRIVER_FUNC1(MatrixMode, GLenum, mode)
+ YAGL_GLES_DRIVER_FUNC0(LoadIdentity)
+ YAGL_GLES_DRIVER_FUNC0(PopMatrix)
+ YAGL_GLES_DRIVER_FUNC0(PushMatrix)
+ YAGL_GLES_DRIVER_FUNC4(Rotatef, GLfloat, GLfloat, GLfloat, GLfloat, angle, x, y, z)
+ YAGL_GLES_DRIVER_FUNC3(Translatef, GLfloat, GLfloat, GLfloat, x, y, z)
+ YAGL_GLES_DRIVER_FUNC3(Scalef, GLfloat, GLfloat, GLfloat, x, y, z)
+ YAGL_GLES_DRIVER_FUNC6(Ortho, yagl_GLdouble, yagl_GLdouble, yagl_GLdouble, yagl_GLdouble, yagl_GLdouble, yagl_GLdouble, left, right, bottom, top, znear, zfar)
+ YAGL_GLES_DRIVER_FUNC4(Color4f, GLfloat, GLfloat, GLfloat, GLfloat, red, green, blue, alpha)
+ YAGL_GLES_DRIVER_FUNC4(Color4ub, GLubyte, GLubyte, GLubyte, GLubyte, red, green, blue, alpha)
+ YAGL_GLES_DRIVER_FUNC3(Normal3f, GLfloat, GLfloat, GLfloat, nx, ny, nz)
+ YAGL_GLES_DRIVER_FUNC2(PointParameterf, GLenum, GLfloat, pname, param)
+ YAGL_GLES_DRIVER_FUNC2(PointParameterfv, GLenum, const GLfloat*, pname, params)
+ YAGL_GLES_DRIVER_FUNC2(Fogf, GLenum, GLfloat, pname, param)
+ YAGL_GLES_DRIVER_FUNC2(Fogfv, GLenum, const GLfloat*, pname, params)
+ YAGL_GLES_DRIVER_FUNC6(Frustum, yagl_GLdouble, yagl_GLdouble, yagl_GLdouble, yagl_GLdouble, yagl_GLdouble, yagl_GLdouble, left, right, bottom, top, znear, zfar)
+ YAGL_GLES_DRIVER_FUNC3(Lightf, GLenum, GLenum, GLfloat, light, pname, param)
+ YAGL_GLES_DRIVER_FUNC3(Lightfv, GLenum, GLenum, const GLfloat*, light, pname, params)
+ YAGL_GLES_DRIVER_FUNC3(GetLightfv, GLenum, GLenum, GLfloat*, light, pname, params)
+ YAGL_GLES_DRIVER_FUNC2(LightModelf, GLenum, GLfloat, pname, param)
+ YAGL_GLES_DRIVER_FUNC2(LightModelfv, GLenum, const GLfloat*, pname, params)
+ YAGL_GLES_DRIVER_FUNC3(Materialf, GLenum, GLenum, GLfloat, face, pname, param)
+ YAGL_GLES_DRIVER_FUNC3(Materialfv, GLenum, GLenum, const GLfloat*, face, pname, params)
+ YAGL_GLES_DRIVER_FUNC3(GetMaterialfv, GLenum, GLenum, GLfloat*, face, pname, params)
+ YAGL_GLES_DRIVER_FUNC1(ShadeModel, GLenum, mode)
+ YAGL_GLES_DRIVER_FUNC1(LogicOp, GLenum, opcode)
+ YAGL_GLES_DRIVER_FUNC1(MultMatrixf, const GLfloat*, m)
+ 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)
+
+ void (*destroy)(struct yagl_gles_driver */*driver*/);
+};
+
+void yagl_gles_driver_init(struct yagl_gles_driver *driver);
+void yagl_gles_driver_cleanup(struct yagl_gles_driver *driver);
+
+/*
+ * @}
+ */
+
+/*
+ * Helpers for ensuring context.
+ * @{
+ */
+
+void yagl_ensure_ctx(void);
+void yagl_unensure_ctx(void);
+
+/*
+ * @}
+ */
+
+#endif
diff --git a/hw/yagl/yagl_handle_gen.c b/hw/yagl/yagl_handle_gen.c
new file mode 100644
index 0000000000..c37bf78ea3
--- /dev/null
+++ b/hw/yagl/yagl_handle_gen.c
@@ -0,0 +1,62 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "yagl_handle_gen.h"
+
+static yagl_host_handle g_handle_gen_next = 0;
+
+void yagl_handle_gen_init(void)
+{
+}
+
+void yagl_handle_gen_reset(void)
+{
+ g_handle_gen_next = 0;
+}
+
+void yagl_handle_gen_cleanup(void)
+{
+}
+
+yagl_host_handle yagl_handle_gen(void)
+{
+ yagl_host_handle ret;
+
+ if (!g_handle_gen_next)
+ {
+ /*
+ * 0 handles are invalid.
+ */
+
+ ++g_handle_gen_next;
+ }
+ ret = g_handle_gen_next++;
+
+ return ret;
+}
diff --git a/hw/yagl/yagl_handle_gen.h b/hw/yagl/yagl_handle_gen.h
new file mode 100644
index 0000000000..151a04a590
--- /dev/null
+++ b/hw/yagl/yagl_handle_gen.h
@@ -0,0 +1,43 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_HANDLE_GEN_H
+#define _QEMU_HANDLE_GEN_H
+
+#include "yagl_types.h"
+
+void yagl_handle_gen_init(void);
+
+void yagl_handle_gen_reset(void);
+
+void yagl_handle_gen_cleanup(void);
+
+yagl_host_handle yagl_handle_gen(void);
+
+#endif
diff --git a/hw/yagl/yagl_inc/EGL/egl.h b/hw/yagl/yagl_inc/EGL/egl.h
new file mode 100644
index 0000000000..99ea342a47
--- /dev/null
+++ b/hw/yagl/yagl_inc/EGL/egl.h
@@ -0,0 +1,329 @@
+/* -*- mode: c; tab-width: 8; -*- */
+/* vi: set sw=4 ts=8: */
+/* Reference version of egl.h for EGL 1.4.
+ * $Revision: 9356 $ on $Date: 2009-10-21 02:52:25 -0700 (Wed, 21 Oct 2009) $
+ */
+
+/*
+** Copyright (c) 2007-2009 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
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+
+#ifndef __egl_h_
+#define __egl_h_
+
+/* All platform-dependent types and macro boilerplate (such as EGLAPI
+ * and EGLAPIENTRY) should go in eglplatform.h.
+ */
+#include <EGL/eglplatform.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* EGL Types */
+/* EGLint is defined in eglplatform.h */
+typedef unsigned int EGLBoolean;
+typedef unsigned int EGLenum;
+typedef void *EGLConfig;
+typedef void *EGLContext;
+typedef void *EGLDisplay;
+typedef void *EGLSurface;
+typedef void *EGLClientBuffer;
+
+/* EGL Versioning */
+#define EGL_VERSION_1_0 1
+#define EGL_VERSION_1_1 1
+#define EGL_VERSION_1_2 1
+#define EGL_VERSION_1_3 1
+#define EGL_VERSION_1_4 1
+
+/* EGL Enumerants. Bitmasks and other exceptional cases aside, most
+ * enums are assigned unique values starting at 0x3000.
+ */
+
+/* EGL aliases */
+#define EGL_FALSE 0
+#define EGL_TRUE 1
+
+/* Out-of-band handle values */
+#define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType)0)
+#define EGL_NO_CONTEXT ((EGLContext)0)
+#define EGL_NO_DISPLAY ((EGLDisplay)0)
+#define EGL_NO_SURFACE ((EGLSurface)0)
+
+/* Out-of-band attribute value */
+#define EGL_DONT_CARE ((EGLint)-1)
+
+/* Errors / GetError return values */
+#define EGL_SUCCESS 0x3000
+#define EGL_NOT_INITIALIZED 0x3001
+#define EGL_BAD_ACCESS 0x3002
+#define EGL_BAD_ALLOC 0x3003
+#define EGL_BAD_ATTRIBUTE 0x3004
+#define EGL_BAD_CONFIG 0x3005
+#define EGL_BAD_CONTEXT 0x3006
+#define EGL_BAD_CURRENT_SURFACE 0x3007
+#define EGL_BAD_DISPLAY 0x3008
+#define EGL_BAD_MATCH 0x3009
+#define EGL_BAD_NATIVE_PIXMAP 0x300A
+#define EGL_BAD_NATIVE_WINDOW 0x300B
+#define EGL_BAD_PARAMETER 0x300C
+#define EGL_BAD_SURFACE 0x300D
+#define EGL_CONTEXT_LOST 0x300E /* EGL 1.1 - IMG_power_management */
+
+/* Reserved 0x300F-0x301F for additional errors */
+
+/* Config attributes */
+#define EGL_BUFFER_SIZE 0x3020
+#define EGL_ALPHA_SIZE 0x3021
+#define EGL_BLUE_SIZE 0x3022
+#define EGL_GREEN_SIZE 0x3023
+#define EGL_RED_SIZE 0x3024
+#define EGL_DEPTH_SIZE 0x3025
+#define EGL_STENCIL_SIZE 0x3026
+#define EGL_CONFIG_CAVEAT 0x3027
+#define EGL_CONFIG_ID 0x3028
+#define EGL_LEVEL 0x3029
+#define EGL_MAX_PBUFFER_HEIGHT 0x302A
+#define EGL_MAX_PBUFFER_PIXELS 0x302B
+#define EGL_MAX_PBUFFER_WIDTH 0x302C
+#define EGL_NATIVE_RENDERABLE 0x302D
+#define EGL_NATIVE_VISUAL_ID 0x302E
+#define EGL_NATIVE_VISUAL_TYPE 0x302F
+#define EGL_SAMPLES 0x3031
+#define EGL_SAMPLE_BUFFERS 0x3032
+#define EGL_SURFACE_TYPE 0x3033
+#define EGL_TRANSPARENT_TYPE 0x3034
+#define EGL_TRANSPARENT_BLUE_VALUE 0x3035
+#define EGL_TRANSPARENT_GREEN_VALUE 0x3036
+#define EGL_TRANSPARENT_RED_VALUE 0x3037
+#define EGL_NONE 0x3038 /* Attrib list terminator */
+#define EGL_BIND_TO_TEXTURE_RGB 0x3039
+#define EGL_BIND_TO_TEXTURE_RGBA 0x303A
+#define EGL_MIN_SWAP_INTERVAL 0x303B
+#define EGL_MAX_SWAP_INTERVAL 0x303C
+#define EGL_LUMINANCE_SIZE 0x303D
+#define EGL_ALPHA_MASK_SIZE 0x303E
+#define EGL_COLOR_BUFFER_TYPE 0x303F
+#define EGL_RENDERABLE_TYPE 0x3040
+#define EGL_MATCH_NATIVE_PIXMAP 0x3041 /* Pseudo-attribute (not queryable) */
+#define EGL_CONFORMANT 0x3042
+
+/* Reserved 0x3041-0x304F for additional config attributes */
+
+/* Config attribute values */
+#define EGL_SLOW_CONFIG 0x3050 /* EGL_CONFIG_CAVEAT value */
+#define EGL_NON_CONFORMANT_CONFIG 0x3051 /* EGL_CONFIG_CAVEAT value */
+#define EGL_TRANSPARENT_RGB 0x3052 /* EGL_TRANSPARENT_TYPE value */
+#define EGL_RGB_BUFFER 0x308E /* EGL_COLOR_BUFFER_TYPE value */
+#define EGL_LUMINANCE_BUFFER 0x308F /* EGL_COLOR_BUFFER_TYPE value */
+
+/* More config attribute values, for EGL_TEXTURE_FORMAT */
+#define EGL_NO_TEXTURE 0x305C
+#define EGL_TEXTURE_RGB 0x305D
+#define EGL_TEXTURE_RGBA 0x305E
+#define EGL_TEXTURE_2D 0x305F
+
+/* Config attribute mask bits */
+#define EGL_PBUFFER_BIT 0x0001 /* EGL_SURFACE_TYPE mask bits */
+#define EGL_PIXMAP_BIT 0x0002 /* EGL_SURFACE_TYPE mask bits */
+#define EGL_WINDOW_BIT 0x0004 /* EGL_SURFACE_TYPE mask bits */
+#define EGL_VG_COLORSPACE_LINEAR_BIT 0x0020 /* EGL_SURFACE_TYPE mask bits */
+#define EGL_VG_ALPHA_FORMAT_PRE_BIT 0x0040 /* EGL_SURFACE_TYPE mask bits */
+#define EGL_MULTISAMPLE_RESOLVE_BOX_BIT 0x0200 /* EGL_SURFACE_TYPE mask bits */
+#define EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400 /* EGL_SURFACE_TYPE mask bits */
+
+#define EGL_OPENGL_ES_BIT 0x0001 /* EGL_RENDERABLE_TYPE mask bits */
+#define EGL_OPENVG_BIT 0x0002 /* EGL_RENDERABLE_TYPE mask bits */
+#define EGL_OPENGL_ES2_BIT 0x0004 /* EGL_RENDERABLE_TYPE mask bits */
+#define EGL_OPENGL_BIT 0x0008 /* EGL_RENDERABLE_TYPE mask bits */
+
+/* QueryString targets */
+#define EGL_VENDOR 0x3053
+#define EGL_VERSION 0x3054
+#define EGL_EXTENSIONS 0x3055
+#define EGL_CLIENT_APIS 0x308D
+
+/* QuerySurface / SurfaceAttrib / CreatePbufferSurface targets */
+#define EGL_HEIGHT 0x3056
+#define EGL_WIDTH 0x3057
+#define EGL_LARGEST_PBUFFER 0x3058
+#define EGL_TEXTURE_FORMAT 0x3080
+#define EGL_TEXTURE_TARGET 0x3081
+#define EGL_MIPMAP_TEXTURE 0x3082
+#define EGL_MIPMAP_LEVEL 0x3083
+#define EGL_RENDER_BUFFER 0x3086
+#define EGL_VG_COLORSPACE 0x3087
+#define EGL_VG_ALPHA_FORMAT 0x3088
+#define EGL_HORIZONTAL_RESOLUTION 0x3090
+#define EGL_VERTICAL_RESOLUTION 0x3091
+#define EGL_PIXEL_ASPECT_RATIO 0x3092
+#define EGL_SWAP_BEHAVIOR 0x3093
+#define EGL_MULTISAMPLE_RESOLVE 0x3099
+
+/* EGL_RENDER_BUFFER values / BindTexImage / ReleaseTexImage buffer targets */
+#define EGL_BACK_BUFFER 0x3084
+#define EGL_SINGLE_BUFFER 0x3085
+
+/* OpenVG color spaces */
+#define EGL_VG_COLORSPACE_sRGB 0x3089 /* EGL_VG_COLORSPACE value */
+#define EGL_VG_COLORSPACE_LINEAR 0x308A /* EGL_VG_COLORSPACE value */
+
+/* OpenVG alpha formats */
+#define EGL_VG_ALPHA_FORMAT_NONPRE 0x308B /* EGL_ALPHA_FORMAT value */
+#define EGL_VG_ALPHA_FORMAT_PRE 0x308C /* EGL_ALPHA_FORMAT value */
+
+/* Constant scale factor by which fractional display resolutions &
+ * aspect ratio are scaled when queried as integer values.
+ */
+#define EGL_DISPLAY_SCALING 10000
+
+/* Unknown display resolution/aspect ratio */
+#define EGL_UNKNOWN ((EGLint)-1)
+
+/* Back buffer swap behaviors */
+#define EGL_BUFFER_PRESERVED 0x3094 /* EGL_SWAP_BEHAVIOR value */
+#define EGL_BUFFER_DESTROYED 0x3095 /* EGL_SWAP_BEHAVIOR value */
+
+/* CreatePbufferFromClientBuffer buffer types */
+#define EGL_OPENVG_IMAGE 0x3096
+
+/* QueryContext targets */
+#define EGL_CONTEXT_CLIENT_TYPE 0x3097
+
+/* CreateContext attributes */
+#define EGL_CONTEXT_CLIENT_VERSION 0x3098
+
+/* Multisample resolution behaviors */
+#define EGL_MULTISAMPLE_RESOLVE_DEFAULT 0x309A /* EGL_MULTISAMPLE_RESOLVE value */
+#define EGL_MULTISAMPLE_RESOLVE_BOX 0x309B /* EGL_MULTISAMPLE_RESOLVE value */
+
+/* BindAPI/QueryAPI targets */
+#define EGL_OPENGL_ES_API 0x30A0
+#define EGL_OPENVG_API 0x30A1
+#define EGL_OPENGL_API 0x30A2
+
+/* GetCurrentSurface targets */
+#define EGL_DRAW 0x3059
+#define EGL_READ 0x305A
+
+/* WaitNative engines */
+#define EGL_CORE_NATIVE_ENGINE 0x305B
+
+/* EGL 1.2 tokens renamed for consistency in EGL 1.3 */
+#define EGL_COLORSPACE EGL_VG_COLORSPACE
+#define EGL_ALPHA_FORMAT EGL_VG_ALPHA_FORMAT
+#define EGL_COLORSPACE_sRGB EGL_VG_COLORSPACE_sRGB
+#define EGL_COLORSPACE_LINEAR EGL_VG_COLORSPACE_LINEAR
+#define EGL_ALPHA_FORMAT_NONPRE EGL_VG_ALPHA_FORMAT_NONPRE
+#define EGL_ALPHA_FORMAT_PRE EGL_VG_ALPHA_FORMAT_PRE
+
+/* EGL extensions must request enum blocks from the Khronos
+ * API Registrar, who maintains the enumerant registry. Submit
+ * a bug in Khronos Bugzilla against task "Registry".
+ */
+
+
+
+/* EGL Functions */
+
+EGLAPI EGLint EGLAPIENTRY eglGetError(void);
+
+EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay(EGLNativeDisplayType display_id);
+EGLAPI EGLBoolean EGLAPIENTRY eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor);
+EGLAPI EGLBoolean EGLAPIENTRY eglTerminate(EGLDisplay dpy);
+
+EGLAPI const char * EGLAPIENTRY eglQueryString(EGLDisplay dpy, EGLint name);
+
+EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigs(EGLDisplay dpy, EGLConfig *configs,
+ EGLint config_size, EGLint *num_config);
+EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list,
+ EGLConfig *configs, EGLint config_size,
+ EGLint *num_config);
+EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config,
+ EGLint attribute, EGLint *value);
+
+EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config,
+ EGLNativeWindowType win,
+ const EGLint *attrib_list);
+EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config,
+ const EGLint *attrib_list);
+EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config,
+ EGLNativePixmapType pixmap,
+ const EGLint *attrib_list);
+EGLAPI EGLBoolean EGLAPIENTRY eglDestroySurface(EGLDisplay dpy, EGLSurface surface);
+EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface(EGLDisplay dpy, EGLSurface surface,
+ EGLint attribute, EGLint *value);
+
+EGLAPI EGLBoolean EGLAPIENTRY eglBindAPI(EGLenum api);
+EGLAPI EGLenum EGLAPIENTRY eglQueryAPI(void);
+
+EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient(void);
+
+EGLAPI EGLBoolean EGLAPIENTRY eglReleaseThread(void);
+
+EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferFromClientBuffer(
+ EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer,
+ EGLConfig config, const EGLint *attrib_list);
+
+EGLAPI EGLBoolean EGLAPIENTRY eglSurfaceAttrib(EGLDisplay dpy, EGLSurface surface,
+ EGLint attribute, EGLint value);
+EGLAPI EGLBoolean EGLAPIENTRY eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer);
+EGLAPI EGLBoolean EGLAPIENTRY eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer);
+
+
+EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval(EGLDisplay dpy, EGLint interval);
+
+
+EGLAPI EGLContext EGLAPIENTRY eglCreateContext(EGLDisplay dpy, EGLConfig config,
+ EGLContext share_context,
+ const EGLint *attrib_list);
+EGLAPI EGLBoolean EGLAPIENTRY eglDestroyContext(EGLDisplay dpy, EGLContext ctx);
+EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrent(EGLDisplay dpy, EGLSurface draw,
+ EGLSurface read, EGLContext ctx);
+
+EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext(void);
+EGLAPI EGLSurface EGLAPIENTRY eglGetCurrentSurface(EGLint readdraw);
+EGLAPI EGLDisplay EGLAPIENTRY eglGetCurrentDisplay(void);
+EGLAPI EGLBoolean EGLAPIENTRY eglQueryContext(EGLDisplay dpy, EGLContext ctx,
+ EGLint attribute, EGLint *value);
+
+EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL(void);
+EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative(EGLint engine);
+EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surface);
+EGLAPI EGLBoolean EGLAPIENTRY eglCopyBuffers(EGLDisplay dpy, EGLSurface surface,
+ EGLNativePixmapType target);
+
+/* This is a generic function pointer type, whose name indicates it must
+ * be cast to the proper type *and calling convention* before use.
+ */
+typedef void (*__eglMustCastToProperFunctionPointerType)(void);
+
+/* Now, define eglGetProcAddress using the generic function ptr. type */
+EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY
+ eglGetProcAddress(const char *procname);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __egl_h_ */
diff --git a/hw/yagl/yagl_inc/EGL/eglext.h b/hw/yagl/yagl_inc/EGL/eglext.h
new file mode 100644
index 0000000000..a7ea2ea2fd
--- /dev/null
+++ b/hw/yagl/yagl_inc/EGL/eglext.h
@@ -0,0 +1,337 @@
+#ifndef __eglext_h_
+#define __eglext_h_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+** Copyright (c) 2007-2010 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
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+
+#include <EGL/eglplatform.h>
+
+/*************************************************************/
+
+/* 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_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
+
+#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_image
+#define EGL_KHR_image 1
+#define EGL_NATIVE_PIXMAP_KHR 0x30B0 /* eglCreateImageKHR target */
+typedef void *EGLImageKHR;
+#define EGL_NO_IMAGE_KHR ((EGLImageKHR)0)
+#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
+
+#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_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_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 */
+#endif
+
+#ifndef EGL_KHR_gl_renderbuffer_image
+#define EGL_KHR_gl_renderbuffer_image 1
+#define EGL_GL_RENDERBUFFER_KHR 0x30B9 /* eglCreateImageKHR target */
+#endif
+
+#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 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 */
+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);
+#endif
+#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
+
+#ifndef EGL_KHR_image_pixmap
+#define EGL_KHR_image_pixmap 1
+/* Interfaces defined by EGL_KHR_image above */
+#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
+
+#ifndef EGL_KHR_lock_surface2
+#define EGL_KHR_lock_surface2 1
+#define EGL_BITMAP_PIXEL_SIZE_KHR 0x3110
+#endif
+
+#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_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
+
+#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;
+#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);
+#endif
+#endif
+
+#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
+#endif
+#endif
+
+#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;
+};
+
+#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 */
+
+#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
+#endif /* EGL_HI_colorformats */
+
+#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 */
+#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
+
+#ifndef EGL_NV_post_sub_buffer
+#define EGL_NV_post_sub_buffer 1
+#define EGL_POST_SUB_BUFFER_SUPPORTED_NV 0x30BE
+#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
+
+#ifndef EGL_ANGLE_query_surface_pointer
+#define EGL_ANGLE_query_surface_pointer 1
+#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
+#endif
+
+#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
+
+#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 */
+typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC) (void);
+typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMENVPROC) (void);
+#endif
+#endif
+
+#include <EGL/eglmesaext.h>
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/hw/yagl/yagl_inc/EGL/eglmesaext.h b/hw/yagl/yagl_inc/EGL/eglmesaext.h
new file mode 100644
index 0000000000..52dd5b108f
--- /dev/null
+++ b/hw/yagl/yagl_inc/EGL/eglmesaext.h
@@ -0,0 +1,150 @@
+/**************************************************************************
+ *
+ * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#ifndef __eglmesaext_h_
+#define __eglmesaext_h_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <EGL/eglplatform.h>
+
+/* EGL_MESA_screen extension >>> PRELIMINARY <<< */
+#ifndef EGL_MESA_screen_surface
+#define EGL_MESA_screen_surface 1
+
+#define EGL_BAD_SCREEN_MESA 0x4000
+#define EGL_BAD_MODE_MESA 0x4001
+#define EGL_SCREEN_COUNT_MESA 0x4002
+#define EGL_SCREEN_POSITION_MESA 0x4003
+#define EGL_SCREEN_POSITION_GRANULARITY_MESA 0x4004
+#define EGL_MODE_ID_MESA 0x4005
+#define EGL_REFRESH_RATE_MESA 0x4006
+#define EGL_OPTIMAL_MESA 0x4007
+#define EGL_INTERLACED_MESA 0x4008
+#define EGL_SCREEN_BIT_MESA 0x08
+
+typedef khronos_uint32_t EGLScreenMESA;
+typedef khronos_uint32_t EGLModeMESA;
+
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLBoolean EGLAPIENTRY eglChooseModeMESA(EGLDisplay dpy, EGLScreenMESA screen, const EGLint *attrib_list, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes);
+EGLAPI EGLBoolean EGLAPIENTRY eglGetModesMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes);
+EGLAPI EGLBoolean EGLAPIENTRY eglGetModeAttribMESA(EGLDisplay dpy, EGLModeMESA mode, EGLint attribute, EGLint *value);
+EGLAPI EGLBoolean EGLAPIENTRY eglGetScreensMESA(EGLDisplay dpy, EGLScreenMESA *screens, EGLint max_screens, EGLint *num_screens);
+EGLAPI EGLSurface EGLAPIENTRY eglCreateScreenSurfaceMESA(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list);
+EGLAPI EGLBoolean EGLAPIENTRY eglShowScreenSurfaceMESA(EGLDisplay dpy, EGLint screen, EGLSurface surface, EGLModeMESA mode);
+EGLAPI EGLBoolean EGLAPIENTRY eglScreenPositionMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLint x, EGLint y);
+EGLAPI EGLBoolean EGLAPIENTRY eglQueryScreenMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLint attribute, EGLint *value);
+EGLAPI EGLBoolean EGLAPIENTRY eglQueryScreenSurfaceMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLSurface *surface);
+EGLAPI EGLBoolean EGLAPIENTRY eglQueryScreenModeMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *mode);
+EGLAPI const char * EGLAPIENTRY eglQueryModeStringMESA(EGLDisplay dpy, EGLModeMESA mode);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLCHOOSEMODEMESA) (EGLDisplay dpy, EGLScreenMESA screen, const EGLint *attrib_list, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETMODESMESA) (EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLGetModeATTRIBMESA) (EGLDisplay dpy, EGLModeMESA mode, EGLint attribute, EGLint *value);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSCRREENSMESA) (EGLDisplay dpy, EGLScreenMESA *screens, EGLint max_screens, EGLint *num_screens);
+typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATESCREENSURFACEMESA) (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLSHOWSCREENSURFACEMESA) (EGLDisplay dpy, EGLint screen, EGLSurface surface, EGLModeMESA mode);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLSCREENPOSIITONMESA) (EGLDisplay dpy, EGLScreenMESA screen, EGLint x, EGLint y);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSCREENMESA) (EGLDisplay dpy, EGLScreenMESA screen, EGLint attribute, EGLint *value);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSCREENSURFACEMESA) (EGLDisplay dpy, EGLScreenMESA screen, EGLSurface *surface);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSCREENMODEMESA) (EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *mode);
+typedef const char * (EGLAPIENTRYP PFNEGLQUERYMODESTRINGMESA) (EGLDisplay dpy, EGLModeMESA mode);
+
+#endif /* EGL_MESA_screen_surface */
+
+#ifndef EGL_MESA_copy_context
+#define EGL_MESA_copy_context 1
+
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLBoolean EGLAPIENTRY eglCopyContextMESA(EGLDisplay dpy, EGLContext source, EGLContext dest, EGLint mask);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLCOPYCONTEXTMESA) (EGLDisplay dpy, EGLContext source, EGLContext dest, EGLint mask);
+
+#endif /* EGL_MESA_copy_context */
+
+#ifndef EGL_MESA_drm_display
+#define EGL_MESA_drm_display 1
+
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLDisplay EGLAPIENTRY eglGetDRMDisplayMESA(int fd);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+
+typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETDRMDISPLAYMESA) (int fd);
+
+#endif /* EGL_MESA_drm_display */
+
+#ifdef EGL_MESA_drm_image
+/* Mesa's extension to EGL_MESA_drm_image... */
+#ifndef EGL_DRM_BUFFER_USE_CURSOR_MESA
+#define EGL_DRM_BUFFER_USE_CURSOR_MESA 0x0004
+#endif
+#endif
+
+#ifndef EGL_WL_bind_wayland_display
+#define EGL_WL_bind_wayland_display 1
+
+#define EGL_WAYLAND_BUFFER_WL 0x31D5 /* eglCreateImageKHR target */
+struct wl_display;
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLBoolean EGLAPIENTRY eglBindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display);
+EGLAPI EGLBoolean EGLAPIENTRY eglUnbindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display);
+#endif
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display);
+#endif
+
+#ifndef EGL_NOK_swap_region
+#define EGL_NOK_swap_region 1
+
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersRegionNOK(EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint* rects);
+#endif
+
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSREGIONNOK) (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint* rects);
+#endif
+
+#ifndef EGL_NOK_texture_from_pixmap
+#define EGL_NOK_texture_from_pixmap 1
+
+#define EGL_Y_INVERTED_NOK 0x307F
+#endif /* EGL_NOK_texture_from_pixmap */
+
+#ifndef EGL_ANDROID_image_native_buffer
+#define EGL_ANDROID_image_native_buffer 1
+#define EGL_NATIVE_BUFFER_ANDROID 0x3140 /* eglCreateImageKHR target */
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/hw/yagl/yagl_inc/EGL/eglplatform.h b/hw/yagl/yagl_inc/EGL/eglplatform.h
new file mode 100644
index 0000000000..19d38d9a53
--- /dev/null
+++ b/hw/yagl/yagl_inc/EGL/eglplatform.h
@@ -0,0 +1,152 @@
+#ifndef __eglplatform_h_
+#define __eglplatform_h_
+
+/*
+** Copyright (c) 2007-2009 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
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+
+/* Platform-specific types and definitions for egl.h
+ * $Revision: 12306 $ on $Date: 2010-08-25 09:51:28 -0700 (Wed, 25 Aug 2010) $
+ *
+ * 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
+ * they can be included in future versions of this file. Please submit changes
+ * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
+ * by filing a bug against product "EGL" component "Registry".
+ */
+
+#include <KHR/khrplatform.h>
+
+/* Macros used in EGL function prototype declarations.
+ *
+ * EGL functions should be prototyped as:
+ *
+ * EGLAPI return-type EGLAPIENTRY eglFunction(arguments);
+ * typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments);
+ *
+ * KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h
+ */
+
+#ifndef EGLAPI
+#define EGLAPI KHRONOS_APICALL
+#endif
+
+#ifndef EGLAPIENTRY
+#define EGLAPIENTRY KHRONOS_APIENTRY
+#endif
+#define EGLAPIENTRYP EGLAPIENTRY*
+
+/* The types NativeDisplayType, NativeWindowType, and NativePixmapType
+ * are aliases of window-system-dependent types, such as X Display * or
+ * Windows Device Context. They must be defined in platform-specific
+ * code below. The EGL-prefixed versions of Native*Type are the same
+ * types, renamed in EGL 1.3 so all types in the API start with "EGL".
+ *
+ * Khronos STRONGLY RECOMMENDS that you use the default definitions
+ * provided below, since these changes affect both binary and source
+ * portability of applications using EGL running on different EGL
+ * implementations.
+ */
+
+#if defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */
+#ifndef WIN32_LEAN_AND_MEAN
+#define WIN32_LEAN_AND_MEAN 1
+#endif
+#include <windows.h>
+
+typedef HDC EGLNativeDisplayType;
+typedef HBITMAP EGLNativePixmapType;
+typedef HWND EGLNativeWindowType;
+
+#elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */
+
+typedef int EGLNativeDisplayType;
+typedef void *EGLNativeWindowType;
+typedef void *EGLNativePixmapType;
+
+#elif defined(WL_EGL_PLATFORM)
+
+typedef struct wl_display *EGLNativeDisplayType;
+typedef struct wl_egl_pixmap *EGLNativePixmapType;
+typedef struct wl_egl_window *EGLNativeWindowType;
+
+#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;
+
+#elif defined(__APPLE__) && defined (__MACH__) /* Mac OS X */
+
+typedef void *EGLNativeDisplayType;
+typedef void *EGLNativePixmapType;
+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>
+
+typedef Display *EGLNativeDisplayType;
+typedef Pixmap EGLNativePixmapType;
+typedef Window EGLNativeWindowType;
+
+#endif /* MESA_EGL_NO_X11_HEADERS */
+
+#else
+#error "Platform not recognized"
+#endif
+
+/* EGL 1.2 types, renamed for consistency in EGL 1.3 */
+typedef EGLNativeDisplayType NativeDisplayType;
+typedef EGLNativePixmapType NativePixmapType;
+typedef EGLNativeWindowType NativeWindowType;
+
+
+/* Define EGLint. This must be a signed integral type large enough to contain
+ * all legal attribute names and values passed into and out of EGL, whether
+ * their type is boolean, bitmask, enumerant (symbolic constant), integer,
+ * handle, or other. While in general a 32-bit integer will suffice, if
+ * handles are 64 bit types, then EGLint should be defined as a signed 64-bit
+ * integer type.
+ */
+typedef khronos_int32_t EGLint;
+
+#endif /* __eglplatform_h */
diff --git a/hw/yagl/yagl_inc/GL/gl.h b/hw/yagl/yagl_inc/GL/gl.h
new file mode 100644
index 0000000000..e65e1bc8a8
--- /dev/null
+++ b/hw/yagl/yagl_inc/GL/gl.h
@@ -0,0 +1,2235 @@
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.6
+ *
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
+ * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#ifndef __gl_h_
+#define __gl_h_
+
+#if defined(USE_MGL_NAMESPACE)
+#include "gl_mangle.h"
+#endif
+
+
+/**********************************************************************
+ * Begin system-specific stuff. Do not do any of this when building
+ * for SciTech SNAP, as this is all done before this header file is
+ * included.
+ */
+#if !defined(__SCITECH_SNAP__)
+
+#if defined(__BEOS__)
+#include <stdlib.h> /* to get some BeOS-isms */
+#endif
+
+#if !defined(OPENSTEP) && (defined(NeXT) || defined(NeXT_PDO))
+#define OPENSTEP
+#endif
+
+#if defined(_WIN32) && !defined(__WIN32__) && !defined(__CYGWIN__)
+#define __WIN32__
+#endif
+
+#if !defined(OPENSTEP) && (defined(__WIN32__) && !defined(__CYGWIN__))
+# if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */
+# define GLAPI __declspec(dllexport)
+# elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
+# define GLAPI __declspec(dllimport)
+# else /* for use with static link lib build of Win32 edition only */
+# define GLAPI extern
+# endif /* _STATIC_MESA support */
+# if defined(__MINGW32__) && defined(GL_NO_STDCALL) || defined(UNDER_CE) /* The generated DLLs by MingW with STDCALL are not compatible with the ones done by Microsoft's compilers */
+# define GLAPIENTRY
+# else
+# define GLAPIENTRY __stdcall
+# endif
+#elif defined(__CYGWIN__) && defined(USE_OPENGL32) /* use native windows opengl32 */
+# define GLAPI extern
+# define GLAPIENTRY __stdcall
+#elif (defined(__GNUC__) && __GNUC__ >= 4) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
+# define GLAPI __attribute__((visibility("default")))
+# define GLAPIENTRY
+#endif /* WIN32 && !CYGWIN */
+
+#if (defined(__BEOS__) && defined(__POWERPC__)) || defined(__QUICKDRAW__)
+# define PRAGMA_EXPORT_SUPPORTED 1
+#endif
+
+/*
+ * WINDOWS: Include windows.h here to define APIENTRY.
+ * It is also useful when applications include this file by
+ * including only glut.h, since glut.h depends on windows.h.
+ * Applications needing to include windows.h with parms other
+ * than "WIN32_LEAN_AND_MEAN" may include windows.h before
+ * glut.h or gl.h.
+ */
+#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__)
+#ifndef WIN32_LEAN_AND_MEAN
+#define WIN32_LEAN_AND_MEAN 1
+#endif
+#include <windows.h>
+#endif
+
+#if defined(macintosh) && PRAGMA_IMPORT_SUPPORTED
+#pragma import on
+#endif
+
+#ifndef GLAPI
+#define GLAPI extern
+#endif
+
+#ifndef GLAPIENTRY
+#define GLAPIENTRY
+#endif
+
+#ifndef APIENTRY
+#define APIENTRY GLAPIENTRY
+#endif
+
+/* "P" suffix to be used for a pointer to a function */
+#ifndef APIENTRYP
+#define APIENTRYP APIENTRY *
+#endif
+
+#ifndef GLAPIENTRYP
+#define GLAPIENTRYP GLAPIENTRY *
+#endif
+
+#ifdef CENTERLINE_CLPP
+#define signed
+#endif
+
+#if defined(PRAGMA_EXPORT_SUPPORTED)
+#pragma export on
+#endif
+
+#endif /* !__SCITECH_SNAP__ */
+/*
+ * End system-specific stuff.
+ **********************************************************************/
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+
+#define GL_VERSION_1_1 1
+#define GL_VERSION_1_2 1
+#define GL_VERSION_1_3 1
+#define GL_ARB_imaging 1
+
+
+/*
+ * Datatypes
+ */
+typedef unsigned int GLenum;
+typedef unsigned char GLboolean;
+typedef unsigned int GLbitfield;
+typedef void GLvoid;
+typedef signed char GLbyte; /* 1-byte signed */
+typedef short GLshort; /* 2-byte signed */
+typedef int GLint; /* 4-byte signed */
+typedef unsigned char GLubyte; /* 1-byte unsigned */
+typedef unsigned short GLushort; /* 2-byte unsigned */
+typedef unsigned int GLuint; /* 4-byte unsigned */
+typedef int GLsizei; /* 4-byte signed */
+typedef float GLfloat; /* single precision float */
+typedef float GLclampf; /* single precision float in [0,1] */
+typedef double GLdouble; /* double precision float */
+typedef double GLclampd; /* double precision float in [0,1] */
+
+
+
+/*
+ * Constants
+ */
+
+/* Boolean values */
+#define GL_FALSE 0x0
+#define GL_TRUE 0x1
+
+/* Data types */
+#define GL_BYTE 0x1400
+#define GL_UNSIGNED_BYTE 0x1401
+#define GL_SHORT 0x1402
+#define GL_UNSIGNED_SHORT 0x1403
+#define GL_INT 0x1404
+#define GL_UNSIGNED_INT 0x1405
+#define GL_FLOAT 0x1406
+#define GL_2_BYTES 0x1407
+#define GL_3_BYTES 0x1408
+#define GL_4_BYTES 0x1409
+#define GL_DOUBLE 0x140A
+
+/* Primitives */
+#define GL_POINTS 0x0000
+#define GL_LINES 0x0001
+#define GL_LINE_LOOP 0x0002
+#define GL_LINE_STRIP 0x0003
+#define GL_TRIANGLES 0x0004
+#define GL_TRIANGLE_STRIP 0x0005
+#define GL_TRIANGLE_FAN 0x0006
+#define GL_QUADS 0x0007
+#define GL_QUAD_STRIP 0x0008
+#define GL_POLYGON 0x0009
+
+/* Vertex Arrays */
+#define GL_VERTEX_ARRAY 0x8074
+#define GL_NORMAL_ARRAY 0x8075
+#define GL_COLOR_ARRAY 0x8076
+#define GL_INDEX_ARRAY 0x8077
+#define GL_TEXTURE_COORD_ARRAY 0x8078
+#define GL_EDGE_FLAG_ARRAY 0x8079
+#define GL_VERTEX_ARRAY_SIZE 0x807A
+#define GL_VERTEX_ARRAY_TYPE 0x807B
+#define GL_VERTEX_ARRAY_STRIDE 0x807C
+#define GL_NORMAL_ARRAY_TYPE 0x807E
+#define GL_NORMAL_ARRAY_STRIDE 0x807F
+#define GL_COLOR_ARRAY_SIZE 0x8081
+#define GL_COLOR_ARRAY_TYPE 0x8082
+#define GL_COLOR_ARRAY_STRIDE 0x8083
+#define GL_INDEX_ARRAY_TYPE 0x8085
+#define GL_INDEX_ARRAY_STRIDE 0x8086
+#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088
+#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089
+#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A
+#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C
+#define GL_VERTEX_ARRAY_POINTER 0x808E
+#define GL_NORMAL_ARRAY_POINTER 0x808F
+#define GL_COLOR_ARRAY_POINTER 0x8090
+#define GL_INDEX_ARRAY_POINTER 0x8091
+#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092
+#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093
+#define GL_V2F 0x2A20
+#define GL_V3F 0x2A21
+#define GL_C4UB_V2F 0x2A22
+#define GL_C4UB_V3F 0x2A23
+#define GL_C3F_V3F 0x2A24
+#define GL_N3F_V3F 0x2A25
+#define GL_C4F_N3F_V3F 0x2A26
+#define GL_T2F_V3F 0x2A27
+#define GL_T4F_V4F 0x2A28
+#define GL_T2F_C4UB_V3F 0x2A29
+#define GL_T2F_C3F_V3F 0x2A2A
+#define GL_T2F_N3F_V3F 0x2A2B
+#define GL_T2F_C4F_N3F_V3F 0x2A2C
+#define GL_T4F_C4F_N3F_V4F 0x2A2D
+
+/* Matrix Mode */
+#define GL_MATRIX_MODE 0x0BA0
+#define GL_MODELVIEW 0x1700
+#define GL_PROJECTION 0x1701
+#define GL_TEXTURE 0x1702
+
+/* Points */
+#define GL_POINT_SMOOTH 0x0B10
+#define GL_POINT_SIZE 0x0B11
+#define GL_POINT_SIZE_GRANULARITY 0x0B13
+#define GL_POINT_SIZE_RANGE 0x0B12
+
+/* Lines */
+#define GL_LINE_SMOOTH 0x0B20
+#define GL_LINE_STIPPLE 0x0B24
+#define GL_LINE_STIPPLE_PATTERN 0x0B25
+#define GL_LINE_STIPPLE_REPEAT 0x0B26
+#define GL_LINE_WIDTH 0x0B21
+#define GL_LINE_WIDTH_GRANULARITY 0x0B23
+#define GL_LINE_WIDTH_RANGE 0x0B22
+
+/* Polygons */
+#define GL_POINT 0x1B00
+#define GL_LINE 0x1B01
+#define GL_FILL 0x1B02
+#define GL_CW 0x0900
+#define GL_CCW 0x0901
+#define GL_FRONT 0x0404
+#define GL_BACK 0x0405
+#define GL_POLYGON_MODE 0x0B40
+#define GL_POLYGON_SMOOTH 0x0B41
+#define GL_POLYGON_STIPPLE 0x0B42
+#define GL_EDGE_FLAG 0x0B43
+#define GL_CULL_FACE 0x0B44
+#define GL_CULL_FACE_MODE 0x0B45
+#define GL_FRONT_FACE 0x0B46
+#define GL_POLYGON_OFFSET_FACTOR 0x8038
+#define GL_POLYGON_OFFSET_UNITS 0x2A00
+#define GL_POLYGON_OFFSET_POINT 0x2A01
+#define GL_POLYGON_OFFSET_LINE 0x2A02
+#define GL_POLYGON_OFFSET_FILL 0x8037
+
+/* Display Lists */
+#define GL_COMPILE 0x1300
+#define GL_COMPILE_AND_EXECUTE 0x1301
+#define GL_LIST_BASE 0x0B32
+#define GL_LIST_INDEX 0x0B33
+#define GL_LIST_MODE 0x0B30
+
+/* Depth buffer */
+#define GL_NEVER 0x0200
+#define GL_LESS 0x0201
+#define GL_EQUAL 0x0202
+#define GL_LEQUAL 0x0203
+#define GL_GREATER 0x0204
+#define GL_NOTEQUAL 0x0205
+#define GL_GEQUAL 0x0206
+#define GL_ALWAYS 0x0207
+#define GL_DEPTH_TEST 0x0B71
+#define GL_DEPTH_BITS 0x0D56
+#define GL_DEPTH_CLEAR_VALUE 0x0B73
+#define GL_DEPTH_FUNC 0x0B74
+#define GL_DEPTH_RANGE 0x0B70
+#define GL_DEPTH_WRITEMASK 0x0B72
+#define GL_DEPTH_COMPONENT 0x1902
+
+/* Lighting */
+#define GL_LIGHTING 0x0B50
+#define GL_LIGHT0 0x4000
+#define GL_LIGHT1 0x4001
+#define GL_LIGHT2 0x4002
+#define GL_LIGHT3 0x4003
+#define GL_LIGHT4 0x4004
+#define GL_LIGHT5 0x4005
+#define GL_LIGHT6 0x4006
+#define GL_LIGHT7 0x4007
+#define GL_SPOT_EXPONENT 0x1205
+#define GL_SPOT_CUTOFF 0x1206
+#define GL_CONSTANT_ATTENUATION 0x1207
+#define GL_LINEAR_ATTENUATION 0x1208
+#define GL_QUADRATIC_ATTENUATION 0x1209
+#define GL_AMBIENT 0x1200
+#define GL_DIFFUSE 0x1201
+#define GL_SPECULAR 0x1202
+#define GL_SHININESS 0x1601
+#define GL_EMISSION 0x1600
+#define GL_POSITION 0x1203
+#define GL_SPOT_DIRECTION 0x1204
+#define GL_AMBIENT_AND_DIFFUSE 0x1602
+#define GL_COLOR_INDEXES 0x1603
+#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52
+#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51
+#define GL_LIGHT_MODEL_AMBIENT 0x0B53
+#define GL_FRONT_AND_BACK 0x0408
+#define GL_SHADE_MODEL 0x0B54
+#define GL_FLAT 0x1D00
+#define GL_SMOOTH 0x1D01
+#define GL_COLOR_MATERIAL 0x0B57
+#define GL_COLOR_MATERIAL_FACE 0x0B55
+#define GL_COLOR_MATERIAL_PARAMETER 0x0B56
+#define GL_NORMALIZE 0x0BA1
+
+/* User clipping planes */
+#define GL_CLIP_PLANE0 0x3000
+#define GL_CLIP_PLANE1 0x3001
+#define GL_CLIP_PLANE2 0x3002
+#define GL_CLIP_PLANE3 0x3003
+#define GL_CLIP_PLANE4 0x3004
+#define GL_CLIP_PLANE5 0x3005
+
+/* Accumulation buffer */
+#define GL_ACCUM_RED_BITS 0x0D58
+#define GL_ACCUM_GREEN_BITS 0x0D59
+#define GL_ACCUM_BLUE_BITS 0x0D5A
+#define GL_ACCUM_ALPHA_BITS 0x0D5B
+#define GL_ACCUM_CLEAR_VALUE 0x0B80
+#define GL_ACCUM 0x0100
+#define GL_ADD 0x0104
+#define GL_LOAD 0x0101
+#define GL_MULT 0x0103
+#define GL_RETURN 0x0102
+
+/* Alpha testing */
+#define GL_ALPHA_TEST 0x0BC0
+#define GL_ALPHA_TEST_REF 0x0BC2
+#define GL_ALPHA_TEST_FUNC 0x0BC1
+
+/* Blending */
+#define GL_BLEND 0x0BE2
+#define GL_BLEND_SRC 0x0BE1
+#define GL_BLEND_DST 0x0BE0
+#define GL_ZERO 0x0
+#define GL_ONE 0x1
+#define GL_SRC_COLOR 0x0300
+#define GL_ONE_MINUS_SRC_COLOR 0x0301
+#define GL_SRC_ALPHA 0x0302
+#define GL_ONE_MINUS_SRC_ALPHA 0x0303
+#define GL_DST_ALPHA 0x0304
+#define GL_ONE_MINUS_DST_ALPHA 0x0305
+#define GL_DST_COLOR 0x0306
+#define GL_ONE_MINUS_DST_COLOR 0x0307
+#define GL_SRC_ALPHA_SATURATE 0x0308
+
+/* Render Mode */
+#define GL_FEEDBACK 0x1C01
+#define GL_RENDER 0x1C00
+#define GL_SELECT 0x1C02
+
+/* Feedback */
+#define GL_2D 0x0600
+#define GL_3D 0x0601
+#define GL_3D_COLOR 0x0602
+#define GL_3D_COLOR_TEXTURE 0x0603
+#define GL_4D_COLOR_TEXTURE 0x0604
+#define GL_POINT_TOKEN 0x0701
+#define GL_LINE_TOKEN 0x0702
+#define GL_LINE_RESET_TOKEN 0x0707
+#define GL_POLYGON_TOKEN 0x0703
+#define GL_BITMAP_TOKEN 0x0704
+#define GL_DRAW_PIXEL_TOKEN 0x0705
+#define GL_COPY_PIXEL_TOKEN 0x0706
+#define GL_PASS_THROUGH_TOKEN 0x0700
+#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0
+#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1
+#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2
+
+/* Selection */
+#define GL_SELECTION_BUFFER_POINTER 0x0DF3
+#define GL_SELECTION_BUFFER_SIZE 0x0DF4
+
+/* Fog */
+#define GL_FOG 0x0B60
+#define GL_FOG_MODE 0x0B65
+#define GL_FOG_DENSITY 0x0B62
+#define GL_FOG_COLOR 0x0B66
+#define GL_FOG_INDEX 0x0B61
+#define GL_FOG_START 0x0B63
+#define GL_FOG_END 0x0B64
+#define GL_LINEAR 0x2601
+#define GL_EXP 0x0800
+#define GL_EXP2 0x0801
+
+/* Logic Ops */
+#define GL_LOGIC_OP 0x0BF1
+#define GL_INDEX_LOGIC_OP 0x0BF1
+#define GL_COLOR_LOGIC_OP 0x0BF2
+#define GL_LOGIC_OP_MODE 0x0BF0
+#define GL_CLEAR 0x1500
+#define GL_SET 0x150F
+#define GL_COPY 0x1503
+#define GL_COPY_INVERTED 0x150C
+#define GL_NOOP 0x1505
+#define GL_INVERT 0x150A
+#define GL_AND 0x1501
+#define GL_NAND 0x150E
+#define GL_OR 0x1507
+#define GL_NOR 0x1508
+#define GL_XOR 0x1506
+#define GL_EQUIV 0x1509
+#define GL_AND_REVERSE 0x1502
+#define GL_AND_INVERTED 0x1504
+#define GL_OR_REVERSE 0x150B
+#define GL_OR_INVERTED 0x150D
+
+/* Stencil */
+#define GL_STENCIL_BITS 0x0D57
+#define GL_STENCIL_TEST 0x0B90
+#define GL_STENCIL_CLEAR_VALUE 0x0B91
+#define GL_STENCIL_FUNC 0x0B92
+#define GL_STENCIL_VALUE_MASK 0x0B93
+#define GL_STENCIL_FAIL 0x0B94
+#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
+#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
+#define GL_STENCIL_REF 0x0B97
+#define GL_STENCIL_WRITEMASK 0x0B98
+#define GL_STENCIL_INDEX 0x1901
+#define GL_KEEP 0x1E00
+#define GL_REPLACE 0x1E01
+#define GL_INCR 0x1E02
+#define GL_DECR 0x1E03
+
+/* Buffers, Pixel Drawing/Reading */
+#define GL_NONE 0x0
+#define GL_LEFT 0x0406
+#define GL_RIGHT 0x0407
+/*GL_FRONT 0x0404 */
+/*GL_BACK 0x0405 */
+/*GL_FRONT_AND_BACK 0x0408 */
+#define GL_FRONT_LEFT 0x0400
+#define GL_FRONT_RIGHT 0x0401
+#define GL_BACK_LEFT 0x0402
+#define GL_BACK_RIGHT 0x0403
+#define GL_AUX0 0x0409
+#define GL_AUX1 0x040A
+#define GL_AUX2 0x040B
+#define GL_AUX3 0x040C
+#define GL_COLOR_INDEX 0x1900
+#define GL_RED 0x1903
+#define GL_GREEN 0x1904
+#define GL_BLUE 0x1905
+#define GL_ALPHA 0x1906
+#define GL_LUMINANCE 0x1909
+#define GL_LUMINANCE_ALPHA 0x190A
+#define GL_ALPHA_BITS 0x0D55
+#define GL_RED_BITS 0x0D52
+#define GL_GREEN_BITS 0x0D53
+#define GL_BLUE_BITS 0x0D54
+#define GL_INDEX_BITS 0x0D51
+#define GL_SUBPIXEL_BITS 0x0D50
+#define GL_AUX_BUFFERS 0x0C00
+#define GL_READ_BUFFER 0x0C02
+#define GL_DRAW_BUFFER 0x0C01
+#define GL_DOUBLEBUFFER 0x0C32
+#define GL_STEREO 0x0C33
+#define GL_BITMAP 0x1A00
+#define GL_COLOR 0x1800
+#define GL_DEPTH 0x1801
+#define GL_STENCIL 0x1802
+#define GL_DITHER 0x0BD0
+#define GL_RGB 0x1907
+#define GL_RGBA 0x1908
+
+/* Implementation limits */
+#define GL_MAX_LIST_NESTING 0x0B31
+#define GL_MAX_EVAL_ORDER 0x0D30
+#define GL_MAX_LIGHTS 0x0D31
+#define GL_MAX_CLIP_PLANES 0x0D32
+#define GL_MAX_TEXTURE_SIZE 0x0D33
+#define GL_MAX_PIXEL_MAP_TABLE 0x0D34
+#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35
+#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36
+#define GL_MAX_NAME_STACK_DEPTH 0x0D37
+#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38
+#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39
+#define GL_MAX_VIEWPORT_DIMS 0x0D3A
+#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B
+
+/* Gets */
+#define GL_ATTRIB_STACK_DEPTH 0x0BB0
+#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1
+#define GL_COLOR_CLEAR_VALUE 0x0C22
+#define GL_COLOR_WRITEMASK 0x0C23
+#define GL_CURRENT_INDEX 0x0B01
+#define GL_CURRENT_COLOR 0x0B00
+#define GL_CURRENT_NORMAL 0x0B02
+#define GL_CURRENT_RASTER_COLOR 0x0B04
+#define GL_CURRENT_RASTER_DISTANCE 0x0B09
+#define GL_CURRENT_RASTER_INDEX 0x0B05
+#define GL_CURRENT_RASTER_POSITION 0x0B07
+#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06
+#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08
+#define GL_CURRENT_TEXTURE_COORDS 0x0B03
+#define GL_INDEX_CLEAR_VALUE 0x0C20
+#define GL_INDEX_MODE 0x0C30
+#define GL_INDEX_WRITEMASK 0x0C21
+#define GL_MODELVIEW_MATRIX 0x0BA6
+#define GL_MODELVIEW_STACK_DEPTH 0x0BA3
+#define GL_NAME_STACK_DEPTH 0x0D70
+#define GL_PROJECTION_MATRIX 0x0BA7
+#define GL_PROJECTION_STACK_DEPTH 0x0BA4
+#define GL_RENDER_MODE 0x0C40
+#define GL_RGBA_MODE 0x0C31
+#define GL_TEXTURE_MATRIX 0x0BA8
+#define GL_TEXTURE_STACK_DEPTH 0x0BA5
+#define GL_VIEWPORT 0x0BA2
+
+/* Evaluators */
+#define GL_AUTO_NORMAL 0x0D80
+#define GL_MAP1_COLOR_4 0x0D90
+#define GL_MAP1_INDEX 0x0D91
+#define GL_MAP1_NORMAL 0x0D92
+#define GL_MAP1_TEXTURE_COORD_1 0x0D93
+#define GL_MAP1_TEXTURE_COORD_2 0x0D94
+#define GL_MAP1_TEXTURE_COORD_3 0x0D95
+#define GL_MAP1_TEXTURE_COORD_4 0x0D96
+#define GL_MAP1_VERTEX_3 0x0D97
+#define GL_MAP1_VERTEX_4 0x0D98
+#define GL_MAP2_COLOR_4 0x0DB0
+#define GL_MAP2_INDEX 0x0DB1
+#define GL_MAP2_NORMAL 0x0DB2
+#define GL_MAP2_TEXTURE_COORD_1 0x0DB3
+#define GL_MAP2_TEXTURE_COORD_2 0x0DB4
+#define GL_MAP2_TEXTURE_COORD_3 0x0DB5
+#define GL_MAP2_TEXTURE_COORD_4 0x0DB6
+#define GL_MAP2_VERTEX_3 0x0DB7
+#define GL_MAP2_VERTEX_4 0x0DB8
+#define GL_MAP1_GRID_DOMAIN 0x0DD0
+#define GL_MAP1_GRID_SEGMENTS 0x0DD1
+#define GL_MAP2_GRID_DOMAIN 0x0DD2
+#define GL_MAP2_GRID_SEGMENTS 0x0DD3
+#define GL_COEFF 0x0A00
+#define GL_ORDER 0x0A01
+#define GL_DOMAIN 0x0A02
+
+/* Hints */
+#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50
+#define GL_POINT_SMOOTH_HINT 0x0C51
+#define GL_LINE_SMOOTH_HINT 0x0C52
+#define GL_POLYGON_SMOOTH_HINT 0x0C53
+#define GL_FOG_HINT 0x0C54
+#define GL_DONT_CARE 0x1100
+#define GL_FASTEST 0x1101
+#define GL_NICEST 0x1102
+
+/* Scissor box */
+#define GL_SCISSOR_BOX 0x0C10
+#define GL_SCISSOR_TEST 0x0C11
+
+/* Pixel Mode / Transfer */
+#define GL_MAP_COLOR 0x0D10
+#define GL_MAP_STENCIL 0x0D11
+#define GL_INDEX_SHIFT 0x0D12
+#define GL_INDEX_OFFSET 0x0D13
+#define GL_RED_SCALE 0x0D14
+#define GL_RED_BIAS 0x0D15
+#define GL_GREEN_SCALE 0x0D18
+#define GL_GREEN_BIAS 0x0D19
+#define GL_BLUE_SCALE 0x0D1A
+#define GL_BLUE_BIAS 0x0D1B
+#define GL_ALPHA_SCALE 0x0D1C
+#define GL_ALPHA_BIAS 0x0D1D
+#define GL_DEPTH_SCALE 0x0D1E
+#define GL_DEPTH_BIAS 0x0D1F
+#define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1
+#define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0
+#define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2
+#define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3
+#define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4
+#define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5
+#define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6
+#define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7
+#define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8
+#define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9
+#define GL_PIXEL_MAP_S_TO_S 0x0C71
+#define GL_PIXEL_MAP_I_TO_I 0x0C70
+#define GL_PIXEL_MAP_I_TO_R 0x0C72
+#define GL_PIXEL_MAP_I_TO_G 0x0C73
+#define GL_PIXEL_MAP_I_TO_B 0x0C74
+#define GL_PIXEL_MAP_I_TO_A 0x0C75
+#define GL_PIXEL_MAP_R_TO_R 0x0C76
+#define GL_PIXEL_MAP_G_TO_G 0x0C77
+#define GL_PIXEL_MAP_B_TO_B 0x0C78
+#define GL_PIXEL_MAP_A_TO_A 0x0C79
+#define GL_PACK_ALIGNMENT 0x0D05
+#define GL_PACK_LSB_FIRST 0x0D01
+#define GL_PACK_ROW_LENGTH 0x0D02
+#define GL_PACK_SKIP_PIXELS 0x0D04
+#define GL_PACK_SKIP_ROWS 0x0D03
+#define GL_PACK_SWAP_BYTES 0x0D00
+#define GL_UNPACK_ALIGNMENT 0x0CF5
+#define GL_UNPACK_LSB_FIRST 0x0CF1
+#define GL_UNPACK_ROW_LENGTH 0x0CF2
+#define GL_UNPACK_SKIP_PIXELS 0x0CF4
+#define GL_UNPACK_SKIP_ROWS 0x0CF3
+#define GL_UNPACK_SWAP_BYTES 0x0CF0
+#define GL_ZOOM_X 0x0D16
+#define GL_ZOOM_Y 0x0D17
+
+/* Texture mapping */
+#define GL_TEXTURE_ENV 0x2300
+#define GL_TEXTURE_ENV_MODE 0x2200
+#define GL_TEXTURE_1D 0x0DE0
+#define GL_TEXTURE_2D 0x0DE1
+#define GL_TEXTURE_WRAP_S 0x2802
+#define GL_TEXTURE_WRAP_T 0x2803
+#define GL_TEXTURE_MAG_FILTER 0x2800
+#define GL_TEXTURE_MIN_FILTER 0x2801
+#define GL_TEXTURE_ENV_COLOR 0x2201
+#define GL_TEXTURE_GEN_S 0x0C60
+#define GL_TEXTURE_GEN_T 0x0C61
+#define GL_TEXTURE_GEN_R 0x0C62
+#define GL_TEXTURE_GEN_Q 0x0C63
+#define GL_TEXTURE_GEN_MODE 0x2500
+#define GL_TEXTURE_BORDER_COLOR 0x1004
+#define GL_TEXTURE_WIDTH 0x1000
+#define GL_TEXTURE_HEIGHT 0x1001
+#define GL_TEXTURE_BORDER 0x1005
+#define GL_TEXTURE_COMPONENTS 0x1003
+#define GL_TEXTURE_RED_SIZE 0x805C
+#define GL_TEXTURE_GREEN_SIZE 0x805D
+#define GL_TEXTURE_BLUE_SIZE 0x805E
+#define GL_TEXTURE_ALPHA_SIZE 0x805F
+#define GL_TEXTURE_LUMINANCE_SIZE 0x8060
+#define GL_TEXTURE_INTENSITY_SIZE 0x8061
+#define GL_NEAREST_MIPMAP_NEAREST 0x2700
+#define GL_NEAREST_MIPMAP_LINEAR 0x2702
+#define GL_LINEAR_MIPMAP_NEAREST 0x2701
+#define GL_LINEAR_MIPMAP_LINEAR 0x2703
+#define GL_OBJECT_LINEAR 0x2401
+#define GL_OBJECT_PLANE 0x2501
+#define GL_EYE_LINEAR 0x2400
+#define GL_EYE_PLANE 0x2502
+#define GL_SPHERE_MAP 0x2402
+#define GL_DECAL 0x2101
+#define GL_MODULATE 0x2100
+#define GL_NEAREST 0x2600
+#define GL_REPEAT 0x2901
+#define GL_CLAMP 0x2900
+#define GL_S 0x2000
+#define GL_T 0x2001
+#define GL_R 0x2002
+#define GL_Q 0x2003
+
+/* Utility */
+#define GL_VENDOR 0x1F00
+#define GL_RENDERER 0x1F01
+#define GL_VERSION 0x1F02
+#define GL_EXTENSIONS 0x1F03
+
+/* Errors */
+#define GL_NO_ERROR 0x0
+#define GL_INVALID_ENUM 0x0500
+#define GL_INVALID_VALUE 0x0501
+#define GL_INVALID_OPERATION 0x0502
+#define GL_STACK_OVERFLOW 0x0503
+#define GL_STACK_UNDERFLOW 0x0504
+#define GL_OUT_OF_MEMORY 0x0505
+
+/* glPush/PopAttrib bits */
+#define GL_CURRENT_BIT 0x00000001
+#define GL_POINT_BIT 0x00000002
+#define GL_LINE_BIT 0x00000004
+#define GL_POLYGON_BIT 0x00000008
+#define GL_POLYGON_STIPPLE_BIT 0x00000010
+#define GL_PIXEL_MODE_BIT 0x00000020
+#define GL_LIGHTING_BIT 0x00000040
+#define GL_FOG_BIT 0x00000080
+#define GL_DEPTH_BUFFER_BIT 0x00000100
+#define GL_ACCUM_BUFFER_BIT 0x00000200
+#define GL_STENCIL_BUFFER_BIT 0x00000400
+#define GL_VIEWPORT_BIT 0x00000800
+#define GL_TRANSFORM_BIT 0x00001000
+#define GL_ENABLE_BIT 0x00002000
+#define GL_COLOR_BUFFER_BIT 0x00004000
+#define GL_HINT_BIT 0x00008000
+#define GL_EVAL_BIT 0x00010000
+#define GL_LIST_BIT 0x00020000
+#define GL_TEXTURE_BIT 0x00040000
+#define GL_SCISSOR_BIT 0x00080000
+#define GL_ALL_ATTRIB_BITS 0x000FFFFF
+
+
+/* OpenGL 1.1 */
+#define GL_PROXY_TEXTURE_1D 0x8063
+#define GL_PROXY_TEXTURE_2D 0x8064
+#define GL_TEXTURE_PRIORITY 0x8066
+#define GL_TEXTURE_RESIDENT 0x8067
+#define GL_TEXTURE_BINDING_1D 0x8068
+#define GL_TEXTURE_BINDING_2D 0x8069
+#define GL_TEXTURE_INTERNAL_FORMAT 0x1003
+#define GL_ALPHA4 0x803B
+#define GL_ALPHA8 0x803C
+#define GL_ALPHA12 0x803D
+#define GL_ALPHA16 0x803E
+#define GL_LUMINANCE4 0x803F
+#define GL_LUMINANCE8 0x8040
+#define GL_LUMINANCE12 0x8041
+#define GL_LUMINANCE16 0x8042
+#define GL_LUMINANCE4_ALPHA4 0x8043
+#define GL_LUMINANCE6_ALPHA2 0x8044
+#define GL_LUMINANCE8_ALPHA8 0x8045
+#define GL_LUMINANCE12_ALPHA4 0x8046
+#define GL_LUMINANCE12_ALPHA12 0x8047
+#define GL_LUMINANCE16_ALPHA16 0x8048
+#define GL_INTENSITY 0x8049
+#define GL_INTENSITY4 0x804A
+#define GL_INTENSITY8 0x804B
+#define GL_INTENSITY12 0x804C
+#define GL_INTENSITY16 0x804D
+#define GL_R3_G3_B2 0x2A10
+#define GL_RGB4 0x804F
+#define GL_RGB5 0x8050
+#define GL_RGB8 0x8051
+#define GL_RGB10 0x8052
+#define GL_RGB12 0x8053
+#define GL_RGB16 0x8054
+#define GL_RGBA2 0x8055
+#define GL_RGBA4 0x8056
+#define GL_RGB5_A1 0x8057
+#define GL_RGBA8 0x8058
+#define GL_RGB10_A2 0x8059
+#define GL_RGBA12 0x805A
+#define GL_RGBA16 0x805B
+#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001
+#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002
+#define GL_ALL_CLIENT_ATTRIB_BITS 0xFFFFFFFF
+#define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF
+
+
+
+/*
+ * Miscellaneous
+ */
+
+GLAPI void GLAPIENTRY glClearIndex( GLfloat c );
+
+GLAPI void GLAPIENTRY glClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha );
+
+GLAPI void GLAPIENTRY glClear( GLbitfield mask );
+
+GLAPI void GLAPIENTRY glIndexMask( GLuint mask );
+
+GLAPI void GLAPIENTRY glColorMask( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha );
+
+GLAPI void GLAPIENTRY glAlphaFunc( GLenum func, GLclampf ref );
+
+GLAPI void GLAPIENTRY glBlendFunc( GLenum sfactor, GLenum dfactor );
+
+GLAPI void GLAPIENTRY glLogicOp( GLenum opcode );
+
+GLAPI void GLAPIENTRY glCullFace( GLenum mode );
+
+GLAPI void GLAPIENTRY glFrontFace( GLenum mode );
+
+GLAPI void GLAPIENTRY glPointSize( GLfloat size );
+
+GLAPI void GLAPIENTRY glLineWidth( GLfloat width );
+
+GLAPI void GLAPIENTRY glLineStipple( GLint factor, GLushort pattern );
+
+GLAPI void GLAPIENTRY glPolygonMode( GLenum face, GLenum mode );
+
+GLAPI void GLAPIENTRY glPolygonOffset( GLfloat factor, GLfloat units );
+
+GLAPI void GLAPIENTRY glPolygonStipple( const GLubyte *mask );
+
+GLAPI void GLAPIENTRY glGetPolygonStipple( GLubyte *mask );
+
+GLAPI void GLAPIENTRY glEdgeFlag( GLboolean flag );
+
+GLAPI void GLAPIENTRY glEdgeFlagv( const GLboolean *flag );
+
+GLAPI void GLAPIENTRY glScissor( GLint x, GLint y, GLsizei width, GLsizei height);
+
+GLAPI void GLAPIENTRY glClipPlane( GLenum plane, const GLdouble *equation );
+
+GLAPI void GLAPIENTRY glGetClipPlane( GLenum plane, GLdouble *equation );
+
+GLAPI void GLAPIENTRY glDrawBuffer( GLenum mode );
+
+GLAPI void GLAPIENTRY glReadBuffer( GLenum mode );
+
+GLAPI void GLAPIENTRY glEnable( GLenum cap );
+
+GLAPI void GLAPIENTRY glDisable( GLenum cap );
+
+GLAPI GLboolean GLAPIENTRY glIsEnabled( GLenum cap );
+
+
+GLAPI void GLAPIENTRY glEnableClientState( GLenum cap ); /* 1.1 */
+
+GLAPI void GLAPIENTRY glDisableClientState( GLenum cap ); /* 1.1 */
+
+
+GLAPI void GLAPIENTRY glGetBooleanv( GLenum pname, GLboolean *params );
+
+GLAPI void GLAPIENTRY glGetDoublev( GLenum pname, GLdouble *params );
+
+GLAPI void GLAPIENTRY glGetFloatv( GLenum pname, GLfloat *params );
+
+GLAPI void GLAPIENTRY glGetIntegerv( GLenum pname, GLint *params );
+
+
+GLAPI void GLAPIENTRY glPushAttrib( GLbitfield mask );
+
+GLAPI void GLAPIENTRY glPopAttrib( void );
+
+
+GLAPI void GLAPIENTRY glPushClientAttrib( GLbitfield mask ); /* 1.1 */
+
+GLAPI void GLAPIENTRY glPopClientAttrib( void ); /* 1.1 */
+
+
+GLAPI GLint GLAPIENTRY glRenderMode( GLenum mode );
+
+GLAPI GLenum GLAPIENTRY glGetError( void );
+
+GLAPI const GLubyte * GLAPIENTRY glGetString( GLenum name );
+
+GLAPI void GLAPIENTRY glFinish( void );
+
+GLAPI void GLAPIENTRY glFlush( void );
+
+GLAPI void GLAPIENTRY glHint( GLenum target, GLenum mode );
+
+
+/*
+ * Depth Buffer
+ */
+
+GLAPI void GLAPIENTRY glClearDepth( GLclampd depth );
+
+GLAPI void GLAPIENTRY glDepthFunc( GLenum func );
+
+GLAPI void GLAPIENTRY glDepthMask( GLboolean flag );
+
+GLAPI void GLAPIENTRY glDepthRange( GLclampd near_val, GLclampd far_val );
+
+
+/*
+ * Accumulation Buffer
+ */
+
+GLAPI void GLAPIENTRY glClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha );
+
+GLAPI void GLAPIENTRY glAccum( GLenum op, GLfloat value );
+
+
+/*
+ * Transformation
+ */
+
+GLAPI void GLAPIENTRY glMatrixMode( GLenum mode );
+
+GLAPI void GLAPIENTRY glOrtho( GLdouble left, GLdouble right,
+ GLdouble bottom, GLdouble top,
+ GLdouble near_val, GLdouble far_val );
+
+GLAPI void GLAPIENTRY glFrustum( GLdouble left, GLdouble right,
+ GLdouble bottom, GLdouble top,
+ GLdouble near_val, GLdouble far_val );
+
+GLAPI void GLAPIENTRY glViewport( GLint x, GLint y,
+ GLsizei width, GLsizei height );
+
+GLAPI void GLAPIENTRY glPushMatrix( void );
+
+GLAPI void GLAPIENTRY glPopMatrix( void );
+
+GLAPI void GLAPIENTRY glLoadIdentity( void );
+
+GLAPI void GLAPIENTRY glLoadMatrixd( const GLdouble *m );
+GLAPI void GLAPIENTRY glLoadMatrixf( const GLfloat *m );
+
+GLAPI void GLAPIENTRY glMultMatrixd( const GLdouble *m );
+GLAPI void GLAPIENTRY glMultMatrixf( const GLfloat *m );
+
+GLAPI void GLAPIENTRY glRotated( GLdouble angle,
+ GLdouble x, GLdouble y, GLdouble z );
+GLAPI void GLAPIENTRY glRotatef( GLfloat angle,
+ GLfloat x, GLfloat y, GLfloat z );
+
+GLAPI void GLAPIENTRY glScaled( GLdouble x, GLdouble y, GLdouble z );
+GLAPI void GLAPIENTRY glScalef( GLfloat x, GLfloat y, GLfloat z );
+
+GLAPI void GLAPIENTRY glTranslated( GLdouble x, GLdouble y, GLdouble z );
+GLAPI void GLAPIENTRY glTranslatef( GLfloat x, GLfloat y, GLfloat z );
+
+
+/*
+ * Display Lists
+ */
+
+GLAPI GLboolean GLAPIENTRY glIsList( GLuint list );
+
+GLAPI void GLAPIENTRY glDeleteLists( GLuint list, GLsizei range );
+
+GLAPI GLuint GLAPIENTRY glGenLists( GLsizei range );
+
+GLAPI void GLAPIENTRY glNewList( GLuint list, GLenum mode );
+
+GLAPI void GLAPIENTRY glEndList( void );
+
+GLAPI void GLAPIENTRY glCallList( GLuint list );
+
+GLAPI void GLAPIENTRY glCallLists( GLsizei n, GLenum type,
+ const GLvoid *lists );
+
+GLAPI void GLAPIENTRY glListBase( GLuint base );
+
+
+/*
+ * Drawing Functions
+ */
+
+GLAPI void GLAPIENTRY glBegin( GLenum mode );
+
+GLAPI void GLAPIENTRY glEnd( void );
+
+
+GLAPI void GLAPIENTRY glVertex2d( GLdouble x, GLdouble y );
+GLAPI void GLAPIENTRY glVertex2f( GLfloat x, GLfloat y );
+GLAPI void GLAPIENTRY glVertex2i( GLint x, GLint y );
+GLAPI void GLAPIENTRY glVertex2s( GLshort x, GLshort y );
+
+GLAPI void GLAPIENTRY glVertex3d( GLdouble x, GLdouble y, GLdouble z );
+GLAPI void GLAPIENTRY glVertex3f( GLfloat x, GLfloat y, GLfloat z );
+GLAPI void GLAPIENTRY glVertex3i( GLint x, GLint y, GLint z );
+GLAPI void GLAPIENTRY glVertex3s( GLshort x, GLshort y, GLshort z );
+
+GLAPI void GLAPIENTRY glVertex4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w );
+GLAPI void GLAPIENTRY glVertex4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w );
+GLAPI void GLAPIENTRY glVertex4i( GLint x, GLint y, GLint z, GLint w );
+GLAPI void GLAPIENTRY glVertex4s( GLshort x, GLshort y, GLshort z, GLshort w );
+
+GLAPI void GLAPIENTRY glVertex2dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glVertex2fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glVertex2iv( const GLint *v );
+GLAPI void GLAPIENTRY glVertex2sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY glVertex3dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glVertex3fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glVertex3iv( const GLint *v );
+GLAPI void GLAPIENTRY glVertex3sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY glVertex4dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glVertex4fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glVertex4iv( const GLint *v );
+GLAPI void GLAPIENTRY glVertex4sv( const GLshort *v );
+
+
+GLAPI void GLAPIENTRY glNormal3b( GLbyte nx, GLbyte ny, GLbyte nz );
+GLAPI void GLAPIENTRY glNormal3d( GLdouble nx, GLdouble ny, GLdouble nz );
+GLAPI void GLAPIENTRY glNormal3f( GLfloat nx, GLfloat ny, GLfloat nz );
+GLAPI void GLAPIENTRY glNormal3i( GLint nx, GLint ny, GLint nz );
+GLAPI void GLAPIENTRY glNormal3s( GLshort nx, GLshort ny, GLshort nz );
+
+GLAPI void GLAPIENTRY glNormal3bv( const GLbyte *v );
+GLAPI void GLAPIENTRY glNormal3dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glNormal3fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glNormal3iv( const GLint *v );
+GLAPI void GLAPIENTRY glNormal3sv( const GLshort *v );
+
+
+GLAPI void GLAPIENTRY glIndexd( GLdouble c );
+GLAPI void GLAPIENTRY glIndexf( GLfloat c );
+GLAPI void GLAPIENTRY glIndexi( GLint c );
+GLAPI void GLAPIENTRY glIndexs( GLshort c );
+GLAPI void GLAPIENTRY glIndexub( GLubyte c ); /* 1.1 */
+
+GLAPI void GLAPIENTRY glIndexdv( const GLdouble *c );
+GLAPI void GLAPIENTRY glIndexfv( const GLfloat *c );
+GLAPI void GLAPIENTRY glIndexiv( const GLint *c );
+GLAPI void GLAPIENTRY glIndexsv( const GLshort *c );
+GLAPI void GLAPIENTRY glIndexubv( const GLubyte *c ); /* 1.1 */
+
+GLAPI void GLAPIENTRY glColor3b( GLbyte red, GLbyte green, GLbyte blue );
+GLAPI void GLAPIENTRY glColor3d( GLdouble red, GLdouble green, GLdouble blue );
+GLAPI void GLAPIENTRY glColor3f( GLfloat red, GLfloat green, GLfloat blue );
+GLAPI void GLAPIENTRY glColor3i( GLint red, GLint green, GLint blue );
+GLAPI void GLAPIENTRY glColor3s( GLshort red, GLshort green, GLshort blue );
+GLAPI void GLAPIENTRY glColor3ub( GLubyte red, GLubyte green, GLubyte blue );
+GLAPI void GLAPIENTRY glColor3ui( GLuint red, GLuint green, GLuint blue );
+GLAPI void GLAPIENTRY glColor3us( GLushort red, GLushort green, GLushort blue );
+
+GLAPI void GLAPIENTRY glColor4b( GLbyte red, GLbyte green,
+ GLbyte blue, GLbyte alpha );
+GLAPI void GLAPIENTRY glColor4d( GLdouble red, GLdouble green,
+ GLdouble blue, GLdouble alpha );
+GLAPI void GLAPIENTRY glColor4f( GLfloat red, GLfloat green,
+ GLfloat blue, GLfloat alpha );
+GLAPI void GLAPIENTRY glColor4i( GLint red, GLint green,
+ GLint blue, GLint alpha );
+GLAPI void GLAPIENTRY glColor4s( GLshort red, GLshort green,
+ GLshort blue, GLshort alpha );
+GLAPI void GLAPIENTRY glColor4ub( GLubyte red, GLubyte green,
+ GLubyte blue, GLubyte alpha );
+GLAPI void GLAPIENTRY glColor4ui( GLuint red, GLuint green,
+ GLuint blue, GLuint alpha );
+GLAPI void GLAPIENTRY glColor4us( GLushort red, GLushort green,
+ GLushort blue, GLushort alpha );
+
+
+GLAPI void GLAPIENTRY glColor3bv( const GLbyte *v );
+GLAPI void GLAPIENTRY glColor3dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glColor3fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glColor3iv( const GLint *v );
+GLAPI void GLAPIENTRY glColor3sv( const GLshort *v );
+GLAPI void GLAPIENTRY glColor3ubv( const GLubyte *v );
+GLAPI void GLAPIENTRY glColor3uiv( const GLuint *v );
+GLAPI void GLAPIENTRY glColor3usv( const GLushort *v );
+
+GLAPI void GLAPIENTRY glColor4bv( const GLbyte *v );
+GLAPI void GLAPIENTRY glColor4dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glColor4fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glColor4iv( const GLint *v );
+GLAPI void GLAPIENTRY glColor4sv( const GLshort *v );
+GLAPI void GLAPIENTRY glColor4ubv( const GLubyte *v );
+GLAPI void GLAPIENTRY glColor4uiv( const GLuint *v );
+GLAPI void GLAPIENTRY glColor4usv( const GLushort *v );
+
+
+GLAPI void GLAPIENTRY glTexCoord1d( GLdouble s );
+GLAPI void GLAPIENTRY glTexCoord1f( GLfloat s );
+GLAPI void GLAPIENTRY glTexCoord1i( GLint s );
+GLAPI void GLAPIENTRY glTexCoord1s( GLshort s );
+
+GLAPI void GLAPIENTRY glTexCoord2d( GLdouble s, GLdouble t );
+GLAPI void GLAPIENTRY glTexCoord2f( GLfloat s, GLfloat t );
+GLAPI void GLAPIENTRY glTexCoord2i( GLint s, GLint t );
+GLAPI void GLAPIENTRY glTexCoord2s( GLshort s, GLshort t );
+
+GLAPI void GLAPIENTRY glTexCoord3d( GLdouble s, GLdouble t, GLdouble r );
+GLAPI void GLAPIENTRY glTexCoord3f( GLfloat s, GLfloat t, GLfloat r );
+GLAPI void GLAPIENTRY glTexCoord3i( GLint s, GLint t, GLint r );
+GLAPI void GLAPIENTRY glTexCoord3s( GLshort s, GLshort t, GLshort r );
+
+GLAPI void GLAPIENTRY glTexCoord4d( GLdouble s, GLdouble t, GLdouble r, GLdouble q );
+GLAPI void GLAPIENTRY glTexCoord4f( GLfloat s, GLfloat t, GLfloat r, GLfloat q );
+GLAPI void GLAPIENTRY glTexCoord4i( GLint s, GLint t, GLint r, GLint q );
+GLAPI void GLAPIENTRY glTexCoord4s( GLshort s, GLshort t, GLshort r, GLshort q );
+
+GLAPI void GLAPIENTRY glTexCoord1dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glTexCoord1fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glTexCoord1iv( const GLint *v );
+GLAPI void GLAPIENTRY glTexCoord1sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY glTexCoord2dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glTexCoord2fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glTexCoord2iv( const GLint *v );
+GLAPI void GLAPIENTRY glTexCoord2sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY glTexCoord3dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glTexCoord3fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glTexCoord3iv( const GLint *v );
+GLAPI void GLAPIENTRY glTexCoord3sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY glTexCoord4dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glTexCoord4fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glTexCoord4iv( const GLint *v );
+GLAPI void GLAPIENTRY glTexCoord4sv( const GLshort *v );
+
+
+GLAPI void GLAPIENTRY glRasterPos2d( GLdouble x, GLdouble y );
+GLAPI void GLAPIENTRY glRasterPos2f( GLfloat x, GLfloat y );
+GLAPI void GLAPIENTRY glRasterPos2i( GLint x, GLint y );
+GLAPI void GLAPIENTRY glRasterPos2s( GLshort x, GLshort y );
+
+GLAPI void GLAPIENTRY glRasterPos3d( GLdouble x, GLdouble y, GLdouble z );
+GLAPI void GLAPIENTRY glRasterPos3f( GLfloat x, GLfloat y, GLfloat z );
+GLAPI void GLAPIENTRY glRasterPos3i( GLint x, GLint y, GLint z );
+GLAPI void GLAPIENTRY glRasterPos3s( GLshort x, GLshort y, GLshort z );
+
+GLAPI void GLAPIENTRY glRasterPos4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w );
+GLAPI void GLAPIENTRY glRasterPos4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w );
+GLAPI void GLAPIENTRY glRasterPos4i( GLint x, GLint y, GLint z, GLint w );
+GLAPI void GLAPIENTRY glRasterPos4s( GLshort x, GLshort y, GLshort z, GLshort w );
+
+GLAPI void GLAPIENTRY glRasterPos2dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glRasterPos2fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glRasterPos2iv( const GLint *v );
+GLAPI void GLAPIENTRY glRasterPos2sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY glRasterPos3dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glRasterPos3fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glRasterPos3iv( const GLint *v );
+GLAPI void GLAPIENTRY glRasterPos3sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY glRasterPos4dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glRasterPos4fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glRasterPos4iv( const GLint *v );
+GLAPI void GLAPIENTRY glRasterPos4sv( const GLshort *v );
+
+
+GLAPI void GLAPIENTRY glRectd( GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2 );
+GLAPI void GLAPIENTRY glRectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 );
+GLAPI void GLAPIENTRY glRecti( GLint x1, GLint y1, GLint x2, GLint y2 );
+GLAPI void GLAPIENTRY glRects( GLshort x1, GLshort y1, GLshort x2, GLshort y2 );
+
+
+GLAPI void GLAPIENTRY glRectdv( const GLdouble *v1, const GLdouble *v2 );
+GLAPI void GLAPIENTRY glRectfv( const GLfloat *v1, const GLfloat *v2 );
+GLAPI void GLAPIENTRY glRectiv( const GLint *v1, const GLint *v2 );
+GLAPI void GLAPIENTRY glRectsv( const GLshort *v1, const GLshort *v2 );
+
+
+/*
+ * Vertex Arrays (1.1)
+ */
+
+GLAPI void GLAPIENTRY glVertexPointer( GLint size, GLenum type,
+ GLsizei stride, const GLvoid *ptr );
+
+GLAPI void GLAPIENTRY glNormalPointer( GLenum type, GLsizei stride,
+ const GLvoid *ptr );
+
+GLAPI void GLAPIENTRY glColorPointer( GLint size, GLenum type,
+ GLsizei stride, const GLvoid *ptr );
+
+GLAPI void GLAPIENTRY glIndexPointer( GLenum type, GLsizei stride,
+ const GLvoid *ptr );
+
+GLAPI void GLAPIENTRY glTexCoordPointer( GLint size, GLenum type,
+ GLsizei stride, const GLvoid *ptr );
+
+GLAPI void GLAPIENTRY glEdgeFlagPointer( GLsizei stride, const GLvoid *ptr );
+
+GLAPI void GLAPIENTRY glGetPointerv( GLenum pname, GLvoid **params );
+
+GLAPI void GLAPIENTRY glArrayElement( GLint i );
+
+GLAPI void GLAPIENTRY glDrawArrays( GLenum mode, GLint first, GLsizei count );
+
+GLAPI void GLAPIENTRY glDrawElements( GLenum mode, GLsizei count,
+ GLenum type, const GLvoid *indices );
+
+GLAPI void GLAPIENTRY glInterleavedArrays( GLenum format, GLsizei stride,
+ const GLvoid *pointer );
+
+/*
+ * Lighting
+ */
+
+GLAPI void GLAPIENTRY glShadeModel( GLenum mode );
+
+GLAPI void GLAPIENTRY glLightf( GLenum light, GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glLighti( GLenum light, GLenum pname, GLint param );
+GLAPI void GLAPIENTRY glLightfv( GLenum light, GLenum pname,
+ const GLfloat *params );
+GLAPI void GLAPIENTRY glLightiv( GLenum light, GLenum pname,
+ const GLint *params );
+
+GLAPI void GLAPIENTRY glGetLightfv( GLenum light, GLenum pname,
+ GLfloat *params );
+GLAPI void GLAPIENTRY glGetLightiv( GLenum light, GLenum pname,
+ GLint *params );
+
+GLAPI void GLAPIENTRY glLightModelf( GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glLightModeli( GLenum pname, GLint param );
+GLAPI void GLAPIENTRY glLightModelfv( GLenum pname, const GLfloat *params );
+GLAPI void GLAPIENTRY glLightModeliv( GLenum pname, const GLint *params );
+
+GLAPI void GLAPIENTRY glMaterialf( GLenum face, GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glMateriali( GLenum face, GLenum pname, GLint param );
+GLAPI void GLAPIENTRY glMaterialfv( GLenum face, GLenum pname, const GLfloat *params );
+GLAPI void GLAPIENTRY glMaterialiv( GLenum face, GLenum pname, const GLint *params );
+
+GLAPI void GLAPIENTRY glGetMaterialfv( GLenum face, GLenum pname, GLfloat *params );
+GLAPI void GLAPIENTRY glGetMaterialiv( GLenum face, GLenum pname, GLint *params );
+
+GLAPI void GLAPIENTRY glColorMaterial( GLenum face, GLenum mode );
+
+
+/*
+ * Raster functions
+ */
+
+GLAPI void GLAPIENTRY glPixelZoom( GLfloat xfactor, GLfloat yfactor );
+
+GLAPI void GLAPIENTRY glPixelStoref( GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glPixelStorei( GLenum pname, GLint param );
+
+GLAPI void GLAPIENTRY glPixelTransferf( GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glPixelTransferi( GLenum pname, GLint param );
+
+GLAPI void GLAPIENTRY glPixelMapfv( GLenum map, GLsizei mapsize,
+ const GLfloat *values );
+GLAPI void GLAPIENTRY glPixelMapuiv( GLenum map, GLsizei mapsize,
+ const GLuint *values );
+GLAPI void GLAPIENTRY glPixelMapusv( GLenum map, GLsizei mapsize,
+ const GLushort *values );
+
+GLAPI void GLAPIENTRY glGetPixelMapfv( GLenum map, GLfloat *values );
+GLAPI void GLAPIENTRY glGetPixelMapuiv( GLenum map, GLuint *values );
+GLAPI void GLAPIENTRY glGetPixelMapusv( GLenum map, GLushort *values );
+
+GLAPI void GLAPIENTRY glBitmap( GLsizei width, GLsizei height,
+ GLfloat xorig, GLfloat yorig,
+ GLfloat xmove, GLfloat ymove,
+ const GLubyte *bitmap );
+
+GLAPI void GLAPIENTRY glReadPixels( GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ GLvoid *pixels );
+
+GLAPI void GLAPIENTRY glDrawPixels( GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const GLvoid *pixels );
+
+GLAPI void GLAPIENTRY glCopyPixels( GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ GLenum type );
+
+/*
+ * Stenciling
+ */
+
+GLAPI void GLAPIENTRY glStencilFunc( GLenum func, GLint ref, GLuint mask );
+
+GLAPI void GLAPIENTRY glStencilMask( GLuint mask );
+
+GLAPI void GLAPIENTRY glStencilOp( GLenum fail, GLenum zfail, GLenum zpass );
+
+GLAPI void GLAPIENTRY glClearStencil( GLint s );
+
+
+
+/*
+ * Texture mapping
+ */
+
+GLAPI void GLAPIENTRY glTexGend( GLenum coord, GLenum pname, GLdouble param );
+GLAPI void GLAPIENTRY glTexGenf( GLenum coord, GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glTexGeni( GLenum coord, GLenum pname, GLint param );
+
+GLAPI void GLAPIENTRY glTexGendv( GLenum coord, GLenum pname, const GLdouble *params );
+GLAPI void GLAPIENTRY glTexGenfv( GLenum coord, GLenum pname, const GLfloat *params );
+GLAPI void GLAPIENTRY glTexGeniv( GLenum coord, GLenum pname, const GLint *params );
+
+GLAPI void GLAPIENTRY glGetTexGendv( GLenum coord, GLenum pname, GLdouble *params );
+GLAPI void GLAPIENTRY glGetTexGenfv( GLenum coord, GLenum pname, GLfloat *params );
+GLAPI void GLAPIENTRY glGetTexGeniv( GLenum coord, GLenum pname, GLint *params );
+
+
+GLAPI void GLAPIENTRY glTexEnvf( GLenum target, GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glTexEnvi( GLenum target, GLenum pname, GLint param );
+
+GLAPI void GLAPIENTRY glTexEnvfv( GLenum target, GLenum pname, const GLfloat *params );
+GLAPI void GLAPIENTRY glTexEnviv( GLenum target, GLenum pname, const GLint *params );
+
+GLAPI void GLAPIENTRY glGetTexEnvfv( GLenum target, GLenum pname, GLfloat *params );
+GLAPI void GLAPIENTRY glGetTexEnviv( GLenum target, GLenum pname, GLint *params );
+
+
+GLAPI void GLAPIENTRY glTexParameterf( GLenum target, GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glTexParameteri( GLenum target, GLenum pname, GLint param );
+
+GLAPI void GLAPIENTRY glTexParameterfv( GLenum target, GLenum pname,
+ const GLfloat *params );
+GLAPI void GLAPIENTRY glTexParameteriv( GLenum target, GLenum pname,
+ const GLint *params );
+
+GLAPI void GLAPIENTRY glGetTexParameterfv( GLenum target,
+ GLenum pname, GLfloat *params);
+GLAPI void GLAPIENTRY glGetTexParameteriv( GLenum target,
+ GLenum pname, GLint *params );
+
+GLAPI void GLAPIENTRY glGetTexLevelParameterfv( GLenum target, GLint level,
+ GLenum pname, GLfloat *params );
+GLAPI void GLAPIENTRY glGetTexLevelParameteriv( GLenum target, GLint level,
+ GLenum pname, GLint *params );
+
+
+GLAPI void GLAPIENTRY glTexImage1D( GLenum target, GLint level,
+ GLint internalFormat,
+ GLsizei width, GLint border,
+ GLenum format, GLenum type,
+ const GLvoid *pixels );
+
+GLAPI void GLAPIENTRY glTexImage2D( GLenum target, GLint level,
+ GLint internalFormat,
+ GLsizei width, GLsizei height,
+ GLint border, GLenum format, GLenum type,
+ const GLvoid *pixels );
+
+GLAPI void GLAPIENTRY glGetTexImage( GLenum target, GLint level,
+ GLenum format, GLenum type,
+ GLvoid *pixels );
+
+
+/* 1.1 functions */
+
+GLAPI void GLAPIENTRY glGenTextures( GLsizei n, GLuint *textures );
+
+GLAPI void GLAPIENTRY glDeleteTextures( GLsizei n, const GLuint *textures);
+
+GLAPI void GLAPIENTRY glBindTexture( GLenum target, GLuint texture );
+
+GLAPI void GLAPIENTRY glPrioritizeTextures( GLsizei n,
+ const GLuint *textures,
+ const GLclampf *priorities );
+
+GLAPI GLboolean GLAPIENTRY glAreTexturesResident( GLsizei n,
+ const GLuint *textures,
+ GLboolean *residences );
+
+GLAPI GLboolean GLAPIENTRY glIsTexture( GLuint texture );
+
+
+GLAPI void GLAPIENTRY glTexSubImage1D( GLenum target, GLint level,
+ GLint xoffset,
+ GLsizei width, GLenum format,
+ GLenum type, const GLvoid *pixels );
+
+
+GLAPI void GLAPIENTRY glTexSubImage2D( GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const GLvoid *pixels );
+
+
+GLAPI void GLAPIENTRY glCopyTexImage1D( GLenum target, GLint level,
+ GLenum internalformat,
+ GLint x, GLint y,
+ GLsizei width, GLint border );
+
+
+GLAPI void GLAPIENTRY glCopyTexImage2D( GLenum target, GLint level,
+ GLenum internalformat,
+ GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ GLint border );
+
+
+GLAPI void GLAPIENTRY glCopyTexSubImage1D( GLenum target, GLint level,
+ GLint xoffset, GLint x, GLint y,
+ GLsizei width );
+
+
+GLAPI void GLAPIENTRY glCopyTexSubImage2D( GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLint x, GLint y,
+ GLsizei width, GLsizei height );
+
+
+/*
+ * Evaluators
+ */
+
+GLAPI void GLAPIENTRY glMap1d( GLenum target, GLdouble u1, GLdouble u2,
+ GLint stride,
+ GLint order, const GLdouble *points );
+GLAPI void GLAPIENTRY glMap1f( GLenum target, GLfloat u1, GLfloat u2,
+ GLint stride,
+ GLint order, const GLfloat *points );
+
+GLAPI void GLAPIENTRY glMap2d( GLenum target,
+ GLdouble u1, GLdouble u2, GLint ustride, GLint uorder,
+ GLdouble v1, GLdouble v2, GLint vstride, GLint vorder,
+ const GLdouble *points );
+GLAPI void GLAPIENTRY glMap2f( GLenum target,
+ GLfloat u1, GLfloat u2, GLint ustride, GLint uorder,
+ GLfloat v1, GLfloat v2, GLint vstride, GLint vorder,
+ const GLfloat *points );
+
+GLAPI void GLAPIENTRY glGetMapdv( GLenum target, GLenum query, GLdouble *v );
+GLAPI void GLAPIENTRY glGetMapfv( GLenum target, GLenum query, GLfloat *v );
+GLAPI void GLAPIENTRY glGetMapiv( GLenum target, GLenum query, GLint *v );
+
+GLAPI void GLAPIENTRY glEvalCoord1d( GLdouble u );
+GLAPI void GLAPIENTRY glEvalCoord1f( GLfloat u );
+
+GLAPI void GLAPIENTRY glEvalCoord1dv( const GLdouble *u );
+GLAPI void GLAPIENTRY glEvalCoord1fv( const GLfloat *u );
+
+GLAPI void GLAPIENTRY glEvalCoord2d( GLdouble u, GLdouble v );
+GLAPI void GLAPIENTRY glEvalCoord2f( GLfloat u, GLfloat v );
+
+GLAPI void GLAPIENTRY glEvalCoord2dv( const GLdouble *u );
+GLAPI void GLAPIENTRY glEvalCoord2fv( const GLfloat *u );
+
+GLAPI void GLAPIENTRY glMapGrid1d( GLint un, GLdouble u1, GLdouble u2 );
+GLAPI void GLAPIENTRY glMapGrid1f( GLint un, GLfloat u1, GLfloat u2 );
+
+GLAPI void GLAPIENTRY glMapGrid2d( GLint un, GLdouble u1, GLdouble u2,
+ GLint vn, GLdouble v1, GLdouble v2 );
+GLAPI void GLAPIENTRY glMapGrid2f( GLint un, GLfloat u1, GLfloat u2,
+ GLint vn, GLfloat v1, GLfloat v2 );
+
+GLAPI void GLAPIENTRY glEvalPoint1( GLint i );
+
+GLAPI void GLAPIENTRY glEvalPoint2( GLint i, GLint j );
+
+GLAPI void GLAPIENTRY glEvalMesh1( GLenum mode, GLint i1, GLint i2 );
+
+GLAPI void GLAPIENTRY glEvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 );
+
+
+/*
+ * Fog
+ */
+
+GLAPI void GLAPIENTRY glFogf( GLenum pname, GLfloat param );
+
+GLAPI void GLAPIENTRY glFogi( GLenum pname, GLint param );
+
+GLAPI void GLAPIENTRY glFogfv( GLenum pname, const GLfloat *params );
+
+GLAPI void GLAPIENTRY glFogiv( GLenum pname, const GLint *params );
+
+
+/*
+ * Selection and Feedback
+ */
+
+GLAPI void GLAPIENTRY glFeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer );
+
+GLAPI void GLAPIENTRY glPassThrough( GLfloat token );
+
+GLAPI void GLAPIENTRY glSelectBuffer( GLsizei size, GLuint *buffer );
+
+GLAPI void GLAPIENTRY glInitNames( void );
+
+GLAPI void GLAPIENTRY glLoadName( GLuint name );
+
+GLAPI void GLAPIENTRY glPushName( GLuint name );
+
+GLAPI void GLAPIENTRY glPopName( void );
+
+
+
+/*
+ * OpenGL 1.2
+ */
+
+#define GL_RESCALE_NORMAL 0x803A
+#define GL_CLAMP_TO_EDGE 0x812F
+#define GL_MAX_ELEMENTS_VERTICES 0x80E8
+#define GL_MAX_ELEMENTS_INDICES 0x80E9
+#define GL_BGR 0x80E0
+#define GL_BGRA 0x80E1
+#define GL_UNSIGNED_BYTE_3_3_2 0x8032
+#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362
+#define GL_UNSIGNED_SHORT_5_6_5 0x8363
+#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364
+#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
+#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365
+#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
+#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366
+#define GL_UNSIGNED_INT_8_8_8_8 0x8035
+#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367
+#define GL_UNSIGNED_INT_10_10_10_2 0x8036
+#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
+#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8
+#define GL_SINGLE_COLOR 0x81F9
+#define GL_SEPARATE_SPECULAR_COLOR 0x81FA
+#define GL_TEXTURE_MIN_LOD 0x813A
+#define GL_TEXTURE_MAX_LOD 0x813B
+#define GL_TEXTURE_BASE_LEVEL 0x813C
+#define GL_TEXTURE_MAX_LEVEL 0x813D
+#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12
+#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13
+#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22
+#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23
+#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
+#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
+#define GL_PACK_SKIP_IMAGES 0x806B
+#define GL_PACK_IMAGE_HEIGHT 0x806C
+#define GL_UNPACK_SKIP_IMAGES 0x806D
+#define GL_UNPACK_IMAGE_HEIGHT 0x806E
+#define GL_TEXTURE_3D 0x806F
+#define GL_PROXY_TEXTURE_3D 0x8070
+#define GL_TEXTURE_DEPTH 0x8071
+#define GL_TEXTURE_WRAP_R 0x8072
+#define GL_MAX_3D_TEXTURE_SIZE 0x8073
+#define GL_TEXTURE_BINDING_3D 0x806A
+
+GLAPI void GLAPIENTRY glDrawRangeElements( GLenum mode, GLuint start,
+ GLuint end, GLsizei count, GLenum type, const GLvoid *indices );
+
+GLAPI void GLAPIENTRY glTexImage3D( GLenum target, GLint level,
+ GLint internalFormat,
+ GLsizei width, GLsizei height,
+ GLsizei depth, GLint border,
+ GLenum format, GLenum type,
+ const GLvoid *pixels );
+
+GLAPI void GLAPIENTRY glTexSubImage3D( GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLint zoffset, GLsizei width,
+ GLsizei height, GLsizei depth,
+ GLenum format,
+ GLenum type, const GLvoid *pixels);
+
+GLAPI void GLAPIENTRY glCopyTexSubImage3D( GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLint zoffset, GLint x,
+ GLint y, GLsizei width,
+ GLsizei height );
+
+typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
+typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+
+
+/*
+ * GL_ARB_imaging
+ */
+
+#define GL_CONSTANT_COLOR 0x8001
+#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
+#define GL_CONSTANT_ALPHA 0x8003
+#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
+#define GL_COLOR_TABLE 0x80D0
+#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1
+#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2
+#define GL_PROXY_COLOR_TABLE 0x80D3
+#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4
+#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5
+#define GL_COLOR_TABLE_SCALE 0x80D6
+#define GL_COLOR_TABLE_BIAS 0x80D7
+#define GL_COLOR_TABLE_FORMAT 0x80D8
+#define GL_COLOR_TABLE_WIDTH 0x80D9
+#define GL_COLOR_TABLE_RED_SIZE 0x80DA
+#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB
+#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC
+#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD
+#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE
+#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF
+#define GL_CONVOLUTION_1D 0x8010
+#define GL_CONVOLUTION_2D 0x8011
+#define GL_SEPARABLE_2D 0x8012
+#define GL_CONVOLUTION_BORDER_MODE 0x8013
+#define GL_CONVOLUTION_FILTER_SCALE 0x8014
+#define GL_CONVOLUTION_FILTER_BIAS 0x8015
+#define GL_REDUCE 0x8016
+#define GL_CONVOLUTION_FORMAT 0x8017
+#define GL_CONVOLUTION_WIDTH 0x8018
+#define GL_CONVOLUTION_HEIGHT 0x8019
+#define GL_MAX_CONVOLUTION_WIDTH 0x801A
+#define GL_MAX_CONVOLUTION_HEIGHT 0x801B
+#define GL_POST_CONVOLUTION_RED_SCALE 0x801C
+#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D
+#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E
+#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F
+#define GL_POST_CONVOLUTION_RED_BIAS 0x8020
+#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021
+#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022
+#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023
+#define GL_CONSTANT_BORDER 0x8151
+#define GL_REPLICATE_BORDER 0x8153
+#define GL_CONVOLUTION_BORDER_COLOR 0x8154
+#define GL_COLOR_MATRIX 0x80B1
+#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2
+#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3
+#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4
+#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5
+#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6
+#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7
+#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8
+#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9
+#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA
+#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB
+#define GL_HISTOGRAM 0x8024
+#define GL_PROXY_HISTOGRAM 0x8025
+#define GL_HISTOGRAM_WIDTH 0x8026
+#define GL_HISTOGRAM_FORMAT 0x8027
+#define GL_HISTOGRAM_RED_SIZE 0x8028
+#define GL_HISTOGRAM_GREEN_SIZE 0x8029
+#define GL_HISTOGRAM_BLUE_SIZE 0x802A
+#define GL_HISTOGRAM_ALPHA_SIZE 0x802B
+#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C
+#define GL_HISTOGRAM_SINK 0x802D
+#define GL_MINMAX 0x802E
+#define GL_MINMAX_FORMAT 0x802F
+#define GL_MINMAX_SINK 0x8030
+#define GL_TABLE_TOO_LARGE 0x8031
+#define GL_BLEND_EQUATION 0x8009
+#define GL_MIN 0x8007
+#define GL_MAX 0x8008
+#define GL_FUNC_ADD 0x8006
+#define GL_FUNC_SUBTRACT 0x800A
+#define GL_FUNC_REVERSE_SUBTRACT 0x800B
+#define GL_BLEND_COLOR 0x8005
+
+
+GLAPI void GLAPIENTRY glColorTable( GLenum target, GLenum internalformat,
+ GLsizei width, GLenum format,
+ GLenum type, const GLvoid *table );
+
+GLAPI void GLAPIENTRY glColorSubTable( GLenum target,
+ GLsizei start, GLsizei count,
+ GLenum format, GLenum type,
+ const GLvoid *data );
+
+GLAPI void GLAPIENTRY glColorTableParameteriv(GLenum target, GLenum pname,
+ const GLint *params);
+
+GLAPI void GLAPIENTRY glColorTableParameterfv(GLenum target, GLenum pname,
+ const GLfloat *params);
+
+GLAPI void GLAPIENTRY glCopyColorSubTable( GLenum target, GLsizei start,
+ GLint x, GLint y, GLsizei width );
+
+GLAPI void GLAPIENTRY glCopyColorTable( GLenum target, GLenum internalformat,
+ GLint x, GLint y, GLsizei width );
+
+GLAPI void GLAPIENTRY glGetColorTable( GLenum target, GLenum format,
+ GLenum type, GLvoid *table );
+
+GLAPI void GLAPIENTRY glGetColorTableParameterfv( GLenum target, GLenum pname,
+ GLfloat *params );
+
+GLAPI void GLAPIENTRY glGetColorTableParameteriv( GLenum target, GLenum pname,
+ GLint *params );
+
+GLAPI void GLAPIENTRY glBlendEquation( GLenum mode );
+
+GLAPI void GLAPIENTRY glBlendColor( GLclampf red, GLclampf green,
+ GLclampf blue, GLclampf alpha );
+
+GLAPI void GLAPIENTRY glHistogram( GLenum target, GLsizei width,
+ GLenum internalformat, GLboolean sink );
+
+GLAPI void GLAPIENTRY glResetHistogram( GLenum target );
+
+GLAPI void GLAPIENTRY glGetHistogram( GLenum target, GLboolean reset,
+ GLenum format, GLenum type,
+ GLvoid *values );
+
+GLAPI void GLAPIENTRY glGetHistogramParameterfv( GLenum target, GLenum pname,
+ GLfloat *params );
+
+GLAPI void GLAPIENTRY glGetHistogramParameteriv( GLenum target, GLenum pname,
+ GLint *params );
+
+GLAPI void GLAPIENTRY glMinmax( GLenum target, GLenum internalformat,
+ GLboolean sink );
+
+GLAPI void GLAPIENTRY glResetMinmax( GLenum target );
+
+GLAPI void GLAPIENTRY glGetMinmax( GLenum target, GLboolean reset,
+ GLenum format, GLenum types,
+ GLvoid *values );
+
+GLAPI void GLAPIENTRY glGetMinmaxParameterfv( GLenum target, GLenum pname,
+ GLfloat *params );
+
+GLAPI void GLAPIENTRY glGetMinmaxParameteriv( GLenum target, GLenum pname,
+ GLint *params );
+
+GLAPI void GLAPIENTRY glConvolutionFilter1D( GLenum target,
+ GLenum internalformat, GLsizei width, GLenum format, GLenum type,
+ const GLvoid *image );
+
+GLAPI void GLAPIENTRY glConvolutionFilter2D( GLenum target,
+ GLenum internalformat, GLsizei width, GLsizei height, GLenum format,
+ GLenum type, const GLvoid *image );
+
+GLAPI void GLAPIENTRY glConvolutionParameterf( GLenum target, GLenum pname,
+ GLfloat params );
+
+GLAPI void GLAPIENTRY glConvolutionParameterfv( GLenum target, GLenum pname,
+ const GLfloat *params );
+
+GLAPI void GLAPIENTRY glConvolutionParameteri( GLenum target, GLenum pname,
+ GLint params );
+
+GLAPI void GLAPIENTRY glConvolutionParameteriv( GLenum target, GLenum pname,
+ const GLint *params );
+
+GLAPI void GLAPIENTRY glCopyConvolutionFilter1D( GLenum target,
+ GLenum internalformat, GLint x, GLint y, GLsizei width );
+
+GLAPI void GLAPIENTRY glCopyConvolutionFilter2D( GLenum target,
+ GLenum internalformat, GLint x, GLint y, GLsizei width,
+ GLsizei height);
+
+GLAPI void GLAPIENTRY glGetConvolutionFilter( GLenum target, GLenum format,
+ GLenum type, GLvoid *image );
+
+GLAPI void GLAPIENTRY glGetConvolutionParameterfv( GLenum target, GLenum pname,
+ GLfloat *params );
+
+GLAPI void GLAPIENTRY glGetConvolutionParameteriv( GLenum target, GLenum pname,
+ GLint *params );
+
+GLAPI void GLAPIENTRY glSeparableFilter2D( GLenum target,
+ GLenum internalformat, GLsizei width, GLsizei height, GLenum format,
+ GLenum type, const GLvoid *row, const GLvoid *column );
+
+GLAPI void GLAPIENTRY glGetSeparableFilter( GLenum target, GLenum format,
+ GLenum type, GLvoid *row, GLvoid *column, GLvoid *span );
+
+typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);
+
+
+
+/*
+ * OpenGL 1.3
+ */
+
+/* multitexture */
+#define GL_TEXTURE0 0x84C0
+#define GL_TEXTURE1 0x84C1
+#define GL_TEXTURE2 0x84C2
+#define GL_TEXTURE3 0x84C3
+#define GL_TEXTURE4 0x84C4
+#define GL_TEXTURE5 0x84C5
+#define GL_TEXTURE6 0x84C6
+#define GL_TEXTURE7 0x84C7
+#define GL_TEXTURE8 0x84C8
+#define GL_TEXTURE9 0x84C9
+#define GL_TEXTURE10 0x84CA
+#define GL_TEXTURE11 0x84CB
+#define GL_TEXTURE12 0x84CC
+#define GL_TEXTURE13 0x84CD
+#define GL_TEXTURE14 0x84CE
+#define GL_TEXTURE15 0x84CF
+#define GL_TEXTURE16 0x84D0
+#define GL_TEXTURE17 0x84D1
+#define GL_TEXTURE18 0x84D2
+#define GL_TEXTURE19 0x84D3
+#define GL_TEXTURE20 0x84D4
+#define GL_TEXTURE21 0x84D5
+#define GL_TEXTURE22 0x84D6
+#define GL_TEXTURE23 0x84D7
+#define GL_TEXTURE24 0x84D8
+#define GL_TEXTURE25 0x84D9
+#define GL_TEXTURE26 0x84DA
+#define GL_TEXTURE27 0x84DB
+#define GL_TEXTURE28 0x84DC
+#define GL_TEXTURE29 0x84DD
+#define GL_TEXTURE30 0x84DE
+#define GL_TEXTURE31 0x84DF
+#define GL_ACTIVE_TEXTURE 0x84E0
+#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1
+#define GL_MAX_TEXTURE_UNITS 0x84E2
+/* texture_cube_map */
+#define GL_NORMAL_MAP 0x8511
+#define GL_REFLECTION_MAP 0x8512
+#define GL_TEXTURE_CUBE_MAP 0x8513
+#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
+#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
+/* texture_compression */
+#define GL_COMPRESSED_ALPHA 0x84E9
+#define GL_COMPRESSED_LUMINANCE 0x84EA
+#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB
+#define GL_COMPRESSED_INTENSITY 0x84EC
+#define GL_COMPRESSED_RGB 0x84ED
+#define GL_COMPRESSED_RGBA 0x84EE
+#define GL_TEXTURE_COMPRESSION_HINT 0x84EF
+#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0
+#define GL_TEXTURE_COMPRESSED 0x86A1
+#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
+#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
+/* multisample */
+#define GL_MULTISAMPLE 0x809D
+#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE 0x809F
+#define GL_SAMPLE_COVERAGE 0x80A0
+#define GL_SAMPLE_BUFFERS 0x80A8
+#define GL_SAMPLES 0x80A9
+#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
+#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
+#define GL_MULTISAMPLE_BIT 0x20000000
+/* transpose_matrix */
+#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3
+#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4
+#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5
+#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6
+/* texture_env_combine */
+#define GL_COMBINE 0x8570
+#define GL_COMBINE_RGB 0x8571
+#define GL_COMBINE_ALPHA 0x8572
+#define GL_SOURCE0_RGB 0x8580
+#define GL_SOURCE1_RGB 0x8581
+#define GL_SOURCE2_RGB 0x8582
+#define GL_SOURCE0_ALPHA 0x8588
+#define GL_SOURCE1_ALPHA 0x8589
+#define GL_SOURCE2_ALPHA 0x858A
+#define GL_OPERAND0_RGB 0x8590
+#define GL_OPERAND1_RGB 0x8591
+#define GL_OPERAND2_RGB 0x8592
+#define GL_OPERAND0_ALPHA 0x8598
+#define GL_OPERAND1_ALPHA 0x8599
+#define GL_OPERAND2_ALPHA 0x859A
+#define GL_RGB_SCALE 0x8573
+#define GL_ADD_SIGNED 0x8574
+#define GL_INTERPOLATE 0x8575
+#define GL_SUBTRACT 0x84E7
+#define GL_CONSTANT 0x8576
+#define GL_PRIMARY_COLOR 0x8577
+#define GL_PREVIOUS 0x8578
+/* texture_env_dot3 */
+#define GL_DOT3_RGB 0x86AE
+#define GL_DOT3_RGBA 0x86AF
+/* texture_border_clamp */
+#define GL_CLAMP_TO_BORDER 0x812D
+
+GLAPI void GLAPIENTRY glActiveTexture( GLenum texture );
+
+GLAPI void GLAPIENTRY glClientActiveTexture( GLenum texture );
+
+GLAPI void GLAPIENTRY glCompressedTexImage1D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data );
+
+GLAPI void GLAPIENTRY glCompressedTexImage2D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data );
+
+GLAPI void GLAPIENTRY glCompressedTexImage3D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data );
+
+GLAPI void GLAPIENTRY glCompressedTexSubImage1D( GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data );
+
+GLAPI void GLAPIENTRY glCompressedTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data );
+
+GLAPI void GLAPIENTRY glCompressedTexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data );
+
+GLAPI void GLAPIENTRY glGetCompressedTexImage( GLenum target, GLint lod, GLvoid *img );
+
+GLAPI void GLAPIENTRY glMultiTexCoord1d( GLenum target, GLdouble s );
+
+GLAPI void GLAPIENTRY glMultiTexCoord1dv( GLenum target, const GLdouble *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord1f( GLenum target, GLfloat s );
+
+GLAPI void GLAPIENTRY glMultiTexCoord1fv( GLenum target, const GLfloat *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord1i( GLenum target, GLint s );
+
+GLAPI void GLAPIENTRY glMultiTexCoord1iv( GLenum target, const GLint *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord1s( GLenum target, GLshort s );
+
+GLAPI void GLAPIENTRY glMultiTexCoord1sv( GLenum target, const GLshort *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord2d( GLenum target, GLdouble s, GLdouble t );
+
+GLAPI void GLAPIENTRY glMultiTexCoord2dv( GLenum target, const GLdouble *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord2f( GLenum target, GLfloat s, GLfloat t );
+
+GLAPI void GLAPIENTRY glMultiTexCoord2fv( GLenum target, const GLfloat *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord2i( GLenum target, GLint s, GLint t );
+
+GLAPI void GLAPIENTRY glMultiTexCoord2iv( GLenum target, const GLint *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord2s( GLenum target, GLshort s, GLshort t );
+
+GLAPI void GLAPIENTRY glMultiTexCoord2sv( GLenum target, const GLshort *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord3d( GLenum target, GLdouble s, GLdouble t, GLdouble r );
+
+GLAPI void GLAPIENTRY glMultiTexCoord3dv( GLenum target, const GLdouble *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord3f( GLenum target, GLfloat s, GLfloat t, GLfloat r );
+
+GLAPI void GLAPIENTRY glMultiTexCoord3fv( GLenum target, const GLfloat *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord3i( GLenum target, GLint s, GLint t, GLint r );
+
+GLAPI void GLAPIENTRY glMultiTexCoord3iv( GLenum target, const GLint *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord3s( GLenum target, GLshort s, GLshort t, GLshort r );
+
+GLAPI void GLAPIENTRY glMultiTexCoord3sv( GLenum target, const GLshort *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord4d( GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q );
+
+GLAPI void GLAPIENTRY glMultiTexCoord4dv( GLenum target, const GLdouble *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord4f( GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q );
+
+GLAPI void GLAPIENTRY glMultiTexCoord4fv( GLenum target, const GLfloat *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord4i( GLenum target, GLint s, GLint t, GLint r, GLint q );
+
+GLAPI void GLAPIENTRY glMultiTexCoord4iv( GLenum target, const GLint *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord4s( GLenum target, GLshort s, GLshort t, GLshort r, GLshort q );
+
+GLAPI void GLAPIENTRY glMultiTexCoord4sv( GLenum target, const GLshort *v );
+
+
+GLAPI void GLAPIENTRY glLoadTransposeMatrixd( const GLdouble m[16] );
+
+GLAPI void GLAPIENTRY glLoadTransposeMatrixf( const GLfloat m[16] );
+
+GLAPI void GLAPIENTRY glMultTransposeMatrixd( const GLdouble m[16] );
+
+GLAPI void GLAPIENTRY glMultTransposeMatrixf( const GLfloat m[16] );
+
+GLAPI void GLAPIENTRY glSampleCoverage( GLclampf value, GLboolean invert );
+
+
+typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img);
+
+
+
+/*
+ * GL_ARB_multitexture (ARB extension 1 and OpenGL 1.2.1)
+ */
+#ifndef GL_ARB_multitexture
+#define GL_ARB_multitexture 1
+
+#define GL_TEXTURE0_ARB 0x84C0
+#define GL_TEXTURE1_ARB 0x84C1
+#define GL_TEXTURE2_ARB 0x84C2
+#define GL_TEXTURE3_ARB 0x84C3
+#define GL_TEXTURE4_ARB 0x84C4
+#define GL_TEXTURE5_ARB 0x84C5
+#define GL_TEXTURE6_ARB 0x84C6
+#define GL_TEXTURE7_ARB 0x84C7
+#define GL_TEXTURE8_ARB 0x84C8
+#define GL_TEXTURE9_ARB 0x84C9
+#define GL_TEXTURE10_ARB 0x84CA
+#define GL_TEXTURE11_ARB 0x84CB
+#define GL_TEXTURE12_ARB 0x84CC
+#define GL_TEXTURE13_ARB 0x84CD
+#define GL_TEXTURE14_ARB 0x84CE
+#define GL_TEXTURE15_ARB 0x84CF
+#define GL_TEXTURE16_ARB 0x84D0
+#define GL_TEXTURE17_ARB 0x84D1
+#define GL_TEXTURE18_ARB 0x84D2
+#define GL_TEXTURE19_ARB 0x84D3
+#define GL_TEXTURE20_ARB 0x84D4
+#define GL_TEXTURE21_ARB 0x84D5
+#define GL_TEXTURE22_ARB 0x84D6
+#define GL_TEXTURE23_ARB 0x84D7
+#define GL_TEXTURE24_ARB 0x84D8
+#define GL_TEXTURE25_ARB 0x84D9
+#define GL_TEXTURE26_ARB 0x84DA
+#define GL_TEXTURE27_ARB 0x84DB
+#define GL_TEXTURE28_ARB 0x84DC
+#define GL_TEXTURE29_ARB 0x84DD
+#define GL_TEXTURE30_ARB 0x84DE
+#define GL_TEXTURE31_ARB 0x84DF
+#define GL_ACTIVE_TEXTURE_ARB 0x84E0
+#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1
+#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2
+
+GLAPI void GLAPIENTRY glActiveTextureARB(GLenum texture);
+GLAPI void GLAPIENTRY glClientActiveTextureARB(GLenum texture);
+GLAPI void GLAPIENTRY glMultiTexCoord1dARB(GLenum target, GLdouble s);
+GLAPI void GLAPIENTRY glMultiTexCoord1dvARB(GLenum target, const GLdouble *v);
+GLAPI void GLAPIENTRY glMultiTexCoord1fARB(GLenum target, GLfloat s);
+GLAPI void GLAPIENTRY glMultiTexCoord1fvARB(GLenum target, const GLfloat *v);
+GLAPI void GLAPIENTRY glMultiTexCoord1iARB(GLenum target, GLint s);
+GLAPI void GLAPIENTRY glMultiTexCoord1ivARB(GLenum target, const GLint *v);
+GLAPI void GLAPIENTRY glMultiTexCoord1sARB(GLenum target, GLshort s);
+GLAPI void GLAPIENTRY glMultiTexCoord1svARB(GLenum target, const GLshort *v);
+GLAPI void GLAPIENTRY glMultiTexCoord2dARB(GLenum target, GLdouble s, GLdouble t);
+GLAPI void GLAPIENTRY glMultiTexCoord2dvARB(GLenum target, const GLdouble *v);
+GLAPI void GLAPIENTRY glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t);
+GLAPI void GLAPIENTRY glMultiTexCoord2fvARB(GLenum target, const GLfloat *v);
+GLAPI void GLAPIENTRY glMultiTexCoord2iARB(GLenum target, GLint s, GLint t);
+GLAPI void GLAPIENTRY glMultiTexCoord2ivARB(GLenum target, const GLint *v);
+GLAPI void GLAPIENTRY glMultiTexCoord2sARB(GLenum target, GLshort s, GLshort t);
+GLAPI void GLAPIENTRY glMultiTexCoord2svARB(GLenum target, const GLshort *v);
+GLAPI void GLAPIENTRY glMultiTexCoord3dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r);
+GLAPI void GLAPIENTRY glMultiTexCoord3dvARB(GLenum target, const GLdouble *v);
+GLAPI void GLAPIENTRY glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r);
+GLAPI void GLAPIENTRY glMultiTexCoord3fvARB(GLenum target, const GLfloat *v);
+GLAPI void GLAPIENTRY glMultiTexCoord3iARB(GLenum target, GLint s, GLint t, GLint r);
+GLAPI void GLAPIENTRY glMultiTexCoord3ivARB(GLenum target, const GLint *v);
+GLAPI void GLAPIENTRY glMultiTexCoord3sARB(GLenum target, GLshort s, GLshort t, GLshort r);
+GLAPI void GLAPIENTRY glMultiTexCoord3svARB(GLenum target, const GLshort *v);
+GLAPI void GLAPIENTRY glMultiTexCoord4dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+GLAPI void GLAPIENTRY glMultiTexCoord4dvARB(GLenum target, const GLdouble *v);
+GLAPI void GLAPIENTRY glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+GLAPI void GLAPIENTRY glMultiTexCoord4fvARB(GLenum target, const GLfloat *v);
+GLAPI void GLAPIENTRY glMultiTexCoord4iARB(GLenum target, GLint s, GLint t, GLint r, GLint q);
+GLAPI void GLAPIENTRY glMultiTexCoord4ivARB(GLenum target, const GLint *v);
+GLAPI void GLAPIENTRY glMultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+GLAPI void GLAPIENTRY glMultiTexCoord4svARB(GLenum target, const GLshort *v);
+
+typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v);
+
+#endif /* GL_ARB_multitexture */
+
+
+
+/*
+ * Define this token if you want "old-style" header file behaviour (extensions
+ * defined in gl.h). Otherwise, extensions will be included from glext.h.
+ */
+#if defined(GL_GLEXT_LEGACY)
+
+/* All extensions that used to be here are now found in glext.h */
+
+#else /* GL_GLEXT_LEGACY */
+
+#include <GL/glext.h>
+
+#endif /* GL_GLEXT_LEGACY */
+
+
+
+#if GL_ARB_shader_objects
+
+#ifndef GL_MESA_shader_debug
+#define GL_MESA_shader_debug 1
+
+#define GL_DEBUG_OBJECT_MESA 0x8759
+#define GL_DEBUG_PRINT_MESA 0x875A
+#define GL_DEBUG_ASSERT_MESA 0x875B
+
+GLAPI GLhandleARB GLAPIENTRY glCreateDebugObjectMESA (void);
+GLAPI void GLAPIENTRY glClearDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType);
+GLAPI void GLAPIENTRY glGetDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType, GLsizei maxLength,
+ GLsizei *length, GLcharARB *debugLog);
+GLAPI GLsizei GLAPIENTRY glGetDebugLogLengthMESA (GLhandleARB obj, GLenum logType, GLenum shaderType);
+
+#endif /* GL_MESA_shader_debug */
+
+#endif /* GL_ARB_shader_objects */
+
+
+/*
+ * ???. GL_MESA_packed_depth_stencil
+ * XXX obsolete
+ */
+#ifndef GL_MESA_packed_depth_stencil
+#define GL_MESA_packed_depth_stencil 1
+
+#define GL_DEPTH_STENCIL_MESA 0x8750
+#define GL_UNSIGNED_INT_24_8_MESA 0x8751
+#define GL_UNSIGNED_INT_8_24_REV_MESA 0x8752
+#define GL_UNSIGNED_SHORT_15_1_MESA 0x8753
+#define GL_UNSIGNED_SHORT_1_15_REV_MESA 0x8754
+
+#endif /* GL_MESA_packed_depth_stencil */
+
+
+#ifndef GL_MESA_program_debug
+#define GL_MESA_program_debug 1
+
+#define GL_FRAGMENT_PROGRAM_POSITION_MESA 0x8bb0
+#define GL_FRAGMENT_PROGRAM_CALLBACK_MESA 0x8bb1
+#define GL_FRAGMENT_PROGRAM_CALLBACK_FUNC_MESA 0x8bb2
+#define GL_FRAGMENT_PROGRAM_CALLBACK_DATA_MESA 0x8bb3
+#define GL_VERTEX_PROGRAM_POSITION_MESA 0x8bb4
+#define GL_VERTEX_PROGRAM_CALLBACK_MESA 0x8bb5
+#define GL_VERTEX_PROGRAM_CALLBACK_FUNC_MESA 0x8bb6
+#define GL_VERTEX_PROGRAM_CALLBACK_DATA_MESA 0x8bb7
+
+typedef void (*GLprogramcallbackMESA)(GLenum target, GLvoid *data);
+
+GLAPI void GLAPIENTRY glProgramCallbackMESA(GLenum target, GLprogramcallbackMESA callback, GLvoid *data);
+
+GLAPI void GLAPIENTRY glGetProgramRegisterfvMESA(GLenum target, GLsizei len, const GLubyte *name, GLfloat *v);
+
+#endif /* GL_MESA_program_debug */
+
+
+#ifndef GL_MESA_texture_array
+#define GL_MESA_texture_array 1
+
+/* GL_MESA_texture_array uses the same enum values as GL_EXT_texture_array.
+ */
+#ifndef GL_EXT_texture_array
+
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFramebufferTextureLayerEXT(GLenum target,
+ GLenum attachment, GLuint texture, GLint level, GLint layer);
+#endif /* GL_GLEXT_PROTOTYPES */
+
+#if 0
+/* (temporarily) disabled because of collision with typedef in glext.h
+ * that happens if apps include both gl.h and glext.h
+ */
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target,
+ GLenum attachment, GLuint texture, GLint level, GLint layer);
+#endif
+
+#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18
+#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19
+#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A
+#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B
+#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C
+#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D
+#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4
+#endif
+
+#endif
+
+
+#ifndef GL_ATI_blend_equation_separate
+#define GL_ATI_blend_equation_separate 1
+
+#define GL_ALPHA_BLEND_EQUATION_ATI 0x883D
+
+GLAPI void GLAPIENTRY glBlendEquationSeparateATI( GLenum modeRGB, GLenum modeA );
+typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEATIPROC) (GLenum modeRGB, GLenum modeA);
+
+#endif /* GL_ATI_blend_equation_separate */
+
+
+/* GL_OES_EGL_image */
+#ifndef GL_OES_EGL_image
+typedef void* GLeglImageOES;
+#endif
+
+#ifndef GL_OES_EGL_image
+#define GL_OES_EGL_image 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image);
+GLAPI void APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image);
+#endif
+typedef void (APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image);
+typedef void (APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image);
+#endif
+
+
+/**
+ ** NOTE!!!!! If you add new functions to this file, or update
+ ** glext.h be sure to regenerate the gl_mangle.h file. See comments
+ ** in that file for details.
+ **/
+
+
+
+/**********************************************************************
+ * Begin system-specific stuff
+ */
+#if defined(PRAGMA_EXPORT_SUPPORTED)
+#pragma export off
+#endif
+
+#if defined(macintosh) && PRAGMA_IMPORT_SUPPORTED
+#pragma import off
+#endif
+/*
+ * End system-specific stuff
+ **********************************************************************/
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __gl_h_ */
diff --git a/hw/yagl/yagl_inc/GL/gl_mangle.h b/hw/yagl/yagl_inc/GL/gl_mangle.h
new file mode 100644
index 0000000000..3684803381
--- /dev/null
+++ b/hw/yagl/yagl_inc/GL/gl_mangle.h
@@ -0,0 +1,2311 @@
+#if 0
+#define GL_MANGLE_C1 "DO NOT EDIT!!! - TO REGENERATE from gl.h, EXECUTE THIS FILE IN SHELL (/bin/sh) and save the output"
+#define GL_MANGLE_C2 "This file is used to create GL function protypes and aliases for the function names"
+ files="gl.h glext.h"
+#define GL_MANGLE_C3 "get regeneration header - copy everything in this file above the 'REGENERATE_TO_END' line"
+ awk '!done; /^\/\*REGENERATE_TO_END/ {done=1}' $0
+ echo ""
+#define GL_MANGLE_C4 get aliases
+ grep '^GLAPI' $files | sed -e 's/.*ENTRY gl\([^( ]*\).*$/#define gl\1 MANGLE(\1)/' | sort | uniq
+ echo ""
+ echo "#endif /* GL_MANGLE_H */"
+ exit
+#endif /* REGENERATION */
+
+/*
+ * If you compile Mesa with USE_MGL_NAMESPACE defined then you can link
+ * your application both with OpenGL and Mesa. The Mesa functions will
+ * be redefined so they are prefixed with "mgl" instead of "gl".
+ * Mgl contributed by Randy Frank (rfrank@rsinc.com)
+ * Regneration code contributed by Ray Tice (rayt@ma.ultra.net)
+ */
+
+#ifndef GL_MANGLE_H
+#define GL_MANGLE_H
+
+#ifndef MANGLE
+#define MANGLE(x) mgl##x
+#endif /*MANGLE*/
+
+/*REGENERATE_TO_END-----------ALL LINES BELOW HERE GET REPLACED ON REGENERATION */
+
+#define glAccum MANGLE(Accum)
+#define glActiveProgramEXT MANGLE(ActiveProgramEXT)
+#define glActiveShaderProgram MANGLE(ActiveShaderProgram)
+#define glActiveStencilFaceEXT MANGLE(ActiveStencilFaceEXT)
+#define glActiveTextureARB MANGLE(ActiveTextureARB)
+#define glActiveTexture MANGLE(ActiveTexture)
+#define glActiveVaryingNV MANGLE(ActiveVaryingNV)
+#define glAlphaFragmentOp1ATI MANGLE(AlphaFragmentOp1ATI)
+#define glAlphaFragmentOp2ATI MANGLE(AlphaFragmentOp2ATI)
+#define glAlphaFragmentOp3ATI MANGLE(AlphaFragmentOp3ATI)
+#define glAlphaFunc MANGLE(AlphaFunc)
+#define glApplyTextureEXT MANGLE(ApplyTextureEXT)
+#define glAreProgramsResidentNV MANGLE(AreProgramsResidentNV)
+#define glAreTexturesResidentEXT MANGLE(AreTexturesResidentEXT)
+#define glAreTexturesResident MANGLE(AreTexturesResident)
+#define glArrayElementEXT MANGLE(ArrayElementEXT)
+#define glArrayElement MANGLE(ArrayElement)
+#define glArrayObjectATI MANGLE(ArrayObjectATI)
+#define glAsyncMarkerSGIX MANGLE(AsyncMarkerSGIX)
+#define glAttachObjectARB MANGLE(AttachObjectARB)
+#define glAttachShader MANGLE(AttachShader)
+#define glBeginConditionalRender MANGLE(BeginConditionalRender)
+#define glBeginConditionalRenderNV MANGLE(BeginConditionalRenderNV)
+#define glBeginFragmentShaderATI MANGLE(BeginFragmentShaderATI)
+#define glBegin MANGLE(Begin)
+#define glBeginOcclusionQueryNV MANGLE(BeginOcclusionQueryNV)
+#define glBeginPerfMonitorAMD MANGLE(BeginPerfMonitorAMD)
+#define glBeginQueryARB MANGLE(BeginQueryARB)
+#define glBeginQueryIndexed MANGLE(BeginQueryIndexed)
+#define glBeginQuery MANGLE(BeginQuery)
+#define glBeginTransformFeedbackEXT MANGLE(BeginTransformFeedbackEXT)
+#define glBeginTransformFeedback MANGLE(BeginTransformFeedback)
+#define glBeginTransformFeedbackNV MANGLE(BeginTransformFeedbackNV)
+#define glBeginVertexShaderEXT MANGLE(BeginVertexShaderEXT)
+#define glBeginVideoCaptureNV MANGLE(BeginVideoCaptureNV)
+#define glBindAttribLocationARB MANGLE(BindAttribLocationARB)
+#define glBindAttribLocation MANGLE(BindAttribLocation)
+#define glBindBufferARB MANGLE(BindBufferARB)
+#define glBindBufferBaseEXT MANGLE(BindBufferBaseEXT)
+#define glBindBufferBase MANGLE(BindBufferBase)
+#define glBindBufferBaseNV MANGLE(BindBufferBaseNV)
+#define glBindBuffer MANGLE(BindBuffer)
+#define glBindBufferOffsetEXT MANGLE(BindBufferOffsetEXT)
+#define glBindBufferOffsetNV MANGLE(BindBufferOffsetNV)
+#define glBindBufferRangeEXT MANGLE(BindBufferRangeEXT)
+#define glBindBufferRange MANGLE(BindBufferRange)
+#define glBindBufferRangeNV MANGLE(BindBufferRangeNV)
+#define glBindFragDataLocationEXT MANGLE(BindFragDataLocationEXT)
+#define glBindFragDataLocationIndexed MANGLE(BindFragDataLocationIndexed)
+#define glBindFragDataLocation MANGLE(BindFragDataLocation)
+#define glBindFragmentShaderATI MANGLE(BindFragmentShaderATI)
+#define glBindFramebufferEXT MANGLE(BindFramebufferEXT)
+#define glBindFramebuffer MANGLE(BindFramebuffer)
+#define glBindImageTextureEXT MANGLE(BindImageTextureEXT)
+#define glBindLightParameterEXT MANGLE(BindLightParameterEXT)
+#define glBindMaterialParameterEXT MANGLE(BindMaterialParameterEXT)
+#define glBindMultiTextureEXT MANGLE(BindMultiTextureEXT)
+#define glBindParameterEXT MANGLE(BindParameterEXT)
+#define glBindProgramARB MANGLE(BindProgramARB)
+#define glBindProgramNV MANGLE(BindProgramNV)
+#define glBindProgramPipeline MANGLE(BindProgramPipeline)
+#define glBindRenderbufferEXT MANGLE(BindRenderbufferEXT)
+#define glBindRenderbuffer MANGLE(BindRenderbuffer)
+#define glBindSampler MANGLE(BindSampler)
+#define glBindTexGenParameterEXT MANGLE(BindTexGenParameterEXT)
+#define glBindTextureEXT MANGLE(BindTextureEXT)
+#define glBindTexture MANGLE(BindTexture)
+#define glBindTextureUnitParameterEXT MANGLE(BindTextureUnitParameterEXT)
+#define glBindTransformFeedback MANGLE(BindTransformFeedback)
+#define glBindTransformFeedbackNV MANGLE(BindTransformFeedbackNV)
+#define glBindVertexArrayAPPLE MANGLE(BindVertexArrayAPPLE)
+#define glBindVertexArray MANGLE(BindVertexArray)
+#define glBindVertexShaderEXT MANGLE(BindVertexShaderEXT)
+#define glBindVideoCaptureStreamBufferNV MANGLE(BindVideoCaptureStreamBufferNV)
+#define glBindVideoCaptureStreamTextureNV MANGLE(BindVideoCaptureStreamTextureNV)
+#define glBinormal3bEXT MANGLE(Binormal3bEXT)
+#define glBinormal3bvEXT MANGLE(Binormal3bvEXT)
+#define glBinormal3dEXT MANGLE(Binormal3dEXT)
+#define glBinormal3dvEXT MANGLE(Binormal3dvEXT)
+#define glBinormal3fEXT MANGLE(Binormal3fEXT)
+#define glBinormal3fvEXT MANGLE(Binormal3fvEXT)
+#define glBinormal3iEXT MANGLE(Binormal3iEXT)
+#define glBinormal3ivEXT MANGLE(Binormal3ivEXT)
+#define glBinormal3sEXT MANGLE(Binormal3sEXT)
+#define glBinormal3svEXT MANGLE(Binormal3svEXT)
+#define glBinormalPointerEXT MANGLE(BinormalPointerEXT)
+#define glBitmap MANGLE(Bitmap)
+#define glBlendColorEXT MANGLE(BlendColorEXT)
+#define glBlendColor MANGLE(BlendColor)
+#define glBlendEquationEXT MANGLE(BlendEquationEXT)
+#define glBlendEquationiARB MANGLE(BlendEquationiARB)
+#define glBlendEquationi MANGLE(BlendEquationi)
+#define glBlendEquationIndexedAMD MANGLE(BlendEquationIndexedAMD)
+#define glBlendEquation MANGLE(BlendEquation)
+#define glBlendEquationSeparateATI MANGLE(BlendEquationSeparateATI)
+#define glBlendEquationSeparateEXT MANGLE(BlendEquationSeparateEXT)
+#define glBlendEquationSeparateiARB MANGLE(BlendEquationSeparateiARB)
+#define glBlendEquationSeparatei MANGLE(BlendEquationSeparatei)
+#define glBlendEquationSeparateIndexedAMD MANGLE(BlendEquationSeparateIndexedAMD)
+#define glBlendEquationSeparate MANGLE(BlendEquationSeparate)
+#define glBlendFunciARB MANGLE(BlendFunciARB)
+#define glBlendFunci MANGLE(BlendFunci)
+#define glBlendFuncIndexedAMD MANGLE(BlendFuncIndexedAMD)
+#define glBlendFunc MANGLE(BlendFunc)
+#define glBlendFuncSeparateEXT MANGLE(BlendFuncSeparateEXT)
+#define glBlendFuncSeparateiARB MANGLE(BlendFuncSeparateiARB)
+#define glBlendFuncSeparatei MANGLE(BlendFuncSeparatei)
+#define glBlendFuncSeparateIndexedAMD MANGLE(BlendFuncSeparateIndexedAMD)
+#define glBlendFuncSeparateINGR MANGLE(BlendFuncSeparateINGR)
+#define glBlendFuncSeparate MANGLE(BlendFuncSeparate)
+#define glBlitFramebufferEXT MANGLE(BlitFramebufferEXT)
+#define glBlitFramebuffer MANGLE(BlitFramebuffer)
+#define glBufferAddressRangeNV MANGLE(BufferAddressRangeNV)
+#define glBufferDataARB MANGLE(BufferDataARB)
+#define glBufferData MANGLE(BufferData)
+#define glBufferParameteriAPPLE MANGLE(BufferParameteriAPPLE)
+#define glBufferSubDataARB MANGLE(BufferSubDataARB)
+#define glBufferSubData MANGLE(BufferSubData)
+#define glCallList MANGLE(CallList)
+#define glCallLists MANGLE(CallLists)
+#define glCheckFramebufferStatusEXT MANGLE(CheckFramebufferStatusEXT)
+#define glCheckFramebufferStatus MANGLE(CheckFramebufferStatus)
+#define glCheckNamedFramebufferStatusEXT MANGLE(CheckNamedFramebufferStatusEXT)
+#define glClampColorARB MANGLE(ClampColorARB)
+#define glClampColor MANGLE(ClampColor)
+#define glClearAccum MANGLE(ClearAccum)
+#define glClearBufferfi MANGLE(ClearBufferfi)
+#define glClearBufferfv MANGLE(ClearBufferfv)
+#define glClearBufferiv MANGLE(ClearBufferiv)
+#define glClearBufferuiv MANGLE(ClearBufferuiv)
+#define glClearColorIiEXT MANGLE(ClearColorIiEXT)
+#define glClearColorIuiEXT MANGLE(ClearColorIuiEXT)
+#define glClearColor MANGLE(ClearColor)
+#define glClearDebugLogMESA MANGLE(ClearDebugLogMESA)
+#define glClearDepthdNV MANGLE(ClearDepthdNV)
+#define glClearDepthf MANGLE(ClearDepthf)
+#define glClearDepth MANGLE(ClearDepth)
+#define glClearIndex MANGLE(ClearIndex)
+#define glClear MANGLE(Clear)
+#define glClearStencil MANGLE(ClearStencil)
+#define glClientActiveTextureARB MANGLE(ClientActiveTextureARB)
+#define glClientActiveTexture MANGLE(ClientActiveTexture)
+#define glClientActiveVertexStreamATI MANGLE(ClientActiveVertexStreamATI)
+#define glClientAttribDefaultEXT MANGLE(ClientAttribDefaultEXT)
+#define glClientWaitSync MANGLE(ClientWaitSync)
+#define glClipPlane MANGLE(ClipPlane)
+#define glColor3b MANGLE(Color3b)
+#define glColor3bv MANGLE(Color3bv)
+#define glColor3d MANGLE(Color3d)
+#define glColor3dv MANGLE(Color3dv)
+#define glColor3f MANGLE(Color3f)
+#define glColor3fVertex3fSUN MANGLE(Color3fVertex3fSUN)
+#define glColor3fVertex3fvSUN MANGLE(Color3fVertex3fvSUN)
+#define glColor3fv MANGLE(Color3fv)
+#define glColor3hNV MANGLE(Color3hNV)
+#define glColor3hvNV MANGLE(Color3hvNV)
+#define glColor3i MANGLE(Color3i)
+#define glColor3iv MANGLE(Color3iv)
+#define glColor3s MANGLE(Color3s)
+#define glColor3sv MANGLE(Color3sv)
+#define glColor3ub MANGLE(Color3ub)
+#define glColor3ubv MANGLE(Color3ubv)
+#define glColor3ui MANGLE(Color3ui)
+#define glColor3uiv MANGLE(Color3uiv)
+#define glColor3us MANGLE(Color3us)
+#define glColor3usv MANGLE(Color3usv)
+#define glColor4b MANGLE(Color4b)
+#define glColor4bv MANGLE(Color4bv)
+#define glColor4d MANGLE(Color4d)
+#define glColor4dv MANGLE(Color4dv)
+#define glColor4f MANGLE(Color4f)
+#define glColor4fNormal3fVertex3fSUN MANGLE(Color4fNormal3fVertex3fSUN)
+#define glColor4fNormal3fVertex3fvSUN MANGLE(Color4fNormal3fVertex3fvSUN)
+#define glColor4fv MANGLE(Color4fv)
+#define glColor4hNV MANGLE(Color4hNV)
+#define glColor4hvNV MANGLE(Color4hvNV)
+#define glColor4i MANGLE(Color4i)
+#define glColor4iv MANGLE(Color4iv)
+#define glColor4s MANGLE(Color4s)
+#define glColor4sv MANGLE(Color4sv)
+#define glColor4ub MANGLE(Color4ub)
+#define glColor4ubVertex2fSUN MANGLE(Color4ubVertex2fSUN)
+#define glColor4ubVertex2fvSUN MANGLE(Color4ubVertex2fvSUN)
+#define glColor4ubVertex3fSUN MANGLE(Color4ubVertex3fSUN)
+#define glColor4ubVertex3fvSUN MANGLE(Color4ubVertex3fvSUN)
+#define glColor4ubv MANGLE(Color4ubv)
+#define glColor4ui MANGLE(Color4ui)
+#define glColor4uiv MANGLE(Color4uiv)
+#define glColor4us MANGLE(Color4us)
+#define glColor4usv MANGLE(Color4usv)
+#define glColorFormatNV MANGLE(ColorFormatNV)
+#define glColorFragmentOp1ATI MANGLE(ColorFragmentOp1ATI)
+#define glColorFragmentOp2ATI MANGLE(ColorFragmentOp2ATI)
+#define glColorFragmentOp3ATI MANGLE(ColorFragmentOp3ATI)
+#define glColorMaski MANGLE(ColorMaski)
+#define glColorMaskIndexedEXT MANGLE(ColorMaskIndexedEXT)
+#define glColorMask MANGLE(ColorMask)
+#define glColorMaterial MANGLE(ColorMaterial)
+#define glColorP3ui MANGLE(ColorP3ui)
+#define glColorP3uiv MANGLE(ColorP3uiv)
+#define glColorP4ui MANGLE(ColorP4ui)
+#define glColorP4uiv MANGLE(ColorP4uiv)
+#define glColorPointerEXT MANGLE(ColorPointerEXT)
+#define glColorPointerListIBM MANGLE(ColorPointerListIBM)
+#define glColorPointer MANGLE(ColorPointer)
+#define glColorPointervINTEL MANGLE(ColorPointervINTEL)
+#define glColorSubTableEXT MANGLE(ColorSubTableEXT)
+#define glColorSubTable MANGLE(ColorSubTable)
+#define glColorTableEXT MANGLE(ColorTableEXT)
+#define glColorTable MANGLE(ColorTable)
+#define glColorTableParameterfv MANGLE(ColorTableParameterfv)
+#define glColorTableParameterfvSGI MANGLE(ColorTableParameterfvSGI)
+#define glColorTableParameteriv MANGLE(ColorTableParameteriv)
+#define glColorTableParameterivSGI MANGLE(ColorTableParameterivSGI)
+#define glColorTableSGI MANGLE(ColorTableSGI)
+#define glCombinerInputNV MANGLE(CombinerInputNV)
+#define glCombinerOutputNV MANGLE(CombinerOutputNV)
+#define glCombinerParameterfNV MANGLE(CombinerParameterfNV)
+#define glCombinerParameterfvNV MANGLE(CombinerParameterfvNV)
+#define glCombinerParameteriNV MANGLE(CombinerParameteriNV)
+#define glCombinerParameterivNV MANGLE(CombinerParameterivNV)
+#define glCombinerStageParameterfvNV MANGLE(CombinerStageParameterfvNV)
+#define glCompileShaderARB MANGLE(CompileShaderARB)
+#define glCompileShaderIncludeARB MANGLE(CompileShaderIncludeARB)
+#define glCompileShader MANGLE(CompileShader)
+#define glCompressedMultiTexImage1DEXT MANGLE(CompressedMultiTexImage1DEXT)
+#define glCompressedMultiTexImage2DEXT MANGLE(CompressedMultiTexImage2DEXT)
+#define glCompressedMultiTexImage3DEXT MANGLE(CompressedMultiTexImage3DEXT)
+#define glCompressedMultiTexSubImage1DEXT MANGLE(CompressedMultiTexSubImage1DEXT)
+#define glCompressedMultiTexSubImage2DEXT MANGLE(CompressedMultiTexSubImage2DEXT)
+#define glCompressedMultiTexSubImage3DEXT MANGLE(CompressedMultiTexSubImage3DEXT)
+#define glCompressedTexImage1DARB MANGLE(CompressedTexImage1DARB)
+#define glCompressedTexImage1D MANGLE(CompressedTexImage1D)
+#define glCompressedTexImage2DARB MANGLE(CompressedTexImage2DARB)
+#define glCompressedTexImage2D MANGLE(CompressedTexImage2D)
+#define glCompressedTexImage3DARB MANGLE(CompressedTexImage3DARB)
+#define glCompressedTexImage3D MANGLE(CompressedTexImage3D)
+#define glCompressedTexSubImage1DARB MANGLE(CompressedTexSubImage1DARB)
+#define glCompressedTexSubImage1D MANGLE(CompressedTexSubImage1D)
+#define glCompressedTexSubImage2DARB MANGLE(CompressedTexSubImage2DARB)
+#define glCompressedTexSubImage2D MANGLE(CompressedTexSubImage2D)
+#define glCompressedTexSubImage3DARB MANGLE(CompressedTexSubImage3DARB)
+#define glCompressedTexSubImage3D MANGLE(CompressedTexSubImage3D)
+#define glCompressedTextureImage1DEXT MANGLE(CompressedTextureImage1DEXT)
+#define glCompressedTextureImage2DEXT MANGLE(CompressedTextureImage2DEXT)
+#define glCompressedTextureImage3DEXT MANGLE(CompressedTextureImage3DEXT)
+#define glCompressedTextureSubImage1DEXT MANGLE(CompressedTextureSubImage1DEXT)
+#define glCompressedTextureSubImage2DEXT MANGLE(CompressedTextureSubImage2DEXT)
+#define glCompressedTextureSubImage3DEXT MANGLE(CompressedTextureSubImage3DEXT)
+#define glConvolutionFilter1DEXT MANGLE(ConvolutionFilter1DEXT)
+#define glConvolutionFilter1D MANGLE(ConvolutionFilter1D)
+#define glConvolutionFilter2DEXT MANGLE(ConvolutionFilter2DEXT)
+#define glConvolutionFilter2D MANGLE(ConvolutionFilter2D)
+#define glConvolutionParameterfEXT MANGLE(ConvolutionParameterfEXT)
+#define glConvolutionParameterf MANGLE(ConvolutionParameterf)
+#define glConvolutionParameterfvEXT MANGLE(ConvolutionParameterfvEXT)
+#define glConvolutionParameterfv MANGLE(ConvolutionParameterfv)
+#define glConvolutionParameteriEXT MANGLE(ConvolutionParameteriEXT)
+#define glConvolutionParameteri MANGLE(ConvolutionParameteri)
+#define glConvolutionParameterivEXT MANGLE(ConvolutionParameterivEXT)
+#define glConvolutionParameteriv MANGLE(ConvolutionParameteriv)
+#define glCopyBufferSubData MANGLE(CopyBufferSubData)
+#define glCopyColorSubTableEXT MANGLE(CopyColorSubTableEXT)
+#define glCopyColorSubTable MANGLE(CopyColorSubTable)
+#define glCopyColorTable MANGLE(CopyColorTable)
+#define glCopyColorTableSGI MANGLE(CopyColorTableSGI)
+#define glCopyConvolutionFilter1DEXT MANGLE(CopyConvolutionFilter1DEXT)
+#define glCopyConvolutionFilter1D MANGLE(CopyConvolutionFilter1D)
+#define glCopyConvolutionFilter2DEXT MANGLE(CopyConvolutionFilter2DEXT)
+#define glCopyConvolutionFilter2D MANGLE(CopyConvolutionFilter2D)
+#define glCopyImageSubDataNV MANGLE(CopyImageSubDataNV)
+#define glCopyMultiTexImage1DEXT MANGLE(CopyMultiTexImage1DEXT)
+#define glCopyMultiTexImage2DEXT MANGLE(CopyMultiTexImage2DEXT)
+#define glCopyMultiTexSubImage1DEXT MANGLE(CopyMultiTexSubImage1DEXT)
+#define glCopyMultiTexSubImage2DEXT MANGLE(CopyMultiTexSubImage2DEXT)
+#define glCopyMultiTexSubImage3DEXT MANGLE(CopyMultiTexSubImage3DEXT)
+#define glCopyPixels MANGLE(CopyPixels)
+#define glCopyTexImage1DEXT MANGLE(CopyTexImage1DEXT)
+#define glCopyTexImage1D MANGLE(CopyTexImage1D)
+#define glCopyTexImage2DEXT MANGLE(CopyTexImage2DEXT)
+#define glCopyTexImage2D MANGLE(CopyTexImage2D)
+#define glCopyTexSubImage1DEXT MANGLE(CopyTexSubImage1DEXT)
+#define glCopyTexSubImage1D MANGLE(CopyTexSubImage1D)
+#define glCopyTexSubImage2DEXT MANGLE(CopyTexSubImage2DEXT)
+#define glCopyTexSubImage2D MANGLE(CopyTexSubImage2D)
+#define glCopyTexSubImage3DEXT MANGLE(CopyTexSubImage3DEXT)
+#define glCopyTexSubImage3D MANGLE(CopyTexSubImage3D)
+#define glCopyTextureImage1DEXT MANGLE(CopyTextureImage1DEXT)
+#define glCopyTextureImage2DEXT MANGLE(CopyTextureImage2DEXT)
+#define glCopyTextureSubImage1DEXT MANGLE(CopyTextureSubImage1DEXT)
+#define glCopyTextureSubImage2DEXT MANGLE(CopyTextureSubImage2DEXT)
+#define glCopyTextureSubImage3DEXT MANGLE(CopyTextureSubImage3DEXT)
+#define glCreateDebugObjectMESA MANGLE(CreateDebugObjectMESA)
+#define glCreateProgram MANGLE(CreateProgram)
+#define glCreateProgramObjectARB MANGLE(CreateProgramObjectARB)
+#define glCreateShader MANGLE(CreateShader)
+#define glCreateShaderObjectARB MANGLE(CreateShaderObjectARB)
+#define glCreateShaderProgramEXT MANGLE(CreateShaderProgramEXT)
+#define glCreateShaderProgramv MANGLE(CreateShaderProgramv)
+#define glCreateSyncFromCLeventARB MANGLE(CreateSyncFromCLeventARB)
+#define glCullFace MANGLE(CullFace)
+#define glCullParameterdvEXT MANGLE(CullParameterdvEXT)
+#define glCullParameterfvEXT MANGLE(CullParameterfvEXT)
+#define glCurrentPaletteMatrixARB MANGLE(CurrentPaletteMatrixARB)
+#define glDebugMessageCallbackAMD MANGLE(DebugMessageCallbackAMD)
+#define glDebugMessageCallbackARB MANGLE(DebugMessageCallbackARB)
+#define glDebugMessageControlARB MANGLE(DebugMessageControlARB)
+#define glDebugMessageEnableAMD MANGLE(DebugMessageEnableAMD)
+#define glDebugMessageInsertAMD MANGLE(DebugMessageInsertAMD)
+#define glDebugMessageInsertARB MANGLE(DebugMessageInsertARB)
+#define glDeformationMap3dSGIX MANGLE(DeformationMap3dSGIX)
+#define glDeformationMap3fSGIX MANGLE(DeformationMap3fSGIX)
+#define glDeformSGIX MANGLE(DeformSGIX)
+#define glDeleteAsyncMarkersSGIX MANGLE(DeleteAsyncMarkersSGIX)
+#define glDeleteBuffersARB MANGLE(DeleteBuffersARB)
+#define glDeleteBuffers MANGLE(DeleteBuffers)
+#define glDeleteFencesAPPLE MANGLE(DeleteFencesAPPLE)
+#define glDeleteFencesNV MANGLE(DeleteFencesNV)
+#define glDeleteFragmentShaderATI MANGLE(DeleteFragmentShaderATI)
+#define glDeleteFramebuffersEXT MANGLE(DeleteFramebuffersEXT)
+#define glDeleteFramebuffers MANGLE(DeleteFramebuffers)
+#define glDeleteLists MANGLE(DeleteLists)
+#define glDeleteNamedStringARB MANGLE(DeleteNamedStringARB)
+#define glDeleteNamesAMD MANGLE(DeleteNamesAMD)
+#define glDeleteObjectARB MANGLE(DeleteObjectARB)
+#define glDeleteOcclusionQueriesNV MANGLE(DeleteOcclusionQueriesNV)
+#define glDeletePerfMonitorsAMD MANGLE(DeletePerfMonitorsAMD)
+#define glDeleteProgram MANGLE(DeleteProgram)
+#define glDeleteProgramPipelines MANGLE(DeleteProgramPipelines)
+#define glDeleteProgramsARB MANGLE(DeleteProgramsARB)
+#define glDeleteProgramsNV MANGLE(DeleteProgramsNV)
+#define glDeleteQueriesARB MANGLE(DeleteQueriesARB)
+#define glDeleteQueries MANGLE(DeleteQueries)
+#define glDeleteRenderbuffersEXT MANGLE(DeleteRenderbuffersEXT)
+#define glDeleteRenderbuffers MANGLE(DeleteRenderbuffers)
+#define glDeleteSamplers MANGLE(DeleteSamplers)
+#define glDeleteShader MANGLE(DeleteShader)
+#define glDeleteSync MANGLE(DeleteSync)
+#define glDeleteTexturesEXT MANGLE(DeleteTexturesEXT)
+#define glDeleteTextures MANGLE(DeleteTextures)
+#define glDeleteTransformFeedbacks MANGLE(DeleteTransformFeedbacks)
+#define glDeleteTransformFeedbacksNV MANGLE(DeleteTransformFeedbacksNV)
+#define glDeleteVertexArraysAPPLE MANGLE(DeleteVertexArraysAPPLE)
+#define glDeleteVertexArrays MANGLE(DeleteVertexArrays)
+#define glDeleteVertexShaderEXT MANGLE(DeleteVertexShaderEXT)
+#define glDepthBoundsdNV MANGLE(DepthBoundsdNV)
+#define glDepthBoundsEXT MANGLE(DepthBoundsEXT)
+#define glDepthFunc MANGLE(DepthFunc)
+#define glDepthMask MANGLE(DepthMask)
+#define glDepthRangeArrayv MANGLE(DepthRangeArrayv)
+#define glDepthRangedNV MANGLE(DepthRangedNV)
+#define glDepthRangef MANGLE(DepthRangef)
+#define glDepthRangeIndexed MANGLE(DepthRangeIndexed)
+#define glDepthRange MANGLE(DepthRange)
+#define glDetachObjectARB MANGLE(DetachObjectARB)
+#define glDetachShader MANGLE(DetachShader)
+#define glDetailTexFuncSGIS MANGLE(DetailTexFuncSGIS)
+#define glDisableClientStateIndexedEXT MANGLE(DisableClientStateIndexedEXT)
+#define glDisableClientState MANGLE(DisableClientState)
+#define glDisablei MANGLE(Disablei)
+#define glDisableIndexedEXT MANGLE(DisableIndexedEXT)
+#define glDisable MANGLE(Disable)
+#define glDisableVariantClientStateEXT MANGLE(DisableVariantClientStateEXT)
+#define glDisableVertexAttribAPPLE MANGLE(DisableVertexAttribAPPLE)
+#define glDisableVertexAttribArrayARB MANGLE(DisableVertexAttribArrayARB)
+#define glDisableVertexAttribArray MANGLE(DisableVertexAttribArray)
+#define glDrawArraysEXT MANGLE(DrawArraysEXT)
+#define glDrawArraysIndirect MANGLE(DrawArraysIndirect)
+#define glDrawArraysInstancedARB MANGLE(DrawArraysInstancedARB)
+#define glDrawArraysInstancedEXT MANGLE(DrawArraysInstancedEXT)
+#define glDrawArraysInstanced MANGLE(DrawArraysInstanced)
+#define glDrawArrays MANGLE(DrawArrays)
+#define glDrawBuffer MANGLE(DrawBuffer)
+#define glDrawBuffersARB MANGLE(DrawBuffersARB)
+#define glDrawBuffersATI MANGLE(DrawBuffersATI)
+#define glDrawBuffers MANGLE(DrawBuffers)
+#define glDrawElementArrayAPPLE MANGLE(DrawElementArrayAPPLE)
+#define glDrawElementArrayATI MANGLE(DrawElementArrayATI)
+#define glDrawElementsBaseVertex MANGLE(DrawElementsBaseVertex)
+#define glDrawElementsIndirect MANGLE(DrawElementsIndirect)
+#define glDrawElementsInstancedARB MANGLE(DrawElementsInstancedARB)
+#define glDrawElementsInstancedBaseVertex MANGLE(DrawElementsInstancedBaseVertex)
+#define glDrawElementsInstancedEXT MANGLE(DrawElementsInstancedEXT)
+#define glDrawElementsInstanced MANGLE(DrawElementsInstanced)
+#define glDrawElements MANGLE(DrawElements)
+#define glDrawMeshArraysSUN MANGLE(DrawMeshArraysSUN)
+#define glDrawPixels MANGLE(DrawPixels)
+#define glDrawRangeElementArrayAPPLE MANGLE(DrawRangeElementArrayAPPLE)
+#define glDrawRangeElementArrayATI MANGLE(DrawRangeElementArrayATI)
+#define glDrawRangeElementsBaseVertex MANGLE(DrawRangeElementsBaseVertex)
+#define glDrawRangeElementsEXT MANGLE(DrawRangeElementsEXT)
+#define glDrawRangeElements MANGLE(DrawRangeElements)
+#define glDrawTransformFeedback MANGLE(DrawTransformFeedback)
+#define glDrawTransformFeedbackNV MANGLE(DrawTransformFeedbackNV)
+#define glDrawTransformFeedbackStream MANGLE(DrawTransformFeedbackStream)
+#define glEdgeFlagFormatNV MANGLE(EdgeFlagFormatNV)
+#define glEdgeFlag MANGLE(EdgeFlag)
+#define glEdgeFlagPointerEXT MANGLE(EdgeFlagPointerEXT)
+#define glEdgeFlagPointerListIBM MANGLE(EdgeFlagPointerListIBM)
+#define glEdgeFlagPointer MANGLE(EdgeFlagPointer)
+#define glEdgeFlagv MANGLE(EdgeFlagv)
+#define glEGLImageTargetRenderbufferStorageOES MANGLE(EGLImageTargetRenderbufferStorageOES)
+#define glEGLImageTargetTexture2DOES MANGLE(EGLImageTargetTexture2DOES)
+#define glElementPointerAPPLE MANGLE(ElementPointerAPPLE)
+#define glElementPointerATI MANGLE(ElementPointerATI)
+#define glEnableClientStateIndexedEXT MANGLE(EnableClientStateIndexedEXT)
+#define glEnableClientState MANGLE(EnableClientState)
+#define glEnablei MANGLE(Enablei)
+#define glEnableIndexedEXT MANGLE(EnableIndexedEXT)
+#define glEnable MANGLE(Enable)
+#define glEnableVariantClientStateEXT MANGLE(EnableVariantClientStateEXT)
+#define glEnableVertexAttribAPPLE MANGLE(EnableVertexAttribAPPLE)
+#define glEnableVertexAttribArrayARB MANGLE(EnableVertexAttribArrayARB)
+#define glEnableVertexAttribArray MANGLE(EnableVertexAttribArray)
+#define glEndConditionalRender MANGLE(EndConditionalRender)
+#define glEndConditionalRenderNV MANGLE(EndConditionalRenderNV)
+#define glEndFragmentShaderATI MANGLE(EndFragmentShaderATI)
+#define glEndList MANGLE(EndList)
+#define glEnd MANGLE(End)
+#define glEndOcclusionQueryNV MANGLE(EndOcclusionQueryNV)
+#define glEndPerfMonitorAMD MANGLE(EndPerfMonitorAMD)
+#define glEndQueryARB MANGLE(EndQueryARB)
+#define glEndQueryIndexed MANGLE(EndQueryIndexed)
+#define glEndQuery MANGLE(EndQuery)
+#define glEndTransformFeedbackEXT MANGLE(EndTransformFeedbackEXT)
+#define glEndTransformFeedback MANGLE(EndTransformFeedback)
+#define glEndTransformFeedbackNV MANGLE(EndTransformFeedbackNV)
+#define glEndVertexShaderEXT MANGLE(EndVertexShaderEXT)
+#define glEndVideoCaptureNV MANGLE(EndVideoCaptureNV)
+#define glEvalCoord1d MANGLE(EvalCoord1d)
+#define glEvalCoord1dv MANGLE(EvalCoord1dv)
+#define glEvalCoord1f MANGLE(EvalCoord1f)
+#define glEvalCoord1fv MANGLE(EvalCoord1fv)
+#define glEvalCoord2d MANGLE(EvalCoord2d)
+#define glEvalCoord2dv MANGLE(EvalCoord2dv)
+#define glEvalCoord2f MANGLE(EvalCoord2f)
+#define glEvalCoord2fv MANGLE(EvalCoord2fv)
+#define glEvalMapsNV MANGLE(EvalMapsNV)
+#define glEvalMesh1 MANGLE(EvalMesh1)
+#define glEvalMesh2 MANGLE(EvalMesh2)
+#define glEvalPoint1 MANGLE(EvalPoint1)
+#define glEvalPoint2 MANGLE(EvalPoint2)
+#define glExecuteProgramNV MANGLE(ExecuteProgramNV)
+#define glExtractComponentEXT MANGLE(ExtractComponentEXT)
+#define glFeedbackBuffer MANGLE(FeedbackBuffer)
+#define glFenceSync MANGLE(FenceSync)
+#define glFinalCombinerInputNV MANGLE(FinalCombinerInputNV)
+#define glFinishAsyncSGIX MANGLE(FinishAsyncSGIX)
+#define glFinishFenceAPPLE MANGLE(FinishFenceAPPLE)
+#define glFinishFenceNV MANGLE(FinishFenceNV)
+#define glFinish MANGLE(Finish)
+#define glFinishObjectAPPLE MANGLE(FinishObjectAPPLE)
+#define glFinishTextureSUNX MANGLE(FinishTextureSUNX)
+#define glFlush MANGLE(Flush)
+#define glFlushMappedBufferRangeAPPLE MANGLE(FlushMappedBufferRangeAPPLE)
+#define glFlushMappedBufferRange MANGLE(FlushMappedBufferRange)
+#define glFlushMappedNamedBufferRangeEXT MANGLE(FlushMappedNamedBufferRangeEXT)
+#define glFlushPixelDataRangeNV MANGLE(FlushPixelDataRangeNV)
+#define glFlushRasterSGIX MANGLE(FlushRasterSGIX)
+#define glFlushVertexArrayRangeAPPLE MANGLE(FlushVertexArrayRangeAPPLE)
+#define glFlushVertexArrayRangeNV MANGLE(FlushVertexArrayRangeNV)
+#define glFogCoorddEXT MANGLE(FogCoorddEXT)
+#define glFogCoordd MANGLE(FogCoordd)
+#define glFogCoorddvEXT MANGLE(FogCoorddvEXT)
+#define glFogCoorddv MANGLE(FogCoorddv)
+#define glFogCoordfEXT MANGLE(FogCoordfEXT)
+#define glFogCoordf MANGLE(FogCoordf)
+#define glFogCoordFormatNV MANGLE(FogCoordFormatNV)
+#define glFogCoordfvEXT MANGLE(FogCoordfvEXT)
+#define glFogCoordfv MANGLE(FogCoordfv)
+#define glFogCoordhNV MANGLE(FogCoordhNV)
+#define glFogCoordhvNV MANGLE(FogCoordhvNV)
+#define glFogCoordPointerEXT MANGLE(FogCoordPointerEXT)
+#define glFogCoordPointerListIBM MANGLE(FogCoordPointerListIBM)
+#define glFogCoordPointer MANGLE(FogCoordPointer)
+#define glFogf MANGLE(Fogf)
+#define glFogFuncSGIS MANGLE(FogFuncSGIS)
+#define glFogfv MANGLE(Fogfv)
+#define glFogi MANGLE(Fogi)
+#define glFogiv MANGLE(Fogiv)
+#define glFragmentColorMaterialSGIX MANGLE(FragmentColorMaterialSGIX)
+#define glFragmentLightfSGIX MANGLE(FragmentLightfSGIX)
+#define glFragmentLightfvSGIX MANGLE(FragmentLightfvSGIX)
+#define glFragmentLightiSGIX MANGLE(FragmentLightiSGIX)
+#define glFragmentLightivSGIX MANGLE(FragmentLightivSGIX)
+#define glFragmentLightModelfSGIX MANGLE(FragmentLightModelfSGIX)
+#define glFragmentLightModelfvSGIX MANGLE(FragmentLightModelfvSGIX)
+#define glFragmentLightModeliSGIX MANGLE(FragmentLightModeliSGIX)
+#define glFragmentLightModelivSGIX MANGLE(FragmentLightModelivSGIX)
+#define glFragmentMaterialfSGIX MANGLE(FragmentMaterialfSGIX)
+#define glFragmentMaterialfvSGIX MANGLE(FragmentMaterialfvSGIX)
+#define glFragmentMaterialiSGIX MANGLE(FragmentMaterialiSGIX)
+#define glFragmentMaterialivSGIX MANGLE(FragmentMaterialivSGIX)
+#define glFramebufferDrawBufferEXT MANGLE(FramebufferDrawBufferEXT)
+#define glFramebufferDrawBuffersEXT MANGLE(FramebufferDrawBuffersEXT)
+#define glFramebufferReadBufferEXT MANGLE(FramebufferReadBufferEXT)
+#define glFramebufferRenderbufferEXT MANGLE(FramebufferRenderbufferEXT)
+#define glFramebufferRenderbuffer MANGLE(FramebufferRenderbuffer)
+#define glFramebufferTexture1DEXT MANGLE(FramebufferTexture1DEXT)
+#define glFramebufferTexture1D MANGLE(FramebufferTexture1D)
+#define glFramebufferTexture2DEXT MANGLE(FramebufferTexture2DEXT)
+#define glFramebufferTexture2D MANGLE(FramebufferTexture2D)
+#define glFramebufferTexture3DEXT MANGLE(FramebufferTexture3DEXT)
+#define glFramebufferTexture3D MANGLE(FramebufferTexture3D)
+#define glFramebufferTextureARB MANGLE(FramebufferTextureARB)
+#define glFramebufferTextureEXT MANGLE(FramebufferTextureEXT)
+#define glFramebufferTextureFaceARB MANGLE(FramebufferTextureFaceARB)
+#define glFramebufferTextureFaceEXT MANGLE(FramebufferTextureFaceEXT)
+#define glFramebufferTextureLayerARB MANGLE(FramebufferTextureLayerARB)
+#define glFramebufferTextureLayerEXT MANGLE(FramebufferTextureLayerEXT)
+#define glFramebufferTextureLayer MANGLE(FramebufferTextureLayer)
+#define glFramebufferTexture MANGLE(FramebufferTexture)
+#define glFrameTerminatorGREMEDY MANGLE(FrameTerminatorGREMEDY)
+#define glFrameZoomSGIX MANGLE(FrameZoomSGIX)
+#define glFreeObjectBufferATI MANGLE(FreeObjectBufferATI)
+#define glFrontFace MANGLE(FrontFace)
+#define glFrustum MANGLE(Frustum)
+#define glGenAsyncMarkersSGIX MANGLE(GenAsyncMarkersSGIX)
+#define glGenBuffersARB MANGLE(GenBuffersARB)
+#define glGenBuffers MANGLE(GenBuffers)
+#define glGenerateMipmapEXT MANGLE(GenerateMipmapEXT)
+#define glGenerateMipmap MANGLE(GenerateMipmap)
+#define glGenerateMultiTexMipmapEXT MANGLE(GenerateMultiTexMipmapEXT)
+#define glGenerateTextureMipmapEXT MANGLE(GenerateTextureMipmapEXT)
+#define glGenFencesAPPLE MANGLE(GenFencesAPPLE)
+#define glGenFencesNV MANGLE(GenFencesNV)
+#define glGenFragmentShadersATI MANGLE(GenFragmentShadersATI)
+#define glGenFramebuffersEXT MANGLE(GenFramebuffersEXT)
+#define glGenFramebuffers MANGLE(GenFramebuffers)
+#define glGenLists MANGLE(GenLists)
+#define glGenNamesAMD MANGLE(GenNamesAMD)
+#define glGenOcclusionQueriesNV MANGLE(GenOcclusionQueriesNV)
+#define glGenPerfMonitorsAMD MANGLE(GenPerfMonitorsAMD)
+#define glGenProgramPipelines MANGLE(GenProgramPipelines)
+#define glGenProgramsARB MANGLE(GenProgramsARB)
+#define glGenProgramsNV MANGLE(GenProgramsNV)
+#define glGenQueriesARB MANGLE(GenQueriesARB)
+#define glGenQueries MANGLE(GenQueries)
+#define glGenRenderbuffersEXT MANGLE(GenRenderbuffersEXT)
+#define glGenRenderbuffers MANGLE(GenRenderbuffers)
+#define glGenSamplers MANGLE(GenSamplers)
+#define glGenSymbolsEXT MANGLE(GenSymbolsEXT)
+#define glGenTexturesEXT MANGLE(GenTexturesEXT)
+#define glGenTextures MANGLE(GenTextures)
+#define glGenTransformFeedbacks MANGLE(GenTransformFeedbacks)
+#define glGenTransformFeedbacksNV MANGLE(GenTransformFeedbacksNV)
+#define glGenVertexArraysAPPLE MANGLE(GenVertexArraysAPPLE)
+#define glGenVertexArrays MANGLE(GenVertexArrays)
+#define glGenVertexShadersEXT MANGLE(GenVertexShadersEXT)
+#define glGetActiveAttribARB MANGLE(GetActiveAttribARB)
+#define glGetActiveAttrib MANGLE(GetActiveAttrib)
+#define glGetActiveSubroutineName MANGLE(GetActiveSubroutineName)
+#define glGetActiveSubroutineUniformiv MANGLE(GetActiveSubroutineUniformiv)
+#define glGetActiveSubroutineUniformName MANGLE(GetActiveSubroutineUniformName)
+#define glGetActiveUniformARB MANGLE(GetActiveUniformARB)
+#define glGetActiveUniformBlockiv MANGLE(GetActiveUniformBlockiv)
+#define glGetActiveUniformBlockName MANGLE(GetActiveUniformBlockName)
+#define glGetActiveUniform MANGLE(GetActiveUniform)
+#define glGetActiveUniformName MANGLE(GetActiveUniformName)
+#define glGetActiveUniformsiv MANGLE(GetActiveUniformsiv)
+#define glGetActiveVaryingNV MANGLE(GetActiveVaryingNV)
+#define glGetArrayObjectfvATI MANGLE(GetArrayObjectfvATI)
+#define glGetArrayObjectivATI MANGLE(GetArrayObjectivATI)
+#define glGetAttachedObjectsARB MANGLE(GetAttachedObjectsARB)
+#define glGetAttachedShaders MANGLE(GetAttachedShaders)
+#define glGetAttribLocationARB MANGLE(GetAttribLocationARB)
+#define glGetAttribLocation MANGLE(GetAttribLocation)
+#define glGetBooleanIndexedvEXT MANGLE(GetBooleanIndexedvEXT)
+#define glGetBooleani_v MANGLE(GetBooleani_v)
+#define glGetBooleanv MANGLE(GetBooleanv)
+#define glGetBufferParameteri64v MANGLE(GetBufferParameteri64v)
+#define glGetBufferParameterivARB MANGLE(GetBufferParameterivARB)
+#define glGetBufferParameteriv MANGLE(GetBufferParameteriv)
+#define glGetBufferParameterui64vNV MANGLE(GetBufferParameterui64vNV)
+#define glGetBufferPointervARB MANGLE(GetBufferPointervARB)
+#define glGetBufferPointerv MANGLE(GetBufferPointerv)
+#define glGetBufferSubDataARB MANGLE(GetBufferSubDataARB)
+#define glGetBufferSubData MANGLE(GetBufferSubData)
+#define glGetClipPlane MANGLE(GetClipPlane)
+#define glGetColorTableEXT MANGLE(GetColorTableEXT)
+#define glGetColorTable MANGLE(GetColorTable)
+#define glGetColorTableParameterfvEXT MANGLE(GetColorTableParameterfvEXT)
+#define glGetColorTableParameterfv MANGLE(GetColorTableParameterfv)
+#define glGetColorTableParameterfvSGI MANGLE(GetColorTableParameterfvSGI)
+#define glGetColorTableParameterivEXT MANGLE(GetColorTableParameterivEXT)
+#define glGetColorTableParameteriv MANGLE(GetColorTableParameteriv)
+#define glGetColorTableParameterivSGI MANGLE(GetColorTableParameterivSGI)
+#define glGetColorTableSGI MANGLE(GetColorTableSGI)
+#define glGetCombinerInputParameterfvNV MANGLE(GetCombinerInputParameterfvNV)
+#define glGetCombinerInputParameterivNV MANGLE(GetCombinerInputParameterivNV)
+#define glGetCombinerOutputParameterfvNV MANGLE(GetCombinerOutputParameterfvNV)
+#define glGetCombinerOutputParameterivNV MANGLE(GetCombinerOutputParameterivNV)
+#define glGetCombinerStageParameterfvNV MANGLE(GetCombinerStageParameterfvNV)
+#define glGetCompressedMultiTexImageEXT MANGLE(GetCompressedMultiTexImageEXT)
+#define glGetCompressedTexImageARB MANGLE(GetCompressedTexImageARB)
+#define glGetCompressedTexImage MANGLE(GetCompressedTexImage)
+#define glGetCompressedTextureImageEXT MANGLE(GetCompressedTextureImageEXT)
+#define glGetConvolutionFilterEXT MANGLE(GetConvolutionFilterEXT)
+#define glGetConvolutionFilter MANGLE(GetConvolutionFilter)
+#define glGetConvolutionParameterfvEXT MANGLE(GetConvolutionParameterfvEXT)
+#define glGetConvolutionParameterfv MANGLE(GetConvolutionParameterfv)
+#define glGetConvolutionParameterivEXT MANGLE(GetConvolutionParameterivEXT)
+#define glGetConvolutionParameteriv MANGLE(GetConvolutionParameteriv)
+#define glGetDebugLogLengthMESA MANGLE(GetDebugLogLengthMESA)
+#define glGetDebugLogMESA MANGLE(GetDebugLogMESA)
+#define glGetDebugMessageLogAMD MANGLE(GetDebugMessageLogAMD)
+#define glGetDebugMessageLogARB MANGLE(GetDebugMessageLogARB)
+#define glGetDetailTexFuncSGIS MANGLE(GetDetailTexFuncSGIS)
+#define glGetDoubleIndexedvEXT MANGLE(GetDoubleIndexedvEXT)
+#define glGetDoublei_v MANGLE(GetDoublei_v)
+#define glGetDoublev MANGLE(GetDoublev)
+#define glGetError MANGLE(GetError)
+#define glGetFenceivNV MANGLE(GetFenceivNV)
+#define glGetFinalCombinerInputParameterfvNV MANGLE(GetFinalCombinerInputParameterfvNV)
+#define glGetFinalCombinerInputParameterivNV MANGLE(GetFinalCombinerInputParameterivNV)
+#define glGetFloatIndexedvEXT MANGLE(GetFloatIndexedvEXT)
+#define glGetFloati_v MANGLE(GetFloati_v)
+#define glGetFloatv MANGLE(GetFloatv)
+#define glGetFogFuncSGIS MANGLE(GetFogFuncSGIS)
+#define glGetFragDataIndex MANGLE(GetFragDataIndex)
+#define glGetFragDataLocationEXT MANGLE(GetFragDataLocationEXT)
+#define glGetFragDataLocation MANGLE(GetFragDataLocation)
+#define glGetFragmentLightfvSGIX MANGLE(GetFragmentLightfvSGIX)
+#define glGetFragmentLightivSGIX MANGLE(GetFragmentLightivSGIX)
+#define glGetFragmentMaterialfvSGIX MANGLE(GetFragmentMaterialfvSGIX)
+#define glGetFragmentMaterialivSGIX MANGLE(GetFragmentMaterialivSGIX)
+#define glGetFramebufferAttachmentParameterivEXT MANGLE(GetFramebufferAttachmentParameterivEXT)
+#define glGetFramebufferAttachmentParameteriv MANGLE(GetFramebufferAttachmentParameteriv)
+#define glGetFramebufferParameterivEXT MANGLE(GetFramebufferParameterivEXT)
+#define glGetGraphicsResetStatusARB MANGLE(GetGraphicsResetStatusARB)
+#define glGetHandleARB MANGLE(GetHandleARB)
+#define glGetHistogramEXT MANGLE(GetHistogramEXT)
+#define glGetHistogram MANGLE(GetHistogram)
+#define glGetHistogramParameterfvEXT MANGLE(GetHistogramParameterfvEXT)
+#define glGetHistogramParameterfv MANGLE(GetHistogramParameterfv)
+#define glGetHistogramParameterivEXT MANGLE(GetHistogramParameterivEXT)
+#define glGetHistogramParameteriv MANGLE(GetHistogramParameteriv)
+#define glGetImageTransformParameterfvHP MANGLE(GetImageTransformParameterfvHP)
+#define glGetImageTransformParameterivHP MANGLE(GetImageTransformParameterivHP)
+#define glGetInfoLogARB MANGLE(GetInfoLogARB)
+#define glGetInstrumentsSGIX MANGLE(GetInstrumentsSGIX)
+#define glGetInteger64i_v MANGLE(GetInteger64i_v)
+#define glGetInteger64v MANGLE(GetInteger64v)
+#define glGetIntegerIndexedvEXT MANGLE(GetIntegerIndexedvEXT)
+#define glGetIntegeri_v MANGLE(GetIntegeri_v)
+#define glGetIntegerui64i_vNV MANGLE(GetIntegerui64i_vNV)
+#define glGetIntegerui64vNV MANGLE(GetIntegerui64vNV)
+#define glGetIntegerv MANGLE(GetIntegerv)
+#define glGetInvariantBooleanvEXT MANGLE(GetInvariantBooleanvEXT)
+#define glGetInvariantFloatvEXT MANGLE(GetInvariantFloatvEXT)
+#define glGetInvariantIntegervEXT MANGLE(GetInvariantIntegervEXT)
+#define glGetLightfv MANGLE(GetLightfv)
+#define glGetLightiv MANGLE(GetLightiv)
+#define glGetListParameterfvSGIX MANGLE(GetListParameterfvSGIX)
+#define glGetListParameterivSGIX MANGLE(GetListParameterivSGIX)
+#define glGetLocalConstantBooleanvEXT MANGLE(GetLocalConstantBooleanvEXT)
+#define glGetLocalConstantFloatvEXT MANGLE(GetLocalConstantFloatvEXT)
+#define glGetLocalConstantIntegervEXT MANGLE(GetLocalConstantIntegervEXT)
+#define glGetMapAttribParameterfvNV MANGLE(GetMapAttribParameterfvNV)
+#define glGetMapAttribParameterivNV MANGLE(GetMapAttribParameterivNV)
+#define glGetMapControlPointsNV MANGLE(GetMapControlPointsNV)
+#define glGetMapdv MANGLE(GetMapdv)
+#define glGetMapfv MANGLE(GetMapfv)
+#define glGetMapiv MANGLE(GetMapiv)
+#define glGetMapParameterfvNV MANGLE(GetMapParameterfvNV)
+#define glGetMapParameterivNV MANGLE(GetMapParameterivNV)
+#define glGetMaterialfv MANGLE(GetMaterialfv)
+#define glGetMaterialiv MANGLE(GetMaterialiv)
+#define glGetMinmaxEXT MANGLE(GetMinmaxEXT)
+#define glGetMinmax MANGLE(GetMinmax)
+#define glGetMinmaxParameterfvEXT MANGLE(GetMinmaxParameterfvEXT)
+#define glGetMinmaxParameterfv MANGLE(GetMinmaxParameterfv)
+#define glGetMinmaxParameterivEXT MANGLE(GetMinmaxParameterivEXT)
+#define glGetMinmaxParameteriv MANGLE(GetMinmaxParameteriv)
+#define glGetMultisamplefv MANGLE(GetMultisamplefv)
+#define glGetMultisamplefvNV MANGLE(GetMultisamplefvNV)
+#define glGetMultiTexEnvfvEXT MANGLE(GetMultiTexEnvfvEXT)
+#define glGetMultiTexEnvivEXT MANGLE(GetMultiTexEnvivEXT)
+#define glGetMultiTexGendvEXT MANGLE(GetMultiTexGendvEXT)
+#define glGetMultiTexGenfvEXT MANGLE(GetMultiTexGenfvEXT)
+#define glGetMultiTexGenivEXT MANGLE(GetMultiTexGenivEXT)
+#define glGetMultiTexImageEXT MANGLE(GetMultiTexImageEXT)
+#define glGetMultiTexLevelParameterfvEXT MANGLE(GetMultiTexLevelParameterfvEXT)
+#define glGetMultiTexLevelParameterivEXT MANGLE(GetMultiTexLevelParameterivEXT)
+#define glGetMultiTexParameterfvEXT MANGLE(GetMultiTexParameterfvEXT)
+#define glGetMultiTexParameterIivEXT MANGLE(GetMultiTexParameterIivEXT)
+#define glGetMultiTexParameterIuivEXT MANGLE(GetMultiTexParameterIuivEXT)
+#define glGetMultiTexParameterivEXT MANGLE(GetMultiTexParameterivEXT)
+#define glGetNamedBufferParameterivEXT MANGLE(GetNamedBufferParameterivEXT)
+#define glGetNamedBufferParameterui64vNV MANGLE(GetNamedBufferParameterui64vNV)
+#define glGetNamedBufferPointervEXT MANGLE(GetNamedBufferPointervEXT)
+#define glGetNamedBufferSubDataEXT MANGLE(GetNamedBufferSubDataEXT)
+#define glGetNamedFramebufferAttachmentParameterivEXT MANGLE(GetNamedFramebufferAttachmentParameterivEXT)
+#define glGetNamedProgramivEXT MANGLE(GetNamedProgramivEXT)
+#define glGetNamedProgramLocalParameterdvEXT MANGLE(GetNamedProgramLocalParameterdvEXT)
+#define glGetNamedProgramLocalParameterfvEXT MANGLE(GetNamedProgramLocalParameterfvEXT)
+#define glGetNamedProgramLocalParameterIivEXT MANGLE(GetNamedProgramLocalParameterIivEXT)
+#define glGetNamedProgramLocalParameterIuivEXT MANGLE(GetNamedProgramLocalParameterIuivEXT)
+#define glGetNamedProgramStringEXT MANGLE(GetNamedProgramStringEXT)
+#define glGetNamedRenderbufferParameterivEXT MANGLE(GetNamedRenderbufferParameterivEXT)
+#define glGetNamedStringARB MANGLE(GetNamedStringARB)
+#define glGetNamedStringivARB MANGLE(GetNamedStringivARB)
+#define glGetnColorTableARB MANGLE(GetnColorTableARB)
+#define glGetnCompressedTexImageARB MANGLE(GetnCompressedTexImageARB)
+#define glGetnConvolutionFilterARB MANGLE(GetnConvolutionFilterARB)
+#define glGetnHistogramARB MANGLE(GetnHistogramARB)
+#define glGetnMapdvARB MANGLE(GetnMapdvARB)
+#define glGetnMapfvARB MANGLE(GetnMapfvARB)
+#define glGetnMapivARB MANGLE(GetnMapivARB)
+#define glGetnMinmaxARB MANGLE(GetnMinmaxARB)
+#define glGetnPixelMapfvARB MANGLE(GetnPixelMapfvARB)
+#define glGetnPixelMapuivARB MANGLE(GetnPixelMapuivARB)
+#define glGetnPixelMapusvARB MANGLE(GetnPixelMapusvARB)
+#define glGetnPolygonStippleARB MANGLE(GetnPolygonStippleARB)
+#define glGetnSeparableFilterARB MANGLE(GetnSeparableFilterARB)
+#define glGetnTexImageARB MANGLE(GetnTexImageARB)
+#define glGetnUniformdvARB MANGLE(GetnUniformdvARB)
+#define glGetnUniformfvARB MANGLE(GetnUniformfvARB)
+#define glGetnUniformivARB MANGLE(GetnUniformivARB)
+#define glGetnUniformuivARB MANGLE(GetnUniformuivARB)
+#define glGetObjectBufferfvATI MANGLE(GetObjectBufferfvATI)
+#define glGetObjectBufferivATI MANGLE(GetObjectBufferivATI)
+#define glGetObjectParameterfvARB MANGLE(GetObjectParameterfvARB)
+#define glGetObjectParameterivAPPLE MANGLE(GetObjectParameterivAPPLE)
+#define glGetObjectParameterivARB MANGLE(GetObjectParameterivARB)
+#define glGetOcclusionQueryivNV MANGLE(GetOcclusionQueryivNV)
+#define glGetOcclusionQueryuivNV MANGLE(GetOcclusionQueryuivNV)
+#define glGetPerfMonitorCounterDataAMD MANGLE(GetPerfMonitorCounterDataAMD)
+#define glGetPerfMonitorCounterInfoAMD MANGLE(GetPerfMonitorCounterInfoAMD)
+#define glGetPerfMonitorCountersAMD MANGLE(GetPerfMonitorCountersAMD)
+#define glGetPerfMonitorCounterStringAMD MANGLE(GetPerfMonitorCounterStringAMD)
+#define glGetPerfMonitorGroupsAMD MANGLE(GetPerfMonitorGroupsAMD)
+#define glGetPerfMonitorGroupStringAMD MANGLE(GetPerfMonitorGroupStringAMD)
+#define glGetPixelMapfv MANGLE(GetPixelMapfv)
+#define glGetPixelMapuiv MANGLE(GetPixelMapuiv)
+#define glGetPixelMapusv MANGLE(GetPixelMapusv)
+#define glGetPixelTexGenParameterfvSGIS MANGLE(GetPixelTexGenParameterfvSGIS)
+#define glGetPixelTexGenParameterivSGIS MANGLE(GetPixelTexGenParameterivSGIS)
+#define glGetPointerIndexedvEXT MANGLE(GetPointerIndexedvEXT)
+#define glGetPointervEXT MANGLE(GetPointervEXT)
+#define glGetPointerv MANGLE(GetPointerv)
+#define glGetPolygonStipple MANGLE(GetPolygonStipple)
+#define glGetProgramBinary MANGLE(GetProgramBinary)
+#define glGetProgramEnvParameterdvARB MANGLE(GetProgramEnvParameterdvARB)
+#define glGetProgramEnvParameterfvARB MANGLE(GetProgramEnvParameterfvARB)
+#define glGetProgramEnvParameterIivNV MANGLE(GetProgramEnvParameterIivNV)
+#define glGetProgramEnvParameterIuivNV MANGLE(GetProgramEnvParameterIuivNV)
+#define glGetProgramInfoLog MANGLE(GetProgramInfoLog)
+#define glGetProgramivARB MANGLE(GetProgramivARB)
+#define glGetProgramiv MANGLE(GetProgramiv)
+#define glGetProgramivNV MANGLE(GetProgramivNV)
+#define glGetProgramLocalParameterdvARB MANGLE(GetProgramLocalParameterdvARB)
+#define glGetProgramLocalParameterfvARB MANGLE(GetProgramLocalParameterfvARB)
+#define glGetProgramLocalParameterIivNV MANGLE(GetProgramLocalParameterIivNV)
+#define glGetProgramLocalParameterIuivNV MANGLE(GetProgramLocalParameterIuivNV)
+#define glGetProgramNamedParameterdvNV MANGLE(GetProgramNamedParameterdvNV)
+#define glGetProgramNamedParameterfvNV MANGLE(GetProgramNamedParameterfvNV)
+#define glGetProgramParameterdvNV MANGLE(GetProgramParameterdvNV)
+#define glGetProgramParameterfvNV MANGLE(GetProgramParameterfvNV)
+#define glGetProgramPipelineInfoLog MANGLE(GetProgramPipelineInfoLog)
+#define glGetProgramPipelineiv MANGLE(GetProgramPipelineiv)
+#define glGetProgramRegisterfvMESA MANGLE(GetProgramRegisterfvMESA)
+#define glGetProgramStageiv MANGLE(GetProgramStageiv)
+#define glGetProgramStringARB MANGLE(GetProgramStringARB)
+#define glGetProgramStringNV MANGLE(GetProgramStringNV)
+#define glGetProgramSubroutineParameteruivNV MANGLE(GetProgramSubroutineParameteruivNV)
+#define glGetQueryIndexediv MANGLE(GetQueryIndexediv)
+#define glGetQueryivARB MANGLE(GetQueryivARB)
+#define glGetQueryiv MANGLE(GetQueryiv)
+#define glGetQueryObjecti64vEXT MANGLE(GetQueryObjecti64vEXT)
+#define glGetQueryObjecti64v MANGLE(GetQueryObjecti64v)
+#define glGetQueryObjectivARB MANGLE(GetQueryObjectivARB)
+#define glGetQueryObjectiv MANGLE(GetQueryObjectiv)
+#define glGetQueryObjectui64vEXT MANGLE(GetQueryObjectui64vEXT)
+#define glGetQueryObjectui64v MANGLE(GetQueryObjectui64v)
+#define glGetQueryObjectuivARB MANGLE(GetQueryObjectuivARB)
+#define glGetQueryObjectuiv MANGLE(GetQueryObjectuiv)
+#define glGetRenderbufferParameterivEXT MANGLE(GetRenderbufferParameterivEXT)
+#define glGetRenderbufferParameteriv MANGLE(GetRenderbufferParameteriv)
+#define glGetSamplerParameterfv MANGLE(GetSamplerParameterfv)
+#define glGetSamplerParameterIiv MANGLE(GetSamplerParameterIiv)
+#define glGetSamplerParameterIuiv MANGLE(GetSamplerParameterIuiv)
+#define glGetSamplerParameteriv MANGLE(GetSamplerParameteriv)
+#define glGetSeparableFilterEXT MANGLE(GetSeparableFilterEXT)
+#define glGetSeparableFilter MANGLE(GetSeparableFilter)
+#define glGetShaderInfoLog MANGLE(GetShaderInfoLog)
+#define glGetShaderiv MANGLE(GetShaderiv)
+#define glGetShaderPrecisionFormat MANGLE(GetShaderPrecisionFormat)
+#define glGetShaderSourceARB MANGLE(GetShaderSourceARB)
+#define glGetShaderSource MANGLE(GetShaderSource)
+#define glGetSharpenTexFuncSGIS MANGLE(GetSharpenTexFuncSGIS)
+#define glGetStringi MANGLE(GetStringi)
+#define glGetString MANGLE(GetString)
+#define glGetSubroutineIndex MANGLE(GetSubroutineIndex)
+#define glGetSubroutineUniformLocation MANGLE(GetSubroutineUniformLocation)
+#define glGetSynciv MANGLE(GetSynciv)
+#define glGetTexBumpParameterfvATI MANGLE(GetTexBumpParameterfvATI)
+#define glGetTexBumpParameterivATI MANGLE(GetTexBumpParameterivATI)
+#define glGetTexEnvfv MANGLE(GetTexEnvfv)
+#define glGetTexEnviv MANGLE(GetTexEnviv)
+#define glGetTexFilterFuncSGIS MANGLE(GetTexFilterFuncSGIS)
+#define glGetTexGendv MANGLE(GetTexGendv)
+#define glGetTexGenfv MANGLE(GetTexGenfv)
+#define glGetTexGeniv MANGLE(GetTexGeniv)
+#define glGetTexImage MANGLE(GetTexImage)
+#define glGetTexLevelParameterfv MANGLE(GetTexLevelParameterfv)
+#define glGetTexLevelParameteriv MANGLE(GetTexLevelParameteriv)
+#define glGetTexParameterfv MANGLE(GetTexParameterfv)
+#define glGetTexParameterIivEXT MANGLE(GetTexParameterIivEXT)
+#define glGetTexParameterIiv MANGLE(GetTexParameterIiv)
+#define glGetTexParameterIuivEXT MANGLE(GetTexParameterIuivEXT)
+#define glGetTexParameterIuiv MANGLE(GetTexParameterIuiv)
+#define glGetTexParameteriv MANGLE(GetTexParameteriv)
+#define glGetTexParameterPointervAPPLE MANGLE(GetTexParameterPointervAPPLE)
+#define glGetTextureImageEXT MANGLE(GetTextureImageEXT)
+#define glGetTextureLevelParameterfvEXT MANGLE(GetTextureLevelParameterfvEXT)
+#define glGetTextureLevelParameterivEXT MANGLE(GetTextureLevelParameterivEXT)
+#define glGetTextureParameterfvEXT MANGLE(GetTextureParameterfvEXT)
+#define glGetTextureParameterIivEXT MANGLE(GetTextureParameterIivEXT)
+#define glGetTextureParameterIuivEXT MANGLE(GetTextureParameterIuivEXT)
+#define glGetTextureParameterivEXT MANGLE(GetTextureParameterivEXT)
+#define glGetTrackMatrixivNV MANGLE(GetTrackMatrixivNV)
+#define glGetTransformFeedbackVaryingEXT MANGLE(GetTransformFeedbackVaryingEXT)
+#define glGetTransformFeedbackVarying MANGLE(GetTransformFeedbackVarying)
+#define glGetTransformFeedbackVaryingNV MANGLE(GetTransformFeedbackVaryingNV)
+#define glGetUniformBlockIndex MANGLE(GetUniformBlockIndex)
+#define glGetUniformBufferSizeEXT MANGLE(GetUniformBufferSizeEXT)
+#define glGetUniformdv MANGLE(GetUniformdv)
+#define glGetUniformfvARB MANGLE(GetUniformfvARB)
+#define glGetUniformfv MANGLE(GetUniformfv)
+#define glGetUniformi64vNV MANGLE(GetUniformi64vNV)
+#define glGetUniformIndices MANGLE(GetUniformIndices)
+#define glGetUniformivARB MANGLE(GetUniformivARB)
+#define glGetUniformiv MANGLE(GetUniformiv)
+#define glGetUniformLocationARB MANGLE(GetUniformLocationARB)
+#define glGetUniformLocation MANGLE(GetUniformLocation)
+#define glGetUniformOffsetEXT MANGLE(GetUniformOffsetEXT)
+#define glGetUniformSubroutineuiv MANGLE(GetUniformSubroutineuiv)
+#define glGetUniformui64vNV MANGLE(GetUniformui64vNV)
+#define glGetUniformuivEXT MANGLE(GetUniformuivEXT)
+#define glGetUniformuiv MANGLE(GetUniformuiv)
+#define glGetVariantArrayObjectfvATI MANGLE(GetVariantArrayObjectfvATI)
+#define glGetVariantArrayObjectivATI MANGLE(GetVariantArrayObjectivATI)
+#define glGetVariantBooleanvEXT MANGLE(GetVariantBooleanvEXT)
+#define glGetVariantFloatvEXT MANGLE(GetVariantFloatvEXT)
+#define glGetVariantIntegervEXT MANGLE(GetVariantIntegervEXT)
+#define glGetVariantPointervEXT MANGLE(GetVariantPointervEXT)
+#define glGetVaryingLocationNV MANGLE(GetVaryingLocationNV)
+#define glGetVertexAttribArrayObjectfvATI MANGLE(GetVertexAttribArrayObjectfvATI)
+#define glGetVertexAttribArrayObjectivATI MANGLE(GetVertexAttribArrayObjectivATI)
+#define glGetVertexAttribdvARB MANGLE(GetVertexAttribdvARB)
+#define glGetVertexAttribdv MANGLE(GetVertexAttribdv)
+#define glGetVertexAttribdvNV MANGLE(GetVertexAttribdvNV)
+#define glGetVertexAttribfvARB MANGLE(GetVertexAttribfvARB)
+#define glGetVertexAttribfv MANGLE(GetVertexAttribfv)
+#define glGetVertexAttribfvNV MANGLE(GetVertexAttribfvNV)
+#define glGetVertexAttribIivEXT MANGLE(GetVertexAttribIivEXT)
+#define glGetVertexAttribIiv MANGLE(GetVertexAttribIiv)
+#define glGetVertexAttribIuivEXT MANGLE(GetVertexAttribIuivEXT)
+#define glGetVertexAttribIuiv MANGLE(GetVertexAttribIuiv)
+#define glGetVertexAttribivARB MANGLE(GetVertexAttribivARB)
+#define glGetVertexAttribiv MANGLE(GetVertexAttribiv)
+#define glGetVertexAttribivNV MANGLE(GetVertexAttribivNV)
+#define glGetVertexAttribLdvEXT MANGLE(GetVertexAttribLdvEXT)
+#define glGetVertexAttribLdv MANGLE(GetVertexAttribLdv)
+#define glGetVertexAttribLi64vNV MANGLE(GetVertexAttribLi64vNV)
+#define glGetVertexAttribLui64vNV MANGLE(GetVertexAttribLui64vNV)
+#define glGetVertexAttribPointervARB MANGLE(GetVertexAttribPointervARB)
+#define glGetVertexAttribPointerv MANGLE(GetVertexAttribPointerv)
+#define glGetVertexAttribPointervNV MANGLE(GetVertexAttribPointervNV)
+#define glGetVideoCaptureivNV MANGLE(GetVideoCaptureivNV)
+#define glGetVideoCaptureStreamdvNV MANGLE(GetVideoCaptureStreamdvNV)
+#define glGetVideoCaptureStreamfvNV MANGLE(GetVideoCaptureStreamfvNV)
+#define glGetVideoCaptureStreamivNV MANGLE(GetVideoCaptureStreamivNV)
+#define glGetVideoi64vNV MANGLE(GetVideoi64vNV)
+#define glGetVideoivNV MANGLE(GetVideoivNV)
+#define glGetVideoui64vNV MANGLE(GetVideoui64vNV)
+#define glGetVideouivNV MANGLE(GetVideouivNV)
+#define glGlobalAlphaFactorbSUN MANGLE(GlobalAlphaFactorbSUN)
+#define glGlobalAlphaFactordSUN MANGLE(GlobalAlphaFactordSUN)
+#define glGlobalAlphaFactorfSUN MANGLE(GlobalAlphaFactorfSUN)
+#define glGlobalAlphaFactoriSUN MANGLE(GlobalAlphaFactoriSUN)
+#define glGlobalAlphaFactorsSUN MANGLE(GlobalAlphaFactorsSUN)
+#define glGlobalAlphaFactorubSUN MANGLE(GlobalAlphaFactorubSUN)
+#define glGlobalAlphaFactoruiSUN MANGLE(GlobalAlphaFactoruiSUN)
+#define glGlobalAlphaFactorusSUN MANGLE(GlobalAlphaFactorusSUN)
+#define glHint MANGLE(Hint)
+#define glHintPGI MANGLE(HintPGI)
+#define glHistogramEXT MANGLE(HistogramEXT)
+#define glHistogram MANGLE(Histogram)
+#define glIglooInterfaceSGIX MANGLE(IglooInterfaceSGIX)
+#define glImageTransformParameterfHP MANGLE(ImageTransformParameterfHP)
+#define glImageTransformParameterfvHP MANGLE(ImageTransformParameterfvHP)
+#define glImageTransformParameteriHP MANGLE(ImageTransformParameteriHP)
+#define glImageTransformParameterivHP MANGLE(ImageTransformParameterivHP)
+#define glIndexd MANGLE(Indexd)
+#define glIndexdv MANGLE(Indexdv)
+#define glIndexf MANGLE(Indexf)
+#define glIndexFormatNV MANGLE(IndexFormatNV)
+#define glIndexFuncEXT MANGLE(IndexFuncEXT)
+#define glIndexfv MANGLE(Indexfv)
+#define glIndexi MANGLE(Indexi)
+#define glIndexiv MANGLE(Indexiv)
+#define glIndexMask MANGLE(IndexMask)
+#define glIndexMaterialEXT MANGLE(IndexMaterialEXT)
+#define glIndexPointerEXT MANGLE(IndexPointerEXT)
+#define glIndexPointerListIBM MANGLE(IndexPointerListIBM)
+#define glIndexPointer MANGLE(IndexPointer)
+#define glIndexs MANGLE(Indexs)
+#define glIndexsv MANGLE(Indexsv)
+#define glIndexub MANGLE(Indexub)
+#define glIndexubv MANGLE(Indexubv)
+#define glInitNames MANGLE(InitNames)
+#define glInsertComponentEXT MANGLE(InsertComponentEXT)
+#define glInstrumentsBufferSGIX MANGLE(InstrumentsBufferSGIX)
+#define glInterleavedArrays MANGLE(InterleavedArrays)
+#define glIsAsyncMarkerSGIX MANGLE(IsAsyncMarkerSGIX)
+#define glIsBufferARB MANGLE(IsBufferARB)
+#define glIsBuffer MANGLE(IsBuffer)
+#define glIsBufferResidentNV MANGLE(IsBufferResidentNV)
+#define glIsEnabledi MANGLE(IsEnabledi)
+#define glIsEnabledIndexedEXT MANGLE(IsEnabledIndexedEXT)
+#define glIsEnabled MANGLE(IsEnabled)
+#define glIsFenceAPPLE MANGLE(IsFenceAPPLE)
+#define glIsFenceNV MANGLE(IsFenceNV)
+#define glIsFramebufferEXT MANGLE(IsFramebufferEXT)
+#define glIsFramebuffer MANGLE(IsFramebuffer)
+#define glIsList MANGLE(IsList)
+#define glIsNameAMD MANGLE(IsNameAMD)
+#define glIsNamedBufferResidentNV MANGLE(IsNamedBufferResidentNV)
+#define glIsNamedStringARB MANGLE(IsNamedStringARB)
+#define glIsObjectBufferATI MANGLE(IsObjectBufferATI)
+#define glIsOcclusionQueryNV MANGLE(IsOcclusionQueryNV)
+#define glIsProgramARB MANGLE(IsProgramARB)
+#define glIsProgram MANGLE(IsProgram)
+#define glIsProgramNV MANGLE(IsProgramNV)
+#define glIsProgramPipeline MANGLE(IsProgramPipeline)
+#define glIsQueryARB MANGLE(IsQueryARB)
+#define glIsQuery MANGLE(IsQuery)
+#define glIsRenderbufferEXT MANGLE(IsRenderbufferEXT)
+#define glIsRenderbuffer MANGLE(IsRenderbuffer)
+#define glIsSampler MANGLE(IsSampler)
+#define glIsShader MANGLE(IsShader)
+#define glIsSync MANGLE(IsSync)
+#define glIsTextureEXT MANGLE(IsTextureEXT)
+#define glIsTexture MANGLE(IsTexture)
+#define glIsTransformFeedback MANGLE(IsTransformFeedback)
+#define glIsTransformFeedbackNV MANGLE(IsTransformFeedbackNV)
+#define glIsVariantEnabledEXT MANGLE(IsVariantEnabledEXT)
+#define glIsVertexArrayAPPLE MANGLE(IsVertexArrayAPPLE)
+#define glIsVertexArray MANGLE(IsVertexArray)
+#define glIsVertexAttribEnabledAPPLE MANGLE(IsVertexAttribEnabledAPPLE)
+#define glLightEnviSGIX MANGLE(LightEnviSGIX)
+#define glLightf MANGLE(Lightf)
+#define glLightfv MANGLE(Lightfv)
+#define glLighti MANGLE(Lighti)
+#define glLightiv MANGLE(Lightiv)
+#define glLightModelf MANGLE(LightModelf)
+#define glLightModelfv MANGLE(LightModelfv)
+#define glLightModeli MANGLE(LightModeli)
+#define glLightModeliv MANGLE(LightModeliv)
+#define glLineStipple MANGLE(LineStipple)
+#define glLineWidth MANGLE(LineWidth)
+#define glLinkProgramARB MANGLE(LinkProgramARB)
+#define glLinkProgram MANGLE(LinkProgram)
+#define glListBase MANGLE(ListBase)
+#define glListParameterfSGIX MANGLE(ListParameterfSGIX)
+#define glListParameterfvSGIX MANGLE(ListParameterfvSGIX)
+#define glListParameteriSGIX MANGLE(ListParameteriSGIX)
+#define glListParameterivSGIX MANGLE(ListParameterivSGIX)
+#define glLoadIdentityDeformationMapSGIX MANGLE(LoadIdentityDeformationMapSGIX)
+#define glLoadIdentity MANGLE(LoadIdentity)
+#define glLoadMatrixd MANGLE(LoadMatrixd)
+#define glLoadMatrixf MANGLE(LoadMatrixf)
+#define glLoadName MANGLE(LoadName)
+#define glLoadProgramNV MANGLE(LoadProgramNV)
+#define glLoadTransposeMatrixdARB MANGLE(LoadTransposeMatrixdARB)
+#define glLoadTransposeMatrixd MANGLE(LoadTransposeMatrixd)
+#define glLoadTransposeMatrixfARB MANGLE(LoadTransposeMatrixfARB)
+#define glLoadTransposeMatrixf MANGLE(LoadTransposeMatrixf)
+#define glLockArraysEXT MANGLE(LockArraysEXT)
+#define glLogicOp MANGLE(LogicOp)
+#define glMakeBufferNonResidentNV MANGLE(MakeBufferNonResidentNV)
+#define glMakeBufferResidentNV MANGLE(MakeBufferResidentNV)
+#define glMakeNamedBufferNonResidentNV MANGLE(MakeNamedBufferNonResidentNV)
+#define glMakeNamedBufferResidentNV MANGLE(MakeNamedBufferResidentNV)
+#define glMap1d MANGLE(Map1d)
+#define glMap1f MANGLE(Map1f)
+#define glMap2d MANGLE(Map2d)
+#define glMap2f MANGLE(Map2f)
+#define glMapBufferARB MANGLE(MapBufferARB)
+#define glMapBuffer MANGLE(MapBuffer)
+#define glMapBufferRange MANGLE(MapBufferRange)
+#define glMapControlPointsNV MANGLE(MapControlPointsNV)
+#define glMapGrid1d MANGLE(MapGrid1d)
+#define glMapGrid1f MANGLE(MapGrid1f)
+#define glMapGrid2d MANGLE(MapGrid2d)
+#define glMapGrid2f MANGLE(MapGrid2f)
+#define glMapNamedBufferEXT MANGLE(MapNamedBufferEXT)
+#define glMapNamedBufferRangeEXT MANGLE(MapNamedBufferRangeEXT)
+#define glMapObjectBufferATI MANGLE(MapObjectBufferATI)
+#define glMapParameterfvNV MANGLE(MapParameterfvNV)
+#define glMapParameterivNV MANGLE(MapParameterivNV)
+#define glMapVertexAttrib1dAPPLE MANGLE(MapVertexAttrib1dAPPLE)
+#define glMapVertexAttrib1fAPPLE MANGLE(MapVertexAttrib1fAPPLE)
+#define glMapVertexAttrib2dAPPLE MANGLE(MapVertexAttrib2dAPPLE)
+#define glMapVertexAttrib2fAPPLE MANGLE(MapVertexAttrib2fAPPLE)
+#define glMaterialf MANGLE(Materialf)
+#define glMaterialfv MANGLE(Materialfv)
+#define glMateriali MANGLE(Materiali)
+#define glMaterialiv MANGLE(Materialiv)
+#define glMatrixFrustumEXT MANGLE(MatrixFrustumEXT)
+#define glMatrixIndexPointerARB MANGLE(MatrixIndexPointerARB)
+#define glMatrixIndexubvARB MANGLE(MatrixIndexubvARB)
+#define glMatrixIndexuivARB MANGLE(MatrixIndexuivARB)
+#define glMatrixIndexusvARB MANGLE(MatrixIndexusvARB)
+#define glMatrixLoaddEXT MANGLE(MatrixLoaddEXT)
+#define glMatrixLoadfEXT MANGLE(MatrixLoadfEXT)
+#define glMatrixLoadIdentityEXT MANGLE(MatrixLoadIdentityEXT)
+#define glMatrixLoadTransposedEXT MANGLE(MatrixLoadTransposedEXT)
+#define glMatrixLoadTransposefEXT MANGLE(MatrixLoadTransposefEXT)
+#define glMatrixMode MANGLE(MatrixMode)
+#define glMatrixMultdEXT MANGLE(MatrixMultdEXT)
+#define glMatrixMultfEXT MANGLE(MatrixMultfEXT)
+#define glMatrixMultTransposedEXT MANGLE(MatrixMultTransposedEXT)
+#define glMatrixMultTransposefEXT MANGLE(MatrixMultTransposefEXT)
+#define glMatrixOrthoEXT MANGLE(MatrixOrthoEXT)
+#define glMatrixPopEXT MANGLE(MatrixPopEXT)
+#define glMatrixPushEXT MANGLE(MatrixPushEXT)
+#define glMatrixRotatedEXT MANGLE(MatrixRotatedEXT)
+#define glMatrixRotatefEXT MANGLE(MatrixRotatefEXT)
+#define glMatrixScaledEXT MANGLE(MatrixScaledEXT)
+#define glMatrixScalefEXT MANGLE(MatrixScalefEXT)
+#define glMatrixTranslatedEXT MANGLE(MatrixTranslatedEXT)
+#define glMatrixTranslatefEXT MANGLE(MatrixTranslatefEXT)
+#define glMemoryBarrierEXT MANGLE(MemoryBarrierEXT)
+#define glMinmaxEXT MANGLE(MinmaxEXT)
+#define glMinmax MANGLE(Minmax)
+#define glMinSampleShadingARB MANGLE(MinSampleShadingARB)
+#define glMinSampleShading MANGLE(MinSampleShading)
+#define glMultiDrawArraysEXT MANGLE(MultiDrawArraysEXT)
+#define glMultiDrawArrays MANGLE(MultiDrawArrays)
+#define glMultiDrawElementArrayAPPLE MANGLE(MultiDrawElementArrayAPPLE)
+#define glMultiDrawElementsBaseVertex MANGLE(MultiDrawElementsBaseVertex)
+#define glMultiDrawElementsEXT MANGLE(MultiDrawElementsEXT)
+#define glMultiDrawElements MANGLE(MultiDrawElements)
+#define glMultiDrawRangeElementArrayAPPLE MANGLE(MultiDrawRangeElementArrayAPPLE)
+#define glMultiModeDrawArraysIBM MANGLE(MultiModeDrawArraysIBM)
+#define glMultiModeDrawElementsIBM MANGLE(MultiModeDrawElementsIBM)
+#define glMultiTexBufferEXT MANGLE(MultiTexBufferEXT)
+#define glMultiTexCoord1dARB MANGLE(MultiTexCoord1dARB)
+#define glMultiTexCoord1d MANGLE(MultiTexCoord1d)
+#define glMultiTexCoord1dvARB MANGLE(MultiTexCoord1dvARB)
+#define glMultiTexCoord1dv MANGLE(MultiTexCoord1dv)
+#define glMultiTexCoord1fARB MANGLE(MultiTexCoord1fARB)
+#define glMultiTexCoord1f MANGLE(MultiTexCoord1f)
+#define glMultiTexCoord1fvARB MANGLE(MultiTexCoord1fvARB)
+#define glMultiTexCoord1fv MANGLE(MultiTexCoord1fv)
+#define glMultiTexCoord1hNV MANGLE(MultiTexCoord1hNV)
+#define glMultiTexCoord1hvNV MANGLE(MultiTexCoord1hvNV)
+#define glMultiTexCoord1iARB MANGLE(MultiTexCoord1iARB)
+#define glMultiTexCoord1i MANGLE(MultiTexCoord1i)
+#define glMultiTexCoord1ivARB MANGLE(MultiTexCoord1ivARB)
+#define glMultiTexCoord1iv MANGLE(MultiTexCoord1iv)
+#define glMultiTexCoord1sARB MANGLE(MultiTexCoord1sARB)
+#define glMultiTexCoord1s MANGLE(MultiTexCoord1s)
+#define glMultiTexCoord1svARB MANGLE(MultiTexCoord1svARB)
+#define glMultiTexCoord1sv MANGLE(MultiTexCoord1sv)
+#define glMultiTexCoord2dARB MANGLE(MultiTexCoord2dARB)
+#define glMultiTexCoord2d MANGLE(MultiTexCoord2d)
+#define glMultiTexCoord2dvARB MANGLE(MultiTexCoord2dvARB)
+#define glMultiTexCoord2dv MANGLE(MultiTexCoord2dv)
+#define glMultiTexCoord2fARB MANGLE(MultiTexCoord2fARB)
+#define glMultiTexCoord2f MANGLE(MultiTexCoord2f)
+#define glMultiTexCoord2fvARB MANGLE(MultiTexCoord2fvARB)
+#define glMultiTexCoord2fv MANGLE(MultiTexCoord2fv)
+#define glMultiTexCoord2hNV MANGLE(MultiTexCoord2hNV)
+#define glMultiTexCoord2hvNV MANGLE(MultiTexCoord2hvNV)
+#define glMultiTexCoord2iARB MANGLE(MultiTexCoord2iARB)
+#define glMultiTexCoord2i MANGLE(MultiTexCoord2i)
+#define glMultiTexCoord2ivARB MANGLE(MultiTexCoord2ivARB)
+#define glMultiTexCoord2iv MANGLE(MultiTexCoord2iv)
+#define glMultiTexCoord2sARB MANGLE(MultiTexCoord2sARB)
+#define glMultiTexCoord2s MANGLE(MultiTexCoord2s)
+#define glMultiTexCoord2svARB MANGLE(MultiTexCoord2svARB)
+#define glMultiTexCoord2sv MANGLE(MultiTexCoord2sv)
+#define glMultiTexCoord3dARB MANGLE(MultiTexCoord3dARB)
+#define glMultiTexCoord3d MANGLE(MultiTexCoord3d)
+#define glMultiTexCoord3dvARB MANGLE(MultiTexCoord3dvARB)
+#define glMultiTexCoord3dv MANGLE(MultiTexCoord3dv)
+#define glMultiTexCoord3fARB MANGLE(MultiTexCoord3fARB)
+#define glMultiTexCoord3f MANGLE(MultiTexCoord3f)
+#define glMultiTexCoord3fvARB MANGLE(MultiTexCoord3fvARB)
+#define glMultiTexCoord3fv MANGLE(MultiTexCoord3fv)
+#define glMultiTexCoord3hNV MANGLE(MultiTexCoord3hNV)
+#define glMultiTexCoord3hvNV MANGLE(MultiTexCoord3hvNV)
+#define glMultiTexCoord3iARB MANGLE(MultiTexCoord3iARB)
+#define glMultiTexCoord3i MANGLE(MultiTexCoord3i)
+#define glMultiTexCoord3ivARB MANGLE(MultiTexCoord3ivARB)
+#define glMultiTexCoord3iv MANGLE(MultiTexCoord3iv)
+#define glMultiTexCoord3sARB MANGLE(MultiTexCoord3sARB)
+#define glMultiTexCoord3s MANGLE(MultiTexCoord3s)
+#define glMultiTexCoord3svARB MANGLE(MultiTexCoord3svARB)
+#define glMultiTexCoord3sv MANGLE(MultiTexCoord3sv)
+#define glMultiTexCoord4dARB MANGLE(MultiTexCoord4dARB)
+#define glMultiTexCoord4d MANGLE(MultiTexCoord4d)
+#define glMultiTexCoord4dvARB MANGLE(MultiTexCoord4dvARB)
+#define glMultiTexCoord4dv MANGLE(MultiTexCoord4dv)
+#define glMultiTexCoord4fARB MANGLE(MultiTexCoord4fARB)
+#define glMultiTexCoord4f MANGLE(MultiTexCoord4f)
+#define glMultiTexCoord4fvARB MANGLE(MultiTexCoord4fvARB)
+#define glMultiTexCoord4fv MANGLE(MultiTexCoord4fv)
+#define glMultiTexCoord4hNV MANGLE(MultiTexCoord4hNV)
+#define glMultiTexCoord4hvNV MANGLE(MultiTexCoord4hvNV)
+#define glMultiTexCoord4iARB MANGLE(MultiTexCoord4iARB)
+#define glMultiTexCoord4i MANGLE(MultiTexCoord4i)
+#define glMultiTexCoord4ivARB MANGLE(MultiTexCoord4ivARB)
+#define glMultiTexCoord4iv MANGLE(MultiTexCoord4iv)
+#define glMultiTexCoord4sARB MANGLE(MultiTexCoord4sARB)
+#define glMultiTexCoord4s MANGLE(MultiTexCoord4s)
+#define glMultiTexCoord4svARB MANGLE(MultiTexCoord4svARB)
+#define glMultiTexCoord4sv MANGLE(MultiTexCoord4sv)
+#define glMultiTexCoordP1ui MANGLE(MultiTexCoordP1ui)
+#define glMultiTexCoordP1uiv MANGLE(MultiTexCoordP1uiv)
+#define glMultiTexCoordP2ui MANGLE(MultiTexCoordP2ui)
+#define glMultiTexCoordP2uiv MANGLE(MultiTexCoordP2uiv)
+#define glMultiTexCoordP3ui MANGLE(MultiTexCoordP3ui)
+#define glMultiTexCoordP3uiv MANGLE(MultiTexCoordP3uiv)
+#define glMultiTexCoordP4ui MANGLE(MultiTexCoordP4ui)
+#define glMultiTexCoordP4uiv MANGLE(MultiTexCoordP4uiv)
+#define glMultiTexCoordPointerEXT MANGLE(MultiTexCoordPointerEXT)
+#define glMultiTexEnvfEXT MANGLE(MultiTexEnvfEXT)
+#define glMultiTexEnvfvEXT MANGLE(MultiTexEnvfvEXT)
+#define glMultiTexEnviEXT MANGLE(MultiTexEnviEXT)
+#define glMultiTexEnvivEXT MANGLE(MultiTexEnvivEXT)
+#define glMultiTexGendEXT MANGLE(MultiTexGendEXT)
+#define glMultiTexGendvEXT MANGLE(MultiTexGendvEXT)
+#define glMultiTexGenfEXT MANGLE(MultiTexGenfEXT)
+#define glMultiTexGenfvEXT MANGLE(MultiTexGenfvEXT)
+#define glMultiTexGeniEXT MANGLE(MultiTexGeniEXT)
+#define glMultiTexGenivEXT MANGLE(MultiTexGenivEXT)
+#define glMultiTexImage1DEXT MANGLE(MultiTexImage1DEXT)
+#define glMultiTexImage2DEXT MANGLE(MultiTexImage2DEXT)
+#define glMultiTexImage3DEXT MANGLE(MultiTexImage3DEXT)
+#define glMultiTexParameterfEXT MANGLE(MultiTexParameterfEXT)
+#define glMultiTexParameterfvEXT MANGLE(MultiTexParameterfvEXT)
+#define glMultiTexParameteriEXT MANGLE(MultiTexParameteriEXT)
+#define glMultiTexParameterIivEXT MANGLE(MultiTexParameterIivEXT)
+#define glMultiTexParameterIuivEXT MANGLE(MultiTexParameterIuivEXT)
+#define glMultiTexParameterivEXT MANGLE(MultiTexParameterivEXT)
+#define glMultiTexRenderbufferEXT MANGLE(MultiTexRenderbufferEXT)
+#define glMultiTexSubImage1DEXT MANGLE(MultiTexSubImage1DEXT)
+#define glMultiTexSubImage2DEXT MANGLE(MultiTexSubImage2DEXT)
+#define glMultiTexSubImage3DEXT MANGLE(MultiTexSubImage3DEXT)
+#define glMultMatrixd MANGLE(MultMatrixd)
+#define glMultMatrixf MANGLE(MultMatrixf)
+#define glMultTransposeMatrixdARB MANGLE(MultTransposeMatrixdARB)
+#define glMultTransposeMatrixd MANGLE(MultTransposeMatrixd)
+#define glMultTransposeMatrixfARB MANGLE(MultTransposeMatrixfARB)
+#define glMultTransposeMatrixf MANGLE(MultTransposeMatrixf)
+#define glNamedBufferDataEXT MANGLE(NamedBufferDataEXT)
+#define glNamedBufferSubDataEXT MANGLE(NamedBufferSubDataEXT)
+#define glNamedCopyBufferSubDataEXT MANGLE(NamedCopyBufferSubDataEXT)
+#define glNamedFramebufferRenderbufferEXT MANGLE(NamedFramebufferRenderbufferEXT)
+#define glNamedFramebufferTexture1DEXT MANGLE(NamedFramebufferTexture1DEXT)
+#define glNamedFramebufferTexture2DEXT MANGLE(NamedFramebufferTexture2DEXT)
+#define glNamedFramebufferTexture3DEXT MANGLE(NamedFramebufferTexture3DEXT)
+#define glNamedFramebufferTextureEXT MANGLE(NamedFramebufferTextureEXT)
+#define glNamedFramebufferTextureFaceEXT MANGLE(NamedFramebufferTextureFaceEXT)
+#define glNamedFramebufferTextureLayerEXT MANGLE(NamedFramebufferTextureLayerEXT)
+#define glNamedProgramLocalParameter4dEXT MANGLE(NamedProgramLocalParameter4dEXT)
+#define glNamedProgramLocalParameter4dvEXT MANGLE(NamedProgramLocalParameter4dvEXT)
+#define glNamedProgramLocalParameter4fEXT MANGLE(NamedProgramLocalParameter4fEXT)
+#define glNamedProgramLocalParameter4fvEXT MANGLE(NamedProgramLocalParameter4fvEXT)
+#define glNamedProgramLocalParameterI4iEXT MANGLE(NamedProgramLocalParameterI4iEXT)
+#define glNamedProgramLocalParameterI4ivEXT MANGLE(NamedProgramLocalParameterI4ivEXT)
+#define glNamedProgramLocalParameterI4uiEXT MANGLE(NamedProgramLocalParameterI4uiEXT)
+#define glNamedProgramLocalParameterI4uivEXT MANGLE(NamedProgramLocalParameterI4uivEXT)
+#define glNamedProgramLocalParameters4fvEXT MANGLE(NamedProgramLocalParameters4fvEXT)
+#define glNamedProgramLocalParametersI4ivEXT MANGLE(NamedProgramLocalParametersI4ivEXT)
+#define glNamedProgramLocalParametersI4uivEXT MANGLE(NamedProgramLocalParametersI4uivEXT)
+#define glNamedProgramStringEXT MANGLE(NamedProgramStringEXT)
+#define glNamedRenderbufferStorageEXT MANGLE(NamedRenderbufferStorageEXT)
+#define glNamedRenderbufferStorageMultisampleCoverageEXT MANGLE(NamedRenderbufferStorageMultisampleCoverageEXT)
+#define glNamedRenderbufferStorageMultisampleEXT MANGLE(NamedRenderbufferStorageMultisampleEXT)
+#define glNamedStringARB MANGLE(NamedStringARB)
+#define glNewList MANGLE(NewList)
+#define glNewObjectBufferATI MANGLE(NewObjectBufferATI)
+#define glNormal3b MANGLE(Normal3b)
+#define glNormal3bv MANGLE(Normal3bv)
+#define glNormal3d MANGLE(Normal3d)
+#define glNormal3dv MANGLE(Normal3dv)
+#define glNormal3f MANGLE(Normal3f)
+#define glNormal3fVertex3fSUN MANGLE(Normal3fVertex3fSUN)
+#define glNormal3fVertex3fvSUN MANGLE(Normal3fVertex3fvSUN)
+#define glNormal3fv MANGLE(Normal3fv)
+#define glNormal3hNV MANGLE(Normal3hNV)
+#define glNormal3hvNV MANGLE(Normal3hvNV)
+#define glNormal3i MANGLE(Normal3i)
+#define glNormal3iv MANGLE(Normal3iv)
+#define glNormal3s MANGLE(Normal3s)
+#define glNormal3sv MANGLE(Normal3sv)
+#define glNormalFormatNV MANGLE(NormalFormatNV)
+#define glNormalP3ui MANGLE(NormalP3ui)
+#define glNormalP3uiv MANGLE(NormalP3uiv)
+#define glNormalPointerEXT MANGLE(NormalPointerEXT)
+#define glNormalPointerListIBM MANGLE(NormalPointerListIBM)
+#define glNormalPointer MANGLE(NormalPointer)
+#define glNormalPointervINTEL MANGLE(NormalPointervINTEL)
+#define glNormalStream3bATI MANGLE(NormalStream3bATI)
+#define glNormalStream3bvATI MANGLE(NormalStream3bvATI)
+#define glNormalStream3dATI MANGLE(NormalStream3dATI)
+#define glNormalStream3dvATI MANGLE(NormalStream3dvATI)
+#define glNormalStream3fATI MANGLE(NormalStream3fATI)
+#define glNormalStream3fvATI MANGLE(NormalStream3fvATI)
+#define glNormalStream3iATI MANGLE(NormalStream3iATI)
+#define glNormalStream3ivATI MANGLE(NormalStream3ivATI)
+#define glNormalStream3sATI MANGLE(NormalStream3sATI)
+#define glNormalStream3svATI MANGLE(NormalStream3svATI)
+#define glObjectPurgeableAPPLE MANGLE(ObjectPurgeableAPPLE)
+#define glObjectUnpurgeableAPPLE MANGLE(ObjectUnpurgeableAPPLE)
+#define glOrtho MANGLE(Ortho)
+#define glPassTexCoordATI MANGLE(PassTexCoordATI)
+#define glPassThrough MANGLE(PassThrough)
+#define glPatchParameterfv MANGLE(PatchParameterfv)
+#define glPatchParameteri MANGLE(PatchParameteri)
+#define glPauseTransformFeedback MANGLE(PauseTransformFeedback)
+#define glPauseTransformFeedbackNV MANGLE(PauseTransformFeedbackNV)
+#define glPixelDataRangeNV MANGLE(PixelDataRangeNV)
+#define glPixelMapfv MANGLE(PixelMapfv)
+#define glPixelMapuiv MANGLE(PixelMapuiv)
+#define glPixelMapusv MANGLE(PixelMapusv)
+#define glPixelStoref MANGLE(PixelStoref)
+#define glPixelStorei MANGLE(PixelStorei)
+#define glPixelTexGenParameterfSGIS MANGLE(PixelTexGenParameterfSGIS)
+#define glPixelTexGenParameterfvSGIS MANGLE(PixelTexGenParameterfvSGIS)
+#define glPixelTexGenParameteriSGIS MANGLE(PixelTexGenParameteriSGIS)
+#define glPixelTexGenParameterivSGIS MANGLE(PixelTexGenParameterivSGIS)
+#define glPixelTexGenSGIX MANGLE(PixelTexGenSGIX)
+#define glPixelTransferf MANGLE(PixelTransferf)
+#define glPixelTransferi MANGLE(PixelTransferi)
+#define glPixelTransformParameterfEXT MANGLE(PixelTransformParameterfEXT)
+#define glPixelTransformParameterfvEXT MANGLE(PixelTransformParameterfvEXT)
+#define glPixelTransformParameteriEXT MANGLE(PixelTransformParameteriEXT)
+#define glPixelTransformParameterivEXT MANGLE(PixelTransformParameterivEXT)
+#define glPixelZoom MANGLE(PixelZoom)
+#define glPNTrianglesfATI MANGLE(PNTrianglesfATI)
+#define glPNTrianglesiATI MANGLE(PNTrianglesiATI)
+#define glPointParameterfARB MANGLE(PointParameterfARB)
+#define glPointParameterfEXT MANGLE(PointParameterfEXT)
+#define glPointParameterf MANGLE(PointParameterf)
+#define glPointParameterfSGIS MANGLE(PointParameterfSGIS)
+#define glPointParameterfvARB MANGLE(PointParameterfvARB)
+#define glPointParameterfvEXT MANGLE(PointParameterfvEXT)
+#define glPointParameterfv MANGLE(PointParameterfv)
+#define glPointParameterfvSGIS MANGLE(PointParameterfvSGIS)
+#define glPointParameteri MANGLE(PointParameteri)
+#define glPointParameteriNV MANGLE(PointParameteriNV)
+#define glPointParameteriv MANGLE(PointParameteriv)
+#define glPointParameterivNV MANGLE(PointParameterivNV)
+#define glPointSize MANGLE(PointSize)
+#define glPollAsyncSGIX MANGLE(PollAsyncSGIX)
+#define glPollInstrumentsSGIX MANGLE(PollInstrumentsSGIX)
+#define glPolygonMode MANGLE(PolygonMode)
+#define glPolygonOffsetEXT MANGLE(PolygonOffsetEXT)
+#define glPolygonOffset MANGLE(PolygonOffset)
+#define glPolygonStipple MANGLE(PolygonStipple)
+#define glPopAttrib MANGLE(PopAttrib)
+#define glPopClientAttrib MANGLE(PopClientAttrib)
+#define glPopMatrix MANGLE(PopMatrix)
+#define glPopName MANGLE(PopName)
+#define glPresentFrameDualFillNV MANGLE(PresentFrameDualFillNV)
+#define glPresentFrameKeyedNV MANGLE(PresentFrameKeyedNV)
+#define glPrimitiveRestartIndex MANGLE(PrimitiveRestartIndex)
+#define glPrimitiveRestartIndexNV MANGLE(PrimitiveRestartIndexNV)
+#define glPrimitiveRestartNV MANGLE(PrimitiveRestartNV)
+#define glPrioritizeTexturesEXT MANGLE(PrioritizeTexturesEXT)
+#define glPrioritizeTextures MANGLE(PrioritizeTextures)
+#define glProgramBinary MANGLE(ProgramBinary)
+#define glProgramBufferParametersfvNV MANGLE(ProgramBufferParametersfvNV)
+#define glProgramBufferParametersIivNV MANGLE(ProgramBufferParametersIivNV)
+#define glProgramBufferParametersIuivNV MANGLE(ProgramBufferParametersIuivNV)
+#define glProgramCallbackMESA MANGLE(ProgramCallbackMESA)
+#define glProgramEnvParameter4dARB MANGLE(ProgramEnvParameter4dARB)
+#define glProgramEnvParameter4dvARB MANGLE(ProgramEnvParameter4dvARB)
+#define glProgramEnvParameter4fARB MANGLE(ProgramEnvParameter4fARB)
+#define glProgramEnvParameter4fvARB MANGLE(ProgramEnvParameter4fvARB)
+#define glProgramEnvParameterI4iNV MANGLE(ProgramEnvParameterI4iNV)
+#define glProgramEnvParameterI4ivNV MANGLE(ProgramEnvParameterI4ivNV)
+#define glProgramEnvParameterI4uiNV MANGLE(ProgramEnvParameterI4uiNV)
+#define glProgramEnvParameterI4uivNV MANGLE(ProgramEnvParameterI4uivNV)
+#define glProgramEnvParameters4fvEXT MANGLE(ProgramEnvParameters4fvEXT)
+#define glProgramEnvParametersI4ivNV MANGLE(ProgramEnvParametersI4ivNV)
+#define glProgramEnvParametersI4uivNV MANGLE(ProgramEnvParametersI4uivNV)
+#define glProgramLocalParameter4dARB MANGLE(ProgramLocalParameter4dARB)
+#define glProgramLocalParameter4dvARB MANGLE(ProgramLocalParameter4dvARB)
+#define glProgramLocalParameter4fARB MANGLE(ProgramLocalParameter4fARB)
+#define glProgramLocalParameter4fvARB MANGLE(ProgramLocalParameter4fvARB)
+#define glProgramLocalParameterI4iNV MANGLE(ProgramLocalParameterI4iNV)
+#define glProgramLocalParameterI4ivNV MANGLE(ProgramLocalParameterI4ivNV)
+#define glProgramLocalParameterI4uiNV MANGLE(ProgramLocalParameterI4uiNV)
+#define glProgramLocalParameterI4uivNV MANGLE(ProgramLocalParameterI4uivNV)
+#define glProgramLocalParameters4fvEXT MANGLE(ProgramLocalParameters4fvEXT)
+#define glProgramLocalParametersI4ivNV MANGLE(ProgramLocalParametersI4ivNV)
+#define glProgramLocalParametersI4uivNV MANGLE(ProgramLocalParametersI4uivNV)
+#define glProgramNamedParameter4dNV MANGLE(ProgramNamedParameter4dNV)
+#define glProgramNamedParameter4dvNV MANGLE(ProgramNamedParameter4dvNV)
+#define glProgramNamedParameter4fNV MANGLE(ProgramNamedParameter4fNV)
+#define glProgramNamedParameter4fvNV MANGLE(ProgramNamedParameter4fvNV)
+#define glProgramParameter4dNV MANGLE(ProgramParameter4dNV)
+#define glProgramParameter4dvNV MANGLE(ProgramParameter4dvNV)
+#define glProgramParameter4fNV MANGLE(ProgramParameter4fNV)
+#define glProgramParameter4fvNV MANGLE(ProgramParameter4fvNV)
+#define glProgramParameteriARB MANGLE(ProgramParameteriARB)
+#define glProgramParameteriEXT MANGLE(ProgramParameteriEXT)
+#define glProgramParameteri MANGLE(ProgramParameteri)
+#define glProgramParameters4dvNV MANGLE(ProgramParameters4dvNV)
+#define glProgramParameters4fvNV MANGLE(ProgramParameters4fvNV)
+#define glProgramStringARB MANGLE(ProgramStringARB)
+#define glProgramSubroutineParametersuivNV MANGLE(ProgramSubroutineParametersuivNV)
+#define glProgramUniform1dEXT MANGLE(ProgramUniform1dEXT)
+#define glProgramUniform1d MANGLE(ProgramUniform1d)
+#define glProgramUniform1dvEXT MANGLE(ProgramUniform1dvEXT)
+#define glProgramUniform1dv MANGLE(ProgramUniform1dv)
+#define glProgramUniform1fEXT MANGLE(ProgramUniform1fEXT)
+#define glProgramUniform1f MANGLE(ProgramUniform1f)
+#define glProgramUniform1fvEXT MANGLE(ProgramUniform1fvEXT)
+#define glProgramUniform1fv MANGLE(ProgramUniform1fv)
+#define glProgramUniform1i64NV MANGLE(ProgramUniform1i64NV)
+#define glProgramUniform1i64vNV MANGLE(ProgramUniform1i64vNV)
+#define glProgramUniform1iEXT MANGLE(ProgramUniform1iEXT)
+#define glProgramUniform1i MANGLE(ProgramUniform1i)
+#define glProgramUniform1ivEXT MANGLE(ProgramUniform1ivEXT)
+#define glProgramUniform1iv MANGLE(ProgramUniform1iv)
+#define glProgramUniform1ui64NV MANGLE(ProgramUniform1ui64NV)
+#define glProgramUniform1ui64vNV MANGLE(ProgramUniform1ui64vNV)
+#define glProgramUniform1uiEXT MANGLE(ProgramUniform1uiEXT)
+#define glProgramUniform1ui MANGLE(ProgramUniform1ui)
+#define glProgramUniform1uivEXT MANGLE(ProgramUniform1uivEXT)
+#define glProgramUniform1uiv MANGLE(ProgramUniform1uiv)
+#define glProgramUniform2dEXT MANGLE(ProgramUniform2dEXT)
+#define glProgramUniform2d MANGLE(ProgramUniform2d)
+#define glProgramUniform2dvEXT MANGLE(ProgramUniform2dvEXT)
+#define glProgramUniform2dv MANGLE(ProgramUniform2dv)
+#define glProgramUniform2fEXT MANGLE(ProgramUniform2fEXT)
+#define glProgramUniform2f MANGLE(ProgramUniform2f)
+#define glProgramUniform2fvEXT MANGLE(ProgramUniform2fvEXT)
+#define glProgramUniform2fv MANGLE(ProgramUniform2fv)
+#define glProgramUniform2i64NV MANGLE(ProgramUniform2i64NV)
+#define glProgramUniform2i64vNV MANGLE(ProgramUniform2i64vNV)
+#define glProgramUniform2iEXT MANGLE(ProgramUniform2iEXT)
+#define glProgramUniform2i MANGLE(ProgramUniform2i)
+#define glProgramUniform2ivEXT MANGLE(ProgramUniform2ivEXT)
+#define glProgramUniform2iv MANGLE(ProgramUniform2iv)
+#define glProgramUniform2ui64NV MANGLE(ProgramUniform2ui64NV)
+#define glProgramUniform2ui64vNV MANGLE(ProgramUniform2ui64vNV)
+#define glProgramUniform2uiEXT MANGLE(ProgramUniform2uiEXT)
+#define glProgramUniform2ui MANGLE(ProgramUniform2ui)
+#define glProgramUniform2uivEXT MANGLE(ProgramUniform2uivEXT)
+#define glProgramUniform2uiv MANGLE(ProgramUniform2uiv)
+#define glProgramUniform3dEXT MANGLE(ProgramUniform3dEXT)
+#define glProgramUniform3d MANGLE(ProgramUniform3d)
+#define glProgramUniform3dvEXT MANGLE(ProgramUniform3dvEXT)
+#define glProgramUniform3dv MANGLE(ProgramUniform3dv)
+#define glProgramUniform3fEXT MANGLE(ProgramUniform3fEXT)
+#define glProgramUniform3f MANGLE(ProgramUniform3f)
+#define glProgramUniform3fvEXT MANGLE(ProgramUniform3fvEXT)
+#define glProgramUniform3fv MANGLE(ProgramUniform3fv)
+#define glProgramUniform3i64NV MANGLE(ProgramUniform3i64NV)
+#define glProgramUniform3i64vNV MANGLE(ProgramUniform3i64vNV)
+#define glProgramUniform3iEXT MANGLE(ProgramUniform3iEXT)
+#define glProgramUniform3i MANGLE(ProgramUniform3i)
+#define glProgramUniform3ivEXT MANGLE(ProgramUniform3ivEXT)
+#define glProgramUniform3iv MANGLE(ProgramUniform3iv)
+#define glProgramUniform3ui64NV MANGLE(ProgramUniform3ui64NV)
+#define glProgramUniform3ui64vNV MANGLE(ProgramUniform3ui64vNV)
+#define glProgramUniform3uiEXT MANGLE(ProgramUniform3uiEXT)
+#define glProgramUniform3ui MANGLE(ProgramUniform3ui)
+#define glProgramUniform3uivEXT MANGLE(ProgramUniform3uivEXT)
+#define glProgramUniform3uiv MANGLE(ProgramUniform3uiv)
+#define glProgramUniform4dEXT MANGLE(ProgramUniform4dEXT)
+#define glProgramUniform4d MANGLE(ProgramUniform4d)
+#define glProgramUniform4dvEXT MANGLE(ProgramUniform4dvEXT)
+#define glProgramUniform4dv MANGLE(ProgramUniform4dv)
+#define glProgramUniform4fEXT MANGLE(ProgramUniform4fEXT)
+#define glProgramUniform4f MANGLE(ProgramUniform4f)
+#define glProgramUniform4fvEXT MANGLE(ProgramUniform4fvEXT)
+#define glProgramUniform4fv MANGLE(ProgramUniform4fv)
+#define glProgramUniform4i64NV MANGLE(ProgramUniform4i64NV)
+#define glProgramUniform4i64vNV MANGLE(ProgramUniform4i64vNV)
+#define glProgramUniform4iEXT MANGLE(ProgramUniform4iEXT)
+#define glProgramUniform4i MANGLE(ProgramUniform4i)
+#define glProgramUniform4ivEXT MANGLE(ProgramUniform4ivEXT)
+#define glProgramUniform4iv MANGLE(ProgramUniform4iv)
+#define glProgramUniform4ui64NV MANGLE(ProgramUniform4ui64NV)
+#define glProgramUniform4ui64vNV MANGLE(ProgramUniform4ui64vNV)
+#define glProgramUniform4uiEXT MANGLE(ProgramUniform4uiEXT)
+#define glProgramUniform4ui MANGLE(ProgramUniform4ui)
+#define glProgramUniform4uivEXT MANGLE(ProgramUniform4uivEXT)
+#define glProgramUniform4uiv MANGLE(ProgramUniform4uiv)
+#define glProgramUniformMatrix2dvEXT MANGLE(ProgramUniformMatrix2dvEXT)
+#define glProgramUniformMatrix2dv MANGLE(ProgramUniformMatrix2dv)
+#define glProgramUniformMatrix2fvEXT MANGLE(ProgramUniformMatrix2fvEXT)
+#define glProgramUniformMatrix2fv MANGLE(ProgramUniformMatrix2fv)
+#define glProgramUniformMatrix2x3dvEXT MANGLE(ProgramUniformMatrix2x3dvEXT)
+#define glProgramUniformMatrix2x3dv MANGLE(ProgramUniformMatrix2x3dv)
+#define glProgramUniformMatrix2x3fvEXT MANGLE(ProgramUniformMatrix2x3fvEXT)
+#define glProgramUniformMatrix2x3fv MANGLE(ProgramUniformMatrix2x3fv)
+#define glProgramUniformMatrix2x4dvEXT MANGLE(ProgramUniformMatrix2x4dvEXT)
+#define glProgramUniformMatrix2x4dv MANGLE(ProgramUniformMatrix2x4dv)
+#define glProgramUniformMatrix2x4fvEXT MANGLE(ProgramUniformMatrix2x4fvEXT)
+#define glProgramUniformMatrix2x4fv MANGLE(ProgramUniformMatrix2x4fv)
+#define glProgramUniformMatrix3dvEXT MANGLE(ProgramUniformMatrix3dvEXT)
+#define glProgramUniformMatrix3dv MANGLE(ProgramUniformMatrix3dv)
+#define glProgramUniformMatrix3fvEXT MANGLE(ProgramUniformMatrix3fvEXT)
+#define glProgramUniformMatrix3fv MANGLE(ProgramUniformMatrix3fv)
+#define glProgramUniformMatrix3x2dvEXT MANGLE(ProgramUniformMatrix3x2dvEXT)
+#define glProgramUniformMatrix3x2dv MANGLE(ProgramUniformMatrix3x2dv)
+#define glProgramUniformMatrix3x2fvEXT MANGLE(ProgramUniformMatrix3x2fvEXT)
+#define glProgramUniformMatrix3x2fv MANGLE(ProgramUniformMatrix3x2fv)
+#define glProgramUniformMatrix3x4dvEXT MANGLE(ProgramUniformMatrix3x4dvEXT)
+#define glProgramUniformMatrix3x4dv MANGLE(ProgramUniformMatrix3x4dv)
+#define glProgramUniformMatrix3x4fvEXT MANGLE(ProgramUniformMatrix3x4fvEXT)
+#define glProgramUniformMatrix3x4fv MANGLE(ProgramUniformMatrix3x4fv)
+#define glProgramUniformMatrix4dvEXT MANGLE(ProgramUniformMatrix4dvEXT)
+#define glProgramUniformMatrix4dv MANGLE(ProgramUniformMatrix4dv)
+#define glProgramUniformMatrix4fvEXT MANGLE(ProgramUniformMatrix4fvEXT)
+#define glProgramUniformMatrix4fv MANGLE(ProgramUniformMatrix4fv)
+#define glProgramUniformMatrix4x2dvEXT MANGLE(ProgramUniformMatrix4x2dvEXT)
+#define glProgramUniformMatrix4x2dv MANGLE(ProgramUniformMatrix4x2dv)
+#define glProgramUniformMatrix4x2fvEXT MANGLE(ProgramUniformMatrix4x2fvEXT)
+#define glProgramUniformMatrix4x2fv MANGLE(ProgramUniformMatrix4x2fv)
+#define glProgramUniformMatrix4x3dvEXT MANGLE(ProgramUniformMatrix4x3dvEXT)
+#define glProgramUniformMatrix4x3dv MANGLE(ProgramUniformMatrix4x3dv)
+#define glProgramUniformMatrix4x3fvEXT MANGLE(ProgramUniformMatrix4x3fvEXT)
+#define glProgramUniformMatrix4x3fv MANGLE(ProgramUniformMatrix4x3fv)
+#define glProgramUniformui64NV MANGLE(ProgramUniformui64NV)
+#define glProgramUniformui64vNV MANGLE(ProgramUniformui64vNV)
+#define glProgramVertexLimitNV MANGLE(ProgramVertexLimitNV)
+#define glProvokingVertexEXT MANGLE(ProvokingVertexEXT)
+#define glProvokingVertex MANGLE(ProvokingVertex)
+#define glPushAttrib MANGLE(PushAttrib)
+#define glPushClientAttribDefaultEXT MANGLE(PushClientAttribDefaultEXT)
+#define glPushClientAttrib MANGLE(PushClientAttrib)
+#define glPushMatrix MANGLE(PushMatrix)
+#define glPushName MANGLE(PushName)
+#define glQueryCounter MANGLE(QueryCounter)
+#define glRasterPos2d MANGLE(RasterPos2d)
+#define glRasterPos2dv MANGLE(RasterPos2dv)
+#define glRasterPos2f MANGLE(RasterPos2f)
+#define glRasterPos2fv MANGLE(RasterPos2fv)
+#define glRasterPos2i MANGLE(RasterPos2i)
+#define glRasterPos2iv MANGLE(RasterPos2iv)
+#define glRasterPos2s MANGLE(RasterPos2s)
+#define glRasterPos2sv MANGLE(RasterPos2sv)
+#define glRasterPos3d MANGLE(RasterPos3d)
+#define glRasterPos3dv MANGLE(RasterPos3dv)
+#define glRasterPos3f MANGLE(RasterPos3f)
+#define glRasterPos3fv MANGLE(RasterPos3fv)
+#define glRasterPos3i MANGLE(RasterPos3i)
+#define glRasterPos3iv MANGLE(RasterPos3iv)
+#define glRasterPos3s MANGLE(RasterPos3s)
+#define glRasterPos3sv MANGLE(RasterPos3sv)
+#define glRasterPos4d MANGLE(RasterPos4d)
+#define glRasterPos4dv MANGLE(RasterPos4dv)
+#define glRasterPos4f MANGLE(RasterPos4f)
+#define glRasterPos4fv MANGLE(RasterPos4fv)
+#define glRasterPos4i MANGLE(RasterPos4i)
+#define glRasterPos4iv MANGLE(RasterPos4iv)
+#define glRasterPos4s MANGLE(RasterPos4s)
+#define glRasterPos4sv MANGLE(RasterPos4sv)
+#define glReadBuffer MANGLE(ReadBuffer)
+#define glReadInstrumentsSGIX MANGLE(ReadInstrumentsSGIX)
+#define glReadnPixelsARB MANGLE(ReadnPixelsARB)
+#define glReadPixels MANGLE(ReadPixels)
+#define glRectd MANGLE(Rectd)
+#define glRectdv MANGLE(Rectdv)
+#define glRectf MANGLE(Rectf)
+#define glRectfv MANGLE(Rectfv)
+#define glRecti MANGLE(Recti)
+#define glRectiv MANGLE(Rectiv)
+#define glRects MANGLE(Rects)
+#define glRectsv MANGLE(Rectsv)
+#define glReferencePlaneSGIX MANGLE(ReferencePlaneSGIX)
+#define glReleaseShaderCompiler MANGLE(ReleaseShaderCompiler)
+#define glRenderbufferStorageEXT MANGLE(RenderbufferStorageEXT)
+#define glRenderbufferStorage MANGLE(RenderbufferStorage)
+#define glRenderbufferStorageMultisampleCoverageNV MANGLE(RenderbufferStorageMultisampleCoverageNV)
+#define glRenderbufferStorageMultisampleEXT MANGLE(RenderbufferStorageMultisampleEXT)
+#define glRenderbufferStorageMultisample MANGLE(RenderbufferStorageMultisample)
+#define glRenderMode MANGLE(RenderMode)
+#define glReplacementCodePointerSUN MANGLE(ReplacementCodePointerSUN)
+#define glReplacementCodeubSUN MANGLE(ReplacementCodeubSUN)
+#define glReplacementCodeubvSUN MANGLE(ReplacementCodeubvSUN)
+#define glReplacementCodeuiColor3fVertex3fSUN MANGLE(ReplacementCodeuiColor3fVertex3fSUN)
+#define glReplacementCodeuiColor3fVertex3fvSUN MANGLE(ReplacementCodeuiColor3fVertex3fvSUN)
+#define glReplacementCodeuiColor4fNormal3fVertex3fSUN MANGLE(ReplacementCodeuiColor4fNormal3fVertex3fSUN)
+#define glReplacementCodeuiColor4fNormal3fVertex3fvSUN MANGLE(ReplacementCodeuiColor4fNormal3fVertex3fvSUN)
+#define glReplacementCodeuiColor4ubVertex3fSUN MANGLE(ReplacementCodeuiColor4ubVertex3fSUN)
+#define glReplacementCodeuiColor4ubVertex3fvSUN MANGLE(ReplacementCodeuiColor4ubVertex3fvSUN)
+#define glReplacementCodeuiNormal3fVertex3fSUN MANGLE(ReplacementCodeuiNormal3fVertex3fSUN)
+#define glReplacementCodeuiNormal3fVertex3fvSUN MANGLE(ReplacementCodeuiNormal3fVertex3fvSUN)
+#define glReplacementCodeuiSUN MANGLE(ReplacementCodeuiSUN)
+#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN MANGLE(ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN)
+#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN MANGLE(ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN)
+#define glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN MANGLE(ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN)
+#define glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN MANGLE(ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN)
+#define glReplacementCodeuiTexCoord2fVertex3fSUN MANGLE(ReplacementCodeuiTexCoord2fVertex3fSUN)
+#define glReplacementCodeuiTexCoord2fVertex3fvSUN MANGLE(ReplacementCodeuiTexCoord2fVertex3fvSUN)
+#define glReplacementCodeuiVertex3fSUN MANGLE(ReplacementCodeuiVertex3fSUN)
+#define glReplacementCodeuiVertex3fvSUN MANGLE(ReplacementCodeuiVertex3fvSUN)
+#define glReplacementCodeuivSUN MANGLE(ReplacementCodeuivSUN)
+#define glReplacementCodeusSUN MANGLE(ReplacementCodeusSUN)
+#define glReplacementCodeusvSUN MANGLE(ReplacementCodeusvSUN)
+#define glRequestResidentProgramsNV MANGLE(RequestResidentProgramsNV)
+#define glResetHistogramEXT MANGLE(ResetHistogramEXT)
+#define glResetHistogram MANGLE(ResetHistogram)
+#define glResetMinmaxEXT MANGLE(ResetMinmaxEXT)
+#define glResetMinmax MANGLE(ResetMinmax)
+#define glResizeBuffersMESA MANGLE(ResizeBuffersMESA)
+#define glResumeTransformFeedback MANGLE(ResumeTransformFeedback)
+#define glResumeTransformFeedbackNV MANGLE(ResumeTransformFeedbackNV)
+#define glRotated MANGLE(Rotated)
+#define glRotatef MANGLE(Rotatef)
+#define glSampleCoverageARB MANGLE(SampleCoverageARB)
+#define glSampleCoverage MANGLE(SampleCoverage)
+#define glSampleMapATI MANGLE(SampleMapATI)
+#define glSampleMaskEXT MANGLE(SampleMaskEXT)
+#define glSampleMaski MANGLE(SampleMaski)
+#define glSampleMaskIndexedNV MANGLE(SampleMaskIndexedNV)
+#define glSampleMaskSGIS MANGLE(SampleMaskSGIS)
+#define glSamplePatternEXT MANGLE(SamplePatternEXT)
+#define glSamplePatternSGIS MANGLE(SamplePatternSGIS)
+#define glSamplerParameterf MANGLE(SamplerParameterf)
+#define glSamplerParameterfv MANGLE(SamplerParameterfv)
+#define glSamplerParameterIiv MANGLE(SamplerParameterIiv)
+#define glSamplerParameteri MANGLE(SamplerParameteri)
+#define glSamplerParameterIuiv MANGLE(SamplerParameterIuiv)
+#define glSamplerParameteriv MANGLE(SamplerParameteriv)
+#define glScaled MANGLE(Scaled)
+#define glScalef MANGLE(Scalef)
+#define glScissorArrayv MANGLE(ScissorArrayv)
+#define glScissorIndexed MANGLE(ScissorIndexed)
+#define glScissorIndexedv MANGLE(ScissorIndexedv)
+#define glScissor MANGLE(Scissor)
+#define glSecondaryColor3bEXT MANGLE(SecondaryColor3bEXT)
+#define glSecondaryColor3b MANGLE(SecondaryColor3b)
+#define glSecondaryColor3bvEXT MANGLE(SecondaryColor3bvEXT)
+#define glSecondaryColor3bv MANGLE(SecondaryColor3bv)
+#define glSecondaryColor3dEXT MANGLE(SecondaryColor3dEXT)
+#define glSecondaryColor3d MANGLE(SecondaryColor3d)
+#define glSecondaryColor3dvEXT MANGLE(SecondaryColor3dvEXT)
+#define glSecondaryColor3dv MANGLE(SecondaryColor3dv)
+#define glSecondaryColor3fEXT MANGLE(SecondaryColor3fEXT)
+#define glSecondaryColor3f MANGLE(SecondaryColor3f)
+#define glSecondaryColor3fvEXT MANGLE(SecondaryColor3fvEXT)
+#define glSecondaryColor3fv MANGLE(SecondaryColor3fv)
+#define glSecondaryColor3hNV MANGLE(SecondaryColor3hNV)
+#define glSecondaryColor3hvNV MANGLE(SecondaryColor3hvNV)
+#define glSecondaryColor3iEXT MANGLE(SecondaryColor3iEXT)
+#define glSecondaryColor3i MANGLE(SecondaryColor3i)
+#define glSecondaryColor3ivEXT MANGLE(SecondaryColor3ivEXT)
+#define glSecondaryColor3iv MANGLE(SecondaryColor3iv)
+#define glSecondaryColor3sEXT MANGLE(SecondaryColor3sEXT)
+#define glSecondaryColor3s MANGLE(SecondaryColor3s)
+#define glSecondaryColor3svEXT MANGLE(SecondaryColor3svEXT)
+#define glSecondaryColor3sv MANGLE(SecondaryColor3sv)
+#define glSecondaryColor3ubEXT MANGLE(SecondaryColor3ubEXT)
+#define glSecondaryColor3ub MANGLE(SecondaryColor3ub)
+#define glSecondaryColor3ubvEXT MANGLE(SecondaryColor3ubvEXT)
+#define glSecondaryColor3ubv MANGLE(SecondaryColor3ubv)
+#define glSecondaryColor3uiEXT MANGLE(SecondaryColor3uiEXT)
+#define glSecondaryColor3ui MANGLE(SecondaryColor3ui)
+#define glSecondaryColor3uivEXT MANGLE(SecondaryColor3uivEXT)
+#define glSecondaryColor3uiv MANGLE(SecondaryColor3uiv)
+#define glSecondaryColor3usEXT MANGLE(SecondaryColor3usEXT)
+#define glSecondaryColor3us MANGLE(SecondaryColor3us)
+#define glSecondaryColor3usvEXT MANGLE(SecondaryColor3usvEXT)
+#define glSecondaryColor3usv MANGLE(SecondaryColor3usv)
+#define glSecondaryColorFormatNV MANGLE(SecondaryColorFormatNV)
+#define glSecondaryColorP3ui MANGLE(SecondaryColorP3ui)
+#define glSecondaryColorP3uiv MANGLE(SecondaryColorP3uiv)
+#define glSecondaryColorPointerEXT MANGLE(SecondaryColorPointerEXT)
+#define glSecondaryColorPointerListIBM MANGLE(SecondaryColorPointerListIBM)
+#define glSecondaryColorPointer MANGLE(SecondaryColorPointer)
+#define glSelectBuffer MANGLE(SelectBuffer)
+#define glSelectPerfMonitorCountersAMD MANGLE(SelectPerfMonitorCountersAMD)
+#define glSeparableFilter2DEXT MANGLE(SeparableFilter2DEXT)
+#define glSeparableFilter2D MANGLE(SeparableFilter2D)
+#define glSetFenceAPPLE MANGLE(SetFenceAPPLE)
+#define glSetFenceNV MANGLE(SetFenceNV)
+#define glSetFragmentShaderConstantATI MANGLE(SetFragmentShaderConstantATI)
+#define glSetInvariantEXT MANGLE(SetInvariantEXT)
+#define glSetLocalConstantEXT MANGLE(SetLocalConstantEXT)
+#define glShadeModel MANGLE(ShadeModel)
+#define glShaderBinary MANGLE(ShaderBinary)
+#define glShaderOp1EXT MANGLE(ShaderOp1EXT)
+#define glShaderOp2EXT MANGLE(ShaderOp2EXT)
+#define glShaderOp3EXT MANGLE(ShaderOp3EXT)
+#define glShaderSourceARB MANGLE(ShaderSourceARB)
+#define glShaderSource MANGLE(ShaderSource)
+#define glSharpenTexFuncSGIS MANGLE(SharpenTexFuncSGIS)
+#define glSpriteParameterfSGIX MANGLE(SpriteParameterfSGIX)
+#define glSpriteParameterfvSGIX MANGLE(SpriteParameterfvSGIX)
+#define glSpriteParameteriSGIX MANGLE(SpriteParameteriSGIX)
+#define glSpriteParameterivSGIX MANGLE(SpriteParameterivSGIX)
+#define glStartInstrumentsSGIX MANGLE(StartInstrumentsSGIX)
+#define glStencilClearTagEXT MANGLE(StencilClearTagEXT)
+#define glStencilFunc MANGLE(StencilFunc)
+#define glStencilFuncSeparateATI MANGLE(StencilFuncSeparateATI)
+#define glStencilFuncSeparate MANGLE(StencilFuncSeparate)
+#define glStencilMask MANGLE(StencilMask)
+#define glStencilMaskSeparate MANGLE(StencilMaskSeparate)
+#define glStencilOp MANGLE(StencilOp)
+#define glStencilOpSeparateATI MANGLE(StencilOpSeparateATI)
+#define glStencilOpSeparate MANGLE(StencilOpSeparate)
+#define glStopInstrumentsSGIX MANGLE(StopInstrumentsSGIX)
+#define glStringMarkerGREMEDY MANGLE(StringMarkerGREMEDY)
+#define glSwizzleEXT MANGLE(SwizzleEXT)
+#define glTagSampleBufferSGIX MANGLE(TagSampleBufferSGIX)
+#define glTangent3bEXT MANGLE(Tangent3bEXT)
+#define glTangent3bvEXT MANGLE(Tangent3bvEXT)
+#define glTangent3dEXT MANGLE(Tangent3dEXT)
+#define glTangent3dvEXT MANGLE(Tangent3dvEXT)
+#define glTangent3fEXT MANGLE(Tangent3fEXT)
+#define glTangent3fvEXT MANGLE(Tangent3fvEXT)
+#define glTangent3iEXT MANGLE(Tangent3iEXT)
+#define glTangent3ivEXT MANGLE(Tangent3ivEXT)
+#define glTangent3sEXT MANGLE(Tangent3sEXT)
+#define glTangent3svEXT MANGLE(Tangent3svEXT)
+#define glTangentPointerEXT MANGLE(TangentPointerEXT)
+#define glTbufferMask3DFX MANGLE(TbufferMask3DFX)
+#define glTessellationFactorAMD MANGLE(TessellationFactorAMD)
+#define glTessellationModeAMD MANGLE(TessellationModeAMD)
+#define glTestFenceAPPLE MANGLE(TestFenceAPPLE)
+#define glTestFenceNV MANGLE(TestFenceNV)
+#define glTestObjectAPPLE MANGLE(TestObjectAPPLE)
+#define glTexBufferARB MANGLE(TexBufferARB)
+#define glTexBufferEXT MANGLE(TexBufferEXT)
+#define glTexBuffer MANGLE(TexBuffer)
+#define glTexBumpParameterfvATI MANGLE(TexBumpParameterfvATI)
+#define glTexBumpParameterivATI MANGLE(TexBumpParameterivATI)
+#define glTexCoord1d MANGLE(TexCoord1d)
+#define glTexCoord1dv MANGLE(TexCoord1dv)
+#define glTexCoord1f MANGLE(TexCoord1f)
+#define glTexCoord1fv MANGLE(TexCoord1fv)
+#define glTexCoord1hNV MANGLE(TexCoord1hNV)
+#define glTexCoord1hvNV MANGLE(TexCoord1hvNV)
+#define glTexCoord1i MANGLE(TexCoord1i)
+#define glTexCoord1iv MANGLE(TexCoord1iv)
+#define glTexCoord1s MANGLE(TexCoord1s)
+#define glTexCoord1sv MANGLE(TexCoord1sv)
+#define glTexCoord2d MANGLE(TexCoord2d)
+#define glTexCoord2dv MANGLE(TexCoord2dv)
+#define glTexCoord2fColor3fVertex3fSUN MANGLE(TexCoord2fColor3fVertex3fSUN)
+#define glTexCoord2fColor3fVertex3fvSUN MANGLE(TexCoord2fColor3fVertex3fvSUN)
+#define glTexCoord2fColor4fNormal3fVertex3fSUN MANGLE(TexCoord2fColor4fNormal3fVertex3fSUN)
+#define glTexCoord2fColor4fNormal3fVertex3fvSUN MANGLE(TexCoord2fColor4fNormal3fVertex3fvSUN)
+#define glTexCoord2fColor4ubVertex3fSUN MANGLE(TexCoord2fColor4ubVertex3fSUN)
+#define glTexCoord2fColor4ubVertex3fvSUN MANGLE(TexCoord2fColor4ubVertex3fvSUN)
+#define glTexCoord2f MANGLE(TexCoord2f)
+#define glTexCoord2fNormal3fVertex3fSUN MANGLE(TexCoord2fNormal3fVertex3fSUN)
+#define glTexCoord2fNormal3fVertex3fvSUN MANGLE(TexCoord2fNormal3fVertex3fvSUN)
+#define glTexCoord2fVertex3fSUN MANGLE(TexCoord2fVertex3fSUN)
+#define glTexCoord2fVertex3fvSUN MANGLE(TexCoord2fVertex3fvSUN)
+#define glTexCoord2fv MANGLE(TexCoord2fv)
+#define glTexCoord2hNV MANGLE(TexCoord2hNV)
+#define glTexCoord2hvNV MANGLE(TexCoord2hvNV)
+#define glTexCoord2i MANGLE(TexCoord2i)
+#define glTexCoord2iv MANGLE(TexCoord2iv)
+#define glTexCoord2s MANGLE(TexCoord2s)
+#define glTexCoord2sv MANGLE(TexCoord2sv)
+#define glTexCoord3d MANGLE(TexCoord3d)
+#define glTexCoord3dv MANGLE(TexCoord3dv)
+#define glTexCoord3f MANGLE(TexCoord3f)
+#define glTexCoord3fv MANGLE(TexCoord3fv)
+#define glTexCoord3hNV MANGLE(TexCoord3hNV)
+#define glTexCoord3hvNV MANGLE(TexCoord3hvNV)
+#define glTexCoord3i MANGLE(TexCoord3i)
+#define glTexCoord3iv MANGLE(TexCoord3iv)
+#define glTexCoord3s MANGLE(TexCoord3s)
+#define glTexCoord3sv MANGLE(TexCoord3sv)
+#define glTexCoord4d MANGLE(TexCoord4d)
+#define glTexCoord4dv MANGLE(TexCoord4dv)
+#define glTexCoord4fColor4fNormal3fVertex4fSUN MANGLE(TexCoord4fColor4fNormal3fVertex4fSUN)
+#define glTexCoord4fColor4fNormal3fVertex4fvSUN MANGLE(TexCoord4fColor4fNormal3fVertex4fvSUN)
+#define glTexCoord4f MANGLE(TexCoord4f)
+#define glTexCoord4fVertex4fSUN MANGLE(TexCoord4fVertex4fSUN)
+#define glTexCoord4fVertex4fvSUN MANGLE(TexCoord4fVertex4fvSUN)
+#define glTexCoord4fv MANGLE(TexCoord4fv)
+#define glTexCoord4hNV MANGLE(TexCoord4hNV)
+#define glTexCoord4hvNV MANGLE(TexCoord4hvNV)
+#define glTexCoord4i MANGLE(TexCoord4i)
+#define glTexCoord4iv MANGLE(TexCoord4iv)
+#define glTexCoord4s MANGLE(TexCoord4s)
+#define glTexCoord4sv MANGLE(TexCoord4sv)
+#define glTexCoordFormatNV MANGLE(TexCoordFormatNV)
+#define glTexCoordP1ui MANGLE(TexCoordP1ui)
+#define glTexCoordP1uiv MANGLE(TexCoordP1uiv)
+#define glTexCoordP2ui MANGLE(TexCoordP2ui)
+#define glTexCoordP2uiv MANGLE(TexCoordP2uiv)
+#define glTexCoordP3ui MANGLE(TexCoordP3ui)
+#define glTexCoordP3uiv MANGLE(TexCoordP3uiv)
+#define glTexCoordP4ui MANGLE(TexCoordP4ui)
+#define glTexCoordP4uiv MANGLE(TexCoordP4uiv)
+#define glTexCoordPointerEXT MANGLE(TexCoordPointerEXT)
+#define glTexCoordPointerListIBM MANGLE(TexCoordPointerListIBM)
+#define glTexCoordPointer MANGLE(TexCoordPointer)
+#define glTexCoordPointervINTEL MANGLE(TexCoordPointervINTEL)
+#define glTexEnvf MANGLE(TexEnvf)
+#define glTexEnvfv MANGLE(TexEnvfv)
+#define glTexEnvi MANGLE(TexEnvi)
+#define glTexEnviv MANGLE(TexEnviv)
+#define glTexFilterFuncSGIS MANGLE(TexFilterFuncSGIS)
+#define glTexGend MANGLE(TexGend)
+#define glTexGendv MANGLE(TexGendv)
+#define glTexGenf MANGLE(TexGenf)
+#define glTexGenfv MANGLE(TexGenfv)
+#define glTexGeni MANGLE(TexGeni)
+#define glTexGeniv MANGLE(TexGeniv)
+#define glTexImage1D MANGLE(TexImage1D)
+#define glTexImage2D MANGLE(TexImage2D)
+#define glTexImage2DMultisample MANGLE(TexImage2DMultisample)
+#define glTexImage3DEXT MANGLE(TexImage3DEXT)
+#define glTexImage3D MANGLE(TexImage3D)
+#define glTexImage3DMultisample MANGLE(TexImage3DMultisample)
+#define glTexImage4DSGIS MANGLE(TexImage4DSGIS)
+#define glTexParameterf MANGLE(TexParameterf)
+#define glTexParameterfv MANGLE(TexParameterfv)
+#define glTexParameterIivEXT MANGLE(TexParameterIivEXT)
+#define glTexParameterIiv MANGLE(TexParameterIiv)
+#define glTexParameteri MANGLE(TexParameteri)
+#define glTexParameterIuivEXT MANGLE(TexParameterIuivEXT)
+#define glTexParameterIuiv MANGLE(TexParameterIuiv)
+#define glTexParameteriv MANGLE(TexParameteriv)
+#define glTexRenderbufferNV MANGLE(TexRenderbufferNV)
+#define glTexSubImage1DEXT MANGLE(TexSubImage1DEXT)
+#define glTexSubImage1D MANGLE(TexSubImage1D)
+#define glTexSubImage2DEXT MANGLE(TexSubImage2DEXT)
+#define glTexSubImage2D MANGLE(TexSubImage2D)
+#define glTexSubImage3DEXT MANGLE(TexSubImage3DEXT)
+#define glTexSubImage3D MANGLE(TexSubImage3D)
+#define glTexSubImage4DSGIS MANGLE(TexSubImage4DSGIS)
+#define glTextureBarrierNV MANGLE(TextureBarrierNV)
+#define glTextureBufferEXT MANGLE(TextureBufferEXT)
+#define glTextureColorMaskSGIS MANGLE(TextureColorMaskSGIS)
+#define glTextureImage1DEXT MANGLE(TextureImage1DEXT)
+#define glTextureImage2DEXT MANGLE(TextureImage2DEXT)
+#define glTextureImage3DEXT MANGLE(TextureImage3DEXT)
+#define glTextureLightEXT MANGLE(TextureLightEXT)
+#define glTextureMaterialEXT MANGLE(TextureMaterialEXT)
+#define glTextureNormalEXT MANGLE(TextureNormalEXT)
+#define glTextureParameterfEXT MANGLE(TextureParameterfEXT)
+#define glTextureParameterfvEXT MANGLE(TextureParameterfvEXT)
+#define glTextureParameteriEXT MANGLE(TextureParameteriEXT)
+#define glTextureParameterIivEXT MANGLE(TextureParameterIivEXT)
+#define glTextureParameterIuivEXT MANGLE(TextureParameterIuivEXT)
+#define glTextureParameterivEXT MANGLE(TextureParameterivEXT)
+#define glTextureRangeAPPLE MANGLE(TextureRangeAPPLE)
+#define glTextureRenderbufferEXT MANGLE(TextureRenderbufferEXT)
+#define glTextureSubImage1DEXT MANGLE(TextureSubImage1DEXT)
+#define glTextureSubImage2DEXT MANGLE(TextureSubImage2DEXT)
+#define glTextureSubImage3DEXT MANGLE(TextureSubImage3DEXT)
+#define glTrackMatrixNV MANGLE(TrackMatrixNV)
+#define glTransformFeedbackAttribsNV MANGLE(TransformFeedbackAttribsNV)
+#define glTransformFeedbackStreamAttribsNV MANGLE(TransformFeedbackStreamAttribsNV)
+#define glTransformFeedbackVaryingsEXT MANGLE(TransformFeedbackVaryingsEXT)
+#define glTransformFeedbackVaryings MANGLE(TransformFeedbackVaryings)
+#define glTransformFeedbackVaryingsNV MANGLE(TransformFeedbackVaryingsNV)
+#define glTranslated MANGLE(Translated)
+#define glTranslatef MANGLE(Translatef)
+#define glUniform1d MANGLE(Uniform1d)
+#define glUniform1dv MANGLE(Uniform1dv)
+#define glUniform1fARB MANGLE(Uniform1fARB)
+#define glUniform1f MANGLE(Uniform1f)
+#define glUniform1fvARB MANGLE(Uniform1fvARB)
+#define glUniform1fv MANGLE(Uniform1fv)
+#define glUniform1i64NV MANGLE(Uniform1i64NV)
+#define glUniform1i64vNV MANGLE(Uniform1i64vNV)
+#define glUniform1iARB MANGLE(Uniform1iARB)
+#define glUniform1i MANGLE(Uniform1i)
+#define glUniform1ivARB MANGLE(Uniform1ivARB)
+#define glUniform1iv MANGLE(Uniform1iv)
+#define glUniform1ui64NV MANGLE(Uniform1ui64NV)
+#define glUniform1ui64vNV MANGLE(Uniform1ui64vNV)
+#define glUniform1uiEXT MANGLE(Uniform1uiEXT)
+#define glUniform1ui MANGLE(Uniform1ui)
+#define glUniform1uivEXT MANGLE(Uniform1uivEXT)
+#define glUniform1uiv MANGLE(Uniform1uiv)
+#define glUniform2d MANGLE(Uniform2d)
+#define glUniform2dv MANGLE(Uniform2dv)
+#define glUniform2fARB MANGLE(Uniform2fARB)
+#define glUniform2f MANGLE(Uniform2f)
+#define glUniform2fvARB MANGLE(Uniform2fvARB)
+#define glUniform2fv MANGLE(Uniform2fv)
+#define glUniform2i64NV MANGLE(Uniform2i64NV)
+#define glUniform2i64vNV MANGLE(Uniform2i64vNV)
+#define glUniform2iARB MANGLE(Uniform2iARB)
+#define glUniform2i MANGLE(Uniform2i)
+#define glUniform2ivARB MANGLE(Uniform2ivARB)
+#define glUniform2iv MANGLE(Uniform2iv)
+#define glUniform2ui64NV MANGLE(Uniform2ui64NV)
+#define glUniform2ui64vNV MANGLE(Uniform2ui64vNV)
+#define glUniform2uiEXT MANGLE(Uniform2uiEXT)
+#define glUniform2ui MANGLE(Uniform2ui)
+#define glUniform2uivEXT MANGLE(Uniform2uivEXT)
+#define glUniform2uiv MANGLE(Uniform2uiv)
+#define glUniform3d MANGLE(Uniform3d)
+#define glUniform3dv MANGLE(Uniform3dv)
+#define glUniform3fARB MANGLE(Uniform3fARB)
+#define glUniform3f MANGLE(Uniform3f)
+#define glUniform3fvARB MANGLE(Uniform3fvARB)
+#define glUniform3fv MANGLE(Uniform3fv)
+#define glUniform3i64NV MANGLE(Uniform3i64NV)
+#define glUniform3i64vNV MANGLE(Uniform3i64vNV)
+#define glUniform3iARB MANGLE(Uniform3iARB)
+#define glUniform3i MANGLE(Uniform3i)
+#define glUniform3ivARB MANGLE(Uniform3ivARB)
+#define glUniform3iv MANGLE(Uniform3iv)
+#define glUniform3ui64NV MANGLE(Uniform3ui64NV)
+#define glUniform3ui64vNV MANGLE(Uniform3ui64vNV)
+#define glUniform3uiEXT MANGLE(Uniform3uiEXT)
+#define glUniform3ui MANGLE(Uniform3ui)
+#define glUniform3uivEXT MANGLE(Uniform3uivEXT)
+#define glUniform3uiv MANGLE(Uniform3uiv)
+#define glUniform4d MANGLE(Uniform4d)
+#define glUniform4dv MANGLE(Uniform4dv)
+#define glUniform4fARB MANGLE(Uniform4fARB)
+#define glUniform4f MANGLE(Uniform4f)
+#define glUniform4fvARB MANGLE(Uniform4fvARB)
+#define glUniform4fv MANGLE(Uniform4fv)
+#define glUniform4i64NV MANGLE(Uniform4i64NV)
+#define glUniform4i64vNV MANGLE(Uniform4i64vNV)
+#define glUniform4iARB MANGLE(Uniform4iARB)
+#define glUniform4i MANGLE(Uniform4i)
+#define glUniform4ivARB MANGLE(Uniform4ivARB)
+#define glUniform4iv MANGLE(Uniform4iv)
+#define glUniform4ui64NV MANGLE(Uniform4ui64NV)
+#define glUniform4ui64vNV MANGLE(Uniform4ui64vNV)
+#define glUniform4uiEXT MANGLE(Uniform4uiEXT)
+#define glUniform4ui MANGLE(Uniform4ui)
+#define glUniform4uivEXT MANGLE(Uniform4uivEXT)
+#define glUniform4uiv MANGLE(Uniform4uiv)
+#define glUniformBlockBinding MANGLE(UniformBlockBinding)
+#define glUniformBufferEXT MANGLE(UniformBufferEXT)
+#define glUniformMatrix2dv MANGLE(UniformMatrix2dv)
+#define glUniformMatrix2fvARB MANGLE(UniformMatrix2fvARB)
+#define glUniformMatrix2fv MANGLE(UniformMatrix2fv)
+#define glUniformMatrix2x3dv MANGLE(UniformMatrix2x3dv)
+#define glUniformMatrix2x3fv MANGLE(UniformMatrix2x3fv)
+#define glUniformMatrix2x4dv MANGLE(UniformMatrix2x4dv)
+#define glUniformMatrix2x4fv MANGLE(UniformMatrix2x4fv)
+#define glUniformMatrix3dv MANGLE(UniformMatrix3dv)
+#define glUniformMatrix3fvARB MANGLE(UniformMatrix3fvARB)
+#define glUniformMatrix3fv MANGLE(UniformMatrix3fv)
+#define glUniformMatrix3x2dv MANGLE(UniformMatrix3x2dv)
+#define glUniformMatrix3x2fv MANGLE(UniformMatrix3x2fv)
+#define glUniformMatrix3x4dv MANGLE(UniformMatrix3x4dv)
+#define glUniformMatrix3x4fv MANGLE(UniformMatrix3x4fv)
+#define glUniformMatrix4dv MANGLE(UniformMatrix4dv)
+#define glUniformMatrix4fvARB MANGLE(UniformMatrix4fvARB)
+#define glUniformMatrix4fv MANGLE(UniformMatrix4fv)
+#define glUniformMatrix4x2dv MANGLE(UniformMatrix4x2dv)
+#define glUniformMatrix4x2fv MANGLE(UniformMatrix4x2fv)
+#define glUniformMatrix4x3dv MANGLE(UniformMatrix4x3dv)
+#define glUniformMatrix4x3fv MANGLE(UniformMatrix4x3fv)
+#define glUniformSubroutinesuiv MANGLE(UniformSubroutinesuiv)
+#define glUniformui64NV MANGLE(Uniformui64NV)
+#define glUniformui64vNV MANGLE(Uniformui64vNV)
+#define glUnlockArraysEXT MANGLE(UnlockArraysEXT)
+#define glUnmapBufferARB MANGLE(UnmapBufferARB)
+#define glUnmapBuffer MANGLE(UnmapBuffer)
+#define glUnmapNamedBufferEXT MANGLE(UnmapNamedBufferEXT)
+#define glUnmapObjectBufferATI MANGLE(UnmapObjectBufferATI)
+#define glUpdateObjectBufferATI MANGLE(UpdateObjectBufferATI)
+#define glUseProgram MANGLE(UseProgram)
+#define glUseProgramObjectARB MANGLE(UseProgramObjectARB)
+#define glUseProgramStages MANGLE(UseProgramStages)
+#define glUseShaderProgramEXT MANGLE(UseShaderProgramEXT)
+#define glValidateProgramARB MANGLE(ValidateProgramARB)
+#define glValidateProgram MANGLE(ValidateProgram)
+#define glValidateProgramPipeline MANGLE(ValidateProgramPipeline)
+#define glVariantArrayObjectATI MANGLE(VariantArrayObjectATI)
+#define glVariantbvEXT MANGLE(VariantbvEXT)
+#define glVariantdvEXT MANGLE(VariantdvEXT)
+#define glVariantfvEXT MANGLE(VariantfvEXT)
+#define glVariantivEXT MANGLE(VariantivEXT)
+#define glVariantPointerEXT MANGLE(VariantPointerEXT)
+#define glVariantsvEXT MANGLE(VariantsvEXT)
+#define glVariantubvEXT MANGLE(VariantubvEXT)
+#define glVariantuivEXT MANGLE(VariantuivEXT)
+#define glVariantusvEXT MANGLE(VariantusvEXT)
+#define glVDPAUFiniNV MANGLE(VDPAUFiniNV)
+#define glVDPAUGetSurfaceivNV MANGLE(VDPAUGetSurfaceivNV)
+#define glVDPAUInitNV MANGLE(VDPAUInitNV)
+#define glVDPAUIsSurfaceNV MANGLE(VDPAUIsSurfaceNV)
+#define glVDPAUMapSurfacesNV MANGLE(VDPAUMapSurfacesNV)
+#define glVDPAURegisterOutputSurfaceNV MANGLE(VDPAURegisterOutputSurfaceNV)
+#define glVDPAURegisterVideoSurfaceNV MANGLE(VDPAURegisterVideoSurfaceNV)
+#define glVDPAUSurfaceAccessNV MANGLE(VDPAUSurfaceAccessNV)
+#define glVDPAUUnmapSurfacesNV MANGLE(VDPAUUnmapSurfacesNV)
+#define glVDPAUUnregisterSurfaceNV MANGLE(VDPAUUnregisterSurfaceNV)
+#define glVertex2d MANGLE(Vertex2d)
+#define glVertex2dv MANGLE(Vertex2dv)
+#define glVertex2f MANGLE(Vertex2f)
+#define glVertex2fv MANGLE(Vertex2fv)
+#define glVertex2hNV MANGLE(Vertex2hNV)
+#define glVertex2hvNV MANGLE(Vertex2hvNV)
+#define glVertex2i MANGLE(Vertex2i)
+#define glVertex2iv MANGLE(Vertex2iv)
+#define glVertex2s MANGLE(Vertex2s)
+#define glVertex2sv MANGLE(Vertex2sv)
+#define glVertex3d MANGLE(Vertex3d)
+#define glVertex3dv MANGLE(Vertex3dv)
+#define glVertex3f MANGLE(Vertex3f)
+#define glVertex3fv MANGLE(Vertex3fv)
+#define glVertex3hNV MANGLE(Vertex3hNV)
+#define glVertex3hvNV MANGLE(Vertex3hvNV)
+#define glVertex3i MANGLE(Vertex3i)
+#define glVertex3iv MANGLE(Vertex3iv)
+#define glVertex3s MANGLE(Vertex3s)
+#define glVertex3sv MANGLE(Vertex3sv)
+#define glVertex4d MANGLE(Vertex4d)
+#define glVertex4dv MANGLE(Vertex4dv)
+#define glVertex4f MANGLE(Vertex4f)
+#define glVertex4fv MANGLE(Vertex4fv)
+#define glVertex4hNV MANGLE(Vertex4hNV)
+#define glVertex4hvNV MANGLE(Vertex4hvNV)
+#define glVertex4i MANGLE(Vertex4i)
+#define glVertex4iv MANGLE(Vertex4iv)
+#define glVertex4s MANGLE(Vertex4s)
+#define glVertex4sv MANGLE(Vertex4sv)
+#define glVertexArrayParameteriAPPLE MANGLE(VertexArrayParameteriAPPLE)
+#define glVertexArrayRangeAPPLE MANGLE(VertexArrayRangeAPPLE)
+#define glVertexArrayRangeNV MANGLE(VertexArrayRangeNV)
+#define glVertexArrayVertexAttribLOffsetEXT MANGLE(VertexArrayVertexAttribLOffsetEXT)
+#define glVertexAttrib1dARB MANGLE(VertexAttrib1dARB)
+#define glVertexAttrib1d MANGLE(VertexAttrib1d)
+#define glVertexAttrib1dNV MANGLE(VertexAttrib1dNV)
+#define glVertexAttrib1dvARB MANGLE(VertexAttrib1dvARB)
+#define glVertexAttrib1dv MANGLE(VertexAttrib1dv)
+#define glVertexAttrib1dvNV MANGLE(VertexAttrib1dvNV)
+#define glVertexAttrib1fARB MANGLE(VertexAttrib1fARB)
+#define glVertexAttrib1f MANGLE(VertexAttrib1f)
+#define glVertexAttrib1fNV MANGLE(VertexAttrib1fNV)
+#define glVertexAttrib1fvARB MANGLE(VertexAttrib1fvARB)
+#define glVertexAttrib1fv MANGLE(VertexAttrib1fv)
+#define glVertexAttrib1fvNV MANGLE(VertexAttrib1fvNV)
+#define glVertexAttrib1hNV MANGLE(VertexAttrib1hNV)
+#define glVertexAttrib1hvNV MANGLE(VertexAttrib1hvNV)
+#define glVertexAttrib1sARB MANGLE(VertexAttrib1sARB)
+#define glVertexAttrib1s MANGLE(VertexAttrib1s)
+#define glVertexAttrib1sNV MANGLE(VertexAttrib1sNV)
+#define glVertexAttrib1svARB MANGLE(VertexAttrib1svARB)
+#define glVertexAttrib1sv MANGLE(VertexAttrib1sv)
+#define glVertexAttrib1svNV MANGLE(VertexAttrib1svNV)
+#define glVertexAttrib2dARB MANGLE(VertexAttrib2dARB)
+#define glVertexAttrib2d MANGLE(VertexAttrib2d)
+#define glVertexAttrib2dNV MANGLE(VertexAttrib2dNV)
+#define glVertexAttrib2dvARB MANGLE(VertexAttrib2dvARB)
+#define glVertexAttrib2dv MANGLE(VertexAttrib2dv)
+#define glVertexAttrib2dvNV MANGLE(VertexAttrib2dvNV)
+#define glVertexAttrib2fARB MANGLE(VertexAttrib2fARB)
+#define glVertexAttrib2f MANGLE(VertexAttrib2f)
+#define glVertexAttrib2fNV MANGLE(VertexAttrib2fNV)
+#define glVertexAttrib2fvARB MANGLE(VertexAttrib2fvARB)
+#define glVertexAttrib2fv MANGLE(VertexAttrib2fv)
+#define glVertexAttrib2fvNV MANGLE(VertexAttrib2fvNV)
+#define glVertexAttrib2hNV MANGLE(VertexAttrib2hNV)
+#define glVertexAttrib2hvNV MANGLE(VertexAttrib2hvNV)
+#define glVertexAttrib2sARB MANGLE(VertexAttrib2sARB)
+#define glVertexAttrib2s MANGLE(VertexAttrib2s)
+#define glVertexAttrib2sNV MANGLE(VertexAttrib2sNV)
+#define glVertexAttrib2svARB MANGLE(VertexAttrib2svARB)
+#define glVertexAttrib2sv MANGLE(VertexAttrib2sv)
+#define glVertexAttrib2svNV MANGLE(VertexAttrib2svNV)
+#define glVertexAttrib3dARB MANGLE(VertexAttrib3dARB)
+#define glVertexAttrib3d MANGLE(VertexAttrib3d)
+#define glVertexAttrib3dNV MANGLE(VertexAttrib3dNV)
+#define glVertexAttrib3dvARB MANGLE(VertexAttrib3dvARB)
+#define glVertexAttrib3dv MANGLE(VertexAttrib3dv)
+#define glVertexAttrib3dvNV MANGLE(VertexAttrib3dvNV)
+#define glVertexAttrib3fARB MANGLE(VertexAttrib3fARB)
+#define glVertexAttrib3f MANGLE(VertexAttrib3f)
+#define glVertexAttrib3fNV MANGLE(VertexAttrib3fNV)
+#define glVertexAttrib3fvARB MANGLE(VertexAttrib3fvARB)
+#define glVertexAttrib3fv MANGLE(VertexAttrib3fv)
+#define glVertexAttrib3fvNV MANGLE(VertexAttrib3fvNV)
+#define glVertexAttrib3hNV MANGLE(VertexAttrib3hNV)
+#define glVertexAttrib3hvNV MANGLE(VertexAttrib3hvNV)
+#define glVertexAttrib3sARB MANGLE(VertexAttrib3sARB)
+#define glVertexAttrib3s MANGLE(VertexAttrib3s)
+#define glVertexAttrib3sNV MANGLE(VertexAttrib3sNV)
+#define glVertexAttrib3svARB MANGLE(VertexAttrib3svARB)
+#define glVertexAttrib3sv MANGLE(VertexAttrib3sv)
+#define glVertexAttrib3svNV MANGLE(VertexAttrib3svNV)
+#define glVertexAttrib4bvARB MANGLE(VertexAttrib4bvARB)
+#define glVertexAttrib4bv MANGLE(VertexAttrib4bv)
+#define glVertexAttrib4dARB MANGLE(VertexAttrib4dARB)
+#define glVertexAttrib4d MANGLE(VertexAttrib4d)
+#define glVertexAttrib4dNV MANGLE(VertexAttrib4dNV)
+#define glVertexAttrib4dvARB MANGLE(VertexAttrib4dvARB)
+#define glVertexAttrib4dv MANGLE(VertexAttrib4dv)
+#define glVertexAttrib4dvNV MANGLE(VertexAttrib4dvNV)
+#define glVertexAttrib4fARB MANGLE(VertexAttrib4fARB)
+#define glVertexAttrib4f MANGLE(VertexAttrib4f)
+#define glVertexAttrib4fNV MANGLE(VertexAttrib4fNV)
+#define glVertexAttrib4fvARB MANGLE(VertexAttrib4fvARB)
+#define glVertexAttrib4fv MANGLE(VertexAttrib4fv)
+#define glVertexAttrib4fvNV MANGLE(VertexAttrib4fvNV)
+#define glVertexAttrib4hNV MANGLE(VertexAttrib4hNV)
+#define glVertexAttrib4hvNV MANGLE(VertexAttrib4hvNV)
+#define glVertexAttrib4ivARB MANGLE(VertexAttrib4ivARB)
+#define glVertexAttrib4iv MANGLE(VertexAttrib4iv)
+#define glVertexAttrib4NbvARB MANGLE(VertexAttrib4NbvARB)
+#define glVertexAttrib4Nbv MANGLE(VertexAttrib4Nbv)
+#define glVertexAttrib4NivARB MANGLE(VertexAttrib4NivARB)
+#define glVertexAttrib4Niv MANGLE(VertexAttrib4Niv)
+#define glVertexAttrib4NsvARB MANGLE(VertexAttrib4NsvARB)
+#define glVertexAttrib4Nsv MANGLE(VertexAttrib4Nsv)
+#define glVertexAttrib4NubARB MANGLE(VertexAttrib4NubARB)
+#define glVertexAttrib4Nub MANGLE(VertexAttrib4Nub)
+#define glVertexAttrib4NubvARB MANGLE(VertexAttrib4NubvARB)
+#define glVertexAttrib4Nubv MANGLE(VertexAttrib4Nubv)
+#define glVertexAttrib4NuivARB MANGLE(VertexAttrib4NuivARB)
+#define glVertexAttrib4Nuiv MANGLE(VertexAttrib4Nuiv)
+#define glVertexAttrib4NusvARB MANGLE(VertexAttrib4NusvARB)
+#define glVertexAttrib4Nusv MANGLE(VertexAttrib4Nusv)
+#define glVertexAttrib4sARB MANGLE(VertexAttrib4sARB)
+#define glVertexAttrib4s MANGLE(VertexAttrib4s)
+#define glVertexAttrib4sNV MANGLE(VertexAttrib4sNV)
+#define glVertexAttrib4svARB MANGLE(VertexAttrib4svARB)
+#define glVertexAttrib4sv MANGLE(VertexAttrib4sv)
+#define glVertexAttrib4svNV MANGLE(VertexAttrib4svNV)
+#define glVertexAttrib4ubNV MANGLE(VertexAttrib4ubNV)
+#define glVertexAttrib4ubvARB MANGLE(VertexAttrib4ubvARB)
+#define glVertexAttrib4ubv MANGLE(VertexAttrib4ubv)
+#define glVertexAttrib4ubvNV MANGLE(VertexAttrib4ubvNV)
+#define glVertexAttrib4uivARB MANGLE(VertexAttrib4uivARB)
+#define glVertexAttrib4uiv MANGLE(VertexAttrib4uiv)
+#define glVertexAttrib4usvARB MANGLE(VertexAttrib4usvARB)
+#define glVertexAttrib4usv MANGLE(VertexAttrib4usv)
+#define glVertexAttribArrayObjectATI MANGLE(VertexAttribArrayObjectATI)
+#define glVertexAttribDivisorARB MANGLE(VertexAttribDivisorARB)
+#define glVertexAttribDivisor MANGLE(VertexAttribDivisor)
+#define glVertexAttribFormatNV MANGLE(VertexAttribFormatNV)
+#define glVertexAttribI1iEXT MANGLE(VertexAttribI1iEXT)
+#define glVertexAttribI1i MANGLE(VertexAttribI1i)
+#define glVertexAttribI1ivEXT MANGLE(VertexAttribI1ivEXT)
+#define glVertexAttribI1iv MANGLE(VertexAttribI1iv)
+#define glVertexAttribI1uiEXT MANGLE(VertexAttribI1uiEXT)
+#define glVertexAttribI1ui MANGLE(VertexAttribI1ui)
+#define glVertexAttribI1uivEXT MANGLE(VertexAttribI1uivEXT)
+#define glVertexAttribI1uiv MANGLE(VertexAttribI1uiv)
+#define glVertexAttribI2iEXT MANGLE(VertexAttribI2iEXT)
+#define glVertexAttribI2i MANGLE(VertexAttribI2i)
+#define glVertexAttribI2ivEXT MANGLE(VertexAttribI2ivEXT)
+#define glVertexAttribI2iv MANGLE(VertexAttribI2iv)
+#define glVertexAttribI2uiEXT MANGLE(VertexAttribI2uiEXT)
+#define glVertexAttribI2ui MANGLE(VertexAttribI2ui)
+#define glVertexAttribI2uivEXT MANGLE(VertexAttribI2uivEXT)
+#define glVertexAttribI2uiv MANGLE(VertexAttribI2uiv)
+#define glVertexAttribI3iEXT MANGLE(VertexAttribI3iEXT)
+#define glVertexAttribI3i MANGLE(VertexAttribI3i)
+#define glVertexAttribI3ivEXT MANGLE(VertexAttribI3ivEXT)
+#define glVertexAttribI3iv MANGLE(VertexAttribI3iv)
+#define glVertexAttribI3uiEXT MANGLE(VertexAttribI3uiEXT)
+#define glVertexAttribI3ui MANGLE(VertexAttribI3ui)
+#define glVertexAttribI3uivEXT MANGLE(VertexAttribI3uivEXT)
+#define glVertexAttribI3uiv MANGLE(VertexAttribI3uiv)
+#define glVertexAttribI4bvEXT MANGLE(VertexAttribI4bvEXT)
+#define glVertexAttribI4bv MANGLE(VertexAttribI4bv)
+#define glVertexAttribI4iEXT MANGLE(VertexAttribI4iEXT)
+#define glVertexAttribI4i MANGLE(VertexAttribI4i)
+#define glVertexAttribI4ivEXT MANGLE(VertexAttribI4ivEXT)
+#define glVertexAttribI4iv MANGLE(VertexAttribI4iv)
+#define glVertexAttribI4svEXT MANGLE(VertexAttribI4svEXT)
+#define glVertexAttribI4sv MANGLE(VertexAttribI4sv)
+#define glVertexAttribI4ubvEXT MANGLE(VertexAttribI4ubvEXT)
+#define glVertexAttribI4ubv MANGLE(VertexAttribI4ubv)
+#define glVertexAttribI4uiEXT MANGLE(VertexAttribI4uiEXT)
+#define glVertexAttribI4ui MANGLE(VertexAttribI4ui)
+#define glVertexAttribI4uivEXT MANGLE(VertexAttribI4uivEXT)
+#define glVertexAttribI4uiv MANGLE(VertexAttribI4uiv)
+#define glVertexAttribI4usvEXT MANGLE(VertexAttribI4usvEXT)
+#define glVertexAttribI4usv MANGLE(VertexAttribI4usv)
+#define glVertexAttribIFormatNV MANGLE(VertexAttribIFormatNV)
+#define glVertexAttribIPointerEXT MANGLE(VertexAttribIPointerEXT)
+#define glVertexAttribIPointer MANGLE(VertexAttribIPointer)
+#define glVertexAttribL1dEXT MANGLE(VertexAttribL1dEXT)
+#define glVertexAttribL1d MANGLE(VertexAttribL1d)
+#define glVertexAttribL1dvEXT MANGLE(VertexAttribL1dvEXT)
+#define glVertexAttribL1dv MANGLE(VertexAttribL1dv)
+#define glVertexAttribL1i64NV MANGLE(VertexAttribL1i64NV)
+#define glVertexAttribL1i64vNV MANGLE(VertexAttribL1i64vNV)
+#define glVertexAttribL1ui64NV MANGLE(VertexAttribL1ui64NV)
+#define glVertexAttribL1ui64vNV MANGLE(VertexAttribL1ui64vNV)
+#define glVertexAttribL2dEXT MANGLE(VertexAttribL2dEXT)
+#define glVertexAttribL2d MANGLE(VertexAttribL2d)
+#define glVertexAttribL2dvEXT MANGLE(VertexAttribL2dvEXT)
+#define glVertexAttribL2dv MANGLE(VertexAttribL2dv)
+#define glVertexAttribL2i64NV MANGLE(VertexAttribL2i64NV)
+#define glVertexAttribL2i64vNV MANGLE(VertexAttribL2i64vNV)
+#define glVertexAttribL2ui64NV MANGLE(VertexAttribL2ui64NV)
+#define glVertexAttribL2ui64vNV MANGLE(VertexAttribL2ui64vNV)
+#define glVertexAttribL3dEXT MANGLE(VertexAttribL3dEXT)
+#define glVertexAttribL3d MANGLE(VertexAttribL3d)
+#define glVertexAttribL3dvEXT MANGLE(VertexAttribL3dvEXT)
+#define glVertexAttribL3dv MANGLE(VertexAttribL3dv)
+#define glVertexAttribL3i64NV MANGLE(VertexAttribL3i64NV)
+#define glVertexAttribL3i64vNV MANGLE(VertexAttribL3i64vNV)
+#define glVertexAttribL3ui64NV MANGLE(VertexAttribL3ui64NV)
+#define glVertexAttribL3ui64vNV MANGLE(VertexAttribL3ui64vNV)
+#define glVertexAttribL4dEXT MANGLE(VertexAttribL4dEXT)
+#define glVertexAttribL4d MANGLE(VertexAttribL4d)
+#define glVertexAttribL4dvEXT MANGLE(VertexAttribL4dvEXT)
+#define glVertexAttribL4dv MANGLE(VertexAttribL4dv)
+#define glVertexAttribL4i64NV MANGLE(VertexAttribL4i64NV)
+#define glVertexAttribL4i64vNV MANGLE(VertexAttribL4i64vNV)
+#define glVertexAttribL4ui64NV MANGLE(VertexAttribL4ui64NV)
+#define glVertexAttribL4ui64vNV MANGLE(VertexAttribL4ui64vNV)
+#define glVertexAttribLFormatNV MANGLE(VertexAttribLFormatNV)
+#define glVertexAttribLPointerEXT MANGLE(VertexAttribLPointerEXT)
+#define glVertexAttribLPointer MANGLE(VertexAttribLPointer)
+#define glVertexAttribP1ui MANGLE(VertexAttribP1ui)
+#define glVertexAttribP1uiv MANGLE(VertexAttribP1uiv)
+#define glVertexAttribP2ui MANGLE(VertexAttribP2ui)
+#define glVertexAttribP2uiv MANGLE(VertexAttribP2uiv)
+#define glVertexAttribP3ui MANGLE(VertexAttribP3ui)
+#define glVertexAttribP3uiv MANGLE(VertexAttribP3uiv)
+#define glVertexAttribP4ui MANGLE(VertexAttribP4ui)
+#define glVertexAttribP4uiv MANGLE(VertexAttribP4uiv)
+#define glVertexAttribPointerARB MANGLE(VertexAttribPointerARB)
+#define glVertexAttribPointer MANGLE(VertexAttribPointer)
+#define glVertexAttribPointerNV MANGLE(VertexAttribPointerNV)
+#define glVertexAttribs1dvNV MANGLE(VertexAttribs1dvNV)
+#define glVertexAttribs1fvNV MANGLE(VertexAttribs1fvNV)
+#define glVertexAttribs1hvNV MANGLE(VertexAttribs1hvNV)
+#define glVertexAttribs1svNV MANGLE(VertexAttribs1svNV)
+#define glVertexAttribs2dvNV MANGLE(VertexAttribs2dvNV)
+#define glVertexAttribs2fvNV MANGLE(VertexAttribs2fvNV)
+#define glVertexAttribs2hvNV MANGLE(VertexAttribs2hvNV)
+#define glVertexAttribs2svNV MANGLE(VertexAttribs2svNV)
+#define glVertexAttribs3dvNV MANGLE(VertexAttribs3dvNV)
+#define glVertexAttribs3fvNV MANGLE(VertexAttribs3fvNV)
+#define glVertexAttribs3hvNV MANGLE(VertexAttribs3hvNV)
+#define glVertexAttribs3svNV MANGLE(VertexAttribs3svNV)
+#define glVertexAttribs4dvNV MANGLE(VertexAttribs4dvNV)
+#define glVertexAttribs4fvNV MANGLE(VertexAttribs4fvNV)
+#define glVertexAttribs4hvNV MANGLE(VertexAttribs4hvNV)
+#define glVertexAttribs4svNV MANGLE(VertexAttribs4svNV)
+#define glVertexAttribs4ubvNV MANGLE(VertexAttribs4ubvNV)
+#define glVertexBlendARB MANGLE(VertexBlendARB)
+#define glVertexBlendEnvfATI MANGLE(VertexBlendEnvfATI)
+#define glVertexBlendEnviATI MANGLE(VertexBlendEnviATI)
+#define glVertexFormatNV MANGLE(VertexFormatNV)
+#define glVertexP2ui MANGLE(VertexP2ui)
+#define glVertexP2uiv MANGLE(VertexP2uiv)
+#define glVertexP3ui MANGLE(VertexP3ui)
+#define glVertexP3uiv MANGLE(VertexP3uiv)
+#define glVertexP4ui MANGLE(VertexP4ui)
+#define glVertexP4uiv MANGLE(VertexP4uiv)
+#define glVertexPointerEXT MANGLE(VertexPointerEXT)
+#define glVertexPointerListIBM MANGLE(VertexPointerListIBM)
+#define glVertexPointer MANGLE(VertexPointer)
+#define glVertexPointervINTEL MANGLE(VertexPointervINTEL)
+#define glVertexStream1dATI MANGLE(VertexStream1dATI)
+#define glVertexStream1dvATI MANGLE(VertexStream1dvATI)
+#define glVertexStream1fATI MANGLE(VertexStream1fATI)
+#define glVertexStream1fvATI MANGLE(VertexStream1fvATI)
+#define glVertexStream1iATI MANGLE(VertexStream1iATI)
+#define glVertexStream1ivATI MANGLE(VertexStream1ivATI)
+#define glVertexStream1sATI MANGLE(VertexStream1sATI)
+#define glVertexStream1svATI MANGLE(VertexStream1svATI)
+#define glVertexStream2dATI MANGLE(VertexStream2dATI)
+#define glVertexStream2dvATI MANGLE(VertexStream2dvATI)
+#define glVertexStream2fATI MANGLE(VertexStream2fATI)
+#define glVertexStream2fvATI MANGLE(VertexStream2fvATI)
+#define glVertexStream2iATI MANGLE(VertexStream2iATI)
+#define glVertexStream2ivATI MANGLE(VertexStream2ivATI)
+#define glVertexStream2sATI MANGLE(VertexStream2sATI)
+#define glVertexStream2svATI MANGLE(VertexStream2svATI)
+#define glVertexStream3dATI MANGLE(VertexStream3dATI)
+#define glVertexStream3dvATI MANGLE(VertexStream3dvATI)
+#define glVertexStream3fATI MANGLE(VertexStream3fATI)
+#define glVertexStream3fvATI MANGLE(VertexStream3fvATI)
+#define glVertexStream3iATI MANGLE(VertexStream3iATI)
+#define glVertexStream3ivATI MANGLE(VertexStream3ivATI)
+#define glVertexStream3sATI MANGLE(VertexStream3sATI)
+#define glVertexStream3svATI MANGLE(VertexStream3svATI)
+#define glVertexStream4dATI MANGLE(VertexStream4dATI)
+#define glVertexStream4dvATI MANGLE(VertexStream4dvATI)
+#define glVertexStream4fATI MANGLE(VertexStream4fATI)
+#define glVertexStream4fvATI MANGLE(VertexStream4fvATI)
+#define glVertexStream4iATI MANGLE(VertexStream4iATI)
+#define glVertexStream4ivATI MANGLE(VertexStream4ivATI)
+#define glVertexStream4sATI MANGLE(VertexStream4sATI)
+#define glVertexStream4svATI MANGLE(VertexStream4svATI)
+#define glVertexWeightfEXT MANGLE(VertexWeightfEXT)
+#define glVertexWeightfvEXT MANGLE(VertexWeightfvEXT)
+#define glVertexWeighthNV MANGLE(VertexWeighthNV)
+#define glVertexWeighthvNV MANGLE(VertexWeighthvNV)
+#define glVertexWeightPointerEXT MANGLE(VertexWeightPointerEXT)
+#define glVideoCaptureNV MANGLE(VideoCaptureNV)
+#define glVideoCaptureStreamParameterdvNV MANGLE(VideoCaptureStreamParameterdvNV)
+#define glVideoCaptureStreamParameterfvNV MANGLE(VideoCaptureStreamParameterfvNV)
+#define glVideoCaptureStreamParameterivNV MANGLE(VideoCaptureStreamParameterivNV)
+#define glViewportArrayv MANGLE(ViewportArrayv)
+#define glViewportIndexedf MANGLE(ViewportIndexedf)
+#define glViewportIndexedfv MANGLE(ViewportIndexedfv)
+#define glViewport MANGLE(Viewport)
+#define glWaitSync MANGLE(WaitSync)
+#define glWeightbvARB MANGLE(WeightbvARB)
+#define glWeightdvARB MANGLE(WeightdvARB)
+#define glWeightfvARB MANGLE(WeightfvARB)
+#define glWeightivARB MANGLE(WeightivARB)
+#define glWeightPointerARB MANGLE(WeightPointerARB)
+#define glWeightsvARB MANGLE(WeightsvARB)
+#define glWeightubvARB MANGLE(WeightubvARB)
+#define glWeightuivARB MANGLE(WeightuivARB)
+#define glWeightusvARB MANGLE(WeightusvARB)
+#define glWindowPos2dARB MANGLE(WindowPos2dARB)
+#define glWindowPos2d MANGLE(WindowPos2d)
+#define glWindowPos2dMESA MANGLE(WindowPos2dMESA)
+#define glWindowPos2dvARB MANGLE(WindowPos2dvARB)
+#define glWindowPos2dv MANGLE(WindowPos2dv)
+#define glWindowPos2dvMESA MANGLE(WindowPos2dvMESA)
+#define glWindowPos2fARB MANGLE(WindowPos2fARB)
+#define glWindowPos2f MANGLE(WindowPos2f)
+#define glWindowPos2fMESA MANGLE(WindowPos2fMESA)
+#define glWindowPos2fvARB MANGLE(WindowPos2fvARB)
+#define glWindowPos2fv MANGLE(WindowPos2fv)
+#define glWindowPos2fvMESA MANGLE(WindowPos2fvMESA)
+#define glWindowPos2iARB MANGLE(WindowPos2iARB)
+#define glWindowPos2i MANGLE(WindowPos2i)
+#define glWindowPos2iMESA MANGLE(WindowPos2iMESA)
+#define glWindowPos2ivARB MANGLE(WindowPos2ivARB)
+#define glWindowPos2iv MANGLE(WindowPos2iv)
+#define glWindowPos2ivMESA MANGLE(WindowPos2ivMESA)
+#define glWindowPos2sARB MANGLE(WindowPos2sARB)
+#define glWindowPos2s MANGLE(WindowPos2s)
+#define glWindowPos2sMESA MANGLE(WindowPos2sMESA)
+#define glWindowPos2svARB MANGLE(WindowPos2svARB)
+#define glWindowPos2sv MANGLE(WindowPos2sv)
+#define glWindowPos2svMESA MANGLE(WindowPos2svMESA)
+#define glWindowPos3dARB MANGLE(WindowPos3dARB)
+#define glWindowPos3d MANGLE(WindowPos3d)
+#define glWindowPos3dMESA MANGLE(WindowPos3dMESA)
+#define glWindowPos3dvARB MANGLE(WindowPos3dvARB)
+#define glWindowPos3dv MANGLE(WindowPos3dv)
+#define glWindowPos3dvMESA MANGLE(WindowPos3dvMESA)
+#define glWindowPos3fARB MANGLE(WindowPos3fARB)
+#define glWindowPos3f MANGLE(WindowPos3f)
+#define glWindowPos3fMESA MANGLE(WindowPos3fMESA)
+#define glWindowPos3fvARB MANGLE(WindowPos3fvARB)
+#define glWindowPos3fv MANGLE(WindowPos3fv)
+#define glWindowPos3fvMESA MANGLE(WindowPos3fvMESA)
+#define glWindowPos3iARB MANGLE(WindowPos3iARB)
+#define glWindowPos3i MANGLE(WindowPos3i)
+#define glWindowPos3iMESA MANGLE(WindowPos3iMESA)
+#define glWindowPos3ivARB MANGLE(WindowPos3ivARB)
+#define glWindowPos3iv MANGLE(WindowPos3iv)
+#define glWindowPos3ivMESA MANGLE(WindowPos3ivMESA)
+#define glWindowPos3sARB MANGLE(WindowPos3sARB)
+#define glWindowPos3s MANGLE(WindowPos3s)
+#define glWindowPos3sMESA MANGLE(WindowPos3sMESA)
+#define glWindowPos3svARB MANGLE(WindowPos3svARB)
+#define glWindowPos3sv MANGLE(WindowPos3sv)
+#define glWindowPos3svMESA MANGLE(WindowPos3svMESA)
+#define glWindowPos4dMESA MANGLE(WindowPos4dMESA)
+#define glWindowPos4dvMESA MANGLE(WindowPos4dvMESA)
+#define glWindowPos4fMESA MANGLE(WindowPos4fMESA)
+#define glWindowPos4fvMESA MANGLE(WindowPos4fvMESA)
+#define glWindowPos4iMESA MANGLE(WindowPos4iMESA)
+#define glWindowPos4ivMESA MANGLE(WindowPos4ivMESA)
+#define glWindowPos4sMESA MANGLE(WindowPos4sMESA)
+#define glWindowPos4svMESA MANGLE(WindowPos4svMESA)
+#define glWriteMaskEXT MANGLE(WriteMaskEXT)
+
+#endif /* GL_MANGLE_H */
diff --git a/hw/yagl/yagl_inc/GL/glext.h b/hw/yagl/yagl_inc/GL/glext.h
new file mode 100644
index 0000000000..09400215ba
--- /dev/null
+++ b/hw/yagl/yagl_inc/GL/glext.h
@@ -0,0 +1,11488 @@
+#ifndef __glext_h_
+#define __glext_h_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+** Copyright (c) 2007-2011 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
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+
+/* Header file version number, required by OpenGL ABI for Linux */
+/* glext.h last updated $Date: 2011-08-08 00:34:29 -0700 (Mon, 08 Aug 2011) $ */
+/* Current version at http://www.opengl.org/registry/ */
+#define GL_GLEXT_VERSION 72
+/* Function declaration macros - to move into glplatform.h */
+
+#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
+#define WIN32_LEAN_AND_MEAN 1
+#include <windows.h>
+#endif
+
+#ifndef APIENTRY
+#define APIENTRY
+#endif
+#ifndef APIENTRYP
+#define APIENTRYP APIENTRY *
+#endif
+#ifndef GLAPI
+#define GLAPI extern
+#endif
+
+/*************************************************************/
+
+#ifndef GL_VERSION_1_2
+#define GL_UNSIGNED_BYTE_3_3_2 0x8032
+#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
+#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
+#define GL_UNSIGNED_INT_8_8_8_8 0x8035
+#define GL_UNSIGNED_INT_10_10_10_2 0x8036
+#define GL_TEXTURE_BINDING_3D 0x806A
+#define GL_PACK_SKIP_IMAGES 0x806B
+#define GL_PACK_IMAGE_HEIGHT 0x806C
+#define GL_UNPACK_SKIP_IMAGES 0x806D
+#define GL_UNPACK_IMAGE_HEIGHT 0x806E
+#define GL_TEXTURE_3D 0x806F
+#define GL_PROXY_TEXTURE_3D 0x8070
+#define GL_TEXTURE_DEPTH 0x8071
+#define GL_TEXTURE_WRAP_R 0x8072
+#define GL_MAX_3D_TEXTURE_SIZE 0x8073
+#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362
+#define GL_UNSIGNED_SHORT_5_6_5 0x8363
+#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364
+#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365
+#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366
+#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367
+#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
+#define GL_BGR 0x80E0
+#define GL_BGRA 0x80E1
+#define GL_MAX_ELEMENTS_VERTICES 0x80E8
+#define GL_MAX_ELEMENTS_INDICES 0x80E9
+#define GL_CLAMP_TO_EDGE 0x812F
+#define GL_TEXTURE_MIN_LOD 0x813A
+#define GL_TEXTURE_MAX_LOD 0x813B
+#define GL_TEXTURE_BASE_LEVEL 0x813C
+#define GL_TEXTURE_MAX_LEVEL 0x813D
+#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12
+#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13
+#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22
+#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23
+#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
+#endif
+
+#ifndef GL_VERSION_1_2_DEPRECATED
+#define GL_RESCALE_NORMAL 0x803A
+#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8
+#define GL_SINGLE_COLOR 0x81F9
+#define GL_SEPARATE_SPECULAR_COLOR 0x81FA
+#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
+#endif
+
+#ifndef GL_ARB_imaging
+#define GL_CONSTANT_COLOR 0x8001
+#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
+#define GL_CONSTANT_ALPHA 0x8003
+#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
+#define GL_BLEND_COLOR 0x8005
+#define GL_FUNC_ADD 0x8006
+#define GL_MIN 0x8007
+#define GL_MAX 0x8008
+#define GL_BLEND_EQUATION 0x8009
+#define GL_FUNC_SUBTRACT 0x800A
+#define GL_FUNC_REVERSE_SUBTRACT 0x800B
+#endif
+
+#ifndef GL_ARB_imaging_DEPRECATED
+#define GL_CONVOLUTION_1D 0x8010
+#define GL_CONVOLUTION_2D 0x8011
+#define GL_SEPARABLE_2D 0x8012
+#define GL_CONVOLUTION_BORDER_MODE 0x8013
+#define GL_CONVOLUTION_FILTER_SCALE 0x8014
+#define GL_CONVOLUTION_FILTER_BIAS 0x8015
+#define GL_REDUCE 0x8016
+#define GL_CONVOLUTION_FORMAT 0x8017
+#define GL_CONVOLUTION_WIDTH 0x8018
+#define GL_CONVOLUTION_HEIGHT 0x8019
+#define GL_MAX_CONVOLUTION_WIDTH 0x801A
+#define GL_MAX_CONVOLUTION_HEIGHT 0x801B
+#define GL_POST_CONVOLUTION_RED_SCALE 0x801C
+#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D
+#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E
+#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F
+#define GL_POST_CONVOLUTION_RED_BIAS 0x8020
+#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021
+#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022
+#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023
+#define GL_HISTOGRAM 0x8024
+#define GL_PROXY_HISTOGRAM 0x8025
+#define GL_HISTOGRAM_WIDTH 0x8026
+#define GL_HISTOGRAM_FORMAT 0x8027
+#define GL_HISTOGRAM_RED_SIZE 0x8028
+#define GL_HISTOGRAM_GREEN_SIZE 0x8029
+#define GL_HISTOGRAM_BLUE_SIZE 0x802A
+#define GL_HISTOGRAM_ALPHA_SIZE 0x802B
+#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C
+#define GL_HISTOGRAM_SINK 0x802D
+#define GL_MINMAX 0x802E
+#define GL_MINMAX_FORMAT 0x802F
+#define GL_MINMAX_SINK 0x8030
+#define GL_TABLE_TOO_LARGE 0x8031
+#define GL_COLOR_MATRIX 0x80B1
+#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2
+#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3
+#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4
+#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5
+#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6
+#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7
+#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8
+#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9
+#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA
+#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB
+#define GL_COLOR_TABLE 0x80D0
+#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1
+#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2
+#define GL_PROXY_COLOR_TABLE 0x80D3
+#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4
+#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5
+#define GL_COLOR_TABLE_SCALE 0x80D6
+#define GL_COLOR_TABLE_BIAS 0x80D7
+#define GL_COLOR_TABLE_FORMAT 0x80D8
+#define GL_COLOR_TABLE_WIDTH 0x80D9
+#define GL_COLOR_TABLE_RED_SIZE 0x80DA
+#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB
+#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC
+#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD
+#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE
+#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF
+#define GL_CONSTANT_BORDER 0x8151
+#define GL_REPLICATE_BORDER 0x8153
+#define GL_CONVOLUTION_BORDER_COLOR 0x8154
+#endif
+
+#ifndef GL_VERSION_1_3
+#define GL_TEXTURE0 0x84C0
+#define GL_TEXTURE1 0x84C1
+#define GL_TEXTURE2 0x84C2
+#define GL_TEXTURE3 0x84C3
+#define GL_TEXTURE4 0x84C4
+#define GL_TEXTURE5 0x84C5
+#define GL_TEXTURE6 0x84C6
+#define GL_TEXTURE7 0x84C7
+#define GL_TEXTURE8 0x84C8
+#define GL_TEXTURE9 0x84C9
+#define GL_TEXTURE10 0x84CA
+#define GL_TEXTURE11 0x84CB
+#define GL_TEXTURE12 0x84CC
+#define GL_TEXTURE13 0x84CD
+#define GL_TEXTURE14 0x84CE
+#define GL_TEXTURE15 0x84CF
+#define GL_TEXTURE16 0x84D0
+#define GL_TEXTURE17 0x84D1
+#define GL_TEXTURE18 0x84D2
+#define GL_TEXTURE19 0x84D3
+#define GL_TEXTURE20 0x84D4
+#define GL_TEXTURE21 0x84D5
+#define GL_TEXTURE22 0x84D6
+#define GL_TEXTURE23 0x84D7
+#define GL_TEXTURE24 0x84D8
+#define GL_TEXTURE25 0x84D9
+#define GL_TEXTURE26 0x84DA
+#define GL_TEXTURE27 0x84DB
+#define GL_TEXTURE28 0x84DC
+#define GL_TEXTURE29 0x84DD
+#define GL_TEXTURE30 0x84DE
+#define GL_TEXTURE31 0x84DF
+#define GL_ACTIVE_TEXTURE 0x84E0
+#define GL_MULTISAMPLE 0x809D
+#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE 0x809F
+#define GL_SAMPLE_COVERAGE 0x80A0
+#define GL_SAMPLE_BUFFERS 0x80A8
+#define GL_SAMPLES 0x80A9
+#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
+#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
+#define GL_TEXTURE_CUBE_MAP 0x8513
+#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
+#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
+#define GL_COMPRESSED_RGB 0x84ED
+#define GL_COMPRESSED_RGBA 0x84EE
+#define GL_TEXTURE_COMPRESSION_HINT 0x84EF
+#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0
+#define GL_TEXTURE_COMPRESSED 0x86A1
+#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
+#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
+#define GL_CLAMP_TO_BORDER 0x812D
+#endif
+
+#ifndef GL_VERSION_1_3_DEPRECATED
+#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1
+#define GL_MAX_TEXTURE_UNITS 0x84E2
+#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3
+#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4
+#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5
+#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6
+#define GL_MULTISAMPLE_BIT 0x20000000
+#define GL_NORMAL_MAP 0x8511
+#define GL_REFLECTION_MAP 0x8512
+#define GL_COMPRESSED_ALPHA 0x84E9
+#define GL_COMPRESSED_LUMINANCE 0x84EA
+#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB
+#define GL_COMPRESSED_INTENSITY 0x84EC
+#define GL_COMBINE 0x8570
+#define GL_COMBINE_RGB 0x8571
+#define GL_COMBINE_ALPHA 0x8572
+#define GL_SOURCE0_RGB 0x8580
+#define GL_SOURCE1_RGB 0x8581
+#define GL_SOURCE2_RGB 0x8582
+#define GL_SOURCE0_ALPHA 0x8588
+#define GL_SOURCE1_ALPHA 0x8589
+#define GL_SOURCE2_ALPHA 0x858A
+#define GL_OPERAND0_RGB 0x8590
+#define GL_OPERAND1_RGB 0x8591
+#define GL_OPERAND2_RGB 0x8592
+#define GL_OPERAND0_ALPHA 0x8598
+#define GL_OPERAND1_ALPHA 0x8599
+#define GL_OPERAND2_ALPHA 0x859A
+#define GL_RGB_SCALE 0x8573
+#define GL_ADD_SIGNED 0x8574
+#define GL_INTERPOLATE 0x8575
+#define GL_SUBTRACT 0x84E7
+#define GL_CONSTANT 0x8576
+#define GL_PRIMARY_COLOR 0x8577
+#define GL_PREVIOUS 0x8578
+#define GL_DOT3_RGB 0x86AE
+#define GL_DOT3_RGBA 0x86AF
+#endif
+
+#ifndef GL_VERSION_1_4
+#define GL_BLEND_DST_RGB 0x80C8
+#define GL_BLEND_SRC_RGB 0x80C9
+#define GL_BLEND_DST_ALPHA 0x80CA
+#define GL_BLEND_SRC_ALPHA 0x80CB
+#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128
+#define GL_DEPTH_COMPONENT16 0x81A5
+#define GL_DEPTH_COMPONENT24 0x81A6
+#define GL_DEPTH_COMPONENT32 0x81A7
+#define GL_MIRRORED_REPEAT 0x8370
+#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD
+#define GL_TEXTURE_LOD_BIAS 0x8501
+#define GL_INCR_WRAP 0x8507
+#define GL_DECR_WRAP 0x8508
+#define GL_TEXTURE_DEPTH_SIZE 0x884A
+#define GL_TEXTURE_COMPARE_MODE 0x884C
+#define GL_TEXTURE_COMPARE_FUNC 0x884D
+#endif
+
+#ifndef GL_VERSION_1_4_DEPRECATED
+#define GL_POINT_SIZE_MIN 0x8126
+#define GL_POINT_SIZE_MAX 0x8127
+#define GL_POINT_DISTANCE_ATTENUATION 0x8129
+#define GL_GENERATE_MIPMAP 0x8191
+#define GL_GENERATE_MIPMAP_HINT 0x8192
+#define GL_FOG_COORDINATE_SOURCE 0x8450
+#define GL_FOG_COORDINATE 0x8451
+#define GL_FRAGMENT_DEPTH 0x8452
+#define GL_CURRENT_FOG_COORDINATE 0x8453
+#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454
+#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455
+#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456
+#define GL_FOG_COORDINATE_ARRAY 0x8457
+#define GL_COLOR_SUM 0x8458
+#define GL_CURRENT_SECONDARY_COLOR 0x8459
+#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A
+#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B
+#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C
+#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D
+#define GL_SECONDARY_COLOR_ARRAY 0x845E
+#define GL_TEXTURE_FILTER_CONTROL 0x8500
+#define GL_DEPTH_TEXTURE_MODE 0x884B
+#define GL_COMPARE_R_TO_TEXTURE 0x884E
+#endif
+
+#ifndef GL_VERSION_1_5
+#define GL_BUFFER_SIZE 0x8764
+#define GL_BUFFER_USAGE 0x8765
+#define GL_QUERY_COUNTER_BITS 0x8864
+#define GL_CURRENT_QUERY 0x8865
+#define GL_QUERY_RESULT 0x8866
+#define GL_QUERY_RESULT_AVAILABLE 0x8867
+#define GL_ARRAY_BUFFER 0x8892
+#define GL_ELEMENT_ARRAY_BUFFER 0x8893
+#define GL_ARRAY_BUFFER_BINDING 0x8894
+#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
+#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
+#define GL_READ_ONLY 0x88B8
+#define GL_WRITE_ONLY 0x88B9
+#define GL_READ_WRITE 0x88BA
+#define GL_BUFFER_ACCESS 0x88BB
+#define GL_BUFFER_MAPPED 0x88BC
+#define GL_BUFFER_MAP_POINTER 0x88BD
+#define GL_STREAM_DRAW 0x88E0
+#define GL_STREAM_READ 0x88E1
+#define GL_STREAM_COPY 0x88E2
+#define GL_STATIC_DRAW 0x88E4
+#define GL_STATIC_READ 0x88E5
+#define GL_STATIC_COPY 0x88E6
+#define GL_DYNAMIC_DRAW 0x88E8
+#define GL_DYNAMIC_READ 0x88E9
+#define GL_DYNAMIC_COPY 0x88EA
+#define GL_SAMPLES_PASSED 0x8914
+#endif
+
+#ifndef GL_VERSION_1_5_DEPRECATED
+#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896
+#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897
+#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898
+#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899
+#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A
+#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B
+#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C
+#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D
+#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E
+#define GL_FOG_COORD_SRC 0x8450
+#define GL_FOG_COORD 0x8451
+#define GL_CURRENT_FOG_COORD 0x8453
+#define GL_FOG_COORD_ARRAY_TYPE 0x8454
+#define GL_FOG_COORD_ARRAY_STRIDE 0x8455
+#define GL_FOG_COORD_ARRAY_POINTER 0x8456
+#define GL_FOG_COORD_ARRAY 0x8457
+#define GL_FOG_COORD_ARRAY_BUFFER_BINDING 0x889D
+#define GL_SRC0_RGB 0x8580
+#define GL_SRC1_RGB 0x8581
+#define GL_SRC2_RGB 0x8582
+#define GL_SRC0_ALPHA 0x8588
+#define GL_SRC1_ALPHA 0x8589
+#define GL_SRC2_ALPHA 0x858A
+#endif
+
+#ifndef GL_VERSION_2_0
+#define GL_BLEND_EQUATION_RGB 0x8009
+#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
+#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
+#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
+#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
+#define GL_CURRENT_VERTEX_ATTRIB 0x8626
+#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642
+#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
+#define GL_STENCIL_BACK_FUNC 0x8800
+#define GL_STENCIL_BACK_FAIL 0x8801
+#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802
+#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803
+#define GL_MAX_DRAW_BUFFERS 0x8824
+#define GL_DRAW_BUFFER0 0x8825
+#define GL_DRAW_BUFFER1 0x8826
+#define GL_DRAW_BUFFER2 0x8827
+#define GL_DRAW_BUFFER3 0x8828
+#define GL_DRAW_BUFFER4 0x8829
+#define GL_DRAW_BUFFER5 0x882A
+#define GL_DRAW_BUFFER6 0x882B
+#define GL_DRAW_BUFFER7 0x882C
+#define GL_DRAW_BUFFER8 0x882D
+#define GL_DRAW_BUFFER9 0x882E
+#define GL_DRAW_BUFFER10 0x882F
+#define GL_DRAW_BUFFER11 0x8830
+#define GL_DRAW_BUFFER12 0x8831
+#define GL_DRAW_BUFFER13 0x8832
+#define GL_DRAW_BUFFER14 0x8833
+#define GL_DRAW_BUFFER15 0x8834
+#define GL_BLEND_EQUATION_ALPHA 0x883D
+#define GL_MAX_VERTEX_ATTRIBS 0x8869
+#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
+#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
+#define GL_FRAGMENT_SHADER 0x8B30
+#define GL_VERTEX_SHADER 0x8B31
+#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49
+#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A
+#define GL_MAX_VARYING_FLOATS 0x8B4B
+#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
+#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
+#define GL_SHADER_TYPE 0x8B4F
+#define GL_FLOAT_VEC2 0x8B50
+#define GL_FLOAT_VEC3 0x8B51
+#define GL_FLOAT_VEC4 0x8B52
+#define GL_INT_VEC2 0x8B53
+#define GL_INT_VEC3 0x8B54
+#define GL_INT_VEC4 0x8B55
+#define GL_BOOL 0x8B56
+#define GL_BOOL_VEC2 0x8B57
+#define GL_BOOL_VEC3 0x8B58
+#define GL_BOOL_VEC4 0x8B59
+#define GL_FLOAT_MAT2 0x8B5A
+#define GL_FLOAT_MAT3 0x8B5B
+#define GL_FLOAT_MAT4 0x8B5C
+#define GL_SAMPLER_1D 0x8B5D
+#define GL_SAMPLER_2D 0x8B5E
+#define GL_SAMPLER_3D 0x8B5F
+#define GL_SAMPLER_CUBE 0x8B60
+#define GL_SAMPLER_1D_SHADOW 0x8B61
+#define GL_SAMPLER_2D_SHADOW 0x8B62
+#define GL_DELETE_STATUS 0x8B80
+#define GL_COMPILE_STATUS 0x8B81
+#define GL_LINK_STATUS 0x8B82
+#define GL_VALIDATE_STATUS 0x8B83
+#define GL_INFO_LOG_LENGTH 0x8B84
+#define GL_ATTACHED_SHADERS 0x8B85
+#define GL_ACTIVE_UNIFORMS 0x8B86
+#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
+#define GL_SHADER_SOURCE_LENGTH 0x8B88
+#define GL_ACTIVE_ATTRIBUTES 0x8B89
+#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
+#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B
+#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
+#define GL_CURRENT_PROGRAM 0x8B8D
+#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0
+#define GL_LOWER_LEFT 0x8CA1
+#define GL_UPPER_LEFT 0x8CA2
+#define GL_STENCIL_BACK_REF 0x8CA3
+#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
+#define GL_STENCIL_BACK_WRITEMASK 0x8CA5
+#endif
+
+#ifndef GL_VERSION_2_0_DEPRECATED
+#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643
+#define GL_POINT_SPRITE 0x8861
+#define GL_COORD_REPLACE 0x8862
+#define GL_MAX_TEXTURE_COORDS 0x8871
+#endif
+
+#ifndef GL_VERSION_2_1
+#define GL_PIXEL_PACK_BUFFER 0x88EB
+#define GL_PIXEL_UNPACK_BUFFER 0x88EC
+#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED
+#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF
+#define GL_FLOAT_MAT2x3 0x8B65
+#define GL_FLOAT_MAT2x4 0x8B66
+#define GL_FLOAT_MAT3x2 0x8B67
+#define GL_FLOAT_MAT3x4 0x8B68
+#define GL_FLOAT_MAT4x2 0x8B69
+#define GL_FLOAT_MAT4x3 0x8B6A
+#define GL_SRGB 0x8C40
+#define GL_SRGB8 0x8C41
+#define GL_SRGB_ALPHA 0x8C42
+#define GL_SRGB8_ALPHA8 0x8C43
+#define GL_COMPRESSED_SRGB 0x8C48
+#define GL_COMPRESSED_SRGB_ALPHA 0x8C49
+#endif
+
+#ifndef GL_VERSION_2_1_DEPRECATED
+#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F
+#define GL_SLUMINANCE_ALPHA 0x8C44
+#define GL_SLUMINANCE8_ALPHA8 0x8C45
+#define GL_SLUMINANCE 0x8C46
+#define GL_SLUMINANCE8 0x8C47
+#define GL_COMPRESSED_SLUMINANCE 0x8C4A
+#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B
+#endif
+
+#ifndef GL_VERSION_3_0
+#define GL_COMPARE_REF_TO_TEXTURE 0x884E
+#define GL_CLIP_DISTANCE0 0x3000
+#define GL_CLIP_DISTANCE1 0x3001
+#define GL_CLIP_DISTANCE2 0x3002
+#define GL_CLIP_DISTANCE3 0x3003
+#define GL_CLIP_DISTANCE4 0x3004
+#define GL_CLIP_DISTANCE5 0x3005
+#define GL_CLIP_DISTANCE6 0x3006
+#define GL_CLIP_DISTANCE7 0x3007
+#define GL_MAX_CLIP_DISTANCES 0x0D32
+#define GL_MAJOR_VERSION 0x821B
+#define GL_MINOR_VERSION 0x821C
+#define GL_NUM_EXTENSIONS 0x821D
+#define GL_CONTEXT_FLAGS 0x821E
+#define GL_DEPTH_BUFFER 0x8223
+#define GL_STENCIL_BUFFER 0x8224
+#define GL_COMPRESSED_RED 0x8225
+#define GL_COMPRESSED_RG 0x8226
+#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001
+#define GL_RGBA32F 0x8814
+#define GL_RGB32F 0x8815
+#define GL_RGBA16F 0x881A
+#define GL_RGB16F 0x881B
+#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD
+#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF
+#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904
+#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905
+#define GL_CLAMP_READ_COLOR 0x891C
+#define GL_FIXED_ONLY 0x891D
+#define GL_MAX_VARYING_COMPONENTS 0x8B4B
+#define GL_TEXTURE_1D_ARRAY 0x8C18
+#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19
+#define GL_TEXTURE_2D_ARRAY 0x8C1A
+#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B
+#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C
+#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D
+#define GL_R11F_G11F_B10F 0x8C3A
+#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B
+#define GL_RGB9_E5 0x8C3D
+#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E
+#define GL_TEXTURE_SHARED_SIZE 0x8C3F
+#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76
+#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F
+#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80
+#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83
+#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84
+#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85
+#define GL_PRIMITIVES_GENERATED 0x8C87
+#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88
+#define GL_RASTERIZER_DISCARD 0x8C89
+#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A
+#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B
+#define GL_INTERLEAVED_ATTRIBS 0x8C8C
+#define GL_SEPARATE_ATTRIBS 0x8C8D
+#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E
+#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F
+#define GL_RGBA32UI 0x8D70
+#define GL_RGB32UI 0x8D71
+#define GL_RGBA16UI 0x8D76
+#define GL_RGB16UI 0x8D77
+#define GL_RGBA8UI 0x8D7C
+#define GL_RGB8UI 0x8D7D
+#define GL_RGBA32I 0x8D82
+#define GL_RGB32I 0x8D83
+#define GL_RGBA16I 0x8D88
+#define GL_RGB16I 0x8D89
+#define GL_RGBA8I 0x8D8E
+#define GL_RGB8I 0x8D8F
+#define GL_RED_INTEGER 0x8D94
+#define GL_GREEN_INTEGER 0x8D95
+#define GL_BLUE_INTEGER 0x8D96
+#define GL_RGB_INTEGER 0x8D98
+#define GL_RGBA_INTEGER 0x8D99
+#define GL_BGR_INTEGER 0x8D9A
+#define GL_BGRA_INTEGER 0x8D9B
+#define GL_SAMPLER_1D_ARRAY 0x8DC0
+#define GL_SAMPLER_2D_ARRAY 0x8DC1
+#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3
+#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4
+#define GL_SAMPLER_CUBE_SHADOW 0x8DC5
+#define GL_UNSIGNED_INT_VEC2 0x8DC6
+#define GL_UNSIGNED_INT_VEC3 0x8DC7
+#define GL_UNSIGNED_INT_VEC4 0x8DC8
+#define GL_INT_SAMPLER_1D 0x8DC9
+#define GL_INT_SAMPLER_2D 0x8DCA
+#define GL_INT_SAMPLER_3D 0x8DCB
+#define GL_INT_SAMPLER_CUBE 0x8DCC
+#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE
+#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF
+#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1
+#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2
+#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3
+#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4
+#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6
+#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7
+#define GL_QUERY_WAIT 0x8E13
+#define GL_QUERY_NO_WAIT 0x8E14
+#define GL_QUERY_BY_REGION_WAIT 0x8E15
+#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16
+#define GL_BUFFER_ACCESS_FLAGS 0x911F
+#define GL_BUFFER_MAP_LENGTH 0x9120
+#define GL_BUFFER_MAP_OFFSET 0x9121
+/* Reuse tokens from ARB_depth_buffer_float */
+/* reuse GL_DEPTH_COMPONENT32F */
+/* reuse GL_DEPTH32F_STENCIL8 */
+/* reuse GL_FLOAT_32_UNSIGNED_INT_24_8_REV */
+/* Reuse tokens from ARB_framebuffer_object */
+/* reuse GL_INVALID_FRAMEBUFFER_OPERATION */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */
+/* reuse GL_FRAMEBUFFER_DEFAULT */
+/* reuse GL_FRAMEBUFFER_UNDEFINED */
+/* reuse GL_DEPTH_STENCIL_ATTACHMENT */
+/* reuse GL_INDEX */
+/* reuse GL_MAX_RENDERBUFFER_SIZE */
+/* reuse GL_DEPTH_STENCIL */
+/* reuse GL_UNSIGNED_INT_24_8 */
+/* reuse GL_DEPTH24_STENCIL8 */
+/* reuse GL_TEXTURE_STENCIL_SIZE */
+/* reuse GL_TEXTURE_RED_TYPE */
+/* reuse GL_TEXTURE_GREEN_TYPE */
+/* reuse GL_TEXTURE_BLUE_TYPE */
+/* reuse GL_TEXTURE_ALPHA_TYPE */
+/* reuse GL_TEXTURE_DEPTH_TYPE */
+/* reuse GL_UNSIGNED_NORMALIZED */
+/* reuse GL_FRAMEBUFFER_BINDING */
+/* reuse GL_DRAW_FRAMEBUFFER_BINDING */
+/* reuse GL_RENDERBUFFER_BINDING */
+/* reuse GL_READ_FRAMEBUFFER */
+/* reuse GL_DRAW_FRAMEBUFFER */
+/* reuse GL_READ_FRAMEBUFFER_BINDING */
+/* reuse GL_RENDERBUFFER_SAMPLES */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */
+/* reuse GL_FRAMEBUFFER_COMPLETE */
+/* reuse GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */
+/* reuse GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */
+/* reuse GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER */
+/* reuse GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER */
+/* reuse GL_FRAMEBUFFER_UNSUPPORTED */
+/* reuse GL_MAX_COLOR_ATTACHMENTS */
+/* reuse GL_COLOR_ATTACHMENT0 */
+/* reuse GL_COLOR_ATTACHMENT1 */
+/* reuse GL_COLOR_ATTACHMENT2 */
+/* reuse GL_COLOR_ATTACHMENT3 */
+/* reuse GL_COLOR_ATTACHMENT4 */
+/* reuse GL_COLOR_ATTACHMENT5 */
+/* reuse GL_COLOR_ATTACHMENT6 */
+/* reuse GL_COLOR_ATTACHMENT7 */
+/* reuse GL_COLOR_ATTACHMENT8 */
+/* reuse GL_COLOR_ATTACHMENT9 */
+/* reuse GL_COLOR_ATTACHMENT10 */
+/* reuse GL_COLOR_ATTACHMENT11 */
+/* reuse GL_COLOR_ATTACHMENT12 */
+/* reuse GL_COLOR_ATTACHMENT13 */
+/* reuse GL_COLOR_ATTACHMENT14 */
+/* reuse GL_COLOR_ATTACHMENT15 */
+/* reuse GL_DEPTH_ATTACHMENT */
+/* reuse GL_STENCIL_ATTACHMENT */
+/* reuse GL_FRAMEBUFFER */
+/* reuse GL_RENDERBUFFER */
+/* reuse GL_RENDERBUFFER_WIDTH */
+/* reuse GL_RENDERBUFFER_HEIGHT */
+/* reuse GL_RENDERBUFFER_INTERNAL_FORMAT */
+/* reuse GL_STENCIL_INDEX1 */
+/* reuse GL_STENCIL_INDEX4 */
+/* reuse GL_STENCIL_INDEX8 */
+/* reuse GL_STENCIL_INDEX16 */
+/* reuse GL_RENDERBUFFER_RED_SIZE */
+/* reuse GL_RENDERBUFFER_GREEN_SIZE */
+/* reuse GL_RENDERBUFFER_BLUE_SIZE */
+/* reuse GL_RENDERBUFFER_ALPHA_SIZE */
+/* reuse GL_RENDERBUFFER_DEPTH_SIZE */
+/* reuse GL_RENDERBUFFER_STENCIL_SIZE */
+/* reuse GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */
+/* reuse GL_MAX_SAMPLES */
+/* Reuse tokens from ARB_framebuffer_sRGB */
+/* reuse GL_FRAMEBUFFER_SRGB */
+/* Reuse tokens from ARB_half_float_vertex */
+/* reuse GL_HALF_FLOAT */
+/* Reuse tokens from ARB_map_buffer_range */
+/* reuse GL_MAP_READ_BIT */
+/* reuse GL_MAP_WRITE_BIT */
+/* reuse GL_MAP_INVALIDATE_RANGE_BIT */
+/* reuse GL_MAP_INVALIDATE_BUFFER_BIT */
+/* reuse GL_MAP_FLUSH_EXPLICIT_BIT */
+/* reuse GL_MAP_UNSYNCHRONIZED_BIT */
+/* Reuse tokens from ARB_texture_compression_rgtc */
+/* reuse GL_COMPRESSED_RED_RGTC1 */
+/* reuse GL_COMPRESSED_SIGNED_RED_RGTC1 */
+/* reuse GL_COMPRESSED_RG_RGTC2 */
+/* reuse GL_COMPRESSED_SIGNED_RG_RGTC2 */
+/* Reuse tokens from ARB_texture_rg */
+/* reuse GL_RG */
+/* reuse GL_RG_INTEGER */
+/* reuse GL_R8 */
+/* reuse GL_R16 */
+/* reuse GL_RG8 */
+/* reuse GL_RG16 */
+/* reuse GL_R16F */
+/* reuse GL_R32F */
+/* reuse GL_RG16F */
+/* reuse GL_RG32F */
+/* reuse GL_R8I */
+/* reuse GL_R8UI */
+/* reuse GL_R16I */
+/* reuse GL_R16UI */
+/* reuse GL_R32I */
+/* reuse GL_R32UI */
+/* reuse GL_RG8I */
+/* reuse GL_RG8UI */
+/* reuse GL_RG16I */
+/* reuse GL_RG16UI */
+/* reuse GL_RG32I */
+/* reuse GL_RG32UI */
+/* Reuse tokens from ARB_vertex_array_object */
+/* reuse GL_VERTEX_ARRAY_BINDING */
+#endif
+
+#ifndef GL_VERSION_3_0_DEPRECATED
+#define GL_CLAMP_VERTEX_COLOR 0x891A
+#define GL_CLAMP_FRAGMENT_COLOR 0x891B
+#define GL_ALPHA_INTEGER 0x8D97
+/* Reuse tokens from ARB_framebuffer_object */
+/* reuse GL_TEXTURE_LUMINANCE_TYPE */
+/* reuse GL_TEXTURE_INTENSITY_TYPE */
+#endif
+
+#ifndef GL_VERSION_3_1
+#define GL_SAMPLER_2D_RECT 0x8B63
+#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64
+#define GL_SAMPLER_BUFFER 0x8DC2
+#define GL_INT_SAMPLER_2D_RECT 0x8DCD
+#define GL_INT_SAMPLER_BUFFER 0x8DD0
+#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5
+#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8
+#define GL_TEXTURE_BUFFER 0x8C2A
+#define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B
+#define GL_TEXTURE_BINDING_BUFFER 0x8C2C
+#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D
+#define GL_TEXTURE_BUFFER_FORMAT 0x8C2E
+#define GL_TEXTURE_RECTANGLE 0x84F5
+#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6
+#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7
+#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8
+#define GL_RED_SNORM 0x8F90
+#define GL_RG_SNORM 0x8F91
+#define GL_RGB_SNORM 0x8F92
+#define GL_RGBA_SNORM 0x8F93
+#define GL_R8_SNORM 0x8F94
+#define GL_RG8_SNORM 0x8F95
+#define GL_RGB8_SNORM 0x8F96
+#define GL_RGBA8_SNORM 0x8F97
+#define GL_R16_SNORM 0x8F98
+#define GL_RG16_SNORM 0x8F99
+#define GL_RGB16_SNORM 0x8F9A
+#define GL_RGBA16_SNORM 0x8F9B
+#define GL_SIGNED_NORMALIZED 0x8F9C
+#define GL_PRIMITIVE_RESTART 0x8F9D
+#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E
+/* Reuse tokens from ARB_copy_buffer */
+/* reuse GL_COPY_READ_BUFFER */
+/* reuse GL_COPY_WRITE_BUFFER */
+/* Reuse tokens from ARB_draw_instanced (none) */
+/* Reuse tokens from ARB_uniform_buffer_object */
+/* reuse GL_UNIFORM_BUFFER */
+/* reuse GL_UNIFORM_BUFFER_BINDING */
+/* reuse GL_UNIFORM_BUFFER_START */
+/* reuse GL_UNIFORM_BUFFER_SIZE */
+/* reuse GL_MAX_VERTEX_UNIFORM_BLOCKS */
+/* reuse GL_MAX_FRAGMENT_UNIFORM_BLOCKS */
+/* reuse GL_MAX_COMBINED_UNIFORM_BLOCKS */
+/* reuse GL_MAX_UNIFORM_BUFFER_BINDINGS */
+/* reuse GL_MAX_UNIFORM_BLOCK_SIZE */
+/* reuse GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS */
+/* reuse GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS */
+/* reuse GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT */
+/* reuse GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH */
+/* reuse GL_ACTIVE_UNIFORM_BLOCKS */
+/* reuse GL_UNIFORM_TYPE */
+/* reuse GL_UNIFORM_SIZE */
+/* reuse GL_UNIFORM_NAME_LENGTH */
+/* reuse GL_UNIFORM_BLOCK_INDEX */
+/* reuse GL_UNIFORM_OFFSET */
+/* reuse GL_UNIFORM_ARRAY_STRIDE */
+/* reuse GL_UNIFORM_MATRIX_STRIDE */
+/* reuse GL_UNIFORM_IS_ROW_MAJOR */
+/* reuse GL_UNIFORM_BLOCK_BINDING */
+/* reuse GL_UNIFORM_BLOCK_DATA_SIZE */
+/* reuse GL_UNIFORM_BLOCK_NAME_LENGTH */
+/* reuse GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS */
+/* reuse GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES */
+/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER */
+/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER */
+/* reuse GL_INVALID_INDEX */
+#endif
+
+#ifndef GL_VERSION_3_2
+#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001
+#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002
+#define GL_LINES_ADJACENCY 0x000A
+#define GL_LINE_STRIP_ADJACENCY 0x000B
+#define GL_TRIANGLES_ADJACENCY 0x000C
+#define GL_TRIANGLE_STRIP_ADJACENCY 0x000D
+#define GL_PROGRAM_POINT_SIZE 0x8642
+#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29
+#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7
+#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8
+#define GL_GEOMETRY_SHADER 0x8DD9
+#define GL_GEOMETRY_VERTICES_OUT 0x8916
+#define GL_GEOMETRY_INPUT_TYPE 0x8917
+#define GL_GEOMETRY_OUTPUT_TYPE 0x8918
+#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF
+#define GL_MAX_GEOMETRY_OUTPUT_VERTICES 0x8DE0
+#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1
+#define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122
+#define GL_MAX_GEOMETRY_INPUT_COMPONENTS 0x9123
+#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124
+#define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125
+#define GL_CONTEXT_PROFILE_MASK 0x9126
+/* reuse GL_MAX_VARYING_COMPONENTS */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */
+/* Reuse tokens from ARB_depth_clamp */
+/* reuse GL_DEPTH_CLAMP */
+/* Reuse tokens from ARB_draw_elements_base_vertex (none) */
+/* Reuse tokens from ARB_fragment_coord_conventions (none) */
+/* Reuse tokens from ARB_provoking_vertex */
+/* reuse GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION */
+/* reuse GL_FIRST_VERTEX_CONVENTION */
+/* reuse GL_LAST_VERTEX_CONVENTION */
+/* reuse GL_PROVOKING_VERTEX */
+/* Reuse tokens from ARB_seamless_cube_map */
+/* reuse GL_TEXTURE_CUBE_MAP_SEAMLESS */
+/* Reuse tokens from ARB_sync */
+/* reuse GL_MAX_SERVER_WAIT_TIMEOUT */
+/* reuse GL_OBJECT_TYPE */
+/* reuse GL_SYNC_CONDITION */
+/* reuse GL_SYNC_STATUS */
+/* reuse GL_SYNC_FLAGS */
+/* reuse GL_SYNC_FENCE */
+/* reuse GL_SYNC_GPU_COMMANDS_COMPLETE */
+/* reuse GL_UNSIGNALED */
+/* reuse GL_SIGNALED */
+/* reuse GL_ALREADY_SIGNALED */
+/* reuse GL_TIMEOUT_EXPIRED */
+/* reuse GL_CONDITION_SATISFIED */
+/* reuse GL_WAIT_FAILED */
+/* reuse GL_TIMEOUT_IGNORED */
+/* reuse GL_SYNC_FLUSH_COMMANDS_BIT */
+/* reuse GL_TIMEOUT_IGNORED */
+/* Reuse tokens from ARB_texture_multisample */
+/* reuse GL_SAMPLE_POSITION */
+/* reuse GL_SAMPLE_MASK */
+/* reuse GL_SAMPLE_MASK_VALUE */
+/* reuse GL_MAX_SAMPLE_MASK_WORDS */
+/* reuse GL_TEXTURE_2D_MULTISAMPLE */
+/* reuse GL_PROXY_TEXTURE_2D_MULTISAMPLE */
+/* reuse GL_TEXTURE_2D_MULTISAMPLE_ARRAY */
+/* reuse GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY */
+/* reuse GL_TEXTURE_BINDING_2D_MULTISAMPLE */
+/* reuse GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY */
+/* reuse GL_TEXTURE_SAMPLES */
+/* reuse GL_TEXTURE_FIXED_SAMPLE_LOCATIONS */
+/* reuse GL_SAMPLER_2D_MULTISAMPLE */
+/* reuse GL_INT_SAMPLER_2D_MULTISAMPLE */
+/* reuse GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE */
+/* reuse GL_SAMPLER_2D_MULTISAMPLE_ARRAY */
+/* reuse GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY */
+/* reuse GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY */
+/* reuse GL_MAX_COLOR_TEXTURE_SAMPLES */
+/* reuse GL_MAX_DEPTH_TEXTURE_SAMPLES */
+/* reuse GL_MAX_INTEGER_SAMPLES */
+/* Don't need to reuse tokens from ARB_vertex_array_bgra since they're already in 1.2 core */
+#endif
+
+#ifndef GL_VERSION_3_3
+#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE
+/* Reuse tokens from ARB_blend_func_extended */
+/* reuse GL_SRC1_COLOR */
+/* reuse GL_ONE_MINUS_SRC1_COLOR */
+/* reuse GL_ONE_MINUS_SRC1_ALPHA */
+/* reuse GL_MAX_DUAL_SOURCE_DRAW_BUFFERS */
+/* Reuse tokens from ARB_explicit_attrib_location (none) */
+/* Reuse tokens from ARB_occlusion_query2 */
+/* reuse GL_ANY_SAMPLES_PASSED */
+/* Reuse tokens from ARB_sampler_objects */
+/* reuse GL_SAMPLER_BINDING */
+/* Reuse tokens from ARB_shader_bit_encoding (none) */
+/* Reuse tokens from ARB_texture_rgb10_a2ui */
+/* reuse GL_RGB10_A2UI */
+/* Reuse tokens from ARB_texture_swizzle */
+/* reuse GL_TEXTURE_SWIZZLE_R */
+/* reuse GL_TEXTURE_SWIZZLE_G */
+/* reuse GL_TEXTURE_SWIZZLE_B */
+/* reuse GL_TEXTURE_SWIZZLE_A */
+/* reuse GL_TEXTURE_SWIZZLE_RGBA */
+/* Reuse tokens from ARB_timer_query */
+/* reuse GL_TIME_ELAPSED */
+/* reuse GL_TIMESTAMP */
+/* Reuse tokens from ARB_vertex_type_2_10_10_10_rev */
+/* reuse GL_INT_2_10_10_10_REV */
+#endif
+
+#ifndef GL_VERSION_4_0
+#define GL_SAMPLE_SHADING 0x8C36
+#define GL_MIN_SAMPLE_SHADING_VALUE 0x8C37
+#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5E
+#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5F
+#define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009
+#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY 0x900A
+#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY 0x900B
+#define GL_SAMPLER_CUBE_MAP_ARRAY 0x900C
+#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW 0x900D
+#define GL_INT_SAMPLER_CUBE_MAP_ARRAY 0x900E
+#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F
+/* Reuse tokens from ARB_texture_query_lod (none) */
+/* Reuse tokens from ARB_draw_buffers_blend (none) */
+/* Reuse tokens from ARB_draw_indirect */
+/* reuse GL_DRAW_INDIRECT_BUFFER */
+/* reuse GL_DRAW_INDIRECT_BUFFER_BINDING */
+/* Reuse tokens from ARB_gpu_shader5 */
+/* reuse GL_GEOMETRY_SHADER_INVOCATIONS */
+/* reuse GL_MAX_GEOMETRY_SHADER_INVOCATIONS */
+/* reuse GL_MIN_FRAGMENT_INTERPOLATION_OFFSET */
+/* reuse GL_MAX_FRAGMENT_INTERPOLATION_OFFSET */
+/* reuse GL_FRAGMENT_INTERPOLATION_OFFSET_BITS */
+/* reuse GL_MAX_VERTEX_STREAMS */
+/* Reuse tokens from ARB_gpu_shader_fp64 */
+/* reuse GL_DOUBLE_VEC2 */
+/* reuse GL_DOUBLE_VEC3 */
+/* reuse GL_DOUBLE_VEC4 */
+/* reuse GL_DOUBLE_MAT2 */
+/* reuse GL_DOUBLE_MAT3 */
+/* reuse GL_DOUBLE_MAT4 */
+/* reuse GL_DOUBLE_MAT2x3 */
+/* reuse GL_DOUBLE_MAT2x4 */
+/* reuse GL_DOUBLE_MAT3x2 */
+/* reuse GL_DOUBLE_MAT3x4 */
+/* reuse GL_DOUBLE_MAT4x2 */
+/* reuse GL_DOUBLE_MAT4x3 */
+/* Reuse tokens from ARB_shader_subroutine */
+/* reuse GL_ACTIVE_SUBROUTINES */
+/* reuse GL_ACTIVE_SUBROUTINE_UNIFORMS */
+/* reuse GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS */
+/* reuse GL_ACTIVE_SUBROUTINE_MAX_LENGTH */
+/* reuse GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH */
+/* reuse GL_MAX_SUBROUTINES */
+/* reuse GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS */
+/* reuse GL_NUM_COMPATIBLE_SUBROUTINES */
+/* reuse GL_COMPATIBLE_SUBROUTINES */
+/* Reuse tokens from ARB_tessellation_shader */
+/* reuse GL_PATCHES */
+/* reuse GL_PATCH_VERTICES */
+/* reuse GL_PATCH_DEFAULT_INNER_LEVEL */
+/* reuse GL_PATCH_DEFAULT_OUTER_LEVEL */
+/* reuse GL_TESS_CONTROL_OUTPUT_VERTICES */
+/* reuse GL_TESS_GEN_MODE */
+/* reuse GL_TESS_GEN_SPACING */
+/* reuse GL_TESS_GEN_VERTEX_ORDER */
+/* reuse GL_TESS_GEN_POINT_MODE */
+/* reuse GL_ISOLINES */
+/* reuse GL_FRACTIONAL_ODD */
+/* reuse GL_FRACTIONAL_EVEN */
+/* reuse GL_MAX_PATCH_VERTICES */
+/* reuse GL_MAX_TESS_GEN_LEVEL */
+/* reuse GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS */
+/* reuse GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS */
+/* reuse GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS */
+/* reuse GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS */
+/* reuse GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS */
+/* reuse GL_MAX_TESS_PATCH_COMPONENTS */
+/* reuse GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS */
+/* reuse GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS */
+/* reuse GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS */
+/* reuse GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS */
+/* reuse GL_MAX_TESS_CONTROL_INPUT_COMPONENTS */
+/* reuse GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS */
+/* reuse GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS */
+/* reuse GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS */
+/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER */
+/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER */
+/* reuse GL_TESS_EVALUATION_SHADER */
+/* reuse GL_TESS_CONTROL_SHADER */
+/* Reuse tokens from ARB_texture_buffer_object_rgb32 (none) */
+/* Reuse tokens from ARB_transform_feedback2 */
+/* reuse GL_TRANSFORM_FEEDBACK */
+/* reuse GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED */
+/* reuse GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE */
+/* reuse GL_TRANSFORM_FEEDBACK_BINDING */
+/* Reuse tokens from ARB_transform_feedback3 */
+/* reuse GL_MAX_TRANSFORM_FEEDBACK_BUFFERS */
+/* reuse GL_MAX_VERTEX_STREAMS */
+#endif
+
+#ifndef GL_VERSION_4_1
+/* Reuse tokens from ARB_ES2_compatibility */
+/* reuse GL_FIXED */
+/* reuse GL_IMPLEMENTATION_COLOR_READ_TYPE */
+/* reuse GL_IMPLEMENTATION_COLOR_READ_FORMAT */
+/* reuse GL_LOW_FLOAT */
+/* reuse GL_MEDIUM_FLOAT */
+/* reuse GL_HIGH_FLOAT */
+/* reuse GL_LOW_INT */
+/* reuse GL_MEDIUM_INT */
+/* reuse GL_HIGH_INT */
+/* reuse GL_SHADER_COMPILER */
+/* reuse GL_NUM_SHADER_BINARY_FORMATS */
+/* reuse GL_MAX_VERTEX_UNIFORM_VECTORS */
+/* reuse GL_MAX_VARYING_VECTORS */
+/* reuse GL_MAX_FRAGMENT_UNIFORM_VECTORS */
+/* Reuse tokens from ARB_get_program_binary */
+/* reuse GL_PROGRAM_BINARY_RETRIEVABLE_HINT */
+/* reuse GL_PROGRAM_BINARY_LENGTH */
+/* reuse GL_NUM_PROGRAM_BINARY_FORMATS */
+/* reuse GL_PROGRAM_BINARY_FORMATS */
+/* Reuse tokens from ARB_separate_shader_objects */
+/* reuse GL_VERTEX_SHADER_BIT */
+/* reuse GL_FRAGMENT_SHADER_BIT */
+/* reuse GL_GEOMETRY_SHADER_BIT */
+/* reuse GL_TESS_CONTROL_SHADER_BIT */
+/* reuse GL_TESS_EVALUATION_SHADER_BIT */
+/* reuse GL_ALL_SHADER_BITS */
+/* reuse GL_PROGRAM_SEPARABLE */
+/* reuse GL_ACTIVE_PROGRAM */
+/* reuse GL_PROGRAM_PIPELINE_BINDING */
+/* Reuse tokens from ARB_shader_precision (none) */
+/* Reuse tokens from ARB_vertex_attrib_64bit - all are in GL 3.0 and 4.0 already */
+/* Reuse tokens from ARB_viewport_array - some are in GL 1.1 and ARB_provoking_vertex already */
+/* reuse GL_MAX_VIEWPORTS */
+/* reuse GL_VIEWPORT_SUBPIXEL_BITS */
+/* reuse GL_VIEWPORT_BOUNDS_RANGE */
+/* reuse GL_LAYER_PROVOKING_VERTEX */
+/* reuse GL_VIEWPORT_INDEX_PROVOKING_VERTEX */
+/* reuse GL_UNDEFINED_VERTEX */
+#endif
+
+#ifndef GL_VERSION_4_2
+/* Reuse tokens from ARB_base_instance (none) */
+/* Reuse tokens from ARB_shading_language_420pack (none) */
+/* Reuse tokens from ARB_transform_feedback_instanced (none) */
+/* Reuse tokens from ARB_compressed_texture_pixel_storage */
+/* reuse GL_UNPACK_COMPRESSED_BLOCK_WIDTH */
+/* reuse GL_UNPACK_COMPRESSED_BLOCK_HEIGHT */
+/* reuse GL_UNPACK_COMPRESSED_BLOCK_DEPTH */
+/* reuse GL_UNPACK_COMPRESSED_BLOCK_SIZE */
+/* reuse GL_PACK_COMPRESSED_BLOCK_WIDTH */
+/* reuse GL_PACK_COMPRESSED_BLOCK_HEIGHT */
+/* reuse GL_PACK_COMPRESSED_BLOCK_DEPTH */
+/* reuse GL_PACK_COMPRESSED_BLOCK_SIZE */
+/* Reuse tokens from ARB_conservative_depth (none) */
+/* Reuse tokens from ARB_internalformat_query */
+/* reuse GL_NUM_SAMPLE_COUNTS */
+/* Reuse tokens from ARB_map_buffer_alignment */
+/* reuse GL_MIN_MAP_BUFFER_ALIGNMENT */
+/* Reuse tokens from ARB_shader_atomic_counters */
+/* reuse GL_ATOMIC_COUNTER_BUFFER */
+/* reuse GL_ATOMIC_COUNTER_BUFFER_BINDING */
+/* reuse GL_ATOMIC_COUNTER_BUFFER_START */
+/* reuse GL_ATOMIC_COUNTER_BUFFER_SIZE */
+/* reuse GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE */
+/* reuse GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS */
+/* reuse GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES */
+/* reuse GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER */
+/* reuse GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER */
+/* reuse GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER */
+/* reuse GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER */
+/* reuse GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER */
+/* reuse GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS */
+/* reuse GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS */
+/* reuse GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS */
+/* reuse GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS */
+/* reuse GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS */
+/* reuse GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS */
+/* reuse GL_MAX_VERTEX_ATOMIC_COUNTERS */
+/* reuse GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS */
+/* reuse GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS */
+/* reuse GL_MAX_GEOMETRY_ATOMIC_COUNTERS */
+/* reuse GL_MAX_FRAGMENT_ATOMIC_COUNTERS */
+/* reuse GL_MAX_COMBINED_ATOMIC_COUNTERS */
+/* reuse GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE */
+/* reuse GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS */
+/* reuse GL_ACTIVE_ATOMIC_COUNTER_BUFFERS */
+/* reuse GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX */
+/* reuse GL_UNSIGNED_INT_ATOMIC_COUNTER */
+/* Reuse tokens from ARB_shader_image_load_store */
+/* reuse GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT */
+/* reuse GL_ELEMENT_ARRAY_BARRIER_BIT */
+/* reuse GL_UNIFORM_BARRIER_BIT */
+/* reuse GL_TEXTURE_FETCH_BARRIER_BIT */
+/* reuse GL_SHADER_IMAGE_ACCESS_BARRIER_BIT */
+/* reuse GL_COMMAND_BARRIER_BIT */
+/* reuse GL_PIXEL_BUFFER_BARRIER_BIT */
+/* reuse GL_TEXTURE_UPDATE_BARRIER_BIT */
+/* reuse GL_BUFFER_UPDATE_BARRIER_BIT */
+/* reuse GL_FRAMEBUFFER_BARRIER_BIT */
+/* reuse GL_TRANSFORM_FEEDBACK_BARRIER_BIT */
+/* reuse GL_ATOMIC_COUNTER_BARRIER_BIT */
+/* reuse GL_ALL_BARRIER_BITS */
+/* reuse GL_MAX_IMAGE_UNITS */
+/* reuse GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS */
+/* reuse GL_IMAGE_BINDING_NAME */
+/* reuse GL_IMAGE_BINDING_LEVEL */
+/* reuse GL_IMAGE_BINDING_LAYERED */
+/* reuse GL_IMAGE_BINDING_LAYER */
+/* reuse GL_IMAGE_BINDING_ACCESS */
+/* reuse GL_IMAGE_1D */
+/* reuse GL_IMAGE_2D */
+/* reuse GL_IMAGE_3D */
+/* reuse GL_IMAGE_2D_RECT */
+/* reuse GL_IMAGE_CUBE */
+/* reuse GL_IMAGE_BUFFER */
+/* reuse GL_IMAGE_1D_ARRAY */
+/* reuse GL_IMAGE_2D_ARRAY */
+/* reuse GL_IMAGE_CUBE_MAP_ARRAY */
+/* reuse GL_IMAGE_2D_MULTISAMPLE */
+/* reuse GL_IMAGE_2D_MULTISAMPLE_ARRAY */
+/* reuse GL_INT_IMAGE_1D */
+/* reuse GL_INT_IMAGE_2D */
+/* reuse GL_INT_IMAGE_3D */
+/* reuse GL_INT_IMAGE_2D_RECT */
+/* reuse GL_INT_IMAGE_CUBE */
+/* reuse GL_INT_IMAGE_BUFFER */
+/* reuse GL_INT_IMAGE_1D_ARRAY */
+/* reuse GL_INT_IMAGE_2D_ARRAY */
+/* reuse GL_INT_IMAGE_CUBE_MAP_ARRAY */
+/* reuse GL_INT_IMAGE_2D_MULTISAMPLE */
+/* reuse GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY */
+/* reuse GL_UNSIGNED_INT_IMAGE_1D */
+/* reuse GL_UNSIGNED_INT_IMAGE_2D */
+/* reuse GL_UNSIGNED_INT_IMAGE_3D */
+/* reuse GL_UNSIGNED_INT_IMAGE_2D_RECT */
+/* reuse GL_UNSIGNED_INT_IMAGE_CUBE */
+/* reuse GL_UNSIGNED_INT_IMAGE_BUFFER */
+/* reuse GL_UNSIGNED_INT_IMAGE_1D_ARRAY */
+/* reuse GL_UNSIGNED_INT_IMAGE_2D_ARRAY */
+/* reuse GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY */
+/* reuse GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE */
+/* reuse GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY */
+/* reuse GL_MAX_IMAGE_SAMPLES */
+/* reuse GL_IMAGE_BINDING_FORMAT */
+/* reuse GL_IMAGE_FORMAT_COMPATIBILITY_TYPE */
+/* reuse GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE */
+/* reuse GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS */
+/* reuse GL_MAX_VERTEX_IMAGE_UNIFORMS */
+/* reuse GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS */
+/* reuse GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS */
+/* reuse GL_MAX_GEOMETRY_IMAGE_UNIFORMS */
+/* reuse GL_MAX_FRAGMENT_IMAGE_UNIFORMS */
+/* reuse GL_MAX_COMBINED_IMAGE_UNIFORMS */
+/* Reuse tokens from ARB_shading_language_packing (none) */
+/* Reuse tokens from ARB_texture_storage */
+/* reuse GL_TEXTURE_IMMUTABLE_FORMAT */
+#endif
+
+#ifndef GL_ARB_multitexture
+#define GL_TEXTURE0_ARB 0x84C0
+#define GL_TEXTURE1_ARB 0x84C1
+#define GL_TEXTURE2_ARB 0x84C2
+#define GL_TEXTURE3_ARB 0x84C3
+#define GL_TEXTURE4_ARB 0x84C4
+#define GL_TEXTURE5_ARB 0x84C5
+#define GL_TEXTURE6_ARB 0x84C6
+#define GL_TEXTURE7_ARB 0x84C7
+#define GL_TEXTURE8_ARB 0x84C8
+#define GL_TEXTURE9_ARB 0x84C9
+#define GL_TEXTURE10_ARB 0x84CA
+#define GL_TEXTURE11_ARB 0x84CB
+#define GL_TEXTURE12_ARB 0x84CC
+#define GL_TEXTURE13_ARB 0x84CD
+#define GL_TEXTURE14_ARB 0x84CE
+#define GL_TEXTURE15_ARB 0x84CF
+#define GL_TEXTURE16_ARB 0x84D0
+#define GL_TEXTURE17_ARB 0x84D1
+#define GL_TEXTURE18_ARB 0x84D2
+#define GL_TEXTURE19_ARB 0x84D3
+#define GL_TEXTURE20_ARB 0x84D4
+#define GL_TEXTURE21_ARB 0x84D5
+#define GL_TEXTURE22_ARB 0x84D6
+#define GL_TEXTURE23_ARB 0x84D7
+#define GL_TEXTURE24_ARB 0x84D8
+#define GL_TEXTURE25_ARB 0x84D9
+#define GL_TEXTURE26_ARB 0x84DA
+#define GL_TEXTURE27_ARB 0x84DB
+#define GL_TEXTURE28_ARB 0x84DC
+#define GL_TEXTURE29_ARB 0x84DD
+#define GL_TEXTURE30_ARB 0x84DE
+#define GL_TEXTURE31_ARB 0x84DF
+#define GL_ACTIVE_TEXTURE_ARB 0x84E0
+#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1
+#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2
+#endif
+
+#ifndef GL_ARB_transpose_matrix
+#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3
+#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4
+#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5
+#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6
+#endif
+
+#ifndef GL_ARB_multisample
+#define GL_MULTISAMPLE_ARB 0x809D
+#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F
+#define GL_SAMPLE_COVERAGE_ARB 0x80A0
+#define GL_SAMPLE_BUFFERS_ARB 0x80A8
+#define GL_SAMPLES_ARB 0x80A9
+#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA
+#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB
+#define GL_MULTISAMPLE_BIT_ARB 0x20000000
+#endif
+
+#ifndef GL_ARB_texture_env_add
+#endif
+
+#ifndef GL_ARB_texture_cube_map
+#define GL_NORMAL_MAP_ARB 0x8511
+#define GL_REFLECTION_MAP_ARB 0x8512
+#define GL_TEXTURE_CUBE_MAP_ARB 0x8513
+#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A
+#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C
+#endif
+
+#ifndef GL_ARB_texture_compression
+#define GL_COMPRESSED_ALPHA_ARB 0x84E9
+#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA
+#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB
+#define GL_COMPRESSED_INTENSITY_ARB 0x84EC
+#define GL_COMPRESSED_RGB_ARB 0x84ED
+#define GL_COMPRESSED_RGBA_ARB 0x84EE
+#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF
+#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0
+#define GL_TEXTURE_COMPRESSED_ARB 0x86A1
+#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2
+#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3
+#endif
+
+#ifndef GL_ARB_texture_border_clamp
+#define GL_CLAMP_TO_BORDER_ARB 0x812D
+#endif
+
+#ifndef GL_ARB_point_parameters
+#define GL_POINT_SIZE_MIN_ARB 0x8126
+#define GL_POINT_SIZE_MAX_ARB 0x8127
+#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128
+#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129
+#endif
+
+#ifndef GL_ARB_vertex_blend
+#define GL_MAX_VERTEX_UNITS_ARB 0x86A4
+#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5
+#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6
+#define GL_VERTEX_BLEND_ARB 0x86A7
+#define GL_CURRENT_WEIGHT_ARB 0x86A8
+#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9
+#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA
+#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB
+#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC
+#define GL_WEIGHT_ARRAY_ARB 0x86AD
+#define GL_MODELVIEW0_ARB 0x1700
+#define GL_MODELVIEW1_ARB 0x850A
+#define GL_MODELVIEW2_ARB 0x8722
+#define GL_MODELVIEW3_ARB 0x8723
+#define GL_MODELVIEW4_ARB 0x8724
+#define GL_MODELVIEW5_ARB 0x8725
+#define GL_MODELVIEW6_ARB 0x8726
+#define GL_MODELVIEW7_ARB 0x8727
+#define GL_MODELVIEW8_ARB 0x8728
+#define GL_MODELVIEW9_ARB 0x8729
+#define GL_MODELVIEW10_ARB 0x872A
+#define GL_MODELVIEW11_ARB 0x872B
+#define GL_MODELVIEW12_ARB 0x872C
+#define GL_MODELVIEW13_ARB 0x872D
+#define GL_MODELVIEW14_ARB 0x872E
+#define GL_MODELVIEW15_ARB 0x872F
+#define GL_MODELVIEW16_ARB 0x8730
+#define GL_MODELVIEW17_ARB 0x8731
+#define GL_MODELVIEW18_ARB 0x8732
+#define GL_MODELVIEW19_ARB 0x8733
+#define GL_MODELVIEW20_ARB 0x8734
+#define GL_MODELVIEW21_ARB 0x8735
+#define GL_MODELVIEW22_ARB 0x8736
+#define GL_MODELVIEW23_ARB 0x8737
+#define GL_MODELVIEW24_ARB 0x8738
+#define GL_MODELVIEW25_ARB 0x8739
+#define GL_MODELVIEW26_ARB 0x873A
+#define GL_MODELVIEW27_ARB 0x873B
+#define GL_MODELVIEW28_ARB 0x873C
+#define GL_MODELVIEW29_ARB 0x873D
+#define GL_MODELVIEW30_ARB 0x873E
+#define GL_MODELVIEW31_ARB 0x873F
+#endif
+
+#ifndef GL_ARB_matrix_palette
+#define GL_MATRIX_PALETTE_ARB 0x8840
+#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841
+#define GL_MAX_PALETTE_MATRICES_ARB 0x8842
+#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843
+#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844
+#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845
+#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846
+#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847
+#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848
+#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849
+#endif
+
+#ifndef GL_ARB_texture_env_combine
+#define GL_COMBINE_ARB 0x8570
+#define GL_COMBINE_RGB_ARB 0x8571
+#define GL_COMBINE_ALPHA_ARB 0x8572
+#define GL_SOURCE0_RGB_ARB 0x8580
+#define GL_SOURCE1_RGB_ARB 0x8581
+#define GL_SOURCE2_RGB_ARB 0x8582
+#define GL_SOURCE0_ALPHA_ARB 0x8588
+#define GL_SOURCE1_ALPHA_ARB 0x8589
+#define GL_SOURCE2_ALPHA_ARB 0x858A
+#define GL_OPERAND0_RGB_ARB 0x8590
+#define GL_OPERAND1_RGB_ARB 0x8591
+#define GL_OPERAND2_RGB_ARB 0x8592
+#define GL_OPERAND0_ALPHA_ARB 0x8598
+#define GL_OPERAND1_ALPHA_ARB 0x8599
+#define GL_OPERAND2_ALPHA_ARB 0x859A
+#define GL_RGB_SCALE_ARB 0x8573
+#define GL_ADD_SIGNED_ARB 0x8574
+#define GL_INTERPOLATE_ARB 0x8575
+#define GL_SUBTRACT_ARB 0x84E7
+#define GL_CONSTANT_ARB 0x8576
+#define GL_PRIMARY_COLOR_ARB 0x8577
+#define GL_PREVIOUS_ARB 0x8578
+#endif
+
+#ifndef GL_ARB_texture_env_crossbar
+#endif
+
+#ifndef GL_ARB_texture_env_dot3
+#define GL_DOT3_RGB_ARB 0x86AE
+#define GL_DOT3_RGBA_ARB 0x86AF
+#endif
+
+#ifndef GL_ARB_texture_mirrored_repeat
+#define GL_MIRRORED_REPEAT_ARB 0x8370
+#endif
+
+#ifndef GL_ARB_depth_texture
+#define GL_DEPTH_COMPONENT16_ARB 0x81A5
+#define GL_DEPTH_COMPONENT24_ARB 0x81A6
+#define GL_DEPTH_COMPONENT32_ARB 0x81A7
+#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A
+#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B
+#endif
+
+#ifndef GL_ARB_shadow
+#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C
+#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D
+#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E
+#endif
+
+#ifndef GL_ARB_shadow_ambient
+#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF
+#endif
+
+#ifndef GL_ARB_window_pos
+#endif
+
+#ifndef GL_ARB_vertex_program
+#define GL_COLOR_SUM_ARB 0x8458
+#define GL_VERTEX_PROGRAM_ARB 0x8620
+#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622
+#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623
+#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624
+#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625
+#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626
+#define GL_PROGRAM_LENGTH_ARB 0x8627
+#define GL_PROGRAM_STRING_ARB 0x8628
+#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E
+#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F
+#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640
+#define GL_CURRENT_MATRIX_ARB 0x8641
+#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642
+#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643
+#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645
+#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B
+#define GL_PROGRAM_BINDING_ARB 0x8677
+#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869
+#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A
+#define GL_PROGRAM_ERROR_STRING_ARB 0x8874
+#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875
+#define GL_PROGRAM_FORMAT_ARB 0x8876
+#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0
+#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1
+#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2
+#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3
+#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4
+#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5
+#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6
+#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7
+#define GL_PROGRAM_PARAMETERS_ARB 0x88A8
+#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9
+#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA
+#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB
+#define GL_PROGRAM_ATTRIBS_ARB 0x88AC
+#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD
+#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE
+#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF
+#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0
+#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1
+#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2
+#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3
+#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4
+#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5
+#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6
+#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7
+#define GL_MATRIX0_ARB 0x88C0
+#define GL_MATRIX1_ARB 0x88C1
+#define GL_MATRIX2_ARB 0x88C2
+#define GL_MATRIX3_ARB 0x88C3
+#define GL_MATRIX4_ARB 0x88C4
+#define GL_MATRIX5_ARB 0x88C5
+#define GL_MATRIX6_ARB 0x88C6
+#define GL_MATRIX7_ARB 0x88C7
+#define GL_MATRIX8_ARB 0x88C8
+#define GL_MATRIX9_ARB 0x88C9
+#define GL_MATRIX10_ARB 0x88CA
+#define GL_MATRIX11_ARB 0x88CB
+#define GL_MATRIX12_ARB 0x88CC
+#define GL_MATRIX13_ARB 0x88CD
+#define GL_MATRIX14_ARB 0x88CE
+#define GL_MATRIX15_ARB 0x88CF
+#define GL_MATRIX16_ARB 0x88D0
+#define GL_MATRIX17_ARB 0x88D1
+#define GL_MATRIX18_ARB 0x88D2
+#define GL_MATRIX19_ARB 0x88D3
+#define GL_MATRIX20_ARB 0x88D4
+#define GL_MATRIX21_ARB 0x88D5
+#define GL_MATRIX22_ARB 0x88D6
+#define GL_MATRIX23_ARB 0x88D7
+#define GL_MATRIX24_ARB 0x88D8
+#define GL_MATRIX25_ARB 0x88D9
+#define GL_MATRIX26_ARB 0x88DA
+#define GL_MATRIX27_ARB 0x88DB
+#define GL_MATRIX28_ARB 0x88DC
+#define GL_MATRIX29_ARB 0x88DD
+#define GL_MATRIX30_ARB 0x88DE
+#define GL_MATRIX31_ARB 0x88DF
+#endif
+
+#ifndef GL_ARB_fragment_program
+#define GL_FRAGMENT_PROGRAM_ARB 0x8804
+#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805
+#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806
+#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807
+#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808
+#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809
+#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A
+#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B
+#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C
+#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D
+#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E
+#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F
+#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810
+#define GL_MAX_TEXTURE_COORDS_ARB 0x8871
+#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872
+#endif
+
+#ifndef GL_ARB_vertex_buffer_object
+#define GL_BUFFER_SIZE_ARB 0x8764
+#define GL_BUFFER_USAGE_ARB 0x8765
+#define GL_ARRAY_BUFFER_ARB 0x8892
+#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893
+#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894
+#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895
+#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896
+#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897
+#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898
+#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899
+#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A
+#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B
+#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C
+#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D
+#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E
+#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F
+#define GL_READ_ONLY_ARB 0x88B8
+#define GL_WRITE_ONLY_ARB 0x88B9
+#define GL_READ_WRITE_ARB 0x88BA
+#define GL_BUFFER_ACCESS_ARB 0x88BB
+#define GL_BUFFER_MAPPED_ARB 0x88BC
+#define GL_BUFFER_MAP_POINTER_ARB 0x88BD
+#define GL_STREAM_DRAW_ARB 0x88E0
+#define GL_STREAM_READ_ARB 0x88E1
+#define GL_STREAM_COPY_ARB 0x88E2
+#define GL_STATIC_DRAW_ARB 0x88E4
+#define GL_STATIC_READ_ARB 0x88E5
+#define GL_STATIC_COPY_ARB 0x88E6
+#define GL_DYNAMIC_DRAW_ARB 0x88E8
+#define GL_DYNAMIC_READ_ARB 0x88E9
+#define GL_DYNAMIC_COPY_ARB 0x88EA
+#endif
+
+#ifndef GL_ARB_occlusion_query
+#define GL_QUERY_COUNTER_BITS_ARB 0x8864
+#define GL_CURRENT_QUERY_ARB 0x8865
+#define GL_QUERY_RESULT_ARB 0x8866
+#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867
+#define GL_SAMPLES_PASSED_ARB 0x8914
+#endif
+
+#ifndef GL_ARB_shader_objects
+#define GL_PROGRAM_OBJECT_ARB 0x8B40
+#define GL_SHADER_OBJECT_ARB 0x8B48
+#define GL_OBJECT_TYPE_ARB 0x8B4E
+#define GL_OBJECT_SUBTYPE_ARB 0x8B4F
+#define GL_FLOAT_VEC2_ARB 0x8B50
+#define GL_FLOAT_VEC3_ARB 0x8B51
+#define GL_FLOAT_VEC4_ARB 0x8B52
+#define GL_INT_VEC2_ARB 0x8B53
+#define GL_INT_VEC3_ARB 0x8B54
+#define GL_INT_VEC4_ARB 0x8B55
+#define GL_BOOL_ARB 0x8B56
+#define GL_BOOL_VEC2_ARB 0x8B57
+#define GL_BOOL_VEC3_ARB 0x8B58
+#define GL_BOOL_VEC4_ARB 0x8B59
+#define GL_FLOAT_MAT2_ARB 0x8B5A
+#define GL_FLOAT_MAT3_ARB 0x8B5B
+#define GL_FLOAT_MAT4_ARB 0x8B5C
+#define GL_SAMPLER_1D_ARB 0x8B5D
+#define GL_SAMPLER_2D_ARB 0x8B5E
+#define GL_SAMPLER_3D_ARB 0x8B5F
+#define GL_SAMPLER_CUBE_ARB 0x8B60
+#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61
+#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62
+#define GL_SAMPLER_2D_RECT_ARB 0x8B63
+#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64
+#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80
+#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81
+#define GL_OBJECT_LINK_STATUS_ARB 0x8B82
+#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83
+#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84
+#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85
+#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86
+#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87
+#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88
+#endif
+
+#ifndef GL_ARB_vertex_shader
+#define GL_VERTEX_SHADER_ARB 0x8B31
+#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A
+#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B
+#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C
+#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D
+#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89
+#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A
+#endif
+
+#ifndef GL_ARB_fragment_shader
+#define GL_FRAGMENT_SHADER_ARB 0x8B30
+#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49
+#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B
+#endif
+
+#ifndef GL_ARB_shading_language_100
+#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C
+#endif
+
+#ifndef GL_ARB_texture_non_power_of_two
+#endif
+
+#ifndef GL_ARB_point_sprite
+#define GL_POINT_SPRITE_ARB 0x8861
+#define GL_COORD_REPLACE_ARB 0x8862
+#endif
+
+#ifndef GL_ARB_fragment_program_shadow
+#endif
+
+#ifndef GL_ARB_draw_buffers
+#define GL_MAX_DRAW_BUFFERS_ARB 0x8824
+#define GL_DRAW_BUFFER0_ARB 0x8825
+#define GL_DRAW_BUFFER1_ARB 0x8826
+#define GL_DRAW_BUFFER2_ARB 0x8827
+#define GL_DRAW_BUFFER3_ARB 0x8828
+#define GL_DRAW_BUFFER4_ARB 0x8829
+#define GL_DRAW_BUFFER5_ARB 0x882A
+#define GL_DRAW_BUFFER6_ARB 0x882B
+#define GL_DRAW_BUFFER7_ARB 0x882C
+#define GL_DRAW_BUFFER8_ARB 0x882D
+#define GL_DRAW_BUFFER9_ARB 0x882E
+#define GL_DRAW_BUFFER10_ARB 0x882F
+#define GL_DRAW_BUFFER11_ARB 0x8830
+#define GL_DRAW_BUFFER12_ARB 0x8831
+#define GL_DRAW_BUFFER13_ARB 0x8832
+#define GL_DRAW_BUFFER14_ARB 0x8833
+#define GL_DRAW_BUFFER15_ARB 0x8834
+#endif
+
+#ifndef GL_ARB_texture_rectangle
+#define GL_TEXTURE_RECTANGLE_ARB 0x84F5
+#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6
+#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7
+#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8
+#endif
+
+#ifndef GL_ARB_color_buffer_float
+#define GL_RGBA_FLOAT_MODE_ARB 0x8820
+#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A
+#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B
+#define GL_CLAMP_READ_COLOR_ARB 0x891C
+#define GL_FIXED_ONLY_ARB 0x891D
+#endif
+
+#ifndef GL_ARB_half_float_pixel
+#define GL_HALF_FLOAT_ARB 0x140B
+#endif
+
+#ifndef GL_ARB_texture_float
+#define GL_TEXTURE_RED_TYPE_ARB 0x8C10
+#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11
+#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12
+#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13
+#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14
+#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15
+#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16
+#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17
+#define GL_RGBA32F_ARB 0x8814
+#define GL_RGB32F_ARB 0x8815
+#define GL_ALPHA32F_ARB 0x8816
+#define GL_INTENSITY32F_ARB 0x8817
+#define GL_LUMINANCE32F_ARB 0x8818
+#define GL_LUMINANCE_ALPHA32F_ARB 0x8819
+#define GL_RGBA16F_ARB 0x881A
+#define GL_RGB16F_ARB 0x881B
+#define GL_ALPHA16F_ARB 0x881C
+#define GL_INTENSITY16F_ARB 0x881D
+#define GL_LUMINANCE16F_ARB 0x881E
+#define GL_LUMINANCE_ALPHA16F_ARB 0x881F
+#endif
+
+#ifndef GL_ARB_pixel_buffer_object
+#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB
+#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC
+#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED
+#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF
+#endif
+
+#ifndef GL_ARB_depth_buffer_float
+#define GL_DEPTH_COMPONENT32F 0x8CAC
+#define GL_DEPTH32F_STENCIL8 0x8CAD
+#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD
+#endif
+
+#ifndef GL_ARB_draw_instanced
+#endif
+
+#ifndef GL_ARB_framebuffer_object
+#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
+#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210
+#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211
+#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212
+#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213
+#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214
+#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215
+#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216
+#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217
+#define GL_FRAMEBUFFER_DEFAULT 0x8218
+#define GL_FRAMEBUFFER_UNDEFINED 0x8219
+#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A
+#define GL_MAX_RENDERBUFFER_SIZE 0x84E8
+#define GL_DEPTH_STENCIL 0x84F9
+#define GL_UNSIGNED_INT_24_8 0x84FA
+#define GL_DEPTH24_STENCIL8 0x88F0
+#define GL_TEXTURE_STENCIL_SIZE 0x88F1
+#define GL_TEXTURE_RED_TYPE 0x8C10
+#define GL_TEXTURE_GREEN_TYPE 0x8C11
+#define GL_TEXTURE_BLUE_TYPE 0x8C12
+#define GL_TEXTURE_ALPHA_TYPE 0x8C13
+#define GL_TEXTURE_DEPTH_TYPE 0x8C16
+#define GL_UNSIGNED_NORMALIZED 0x8C17
+#define GL_FRAMEBUFFER_BINDING 0x8CA6
+#define GL_DRAW_FRAMEBUFFER_BINDING GL_FRAMEBUFFER_BINDING
+#define GL_RENDERBUFFER_BINDING 0x8CA7
+#define GL_READ_FRAMEBUFFER 0x8CA8
+#define GL_DRAW_FRAMEBUFFER 0x8CA9
+#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA
+#define GL_RENDERBUFFER_SAMPLES 0x8CAB
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4
+#define GL_FRAMEBUFFER_COMPLETE 0x8CD5
+#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
+#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
+#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB
+#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC
+#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
+#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF
+#define GL_COLOR_ATTACHMENT0 0x8CE0
+#define GL_COLOR_ATTACHMENT1 0x8CE1
+#define GL_COLOR_ATTACHMENT2 0x8CE2
+#define GL_COLOR_ATTACHMENT3 0x8CE3
+#define GL_COLOR_ATTACHMENT4 0x8CE4
+#define GL_COLOR_ATTACHMENT5 0x8CE5
+#define GL_COLOR_ATTACHMENT6 0x8CE6
+#define GL_COLOR_ATTACHMENT7 0x8CE7
+#define GL_COLOR_ATTACHMENT8 0x8CE8
+#define GL_COLOR_ATTACHMENT9 0x8CE9
+#define GL_COLOR_ATTACHMENT10 0x8CEA
+#define GL_COLOR_ATTACHMENT11 0x8CEB
+#define GL_COLOR_ATTACHMENT12 0x8CEC
+#define GL_COLOR_ATTACHMENT13 0x8CED
+#define GL_COLOR_ATTACHMENT14 0x8CEE
+#define GL_COLOR_ATTACHMENT15 0x8CEF
+#define GL_DEPTH_ATTACHMENT 0x8D00
+#define GL_STENCIL_ATTACHMENT 0x8D20
+#define GL_FRAMEBUFFER 0x8D40
+#define GL_RENDERBUFFER 0x8D41
+#define GL_RENDERBUFFER_WIDTH 0x8D42
+#define GL_RENDERBUFFER_HEIGHT 0x8D43
+#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44
+#define GL_STENCIL_INDEX1 0x8D46
+#define GL_STENCIL_INDEX4 0x8D47
+#define GL_STENCIL_INDEX8 0x8D48
+#define GL_STENCIL_INDEX16 0x8D49
+#define GL_RENDERBUFFER_RED_SIZE 0x8D50
+#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51
+#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52
+#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53
+#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54
+#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56
+#define GL_MAX_SAMPLES 0x8D57
+#endif
+
+#ifndef GL_ARB_framebuffer_object_DEPRECATED
+#define GL_INDEX 0x8222
+#define GL_TEXTURE_LUMINANCE_TYPE 0x8C14
+#define GL_TEXTURE_INTENSITY_TYPE 0x8C15
+#endif
+
+#ifndef GL_ARB_framebuffer_sRGB
+#define GL_FRAMEBUFFER_SRGB 0x8DB9
+#endif
+
+#ifndef GL_ARB_geometry_shader4
+#define GL_LINES_ADJACENCY_ARB 0x000A
+#define GL_LINE_STRIP_ADJACENCY_ARB 0x000B
+#define GL_TRIANGLES_ADJACENCY_ARB 0x000C
+#define GL_TRIANGLE_STRIP_ADJACENCY_ARB 0x000D
+#define GL_PROGRAM_POINT_SIZE_ARB 0x8642
+#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29
+#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7
+#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8
+#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9
+#define GL_GEOMETRY_SHADER_ARB 0x8DD9
+#define GL_GEOMETRY_VERTICES_OUT_ARB 0x8DDA
+#define GL_GEOMETRY_INPUT_TYPE_ARB 0x8DDB
+#define GL_GEOMETRY_OUTPUT_TYPE_ARB 0x8DDC
+#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD
+#define GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE
+#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF
+#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0
+#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1
+/* reuse GL_MAX_VARYING_COMPONENTS */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */
+#endif
+
+#ifndef GL_ARB_half_float_vertex
+#define GL_HALF_FLOAT 0x140B
+#endif
+
+#ifndef GL_ARB_instanced_arrays
+#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB 0x88FE
+#endif
+
+#ifndef GL_ARB_map_buffer_range
+#define GL_MAP_READ_BIT 0x0001
+#define GL_MAP_WRITE_BIT 0x0002
+#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004
+#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008
+#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010
+#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020
+#endif
+
+#ifndef GL_ARB_texture_buffer_object
+#define GL_TEXTURE_BUFFER_ARB 0x8C2A
+#define GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B
+#define GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C
+#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D
+#define GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E
+#endif
+
+#ifndef GL_ARB_texture_compression_rgtc
+#define GL_COMPRESSED_RED_RGTC1 0x8DBB
+#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC
+#define GL_COMPRESSED_RG_RGTC2 0x8DBD
+#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE
+#endif
+
+#ifndef GL_ARB_texture_rg
+#define GL_RG 0x8227
+#define GL_RG_INTEGER 0x8228
+#define GL_R8 0x8229
+#define GL_R16 0x822A
+#define GL_RG8 0x822B
+#define GL_RG16 0x822C
+#define GL_R16F 0x822D
+#define GL_R32F 0x822E
+#define GL_RG16F 0x822F
+#define GL_RG32F 0x8230
+#define GL_R8I 0x8231
+#define GL_R8UI 0x8232
+#define GL_R16I 0x8233
+#define GL_R16UI 0x8234
+#define GL_R32I 0x8235
+#define GL_R32UI 0x8236
+#define GL_RG8I 0x8237
+#define GL_RG8UI 0x8238
+#define GL_RG16I 0x8239
+#define GL_RG16UI 0x823A
+#define GL_RG32I 0x823B
+#define GL_RG32UI 0x823C
+#endif
+
+#ifndef GL_ARB_vertex_array_object
+#define GL_VERTEX_ARRAY_BINDING 0x85B5
+#endif
+
+#ifndef GL_ARB_uniform_buffer_object
+#define GL_UNIFORM_BUFFER 0x8A11
+#define GL_UNIFORM_BUFFER_BINDING 0x8A28
+#define GL_UNIFORM_BUFFER_START 0x8A29
+#define GL_UNIFORM_BUFFER_SIZE 0x8A2A
+#define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B
+#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C
+#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D
+#define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E
+#define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F
+#define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30
+#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31
+#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32
+#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33
+#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34
+#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35
+#define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36
+#define GL_UNIFORM_TYPE 0x8A37
+#define GL_UNIFORM_SIZE 0x8A38
+#define GL_UNIFORM_NAME_LENGTH 0x8A39
+#define GL_UNIFORM_BLOCK_INDEX 0x8A3A
+#define GL_UNIFORM_OFFSET 0x8A3B
+#define GL_UNIFORM_ARRAY_STRIDE 0x8A3C
+#define GL_UNIFORM_MATRIX_STRIDE 0x8A3D
+#define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E
+#define GL_UNIFORM_BLOCK_BINDING 0x8A3F
+#define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40
+#define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41
+#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42
+#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43
+#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44
+#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45
+#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46
+#define GL_INVALID_INDEX 0xFFFFFFFFu
+#endif
+
+#ifndef GL_ARB_compatibility
+/* ARB_compatibility just defines tokens from core 3.0 */
+#endif
+
+#ifndef GL_ARB_copy_buffer
+#define GL_COPY_READ_BUFFER 0x8F36
+#define GL_COPY_WRITE_BUFFER 0x8F37
+#endif
+
+#ifndef GL_ARB_shader_texture_lod
+#endif
+
+#ifndef GL_ARB_depth_clamp
+#define GL_DEPTH_CLAMP 0x864F
+#endif
+
+#ifndef GL_ARB_draw_elements_base_vertex
+#endif
+
+#ifndef GL_ARB_fragment_coord_conventions
+#endif
+
+#ifndef GL_ARB_provoking_vertex
+#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C
+#define GL_FIRST_VERTEX_CONVENTION 0x8E4D
+#define GL_LAST_VERTEX_CONVENTION 0x8E4E
+#define GL_PROVOKING_VERTEX 0x8E4F
+#endif
+
+#ifndef GL_ARB_seamless_cube_map
+#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F
+#endif
+
+#ifndef GL_ARB_sync
+#define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111
+#define GL_OBJECT_TYPE 0x9112
+#define GL_SYNC_CONDITION 0x9113
+#define GL_SYNC_STATUS 0x9114
+#define GL_SYNC_FLAGS 0x9115
+#define GL_SYNC_FENCE 0x9116
+#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117
+#define GL_UNSIGNALED 0x9118
+#define GL_SIGNALED 0x9119
+#define GL_ALREADY_SIGNALED 0x911A
+#define GL_TIMEOUT_EXPIRED 0x911B
+#define GL_CONDITION_SATISFIED 0x911C
+#define GL_WAIT_FAILED 0x911D
+#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001
+#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFFull
+#endif
+
+#ifndef GL_ARB_texture_multisample
+#define GL_SAMPLE_POSITION 0x8E50
+#define GL_SAMPLE_MASK 0x8E51
+#define GL_SAMPLE_MASK_VALUE 0x8E52
+#define GL_MAX_SAMPLE_MASK_WORDS 0x8E59
+#define GL_TEXTURE_2D_MULTISAMPLE 0x9100
+#define GL_PROXY_TEXTURE_2D_MULTISAMPLE 0x9101
+#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102
+#define GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103
+#define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104
+#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105
+#define GL_TEXTURE_SAMPLES 0x9106
+#define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107
+#define GL_SAMPLER_2D_MULTISAMPLE 0x9108
+#define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109
+#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A
+#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B
+#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C
+#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D
+#define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E
+#define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F
+#define GL_MAX_INTEGER_SAMPLES 0x9110
+#endif
+
+#ifndef GL_ARB_vertex_array_bgra
+/* reuse GL_BGRA */
+#endif
+
+#ifndef GL_ARB_draw_buffers_blend
+#endif
+
+#ifndef GL_ARB_sample_shading
+#define GL_SAMPLE_SHADING_ARB 0x8C36
+#define GL_MIN_SAMPLE_SHADING_VALUE_ARB 0x8C37
+#endif
+
+#ifndef GL_ARB_texture_cube_map_array
+#define GL_TEXTURE_CUBE_MAP_ARRAY_ARB 0x9009
+#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB 0x900A
+#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB 0x900B
+#define GL_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900C
+#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D
+#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900E
+#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900F
+#endif
+
+#ifndef GL_ARB_texture_gather
+#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5E
+#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5F
+#endif
+
+#ifndef GL_ARB_texture_query_lod
+#endif
+
+#ifndef GL_ARB_shading_language_include
+#define GL_SHADER_INCLUDE_ARB 0x8DAE
+#define GL_NAMED_STRING_LENGTH_ARB 0x8DE9
+#define GL_NAMED_STRING_TYPE_ARB 0x8DEA
+#endif
+
+#ifndef GL_ARB_texture_compression_bptc
+#define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C
+#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D
+#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E
+#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F
+#endif
+
+#ifndef GL_ARB_blend_func_extended
+#define GL_SRC1_COLOR 0x88F9
+/* reuse GL_SRC1_ALPHA */
+#define GL_ONE_MINUS_SRC1_COLOR 0x88FA
+#define GL_ONE_MINUS_SRC1_ALPHA 0x88FB
+#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS 0x88FC
+#endif
+
+#ifndef GL_ARB_explicit_attrib_location
+#endif
+
+#ifndef GL_ARB_occlusion_query2
+#define GL_ANY_SAMPLES_PASSED 0x8C2F
+#endif
+
+#ifndef GL_ARB_sampler_objects
+#define GL_SAMPLER_BINDING 0x8919
+#endif
+
+#ifndef GL_ARB_shader_bit_encoding
+#endif
+
+#ifndef GL_ARB_texture_rgb10_a2ui
+#define GL_RGB10_A2UI 0x906F
+#endif
+
+#ifndef GL_ARB_texture_swizzle
+#define GL_TEXTURE_SWIZZLE_R 0x8E42
+#define GL_TEXTURE_SWIZZLE_G 0x8E43
+#define GL_TEXTURE_SWIZZLE_B 0x8E44
+#define GL_TEXTURE_SWIZZLE_A 0x8E45
+#define GL_TEXTURE_SWIZZLE_RGBA 0x8E46
+#endif
+
+#ifndef GL_ARB_timer_query
+#define GL_TIME_ELAPSED 0x88BF
+#define GL_TIMESTAMP 0x8E28
+#endif
+
+#ifndef GL_ARB_vertex_type_2_10_10_10_rev
+/* reuse GL_UNSIGNED_INT_2_10_10_10_REV */
+#define GL_INT_2_10_10_10_REV 0x8D9F
+#endif
+
+#ifndef GL_ARB_draw_indirect
+#define GL_DRAW_INDIRECT_BUFFER 0x8F3F
+#define GL_DRAW_INDIRECT_BUFFER_BINDING 0x8F43
+#endif
+
+#ifndef GL_ARB_gpu_shader5
+#define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F
+#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS 0x8E5A
+#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET 0x8E5B
+#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET 0x8E5C
+#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS 0x8E5D
+/* reuse GL_MAX_VERTEX_STREAMS */
+#endif
+
+#ifndef GL_ARB_gpu_shader_fp64
+/* reuse GL_DOUBLE */
+#define GL_DOUBLE_VEC2 0x8FFC
+#define GL_DOUBLE_VEC3 0x8FFD
+#define GL_DOUBLE_VEC4 0x8FFE
+#define GL_DOUBLE_MAT2 0x8F46
+#define GL_DOUBLE_MAT3 0x8F47
+#define GL_DOUBLE_MAT4 0x8F48
+#define GL_DOUBLE_MAT2x3 0x8F49
+#define GL_DOUBLE_MAT2x4 0x8F4A
+#define GL_DOUBLE_MAT3x2 0x8F4B
+#define GL_DOUBLE_MAT3x4 0x8F4C
+#define GL_DOUBLE_MAT4x2 0x8F4D
+#define GL_DOUBLE_MAT4x3 0x8F4E
+#endif
+
+#ifndef GL_ARB_shader_subroutine
+#define GL_ACTIVE_SUBROUTINES 0x8DE5
+#define GL_ACTIVE_SUBROUTINE_UNIFORMS 0x8DE6
+#define GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS 0x8E47
+#define GL_ACTIVE_SUBROUTINE_MAX_LENGTH 0x8E48
+#define GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH 0x8E49
+#define GL_MAX_SUBROUTINES 0x8DE7
+#define GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS 0x8DE8
+#define GL_NUM_COMPATIBLE_SUBROUTINES 0x8E4A
+#define GL_COMPATIBLE_SUBROUTINES 0x8E4B
+/* reuse GL_UNIFORM_SIZE */
+/* reuse GL_UNIFORM_NAME_LENGTH */
+#endif
+
+#ifndef GL_ARB_tessellation_shader
+#define GL_PATCHES 0x000E
+#define GL_PATCH_VERTICES 0x8E72
+#define GL_PATCH_DEFAULT_INNER_LEVEL 0x8E73
+#define GL_PATCH_DEFAULT_OUTER_LEVEL 0x8E74
+#define GL_TESS_CONTROL_OUTPUT_VERTICES 0x8E75
+#define GL_TESS_GEN_MODE 0x8E76
+#define GL_TESS_GEN_SPACING 0x8E77
+#define GL_TESS_GEN_VERTEX_ORDER 0x8E78
+#define GL_TESS_GEN_POINT_MODE 0x8E79
+/* reuse GL_TRIANGLES */
+/* reuse GL_QUADS */
+#define GL_ISOLINES 0x8E7A
+/* reuse GL_EQUAL */
+#define GL_FRACTIONAL_ODD 0x8E7B
+#define GL_FRACTIONAL_EVEN 0x8E7C
+/* reuse GL_CCW */
+/* reuse GL_CW */
+#define GL_MAX_PATCH_VERTICES 0x8E7D
+#define GL_MAX_TESS_GEN_LEVEL 0x8E7E
+#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E7F
+#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E80
+#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS 0x8E81
+#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS 0x8E82
+#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS 0x8E83
+#define GL_MAX_TESS_PATCH_COMPONENTS 0x8E84
+#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS 0x8E85
+#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS 0x8E86
+#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS 0x8E89
+#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS 0x8E8A
+#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS 0x886C
+#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS 0x886D
+#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E1E
+#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E1F
+#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER 0x84F0
+#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER 0x84F1
+#define GL_TESS_EVALUATION_SHADER 0x8E87
+#define GL_TESS_CONTROL_SHADER 0x8E88
+#endif
+
+#ifndef GL_ARB_texture_buffer_object_rgb32
+/* reuse GL_RGB32F */
+/* reuse GL_RGB32UI */
+/* reuse GL_RGB32I */
+#endif
+
+#ifndef GL_ARB_transform_feedback2
+#define GL_TRANSFORM_FEEDBACK 0x8E22
+#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED 0x8E23
+#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE 0x8E24
+#define GL_TRANSFORM_FEEDBACK_BINDING 0x8E25
+#endif
+
+#ifndef GL_ARB_transform_feedback3
+#define GL_MAX_TRANSFORM_FEEDBACK_BUFFERS 0x8E70
+#define GL_MAX_VERTEX_STREAMS 0x8E71
+#endif
+
+#ifndef GL_ARB_ES2_compatibility
+#define GL_FIXED 0x140C
+#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A
+#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
+#define GL_LOW_FLOAT 0x8DF0
+#define GL_MEDIUM_FLOAT 0x8DF1
+#define GL_HIGH_FLOAT 0x8DF2
+#define GL_LOW_INT 0x8DF3
+#define GL_MEDIUM_INT 0x8DF4
+#define GL_HIGH_INT 0x8DF5
+#define GL_SHADER_COMPILER 0x8DFA
+#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9
+#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB
+#define GL_MAX_VARYING_VECTORS 0x8DFC
+#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD
+#endif
+
+#ifndef GL_ARB_get_program_binary
+#define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257
+#define GL_PROGRAM_BINARY_LENGTH 0x8741
+#define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE
+#define GL_PROGRAM_BINARY_FORMATS 0x87FF
+#endif
+
+#ifndef GL_ARB_separate_shader_objects
+#define GL_VERTEX_SHADER_BIT 0x00000001
+#define GL_FRAGMENT_SHADER_BIT 0x00000002
+#define GL_GEOMETRY_SHADER_BIT 0x00000004
+#define GL_TESS_CONTROL_SHADER_BIT 0x00000008
+#define GL_TESS_EVALUATION_SHADER_BIT 0x00000010
+#define GL_ALL_SHADER_BITS 0xFFFFFFFF
+#define GL_PROGRAM_SEPARABLE 0x8258
+#define GL_ACTIVE_PROGRAM 0x8259
+#define GL_PROGRAM_PIPELINE_BINDING 0x825A
+#endif
+
+#ifndef GL_ARB_shader_precision
+#endif
+
+#ifndef GL_ARB_vertex_attrib_64bit
+/* reuse GL_RGB32I */
+/* reuse GL_DOUBLE_VEC2 */
+/* reuse GL_DOUBLE_VEC3 */
+/* reuse GL_DOUBLE_VEC4 */
+/* reuse GL_DOUBLE_MAT2 */
+/* reuse GL_DOUBLE_MAT3 */
+/* reuse GL_DOUBLE_MAT4 */
+/* reuse GL_DOUBLE_MAT2x3 */
+/* reuse GL_DOUBLE_MAT2x4 */
+/* reuse GL_DOUBLE_MAT3x2 */
+/* reuse GL_DOUBLE_MAT3x4 */
+/* reuse GL_DOUBLE_MAT4x2 */
+/* reuse GL_DOUBLE_MAT4x3 */
+#endif
+
+#ifndef GL_ARB_viewport_array
+/* reuse GL_SCISSOR_BOX */
+/* reuse GL_VIEWPORT */
+/* reuse GL_DEPTH_RANGE */
+/* reuse GL_SCISSOR_TEST */
+#define GL_MAX_VIEWPORTS 0x825B
+#define GL_VIEWPORT_SUBPIXEL_BITS 0x825C
+#define GL_VIEWPORT_BOUNDS_RANGE 0x825D
+#define GL_LAYER_PROVOKING_VERTEX 0x825E
+#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX 0x825F
+#define GL_UNDEFINED_VERTEX 0x8260
+/* reuse GL_FIRST_VERTEX_CONVENTION */
+/* reuse GL_LAST_VERTEX_CONVENTION */
+/* reuse GL_PROVOKING_VERTEX */
+#endif
+
+#ifndef GL_ARB_cl_event
+#define GL_SYNC_CL_EVENT_ARB 0x8240
+#define GL_SYNC_CL_EVENT_COMPLETE_ARB 0x8241
+#endif
+
+#ifndef GL_ARB_debug_output
+#define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242
+#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243
+#define GL_DEBUG_CALLBACK_FUNCTION_ARB 0x8244
+#define GL_DEBUG_CALLBACK_USER_PARAM_ARB 0x8245
+#define GL_DEBUG_SOURCE_API_ARB 0x8246
+#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247
+#define GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248
+#define GL_DEBUG_SOURCE_THIRD_PARTY_ARB 0x8249
+#define GL_DEBUG_SOURCE_APPLICATION_ARB 0x824A
+#define GL_DEBUG_SOURCE_OTHER_ARB 0x824B
+#define GL_DEBUG_TYPE_ERROR_ARB 0x824C
+#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D
+#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E
+#define GL_DEBUG_TYPE_PORTABILITY_ARB 0x824F
+#define GL_DEBUG_TYPE_PERFORMANCE_ARB 0x8250
+#define GL_DEBUG_TYPE_OTHER_ARB 0x8251
+#define GL_MAX_DEBUG_MESSAGE_LENGTH_ARB 0x9143
+#define GL_MAX_DEBUG_LOGGED_MESSAGES_ARB 0x9144
+#define GL_DEBUG_LOGGED_MESSAGES_ARB 0x9145
+#define GL_DEBUG_SEVERITY_HIGH_ARB 0x9146
+#define GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147
+#define GL_DEBUG_SEVERITY_LOW_ARB 0x9148
+#endif
+
+#ifndef GL_ARB_robustness
+/* reuse GL_NO_ERROR */
+#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB 0x00000004
+#define GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252
+#define GL_GUILTY_CONTEXT_RESET_ARB 0x8253
+#define GL_INNOCENT_CONTEXT_RESET_ARB 0x8254
+#define GL_UNKNOWN_CONTEXT_RESET_ARB 0x8255
+#define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
+#define GL_NO_RESET_NOTIFICATION_ARB 0x8261
+#endif
+
+#ifndef GL_ARB_shader_stencil_export
+#endif
+
+#ifndef GL_ARB_base_instance
+#endif
+
+#ifndef GL_ARB_shading_language_420pack
+#endif
+
+#ifndef GL_ARB_transform_feedback_instanced
+#endif
+
+#ifndef GL_ARB_compressed_texture_pixel_storage
+#define GL_UNPACK_COMPRESSED_BLOCK_WIDTH 0x9127
+#define GL_UNPACK_COMPRESSED_BLOCK_HEIGHT 0x9128
+#define GL_UNPACK_COMPRESSED_BLOCK_DEPTH 0x9129
+#define GL_UNPACK_COMPRESSED_BLOCK_SIZE 0x912A
+#define GL_PACK_COMPRESSED_BLOCK_WIDTH 0x912B
+#define GL_PACK_COMPRESSED_BLOCK_HEIGHT 0x912C
+#define GL_PACK_COMPRESSED_BLOCK_DEPTH 0x912D
+#define GL_PACK_COMPRESSED_BLOCK_SIZE 0x912E
+#endif
+
+#ifndef GL_ARB_conservative_depth
+#endif
+
+#ifndef GL_ARB_internalformat_query
+#define GL_NUM_SAMPLE_COUNTS 0x9380
+#endif
+
+#ifndef GL_ARB_map_buffer_alignment
+#define GL_MIN_MAP_BUFFER_ALIGNMENT 0x90BC
+#endif
+
+#ifndef GL_ARB_shader_atomic_counters
+#define GL_ATOMIC_COUNTER_BUFFER 0x92C0
+#define GL_ATOMIC_COUNTER_BUFFER_BINDING 0x92C1
+#define GL_ATOMIC_COUNTER_BUFFER_START 0x92C2
+#define GL_ATOMIC_COUNTER_BUFFER_SIZE 0x92C3
+#define GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE 0x92C4
+#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS 0x92C5
+#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES 0x92C6
+#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER 0x92C7
+#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER 0x92C8
+#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER 0x92C9
+#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER 0x92CA
+#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER 0x92CB
+#define GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS 0x92CC
+#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS 0x92CD
+#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS 0x92CE
+#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS 0x92CF
+#define GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS 0x92D0
+#define GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS 0x92D1
+#define GL_MAX_VERTEX_ATOMIC_COUNTERS 0x92D2
+#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS 0x92D3
+#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS 0x92D4
+#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS 0x92D5
+#define GL_MAX_FRAGMENT_ATOMIC_COUNTERS 0x92D6
+#define GL_MAX_COMBINED_ATOMIC_COUNTERS 0x92D7
+#define GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE 0x92D8
+#define GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS 0x92DC
+#define GL_ACTIVE_ATOMIC_COUNTER_BUFFERS 0x92D9
+#define GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX 0x92DA
+#define GL_UNSIGNED_INT_ATOMIC_COUNTER 0x92DB
+#endif
+
+#ifndef GL_ARB_shader_image_load_store
+#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001
+#define GL_ELEMENT_ARRAY_BARRIER_BIT 0x00000002
+#define GL_UNIFORM_BARRIER_BIT 0x00000004
+#define GL_TEXTURE_FETCH_BARRIER_BIT 0x00000008
+#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020
+#define GL_COMMAND_BARRIER_BIT 0x00000040
+#define GL_PIXEL_BUFFER_BARRIER_BIT 0x00000080
+#define GL_TEXTURE_UPDATE_BARRIER_BIT 0x00000100
+#define GL_BUFFER_UPDATE_BARRIER_BIT 0x00000200
+#define GL_FRAMEBUFFER_BARRIER_BIT 0x00000400
+#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x00000800
+#define GL_ATOMIC_COUNTER_BARRIER_BIT 0x00001000
+#define GL_ALL_BARRIER_BITS 0xFFFFFFFF
+#define GL_MAX_IMAGE_UNITS 0x8F38
+#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS 0x8F39
+#define GL_IMAGE_BINDING_NAME 0x8F3A
+#define GL_IMAGE_BINDING_LEVEL 0x8F3B
+#define GL_IMAGE_BINDING_LAYERED 0x8F3C
+#define GL_IMAGE_BINDING_LAYER 0x8F3D
+#define GL_IMAGE_BINDING_ACCESS 0x8F3E
+#define GL_IMAGE_1D 0x904C
+#define GL_IMAGE_2D 0x904D
+#define GL_IMAGE_3D 0x904E
+#define GL_IMAGE_2D_RECT 0x904F
+#define GL_IMAGE_CUBE 0x9050
+#define GL_IMAGE_BUFFER 0x9051
+#define GL_IMAGE_1D_ARRAY 0x9052
+#define GL_IMAGE_2D_ARRAY 0x9053
+#define GL_IMAGE_CUBE_MAP_ARRAY 0x9054
+#define GL_IMAGE_2D_MULTISAMPLE 0x9055
+#define GL_IMAGE_2D_MULTISAMPLE_ARRAY 0x9056
+#define GL_INT_IMAGE_1D 0x9057
+#define GL_INT_IMAGE_2D 0x9058
+#define GL_INT_IMAGE_3D 0x9059
+#define GL_INT_IMAGE_2D_RECT 0x905A
+#define GL_INT_IMAGE_CUBE 0x905B
+#define GL_INT_IMAGE_BUFFER 0x905C
+#define GL_INT_IMAGE_1D_ARRAY 0x905D
+#define GL_INT_IMAGE_2D_ARRAY 0x905E
+#define GL_INT_IMAGE_CUBE_MAP_ARRAY 0x905F
+#define GL_INT_IMAGE_2D_MULTISAMPLE 0x9060
+#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x9061
+#define GL_UNSIGNED_INT_IMAGE_1D 0x9062
+#define GL_UNSIGNED_INT_IMAGE_2D 0x9063
+#define GL_UNSIGNED_INT_IMAGE_3D 0x9064
+#define GL_UNSIGNED_INT_IMAGE_2D_RECT 0x9065
+#define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066
+#define GL_UNSIGNED_INT_IMAGE_BUFFER 0x9067
+#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY 0x9068
+#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069
+#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY 0x906A
+#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE 0x906B
+#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x906C
+#define GL_MAX_IMAGE_SAMPLES 0x906D
+#define GL_IMAGE_BINDING_FORMAT 0x906E
+#define GL_IMAGE_FORMAT_COMPATIBILITY_TYPE 0x90C7
+#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE 0x90C8
+#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS 0x90C9
+#define GL_MAX_VERTEX_IMAGE_UNIFORMS 0x90CA
+#define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS 0x90CB
+#define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS 0x90CC
+#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS 0x90CD
+#define GL_MAX_FRAGMENT_IMAGE_UNIFORMS 0x90CE
+#define GL_MAX_COMBINED_IMAGE_UNIFORMS 0x90CF
+#endif
+
+#ifndef GL_ARB_shading_language_packing
+#endif
+
+#ifndef GL_ARB_texture_storage
+#define GL_TEXTURE_IMMUTABLE_FORMAT 0x912F
+#endif
+
+#ifndef GL_EXT_abgr
+#define GL_ABGR_EXT 0x8000
+#endif
+
+#ifndef GL_EXT_blend_color
+#define GL_CONSTANT_COLOR_EXT 0x8001
+#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002
+#define GL_CONSTANT_ALPHA_EXT 0x8003
+#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004
+#define GL_BLEND_COLOR_EXT 0x8005
+#endif
+
+#ifndef GL_EXT_polygon_offset
+#define GL_POLYGON_OFFSET_EXT 0x8037
+#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038
+#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039
+#endif
+
+#ifndef GL_EXT_texture
+#define GL_ALPHA4_EXT 0x803B
+#define GL_ALPHA8_EXT 0x803C
+#define GL_ALPHA12_EXT 0x803D
+#define GL_ALPHA16_EXT 0x803E
+#define GL_LUMINANCE4_EXT 0x803F
+#define GL_LUMINANCE8_EXT 0x8040
+#define GL_LUMINANCE12_EXT 0x8041
+#define GL_LUMINANCE16_EXT 0x8042
+#define GL_LUMINANCE4_ALPHA4_EXT 0x8043
+#define GL_LUMINANCE6_ALPHA2_EXT 0x8044
+#define GL_LUMINANCE8_ALPHA8_EXT 0x8045
+#define GL_LUMINANCE12_ALPHA4_EXT 0x8046
+#define GL_LUMINANCE12_ALPHA12_EXT 0x8047
+#define GL_LUMINANCE16_ALPHA16_EXT 0x8048
+#define GL_INTENSITY_EXT 0x8049
+#define GL_INTENSITY4_EXT 0x804A
+#define GL_INTENSITY8_EXT 0x804B
+#define GL_INTENSITY12_EXT 0x804C
+#define GL_INTENSITY16_EXT 0x804D
+#define GL_RGB2_EXT 0x804E
+#define GL_RGB4_EXT 0x804F
+#define GL_RGB5_EXT 0x8050
+#define GL_RGB8_EXT 0x8051
+#define GL_RGB10_EXT 0x8052
+#define GL_RGB12_EXT 0x8053
+#define GL_RGB16_EXT 0x8054
+#define GL_RGBA2_EXT 0x8055
+#define GL_RGBA4_EXT 0x8056
+#define GL_RGB5_A1_EXT 0x8057
+#define GL_RGBA8_EXT 0x8058
+#define GL_RGB10_A2_EXT 0x8059
+#define GL_RGBA12_EXT 0x805A
+#define GL_RGBA16_EXT 0x805B
+#define GL_TEXTURE_RED_SIZE_EXT 0x805C
+#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D
+#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E
+#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F
+#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060
+#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061
+#define GL_REPLACE_EXT 0x8062
+#define GL_PROXY_TEXTURE_1D_EXT 0x8063
+#define GL_PROXY_TEXTURE_2D_EXT 0x8064
+#define GL_TEXTURE_TOO_LARGE_EXT 0x8065
+#endif
+
+#ifndef GL_EXT_texture3D
+#define GL_PACK_SKIP_IMAGES_EXT 0x806B
+#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C
+#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D
+#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E
+#define GL_TEXTURE_3D_EXT 0x806F
+#define GL_PROXY_TEXTURE_3D_EXT 0x8070
+#define GL_TEXTURE_DEPTH_EXT 0x8071
+#define GL_TEXTURE_WRAP_R_EXT 0x8072
+#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073
+#endif
+
+#ifndef GL_SGIS_texture_filter4
+#define GL_FILTER4_SGIS 0x8146
+#define GL_TEXTURE_FILTER4_SIZE_SGIS 0x8147
+#endif
+
+#ifndef GL_EXT_subtexture
+#endif
+
+#ifndef GL_EXT_copy_texture
+#endif
+
+#ifndef GL_EXT_histogram
+#define GL_HISTOGRAM_EXT 0x8024
+#define GL_PROXY_HISTOGRAM_EXT 0x8025
+#define GL_HISTOGRAM_WIDTH_EXT 0x8026
+#define GL_HISTOGRAM_FORMAT_EXT 0x8027
+#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028
+#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029
+#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A
+#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B
+#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C
+#define GL_HISTOGRAM_SINK_EXT 0x802D
+#define GL_MINMAX_EXT 0x802E
+#define GL_MINMAX_FORMAT_EXT 0x802F
+#define GL_MINMAX_SINK_EXT 0x8030
+#define GL_TABLE_TOO_LARGE_EXT 0x8031
+#endif
+
+#ifndef GL_EXT_convolution
+#define GL_CONVOLUTION_1D_EXT 0x8010
+#define GL_CONVOLUTION_2D_EXT 0x8011
+#define GL_SEPARABLE_2D_EXT 0x8012
+#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013
+#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014
+#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015
+#define GL_REDUCE_EXT 0x8016
+#define GL_CONVOLUTION_FORMAT_EXT 0x8017
+#define GL_CONVOLUTION_WIDTH_EXT 0x8018
+#define GL_CONVOLUTION_HEIGHT_EXT 0x8019
+#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A
+#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B
+#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C
+#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D
+#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E
+#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F
+#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020
+#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021
+#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022
+#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023
+#endif
+
+#ifndef GL_SGI_color_matrix
+#define GL_COLOR_MATRIX_SGI 0x80B1
+#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2
+#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3
+#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4
+#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5
+#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6
+#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7
+#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8
+#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9
+#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA
+#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB
+#endif
+
+#ifndef GL_SGI_color_table
+#define GL_COLOR_TABLE_SGI 0x80D0
+#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1
+#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2
+#define GL_PROXY_COLOR_TABLE_SGI 0x80D3
+#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4
+#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5
+#define GL_COLOR_TABLE_SCALE_SGI 0x80D6
+#define GL_COLOR_TABLE_BIAS_SGI 0x80D7
+#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8
+#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9
+#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA
+#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB
+#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC
+#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD
+#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE
+#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF
+#endif
+
+#ifndef GL_SGIS_pixel_texture
+#define GL_PIXEL_TEXTURE_SGIS 0x8353
+#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354
+#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355
+#define GL_PIXEL_GROUP_COLOR_SGIS 0x8356
+#endif
+
+#ifndef GL_SGIX_pixel_texture
+#define GL_PIXEL_TEX_GEN_SGIX 0x8139
+#define GL_PIXEL_TEX_GEN_MODE_SGIX 0x832B
+#endif
+
+#ifndef GL_SGIS_texture4D
+#define GL_PACK_SKIP_VOLUMES_SGIS 0x8130
+#define GL_PACK_IMAGE_DEPTH_SGIS 0x8131
+#define GL_UNPACK_SKIP_VOLUMES_SGIS 0x8132
+#define GL_UNPACK_IMAGE_DEPTH_SGIS 0x8133
+#define GL_TEXTURE_4D_SGIS 0x8134
+#define GL_PROXY_TEXTURE_4D_SGIS 0x8135
+#define GL_TEXTURE_4DSIZE_SGIS 0x8136
+#define GL_TEXTURE_WRAP_Q_SGIS 0x8137
+#define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138
+#define GL_TEXTURE_4D_BINDING_SGIS 0x814F
+#endif
+
+#ifndef GL_SGI_texture_color_table
+#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC
+#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD
+#endif
+
+#ifndef GL_EXT_cmyka
+#define GL_CMYK_EXT 0x800C
+#define GL_CMYKA_EXT 0x800D
+#define GL_PACK_CMYK_HINT_EXT 0x800E
+#define GL_UNPACK_CMYK_HINT_EXT 0x800F
+#endif
+
+#ifndef GL_EXT_texture_object
+#define GL_TEXTURE_PRIORITY_EXT 0x8066
+#define GL_TEXTURE_RESIDENT_EXT 0x8067
+#define GL_TEXTURE_1D_BINDING_EXT 0x8068
+#define GL_TEXTURE_2D_BINDING_EXT 0x8069
+#define GL_TEXTURE_3D_BINDING_EXT 0x806A
+#endif
+
+#ifndef GL_SGIS_detail_texture
+#define GL_DETAIL_TEXTURE_2D_SGIS 0x8095
+#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096
+#define GL_LINEAR_DETAIL_SGIS 0x8097
+#define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098
+#define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099
+#define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A
+#define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B
+#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C
+#endif
+
+#ifndef GL_SGIS_sharpen_texture
+#define GL_LINEAR_SHARPEN_SGIS 0x80AD
+#define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE
+#define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF
+#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0
+#endif
+
+#ifndef GL_EXT_packed_pixels
+#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032
+#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033
+#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034
+#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035
+#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036
+#endif
+
+#ifndef GL_SGIS_texture_lod
+#define GL_TEXTURE_MIN_LOD_SGIS 0x813A
+#define GL_TEXTURE_MAX_LOD_SGIS 0x813B
+#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C
+#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D
+#endif
+
+#ifndef GL_SGIS_multisample
+#define GL_MULTISAMPLE_SGIS 0x809D
+#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F
+#define GL_SAMPLE_MASK_SGIS 0x80A0
+#define GL_1PASS_SGIS 0x80A1
+#define GL_2PASS_0_SGIS 0x80A2
+#define GL_2PASS_1_SGIS 0x80A3
+#define GL_4PASS_0_SGIS 0x80A4
+#define GL_4PASS_1_SGIS 0x80A5
+#define GL_4PASS_2_SGIS 0x80A6
+#define GL_4PASS_3_SGIS 0x80A7
+#define GL_SAMPLE_BUFFERS_SGIS 0x80A8
+#define GL_SAMPLES_SGIS 0x80A9
+#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA
+#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB
+#define GL_SAMPLE_PATTERN_SGIS 0x80AC
+#endif
+
+#ifndef GL_EXT_rescale_normal
+#define GL_RESCALE_NORMAL_EXT 0x803A
+#endif
+
+#ifndef GL_EXT_vertex_array
+#define GL_VERTEX_ARRAY_EXT 0x8074
+#define GL_NORMAL_ARRAY_EXT 0x8075
+#define GL_COLOR_ARRAY_EXT 0x8076
+#define GL_INDEX_ARRAY_EXT 0x8077
+#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078
+#define GL_EDGE_FLAG_ARRAY_EXT 0x8079
+#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A
+#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B
+#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C
+#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D
+#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E
+#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F
+#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080
+#define GL_COLOR_ARRAY_SIZE_EXT 0x8081
+#define GL_COLOR_ARRAY_TYPE_EXT 0x8082
+#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083
+#define GL_COLOR_ARRAY_COUNT_EXT 0x8084
+#define GL_INDEX_ARRAY_TYPE_EXT 0x8085
+#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086
+#define GL_INDEX_ARRAY_COUNT_EXT 0x8087
+#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088
+#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089
+#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A
+#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B
+#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C
+#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D
+#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E
+#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F
+#define GL_COLOR_ARRAY_POINTER_EXT 0x8090
+#define GL_INDEX_ARRAY_POINTER_EXT 0x8091
+#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092
+#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093
+#endif
+
+#ifndef GL_EXT_misc_attribute
+#endif
+
+#ifndef GL_SGIS_generate_mipmap
+#define GL_GENERATE_MIPMAP_SGIS 0x8191
+#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192
+#endif
+
+#ifndef GL_SGIX_clipmap
+#define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170
+#define GL_TEXTURE_CLIPMAP_CENTER_SGIX 0x8171
+#define GL_TEXTURE_CLIPMAP_FRAME_SGIX 0x8172
+#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX 0x8173
+#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174
+#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175
+#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX 0x8176
+#define GL_MAX_CLIPMAP_DEPTH_SGIX 0x8177
+#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178
+#define GL_NEAREST_CLIPMAP_NEAREST_SGIX 0x844D
+#define GL_NEAREST_CLIPMAP_LINEAR_SGIX 0x844E
+#define GL_LINEAR_CLIPMAP_NEAREST_SGIX 0x844F
+#endif
+
+#ifndef GL_SGIX_shadow
+#define GL_TEXTURE_COMPARE_SGIX 0x819A
+#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B
+#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C
+#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D
+#endif
+
+#ifndef GL_SGIS_texture_edge_clamp
+#define GL_CLAMP_TO_EDGE_SGIS 0x812F
+#endif
+
+#ifndef GL_SGIS_texture_border_clamp
+#define GL_CLAMP_TO_BORDER_SGIS 0x812D
+#endif
+
+#ifndef GL_EXT_blend_minmax
+#define GL_FUNC_ADD_EXT 0x8006
+#define GL_MIN_EXT 0x8007
+#define GL_MAX_EXT 0x8008
+#define GL_BLEND_EQUATION_EXT 0x8009
+#endif
+
+#ifndef GL_EXT_blend_subtract
+#define GL_FUNC_SUBTRACT_EXT 0x800A
+#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B
+#endif
+
+#ifndef GL_EXT_blend_logic_op
+#endif
+
+#ifndef GL_SGIX_interlace
+#define GL_INTERLACE_SGIX 0x8094
+#endif
+
+#ifndef GL_SGIX_pixel_tiles
+#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E
+#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F
+#define GL_PIXEL_TILE_WIDTH_SGIX 0x8140
+#define GL_PIXEL_TILE_HEIGHT_SGIX 0x8141
+#define GL_PIXEL_TILE_GRID_WIDTH_SGIX 0x8142
+#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX 0x8143
+#define GL_PIXEL_TILE_GRID_DEPTH_SGIX 0x8144
+#define GL_PIXEL_TILE_CACHE_SIZE_SGIX 0x8145
+#endif
+
+#ifndef GL_SGIS_texture_select
+#define GL_DUAL_ALPHA4_SGIS 0x8110
+#define GL_DUAL_ALPHA8_SGIS 0x8111
+#define GL_DUAL_ALPHA12_SGIS 0x8112
+#define GL_DUAL_ALPHA16_SGIS 0x8113
+#define GL_DUAL_LUMINANCE4_SGIS 0x8114
+#define GL_DUAL_LUMINANCE8_SGIS 0x8115
+#define GL_DUAL_LUMINANCE12_SGIS 0x8116
+#define GL_DUAL_LUMINANCE16_SGIS 0x8117
+#define GL_DUAL_INTENSITY4_SGIS 0x8118
+#define GL_DUAL_INTENSITY8_SGIS 0x8119
+#define GL_DUAL_INTENSITY12_SGIS 0x811A
+#define GL_DUAL_INTENSITY16_SGIS 0x811B
+#define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C
+#define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D
+#define GL_QUAD_ALPHA4_SGIS 0x811E
+#define GL_QUAD_ALPHA8_SGIS 0x811F
+#define GL_QUAD_LUMINANCE4_SGIS 0x8120
+#define GL_QUAD_LUMINANCE8_SGIS 0x8121
+#define GL_QUAD_INTENSITY4_SGIS 0x8122
+#define GL_QUAD_INTENSITY8_SGIS 0x8123
+#define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124
+#define GL_QUAD_TEXTURE_SELECT_SGIS 0x8125
+#endif
+
+#ifndef GL_SGIX_sprite
+#define GL_SPRITE_SGIX 0x8148
+#define GL_SPRITE_MODE_SGIX 0x8149
+#define GL_SPRITE_AXIS_SGIX 0x814A
+#define GL_SPRITE_TRANSLATION_SGIX 0x814B
+#define GL_SPRITE_AXIAL_SGIX 0x814C
+#define GL_SPRITE_OBJECT_ALIGNED_SGIX 0x814D
+#define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E
+#endif
+
+#ifndef GL_SGIX_texture_multi_buffer
+#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E
+#endif
+
+#ifndef GL_EXT_point_parameters
+#define GL_POINT_SIZE_MIN_EXT 0x8126
+#define GL_POINT_SIZE_MAX_EXT 0x8127
+#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128
+#define GL_DISTANCE_ATTENUATION_EXT 0x8129
+#endif
+
+#ifndef GL_SGIS_point_parameters
+#define GL_POINT_SIZE_MIN_SGIS 0x8126
+#define GL_POINT_SIZE_MAX_SGIS 0x8127
+#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128
+#define GL_DISTANCE_ATTENUATION_SGIS 0x8129
+#endif
+
+#ifndef GL_SGIX_instruments
+#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180
+#define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181
+#endif
+
+#ifndef GL_SGIX_texture_scale_bias
+#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179
+#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A
+#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B
+#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C
+#endif
+
+#ifndef GL_SGIX_framezoom
+#define GL_FRAMEZOOM_SGIX 0x818B
+#define GL_FRAMEZOOM_FACTOR_SGIX 0x818C
+#define GL_MAX_FRAMEZOOM_FACTOR_SGIX 0x818D
+#endif
+
+#ifndef GL_SGIX_tag_sample_buffer
+#endif
+
+#ifndef GL_FfdMaskSGIX
+#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x00000001
+#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x00000002
+#endif
+
+#ifndef GL_SGIX_polynomial_ffd
+#define GL_GEOMETRY_DEFORMATION_SGIX 0x8194
+#define GL_TEXTURE_DEFORMATION_SGIX 0x8195
+#define GL_DEFORMATIONS_MASK_SGIX 0x8196
+#define GL_MAX_DEFORMATION_ORDER_SGIX 0x8197
+#endif
+
+#ifndef GL_SGIX_reference_plane
+#define GL_REFERENCE_PLANE_SGIX 0x817D
+#define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E
+#endif
+
+#ifndef GL_SGIX_flush_raster
+#endif
+
+#ifndef GL_SGIX_depth_texture
+#define GL_DEPTH_COMPONENT16_SGIX 0x81A5
+#define GL_DEPTH_COMPONENT24_SGIX 0x81A6
+#define GL_DEPTH_COMPONENT32_SGIX 0x81A7
+#endif
+
+#ifndef GL_SGIS_fog_function
+#define GL_FOG_FUNC_SGIS 0x812A
+#define GL_FOG_FUNC_POINTS_SGIS 0x812B
+#define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C
+#endif
+
+#ifndef GL_SGIX_fog_offset
+#define GL_FOG_OFFSET_SGIX 0x8198
+#define GL_FOG_OFFSET_VALUE_SGIX 0x8199
+#endif
+
+#ifndef GL_HP_image_transform
+#define GL_IMAGE_SCALE_X_HP 0x8155
+#define GL_IMAGE_SCALE_Y_HP 0x8156
+#define GL_IMAGE_TRANSLATE_X_HP 0x8157
+#define GL_IMAGE_TRANSLATE_Y_HP 0x8158
+#define GL_IMAGE_ROTATE_ANGLE_HP 0x8159
+#define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A
+#define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B
+#define GL_IMAGE_MAG_FILTER_HP 0x815C
+#define GL_IMAGE_MIN_FILTER_HP 0x815D
+#define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E
+#define GL_CUBIC_HP 0x815F
+#define GL_AVERAGE_HP 0x8160
+#define GL_IMAGE_TRANSFORM_2D_HP 0x8161
+#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162
+#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163
+#endif
+
+#ifndef GL_HP_convolution_border_modes
+#define GL_IGNORE_BORDER_HP 0x8150
+#define GL_CONSTANT_BORDER_HP 0x8151
+#define GL_REPLICATE_BORDER_HP 0x8153
+#define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154
+#endif
+
+#ifndef GL_INGR_palette_buffer
+#endif
+
+#ifndef GL_SGIX_texture_add_env
+#define GL_TEXTURE_ENV_BIAS_SGIX 0x80BE
+#endif
+
+#ifndef GL_EXT_color_subtable
+#endif
+
+#ifndef GL_PGI_vertex_hints
+#define GL_VERTEX_DATA_HINT_PGI 0x1A22A
+#define GL_VERTEX_CONSISTENT_HINT_PGI 0x1A22B
+#define GL_MATERIAL_SIDE_HINT_PGI 0x1A22C
+#define GL_MAX_VERTEX_HINT_PGI 0x1A22D
+#define GL_COLOR3_BIT_PGI 0x00010000
+#define GL_COLOR4_BIT_PGI 0x00020000
+#define GL_EDGEFLAG_BIT_PGI 0x00040000
+#define GL_INDEX_BIT_PGI 0x00080000
+#define GL_MAT_AMBIENT_BIT_PGI 0x00100000
+#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000
+#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000
+#define GL_MAT_EMISSION_BIT_PGI 0x00800000
+#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000
+#define GL_MAT_SHININESS_BIT_PGI 0x02000000
+#define GL_MAT_SPECULAR_BIT_PGI 0x04000000
+#define GL_NORMAL_BIT_PGI 0x08000000
+#define GL_TEXCOORD1_BIT_PGI 0x10000000
+#define GL_TEXCOORD2_BIT_PGI 0x20000000
+#define GL_TEXCOORD3_BIT_PGI 0x40000000
+#define GL_TEXCOORD4_BIT_PGI 0x80000000
+#define GL_VERTEX23_BIT_PGI 0x00000004
+#define GL_VERTEX4_BIT_PGI 0x00000008
+#endif
+
+#ifndef GL_PGI_misc_hints
+#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 0x1A1F8
+#define GL_CONSERVE_MEMORY_HINT_PGI 0x1A1FD
+#define GL_RECLAIM_MEMORY_HINT_PGI 0x1A1FE
+#define GL_NATIVE_GRAPHICS_HANDLE_PGI 0x1A202
+#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203
+#define GL_NATIVE_GRAPHICS_END_HINT_PGI 0x1A204
+#define GL_ALWAYS_FAST_HINT_PGI 0x1A20C
+#define GL_ALWAYS_SOFT_HINT_PGI 0x1A20D
+#define GL_ALLOW_DRAW_OBJ_HINT_PGI 0x1A20E
+#define GL_ALLOW_DRAW_WIN_HINT_PGI 0x1A20F
+#define GL_ALLOW_DRAW_FRG_HINT_PGI 0x1A210
+#define GL_ALLOW_DRAW_MEM_HINT_PGI 0x1A211
+#define GL_STRICT_DEPTHFUNC_HINT_PGI 0x1A216
+#define GL_STRICT_LIGHTING_HINT_PGI 0x1A217
+#define GL_STRICT_SCISSOR_HINT_PGI 0x1A218
+#define GL_FULL_STIPPLE_HINT_PGI 0x1A219
+#define GL_CLIP_NEAR_HINT_PGI 0x1A220
+#define GL_CLIP_FAR_HINT_PGI 0x1A221
+#define GL_WIDE_LINE_HINT_PGI 0x1A222
+#define GL_BACK_NORMALS_HINT_PGI 0x1A223
+#endif
+
+#ifndef GL_EXT_paletted_texture
+#define GL_COLOR_INDEX1_EXT 0x80E2
+#define GL_COLOR_INDEX2_EXT 0x80E3
+#define GL_COLOR_INDEX4_EXT 0x80E4
+#define GL_COLOR_INDEX8_EXT 0x80E5
+#define GL_COLOR_INDEX12_EXT 0x80E6
+#define GL_COLOR_INDEX16_EXT 0x80E7
+#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED
+#endif
+
+#ifndef GL_EXT_clip_volume_hint
+#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0
+#endif
+
+#ifndef GL_SGIX_list_priority
+#define GL_LIST_PRIORITY_SGIX 0x8182
+#endif
+
+#ifndef GL_SGIX_ir_instrument1
+#define GL_IR_INSTRUMENT1_SGIX 0x817F
+#endif
+
+#ifndef GL_SGIX_calligraphic_fragment
+#define GL_CALLIGRAPHIC_FRAGMENT_SGIX 0x8183
+#endif
+
+#ifndef GL_SGIX_texture_lod_bias
+#define GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E
+#define GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F
+#define GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190
+#endif
+
+#ifndef GL_SGIX_shadow_ambient
+#define GL_SHADOW_AMBIENT_SGIX 0x80BF
+#endif
+
+#ifndef GL_EXT_index_texture
+#endif
+
+#ifndef GL_EXT_index_material
+#define GL_INDEX_MATERIAL_EXT 0x81B8
+#define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9
+#define GL_INDEX_MATERIAL_FACE_EXT 0x81BA
+#endif
+
+#ifndef GL_EXT_index_func
+#define GL_INDEX_TEST_EXT 0x81B5
+#define GL_INDEX_TEST_FUNC_EXT 0x81B6
+#define GL_INDEX_TEST_REF_EXT 0x81B7
+#endif
+
+#ifndef GL_EXT_index_array_formats
+#define GL_IUI_V2F_EXT 0x81AD
+#define GL_IUI_V3F_EXT 0x81AE
+#define GL_IUI_N3F_V2F_EXT 0x81AF
+#define GL_IUI_N3F_V3F_EXT 0x81B0
+#define GL_T2F_IUI_V2F_EXT 0x81B1
+#define GL_T2F_IUI_V3F_EXT 0x81B2
+#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3
+#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4
+#endif
+
+#ifndef GL_EXT_compiled_vertex_array
+#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8
+#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9
+#endif
+
+#ifndef GL_EXT_cull_vertex
+#define GL_CULL_VERTEX_EXT 0x81AA
+#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB
+#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC
+#endif
+
+#ifndef GL_SGIX_ycrcb
+#define GL_YCRCB_422_SGIX 0x81BB
+#define GL_YCRCB_444_SGIX 0x81BC
+#endif
+
+#ifndef GL_SGIX_fragment_lighting
+#define GL_FRAGMENT_LIGHTING_SGIX 0x8400
+#define GL_FRAGMENT_COLOR_MATERIAL_SGIX 0x8401
+#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402
+#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403
+#define GL_MAX_FRAGMENT_LIGHTS_SGIX 0x8404
+#define GL_MAX_ACTIVE_LIGHTS_SGIX 0x8405
+#define GL_CURRENT_RASTER_NORMAL_SGIX 0x8406
+#define GL_LIGHT_ENV_MODE_SGIX 0x8407
+#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408
+#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409
+#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A
+#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B
+#define GL_FRAGMENT_LIGHT0_SGIX 0x840C
+#define GL_FRAGMENT_LIGHT1_SGIX 0x840D
+#define GL_FRAGMENT_LIGHT2_SGIX 0x840E
+#define GL_FRAGMENT_LIGHT3_SGIX 0x840F
+#define GL_FRAGMENT_LIGHT4_SGIX 0x8410
+#define GL_FRAGMENT_LIGHT5_SGIX 0x8411
+#define GL_FRAGMENT_LIGHT6_SGIX 0x8412
+#define GL_FRAGMENT_LIGHT7_SGIX 0x8413
+#endif
+
+#ifndef GL_IBM_rasterpos_clip
+#define GL_RASTER_POSITION_UNCLIPPED_IBM 0x19262
+#endif
+
+#ifndef GL_HP_texture_lighting
+#define GL_TEXTURE_LIGHTING_MODE_HP 0x8167
+#define GL_TEXTURE_POST_SPECULAR_HP 0x8168
+#define GL_TEXTURE_PRE_SPECULAR_HP 0x8169
+#endif
+
+#ifndef GL_EXT_draw_range_elements
+#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8
+#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9
+#endif
+
+#ifndef GL_WIN_phong_shading
+#define GL_PHONG_WIN 0x80EA
+#define GL_PHONG_HINT_WIN 0x80EB
+#endif
+
+#ifndef GL_WIN_specular_fog
+#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC
+#endif
+
+#ifndef GL_EXT_light_texture
+#define GL_FRAGMENT_MATERIAL_EXT 0x8349
+#define GL_FRAGMENT_NORMAL_EXT 0x834A
+#define GL_FRAGMENT_COLOR_EXT 0x834C
+#define GL_ATTENUATION_EXT 0x834D
+#define GL_SHADOW_ATTENUATION_EXT 0x834E
+#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F
+#define GL_TEXTURE_LIGHT_EXT 0x8350
+#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351
+#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352
+/* reuse GL_FRAGMENT_DEPTH_EXT */
+#endif
+
+#ifndef GL_SGIX_blend_alpha_minmax
+#define GL_ALPHA_MIN_SGIX 0x8320
+#define GL_ALPHA_MAX_SGIX 0x8321
+#endif
+
+#ifndef GL_SGIX_impact_pixel_texture
+#define GL_PIXEL_TEX_GEN_Q_CEILING_SGIX 0x8184
+#define GL_PIXEL_TEX_GEN_Q_ROUND_SGIX 0x8185
+#define GL_PIXEL_TEX_GEN_Q_FLOOR_SGIX 0x8186
+#define GL_PIXEL_TEX_GEN_ALPHA_REPLACE_SGIX 0x8187
+#define GL_PIXEL_TEX_GEN_ALPHA_NO_REPLACE_SGIX 0x8188
+#define GL_PIXEL_TEX_GEN_ALPHA_LS_SGIX 0x8189
+#define GL_PIXEL_TEX_GEN_ALPHA_MS_SGIX 0x818A
+#endif
+
+#ifndef GL_EXT_bgra
+#define GL_BGR_EXT 0x80E0
+#define GL_BGRA_EXT 0x80E1
+#endif
+
+#ifndef GL_SGIX_async
+#define GL_ASYNC_MARKER_SGIX 0x8329
+#endif
+
+#ifndef GL_SGIX_async_pixel
+#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C
+#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D
+#define GL_ASYNC_READ_PIXELS_SGIX 0x835E
+#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F
+#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360
+#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361
+#endif
+
+#ifndef GL_SGIX_async_histogram
+#define GL_ASYNC_HISTOGRAM_SGIX 0x832C
+#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D
+#endif
+
+#ifndef GL_INTEL_texture_scissor
+#endif
+
+#ifndef GL_INTEL_parallel_arrays
+#define GL_PARALLEL_ARRAYS_INTEL 0x83F4
+#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5
+#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6
+#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7
+#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8
+#endif
+
+#ifndef GL_HP_occlusion_test
+#define GL_OCCLUSION_TEST_HP 0x8165
+#define GL_OCCLUSION_TEST_RESULT_HP 0x8166
+#endif
+
+#ifndef GL_EXT_pixel_transform
+#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330
+#define GL_PIXEL_MAG_FILTER_EXT 0x8331
+#define GL_PIXEL_MIN_FILTER_EXT 0x8332
+#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333
+#define GL_CUBIC_EXT 0x8334
+#define GL_AVERAGE_EXT 0x8335
+#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336
+#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337
+#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338
+#endif
+
+#ifndef GL_EXT_pixel_transform_color_table
+#endif
+
+#ifndef GL_EXT_shared_texture_palette
+#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB
+#endif
+
+#ifndef GL_EXT_separate_specular_color
+#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8
+#define GL_SINGLE_COLOR_EXT 0x81F9
+#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA
+#endif
+
+#ifndef GL_EXT_secondary_color
+#define GL_COLOR_SUM_EXT 0x8458
+#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459
+#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A
+#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B
+#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C
+#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D
+#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E
+#endif
+
+#ifndef GL_EXT_texture_perturb_normal
+#define GL_PERTURB_EXT 0x85AE
+#define GL_TEXTURE_NORMAL_EXT 0x85AF
+#endif
+
+#ifndef GL_EXT_multi_draw_arrays
+#endif
+
+#ifndef GL_EXT_fog_coord
+#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450
+#define GL_FOG_COORDINATE_EXT 0x8451
+#define GL_FRAGMENT_DEPTH_EXT 0x8452
+#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453
+#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454
+#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455
+#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456
+#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457
+#endif
+
+#ifndef GL_REND_screen_coordinates
+#define GL_SCREEN_COORDINATES_REND 0x8490
+#define GL_INVERTED_SCREEN_W_REND 0x8491
+#endif
+
+#ifndef GL_EXT_coordinate_frame
+#define GL_TANGENT_ARRAY_EXT 0x8439
+#define GL_BINORMAL_ARRAY_EXT 0x843A
+#define GL_CURRENT_TANGENT_EXT 0x843B
+#define GL_CURRENT_BINORMAL_EXT 0x843C
+#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E
+#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F
+#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440
+#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441
+#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442
+#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443
+#define GL_MAP1_TANGENT_EXT 0x8444
+#define GL_MAP2_TANGENT_EXT 0x8445
+#define GL_MAP1_BINORMAL_EXT 0x8446
+#define GL_MAP2_BINORMAL_EXT 0x8447
+#endif
+
+#ifndef GL_EXT_texture_env_combine
+#define GL_COMBINE_EXT 0x8570
+#define GL_COMBINE_RGB_EXT 0x8571
+#define GL_COMBINE_ALPHA_EXT 0x8572
+#define GL_RGB_SCALE_EXT 0x8573
+#define GL_ADD_SIGNED_EXT 0x8574
+#define GL_INTERPOLATE_EXT 0x8575
+#define GL_CONSTANT_EXT 0x8576
+#define GL_PRIMARY_COLOR_EXT 0x8577
+#define GL_PREVIOUS_EXT 0x8578
+#define GL_SOURCE0_RGB_EXT 0x8580
+#define GL_SOURCE1_RGB_EXT 0x8581
+#define GL_SOURCE2_RGB_EXT 0x8582
+#define GL_SOURCE0_ALPHA_EXT 0x8588
+#define GL_SOURCE1_ALPHA_EXT 0x8589
+#define GL_SOURCE2_ALPHA_EXT 0x858A
+#define GL_OPERAND0_RGB_EXT 0x8590
+#define GL_OPERAND1_RGB_EXT 0x8591
+#define GL_OPERAND2_RGB_EXT 0x8592
+#define GL_OPERAND0_ALPHA_EXT 0x8598
+#define GL_OPERAND1_ALPHA_EXT 0x8599
+#define GL_OPERAND2_ALPHA_EXT 0x859A
+#endif
+
+#ifndef GL_APPLE_specular_vector
+#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0
+#endif
+
+#ifndef GL_APPLE_transform_hint
+#define GL_TRANSFORM_HINT_APPLE 0x85B1
+#endif
+
+#ifndef GL_SGIX_fog_scale
+#define GL_FOG_SCALE_SGIX 0x81FC
+#define GL_FOG_SCALE_VALUE_SGIX 0x81FD
+#endif
+
+#ifndef GL_SUNX_constant_data
+#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5
+#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6
+#endif
+
+#ifndef GL_SUN_global_alpha
+#define GL_GLOBAL_ALPHA_SUN 0x81D9
+#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA
+#endif
+
+#ifndef GL_SUN_triangle_list
+#define GL_RESTART_SUN 0x0001
+#define GL_REPLACE_MIDDLE_SUN 0x0002
+#define GL_REPLACE_OLDEST_SUN 0x0003
+#define GL_TRIANGLE_LIST_SUN 0x81D7
+#define GL_REPLACEMENT_CODE_SUN 0x81D8
+#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0
+#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1
+#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2
+#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3
+#define GL_R1UI_V3F_SUN 0x85C4
+#define GL_R1UI_C4UB_V3F_SUN 0x85C5
+#define GL_R1UI_C3F_V3F_SUN 0x85C6
+#define GL_R1UI_N3F_V3F_SUN 0x85C7
+#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8
+#define GL_R1UI_T2F_V3F_SUN 0x85C9
+#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA
+#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB
+#endif
+
+#ifndef GL_SUN_vertex
+#endif
+
+#ifndef GL_EXT_blend_func_separate
+#define GL_BLEND_DST_RGB_EXT 0x80C8
+#define GL_BLEND_SRC_RGB_EXT 0x80C9
+#define GL_BLEND_DST_ALPHA_EXT 0x80CA
+#define GL_BLEND_SRC_ALPHA_EXT 0x80CB
+#endif
+
+#ifndef GL_INGR_color_clamp
+#define GL_RED_MIN_CLAMP_INGR 0x8560
+#define GL_GREEN_MIN_CLAMP_INGR 0x8561
+#define GL_BLUE_MIN_CLAMP_INGR 0x8562
+#define GL_ALPHA_MIN_CLAMP_INGR 0x8563
+#define GL_RED_MAX_CLAMP_INGR 0x8564
+#define GL_GREEN_MAX_CLAMP_INGR 0x8565
+#define GL_BLUE_MAX_CLAMP_INGR 0x8566
+#define GL_ALPHA_MAX_CLAMP_INGR 0x8567
+#endif
+
+#ifndef GL_INGR_interlace_read
+#define GL_INTERLACE_READ_INGR 0x8568
+#endif
+
+#ifndef GL_EXT_stencil_wrap
+#define GL_INCR_WRAP_EXT 0x8507
+#define GL_DECR_WRAP_EXT 0x8508
+#endif
+
+#ifndef GL_EXT_422_pixels
+#define GL_422_EXT 0x80CC
+#define GL_422_REV_EXT 0x80CD
+#define GL_422_AVERAGE_EXT 0x80CE
+#define GL_422_REV_AVERAGE_EXT 0x80CF
+#endif
+
+#ifndef GL_NV_texgen_reflection
+#define GL_NORMAL_MAP_NV 0x8511
+#define GL_REFLECTION_MAP_NV 0x8512
+#endif
+
+#ifndef GL_EXT_texture_cube_map
+#define GL_NORMAL_MAP_EXT 0x8511
+#define GL_REFLECTION_MAP_EXT 0x8512
+#define GL_TEXTURE_CUBE_MAP_EXT 0x8513
+#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A
+#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C
+#endif
+
+#ifndef GL_SUN_convolution_border_modes
+#define GL_WRAP_BORDER_SUN 0x81D4
+#endif
+
+#ifndef GL_EXT_texture_env_add
+#endif
+
+#ifndef GL_EXT_texture_lod_bias
+#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD
+#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500
+#define GL_TEXTURE_LOD_BIAS_EXT 0x8501
+#endif
+
+#ifndef GL_EXT_texture_filter_anisotropic
+#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
+#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
+#endif
+
+#ifndef GL_EXT_vertex_weighting
+#define GL_MODELVIEW0_STACK_DEPTH_EXT GL_MODELVIEW_STACK_DEPTH
+#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502
+#define GL_MODELVIEW0_MATRIX_EXT GL_MODELVIEW_MATRIX
+#define GL_MODELVIEW1_MATRIX_EXT 0x8506
+#define GL_VERTEX_WEIGHTING_EXT 0x8509
+#define GL_MODELVIEW0_EXT GL_MODELVIEW
+#define GL_MODELVIEW1_EXT 0x850A
+#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B
+#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C
+#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D
+#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E
+#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F
+#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510
+#endif
+
+#ifndef GL_NV_light_max_exponent
+#define GL_MAX_SHININESS_NV 0x8504
+#define GL_MAX_SPOT_EXPONENT_NV 0x8505
+#endif
+
+#ifndef GL_NV_vertex_array_range
+#define GL_VERTEX_ARRAY_RANGE_NV 0x851D
+#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E
+#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F
+#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520
+#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521
+#endif
+
+#ifndef GL_NV_register_combiners
+#define GL_REGISTER_COMBINERS_NV 0x8522
+#define GL_VARIABLE_A_NV 0x8523
+#define GL_VARIABLE_B_NV 0x8524
+#define GL_VARIABLE_C_NV 0x8525
+#define GL_VARIABLE_D_NV 0x8526
+#define GL_VARIABLE_E_NV 0x8527
+#define GL_VARIABLE_F_NV 0x8528
+#define GL_VARIABLE_G_NV 0x8529
+#define GL_CONSTANT_COLOR0_NV 0x852A
+#define GL_CONSTANT_COLOR1_NV 0x852B
+#define GL_PRIMARY_COLOR_NV 0x852C
+#define GL_SECONDARY_COLOR_NV 0x852D
+#define GL_SPARE0_NV 0x852E
+#define GL_SPARE1_NV 0x852F
+#define GL_DISCARD_NV 0x8530
+#define GL_E_TIMES_F_NV 0x8531
+#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532
+#define GL_UNSIGNED_IDENTITY_NV 0x8536
+#define GL_UNSIGNED_INVERT_NV 0x8537
+#define GL_EXPAND_NORMAL_NV 0x8538
+#define GL_EXPAND_NEGATE_NV 0x8539
+#define GL_HALF_BIAS_NORMAL_NV 0x853A
+#define GL_HALF_BIAS_NEGATE_NV 0x853B
+#define GL_SIGNED_IDENTITY_NV 0x853C
+#define GL_SIGNED_NEGATE_NV 0x853D
+#define GL_SCALE_BY_TWO_NV 0x853E
+#define GL_SCALE_BY_FOUR_NV 0x853F
+#define GL_SCALE_BY_ONE_HALF_NV 0x8540
+#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541
+#define GL_COMBINER_INPUT_NV 0x8542
+#define GL_COMBINER_MAPPING_NV 0x8543
+#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544
+#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545
+#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546
+#define GL_COMBINER_MUX_SUM_NV 0x8547
+#define GL_COMBINER_SCALE_NV 0x8548
+#define GL_COMBINER_BIAS_NV 0x8549
+#define GL_COMBINER_AB_OUTPUT_NV 0x854A
+#define GL_COMBINER_CD_OUTPUT_NV 0x854B
+#define GL_COMBINER_SUM_OUTPUT_NV 0x854C
+#define GL_MAX_GENERAL_COMBINERS_NV 0x854D
+#define GL_NUM_GENERAL_COMBINERS_NV 0x854E
+#define GL_COLOR_SUM_CLAMP_NV 0x854F
+#define GL_COMBINER0_NV 0x8550
+#define GL_COMBINER1_NV 0x8551
+#define GL_COMBINER2_NV 0x8552
+#define GL_COMBINER3_NV 0x8553
+#define GL_COMBINER4_NV 0x8554
+#define GL_COMBINER5_NV 0x8555
+#define GL_COMBINER6_NV 0x8556
+#define GL_COMBINER7_NV 0x8557
+/* reuse GL_TEXTURE0_ARB */
+/* reuse GL_TEXTURE1_ARB */
+/* reuse GL_ZERO */
+/* reuse GL_NONE */
+/* reuse GL_FOG */
+#endif
+
+#ifndef GL_NV_fog_distance
+#define GL_FOG_DISTANCE_MODE_NV 0x855A
+#define GL_EYE_RADIAL_NV 0x855B
+#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C
+/* reuse GL_EYE_PLANE */
+#endif
+
+#ifndef GL_NV_texgen_emboss
+#define GL_EMBOSS_LIGHT_NV 0x855D
+#define GL_EMBOSS_CONSTANT_NV 0x855E
+#define GL_EMBOSS_MAP_NV 0x855F
+#endif
+
+#ifndef GL_NV_blend_square
+#endif
+
+#ifndef GL_NV_texture_env_combine4
+#define GL_COMBINE4_NV 0x8503
+#define GL_SOURCE3_RGB_NV 0x8583
+#define GL_SOURCE3_ALPHA_NV 0x858B
+#define GL_OPERAND3_RGB_NV 0x8593
+#define GL_OPERAND3_ALPHA_NV 0x859B
+#endif
+
+#ifndef GL_MESA_resize_buffers
+#endif
+
+#ifndef GL_MESA_window_pos
+#endif
+
+#ifndef GL_EXT_texture_compression_s3tc
+#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
+#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
+#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2
+#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3
+#endif
+
+#ifndef GL_IBM_cull_vertex
+#define GL_CULL_VERTEX_IBM 103050
+#endif
+
+#ifndef GL_IBM_multimode_draw_arrays
+#endif
+
+#ifndef GL_IBM_vertex_array_lists
+#define GL_VERTEX_ARRAY_LIST_IBM 103070
+#define GL_NORMAL_ARRAY_LIST_IBM 103071
+#define GL_COLOR_ARRAY_LIST_IBM 103072
+#define GL_INDEX_ARRAY_LIST_IBM 103073
+#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074
+#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075
+#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076
+#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077
+#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080
+#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081
+#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082
+#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083
+#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084
+#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085
+#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086
+#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087
+#endif
+
+#ifndef GL_SGIX_subsample
+#define GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0
+#define GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1
+#define GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2
+#define GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3
+#define GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4
+#endif
+
+#ifndef GL_SGIX_ycrcb_subsample
+#endif
+
+#ifndef GL_SGIX_ycrcba
+#define GL_YCRCB_SGIX 0x8318
+#define GL_YCRCBA_SGIX 0x8319
+#endif
+
+#ifndef GL_SGI_depth_pass_instrument
+#define GL_DEPTH_PASS_INSTRUMENT_SGIX 0x8310
+#define GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX 0x8311
+#define GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX 0x8312
+#endif
+
+#ifndef GL_3DFX_texture_compression_FXT1
+#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0
+#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1
+#endif
+
+#ifndef GL_3DFX_multisample
+#define GL_MULTISAMPLE_3DFX 0x86B2
+#define GL_SAMPLE_BUFFERS_3DFX 0x86B3
+#define GL_SAMPLES_3DFX 0x86B4
+#define GL_MULTISAMPLE_BIT_3DFX 0x20000000
+#endif
+
+#ifndef GL_3DFX_tbuffer
+#endif
+
+#ifndef GL_EXT_multisample
+#define GL_MULTISAMPLE_EXT 0x809D
+#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F
+#define GL_SAMPLE_MASK_EXT 0x80A0
+#define GL_1PASS_EXT 0x80A1
+#define GL_2PASS_0_EXT 0x80A2
+#define GL_2PASS_1_EXT 0x80A3
+#define GL_4PASS_0_EXT 0x80A4
+#define GL_4PASS_1_EXT 0x80A5
+#define GL_4PASS_2_EXT 0x80A6
+#define GL_4PASS_3_EXT 0x80A7
+#define GL_SAMPLE_BUFFERS_EXT 0x80A8
+#define GL_SAMPLES_EXT 0x80A9
+#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA
+#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB
+#define GL_SAMPLE_PATTERN_EXT 0x80AC
+#define GL_MULTISAMPLE_BIT_EXT 0x20000000
+#endif
+
+#ifndef GL_SGIX_vertex_preclip
+#define GL_VERTEX_PRECLIP_SGIX 0x83EE
+#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF
+#endif
+
+#ifndef GL_SGIX_convolution_accuracy
+#define GL_CONVOLUTION_HINT_SGIX 0x8316
+#endif
+
+#ifndef GL_SGIX_resample
+#define GL_PACK_RESAMPLE_SGIX 0x842C
+#define GL_UNPACK_RESAMPLE_SGIX 0x842D
+#define GL_RESAMPLE_REPLICATE_SGIX 0x842E
+#define GL_RESAMPLE_ZERO_FILL_SGIX 0x842F
+#define GL_RESAMPLE_DECIMATE_SGIX 0x8430
+#endif
+
+#ifndef GL_SGIS_point_line_texgen
+#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0
+#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1
+#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2
+#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3
+#define GL_EYE_POINT_SGIS 0x81F4
+#define GL_OBJECT_POINT_SGIS 0x81F5
+#define GL_EYE_LINE_SGIS 0x81F6
+#define GL_OBJECT_LINE_SGIS 0x81F7
+#endif
+
+#ifndef GL_SGIS_texture_color_mask
+#define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF
+#endif
+
+#ifndef GL_EXT_texture_env_dot3
+#define GL_DOT3_RGB_EXT 0x8740
+#define GL_DOT3_RGBA_EXT 0x8741
+#endif
+
+#ifndef GL_ATI_texture_mirror_once
+#define GL_MIRROR_CLAMP_ATI 0x8742
+#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743
+#endif
+
+#ifndef GL_NV_fence
+#define GL_ALL_COMPLETED_NV 0x84F2
+#define GL_FENCE_STATUS_NV 0x84F3
+#define GL_FENCE_CONDITION_NV 0x84F4
+#endif
+
+#ifndef GL_IBM_texture_mirrored_repeat
+#define GL_MIRRORED_REPEAT_IBM 0x8370
+#endif
+
+#ifndef GL_NV_evaluators
+#define GL_EVAL_2D_NV 0x86C0
+#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1
+#define GL_MAP_TESSELLATION_NV 0x86C2
+#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3
+#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4
+#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5
+#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6
+#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7
+#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8
+#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9
+#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA
+#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB
+#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC
+#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD
+#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE
+#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF
+#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0
+#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1
+#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2
+#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3
+#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4
+#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5
+#define GL_MAX_MAP_TESSELLATION_NV 0x86D6
+#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7
+#endif
+
+#ifndef GL_NV_packed_depth_stencil
+#define GL_DEPTH_STENCIL_NV 0x84F9
+#define GL_UNSIGNED_INT_24_8_NV 0x84FA
+#endif
+
+#ifndef GL_NV_register_combiners2
+#define GL_PER_STAGE_CONSTANTS_NV 0x8535
+#endif
+
+#ifndef GL_NV_texture_compression_vtc
+#endif
+
+#ifndef GL_NV_texture_rectangle
+#define GL_TEXTURE_RECTANGLE_NV 0x84F5
+#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6
+#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7
+#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8
+#endif
+
+#ifndef GL_NV_texture_shader
+#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C
+#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D
+#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E
+#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9
+#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA
+#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB
+#define GL_DSDT_MAG_INTENSITY_NV 0x86DC
+#define GL_SHADER_CONSISTENT_NV 0x86DD
+#define GL_TEXTURE_SHADER_NV 0x86DE
+#define GL_SHADER_OPERATION_NV 0x86DF
+#define GL_CULL_MODES_NV 0x86E0
+#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1
+#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2
+#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3
+#define GL_OFFSET_TEXTURE_2D_MATRIX_NV GL_OFFSET_TEXTURE_MATRIX_NV
+#define GL_OFFSET_TEXTURE_2D_SCALE_NV GL_OFFSET_TEXTURE_SCALE_NV
+#define GL_OFFSET_TEXTURE_2D_BIAS_NV GL_OFFSET_TEXTURE_BIAS_NV
+#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4
+#define GL_CONST_EYE_NV 0x86E5
+#define GL_PASS_THROUGH_NV 0x86E6
+#define GL_CULL_FRAGMENT_NV 0x86E7
+#define GL_OFFSET_TEXTURE_2D_NV 0x86E8
+#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9
+#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA
+#define GL_DOT_PRODUCT_NV 0x86EC
+#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED
+#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE
+#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0
+#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1
+#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2
+#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3
+#define GL_HILO_NV 0x86F4
+#define GL_DSDT_NV 0x86F5
+#define GL_DSDT_MAG_NV 0x86F6
+#define GL_DSDT_MAG_VIB_NV 0x86F7
+#define GL_HILO16_NV 0x86F8
+#define GL_SIGNED_HILO_NV 0x86F9
+#define GL_SIGNED_HILO16_NV 0x86FA
+#define GL_SIGNED_RGBA_NV 0x86FB
+#define GL_SIGNED_RGBA8_NV 0x86FC
+#define GL_SIGNED_RGB_NV 0x86FE
+#define GL_SIGNED_RGB8_NV 0x86FF
+#define GL_SIGNED_LUMINANCE_NV 0x8701
+#define GL_SIGNED_LUMINANCE8_NV 0x8702
+#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703
+#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704
+#define GL_SIGNED_ALPHA_NV 0x8705
+#define GL_SIGNED_ALPHA8_NV 0x8706
+#define GL_SIGNED_INTENSITY_NV 0x8707
+#define GL_SIGNED_INTENSITY8_NV 0x8708
+#define GL_DSDT8_NV 0x8709
+#define GL_DSDT8_MAG8_NV 0x870A
+#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B
+#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C
+#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D
+#define GL_HI_SCALE_NV 0x870E
+#define GL_LO_SCALE_NV 0x870F
+#define GL_DS_SCALE_NV 0x8710
+#define GL_DT_SCALE_NV 0x8711
+#define GL_MAGNITUDE_SCALE_NV 0x8712
+#define GL_VIBRANCE_SCALE_NV 0x8713
+#define GL_HI_BIAS_NV 0x8714
+#define GL_LO_BIAS_NV 0x8715
+#define GL_DS_BIAS_NV 0x8716
+#define GL_DT_BIAS_NV 0x8717
+#define GL_MAGNITUDE_BIAS_NV 0x8718
+#define GL_VIBRANCE_BIAS_NV 0x8719
+#define GL_TEXTURE_BORDER_VALUES_NV 0x871A
+#define GL_TEXTURE_HI_SIZE_NV 0x871B
+#define GL_TEXTURE_LO_SIZE_NV 0x871C
+#define GL_TEXTURE_DS_SIZE_NV 0x871D
+#define GL_TEXTURE_DT_SIZE_NV 0x871E
+#define GL_TEXTURE_MAG_SIZE_NV 0x871F
+#endif
+
+#ifndef GL_NV_texture_shader2
+#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF
+#endif
+
+#ifndef GL_NV_vertex_array_range2
+#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533
+#endif
+
+#ifndef GL_NV_vertex_program
+#define GL_VERTEX_PROGRAM_NV 0x8620
+#define GL_VERTEX_STATE_PROGRAM_NV 0x8621
+#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623
+#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624
+#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625
+#define GL_CURRENT_ATTRIB_NV 0x8626
+#define GL_PROGRAM_LENGTH_NV 0x8627
+#define GL_PROGRAM_STRING_NV 0x8628
+#define GL_MODELVIEW_PROJECTION_NV 0x8629
+#define GL_IDENTITY_NV 0x862A
+#define GL_INVERSE_NV 0x862B
+#define GL_TRANSPOSE_NV 0x862C
+#define GL_INVERSE_TRANSPOSE_NV 0x862D
+#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E
+#define GL_MAX_TRACK_MATRICES_NV 0x862F
+#define GL_MATRIX0_NV 0x8630
+#define GL_MATRIX1_NV 0x8631
+#define GL_MATRIX2_NV 0x8632
+#define GL_MATRIX3_NV 0x8633
+#define GL_MATRIX4_NV 0x8634
+#define GL_MATRIX5_NV 0x8635
+#define GL_MATRIX6_NV 0x8636
+#define GL_MATRIX7_NV 0x8637
+#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640
+#define GL_CURRENT_MATRIX_NV 0x8641
+#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642
+#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643
+#define GL_PROGRAM_PARAMETER_NV 0x8644
+#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645
+#define GL_PROGRAM_TARGET_NV 0x8646
+#define GL_PROGRAM_RESIDENT_NV 0x8647
+#define GL_TRACK_MATRIX_NV 0x8648
+#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649
+#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A
+#define GL_PROGRAM_ERROR_POSITION_NV 0x864B
+#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650
+#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651
+#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652
+#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653
+#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654
+#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655
+#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656
+#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657
+#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658
+#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659
+#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A
+#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B
+#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C
+#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D
+#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E
+#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F
+#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660
+#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661
+#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662
+#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663
+#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664
+#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665
+#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666
+#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667
+#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668
+#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669
+#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A
+#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B
+#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C
+#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D
+#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E
+#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F
+#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670
+#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671
+#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672
+#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673
+#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674
+#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675
+#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676
+#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677
+#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678
+#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679
+#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A
+#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B
+#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C
+#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D
+#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E
+#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F
+#endif
+
+#ifndef GL_SGIX_texture_coordinate_clamp
+#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369
+#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A
+#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B
+#endif
+
+#ifndef GL_SGIX_scalebias_hint
+#define GL_SCALEBIAS_HINT_SGIX 0x8322
+#endif
+
+#ifndef GL_OML_interlace
+#define GL_INTERLACE_OML 0x8980
+#define GL_INTERLACE_READ_OML 0x8981
+#endif
+
+#ifndef GL_OML_subsample
+#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982
+#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983
+#endif
+
+#ifndef GL_OML_resample
+#define GL_PACK_RESAMPLE_OML 0x8984
+#define GL_UNPACK_RESAMPLE_OML 0x8985
+#define GL_RESAMPLE_REPLICATE_OML 0x8986
+#define GL_RESAMPLE_ZERO_FILL_OML 0x8987
+#define GL_RESAMPLE_AVERAGE_OML 0x8988
+#define GL_RESAMPLE_DECIMATE_OML 0x8989
+#endif
+
+#ifndef GL_NV_copy_depth_to_color
+#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E
+#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F
+#endif
+
+#ifndef GL_ATI_envmap_bumpmap
+#define GL_BUMP_ROT_MATRIX_ATI 0x8775
+#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776
+#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777
+#define GL_BUMP_TEX_UNITS_ATI 0x8778
+#define GL_DUDV_ATI 0x8779
+#define GL_DU8DV8_ATI 0x877A
+#define GL_BUMP_ENVMAP_ATI 0x877B
+#define GL_BUMP_TARGET_ATI 0x877C
+#endif
+
+#ifndef GL_ATI_fragment_shader
+#define GL_FRAGMENT_SHADER_ATI 0x8920
+#define GL_REG_0_ATI 0x8921
+#define GL_REG_1_ATI 0x8922
+#define GL_REG_2_ATI 0x8923
+#define GL_REG_3_ATI 0x8924
+#define GL_REG_4_ATI 0x8925
+#define GL_REG_5_ATI 0x8926
+#define GL_REG_6_ATI 0x8927
+#define GL_REG_7_ATI 0x8928
+#define GL_REG_8_ATI 0x8929
+#define GL_REG_9_ATI 0x892A
+#define GL_REG_10_ATI 0x892B
+#define GL_REG_11_ATI 0x892C
+#define GL_REG_12_ATI 0x892D
+#define GL_REG_13_ATI 0x892E
+#define GL_REG_14_ATI 0x892F
+#define GL_REG_15_ATI 0x8930
+#define GL_REG_16_ATI 0x8931
+#define GL_REG_17_ATI 0x8932
+#define GL_REG_18_ATI 0x8933
+#define GL_REG_19_ATI 0x8934
+#define GL_REG_20_ATI 0x8935
+#define GL_REG_21_ATI 0x8936
+#define GL_REG_22_ATI 0x8937
+#define GL_REG_23_ATI 0x8938
+#define GL_REG_24_ATI 0x8939
+#define GL_REG_25_ATI 0x893A
+#define GL_REG_26_ATI 0x893B
+#define GL_REG_27_ATI 0x893C
+#define GL_REG_28_ATI 0x893D
+#define GL_REG_29_ATI 0x893E
+#define GL_REG_30_ATI 0x893F
+#define GL_REG_31_ATI 0x8940
+#define GL_CON_0_ATI 0x8941
+#define GL_CON_1_ATI 0x8942
+#define GL_CON_2_ATI 0x8943
+#define GL_CON_3_ATI 0x8944
+#define GL_CON_4_ATI 0x8945
+#define GL_CON_5_ATI 0x8946
+#define GL_CON_6_ATI 0x8947
+#define GL_CON_7_ATI 0x8948
+#define GL_CON_8_ATI 0x8949
+#define GL_CON_9_ATI 0x894A
+#define GL_CON_10_ATI 0x894B
+#define GL_CON_11_ATI 0x894C
+#define GL_CON_12_ATI 0x894D
+#define GL_CON_13_ATI 0x894E
+#define GL_CON_14_ATI 0x894F
+#define GL_CON_15_ATI 0x8950
+#define GL_CON_16_ATI 0x8951
+#define GL_CON_17_ATI 0x8952
+#define GL_CON_18_ATI 0x8953
+#define GL_CON_19_ATI 0x8954
+#define GL_CON_20_ATI 0x8955
+#define GL_CON_21_ATI 0x8956
+#define GL_CON_22_ATI 0x8957
+#define GL_CON_23_ATI 0x8958
+#define GL_CON_24_ATI 0x8959
+#define GL_CON_25_ATI 0x895A
+#define GL_CON_26_ATI 0x895B
+#define GL_CON_27_ATI 0x895C
+#define GL_CON_28_ATI 0x895D
+#define GL_CON_29_ATI 0x895E
+#define GL_CON_30_ATI 0x895F
+#define GL_CON_31_ATI 0x8960
+#define GL_MOV_ATI 0x8961
+#define GL_ADD_ATI 0x8963
+#define GL_MUL_ATI 0x8964
+#define GL_SUB_ATI 0x8965
+#define GL_DOT3_ATI 0x8966
+#define GL_DOT4_ATI 0x8967
+#define GL_MAD_ATI 0x8968
+#define GL_LERP_ATI 0x8969
+#define GL_CND_ATI 0x896A
+#define GL_CND0_ATI 0x896B
+#define GL_DOT2_ADD_ATI 0x896C
+#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D
+#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E
+#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F
+#define GL_NUM_PASSES_ATI 0x8970
+#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971
+#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972
+#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973
+#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974
+#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975
+#define GL_SWIZZLE_STR_ATI 0x8976
+#define GL_SWIZZLE_STQ_ATI 0x8977
+#define GL_SWIZZLE_STR_DR_ATI 0x8978
+#define GL_SWIZZLE_STQ_DQ_ATI 0x8979
+#define GL_SWIZZLE_STRQ_ATI 0x897A
+#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B
+#define GL_RED_BIT_ATI 0x00000001
+#define GL_GREEN_BIT_ATI 0x00000002
+#define GL_BLUE_BIT_ATI 0x00000004
+#define GL_2X_BIT_ATI 0x00000001
+#define GL_4X_BIT_ATI 0x00000002
+#define GL_8X_BIT_ATI 0x00000004
+#define GL_HALF_BIT_ATI 0x00000008
+#define GL_QUARTER_BIT_ATI 0x00000010
+#define GL_EIGHTH_BIT_ATI 0x00000020
+#define GL_SATURATE_BIT_ATI 0x00000040
+#define GL_COMP_BIT_ATI 0x00000002
+#define GL_NEGATE_BIT_ATI 0x00000004
+#define GL_BIAS_BIT_ATI 0x00000008
+#endif
+
+#ifndef GL_ATI_pn_triangles
+#define GL_PN_TRIANGLES_ATI 0x87F0
+#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1
+#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2
+#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3
+#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4
+#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5
+#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6
+#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7
+#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8
+#endif
+
+#ifndef GL_ATI_vertex_array_object
+#define GL_STATIC_ATI 0x8760
+#define GL_DYNAMIC_ATI 0x8761
+#define GL_PRESERVE_ATI 0x8762
+#define GL_DISCARD_ATI 0x8763
+#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764
+#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765
+#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766
+#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767
+#endif
+
+#ifndef GL_EXT_vertex_shader
+#define GL_VERTEX_SHADER_EXT 0x8780
+#define GL_VERTEX_SHADER_BINDING_EXT 0x8781
+#define GL_OP_INDEX_EXT 0x8782
+#define GL_OP_NEGATE_EXT 0x8783
+#define GL_OP_DOT3_EXT 0x8784
+#define GL_OP_DOT4_EXT 0x8785
+#define GL_OP_MUL_EXT 0x8786
+#define GL_OP_ADD_EXT 0x8787
+#define GL_OP_MADD_EXT 0x8788
+#define GL_OP_FRAC_EXT 0x8789
+#define GL_OP_MAX_EXT 0x878A
+#define GL_OP_MIN_EXT 0x878B
+#define GL_OP_SET_GE_EXT 0x878C
+#define GL_OP_SET_LT_EXT 0x878D
+#define GL_OP_CLAMP_EXT 0x878E
+#define GL_OP_FLOOR_EXT 0x878F
+#define GL_OP_ROUND_EXT 0x8790
+#define GL_OP_EXP_BASE_2_EXT 0x8791
+#define GL_OP_LOG_BASE_2_EXT 0x8792
+#define GL_OP_POWER_EXT 0x8793
+#define GL_OP_RECIP_EXT 0x8794
+#define GL_OP_RECIP_SQRT_EXT 0x8795
+#define GL_OP_SUB_EXT 0x8796
+#define GL_OP_CROSS_PRODUCT_EXT 0x8797
+#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798
+#define GL_OP_MOV_EXT 0x8799
+#define GL_OUTPUT_VERTEX_EXT 0x879A
+#define GL_OUTPUT_COLOR0_EXT 0x879B
+#define GL_OUTPUT_COLOR1_EXT 0x879C
+#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D
+#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E
+#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F
+#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0
+#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1
+#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2
+#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3
+#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4
+#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5
+#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6
+#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7
+#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8
+#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9
+#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA
+#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB
+#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC
+#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD
+#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE
+#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF
+#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0
+#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1
+#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2
+#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3
+#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4
+#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5
+#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6
+#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7
+#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8
+#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9
+#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA
+#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB
+#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC
+#define GL_OUTPUT_FOG_EXT 0x87BD
+#define GL_SCALAR_EXT 0x87BE
+#define GL_VECTOR_EXT 0x87BF
+#define GL_MATRIX_EXT 0x87C0
+#define GL_VARIANT_EXT 0x87C1
+#define GL_INVARIANT_EXT 0x87C2
+#define GL_LOCAL_CONSTANT_EXT 0x87C3
+#define GL_LOCAL_EXT 0x87C4
+#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5
+#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6
+#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7
+#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8
+#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9
+#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA
+#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB
+#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CC
+#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CD
+#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE
+#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF
+#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0
+#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1
+#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2
+#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3
+#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4
+#define GL_X_EXT 0x87D5
+#define GL_Y_EXT 0x87D6
+#define GL_Z_EXT 0x87D7
+#define GL_W_EXT 0x87D8
+#define GL_NEGATIVE_X_EXT 0x87D9
+#define GL_NEGATIVE_Y_EXT 0x87DA
+#define GL_NEGATIVE_Z_EXT 0x87DB
+#define GL_NEGATIVE_W_EXT 0x87DC
+#define GL_ZERO_EXT 0x87DD
+#define GL_ONE_EXT 0x87DE
+#define GL_NEGATIVE_ONE_EXT 0x87DF
+#define GL_NORMALIZED_RANGE_EXT 0x87E0
+#define GL_FULL_RANGE_EXT 0x87E1
+#define GL_CURRENT_VERTEX_EXT 0x87E2
+#define GL_MVP_MATRIX_EXT 0x87E3
+#define GL_VARIANT_VALUE_EXT 0x87E4
+#define GL_VARIANT_DATATYPE_EXT 0x87E5
+#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6
+#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7
+#define GL_VARIANT_ARRAY_EXT 0x87E8
+#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9
+#define GL_INVARIANT_VALUE_EXT 0x87EA
+#define GL_INVARIANT_DATATYPE_EXT 0x87EB
+#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC
+#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED
+#endif
+
+#ifndef GL_ATI_vertex_streams
+#define GL_MAX_VERTEX_STREAMS_ATI 0x876B
+#define GL_VERTEX_STREAM0_ATI 0x876C
+#define GL_VERTEX_STREAM1_ATI 0x876D
+#define GL_VERTEX_STREAM2_ATI 0x876E
+#define GL_VERTEX_STREAM3_ATI 0x876F
+#define GL_VERTEX_STREAM4_ATI 0x8770
+#define GL_VERTEX_STREAM5_ATI 0x8771
+#define GL_VERTEX_STREAM6_ATI 0x8772
+#define GL_VERTEX_STREAM7_ATI 0x8773
+#define GL_VERTEX_SOURCE_ATI 0x8774
+#endif
+
+#ifndef GL_ATI_element_array
+#define GL_ELEMENT_ARRAY_ATI 0x8768
+#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769
+#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A
+#endif
+
+#ifndef GL_SUN_mesh_array
+#define GL_QUAD_MESH_SUN 0x8614
+#define GL_TRIANGLE_MESH_SUN 0x8615
+#endif
+
+#ifndef GL_SUN_slice_accum
+#define GL_SLICE_ACCUM_SUN 0x85CC
+#endif
+
+#ifndef GL_NV_multisample_filter_hint
+#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534
+#endif
+
+#ifndef GL_NV_depth_clamp
+#define GL_DEPTH_CLAMP_NV 0x864F
+#endif
+
+#ifndef GL_NV_occlusion_query
+#define GL_PIXEL_COUNTER_BITS_NV 0x8864
+#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865
+#define GL_PIXEL_COUNT_NV 0x8866
+#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867
+#endif
+
+#ifndef GL_NV_point_sprite
+#define GL_POINT_SPRITE_NV 0x8861
+#define GL_COORD_REPLACE_NV 0x8862
+#define GL_POINT_SPRITE_R_MODE_NV 0x8863
+#endif
+
+#ifndef GL_NV_texture_shader3
+#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850
+#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851
+#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852
+#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853
+#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854
+#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855
+#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856
+#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857
+#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858
+#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859
+#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A
+#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B
+#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C
+#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D
+#define GL_HILO8_NV 0x885E
+#define GL_SIGNED_HILO8_NV 0x885F
+#define GL_FORCE_BLUE_TO_ONE_NV 0x8860
+#endif
+
+#ifndef GL_NV_vertex_program1_1
+#endif
+
+#ifndef GL_EXT_shadow_funcs
+#endif
+
+#ifndef GL_EXT_stencil_two_side
+#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910
+#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911
+#endif
+
+#ifndef GL_ATI_text_fragment_shader
+#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200
+#endif
+
+#ifndef GL_APPLE_client_storage
+#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2
+#endif
+
+#ifndef GL_APPLE_element_array
+#define GL_ELEMENT_ARRAY_APPLE 0x8A0C
+#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8A0D
+#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x8A0E
+#endif
+
+#ifndef GL_APPLE_fence
+#define GL_DRAW_PIXELS_APPLE 0x8A0A
+#define GL_FENCE_APPLE 0x8A0B
+#endif
+
+#ifndef GL_APPLE_vertex_array_object
+#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5
+#endif
+
+#ifndef GL_APPLE_vertex_array_range
+#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D
+#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E
+#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F
+#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521
+#define GL_STORAGE_CLIENT_APPLE 0x85B4
+#define GL_STORAGE_CACHED_APPLE 0x85BE
+#define GL_STORAGE_SHARED_APPLE 0x85BF
+#endif
+
+#ifndef GL_APPLE_ycbcr_422
+#define GL_YCBCR_422_APPLE 0x85B9
+#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA
+#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB
+#endif
+
+#ifndef GL_S3_s3tc
+#define GL_RGB_S3TC 0x83A0
+#define GL_RGB4_S3TC 0x83A1
+#define GL_RGBA_S3TC 0x83A2
+#define GL_RGBA4_S3TC 0x83A3
+#endif
+
+#ifndef GL_ATI_draw_buffers
+#define GL_MAX_DRAW_BUFFERS_ATI 0x8824
+#define GL_DRAW_BUFFER0_ATI 0x8825
+#define GL_DRAW_BUFFER1_ATI 0x8826
+#define GL_DRAW_BUFFER2_ATI 0x8827
+#define GL_DRAW_BUFFER3_ATI 0x8828
+#define GL_DRAW_BUFFER4_ATI 0x8829
+#define GL_DRAW_BUFFER5_ATI 0x882A
+#define GL_DRAW_BUFFER6_ATI 0x882B
+#define GL_DRAW_BUFFER7_ATI 0x882C
+#define GL_DRAW_BUFFER8_ATI 0x882D
+#define GL_DRAW_BUFFER9_ATI 0x882E
+#define GL_DRAW_BUFFER10_ATI 0x882F
+#define GL_DRAW_BUFFER11_ATI 0x8830
+#define GL_DRAW_BUFFER12_ATI 0x8831
+#define GL_DRAW_BUFFER13_ATI 0x8832
+#define GL_DRAW_BUFFER14_ATI 0x8833
+#define GL_DRAW_BUFFER15_ATI 0x8834
+#endif
+
+#ifndef GL_ATI_pixel_format_float
+#define GL_TYPE_RGBA_FLOAT_ATI 0x8820
+#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835
+#endif
+
+#ifndef GL_ATI_texture_env_combine3
+#define GL_MODULATE_ADD_ATI 0x8744
+#define GL_MODULATE_SIGNED_ADD_ATI 0x8745
+#define GL_MODULATE_SUBTRACT_ATI 0x8746
+#endif
+
+#ifndef GL_ATI_texture_float
+#define GL_RGBA_FLOAT32_ATI 0x8814
+#define GL_RGB_FLOAT32_ATI 0x8815
+#define GL_ALPHA_FLOAT32_ATI 0x8816
+#define GL_INTENSITY_FLOAT32_ATI 0x8817
+#define GL_LUMINANCE_FLOAT32_ATI 0x8818
+#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819
+#define GL_RGBA_FLOAT16_ATI 0x881A
+#define GL_RGB_FLOAT16_ATI 0x881B
+#define GL_ALPHA_FLOAT16_ATI 0x881C
+#define GL_INTENSITY_FLOAT16_ATI 0x881D
+#define GL_LUMINANCE_FLOAT16_ATI 0x881E
+#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F
+#endif
+
+#ifndef GL_NV_float_buffer
+#define GL_FLOAT_R_NV 0x8880
+#define GL_FLOAT_RG_NV 0x8881
+#define GL_FLOAT_RGB_NV 0x8882
+#define GL_FLOAT_RGBA_NV 0x8883
+#define GL_FLOAT_R16_NV 0x8884
+#define GL_FLOAT_R32_NV 0x8885
+#define GL_FLOAT_RG16_NV 0x8886
+#define GL_FLOAT_RG32_NV 0x8887
+#define GL_FLOAT_RGB16_NV 0x8888
+#define GL_FLOAT_RGB32_NV 0x8889
+#define GL_FLOAT_RGBA16_NV 0x888A
+#define GL_FLOAT_RGBA32_NV 0x888B
+#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C
+#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D
+#define GL_FLOAT_RGBA_MODE_NV 0x888E
+#endif
+
+#ifndef GL_NV_fragment_program
+#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868
+#define GL_FRAGMENT_PROGRAM_NV 0x8870
+#define GL_MAX_TEXTURE_COORDS_NV 0x8871
+#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872
+#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873
+#define GL_PROGRAM_ERROR_STRING_NV 0x8874
+#endif
+
+#ifndef GL_NV_half_float
+#define GL_HALF_FLOAT_NV 0x140B
+#endif
+
+#ifndef GL_NV_pixel_data_range
+#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878
+#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879
+#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A
+#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B
+#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C
+#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D
+#endif
+
+#ifndef GL_NV_primitive_restart
+#define GL_PRIMITIVE_RESTART_NV 0x8558
+#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559
+#endif
+
+#ifndef GL_NV_texture_expand_normal
+#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F
+#endif
+
+#ifndef GL_NV_vertex_program2
+#endif
+
+#ifndef GL_ATI_map_object_buffer
+#endif
+
+#ifndef GL_ATI_separate_stencil
+#define GL_STENCIL_BACK_FUNC_ATI 0x8800
+#define GL_STENCIL_BACK_FAIL_ATI 0x8801
+#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802
+#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803
+#endif
+
+#ifndef GL_ATI_vertex_attrib_array_object
+#endif
+
+#ifndef GL_OES_read_format
+#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A
+#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B
+#endif
+
+#ifndef GL_EXT_depth_bounds_test
+#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890
+#define GL_DEPTH_BOUNDS_EXT 0x8891
+#endif
+
+#ifndef GL_EXT_texture_mirror_clamp
+#define GL_MIRROR_CLAMP_EXT 0x8742
+#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743
+#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912
+#endif
+
+#ifndef GL_EXT_blend_equation_separate
+#define GL_BLEND_EQUATION_RGB_EXT 0x8009
+#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D
+#endif
+
+#ifndef GL_MESA_pack_invert
+#define GL_PACK_INVERT_MESA 0x8758
+#endif
+
+#ifndef GL_MESA_ycbcr_texture
+#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA
+#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB
+#define GL_YCBCR_MESA 0x8757
+#endif
+
+#ifndef GL_EXT_pixel_buffer_object
+#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB
+#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC
+#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED
+#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF
+#endif
+
+#ifndef GL_NV_fragment_program_option
+#endif
+
+#ifndef GL_NV_fragment_program2
+#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4
+#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5
+#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6
+#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7
+#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8
+#endif
+
+#ifndef GL_NV_vertex_program2_option
+/* reuse GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */
+/* reuse GL_MAX_PROGRAM_CALL_DEPTH_NV */
+#endif
+
+#ifndef GL_NV_vertex_program3
+/* reuse GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */
+#endif
+
+#ifndef GL_EXT_framebuffer_object
+#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506
+#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8
+#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6
+#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4
+#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5
+#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6
+#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7
+#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9
+#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA
+#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB
+#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC
+#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD
+#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF
+#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0
+#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1
+#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2
+#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3
+#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4
+#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5
+#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6
+#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7
+#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8
+#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9
+#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA
+#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB
+#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC
+#define GL_COLOR_ATTACHMENT13_EXT 0x8CED
+#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE
+#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF
+#define GL_DEPTH_ATTACHMENT_EXT 0x8D00
+#define GL_STENCIL_ATTACHMENT_EXT 0x8D20
+#define GL_FRAMEBUFFER_EXT 0x8D40
+#define GL_RENDERBUFFER_EXT 0x8D41
+#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42
+#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43
+#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44
+#define GL_STENCIL_INDEX1_EXT 0x8D46
+#define GL_STENCIL_INDEX4_EXT 0x8D47
+#define GL_STENCIL_INDEX8_EXT 0x8D48
+#define GL_STENCIL_INDEX16_EXT 0x8D49
+#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50
+#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51
+#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52
+#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53
+#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54
+#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55
+#endif
+
+#ifndef GL_GREMEDY_string_marker
+#endif
+
+#ifndef GL_EXT_packed_depth_stencil
+#define GL_DEPTH_STENCIL_EXT 0x84F9
+#define GL_UNSIGNED_INT_24_8_EXT 0x84FA
+#define GL_DEPTH24_STENCIL8_EXT 0x88F0
+#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1
+#endif
+
+#ifndef GL_EXT_stencil_clear_tag
+#define GL_STENCIL_TAG_BITS_EXT 0x88F2
+#define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3
+#endif
+
+#ifndef GL_EXT_texture_sRGB
+#define GL_SRGB_EXT 0x8C40
+#define GL_SRGB8_EXT 0x8C41
+#define GL_SRGB_ALPHA_EXT 0x8C42
+#define GL_SRGB8_ALPHA8_EXT 0x8C43
+#define GL_SLUMINANCE_ALPHA_EXT 0x8C44
+#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45
+#define GL_SLUMINANCE_EXT 0x8C46
+#define GL_SLUMINANCE8_EXT 0x8C47
+#define GL_COMPRESSED_SRGB_EXT 0x8C48
+#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49
+#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A
+#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B
+#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C
+#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D
+#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E
+#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F
+#endif
+
+#ifndef GL_EXT_framebuffer_blit
+#define GL_READ_FRAMEBUFFER_EXT 0x8CA8
+#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9
+#define GL_DRAW_FRAMEBUFFER_BINDING_EXT GL_FRAMEBUFFER_BINDING_EXT
+#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA
+#endif
+
+#ifndef GL_EXT_framebuffer_multisample
+#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56
+#define GL_MAX_SAMPLES_EXT 0x8D57
+#endif
+
+#ifndef GL_MESAX_texture_stack
+#define GL_TEXTURE_1D_STACK_MESAX 0x8759
+#define GL_TEXTURE_2D_STACK_MESAX 0x875A
+#define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B
+#define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C
+#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D
+#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E
+#endif
+
+#ifndef GL_EXT_timer_query
+#define GL_TIME_ELAPSED_EXT 0x88BF
+#endif
+
+#ifndef GL_EXT_gpu_program_parameters
+#endif
+
+#ifndef GL_APPLE_flush_buffer_range
+#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12
+#define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13
+#endif
+
+#ifndef GL_NV_gpu_program4
+#define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904
+#define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905
+#define GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906
+#define GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907
+#define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908
+#define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909
+#define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5
+#define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6
+#endif
+
+#ifndef GL_NV_geometry_program4
+#define GL_LINES_ADJACENCY_EXT 0x000A
+#define GL_LINE_STRIP_ADJACENCY_EXT 0x000B
+#define GL_TRIANGLES_ADJACENCY_EXT 0x000C
+#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0x000D
+#define GL_GEOMETRY_PROGRAM_NV 0x8C26
+#define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27
+#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28
+#define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA
+#define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB
+#define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC
+#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29
+#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7
+#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8
+#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4
+#define GL_PROGRAM_POINT_SIZE_EXT 0x8642
+#endif
+
+#ifndef GL_EXT_geometry_shader4
+#define GL_GEOMETRY_SHADER_EXT 0x8DD9
+/* reuse GL_GEOMETRY_VERTICES_OUT_EXT */
+/* reuse GL_GEOMETRY_INPUT_TYPE_EXT */
+/* reuse GL_GEOMETRY_OUTPUT_TYPE_EXT */
+/* reuse GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT */
+#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD
+#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE
+#define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B
+#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF
+#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0
+#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1
+/* reuse GL_LINES_ADJACENCY_EXT */
+/* reuse GL_LINE_STRIP_ADJACENCY_EXT */
+/* reuse GL_TRIANGLES_ADJACENCY_EXT */
+/* reuse GL_TRIANGLE_STRIP_ADJACENCY_EXT */
+/* reuse GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT */
+/* reuse GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */
+/* reuse GL_PROGRAM_POINT_SIZE_EXT */
+#endif
+
+#ifndef GL_NV_vertex_program4
+#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD
+#endif
+
+#ifndef GL_EXT_gpu_shader4
+#define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0
+#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1
+#define GL_SAMPLER_BUFFER_EXT 0x8DC2
+#define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3
+#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4
+#define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5
+#define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6
+#define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7
+#define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8
+#define GL_INT_SAMPLER_1D_EXT 0x8DC9
+#define GL_INT_SAMPLER_2D_EXT 0x8DCA
+#define GL_INT_SAMPLER_3D_EXT 0x8DCB
+#define GL_INT_SAMPLER_CUBE_EXT 0x8DCC
+#define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD
+#define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE
+#define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF
+#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0
+#define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1
+#define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2
+#define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3
+#define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4
+#define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5
+#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6
+#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7
+#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8
+#endif
+
+#ifndef GL_EXT_draw_instanced
+#endif
+
+#ifndef GL_EXT_packed_float
+#define GL_R11F_G11F_B10F_EXT 0x8C3A
+#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B
+#define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C
+#endif
+
+#ifndef GL_EXT_texture_array
+#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18
+#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19
+#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A
+#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B
+#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C
+#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D
+#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF
+#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */
+#endif
+
+#ifndef GL_EXT_texture_buffer_object
+#define GL_TEXTURE_BUFFER_EXT 0x8C2A
+#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B
+#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C
+#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D
+#define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E
+#endif
+
+#ifndef GL_EXT_texture_compression_latc
+#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70
+#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71
+#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72
+#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73
+#endif
+
+#ifndef GL_EXT_texture_compression_rgtc
+#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB
+#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC
+#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD
+#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE
+#endif
+
+#ifndef GL_EXT_texture_shared_exponent
+#define GL_RGB9_E5_EXT 0x8C3D
+#define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E
+#define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F
+#endif
+
+#ifndef GL_NV_depth_buffer_float
+#define GL_DEPTH_COMPONENT32F_NV 0x8DAB
+#define GL_DEPTH32F_STENCIL8_NV 0x8DAC
+#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD
+#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF
+#endif
+
+#ifndef GL_NV_fragment_program4
+#endif
+
+#ifndef GL_NV_framebuffer_multisample_coverage
+#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB
+#define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10
+#define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11
+#define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12
+#endif
+
+#ifndef GL_EXT_framebuffer_sRGB
+#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9
+#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA
+#endif
+
+#ifndef GL_NV_geometry_shader4
+#endif
+
+#ifndef GL_NV_parameter_buffer_object
+#define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0
+#define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1
+#define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2
+#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3
+#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4
+#endif
+
+#ifndef GL_EXT_draw_buffers2
+#endif
+
+#ifndef GL_NV_transform_feedback
+#define GL_BACK_PRIMARY_COLOR_NV 0x8C77
+#define GL_BACK_SECONDARY_COLOR_NV 0x8C78
+#define GL_TEXTURE_COORD_NV 0x8C79
+#define GL_CLIP_DISTANCE_NV 0x8C7A
+#define GL_VERTEX_ID_NV 0x8C7B
+#define GL_PRIMITIVE_ID_NV 0x8C7C
+#define GL_GENERIC_ATTRIB_NV 0x8C7D
+#define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E
+#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F
+#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80
+#define GL_ACTIVE_VARYINGS_NV 0x8C81
+#define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82
+#define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83
+#define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84
+#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85
+#define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86
+#define GL_PRIMITIVES_GENERATED_NV 0x8C87
+#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88
+#define GL_RASTERIZER_DISCARD_NV 0x8C89
+#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_ATTRIBS_NV 0x8C8A
+#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B
+#define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C
+#define GL_SEPARATE_ATTRIBS_NV 0x8C8D
+#define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E
+#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F
+#define GL_LAYER_NV 0x8DAA
+#define GL_NEXT_BUFFER_NV -2
+#define GL_SKIP_COMPONENTS4_NV -3
+#define GL_SKIP_COMPONENTS3_NV -4
+#define GL_SKIP_COMPONENTS2_NV -5
+#define GL_SKIP_COMPONENTS1_NV -6
+#endif
+
+#ifndef GL_EXT_bindable_uniform
+#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2
+#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3
+#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4
+#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED
+#define GL_UNIFORM_BUFFER_EXT 0x8DEE
+#define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF
+#endif
+
+#ifndef GL_EXT_texture_integer
+#define GL_RGBA32UI_EXT 0x8D70
+#define GL_RGB32UI_EXT 0x8D71
+#define GL_ALPHA32UI_EXT 0x8D72
+#define GL_INTENSITY32UI_EXT 0x8D73
+#define GL_LUMINANCE32UI_EXT 0x8D74
+#define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75
+#define GL_RGBA16UI_EXT 0x8D76
+#define GL_RGB16UI_EXT 0x8D77
+#define GL_ALPHA16UI_EXT 0x8D78
+#define GL_INTENSITY16UI_EXT 0x8D79
+#define GL_LUMINANCE16UI_EXT 0x8D7A
+#define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B
+#define GL_RGBA8UI_EXT 0x8D7C
+#define GL_RGB8UI_EXT 0x8D7D
+#define GL_ALPHA8UI_EXT 0x8D7E
+#define GL_INTENSITY8UI_EXT 0x8D7F
+#define GL_LUMINANCE8UI_EXT 0x8D80
+#define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81
+#define GL_RGBA32I_EXT 0x8D82
+#define GL_RGB32I_EXT 0x8D83
+#define GL_ALPHA32I_EXT 0x8D84
+#define GL_INTENSITY32I_EXT 0x8D85
+#define GL_LUMINANCE32I_EXT 0x8D86
+#define GL_LUMINANCE_ALPHA32I_EXT 0x8D87
+#define GL_RGBA16I_EXT 0x8D88
+#define GL_RGB16I_EXT 0x8D89
+#define GL_ALPHA16I_EXT 0x8D8A
+#define GL_INTENSITY16I_EXT 0x8D8B
+#define GL_LUMINANCE16I_EXT 0x8D8C
+#define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D
+#define GL_RGBA8I_EXT 0x8D8E
+#define GL_RGB8I_EXT 0x8D8F
+#define GL_ALPHA8I_EXT 0x8D90
+#define GL_INTENSITY8I_EXT 0x8D91
+#define GL_LUMINANCE8I_EXT 0x8D92
+#define GL_LUMINANCE_ALPHA8I_EXT 0x8D93
+#define GL_RED_INTEGER_EXT 0x8D94
+#define GL_GREEN_INTEGER_EXT 0x8D95
+#define GL_BLUE_INTEGER_EXT 0x8D96
+#define GL_ALPHA_INTEGER_EXT 0x8D97
+#define GL_RGB_INTEGER_EXT 0x8D98
+#define GL_RGBA_INTEGER_EXT 0x8D99
+#define GL_BGR_INTEGER_EXT 0x8D9A
+#define GL_BGRA_INTEGER_EXT 0x8D9B
+#define GL_LUMINANCE_INTEGER_EXT 0x8D9C
+#define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D
+#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E
+#endif
+
+#ifndef GL_GREMEDY_frame_terminator
+#endif
+
+#ifndef GL_NV_conditional_render
+#define GL_QUERY_WAIT_NV 0x8E13
+#define GL_QUERY_NO_WAIT_NV 0x8E14
+#define GL_QUERY_BY_REGION_WAIT_NV 0x8E15
+#define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16
+#endif
+
+#ifndef GL_NV_present_video
+#define GL_FRAME_NV 0x8E26
+#define GL_FIELDS_NV 0x8E27
+#define GL_CURRENT_TIME_NV 0x8E28
+#define GL_NUM_FILL_STREAMS_NV 0x8E29
+#define GL_PRESENT_TIME_NV 0x8E2A
+#define GL_PRESENT_DURATION_NV 0x8E2B
+#endif
+
+#ifndef GL_EXT_transform_feedback
+#define GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E
+#define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84
+#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85
+#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F
+#define GL_INTERLEAVED_ATTRIBS_EXT 0x8C8C
+#define GL_SEPARATE_ATTRIBS_EXT 0x8C8D
+#define GL_PRIMITIVES_GENERATED_EXT 0x8C87
+#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88
+#define GL_RASTERIZER_DISCARD_EXT 0x8C89
+#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A
+#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B
+#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80
+#define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83
+#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F
+#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76
+#endif
+
+#ifndef GL_EXT_direct_state_access
+#define GL_PROGRAM_MATRIX_EXT 0x8E2D
+#define GL_TRANSPOSE_PROGRAM_MATRIX_EXT 0x8E2E
+#define GL_PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F
+#endif
+
+#ifndef GL_EXT_vertex_array_bgra
+/* reuse GL_BGRA */
+#endif
+
+#ifndef GL_EXT_texture_swizzle
+#define GL_TEXTURE_SWIZZLE_R_EXT 0x8E42
+#define GL_TEXTURE_SWIZZLE_G_EXT 0x8E43
+#define GL_TEXTURE_SWIZZLE_B_EXT 0x8E44
+#define GL_TEXTURE_SWIZZLE_A_EXT 0x8E45
+#define GL_TEXTURE_SWIZZLE_RGBA_EXT 0x8E46
+#endif
+
+#ifndef GL_NV_explicit_multisample
+#define GL_SAMPLE_POSITION_NV 0x8E50
+#define GL_SAMPLE_MASK_NV 0x8E51
+#define GL_SAMPLE_MASK_VALUE_NV 0x8E52
+#define GL_TEXTURE_BINDING_RENDERBUFFER_NV 0x8E53
+#define GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV 0x8E54
+#define GL_TEXTURE_RENDERBUFFER_NV 0x8E55
+#define GL_SAMPLER_RENDERBUFFER_NV 0x8E56
+#define GL_INT_SAMPLER_RENDERBUFFER_NV 0x8E57
+#define GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV 0x8E58
+#define GL_MAX_SAMPLE_MASK_WORDS_NV 0x8E59
+#endif
+
+#ifndef GL_NV_transform_feedback2
+#define GL_TRANSFORM_FEEDBACK_NV 0x8E22
+#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV 0x8E23
+#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV 0x8E24
+#define GL_TRANSFORM_FEEDBACK_BINDING_NV 0x8E25
+#endif
+
+#ifndef GL_ATI_meminfo
+#define GL_VBO_FREE_MEMORY_ATI 0x87FB
+#define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC
+#define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD
+#endif
+
+#ifndef GL_AMD_performance_monitor
+#define GL_COUNTER_TYPE_AMD 0x8BC0
+#define GL_COUNTER_RANGE_AMD 0x8BC1
+#define GL_UNSIGNED_INT64_AMD 0x8BC2
+#define GL_PERCENTAGE_AMD 0x8BC3
+#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4
+#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5
+#define GL_PERFMON_RESULT_AMD 0x8BC6
+#endif
+
+#ifndef GL_AMD_texture_texture4
+#endif
+
+#ifndef GL_AMD_vertex_shader_tesselator
+#define GL_SAMPLER_BUFFER_AMD 0x9001
+#define GL_INT_SAMPLER_BUFFER_AMD 0x9002
+#define GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD 0x9003
+#define GL_TESSELLATION_MODE_AMD 0x9004
+#define GL_TESSELLATION_FACTOR_AMD 0x9005
+#define GL_DISCRETE_AMD 0x9006
+#define GL_CONTINUOUS_AMD 0x9007
+#endif
+
+#ifndef GL_EXT_provoking_vertex
+#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT 0x8E4C
+#define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D
+#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E
+#define GL_PROVOKING_VERTEX_EXT 0x8E4F
+#endif
+
+#ifndef GL_EXT_texture_snorm
+#define GL_ALPHA_SNORM 0x9010
+#define GL_LUMINANCE_SNORM 0x9011
+#define GL_LUMINANCE_ALPHA_SNORM 0x9012
+#define GL_INTENSITY_SNORM 0x9013
+#define GL_ALPHA8_SNORM 0x9014
+#define GL_LUMINANCE8_SNORM 0x9015
+#define GL_LUMINANCE8_ALPHA8_SNORM 0x9016
+#define GL_INTENSITY8_SNORM 0x9017
+#define GL_ALPHA16_SNORM 0x9018
+#define GL_LUMINANCE16_SNORM 0x9019
+#define GL_LUMINANCE16_ALPHA16_SNORM 0x901A
+#define GL_INTENSITY16_SNORM 0x901B
+/* reuse GL_RED_SNORM */
+/* reuse GL_RG_SNORM */
+/* reuse GL_RGB_SNORM */
+/* reuse GL_RGBA_SNORM */
+/* reuse GL_R8_SNORM */
+/* reuse GL_RG8_SNORM */
+/* reuse GL_RGB8_SNORM */
+/* reuse GL_RGBA8_SNORM */
+/* reuse GL_R16_SNORM */
+/* reuse GL_RG16_SNORM */
+/* reuse GL_RGB16_SNORM */
+/* reuse GL_RGBA16_SNORM */
+/* reuse GL_SIGNED_NORMALIZED */
+#endif
+
+#ifndef GL_AMD_draw_buffers_blend
+#endif
+
+#ifndef GL_APPLE_texture_range
+#define GL_TEXTURE_RANGE_LENGTH_APPLE 0x85B7
+#define GL_TEXTURE_RANGE_POINTER_APPLE 0x85B8
+#define GL_TEXTURE_STORAGE_HINT_APPLE 0x85BC
+#define GL_STORAGE_PRIVATE_APPLE 0x85BD
+/* reuse GL_STORAGE_CACHED_APPLE */
+/* reuse GL_STORAGE_SHARED_APPLE */
+#endif
+
+#ifndef GL_APPLE_float_pixels
+#define GL_HALF_APPLE 0x140B
+#define GL_RGBA_FLOAT32_APPLE 0x8814
+#define GL_RGB_FLOAT32_APPLE 0x8815
+#define GL_ALPHA_FLOAT32_APPLE 0x8816
+#define GL_INTENSITY_FLOAT32_APPLE 0x8817
+#define GL_LUMINANCE_FLOAT32_APPLE 0x8818
+#define GL_LUMINANCE_ALPHA_FLOAT32_APPLE 0x8819
+#define GL_RGBA_FLOAT16_APPLE 0x881A
+#define GL_RGB_FLOAT16_APPLE 0x881B
+#define GL_ALPHA_FLOAT16_APPLE 0x881C
+#define GL_INTENSITY_FLOAT16_APPLE 0x881D
+#define GL_LUMINANCE_FLOAT16_APPLE 0x881E
+#define GL_LUMINANCE_ALPHA_FLOAT16_APPLE 0x881F
+#define GL_COLOR_FLOAT_APPLE 0x8A0F
+#endif
+
+#ifndef GL_APPLE_vertex_program_evaluators
+#define GL_VERTEX_ATTRIB_MAP1_APPLE 0x8A00
+#define GL_VERTEX_ATTRIB_MAP2_APPLE 0x8A01
+#define GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE 0x8A02
+#define GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE 0x8A03
+#define GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE 0x8A04
+#define GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE 0x8A05
+#define GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE 0x8A06
+#define GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE 0x8A07
+#define GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE 0x8A08
+#define GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE 0x8A09
+#endif
+
+#ifndef GL_APPLE_aux_depth_stencil
+#define GL_AUX_DEPTH_STENCIL_APPLE 0x8A14
+#endif
+
+#ifndef GL_APPLE_object_purgeable
+#define GL_BUFFER_OBJECT_APPLE 0x85B3
+#define GL_RELEASED_APPLE 0x8A19
+#define GL_VOLATILE_APPLE 0x8A1A
+#define GL_RETAINED_APPLE 0x8A1B
+#define GL_UNDEFINED_APPLE 0x8A1C
+#define GL_PURGEABLE_APPLE 0x8A1D
+#endif
+
+#ifndef GL_APPLE_row_bytes
+#define GL_PACK_ROW_BYTES_APPLE 0x8A15
+#define GL_UNPACK_ROW_BYTES_APPLE 0x8A16
+#endif
+
+#ifndef GL_APPLE_rgb_422
+#define GL_RGB_422_APPLE 0x8A1F
+/* reuse GL_UNSIGNED_SHORT_8_8_APPLE */
+/* reuse GL_UNSIGNED_SHORT_8_8_REV_APPLE */
+#endif
+
+#ifndef GL_NV_video_capture
+#define GL_VIDEO_BUFFER_NV 0x9020
+#define GL_VIDEO_BUFFER_BINDING_NV 0x9021
+#define GL_FIELD_UPPER_NV 0x9022
+#define GL_FIELD_LOWER_NV 0x9023
+#define GL_NUM_VIDEO_CAPTURE_STREAMS_NV 0x9024
+#define GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV 0x9025
+#define GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV 0x9026
+#define GL_LAST_VIDEO_CAPTURE_STATUS_NV 0x9027
+#define GL_VIDEO_BUFFER_PITCH_NV 0x9028
+#define GL_VIDEO_COLOR_CONVERSION_MATRIX_NV 0x9029
+#define GL_VIDEO_COLOR_CONVERSION_MAX_NV 0x902A
+#define GL_VIDEO_COLOR_CONVERSION_MIN_NV 0x902B
+#define GL_VIDEO_COLOR_CONVERSION_OFFSET_NV 0x902C
+#define GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV 0x902D
+#define GL_PARTIAL_SUCCESS_NV 0x902E
+#define GL_SUCCESS_NV 0x902F
+#define GL_FAILURE_NV 0x9030
+#define GL_YCBYCR8_422_NV 0x9031
+#define GL_YCBAYCR8A_4224_NV 0x9032
+#define GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV 0x9033
+#define GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV 0x9034
+#define GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV 0x9035
+#define GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV 0x9036
+#define GL_Z4Y12Z4CB12Z4CR12_444_NV 0x9037
+#define GL_VIDEO_CAPTURE_FRAME_WIDTH_NV 0x9038
+#define GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV 0x9039
+#define GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV 0x903A
+#define GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV 0x903B
+#define GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 0x903C
+#endif
+
+#ifndef GL_NV_copy_image
+#endif
+
+#ifndef GL_EXT_separate_shader_objects
+#define GL_ACTIVE_PROGRAM_EXT 0x8B8D
+#endif
+
+#ifndef GL_NV_parameter_buffer_object2
+#endif
+
+#ifndef GL_NV_shader_buffer_load
+#define GL_BUFFER_GPU_ADDRESS_NV 0x8F1D
+#define GL_GPU_ADDRESS_NV 0x8F34
+#define GL_MAX_SHADER_BUFFER_ADDRESS_NV 0x8F35
+#endif
+
+#ifndef GL_NV_vertex_buffer_unified_memory
+#define GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV 0x8F1E
+#define GL_ELEMENT_ARRAY_UNIFIED_NV 0x8F1F
+#define GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV 0x8F20
+#define GL_VERTEX_ARRAY_ADDRESS_NV 0x8F21
+#define GL_NORMAL_ARRAY_ADDRESS_NV 0x8F22
+#define GL_COLOR_ARRAY_ADDRESS_NV 0x8F23
+#define GL_INDEX_ARRAY_ADDRESS_NV 0x8F24
+#define GL_TEXTURE_COORD_ARRAY_ADDRESS_NV 0x8F25
+#define GL_EDGE_FLAG_ARRAY_ADDRESS_NV 0x8F26
+#define GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV 0x8F27
+#define GL_FOG_COORD_ARRAY_ADDRESS_NV 0x8F28
+#define GL_ELEMENT_ARRAY_ADDRESS_NV 0x8F29
+#define GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV 0x8F2A
+#define GL_VERTEX_ARRAY_LENGTH_NV 0x8F2B
+#define GL_NORMAL_ARRAY_LENGTH_NV 0x8F2C
+#define GL_COLOR_ARRAY_LENGTH_NV 0x8F2D
+#define GL_INDEX_ARRAY_LENGTH_NV 0x8F2E
+#define GL_TEXTURE_COORD_ARRAY_LENGTH_NV 0x8F2F
+#define GL_EDGE_FLAG_ARRAY_LENGTH_NV 0x8F30
+#define GL_SECONDARY_COLOR_ARRAY_LENGTH_NV 0x8F31
+#define GL_FOG_COORD_ARRAY_LENGTH_NV 0x8F32
+#define GL_ELEMENT_ARRAY_LENGTH_NV 0x8F33
+#define GL_DRAW_INDIRECT_UNIFIED_NV 0x8F40
+#define GL_DRAW_INDIRECT_ADDRESS_NV 0x8F41
+#define GL_DRAW_INDIRECT_LENGTH_NV 0x8F42
+#endif
+
+#ifndef GL_NV_texture_barrier
+#endif
+
+#ifndef GL_AMD_shader_stencil_export
+#endif
+
+#ifndef GL_AMD_seamless_cubemap_per_texture
+/* reuse GL_TEXTURE_CUBE_MAP_SEAMLESS */
+#endif
+
+#ifndef GL_AMD_conservative_depth
+#endif
+
+#ifndef GL_EXT_shader_image_load_store
+#define GL_MAX_IMAGE_UNITS_EXT 0x8F38
+#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT 0x8F39
+#define GL_IMAGE_BINDING_NAME_EXT 0x8F3A
+#define GL_IMAGE_BINDING_LEVEL_EXT 0x8F3B
+#define GL_IMAGE_BINDING_LAYERED_EXT 0x8F3C
+#define GL_IMAGE_BINDING_LAYER_EXT 0x8F3D
+#define GL_IMAGE_BINDING_ACCESS_EXT 0x8F3E
+#define GL_IMAGE_1D_EXT 0x904C
+#define GL_IMAGE_2D_EXT 0x904D
+#define GL_IMAGE_3D_EXT 0x904E
+#define GL_IMAGE_2D_RECT_EXT 0x904F
+#define GL_IMAGE_CUBE_EXT 0x9050
+#define GL_IMAGE_BUFFER_EXT 0x9051
+#define GL_IMAGE_1D_ARRAY_EXT 0x9052
+#define GL_IMAGE_2D_ARRAY_EXT 0x9053
+#define GL_IMAGE_CUBE_MAP_ARRAY_EXT 0x9054
+#define GL_IMAGE_2D_MULTISAMPLE_EXT 0x9055
+#define GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9056
+#define GL_INT_IMAGE_1D_EXT 0x9057
+#define GL_INT_IMAGE_2D_EXT 0x9058
+#define GL_INT_IMAGE_3D_EXT 0x9059
+#define GL_INT_IMAGE_2D_RECT_EXT 0x905A
+#define GL_INT_IMAGE_CUBE_EXT 0x905B
+#define GL_INT_IMAGE_BUFFER_EXT 0x905C
+#define GL_INT_IMAGE_1D_ARRAY_EXT 0x905D
+#define GL_INT_IMAGE_2D_ARRAY_EXT 0x905E
+#define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x905F
+#define GL_INT_IMAGE_2D_MULTISAMPLE_EXT 0x9060
+#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9061
+#define GL_UNSIGNED_INT_IMAGE_1D_EXT 0x9062
+#define GL_UNSIGNED_INT_IMAGE_2D_EXT 0x9063
+#define GL_UNSIGNED_INT_IMAGE_3D_EXT 0x9064
+#define GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT 0x9065
+#define GL_UNSIGNED_INT_IMAGE_CUBE_EXT 0x9066
+#define GL_UNSIGNED_INT_IMAGE_BUFFER_EXT 0x9067
+#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT 0x9068
+#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT 0x9069
+#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A
+#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT 0x906B
+#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x906C
+#define GL_MAX_IMAGE_SAMPLES_EXT 0x906D
+#define GL_IMAGE_BINDING_FORMAT_EXT 0x906E
+#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT 0x00000001
+#define GL_ELEMENT_ARRAY_BARRIER_BIT_EXT 0x00000002
+#define GL_UNIFORM_BARRIER_BIT_EXT 0x00000004
+#define GL_TEXTURE_FETCH_BARRIER_BIT_EXT 0x00000008
+#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT 0x00000020
+#define GL_COMMAND_BARRIER_BIT_EXT 0x00000040
+#define GL_PIXEL_BUFFER_BARRIER_BIT_EXT 0x00000080
+#define GL_TEXTURE_UPDATE_BARRIER_BIT_EXT 0x00000100
+#define GL_BUFFER_UPDATE_BARRIER_BIT_EXT 0x00000200
+#define GL_FRAMEBUFFER_BARRIER_BIT_EXT 0x00000400
+#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT 0x00000800
+#define GL_ATOMIC_COUNTER_BARRIER_BIT_EXT 0x00001000
+#define GL_ALL_BARRIER_BITS_EXT 0xFFFFFFFF
+#endif
+
+#ifndef GL_EXT_vertex_attrib_64bit
+/* reuse GL_DOUBLE */
+#define GL_DOUBLE_VEC2_EXT 0x8FFC
+#define GL_DOUBLE_VEC3_EXT 0x8FFD
+#define GL_DOUBLE_VEC4_EXT 0x8FFE
+#define GL_DOUBLE_MAT2_EXT 0x8F46
+#define GL_DOUBLE_MAT3_EXT 0x8F47
+#define GL_DOUBLE_MAT4_EXT 0x8F48
+#define GL_DOUBLE_MAT2x3_EXT 0x8F49
+#define GL_DOUBLE_MAT2x4_EXT 0x8F4A
+#define GL_DOUBLE_MAT3x2_EXT 0x8F4B
+#define GL_DOUBLE_MAT3x4_EXT 0x8F4C
+#define GL_DOUBLE_MAT4x2_EXT 0x8F4D
+#define GL_DOUBLE_MAT4x3_EXT 0x8F4E
+#endif
+
+#ifndef GL_NV_gpu_program5
+#define GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV 0x8E5A
+#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5B
+#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5C
+#define GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV 0x8E5D
+#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5E
+#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5F
+#define GL_MAX_PROGRAM_SUBROUTINE_PARAMETERS_NV 0x8F44
+#define GL_MAX_PROGRAM_SUBROUTINE_NUM_NV 0x8F45
+#endif
+
+#ifndef GL_NV_gpu_shader5
+#define GL_INT64_NV 0x140E
+#define GL_UNSIGNED_INT64_NV 0x140F
+#define GL_INT8_NV 0x8FE0
+#define GL_INT8_VEC2_NV 0x8FE1
+#define GL_INT8_VEC3_NV 0x8FE2
+#define GL_INT8_VEC4_NV 0x8FE3
+#define GL_INT16_NV 0x8FE4
+#define GL_INT16_VEC2_NV 0x8FE5
+#define GL_INT16_VEC3_NV 0x8FE6
+#define GL_INT16_VEC4_NV 0x8FE7
+#define GL_INT64_VEC2_NV 0x8FE9
+#define GL_INT64_VEC3_NV 0x8FEA
+#define GL_INT64_VEC4_NV 0x8FEB
+#define GL_UNSIGNED_INT8_NV 0x8FEC
+#define GL_UNSIGNED_INT8_VEC2_NV 0x8FED
+#define GL_UNSIGNED_INT8_VEC3_NV 0x8FEE
+#define GL_UNSIGNED_INT8_VEC4_NV 0x8FEF
+#define GL_UNSIGNED_INT16_NV 0x8FF0
+#define GL_UNSIGNED_INT16_VEC2_NV 0x8FF1
+#define GL_UNSIGNED_INT16_VEC3_NV 0x8FF2
+#define GL_UNSIGNED_INT16_VEC4_NV 0x8FF3
+#define GL_UNSIGNED_INT64_VEC2_NV 0x8FF5
+#define GL_UNSIGNED_INT64_VEC3_NV 0x8FF6
+#define GL_UNSIGNED_INT64_VEC4_NV 0x8FF7
+#define GL_FLOAT16_NV 0x8FF8
+#define GL_FLOAT16_VEC2_NV 0x8FF9
+#define GL_FLOAT16_VEC3_NV 0x8FFA
+#define GL_FLOAT16_VEC4_NV 0x8FFB
+/* reuse GL_PATCHES */
+#endif
+
+#ifndef GL_NV_shader_buffer_store
+#define GL_SHADER_GLOBAL_ACCESS_BARRIER_BIT_NV 0x00000010
+/* reuse GL_READ_WRITE */
+/* reuse GL_WRITE_ONLY */
+#endif
+
+#ifndef GL_NV_tessellation_program5
+#define GL_MAX_PROGRAM_PATCH_ATTRIBS_NV 0x86D8
+#define GL_TESS_CONTROL_PROGRAM_NV 0x891E
+#define GL_TESS_EVALUATION_PROGRAM_NV 0x891F
+#define GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV 0x8C74
+#define GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV 0x8C75
+#endif
+
+#ifndef GL_NV_vertex_attrib_integer_64bit
+/* reuse GL_INT64_NV */
+/* reuse GL_UNSIGNED_INT64_NV */
+#endif
+
+#ifndef GL_NV_multisample_coverage
+#define GL_COVERAGE_SAMPLES_NV 0x80A9
+#define GL_COLOR_SAMPLES_NV 0x8E20
+#endif
+
+#ifndef GL_AMD_name_gen_delete
+#define GL_DATA_BUFFER_AMD 0x9151
+#define GL_PERFORMANCE_MONITOR_AMD 0x9152
+#define GL_QUERY_OBJECT_AMD 0x9153
+#define GL_VERTEX_ARRAY_OBJECT_AMD 0x9154
+#define GL_SAMPLER_OBJECT_AMD 0x9155
+#endif
+
+#ifndef GL_AMD_debug_output
+#define GL_MAX_DEBUG_LOGGED_MESSAGES_AMD 0x9144
+#define GL_DEBUG_LOGGED_MESSAGES_AMD 0x9145
+#define GL_DEBUG_SEVERITY_HIGH_AMD 0x9146
+#define GL_DEBUG_SEVERITY_MEDIUM_AMD 0x9147
+#define GL_DEBUG_SEVERITY_LOW_AMD 0x9148
+#define GL_DEBUG_CATEGORY_API_ERROR_AMD 0x9149
+#define GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD 0x914A
+#define GL_DEBUG_CATEGORY_DEPRECATION_AMD 0x914B
+#define GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD 0x914C
+#define GL_DEBUG_CATEGORY_PERFORMANCE_AMD 0x914D
+#define GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD 0x914E
+#define GL_DEBUG_CATEGORY_APPLICATION_AMD 0x914F
+#define GL_DEBUG_CATEGORY_OTHER_AMD 0x9150
+#endif
+
+#ifndef GL_NV_vdpau_interop
+#define GL_SURFACE_STATE_NV 0x86EB
+#define GL_SURFACE_REGISTERED_NV 0x86FD
+#define GL_SURFACE_MAPPED_NV 0x8700
+#define GL_WRITE_DISCARD_NV 0x88BE
+#endif
+
+#ifndef GL_AMD_transform_feedback3_lines_triangles
+#endif
+
+#ifndef GL_AMD_depth_clamp_separate
+#define GL_DEPTH_CLAMP_NEAR_AMD 0x901E
+#define GL_DEPTH_CLAMP_FAR_AMD 0x901F
+#endif
+
+#ifndef GL_EXT_texture_sRGB_decode
+#define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48
+#define GL_DECODE_EXT 0x8A49
+#define GL_SKIP_DECODE_EXT 0x8A4A
+#endif
+
+#ifndef GL_NV_texture_multisample
+#define GL_TEXTURE_COVERAGE_SAMPLES_NV 0x9045
+#define GL_TEXTURE_COLOR_SAMPLES_NV 0x9046
+#endif
+
+#ifndef GL_AMD_blend_minmax_factor
+#define GL_FACTOR_MIN_AMD 0x901C
+#define GL_FACTOR_MAX_AMD 0x901D
+#endif
+
+#ifndef GL_AMD_sample_positions
+#define GL_SUBSAMPLE_DISTANCE_AMD 0x883F
+#endif
+
+#ifndef GL_EXT_x11_sync_object
+#define GL_SYNC_X11_FENCE_EXT 0x90E1
+#endif
+
+#ifndef GL_AMD_multi_draw_indirect
+#endif
+
+#ifndef GL_EXT_framebuffer_multisample_blit_scaled
+#define GL_SCALED_RESOLVE_FASTEST_EXT 0x90BA
+#define GL_SCALED_RESOLVE_NICEST_EXT 0x90BB
+#endif
+
+
+/*************************************************************/
+
+#include <stddef.h>
+#ifndef GL_VERSION_2_0
+/* GL type for program/shader text */
+typedef char GLchar;
+#endif
+
+#ifndef GL_VERSION_1_5
+/* GL types for handling large vertex buffer objects */
+typedef ptrdiff_t GLintptr;
+typedef ptrdiff_t GLsizeiptr;
+#endif
+
+#ifndef GL_ARB_vertex_buffer_object
+/* GL types for handling large vertex buffer objects */
+typedef ptrdiff_t GLintptrARB;
+typedef ptrdiff_t GLsizeiptrARB;
+#endif
+
+#ifndef GL_ARB_shader_objects
+/* GL types for program/shader text and shader object handles */
+typedef char GLcharARB;
+typedef unsigned int GLhandleARB;
+#endif
+
+/* GL type for "half" precision (s10e5) float data in host memory */
+#ifndef GL_ARB_half_float_pixel
+typedef unsigned short GLhalfARB;
+#endif
+
+#ifndef GL_NV_half_float
+typedef unsigned short GLhalfNV;
+#endif
+
+#ifndef GLEXT_64_TYPES_DEFINED
+/* This code block is duplicated in glxext.h, so must be protected */
+#define GLEXT_64_TYPES_DEFINED
+/* Define int32_t, int64_t, and uint64_t types for UST/MSC */
+/* (as used in the GL_EXT_timer_query extension). */
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+#include <inttypes.h>
+#elif defined(__sun__) || defined(__digital__)
+#include <inttypes.h>
+#if defined(__STDC__)
+#if defined(__arch64__) || defined(_LP64)
+typedef long int int64_t;
+typedef unsigned long int uint64_t;
+#else
+typedef long long int int64_t;
+typedef unsigned long long int uint64_t;
+#endif /* __arch64__ */
+#endif /* __STDC__ */
+#elif defined( __VMS ) || defined(__sgi)
+#include <inttypes.h>
+#elif defined(__SCO__) || defined(__USLC__)
+#include <stdint.h>
+#elif defined(__UNIXOS2__) || defined(__SOL64__)
+typedef long int int32_t;
+typedef long long int int64_t;
+typedef unsigned long long int uint64_t;
+#elif defined(_WIN32) && defined(__GNUC__)
+#include <stdint.h>
+#elif defined(_WIN32)
+typedef __int32 int32_t;
+typedef __int64 int64_t;
+typedef unsigned __int64 uint64_t;
+#else
+/* Fallback if nothing above works */
+#include <inttypes.h>
+#endif
+#endif
+
+#ifndef GL_EXT_timer_query
+typedef int64_t GLint64EXT;
+typedef uint64_t GLuint64EXT;
+#endif
+
+#ifndef GL_ARB_sync
+typedef int64_t GLint64;
+typedef uint64_t GLuint64;
+typedef struct __GLsync *GLsync;
+#endif
+
+#ifndef GL_ARB_cl_event
+/* These incomplete types let us declare types compatible with OpenCL's cl_context and cl_event */
+struct _cl_context;
+struct _cl_event;
+#endif
+
+#ifndef GL_ARB_debug_output
+typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam);
+#endif
+
+#ifndef GL_AMD_debug_output
+typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam);
+#endif
+
+#ifndef GL_NV_vdpau_interop
+typedef GLintptr GLvdpauSurfaceNV;
+#endif
+
+#ifndef GL_VERSION_1_2
+#define GL_VERSION_1_2 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+GLAPI void APIENTRY glBlendEquation (GLenum mode);
+GLAPI void APIENTRY glDrawRangeElements (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
+GLAPI void APIENTRY glTexImage3D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glCopyTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);
+typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
+typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+#endif
+
+#ifndef GL_VERSION_1_2_DEPRECATED
+#define GL_VERSION_1_2_DEPRECATED 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColorTable (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
+GLAPI void APIENTRY glColorTableParameterfv (GLenum target, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glColorTableParameteriv (GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glCopyColorTable (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+GLAPI void APIENTRY glGetColorTable (GLenum target, GLenum format, GLenum type, GLvoid *table);
+GLAPI void APIENTRY glGetColorTableParameterfv (GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetColorTableParameteriv (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glColorSubTable (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
+GLAPI void APIENTRY glCopyColorSubTable (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
+GLAPI void APIENTRY glConvolutionFilter1D (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
+GLAPI void APIENTRY glConvolutionFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
+GLAPI void APIENTRY glConvolutionParameterf (GLenum target, GLenum pname, GLfloat params);
+GLAPI void APIENTRY glConvolutionParameterfv (GLenum target, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glConvolutionParameteri (GLenum target, GLenum pname, GLint params);
+GLAPI void APIENTRY glConvolutionParameteriv (GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glCopyConvolutionFilter1D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+GLAPI void APIENTRY glCopyConvolutionFilter2D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glGetConvolutionFilter (GLenum target, GLenum format, GLenum type, GLvoid *image);
+GLAPI void APIENTRY glGetConvolutionParameterfv (GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetConvolutionParameteriv (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetSeparableFilter (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
+GLAPI void APIENTRY glSeparableFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
+GLAPI void APIENTRY glGetHistogram (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+GLAPI void APIENTRY glGetHistogramParameterfv (GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetHistogramParameteriv (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetMinmax (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+GLAPI void APIENTRY glGetMinmaxParameterfv (GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetMinmaxParameteriv (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glHistogram (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
+GLAPI void APIENTRY glMinmax (GLenum target, GLenum internalformat, GLboolean sink);
+GLAPI void APIENTRY glResetHistogram (GLenum target);
+GLAPI void APIENTRY glResetMinmax (GLenum target);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
+typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
+typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
+typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
+typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink);
+typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target);
+#endif
+
+#ifndef GL_VERSION_1_3
+#define GL_VERSION_1_3 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glActiveTexture (GLenum texture);
+GLAPI void APIENTRY glSampleCoverage (GLclampf value, GLboolean invert);
+GLAPI void APIENTRY glCompressedTexImage3D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY glCompressedTexImage1D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY glGetCompressedTexImage (GLenum target, GLint level, GLvoid *img);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img);
+#endif
+
+#ifndef GL_VERSION_1_3_DEPRECATED
+#define GL_VERSION_1_3_DEPRECATED 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glClientActiveTexture (GLenum texture);
+GLAPI void APIENTRY glMultiTexCoord1d (GLenum target, GLdouble s);
+GLAPI void APIENTRY glMultiTexCoord1dv (GLenum target, const GLdouble *v);
+GLAPI void APIENTRY glMultiTexCoord1f (GLenum target, GLfloat s);
+GLAPI void APIENTRY glMultiTexCoord1fv (GLenum target, const GLfloat *v);
+GLAPI void APIENTRY glMultiTexCoord1i (GLenum target, GLint s);
+GLAPI void APIENTRY glMultiTexCoord1iv (GLenum target, const GLint *v);
+GLAPI void APIENTRY glMultiTexCoord1s (GLenum target, GLshort s);
+GLAPI void APIENTRY glMultiTexCoord1sv (GLenum target, const GLshort *v);
+GLAPI void APIENTRY glMultiTexCoord2d (GLenum target, GLdouble s, GLdouble t);
+GLAPI void APIENTRY glMultiTexCoord2dv (GLenum target, const GLdouble *v);
+GLAPI void APIENTRY glMultiTexCoord2f (GLenum target, GLfloat s, GLfloat t);
+GLAPI void APIENTRY glMultiTexCoord2fv (GLenum target, const GLfloat *v);
+GLAPI void APIENTRY glMultiTexCoord2i (GLenum target, GLint s, GLint t);
+GLAPI void APIENTRY glMultiTexCoord2iv (GLenum target, const GLint *v);
+GLAPI void APIENTRY glMultiTexCoord2s (GLenum target, GLshort s, GLshort t);
+GLAPI void APIENTRY glMultiTexCoord2sv (GLenum target, const GLshort *v);
+GLAPI void APIENTRY glMultiTexCoord3d (GLenum target, GLdouble s, GLdouble t, GLdouble r);
+GLAPI void APIENTRY glMultiTexCoord3dv (GLenum target, const GLdouble *v);
+GLAPI void APIENTRY glMultiTexCoord3f (GLenum target, GLfloat s, GLfloat t, GLfloat r);
+GLAPI void APIENTRY glMultiTexCoord3fv (GLenum target, const GLfloat *v);
+GLAPI void APIENTRY glMultiTexCoord3i (GLenum target, GLint s, GLint t, GLint r);
+GLAPI void APIENTRY glMultiTexCoord3iv (GLenum target, const GLint *v);
+GLAPI void APIENTRY glMultiTexCoord3s (GLenum target, GLshort s, GLshort t, GLshort r);
+GLAPI void APIENTRY glMultiTexCoord3sv (GLenum target, const GLshort *v);
+GLAPI void APIENTRY glMultiTexCoord4d (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+GLAPI void APIENTRY glMultiTexCoord4dv (GLenum target, const GLdouble *v);
+GLAPI void APIENTRY glMultiTexCoord4f (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+GLAPI void APIENTRY glMultiTexCoord4fv (GLenum target, const GLfloat *v);
+GLAPI void APIENTRY glMultiTexCoord4i (GLenum target, GLint s, GLint t, GLint r, GLint q);
+GLAPI void APIENTRY glMultiTexCoord4iv (GLenum target, const GLint *v);
+GLAPI void APIENTRY glMultiTexCoord4s (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+GLAPI void APIENTRY glMultiTexCoord4sv (GLenum target, const GLshort *v);
+GLAPI void APIENTRY glLoadTransposeMatrixf (const GLfloat *m);
+GLAPI void APIENTRY glLoadTransposeMatrixd (const GLdouble *m);
+GLAPI void APIENTRY glMultTransposeMatrixf (const GLfloat *m);
+GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *m);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m);
+typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m);
+typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m);
+typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m);
+#endif
+
+#ifndef GL_VERSION_1_4
+#define GL_VERSION_1_4 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+GLAPI void APIENTRY glMultiDrawArrays (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
+GLAPI void APIENTRY glMultiDrawElements (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
+GLAPI void APIENTRY glPointParameterf (GLenum pname, GLfloat param);
+GLAPI void APIENTRY glPointParameterfv (GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glPointParameteri (GLenum pname, GLint param);
+GLAPI void APIENTRY glPointParameteriv (GLenum pname, const GLint *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
+typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params);
+#endif
+
+#ifndef GL_VERSION_1_4_DEPRECATED
+#define GL_VERSION_1_4_DEPRECATED 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFogCoordf (GLfloat coord);
+GLAPI void APIENTRY glFogCoordfv (const GLfloat *coord);
+GLAPI void APIENTRY glFogCoordd (GLdouble coord);
+GLAPI void APIENTRY glFogCoorddv (const GLdouble *coord);
+GLAPI void APIENTRY glFogCoordPointer (GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY glSecondaryColor3b (GLbyte red, GLbyte green, GLbyte blue);
+GLAPI void APIENTRY glSecondaryColor3bv (const GLbyte *v);
+GLAPI void APIENTRY glSecondaryColor3d (GLdouble red, GLdouble green, GLdouble blue);
+GLAPI void APIENTRY glSecondaryColor3dv (const GLdouble *v);
+GLAPI void APIENTRY glSecondaryColor3f (GLfloat red, GLfloat green, GLfloat blue);
+GLAPI void APIENTRY glSecondaryColor3fv (const GLfloat *v);
+GLAPI void APIENTRY glSecondaryColor3i (GLint red, GLint green, GLint blue);
+GLAPI void APIENTRY glSecondaryColor3iv (const GLint *v);
+GLAPI void APIENTRY glSecondaryColor3s (GLshort red, GLshort green, GLshort blue);
+GLAPI void APIENTRY glSecondaryColor3sv (const GLshort *v);
+GLAPI void APIENTRY glSecondaryColor3ub (GLubyte red, GLubyte green, GLubyte blue);
+GLAPI void APIENTRY glSecondaryColor3ubv (const GLubyte *v);
+GLAPI void APIENTRY glSecondaryColor3ui (GLuint red, GLuint green, GLuint blue);
+GLAPI void APIENTRY glSecondaryColor3uiv (const GLuint *v);
+GLAPI void APIENTRY glSecondaryColor3us (GLushort red, GLushort green, GLushort blue);
+GLAPI void APIENTRY glSecondaryColor3usv (const GLushort *v);
+GLAPI void APIENTRY glSecondaryColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY glWindowPos2d (GLdouble x, GLdouble y);
+GLAPI void APIENTRY glWindowPos2dv (const GLdouble *v);
+GLAPI void APIENTRY glWindowPos2f (GLfloat x, GLfloat y);
+GLAPI void APIENTRY glWindowPos2fv (const GLfloat *v);
+GLAPI void APIENTRY glWindowPos2i (GLint x, GLint y);
+GLAPI void APIENTRY glWindowPos2iv (const GLint *v);
+GLAPI void APIENTRY glWindowPos2s (GLshort x, GLshort y);
+GLAPI void APIENTRY glWindowPos2sv (const GLshort *v);
+GLAPI void APIENTRY glWindowPos3d (GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glWindowPos3dv (const GLdouble *v);
+GLAPI void APIENTRY glWindowPos3f (GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glWindowPos3fv (const GLfloat *v);
+GLAPI void APIENTRY glWindowPos3i (GLint x, GLint y, GLint z);
+GLAPI void APIENTRY glWindowPos3iv (const GLint *v);
+GLAPI void APIENTRY glWindowPos3s (GLshort x, GLshort y, GLshort z);
+GLAPI void APIENTRY glWindowPos3sv (const GLshort *v);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFOGCOORDFPROC) (GLfloat coord);
+typedef void (APIENTRYP PFNGLFOGCOORDFVPROC) (const GLfloat *coord);
+typedef void (APIENTRYP PFNGLFOGCOORDDPROC) (GLdouble coord);
+typedef void (APIENTRYP PFNGLFOGCOORDDVPROC) (const GLdouble *coord);
+typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2DVPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FVPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IPROC) (GLint x, GLint y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IVPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SVPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DVPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FVPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IVPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SVPROC) (const GLshort *v);
+#endif
+
+#ifndef GL_VERSION_1_5
+#define GL_VERSION_1_5 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGenQueries (GLsizei n, GLuint *ids);
+GLAPI void APIENTRY glDeleteQueries (GLsizei n, const GLuint *ids);
+GLAPI GLboolean APIENTRY glIsQuery (GLuint id);
+GLAPI void APIENTRY glBeginQuery (GLenum target, GLuint id);
+GLAPI void APIENTRY glEndQuery (GLenum target);
+GLAPI void APIENTRY glGetQueryiv (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetQueryObjectiv (GLuint id, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetQueryObjectuiv (GLuint id, GLenum pname, GLuint *params);
+GLAPI void APIENTRY glBindBuffer (GLenum target, GLuint buffer);
+GLAPI void APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers);
+GLAPI void APIENTRY glGenBuffers (GLsizei n, GLuint *buffers);
+GLAPI GLboolean APIENTRY glIsBuffer (GLuint buffer);
+GLAPI void APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage);
+GLAPI void APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data);
+GLAPI void APIENTRY glGetBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data);
+GLAPI GLvoid* APIENTRY glMapBuffer (GLenum target, GLenum access);
+GLAPI GLboolean APIENTRY glUnmapBuffer (GLenum target);
+GLAPI void APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetBufferPointerv (GLenum target, GLenum pname, GLvoid* *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids);
+typedef void (APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids);
+typedef GLboolean (APIENTRYP PFNGLISQUERYPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLBEGINQUERYPROC) (GLenum target, GLuint id);
+typedef void (APIENTRYP PFNGLENDQUERYPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint *params);
+typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer);
+typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers);
+typedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers);
+typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage);
+typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data);
+typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data);
+typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERPROC) (GLenum target, GLenum access);
+typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid* *params);
+#endif
+
+#ifndef GL_VERSION_2_0
+#define GL_VERSION_2_0 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha);
+GLAPI void APIENTRY glDrawBuffers (GLsizei n, const GLenum *bufs);
+GLAPI void APIENTRY glStencilOpSeparate (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
+GLAPI void APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);
+GLAPI void APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask);
+GLAPI void APIENTRY glAttachShader (GLuint program, GLuint shader);
+GLAPI void APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar *name);
+GLAPI void APIENTRY glCompileShader (GLuint shader);
+GLAPI GLuint APIENTRY glCreateProgram (void);
+GLAPI GLuint APIENTRY glCreateShader (GLenum type);
+GLAPI void APIENTRY glDeleteProgram (GLuint program);
+GLAPI void APIENTRY glDeleteShader (GLuint shader);
+GLAPI void APIENTRY glDetachShader (GLuint program, GLuint shader);
+GLAPI void APIENTRY glDisableVertexAttribArray (GLuint index);
+GLAPI void APIENTRY glEnableVertexAttribArray (GLuint index);
+GLAPI void APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+GLAPI void APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+GLAPI void APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj);
+GLAPI GLint APIENTRY glGetAttribLocation (GLuint program, const GLchar *name);
+GLAPI void APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+GLAPI void APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+GLAPI void APIENTRY glGetShaderSource (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
+GLAPI GLint APIENTRY glGetUniformLocation (GLuint program, const GLchar *name);
+GLAPI void APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat *params);
+GLAPI void APIENTRY glGetUniformiv (GLuint program, GLint location, GLint *params);
+GLAPI void APIENTRY glGetVertexAttribdv (GLuint index, GLenum pname, GLdouble *params);
+GLAPI void APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, GLvoid* *pointer);
+GLAPI GLboolean APIENTRY glIsProgram (GLuint program);
+GLAPI GLboolean APIENTRY glIsShader (GLuint shader);
+GLAPI void APIENTRY glLinkProgram (GLuint program);
+GLAPI void APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar* *string, const GLint *length);
+GLAPI void APIENTRY glUseProgram (GLuint program);
+GLAPI void APIENTRY glUniform1f (GLint location, GLfloat v0);
+GLAPI void APIENTRY glUniform2f (GLint location, GLfloat v0, GLfloat v1);
+GLAPI void APIENTRY glUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+GLAPI void APIENTRY glUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+GLAPI void APIENTRY glUniform1i (GLint location, GLint v0);
+GLAPI void APIENTRY glUniform2i (GLint location, GLint v0, GLint v1);
+GLAPI void APIENTRY glUniform3i (GLint location, GLint v0, GLint v1, GLint v2);
+GLAPI void APIENTRY glUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+GLAPI void APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glValidateProgram (GLuint program);
+GLAPI void APIENTRY glVertexAttrib1d (GLuint index, GLdouble x);
+GLAPI void APIENTRY glVertexAttrib1dv (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib1f (GLuint index, GLfloat x);
+GLAPI void APIENTRY glVertexAttrib1fv (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib1s (GLuint index, GLshort x);
+GLAPI void APIENTRY glVertexAttrib1sv (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib2d (GLuint index, GLdouble x, GLdouble y);
+GLAPI void APIENTRY glVertexAttrib2dv (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib2f (GLuint index, GLfloat x, GLfloat y);
+GLAPI void APIENTRY glVertexAttrib2fv (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib2s (GLuint index, GLshort x, GLshort y);
+GLAPI void APIENTRY glVertexAttrib2sv (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib3d (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glVertexAttrib3dv (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib3f (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glVertexAttrib3fv (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib3s (GLuint index, GLshort x, GLshort y, GLshort z);
+GLAPI void APIENTRY glVertexAttrib3sv (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib4Nbv (GLuint index, const GLbyte *v);
+GLAPI void APIENTRY glVertexAttrib4Niv (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttrib4Nsv (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib4Nub (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+GLAPI void APIENTRY glVertexAttrib4Nubv (GLuint index, const GLubyte *v);
+GLAPI void APIENTRY glVertexAttrib4Nuiv (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttrib4Nusv (GLuint index, const GLushort *v);
+GLAPI void APIENTRY glVertexAttrib4bv (GLuint index, const GLbyte *v);
+GLAPI void APIENTRY glVertexAttrib4d (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glVertexAttrib4dv (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY glVertexAttrib4fv (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib4iv (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttrib4s (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+GLAPI void APIENTRY glVertexAttrib4sv (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib4ubv (GLuint index, const GLubyte *v);
+GLAPI void APIENTRY glVertexAttrib4uiv (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttrib4usv (GLuint index, const GLushort *v);
+GLAPI void APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha);
+typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs);
+typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
+typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum face, GLenum func, GLint ref, GLuint mask);
+typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask);
+typedef void (APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader);
+typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name);
+typedef void (APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader);
+typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC) (void);
+typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC) (GLenum type);
+typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program);
+typedef void (APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader);
+typedef void (APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader);
+typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index);
+typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index);
+typedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+typedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj);
+typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name);
+typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+typedef void (APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+typedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
+typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name);
+typedef void (APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, GLvoid* *pointer);
+typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC) (GLuint program);
+typedef GLboolean (APIENTRYP PFNGLISSHADERPROC) (GLuint shader);
+typedef void (APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program);
+typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar* *string, const GLint *length);
+typedef void (APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program);
+typedef void (APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0);
+typedef void (APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1);
+typedef void (APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+typedef void (APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+typedef void (APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0);
+typedef void (APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1);
+typedef void (APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2);
+typedef void (APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+typedef void (APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_VERSION_2_1
+#define GL_VERSION_2_1 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glUniformMatrix2x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glUniformMatrix3x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glUniformMatrix2x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glUniformMatrix4x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glUniformMatrix3x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glUniformMatrix4x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+#endif
+
+#ifndef GL_VERSION_3_0
+#define GL_VERSION_3_0 1
+/* OpenGL 3.0 also reuses entry points from these extensions: */
+/* ARB_framebuffer_object */
+/* ARB_map_buffer_range */
+/* ARB_vertex_array_object */
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColorMaski (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
+GLAPI void APIENTRY glGetBooleani_v (GLenum target, GLuint index, GLboolean *data);
+GLAPI void APIENTRY glGetIntegeri_v (GLenum target, GLuint index, GLint *data);
+GLAPI void APIENTRY glEnablei (GLenum target, GLuint index);
+GLAPI void APIENTRY glDisablei (GLenum target, GLuint index);
+GLAPI GLboolean APIENTRY glIsEnabledi (GLenum target, GLuint index);
+GLAPI void APIENTRY glBeginTransformFeedback (GLenum primitiveMode);
+GLAPI void APIENTRY glEndTransformFeedback (void);
+GLAPI void APIENTRY glBindBufferRange (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+GLAPI void APIENTRY glBindBufferBase (GLenum target, GLuint index, GLuint buffer);
+GLAPI void APIENTRY glTransformFeedbackVaryings (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode);
+GLAPI void APIENTRY glGetTransformFeedbackVarying (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
+GLAPI void APIENTRY glClampColor (GLenum target, GLenum clamp);
+GLAPI void APIENTRY glBeginConditionalRender (GLuint id, GLenum mode);
+GLAPI void APIENTRY glEndConditionalRender (void);
+GLAPI void APIENTRY glVertexAttribIPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY glGetVertexAttribIiv (GLuint index, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetVertexAttribIuiv (GLuint index, GLenum pname, GLuint *params);
+GLAPI void APIENTRY glVertexAttribI1i (GLuint index, GLint x);
+GLAPI void APIENTRY glVertexAttribI2i (GLuint index, GLint x, GLint y);
+GLAPI void APIENTRY glVertexAttribI3i (GLuint index, GLint x, GLint y, GLint z);
+GLAPI void APIENTRY glVertexAttribI4i (GLuint index, GLint x, GLint y, GLint z, GLint w);
+GLAPI void APIENTRY glVertexAttribI1ui (GLuint index, GLuint x);
+GLAPI void APIENTRY glVertexAttribI2ui (GLuint index, GLuint x, GLuint y);
+GLAPI void APIENTRY glVertexAttribI3ui (GLuint index, GLuint x, GLuint y, GLuint z);
+GLAPI void APIENTRY glVertexAttribI4ui (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+GLAPI void APIENTRY glVertexAttribI1iv (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttribI2iv (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttribI3iv (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttribI4iv (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttribI1uiv (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttribI2uiv (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttribI3uiv (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttribI4uiv (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttribI4bv (GLuint index, const GLbyte *v);
+GLAPI void APIENTRY glVertexAttribI4sv (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttribI4ubv (GLuint index, const GLubyte *v);
+GLAPI void APIENTRY glVertexAttribI4usv (GLuint index, const GLushort *v);
+GLAPI void APIENTRY glGetUniformuiv (GLuint program, GLint location, GLuint *params);
+GLAPI void APIENTRY glBindFragDataLocation (GLuint program, GLuint color, const GLchar *name);
+GLAPI GLint APIENTRY glGetFragDataLocation (GLuint program, const GLchar *name);
+GLAPI void APIENTRY glUniform1ui (GLint location, GLuint v0);
+GLAPI void APIENTRY glUniform2ui (GLint location, GLuint v0, GLuint v1);
+GLAPI void APIENTRY glUniform3ui (GLint location, GLuint v0, GLuint v1, GLuint v2);
+GLAPI void APIENTRY glUniform4ui (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+GLAPI void APIENTRY glUniform1uiv (GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glUniform2uiv (GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glUniform3uiv (GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glUniform4uiv (GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glTexParameterIiv (GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glTexParameterIuiv (GLenum target, GLenum pname, const GLuint *params);
+GLAPI void APIENTRY glGetTexParameterIiv (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetTexParameterIuiv (GLenum target, GLenum pname, GLuint *params);
+GLAPI void APIENTRY glClearBufferiv (GLenum buffer, GLint drawbuffer, const GLint *value);
+GLAPI void APIENTRY glClearBufferuiv (GLenum buffer, GLint drawbuffer, const GLuint *value);
+GLAPI void APIENTRY glClearBufferfv (GLenum buffer, GLint drawbuffer, const GLfloat *value);
+GLAPI void APIENTRY glClearBufferfi (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
+GLAPI const GLubyte * APIENTRY glGetStringi (GLenum name, GLuint index);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLORMASKIPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
+typedef void (APIENTRYP PFNGLGETBOOLEANI_VPROC) (GLenum target, GLuint index, GLboolean *data);
+typedef void (APIENTRYP PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint *data);
+typedef void (APIENTRYP PFNGLENABLEIPROC) (GLenum target, GLuint index);
+typedef void (APIENTRYP PFNGLDISABLEIPROC) (GLenum target, GLuint index);
+typedef GLboolean (APIENTRYP PFNGLISENABLEDIPROC) (GLenum target, GLuint index);
+typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum primitiveMode);
+typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKPROC) (void);
+typedef void (APIENTRYP PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+typedef void (APIENTRYP PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer);
+typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode);
+typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
+typedef void (APIENTRYP PFNGLCLAMPCOLORPROC) (GLenum target, GLenum clamp);
+typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERPROC) (GLuint id, GLenum mode);
+typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERPROC) (void);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVPROC) (GLuint index, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint index, GLenum pname, GLuint *params);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IPROC) (GLuint index, GLint x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IPROC) (GLuint index, GLint x, GLint y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IPROC) (GLuint index, GLint x, GLint y, GLint z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIPROC) (GLuint index, GLuint x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIPROC) (GLuint index, GLuint x, GLuint y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVPROC) (GLuint index, const GLbyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVPROC) (GLuint index, const GLushort *v);
+typedef void (APIENTRYP PFNGLGETUNIFORMUIVPROC) (GLuint program, GLint location, GLuint *params);
+typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONPROC) (GLuint program, GLuint color, const GLchar *name);
+typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONPROC) (GLuint program, const GLchar *name);
+typedef void (APIENTRYP PFNGLUNIFORM1UIPROC) (GLint location, GLuint v0);
+typedef void (APIENTRYP PFNGLUNIFORM2UIPROC) (GLint location, GLuint v0, GLuint v1);
+typedef void (APIENTRYP PFNGLUNIFORM3UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2);
+typedef void (APIENTRYP PFNGLUNIFORM4UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+typedef void (APIENTRYP PFNGLUNIFORM1UIVPROC) (GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLUNIFORM2UIVPROC) (GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLUNIFORM3UIVPROC) (GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLUNIFORM4UIVPROC) (GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, const GLuint *params);
+typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, GLuint *params);
+typedef void (APIENTRYP PFNGLCLEARBUFFERIVPROC) (GLenum buffer, GLint drawbuffer, const GLint *value);
+typedef void (APIENTRYP PFNGLCLEARBUFFERUIVPROC) (GLenum buffer, GLint drawbuffer, const GLuint *value);
+typedef void (APIENTRYP PFNGLCLEARBUFFERFVPROC) (GLenum buffer, GLint drawbuffer, const GLfloat *value);
+typedef void (APIENTRYP PFNGLCLEARBUFFERFIPROC) (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
+typedef const GLubyte * (APIENTRYP PFNGLGETSTRINGIPROC) (GLenum name, GLuint index);
+#endif
+
+#ifndef GL_VERSION_3_1
+#define GL_VERSION_3_1 1
+/* OpenGL 3.1 also reuses entry points from these extensions: */
+/* ARB_copy_buffer */
+/* ARB_uniform_buffer_object */
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawArraysInstanced (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
+GLAPI void APIENTRY glDrawElementsInstanced (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
+GLAPI void APIENTRY glTexBuffer (GLenum target, GLenum internalformat, GLuint buffer);
+GLAPI void APIENTRY glPrimitiveRestartIndex (GLuint index);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
+typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
+typedef void (APIENTRYP PFNGLTEXBUFFERPROC) (GLenum target, GLenum internalformat, GLuint buffer);
+typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXPROC) (GLuint index);
+#endif
+
+#ifndef GL_VERSION_3_2
+#define GL_VERSION_3_2 1
+/* OpenGL 3.2 also reuses entry points from these extensions: */
+/* ARB_draw_elements_base_vertex */
+/* ARB_provoking_vertex */
+/* ARB_sync */
+/* ARB_texture_multisample */
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetInteger64i_v (GLenum target, GLuint index, GLint64 *data);
+GLAPI void APIENTRY glGetBufferParameteri64v (GLenum target, GLenum pname, GLint64 *params);
+GLAPI void APIENTRY glFramebufferTexture (GLenum target, GLenum attachment, GLuint texture, GLint level);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETINTEGER64I_VPROC) (GLenum target, GLuint index, GLint64 *data);
+typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum target, GLenum pname, GLint64 *params);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
+#endif
+
+#ifndef GL_VERSION_3_3
+#define GL_VERSION_3_3 1
+/* OpenGL 3.3 also reuses entry points from these extensions: */
+/* ARB_blend_func_extended */
+/* ARB_sampler_objects */
+/* ARB_explicit_attrib_location, but it has none */
+/* ARB_occlusion_query2 (no entry points) */
+/* ARB_shader_bit_encoding (no entry points) */
+/* ARB_texture_rgb10_a2ui (no entry points) */
+/* ARB_texture_swizzle (no entry points) */
+/* ARB_timer_query */
+/* ARB_vertex_type_2_10_10_10_rev */
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexAttribDivisor (GLuint index, GLuint divisor);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor);
+#endif
+
+#ifndef GL_VERSION_4_0
+#define GL_VERSION_4_0 1
+/* OpenGL 4.0 also reuses entry points from these extensions: */
+/* ARB_texture_query_lod (no entry points) */
+/* ARB_draw_indirect */
+/* ARB_gpu_shader5 (no entry points) */
+/* ARB_gpu_shader_fp64 */
+/* ARB_shader_subroutine */
+/* ARB_tessellation_shader */
+/* ARB_texture_buffer_object_rgb32 (no entry points) */
+/* ARB_texture_cube_map_array (no entry points) */
+/* ARB_texture_gather (no entry points) */
+/* ARB_transform_feedback2 */
+/* ARB_transform_feedback3 */
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glMinSampleShading (GLclampf value);
+GLAPI void APIENTRY glBlendEquationi (GLuint buf, GLenum mode);
+GLAPI void APIENTRY glBlendEquationSeparatei (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
+GLAPI void APIENTRY glBlendFunci (GLuint buf, GLenum src, GLenum dst);
+GLAPI void APIENTRY glBlendFuncSeparatei (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLMINSAMPLESHADINGPROC) (GLclampf value);
+typedef void (APIENTRYP PFNGLBLENDEQUATIONIPROC) (GLuint buf, GLenum mode);
+typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
+typedef void (APIENTRYP PFNGLBLENDFUNCIPROC) (GLuint buf, GLenum src, GLenum dst);
+typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+#endif
+
+#ifndef GL_VERSION_4_1
+#define GL_VERSION_4_1 1
+/* OpenGL 4.1 reuses entry points from these extensions: */
+/* ARB_ES2_compatibility */
+/* ARB_get_program_binary */
+/* ARB_separate_shader_objects */
+/* ARB_shader_precision (no entry points) */
+/* ARB_vertex_attrib_64bit */
+/* ARB_viewport_array */
+#endif
+
+#ifndef GL_VERSION_4_2
+#define GL_VERSION_4_2 1
+/* OpenGL 4.2 reuses entry points from these extensions: */
+/* ARB_base_instance */
+/* ARB_shading_language_420pack (no entry points) */
+/* ARB_transform_feedback_instanced */
+/* ARB_compressed_texture_pixel_storage (no entry points) */
+/* ARB_conservative_depth (no entry points) */
+/* ARB_internalformat_query */
+/* ARB_map_buffer_alignment (no entry points) */
+/* ARB_shader_atomic_counters */
+/* ARB_shader_image_load_store */
+/* ARB_shading_language_packing (no entry points) */
+/* ARB_texture_storage */
+#endif
+
+#ifndef GL_ARB_multitexture
+#define GL_ARB_multitexture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glActiveTextureARB (GLenum texture);
+GLAPI void APIENTRY glClientActiveTextureARB (GLenum texture);
+GLAPI void APIENTRY glMultiTexCoord1dARB (GLenum target, GLdouble s);
+GLAPI void APIENTRY glMultiTexCoord1dvARB (GLenum target, const GLdouble *v);
+GLAPI void APIENTRY glMultiTexCoord1fARB (GLenum target, GLfloat s);
+GLAPI void APIENTRY glMultiTexCoord1fvARB (GLenum target, const GLfloat *v);
+GLAPI void APIENTRY glMultiTexCoord1iARB (GLenum target, GLint s);
+GLAPI void APIENTRY glMultiTexCoord1ivARB (GLenum target, const GLint *v);
+GLAPI void APIENTRY glMultiTexCoord1sARB (GLenum target, GLshort s);
+GLAPI void APIENTRY glMultiTexCoord1svARB (GLenum target, const GLshort *v);
+GLAPI void APIENTRY glMultiTexCoord2dARB (GLenum target, GLdouble s, GLdouble t);
+GLAPI void APIENTRY glMultiTexCoord2dvARB (GLenum target, const GLdouble *v);
+GLAPI void APIENTRY glMultiTexCoord2fARB (GLenum target, GLfloat s, GLfloat t);
+GLAPI void APIENTRY glMultiTexCoord2fvARB (GLenum target, const GLfloat *v);
+GLAPI void APIENTRY glMultiTexCoord2iARB (GLenum target, GLint s, GLint t);
+GLAPI void APIENTRY glMultiTexCoord2ivARB (GLenum target, const GLint *v);
+GLAPI void APIENTRY glMultiTexCoord2sARB (GLenum target, GLshort s, GLshort t);
+GLAPI void APIENTRY glMultiTexCoord2svARB (GLenum target, const GLshort *v);
+GLAPI void APIENTRY glMultiTexCoord3dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r);
+GLAPI void APIENTRY glMultiTexCoord3dvARB (GLenum target, const GLdouble *v);
+GLAPI void APIENTRY glMultiTexCoord3fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r);
+GLAPI void APIENTRY glMultiTexCoord3fvARB (GLenum target, const GLfloat *v);
+GLAPI void APIENTRY glMultiTexCoord3iARB (GLenum target, GLint s, GLint t, GLint r);
+GLAPI void APIENTRY glMultiTexCoord3ivARB (GLenum target, const GLint *v);
+GLAPI void APIENTRY glMultiTexCoord3sARB (GLenum target, GLshort s, GLshort t, GLshort r);
+GLAPI void APIENTRY glMultiTexCoord3svARB (GLenum target, const GLshort *v);
+GLAPI void APIENTRY glMultiTexCoord4dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+GLAPI void APIENTRY glMultiTexCoord4dvARB (GLenum target, const GLdouble *v);
+GLAPI void APIENTRY glMultiTexCoord4fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+GLAPI void APIENTRY glMultiTexCoord4fvARB (GLenum target, const GLfloat *v);
+GLAPI void APIENTRY glMultiTexCoord4iARB (GLenum target, GLint s, GLint t, GLint r, GLint q);
+GLAPI void APIENTRY glMultiTexCoord4ivARB (GLenum target, const GLint *v);
+GLAPI void APIENTRY glMultiTexCoord4sARB (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+GLAPI void APIENTRY glMultiTexCoord4svARB (GLenum target, const GLshort *v);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v);
+#endif
+
+#ifndef GL_ARB_transpose_matrix
+#define GL_ARB_transpose_matrix 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *m);
+GLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *m);
+GLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat *m);
+GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *m);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m);
+typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m);
+typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat *m);
+typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m);
+#endif
+
+#ifndef GL_ARB_multisample
+#define GL_ARB_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSampleCoverageARB (GLclampf value, GLboolean invert);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert);
+#endif
+
+#ifndef GL_ARB_texture_env_add
+#define GL_ARB_texture_env_add 1
+#endif
+
+#ifndef GL_ARB_texture_cube_map
+#define GL_ARB_texture_cube_map 1
+#endif
+
+#ifndef GL_ARB_texture_compression
+#define GL_ARB_texture_compression 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum target, GLint level, GLvoid *img);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, GLvoid *img);
+#endif
+
+#ifndef GL_ARB_texture_border_clamp
+#define GL_ARB_texture_border_clamp 1
+#endif
+
+#ifndef GL_ARB_point_parameters
+#define GL_ARB_point_parameters 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPointParameterfARB (GLenum pname, GLfloat param);
+GLAPI void APIENTRY glPointParameterfvARB (GLenum pname, const GLfloat *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params);
+#endif
+
+#ifndef GL_ARB_vertex_blend
+#define GL_ARB_vertex_blend 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glWeightbvARB (GLint size, const GLbyte *weights);
+GLAPI void APIENTRY glWeightsvARB (GLint size, const GLshort *weights);
+GLAPI void APIENTRY glWeightivARB (GLint size, const GLint *weights);
+GLAPI void APIENTRY glWeightfvARB (GLint size, const GLfloat *weights);
+GLAPI void APIENTRY glWeightdvARB (GLint size, const GLdouble *weights);
+GLAPI void APIENTRY glWeightubvARB (GLint size, const GLubyte *weights);
+GLAPI void APIENTRY glWeightusvARB (GLint size, const GLushort *weights);
+GLAPI void APIENTRY glWeightuivARB (GLint size, const GLuint *weights);
+GLAPI void APIENTRY glWeightPointerARB (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY glVertexBlendARB (GLint count);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLWEIGHTBVARBPROC) (GLint size, const GLbyte *weights);
+typedef void (APIENTRYP PFNGLWEIGHTSVARBPROC) (GLint size, const GLshort *weights);
+typedef void (APIENTRYP PFNGLWEIGHTIVARBPROC) (GLint size, const GLint *weights);
+typedef void (APIENTRYP PFNGLWEIGHTFVARBPROC) (GLint size, const GLfloat *weights);
+typedef void (APIENTRYP PFNGLWEIGHTDVARBPROC) (GLint size, const GLdouble *weights);
+typedef void (APIENTRYP PFNGLWEIGHTUBVARBPROC) (GLint size, const GLubyte *weights);
+typedef void (APIENTRYP PFNGLWEIGHTUSVARBPROC) (GLint size, const GLushort *weights);
+typedef void (APIENTRYP PFNGLWEIGHTUIVARBPROC) (GLint size, const GLuint *weights);
+typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC) (GLint count);
+#endif
+
+#ifndef GL_ARB_matrix_palette
+#define GL_ARB_matrix_palette 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCurrentPaletteMatrixARB (GLint index);
+GLAPI void APIENTRY glMatrixIndexubvARB (GLint size, const GLubyte *indices);
+GLAPI void APIENTRY glMatrixIndexusvARB (GLint size, const GLushort *indices);
+GLAPI void APIENTRY glMatrixIndexuivARB (GLint size, const GLuint *indices);
+GLAPI void APIENTRY glMatrixIndexPointerARB (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index);
+typedef void (APIENTRYP PFNGLMATRIXINDEXUBVARBPROC) (GLint size, const GLubyte *indices);
+typedef void (APIENTRYP PFNGLMATRIXINDEXUSVARBPROC) (GLint size, const GLushort *indices);
+typedef void (APIENTRYP PFNGLMATRIXINDEXUIVARBPROC) (GLint size, const GLuint *indices);
+typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_ARB_texture_env_combine
+#define GL_ARB_texture_env_combine 1
+#endif
+
+#ifndef GL_ARB_texture_env_crossbar
+#define GL_ARB_texture_env_crossbar 1
+#endif
+
+#ifndef GL_ARB_texture_env_dot3
+#define GL_ARB_texture_env_dot3 1
+#endif
+
+#ifndef GL_ARB_texture_mirrored_repeat
+#define GL_ARB_texture_mirrored_repeat 1
+#endif
+
+#ifndef GL_ARB_depth_texture
+#define GL_ARB_depth_texture 1
+#endif
+
+#ifndef GL_ARB_shadow
+#define GL_ARB_shadow 1
+#endif
+
+#ifndef GL_ARB_shadow_ambient
+#define GL_ARB_shadow_ambient 1
+#endif
+
+#ifndef GL_ARB_window_pos
+#define GL_ARB_window_pos 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glWindowPos2dARB (GLdouble x, GLdouble y);
+GLAPI void APIENTRY glWindowPos2dvARB (const GLdouble *v);
+GLAPI void APIENTRY glWindowPos2fARB (GLfloat x, GLfloat y);
+GLAPI void APIENTRY glWindowPos2fvARB (const GLfloat *v);
+GLAPI void APIENTRY glWindowPos2iARB (GLint x, GLint y);
+GLAPI void APIENTRY glWindowPos2ivARB (const GLint *v);
+GLAPI void APIENTRY glWindowPos2sARB (GLshort x, GLshort y);
+GLAPI void APIENTRY glWindowPos2svARB (const GLshort *v);
+GLAPI void APIENTRY glWindowPos3dARB (GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glWindowPos3dvARB (const GLdouble *v);
+GLAPI void APIENTRY glWindowPos3fARB (GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glWindowPos3fvARB (const GLfloat *v);
+GLAPI void APIENTRY glWindowPos3iARB (GLint x, GLint y, GLint z);
+GLAPI void APIENTRY glWindowPos3ivARB (const GLint *v);
+GLAPI void APIENTRY glWindowPos3sARB (GLshort x, GLshort y, GLshort z);
+GLAPI void APIENTRY glWindowPos3svARB (const GLshort *v);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2DVARBPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FVARBPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IVARBPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SVARBPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DVARBPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FVARBPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IVARBPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SVARBPROC) (const GLshort *v);
+#endif
+
+#ifndef GL_ARB_vertex_program
+#define GL_ARB_vertex_program 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexAttrib1dARB (GLuint index, GLdouble x);
+GLAPI void APIENTRY glVertexAttrib1dvARB (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib1fARB (GLuint index, GLfloat x);
+GLAPI void APIENTRY glVertexAttrib1fvARB (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib1sARB (GLuint index, GLshort x);
+GLAPI void APIENTRY glVertexAttrib1svARB (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib2dARB (GLuint index, GLdouble x, GLdouble y);
+GLAPI void APIENTRY glVertexAttrib2dvARB (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib2fARB (GLuint index, GLfloat x, GLfloat y);
+GLAPI void APIENTRY glVertexAttrib2fvARB (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib2sARB (GLuint index, GLshort x, GLshort y);
+GLAPI void APIENTRY glVertexAttrib2svARB (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib3dARB (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glVertexAttrib3dvARB (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib3fARB (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glVertexAttrib3fvARB (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib3sARB (GLuint index, GLshort x, GLshort y, GLshort z);
+GLAPI void APIENTRY glVertexAttrib3svARB (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib4NbvARB (GLuint index, const GLbyte *v);
+GLAPI void APIENTRY glVertexAttrib4NivARB (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttrib4NsvARB (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib4NubARB (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+GLAPI void APIENTRY glVertexAttrib4NubvARB (GLuint index, const GLubyte *v);
+GLAPI void APIENTRY glVertexAttrib4NuivARB (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttrib4NusvARB (GLuint index, const GLushort *v);
+GLAPI void APIENTRY glVertexAttrib4bvARB (GLuint index, const GLbyte *v);
+GLAPI void APIENTRY glVertexAttrib4dARB (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glVertexAttrib4dvARB (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib4fARB (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY glVertexAttrib4fvARB (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib4ivARB (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttrib4sARB (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+GLAPI void APIENTRY glVertexAttrib4svARB (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib4ubvARB (GLuint index, const GLubyte *v);
+GLAPI void APIENTRY glVertexAttrib4uivARB (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttrib4usvARB (GLuint index, const GLushort *v);
+GLAPI void APIENTRY glVertexAttribPointerARB (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY glEnableVertexAttribArrayARB (GLuint index);
+GLAPI void APIENTRY glDisableVertexAttribArrayARB (GLuint index);
+GLAPI void APIENTRY glProgramStringARB (GLenum target, GLenum format, GLsizei len, const GLvoid *string);
+GLAPI void APIENTRY glBindProgramARB (GLenum target, GLuint program);
+GLAPI void APIENTRY glDeleteProgramsARB (GLsizei n, const GLuint *programs);
+GLAPI void APIENTRY glGenProgramsARB (GLsizei n, GLuint *programs);
+GLAPI void APIENTRY glProgramEnvParameter4dARB (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glProgramEnvParameter4dvARB (GLenum target, GLuint index, const GLdouble *params);
+GLAPI void APIENTRY glProgramEnvParameter4fARB (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY glProgramEnvParameter4fvARB (GLenum target, GLuint index, const GLfloat *params);
+GLAPI void APIENTRY glProgramLocalParameter4dARB (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glProgramLocalParameter4dvARB (GLenum target, GLuint index, const GLdouble *params);
+GLAPI void APIENTRY glProgramLocalParameter4fARB (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY glProgramLocalParameter4fvARB (GLenum target, GLuint index, const GLfloat *params);
+GLAPI void APIENTRY glGetProgramEnvParameterdvARB (GLenum target, GLuint index, GLdouble *params);
+GLAPI void APIENTRY glGetProgramEnvParameterfvARB (GLenum target, GLuint index, GLfloat *params);
+GLAPI void APIENTRY glGetProgramLocalParameterdvARB (GLenum target, GLuint index, GLdouble *params);
+GLAPI void APIENTRY glGetProgramLocalParameterfvARB (GLenum target, GLuint index, GLfloat *params);
+GLAPI void APIENTRY glGetProgramivARB (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetProgramStringARB (GLenum target, GLenum pname, GLvoid *string);
+GLAPI void APIENTRY glGetVertexAttribdvARB (GLuint index, GLenum pname, GLdouble *params);
+GLAPI void APIENTRY glGetVertexAttribfvARB (GLuint index, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetVertexAttribivARB (GLuint index, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetVertexAttribPointervARB (GLuint index, GLenum pname, GLvoid* *pointer);
+GLAPI GLboolean APIENTRY glIsProgramARB (GLuint program);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index);
+typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index);
+typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const GLvoid *string);
+typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program);
+typedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint *programs);
+typedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint *programs);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, GLvoid *string);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid* *pointer);
+typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program);
+#endif
+
+#ifndef GL_ARB_fragment_program
+#define GL_ARB_fragment_program 1
+/* All ARB_fragment_program entry points are shared with ARB_vertex_program. */
+#endif
+
+#ifndef GL_ARB_vertex_buffer_object
+#define GL_ARB_vertex_buffer_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBindBufferARB (GLenum target, GLuint buffer);
+GLAPI void APIENTRY glDeleteBuffersARB (GLsizei n, const GLuint *buffers);
+GLAPI void APIENTRY glGenBuffersARB (GLsizei n, GLuint *buffers);
+GLAPI GLboolean APIENTRY glIsBufferARB (GLuint buffer);
+GLAPI void APIENTRY glBufferDataARB (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage);
+GLAPI void APIENTRY glBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data);
+GLAPI void APIENTRY glGetBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data);
+GLAPI GLvoid* APIENTRY glMapBufferARB (GLenum target, GLenum access);
+GLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum target);
+GLAPI void APIENTRY glGetBufferParameterivARB (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetBufferPointervARB (GLenum target, GLenum pname, GLvoid* *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer);
+typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers);
+typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers);
+typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage);
+typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data);
+typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data);
+typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access);
+typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid* *params);
+#endif
+
+#ifndef GL_ARB_occlusion_query
+#define GL_ARB_occlusion_query 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGenQueriesARB (GLsizei n, GLuint *ids);
+GLAPI void APIENTRY glDeleteQueriesARB (GLsizei n, const GLuint *ids);
+GLAPI GLboolean APIENTRY glIsQueryARB (GLuint id);
+GLAPI void APIENTRY glBeginQueryARB (GLenum target, GLuint id);
+GLAPI void APIENTRY glEndQueryARB (GLenum target);
+GLAPI void APIENTRY glGetQueryivARB (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetQueryObjectivARB (GLuint id, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetQueryObjectuivARB (GLuint id, GLenum pname, GLuint *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint *ids);
+typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint *ids);
+typedef GLboolean (APIENTRYP PFNGLISQUERYARBPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id);
+typedef void (APIENTRYP PFNGLENDQUERYARBPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint *params);
+#endif
+
+#ifndef GL_ARB_shader_objects
+#define GL_ARB_shader_objects 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDeleteObjectARB (GLhandleARB obj);
+GLAPI GLhandleARB APIENTRY glGetHandleARB (GLenum pname);
+GLAPI void APIENTRY glDetachObjectARB (GLhandleARB containerObj, GLhandleARB attachedObj);
+GLAPI GLhandleARB APIENTRY glCreateShaderObjectARB (GLenum shaderType);
+GLAPI void APIENTRY glShaderSourceARB (GLhandleARB shaderObj, GLsizei count, const GLcharARB* *string, const GLint *length);
+GLAPI void APIENTRY glCompileShaderARB (GLhandleARB shaderObj);
+GLAPI GLhandleARB APIENTRY glCreateProgramObjectARB (void);
+GLAPI void APIENTRY glAttachObjectARB (GLhandleARB containerObj, GLhandleARB obj);
+GLAPI void APIENTRY glLinkProgramARB (GLhandleARB programObj);
+GLAPI void APIENTRY glUseProgramObjectARB (GLhandleARB programObj);
+GLAPI void APIENTRY glValidateProgramARB (GLhandleARB programObj);
+GLAPI void APIENTRY glUniform1fARB (GLint location, GLfloat v0);
+GLAPI void APIENTRY glUniform2fARB (GLint location, GLfloat v0, GLfloat v1);
+GLAPI void APIENTRY glUniform3fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+GLAPI void APIENTRY glUniform4fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+GLAPI void APIENTRY glUniform1iARB (GLint location, GLint v0);
+GLAPI void APIENTRY glUniform2iARB (GLint location, GLint v0, GLint v1);
+GLAPI void APIENTRY glUniform3iARB (GLint location, GLint v0, GLint v1, GLint v2);
+GLAPI void APIENTRY glUniform4iARB (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+GLAPI void APIENTRY glUniform1fvARB (GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glUniform2fvARB (GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glUniform3fvARB (GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glUniform4fvARB (GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glUniform1ivARB (GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glUniform2ivARB (GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glUniform3ivARB (GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glUniform4ivARB (GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glUniformMatrix2fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glUniformMatrix3fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glUniformMatrix4fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glGetObjectParameterfvARB (GLhandleARB obj, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetObjectParameterivARB (GLhandleARB obj, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetInfoLogARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog);
+GLAPI void APIENTRY glGetAttachedObjectsARB (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj);
+GLAPI GLint APIENTRY glGetUniformLocationARB (GLhandleARB programObj, const GLcharARB *name);
+GLAPI void APIENTRY glGetActiveUniformARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
+GLAPI void APIENTRY glGetUniformfvARB (GLhandleARB programObj, GLint location, GLfloat *params);
+GLAPI void APIENTRY glGetUniformivARB (GLhandleARB programObj, GLint location, GLint *params);
+GLAPI void APIENTRY glGetShaderSourceARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj);
+typedef GLhandleARB (APIENTRYP PFNGLGETHANDLEARBPROC) (GLenum pname);
+typedef void (APIENTRYP PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj);
+typedef GLhandleARB (APIENTRYP PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType);
+typedef void (APIENTRYP PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB* *string, const GLint *length);
+typedef void (APIENTRYP PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj);
+typedef GLhandleARB (APIENTRYP PFNGLCREATEPROGRAMOBJECTARBPROC) (void);
+typedef void (APIENTRYP PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj);
+typedef void (APIENTRYP PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj);
+typedef void (APIENTRYP PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj);
+typedef void (APIENTRYP PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj);
+typedef void (APIENTRYP PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0);
+typedef void (APIENTRYP PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1);
+typedef void (APIENTRYP PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+typedef void (APIENTRYP PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+typedef void (APIENTRYP PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0);
+typedef void (APIENTRYP PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1);
+typedef void (APIENTRYP PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2);
+typedef void (APIENTRYP PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+typedef void (APIENTRYP PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog);
+typedef void (APIENTRYP PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj);
+typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name);
+typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
+typedef void (APIENTRYP PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint *params);
+typedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source);
+#endif
+
+#ifndef GL_ARB_vertex_shader
+#define GL_ARB_vertex_shader 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBindAttribLocationARB (GLhandleARB programObj, GLuint index, const GLcharARB *name);
+GLAPI void APIENTRY glGetActiveAttribARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
+GLAPI GLint APIENTRY glGetAttribLocationARB (GLhandleARB programObj, const GLcharARB *name);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB *name);
+typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
+typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name);
+#endif
+
+#ifndef GL_ARB_fragment_shader
+#define GL_ARB_fragment_shader 1
+#endif
+
+#ifndef GL_ARB_shading_language_100
+#define GL_ARB_shading_language_100 1
+#endif
+
+#ifndef GL_ARB_texture_non_power_of_two
+#define GL_ARB_texture_non_power_of_two 1
+#endif
+
+#ifndef GL_ARB_point_sprite
+#define GL_ARB_point_sprite 1
+#endif
+
+#ifndef GL_ARB_fragment_program_shadow
+#define GL_ARB_fragment_program_shadow 1
+#endif
+
+#ifndef GL_ARB_draw_buffers
+#define GL_ARB_draw_buffers 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawBuffersARB (GLsizei n, const GLenum *bufs);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum *bufs);
+#endif
+
+#ifndef GL_ARB_texture_rectangle
+#define GL_ARB_texture_rectangle 1
+#endif
+
+#ifndef GL_ARB_color_buffer_float
+#define GL_ARB_color_buffer_float 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glClampColorARB (GLenum target, GLenum clamp);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp);
+#endif
+
+#ifndef GL_ARB_half_float_pixel
+#define GL_ARB_half_float_pixel 1
+#endif
+
+#ifndef GL_ARB_texture_float
+#define GL_ARB_texture_float 1
+#endif
+
+#ifndef GL_ARB_pixel_buffer_object
+#define GL_ARB_pixel_buffer_object 1
+#endif
+
+#ifndef GL_ARB_depth_buffer_float
+#define GL_ARB_depth_buffer_float 1
+#endif
+
+#ifndef GL_ARB_draw_instanced
+#define GL_ARB_draw_instanced 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawArraysInstancedARB (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
+GLAPI void APIENTRY glDrawElementsInstancedARB (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
+typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
+#endif
+
+#ifndef GL_ARB_framebuffer_object
+#define GL_ARB_framebuffer_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLboolean APIENTRY glIsRenderbuffer (GLuint renderbuffer);
+GLAPI void APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer);
+GLAPI void APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint *renderbuffers);
+GLAPI void APIENTRY glGenRenderbuffers (GLsizei n, GLuint *renderbuffers);
+GLAPI void APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint *params);
+GLAPI GLboolean APIENTRY glIsFramebuffer (GLuint framebuffer);
+GLAPI void APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer);
+GLAPI void APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint *framebuffers);
+GLAPI void APIENTRY glGenFramebuffers (GLsizei n, GLuint *framebuffers);
+GLAPI GLenum APIENTRY glCheckFramebufferStatus (GLenum target);
+GLAPI void APIENTRY glFramebufferTexture1D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GLAPI void APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GLAPI void APIENTRY glFramebufferTexture3D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+GLAPI void APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+GLAPI void APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGenerateMipmap (GLenum target);
+GLAPI void APIENTRY glBlitFramebuffer (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+GLAPI void APIENTRY glRenderbufferStorageMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glFramebufferTextureLayer (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint *renderbuffers);
+typedef void (APIENTRYP PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint *renderbuffers);
+typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer);
+typedef void (APIENTRYP PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer);
+typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint *framebuffers);
+typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint *framebuffers);
+typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGENERATEMIPMAPPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+#endif
+
+#ifndef GL_ARB_framebuffer_sRGB
+#define GL_ARB_framebuffer_sRGB 1
+#endif
+
+#ifndef GL_ARB_geometry_shader4
+#define GL_ARB_geometry_shader4 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glProgramParameteriARB (GLuint program, GLenum pname, GLint value);
+GLAPI void APIENTRY glFramebufferTextureARB (GLenum target, GLenum attachment, GLuint texture, GLint level);
+GLAPI void APIENTRY glFramebufferTextureLayerARB (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+GLAPI void APIENTRY glFramebufferTextureFaceARB (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIARBPROC) (GLuint program, GLenum pname, GLint value);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
+#endif
+
+#ifndef GL_ARB_half_float_vertex
+#define GL_ARB_half_float_vertex 1
+#endif
+
+#ifndef GL_ARB_instanced_arrays
+#define GL_ARB_instanced_arrays 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexAttribDivisorARB (GLuint index, GLuint divisor);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORARBPROC) (GLuint index, GLuint divisor);
+#endif
+
+#ifndef GL_ARB_map_buffer_range
+#define GL_ARB_map_buffer_range 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLvoid* APIENTRY glMapBufferRange (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
+GLAPI void APIENTRY glFlushMappedBufferRange (GLenum target, GLintptr offset, GLsizeiptr length);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
+typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length);
+#endif
+
+#ifndef GL_ARB_texture_buffer_object
+#define GL_ARB_texture_buffer_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexBufferARB (GLenum target, GLenum internalformat, GLuint buffer);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXBUFFERARBPROC) (GLenum target, GLenum internalformat, GLuint buffer);
+#endif
+
+#ifndef GL_ARB_texture_compression_rgtc
+#define GL_ARB_texture_compression_rgtc 1
+#endif
+
+#ifndef GL_ARB_texture_rg
+#define GL_ARB_texture_rg 1
+#endif
+
+#ifndef GL_ARB_vertex_array_object
+#define GL_ARB_vertex_array_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBindVertexArray (GLuint array);
+GLAPI void APIENTRY glDeleteVertexArrays (GLsizei n, const GLuint *arrays);
+GLAPI void APIENTRY glGenVertexArrays (GLsizei n, GLuint *arrays);
+GLAPI GLboolean APIENTRY glIsVertexArray (GLuint array);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBINDVERTEXARRAYPROC) (GLuint array);
+typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint *arrays);
+typedef void (APIENTRYP PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint *arrays);
+typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYPROC) (GLuint array);
+#endif
+
+#ifndef GL_ARB_uniform_buffer_object
+#define GL_ARB_uniform_buffer_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetUniformIndices (GLuint program, GLsizei uniformCount, const GLchar* *uniformNames, GLuint *uniformIndices);
+GLAPI void APIENTRY glGetActiveUniformsiv (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetActiveUniformName (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName);
+GLAPI GLuint APIENTRY glGetUniformBlockIndex (GLuint program, const GLchar *uniformBlockName);
+GLAPI void APIENTRY glGetActiveUniformBlockiv (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetActiveUniformBlockName (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName);
+GLAPI void APIENTRY glUniformBlockBinding (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar* *uniformNames, GLuint *uniformIndices);
+typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMNAMEPROC) (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName);
+typedef GLuint (APIENTRYP PFNGLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const GLchar *uniformBlockName);
+typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName);
+typedef void (APIENTRYP PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
+#endif
+
+#ifndef GL_ARB_compatibility
+#define GL_ARB_compatibility 1
+#endif
+
+#ifndef GL_ARB_copy_buffer
+#define GL_ARB_copy_buffer 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCopyBufferSubData (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
+#endif
+
+#ifndef GL_ARB_shader_texture_lod
+#define GL_ARB_shader_texture_lod 1
+#endif
+
+#ifndef GL_ARB_depth_clamp
+#define GL_ARB_depth_clamp 1
+#endif
+
+#ifndef GL_ARB_draw_elements_base_vertex
+#define GL_ARB_draw_elements_base_vertex 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawElementsBaseVertex (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex);
+GLAPI void APIENTRY glDrawRangeElementsBaseVertex (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex);
+GLAPI void APIENTRY glDrawElementsInstancedBaseVertex (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount, GLint basevertex);
+GLAPI void APIENTRY glMultiDrawElementsBaseVertex (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount, const GLint *basevertex);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex);
+typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex);
+typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount, GLint basevertex);
+typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount, const GLint *basevertex);
+#endif
+
+#ifndef GL_ARB_fragment_coord_conventions
+#define GL_ARB_fragment_coord_conventions 1
+#endif
+
+#ifndef GL_ARB_provoking_vertex
+#define GL_ARB_provoking_vertex 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glProvokingVertex (GLenum mode);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPROVOKINGVERTEXPROC) (GLenum mode);
+#endif
+
+#ifndef GL_ARB_seamless_cube_map
+#define GL_ARB_seamless_cube_map 1
+#endif
+
+#ifndef GL_ARB_sync
+#define GL_ARB_sync 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLsync APIENTRY glFenceSync (GLenum condition, GLbitfield flags);
+GLAPI GLboolean APIENTRY glIsSync (GLsync sync);
+GLAPI void APIENTRY glDeleteSync (GLsync sync);
+GLAPI GLenum APIENTRY glClientWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout);
+GLAPI void APIENTRY glWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout);
+GLAPI void APIENTRY glGetInteger64v (GLenum pname, GLint64 *params);
+GLAPI void APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLsync (APIENTRYP PFNGLFENCESYNCPROC) (GLenum condition, GLbitfield flags);
+typedef GLboolean (APIENTRYP PFNGLISSYNCPROC) (GLsync sync);
+typedef void (APIENTRYP PFNGLDELETESYNCPROC) (GLsync sync);
+typedef GLenum (APIENTRYP PFNGLCLIENTWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
+typedef void (APIENTRYP PFNGLWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
+typedef void (APIENTRYP PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64 *params);
+typedef void (APIENTRYP PFNGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
+#endif
+
+#ifndef GL_ARB_texture_multisample
+#define GL_ARB_texture_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexImage2DMultisample (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
+GLAPI void APIENTRY glTexImage3DMultisample (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
+GLAPI void APIENTRY glGetMultisamplefv (GLenum pname, GLuint index, GLfloat *val);
+GLAPI void APIENTRY glSampleMaski (GLuint index, GLbitfield mask);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
+typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
+typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVPROC) (GLenum pname, GLuint index, GLfloat *val);
+typedef void (APIENTRYP PFNGLSAMPLEMASKIPROC) (GLuint index, GLbitfield mask);
+#endif
+
+#ifndef GL_ARB_vertex_array_bgra
+#define GL_ARB_vertex_array_bgra 1
+#endif
+
+#ifndef GL_ARB_draw_buffers_blend
+#define GL_ARB_draw_buffers_blend 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendEquationiARB (GLuint buf, GLenum mode);
+GLAPI void APIENTRY glBlendEquationSeparateiARB (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
+GLAPI void APIENTRY glBlendFunciARB (GLuint buf, GLenum src, GLenum dst);
+GLAPI void APIENTRY glBlendFuncSeparateiARB (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDEQUATIONIARBPROC) (GLuint buf, GLenum mode);
+typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIARBPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
+typedef void (APIENTRYP PFNGLBLENDFUNCIARBPROC) (GLuint buf, GLenum src, GLenum dst);
+typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIARBPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+#endif
+
+#ifndef GL_ARB_sample_shading
+#define GL_ARB_sample_shading 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glMinSampleShadingARB (GLclampf value);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLMINSAMPLESHADINGARBPROC) (GLclampf value);
+#endif
+
+#ifndef GL_ARB_texture_cube_map_array
+#define GL_ARB_texture_cube_map_array 1
+#endif
+
+#ifndef GL_ARB_texture_gather
+#define GL_ARB_texture_gather 1
+#endif
+
+#ifndef GL_ARB_texture_query_lod
+#define GL_ARB_texture_query_lod 1
+#endif
+
+#ifndef GL_ARB_shading_language_include
+#define GL_ARB_shading_language_include 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glNamedStringARB (GLenum type, GLint namelen, const GLchar *name, GLint stringlen, const GLchar *string);
+GLAPI void APIENTRY glDeleteNamedStringARB (GLint namelen, const GLchar *name);
+GLAPI void APIENTRY glCompileShaderIncludeARB (GLuint shader, GLsizei count, const GLchar* *path, const GLint *length);
+GLAPI GLboolean APIENTRY glIsNamedStringARB (GLint namelen, const GLchar *name);
+GLAPI void APIENTRY glGetNamedStringARB (GLint namelen, const GLchar *name, GLsizei bufSize, GLint *stringlen, GLchar *string);
+GLAPI void APIENTRY glGetNamedStringivARB (GLint namelen, const GLchar *name, GLenum pname, GLint *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLNAMEDSTRINGARBPROC) (GLenum type, GLint namelen, const GLchar *name, GLint stringlen, const GLchar *string);
+typedef void (APIENTRYP PFNGLDELETENAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name);
+typedef void (APIENTRYP PFNGLCOMPILESHADERINCLUDEARBPROC) (GLuint shader, GLsizei count, const GLchar* *path, const GLint *length);
+typedef GLboolean (APIENTRYP PFNGLISNAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name);
+typedef void (APIENTRYP PFNGLGETNAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name, GLsizei bufSize, GLint *stringlen, GLchar *string);
+typedef void (APIENTRYP PFNGLGETNAMEDSTRINGIVARBPROC) (GLint namelen, const GLchar *name, GLenum pname, GLint *params);
+#endif
+
+#ifndef GL_ARB_texture_compression_bptc
+#define GL_ARB_texture_compression_bptc 1
+#endif
+
+#ifndef GL_ARB_blend_func_extended
+#define GL_ARB_blend_func_extended 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBindFragDataLocationIndexed (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name);
+GLAPI GLint APIENTRY glGetFragDataIndex (GLuint program, const GLchar *name);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONINDEXEDPROC) (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name);
+typedef GLint (APIENTRYP PFNGLGETFRAGDATAINDEXPROC) (GLuint program, const GLchar *name);
+#endif
+
+#ifndef GL_ARB_explicit_attrib_location
+#define GL_ARB_explicit_attrib_location 1
+#endif
+
+#ifndef GL_ARB_occlusion_query2
+#define GL_ARB_occlusion_query2 1
+#endif
+
+#ifndef GL_ARB_sampler_objects
+#define GL_ARB_sampler_objects 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGenSamplers (GLsizei count, GLuint *samplers);
+GLAPI void APIENTRY glDeleteSamplers (GLsizei count, const GLuint *samplers);
+GLAPI GLboolean APIENTRY glIsSampler (GLuint sampler);
+GLAPI void APIENTRY glBindSampler (GLuint unit, GLuint sampler);
+GLAPI void APIENTRY glSamplerParameteri (GLuint sampler, GLenum pname, GLint param);
+GLAPI void APIENTRY glSamplerParameteriv (GLuint sampler, GLenum pname, const GLint *param);
+GLAPI void APIENTRY glSamplerParameterf (GLuint sampler, GLenum pname, GLfloat param);
+GLAPI void APIENTRY glSamplerParameterfv (GLuint sampler, GLenum pname, const GLfloat *param);
+GLAPI void APIENTRY glSamplerParameterIiv (GLuint sampler, GLenum pname, const GLint *param);
+GLAPI void APIENTRY glSamplerParameterIuiv (GLuint sampler, GLenum pname, const GLuint *param);
+GLAPI void APIENTRY glGetSamplerParameteriv (GLuint sampler, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetSamplerParameterIiv (GLuint sampler, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetSamplerParameterfv (GLuint sampler, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetSamplerParameterIuiv (GLuint sampler, GLenum pname, GLuint *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint *samplers);
+typedef void (APIENTRYP PFNGLDELETESAMPLERSPROC) (GLsizei count, const GLuint *samplers);
+typedef GLboolean (APIENTRYP PFNGLISSAMPLERPROC) (GLuint sampler);
+typedef void (APIENTRYP PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler);
+typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint *param);
+typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat *param);
+typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, const GLint *param);
+typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, const GLuint *param);
+typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, GLuint *params);
+#endif
+
+#ifndef GL_ARB_shader_bit_encoding
+#define GL_ARB_shader_bit_encoding 1
+#endif
+
+#ifndef GL_ARB_texture_rgb10_a2ui
+#define GL_ARB_texture_rgb10_a2ui 1
+#endif
+
+#ifndef GL_ARB_texture_swizzle
+#define GL_ARB_texture_swizzle 1
+#endif
+
+#ifndef GL_ARB_timer_query
+#define GL_ARB_timer_query 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glQueryCounter (GLuint id, GLenum target);
+GLAPI void APIENTRY glGetQueryObjecti64v (GLuint id, GLenum pname, GLint64 *params);
+GLAPI void APIENTRY glGetQueryObjectui64v (GLuint id, GLenum pname, GLuint64 *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLQUERYCOUNTERPROC) (GLuint id, GLenum target);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VPROC) (GLuint id, GLenum pname, GLint64 *params);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VPROC) (GLuint id, GLenum pname, GLuint64 *params);
+#endif
+
+#ifndef GL_ARB_vertex_type_2_10_10_10_rev
+#define GL_ARB_vertex_type_2_10_10_10_rev 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexP2ui (GLenum type, GLuint value);
+GLAPI void APIENTRY glVertexP2uiv (GLenum type, const GLuint *value);
+GLAPI void APIENTRY glVertexP3ui (GLenum type, GLuint value);
+GLAPI void APIENTRY glVertexP3uiv (GLenum type, const GLuint *value);
+GLAPI void APIENTRY glVertexP4ui (GLenum type, GLuint value);
+GLAPI void APIENTRY glVertexP4uiv (GLenum type, const GLuint *value);
+GLAPI void APIENTRY glTexCoordP1ui (GLenum type, GLuint coords);
+GLAPI void APIENTRY glTexCoordP1uiv (GLenum type, const GLuint *coords);
+GLAPI void APIENTRY glTexCoordP2ui (GLenum type, GLuint coords);
+GLAPI void APIENTRY glTexCoordP2uiv (GLenum type, const GLuint *coords);
+GLAPI void APIENTRY glTexCoordP3ui (GLenum type, GLuint coords);
+GLAPI void APIENTRY glTexCoordP3uiv (GLenum type, const GLuint *coords);
+GLAPI void APIENTRY glTexCoordP4ui (GLenum type, GLuint coords);
+GLAPI void APIENTRY glTexCoordP4uiv (GLenum type, const GLuint *coords);
+GLAPI void APIENTRY glMultiTexCoordP1ui (GLenum texture, GLenum type, GLuint coords);
+GLAPI void APIENTRY glMultiTexCoordP1uiv (GLenum texture, GLenum type, const GLuint *coords);
+GLAPI void APIENTRY glMultiTexCoordP2ui (GLenum texture, GLenum type, GLuint coords);
+GLAPI void APIENTRY glMultiTexCoordP2uiv (GLenum texture, GLenum type, const GLuint *coords);
+GLAPI void APIENTRY glMultiTexCoordP3ui (GLenum texture, GLenum type, GLuint coords);
+GLAPI void APIENTRY glMultiTexCoordP3uiv (GLenum texture, GLenum type, const GLuint *coords);
+GLAPI void APIENTRY glMultiTexCoordP4ui (GLenum texture, GLenum type, GLuint coords);
+GLAPI void APIENTRY glMultiTexCoordP4uiv (GLenum texture, GLenum type, const GLuint *coords);
+GLAPI void APIENTRY glNormalP3ui (GLenum type, GLuint coords);
+GLAPI void APIENTRY glNormalP3uiv (GLenum type, const GLuint *coords);
+GLAPI void APIENTRY glColorP3ui (GLenum type, GLuint color);
+GLAPI void APIENTRY glColorP3uiv (GLenum type, const GLuint *color);
+GLAPI void APIENTRY glColorP4ui (GLenum type, GLuint color);
+GLAPI void APIENTRY glColorP4uiv (GLenum type, const GLuint *color);
+GLAPI void APIENTRY glSecondaryColorP3ui (GLenum type, GLuint color);
+GLAPI void APIENTRY glSecondaryColorP3uiv (GLenum type, const GLuint *color);
+GLAPI void APIENTRY glVertexAttribP1ui (GLuint index, GLenum type, GLboolean normalized, GLuint value);
+GLAPI void APIENTRY glVertexAttribP1uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
+GLAPI void APIENTRY glVertexAttribP2ui (GLuint index, GLenum type, GLboolean normalized, GLuint value);
+GLAPI void APIENTRY glVertexAttribP2uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
+GLAPI void APIENTRY glVertexAttribP3ui (GLuint index, GLenum type, GLboolean normalized, GLuint value);
+GLAPI void APIENTRY glVertexAttribP3uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
+GLAPI void APIENTRY glVertexAttribP4ui (GLuint index, GLenum type, GLboolean normalized, GLuint value);
+GLAPI void APIENTRY glVertexAttribP4uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXP2UIPROC) (GLenum type, GLuint value);
+typedef void (APIENTRYP PFNGLVERTEXP2UIVPROC) (GLenum type, const GLuint *value);
+typedef void (APIENTRYP PFNGLVERTEXP3UIPROC) (GLenum type, GLuint value);
+typedef void (APIENTRYP PFNGLVERTEXP3UIVPROC) (GLenum type, const GLuint *value);
+typedef void (APIENTRYP PFNGLVERTEXP4UIPROC) (GLenum type, GLuint value);
+typedef void (APIENTRYP PFNGLVERTEXP4UIVPROC) (GLenum type, const GLuint *value);
+typedef void (APIENTRYP PFNGLTEXCOORDP1UIPROC) (GLenum type, GLuint coords);
+typedef void (APIENTRYP PFNGLTEXCOORDP1UIVPROC) (GLenum type, const GLuint *coords);
+typedef void (APIENTRYP PFNGLTEXCOORDP2UIPROC) (GLenum type, GLuint coords);
+typedef void (APIENTRYP PFNGLTEXCOORDP2UIVPROC) (GLenum type, const GLuint *coords);
+typedef void (APIENTRYP PFNGLTEXCOORDP3UIPROC) (GLenum type, GLuint coords);
+typedef void (APIENTRYP PFNGLTEXCOORDP3UIVPROC) (GLenum type, const GLuint *coords);
+typedef void (APIENTRYP PFNGLTEXCOORDP4UIPROC) (GLenum type, GLuint coords);
+typedef void (APIENTRYP PFNGLTEXCOORDP4UIVPROC) (GLenum type, const GLuint *coords);
+typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIPROC) (GLenum texture, GLenum type, GLuint coords);
+typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIVPROC) (GLenum texture, GLenum type, const GLuint *coords);
+typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIPROC) (GLenum texture, GLenum type, GLuint coords);
+typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIVPROC) (GLenum texture, GLenum type, const GLuint *coords);
+typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIPROC) (GLenum texture, GLenum type, GLuint coords);
+typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIVPROC) (GLenum texture, GLenum type, const GLuint *coords);
+typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIPROC) (GLenum texture, GLenum type, GLuint coords);
+typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIVPROC) (GLenum texture, GLenum type, const GLuint *coords);
+typedef void (APIENTRYP PFNGLNORMALP3UIPROC) (GLenum type, GLuint coords);
+typedef void (APIENTRYP PFNGLNORMALP3UIVPROC) (GLenum type, const GLuint *coords);
+typedef void (APIENTRYP PFNGLCOLORP3UIPROC) (GLenum type, GLuint color);
+typedef void (APIENTRYP PFNGLCOLORP3UIVPROC) (GLenum type, const GLuint *color);
+typedef void (APIENTRYP PFNGLCOLORP4UIPROC) (GLenum type, GLuint color);
+typedef void (APIENTRYP PFNGLCOLORP4UIVPROC) (GLenum type, const GLuint *color);
+typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIPROC) (GLenum type, GLuint color);
+typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIVPROC) (GLenum type, const GLuint *color);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
+#endif
+
+#ifndef GL_ARB_draw_indirect
+#define GL_ARB_draw_indirect 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawArraysIndirect (GLenum mode, const GLvoid *indirect);
+GLAPI void APIENTRY glDrawElementsIndirect (GLenum mode, GLenum type, const GLvoid *indirect);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWARRAYSINDIRECTPROC) (GLenum mode, const GLvoid *indirect);
+typedef void (APIENTRYP PFNGLDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const GLvoid *indirect);
+#endif
+
+#ifndef GL_ARB_gpu_shader5
+#define GL_ARB_gpu_shader5 1
+#endif
+
+#ifndef GL_ARB_gpu_shader_fp64
+#define GL_ARB_gpu_shader_fp64 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glUniform1d (GLint location, GLdouble x);
+GLAPI void APIENTRY glUniform2d (GLint location, GLdouble x, GLdouble y);
+GLAPI void APIENTRY glUniform3d (GLint location, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glUniform4d (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glUniform1dv (GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glUniform2dv (GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glUniform3dv (GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glUniform4dv (GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glUniformMatrix2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glUniformMatrix3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glUniformMatrix4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glUniformMatrix2x3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glUniformMatrix2x4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glUniformMatrix3x2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glUniformMatrix3x4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glUniformMatrix4x2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glUniformMatrix4x3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glGetUniformdv (GLuint program, GLint location, GLdouble *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLUNIFORM1DPROC) (GLint location, GLdouble x);
+typedef void (APIENTRYP PFNGLUNIFORM2DPROC) (GLint location, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLUNIFORM3DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLUNIFORM4DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLUNIFORM1DVPROC) (GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORM2DVPROC) (GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORM3DVPROC) (GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORM4DVPROC) (GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLGETUNIFORMDVPROC) (GLuint program, GLint location, GLdouble *params);
+#endif
+
+#ifndef GL_ARB_shader_subroutine
+#define GL_ARB_shader_subroutine 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLint APIENTRY glGetSubroutineUniformLocation (GLuint program, GLenum shadertype, const GLchar *name);
+GLAPI GLuint APIENTRY glGetSubroutineIndex (GLuint program, GLenum shadertype, const GLchar *name);
+GLAPI void APIENTRY glGetActiveSubroutineUniformiv (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values);
+GLAPI void APIENTRY glGetActiveSubroutineUniformName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name);
+GLAPI void APIENTRY glGetActiveSubroutineName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name);
+GLAPI void APIENTRY glUniformSubroutinesuiv (GLenum shadertype, GLsizei count, const GLuint *indices);
+GLAPI void APIENTRY glGetUniformSubroutineuiv (GLenum shadertype, GLint location, GLuint *params);
+GLAPI void APIENTRY glGetProgramStageiv (GLuint program, GLenum shadertype, GLenum pname, GLint *values);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLint (APIENTRYP PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC) (GLuint program, GLenum shadertype, const GLchar *name);
+typedef GLuint (APIENTRYP PFNGLGETSUBROUTINEINDEXPROC) (GLuint program, GLenum shadertype, const GLchar *name);
+typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC) (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values);
+typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name);
+typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINENAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name);
+typedef void (APIENTRYP PFNGLUNIFORMSUBROUTINESUIVPROC) (GLenum shadertype, GLsizei count, const GLuint *indices);
+typedef void (APIENTRYP PFNGLGETUNIFORMSUBROUTINEUIVPROC) (GLenum shadertype, GLint location, GLuint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMSTAGEIVPROC) (GLuint program, GLenum shadertype, GLenum pname, GLint *values);
+#endif
+
+#ifndef GL_ARB_tessellation_shader
+#define GL_ARB_tessellation_shader 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPatchParameteri (GLenum pname, GLint value);
+GLAPI void APIENTRY glPatchParameterfv (GLenum pname, const GLfloat *values);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPATCHPARAMETERIPROC) (GLenum pname, GLint value);
+typedef void (APIENTRYP PFNGLPATCHPARAMETERFVPROC) (GLenum pname, const GLfloat *values);
+#endif
+
+#ifndef GL_ARB_texture_buffer_object_rgb32
+#define GL_ARB_texture_buffer_object_rgb32 1
+#endif
+
+#ifndef GL_ARB_transform_feedback2
+#define GL_ARB_transform_feedback2 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBindTransformFeedback (GLenum target, GLuint id);
+GLAPI void APIENTRY glDeleteTransformFeedbacks (GLsizei n, const GLuint *ids);
+GLAPI void APIENTRY glGenTransformFeedbacks (GLsizei n, GLuint *ids);
+GLAPI GLboolean APIENTRY glIsTransformFeedback (GLuint id);
+GLAPI void APIENTRY glPauseTransformFeedback (void);
+GLAPI void APIENTRY glResumeTransformFeedback (void);
+GLAPI void APIENTRY glDrawTransformFeedback (GLenum mode, GLuint id);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKPROC) (GLenum target, GLuint id);
+typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSPROC) (GLsizei n, const GLuint *ids);
+typedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint *ids);
+typedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKPROC) (void);
+typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKPROC) (void);
+typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKPROC) (GLenum mode, GLuint id);
+#endif
+
+#ifndef GL_ARB_transform_feedback3
+#define GL_ARB_transform_feedback3 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawTransformFeedbackStream (GLenum mode, GLuint id, GLuint stream);
+GLAPI void APIENTRY glBeginQueryIndexed (GLenum target, GLuint index, GLuint id);
+GLAPI void APIENTRY glEndQueryIndexed (GLenum target, GLuint index);
+GLAPI void APIENTRY glGetQueryIndexediv (GLenum target, GLuint index, GLenum pname, GLint *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC) (GLenum mode, GLuint id, GLuint stream);
+typedef void (APIENTRYP PFNGLBEGINQUERYINDEXEDPROC) (GLenum target, GLuint index, GLuint id);
+typedef void (APIENTRYP PFNGLENDQUERYINDEXEDPROC) (GLenum target, GLuint index);
+typedef void (APIENTRYP PFNGLGETQUERYINDEXEDIVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params);
+#endif
+
+#ifndef GL_ARB_ES2_compatibility
+#define GL_ARB_ES2_compatibility 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glReleaseShaderCompiler (void);
+GLAPI void APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length);
+GLAPI void APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
+GLAPI void APIENTRY glDepthRangef (GLclampf n, GLclampf f);
+GLAPI void APIENTRY glClearDepthf (GLclampf d);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLRELEASESHADERCOMPILERPROC) (void);
+typedef void (APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length);
+typedef void (APIENTRYP PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
+typedef void (APIENTRYP PFNGLDEPTHRANGEFPROC) (GLclampf n, GLclampf f);
+typedef void (APIENTRYP PFNGLCLEARDEPTHFPROC) (GLclampf d);
+#endif
+
+#ifndef GL_ARB_get_program_binary
+#define GL_ARB_get_program_binary 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetProgramBinary (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary);
+GLAPI void APIENTRY glProgramBinary (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length);
+GLAPI void APIENTRY glProgramParameteri (GLuint program, GLenum pname, GLint value);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary);
+typedef void (APIENTRYP PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value);
+#endif
+
+#ifndef GL_ARB_separate_shader_objects
+#define GL_ARB_separate_shader_objects 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glUseProgramStages (GLuint pipeline, GLbitfield stages, GLuint program);
+GLAPI void APIENTRY glActiveShaderProgram (GLuint pipeline, GLuint program);
+GLAPI GLuint APIENTRY glCreateShaderProgramv (GLenum type, GLsizei count, const GLchar* *strings);
+GLAPI void APIENTRY glBindProgramPipeline (GLuint pipeline);
+GLAPI void APIENTRY glDeleteProgramPipelines (GLsizei n, const GLuint *pipelines);
+GLAPI void APIENTRY glGenProgramPipelines (GLsizei n, GLuint *pipelines);
+GLAPI GLboolean APIENTRY glIsProgramPipeline (GLuint pipeline);
+GLAPI void APIENTRY glGetProgramPipelineiv (GLuint pipeline, GLenum pname, GLint *params);
+GLAPI void APIENTRY glProgramUniform1i (GLuint program, GLint location, GLint v0);
+GLAPI void APIENTRY glProgramUniform1iv (GLuint program, GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glProgramUniform1f (GLuint program, GLint location, GLfloat v0);
+GLAPI void APIENTRY glProgramUniform1fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniform1d (GLuint program, GLint location, GLdouble v0);
+GLAPI void APIENTRY glProgramUniform1dv (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniform1ui (GLuint program, GLint location, GLuint v0);
+GLAPI void APIENTRY glProgramUniform1uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glProgramUniform2i (GLuint program, GLint location, GLint v0, GLint v1);
+GLAPI void APIENTRY glProgramUniform2iv (GLuint program, GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glProgramUniform2f (GLuint program, GLint location, GLfloat v0, GLfloat v1);
+GLAPI void APIENTRY glProgramUniform2fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniform2d (GLuint program, GLint location, GLdouble v0, GLdouble v1);
+GLAPI void APIENTRY glProgramUniform2dv (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniform2ui (GLuint program, GLint location, GLuint v0, GLuint v1);
+GLAPI void APIENTRY glProgramUniform2uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glProgramUniform3i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
+GLAPI void APIENTRY glProgramUniform3iv (GLuint program, GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glProgramUniform3f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+GLAPI void APIENTRY glProgramUniform3fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniform3d (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2);
+GLAPI void APIENTRY glProgramUniform3dv (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniform3ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
+GLAPI void APIENTRY glProgramUniform3uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glProgramUniform4i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+GLAPI void APIENTRY glProgramUniform4iv (GLuint program, GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glProgramUniform4f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+GLAPI void APIENTRY glProgramUniform4fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniform4d (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3);
+GLAPI void APIENTRY glProgramUniform4dv (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniform4ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+GLAPI void APIENTRY glProgramUniform4uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glProgramUniformMatrix2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix2x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix3x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix2x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix4x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix3x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix4x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix2x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix3x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix2x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix4x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix3x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix4x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glValidateProgramPipeline (GLuint pipeline);
+GLAPI void APIENTRY glGetProgramPipelineInfoLog (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLUSEPROGRAMSTAGESPROC) (GLuint pipeline, GLbitfield stages, GLuint program);
+typedef void (APIENTRYP PFNGLACTIVESHADERPROGRAMPROC) (GLuint pipeline, GLuint program);
+typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMVPROC) (GLenum type, GLsizei count, const GLchar* *strings);
+typedef void (APIENTRYP PFNGLBINDPROGRAMPIPELINEPROC) (GLuint pipeline);
+typedef void (APIENTRYP PFNGLDELETEPROGRAMPIPELINESPROC) (GLsizei n, const GLuint *pipelines);
+typedef void (APIENTRYP PFNGLGENPROGRAMPIPELINESPROC) (GLsizei n, GLuint *pipelines);
+typedef GLboolean (APIENTRYP PFNGLISPROGRAMPIPELINEPROC) (GLuint pipeline);
+typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEIVPROC) (GLuint pipeline, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IPROC) (GLuint program, GLint location, GLint v0);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FPROC) (GLuint program, GLint location, GLfloat v0);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DPROC) (GLuint program, GLint location, GLdouble v0);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIPROC) (GLuint program, GLint location, GLuint v0);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IPROC) (GLuint program, GLint location, GLint v0, GLint v1);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEPROC) (GLuint pipeline);
+typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGPROC) (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+#endif
+
+#ifndef GL_ARB_vertex_attrib_64bit
+#define GL_ARB_vertex_attrib_64bit 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexAttribL1d (GLuint index, GLdouble x);
+GLAPI void APIENTRY glVertexAttribL2d (GLuint index, GLdouble x, GLdouble y);
+GLAPI void APIENTRY glVertexAttribL3d (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glVertexAttribL4d (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glVertexAttribL1dv (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribL2dv (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribL3dv (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribL4dv (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribLPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY glGetVertexAttribLdv (GLuint index, GLenum pname, GLdouble *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DPROC) (GLuint index, GLdouble x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DPROC) (GLuint index, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLDVPROC) (GLuint index, GLenum pname, GLdouble *params);
+#endif
+
+#ifndef GL_ARB_viewport_array
+#define GL_ARB_viewport_array 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glViewportArrayv (GLuint first, GLsizei count, const GLfloat *v);
+GLAPI void APIENTRY glViewportIndexedf (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h);
+GLAPI void APIENTRY glViewportIndexedfv (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glScissorArrayv (GLuint first, GLsizei count, const GLint *v);
+GLAPI void APIENTRY glScissorIndexed (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glScissorIndexedv (GLuint index, const GLint *v);
+GLAPI void APIENTRY glDepthRangeArrayv (GLuint first, GLsizei count, const GLclampd *v);
+GLAPI void APIENTRY glDepthRangeIndexed (GLuint index, GLclampd n, GLclampd f);
+GLAPI void APIENTRY glGetFloati_v (GLenum target, GLuint index, GLfloat *data);
+GLAPI void APIENTRY glGetDoublei_v (GLenum target, GLuint index, GLdouble *data);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVIEWPORTARRAYVPROC) (GLuint first, GLsizei count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVIEWPORTINDEXEDFPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h);
+typedef void (APIENTRYP PFNGLVIEWPORTINDEXEDFVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLSCISSORARRAYVPROC) (GLuint first, GLsizei count, const GLint *v);
+typedef void (APIENTRYP PFNGLSCISSORINDEXEDPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLSCISSORINDEXEDVPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLDEPTHRANGEARRAYVPROC) (GLuint first, GLsizei count, const GLclampd *v);
+typedef void (APIENTRYP PFNGLDEPTHRANGEINDEXEDPROC) (GLuint index, GLclampd n, GLclampd f);
+typedef void (APIENTRYP PFNGLGETFLOATI_VPROC) (GLenum target, GLuint index, GLfloat *data);
+typedef void (APIENTRYP PFNGLGETDOUBLEI_VPROC) (GLenum target, GLuint index, GLdouble *data);
+#endif
+
+#ifndef GL_ARB_cl_event
+#define GL_ARB_cl_event 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLsync APIENTRY glCreateSyncFromCLeventARB (struct _cl_context * context, struct _cl_event * event, GLbitfield flags);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLsync (APIENTRYP PFNGLCREATESYNCFROMCLEVENTARBPROC) (struct _cl_context * context, struct _cl_event * event, GLbitfield flags);
+#endif
+
+#ifndef GL_ARB_debug_output
+#define GL_ARB_debug_output 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDebugMessageControlARB (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
+GLAPI void APIENTRY glDebugMessageInsertARB (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
+GLAPI void APIENTRY glDebugMessageCallbackARB (GLDEBUGPROCARB callback, const GLvoid *userParam);
+GLAPI GLuint APIENTRY glGetDebugMessageLogARB (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLARBPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
+typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTARBPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
+typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKARBPROC) (GLDEBUGPROCARB callback, const GLvoid *userParam);
+typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGARBPROC) (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
+#endif
+
+#ifndef GL_ARB_robustness
+#define GL_ARB_robustness 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLenum APIENTRY glGetGraphicsResetStatusARB (void);
+GLAPI void APIENTRY glGetnMapdvARB (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v);
+GLAPI void APIENTRY glGetnMapfvARB (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v);
+GLAPI void APIENTRY glGetnMapivARB (GLenum target, GLenum query, GLsizei bufSize, GLint *v);
+GLAPI void APIENTRY glGetnPixelMapfvARB (GLenum map, GLsizei bufSize, GLfloat *values);
+GLAPI void APIENTRY glGetnPixelMapuivARB (GLenum map, GLsizei bufSize, GLuint *values);
+GLAPI void APIENTRY glGetnPixelMapusvARB (GLenum map, GLsizei bufSize, GLushort *values);
+GLAPI void APIENTRY glGetnPolygonStippleARB (GLsizei bufSize, GLubyte *pattern);
+GLAPI void APIENTRY glGetnColorTableARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *table);
+GLAPI void APIENTRY glGetnConvolutionFilterARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *image);
+GLAPI void APIENTRY glGetnSeparableFilterARB (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, GLvoid *row, GLsizei columnBufSize, GLvoid *column, GLvoid *span);
+GLAPI void APIENTRY glGetnHistogramARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values);
+GLAPI void APIENTRY glGetnMinmaxARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values);
+GLAPI void APIENTRY glGetnTexImageARB (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid *img);
+GLAPI void APIENTRY glReadnPixelsARB (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid *data);
+GLAPI void APIENTRY glGetnCompressedTexImageARB (GLenum target, GLint lod, GLsizei bufSize, GLvoid *img);
+GLAPI void APIENTRY glGetnUniformfvARB (GLuint program, GLint location, GLsizei bufSize, GLfloat *params);
+GLAPI void APIENTRY glGetnUniformivARB (GLuint program, GLint location, GLsizei bufSize, GLint *params);
+GLAPI void APIENTRY glGetnUniformuivARB (GLuint program, GLint location, GLsizei bufSize, GLuint *params);
+GLAPI void APIENTRY glGetnUniformdvARB (GLuint program, GLint location, GLsizei bufSize, GLdouble *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLenum (APIENTRYP PFNGLGETGRAPHICSRESETSTATUSARBPROC) (void);
+typedef void (APIENTRYP PFNGLGETNMAPDVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v);
+typedef void (APIENTRYP PFNGLGETNMAPFVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v);
+typedef void (APIENTRYP PFNGLGETNMAPIVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLint *v);
+typedef void (APIENTRYP PFNGLGETNPIXELMAPFVARBPROC) (GLenum map, GLsizei bufSize, GLfloat *values);
+typedef void (APIENTRYP PFNGLGETNPIXELMAPUIVARBPROC) (GLenum map, GLsizei bufSize, GLuint *values);
+typedef void (APIENTRYP PFNGLGETNPIXELMAPUSVARBPROC) (GLenum map, GLsizei bufSize, GLushort *values);
+typedef void (APIENTRYP PFNGLGETNPOLYGONSTIPPLEARBPROC) (GLsizei bufSize, GLubyte *pattern);
+typedef void (APIENTRYP PFNGLGETNCOLORTABLEARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *table);
+typedef void (APIENTRYP PFNGLGETNCONVOLUTIONFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *image);
+typedef void (APIENTRYP PFNGLGETNSEPARABLEFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, GLvoid *row, GLsizei columnBufSize, GLvoid *column, GLvoid *span);
+typedef void (APIENTRYP PFNGLGETNHISTOGRAMARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values);
+typedef void (APIENTRYP PFNGLGETNMINMAXARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values);
+typedef void (APIENTRYP PFNGLGETNTEXIMAGEARBPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid *img);
+typedef void (APIENTRYP PFNGLREADNPIXELSARBPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid *data);
+typedef void (APIENTRYP PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLsizei bufSize, GLvoid *img);
+typedef void (APIENTRYP PFNGLGETNUNIFORMFVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETNUNIFORMIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params);
+typedef void (APIENTRYP PFNGLGETNUNIFORMUIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint *params);
+typedef void (APIENTRYP PFNGLGETNUNIFORMDVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble *params);
+#endif
+
+#ifndef GL_ARB_shader_stencil_export
+#define GL_ARB_shader_stencil_export 1
+#endif
+
+#ifndef GL_ARB_base_instance
+#define GL_ARB_base_instance 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawArraysInstancedBaseInstance (GLenum mode, GLint first, GLsizei count, GLsizei primcount, GLuint baseinstance);
+GLAPI void APIENTRY glDrawElementsInstancedBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount, GLuint baseinstance);
+GLAPI void APIENTRY glDrawElementsInstancedBaseVertexBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount, GLint basevertex, GLuint baseinstance);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount, GLuint baseinstance);
+typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount, GLuint baseinstance);
+typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount, GLint basevertex, GLuint baseinstance);
+#endif
+
+#ifndef GL_ARB_shading_language_420pack
+#define GL_ARB_shading_language_420pack 1
+#endif
+
+#ifndef GL_ARB_transform_feedback_instanced
+#define GL_ARB_transform_feedback_instanced 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawTransformFeedbackInstanced (GLenum mode, GLuint id, GLsizei primcount);
+GLAPI void APIENTRY glDrawTransformFeedbackStreamInstanced (GLenum mode, GLuint id, GLuint stream, GLsizei primcount);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC) (GLenum mode, GLuint id, GLsizei primcount);
+typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC) (GLenum mode, GLuint id, GLuint stream, GLsizei primcount);
+#endif
+
+#ifndef GL_ARB_compressed_texture_pixel_storage
+#define GL_ARB_compressed_texture_pixel_storage 1
+#endif
+
+#ifndef GL_ARB_conservative_depth
+#define GL_ARB_conservative_depth 1
+#endif
+
+#ifndef GL_ARB_internalformat_query
+#define GL_ARB_internalformat_query 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetInternalformativ (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params);
+#endif
+
+#ifndef GL_ARB_map_buffer_alignment
+#define GL_ARB_map_buffer_alignment 1
+#endif
+
+#ifndef GL_ARB_shader_atomic_counters
+#define GL_ARB_shader_atomic_counters 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetActiveAtomicCounterBufferiv (GLuint program, GLuint bufferIndex, GLenum pname, GLint *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC) (GLuint program, GLuint bufferIndex, GLenum pname, GLint *params);
+#endif
+
+#ifndef GL_ARB_shader_image_load_store
+#define GL_ARB_shader_image_load_store 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBindImageTexture (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format);
+GLAPI void APIENTRY glMemoryBarrier (GLbitfield barriers);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format);
+typedef void (APIENTRYP PFNGLMEMORYBARRIERPROC) (GLbitfield barriers);
+#endif
+
+#ifndef GL_ARB_shading_language_packing
+#define GL_ARB_shading_language_packing 1
+#endif
+
+#ifndef GL_ARB_texture_storage
+#define GL_ARB_texture_storage 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexStorage1D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+GLAPI void APIENTRY glTexStorage2D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glTexStorage3D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+GLAPI void APIENTRY glTextureStorage1DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+GLAPI void APIENTRY glTextureStorage2DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glTextureStorage3DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXSTORAGE1DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+typedef void (APIENTRYP PFNGLTEXSTORAGE2DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLTEXSTORAGE3DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+typedef void (APIENTRYP PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+#endif
+
+#ifndef GL_EXT_abgr
+#define GL_EXT_abgr 1
+#endif
+
+#ifndef GL_EXT_blend_color
+#define GL_EXT_blend_color 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendColorEXT (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+#endif
+
+#ifndef GL_EXT_polygon_offset
+#define GL_EXT_polygon_offset 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPolygonOffsetEXT (GLfloat factor, GLfloat bias);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias);
+#endif
+
+#ifndef GL_EXT_texture
+#define GL_EXT_texture 1
+#endif
+
+#ifndef GL_EXT_texture3D
+#define GL_EXT_texture3D 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexImage3DEXT (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
+#endif
+
+#ifndef GL_SGIS_texture_filter4
+#define GL_SGIS_texture_filter4 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetTexFilterFuncSGIS (GLenum target, GLenum filter, GLfloat *weights);
+GLAPI void APIENTRY glTexFilterFuncSGIS (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights);
+typedef void (APIENTRYP PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights);
+#endif
+
+#ifndef GL_EXT_subtexture
+#define GL_EXT_subtexture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
+#endif
+
+#ifndef GL_EXT_copy_texture
+#define GL_EXT_copy_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCopyTexImage1DEXT (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
+GLAPI void APIENTRY glCopyTexImage2DEXT (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+GLAPI void APIENTRY glCopyTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
+GLAPI void APIENTRY glCopyTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glCopyTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
+typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+#endif
+
+#ifndef GL_EXT_histogram
+#define GL_EXT_histogram 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetHistogramEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+GLAPI void APIENTRY glGetHistogramParameterfvEXT (GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetHistogramParameterivEXT (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetMinmaxEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+GLAPI void APIENTRY glGetMinmaxParameterfvEXT (GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetMinmaxParameterivEXT (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glHistogramEXT (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
+GLAPI void APIENTRY glMinmaxEXT (GLenum target, GLenum internalformat, GLboolean sink);
+GLAPI void APIENTRY glResetHistogramEXT (GLenum target);
+GLAPI void APIENTRY glResetMinmaxEXT (GLenum target);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
+typedef void (APIENTRYP PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink);
+typedef void (APIENTRYP PFNGLRESETHISTOGRAMEXTPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLRESETMINMAXEXTPROC) (GLenum target);
+#endif
+
+#ifndef GL_EXT_convolution
+#define GL_EXT_convolution 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
+GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
+GLAPI void APIENTRY glConvolutionParameterfEXT (GLenum target, GLenum pname, GLfloat params);
+GLAPI void APIENTRY glConvolutionParameterfvEXT (GLenum target, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glConvolutionParameteriEXT (GLenum target, GLenum pname, GLint params);
+GLAPI void APIENTRY glConvolutionParameterivEXT (GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glCopyConvolutionFilter1DEXT (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+GLAPI void APIENTRY glCopyConvolutionFilter2DEXT (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum target, GLenum format, GLenum type, GLvoid *image);
+GLAPI void APIENTRY glGetConvolutionParameterfvEXT (GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
+GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
+typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
+typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
+#endif
+
+#ifndef GL_SGI_color_matrix
+#define GL_SGI_color_matrix 1
+#endif
+
+#ifndef GL_SGI_color_table
+#define GL_SGI_color_table 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColorTableSGI (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
+GLAPI void APIENTRY glColorTableParameterfvSGI (GLenum target, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glColorTableParameterivSGI (GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glCopyColorTableSGI (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+GLAPI void APIENTRY glGetColorTableSGI (GLenum target, GLenum format, GLenum type, GLvoid *table);
+GLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum target, GLenum pname, GLint *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
+typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params);
+#endif
+
+#ifndef GL_SGIX_pixel_texture
+#define GL_SGIX_pixel_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPixelTexGenSGIX (GLenum mode);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC) (GLenum mode);
+#endif
+
+#ifndef GL_SGIS_pixel_texture
+#define GL_SGIS_pixel_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPixelTexGenParameteriSGIS (GLenum pname, GLint param);
+GLAPI void APIENTRY glPixelTexGenParameterivSGIS (GLenum pname, const GLint *params);
+GLAPI void APIENTRY glPixelTexGenParameterfSGIS (GLenum pname, GLfloat param);
+GLAPI void APIENTRY glPixelTexGenParameterfvSGIS (GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum pname, GLfloat *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat *params);
+#endif
+
+#ifndef GL_SGIS_texture4D
+#define GL_SGIS_texture4D 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexImage4DSGIS (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glTexSubImage4DSGIS (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels);
+#endif
+
+#ifndef GL_SGI_texture_color_table
+#define GL_SGI_texture_color_table 1
+#endif
+
+#ifndef GL_EXT_cmyka
+#define GL_EXT_cmyka 1
+#endif
+
+#ifndef GL_EXT_texture_object
+#define GL_EXT_texture_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLboolean APIENTRY glAreTexturesResidentEXT (GLsizei n, const GLuint *textures, GLboolean *residences);
+GLAPI void APIENTRY glBindTextureEXT (GLenum target, GLuint texture);
+GLAPI void APIENTRY glDeleteTexturesEXT (GLsizei n, const GLuint *textures);
+GLAPI void APIENTRY glGenTexturesEXT (GLsizei n, GLuint *textures);
+GLAPI GLboolean APIENTRY glIsTextureEXT (GLuint texture);
+GLAPI void APIENTRY glPrioritizeTexturesEXT (GLsizei n, const GLuint *textures, const GLclampf *priorities);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences);
+typedef void (APIENTRYP PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture);
+typedef void (APIENTRYP PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures);
+typedef void (APIENTRYP PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures);
+typedef GLboolean (APIENTRYP PFNGLISTEXTUREEXTPROC) (GLuint texture);
+typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities);
+#endif
+
+#ifndef GL_SGIS_detail_texture
+#define GL_SGIS_detail_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDetailTexFuncSGIS (GLenum target, GLsizei n, const GLfloat *points);
+GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum target, GLfloat *points);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points);
+typedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points);
+#endif
+
+#ifndef GL_SGIS_sharpen_texture
+#define GL_SGIS_sharpen_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSharpenTexFuncSGIS (GLenum target, GLsizei n, const GLfloat *points);
+GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum target, GLfloat *points);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points);
+typedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points);
+#endif
+
+#ifndef GL_EXT_packed_pixels
+#define GL_EXT_packed_pixels 1
+#endif
+
+#ifndef GL_SGIS_texture_lod
+#define GL_SGIS_texture_lod 1
+#endif
+
+#ifndef GL_SGIS_multisample
+#define GL_SGIS_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSampleMaskSGIS (GLclampf value, GLboolean invert);
+GLAPI void APIENTRY glSamplePatternSGIS (GLenum pattern);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert);
+typedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern);
+#endif
+
+#ifndef GL_EXT_rescale_normal
+#define GL_EXT_rescale_normal 1
+#endif
+
+#ifndef GL_EXT_vertex_array
+#define GL_EXT_vertex_array 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glArrayElementEXT (GLint i);
+GLAPI void APIENTRY glColorPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+GLAPI void APIENTRY glDrawArraysEXT (GLenum mode, GLint first, GLsizei count);
+GLAPI void APIENTRY glEdgeFlagPointerEXT (GLsizei stride, GLsizei count, const GLboolean *pointer);
+GLAPI void APIENTRY glGetPointervEXT (GLenum pname, GLvoid* *params);
+GLAPI void APIENTRY glIndexPointerEXT (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+GLAPI void APIENTRY glNormalPointerEXT (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+GLAPI void APIENTRY glTexCoordPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+GLAPI void APIENTRY glVertexPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLARRAYELEMENTEXTPROC) (GLint i);
+typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count);
+typedef void (APIENTRYP PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean *pointer);
+typedef void (APIENTRYP PFNGLGETPOINTERVEXTPROC) (GLenum pname, GLvoid* *params);
+typedef void (APIENTRYP PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+#endif
+
+#ifndef GL_EXT_misc_attribute
+#define GL_EXT_misc_attribute 1
+#endif
+
+#ifndef GL_SGIS_generate_mipmap
+#define GL_SGIS_generate_mipmap 1
+#endif
+
+#ifndef GL_SGIX_clipmap
+#define GL_SGIX_clipmap 1
+#endif
+
+#ifndef GL_SGIX_shadow
+#define GL_SGIX_shadow 1
+#endif
+
+#ifndef GL_SGIS_texture_edge_clamp
+#define GL_SGIS_texture_edge_clamp 1
+#endif
+
+#ifndef GL_SGIS_texture_border_clamp
+#define GL_SGIS_texture_border_clamp 1
+#endif
+
+#ifndef GL_EXT_blend_minmax
+#define GL_EXT_blend_minmax 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendEquationEXT (GLenum mode);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC) (GLenum mode);
+#endif
+
+#ifndef GL_EXT_blend_subtract
+#define GL_EXT_blend_subtract 1
+#endif
+
+#ifndef GL_EXT_blend_logic_op
+#define GL_EXT_blend_logic_op 1
+#endif
+
+#ifndef GL_SGIX_interlace
+#define GL_SGIX_interlace 1
+#endif
+
+#ifndef GL_SGIX_pixel_tiles
+#define GL_SGIX_pixel_tiles 1
+#endif
+
+#ifndef GL_SGIX_texture_select
+#define GL_SGIX_texture_select 1
+#endif
+
+#ifndef GL_SGIX_sprite
+#define GL_SGIX_sprite 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSpriteParameterfSGIX (GLenum pname, GLfloat param);
+GLAPI void APIENTRY glSpriteParameterfvSGIX (GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glSpriteParameteriSGIX (GLenum pname, GLint param);
+GLAPI void APIENTRY glSpriteParameterivSGIX (GLenum pname, const GLint *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *params);
+#endif
+
+#ifndef GL_SGIX_texture_multi_buffer
+#define GL_SGIX_texture_multi_buffer 1
+#endif
+
+#ifndef GL_EXT_point_parameters
+#define GL_EXT_point_parameters 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPointParameterfEXT (GLenum pname, GLfloat param);
+GLAPI void APIENTRY glPointParameterfvEXT (GLenum pname, const GLfloat *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params);
+#endif
+
+#ifndef GL_SGIS_point_parameters
+#define GL_SGIS_point_parameters 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPointParameterfSGIS (GLenum pname, GLfloat param);
+GLAPI void APIENTRY glPointParameterfvSGIS (GLenum pname, const GLfloat *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params);
+#endif
+
+#ifndef GL_SGIX_instruments
+#define GL_SGIX_instruments 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLint APIENTRY glGetInstrumentsSGIX (void);
+GLAPI void APIENTRY glInstrumentsBufferSGIX (GLsizei size, GLint *buffer);
+GLAPI GLint APIENTRY glPollInstrumentsSGIX (GLint *marker_p);
+GLAPI void APIENTRY glReadInstrumentsSGIX (GLint marker);
+GLAPI void APIENTRY glStartInstrumentsSGIX (void);
+GLAPI void APIENTRY glStopInstrumentsSGIX (GLint marker);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLint (APIENTRYP PFNGLGETINSTRUMENTSSGIXPROC) (void);
+typedef void (APIENTRYP PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer);
+typedef GLint (APIENTRYP PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *marker_p);
+typedef void (APIENTRYP PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker);
+typedef void (APIENTRYP PFNGLSTARTINSTRUMENTSSGIXPROC) (void);
+typedef void (APIENTRYP PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker);
+#endif
+
+#ifndef GL_SGIX_texture_scale_bias
+#define GL_SGIX_texture_scale_bias 1
+#endif
+
+#ifndef GL_SGIX_framezoom
+#define GL_SGIX_framezoom 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFrameZoomSGIX (GLint factor);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFRAMEZOOMSGIXPROC) (GLint factor);
+#endif
+
+#ifndef GL_SGIX_tag_sample_buffer
+#define GL_SGIX_tag_sample_buffer 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTagSampleBufferSGIX (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTAGSAMPLEBUFFERSGIXPROC) (void);
+#endif
+
+#ifndef GL_SGIX_polynomial_ffd
+#define GL_SGIX_polynomial_ffd 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDeformationMap3dSGIX (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points);
+GLAPI void APIENTRY glDeformationMap3fSGIX (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points);
+GLAPI void APIENTRY glDeformSGIX (GLbitfield mask);
+GLAPI void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield mask);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points);
+typedef void (APIENTRYP PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points);
+typedef void (APIENTRYP PFNGLDEFORMSGIXPROC) (GLbitfield mask);
+typedef void (APIENTRYP PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask);
+#endif
+
+#ifndef GL_SGIX_reference_plane
+#define GL_SGIX_reference_plane 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *equation);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation);
+#endif
+
+#ifndef GL_SGIX_flush_raster
+#define GL_SGIX_flush_raster 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFlushRasterSGIX (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFLUSHRASTERSGIXPROC) (void);
+#endif
+
+#ifndef GL_SGIX_depth_texture
+#define GL_SGIX_depth_texture 1
+#endif
+
+#ifndef GL_SGIS_fog_function
+#define GL_SGIS_fog_function 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFogFuncSGIS (GLsizei n, const GLfloat *points);
+GLAPI void APIENTRY glGetFogFuncSGIS (GLfloat *points);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points);
+typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC) (GLfloat *points);
+#endif
+
+#ifndef GL_SGIX_fog_offset
+#define GL_SGIX_fog_offset 1
+#endif
+
+#ifndef GL_HP_image_transform
+#define GL_HP_image_transform 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glImageTransformParameteriHP (GLenum target, GLenum pname, GLint param);
+GLAPI void APIENTRY glImageTransformParameterfHP (GLenum target, GLenum pname, GLfloat param);
+GLAPI void APIENTRY glImageTransformParameterivHP (GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glImageTransformParameterfvHP (GLenum target, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glGetImageTransformParameterivHP (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum target, GLenum pname, GLfloat *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, GLfloat *params);
+#endif
+
+#ifndef GL_HP_convolution_border_modes
+#define GL_HP_convolution_border_modes 1
+#endif
+
+#ifndef GL_SGIX_texture_add_env
+#define GL_SGIX_texture_add_env 1
+#endif
+
+#ifndef GL_EXT_color_subtable
+#define GL_EXT_color_subtable 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColorSubTableEXT (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
+GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
+#endif
+
+#ifndef GL_PGI_vertex_hints
+#define GL_PGI_vertex_hints 1
+#endif
+
+#ifndef GL_PGI_misc_hints
+#define GL_PGI_misc_hints 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glHintPGI (GLenum target, GLint mode);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLHINTPGIPROC) (GLenum target, GLint mode);
+#endif
+
+#ifndef GL_EXT_paletted_texture
+#define GL_EXT_paletted_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColorTableEXT (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
+GLAPI void APIENTRY glGetColorTableEXT (GLenum target, GLenum format, GLenum type, GLvoid *data);
+GLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum target, GLenum pname, GLfloat *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
+#endif
+
+#ifndef GL_EXT_clip_volume_hint
+#define GL_EXT_clip_volume_hint 1
+#endif
+
+#ifndef GL_SGIX_list_priority
+#define GL_SGIX_list_priority 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetListParameterfvSGIX (GLuint list, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetListParameterivSGIX (GLuint list, GLenum pname, GLint *params);
+GLAPI void APIENTRY glListParameterfSGIX (GLuint list, GLenum pname, GLfloat param);
+GLAPI void APIENTRY glListParameterfvSGIX (GLuint list, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glListParameteriSGIX (GLuint list, GLenum pname, GLint param);
+GLAPI void APIENTRY glListParameterivSGIX (GLuint list, GLenum pname, const GLint *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint *params);
+#endif
+
+#ifndef GL_SGIX_ir_instrument1
+#define GL_SGIX_ir_instrument1 1
+#endif
+
+#ifndef GL_SGIX_calligraphic_fragment
+#define GL_SGIX_calligraphic_fragment 1
+#endif
+
+#ifndef GL_SGIX_texture_lod_bias
+#define GL_SGIX_texture_lod_bias 1
+#endif
+
+#ifndef GL_SGIX_shadow_ambient
+#define GL_SGIX_shadow_ambient 1
+#endif
+
+#ifndef GL_EXT_index_texture
+#define GL_EXT_index_texture 1
+#endif
+
+#ifndef GL_EXT_index_material
+#define GL_EXT_index_material 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glIndexMaterialEXT (GLenum face, GLenum mode);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode);
+#endif
+
+#ifndef GL_EXT_index_func
+#define GL_EXT_index_func 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glIndexFuncEXT (GLenum func, GLclampf ref);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref);
+#endif
+
+#ifndef GL_EXT_index_array_formats
+#define GL_EXT_index_array_formats 1
+#endif
+
+#ifndef GL_EXT_compiled_vertex_array
+#define GL_EXT_compiled_vertex_array 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glLockArraysEXT (GLint first, GLsizei count);
+GLAPI void APIENTRY glUnlockArraysEXT (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count);
+typedef void (APIENTRYP PFNGLUNLOCKARRAYSEXTPROC) (void);
+#endif
+
+#ifndef GL_EXT_cull_vertex
+#define GL_EXT_cull_vertex 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCullParameterdvEXT (GLenum pname, GLdouble *params);
+GLAPI void APIENTRY glCullParameterfvEXT (GLenum pname, GLfloat *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params);
+#endif
+
+#ifndef GL_SGIX_ycrcb
+#define GL_SGIX_ycrcb 1
+#endif
+
+#ifndef GL_SGIX_fragment_lighting
+#define GL_SGIX_fragment_lighting 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFragmentColorMaterialSGIX (GLenum face, GLenum mode);
+GLAPI void APIENTRY glFragmentLightfSGIX (GLenum light, GLenum pname, GLfloat param);
+GLAPI void APIENTRY glFragmentLightfvSGIX (GLenum light, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glFragmentLightiSGIX (GLenum light, GLenum pname, GLint param);
+GLAPI void APIENTRY glFragmentLightivSGIX (GLenum light, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glFragmentLightModelfSGIX (GLenum pname, GLfloat param);
+GLAPI void APIENTRY glFragmentLightModelfvSGIX (GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glFragmentLightModeliSGIX (GLenum pname, GLint param);
+GLAPI void APIENTRY glFragmentLightModelivSGIX (GLenum pname, const GLint *params);
+GLAPI void APIENTRY glFragmentMaterialfSGIX (GLenum face, GLenum pname, GLfloat param);
+GLAPI void APIENTRY glFragmentMaterialfvSGIX (GLenum face, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glFragmentMaterialiSGIX (GLenum face, GLenum pname, GLint param);
+GLAPI void APIENTRY glFragmentMaterialivSGIX (GLenum face, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glGetFragmentLightfvSGIX (GLenum light, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetFragmentLightivSGIX (GLenum light, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetFragmentMaterialfvSGIX (GLenum face, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetFragmentMaterialivSGIX (GLenum face, GLenum pname, GLint *params);
+GLAPI void APIENTRY glLightEnviSGIX (GLenum pname, GLint param);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param);
+#endif
+
+#ifndef GL_IBM_rasterpos_clip
+#define GL_IBM_rasterpos_clip 1
+#endif
+
+#ifndef GL_HP_texture_lighting
+#define GL_HP_texture_lighting 1
+#endif
+
+#ifndef GL_EXT_draw_range_elements
+#define GL_EXT_draw_range_elements 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
+#endif
+
+#ifndef GL_WIN_phong_shading
+#define GL_WIN_phong_shading 1
+#endif
+
+#ifndef GL_WIN_specular_fog
+#define GL_WIN_specular_fog 1
+#endif
+
+#ifndef GL_EXT_light_texture
+#define GL_EXT_light_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glApplyTextureEXT (GLenum mode);
+GLAPI void APIENTRY glTextureLightEXT (GLenum pname);
+GLAPI void APIENTRY glTextureMaterialEXT (GLenum face, GLenum mode);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode);
+typedef void (APIENTRYP PFNGLTEXTURELIGHTEXTPROC) (GLenum pname);
+typedef void (APIENTRYP PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode);
+#endif
+
+#ifndef GL_SGIX_blend_alpha_minmax
+#define GL_SGIX_blend_alpha_minmax 1
+#endif
+
+#ifndef GL_EXT_bgra
+#define GL_EXT_bgra 1
+#endif
+
+#ifndef GL_SGIX_async
+#define GL_SGIX_async 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glAsyncMarkerSGIX (GLuint marker);
+GLAPI GLint APIENTRY glFinishAsyncSGIX (GLuint *markerp);
+GLAPI GLint APIENTRY glPollAsyncSGIX (GLuint *markerp);
+GLAPI GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei range);
+GLAPI void APIENTRY glDeleteAsyncMarkersSGIX (GLuint marker, GLsizei range);
+GLAPI GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint marker);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLASYNCMARKERSGIXPROC) (GLuint marker);
+typedef GLint (APIENTRYP PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp);
+typedef GLint (APIENTRYP PFNGLPOLLASYNCSGIXPROC) (GLuint *markerp);
+typedef GLuint (APIENTRYP PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range);
+typedef void (APIENTRYP PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range);
+typedef GLboolean (APIENTRYP PFNGLISASYNCMARKERSGIXPROC) (GLuint marker);
+#endif
+
+#ifndef GL_SGIX_async_pixel
+#define GL_SGIX_async_pixel 1
+#endif
+
+#ifndef GL_SGIX_async_histogram
+#define GL_SGIX_async_histogram 1
+#endif
+
+#ifndef GL_INTEL_parallel_arrays
+#define GL_INTEL_parallel_arrays 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexPointervINTEL (GLint size, GLenum type, const GLvoid* *pointer);
+GLAPI void APIENTRY glNormalPointervINTEL (GLenum type, const GLvoid* *pointer);
+GLAPI void APIENTRY glColorPointervINTEL (GLint size, GLenum type, const GLvoid* *pointer);
+GLAPI void APIENTRY glTexCoordPointervINTEL (GLint size, GLenum type, const GLvoid* *pointer);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);
+typedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const GLvoid* *pointer);
+typedef void (APIENTRYP PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);
+typedef void (APIENTRYP PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);
+#endif
+
+#ifndef GL_HP_occlusion_test
+#define GL_HP_occlusion_test 1
+#endif
+
+#ifndef GL_EXT_pixel_transform
+#define GL_EXT_pixel_transform 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPixelTransformParameteriEXT (GLenum target, GLenum pname, GLint param);
+GLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum target, GLenum pname, GLfloat param);
+GLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum target, GLenum pname, const GLfloat *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params);
+#endif
+
+#ifndef GL_EXT_pixel_transform_color_table
+#define GL_EXT_pixel_transform_color_table 1
+#endif
+
+#ifndef GL_EXT_shared_texture_palette
+#define GL_EXT_shared_texture_palette 1
+#endif
+
+#ifndef GL_EXT_separate_specular_color
+#define GL_EXT_separate_specular_color 1
+#endif
+
+#ifndef GL_EXT_secondary_color
+#define GL_EXT_secondary_color 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte red, GLbyte green, GLbyte blue);
+GLAPI void APIENTRY glSecondaryColor3bvEXT (const GLbyte *v);
+GLAPI void APIENTRY glSecondaryColor3dEXT (GLdouble red, GLdouble green, GLdouble blue);
+GLAPI void APIENTRY glSecondaryColor3dvEXT (const GLdouble *v);
+GLAPI void APIENTRY glSecondaryColor3fEXT (GLfloat red, GLfloat green, GLfloat blue);
+GLAPI void APIENTRY glSecondaryColor3fvEXT (const GLfloat *v);
+GLAPI void APIENTRY glSecondaryColor3iEXT (GLint red, GLint green, GLint blue);
+GLAPI void APIENTRY glSecondaryColor3ivEXT (const GLint *v);
+GLAPI void APIENTRY glSecondaryColor3sEXT (GLshort red, GLshort green, GLshort blue);
+GLAPI void APIENTRY glSecondaryColor3svEXT (const GLshort *v);
+GLAPI void APIENTRY glSecondaryColor3ubEXT (GLubyte red, GLubyte green, GLubyte blue);
+GLAPI void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *v);
+GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint red, GLuint green, GLuint blue);
+GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *v);
+GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort red, GLushort green, GLushort blue);
+GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *v);
+GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_EXT_texture_perturb_normal
+#define GL_EXT_texture_perturb_normal 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTextureNormalEXT (GLenum mode);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC) (GLenum mode);
+#endif
+
+#ifndef GL_EXT_multi_draw_arrays
+#define GL_EXT_multi_draw_arrays 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
+GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
+typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
+#endif
+
+#ifndef GL_EXT_fog_coord
+#define GL_EXT_fog_coord 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFogCoordfEXT (GLfloat coord);
+GLAPI void APIENTRY glFogCoordfvEXT (const GLfloat *coord);
+GLAPI void APIENTRY glFogCoorddEXT (GLdouble coord);
+GLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *coord);
+GLAPI void APIENTRY glFogCoordPointerEXT (GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC) (GLfloat coord);
+typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord);
+typedef void (APIENTRYP PFNGLFOGCOORDDEXTPROC) (GLdouble coord);
+typedef void (APIENTRYP PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord);
+typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_REND_screen_coordinates
+#define GL_REND_screen_coordinates 1
+#endif
+
+#ifndef GL_EXT_coordinate_frame
+#define GL_EXT_coordinate_frame 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTangent3bEXT (GLbyte tx, GLbyte ty, GLbyte tz);
+GLAPI void APIENTRY glTangent3bvEXT (const GLbyte *v);
+GLAPI void APIENTRY glTangent3dEXT (GLdouble tx, GLdouble ty, GLdouble tz);
+GLAPI void APIENTRY glTangent3dvEXT (const GLdouble *v);
+GLAPI void APIENTRY glTangent3fEXT (GLfloat tx, GLfloat ty, GLfloat tz);
+GLAPI void APIENTRY glTangent3fvEXT (const GLfloat *v);
+GLAPI void APIENTRY glTangent3iEXT (GLint tx, GLint ty, GLint tz);
+GLAPI void APIENTRY glTangent3ivEXT (const GLint *v);
+GLAPI void APIENTRY glTangent3sEXT (GLshort tx, GLshort ty, GLshort tz);
+GLAPI void APIENTRY glTangent3svEXT (const GLshort *v);
+GLAPI void APIENTRY glBinormal3bEXT (GLbyte bx, GLbyte by, GLbyte bz);
+GLAPI void APIENTRY glBinormal3bvEXT (const GLbyte *v);
+GLAPI void APIENTRY glBinormal3dEXT (GLdouble bx, GLdouble by, GLdouble bz);
+GLAPI void APIENTRY glBinormal3dvEXT (const GLdouble *v);
+GLAPI void APIENTRY glBinormal3fEXT (GLfloat bx, GLfloat by, GLfloat bz);
+GLAPI void APIENTRY glBinormal3fvEXT (const GLfloat *v);
+GLAPI void APIENTRY glBinormal3iEXT (GLint bx, GLint by, GLint bz);
+GLAPI void APIENTRY glBinormal3ivEXT (const GLint *v);
+GLAPI void APIENTRY glBinormal3sEXT (GLshort bx, GLshort by, GLshort bz);
+GLAPI void APIENTRY glBinormal3svEXT (const GLshort *v);
+GLAPI void APIENTRY glTangentPointerEXT (GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY glBinormalPointerEXT (GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz);
+typedef void (APIENTRYP PFNGLTANGENT3BVEXTPROC) (const GLbyte *v);
+typedef void (APIENTRYP PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz);
+typedef void (APIENTRYP PFNGLTANGENT3DVEXTPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz);
+typedef void (APIENTRYP PFNGLTANGENT3FVEXTPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz);
+typedef void (APIENTRYP PFNGLTANGENT3IVEXTPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz);
+typedef void (APIENTRYP PFNGLTANGENT3SVEXTPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz);
+typedef void (APIENTRYP PFNGLBINORMAL3BVEXTPROC) (const GLbyte *v);
+typedef void (APIENTRYP PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz);
+typedef void (APIENTRYP PFNGLBINORMAL3DVEXTPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz);
+typedef void (APIENTRYP PFNGLBINORMAL3FVEXTPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz);
+typedef void (APIENTRYP PFNGLBINORMAL3IVEXTPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz);
+typedef void (APIENTRYP PFNGLBINORMAL3SVEXTPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_EXT_texture_env_combine
+#define GL_EXT_texture_env_combine 1
+#endif
+
+#ifndef GL_APPLE_specular_vector
+#define GL_APPLE_specular_vector 1
+#endif
+
+#ifndef GL_APPLE_transform_hint
+#define GL_APPLE_transform_hint 1
+#endif
+
+#ifndef GL_SGIX_fog_scale
+#define GL_SGIX_fog_scale 1
+#endif
+
+#ifndef GL_SUNX_constant_data
+#define GL_SUNX_constant_data 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFinishTextureSUNX (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFINISHTEXTURESUNXPROC) (void);
+#endif
+
+#ifndef GL_SUN_global_alpha
+#define GL_SUN_global_alpha 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGlobalAlphaFactorbSUN (GLbyte factor);
+GLAPI void APIENTRY glGlobalAlphaFactorsSUN (GLshort factor);
+GLAPI void APIENTRY glGlobalAlphaFactoriSUN (GLint factor);
+GLAPI void APIENTRY glGlobalAlphaFactorfSUN (GLfloat factor);
+GLAPI void APIENTRY glGlobalAlphaFactordSUN (GLdouble factor);
+GLAPI void APIENTRY glGlobalAlphaFactorubSUN (GLubyte factor);
+GLAPI void APIENTRY glGlobalAlphaFactorusSUN (GLushort factor);
+GLAPI void APIENTRY glGlobalAlphaFactoruiSUN (GLuint factor);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor);
+#endif
+
+#ifndef GL_SUN_triangle_list
+#define GL_SUN_triangle_list 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glReplacementCodeuiSUN (GLuint code);
+GLAPI void APIENTRY glReplacementCodeusSUN (GLushort code);
+GLAPI void APIENTRY glReplacementCodeubSUN (GLubyte code);
+GLAPI void APIENTRY glReplacementCodeuivSUN (const GLuint *code);
+GLAPI void APIENTRY glReplacementCodeusvSUN (const GLushort *code);
+GLAPI void APIENTRY glReplacementCodeubvSUN (const GLubyte *code);
+GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum type, GLsizei stride, const GLvoid* *pointer);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint *code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort *code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte *code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const GLvoid* *pointer);
+#endif
+
+#ifndef GL_SUN_vertex
+#define GL_SUN_vertex 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColor4ubVertex2fSUN (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y);
+GLAPI void APIENTRY glColor4ubVertex2fvSUN (const GLubyte *c, const GLfloat *v);
+GLAPI void APIENTRY glColor4ubVertex3fSUN (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glColor4ubVertex3fvSUN (const GLubyte *c, const GLfloat *v);
+GLAPI void APIENTRY glColor3fVertex3fSUN (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glColor3fVertex3fvSUN (const GLfloat *c, const GLfloat *v);
+GLAPI void APIENTRY glNormal3fVertex3fSUN (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glNormal3fVertex3fvSUN (const GLfloat *n, const GLfloat *v);
+GLAPI void APIENTRY glColor4fNormal3fVertex3fSUN (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glColor4fNormal3fVertex3fvSUN (const GLfloat *c, const GLfloat *n, const GLfloat *v);
+GLAPI void APIENTRY glTexCoord2fVertex3fSUN (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glTexCoord2fVertex3fvSUN (const GLfloat *tc, const GLfloat *v);
+GLAPI void APIENTRY glTexCoord4fVertex4fSUN (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY glTexCoord4fVertex4fvSUN (const GLfloat *tc, const GLfloat *v);
+GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fSUN (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fvSUN (const GLfloat *tc, const GLubyte *c, const GLfloat *v);
+GLAPI void APIENTRY glTexCoord2fColor3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glTexCoord2fColor3fVertex3fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *v);
+GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fvSUN (const GLfloat *tc, const GLfloat *n, const GLfloat *v);
+GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+GLAPI void APIENTRY glReplacementCodeuiVertex3fSUN (GLuint rc, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLuint *rc, const GLfloat *v);
+GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLuint *rc, const GLubyte *c, const GLfloat *v);
+GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLuint *rc, const GLfloat *c, const GLfloat *v);
+GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *n, const GLfloat *v);
+GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *v);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat *tc, const GLubyte *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint *rc, const GLubyte *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+#endif
+
+#ifndef GL_EXT_blend_func_separate
+#define GL_EXT_blend_func_separate 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+#endif
+
+#ifndef GL_INGR_blend_func_separate
+#define GL_INGR_blend_func_separate 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+#endif
+
+#ifndef GL_INGR_color_clamp
+#define GL_INGR_color_clamp 1
+#endif
+
+#ifndef GL_INGR_interlace_read
+#define GL_INGR_interlace_read 1
+#endif
+
+#ifndef GL_EXT_stencil_wrap
+#define GL_EXT_stencil_wrap 1
+#endif
+
+#ifndef GL_EXT_422_pixels
+#define GL_EXT_422_pixels 1
+#endif
+
+#ifndef GL_NV_texgen_reflection
+#define GL_NV_texgen_reflection 1
+#endif
+
+#ifndef GL_SUN_convolution_border_modes
+#define GL_SUN_convolution_border_modes 1
+#endif
+
+#ifndef GL_EXT_texture_env_add
+#define GL_EXT_texture_env_add 1
+#endif
+
+#ifndef GL_EXT_texture_lod_bias
+#define GL_EXT_texture_lod_bias 1
+#endif
+
+#ifndef GL_EXT_texture_filter_anisotropic
+#define GL_EXT_texture_filter_anisotropic 1
+#endif
+
+#ifndef GL_EXT_vertex_weighting
+#define GL_EXT_vertex_weighting 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexWeightfEXT (GLfloat weight);
+GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *weight);
+GLAPI void APIENTRY glVertexWeightPointerEXT (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight);
+typedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight);
+typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_NV_light_max_exponent
+#define GL_NV_light_max_exponent 1
+#endif
+
+#ifndef GL_NV_vertex_array_range
+#define GL_NV_vertex_array_range 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFlushVertexArrayRangeNV (void);
+GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei length, const GLvoid *pointer);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void);
+typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const GLvoid *pointer);
+#endif
+
+#ifndef GL_NV_register_combiners
+#define GL_NV_register_combiners 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCombinerParameterfvNV (GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glCombinerParameterfNV (GLenum pname, GLfloat param);
+GLAPI void APIENTRY glCombinerParameterivNV (GLenum pname, const GLint *params);
+GLAPI void APIENTRY glCombinerParameteriNV (GLenum pname, GLint param);
+GLAPI void APIENTRY glCombinerInputNV (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
+GLAPI void APIENTRY glCombinerOutputNV (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum);
+GLAPI void APIENTRY glFinalCombinerInputNV (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
+GLAPI void APIENTRY glGetCombinerInputParameterfvNV (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetCombinerInputParameterivNV (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetCombinerOutputParameterfvNV (GLenum stage, GLenum portion, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetCombinerOutputParameterivNV (GLenum stage, GLenum portion, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum variable, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum variable, GLenum pname, GLint *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
+typedef void (APIENTRYP PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum);
+typedef void (APIENTRYP PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
+typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint *params);
+#endif
+
+#ifndef GL_NV_fog_distance
+#define GL_NV_fog_distance 1
+#endif
+
+#ifndef GL_NV_texgen_emboss
+#define GL_NV_texgen_emboss 1
+#endif
+
+#ifndef GL_NV_blend_square
+#define GL_NV_blend_square 1
+#endif
+
+#ifndef GL_NV_texture_env_combine4
+#define GL_NV_texture_env_combine4 1
+#endif
+
+#ifndef GL_MESA_resize_buffers
+#define GL_MESA_resize_buffers 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glResizeBuffersMESA (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLRESIZEBUFFERSMESAPROC) (void);
+#endif
+
+#ifndef GL_MESA_window_pos
+#define GL_MESA_window_pos 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glWindowPos2dMESA (GLdouble x, GLdouble y);
+GLAPI void APIENTRY glWindowPos2dvMESA (const GLdouble *v);
+GLAPI void APIENTRY glWindowPos2fMESA (GLfloat x, GLfloat y);
+GLAPI void APIENTRY glWindowPos2fvMESA (const GLfloat *v);
+GLAPI void APIENTRY glWindowPos2iMESA (GLint x, GLint y);
+GLAPI void APIENTRY glWindowPos2ivMESA (const GLint *v);
+GLAPI void APIENTRY glWindowPos2sMESA (GLshort x, GLshort y);
+GLAPI void APIENTRY glWindowPos2svMESA (const GLshort *v);
+GLAPI void APIENTRY glWindowPos3dMESA (GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glWindowPos3dvMESA (const GLdouble *v);
+GLAPI void APIENTRY glWindowPos3fMESA (GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glWindowPos3fvMESA (const GLfloat *v);
+GLAPI void APIENTRY glWindowPos3iMESA (GLint x, GLint y, GLint z);
+GLAPI void APIENTRY glWindowPos3ivMESA (const GLint *v);
+GLAPI void APIENTRY glWindowPos3sMESA (GLshort x, GLshort y, GLshort z);
+GLAPI void APIENTRY glWindowPos3svMESA (const GLshort *v);
+GLAPI void APIENTRY glWindowPos4dMESA (GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glWindowPos4dvMESA (const GLdouble *v);
+GLAPI void APIENTRY glWindowPos4fMESA (GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY glWindowPos4fvMESA (const GLfloat *v);
+GLAPI void APIENTRY glWindowPos4iMESA (GLint x, GLint y, GLint z, GLint w);
+GLAPI void APIENTRY glWindowPos4ivMESA (const GLint *v);
+GLAPI void APIENTRY glWindowPos4sMESA (GLshort x, GLshort y, GLshort z, GLshort w);
+GLAPI void APIENTRY glWindowPos4svMESA (const GLshort *v);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IVMESAPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SVMESAPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IVMESAPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SVMESAPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w);
+typedef void (APIENTRYP PFNGLWINDOWPOS4IVMESAPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (APIENTRYP PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v);
+#endif
+
+#ifndef GL_IBM_cull_vertex
+#define GL_IBM_cull_vertex 1
+#endif
+
+#ifndef GL_IBM_multimode_draw_arrays
+#define GL_IBM_multimode_draw_arrays 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glMultiModeDrawArraysIBM (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride);
+GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, GLint modestride);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride);
+typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, GLint modestride);
+#endif
+
+#ifndef GL_IBM_vertex_array_lists
+#define GL_IBM_vertex_array_lists 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColorPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+GLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+GLAPI void APIENTRY glEdgeFlagPointerListIBM (GLint stride, const GLboolean* *pointer, GLint ptrstride);
+GLAPI void APIENTRY glFogCoordPointerListIBM (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+GLAPI void APIENTRY glIndexPointerListIBM (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+GLAPI void APIENTRY glNormalPointerListIBM (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+GLAPI void APIENTRY glTexCoordPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+GLAPI void APIENTRY glVertexPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+#endif
+
+#ifndef GL_SGIX_subsample
+#define GL_SGIX_subsample 1
+#endif
+
+#ifndef GL_SGIX_ycrcba
+#define GL_SGIX_ycrcba 1
+#endif
+
+#ifndef GL_SGIX_ycrcb_subsample
+#define GL_SGIX_ycrcb_subsample 1
+#endif
+
+#ifndef GL_SGIX_depth_pass_instrument
+#define GL_SGIX_depth_pass_instrument 1
+#endif
+
+#ifndef GL_3DFX_texture_compression_FXT1
+#define GL_3DFX_texture_compression_FXT1 1
+#endif
+
+#ifndef GL_3DFX_multisample
+#define GL_3DFX_multisample 1
+#endif
+
+#ifndef GL_3DFX_tbuffer
+#define GL_3DFX_tbuffer 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTbufferMask3DFX (GLuint mask);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC) (GLuint mask);
+#endif
+
+#ifndef GL_EXT_multisample
+#define GL_EXT_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSampleMaskEXT (GLclampf value, GLboolean invert);
+GLAPI void APIENTRY glSamplePatternEXT (GLenum pattern);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert);
+typedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern);
+#endif
+
+#ifndef GL_SGIX_vertex_preclip
+#define GL_SGIX_vertex_preclip 1
+#endif
+
+#ifndef GL_SGIX_convolution_accuracy
+#define GL_SGIX_convolution_accuracy 1
+#endif
+
+#ifndef GL_SGIX_resample
+#define GL_SGIX_resample 1
+#endif
+
+#ifndef GL_SGIS_point_line_texgen
+#define GL_SGIS_point_line_texgen 1
+#endif
+
+#ifndef GL_SGIS_texture_color_mask
+#define GL_SGIS_texture_color_mask 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTextureColorMaskSGIS (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+#endif
+
+#ifndef GL_SGIX_igloo_interface
+#define GL_SGIX_igloo_interface 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum pname, const GLvoid *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid *params);
+#endif
+
+#ifndef GL_EXT_texture_env_dot3
+#define GL_EXT_texture_env_dot3 1
+#endif
+
+#ifndef GL_ATI_texture_mirror_once
+#define GL_ATI_texture_mirror_once 1
+#endif
+
+#ifndef GL_NV_fence
+#define GL_NV_fence 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDeleteFencesNV (GLsizei n, const GLuint *fences);
+GLAPI void APIENTRY glGenFencesNV (GLsizei n, GLuint *fences);
+GLAPI GLboolean APIENTRY glIsFenceNV (GLuint fence);
+GLAPI GLboolean APIENTRY glTestFenceNV (GLuint fence);
+GLAPI void APIENTRY glGetFenceivNV (GLuint fence, GLenum pname, GLint *params);
+GLAPI void APIENTRY glFinishFenceNV (GLuint fence);
+GLAPI void APIENTRY glSetFenceNV (GLuint fence, GLenum condition);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences);
+typedef void (APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences);
+typedef GLboolean (APIENTRYP PFNGLISFENCENVPROC) (GLuint fence);
+typedef GLboolean (APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence);
+typedef void (APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence);
+typedef void (APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition);
+#endif
+
+#ifndef GL_NV_evaluators
+#define GL_NV_evaluators 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glMapControlPointsNV (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points);
+GLAPI void APIENTRY glMapParameterivNV (GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glMapParameterfvNV (GLenum target, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glGetMapControlPointsNV (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points);
+GLAPI void APIENTRY glGetMapParameterivNV (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetMapParameterfvNV (GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetMapAttribParameterivNV (GLenum target, GLuint index, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetMapAttribParameterfvNV (GLenum target, GLuint index, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glEvalMapsNV (GLenum target, GLenum mode);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points);
+typedef void (APIENTRYP PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points);
+typedef void (APIENTRYP PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode);
+#endif
+
+#ifndef GL_NV_packed_depth_stencil
+#define GL_NV_packed_depth_stencil 1
+#endif
+
+#ifndef GL_NV_register_combiners2
+#define GL_NV_register_combiners2 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCombinerStageParameterfvNV (GLenum stage, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum stage, GLenum pname, GLfloat *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat *params);
+#endif
+
+#ifndef GL_NV_texture_compression_vtc
+#define GL_NV_texture_compression_vtc 1
+#endif
+
+#ifndef GL_NV_texture_rectangle
+#define GL_NV_texture_rectangle 1
+#endif
+
+#ifndef GL_NV_texture_shader
+#define GL_NV_texture_shader 1
+#endif
+
+#ifndef GL_NV_texture_shader2
+#define GL_NV_texture_shader2 1
+#endif
+
+#ifndef GL_NV_vertex_array_range2
+#define GL_NV_vertex_array_range2 1
+#endif
+
+#ifndef GL_NV_vertex_program
+#define GL_NV_vertex_program 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei n, const GLuint *programs, GLboolean *residences);
+GLAPI void APIENTRY glBindProgramNV (GLenum target, GLuint id);
+GLAPI void APIENTRY glDeleteProgramsNV (GLsizei n, const GLuint *programs);
+GLAPI void APIENTRY glExecuteProgramNV (GLenum target, GLuint id, const GLfloat *params);
+GLAPI void APIENTRY glGenProgramsNV (GLsizei n, GLuint *programs);
+GLAPI void APIENTRY glGetProgramParameterdvNV (GLenum target, GLuint index, GLenum pname, GLdouble *params);
+GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum target, GLuint index, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetProgramivNV (GLuint id, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetProgramStringNV (GLuint id, GLenum pname, GLubyte *program);
+GLAPI void APIENTRY glGetTrackMatrixivNV (GLenum target, GLuint address, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetVertexAttribdvNV (GLuint index, GLenum pname, GLdouble *params);
+GLAPI void APIENTRY glGetVertexAttribfvNV (GLuint index, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetVertexAttribivNV (GLuint index, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint index, GLenum pname, GLvoid* *pointer);
+GLAPI GLboolean APIENTRY glIsProgramNV (GLuint id);
+GLAPI void APIENTRY glLoadProgramNV (GLenum target, GLuint id, GLsizei len, const GLubyte *program);
+GLAPI void APIENTRY glProgramParameter4dNV (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glProgramParameter4dvNV (GLenum target, GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glProgramParameter4fNV (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY glProgramParameter4fvNV (GLenum target, GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glProgramParameters4dvNV (GLenum target, GLuint index, GLsizei count, const GLdouble *v);
+GLAPI void APIENTRY glProgramParameters4fvNV (GLenum target, GLuint index, GLsizei count, const GLfloat *v);
+GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei n, const GLuint *programs);
+GLAPI void APIENTRY glTrackMatrixNV (GLenum target, GLuint address, GLenum matrix, GLenum transform);
+GLAPI void APIENTRY glVertexAttribPointerNV (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY glVertexAttrib1dNV (GLuint index, GLdouble x);
+GLAPI void APIENTRY glVertexAttrib1dvNV (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib1fNV (GLuint index, GLfloat x);
+GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib1sNV (GLuint index, GLshort x);
+GLAPI void APIENTRY glVertexAttrib1svNV (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib2dNV (GLuint index, GLdouble x, GLdouble y);
+GLAPI void APIENTRY glVertexAttrib2dvNV (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib2fNV (GLuint index, GLfloat x, GLfloat y);
+GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib2sNV (GLuint index, GLshort x, GLshort y);
+GLAPI void APIENTRY glVertexAttrib2svNV (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib3dNV (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glVertexAttrib3dvNV (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib3fNV (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib3sNV (GLuint index, GLshort x, GLshort y, GLshort z);
+GLAPI void APIENTRY glVertexAttrib3svNV (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib4dNV (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glVertexAttrib4dvNV (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib4fNV (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib4sNV (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+GLAPI void APIENTRY glVertexAttrib4svNV (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+GLAPI void APIENTRY glVertexAttrib4ubvNV (GLuint index, const GLubyte *v);
+GLAPI void APIENTRY glVertexAttribs1dvNV (GLuint index, GLsizei count, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint index, GLsizei count, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttribs1svNV (GLuint index, GLsizei count, const GLshort *v);
+GLAPI void APIENTRY glVertexAttribs2dvNV (GLuint index, GLsizei count, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint index, GLsizei count, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttribs2svNV (GLuint index, GLsizei count, const GLshort *v);
+GLAPI void APIENTRY glVertexAttribs3dvNV (GLuint index, GLsizei count, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint index, GLsizei count, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttribs3svNV (GLuint index, GLsizei count, const GLshort *v);
+GLAPI void APIENTRY glVertexAttribs4dvNV (GLuint index, GLsizei count, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint index, GLsizei count, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttribs4svNV (GLuint index, GLsizei count, const GLshort *v);
+GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint index, GLsizei count, const GLubyte *v);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences);
+typedef void (APIENTRYP PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id);
+typedef void (APIENTRYP PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *programs);
+typedef void (APIENTRYP PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs);
+typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte *program);
+typedef void (APIENTRYP PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid* *pointer);
+typedef GLboolean (APIENTRYP PFNGLISPROGRAMNVPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLdouble *v);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs);
+typedef void (APIENTRYP PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte *v);
+#endif
+
+#ifndef GL_SGIX_texture_coordinate_clamp
+#define GL_SGIX_texture_coordinate_clamp 1
+#endif
+
+#ifndef GL_SGIX_scalebias_hint
+#define GL_SGIX_scalebias_hint 1
+#endif
+
+#ifndef GL_OML_interlace
+#define GL_OML_interlace 1
+#endif
+
+#ifndef GL_OML_subsample
+#define GL_OML_subsample 1
+#endif
+
+#ifndef GL_OML_resample
+#define GL_OML_resample 1
+#endif
+
+#ifndef GL_NV_copy_depth_to_color
+#define GL_NV_copy_depth_to_color 1
+#endif
+
+#ifndef GL_ATI_envmap_bumpmap
+#define GL_ATI_envmap_bumpmap 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexBumpParameterivATI (GLenum pname, const GLint *param);
+GLAPI void APIENTRY glTexBumpParameterfvATI (GLenum pname, const GLfloat *param);
+GLAPI void APIENTRY glGetTexBumpParameterivATI (GLenum pname, GLint *param);
+GLAPI void APIENTRY glGetTexBumpParameterfvATI (GLenum pname, GLfloat *param);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, const GLint *param);
+typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, const GLfloat *param);
+typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param);
+typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param);
+#endif
+
+#ifndef GL_ATI_fragment_shader
+#define GL_ATI_fragment_shader 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLuint APIENTRY glGenFragmentShadersATI (GLuint range);
+GLAPI void APIENTRY glBindFragmentShaderATI (GLuint id);
+GLAPI void APIENTRY glDeleteFragmentShaderATI (GLuint id);
+GLAPI void APIENTRY glBeginFragmentShaderATI (void);
+GLAPI void APIENTRY glEndFragmentShaderATI (void);
+GLAPI void APIENTRY glPassTexCoordATI (GLuint dst, GLuint coord, GLenum swizzle);
+GLAPI void APIENTRY glSampleMapATI (GLuint dst, GLuint interp, GLenum swizzle);
+GLAPI void APIENTRY glColorFragmentOp1ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
+GLAPI void APIENTRY glColorFragmentOp2ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
+GLAPI void APIENTRY glColorFragmentOp3ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
+GLAPI void APIENTRY glAlphaFragmentOp1ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
+GLAPI void APIENTRY glAlphaFragmentOp2ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
+GLAPI void APIENTRY glAlphaFragmentOp3ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
+GLAPI void APIENTRY glSetFragmentShaderConstantATI (GLuint dst, const GLfloat *value);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range);
+typedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLBEGINFRAGMENTSHADERATIPROC) (void);
+typedef void (APIENTRYP PFNGLENDFRAGMENTSHADERATIPROC) (void);
+typedef void (APIENTRYP PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle);
+typedef void (APIENTRYP PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle);
+typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
+typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
+typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
+typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
+typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
+typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
+typedef void (APIENTRYP PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat *value);
+#endif
+
+#ifndef GL_ATI_pn_triangles
+#define GL_ATI_pn_triangles 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPNTrianglesiATI (GLenum pname, GLint param);
+GLAPI void APIENTRY glPNTrianglesfATI (GLenum pname, GLfloat param);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param);
+#endif
+
+#ifndef GL_ATI_vertex_array_object
+#define GL_ATI_vertex_array_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLuint APIENTRY glNewObjectBufferATI (GLsizei size, const GLvoid *pointer, GLenum usage);
+GLAPI GLboolean APIENTRY glIsObjectBufferATI (GLuint buffer);
+GLAPI void APIENTRY glUpdateObjectBufferATI (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve);
+GLAPI void APIENTRY glGetObjectBufferfvATI (GLuint buffer, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetObjectBufferivATI (GLuint buffer, GLenum pname, GLint *params);
+GLAPI void APIENTRY glFreeObjectBufferATI (GLuint buffer);
+GLAPI void APIENTRY glArrayObjectATI (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
+GLAPI void APIENTRY glGetArrayObjectfvATI (GLenum array, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetArrayObjectivATI (GLenum array, GLenum pname, GLint *params);
+GLAPI void APIENTRY glVariantArrayObjectATI (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
+GLAPI void APIENTRY glGetVariantArrayObjectfvATI (GLuint id, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetVariantArrayObjectivATI (GLuint id, GLenum pname, GLint *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const GLvoid *pointer, GLenum usage);
+typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve);
+typedef void (APIENTRYP PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
+typedef void (APIENTRYP PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
+typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint *params);
+#endif
+
+#ifndef GL_EXT_vertex_shader
+#define GL_EXT_vertex_shader 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBeginVertexShaderEXT (void);
+GLAPI void APIENTRY glEndVertexShaderEXT (void);
+GLAPI void APIENTRY glBindVertexShaderEXT (GLuint id);
+GLAPI GLuint APIENTRY glGenVertexShadersEXT (GLuint range);
+GLAPI void APIENTRY glDeleteVertexShaderEXT (GLuint id);
+GLAPI void APIENTRY glShaderOp1EXT (GLenum op, GLuint res, GLuint arg1);
+GLAPI void APIENTRY glShaderOp2EXT (GLenum op, GLuint res, GLuint arg1, GLuint arg2);
+GLAPI void APIENTRY glShaderOp3EXT (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3);
+GLAPI void APIENTRY glSwizzleEXT (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
+GLAPI void APIENTRY glWriteMaskEXT (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
+GLAPI void APIENTRY glInsertComponentEXT (GLuint res, GLuint src, GLuint num);
+GLAPI void APIENTRY glExtractComponentEXT (GLuint res, GLuint src, GLuint num);
+GLAPI GLuint APIENTRY glGenSymbolsEXT (GLenum datatype, GLenum storagetype, GLenum range, GLuint components);
+GLAPI void APIENTRY glSetInvariantEXT (GLuint id, GLenum type, const GLvoid *addr);
+GLAPI void APIENTRY glSetLocalConstantEXT (GLuint id, GLenum type, const GLvoid *addr);
+GLAPI void APIENTRY glVariantbvEXT (GLuint id, const GLbyte *addr);
+GLAPI void APIENTRY glVariantsvEXT (GLuint id, const GLshort *addr);
+GLAPI void APIENTRY glVariantivEXT (GLuint id, const GLint *addr);
+GLAPI void APIENTRY glVariantfvEXT (GLuint id, const GLfloat *addr);
+GLAPI void APIENTRY glVariantdvEXT (GLuint id, const GLdouble *addr);
+GLAPI void APIENTRY glVariantubvEXT (GLuint id, const GLubyte *addr);
+GLAPI void APIENTRY glVariantusvEXT (GLuint id, const GLushort *addr);
+GLAPI void APIENTRY glVariantuivEXT (GLuint id, const GLuint *addr);
+GLAPI void APIENTRY glVariantPointerEXT (GLuint id, GLenum type, GLuint stride, const GLvoid *addr);
+GLAPI void APIENTRY glEnableVariantClientStateEXT (GLuint id);
+GLAPI void APIENTRY glDisableVariantClientStateEXT (GLuint id);
+GLAPI GLuint APIENTRY glBindLightParameterEXT (GLenum light, GLenum value);
+GLAPI GLuint APIENTRY glBindMaterialParameterEXT (GLenum face, GLenum value);
+GLAPI GLuint APIENTRY glBindTexGenParameterEXT (GLenum unit, GLenum coord, GLenum value);
+GLAPI GLuint APIENTRY glBindTextureUnitParameterEXT (GLenum unit, GLenum value);
+GLAPI GLuint APIENTRY glBindParameterEXT (GLenum value);
+GLAPI GLboolean APIENTRY glIsVariantEnabledEXT (GLuint id, GLenum cap);
+GLAPI void APIENTRY glGetVariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data);
+GLAPI void APIENTRY glGetVariantIntegervEXT (GLuint id, GLenum value, GLint *data);
+GLAPI void APIENTRY glGetVariantFloatvEXT (GLuint id, GLenum value, GLfloat *data);
+GLAPI void APIENTRY glGetVariantPointervEXT (GLuint id, GLenum value, GLvoid* *data);
+GLAPI void APIENTRY glGetInvariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data);
+GLAPI void APIENTRY glGetInvariantIntegervEXT (GLuint id, GLenum value, GLint *data);
+GLAPI void APIENTRY glGetInvariantFloatvEXT (GLuint id, GLenum value, GLfloat *data);
+GLAPI void APIENTRY glGetLocalConstantBooleanvEXT (GLuint id, GLenum value, GLboolean *data);
+GLAPI void APIENTRY glGetLocalConstantIntegervEXT (GLuint id, GLenum value, GLint *data);
+GLAPI void APIENTRY glGetLocalConstantFloatvEXT (GLuint id, GLenum value, GLfloat *data);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC) (void);
+typedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC) (void);
+typedef void (APIENTRYP PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id);
+typedef GLuint (APIENTRYP PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range);
+typedef void (APIENTRYP PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1);
+typedef void (APIENTRYP PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2);
+typedef void (APIENTRYP PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3);
+typedef void (APIENTRYP PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
+typedef void (APIENTRYP PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
+typedef void (APIENTRYP PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num);
+typedef void (APIENTRYP PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num);
+typedef GLuint (APIENTRYP PFNGLGENSYMBOLSEXTPROC) (GLenum datatype, GLenum storagetype, GLenum range, GLuint components);
+typedef void (APIENTRYP PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr);
+typedef void (APIENTRYP PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr);
+typedef void (APIENTRYP PFNGLVARIANTBVEXTPROC) (GLuint id, const GLbyte *addr);
+typedef void (APIENTRYP PFNGLVARIANTSVEXTPROC) (GLuint id, const GLshort *addr);
+typedef void (APIENTRYP PFNGLVARIANTIVEXTPROC) (GLuint id, const GLint *addr);
+typedef void (APIENTRYP PFNGLVARIANTFVEXTPROC) (GLuint id, const GLfloat *addr);
+typedef void (APIENTRYP PFNGLVARIANTDVEXTPROC) (GLuint id, const GLdouble *addr);
+typedef void (APIENTRYP PFNGLVARIANTUBVEXTPROC) (GLuint id, const GLubyte *addr);
+typedef void (APIENTRYP PFNGLVARIANTUSVEXTPROC) (GLuint id, const GLushort *addr);
+typedef void (APIENTRYP PFNGLVARIANTUIVEXTPROC) (GLuint id, const GLuint *addr);
+typedef void (APIENTRYP PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, const GLvoid *addr);
+typedef void (APIENTRYP PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id);
+typedef GLuint (APIENTRYP PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value);
+typedef GLuint (APIENTRYP PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value);
+typedef GLuint (APIENTRYP PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value);
+typedef GLuint (APIENTRYP PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value);
+typedef GLuint (APIENTRYP PFNGLBINDPARAMETEREXTPROC) (GLenum value);
+typedef GLboolean (APIENTRYP PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap);
+typedef void (APIENTRYP PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
+typedef void (APIENTRYP PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
+typedef void (APIENTRYP PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
+typedef void (APIENTRYP PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid* *data);
+typedef void (APIENTRYP PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
+typedef void (APIENTRYP PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
+typedef void (APIENTRYP PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
+typedef void (APIENTRYP PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
+typedef void (APIENTRYP PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
+typedef void (APIENTRYP PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
+#endif
+
+#ifndef GL_ATI_vertex_streams
+#define GL_ATI_vertex_streams 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexStream1sATI (GLenum stream, GLshort x);
+GLAPI void APIENTRY glVertexStream1svATI (GLenum stream, const GLshort *coords);
+GLAPI void APIENTRY glVertexStream1iATI (GLenum stream, GLint x);
+GLAPI void APIENTRY glVertexStream1ivATI (GLenum stream, const GLint *coords);
+GLAPI void APIENTRY glVertexStream1fATI (GLenum stream, GLfloat x);
+GLAPI void APIENTRY glVertexStream1fvATI (GLenum stream, const GLfloat *coords);
+GLAPI void APIENTRY glVertexStream1dATI (GLenum stream, GLdouble x);
+GLAPI void APIENTRY glVertexStream1dvATI (GLenum stream, const GLdouble *coords);
+GLAPI void APIENTRY glVertexStream2sATI (GLenum stream, GLshort x, GLshort y);
+GLAPI void APIENTRY glVertexStream2svATI (GLenum stream, const GLshort *coords);
+GLAPI void APIENTRY glVertexStream2iATI (GLenum stream, GLint x, GLint y);
+GLAPI void APIENTRY glVertexStream2ivATI (GLenum stream, const GLint *coords);
+GLAPI void APIENTRY glVertexStream2fATI (GLenum stream, GLfloat x, GLfloat y);
+GLAPI void APIENTRY glVertexStream2fvATI (GLenum stream, const GLfloat *coords);
+GLAPI void APIENTRY glVertexStream2dATI (GLenum stream, GLdouble x, GLdouble y);
+GLAPI void APIENTRY glVertexStream2dvATI (GLenum stream, const GLdouble *coords);
+GLAPI void APIENTRY glVertexStream3sATI (GLenum stream, GLshort x, GLshort y, GLshort z);
+GLAPI void APIENTRY glVertexStream3svATI (GLenum stream, const GLshort *coords);
+GLAPI void APIENTRY glVertexStream3iATI (GLenum stream, GLint x, GLint y, GLint z);
+GLAPI void APIENTRY glVertexStream3ivATI (GLenum stream, const GLint *coords);
+GLAPI void APIENTRY glVertexStream3fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glVertexStream3fvATI (GLenum stream, const GLfloat *coords);
+GLAPI void APIENTRY glVertexStream3dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glVertexStream3dvATI (GLenum stream, const GLdouble *coords);
+GLAPI void APIENTRY glVertexStream4sATI (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w);
+GLAPI void APIENTRY glVertexStream4svATI (GLenum stream, const GLshort *coords);
+GLAPI void APIENTRY glVertexStream4iATI (GLenum stream, GLint x, GLint y, GLint z, GLint w);
+GLAPI void APIENTRY glVertexStream4ivATI (GLenum stream, const GLint *coords);
+GLAPI void APIENTRY glVertexStream4fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY glVertexStream4fvATI (GLenum stream, const GLfloat *coords);
+GLAPI void APIENTRY glVertexStream4dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glVertexStream4dvATI (GLenum stream, const GLdouble *coords);
+GLAPI void APIENTRY glNormalStream3bATI (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz);
+GLAPI void APIENTRY glNormalStream3bvATI (GLenum stream, const GLbyte *coords);
+GLAPI void APIENTRY glNormalStream3sATI (GLenum stream, GLshort nx, GLshort ny, GLshort nz);
+GLAPI void APIENTRY glNormalStream3svATI (GLenum stream, const GLshort *coords);
+GLAPI void APIENTRY glNormalStream3iATI (GLenum stream, GLint nx, GLint ny, GLint nz);
+GLAPI void APIENTRY glNormalStream3ivATI (GLenum stream, const GLint *coords);
+GLAPI void APIENTRY glNormalStream3fATI (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz);
+GLAPI void APIENTRY glNormalStream3fvATI (GLenum stream, const GLfloat *coords);
+GLAPI void APIENTRY glNormalStream3dATI (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz);
+GLAPI void APIENTRY glNormalStream3dvATI (GLenum stream, const GLdouble *coords);
+GLAPI void APIENTRY glClientActiveVertexStreamATI (GLenum stream);
+GLAPI void APIENTRY glVertexBlendEnviATI (GLenum pname, GLint param);
+GLAPI void APIENTRY glVertexBlendEnvfATI (GLenum pname, GLfloat param);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort nx, GLshort ny, GLshort nz);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint nx, GLint ny, GLint nz);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords);
+typedef void (APIENTRYP PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream);
+typedef void (APIENTRYP PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param);
+#endif
+
+#ifndef GL_ATI_element_array
+#define GL_ATI_element_array 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glElementPointerATI (GLenum type, const GLvoid *pointer);
+GLAPI void APIENTRY glDrawElementArrayATI (GLenum mode, GLsizei count);
+GLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum mode, GLuint start, GLuint end, GLsizei count);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC) (GLenum type, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count);
+typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count);
+#endif
+
+#ifndef GL_SUN_mesh_array
+#define GL_SUN_mesh_array 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawMeshArraysSUN (GLenum mode, GLint first, GLsizei count, GLsizei width);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, GLsizei count, GLsizei width);
+#endif
+
+#ifndef GL_SUN_slice_accum
+#define GL_SUN_slice_accum 1
+#endif
+
+#ifndef GL_NV_multisample_filter_hint
+#define GL_NV_multisample_filter_hint 1
+#endif
+
+#ifndef GL_NV_depth_clamp
+#define GL_NV_depth_clamp 1
+#endif
+
+#ifndef GL_NV_occlusion_query
+#define GL_NV_occlusion_query 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGenOcclusionQueriesNV (GLsizei n, GLuint *ids);
+GLAPI void APIENTRY glDeleteOcclusionQueriesNV (GLsizei n, const GLuint *ids);
+GLAPI GLboolean APIENTRY glIsOcclusionQueryNV (GLuint id);
+GLAPI void APIENTRY glBeginOcclusionQueryNV (GLuint id);
+GLAPI void APIENTRY glEndOcclusionQueryNV (void);
+GLAPI void APIENTRY glGetOcclusionQueryivNV (GLuint id, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetOcclusionQueryuivNV (GLuint id, GLenum pname, GLuint *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids);
+typedef void (APIENTRYP PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids);
+typedef GLboolean (APIENTRYP PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLENDOCCLUSIONQUERYNVPROC) (void);
+typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint *params);
+#endif
+
+#ifndef GL_NV_point_sprite
+#define GL_NV_point_sprite 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPointParameteriNV (GLenum pname, GLint param);
+GLAPI void APIENTRY glPointParameterivNV (GLenum pname, const GLint *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint *params);
+#endif
+
+#ifndef GL_NV_texture_shader3
+#define GL_NV_texture_shader3 1
+#endif
+
+#ifndef GL_NV_vertex_program1_1
+#define GL_NV_vertex_program1_1 1
+#endif
+
+#ifndef GL_EXT_shadow_funcs
+#define GL_EXT_shadow_funcs 1
+#endif
+
+#ifndef GL_EXT_stencil_two_side
+#define GL_EXT_stencil_two_side 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum face);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face);
+#endif
+
+#ifndef GL_ATI_text_fragment_shader
+#define GL_ATI_text_fragment_shader 1
+#endif
+
+#ifndef GL_APPLE_client_storage
+#define GL_APPLE_client_storage 1
+#endif
+
+#ifndef GL_APPLE_element_array
+#define GL_APPLE_element_array 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glElementPointerAPPLE (GLenum type, const GLvoid *pointer);
+GLAPI void APIENTRY glDrawElementArrayAPPLE (GLenum mode, GLint first, GLsizei count);
+GLAPI void APIENTRY glDrawRangeElementArrayAPPLE (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count);
+GLAPI void APIENTRY glMultiDrawElementArrayAPPLE (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
+GLAPI void APIENTRY glMultiDrawRangeElementArrayAPPLE (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count);
+typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count);
+typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
+typedef void (APIENTRYP PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount);
+#endif
+
+#ifndef GL_APPLE_fence
+#define GL_APPLE_fence 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGenFencesAPPLE (GLsizei n, GLuint *fences);
+GLAPI void APIENTRY glDeleteFencesAPPLE (GLsizei n, const GLuint *fences);
+GLAPI void APIENTRY glSetFenceAPPLE (GLuint fence);
+GLAPI GLboolean APIENTRY glIsFenceAPPLE (GLuint fence);
+GLAPI GLboolean APIENTRY glTestFenceAPPLE (GLuint fence);
+GLAPI void APIENTRY glFinishFenceAPPLE (GLuint fence);
+GLAPI GLboolean APIENTRY glTestObjectAPPLE (GLenum object, GLuint name);
+GLAPI void APIENTRY glFinishObjectAPPLE (GLenum object, GLint name);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint *fences);
+typedef void (APIENTRYP PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint *fences);
+typedef void (APIENTRYP PFNGLSETFENCEAPPLEPROC) (GLuint fence);
+typedef GLboolean (APIENTRYP PFNGLISFENCEAPPLEPROC) (GLuint fence);
+typedef GLboolean (APIENTRYP PFNGLTESTFENCEAPPLEPROC) (GLuint fence);
+typedef void (APIENTRYP PFNGLFINISHFENCEAPPLEPROC) (GLuint fence);
+typedef GLboolean (APIENTRYP PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name);
+typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name);
+#endif
+
+#ifndef GL_APPLE_vertex_array_object
+#define GL_APPLE_vertex_array_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint array);
+GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei n, const GLuint *arrays);
+GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei n, GLuint *arrays);
+GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint array);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array);
+typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays);
+typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, GLuint *arrays);
+typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array);
+#endif
+
+#ifndef GL_APPLE_vertex_array_range
+#define GL_APPLE_vertex_array_range 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexArrayRangeAPPLE (GLsizei length, GLvoid *pointer);
+GLAPI void APIENTRY glFlushVertexArrayRangeAPPLE (GLsizei length, GLvoid *pointer);
+GLAPI void APIENTRY glVertexArrayParameteriAPPLE (GLenum pname, GLint param);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer);
+typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer);
+typedef void (APIENTRYP PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param);
+#endif
+
+#ifndef GL_APPLE_ycbcr_422
+#define GL_APPLE_ycbcr_422 1
+#endif
+
+#ifndef GL_S3_s3tc
+#define GL_S3_s3tc 1
+#endif
+
+#ifndef GL_ATI_draw_buffers
+#define GL_ATI_draw_buffers 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawBuffersATI (GLsizei n, const GLenum *bufs);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum *bufs);
+#endif
+
+#ifndef GL_ATI_pixel_format_float
+#define GL_ATI_pixel_format_float 1
+/* This is really a WGL extension, but defines some associated GL enums.
+ * ATI does not export "GL_ATI_pixel_format_float" in the GL_EXTENSIONS string.
+ */
+#endif
+
+#ifndef GL_ATI_texture_env_combine3
+#define GL_ATI_texture_env_combine3 1
+#endif
+
+#ifndef GL_ATI_texture_float
+#define GL_ATI_texture_float 1
+#endif
+
+#ifndef GL_NV_float_buffer
+#define GL_NV_float_buffer 1
+#endif
+
+#ifndef GL_NV_fragment_program
+#define GL_NV_fragment_program 1
+/* Some NV_fragment_program entry points are shared with ARB_vertex_program. */
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glProgramNamedParameter4fNV (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY glProgramNamedParameter4dNV (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glProgramNamedParameter4fvNV (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v);
+GLAPI void APIENTRY glProgramNamedParameter4dvNV (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v);
+GLAPI void APIENTRY glGetProgramNamedParameterfvNV (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params);
+GLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v);
+typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v);
+typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params);
+#endif
+
+#ifndef GL_NV_half_float
+#define GL_NV_half_float 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertex2hNV (GLhalfNV x, GLhalfNV y);
+GLAPI void APIENTRY glVertex2hvNV (const GLhalfNV *v);
+GLAPI void APIENTRY glVertex3hNV (GLhalfNV x, GLhalfNV y, GLhalfNV z);
+GLAPI void APIENTRY glVertex3hvNV (const GLhalfNV *v);
+GLAPI void APIENTRY glVertex4hNV (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);
+GLAPI void APIENTRY glVertex4hvNV (const GLhalfNV *v);
+GLAPI void APIENTRY glNormal3hNV (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz);
+GLAPI void APIENTRY glNormal3hvNV (const GLhalfNV *v);
+GLAPI void APIENTRY glColor3hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
+GLAPI void APIENTRY glColor3hvNV (const GLhalfNV *v);
+GLAPI void APIENTRY glColor4hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha);
+GLAPI void APIENTRY glColor4hvNV (const GLhalfNV *v);
+GLAPI void APIENTRY glTexCoord1hNV (GLhalfNV s);
+GLAPI void APIENTRY glTexCoord1hvNV (const GLhalfNV *v);
+GLAPI void APIENTRY glTexCoord2hNV (GLhalfNV s, GLhalfNV t);
+GLAPI void APIENTRY glTexCoord2hvNV (const GLhalfNV *v);
+GLAPI void APIENTRY glTexCoord3hNV (GLhalfNV s, GLhalfNV t, GLhalfNV r);
+GLAPI void APIENTRY glTexCoord3hvNV (const GLhalfNV *v);
+GLAPI void APIENTRY glTexCoord4hNV (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);
+GLAPI void APIENTRY glTexCoord4hvNV (const GLhalfNV *v);
+GLAPI void APIENTRY glMultiTexCoord1hNV (GLenum target, GLhalfNV s);
+GLAPI void APIENTRY glMultiTexCoord1hvNV (GLenum target, const GLhalfNV *v);
+GLAPI void APIENTRY glMultiTexCoord2hNV (GLenum target, GLhalfNV s, GLhalfNV t);
+GLAPI void APIENTRY glMultiTexCoord2hvNV (GLenum target, const GLhalfNV *v);
+GLAPI void APIENTRY glMultiTexCoord3hNV (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r);
+GLAPI void APIENTRY glMultiTexCoord3hvNV (GLenum target, const GLhalfNV *v);
+GLAPI void APIENTRY glMultiTexCoord4hNV (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);
+GLAPI void APIENTRY glMultiTexCoord4hvNV (GLenum target, const GLhalfNV *v);
+GLAPI void APIENTRY glFogCoordhNV (GLhalfNV fog);
+GLAPI void APIENTRY glFogCoordhvNV (const GLhalfNV *fog);
+GLAPI void APIENTRY glSecondaryColor3hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
+GLAPI void APIENTRY glSecondaryColor3hvNV (const GLhalfNV *v);
+GLAPI void APIENTRY glVertexWeighthNV (GLhalfNV weight);
+GLAPI void APIENTRY glVertexWeighthvNV (const GLhalfNV *weight);
+GLAPI void APIENTRY glVertexAttrib1hNV (GLuint index, GLhalfNV x);
+GLAPI void APIENTRY glVertexAttrib1hvNV (GLuint index, const GLhalfNV *v);
+GLAPI void APIENTRY glVertexAttrib2hNV (GLuint index, GLhalfNV x, GLhalfNV y);
+GLAPI void APIENTRY glVertexAttrib2hvNV (GLuint index, const GLhalfNV *v);
+GLAPI void APIENTRY glVertexAttrib3hNV (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z);
+GLAPI void APIENTRY glVertexAttrib3hvNV (GLuint index, const GLhalfNV *v);
+GLAPI void APIENTRY glVertexAttrib4hNV (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);
+GLAPI void APIENTRY glVertexAttrib4hvNV (GLuint index, const GLhalfNV *v);
+GLAPI void APIENTRY glVertexAttribs1hvNV (GLuint index, GLsizei n, const GLhalfNV *v);
+GLAPI void APIENTRY glVertexAttribs2hvNV (GLuint index, GLsizei n, const GLhalfNV *v);
+GLAPI void APIENTRY glVertexAttribs3hvNV (GLuint index, GLsizei n, const GLhalfNV *v);
+GLAPI void APIENTRY glVertexAttribs4hvNV (GLuint index, GLsizei n, const GLhalfNV *v);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEX2HNVPROC) (GLhalfNV x, GLhalfNV y);
+typedef void (APIENTRYP PFNGLVERTEX2HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEX3HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z);
+typedef void (APIENTRYP PFNGLVERTEX3HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEX4HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);
+typedef void (APIENTRYP PFNGLVERTEX4HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLNORMAL3HNVPROC) (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz);
+typedef void (APIENTRYP PFNGLNORMAL3HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
+typedef void (APIENTRYP PFNGLCOLOR3HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLCOLOR4HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha);
+typedef void (APIENTRYP PFNGLCOLOR4HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLTEXCOORD1HNVPROC) (GLhalfNV s);
+typedef void (APIENTRYP PFNGLTEXCOORD1HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2HNVPROC) (GLhalfNV s, GLhalfNV t);
+typedef void (APIENTRYP PFNGLTEXCOORD2HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLTEXCOORD3HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r);
+typedef void (APIENTRYP PFNGLTEXCOORD3HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLTEXCOORD4HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);
+typedef void (APIENTRYP PFNGLTEXCOORD4HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalfNV s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLFOGCOORDHNVPROC) (GLhalfNV fog);
+typedef void (APIENTRYP PFNGLFOGCOORDHVNVPROC) (const GLhalfNV *fog);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXWEIGHTHNVPROC) (GLhalfNV weight);
+typedef void (APIENTRYP PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalfNV *weight);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalfNV x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
+#endif
+
+#ifndef GL_NV_pixel_data_range
+#define GL_NV_pixel_data_range 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPixelDataRangeNV (GLenum target, GLsizei length, GLvoid *pointer);
+GLAPI void APIENTRY glFlushPixelDataRangeNV (GLenum target);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, GLvoid *pointer);
+typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target);
+#endif
+
+#ifndef GL_NV_primitive_restart
+#define GL_NV_primitive_restart 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPrimitiveRestartNV (void);
+GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint index);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPRIMITIVERESTARTNVPROC) (void);
+typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index);
+#endif
+
+#ifndef GL_NV_texture_expand_normal
+#define GL_NV_texture_expand_normal 1
+#endif
+
+#ifndef GL_NV_vertex_program2
+#define GL_NV_vertex_program2 1
+#endif
+
+#ifndef GL_ATI_map_object_buffer
+#define GL_ATI_map_object_buffer 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLvoid* APIENTRY glMapObjectBufferATI (GLuint buffer);
+GLAPI void APIENTRY glUnmapObjectBufferATI (GLuint buffer);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLvoid* (APIENTRYP PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer);
+#endif
+
+#ifndef GL_ATI_separate_stencil
+#define GL_ATI_separate_stencil 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glStencilOpSeparateATI (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
+GLAPI void APIENTRY glStencilFuncSeparateATI (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
+typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
+#endif
+
+#ifndef GL_ATI_vertex_attrib_array_object
+#define GL_ATI_vertex_attrib_array_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexAttribArrayObjectATI (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset);
+GLAPI void APIENTRY glGetVertexAttribArrayObjectfvATI (GLuint index, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetVertexAttribArrayObjectivATI (GLuint index, GLenum pname, GLint *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint *params);
+#endif
+
+#ifndef GL_OES_read_format
+#define GL_OES_read_format 1
+#endif
+
+#ifndef GL_EXT_depth_bounds_test
+#define GL_EXT_depth_bounds_test 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDepthBoundsEXT (GLclampd zmin, GLclampd zmax);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax);
+#endif
+
+#ifndef GL_EXT_texture_mirror_clamp
+#define GL_EXT_texture_mirror_clamp 1
+#endif
+
+#ifndef GL_EXT_blend_equation_separate
+#define GL_EXT_blend_equation_separate 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendEquationSeparateEXT (GLenum modeRGB, GLenum modeAlpha);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha);
+#endif
+
+#ifndef GL_MESA_pack_invert
+#define GL_MESA_pack_invert 1
+#endif
+
+#ifndef GL_MESA_ycbcr_texture
+#define GL_MESA_ycbcr_texture 1
+#endif
+
+#ifndef GL_EXT_pixel_buffer_object
+#define GL_EXT_pixel_buffer_object 1
+#endif
+
+#ifndef GL_NV_fragment_program_option
+#define GL_NV_fragment_program_option 1
+#endif
+
+#ifndef GL_NV_fragment_program2
+#define GL_NV_fragment_program2 1
+#endif
+
+#ifndef GL_NV_vertex_program2_option
+#define GL_NV_vertex_program2_option 1
+#endif
+
+#ifndef GL_NV_vertex_program3
+#define GL_NV_vertex_program3 1
+#endif
+
+#ifndef GL_EXT_framebuffer_object
+#define GL_EXT_framebuffer_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLboolean APIENTRY glIsRenderbufferEXT (GLuint renderbuffer);
+GLAPI void APIENTRY glBindRenderbufferEXT (GLenum target, GLuint renderbuffer);
+GLAPI void APIENTRY glDeleteRenderbuffersEXT (GLsizei n, const GLuint *renderbuffers);
+GLAPI void APIENTRY glGenRenderbuffersEXT (GLsizei n, GLuint *renderbuffers);
+GLAPI void APIENTRY glRenderbufferStorageEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glGetRenderbufferParameterivEXT (GLenum target, GLenum pname, GLint *params);
+GLAPI GLboolean APIENTRY glIsFramebufferEXT (GLuint framebuffer);
+GLAPI void APIENTRY glBindFramebufferEXT (GLenum target, GLuint framebuffer);
+GLAPI void APIENTRY glDeleteFramebuffersEXT (GLsizei n, const GLuint *framebuffers);
+GLAPI void APIENTRY glGenFramebuffersEXT (GLsizei n, GLuint *framebuffers);
+GLAPI GLenum APIENTRY glCheckFramebufferStatusEXT (GLenum target);
+GLAPI void APIENTRY glFramebufferTexture1DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GLAPI void APIENTRY glFramebufferTexture2DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GLAPI void APIENTRY glFramebufferTexture3DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+GLAPI void APIENTRY glFramebufferRenderbufferEXT (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+GLAPI void APIENTRY glGetFramebufferAttachmentParameterivEXT (GLenum target, GLenum attachment, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGenerateMipmapEXT (GLenum target);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers);
+typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers);
+typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer);
+typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer);
+typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers);
+typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers);
+typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target);
+#endif
+
+#ifndef GL_GREMEDY_string_marker
+#define GL_GREMEDY_string_marker 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei len, const GLvoid *string);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid *string);
+#endif
+
+#ifndef GL_EXT_packed_depth_stencil
+#define GL_EXT_packed_depth_stencil 1
+#endif
+
+#ifndef GL_EXT_stencil_clear_tag
+#define GL_EXT_stencil_clear_tag 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glStencilClearTagEXT (GLsizei stencilTagBits, GLuint stencilClearTag);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSTENCILCLEARTAGEXTPROC) (GLsizei stencilTagBits, GLuint stencilClearTag);
+#endif
+
+#ifndef GL_EXT_texture_sRGB
+#define GL_EXT_texture_sRGB 1
+#endif
+
+#ifndef GL_EXT_framebuffer_blit
+#define GL_EXT_framebuffer_blit 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlitFramebufferEXT (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+#endif
+
+#ifndef GL_EXT_framebuffer_multisample
+#define GL_EXT_framebuffer_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glRenderbufferStorageMultisampleEXT (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+#endif
+
+#ifndef GL_MESAX_texture_stack
+#define GL_MESAX_texture_stack 1
+#endif
+
+#ifndef GL_EXT_timer_query
+#define GL_EXT_timer_query 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetQueryObjecti64vEXT (GLuint id, GLenum pname, GLint64EXT *params);
+GLAPI void APIENTRY glGetQueryObjectui64vEXT (GLuint id, GLenum pname, GLuint64EXT *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT *params);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT *params);
+#endif
+
+#ifndef GL_EXT_gpu_program_parameters
+#define GL_EXT_gpu_program_parameters 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glProgramEnvParameters4fvEXT (GLenum target, GLuint index, GLsizei count, const GLfloat *params);
+GLAPI void APIENTRY glProgramLocalParameters4fvEXT (GLenum target, GLuint index, GLsizei count, const GLfloat *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params);
+#endif
+
+#ifndef GL_APPLE_flush_buffer_range
+#define GL_APPLE_flush_buffer_range 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBufferParameteriAPPLE (GLenum target, GLenum pname, GLint param);
+GLAPI void APIENTRY glFlushMappedBufferRangeAPPLE (GLenum target, GLintptr offset, GLsizeiptr size);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size);
+#endif
+
+#ifndef GL_NV_gpu_program4
+#define GL_NV_gpu_program4 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glProgramLocalParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
+GLAPI void APIENTRY glProgramLocalParameterI4ivNV (GLenum target, GLuint index, const GLint *params);
+GLAPI void APIENTRY glProgramLocalParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params);
+GLAPI void APIENTRY glProgramLocalParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+GLAPI void APIENTRY glProgramLocalParameterI4uivNV (GLenum target, GLuint index, const GLuint *params);
+GLAPI void APIENTRY glProgramLocalParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params);
+GLAPI void APIENTRY glProgramEnvParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
+GLAPI void APIENTRY glProgramEnvParameterI4ivNV (GLenum target, GLuint index, const GLint *params);
+GLAPI void APIENTRY glProgramEnvParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params);
+GLAPI void APIENTRY glProgramEnvParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+GLAPI void APIENTRY glProgramEnvParameterI4uivNV (GLenum target, GLuint index, const GLuint *params);
+GLAPI void APIENTRY glProgramEnvParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params);
+GLAPI void APIENTRY glGetProgramLocalParameterIivNV (GLenum target, GLuint index, GLint *params);
+GLAPI void APIENTRY glGetProgramLocalParameterIuivNV (GLenum target, GLuint index, GLuint *params);
+GLAPI void APIENTRY glGetProgramEnvParameterIivNV (GLenum target, GLuint index, GLint *params);
+GLAPI void APIENTRY glGetProgramEnvParameterIuivNV (GLenum target, GLuint index, GLuint *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params);
+#endif
+
+#ifndef GL_NV_geometry_program4
+#define GL_NV_geometry_program4 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glProgramVertexLimitNV (GLenum target, GLint limit);
+GLAPI void APIENTRY glFramebufferTextureEXT (GLenum target, GLenum attachment, GLuint texture, GLint level);
+GLAPI void APIENTRY glFramebufferTextureLayerEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+GLAPI void APIENTRY glFramebufferTextureFaceEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
+#endif
+
+#ifndef GL_EXT_geometry_shader4
+#define GL_EXT_geometry_shader4 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glProgramParameteriEXT (GLuint program, GLenum pname, GLint value);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value);
+#endif
+
+#ifndef GL_NV_vertex_program4
+#define GL_NV_vertex_program4 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexAttribI1iEXT (GLuint index, GLint x);
+GLAPI void APIENTRY glVertexAttribI2iEXT (GLuint index, GLint x, GLint y);
+GLAPI void APIENTRY glVertexAttribI3iEXT (GLuint index, GLint x, GLint y, GLint z);
+GLAPI void APIENTRY glVertexAttribI4iEXT (GLuint index, GLint x, GLint y, GLint z, GLint w);
+GLAPI void APIENTRY glVertexAttribI1uiEXT (GLuint index, GLuint x);
+GLAPI void APIENTRY glVertexAttribI2uiEXT (GLuint index, GLuint x, GLuint y);
+GLAPI void APIENTRY glVertexAttribI3uiEXT (GLuint index, GLuint x, GLuint y, GLuint z);
+GLAPI void APIENTRY glVertexAttribI4uiEXT (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+GLAPI void APIENTRY glVertexAttribI1ivEXT (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttribI2ivEXT (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttribI3ivEXT (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttribI4ivEXT (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttribI1uivEXT (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttribI2uivEXT (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttribI3uivEXT (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttribI4uivEXT (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttribI4bvEXT (GLuint index, const GLbyte *v);
+GLAPI void APIENTRY glVertexAttribI4svEXT (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttribI4ubvEXT (GLuint index, const GLubyte *v);
+GLAPI void APIENTRY glVertexAttribI4usvEXT (GLuint index, const GLushort *v);
+GLAPI void APIENTRY glVertexAttribIPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY glGetVertexAttribIivEXT (GLuint index, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetVertexAttribIuivEXT (GLuint index, GLenum pname, GLuint *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint *params);
+#endif
+
+#ifndef GL_EXT_gpu_shader4
+#define GL_EXT_gpu_shader4 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetUniformuivEXT (GLuint program, GLint location, GLuint *params);
+GLAPI void APIENTRY glBindFragDataLocationEXT (GLuint program, GLuint color, const GLchar *name);
+GLAPI GLint APIENTRY glGetFragDataLocationEXT (GLuint program, const GLchar *name);
+GLAPI void APIENTRY glUniform1uiEXT (GLint location, GLuint v0);
+GLAPI void APIENTRY glUniform2uiEXT (GLint location, GLuint v0, GLuint v1);
+GLAPI void APIENTRY glUniform3uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2);
+GLAPI void APIENTRY glUniform4uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+GLAPI void APIENTRY glUniform1uivEXT (GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glUniform2uivEXT (GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glUniform3uivEXT (GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glUniform4uivEXT (GLint location, GLsizei count, const GLuint *value);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint *params);
+typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name);
+typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONEXTPROC) (GLuint program, const GLchar *name);
+typedef void (APIENTRYP PFNGLUNIFORM1UIEXTPROC) (GLint location, GLuint v0);
+typedef void (APIENTRYP PFNGLUNIFORM2UIEXTPROC) (GLint location, GLuint v0, GLuint v1);
+typedef void (APIENTRYP PFNGLUNIFORM3UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2);
+typedef void (APIENTRYP PFNGLUNIFORM4UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+typedef void (APIENTRYP PFNGLUNIFORM1UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLUNIFORM2UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLUNIFORM3UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
+#endif
+
+#ifndef GL_EXT_draw_instanced
+#define GL_EXT_draw_instanced 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawArraysInstancedEXT (GLenum mode, GLint start, GLsizei count, GLsizei primcount);
+GLAPI void APIENTRY glDrawElementsInstancedEXT (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount);
+typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
+#endif
+
+#ifndef GL_EXT_packed_float
+#define GL_EXT_packed_float 1
+#endif
+
+#ifndef GL_EXT_texture_array
+#define GL_EXT_texture_array 1
+#endif
+
+#ifndef GL_EXT_texture_buffer_object
+#define GL_EXT_texture_buffer_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexBufferEXT (GLenum target, GLenum internalformat, GLuint buffer);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer);
+#endif
+
+#ifndef GL_EXT_texture_compression_latc
+#define GL_EXT_texture_compression_latc 1
+#endif
+
+#ifndef GL_EXT_texture_compression_rgtc
+#define GL_EXT_texture_compression_rgtc 1
+#endif
+
+#ifndef GL_EXT_texture_shared_exponent
+#define GL_EXT_texture_shared_exponent 1
+#endif
+
+#ifndef GL_NV_depth_buffer_float
+#define GL_NV_depth_buffer_float 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDepthRangedNV (GLdouble zNear, GLdouble zFar);
+GLAPI void APIENTRY glClearDepthdNV (GLdouble depth);
+GLAPI void APIENTRY glDepthBoundsdNV (GLdouble zmin, GLdouble zmax);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar);
+typedef void (APIENTRYP PFNGLCLEARDEPTHDNVPROC) (GLdouble depth);
+typedef void (APIENTRYP PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax);
+#endif
+
+#ifndef GL_NV_fragment_program4
+#define GL_NV_fragment_program4 1
+#endif
+
+#ifndef GL_NV_framebuffer_multisample_coverage
+#define GL_NV_framebuffer_multisample_coverage 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glRenderbufferStorageMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);
+#endif
+
+#ifndef GL_EXT_framebuffer_sRGB
+#define GL_EXT_framebuffer_sRGB 1
+#endif
+
+#ifndef GL_NV_geometry_shader4
+#define GL_NV_geometry_shader4 1
+#endif
+
+#ifndef GL_NV_parameter_buffer_object
+#define GL_NV_parameter_buffer_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glProgramBufferParametersfvNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params);
+GLAPI void APIENTRY glProgramBufferParametersIivNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params);
+GLAPI void APIENTRY glProgramBufferParametersIuivNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params);
+typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params);
+typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params);
+#endif
+
+#ifndef GL_EXT_draw_buffers2
+#define GL_EXT_draw_buffers2 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColorMaskIndexedEXT (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
+GLAPI void APIENTRY glGetBooleanIndexedvEXT (GLenum target, GLuint index, GLboolean *data);
+GLAPI void APIENTRY glGetIntegerIndexedvEXT (GLenum target, GLuint index, GLint *data);
+GLAPI void APIENTRY glEnableIndexedEXT (GLenum target, GLuint index);
+GLAPI void APIENTRY glDisableIndexedEXT (GLenum target, GLuint index);
+GLAPI GLboolean APIENTRY glIsEnabledIndexedEXT (GLenum target, GLuint index);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
+typedef void (APIENTRYP PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum target, GLuint index, GLboolean *data);
+typedef void (APIENTRYP PFNGLGETINTEGERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLint *data);
+typedef void (APIENTRYP PFNGLENABLEINDEXEDEXTPROC) (GLenum target, GLuint index);
+typedef void (APIENTRYP PFNGLDISABLEINDEXEDEXTPROC) (GLenum target, GLuint index);
+typedef GLboolean (APIENTRYP PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GLuint index);
+#endif
+
+#ifndef GL_NV_transform_feedback
+#define GL_NV_transform_feedback 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBeginTransformFeedbackNV (GLenum primitiveMode);
+GLAPI void APIENTRY glEndTransformFeedbackNV (void);
+GLAPI void APIENTRY glTransformFeedbackAttribsNV (GLuint count, const GLint *attribs, GLenum bufferMode);
+GLAPI void APIENTRY glBindBufferRangeNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+GLAPI void APIENTRY glBindBufferOffsetNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset);
+GLAPI void APIENTRY glBindBufferBaseNV (GLenum target, GLuint index, GLuint buffer);
+GLAPI void APIENTRY glTransformFeedbackVaryingsNV (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode);
+GLAPI void APIENTRY glActiveVaryingNV (GLuint program, const GLchar *name);
+GLAPI GLint APIENTRY glGetVaryingLocationNV (GLuint program, const GLchar *name);
+GLAPI void APIENTRY glGetActiveVaryingNV (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
+GLAPI void APIENTRY glGetTransformFeedbackVaryingNV (GLuint program, GLuint index, GLint *location);
+GLAPI void APIENTRY glTransformFeedbackStreamAttribsNV (GLsizei count, const GLint *attribs, GLsizei nbuffers, const GLint *bufstreams, GLenum bufferMode);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode);
+typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKNVPROC) (void);
+typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLuint count, const GLint *attribs, GLenum bufferMode);
+typedef void (APIENTRYP PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset);
+typedef void (APIENTRYP PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer);
+typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode);
+typedef void (APIENTRYP PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar *name);
+typedef GLint (APIENTRYP PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar *name);
+typedef void (APIENTRYP PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
+typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint *location);
+typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKSTREAMATTRIBSNVPROC) (GLsizei count, const GLint *attribs, GLsizei nbuffers, const GLint *bufstreams, GLenum bufferMode);
+#endif
+
+#ifndef GL_EXT_bindable_uniform
+#define GL_EXT_bindable_uniform 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glUniformBufferEXT (GLuint program, GLint location, GLuint buffer);
+GLAPI GLint APIENTRY glGetUniformBufferSizeEXT (GLuint program, GLint location);
+GLAPI GLintptr APIENTRY glGetUniformOffsetEXT (GLuint program, GLint location);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer);
+typedef GLint (APIENTRYP PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location);
+typedef GLintptr (APIENTRYP PFNGLGETUNIFORMOFFSETEXTPROC) (GLuint program, GLint location);
+#endif
+
+#ifndef GL_EXT_texture_integer
+#define GL_EXT_texture_integer 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexParameterIivEXT (GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glTexParameterIuivEXT (GLenum target, GLenum pname, const GLuint *params);
+GLAPI void APIENTRY glGetTexParameterIivEXT (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetTexParameterIuivEXT (GLenum target, GLenum pname, GLuint *params);
+GLAPI void APIENTRY glClearColorIiEXT (GLint red, GLint green, GLint blue, GLint alpha);
+GLAPI void APIENTRY glClearColorIuiEXT (GLuint red, GLuint green, GLuint blue, GLuint alpha);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params);
+typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params);
+typedef void (APIENTRYP PFNGLCLEARCOLORIIEXTPROC) (GLint red, GLint green, GLint blue, GLint alpha);
+typedef void (APIENTRYP PFNGLCLEARCOLORIUIEXTPROC) (GLuint red, GLuint green, GLuint blue, GLuint alpha);
+#endif
+
+#ifndef GL_GREMEDY_frame_terminator
+#define GL_GREMEDY_frame_terminator 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFrameTerminatorGREMEDY (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFRAMETERMINATORGREMEDYPROC) (void);
+#endif
+
+#ifndef GL_NV_conditional_render
+#define GL_NV_conditional_render 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBeginConditionalRenderNV (GLuint id, GLenum mode);
+GLAPI void APIENTRY glEndConditionalRenderNV (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode);
+typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERNVPROC) (void);
+#endif
+
+#ifndef GL_NV_present_video
+#define GL_NV_present_video 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPresentFrameKeyedNV (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1);
+GLAPI void APIENTRY glPresentFrameDualFillNV (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3);
+GLAPI void APIENTRY glGetVideoivNV (GLuint video_slot, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetVideouivNV (GLuint video_slot, GLenum pname, GLuint *params);
+GLAPI void APIENTRY glGetVideoi64vNV (GLuint video_slot, GLenum pname, GLint64EXT *params);
+GLAPI void APIENTRY glGetVideoui64vNV (GLuint video_slot, GLenum pname, GLuint64EXT *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPRESENTFRAMEKEYEDNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1);
+typedef void (APIENTRYP PFNGLPRESENTFRAMEDUALFILLNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3);
+typedef void (APIENTRYP PFNGLGETVIDEOIVNVPROC) (GLuint video_slot, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVIDEOUIVNVPROC) (GLuint video_slot, GLenum pname, GLuint *params);
+typedef void (APIENTRYP PFNGLGETVIDEOI64VNVPROC) (GLuint video_slot, GLenum pname, GLint64EXT *params);
+typedef void (APIENTRYP PFNGLGETVIDEOUI64VNVPROC) (GLuint video_slot, GLenum pname, GLuint64EXT *params);
+#endif
+
+#ifndef GL_EXT_transform_feedback
+#define GL_EXT_transform_feedback 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBeginTransformFeedbackEXT (GLenum primitiveMode);
+GLAPI void APIENTRY glEndTransformFeedbackEXT (void);
+GLAPI void APIENTRY glBindBufferRangeEXT (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+GLAPI void APIENTRY glBindBufferOffsetEXT (GLenum target, GLuint index, GLuint buffer, GLintptr offset);
+GLAPI void APIENTRY glBindBufferBaseEXT (GLenum target, GLuint index, GLuint buffer);
+GLAPI void APIENTRY glTransformFeedbackVaryingsEXT (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode);
+GLAPI void APIENTRY glGetTransformFeedbackVaryingEXT (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKEXTPROC) (GLenum primitiveMode);
+typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKEXTPROC) (void);
+typedef void (APIENTRYP PFNGLBINDBUFFERRANGEEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset);
+typedef void (APIENTRYP PFNGLBINDBUFFERBASEEXTPROC) (GLenum target, GLuint index, GLuint buffer);
+typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode);
+typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
+#endif
+
+#ifndef GL_EXT_direct_state_access
+#define GL_EXT_direct_state_access 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glClientAttribDefaultEXT (GLbitfield mask);
+GLAPI void APIENTRY glPushClientAttribDefaultEXT (GLbitfield mask);
+GLAPI void APIENTRY glMatrixLoadfEXT (GLenum mode, const GLfloat *m);
+GLAPI void APIENTRY glMatrixLoaddEXT (GLenum mode, const GLdouble *m);
+GLAPI void APIENTRY glMatrixMultfEXT (GLenum mode, const GLfloat *m);
+GLAPI void APIENTRY glMatrixMultdEXT (GLenum mode, const GLdouble *m);
+GLAPI void APIENTRY glMatrixLoadIdentityEXT (GLenum mode);
+GLAPI void APIENTRY glMatrixRotatefEXT (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glMatrixRotatedEXT (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glMatrixScalefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glMatrixScaledEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glMatrixTranslatefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glMatrixTranslatedEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glMatrixFrustumEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
+GLAPI void APIENTRY glMatrixOrthoEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
+GLAPI void APIENTRY glMatrixPopEXT (GLenum mode);
+GLAPI void APIENTRY glMatrixPushEXT (GLenum mode);
+GLAPI void APIENTRY glMatrixLoadTransposefEXT (GLenum mode, const GLfloat *m);
+GLAPI void APIENTRY glMatrixLoadTransposedEXT (GLenum mode, const GLdouble *m);
+GLAPI void APIENTRY glMatrixMultTransposefEXT (GLenum mode, const GLfloat *m);
+GLAPI void APIENTRY glMatrixMultTransposedEXT (GLenum mode, const GLdouble *m);
+GLAPI void APIENTRY glTextureParameterfEXT (GLuint texture, GLenum target, GLenum pname, GLfloat param);
+GLAPI void APIENTRY glTextureParameterfvEXT (GLuint texture, GLenum target, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glTextureParameteriEXT (GLuint texture, GLenum target, GLenum pname, GLint param);
+GLAPI void APIENTRY glTextureParameterivEXT (GLuint texture, GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glCopyTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
+GLAPI void APIENTRY glCopyTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+GLAPI void APIENTRY glCopyTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
+GLAPI void APIENTRY glCopyTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glGetTextureImageEXT (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
+GLAPI void APIENTRY glGetTextureParameterfvEXT (GLuint texture, GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetTextureParameterivEXT (GLuint texture, GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetTextureLevelParameterfvEXT (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetTextureLevelParameterivEXT (GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params);
+GLAPI void APIENTRY glTextureImage3DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glCopyTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glMultiTexParameterfEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat param);
+GLAPI void APIENTRY glMultiTexParameterfvEXT (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glMultiTexParameteriEXT (GLenum texunit, GLenum target, GLenum pname, GLint param);
+GLAPI void APIENTRY glMultiTexParameterivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glCopyMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
+GLAPI void APIENTRY glCopyMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+GLAPI void APIENTRY glCopyMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
+GLAPI void APIENTRY glCopyMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glGetMultiTexImageEXT (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
+GLAPI void APIENTRY glGetMultiTexParameterfvEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetMultiTexParameterivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetMultiTexLevelParameterfvEXT (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetMultiTexLevelParameterivEXT (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params);
+GLAPI void APIENTRY glMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glCopyMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glBindMultiTextureEXT (GLenum texunit, GLenum target, GLuint texture);
+GLAPI void APIENTRY glEnableClientStateIndexedEXT (GLenum array, GLuint index);
+GLAPI void APIENTRY glDisableClientStateIndexedEXT (GLenum array, GLuint index);
+GLAPI void APIENTRY glMultiTexCoordPointerEXT (GLenum texunit, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY glMultiTexEnvfEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat param);
+GLAPI void APIENTRY glMultiTexEnvfvEXT (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glMultiTexEnviEXT (GLenum texunit, GLenum target, GLenum pname, GLint param);
+GLAPI void APIENTRY glMultiTexEnvivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glMultiTexGendEXT (GLenum texunit, GLenum coord, GLenum pname, GLdouble param);
+GLAPI void APIENTRY glMultiTexGendvEXT (GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params);
+GLAPI void APIENTRY glMultiTexGenfEXT (GLenum texunit, GLenum coord, GLenum pname, GLfloat param);
+GLAPI void APIENTRY glMultiTexGenfvEXT (GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glMultiTexGeniEXT (GLenum texunit, GLenum coord, GLenum pname, GLint param);
+GLAPI void APIENTRY glMultiTexGenivEXT (GLenum texunit, GLenum coord, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glGetMultiTexEnvfvEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetMultiTexEnvivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetMultiTexGendvEXT (GLenum texunit, GLenum coord, GLenum pname, GLdouble *params);
+GLAPI void APIENTRY glGetMultiTexGenfvEXT (GLenum texunit, GLenum coord, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetMultiTexGenivEXT (GLenum texunit, GLenum coord, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetFloatIndexedvEXT (GLenum target, GLuint index, GLfloat *data);
+GLAPI void APIENTRY glGetDoubleIndexedvEXT (GLenum target, GLuint index, GLdouble *data);
+GLAPI void APIENTRY glGetPointerIndexedvEXT (GLenum target, GLuint index, GLvoid* *data);
+GLAPI void APIENTRY glCompressedTextureImage3DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits);
+GLAPI void APIENTRY glCompressedTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits);
+GLAPI void APIENTRY glCompressedTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits);
+GLAPI void APIENTRY glCompressedTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits);
+GLAPI void APIENTRY glCompressedTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits);
+GLAPI void APIENTRY glCompressedTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits);
+GLAPI void APIENTRY glGetCompressedTextureImageEXT (GLuint texture, GLenum target, GLint lod, GLvoid *img);
+GLAPI void APIENTRY glCompressedMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits);
+GLAPI void APIENTRY glCompressedMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits);
+GLAPI void APIENTRY glCompressedMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits);
+GLAPI void APIENTRY glCompressedMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits);
+GLAPI void APIENTRY glCompressedMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits);
+GLAPI void APIENTRY glCompressedMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits);
+GLAPI void APIENTRY glGetCompressedMultiTexImageEXT (GLenum texunit, GLenum target, GLint lod, GLvoid *img);
+GLAPI void APIENTRY glNamedProgramStringEXT (GLuint program, GLenum target, GLenum format, GLsizei len, const GLvoid *string);
+GLAPI void APIENTRY glNamedProgramLocalParameter4dEXT (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glNamedProgramLocalParameter4dvEXT (GLuint program, GLenum target, GLuint index, const GLdouble *params);
+GLAPI void APIENTRY glNamedProgramLocalParameter4fEXT (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY glNamedProgramLocalParameter4fvEXT (GLuint program, GLenum target, GLuint index, const GLfloat *params);
+GLAPI void APIENTRY glGetNamedProgramLocalParameterdvEXT (GLuint program, GLenum target, GLuint index, GLdouble *params);
+GLAPI void APIENTRY glGetNamedProgramLocalParameterfvEXT (GLuint program, GLenum target, GLuint index, GLfloat *params);
+GLAPI void APIENTRY glGetNamedProgramivEXT (GLuint program, GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetNamedProgramStringEXT (GLuint program, GLenum target, GLenum pname, GLvoid *string);
+GLAPI void APIENTRY glNamedProgramLocalParameters4fvEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat *params);
+GLAPI void APIENTRY glNamedProgramLocalParameterI4iEXT (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
+GLAPI void APIENTRY glNamedProgramLocalParameterI4ivEXT (GLuint program, GLenum target, GLuint index, const GLint *params);
+GLAPI void APIENTRY glNamedProgramLocalParametersI4ivEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint *params);
+GLAPI void APIENTRY glNamedProgramLocalParameterI4uiEXT (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+GLAPI void APIENTRY glNamedProgramLocalParameterI4uivEXT (GLuint program, GLenum target, GLuint index, const GLuint *params);
+GLAPI void APIENTRY glNamedProgramLocalParametersI4uivEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint *params);
+GLAPI void APIENTRY glGetNamedProgramLocalParameterIivEXT (GLuint program, GLenum target, GLuint index, GLint *params);
+GLAPI void APIENTRY glGetNamedProgramLocalParameterIuivEXT (GLuint program, GLenum target, GLuint index, GLuint *params);
+GLAPI void APIENTRY glTextureParameterIivEXT (GLuint texture, GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glTextureParameterIuivEXT (GLuint texture, GLenum target, GLenum pname, const GLuint *params);
+GLAPI void APIENTRY glGetTextureParameterIivEXT (GLuint texture, GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetTextureParameterIuivEXT (GLuint texture, GLenum target, GLenum pname, GLuint *params);
+GLAPI void APIENTRY glMultiTexParameterIivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glMultiTexParameterIuivEXT (GLenum texunit, GLenum target, GLenum pname, const GLuint *params);
+GLAPI void APIENTRY glGetMultiTexParameterIivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetMultiTexParameterIuivEXT (GLenum texunit, GLenum target, GLenum pname, GLuint *params);
+GLAPI void APIENTRY glProgramUniform1fEXT (GLuint program, GLint location, GLfloat v0);
+GLAPI void APIENTRY glProgramUniform2fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1);
+GLAPI void APIENTRY glProgramUniform3fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+GLAPI void APIENTRY glProgramUniform4fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+GLAPI void APIENTRY glProgramUniform1iEXT (GLuint program, GLint location, GLint v0);
+GLAPI void APIENTRY glProgramUniform2iEXT (GLuint program, GLint location, GLint v0, GLint v1);
+GLAPI void APIENTRY glProgramUniform3iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
+GLAPI void APIENTRY glProgramUniform4iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+GLAPI void APIENTRY glProgramUniform1fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniform2fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniform3fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniform4fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniform1ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glProgramUniform2ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glProgramUniform3ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glProgramUniform4ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glProgramUniformMatrix2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix2x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix3x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix2x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix4x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix3x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix4x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniform1uiEXT (GLuint program, GLint location, GLuint v0);
+GLAPI void APIENTRY glProgramUniform2uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1);
+GLAPI void APIENTRY glProgramUniform3uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
+GLAPI void APIENTRY glProgramUniform4uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+GLAPI void APIENTRY glProgramUniform1uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glProgramUniform2uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glProgramUniform3uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glProgramUniform4uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glNamedBufferDataEXT (GLuint buffer, GLsizeiptr size, const GLvoid *data, GLenum usage);
+GLAPI void APIENTRY glNamedBufferSubDataEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid *data);
+GLAPI GLvoid* APIENTRY glMapNamedBufferEXT (GLuint buffer, GLenum access);
+GLAPI GLboolean APIENTRY glUnmapNamedBufferEXT (GLuint buffer);
+GLAPI GLvoid* APIENTRY glMapNamedBufferRangeEXT (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access);
+GLAPI void APIENTRY glFlushMappedNamedBufferRangeEXT (GLuint buffer, GLintptr offset, GLsizeiptr length);
+GLAPI void APIENTRY glNamedCopyBufferSubDataEXT (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
+GLAPI void APIENTRY glGetNamedBufferParameterivEXT (GLuint buffer, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetNamedBufferPointervEXT (GLuint buffer, GLenum pname, GLvoid* *params);
+GLAPI void APIENTRY glGetNamedBufferSubDataEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, GLvoid *data);
+GLAPI void APIENTRY glTextureBufferEXT (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer);
+GLAPI void APIENTRY glMultiTexBufferEXT (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer);
+GLAPI void APIENTRY glNamedRenderbufferStorageEXT (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glGetNamedRenderbufferParameterivEXT (GLuint renderbuffer, GLenum pname, GLint *params);
+GLAPI GLenum APIENTRY glCheckNamedFramebufferStatusEXT (GLuint framebuffer, GLenum target);
+GLAPI void APIENTRY glNamedFramebufferTexture1DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GLAPI void APIENTRY glNamedFramebufferTexture2DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GLAPI void APIENTRY glNamedFramebufferTexture3DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+GLAPI void APIENTRY glNamedFramebufferRenderbufferEXT (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+GLAPI void APIENTRY glGetNamedFramebufferAttachmentParameterivEXT (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGenerateTextureMipmapEXT (GLuint texture, GLenum target);
+GLAPI void APIENTRY glGenerateMultiTexMipmapEXT (GLenum texunit, GLenum target);
+GLAPI void APIENTRY glFramebufferDrawBufferEXT (GLuint framebuffer, GLenum mode);
+GLAPI void APIENTRY glFramebufferDrawBuffersEXT (GLuint framebuffer, GLsizei n, const GLenum *bufs);
+GLAPI void APIENTRY glFramebufferReadBufferEXT (GLuint framebuffer, GLenum mode);
+GLAPI void APIENTRY glGetFramebufferParameterivEXT (GLuint framebuffer, GLenum pname, GLint *params);
+GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleEXT (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleCoverageEXT (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glNamedFramebufferTextureEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level);
+GLAPI void APIENTRY glNamedFramebufferTextureLayerEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer);
+GLAPI void APIENTRY glNamedFramebufferTextureFaceEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face);
+GLAPI void APIENTRY glTextureRenderbufferEXT (GLuint texture, GLenum target, GLuint renderbuffer);
+GLAPI void APIENTRY glMultiTexRenderbufferEXT (GLenum texunit, GLenum target, GLuint renderbuffer);
+GLAPI void APIENTRY glProgramUniform1dEXT (GLuint program, GLint location, GLdouble x);
+GLAPI void APIENTRY glProgramUniform2dEXT (GLuint program, GLint location, GLdouble x, GLdouble y);
+GLAPI void APIENTRY glProgramUniform3dEXT (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glProgramUniform4dEXT (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glProgramUniform1dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniform2dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniform3dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniform4dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix2x3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix2x4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix3x2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix3x4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix4x2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix4x3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask);
+typedef void (APIENTRYP PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask);
+typedef void (APIENTRYP PFNGLMATRIXLOADFEXTPROC) (GLenum mode, const GLfloat *m);
+typedef void (APIENTRYP PFNGLMATRIXLOADDEXTPROC) (GLenum mode, const GLdouble *m);
+typedef void (APIENTRYP PFNGLMATRIXMULTFEXTPROC) (GLenum mode, const GLfloat *m);
+typedef void (APIENTRYP PFNGLMATRIXMULTDEXTPROC) (GLenum mode, const GLdouble *m);
+typedef void (APIENTRYP PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum mode);
+typedef void (APIENTRYP PFNGLMATRIXROTATEFEXTPROC) (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLMATRIXROTATEDEXTPROC) (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLMATRIXSCALEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLMATRIXSCALEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLMATRIXFRUSTUMEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
+typedef void (APIENTRYP PFNGLMATRIXORTHOEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
+typedef void (APIENTRYP PFNGLMATRIXPOPEXTPROC) (GLenum mode);
+typedef void (APIENTRYP PFNGLMATRIXPUSHEXTPROC) (GLenum mode);
+typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m);
+typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m);
+typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m);
+typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m);
+typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
+typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLGETTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
+typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
+typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLGETMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
+typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLBINDMULTITEXTUREEXTPROC) (GLenum texunit, GLenum target, GLuint texture);
+typedef void (APIENTRYP PFNGLENABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index);
+typedef void (APIENTRYP PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index);
+typedef void (APIENTRYP PFNGLMULTITEXCOORDPOINTEREXTPROC) (GLenum texunit, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLMULTITEXENVFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLMULTITEXENVIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLMULTITEXGENDEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble param);
+typedef void (APIENTRYP PFNGLMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params);
+typedef void (APIENTRYP PFNGLMULTITEXGENFEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLMULTITEXGENIEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLGETMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETFLOATINDEXEDVEXTPROC) (GLenum target, GLuint index, GLfloat *data);
+typedef void (APIENTRYP PFNGLGETDOUBLEINDEXEDVEXTPROC) (GLenum target, GLuint index, GLdouble *data);
+typedef void (APIENTRYP PFNGLGETPOINTERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLvoid* *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits);
+typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint lod, GLvoid *img);
+typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits);
+typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits);
+typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits);
+typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits);
+typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits);
+typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits);
+typedef void (APIENTRYP PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint lod, GLvoid *img);
+typedef void (APIENTRYP PFNGLNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum format, GLsizei len, const GLvoid *string);
+typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLdouble *params);
+typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMIVEXTPROC) (GLuint program, GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum pname, GLvoid *string);
+typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat *params);
+typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC) (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
+typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLint *params);
+typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint *params);
+typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLuint *params);
+typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint *params);
+typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLint *params);
+typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint *params);
+typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLuint *params);
+typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLuint *params);
+typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLuint *params);
+typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLuint *params);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLsizeiptr size, const GLvoid *data, GLenum usage);
+typedef void (APIENTRYP PFNGLNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid *data);
+typedef GLvoid* (APIENTRYP PFNGLMAPNAMEDBUFFEREXTPROC) (GLuint buffer, GLenum access);
+typedef GLboolean (APIENTRYP PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer);
+typedef GLvoid* (APIENTRYP PFNGLMAPNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access);
+typedef void (APIENTRYP PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length);
+typedef void (APIENTRYP PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
+typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC) (GLuint buffer, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPOINTERVEXTPROC) (GLuint buffer, GLenum pname, GLvoid* *params);
+typedef void (APIENTRYP PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLvoid *data);
+typedef void (APIENTRYP PFNGLTEXTUREBUFFEREXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer);
+typedef void (APIENTRYP PFNGLMULTITEXBUFFEREXTPROC) (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer);
+typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC) (GLuint renderbuffer, GLenum pname, GLint *params);
+typedef GLenum (APIENTRYP PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC) (GLuint framebuffer, GLenum target);
+typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGENERATETEXTUREMIPMAPEXTPROC) (GLuint texture, GLenum target);
+typedef void (APIENTRYP PFNGLGENERATEMULTITEXMIPMAPEXTPROC) (GLenum texunit, GLenum target);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC) (GLuint framebuffer, GLenum mode);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC) (GLuint framebuffer, GLsizei n, const GLenum *bufs);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERREADBUFFEREXTPROC) (GLuint framebuffer, GLenum mode);
+typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC) (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer);
+typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face);
+typedef void (APIENTRYP PFNGLTEXTURERENDERBUFFEREXTPROC) (GLuint texture, GLenum target, GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLMULTITEXRENDERBUFFEREXTPROC) (GLenum texunit, GLenum target, GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DEXTPROC) (GLuint program, GLint location, GLdouble x);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+#endif
+
+#ifndef GL_EXT_vertex_array_bgra
+#define GL_EXT_vertex_array_bgra 1
+#endif
+
+#ifndef GL_EXT_texture_swizzle
+#define GL_EXT_texture_swizzle 1
+#endif
+
+#ifndef GL_NV_explicit_multisample
+#define GL_NV_explicit_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetMultisamplefvNV (GLenum pname, GLuint index, GLfloat *val);
+GLAPI void APIENTRY glSampleMaskIndexedNV (GLuint index, GLbitfield mask);
+GLAPI void APIENTRY glTexRenderbufferNV (GLenum target, GLuint renderbuffer);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVNVPROC) (GLenum pname, GLuint index, GLfloat *val);
+typedef void (APIENTRYP PFNGLSAMPLEMASKINDEXEDNVPROC) (GLuint index, GLbitfield mask);
+typedef void (APIENTRYP PFNGLTEXRENDERBUFFERNVPROC) (GLenum target, GLuint renderbuffer);
+#endif
+
+#ifndef GL_NV_transform_feedback2
+#define GL_NV_transform_feedback2 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBindTransformFeedbackNV (GLenum target, GLuint id);
+GLAPI void APIENTRY glDeleteTransformFeedbacksNV (GLsizei n, const GLuint *ids);
+GLAPI void APIENTRY glGenTransformFeedbacksNV (GLsizei n, GLuint *ids);
+GLAPI GLboolean APIENTRY glIsTransformFeedbackNV (GLuint id);
+GLAPI void APIENTRY glPauseTransformFeedbackNV (void);
+GLAPI void APIENTRY glResumeTransformFeedbackNV (void);
+GLAPI void APIENTRY glDrawTransformFeedbackNV (GLenum mode, GLuint id);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKNVPROC) (GLenum target, GLuint id);
+typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSNVPROC) (GLsizei n, const GLuint *ids);
+typedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSNVPROC) (GLsizei n, GLuint *ids);
+typedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKNVPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKNVPROC) (void);
+typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKNVPROC) (void);
+typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKNVPROC) (GLenum mode, GLuint id);
+#endif
+
+#ifndef GL_ATI_meminfo
+#define GL_ATI_meminfo 1
+#endif
+
+#ifndef GL_AMD_performance_monitor
+#define GL_AMD_performance_monitor 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetPerfMonitorGroupsAMD (GLint *numGroups, GLsizei groupsSize, GLuint *groups);
+GLAPI void APIENTRY glGetPerfMonitorCountersAMD (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters);
+GLAPI void APIENTRY glGetPerfMonitorGroupStringAMD (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString);
+GLAPI void APIENTRY glGetPerfMonitorCounterStringAMD (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString);
+GLAPI void APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint group, GLuint counter, GLenum pname, GLvoid *data);
+GLAPI void APIENTRY glGenPerfMonitorsAMD (GLsizei n, GLuint *monitors);
+GLAPI void APIENTRY glDeletePerfMonitorsAMD (GLsizei n, GLuint *monitors);
+GLAPI void APIENTRY glSelectPerfMonitorCountersAMD (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList);
+GLAPI void APIENTRY glBeginPerfMonitorAMD (GLuint monitor);
+GLAPI void APIENTRY glEndPerfMonitorAMD (GLuint monitor);
+GLAPI void APIENTRY glGetPerfMonitorCounterDataAMD (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups);
+typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters);
+typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString);
+typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString);
+typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, GLvoid *data);
+typedef void (APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors);
+typedef void (APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors);
+typedef void (APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList);
+typedef void (APIENTRYP PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor);
+typedef void (APIENTRYP PFNGLENDPERFMONITORAMDPROC) (GLuint monitor);
+typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten);
+#endif
+
+#ifndef GL_AMD_texture_texture4
+#define GL_AMD_texture_texture4 1
+#endif
+
+#ifndef GL_AMD_vertex_shader_tesselator
+#define GL_AMD_vertex_shader_tesselator 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTessellationFactorAMD (GLfloat factor);
+GLAPI void APIENTRY glTessellationModeAMD (GLenum mode);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTESSELLATIONFACTORAMDPROC) (GLfloat factor);
+typedef void (APIENTRYP PFNGLTESSELLATIONMODEAMDPROC) (GLenum mode);
+#endif
+
+#ifndef GL_EXT_provoking_vertex
+#define GL_EXT_provoking_vertex 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glProvokingVertexEXT (GLenum mode);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPROVOKINGVERTEXEXTPROC) (GLenum mode);
+#endif
+
+#ifndef GL_EXT_texture_snorm
+#define GL_EXT_texture_snorm 1
+#endif
+
+#ifndef GL_AMD_draw_buffers_blend
+#define GL_AMD_draw_buffers_blend 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendFuncIndexedAMD (GLuint buf, GLenum src, GLenum dst);
+GLAPI void APIENTRY glBlendFuncSeparateIndexedAMD (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+GLAPI void APIENTRY glBlendEquationIndexedAMD (GLuint buf, GLenum mode);
+GLAPI void APIENTRY glBlendEquationSeparateIndexedAMD (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDFUNCINDEXEDAMDPROC) (GLuint buf, GLenum src, GLenum dst);
+typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+typedef void (APIENTRYP PFNGLBLENDEQUATIONINDEXEDAMDPROC) (GLuint buf, GLenum mode);
+typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
+#endif
+
+#ifndef GL_APPLE_texture_range
+#define GL_APPLE_texture_range 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTextureRangeAPPLE (GLenum target, GLsizei length, const GLvoid *pointer);
+GLAPI void APIENTRY glGetTexParameterPointervAPPLE (GLenum target, GLenum pname, GLvoid* *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXTURERANGEAPPLEPROC) (GLenum target, GLsizei length, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC) (GLenum target, GLenum pname, GLvoid* *params);
+#endif
+
+#ifndef GL_APPLE_float_pixels
+#define GL_APPLE_float_pixels 1
+#endif
+
+#ifndef GL_APPLE_vertex_program_evaluators
+#define GL_APPLE_vertex_program_evaluators 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glEnableVertexAttribAPPLE (GLuint index, GLenum pname);
+GLAPI void APIENTRY glDisableVertexAttribAPPLE (GLuint index, GLenum pname);
+GLAPI GLboolean APIENTRY glIsVertexAttribEnabledAPPLE (GLuint index, GLenum pname);
+GLAPI void APIENTRY glMapVertexAttrib1dAPPLE (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points);
+GLAPI void APIENTRY glMapVertexAttrib1fAPPLE (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points);
+GLAPI void APIENTRY glMapVertexAttrib2dAPPLE (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points);
+GLAPI void APIENTRY glMapVertexAttrib2fAPPLE (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname);
+typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname);
+typedef GLboolean (APIENTRYP PFNGLISVERTEXATTRIBENABLEDAPPLEPROC) (GLuint index, GLenum pname);
+typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB1DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points);
+typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB1FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points);
+typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB2DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points);
+typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB2FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points);
+#endif
+
+#ifndef GL_APPLE_aux_depth_stencil
+#define GL_APPLE_aux_depth_stencil 1
+#endif
+
+#ifndef GL_APPLE_object_purgeable
+#define GL_APPLE_object_purgeable 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLenum APIENTRY glObjectPurgeableAPPLE (GLenum objectType, GLuint name, GLenum option);
+GLAPI GLenum APIENTRY glObjectUnpurgeableAPPLE (GLenum objectType, GLuint name, GLenum option);
+GLAPI void APIENTRY glGetObjectParameterivAPPLE (GLenum objectType, GLuint name, GLenum pname, GLint *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLenum (APIENTRYP PFNGLOBJECTPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option);
+typedef GLenum (APIENTRYP PFNGLOBJECTUNPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option);
+typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVAPPLEPROC) (GLenum objectType, GLuint name, GLenum pname, GLint *params);
+#endif
+
+#ifndef GL_APPLE_row_bytes
+#define GL_APPLE_row_bytes 1
+#endif
+
+#ifndef GL_APPLE_rgb_422
+#define GL_APPLE_rgb_422 1
+#endif
+
+#ifndef GL_NV_video_capture
+#define GL_NV_video_capture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBeginVideoCaptureNV (GLuint video_capture_slot);
+GLAPI void APIENTRY glBindVideoCaptureStreamBufferNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset);
+GLAPI void APIENTRY glBindVideoCaptureStreamTextureNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture);
+GLAPI void APIENTRY glEndVideoCaptureNV (GLuint video_capture_slot);
+GLAPI void APIENTRY glGetVideoCaptureivNV (GLuint video_capture_slot, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetVideoCaptureStreamivNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetVideoCaptureStreamfvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetVideoCaptureStreamdvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble *params);
+GLAPI GLenum APIENTRY glVideoCaptureNV (GLuint video_capture_slot, GLuint *sequence_num, GLuint64EXT *capture_time);
+GLAPI void APIENTRY glVideoCaptureStreamParameterivNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glVideoCaptureStreamParameterfvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glVideoCaptureStreamParameterdvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBEGINVIDEOCAPTURENVPROC) (GLuint video_capture_slot);
+typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset);
+typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture);
+typedef void (APIENTRYP PFNGLENDVIDEOCAPTURENVPROC) (GLuint video_capture_slot);
+typedef void (APIENTRYP PFNGLGETVIDEOCAPTUREIVNVPROC) (GLuint video_capture_slot, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble *params);
+typedef GLenum (APIENTRYP PFNGLVIDEOCAPTURENVPROC) (GLuint video_capture_slot, GLuint *sequence_num, GLuint64EXT *capture_time);
+typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble *params);
+#endif
+
+#ifndef GL_NV_copy_image
+#define GL_NV_copy_image 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCopyImageSubDataNV (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOPYIMAGESUBDATANVPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
+#endif
+
+#ifndef GL_EXT_separate_shader_objects
+#define GL_EXT_separate_shader_objects 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glUseShaderProgramEXT (GLenum type, GLuint program);
+GLAPI void APIENTRY glActiveProgramEXT (GLuint program);
+GLAPI GLuint APIENTRY glCreateShaderProgramEXT (GLenum type, const GLchar *string);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLUSESHADERPROGRAMEXTPROC) (GLenum type, GLuint program);
+typedef void (APIENTRYP PFNGLACTIVEPROGRAMEXTPROC) (GLuint program);
+typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMEXTPROC) (GLenum type, const GLchar *string);
+#endif
+
+#ifndef GL_NV_parameter_buffer_object2
+#define GL_NV_parameter_buffer_object2 1
+#endif
+
+#ifndef GL_NV_shader_buffer_load
+#define GL_NV_shader_buffer_load 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glMakeBufferResidentNV (GLenum target, GLenum access);
+GLAPI void APIENTRY glMakeBufferNonResidentNV (GLenum target);
+GLAPI GLboolean APIENTRY glIsBufferResidentNV (GLenum target);
+GLAPI void APIENTRY glMakeNamedBufferResidentNV (GLuint buffer, GLenum access);
+GLAPI void APIENTRY glMakeNamedBufferNonResidentNV (GLuint buffer);
+GLAPI GLboolean APIENTRY glIsNamedBufferResidentNV (GLuint buffer);
+GLAPI void APIENTRY glGetBufferParameterui64vNV (GLenum target, GLenum pname, GLuint64EXT *params);
+GLAPI void APIENTRY glGetNamedBufferParameterui64vNV (GLuint buffer, GLenum pname, GLuint64EXT *params);
+GLAPI void APIENTRY glGetIntegerui64vNV (GLenum value, GLuint64EXT *result);
+GLAPI void APIENTRY glUniformui64NV (GLint location, GLuint64EXT value);
+GLAPI void APIENTRY glUniformui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
+GLAPI void APIENTRY glGetUniformui64vNV (GLuint program, GLint location, GLuint64EXT *params);
+GLAPI void APIENTRY glProgramUniformui64NV (GLuint program, GLint location, GLuint64EXT value);
+GLAPI void APIENTRY glProgramUniformui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLMAKEBUFFERRESIDENTNVPROC) (GLenum target, GLenum access);
+typedef void (APIENTRYP PFNGLMAKEBUFFERNONRESIDENTNVPROC) (GLenum target);
+typedef GLboolean (APIENTRYP PFNGLISBUFFERRESIDENTNVPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLMAKENAMEDBUFFERRESIDENTNVPROC) (GLuint buffer, GLenum access);
+typedef void (APIENTRYP PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC) (GLuint buffer);
+typedef GLboolean (APIENTRYP PFNGLISNAMEDBUFFERRESIDENTNVPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERUI64VNVPROC) (GLenum target, GLenum pname, GLuint64EXT *params);
+typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC) (GLuint buffer, GLenum pname, GLuint64EXT *params);
+typedef void (APIENTRYP PFNGLGETINTEGERUI64VNVPROC) (GLenum value, GLuint64EXT *result);
+typedef void (APIENTRYP PFNGLUNIFORMUI64NVPROC) (GLint location, GLuint64EXT value);
+typedef void (APIENTRYP PFNGLUNIFORMUI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
+typedef void (APIENTRYP PFNGLGETUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLuint64EXT *params);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64NVPROC) (GLuint program, GLint location, GLuint64EXT value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
+#endif
+
+#ifndef GL_NV_vertex_buffer_unified_memory
+#define GL_NV_vertex_buffer_unified_memory 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBufferAddressRangeNV (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length);
+GLAPI void APIENTRY glVertexFormatNV (GLint size, GLenum type, GLsizei stride);
+GLAPI void APIENTRY glNormalFormatNV (GLenum type, GLsizei stride);
+GLAPI void APIENTRY glColorFormatNV (GLint size, GLenum type, GLsizei stride);
+GLAPI void APIENTRY glIndexFormatNV (GLenum type, GLsizei stride);
+GLAPI void APIENTRY glTexCoordFormatNV (GLint size, GLenum type, GLsizei stride);
+GLAPI void APIENTRY glEdgeFlagFormatNV (GLsizei stride);
+GLAPI void APIENTRY glSecondaryColorFormatNV (GLint size, GLenum type, GLsizei stride);
+GLAPI void APIENTRY glFogCoordFormatNV (GLenum type, GLsizei stride);
+GLAPI void APIENTRY glVertexAttribFormatNV (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride);
+GLAPI void APIENTRY glVertexAttribIFormatNV (GLuint index, GLint size, GLenum type, GLsizei stride);
+GLAPI void APIENTRY glGetIntegerui64i_vNV (GLenum value, GLuint index, GLuint64EXT *result);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBUFFERADDRESSRANGENVPROC) (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length);
+typedef void (APIENTRYP PFNGLVERTEXFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);
+typedef void (APIENTRYP PFNGLNORMALFORMATNVPROC) (GLenum type, GLsizei stride);
+typedef void (APIENTRYP PFNGLCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);
+typedef void (APIENTRYP PFNGLINDEXFORMATNVPROC) (GLenum type, GLsizei stride);
+typedef void (APIENTRYP PFNGLTEXCOORDFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);
+typedef void (APIENTRYP PFNGLEDGEFLAGFORMATNVPROC) (GLsizei stride);
+typedef void (APIENTRYP PFNGLSECONDARYCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);
+typedef void (APIENTRYP PFNGLFOGCOORDFORMATNVPROC) (GLenum type, GLsizei stride);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBIFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride);
+typedef void (APIENTRYP PFNGLGETINTEGERUI64I_VNVPROC) (GLenum value, GLuint index, GLuint64EXT *result);
+#endif
+
+#ifndef GL_NV_texture_barrier
+#define GL_NV_texture_barrier 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTextureBarrierNV (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXTUREBARRIERNVPROC) (void);
+#endif
+
+#ifndef GL_AMD_shader_stencil_export
+#define GL_AMD_shader_stencil_export 1
+#endif
+
+#ifndef GL_AMD_seamless_cubemap_per_texture
+#define GL_AMD_seamless_cubemap_per_texture 1
+#endif
+
+#ifndef GL_AMD_conservative_depth
+#define GL_AMD_conservative_depth 1
+#endif
+
+#ifndef GL_EXT_shader_image_load_store
+#define GL_EXT_shader_image_load_store 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBindImageTextureEXT (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format);
+GLAPI void APIENTRY glMemoryBarrierEXT (GLbitfield barriers);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBINDIMAGETEXTUREEXTPROC) (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format);
+typedef void (APIENTRYP PFNGLMEMORYBARRIEREXTPROC) (GLbitfield barriers);
+#endif
+
+#ifndef GL_EXT_vertex_attrib_64bit
+#define GL_EXT_vertex_attrib_64bit 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexAttribL1dEXT (GLuint index, GLdouble x);
+GLAPI void APIENTRY glVertexAttribL2dEXT (GLuint index, GLdouble x, GLdouble y);
+GLAPI void APIENTRY glVertexAttribL3dEXT (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glVertexAttribL4dEXT (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glVertexAttribL1dvEXT (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribL2dvEXT (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribL3dvEXT (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribL4dvEXT (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribLPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY glGetVertexAttribLdvEXT (GLuint index, GLenum pname, GLdouble *params);
+GLAPI void APIENTRY glVertexArrayVertexAttribLOffsetEXT (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DEXTPROC) (GLuint index, GLdouble x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DEXTPROC) (GLuint index, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DVEXTPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DVEXTPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DVEXTPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DVEXTPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLDVEXTPROC) (GLuint index, GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset);
+#endif
+
+#ifndef GL_NV_gpu_program5
+#define GL_NV_gpu_program5 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glProgramSubroutineParametersuivNV (GLenum target, GLsizei count, const GLuint *params);
+GLAPI void APIENTRY glGetProgramSubroutineParameteruivNV (GLenum target, GLuint index, GLuint *param);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPROGRAMSUBROUTINEPARAMETERSUIVNVPROC) (GLenum target, GLsizei count, const GLuint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMSUBROUTINEPARAMETERUIVNVPROC) (GLenum target, GLuint index, GLuint *param);
+#endif
+
+#ifndef GL_NV_gpu_shader5
+#define GL_NV_gpu_shader5 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glUniform1i64NV (GLint location, GLint64EXT x);
+GLAPI void APIENTRY glUniform2i64NV (GLint location, GLint64EXT x, GLint64EXT y);
+GLAPI void APIENTRY glUniform3i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);
+GLAPI void APIENTRY glUniform4i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
+GLAPI void APIENTRY glUniform1i64vNV (GLint location, GLsizei count, const GLint64EXT *value);
+GLAPI void APIENTRY glUniform2i64vNV (GLint location, GLsizei count, const GLint64EXT *value);
+GLAPI void APIENTRY glUniform3i64vNV (GLint location, GLsizei count, const GLint64EXT *value);
+GLAPI void APIENTRY glUniform4i64vNV (GLint location, GLsizei count, const GLint64EXT *value);
+GLAPI void APIENTRY glUniform1ui64NV (GLint location, GLuint64EXT x);
+GLAPI void APIENTRY glUniform2ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y);
+GLAPI void APIENTRY glUniform3ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
+GLAPI void APIENTRY glUniform4ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
+GLAPI void APIENTRY glUniform1ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
+GLAPI void APIENTRY glUniform2ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
+GLAPI void APIENTRY glUniform3ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
+GLAPI void APIENTRY glUniform4ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
+GLAPI void APIENTRY glGetUniformi64vNV (GLuint program, GLint location, GLint64EXT *params);
+GLAPI void APIENTRY glProgramUniform1i64NV (GLuint program, GLint location, GLint64EXT x);
+GLAPI void APIENTRY glProgramUniform2i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y);
+GLAPI void APIENTRY glProgramUniform3i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);
+GLAPI void APIENTRY glProgramUniform4i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
+GLAPI void APIENTRY glProgramUniform1i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
+GLAPI void APIENTRY glProgramUniform2i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
+GLAPI void APIENTRY glProgramUniform3i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
+GLAPI void APIENTRY glProgramUniform4i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
+GLAPI void APIENTRY glProgramUniform1ui64NV (GLuint program, GLint location, GLuint64EXT x);
+GLAPI void APIENTRY glProgramUniform2ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y);
+GLAPI void APIENTRY glProgramUniform3ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
+GLAPI void APIENTRY glProgramUniform4ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
+GLAPI void APIENTRY glProgramUniform1ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
+GLAPI void APIENTRY glProgramUniform2ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
+GLAPI void APIENTRY glProgramUniform3ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
+GLAPI void APIENTRY glProgramUniform4ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLUNIFORM1I64NVPROC) (GLint location, GLint64EXT x);
+typedef void (APIENTRYP PFNGLUNIFORM2I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y);
+typedef void (APIENTRYP PFNGLUNIFORM3I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);
+typedef void (APIENTRYP PFNGLUNIFORM4I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
+typedef void (APIENTRYP PFNGLUNIFORM1I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value);
+typedef void (APIENTRYP PFNGLUNIFORM2I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value);
+typedef void (APIENTRYP PFNGLUNIFORM3I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value);
+typedef void (APIENTRYP PFNGLUNIFORM4I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value);
+typedef void (APIENTRYP PFNGLUNIFORM1UI64NVPROC) (GLint location, GLuint64EXT x);
+typedef void (APIENTRYP PFNGLUNIFORM2UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y);
+typedef void (APIENTRYP PFNGLUNIFORM3UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
+typedef void (APIENTRYP PFNGLUNIFORM4UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
+typedef void (APIENTRYP PFNGLUNIFORM1UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
+typedef void (APIENTRYP PFNGLUNIFORM2UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
+typedef void (APIENTRYP PFNGLUNIFORM3UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
+typedef void (APIENTRYP PFNGLUNIFORM4UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
+typedef void (APIENTRYP PFNGLGETUNIFORMI64VNVPROC) (GLuint program, GLint location, GLint64EXT *params);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64NVPROC) (GLuint program, GLint location, GLint64EXT x);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
+#endif
+
+#ifndef GL_NV_shader_buffer_store
+#define GL_NV_shader_buffer_store 1
+#endif
+
+#ifndef GL_NV_tessellation_program5
+#define GL_NV_tessellation_program5 1
+#endif
+
+#ifndef GL_NV_vertex_attrib_integer_64bit
+#define GL_NV_vertex_attrib_integer_64bit 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexAttribL1i64NV (GLuint index, GLint64EXT x);
+GLAPI void APIENTRY glVertexAttribL2i64NV (GLuint index, GLint64EXT x, GLint64EXT y);
+GLAPI void APIENTRY glVertexAttribL3i64NV (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z);
+GLAPI void APIENTRY glVertexAttribL4i64NV (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
+GLAPI void APIENTRY glVertexAttribL1i64vNV (GLuint index, const GLint64EXT *v);
+GLAPI void APIENTRY glVertexAttribL2i64vNV (GLuint index, const GLint64EXT *v);
+GLAPI void APIENTRY glVertexAttribL3i64vNV (GLuint index, const GLint64EXT *v);
+GLAPI void APIENTRY glVertexAttribL4i64vNV (GLuint index, const GLint64EXT *v);
+GLAPI void APIENTRY glVertexAttribL1ui64NV (GLuint index, GLuint64EXT x);
+GLAPI void APIENTRY glVertexAttribL2ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y);
+GLAPI void APIENTRY glVertexAttribL3ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
+GLAPI void APIENTRY glVertexAttribL4ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
+GLAPI void APIENTRY glVertexAttribL1ui64vNV (GLuint index, const GLuint64EXT *v);
+GLAPI void APIENTRY glVertexAttribL2ui64vNV (GLuint index, const GLuint64EXT *v);
+GLAPI void APIENTRY glVertexAttribL3ui64vNV (GLuint index, const GLuint64EXT *v);
+GLAPI void APIENTRY glVertexAttribL4ui64vNV (GLuint index, const GLuint64EXT *v);
+GLAPI void APIENTRY glGetVertexAttribLi64vNV (GLuint index, GLenum pname, GLint64EXT *params);
+GLAPI void APIENTRY glGetVertexAttribLui64vNV (GLuint index, GLenum pname, GLuint64EXT *params);
+GLAPI void APIENTRY glVertexAttribLFormatNV (GLuint index, GLint size, GLenum type, GLsizei stride);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL1I64NVPROC) (GLuint index, GLint64EXT x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL2I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL3I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL4I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL1I64VNVPROC) (GLuint index, const GLint64EXT *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL2I64VNVPROC) (GLuint index, const GLint64EXT *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL3I64VNVPROC) (GLuint index, const GLint64EXT *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL4I64VNVPROC) (GLuint index, const GLint64EXT *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64NVPROC) (GLuint index, GLuint64EXT x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL2UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL3UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL4UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64VNVPROC) (GLuint index, const GLuint64EXT *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL2UI64VNVPROC) (GLuint index, const GLuint64EXT *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL3UI64VNVPROC) (GLuint index, const GLuint64EXT *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL4UI64VNVPROC) (GLuint index, const GLuint64EXT *v);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLI64VNVPROC) (GLuint index, GLenum pname, GLint64EXT *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLUI64VNVPROC) (GLuint index, GLenum pname, GLuint64EXT *params);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBLFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride);
+#endif
+
+#ifndef GL_NV_multisample_coverage
+#define GL_NV_multisample_coverage 1
+#endif
+
+#ifndef GL_AMD_name_gen_delete
+#define GL_AMD_name_gen_delete 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGenNamesAMD (GLenum identifier, GLuint num, GLuint *names);
+GLAPI void APIENTRY glDeleteNamesAMD (GLenum identifier, GLuint num, const GLuint *names);
+GLAPI GLboolean APIENTRY glIsNameAMD (GLenum identifier, GLuint name);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGENNAMESAMDPROC) (GLenum identifier, GLuint num, GLuint *names);
+typedef void (APIENTRYP PFNGLDELETENAMESAMDPROC) (GLenum identifier, GLuint num, const GLuint *names);
+typedef GLboolean (APIENTRYP PFNGLISNAMEAMDPROC) (GLenum identifier, GLuint name);
+#endif
+
+#ifndef GL_AMD_debug_output
+#define GL_AMD_debug_output 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDebugMessageEnableAMD (GLenum category, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
+GLAPI void APIENTRY glDebugMessageInsertAMD (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar *buf);
+GLAPI void APIENTRY glDebugMessageCallbackAMD (GLDEBUGPROCAMD callback, GLvoid *userParam);
+GLAPI GLuint APIENTRY glGetDebugMessageLogAMD (GLuint count, GLsizei bufsize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDEBUGMESSAGEENABLEAMDPROC) (GLenum category, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
+typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTAMDPROC) (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar *buf);
+typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKAMDPROC) (GLDEBUGPROCAMD callback, GLvoid *userParam);
+typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGAMDPROC) (GLuint count, GLsizei bufsize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message);
+#endif
+
+#ifndef GL_NV_vdpau_interop
+#define GL_NV_vdpau_interop 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVDPAUInitNV (const GLvoid *vdpDevice, const GLvoid *getProcAddress);
+GLAPI void APIENTRY glVDPAUFiniNV (void);
+GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterVideoSurfaceNV (GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames);
+GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterOutputSurfaceNV (GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames);
+GLAPI void APIENTRY glVDPAUIsSurfaceNV (GLvdpauSurfaceNV surface);
+GLAPI void APIENTRY glVDPAUUnregisterSurfaceNV (GLvdpauSurfaceNV surface);
+GLAPI void APIENTRY glVDPAUGetSurfaceivNV (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
+GLAPI void APIENTRY glVDPAUSurfaceAccessNV (GLvdpauSurfaceNV surface, GLenum access);
+GLAPI void APIENTRY glVDPAUMapSurfacesNV (GLsizei numSurfaces, const GLvdpauSurfaceNV *surfaces);
+GLAPI void APIENTRY glVDPAUUnmapSurfacesNV (GLsizei numSurface, const GLvdpauSurfaceNV *surfaces);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVDPAUINITNVPROC) (const GLvoid *vdpDevice, const GLvoid *getProcAddress);
+typedef void (APIENTRYP PFNGLVDPAUFININVPROC) (void);
+typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTERVIDEOSURFACENVPROC) (GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames);
+typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC) (GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames);
+typedef void (APIENTRYP PFNGLVDPAUISSURFACENVPROC) (GLvdpauSurfaceNV surface);
+typedef void (APIENTRYP PFNGLVDPAUUNREGISTERSURFACENVPROC) (GLvdpauSurfaceNV surface);
+typedef void (APIENTRYP PFNGLVDPAUGETSURFACEIVNVPROC) (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
+typedef void (APIENTRYP PFNGLVDPAUSURFACEACCESSNVPROC) (GLvdpauSurfaceNV surface, GLenum access);
+typedef void (APIENTRYP PFNGLVDPAUMAPSURFACESNVPROC) (GLsizei numSurfaces, const GLvdpauSurfaceNV *surfaces);
+typedef void (APIENTRYP PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, const GLvdpauSurfaceNV *surfaces);
+#endif
+
+#ifndef GL_AMD_transform_feedback3_lines_triangles
+#define GL_AMD_transform_feedback3_lines_triangles 1
+#endif
+
+#ifndef GL_AMD_depth_clamp_separate
+#define GL_AMD_depth_clamp_separate 1
+#endif
+
+#ifndef GL_EXT_texture_sRGB_decode
+#define GL_EXT_texture_sRGB_decode 1
+#endif
+
+#ifndef GL_NV_texture_multisample
+#define GL_NV_texture_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexImage2DMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
+GLAPI void APIENTRY glTexImage3DMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
+GLAPI void APIENTRY glTextureImage2DMultisampleNV (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
+GLAPI void APIENTRY glTextureImage3DMultisampleNV (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
+GLAPI void APIENTRY glTextureImage2DMultisampleCoverageNV (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
+GLAPI void APIENTRY glTextureImage3DMultisampleCoverageNV (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
+typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
+typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
+typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
+typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
+typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
+#endif
+
+#ifndef GL_AMD_blend_minmax_factor
+#define GL_AMD_blend_minmax_factor 1
+#endif
+
+#ifndef GL_AMD_sample_positions
+#define GL_AMD_sample_positions 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSetMultisamplefvAMD (GLenum pname, GLuint index, const GLfloat *val);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSETMULTISAMPLEFVAMDPROC) (GLenum pname, GLuint index, const GLfloat *val);
+#endif
+
+#ifndef GL_EXT_x11_sync_object
+#define GL_EXT_x11_sync_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLsync APIENTRY glImportSyncEXT (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLsync (APIENTRYP PFNGLIMPORTSYNCEXTPROC) (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags);
+#endif
+
+#ifndef GL_AMD_multi_draw_indirect
+#define GL_AMD_multi_draw_indirect 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glMultiDrawArraysIndirectAMD (GLenum mode, const GLvoid *indirect, GLsizei primcount, GLsizei stride);
+GLAPI void APIENTRY glMultiDrawElementsIndirectAMD (GLenum mode, GLenum type, const GLvoid *indirect, GLsizei primcount, GLsizei stride);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC) (GLenum mode, const GLvoid *indirect, GLsizei primcount, GLsizei stride);
+typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC) (GLenum mode, GLenum type, const GLvoid *indirect, GLsizei primcount, GLsizei stride);
+#endif
+
+#ifndef GL_EXT_framebuffer_multisample_blit_scaled
+#define GL_EXT_framebuffer_multisample_blit_scaled 1
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/hw/yagl/yagl_inc/GL/glu.h b/hw/yagl/yagl_inc/GL/glu.h
new file mode 100644
index 0000000000..ba2228d8d8
--- /dev/null
+++ b/hw/yagl/yagl_inc/GL/glu.h
@@ -0,0 +1,353 @@
+/*
+ * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
+ * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice including the dates of first publication and
+ * either this permission notice or a reference to
+ * http://oss.sgi.com/projects/FreeB/
+ * shall be included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
+ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * Except as contained in this notice, the name of Silicon Graphics, Inc.
+ * shall not be used in advertising or otherwise to promote the sale, use or
+ * other dealings in this Software without prior written authorization from
+ * Silicon Graphics, Inc.
+ */
+
+#ifndef __glu_h__
+#define __glu_h__
+
+#if defined(USE_MGL_NAMESPACE)
+#include "glu_mangle.h"
+#endif
+
+#include <GL/gl.h>
+
+#ifndef GLAPIENTRY
+#if defined(_MSC_VER) || defined(__MINGW32__)
+#define GLAPIENTRY __stdcall
+#else
+#define GLAPIENTRY
+#endif
+#endif
+
+#ifndef GLAPIENTRYP
+#define GLAPIENTRYP GLAPIENTRY *
+#endif
+
+#if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GLU32)
+# undef GLAPI
+# define GLAPI __declspec(dllexport)
+#elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL)
+/* tag specifying we're building for DLL runtime support */
+# undef GLAPI
+# define GLAPI __declspec(dllimport)
+#elif !defined(GLAPI)
+/* for use with static link lib build of Win32 edition only */
+# define GLAPI extern
+#endif /* _STATIC_MESA support */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*************************************************************/
+
+/* Extensions */
+#define GLU_EXT_object_space_tess 1
+#define GLU_EXT_nurbs_tessellator 1
+
+/* Boolean */
+#define GLU_FALSE 0
+#define GLU_TRUE 1
+
+/* Version */
+#define GLU_VERSION_1_1 1
+#define GLU_VERSION_1_2 1
+#define GLU_VERSION_1_3 1
+
+/* StringName */
+#define GLU_VERSION 100800
+#define GLU_EXTENSIONS 100801
+
+/* ErrorCode */
+#define GLU_INVALID_ENUM 100900
+#define GLU_INVALID_VALUE 100901
+#define GLU_OUT_OF_MEMORY 100902
+#define GLU_INCOMPATIBLE_GL_VERSION 100903
+#define GLU_INVALID_OPERATION 100904
+
+/* NurbsDisplay */
+/* GLU_FILL */
+#define GLU_OUTLINE_POLYGON 100240
+#define GLU_OUTLINE_PATCH 100241
+
+/* NurbsCallback */
+#define GLU_NURBS_ERROR 100103
+#define GLU_ERROR 100103
+#define GLU_NURBS_BEGIN 100164
+#define GLU_NURBS_BEGIN_EXT 100164
+#define GLU_NURBS_VERTEX 100165
+#define GLU_NURBS_VERTEX_EXT 100165
+#define GLU_NURBS_NORMAL 100166
+#define GLU_NURBS_NORMAL_EXT 100166
+#define GLU_NURBS_COLOR 100167
+#define GLU_NURBS_COLOR_EXT 100167
+#define GLU_NURBS_TEXTURE_COORD 100168
+#define GLU_NURBS_TEX_COORD_EXT 100168
+#define GLU_NURBS_END 100169
+#define GLU_NURBS_END_EXT 100169
+#define GLU_NURBS_BEGIN_DATA 100170
+#define GLU_NURBS_BEGIN_DATA_EXT 100170
+#define GLU_NURBS_VERTEX_DATA 100171
+#define GLU_NURBS_VERTEX_DATA_EXT 100171
+#define GLU_NURBS_NORMAL_DATA 100172
+#define GLU_NURBS_NORMAL_DATA_EXT 100172
+#define GLU_NURBS_COLOR_DATA 100173
+#define GLU_NURBS_COLOR_DATA_EXT 100173
+#define GLU_NURBS_TEXTURE_COORD_DATA 100174
+#define GLU_NURBS_TEX_COORD_DATA_EXT 100174
+#define GLU_NURBS_END_DATA 100175
+#define GLU_NURBS_END_DATA_EXT 100175
+
+/* NurbsError */
+#define GLU_NURBS_ERROR1 100251
+#define GLU_NURBS_ERROR2 100252
+#define GLU_NURBS_ERROR3 100253
+#define GLU_NURBS_ERROR4 100254
+#define GLU_NURBS_ERROR5 100255
+#define GLU_NURBS_ERROR6 100256
+#define GLU_NURBS_ERROR7 100257
+#define GLU_NURBS_ERROR8 100258
+#define GLU_NURBS_ERROR9 100259
+#define GLU_NURBS_ERROR10 100260
+#define GLU_NURBS_ERROR11 100261
+#define GLU_NURBS_ERROR12 100262
+#define GLU_NURBS_ERROR13 100263
+#define GLU_NURBS_ERROR14 100264
+#define GLU_NURBS_ERROR15 100265
+#define GLU_NURBS_ERROR16 100266
+#define GLU_NURBS_ERROR17 100267
+#define GLU_NURBS_ERROR18 100268
+#define GLU_NURBS_ERROR19 100269
+#define GLU_NURBS_ERROR20 100270
+#define GLU_NURBS_ERROR21 100271
+#define GLU_NURBS_ERROR22 100272
+#define GLU_NURBS_ERROR23 100273
+#define GLU_NURBS_ERROR24 100274
+#define GLU_NURBS_ERROR25 100275
+#define GLU_NURBS_ERROR26 100276
+#define GLU_NURBS_ERROR27 100277
+#define GLU_NURBS_ERROR28 100278
+#define GLU_NURBS_ERROR29 100279
+#define GLU_NURBS_ERROR30 100280
+#define GLU_NURBS_ERROR31 100281
+#define GLU_NURBS_ERROR32 100282
+#define GLU_NURBS_ERROR33 100283
+#define GLU_NURBS_ERROR34 100284
+#define GLU_NURBS_ERROR35 100285
+#define GLU_NURBS_ERROR36 100286
+#define GLU_NURBS_ERROR37 100287
+
+/* NurbsProperty */
+#define GLU_AUTO_LOAD_MATRIX 100200
+#define GLU_CULLING 100201
+#define GLU_SAMPLING_TOLERANCE 100203
+#define GLU_DISPLAY_MODE 100204
+#define GLU_PARAMETRIC_TOLERANCE 100202
+#define GLU_SAMPLING_METHOD 100205
+#define GLU_U_STEP 100206
+#define GLU_V_STEP 100207
+#define GLU_NURBS_MODE 100160
+#define GLU_NURBS_MODE_EXT 100160
+#define GLU_NURBS_TESSELLATOR 100161
+#define GLU_NURBS_TESSELLATOR_EXT 100161
+#define GLU_NURBS_RENDERER 100162
+#define GLU_NURBS_RENDERER_EXT 100162
+
+/* NurbsSampling */
+#define GLU_OBJECT_PARAMETRIC_ERROR 100208
+#define GLU_OBJECT_PARAMETRIC_ERROR_EXT 100208
+#define GLU_OBJECT_PATH_LENGTH 100209
+#define GLU_OBJECT_PATH_LENGTH_EXT 100209
+#define GLU_PATH_LENGTH 100215
+#define GLU_PARAMETRIC_ERROR 100216
+#define GLU_DOMAIN_DISTANCE 100217
+
+/* NurbsTrim */
+#define GLU_MAP1_TRIM_2 100210
+#define GLU_MAP1_TRIM_3 100211
+
+/* QuadricDrawStyle */
+#define GLU_POINT 100010
+#define GLU_LINE 100011
+#define GLU_FILL 100012
+#define GLU_SILHOUETTE 100013
+
+/* QuadricCallback */
+/* GLU_ERROR */
+
+/* QuadricNormal */
+#define GLU_SMOOTH 100000
+#define GLU_FLAT 100001
+#define GLU_NONE 100002
+
+/* QuadricOrientation */
+#define GLU_OUTSIDE 100020
+#define GLU_INSIDE 100021
+
+/* TessCallback */
+#define GLU_TESS_BEGIN 100100
+#define GLU_BEGIN 100100
+#define GLU_TESS_VERTEX 100101
+#define GLU_VERTEX 100101
+#define GLU_TESS_END 100102
+#define GLU_END 100102
+#define GLU_TESS_ERROR 100103
+#define GLU_TESS_EDGE_FLAG 100104
+#define GLU_EDGE_FLAG 100104
+#define GLU_TESS_COMBINE 100105
+#define GLU_TESS_BEGIN_DATA 100106
+#define GLU_TESS_VERTEX_DATA 100107
+#define GLU_TESS_END_DATA 100108
+#define GLU_TESS_ERROR_DATA 100109
+#define GLU_TESS_EDGE_FLAG_DATA 100110
+#define GLU_TESS_COMBINE_DATA 100111
+
+/* TessContour */
+#define GLU_CW 100120
+#define GLU_CCW 100121
+#define GLU_INTERIOR 100122
+#define GLU_EXTERIOR 100123
+#define GLU_UNKNOWN 100124
+
+/* TessProperty */
+#define GLU_TESS_WINDING_RULE 100140
+#define GLU_TESS_BOUNDARY_ONLY 100141
+#define GLU_TESS_TOLERANCE 100142
+
+/* TessError */
+#define GLU_TESS_ERROR1 100151
+#define GLU_TESS_ERROR2 100152
+#define GLU_TESS_ERROR3 100153
+#define GLU_TESS_ERROR4 100154
+#define GLU_TESS_ERROR5 100155
+#define GLU_TESS_ERROR6 100156
+#define GLU_TESS_ERROR7 100157
+#define GLU_TESS_ERROR8 100158
+#define GLU_TESS_MISSING_BEGIN_POLYGON 100151
+#define GLU_TESS_MISSING_BEGIN_CONTOUR 100152
+#define GLU_TESS_MISSING_END_POLYGON 100153
+#define GLU_TESS_MISSING_END_CONTOUR 100154
+#define GLU_TESS_COORD_TOO_LARGE 100155
+#define GLU_TESS_NEED_COMBINE_CALLBACK 100156
+
+/* TessWinding */
+#define GLU_TESS_WINDING_ODD 100130
+#define GLU_TESS_WINDING_NONZERO 100131
+#define GLU_TESS_WINDING_POSITIVE 100132
+#define GLU_TESS_WINDING_NEGATIVE 100133
+#define GLU_TESS_WINDING_ABS_GEQ_TWO 100134
+
+/*************************************************************/
+
+
+#ifdef __cplusplus
+class GLUnurbs;
+class GLUquadric;
+class GLUtesselator;
+#else
+typedef struct GLUnurbs GLUnurbs;
+typedef struct GLUquadric GLUquadric;
+typedef struct GLUtesselator GLUtesselator;
+#endif
+
+typedef GLUnurbs GLUnurbsObj;
+typedef GLUquadric GLUquadricObj;
+typedef GLUtesselator GLUtesselatorObj;
+typedef GLUtesselator GLUtriangulatorObj;
+
+#define GLU_TESS_MAX_COORD 1.0e150
+
+/* Internal convenience typedefs */
+typedef void (GLAPIENTRYP _GLUfuncptr)(void);
+
+GLAPI void GLAPIENTRY gluBeginCurve (GLUnurbs* nurb);
+GLAPI void GLAPIENTRY gluBeginPolygon (GLUtesselator* tess);
+GLAPI void GLAPIENTRY gluBeginSurface (GLUnurbs* nurb);
+GLAPI void GLAPIENTRY gluBeginTrim (GLUnurbs* nurb);
+GLAPI GLint GLAPIENTRY gluBuild1DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
+GLAPI GLint GLAPIENTRY gluBuild1DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, const void *data);
+GLAPI GLint GLAPIENTRY gluBuild2DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
+GLAPI GLint GLAPIENTRY gluBuild2DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *data);
+GLAPI GLint GLAPIENTRY gluBuild3DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
+GLAPI GLint GLAPIENTRY gluBuild3DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data);
+GLAPI GLboolean GLAPIENTRY gluCheckExtension (const GLubyte *extName, const GLubyte *extString);
+GLAPI void GLAPIENTRY gluCylinder (GLUquadric* quad, GLdouble base, GLdouble top, GLdouble height, GLint slices, GLint stacks);
+GLAPI void GLAPIENTRY gluDeleteNurbsRenderer (GLUnurbs* nurb);
+GLAPI void GLAPIENTRY gluDeleteQuadric (GLUquadric* quad);
+GLAPI void GLAPIENTRY gluDeleteTess (GLUtesselator* tess);
+GLAPI void GLAPIENTRY gluDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops);
+GLAPI void GLAPIENTRY gluEndCurve (GLUnurbs* nurb);
+GLAPI void GLAPIENTRY gluEndPolygon (GLUtesselator* tess);
+GLAPI void GLAPIENTRY gluEndSurface (GLUnurbs* nurb);
+GLAPI void GLAPIENTRY gluEndTrim (GLUnurbs* nurb);
+GLAPI const GLubyte * GLAPIENTRY gluErrorString (GLenum error);
+GLAPI void GLAPIENTRY gluGetNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat* data);
+GLAPI const GLubyte * GLAPIENTRY gluGetString (GLenum name);
+GLAPI void GLAPIENTRY gluGetTessProperty (GLUtesselator* tess, GLenum which, GLdouble* data);
+GLAPI void GLAPIENTRY gluLoadSamplingMatrices (GLUnurbs* nurb, const GLfloat *model, const GLfloat *perspective, const GLint *view);
+GLAPI void GLAPIENTRY gluLookAt (GLdouble eyeX, GLdouble eyeY, GLdouble eyeZ, GLdouble centerX, GLdouble centerY, GLdouble centerZ, GLdouble upX, GLdouble upY, GLdouble upZ);
+GLAPI GLUnurbs* GLAPIENTRY gluNewNurbsRenderer (void);
+GLAPI GLUquadric* GLAPIENTRY gluNewQuadric (void);
+GLAPI GLUtesselator* GLAPIENTRY gluNewTess (void);
+GLAPI void GLAPIENTRY gluNextContour (GLUtesselator* tess, GLenum type);
+GLAPI void GLAPIENTRY gluNurbsCallback (GLUnurbs* nurb, GLenum which, _GLUfuncptr CallBackFunc);
+GLAPI void GLAPIENTRY gluNurbsCallbackData (GLUnurbs* nurb, GLvoid* userData);
+GLAPI void GLAPIENTRY gluNurbsCallbackDataEXT (GLUnurbs* nurb, GLvoid* userData);
+GLAPI void GLAPIENTRY gluNurbsCurve (GLUnurbs* nurb, GLint knotCount, GLfloat *knots, GLint stride, GLfloat *control, GLint order, GLenum type);
+GLAPI void GLAPIENTRY gluNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat value);
+GLAPI void GLAPIENTRY gluNurbsSurface (GLUnurbs* nurb, GLint sKnotCount, GLfloat* sKnots, GLint tKnotCount, GLfloat* tKnots, GLint sStride, GLint tStride, GLfloat* control, GLint sOrder, GLint tOrder, GLenum type);
+GLAPI void GLAPIENTRY gluOrtho2D (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top);
+GLAPI void GLAPIENTRY gluPartialDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops, GLdouble start, GLdouble sweep);
+GLAPI void GLAPIENTRY gluPerspective (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar);
+GLAPI void GLAPIENTRY gluPickMatrix (GLdouble x, GLdouble y, GLdouble delX, GLdouble delY, GLint *viewport);
+GLAPI GLint GLAPIENTRY gluProject (GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* winX, GLdouble* winY, GLdouble* winZ);
+GLAPI void GLAPIENTRY gluPwlCurve (GLUnurbs* nurb, GLint count, GLfloat* data, GLint stride, GLenum type);
+GLAPI void GLAPIENTRY gluQuadricCallback (GLUquadric* quad, GLenum which, _GLUfuncptr CallBackFunc);
+GLAPI void GLAPIENTRY gluQuadricDrawStyle (GLUquadric* quad, GLenum draw);
+GLAPI void GLAPIENTRY gluQuadricNormals (GLUquadric* quad, GLenum normal);
+GLAPI void GLAPIENTRY gluQuadricOrientation (GLUquadric* quad, GLenum orientation);
+GLAPI void GLAPIENTRY gluQuadricTexture (GLUquadric* quad, GLboolean texture);
+GLAPI GLint GLAPIENTRY gluScaleImage (GLenum format, GLsizei wIn, GLsizei hIn, GLenum typeIn, const void *dataIn, GLsizei wOut, GLsizei hOut, GLenum typeOut, GLvoid* dataOut);
+GLAPI void GLAPIENTRY gluSphere (GLUquadric* quad, GLdouble radius, GLint slices, GLint stacks);
+GLAPI void GLAPIENTRY gluTessBeginContour (GLUtesselator* tess);
+GLAPI void GLAPIENTRY gluTessBeginPolygon (GLUtesselator* tess, GLvoid* data);
+GLAPI void GLAPIENTRY gluTessCallback (GLUtesselator* tess, GLenum which, _GLUfuncptr CallBackFunc);
+GLAPI void GLAPIENTRY gluTessEndContour (GLUtesselator* tess);
+GLAPI void GLAPIENTRY gluTessEndPolygon (GLUtesselator* tess);
+GLAPI void GLAPIENTRY gluTessNormal (GLUtesselator* tess, GLdouble valueX, GLdouble valueY, GLdouble valueZ);
+GLAPI void GLAPIENTRY gluTessProperty (GLUtesselator* tess, GLenum which, GLdouble data);
+GLAPI void GLAPIENTRY gluTessVertex (GLUtesselator* tess, GLdouble *location, GLvoid* data);
+GLAPI GLint GLAPIENTRY gluUnProject (GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* objX, GLdouble* objY, GLdouble* objZ);
+GLAPI GLint GLAPIENTRY gluUnProject4 (GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble nearVal, GLdouble farVal, GLdouble* objX, GLdouble* objY, GLdouble* objZ, GLdouble* objW);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __glu_h__ */
diff --git a/hw/yagl/yagl_inc/GL/glu_mangle.h b/hw/yagl/yagl_inc/GL/glu_mangle.h
new file mode 100644
index 0000000000..9c25aa864c
--- /dev/null
+++ b/hw/yagl/yagl_inc/GL/glu_mangle.h
@@ -0,0 +1,86 @@
+/*
+ * Mesa 3-D graphics library
+ * Version: 3.0
+ * Copyright (C) 1995-1998 Brian Paul
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+
+#ifndef GLU_MANGLE_H
+#define GLU_MANGLE_H
+
+
+#define gluLookAt mgluLookAt
+#define gluOrtho2D mgluOrtho2D
+#define gluPerspective mgluPerspective
+#define gluPickMatrix mgluPickMatrix
+#define gluProject mgluProject
+#define gluUnProject mgluUnProject
+#define gluErrorString mgluErrorString
+#define gluScaleImage mgluScaleImage
+#define gluBuild1DMipmaps mgluBuild1DMipmaps
+#define gluBuild2DMipmaps mgluBuild2DMipmaps
+#define gluNewQuadric mgluNewQuadric
+#define gluDeleteQuadric mgluDeleteQuadric
+#define gluQuadricDrawStyle mgluQuadricDrawStyle
+#define gluQuadricOrientation mgluQuadricOrientation
+#define gluQuadricNormals mgluQuadricNormals
+#define gluQuadricTexture mgluQuadricTexture
+#define gluQuadricCallback mgluQuadricCallback
+#define gluCylinder mgluCylinder
+#define gluSphere mgluSphere
+#define gluDisk mgluDisk
+#define gluPartialDisk mgluPartialDisk
+#define gluNewNurbsRenderer mgluNewNurbsRenderer
+#define gluDeleteNurbsRenderer mgluDeleteNurbsRenderer
+#define gluLoadSamplingMatrices mgluLoadSamplingMatrices
+#define gluNurbsProperty mgluNurbsProperty
+#define gluGetNurbsProperty mgluGetNurbsProperty
+#define gluBeginCurve mgluBeginCurve
+#define gluEndCurve mgluEndCurve
+#define gluNurbsCurve mgluNurbsCurve
+#define gluBeginSurface mgluBeginSurface
+#define gluEndSurface mgluEndSurface
+#define gluNurbsSurface mgluNurbsSurface
+#define gluBeginTrim mgluBeginTrim
+#define gluEndTrim mgluEndTrim
+#define gluPwlCurve mgluPwlCurve
+#define gluNurbsCallback mgluNurbsCallback
+#define gluNewTess mgluNewTess
+#define gluDeleteTess mgluDeleteTess
+#define gluTessBeginPolygon mgluTessBeginPolygon
+#define gluTessBeginContour mgluTessBeginContour
+#define gluTessVertex mgluTessVertex
+#define gluTessEndPolygon mgluTessEndPolygon
+#define gluTessEndContour mgluTessEndContour
+#define gluTessProperty mgluTessProperty
+#define gluTessNormal mgluTessNormal
+#define gluTessCallback mgluTessCallback
+#define gluGetTessProperty mgluGetTessProperty
+#define gluBeginPolygon mgluBeginPolygon
+#define gluNextContour mgluNextContour
+#define gluEndPolygon mgluEndPolygon
+#define gluGetString mgluGetString
+#define gluBuild1DMipmapLevels mgluBuild1DMipmapLevels
+#define gluBuild2DMipmapLevels mgluBuild2DMipmapLevels
+#define gluBuild3DMipmapLevels mgluBuild3DMipmapLevels
+#define gluBuild3DMipmaps mgluBuild3DMipmaps
+#define gluCheckExtension mgluCheckExtension
+#define gluUnProject4 mgluUnProject4
+#define gluNurbsCallbackData mgluNurbsCallbackData
+#define gluNurbsCallbackDataEXT mgluNurbsCallbackDataEXT
+
+#endif
diff --git a/hw/yagl/yagl_inc/GL/glx.h b/hw/yagl/yagl_inc/GL/glx.h
new file mode 100644
index 0000000000..a3a7d97c93
--- /dev/null
+++ b/hw/yagl/yagl_inc/GL/glx.h
@@ -0,0 +1,526 @@
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#ifndef GLX_H
+#define GLX_H
+
+
+#ifdef __VMS
+#include <GL/vms_x_fix.h>
+# ifdef __cplusplus
+/* VMS Xlib.h gives problems with C++.
+ * this avoids a bunch of trivial warnings */
+#pragma message disable nosimpint
+#endif
+#endif
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#ifdef __VMS
+# ifdef __cplusplus
+#pragma message enable nosimpint
+#endif
+#endif
+#include <GL/gl.h>
+
+
+#if defined(USE_MGL_NAMESPACE)
+#include "glx_mangle.h"
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#define GLX_VERSION_1_1 1
+#define GLX_VERSION_1_2 1
+#define GLX_VERSION_1_3 1
+#define GLX_VERSION_1_4 1
+
+#define GLX_EXTENSION_NAME "GLX"
+
+
+
+/*
+ * Tokens for glXChooseVisual and glXGetConfig:
+ */
+#define GLX_USE_GL 1
+#define GLX_BUFFER_SIZE 2
+#define GLX_LEVEL 3
+#define GLX_RGBA 4
+#define GLX_DOUBLEBUFFER 5
+#define GLX_STEREO 6
+#define GLX_AUX_BUFFERS 7
+#define GLX_RED_SIZE 8
+#define GLX_GREEN_SIZE 9
+#define GLX_BLUE_SIZE 10
+#define GLX_ALPHA_SIZE 11
+#define GLX_DEPTH_SIZE 12
+#define GLX_STENCIL_SIZE 13
+#define GLX_ACCUM_RED_SIZE 14
+#define GLX_ACCUM_GREEN_SIZE 15
+#define GLX_ACCUM_BLUE_SIZE 16
+#define GLX_ACCUM_ALPHA_SIZE 17
+
+
+/*
+ * Error codes returned by glXGetConfig:
+ */
+#define GLX_BAD_SCREEN 1
+#define GLX_BAD_ATTRIBUTE 2
+#define GLX_NO_EXTENSION 3
+#define GLX_BAD_VISUAL 4
+#define GLX_BAD_CONTEXT 5
+#define GLX_BAD_VALUE 6
+#define GLX_BAD_ENUM 7
+
+
+/*
+ * GLX 1.1 and later:
+ */
+#define GLX_VENDOR 1
+#define GLX_VERSION 2
+#define GLX_EXTENSIONS 3
+
+
+/*
+ * GLX 1.3 and later:
+ */
+#define GLX_CONFIG_CAVEAT 0x20
+#define GLX_DONT_CARE 0xFFFFFFFF
+#define GLX_X_VISUAL_TYPE 0x22
+#define GLX_TRANSPARENT_TYPE 0x23
+#define GLX_TRANSPARENT_INDEX_VALUE 0x24
+#define GLX_TRANSPARENT_RED_VALUE 0x25
+#define GLX_TRANSPARENT_GREEN_VALUE 0x26
+#define GLX_TRANSPARENT_BLUE_VALUE 0x27
+#define GLX_TRANSPARENT_ALPHA_VALUE 0x28
+#define GLX_WINDOW_BIT 0x00000001
+#define GLX_PIXMAP_BIT 0x00000002
+#define GLX_PBUFFER_BIT 0x00000004
+#define GLX_AUX_BUFFERS_BIT 0x00000010
+#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001
+#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002
+#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004
+#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008
+#define GLX_DEPTH_BUFFER_BIT 0x00000020
+#define GLX_STENCIL_BUFFER_BIT 0x00000040
+#define GLX_ACCUM_BUFFER_BIT 0x00000080
+#define GLX_NONE 0x8000
+#define GLX_SLOW_CONFIG 0x8001
+#define GLX_TRUE_COLOR 0x8002
+#define GLX_DIRECT_COLOR 0x8003
+#define GLX_PSEUDO_COLOR 0x8004
+#define GLX_STATIC_COLOR 0x8005
+#define GLX_GRAY_SCALE 0x8006
+#define GLX_STATIC_GRAY 0x8007
+#define GLX_TRANSPARENT_RGB 0x8008
+#define GLX_TRANSPARENT_INDEX 0x8009
+#define GLX_VISUAL_ID 0x800B
+#define GLX_SCREEN 0x800C
+#define GLX_NON_CONFORMANT_CONFIG 0x800D
+#define GLX_DRAWABLE_TYPE 0x8010
+#define GLX_RENDER_TYPE 0x8011
+#define GLX_X_RENDERABLE 0x8012
+#define GLX_FBCONFIG_ID 0x8013
+#define GLX_RGBA_TYPE 0x8014
+#define GLX_COLOR_INDEX_TYPE 0x8015
+#define GLX_MAX_PBUFFER_WIDTH 0x8016
+#define GLX_MAX_PBUFFER_HEIGHT 0x8017
+#define GLX_MAX_PBUFFER_PIXELS 0x8018
+#define GLX_PRESERVED_CONTENTS 0x801B
+#define GLX_LARGEST_PBUFFER 0x801C
+#define GLX_WIDTH 0x801D
+#define GLX_HEIGHT 0x801E
+#define GLX_EVENT_MASK 0x801F
+#define GLX_DAMAGED 0x8020
+#define GLX_SAVED 0x8021
+#define GLX_WINDOW 0x8022
+#define GLX_PBUFFER 0x8023
+#define GLX_PBUFFER_HEIGHT 0x8040
+#define GLX_PBUFFER_WIDTH 0x8041
+#define GLX_RGBA_BIT 0x00000001
+#define GLX_COLOR_INDEX_BIT 0x00000002
+#define GLX_PBUFFER_CLOBBER_MASK 0x08000000
+
+
+/*
+ * GLX 1.4 and later:
+ */
+#define GLX_SAMPLE_BUFFERS 0x186a0 /*100000*/
+#define GLX_SAMPLES 0x186a1 /*100001*/
+
+
+
+typedef struct __GLXcontextRec *GLXContext;
+typedef XID GLXPixmap;
+typedef XID GLXDrawable;
+/* GLX 1.3 and later */
+typedef struct __GLXFBConfigRec *GLXFBConfig;
+typedef XID GLXFBConfigID;
+typedef XID GLXContextID;
+typedef XID GLXWindow;
+typedef XID GLXPbuffer;
+
+
+/*
+** Events.
+** __GLX_NUMBER_EVENTS is set to 17 to account for the BufferClobberSGIX
+** event - this helps initialization if the server supports the pbuffer
+** extension and the client doesn't.
+*/
+#define GLX_PbufferClobber 0
+#define GLX_BufferSwapComplete 1
+
+#define __GLX_NUMBER_EVENTS 17
+
+extern XVisualInfo* glXChooseVisual( Display *dpy, int screen,
+ int *attribList );
+
+extern GLXContext glXCreateContext( Display *dpy, XVisualInfo *vis,
+ GLXContext shareList, Bool direct );
+
+extern void glXDestroyContext( Display *dpy, GLXContext ctx );
+
+extern Bool glXMakeCurrent( Display *dpy, GLXDrawable drawable,
+ GLXContext ctx);
+
+extern void glXCopyContext( Display *dpy, GLXContext src, GLXContext dst,
+ unsigned long mask );
+
+extern void glXSwapBuffers( Display *dpy, GLXDrawable drawable );
+
+extern GLXPixmap glXCreateGLXPixmap( Display *dpy, XVisualInfo *visual,
+ Pixmap pixmap );
+
+extern void glXDestroyGLXPixmap( Display *dpy, GLXPixmap pixmap );
+
+extern Bool glXQueryExtension( Display *dpy, int *errorb, int *event );
+
+extern Bool glXQueryVersion( Display *dpy, int *maj, int *min );
+
+extern Bool glXIsDirect( Display *dpy, GLXContext ctx );
+
+extern int glXGetConfig( Display *dpy, XVisualInfo *visual,
+ int attrib, int *value );
+
+extern GLXContext glXGetCurrentContext( void );
+
+extern GLXDrawable glXGetCurrentDrawable( void );
+
+extern void glXWaitGL( void );
+
+extern void glXWaitX( void );
+
+extern void glXUseXFont( Font font, int first, int count, int list );
+
+
+
+/* GLX 1.1 and later */
+extern const char *glXQueryExtensionsString( Display *dpy, int screen );
+
+extern const char *glXQueryServerString( Display *dpy, int screen, int name );
+
+extern const char *glXGetClientString( Display *dpy, int name );
+
+
+/* GLX 1.2 and later */
+extern Display *glXGetCurrentDisplay( void );
+
+
+/* GLX 1.3 and later */
+extern GLXFBConfig *glXChooseFBConfig( Display *dpy, int screen,
+ const int *attribList, int *nitems );
+
+extern int glXGetFBConfigAttrib( Display *dpy, GLXFBConfig config,
+ int attribute, int *value );
+
+extern GLXFBConfig *glXGetFBConfigs( Display *dpy, int screen,
+ int *nelements );
+
+extern XVisualInfo *glXGetVisualFromFBConfig( Display *dpy,
+ GLXFBConfig config );
+
+extern GLXWindow glXCreateWindow( Display *dpy, GLXFBConfig config,
+ Window win, const int *attribList );
+
+extern void glXDestroyWindow( Display *dpy, GLXWindow window );
+
+extern GLXPixmap glXCreatePixmap( Display *dpy, GLXFBConfig config,
+ Pixmap pixmap, const int *attribList );
+
+extern void glXDestroyPixmap( Display *dpy, GLXPixmap pixmap );
+
+extern GLXPbuffer glXCreatePbuffer( Display *dpy, GLXFBConfig config,
+ const int *attribList );
+
+extern void glXDestroyPbuffer( Display *dpy, GLXPbuffer pbuf );
+
+extern void glXQueryDrawable( Display *dpy, GLXDrawable draw, int attribute,
+ unsigned int *value );
+
+extern GLXContext glXCreateNewContext( Display *dpy, GLXFBConfig config,
+ int renderType, GLXContext shareList,
+ Bool direct );
+
+extern Bool glXMakeContextCurrent( Display *dpy, GLXDrawable draw,
+ GLXDrawable read, GLXContext ctx );
+
+extern GLXDrawable glXGetCurrentReadDrawable( void );
+
+extern int glXQueryContext( Display *dpy, GLXContext ctx, int attribute,
+ int *value );
+
+extern void glXSelectEvent( Display *dpy, GLXDrawable drawable,
+ unsigned long mask );
+
+extern void glXGetSelectedEvent( Display *dpy, GLXDrawable drawable,
+ unsigned long *mask );
+
+/* GLX 1.3 function pointer typedefs */
+typedef GLXFBConfig * (* PFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements);
+typedef GLXFBConfig * (* PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements);
+typedef int (* PFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value);
+typedef XVisualInfo * (* PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config);
+typedef GLXWindow (* PFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list);
+typedef void (* PFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win);
+typedef GLXPixmap (* PFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list);
+typedef void (* PFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap);
+typedef GLXPbuffer (* PFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list);
+typedef void (* PFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf);
+typedef void (* PFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
+typedef GLXContext (* PFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
+typedef Bool (* PFNGLXMAKECONTEXTCURRENTPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
+typedef GLXDrawable (* PFNGLXGETCURRENTREADDRAWABLEPROC) (void);
+typedef Display * (* PFNGLXGETCURRENTDISPLAYPROC) (void);
+typedef int (* PFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value);
+typedef void (* PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask);
+typedef void (* PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask);
+
+
+/*
+ * ARB 2. GLX_ARB_get_proc_address
+ */
+#ifndef GLX_ARB_get_proc_address
+#define GLX_ARB_get_proc_address 1
+
+typedef void (*__GLXextFuncPtr)(void);
+extern __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *);
+
+#endif /* GLX_ARB_get_proc_address */
+
+
+
+/* GLX 1.4 and later */
+extern void (*glXGetProcAddress(const GLubyte *procname))( void );
+
+/* GLX 1.4 function pointer typedefs */
+typedef __GLXextFuncPtr (* PFNGLXGETPROCADDRESSPROC) (const GLubyte *procName);
+
+
+#ifndef GLX_GLXEXT_LEGACY
+
+#include <GL/glxext.h>
+
+#endif /* GLX_GLXEXT_LEGACY */
+
+
+/**
+ ** The following aren't in glxext.h yet.
+ **/
+
+
+/*
+ * ???. GLX_NV_vertex_array_range
+ */
+#ifndef GLX_NV_vertex_array_range
+#define GLX_NV_vertex_array_range
+
+extern void *glXAllocateMemoryNV(GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
+extern void glXFreeMemoryNV(GLvoid *pointer);
+typedef void * ( * PFNGLXALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
+typedef void ( * PFNGLXFREEMEMORYNVPROC) (GLvoid *pointer);
+
+#endif /* GLX_NV_vertex_array_range */
+
+
+/*
+ * ARB ?. GLX_ARB_render_texture
+ * XXX This was never finalized!
+ */
+#ifndef GLX_ARB_render_texture
+#define GLX_ARB_render_texture 1
+
+extern Bool glXBindTexImageARB(Display *dpy, GLXPbuffer pbuffer, int buffer);
+extern Bool glXReleaseTexImageARB(Display *dpy, GLXPbuffer pbuffer, int buffer);
+extern Bool glXDrawableAttribARB(Display *dpy, GLXDrawable draw, const int *attribList);
+
+#endif /* GLX_ARB_render_texture */
+
+
+/*
+ * Remove this when glxext.h is updated.
+ */
+#ifndef GLX_NV_float_buffer
+#define GLX_NV_float_buffer 1
+
+#define GLX_FLOAT_COMPONENTS_NV 0x20B0
+
+#endif /* GLX_NV_float_buffer */
+
+
+
+/*
+ * #?. GLX_MESA_swap_frame_usage
+ */
+#ifndef GLX_MESA_swap_frame_usage
+#define GLX_MESA_swap_frame_usage 1
+
+extern int glXGetFrameUsageMESA(Display *dpy, GLXDrawable drawable, float *usage);
+extern int glXBeginFrameTrackingMESA(Display *dpy, GLXDrawable drawable);
+extern int glXEndFrameTrackingMESA(Display *dpy, GLXDrawable drawable);
+extern int glXQueryFrameTrackingMESA(Display *dpy, GLXDrawable drawable, int64_t *swapCount, int64_t *missedFrames, float *lastMissedUsage);
+
+typedef int (*PFNGLXGETFRAMEUSAGEMESAPROC) (Display *dpy, GLXDrawable drawable, float *usage);
+typedef int (*PFNGLXBEGINFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable);
+typedef int (*PFNGLXENDFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable);
+typedef int (*PFNGLXQUERYFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable, int64_t *swapCount, int64_t *missedFrames, float *lastMissedUsage);
+
+#endif /* GLX_MESA_swap_frame_usage */
+
+
+
+/*
+ * #?. GLX_MESA_swap_control
+ */
+#ifndef GLX_MESA_swap_control
+#define GLX_MESA_swap_control 1
+
+extern int glXSwapIntervalMESA(unsigned int interval);
+extern int glXGetSwapIntervalMESA(void);
+
+typedef int (*PFNGLXSWAPINTERVALMESAPROC)(unsigned int interval);
+typedef int (*PFNGLXGETSWAPINTERVALMESAPROC)(void);
+
+#endif /* GLX_MESA_swap_control */
+
+
+
+/*
+ * #?. GLX_EXT_texture_from_pixmap
+ * XXX not finished?
+ */
+#ifndef GLX_EXT_texture_from_pixmap
+#define GLX_EXT_texture_from_pixmap 1
+
+#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0
+#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1
+#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2
+#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3
+#define GLX_Y_INVERTED_EXT 0x20D4
+
+#define GLX_TEXTURE_FORMAT_EXT 0x20D5
+#define GLX_TEXTURE_TARGET_EXT 0x20D6
+#define GLX_MIPMAP_TEXTURE_EXT 0x20D7
+
+#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8
+#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9
+#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA
+
+#define GLX_TEXTURE_1D_BIT_EXT 0x00000001
+#define GLX_TEXTURE_2D_BIT_EXT 0x00000002
+#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004
+
+#define GLX_TEXTURE_1D_EXT 0x20DB
+#define GLX_TEXTURE_2D_EXT 0x20DC
+#define GLX_TEXTURE_RECTANGLE_EXT 0x20DD
+
+#define GLX_FRONT_LEFT_EXT 0x20DE
+#define GLX_FRONT_RIGHT_EXT 0x20DF
+#define GLX_BACK_LEFT_EXT 0x20E0
+#define GLX_BACK_RIGHT_EXT 0x20E1
+#define GLX_FRONT_EXT GLX_FRONT_LEFT_EXT
+#define GLX_BACK_EXT GLX_BACK_LEFT_EXT
+#define GLX_AUX0_EXT 0x20E2
+#define GLX_AUX1_EXT 0x20E3
+#define GLX_AUX2_EXT 0x20E4
+#define GLX_AUX3_EXT 0x20E5
+#define GLX_AUX4_EXT 0x20E6
+#define GLX_AUX5_EXT 0x20E7
+#define GLX_AUX6_EXT 0x20E8
+#define GLX_AUX7_EXT 0x20E9
+#define GLX_AUX8_EXT 0x20EA
+#define GLX_AUX9_EXT 0x20EB
+
+extern void glXBindTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list);
+extern void glXReleaseTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer);
+
+#endif /* GLX_EXT_texture_from_pixmap */
+
+
+
+
+/*** Should these go here, or in another header? */
+/*
+** GLX Events
+*/
+typedef struct {
+ int event_type; /* GLX_DAMAGED or GLX_SAVED */
+ int draw_type; /* GLX_WINDOW or GLX_PBUFFER */
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came for SendEvent request */
+ Display *display; /* display the event was read from */
+ GLXDrawable drawable; /* XID of Drawable */
+ unsigned int buffer_mask; /* mask indicating which buffers are affected */
+ unsigned int aux_buffer; /* which aux buffer was affected */
+ int x, y;
+ int width, height;
+ int count; /* if nonzero, at least this many more */
+} GLXPbufferClobberEvent;
+
+typedef struct {
+ int type;
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ GLXDrawable drawable; /* drawable on which event was requested in event mask */
+ int event_type;
+ int64_t ust;
+ int64_t msc;
+ int64_t sbc;
+} GLXBufferSwapComplete;
+
+typedef union __GLXEvent {
+ GLXPbufferClobberEvent glxpbufferclobber;
+ GLXBufferSwapComplete glxbufferswapcomplete;
+ long pad[24];
+} GLXEvent;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/hw/yagl/yagl_inc/GL/glx_mangle.h b/hw/yagl/yagl_inc/GL/glx_mangle.h
new file mode 100644
index 0000000000..fa664a7f59
--- /dev/null
+++ b/hw/yagl/yagl_inc/GL/glx_mangle.h
@@ -0,0 +1,82 @@
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#ifndef GLX_MANGLE_H
+#define GLX_MANGLE_H
+
+#define glXChooseVisual mglXChooseVisual
+#define glXCreateContext mglXCreateContext
+#define glXDestroyContext mglXDestroyContext
+#define glXMakeCurrent mglXMakeCurrent
+#define glXCopyContext mglXCopyContext
+#define glXSwapBuffers mglXSwapBuffers
+#define glXCreateGLXPixmap mglXCreateGLXPixmap
+#define glXDestroyGLXPixmap mglXDestroyGLXPixmap
+#define glXQueryExtension mglXQueryExtension
+#define glXQueryVersion mglXQueryVersion
+#define glXIsDirect mglXIsDirect
+#define glXGetConfig mglXGetConfig
+#define glXGetCurrentContext mglXGetCurrentContext
+#define glXGetCurrentDrawable mglXGetCurrentDrawable
+#define glXWaitGL mglXWaitGL
+#define glXWaitX mglXWaitX
+#define glXUseXFont mglXUseXFont
+#define glXQueryExtensionsString mglXQueryExtensionsString
+#define glXQueryServerString mglXQueryServerString
+#define glXGetClientString mglXGetClientString
+#define glXCreateGLXPixmapMESA mglXCreateGLXPixmapMESA
+#define glXReleaseBuffersMESA mglXReleaseBuffersMESA
+#define glXCopySubBufferMESA mglXCopySubBufferMESA
+#define glXGetVideoSyncSGI mglXGetVideoSyncSGI
+#define glXWaitVideoSyncSGI mglXWaitVideoSyncSGI
+
+/* GLX 1.2 */
+#define glXGetCurrentDisplay mglXGetCurrentDisplay
+
+/* GLX 1.3 */
+#define glXChooseFBConfig mglXChooseFBConfig
+#define glXGetFBConfigAttrib mglXGetFBConfigAttrib
+#define glXGetFBConfigs mglXGetFBConfigs
+#define glXGetVisualFromFBConfig mglXGetVisualFromFBConfig
+#define glXCreateWindow mglXCreateWindow
+#define glXDestroyWindow mglXDestroyWindow
+#define glXCreatePixmap mglXCreatePixmap
+#define glXDestroyPixmap mglXDestroyPixmap
+#define glXCreatePbuffer mglXCreatePbuffer
+#define glXDestroyPbuffer mglXDestroyPbuffer
+#define glXQueryDrawable mglXQueryDrawable
+#define glXCreateNewContext mglXCreateNewContext
+#define glXMakeContextCurrent mglXMakeContextCurrent
+#define glXGetCurrentReadDrawable mglXGetCurrentReadDrawable
+#define glXQueryContext mglXQueryContext
+#define glXSelectEvent mglXSelectEvent
+#define glXGetSelectedEvent mglXGetSelectedEvent
+
+/* GLX 1.4 */
+#define glXGetProcAddress mglXGetProcAddress
+#define glXGetProcAddressARB mglXGetProcAddressARB
+
+
+#endif
diff --git a/hw/yagl/yagl_inc/GL/glxext.h b/hw/yagl/yagl_inc/GL/glxext.h
new file mode 100644
index 0000000000..3c47dc363e
--- /dev/null
+++ b/hw/yagl/yagl_inc/GL/glxext.h
@@ -0,0 +1,993 @@
+#ifndef __glxext_h_
+#define __glxext_h_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+** Copyright (c) 2007-2010 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
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+
+/* Function declaration macros - to move into glplatform.h */
+
+#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
+#define WIN32_LEAN_AND_MEAN 1
+#include <windows.h>
+#endif
+
+#ifndef APIENTRY
+#define APIENTRY
+#endif
+#ifndef APIENTRYP
+#define APIENTRYP APIENTRY *
+#endif
+#ifndef GLAPI
+#define GLAPI extern
+#endif
+
+/*************************************************************/
+
+/* Header file version number, required by OpenGL ABI for Linux */
+/* glxext.h last updated 2010/08/06 */
+/* Current version at http://www.opengl.org/registry/ */
+#define GLX_GLXEXT_VERSION 32
+
+#ifndef GLX_VERSION_1_3
+#define GLX_WINDOW_BIT 0x00000001
+#define GLX_PIXMAP_BIT 0x00000002
+#define GLX_PBUFFER_BIT 0x00000004
+#define GLX_RGBA_BIT 0x00000001
+#define GLX_COLOR_INDEX_BIT 0x00000002
+#define GLX_PBUFFER_CLOBBER_MASK 0x08000000
+#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001
+#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002
+#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004
+#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008
+#define GLX_AUX_BUFFERS_BIT 0x00000010
+#define GLX_DEPTH_BUFFER_BIT 0x00000020
+#define GLX_STENCIL_BUFFER_BIT 0x00000040
+#define GLX_ACCUM_BUFFER_BIT 0x00000080
+#define GLX_CONFIG_CAVEAT 0x20
+#define GLX_X_VISUAL_TYPE 0x22
+#define GLX_TRANSPARENT_TYPE 0x23
+#define GLX_TRANSPARENT_INDEX_VALUE 0x24
+#define GLX_TRANSPARENT_RED_VALUE 0x25
+#define GLX_TRANSPARENT_GREEN_VALUE 0x26
+#define GLX_TRANSPARENT_BLUE_VALUE 0x27
+#define GLX_TRANSPARENT_ALPHA_VALUE 0x28
+#define GLX_DONT_CARE 0xFFFFFFFF
+#define GLX_NONE 0x8000
+#define GLX_SLOW_CONFIG 0x8001
+#define GLX_TRUE_COLOR 0x8002
+#define GLX_DIRECT_COLOR 0x8003
+#define GLX_PSEUDO_COLOR 0x8004
+#define GLX_STATIC_COLOR 0x8005
+#define GLX_GRAY_SCALE 0x8006
+#define GLX_STATIC_GRAY 0x8007
+#define GLX_TRANSPARENT_RGB 0x8008
+#define GLX_TRANSPARENT_INDEX 0x8009
+#define GLX_VISUAL_ID 0x800B
+#define GLX_SCREEN 0x800C
+#define GLX_NON_CONFORMANT_CONFIG 0x800D
+#define GLX_DRAWABLE_TYPE 0x8010
+#define GLX_RENDER_TYPE 0x8011
+#define GLX_X_RENDERABLE 0x8012
+#define GLX_FBCONFIG_ID 0x8013
+#define GLX_RGBA_TYPE 0x8014
+#define GLX_COLOR_INDEX_TYPE 0x8015
+#define GLX_MAX_PBUFFER_WIDTH 0x8016
+#define GLX_MAX_PBUFFER_HEIGHT 0x8017
+#define GLX_MAX_PBUFFER_PIXELS 0x8018
+#define GLX_PRESERVED_CONTENTS 0x801B
+#define GLX_LARGEST_PBUFFER 0x801C
+#define GLX_WIDTH 0x801D
+#define GLX_HEIGHT 0x801E
+#define GLX_EVENT_MASK 0x801F
+#define GLX_DAMAGED 0x8020
+#define GLX_SAVED 0x8021
+#define GLX_WINDOW 0x8022
+#define GLX_PBUFFER 0x8023
+#define GLX_PBUFFER_HEIGHT 0x8040
+#define GLX_PBUFFER_WIDTH 0x8041
+#endif
+
+#ifndef GLX_VERSION_1_4
+#define GLX_SAMPLE_BUFFERS 100000
+#define GLX_SAMPLES 100001
+#endif
+
+#ifndef GLX_ARB_get_proc_address
+#endif
+
+#ifndef GLX_ARB_multisample
+#define GLX_SAMPLE_BUFFERS_ARB 100000
+#define GLX_SAMPLES_ARB 100001
+#endif
+
+#ifndef GLX_ARB_vertex_buffer_object
+#define GLX_CONTEXT_ALLOW_BUFFER_BYTE_ORDER_MISMATCH_ARB 0x2095
+#endif
+
+#ifndef GLX_ARB_fbconfig_float
+#define GLX_RGBA_FLOAT_TYPE_ARB 0x20B9
+#define GLX_RGBA_FLOAT_BIT_ARB 0x00000004
+#endif
+
+#ifndef GLX_ARB_framebuffer_sRGB
+#define GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20B2
+#endif
+
+#ifndef GLX_ARB_create_context
+#define GLX_CONTEXT_DEBUG_BIT_ARB 0x00000001
+#define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002
+#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091
+#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092
+#define GLX_CONTEXT_FLAGS_ARB 0x2094
+#endif
+
+#ifndef GLX_ARB_create_context_profile
+#define GLX_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001
+#define GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002
+#define GLX_CONTEXT_PROFILE_MASK_ARB 0x9126
+#endif
+
+#ifndef GLX_ARB_create_context_robustness
+#define GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004
+#define GLX_LOSE_CONTEXT_ON_RESET_ARB 0x8252
+#define GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
+#define GLX_NO_RESET_NOTIFICATION_ARB 0x8261
+#endif
+
+#ifndef GLX_SGIS_multisample
+#define GLX_SAMPLE_BUFFERS_SGIS 100000
+#define GLX_SAMPLES_SGIS 100001
+#endif
+
+#ifndef GLX_EXT_visual_info
+#define GLX_X_VISUAL_TYPE_EXT 0x22
+#define GLX_TRANSPARENT_TYPE_EXT 0x23
+#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24
+#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25
+#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26
+#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27
+#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28
+#define GLX_NONE_EXT 0x8000
+#define GLX_TRUE_COLOR_EXT 0x8002
+#define GLX_DIRECT_COLOR_EXT 0x8003
+#define GLX_PSEUDO_COLOR_EXT 0x8004
+#define GLX_STATIC_COLOR_EXT 0x8005
+#define GLX_GRAY_SCALE_EXT 0x8006
+#define GLX_STATIC_GRAY_EXT 0x8007
+#define GLX_TRANSPARENT_RGB_EXT 0x8008
+#define GLX_TRANSPARENT_INDEX_EXT 0x8009
+#endif
+
+#ifndef GLX_SGI_swap_control
+#endif
+
+#ifndef GLX_SGI_video_sync
+#endif
+
+#ifndef GLX_SGI_make_current_read
+#endif
+
+#ifndef GLX_SGIX_video_source
+#endif
+
+#ifndef GLX_EXT_visual_rating
+#define GLX_VISUAL_CAVEAT_EXT 0x20
+#define GLX_SLOW_VISUAL_EXT 0x8001
+#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D
+/* reuse GLX_NONE_EXT */
+#endif
+
+#ifndef GLX_EXT_import_context
+#define GLX_SHARE_CONTEXT_EXT 0x800A
+#define GLX_VISUAL_ID_EXT 0x800B
+#define GLX_SCREEN_EXT 0x800C
+#endif
+
+#ifndef GLX_SGIX_fbconfig
+#define GLX_WINDOW_BIT_SGIX 0x00000001
+#define GLX_PIXMAP_BIT_SGIX 0x00000002
+#define GLX_RGBA_BIT_SGIX 0x00000001
+#define GLX_COLOR_INDEX_BIT_SGIX 0x00000002
+#define GLX_DRAWABLE_TYPE_SGIX 0x8010
+#define GLX_RENDER_TYPE_SGIX 0x8011
+#define GLX_X_RENDERABLE_SGIX 0x8012
+#define GLX_FBCONFIG_ID_SGIX 0x8013
+#define GLX_RGBA_TYPE_SGIX 0x8014
+#define GLX_COLOR_INDEX_TYPE_SGIX 0x8015
+/* reuse GLX_SCREEN_EXT */
+#endif
+
+#ifndef GLX_SGIX_pbuffer
+#define GLX_PBUFFER_BIT_SGIX 0x00000004
+#define GLX_BUFFER_CLOBBER_MASK_SGIX 0x08000000
+#define GLX_FRONT_LEFT_BUFFER_BIT_SGIX 0x00000001
+#define GLX_FRONT_RIGHT_BUFFER_BIT_SGIX 0x00000002
+#define GLX_BACK_LEFT_BUFFER_BIT_SGIX 0x00000004
+#define GLX_BACK_RIGHT_BUFFER_BIT_SGIX 0x00000008
+#define GLX_AUX_BUFFERS_BIT_SGIX 0x00000010
+#define GLX_DEPTH_BUFFER_BIT_SGIX 0x00000020
+#define GLX_STENCIL_BUFFER_BIT_SGIX 0x00000040
+#define GLX_ACCUM_BUFFER_BIT_SGIX 0x00000080
+#define GLX_SAMPLE_BUFFERS_BIT_SGIX 0x00000100
+#define GLX_MAX_PBUFFER_WIDTH_SGIX 0x8016
+#define GLX_MAX_PBUFFER_HEIGHT_SGIX 0x8017
+#define GLX_MAX_PBUFFER_PIXELS_SGIX 0x8018
+#define GLX_OPTIMAL_PBUFFER_WIDTH_SGIX 0x8019
+#define GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX 0x801A
+#define GLX_PRESERVED_CONTENTS_SGIX 0x801B
+#define GLX_LARGEST_PBUFFER_SGIX 0x801C
+#define GLX_WIDTH_SGIX 0x801D
+#define GLX_HEIGHT_SGIX 0x801E
+#define GLX_EVENT_MASK_SGIX 0x801F
+#define GLX_DAMAGED_SGIX 0x8020
+#define GLX_SAVED_SGIX 0x8021
+#define GLX_WINDOW_SGIX 0x8022
+#define GLX_PBUFFER_SGIX 0x8023
+#endif
+
+#ifndef GLX_SGI_cushion
+#endif
+
+#ifndef GLX_SGIX_video_resize
+#define GLX_SYNC_FRAME_SGIX 0x00000000
+#define GLX_SYNC_SWAP_SGIX 0x00000001
+#endif
+
+#ifndef GLX_SGIX_dmbuffer
+#define GLX_DIGITAL_MEDIA_PBUFFER_SGIX 0x8024
+#endif
+
+#ifndef GLX_SGIX_swap_group
+#endif
+
+#ifndef GLX_SGIX_swap_barrier
+#endif
+
+#ifndef GLX_SGIS_blended_overlay
+#define GLX_BLENDED_RGBA_SGIS 0x8025
+#endif
+
+#ifndef GLX_SGIS_shared_multisample
+#define GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026
+#define GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027
+#endif
+
+#ifndef GLX_SUN_get_transparent_index
+#endif
+
+#ifndef GLX_3DFX_multisample
+#define GLX_SAMPLE_BUFFERS_3DFX 0x8050
+#define GLX_SAMPLES_3DFX 0x8051
+#endif
+
+#ifndef GLX_MESA_copy_sub_buffer
+#endif
+
+#ifndef GLX_MESA_pixmap_colormap
+#endif
+
+#ifndef GLX_MESA_release_buffers
+#endif
+
+#ifndef GLX_MESA_set_3dfx_mode
+#define GLX_3DFX_WINDOW_MODE_MESA 0x1
+#define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2
+#endif
+
+#ifndef GLX_SGIX_visual_select_group
+#define GLX_VISUAL_SELECT_GROUP_SGIX 0x8028
+#endif
+
+#ifndef GLX_OML_swap_method
+#define GLX_SWAP_METHOD_OML 0x8060
+#define GLX_SWAP_EXCHANGE_OML 0x8061
+#define GLX_SWAP_COPY_OML 0x8062
+#define GLX_SWAP_UNDEFINED_OML 0x8063
+#endif
+
+#ifndef GLX_OML_sync_control
+#endif
+
+#ifndef GLX_NV_float_buffer
+#define GLX_FLOAT_COMPONENTS_NV 0x20B0
+#endif
+
+#ifndef GLX_SGIX_hyperpipe
+#define GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80
+#define GLX_BAD_HYPERPIPE_CONFIG_SGIX 91
+#define GLX_BAD_HYPERPIPE_SGIX 92
+#define GLX_HYPERPIPE_DISPLAY_PIPE_SGIX 0x00000001
+#define GLX_HYPERPIPE_RENDER_PIPE_SGIX 0x00000002
+#define GLX_PIPE_RECT_SGIX 0x00000001
+#define GLX_PIPE_RECT_LIMITS_SGIX 0x00000002
+#define GLX_HYPERPIPE_STEREO_SGIX 0x00000003
+#define GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX 0x00000004
+#define GLX_HYPERPIPE_ID_SGIX 0x8030
+#endif
+
+#ifndef GLX_MESA_agp_offset
+#endif
+
+#ifndef GLX_EXT_fbconfig_packed_float
+#define GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1
+#define GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008
+#endif
+
+#ifndef GLX_EXT_framebuffer_sRGB
+#define GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20B2
+#endif
+
+#ifndef GLX_EXT_texture_from_pixmap
+#define GLX_TEXTURE_1D_BIT_EXT 0x00000001
+#define GLX_TEXTURE_2D_BIT_EXT 0x00000002
+#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004
+#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0
+#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1
+#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2
+#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3
+#define GLX_Y_INVERTED_EXT 0x20D4
+#define GLX_TEXTURE_FORMAT_EXT 0x20D5
+#define GLX_TEXTURE_TARGET_EXT 0x20D6
+#define GLX_MIPMAP_TEXTURE_EXT 0x20D7
+#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8
+#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9
+#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA
+#define GLX_TEXTURE_1D_EXT 0x20DB
+#define GLX_TEXTURE_2D_EXT 0x20DC
+#define GLX_TEXTURE_RECTANGLE_EXT 0x20DD
+#define GLX_FRONT_LEFT_EXT 0x20DE
+#define GLX_FRONT_RIGHT_EXT 0x20DF
+#define GLX_BACK_LEFT_EXT 0x20E0
+#define GLX_BACK_RIGHT_EXT 0x20E1
+#define GLX_FRONT_EXT GLX_FRONT_LEFT_EXT
+#define GLX_BACK_EXT GLX_BACK_LEFT_EXT
+#define GLX_AUX0_EXT 0x20E2
+#define GLX_AUX1_EXT 0x20E3
+#define GLX_AUX2_EXT 0x20E4
+#define GLX_AUX3_EXT 0x20E5
+#define GLX_AUX4_EXT 0x20E6
+#define GLX_AUX5_EXT 0x20E7
+#define GLX_AUX6_EXT 0x20E8
+#define GLX_AUX7_EXT 0x20E9
+#define GLX_AUX8_EXT 0x20EA
+#define GLX_AUX9_EXT 0x20EB
+#endif
+
+#ifndef GLX_NV_present_video
+#define GLX_NUM_VIDEO_SLOTS_NV 0x20F0
+#endif
+
+#ifndef GLX_NV_video_out
+#define GLX_VIDEO_OUT_COLOR_NV 0x20C3
+#define GLX_VIDEO_OUT_ALPHA_NV 0x20C4
+#define GLX_VIDEO_OUT_DEPTH_NV 0x20C5
+#define GLX_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6
+#define GLX_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7
+#define GLX_VIDEO_OUT_FRAME_NV 0x20C8
+#define GLX_VIDEO_OUT_FIELD_1_NV 0x20C9
+#define GLX_VIDEO_OUT_FIELD_2_NV 0x20CA
+#define GLX_VIDEO_OUT_STACKED_FIELDS_1_2_NV 0x20CB
+#define GLX_VIDEO_OUT_STACKED_FIELDS_2_1_NV 0x20CC
+#endif
+
+#ifndef GLX_NV_swap_group
+#endif
+
+#ifndef GLX_NV_video_capture
+#define GLX_DEVICE_ID_NV 0x20CD
+#define GLX_UNIQUE_ID_NV 0x20CE
+#define GLX_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF
+#endif
+
+#ifndef GLX_EXT_swap_control
+#define GLX_SWAP_INTERVAL_EXT 0x20F1
+#define GLX_MAX_SWAP_INTERVAL_EXT 0x20F2
+#endif
+
+#ifndef GLX_NV_copy_image
+#endif
+
+#ifndef GLX_INTEL_swap_event
+#define GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK 0x04000000
+#define GLX_EXCHANGE_COMPLETE_INTEL 0x8180
+#define GLX_COPY_COMPLETE_INTEL 0x8181
+#define GLX_FLIP_COMPLETE_INTEL 0x8182
+#endif
+
+#ifndef GLX_NV_multisample_coverage
+#define GLX_COVERAGE_SAMPLES_NV 100001
+#define GLX_COLOR_SAMPLES_NV 0x20B3
+#endif
+
+#ifndef GLX_AMD_gpu_association
+#define GLX_GPU_VENDOR_AMD 0x1F00
+#define GLX_GPU_RENDERER_STRING_AMD 0x1F01
+#define GLX_GPU_OPENGL_VERSION_STRING_AMD 0x1F02
+#define GLX_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2
+#define GLX_GPU_RAM_AMD 0x21A3
+#define GLX_GPU_CLOCK_AMD 0x21A4
+#define GLX_GPU_NUM_PIPES_AMD 0x21A5
+#define GLX_GPU_NUM_SIMD_AMD 0x21A6
+#define GLX_GPU_NUM_RB_AMD 0x21A7
+#define GLX_GPU_NUM_SPI_AMD 0x21A8
+#endif
+
+#ifndef GLX_EXT_create_context_es2_profile
+#define GLX_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004
+#endif
+
+
+/*************************************************************/
+
+#ifndef GLX_ARB_get_proc_address
+typedef void (*__GLXextFuncPtr)(void);
+#endif
+
+#ifndef GLX_SGIX_video_source
+typedef XID GLXVideoSourceSGIX;
+#endif
+
+#ifndef GLX_SGIX_fbconfig
+typedef XID GLXFBConfigIDSGIX;
+typedef struct __GLXFBConfigRec *GLXFBConfigSGIX;
+#endif
+
+#ifndef GLX_SGIX_pbuffer
+typedef XID GLXPbufferSGIX;
+typedef struct {
+ int type;
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came for SendEvent request */
+ Display *display; /* display the event was read from */
+ GLXDrawable drawable; /* i.d. of Drawable */
+ int event_type; /* GLX_DAMAGED_SGIX or GLX_SAVED_SGIX */
+ int draw_type; /* GLX_WINDOW_SGIX or GLX_PBUFFER_SGIX */
+ unsigned int mask; /* mask indicating which buffers are affected*/
+ int x, y;
+ int width, height;
+ int count; /* if nonzero, at least this many more */
+} GLXBufferClobberEventSGIX;
+#endif
+
+#ifndef GLX_NV_video_output
+typedef unsigned int GLXVideoDeviceNV;
+#endif
+
+#ifndef GLX_NV_video_capture
+typedef XID GLXVideoCaptureDeviceNV;
+#endif
+
+#ifndef GLEXT_64_TYPES_DEFINED
+/* This code block is duplicated in glext.h, so must be protected */
+#define GLEXT_64_TYPES_DEFINED
+/* Define int32_t, int64_t, and uint64_t types for UST/MSC */
+/* (as used in the GLX_OML_sync_control extension). */
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+#include <inttypes.h>
+#elif defined(__sun__) || defined(__digital__)
+#include <inttypes.h>
+#if defined(__STDC__)
+#if defined(__arch64__) || defined(_LP64)
+typedef long int int64_t;
+typedef unsigned long int uint64_t;
+#else
+typedef long long int int64_t;
+typedef unsigned long long int uint64_t;
+#endif /* __arch64__ */
+#endif /* __STDC__ */
+#elif defined( __VMS ) || defined(__sgi)
+#include <inttypes.h>
+#elif defined(__SCO__) || defined(__USLC__)
+#include <stdint.h>
+#elif defined(__UNIXOS2__) || defined(__SOL64__)
+typedef long int int32_t;
+typedef long long int int64_t;
+typedef unsigned long long int uint64_t;
+#elif defined(_WIN32) && defined(__GNUC__)
+#include <stdint.h>
+#elif defined(_WIN32)
+typedef __int32 int32_t;
+typedef __int64 int64_t;
+typedef unsigned __int64 uint64_t;
+#else
+#include <inttypes.h> /* Fallback option */
+#endif
+#endif
+
+#ifndef GLX_VERSION_1_3
+#define GLX_VERSION_1_3 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern GLXFBConfig * glXGetFBConfigs (Display *dpy, int screen, int *nelements);
+extern GLXFBConfig * glXChooseFBConfig (Display *dpy, int screen, const int *attrib_list, int *nelements);
+extern int glXGetFBConfigAttrib (Display *dpy, GLXFBConfig config, int attribute, int *value);
+extern XVisualInfo * glXGetVisualFromFBConfig (Display *dpy, GLXFBConfig config);
+extern GLXWindow glXCreateWindow (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list);
+extern void glXDestroyWindow (Display *dpy, GLXWindow win);
+extern GLXPixmap glXCreatePixmap (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list);
+extern void glXDestroyPixmap (Display *dpy, GLXPixmap pixmap);
+extern GLXPbuffer glXCreatePbuffer (Display *dpy, GLXFBConfig config, const int *attrib_list);
+extern void glXDestroyPbuffer (Display *dpy, GLXPbuffer pbuf);
+extern void glXQueryDrawable (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
+extern GLXContext glXCreateNewContext (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
+extern Bool glXMakeContextCurrent (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
+extern GLXDrawable glXGetCurrentReadDrawable (void);
+extern Display * glXGetCurrentDisplay (void);
+extern int glXQueryContext (Display *dpy, GLXContext ctx, int attribute, int *value);
+extern void glXSelectEvent (Display *dpy, GLXDrawable draw, unsigned long event_mask);
+extern void glXGetSelectedEvent (Display *dpy, GLXDrawable draw, unsigned long *event_mask);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef GLXFBConfig * ( * PFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements);
+typedef GLXFBConfig * ( * PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements);
+typedef int ( * PFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value);
+typedef XVisualInfo * ( * PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config);
+typedef GLXWindow ( * PFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list);
+typedef void ( * PFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win);
+typedef GLXPixmap ( * PFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list);
+typedef void ( * PFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap);
+typedef GLXPbuffer ( * PFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list);
+typedef void ( * PFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf);
+typedef void ( * PFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
+typedef GLXContext ( * PFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
+typedef Bool ( * PFNGLXMAKECONTEXTCURRENTPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
+typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLEPROC) (void);
+typedef Display * ( * PFNGLXGETCURRENTDISPLAYPROC) (void);
+typedef int ( * PFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value);
+typedef void ( * PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask);
+typedef void ( * PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask);
+#endif
+
+#ifndef GLX_VERSION_1_4
+#define GLX_VERSION_1_4 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern __GLXextFuncPtr glXGetProcAddress (const GLubyte *procName);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSPROC) (const GLubyte *procName);
+#endif
+
+#ifndef GLX_ARB_get_proc_address
+#define GLX_ARB_get_proc_address 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *procName);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSARBPROC) (const GLubyte *procName);
+#endif
+
+#ifndef GLX_ARB_multisample
+#define GLX_ARB_multisample 1
+#endif
+
+#ifndef GLX_ARB_fbconfig_float
+#define GLX_ARB_fbconfig_float 1
+#endif
+
+#ifndef GLX_ARB_framebuffer_sRGB
+#define GLX_ARB_framebuffer_sRGB 1
+#endif
+
+#ifndef GLX_ARB_create_context
+#define GLX_ARB_create_context 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern GLXContext glXCreateContextAttribsARB (Display *dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef GLXContext ( * PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display *dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list);
+#endif
+
+#ifndef GLX_ARB_create_context_profile
+#define GLX_ARB_create_context_profile 1
+#endif
+
+#ifndef GLX_ARB_create_context_robustness
+#define GLX_ARB_create_context_robustness 1
+#endif
+
+#ifndef GLX_SGIS_multisample
+#define GLX_SGIS_multisample 1
+#endif
+
+#ifndef GLX_EXT_visual_info
+#define GLX_EXT_visual_info 1
+#endif
+
+#ifndef GLX_SGI_swap_control
+#define GLX_SGI_swap_control 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern int glXSwapIntervalSGI (int interval);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef int ( * PFNGLXSWAPINTERVALSGIPROC) (int interval);
+#endif
+
+#ifndef GLX_SGI_video_sync
+#define GLX_SGI_video_sync 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern int glXGetVideoSyncSGI (unsigned int *count);
+extern int glXWaitVideoSyncSGI (int divisor, int remainder, unsigned int *count);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef int ( * PFNGLXGETVIDEOSYNCSGIPROC) (unsigned int *count);
+typedef int ( * PFNGLXWAITVIDEOSYNCSGIPROC) (int divisor, int remainder, unsigned int *count);
+#endif
+
+#ifndef GLX_SGI_make_current_read
+#define GLX_SGI_make_current_read 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Bool glXMakeCurrentReadSGI (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
+extern GLXDrawable glXGetCurrentReadDrawableSGI (void);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Bool ( * PFNGLXMAKECURRENTREADSGIPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
+typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLESGIPROC) (void);
+#endif
+
+#ifndef GLX_SGIX_video_source
+#define GLX_SGIX_video_source 1
+#ifdef _VL_H
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern GLXVideoSourceSGIX glXCreateGLXVideoSourceSGIX (Display *display, int screen, VLServer server, VLPath path, int nodeClass, VLNode drainNode);
+extern void glXDestroyGLXVideoSourceSGIX (Display *dpy, GLXVideoSourceSGIX glxvideosource);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef GLXVideoSourceSGIX ( * PFNGLXCREATEGLXVIDEOSOURCESGIXPROC) (Display *display, int screen, VLServer server, VLPath path, int nodeClass, VLNode drainNode);
+typedef void ( * PFNGLXDESTROYGLXVIDEOSOURCESGIXPROC) (Display *dpy, GLXVideoSourceSGIX glxvideosource);
+#endif /* _VL_H */
+#endif
+
+#ifndef GLX_EXT_visual_rating
+#define GLX_EXT_visual_rating 1
+#endif
+
+#ifndef GLX_EXT_import_context
+#define GLX_EXT_import_context 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Display * glXGetCurrentDisplayEXT (void);
+extern int glXQueryContextInfoEXT (Display *dpy, GLXContext context, int attribute, int *value);
+extern GLXContextID glXGetContextIDEXT (const GLXContext context);
+extern GLXContext glXImportContextEXT (Display *dpy, GLXContextID contextID);
+extern void glXFreeContextEXT (Display *dpy, GLXContext context);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Display * ( * PFNGLXGETCURRENTDISPLAYEXTPROC) (void);
+typedef int ( * PFNGLXQUERYCONTEXTINFOEXTPROC) (Display *dpy, GLXContext context, int attribute, int *value);
+typedef GLXContextID ( * PFNGLXGETCONTEXTIDEXTPROC) (const GLXContext context);
+typedef GLXContext ( * PFNGLXIMPORTCONTEXTEXTPROC) (Display *dpy, GLXContextID contextID);
+typedef void ( * PFNGLXFREECONTEXTEXTPROC) (Display *dpy, GLXContext context);
+#endif
+
+#ifndef GLX_SGIX_fbconfig
+#define GLX_SGIX_fbconfig 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern int glXGetFBConfigAttribSGIX (Display *dpy, GLXFBConfigSGIX config, int attribute, int *value);
+extern GLXFBConfigSGIX * glXChooseFBConfigSGIX (Display *dpy, int screen, int *attrib_list, int *nelements);
+extern GLXPixmap glXCreateGLXPixmapWithConfigSGIX (Display *dpy, GLXFBConfigSGIX config, Pixmap pixmap);
+extern GLXContext glXCreateContextWithConfigSGIX (Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct);
+extern XVisualInfo * glXGetVisualFromFBConfigSGIX (Display *dpy, GLXFBConfigSGIX config);
+extern GLXFBConfigSGIX glXGetFBConfigFromVisualSGIX (Display *dpy, XVisualInfo *vis);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef int ( * PFNGLXGETFBCONFIGATTRIBSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, int attribute, int *value);
+typedef GLXFBConfigSGIX * ( * PFNGLXCHOOSEFBCONFIGSGIXPROC) (Display *dpy, int screen, int *attrib_list, int *nelements);
+typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, Pixmap pixmap);
+typedef GLXContext ( * PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct);
+typedef XVisualInfo * ( * PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config);
+typedef GLXFBConfigSGIX ( * PFNGLXGETFBCONFIGFROMVISUALSGIXPROC) (Display *dpy, XVisualInfo *vis);
+#endif
+
+#ifndef GLX_SGIX_pbuffer
+#define GLX_SGIX_pbuffer 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern GLXPbufferSGIX glXCreateGLXPbufferSGIX (Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list);
+extern void glXDestroyGLXPbufferSGIX (Display *dpy, GLXPbufferSGIX pbuf);
+extern int glXQueryGLXPbufferSGIX (Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value);
+extern void glXSelectEventSGIX (Display *dpy, GLXDrawable drawable, unsigned long mask);
+extern void glXGetSelectedEventSGIX (Display *dpy, GLXDrawable drawable, unsigned long *mask);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef GLXPbufferSGIX ( * PFNGLXCREATEGLXPBUFFERSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list);
+typedef void ( * PFNGLXDESTROYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf);
+typedef int ( * PFNGLXQUERYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value);
+typedef void ( * PFNGLXSELECTEVENTSGIXPROC) (Display *dpy, GLXDrawable drawable, unsigned long mask);
+typedef void ( * PFNGLXGETSELECTEDEVENTSGIXPROC) (Display *dpy, GLXDrawable drawable, unsigned long *mask);
+#endif
+
+#ifndef GLX_SGI_cushion
+#define GLX_SGI_cushion 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern void glXCushionSGI (Display *dpy, Window window, float cushion);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef void ( * PFNGLXCUSHIONSGIPROC) (Display *dpy, Window window, float cushion);
+#endif
+
+#ifndef GLX_SGIX_video_resize
+#define GLX_SGIX_video_resize 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern int glXBindChannelToWindowSGIX (Display *display, int screen, int channel, Window window);
+extern int glXChannelRectSGIX (Display *display, int screen, int channel, int x, int y, int w, int h);
+extern int glXQueryChannelRectSGIX (Display *display, int screen, int channel, int *dx, int *dy, int *dw, int *dh);
+extern int glXQueryChannelDeltasSGIX (Display *display, int screen, int channel, int *x, int *y, int *w, int *h);
+extern int glXChannelRectSyncSGIX (Display *display, int screen, int channel, GLenum synctype);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef int ( * PFNGLXBINDCHANNELTOWINDOWSGIXPROC) (Display *display, int screen, int channel, Window window);
+typedef int ( * PFNGLXCHANNELRECTSGIXPROC) (Display *display, int screen, int channel, int x, int y, int w, int h);
+typedef int ( * PFNGLXQUERYCHANNELRECTSGIXPROC) (Display *display, int screen, int channel, int *dx, int *dy, int *dw, int *dh);
+typedef int ( * PFNGLXQUERYCHANNELDELTASSGIXPROC) (Display *display, int screen, int channel, int *x, int *y, int *w, int *h);
+typedef int ( * PFNGLXCHANNELRECTSYNCSGIXPROC) (Display *display, int screen, int channel, GLenum synctype);
+#endif
+
+#ifndef GLX_SGIX_dmbuffer
+#define GLX_SGIX_dmbuffer 1
+#ifdef _DM_BUFFER_H_
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Bool glXAssociateDMPbufferSGIX (Display *dpy, GLXPbufferSGIX pbuffer, DMparams *params, DMbuffer dmbuffer);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Bool ( * PFNGLXASSOCIATEDMPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuffer, DMparams *params, DMbuffer dmbuffer);
+#endif /* _DM_BUFFER_H_ */
+#endif
+
+#ifndef GLX_SGIX_swap_group
+#define GLX_SGIX_swap_group 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern void glXJoinSwapGroupSGIX (Display *dpy, GLXDrawable drawable, GLXDrawable member);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef void ( * PFNGLXJOINSWAPGROUPSGIXPROC) (Display *dpy, GLXDrawable drawable, GLXDrawable member);
+#endif
+
+#ifndef GLX_SGIX_swap_barrier
+#define GLX_SGIX_swap_barrier 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern void glXBindSwapBarrierSGIX (Display *dpy, GLXDrawable drawable, int barrier);
+extern Bool glXQueryMaxSwapBarriersSGIX (Display *dpy, int screen, int *max);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef void ( * PFNGLXBINDSWAPBARRIERSGIXPROC) (Display *dpy, GLXDrawable drawable, int barrier);
+typedef Bool ( * PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC) (Display *dpy, int screen, int *max);
+#endif
+
+#ifndef GLX_SUN_get_transparent_index
+#define GLX_SUN_get_transparent_index 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Status glXGetTransparentIndexSUN (Display *dpy, Window overlay, Window underlay, long *pTransparentIndex);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Status ( * PFNGLXGETTRANSPARENTINDEXSUNPROC) (Display *dpy, Window overlay, Window underlay, long *pTransparentIndex);
+#endif
+
+#ifndef GLX_MESA_copy_sub_buffer
+#define GLX_MESA_copy_sub_buffer 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern void glXCopySubBufferMESA (Display *dpy, GLXDrawable drawable, int x, int y, int width, int height);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef void ( * PFNGLXCOPYSUBBUFFERMESAPROC) (Display *dpy, GLXDrawable drawable, int x, int y, int width, int height);
+#endif
+
+#ifndef GLX_MESA_pixmap_colormap
+#define GLX_MESA_pixmap_colormap 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern GLXPixmap glXCreateGLXPixmapMESA (Display *dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPMESAPROC) (Display *dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap);
+#endif
+
+#ifndef GLX_MESA_release_buffers
+#define GLX_MESA_release_buffers 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Bool glXReleaseBuffersMESA (Display *dpy, GLXDrawable drawable);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Bool ( * PFNGLXRELEASEBUFFERSMESAPROC) (Display *dpy, GLXDrawable drawable);
+#endif
+
+#ifndef GLX_MESA_set_3dfx_mode
+#define GLX_MESA_set_3dfx_mode 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Bool glXSet3DfxModeMESA (int mode);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Bool ( * PFNGLXSET3DFXMODEMESAPROC) (int mode);
+#endif
+
+#ifndef GLX_SGIX_visual_select_group
+#define GLX_SGIX_visual_select_group 1
+#endif
+
+#ifndef GLX_OML_swap_method
+#define GLX_OML_swap_method 1
+#endif
+
+#ifndef GLX_OML_sync_control
+#define GLX_OML_sync_control 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Bool glXGetSyncValuesOML (Display *dpy, GLXDrawable drawable, int64_t *ust, int64_t *msc, int64_t *sbc);
+extern Bool glXGetMscRateOML (Display *dpy, GLXDrawable drawable, int32_t *numerator, int32_t *denominator);
+extern int64_t glXSwapBuffersMscOML (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder);
+extern Bool glXWaitForMscOML (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t *ust, int64_t *msc, int64_t *sbc);
+extern Bool glXWaitForSbcOML (Display *dpy, GLXDrawable drawable, int64_t target_sbc, int64_t *ust, int64_t *msc, int64_t *sbc);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Bool ( * PFNGLXGETSYNCVALUESOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t *ust, int64_t *msc, int64_t *sbc);
+typedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (Display *dpy, GLXDrawable drawable, int32_t *numerator, int32_t *denominator);
+typedef int64_t ( * PFNGLXSWAPBUFFERSMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder);
+typedef Bool ( * PFNGLXWAITFORMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t *ust, int64_t *msc, int64_t *sbc);
+typedef Bool ( * PFNGLXWAITFORSBCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_sbc, int64_t *ust, int64_t *msc, int64_t *sbc);
+#endif
+
+#ifndef GLX_NV_float_buffer
+#define GLX_NV_float_buffer 1
+#endif
+
+#ifndef GLX_SGIX_hyperpipe
+#define GLX_SGIX_hyperpipe 1
+
+typedef struct {
+ char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
+ int networkId;
+} GLXHyperpipeNetworkSGIX;
+
+typedef struct {
+ char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
+ int channel;
+ unsigned int
+ participationType;
+ int timeSlice;
+} GLXHyperpipeConfigSGIX;
+
+typedef struct {
+ char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
+ int srcXOrigin, srcYOrigin, srcWidth, srcHeight;
+ int destXOrigin, destYOrigin, destWidth, destHeight;
+} GLXPipeRect;
+
+typedef struct {
+ char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
+ int XOrigin, YOrigin, maxHeight, maxWidth;
+} GLXPipeRectLimits;
+
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern GLXHyperpipeNetworkSGIX * glXQueryHyperpipeNetworkSGIX (Display *dpy, int *npipes);
+extern int glXHyperpipeConfigSGIX (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId);
+extern GLXHyperpipeConfigSGIX * glXQueryHyperpipeConfigSGIX (Display *dpy, int hpId, int *npipes);
+extern int glXDestroyHyperpipeConfigSGIX (Display *dpy, int hpId);
+extern int glXBindHyperpipeSGIX (Display *dpy, int hpId);
+extern int glXQueryHyperpipeBestAttribSGIX (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList);
+extern int glXHyperpipeAttribSGIX (Display *dpy, int timeSlice, int attrib, int size, void *attribList);
+extern int glXQueryHyperpipeAttribSGIX (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef GLXHyperpipeNetworkSGIX * ( * PFNGLXQUERYHYPERPIPENETWORKSGIXPROC) (Display *dpy, int *npipes);
+typedef int ( * PFNGLXHYPERPIPECONFIGSGIXPROC) (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId);
+typedef GLXHyperpipeConfigSGIX * ( * PFNGLXQUERYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId, int *npipes);
+typedef int ( * PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId);
+typedef int ( * PFNGLXBINDHYPERPIPESGIXPROC) (Display *dpy, int hpId);
+typedef int ( * PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList);
+typedef int ( * PFNGLXHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList);
+typedef int ( * PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList);
+#endif
+
+#ifndef GLX_MESA_agp_offset
+#define GLX_MESA_agp_offset 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern unsigned int glXGetAGPOffsetMESA (const void *pointer);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef unsigned int ( * PFNGLXGETAGPOFFSETMESAPROC) (const void *pointer);
+#endif
+
+#ifndef GLX_EXT_fbconfig_packed_float
+#define GLX_EXT_fbconfig_packed_float 1
+#endif
+
+#ifndef GLX_EXT_framebuffer_sRGB
+#define GLX_EXT_framebuffer_sRGB 1
+#endif
+
+#ifndef GLX_EXT_texture_from_pixmap
+#define GLX_EXT_texture_from_pixmap 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern void glXBindTexImageEXT (Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list);
+extern void glXReleaseTexImageEXT (Display *dpy, GLXDrawable drawable, int buffer);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef void ( * PFNGLXBINDTEXIMAGEEXTPROC) (Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list);
+typedef void ( * PFNGLXRELEASETEXIMAGEEXTPROC) (Display *dpy, GLXDrawable drawable, int buffer);
+#endif
+
+#ifndef GLX_NV_present_video
+#define GLX_NV_present_video 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern unsigned int * glXEnumerateVideoDevicesNV (Display *dpy, int screen, int *nelements);
+extern int glXBindVideoDeviceNV (Display *dpy, unsigned int video_slot, unsigned int video_device, const int *attrib_list);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef unsigned int * ( * PFNGLXENUMERATEVIDEODEVICESNVPROC) (Display *dpy, int screen, int *nelements);
+typedef int ( * PFNGLXBINDVIDEODEVICENVPROC) (Display *dpy, unsigned int video_slot, unsigned int video_device, const int *attrib_list);
+#endif
+
+#ifndef GLX_NV_video_output
+#define GLX_NV_video_output 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern int glXGetVideoDeviceNV (Display *dpy, int screen, int numVideoDevices, GLXVideoDeviceNV *pVideoDevice);
+extern int glXReleaseVideoDeviceNV (Display *dpy, int screen, GLXVideoDeviceNV VideoDevice);
+extern int glXBindVideoImageNV (Display *dpy, GLXVideoDeviceNV VideoDevice, GLXPbuffer pbuf, int iVideoBuffer);
+extern int glXReleaseVideoImageNV (Display *dpy, GLXPbuffer pbuf);
+extern int glXSendPbufferToVideoNV (Display *dpy, GLXPbuffer pbuf, int iBufferType, unsigned long *pulCounterPbuffer, GLboolean bBlock);
+extern int glXGetVideoInfoNV (Display *dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef int ( * PFNGLXGETVIDEODEVICENVPROC) (Display *dpy, int screen, int numVideoDevices, GLXVideoDeviceNV *pVideoDevice);
+typedef int ( * PFNGLXRELEASEVIDEODEVICENVPROC) (Display *dpy, int screen, GLXVideoDeviceNV VideoDevice);
+typedef int ( * PFNGLXBINDVIDEOIMAGENVPROC) (Display *dpy, GLXVideoDeviceNV VideoDevice, GLXPbuffer pbuf, int iVideoBuffer);
+typedef int ( * PFNGLXRELEASEVIDEOIMAGENVPROC) (Display *dpy, GLXPbuffer pbuf);
+typedef int ( * PFNGLXSENDPBUFFERTOVIDEONVPROC) (Display *dpy, GLXPbuffer pbuf, int iBufferType, unsigned long *pulCounterPbuffer, GLboolean bBlock);
+typedef int ( * PFNGLXGETVIDEOINFONVPROC) (Display *dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
+#endif
+
+#ifndef GLX_NV_swap_group
+#define GLX_NV_swap_group 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Bool glXJoinSwapGroupNV (Display *dpy, GLXDrawable drawable, GLuint group);
+extern Bool glXBindSwapBarrierNV (Display *dpy, GLuint group, GLuint barrier);
+extern Bool glXQuerySwapGroupNV (Display *dpy, GLXDrawable drawable, GLuint *group, GLuint *barrier);
+extern Bool glXQueryMaxSwapGroupsNV (Display *dpy, int screen, GLuint *maxGroups, GLuint *maxBarriers);
+extern Bool glXQueryFrameCountNV (Display *dpy, int screen, GLuint *count);
+extern Bool glXResetFrameCountNV (Display *dpy, int screen);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Bool ( * PFNGLXJOINSWAPGROUPNVPROC) (Display *dpy, GLXDrawable drawable, GLuint group);
+typedef Bool ( * PFNGLXBINDSWAPBARRIERNVPROC) (Display *dpy, GLuint group, GLuint barrier);
+typedef Bool ( * PFNGLXQUERYSWAPGROUPNVPROC) (Display *dpy, GLXDrawable drawable, GLuint *group, GLuint *barrier);
+typedef Bool ( * PFNGLXQUERYMAXSWAPGROUPSNVPROC) (Display *dpy, int screen, GLuint *maxGroups, GLuint *maxBarriers);
+typedef Bool ( * PFNGLXQUERYFRAMECOUNTNVPROC) (Display *dpy, int screen, GLuint *count);
+typedef Bool ( * PFNGLXRESETFRAMECOUNTNVPROC) (Display *dpy, int screen);
+#endif
+
+#ifndef GLX_NV_video_capture
+#define GLX_NV_video_capture 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern int glXBindVideoCaptureDeviceNV (Display *dpy, unsigned int video_capture_slot, GLXVideoCaptureDeviceNV device);
+extern GLXVideoCaptureDeviceNV * glXEnumerateVideoCaptureDevicesNV (Display *dpy, int screen, int *nelements);
+extern void glXLockVideoCaptureDeviceNV (Display *dpy, GLXVideoCaptureDeviceNV device);
+extern int glXQueryVideoCaptureDeviceNV (Display *dpy, GLXVideoCaptureDeviceNV device, int attribute, int *value);
+extern void glXReleaseVideoCaptureDeviceNV (Display *dpy, GLXVideoCaptureDeviceNV device);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef int ( * PFNGLXBINDVIDEOCAPTUREDEVICENVPROC) (Display *dpy, unsigned int video_capture_slot, GLXVideoCaptureDeviceNV device);
+typedef GLXVideoCaptureDeviceNV * ( * PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC) (Display *dpy, int screen, int *nelements);
+typedef void ( * PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC) (Display *dpy, GLXVideoCaptureDeviceNV device);
+typedef int ( * PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC) (Display *dpy, GLXVideoCaptureDeviceNV device, int attribute, int *value);
+typedef void ( * PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC) (Display *dpy, GLXVideoCaptureDeviceNV device);
+#endif
+
+#ifndef GLX_EXT_swap_control
+#define GLX_EXT_swap_control 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern int glXSwapIntervalEXT (Display *dpy, GLXDrawable drawable, int interval);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef int ( * PFNGLXSWAPINTERVALEXTPROC) (Display *dpy, GLXDrawable drawable, int interval);
+#endif
+
+#ifndef GLX_NV_copy_image
+#define GLX_NV_copy_image 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern void glXCopyImageSubDataNV (Display *dpy, GLXContext srcCtx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLXContext dstCtx, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef void ( * PFNGLXCOPYIMAGESUBDATANVPROC) (Display *dpy, GLXContext srcCtx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLXContext dstCtx, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
+#endif
+
+#ifndef GLX_INTEL_swap_event
+#define GLX_INTEL_swap_event 1
+#endif
+
+#ifndef GLX_NV_multisample_coverage
+#define GLX_NV_multisample_coverage 1
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/hw/yagl/yagl_inc/GL/internal/dri_interface.h b/hw/yagl/yagl_inc/GL/internal/dri_interface.h
new file mode 100644
index 0000000000..b21445f104
--- /dev/null
+++ b/hw/yagl/yagl_inc/GL/internal/dri_interface.h
@@ -0,0 +1,986 @@
+/*
+ * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2007-2008 Red Hat, Inc.
+ * (C) Copyright IBM Corporation 2004
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file dri_interface.h
+ *
+ * This file contains all the types and functions that define the interface
+ * between a DRI driver and driver loader. Currently, the most common driver
+ * loader is the XFree86 libGL.so. However, other loaders do exist, and in
+ * the future the server-side libglx.a will also be a loader.
+ *
+ * \author Kevin E. Martin <kevin@precisioninsight.com>
+ * \author Ian Romanick <idr@us.ibm.com>
+ * \author Kristian Høgsberg <krh@redhat.com>
+ */
+
+#ifndef DRI_INTERFACE_H
+#define DRI_INTERFACE_H
+
+/* For archs with no drm.h */
+#if defined(__APPLE__) || defined(__CYGWIN__) || defined(__GNU__)
+#ifndef __NOT_HAVE_DRM_H
+#define __NOT_HAVE_DRM_H
+#endif
+#endif
+
+#ifndef __NOT_HAVE_DRM_H
+#include <drm.h>
+#else
+typedef unsigned int drm_context_t;
+typedef unsigned int drm_drawable_t;
+typedef struct drm_clip_rect drm_clip_rect_t;
+#endif
+
+/**
+ * \name DRI interface structures
+ *
+ * The following structures define the interface between the GLX client
+ * side library and the DRI (direct rendering infrastructure).
+ */
+/*@{*/
+typedef struct __DRIdisplayRec __DRIdisplay;
+typedef struct __DRIscreenRec __DRIscreen;
+typedef struct __DRIcontextRec __DRIcontext;
+typedef struct __DRIdrawableRec __DRIdrawable;
+typedef struct __DRIconfigRec __DRIconfig;
+typedef struct __DRIframebufferRec __DRIframebuffer;
+typedef struct __DRIversionRec __DRIversion;
+
+typedef struct __DRIcoreExtensionRec __DRIcoreExtension;
+typedef struct __DRIextensionRec __DRIextension;
+typedef struct __DRIcopySubBufferExtensionRec __DRIcopySubBufferExtension;
+typedef struct __DRIswapControlExtensionRec __DRIswapControlExtension;
+typedef struct __DRIframeTrackingExtensionRec __DRIframeTrackingExtension;
+typedef struct __DRImediaStreamCounterExtensionRec __DRImediaStreamCounterExtension;
+typedef struct __DRItexOffsetExtensionRec __DRItexOffsetExtension;
+typedef struct __DRItexBufferExtensionRec __DRItexBufferExtension;
+typedef struct __DRIlegacyExtensionRec __DRIlegacyExtension;
+typedef struct __DRIswrastExtensionRec __DRIswrastExtension;
+typedef struct __DRIbufferRec __DRIbuffer;
+typedef struct __DRIdri2ExtensionRec __DRIdri2Extension;
+typedef struct __DRIdri2LoaderExtensionRec __DRIdri2LoaderExtension;
+typedef struct __DRI2flushExtensionRec __DRI2flushExtension;
+typedef struct __DRI2throttleExtensionRec __DRI2throttleExtension;
+
+/*@}*/
+
+
+/**
+ * Extension struct. Drivers 'inherit' from this struct by embedding
+ * it as the first element in the extension struct.
+ *
+ * We never break API in for a DRI extension. If we need to change
+ * the way things work in a non-backwards compatible manner, we
+ * introduce a new extension. During a transition period, we can
+ * leave both the old and the new extension in the driver, which
+ * allows us to move to the new interface without having to update the
+ * loader(s) in lock step.
+ *
+ * However, we can add entry points to an extension over time as long
+ * as we don't break the old ones. As we add entry points to an
+ * extension, we increase the version number. The corresponding
+ * #define can be used to guard code that accesses the new entry
+ * points at compile time and the version field in the extension
+ * struct can be used at run-time to determine how to use the
+ * extension.
+ */
+struct __DRIextensionRec {
+ const char *name;
+ int version;
+};
+
+/**
+ * The first set of extension are the screen extensions, returned by
+ * __DRIcore::getExtensions(). This entry point will return a list of
+ * extensions and the loader can use the ones it knows about by
+ * casting them to more specific extensions and advertising any GLX
+ * extensions the DRI extensions enables.
+ */
+
+/**
+ * Used by drivers to indicate support for setting the read drawable.
+ */
+#define __DRI_READ_DRAWABLE "DRI_ReadDrawable"
+#define __DRI_READ_DRAWABLE_VERSION 1
+
+/**
+ * Used by drivers that implement the GLX_MESA_copy_sub_buffer extension.
+ */
+#define __DRI_COPY_SUB_BUFFER "DRI_CopySubBuffer"
+#define __DRI_COPY_SUB_BUFFER_VERSION 1
+struct __DRIcopySubBufferExtensionRec {
+ __DRIextension base;
+ void (*copySubBuffer)(__DRIdrawable *drawable, int x, int y, int w, int h);
+};
+
+/**
+ * Used by drivers that implement the GLX_SGI_swap_control or
+ * GLX_MESA_swap_control extension.
+ */
+#define __DRI_SWAP_CONTROL "DRI_SwapControl"
+#define __DRI_SWAP_CONTROL_VERSION 1
+struct __DRIswapControlExtensionRec {
+ __DRIextension base;
+ void (*setSwapInterval)(__DRIdrawable *drawable, unsigned int inteval);
+ unsigned int (*getSwapInterval)(__DRIdrawable *drawable);
+};
+
+/**
+ * Used by drivers that implement the GLX_MESA_swap_frame_usage extension.
+ */
+#define __DRI_FRAME_TRACKING "DRI_FrameTracking"
+#define __DRI_FRAME_TRACKING_VERSION 1
+struct __DRIframeTrackingExtensionRec {
+ __DRIextension base;
+
+ /**
+ * Enable or disable frame usage tracking.
+ *
+ * \since Internal API version 20030317.
+ */
+ int (*frameTracking)(__DRIdrawable *drawable, GLboolean enable);
+
+ /**
+ * Retrieve frame usage information.
+ *
+ * \since Internal API version 20030317.
+ */
+ int (*queryFrameTracking)(__DRIdrawable *drawable,
+ int64_t * sbc, int64_t * missedFrames,
+ float * lastMissedUsage, float * usage);
+};
+
+
+/**
+ * Used by drivers that implement the GLX_SGI_video_sync extension.
+ */
+#define __DRI_MEDIA_STREAM_COUNTER "DRI_MediaStreamCounter"
+#define __DRI_MEDIA_STREAM_COUNTER_VERSION 1
+struct __DRImediaStreamCounterExtensionRec {
+ __DRIextension base;
+
+ /**
+ * Wait for the MSC to equal target_msc, or, if that has already passed,
+ * the next time (MSC % divisor) is equal to remainder. If divisor is
+ * zero, the function will return as soon as MSC is greater than or equal
+ * to target_msc.
+ */
+ int (*waitForMSC)(__DRIdrawable *drawable,
+ int64_t target_msc, int64_t divisor, int64_t remainder,
+ int64_t * msc, int64_t * sbc);
+
+ /**
+ * Get the number of vertical refreshes since some point in time before
+ * this function was first called (i.e., system start up).
+ */
+ int (*getDrawableMSC)(__DRIscreen *screen, __DRIdrawable *drawable,
+ int64_t *msc);
+};
+
+
+#define __DRI_TEX_OFFSET "DRI_TexOffset"
+#define __DRI_TEX_OFFSET_VERSION 1
+struct __DRItexOffsetExtensionRec {
+ __DRIextension base;
+
+ /**
+ * Method to override base texture image with a driver specific 'offset'.
+ * The depth passed in allows e.g. to ignore the alpha channel of texture
+ * images where the non-alpha components don't occupy a whole texel.
+ *
+ * For GLX_EXT_texture_from_pixmap with AIGLX.
+ */
+ void (*setTexOffset)(__DRIcontext *pDRICtx, GLint texname,
+ unsigned long long offset, GLint depth, GLuint pitch);
+};
+
+
+/* Valid values for format in the setTexBuffer2 function below. These
+ * values match the GLX tokens for compatibility reasons, but we
+ * define them here since the DRI interface can't depend on GLX. */
+#define __DRI_TEXTURE_FORMAT_NONE 0x20D8
+#define __DRI_TEXTURE_FORMAT_RGB 0x20D9
+#define __DRI_TEXTURE_FORMAT_RGBA 0x20DA
+
+#define __DRI_TEX_BUFFER "DRI_TexBuffer"
+#define __DRI_TEX_BUFFER_VERSION 2
+struct __DRItexBufferExtensionRec {
+ __DRIextension base;
+
+ /**
+ * Method to override base texture image with the contents of a
+ * __DRIdrawable.
+ *
+ * For GLX_EXT_texture_from_pixmap with AIGLX. Deprecated in favor of
+ * setTexBuffer2 in version 2 of this interface
+ */
+ void (*setTexBuffer)(__DRIcontext *pDRICtx,
+ GLint target,
+ __DRIdrawable *pDraw);
+
+ /**
+ * Method to override base texture image with the contents of a
+ * __DRIdrawable, including the required texture format attribute.
+ *
+ * For GLX_EXT_texture_from_pixmap with AIGLX.
+ */
+ void (*setTexBuffer2)(__DRIcontext *pDRICtx,
+ GLint target,
+ GLint format,
+ __DRIdrawable *pDraw);
+ /**
+ * Method to release texture buffer in case some special platform
+ * need this.
+ *
+ * For GLX_EXT_texture_from_pixmap with AIGLX.
+ */
+ void (*releaseTexBuffer)(__DRIcontext *pDRICtx,
+ GLint target,
+ __DRIdrawable *pDraw);
+};
+
+/**
+ * Used by drivers that implement DRI2
+ */
+#define __DRI2_FLUSH "DRI2_Flush"
+#define __DRI2_FLUSH_VERSION 3
+struct __DRI2flushExtensionRec {
+ __DRIextension base;
+ void (*flush)(__DRIdrawable *drawable);
+
+ /**
+ * Ask the driver to call getBuffers/getBuffersWithFormat before
+ * it starts rendering again.
+ *
+ * \param drawable the drawable to invalidate
+ *
+ * \since 3
+ */
+ void (*invalidate)(__DRIdrawable *drawable);
+};
+
+
+/**
+ * Extension that the driver uses to request
+ * throttle callbacks.
+ */
+
+#define __DRI2_THROTTLE "DRI2_Throttle"
+#define __DRI2_THROTTLE_VERSION 1
+
+enum __DRI2throttleReason {
+ __DRI2_THROTTLE_SWAPBUFFER,
+ __DRI2_THROTTLE_COPYSUBBUFFER,
+ __DRI2_THROTTLE_FLUSHFRONT
+};
+
+struct __DRI2throttleExtensionRec {
+ __DRIextension base;
+ void (*throttle)(__DRIcontext *ctx,
+ __DRIdrawable *drawable,
+ enum __DRI2throttleReason reason);
+};
+
+/**
+ * XML document describing the configuration options supported by the
+ * driver.
+ */
+extern const char __driConfigOptions[];
+
+/*@}*/
+
+/**
+ * The following extensions describe loader features that the DRI
+ * driver can make use of. Some of these are mandatory, such as the
+ * getDrawableInfo extension for DRI and the DRI Loader extensions for
+ * DRI2, while others are optional, and if present allow the driver to
+ * expose certain features. The loader pass in a NULL terminated
+ * array of these extensions to the driver in the createNewScreen
+ * constructor.
+ */
+
+typedef struct __DRIgetDrawableInfoExtensionRec __DRIgetDrawableInfoExtension;
+typedef struct __DRIsystemTimeExtensionRec __DRIsystemTimeExtension;
+typedef struct __DRIdamageExtensionRec __DRIdamageExtension;
+typedef struct __DRIloaderExtensionRec __DRIloaderExtension;
+typedef struct __DRIswrastLoaderExtensionRec __DRIswrastLoaderExtension;
+
+
+/**
+ * Callback to getDrawableInfo protocol
+ */
+#define __DRI_GET_DRAWABLE_INFO "DRI_GetDrawableInfo"
+#define __DRI_GET_DRAWABLE_INFO_VERSION 1
+struct __DRIgetDrawableInfoExtensionRec {
+ __DRIextension base;
+
+ /**
+ * This function is used to get information about the position, size, and
+ * clip rects of a drawable.
+ */
+ GLboolean (* getDrawableInfo) ( __DRIdrawable *drawable,
+ unsigned int * index, unsigned int * stamp,
+ int * x, int * y, int * width, int * height,
+ int * numClipRects, drm_clip_rect_t ** pClipRects,
+ int * backX, int * backY,
+ int * numBackClipRects, drm_clip_rect_t ** pBackClipRects,
+ void *loaderPrivate);
+};
+
+/**
+ * Callback to get system time for media stream counter extensions.
+ */
+#define __DRI_SYSTEM_TIME "DRI_SystemTime"
+#define __DRI_SYSTEM_TIME_VERSION 1
+struct __DRIsystemTimeExtensionRec {
+ __DRIextension base;
+
+ /**
+ * Get the 64-bit unadjusted system time (UST).
+ */
+ int (*getUST)(int64_t * ust);
+
+ /**
+ * Get the media stream counter (MSC) rate.
+ *
+ * Matching the definition in GLX_OML_sync_control, this function returns
+ * the rate of the "media stream counter". In practical terms, this is
+ * the frame refresh rate of the display.
+ */
+ GLboolean (*getMSCRate)(__DRIdrawable *draw,
+ int32_t * numerator, int32_t * denominator,
+ void *loaderPrivate);
+};
+
+/**
+ * Damage reporting
+ */
+#define __DRI_DAMAGE "DRI_Damage"
+#define __DRI_DAMAGE_VERSION 1
+struct __DRIdamageExtensionRec {
+ __DRIextension base;
+
+ /**
+ * Reports areas of the given drawable which have been modified by the
+ * driver.
+ *
+ * \param drawable which the drawing was done to.
+ * \param rects rectangles affected, with the drawable origin as the
+ * origin.
+ * \param x X offset of the drawable within the screen (used in the
+ * front_buffer case)
+ * \param y Y offset of the drawable within the screen.
+ * \param front_buffer boolean flag for whether the drawing to the
+ * drawable was actually done directly to the front buffer (instead
+ * of backing storage, for example)
+ * \param loaderPrivate the data passed in at createNewDrawable time
+ */
+ void (*reportDamage)(__DRIdrawable *draw,
+ int x, int y,
+ drm_clip_rect_t *rects, int num_rects,
+ GLboolean front_buffer,
+ void *loaderPrivate);
+};
+
+#define __DRI_SWRAST_IMAGE_OP_DRAW 1
+#define __DRI_SWRAST_IMAGE_OP_CLEAR 2
+#define __DRI_SWRAST_IMAGE_OP_SWAP 3
+
+/**
+ * SWRast Loader extension.
+ */
+#define __DRI_SWRAST_LOADER "DRI_SWRastLoader"
+#define __DRI_SWRAST_LOADER_VERSION 1
+struct __DRIswrastLoaderExtensionRec {
+ __DRIextension base;
+
+ /*
+ * Drawable position and size
+ */
+ void (*getDrawableInfo)(__DRIdrawable *drawable,
+ int *x, int *y, int *width, int *height,
+ void *loaderPrivate);
+
+ /**
+ * Put image to drawable
+ */
+ void (*putImage)(__DRIdrawable *drawable, int op,
+ int x, int y, int width, int height,
+ char *data, void *loaderPrivate);
+
+ /**
+ * Get image from readable
+ */
+ void (*getImage)(__DRIdrawable *readable,
+ int x, int y, int width, int height,
+ char *data, void *loaderPrivate);
+};
+
+/**
+ * Invalidate loader extension. The presence of this extension
+ * indicates to the DRI driver that the loader will call invalidate in
+ * the __DRI2_FLUSH extension, whenever the needs to query for new
+ * buffers. This means that the DRI driver can drop the polling in
+ * glViewport().
+ *
+ * The extension doesn't provide any functionality, it's only use to
+ * indicate to the driver that it can use the new semantics. A DRI
+ * driver can use this to switch between the different semantics or
+ * just refuse to initialize if this extension isn't present.
+ */
+#define __DRI_USE_INVALIDATE "DRI_UseInvalidate"
+#define __DRI_USE_INVALIDATE_VERSION 1
+
+typedef struct __DRIuseInvalidateExtensionRec __DRIuseInvalidateExtension;
+struct __DRIuseInvalidateExtensionRec {
+ __DRIextension base;
+};
+
+/**
+ * The remaining extensions describe driver extensions, immediately
+ * available interfaces provided by the driver. To start using the
+ * driver, dlsym() for the __DRI_DRIVER_EXTENSIONS symbol and look for
+ * the extension you need in the array.
+ */
+#define __DRI_DRIVER_EXTENSIONS "__driDriverExtensions"
+
+/**
+ * Tokens for __DRIconfig attribs. A number of attributes defined by
+ * GLX or EGL standards are not in the table, as they must be provided
+ * by the loader. For example, FBConfig ID or visual ID, drawable type.
+ */
+
+#define __DRI_ATTRIB_BUFFER_SIZE 1
+#define __DRI_ATTRIB_LEVEL 2
+#define __DRI_ATTRIB_RED_SIZE 3
+#define __DRI_ATTRIB_GREEN_SIZE 4
+#define __DRI_ATTRIB_BLUE_SIZE 5
+#define __DRI_ATTRIB_LUMINANCE_SIZE 6
+#define __DRI_ATTRIB_ALPHA_SIZE 7
+#define __DRI_ATTRIB_ALPHA_MASK_SIZE 8
+#define __DRI_ATTRIB_DEPTH_SIZE 9
+#define __DRI_ATTRIB_STENCIL_SIZE 10
+#define __DRI_ATTRIB_ACCUM_RED_SIZE 11
+#define __DRI_ATTRIB_ACCUM_GREEN_SIZE 12
+#define __DRI_ATTRIB_ACCUM_BLUE_SIZE 13
+#define __DRI_ATTRIB_ACCUM_ALPHA_SIZE 14
+#define __DRI_ATTRIB_SAMPLE_BUFFERS 15
+#define __DRI_ATTRIB_SAMPLES 16
+#define __DRI_ATTRIB_RENDER_TYPE 17
+#define __DRI_ATTRIB_CONFIG_CAVEAT 18
+#define __DRI_ATTRIB_CONFORMANT 19
+#define __DRI_ATTRIB_DOUBLE_BUFFER 20
+#define __DRI_ATTRIB_STEREO 21
+#define __DRI_ATTRIB_AUX_BUFFERS 22
+#define __DRI_ATTRIB_TRANSPARENT_TYPE 23
+#define __DRI_ATTRIB_TRANSPARENT_INDEX_VALUE 24
+#define __DRI_ATTRIB_TRANSPARENT_RED_VALUE 25
+#define __DRI_ATTRIB_TRANSPARENT_GREEN_VALUE 26
+#define __DRI_ATTRIB_TRANSPARENT_BLUE_VALUE 27
+#define __DRI_ATTRIB_TRANSPARENT_ALPHA_VALUE 28
+#define __DRI_ATTRIB_FLOAT_MODE 29
+#define __DRI_ATTRIB_RED_MASK 30
+#define __DRI_ATTRIB_GREEN_MASK 31
+#define __DRI_ATTRIB_BLUE_MASK 32
+#define __DRI_ATTRIB_ALPHA_MASK 33
+#define __DRI_ATTRIB_MAX_PBUFFER_WIDTH 34
+#define __DRI_ATTRIB_MAX_PBUFFER_HEIGHT 35
+#define __DRI_ATTRIB_MAX_PBUFFER_PIXELS 36
+#define __DRI_ATTRIB_OPTIMAL_PBUFFER_WIDTH 37
+#define __DRI_ATTRIB_OPTIMAL_PBUFFER_HEIGHT 38
+#define __DRI_ATTRIB_VISUAL_SELECT_GROUP 39
+#define __DRI_ATTRIB_SWAP_METHOD 40
+#define __DRI_ATTRIB_MAX_SWAP_INTERVAL 41
+#define __DRI_ATTRIB_MIN_SWAP_INTERVAL 42
+#define __DRI_ATTRIB_BIND_TO_TEXTURE_RGB 43
+#define __DRI_ATTRIB_BIND_TO_TEXTURE_RGBA 44
+#define __DRI_ATTRIB_BIND_TO_MIPMAP_TEXTURE 45
+#define __DRI_ATTRIB_BIND_TO_TEXTURE_TARGETS 46
+#define __DRI_ATTRIB_YINVERTED 47
+#define __DRI_ATTRIB_FRAMEBUFFER_SRGB_CAPABLE 48
+
+/* __DRI_ATTRIB_RENDER_TYPE */
+#define __DRI_ATTRIB_RGBA_BIT 0x01
+#define __DRI_ATTRIB_COLOR_INDEX_BIT 0x02
+#define __DRI_ATTRIB_LUMINANCE_BIT 0x04
+
+/* __DRI_ATTRIB_CONFIG_CAVEAT */
+#define __DRI_ATTRIB_SLOW_BIT 0x01
+#define __DRI_ATTRIB_NON_CONFORMANT_CONFIG 0x02
+
+/* __DRI_ATTRIB_TRANSPARENT_TYPE */
+#define __DRI_ATTRIB_TRANSPARENT_RGB 0x00
+#define __DRI_ATTRIB_TRANSPARENT_INDEX 0x01
+
+/* __DRI_ATTRIB_BIND_TO_TEXTURE_TARGETS */
+#define __DRI_ATTRIB_TEXTURE_1D_BIT 0x01
+#define __DRI_ATTRIB_TEXTURE_2D_BIT 0x02
+#define __DRI_ATTRIB_TEXTURE_RECTANGLE_BIT 0x04
+
+/**
+ * This extension defines the core DRI functionality.
+ */
+#define __DRI_CORE "DRI_Core"
+#define __DRI_CORE_VERSION 1
+
+struct __DRIcoreExtensionRec {
+ __DRIextension base;
+
+ __DRIscreen *(*createNewScreen)(int screen, int fd,
+ unsigned int sarea_handle,
+ const __DRIextension **extensions,
+ const __DRIconfig ***driverConfigs,
+ void *loaderPrivate);
+
+ void (*destroyScreen)(__DRIscreen *screen);
+
+ const __DRIextension **(*getExtensions)(__DRIscreen *screen);
+
+ int (*getConfigAttrib)(const __DRIconfig *config,
+ unsigned int attrib,
+ unsigned int *value);
+
+ int (*indexConfigAttrib)(const __DRIconfig *config, int index,
+ unsigned int *attrib, unsigned int *value);
+
+ __DRIdrawable *(*createNewDrawable)(__DRIscreen *screen,
+ const __DRIconfig *config,
+ unsigned int drawable_id,
+ unsigned int head,
+ void *loaderPrivate);
+
+ void (*destroyDrawable)(__DRIdrawable *drawable);
+
+ void (*swapBuffers)(__DRIdrawable *drawable);
+
+ __DRIcontext *(*createNewContext)(__DRIscreen *screen,
+ const __DRIconfig *config,
+ __DRIcontext *shared,
+ void *loaderPrivate);
+
+ int (*copyContext)(__DRIcontext *dest,
+ __DRIcontext *src,
+ unsigned long mask);
+
+ void (*destroyContext)(__DRIcontext *context);
+
+ int (*bindContext)(__DRIcontext *ctx,
+ __DRIdrawable *pdraw,
+ __DRIdrawable *pread);
+
+ int (*unbindContext)(__DRIcontext *ctx);
+};
+
+/**
+ * Stored version of some component (i.e., server-side DRI module, kernel-side
+ * DRM, etc.).
+ *
+ * \todo
+ * There are several data structures that explicitly store a major version,
+ * minor version, and patch level. These structures should be modified to
+ * have a \c __DRIversionRec instead.
+ */
+struct __DRIversionRec {
+ int major; /**< Major version number. */
+ int minor; /**< Minor version number. */
+ int patch; /**< Patch-level. */
+};
+
+/**
+ * Framebuffer information record. Used by libGL to communicate information
+ * about the framebuffer to the driver's \c __driCreateNewScreen function.
+ *
+ * In XFree86, most of this information is derrived from data returned by
+ * calling \c XF86DRIGetDeviceInfo.
+ *
+ * \sa XF86DRIGetDeviceInfo __DRIdisplayRec::createNewScreen
+ * __driUtilCreateNewScreen CallCreateNewScreen
+ *
+ * \bug This structure could be better named.
+ */
+struct __DRIframebufferRec {
+ unsigned char *base; /**< Framebuffer base address in the CPU's
+ * address space. This value is calculated by
+ * calling \c drmMap on the framebuffer handle
+ * returned by \c XF86DRIGetDeviceInfo (or a
+ * similar function).
+ */
+ int size; /**< Framebuffer size, in bytes. */
+ int stride; /**< Number of bytes from one line to the next. */
+ int width; /**< Pixel width of the framebuffer. */
+ int height; /**< Pixel height of the framebuffer. */
+ int dev_priv_size; /**< Size of the driver's dev-priv structure. */
+ void *dev_priv; /**< Pointer to the driver's dev-priv structure. */
+};
+
+
+/**
+ * This extension provides alternative screen, drawable and context
+ * constructors for legacy DRI functionality. This is used in
+ * conjunction with the core extension.
+ */
+#define __DRI_LEGACY "DRI_Legacy"
+#define __DRI_LEGACY_VERSION 1
+
+struct __DRIlegacyExtensionRec {
+ __DRIextension base;
+
+ __DRIscreen *(*createNewScreen)(int screen,
+ const __DRIversion *ddx_version,
+ const __DRIversion *dri_version,
+ const __DRIversion *drm_version,
+ const __DRIframebuffer *frame_buffer,
+ void *pSAREA, int fd,
+ const __DRIextension **extensions,
+ const __DRIconfig ***driver_configs,
+ void *loaderPrivate);
+
+ __DRIdrawable *(*createNewDrawable)(__DRIscreen *screen,
+ const __DRIconfig *config,
+ drm_drawable_t hwDrawable,
+ int renderType, const int *attrs,
+ void *loaderPrivate);
+
+ __DRIcontext *(*createNewContext)(__DRIscreen *screen,
+ const __DRIconfig *config,
+ int render_type,
+ __DRIcontext *shared,
+ drm_context_t hwContext,
+ void *loaderPrivate);
+};
+
+/**
+ * This extension provides alternative screen, drawable and context
+ * constructors for swrast DRI functionality. This is used in
+ * conjunction with the core extension.
+ */
+#define __DRI_SWRAST "DRI_SWRast"
+#define __DRI_SWRAST_VERSION 3
+
+struct __DRIswrastExtensionRec {
+ __DRIextension base;
+
+ __DRIscreen *(*createNewScreen)(int screen,
+ const __DRIextension **extensions,
+ const __DRIconfig ***driver_configs,
+ void *loaderPrivate);
+
+ __DRIdrawable *(*createNewDrawable)(__DRIscreen *screen,
+ const __DRIconfig *config,
+ void *loaderPrivate);
+
+ /* Since version 2 */
+ __DRIcontext *(*createNewContextForAPI)(__DRIscreen *screen,
+ int api,
+ const __DRIconfig *config,
+ __DRIcontext *shared,
+ void *data);
+
+ /**
+ * Create a context for a particular API with a set of attributes
+ *
+ * \since version 3
+ *
+ * \sa __DRIdri2ExtensionRec::createContextAttribs
+ */
+ __DRIcontext *(*createContextAttribs)(__DRIscreen *screen,
+ int api,
+ const __DRIconfig *config,
+ __DRIcontext *shared,
+ unsigned num_attribs,
+ const uint32_t *attribs,
+ unsigned *error,
+ void *loaderPrivate);
+};
+
+/**
+ * DRI2 Loader extension.
+ */
+#define __DRI_BUFFER_FRONT_LEFT 0
+#define __DRI_BUFFER_BACK_LEFT 1
+#define __DRI_BUFFER_FRONT_RIGHT 2
+#define __DRI_BUFFER_BACK_RIGHT 3
+#define __DRI_BUFFER_DEPTH 4
+#define __DRI_BUFFER_STENCIL 5
+#define __DRI_BUFFER_ACCUM 6
+#define __DRI_BUFFER_FAKE_FRONT_LEFT 7
+#define __DRI_BUFFER_FAKE_FRONT_RIGHT 8
+#define __DRI_BUFFER_DEPTH_STENCIL 9 /**< Only available with DRI2 1.1 */
+#define __DRI_BUFFER_HIZ 10
+
+/* Inofficial and for internal use. Increase when adding a new buffer token. */
+#define __DRI_BUFFER_COUNT 11
+
+struct __DRIbufferRec {
+ unsigned int attachment;
+ unsigned int name;
+ unsigned int pitch;
+ unsigned int cpp;
+ unsigned int flags;
+};
+
+#define __DRI_DRI2_LOADER "DRI_DRI2Loader"
+#define __DRI_DRI2_LOADER_VERSION 3
+struct __DRIdri2LoaderExtensionRec {
+ __DRIextension base;
+
+ __DRIbuffer *(*getBuffers)(__DRIdrawable *driDrawable,
+ int *width, int *height,
+ unsigned int *attachments, int count,
+ int *out_count, void *loaderPrivate);
+
+ /**
+ * Flush pending front-buffer rendering
+ *
+ * Any rendering that has been performed to the
+ * \c __DRI_BUFFER_FAKE_FRONT_LEFT will be flushed to the
+ * \c __DRI_BUFFER_FRONT_LEFT.
+ *
+ * \param driDrawable Drawable whose front-buffer is to be flushed
+ * \param loaderPrivate Loader's private data that was previously passed
+ * into __DRIdri2ExtensionRec::createNewDrawable
+ */
+ void (*flushFrontBuffer)(__DRIdrawable *driDrawable, void *loaderPrivate);
+
+
+ /**
+ * Get list of buffers from the server
+ *
+ * Gets a list of buffer for the specified set of attachments. Unlike
+ * \c ::getBuffers, this function takes a list of attachments paired with
+ * opaque \c unsigned \c int value describing the format of the buffer.
+ * It is the responsibility of the caller to know what the service that
+ * allocates the buffers will expect to receive for the format.
+ *
+ * \param driDrawable Drawable whose buffers are being queried.
+ * \param width Output where the width of the buffers is stored.
+ * \param height Output where the height of the buffers is stored.
+ * \param attachments List of pairs of attachment ID and opaque format
+ * requested for the drawable.
+ * \param count Number of attachment / format pairs stored in
+ * \c attachments.
+ * \param loaderPrivate Loader's private data that was previously passed
+ * into __DRIdri2ExtensionRec::createNewDrawable.
+ */
+ __DRIbuffer *(*getBuffersWithFormat)(__DRIdrawable *driDrawable,
+ int *width, int *height,
+ unsigned int *attachments, int count,
+ int *out_count, void *loaderPrivate);
+};
+
+/**
+ * This extension provides alternative screen, drawable and context
+ * constructors for DRI2.
+ */
+#define __DRI_DRI2 "DRI_DRI2"
+#define __DRI_DRI2_VERSION 3
+
+#define __DRI_API_OPENGL 0 /**< OpenGL compatibility profile */
+#define __DRI_API_GLES 1
+#define __DRI_API_GLES2 2
+#define __DRI_API_OPENGL_CORE 3 /**< OpenGL 3.2+ core profile */
+
+#define __DRI_CTX_ATTRIB_MAJOR_VERSION 0
+#define __DRI_CTX_ATTRIB_MINOR_VERSION 1
+#define __DRI_CTX_ATTRIB_FLAGS 2
+
+#define __DRI_CTX_FLAG_DEBUG 0x00000001
+#define __DRI_CTX_FLAG_FORWARD_COMPATIBLE 0x00000002
+
+/**
+ * \name Reasons that __DRIdri2Extension::createContextAttribs might fail
+ */
+/*@{*/
+/** Success! */
+#define __DRI_CTX_ERROR_SUCCESS 0
+
+/** Memory allocation failure */
+#define __DRI_CTX_ERROR_NO_MEMORY 1
+
+/** Client requested an API (e.g., OpenGL ES 2.0) that the driver can't do. */
+#define __DRI_CTX_ERROR_BAD_API 2
+
+/** Client requested an API version that the driver can't do. */
+#define __DRI_CTX_ERROR_BAD_VERSION 3
+
+/** Client requested a flag or combination of flags the driver can't do. */
+#define __DRI_CTX_ERROR_BAD_FLAG 4
+
+/** Client requested an attribute the driver doesn't understand. */
+#define __DRI_CTX_ERROR_UNKNOWN_ATTRIBUTE 5
+
+/** Client requested a flag the driver doesn't understand. */
+#define __DRI_CTX_ERROR_UNKNOWN_FLAG 6
+/*@}*/
+
+struct __DRIdri2ExtensionRec {
+ __DRIextension base;
+
+ __DRIscreen *(*createNewScreen)(int screen, int fd,
+ const __DRIextension **extensions,
+ const __DRIconfig ***driver_configs,
+ void *loaderPrivate);
+
+ __DRIdrawable *(*createNewDrawable)(__DRIscreen *screen,
+ const __DRIconfig *config,
+ void *loaderPrivate);
+
+ __DRIcontext *(*createNewContext)(__DRIscreen *screen,
+ const __DRIconfig *config,
+ __DRIcontext *shared,
+ void *loaderPrivate);
+
+ /* Since version 2 */
+ unsigned int (*getAPIMask)(__DRIscreen *screen);
+
+ __DRIcontext *(*createNewContextForAPI)(__DRIscreen *screen,
+ int api,
+ const __DRIconfig *config,
+ __DRIcontext *shared,
+ void *data);
+
+ __DRIbuffer *(*allocateBuffer)(__DRIscreen *screen,
+ unsigned int attachment,
+ unsigned int format,
+ int width,
+ int height);
+ void (*releaseBuffer)(__DRIscreen *screen,
+ __DRIbuffer *buffer);
+
+ /**
+ * Create a context for a particular API with a set of attributes
+ *
+ * \since version 3
+ *
+ * \sa __DRIswrastExtensionRec::createContextAttribs
+ */
+ __DRIcontext *(*createContextAttribs)(__DRIscreen *screen,
+ int api,
+ const __DRIconfig *config,
+ __DRIcontext *shared,
+ unsigned num_attribs,
+ const uint32_t *attribs,
+ unsigned *error,
+ void *loaderPrivate);
+};
+
+
+/**
+ * This extension provides functionality to enable various EGLImage
+ * extensions.
+ */
+#define __DRI_IMAGE "DRI_IMAGE"
+#define __DRI_IMAGE_VERSION 1
+
+/**
+ * These formats correspond to the similarly named MESA_FORMAT_*
+ * tokens, except in the native endian of the CPU. For example, on
+ * little endian __DRI_IMAGE_FORMAT_XRGB8888 corresponds to
+ * MESA_FORMAT_XRGB8888, but MESA_FORMAT_XRGB8888_REV on big endian.
+ */
+#define __DRI_IMAGE_FORMAT_RGB565 0x1001
+#define __DRI_IMAGE_FORMAT_XRGB8888 0x1002
+#define __DRI_IMAGE_FORMAT_ARGB8888 0x1003
+#define __DRI_IMAGE_FORMAT_ABGR8888 0x1004
+
+#define __DRI_IMAGE_USE_SHARE 0x0001
+#define __DRI_IMAGE_USE_SCANOUT 0x0002
+#define __DRI_IMAGE_USE_CURSOR 0x0004
+
+/**
+ * queryImage attributes
+ */
+
+#define __DRI_IMAGE_ATTRIB_STRIDE 0x2000
+#define __DRI_IMAGE_ATTRIB_HANDLE 0x2001
+#define __DRI_IMAGE_ATTRIB_NAME 0x2002
+
+typedef struct __DRIimageRec __DRIimage;
+typedef struct __DRIimageExtensionRec __DRIimageExtension;
+struct __DRIimageExtensionRec {
+ __DRIextension base;
+
+ __DRIimage *(*createImageFromName)(__DRIscreen *screen,
+ int width, int height, int format,
+ int name, int pitch,
+ void *loaderPrivate);
+
+ __DRIimage *(*createImageFromRenderbuffer)(__DRIcontext *context,
+ int renderbuffer,
+ void *loaderPrivate);
+
+ void (*destroyImage)(__DRIimage *image);
+
+ __DRIimage *(*createImage)(__DRIscreen *screen,
+ int width, int height, int format,
+ unsigned int use,
+ void *loaderPrivate);
+
+ GLboolean (*queryImage)(__DRIimage *image, int attrib, int *value);
+
+ /**
+ * The new __DRIimage will share the content with the old one, see dup(2).
+ */
+ __DRIimage *(*dupImage)(__DRIimage *image, void *loaderPrivate);
+};
+
+
+/**
+ * This extension must be implemented by the loader and passed to the
+ * driver at screen creation time. The EGLImage entry points in the
+ * various client APIs take opaque EGLImage handles and use this
+ * extension to map them to a __DRIimage. At version 1, this
+ * extensions allows mapping EGLImage pointers to __DRIimage pointers,
+ * but future versions could support other EGLImage-like, opaque types
+ * with new lookup functions.
+ */
+#define __DRI_IMAGE_LOOKUP "DRI_IMAGE_LOOKUP"
+#define __DRI_IMAGE_LOOKUP_VERSION 1
+
+typedef struct __DRIimageLookupExtensionRec __DRIimageLookupExtension;
+struct __DRIimageLookupExtensionRec {
+ __DRIextension base;
+
+ __DRIimage *(*lookupEGLImage)(__DRIscreen *screen, void *image,
+ void *loaderPrivate);
+};
+
+/**
+ * This extension allows for common DRI2 options
+ */
+#define __DRI2_CONFIG_QUERY "DRI_CONFIG_QUERY"
+#define __DRI2_CONFIG_QUERY_VERSION 1
+
+typedef struct __DRI2configQueryExtensionRec __DRI2configQueryExtension;
+struct __DRI2configQueryExtensionRec {
+ __DRIextension base;
+
+ int (*configQueryb)(__DRIscreen *screen, const char *var, GLboolean *val);
+ int (*configQueryi)(__DRIscreen *screen, const char *var, GLint *val);
+ int (*configQueryf)(__DRIscreen *screen, const char *var, GLfloat *val);
+};
+#endif
diff --git a/hw/yagl/yagl_inc/GL/internal/sarea.h b/hw/yagl/yagl_inc/GL/internal/sarea.h
new file mode 100644
index 0000000000..a0d6084f31
--- /dev/null
+++ b/hw/yagl/yagl_inc/GL/internal/sarea.h
@@ -0,0 +1,92 @@
+/**
+ * \file sarea.h
+ * SAREA definitions.
+ *
+ * \author Kevin E. Martin <kevin@precisioninsight.com>
+ * \author Jens Owen <jens@tungstengraphics.com>
+ * \author Rickard E. (Rik) Faith <faith@valinux.com>
+ */
+
+/*
+ * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#ifndef _SAREA_H_
+#define _SAREA_H_
+
+#include "xf86drm.h"
+
+/* SAREA area needs to be at least a page */
+#if defined(__alpha__)
+#define SAREA_MAX 0x2000
+#elif defined(__ia64__)
+#define SAREA_MAX 0x10000 /* 64kB */
+#else
+/* Intel 830M driver needs at least 8k SAREA */
+#define SAREA_MAX 0x2000
+#endif
+
+#define SAREA_MAX_DRAWABLES 256
+
+#define SAREA_DRAWABLE_CLAIMED_ENTRY 0x80000000
+
+/**
+ * SAREA per drawable information.
+ *
+ * \sa _XF86DRISAREA.
+ */
+typedef struct _XF86DRISAREADrawable {
+ unsigned int stamp;
+ unsigned int flags;
+} XF86DRISAREADrawableRec, *XF86DRISAREADrawablePtr;
+
+/**
+ * SAREA frame information.
+ *
+ * \sa _XF86DRISAREA.
+ */
+typedef struct _XF86DRISAREAFrame {
+ unsigned int x;
+ unsigned int y;
+ unsigned int width;
+ unsigned int height;
+ unsigned int fullscreen;
+} XF86DRISAREAFrameRec, *XF86DRISAREAFramePtr;
+
+/**
+ * SAREA definition.
+ */
+typedef struct _XF86DRISAREA {
+ /** first thing is always the DRM locking structure */
+ drmLock lock;
+ /** \todo Use readers/writer lock for drawable_lock */
+ drmLock drawable_lock;
+ XF86DRISAREADrawableRec drawableTable[SAREA_MAX_DRAWABLES];
+ XF86DRISAREAFrameRec frame;
+ drm_context_t dummy_context;
+} XF86DRISAREARec, *XF86DRISAREAPtr;
+
+#endif
diff --git a/hw/yagl/yagl_inc/GL/osmesa.h b/hw/yagl/yagl_inc/GL/osmesa.h
new file mode 100644
index 0000000000..304655e7c4
--- /dev/null
+++ b/hw/yagl/yagl_inc/GL/osmesa.h
@@ -0,0 +1,283 @@
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+/*
+ * Mesa Off-Screen rendering interface.
+ *
+ * This is an operating system and window system independent interface to
+ * Mesa which allows one to render images into a client-supplied buffer in
+ * main memory. Such images may manipulated or saved in whatever way the
+ * client wants.
+ *
+ * These are the API functions:
+ * OSMesaCreateContext - create a new Off-Screen Mesa rendering context
+ * OSMesaMakeCurrent - bind an OSMesaContext to a client's image buffer
+ * and make the specified context the current one.
+ * OSMesaDestroyContext - destroy an OSMesaContext
+ * OSMesaGetCurrentContext - return thread's current context ID
+ * OSMesaPixelStore - controls how pixels are stored in image buffer
+ * OSMesaGetIntegerv - return OSMesa state parameters
+ *
+ *
+ * The limits on the width and height of an image buffer are MAX_WIDTH and
+ * MAX_HEIGHT as defined in Mesa/src/config.h. Defaults are 1280 and 1024.
+ * You can increase them as needed but beware that many temporary arrays in
+ * Mesa are dimensioned by MAX_WIDTH or MAX_HEIGHT.
+ */
+
+
+#ifndef OSMESA_H
+#define OSMESA_H
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include <GL/gl.h>
+
+
+#define OSMESA_MAJOR_VERSION 6
+#define OSMESA_MINOR_VERSION 5
+#define OSMESA_PATCH_VERSION 0
+
+
+
+/*
+ * Values for the format parameter of OSMesaCreateContext()
+ * New in version 2.0.
+ */
+#define OSMESA_COLOR_INDEX GL_COLOR_INDEX
+#define OSMESA_RGBA GL_RGBA
+#define OSMESA_BGRA 0x1
+#define OSMESA_ARGB 0x2
+#define OSMESA_RGB GL_RGB
+#define OSMESA_BGR 0x4
+#define OSMESA_RGB_565 0x5
+
+
+/*
+ * OSMesaPixelStore() parameters:
+ * New in version 2.0.
+ */
+#define OSMESA_ROW_LENGTH 0x10
+#define OSMESA_Y_UP 0x11
+
+
+/*
+ * Accepted by OSMesaGetIntegerv:
+ */
+#define OSMESA_WIDTH 0x20
+#define OSMESA_HEIGHT 0x21
+#define OSMESA_FORMAT 0x22
+#define OSMESA_TYPE 0x23
+#define OSMESA_MAX_WIDTH 0x24 /* new in 4.0 */
+#define OSMESA_MAX_HEIGHT 0x25 /* new in 4.0 */
+
+
+typedef struct osmesa_context *OSMesaContext;
+
+
+#if defined(__QUICKDRAW__)
+#pragma export on
+#endif
+
+
+/*
+ * Create an Off-Screen Mesa rendering context. The only attribute needed is
+ * an RGBA vs Color-Index mode flag.
+ *
+ * Input: format - one of OSMESA_COLOR_INDEX, OSMESA_RGBA, OSMESA_BGRA,
+ * OSMESA_ARGB, OSMESA_RGB, or OSMESA_BGR.
+ * sharelist - specifies another OSMesaContext with which to share
+ * display lists. NULL indicates no sharing.
+ * Return: an OSMesaContext or 0 if error
+ */
+GLAPI OSMesaContext GLAPIENTRY
+OSMesaCreateContext( GLenum format, OSMesaContext sharelist );
+
+
+
+/*
+ * Create an Off-Screen Mesa rendering context and specify desired
+ * size of depth buffer, stencil buffer and accumulation buffer.
+ * If you specify zero for depthBits, stencilBits, accumBits you
+ * can save some memory.
+ *
+ * New in Mesa 3.5
+ */
+GLAPI OSMesaContext GLAPIENTRY
+OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits,
+ GLint accumBits, OSMesaContext sharelist);
+
+
+/*
+ * Destroy an Off-Screen Mesa rendering context.
+ *
+ * Input: ctx - the context to destroy
+ */
+GLAPI void GLAPIENTRY
+OSMesaDestroyContext( OSMesaContext ctx );
+
+
+
+/*
+ * Bind an OSMesaContext to an image buffer. The image buffer is just a
+ * block of memory which the client provides. Its size must be at least
+ * as large as width*height*sizeof(type). Its address should be a multiple
+ * of 4 if using RGBA mode.
+ *
+ * Image data is stored in the order of glDrawPixels: row-major order
+ * with the lower-left image pixel stored in the first array position
+ * (ie. bottom-to-top).
+ *
+ * Since the only type initially supported is GL_UNSIGNED_BYTE, if the
+ * context is in RGBA mode, each pixel will be stored as a 4-byte RGBA
+ * value. If the context is in color indexed mode, each pixel will be
+ * stored as a 1-byte value.
+ *
+ * If the context's viewport hasn't been initialized yet, it will now be
+ * initialized to (0,0,width,height).
+ *
+ * Input: ctx - the rendering context
+ * buffer - the image buffer memory
+ * type - data type for pixel components, only GL_UNSIGNED_BYTE
+ * supported now
+ * width, height - size of image buffer in pixels, at least 1
+ * Return: GL_TRUE if success, GL_FALSE if error because of invalid ctx,
+ * invalid buffer address, type!=GL_UNSIGNED_BYTE, width<1, height<1,
+ * width>internal limit or height>internal limit.
+ */
+GLAPI GLboolean GLAPIENTRY
+OSMesaMakeCurrent( OSMesaContext ctx, void *buffer, GLenum type,
+ GLsizei width, GLsizei height );
+
+
+
+
+/*
+ * Return the current Off-Screen Mesa rendering context handle.
+ */
+GLAPI OSMesaContext GLAPIENTRY
+OSMesaGetCurrentContext( void );
+
+
+
+/*
+ * Set pixel store/packing parameters for the current context.
+ * This is similar to glPixelStore.
+ * Input: pname - OSMESA_ROW_LENGTH
+ * specify actual pixels per row in image buffer
+ * 0 = same as image width (default)
+ * OSMESA_Y_UP
+ * zero = Y coordinates increase downward
+ * non-zero = Y coordinates increase upward (default)
+ * value - the value for the parameter pname
+ *
+ * New in version 2.0.
+ */
+GLAPI void GLAPIENTRY
+OSMesaPixelStore( GLint pname, GLint value );
+
+
+
+/*
+ * Return an integer value like glGetIntegerv.
+ * Input: pname -
+ * OSMESA_WIDTH return current image width
+ * OSMESA_HEIGHT return current image height
+ * OSMESA_FORMAT return image format
+ * OSMESA_TYPE return color component data type
+ * OSMESA_ROW_LENGTH return row length in pixels
+ * OSMESA_Y_UP returns 1 or 0 to indicate Y axis direction
+ * value - pointer to integer in which to return result.
+ */
+GLAPI void GLAPIENTRY
+OSMesaGetIntegerv( GLint pname, GLint *value );
+
+
+
+/*
+ * Return the depth buffer associated with an OSMesa context.
+ * Input: c - the OSMesa context
+ * Output: width, height - size of buffer in pixels
+ * bytesPerValue - bytes per depth value (2 or 4)
+ * buffer - pointer to depth buffer values
+ * Return: GL_TRUE or GL_FALSE to indicate success or failure.
+ *
+ * New in Mesa 2.4.
+ */
+GLAPI GLboolean GLAPIENTRY
+OSMesaGetDepthBuffer( OSMesaContext c, GLint *width, GLint *height,
+ GLint *bytesPerValue, void **buffer );
+
+
+
+/*
+ * Return the color buffer associated with an OSMesa context.
+ * Input: c - the OSMesa context
+ * Output: width, height - size of buffer in pixels
+ * format - buffer format (OSMESA_FORMAT)
+ * buffer - pointer to depth buffer values
+ * Return: GL_TRUE or GL_FALSE to indicate success or failure.
+ *
+ * New in Mesa 3.3.
+ */
+GLAPI GLboolean GLAPIENTRY
+OSMesaGetColorBuffer( OSMesaContext c, GLint *width, GLint *height,
+ GLint *format, void **buffer );
+
+
+
+/**
+ * This typedef is new in Mesa 6.3.
+ */
+typedef void (*OSMESAproc)();
+
+
+/*
+ * Return pointer to the named function.
+ * New in Mesa 4.1
+ * Return OSMESAproc in 6.3.
+ */
+GLAPI OSMESAproc GLAPIENTRY
+OSMesaGetProcAddress( const char *funcName );
+
+
+
+/**
+ * Enable/disable color clamping, off by default.
+ * New in Mesa 6.4.2
+ */
+GLAPI void GLAPIENTRY
+OSMesaColorClamp(GLboolean enable);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif
diff --git a/hw/yagl/yagl_inc/GL/vms_x_fix.h b/hw/yagl/yagl_inc/GL/vms_x_fix.h
new file mode 100644
index 0000000000..24cba473d8
--- /dev/null
+++ b/hw/yagl/yagl_inc/GL/vms_x_fix.h
@@ -0,0 +1,1224 @@
+/***************************************************************************
+ * *
+ * Author : Jouk Jansen (joukj@hrem.nano.tudelft.nl) *
+ * *
+ * Last revision : 31 August 2006 *
+ * *
+ * Repair definitions of Runtime library functions when compiling with *
+ * /name=(as_is) on OpenVMS *
+ * *
+ ***************************************************************************/
+
+#ifndef VMS_X_FIX
+#define VMS_X_FIX
+
+#define decw$_select DECW$_SELECT
+#define DtSaverGetWindows DTSAVERGETWINDOWS
+#define MrmFetchWidget MRMFETCHWIDGET
+#define MrmInitialize MRMINITIALIZE
+#define MrmOpenHierarchy MRMOPENHIERARCHY
+#define MrmRegisterNames MRMREGISTERNAMES
+#define XAddExtension XADDEXTENSION
+#define XAddHosts XADDHOSTS
+#define XAllocClassHint XALLOCCLASSHINT
+#define XAllocColor XALLOCCOLOR
+#define XAllocColorCells XALLOCCOLORCELLS
+#define XAllocIconSize XALLOCICONSIZE
+#define XAllocNamedColor XALLOCNAMEDCOLOR
+#define XAllocSizeHints XALLOCSIZEHINTS
+#define XAllocStandardColormap XALLOCSTANDARDCOLORMAP
+#define XAllocWMHints XALLOCWMHINTS
+#define XAllowEvents XALLOWEVENTS
+#define XAutoRepeatOff XAUTOREPEATOFF
+#define XAutoRepeatOn XAUTOREPEATON
+#define XBaseFontNameListOfFontSet XBASEFONTNAMELISTOFFONTSET
+#define XBell XBELL
+#define XBitmapPad XBITMAPPAD
+#define XBlackPixel XBLACKPIXEL
+#define XBlackPixelOfScreen XBLACKPIXELOFSCREEN
+#define XCellsOfScreen XCELLSOFSCREEN
+#define XChangeActivePointerGrab XCHANGEACTIVEPOINTERGRAB
+#define XChangeGC XCHANGEGC
+#define XChangeKeyboardControl XCHANGEKEYBOARDCONTROL
+#define XChangePointerControl XCHANGEPOINTERCONTROL
+#define XChangeProperty XCHANGEPROPERTY
+#define XChangeWindowAttributes XCHANGEWINDOWATTRIBUTES
+#define XCheckIfEvent XCHECKIFEVENT
+#define XCheckMaskEvent XCHECKMASKEVENT
+#define XCheckTypedEvent XCHECKTYPEDEVENT
+#define XCheckTypedWindowEvent XCHECKTYPEDWINDOWEVENT
+#define XCheckWindowEvent XCHECKWINDOWEVENT
+#define XClearArea XCLEARAREA
+#define XClearWindow XCLEARWINDOW
+#define XClipBox XCLIPBOX
+#define XCloseDisplay XCLOSEDISPLAY
+#define XCloseIM XCLOSEIM
+#define XConfigureWindow XCONFIGUREWINDOW
+#define XConvertSelection XCONVERTSELECTION
+#define XCopyArea XCOPYAREA
+#define XCopyColormapAndFree XCOPYCOLORMAPANDFREE
+#define XCopyGC XCOPYGC
+#define XCopyPlane XCOPYPLANE
+#define XCreateBitmapFromData XCREATEBITMAPFROMDATA
+#define XCreateColormap XCREATECOLORMAP
+#define XCreateFontCursor XCREATEFONTCURSOR
+#define XCreateFontSet XCREATEFONTSET
+#define XCreateGC XCREATEGC
+#define XCreateGlyphCursor XCREATEGLYPHCURSOR
+#define XCreateIC XCREATEIC
+#define XCreateImage XCREATEIMAGE
+#define XCreatePixmap XCREATEPIXMAP
+#define XCreatePixmapCursor XCREATEPIXMAPCURSOR
+#define XCreatePixmapFromBitmapData XCREATEPIXMAPFROMBITMAPDATA
+#define XCreateRegion XCREATEREGION
+#define XCreateSimpleWindow XCREATESIMPLEWINDOW
+#define XCreateWindow XCREATEWINDOW
+#define XDefaultColormap XDEFAULTCOLORMAP
+#define XDefaultColormapOfScreen XDEFAULTCOLORMAPOFSCREEN
+#define XDefaultDepth XDEFAULTDEPTH
+#define XDefaultDepthOfScreen XDEFAULTDEPTHOFSCREEN
+#define XDefaultGC XDEFAULTGC
+#define XDefaultRootWindow XDEFAULTROOTWINDOW
+#define XDefaultScreen XDEFAULTSCREEN
+#define XDefaultScreenOfDisplay XDEFAULTSCREENOFDISPLAY
+#define XDefaultVisual XDEFAULTVISUAL
+#define XDefaultVisualOfScreen XDEFAULTVISUALOFSCREEN
+#define XDefineCursor XDEFINECURSOR
+#define XDeleteContext XDELETECONTEXT
+#define XDeleteProperty XDELETEPROPERTY
+#define XDestroyIC XDESTROYIC
+#define XDestroyRegion XDESTROYREGION
+#define XDestroySubwindows XDESTROYSUBWINDOWS
+#define XDestroyWindow XDESTROYWINDOW
+#define XDisableAccessControl XDISABLEACCESSCONTROL
+#define XDisplayCells XDISPLAYCELLS
+#define XDisplayHeight XDISPLAYHEIGHT
+#define XDisplayKeycodes XDISPLAYKEYCODES
+#define XDisplayName XDISPLAYNAME
+#define XDisplayOfIM XDISPLAYOFIM
+#define XDisplayOfScreen XDISPLAYOFSCREEN
+#define XDisplayString XDISPLAYSTRING
+#define XDisplayWidth XDISPLAYWIDTH
+#define XDoesBackingStore XDOESBACKINGSTORE
+#define XDrawArc XDRAWARC
+#define XDrawArcs XDRAWARCS
+#define XDrawImageString XDRAWIMAGESTRING
+#define XDrawImageString16 XDRAWIMAGESTRING16
+#define XDrawLine XDRAWLINE
+#define XDrawLines XDRAWLINES
+#define XDrawPoint XDRAWPOINT
+#define XDrawPoints XDRAWPOINTS
+#define XDrawRectangle XDRAWRECTANGLE
+#define XDrawRectangles XDRAWRECTANGLES
+#define XDrawSegments XDRAWSEGMENTS
+#define XDrawString XDRAWSTRING
+#define XDrawString16 XDRAWSTRING16
+#define XDrawText XDRAWTEXT
+#define XDrawText16 XDRAWTEXT16
+#define XESetCloseDisplay XESETCLOSEDISPLAY
+#define XEmptyRegion XEMPTYREGION
+#define XEnableAccessControl XENABLEACCESSCONTROL
+#define XEqualRegion XEQUALREGION
+#define XEventsQueued XEVENTSQUEUED
+#define XExtendedMaxRequestSize XEXTENDEDMAXREQUESTSIZE
+#define XExtentsOfFontSet XEXTENTSOFFONTSET
+#define XFetchBuffer XFETCHBUFFER
+#define XFetchBytes XFETCHBYTES
+#define XFetchName XFETCHNAME
+#define XFillArc XFILLARC
+#define XFillArcs XFILLARCS
+#define XFillPolygon XFILLPOLYGON
+#define XFillRectangle XFILLRECTANGLE
+#define XFillRectangles XFILLRECTANGLES
+#define XFilterEvent XFILTEREVENT
+#define XFindContext XFINDCONTEXT
+#define XFlush XFLUSH
+#define XFontsOfFontSet XFONTSOFFONTSET
+#define XForceScreenSaver XFORCESCREENSAVER
+#define XFree XFREE
+#define XFreeColormap XFREECOLORMAP
+#define XFreeColors XFREECOLORS
+#define XFreeCursor XFREECURSOR
+#define XFreeDeviceList XFREEDEVICELIST
+#define XFreeDeviceState XFREEDEVICESTATE
+#define XFreeFont XFREEFONT
+#define XFreeFontInfo XFREEFONTINFO
+#define XFreeFontNames XFREEFONTNAMES
+#define XFreeFontSet XFREEFONTSET
+#define XFreeGC XFREEGC
+#define XFreeModifiermap XFREEMODIFIERMAP
+#define XFreePixmap XFREEPIXMAP
+#define XFreeStringList XFREESTRINGLIST
+#define XGContextFromGC XGCONTEXTFROMGC
+#define XGeometry XGEOMETRY
+#define XGetAtomName XGETATOMNAME
+#define XGetClassHint XGETCLASSHINT
+#define XGetCommand XGETCOMMAND
+#define XGetDefault XGETDEFAULT
+#define XGetErrorDatabaseText XGETERRORDATABASETEXT
+#define XGetErrorText XGETERRORTEXT
+#define XGetExtensionVersion XGETEXTENSIONVERSION
+#define XGetFontProperty XGETFONTPROPERTY
+#define XGetGCValues XGETGCVALUES
+#define XGetGeometry XGETGEOMETRY
+#define XGetICValues XGETICVALUES
+#define XGetIMValues XGETIMVALUES
+#define XGetIconName XGETICONNAME
+#define XGetIconSizes XGETICONSIZES
+#define XGetImage XGETIMAGE
+#define XGetInputFocus XGETINPUTFOCUS
+#define XGetKeyboardControl XGETKEYBOARDCONTROL
+#define XGetKeyboardMapping XGETKEYBOARDMAPPING
+#define XGetModifierMapping XGETMODIFIERMAPPING
+#define XGetMotionEvents XGETMOTIONEVENTS
+#define XGetNormalHints XGETNORMALHINTS
+#define XGetPointerControl XGETPOINTERCONTROL
+#define XGetPointerMapping XGETPOINTERMAPPING
+#define XGetRGBColormaps XGETRGBCOLORMAPS
+#define XGetScreenSaver XGETSCREENSAVER
+#define XGetSelectionOwner XGETSELECTIONOWNER
+#define XGetStandardColormap XGETSTANDARDCOLORMAP
+#define XGetSubImage XGETSUBIMAGE
+#define XGetTextProperty XGETTEXTPROPERTY
+#define XGetVisualInfo XGETVISUALINFO
+#define XGetWMColormapWindows XGETWMCOLORMAPWINDOWS
+#define XGetWMHints XGETWMHINTS
+#define XGetWMIconName XGETWMICONNAME
+#define XGetWMName XGETWMNAME
+#define XGetWMNormalHints XGETWMNORMALHINTS
+#define XGetWindowAttributes XGETWINDOWATTRIBUTES
+#define XGetWindowProperty XGETWINDOWPROPERTY
+#define XGrabButton XGRABBUTTON
+#define XGrabKeyboard XGRABKEYBOARD
+#define XGrabPointer XGRABPOINTER
+#define XGrabServer XGRABSERVER
+#define XHeightMMOfScreen XHEIGHTMMOFSCREEN
+#define XHeightOfScreen XHEIGHTOFSCREEN
+#define XIconifyWindow XICONIFYWINDOW
+#define XIfEvent XIFEVENT
+#define XInitExtension XINITEXTENSION
+#define XInitImage XINITIMAGE
+#define XInstallColormap XINSTALLCOLORMAP
+#define XInternAtom XINTERNATOM
+#define XInternAtoms XINTERNATOMS
+#define XIntersectRegion XINTERSECTREGION
+#define XKeycodeToKeysym XKEYCODETOKEYSYM
+#define XKeysymToKeycode XKEYSYMTOKEYCODE
+#define XKeysymToString XKEYSYMTOSTRING
+#define XKillClient XKILLCLIENT
+#define XListDepths XLISTDEPTHS
+#define XListFonts XLISTFONTS
+#define XListFontsWithInfo XLISTFONTSWITHINFO
+#define XListHosts XLISTHOSTS
+#define XListInputDevices XLISTINPUTDEVICES
+#define XListInstalledColormaps XLISTINSTALLEDCOLORMAPS
+#define XListPixmapFormats XLISTPIXMAPFORMATS
+#define XListProperties XLISTPROPERTIES
+#define XLoadFont XLOADFONT
+#define XLoadQueryFont XLOADQUERYFONT
+#define XLookupColor XLOOKUPCOLOR
+#define XLookupKeysym XLOOKUPKEYSYM
+#define XLookupString XLOOKUPSTRING
+#define XLowerWindow XLOWERWINDOW
+#define XMapRaised XMAPRAISED
+#define XMapSubwindows XMAPSUBWINDOWS
+#define XMapWindow XMAPWINDOW
+#define XMaskEvent XMASKEVENT
+#define XMatchVisualInfo XMATCHVISUALINFO
+#define XMaxRequestSize XMAXREQUESTSIZE
+#define XMissingExtension XMISSINGEXTENSION
+#define XMoveResizeWindow XMOVERESIZEWINDOW
+#define XMoveWindow XMOVEWINDOW
+#define XNextEvent XNEXTEVENT
+#define XNextRequest XNEXTREQUEST
+#define XNoOp XNOOP
+#define XOffsetRegion XOFFSETREGION
+#define XOpenDevice XOPENDEVICE
+#define XOpenDisplay XOPENDISPLAY
+#define XOpenIM XOPENIM
+#define XParseColor XPARSECOLOR
+#define XParseGeometry XPARSEGEOMETRY
+#define XPeekEvent XPEEKEVENT
+#define XPeekIfEvent XPEEKIFEVENT
+#define XPending XPENDING
+#define XPointInRegion XPOINTINREGION
+#define XPolygonRegion XPOLYGONREGION
+#define XPutBackEvent XPUTBACKEVENT
+#define XPutImage XPUTIMAGE
+#define XQLength XQLENGTH
+#define XQueryBestCursor XQUERYBESTCURSOR
+#define XQueryBestStipple XQUERYBESTSTIPPLE
+#define XQueryColor XQUERYCOLOR
+#define XQueryColors XQUERYCOLORS
+#define XQueryDeviceState XQUERYDEVICESTATE
+#define XQueryExtension XQUERYEXTENSION
+#define XQueryFont XQUERYFONT
+#define XQueryKeymap XQUERYKEYMAP
+#define XQueryPointer XQUERYPOINTER
+#define XQueryTree XQUERYTREE
+#define XRaiseWindow XRAISEWINDOW
+#define XReadBitmapFile XREADBITMAPFILE
+#define XRecolorCursor XRECOLORCURSOR
+#define XReconfigureWMWindow XRECONFIGUREWMWINDOW
+#define XRectInRegion XRECTINREGION
+#define XRefreshKeyboardMapping XREFRESHKEYBOARDMAPPING
+#define XRemoveHosts XREMOVEHOSTS
+#define XReparentWindow XREPARENTWINDOW
+#define XResetScreenSaver XRESETSCREENSAVER
+#define XResizeWindow XRESIZEWINDOW
+#define XResourceManagerString XRESOURCEMANAGERSTRING
+#define XRestackWindows XRESTACKWINDOWS
+#define XRotateBuffers XROTATEBUFFERS
+#define XRootWindow XROOTWINDOW
+#define XRootWindowOfScreen XROOTWINDOWOFSCREEN
+#define XSaveContext XSAVECONTEXT
+#define XScreenNumberOfScreen XSCREENNUMBEROFSCREEN
+#define XScreenOfDisplay XSCREENOFDISPLAY
+#define XSelectAsyncEvent XSELECTASYNCEVENT
+#define XSelectAsyncInput XSELECTASYNCINPUT
+#define XSelectExtensionEvent XSELECTEXTENSIONEVENT
+#define XSelectInput XSELECTINPUT
+#define XSendEvent XSENDEVENT
+#define XServerVendor XSERVERVENDOR
+#define XSetArcMode XSETARCMODE
+#define XSetBackground XSETBACKGROUND
+#define XSetClassHint XSETCLASSHINT
+#define XSetClipMask XSETCLIPMASK
+#define XSetClipOrigin XSETCLIPORIGIN
+#define XSetClipRectangles XSETCLIPRECTANGLES
+#define XSetCloseDownMode XSETCLOSEDOWNMODE
+#define XSetCommand XSETCOMMAND
+#define XSetDashes XSETDASHES
+#define XSetErrorHandler XSETERRORHANDLER
+#define XSetExtensionErrorHandler XSETEXTENSIONERRORHANDLER
+#define XSetFillRule XSETFILLRULE
+#define XSetFillStyle XSETFILLSTYLE
+#define XSetFont XSETFONT
+#define XSetForeground XSETFOREGROUND
+#define XSetFunction XSETFUNCTION
+#define XSetGraphicsExposures XSETGRAPHICSEXPOSURES
+#define XSetICFocus XSETICFOCUS
+#define XSetICValues XSETICVALUES
+#define XSetIOErrorHandler XSETIOERRORHANDLER
+#define XSetIconName XSETICONNAME
+#define XSetInputFocus XSETINPUTFOCUS
+#define XSetLineAttributes XSETLINEATTRIBUTES
+#define XSetLocaleModifiers XSETLOCALEMODIFIERS
+#define XSetNormalHints XSETNORMALHINTS
+#define XSetPlaneMask XSETPLANEMASK
+#define XSetRegion XSETREGION
+#define XSetRGBColormaps XSETRGBCOLORMAPS
+#define XSetScreenSaver XSETSCREENSAVER
+#define XSetSelectionOwner XSETSELECTIONOWNER
+#define XSetStandardProperties XSETSTANDARDPROPERTIES
+#define XSetState XSETSTATE
+#define XSetStipple XSETSTIPPLE
+#define XSetSubwindowMode XSETSUBWINDOWMODE
+#define XSetTSOrigin XSETTSORIGIN
+#define XSetTextProperty XSETTEXTPROPERTY
+#define XSetTile XSETTILE
+#define XSetTransientForHint XSETTRANSIENTFORHINT
+#define XSetWMClientMachine XSETWMCLIENTMACHINE
+#define XSetWMColormapWindows XSETWMCOLORMAPWINDOWS
+#define XSetWMHints XSETWMHINTS
+#define XSetWMIconName XSETWMICONNAME
+#define XSetWMName XSETWMNAME
+#define XSetWMNormalHints XSETWMNORMALHINTS
+#define XSetWMProperties XSETWMPROPERTIES
+#define XSetWMProtocols XSETWMPROTOCOLS
+#define XSetWMSizeHints XSETWMSIZEHINTS
+#define XSetWindowBackground XSETWINDOWBACKGROUND
+#define XSetWindowBackgroundPixmap XSETWINDOWBACKGROUNDPIXMAP
+#define XSetWindowBorder XSETWINDOWBORDER
+#define XSetWindowBorderPixmap XSETWINDOWBORDERPIXMAP
+#define XSetWindowBorderWidth XSETWINDOWBORDERWIDTH
+#define XSetWindowColormap XSETWINDOWCOLORMAP
+#define XShapeCombineMask XSHAPECOMBINEMASK
+#define XShapeCombineRectangles XSHAPECOMBINERECTANGLES
+#define XShapeGetRectangles XSHAPEGETRECTANGLES
+#define XShapeQueryExtension XSHAPEQUERYEXTENSION
+#define XShmAttach XSHMATTACH
+#define XShmCreateImage XSHMCREATEIMAGE
+#define XShmCreatePixmap XSHMCREATEPIXMAP
+#define XShmDetach XSHMDETACH
+#define XShmGetEventBase XSHMGETEVENTBASE
+#define XShmPutImage XSHMPUTIMAGE
+#define XShmQueryExtension XSHMQUERYEXTENSION
+#define XShmQueryVersion XSHMQUERYVERSION
+#define XShrinkRegion XSHRINKREGION
+#define XStoreBuffer XSTOREBUFFER
+#define XStoreBytes XSTOREBYTES
+#define XStoreColor XSTORECOLOR
+#define XStoreColors XSTORECOLORS
+#define XStoreName XSTORENAME
+#define XStringListToTextProperty XSTRINGLISTTOTEXTPROPERTY
+#define XStringToKeysym XSTRINGTOKEYSYM
+#define XSubtractRegion XSUBTRACTREGION
+#define XSupportsLocale XSUPPORTSLOCALE
+#define XSync XSYNC
+#define XSynchronize XSYNCHRONIZE
+#define XTextExtents XTEXTEXTENTS
+#define XTextExtents16 XTEXTEXTENTS16
+#define XTextPropertyToStringList XTEXTPROPERTYTOSTRINGLIST
+#define XTextWidth XTEXTWIDTH
+#define XTextWidth16 XTEXTWIDTH16
+#define XTranslateCoordinates XTRANSLATECOORDINATES
+#define XUndefineCursor XUNDEFINECURSOR
+#define XUngrabButton XUNGRABBUTTON
+#define XUngrabKeyboard XUNGRABKEYBOARD
+#define XUngrabPointer XUNGRABPOINTER
+#define XUngrabServer XUNGRABSERVER
+#define XUninstallColormap XUNINSTALLCOLORMAP
+#define XUnionRectWithRegion XUNIONRECTWITHREGION
+#define XUnionRegion XUNIONREGION
+#define XUniqueContext XUNIQUECONTEXT
+#define XUnloadFont XUNLOADFONT
+#define XUnmapWindow XUNMAPWINDOW
+#define XUnsetICFocus XUNSETICFOCUS
+#define XVaCreateNestedList XVACREATENESTEDLIST
+#define XVisualIDFromVisual XVISUALIDFROMVISUAL
+#define XWMGeometry XWMGEOMETRY
+#define XWarpPointer XWARPPOINTER
+#define XWhitePixel XWHITEPIXEL
+#define XWhitePixelOfScreen XWHITEPIXELOFSCREEN
+#define XWidthMMOfScreen XWIDTHMMOFSCREEN
+#define XWidthOfScreen XWIDTHOFSCREEN
+#define XWindowEvent XWINDOWEVENT
+#define XWithdrawWindow XWITHDRAWWINDOW
+#define XXorRegion XXORREGION
+#define XcmsQueryColor XCMSQUERYCOLOR
+#define XdbeAllocateBackBufferName XDBEALLOCATEBACKBUFFERNAME
+#define XdbeFreeVisualInfo XDBEFREEVISUALINFO
+#define XdbeGetVisualInfo XDBEGETVISUALINFO
+#define XdbeQueryExtension XDBEQUERYEXTENSION
+#define XdbeSwapBuffers XDBESWAPBUFFERS
+#define XextAddDisplay XEXTADDDISPLAY
+#define XextFindDisplay XEXTFINDDISPLAY
+#define XextRemoveDisplay XEXTREMOVEDISPLAY
+#define XkbSetDetectableAutoRepeat XKBSETDETECTABLEAUTOREPEAT
+#define XmActivateProtocol XMACTIVATEPROTOCOL
+#define XmAddProtocolCallback XMADDPROTOCOLCALLBACK
+#define XmAddProtocols XMADDPROTOCOLS
+#define XmChangeColor XMCHANGECOLOR
+#define XmClipboardCopy XMCLIPBOARDCOPY
+#define XmClipboardCopyByName XMCLIPBOARDCOPYBYNAME
+#define XmClipboardEndCopy XMCLIPBOARDENDCOPY
+#define XmClipboardEndRetrieve XMCLIPBOARDENDRETRIEVE
+#define XmClipboardInquireCount XMCLIPBOARDINQUIRECOUNT
+#define XmClipboardInquireFormat XMCLIPBOARDINQUIREFORMAT
+#define XmClipboardInquireLength XMCLIPBOARDINQUIRELENGTH
+#define XmClipboardLock XMCLIPBOARDLOCK
+#define XmClipboardRetrieve XMCLIPBOARDRETRIEVE
+#define XmClipboardStartCopy XMCLIPBOARDSTARTCOPY
+#define XmClipboardStartRetrieve XMCLIPBOARDSTARTRETRIEVE
+#define XmClipboardUnlock XMCLIPBOARDUNLOCK
+#define XmCommandError XMCOMMANDERROR
+#define XmCommandGetChild XMCOMMANDGETCHILD
+#define XmCommandSetValue XMCOMMANDSETVALUE
+#define XmCreateArrowButton XMCREATEARROWBUTTON
+#define XmCreateArrowButtonGadget XMCREATEARROWBUTTONGADGET
+#define XmCreateBulletinBoardDialog XMCREATEBULLETINBOARDDIALOG
+#define XmCreateCascadeButton XMCREATECASCADEBUTTON
+#define XmCreateCascadeButtonGadget XMCREATECASCADEBUTTONGADGET
+#define XmCreateDialogShell XMCREATEDIALOGSHELL
+#define XmCreateDragIcon XMCREATEDRAGICON
+#define XmCreateDrawingArea XMCREATEDRAWINGAREA
+#define XmCreateDrawnButton XMCREATEDRAWNBUTTON
+#define XmCreateErrorDialog XMCREATEERRORDIALOG
+#define XmCreateFileSelectionBox XMCREATEFILESELECTIONBOX
+#define XmCreateFileSelectionDialog XMCREATEFILESELECTIONDIALOG
+#define XmCreateForm XMCREATEFORM
+#define XmCreateFormDialog XMCREATEFORMDIALOG
+#define XmCreateFrame XMCREATEFRAME
+#define XmCreateInformationDialog XMCREATEINFORMATIONDIALOG
+#define XmCreateLabel XMCREATELABEL
+#define XmCreateLabelGadget XMCREATELABELGADGET
+#define XmCreateList XMCREATELIST
+#define XmCreateMainWindow XMCREATEMAINWINDOW
+#define XmCreateMenuBar XMCREATEMENUBAR
+#define XmCreateMessageBox XMCREATEMESSAGEBOX
+#define XmCreateMessageDialog XMCREATEMESSAGEDIALOG
+#define XmCreateOptionMenu XMCREATEOPTIONMENU
+#define XmCreatePanedWindow XMCREATEPANEDWINDOW
+#define XmCreatePopupMenu XMCREATEPOPUPMENU
+#define XmCreatePromptDialog XMCREATEPROMPTDIALOG
+#define XmCreatePulldownMenu XMCREATEPULLDOWNMENU
+#define XmCreatePushButton XMCREATEPUSHBUTTON
+#define XmCreatePushButtonGadget XMCREATEPUSHBUTTONGADGET
+#define XmCreateQuestionDialog XMCREATEQUESTIONDIALOG
+#define XmCreateRadioBox XMCREATERADIOBOX
+#define XmCreateRowColumn XMCREATEROWCOLUMN
+#define XmCreateScale XMCREATESCALE
+#define XmCreateScrollBar XMCREATESCROLLBAR
+#define XmCreateScrolledList XMCREATESCROLLEDLIST
+#define XmCreateScrolledText XMCREATESCROLLEDTEXT
+#define XmCreateScrolledWindow XMCREATESCROLLEDWINDOW
+#define XmCreateSelectionDialog XMCREATESELECTIONDIALOG
+#define XmCreateSeparator XMCREATESEPARATOR
+#define XmCreateSeparatorGadget XMCREATESEPARATORGADGET
+#define XmCreateSimpleMenuBar XMCREATESIMPLEMENUBAR
+#define XmCreateTemplateDialog XMCREATETEMPLATEDIALOG
+#define XmCreateText XMCREATETEXT
+#define XmCreateTextField XMCREATETEXTFIELD
+#define XmCreateToggleButton XMCREATETOGGLEBUTTON
+#define XmCreateToggleButtonGadget XMCREATETOGGLEBUTTONGADGET
+#define XmCreateWarningDialog XMCREATEWARNINGDIALOG
+#define XmCvtCTToXmString XMCVTCTTOXMSTRING
+#define XmDestroyPixmap XMDESTROYPIXMAP
+#define XmDragStart XMDRAGSTART
+#define XmDropSiteRegister XMDROPSITEREGISTER
+#define XmDropSiteUnregister XMDROPSITEUNREGISTER
+#define XmDropSiteUpdate XMDROPSITEUPDATE
+#define XmDropTransferStart XMDROPTRANSFERSTART
+#define XmFileSelectionBoxGetChild XMFILESELECTIONBOXGETCHILD
+#define XmFileSelectionDoSearch XMFILESELECTIONDOSEARCH
+#define XmFontListAppendEntry XMFONTLISTAPPENDENTRY
+#define XmFontListCopy XMFONTLISTCOPY
+#define XmFontListCreate XMFONTLISTCREATE
+#define XmFontListEntryCreate XMFONTLISTENTRYCREATE
+#define XmFontListEntryFree XMFONTLISTENTRYFREE
+#define XmFontListEntryGetFont XMFONTLISTENTRYGETFONT
+#define XmFontListEntryGetTag XMFONTLISTENTRYGETTAG
+#define XmFontListEntryLoad XMFONTLISTENTRYLOAD
+#define XmFontListFree XMFONTLISTFREE
+#define XmFontListFreeFontContext XMFONTLISTFREEFONTCONTEXT
+#define XmFontListGetNextFont XMFONTLISTGETNEXTFONT
+#define XmFontListInitFontContext XMFONTLISTINITFONTCONTEXT
+#define XmFontListNextEntry XMFONTLISTNEXTENTRY
+#define XmGetColors XMGETCOLORS
+#define XmGetColorCalculation XMGETCOLORCALCULATION
+#define XmGetFocusWidget XMGETFOCUSWIDGET
+#define XmGetMenuCursor XMGETMENUCURSOR
+#define XmGetPixmap XMGETPIXMAP
+#define XmGetPixmapByDepth XMGETPIXMAPBYDEPTH
+#define XmGetTearOffControl XMGETTEAROFFCONTROL
+#define XmGetXmDisplay XMGETXMDISPLAY
+#define XmImMbLookupString XMIMMBLOOKUPSTRING
+#define XmImRegister XMIMREGISTER
+#define XmImSetFocusValues XMIMSETFOCUSVALUES
+#define XmImSetValues XMIMSETVALUES
+#define XmImUnregister XMIMUNREGISTER
+#define XmImUnsetFocus XMIMUNSETFOCUS
+#define XmInstallImage XMINSTALLIMAGE
+#define XmInternAtom XMINTERNATOM
+#define XmIsMotifWMRunning XMISMOTIFWMRUNNING
+#define XmListAddItem XMLISTADDITEM
+#define XmListAddItemUnselected XMLISTADDITEMUNSELECTED
+#define XmListAddItems XMLISTADDITEMS
+#define XmListAddItemsUnselected XMLISTADDITEMSUNSELECTED
+#define XmListDeleteAllItems XMLISTDELETEALLITEMS
+#define XmListDeleteItem XMLISTDELETEITEM
+#define XmListDeleteItemsPos XMLISTDELETEITEMSPOS
+#define XmListDeletePos XMLISTDELETEPOS
+#define XmListDeselectAllItems XMLISTDESELECTALLITEMS
+#define XmListDeselectPos XMLISTDESELECTPOS
+#define XmListGetKbdItemPos XMLISTGETKBDITEMPOS
+#define XmListGetMatchPos XMLISTGETMATCHPOS
+#define XmListGetSelectedPos XMLISTGETSELECTEDPOS
+#define XmListItemExists XMLISTITEMEXISTS
+#define XmListItemPos XMLISTITEMPOS
+#define XmListPosSelected XMLISTPOSSELECTED
+#define XmListReplaceItems XMLISTREPLACEITEMS
+#define XmListReplaceItemsPos XMLISTREPLACEITEMSPOS
+#define XmListSelectItem XMLISTSELECTITEM
+#define XmListSelectPos XMLISTSELECTPOS
+#define XmListSetBottomPos XMLISTSETBOTTOMPOS
+#define XmListSetItem XMLISTSETITEM
+#define XmListSetKbdItemPos XMLISTSETKBDITEMPOS
+#define XmListSetPos XMLISTSETPOS
+#define XmMainWindowSetAreas XMMAINWINDOWSETAREAS
+#define XmMenuPosition XMMENUPOSITION
+#define XmMessageBoxGetChild XMMESSAGEBOXGETCHILD
+#define XmOptionButtonGadget XMOPTIONBUTTONGADGET
+#define XmOptionLabelGadget XMOPTIONLABELGADGET
+#define XmProcessTraversal XMPROCESSTRAVERSAL
+#define XmQmotif XMQMOTIF
+#define XmRemoveProtocolCallback XMREMOVEPROTOCOLCALLBACK
+#define XmRemoveProtocols XMREMOVEPROTOCOLS
+#define XmRemoveTabGroup XMREMOVETABGROUP
+#define XmRepTypeGetId XMREPTYPEGETID
+#define XmRepTypeGetRecord XMREPTYPEGETRECORD
+#define XmRepTypeInstallTearOffModelCon XMREPTYPEINSTALLTEAROFFMODELCON
+#define XmRepTypeRegister XMREPTYPEREGISTER
+#define XmRepTypeValidValue XMREPTYPEVALIDVALUE
+#define XmScrollBarGetValues XMSCROLLBARGETVALUES
+#define XmScrollBarSetValues XMSCROLLBARSETVALUES
+#define XmScrolledWindowSetAreas XMSCROLLEDWINDOWSETAREAS
+#define XmSelectionBoxGetChild XMSELECTIONBOXGETCHILD
+#define XmSetColorCalculation XMSETCOLORCALCULATION
+#define XmStringByteCompare XMSTRINGBYTECOMPARE
+#define XmStringCompare XMSTRINGCOMPARE
+#define XmStringConcat XMSTRINGCONCAT
+#define XmStringCopy XMSTRINGCOPY
+#define XmStringCreate XMSTRINGCREATE
+#define XmStringCreateLocalized XMSTRINGCREATELOCALIZED
+#define XmStringCreateLtoR XMSTRINGCREATELTOR
+#define XmStringCreateSimple XMSTRINGCREATESIMPLE
+#define XmStringDraw XMSTRINGDRAW
+#define XmStringDrawUnderline XMSTRINGDRAWUNDERLINE
+#define XmStringExtent XMSTRINGEXTENT
+#define XmStringFree XMSTRINGFREE
+#define XmStringFreeContext XMSTRINGFREECONTEXT
+#define XmStringGetLtoR XMSTRINGGETLTOR
+#define XmStringGetNextComponent XMSTRINGGETNEXTCOMPONENT
+#define XmStringGetNextSegment XMSTRINGGETNEXTSEGMENT
+#define XmStringInitContext XMSTRINGINITCONTEXT
+#define XmStringLength XMSTRINGLENGTH
+#define XmStringLtoRCreate XMSTRINGLTORCREATE
+#define XmStringNConcat XMSTRINGNCONCAT
+#define XmStringSegmentCreate XMSTRINGSEGMENTCREATE
+#define XmStringSeparatorCreate XMSTRINGSEPARATORCREATE
+#define XmStringWidth XMSTRINGWIDTH
+#define XmTextClearSelection XMTEXTCLEARSELECTION
+#define XmTextCopy XMTEXTCOPY
+#define XmTextCut XMTEXTCUT
+#define XmTextFieldClearSelection XMTEXTFIELDCLEARSELECTION
+#define XmTextFieldCopy XMTEXTFIELDCOPY
+#define XmTextFieldCut XMTEXTFIELDCUT
+#define XmTextFieldGetEditable XMTEXTFIELDGETEDITABLE
+#define XmTextFieldGetInsertionPosition XMTEXTFIELDGETINSERTIONPOSITION
+#define XmTextFieldGetLastPosition XMTEXTFIELDGETLASTPOSITION
+#define XmTextFieldGetMaxLength XMTEXTFIELDGETMAXLENGTH
+#define XmTextFieldGetSelection XMTEXTFIELDGETSELECTION
+#define XmTextFieldGetSelectionPosition XMTEXTFIELDGETSELECTIONPOSITION
+#define XmTextFieldGetString XMTEXTFIELDGETSTRING
+#define XmTextFieldInsert XMTEXTFIELDINSERT
+#define XmTextFieldPaste XMTEXTFIELDPASTE
+#define XmTextFieldRemove XMTEXTFIELDREMOVE
+#define XmTextFieldReplace XMTEXTFIELDREPLACE
+#define XmTextFieldSetAddMode XMTEXTFIELDSETADDMODE
+#define XmTextFieldSetHighlight XMTEXTFIELDSETHIGHLIGHT
+#define XmTextFieldSetInsertionPosition XMTEXTFIELDSETINSERTIONPOSITION
+#define XmTextFieldSetMaxLength XMTEXTFIELDSETMAXLENGTH
+#define XmTextFieldSetSelection XMTEXTFIELDSETSELECTION
+#define XmTextFieldSetString XMTEXTFIELDSETSTRING
+#define XmTextFieldShowPosition XMTEXTFIELDSHOWPOSITION
+#define XmTextGetCursorPosition XMTEXTGETCURSORPOSITION
+#define XmTextGetEditable XMTEXTGETEDITABLE
+#define XmTextGetInsertionPosition XMTEXTGETINSERTIONPOSITION
+#define XmTextGetLastPosition XMTEXTGETLASTPOSITION
+#define XmTextGetMaxLength XMTEXTGETMAXLENGTH
+#define XmTextGetSelection XMTEXTGETSELECTION
+#define XmTextGetSelectionPosition XMTEXTGETSELECTIONPOSITION
+#define XmTextGetString XMTEXTGETSTRING
+#define XmTextInsert XMTEXTINSERT
+#define XmTextPaste XMTEXTPASTE
+#define XmTextPosToXY XMTEXTPOSTOXY
+#define XmTextRemove XMTEXTREMOVE
+#define XmTextReplace XMTEXTREPLACE
+#define XmTextSetCursorPosition XMTEXTSETCURSORPOSITION
+#define XmTextSetEditable XMTEXTSETEDITABLE
+#define XmTextSetHighlight XMTEXTSETHIGHLIGHT
+#define XmTextSetInsertionPosition XMTEXTSETINSERTIONPOSITION
+#define XmTextSetSelection XMTEXTSETSELECTION
+#define XmTextSetString XMTEXTSETSTRING
+#define XmTextSetTopCharacter XMTEXTSETTOPCHARACTER
+#define XmTextShowPosition XMTEXTSHOWPOSITION
+#define XmToggleButtonGadgetGetState XMTOGGLEBUTTONGADGETGETSTATE
+#define XmToggleButtonGadgetSetState XMTOGGLEBUTTONGADGETSETSTATE
+#define XmToggleButtonGetState XMTOGGLEBUTTONGETSTATE
+#define XmToggleButtonSetState XMTOGGLEBUTTONSETSTATE
+#define XmUninstallImage XMUNINSTALLIMAGE
+#define XmUpdateDisplay XMUPDATEDISPLAY
+#define XmVaCreateSimpleRadioBox XMVACREATESIMPLERADIOBOX
+#define XmbDrawString XMBDRAWSTRING
+#define XmbLookupString XMBLOOKUPSTRING
+#define XmbResetIC XMBRESETIC
+#define XmbSetWMProperties XMBSETWMPROPERTIES
+#define XmbTextEscapement XMBTEXTESCAPEMENT
+#define XmbTextExtents XMBTEXTEXTENTS
+#define XmbTextListToTextProperty XMBTEXTLISTTOTEXTPROPERTY
+#define XmbTextPropertyToTextList XMBTEXTPROPERTYTOTEXTLIST
+#define XmbufCreateBuffers XMBUFCREATEBUFFERS
+#define XmbufDestroyBuffers XMBUFDESTROYBUFFERS
+#define XmbufDisplayBuffers XMBUFDISPLAYBUFFERS
+#define XmbufQueryExtension XMBUFQUERYEXTENSION
+#define Xmemory_free XMEMORY_FREE
+#define Xmemory_malloc XMEMORY_MALLOC
+#define XmuClientWindow XMUCLIENTWINDOW
+#define XmuConvertStandardSelection XMUCONVERTSTANDARDSELECTION
+#define XmuCvtStringToBitmap XMUCVTSTRINGTOBITMAP
+#define XmuInternAtom XMUINTERNATOM
+#define XmuInternStrings XMUINTERNSTRINGS
+#define XmuLookupStandardColormap XMULOOKUPSTANDARDCOLORMAP
+#define XmuPrintDefaultErrorMessage XMUPRINTDEFAULTERRORMESSAGE
+#define XrmCombineDatabase XRMCOMBINEDATABASE
+#define XrmCombineFileDatabase XRMCOMBINEFILEDATABASE
+#define XrmDestroyDatabase XRMDESTROYDATABASE
+#define XrmGetDatabase XRMGETDATABASE
+#define XrmGetFileDatabase XRMGETFILEDATABASE
+#define XrmGetResource XRMGETRESOURCE
+#define XrmGetStringDatabase XRMGETSTRINGDATABASE
+#define XrmInitialize XRMINITIALIZE
+#define XrmMergeDatabases XRMMERGEDATABASES
+#define XrmParseCommand XRMPARSECOMMAND
+#define XrmPermStringToQuark XRMPERMSTRINGTOQUARK
+#define XrmPutFileDatabase XRMPUTFILEDATABASE
+#define XrmPutLineResource XRMPUTLINERESOURCE
+#define XrmPutStringResource XRMPUTSTRINGRESOURCE
+#define XrmQGetResource XRMQGETRESOURCE
+#define XrmQPutStringResource XRMQPUTSTRINGRESOURCE
+#define XrmQuarkToString XRMQUARKTOSTRING
+#define XrmSetDatabase XRMSETDATABASE
+#define XrmStringToBindingQuarkList XRMSTRINGTOBINDINGQUARKLIST
+#define XrmStringToQuark XRMSTRINGTOQUARK
+#define XtAddCallback XTADDCALLBACK
+#define XtAddCallbacks XTADDCALLBACKS
+#define XtAddConverter XTADDCONVERTER
+#define XtAddEventHandler XTADDEVENTHANDLER
+#define XtAddExposureToRegion XTADDEXPOSURETOREGION
+#define XtAddGrab XTADDGRAB
+#define XtAddRawEventHandler XTADDRAWEVENTHANDLER
+#define XtAllocateGC XTALLOCATEGC
+#define XtAppAddActions XTAPPADDACTIONS
+#define XtAppAddInput XTAPPADDINPUT
+#define XtAppAddTimeOut XTAPPADDTIMEOUT
+#define XtAppAddWorkProc XTAPPADDWORKPROC
+#define XtAppCreateShell XTAPPCREATESHELL
+#define XtAppError XTAPPERROR
+#define XtAppErrorMsg XTAPPERRORMSG
+#define XtAppGetErrorDatabase XTAPPGETERRORDATABASE
+#define XtAppGetErrorDatabaseText XTAPPGETERRORDATABASETEXT
+#define XtAppSetErrorMsgHandler XTAPPSETERRORMSGHANDLER
+#define XtAppInitialize XTAPPINITIALIZE
+#define XtAppMainLoop XTAPPMAINLOOP
+#define XtAppNextEvent XTAPPNEXTEVENT
+#define XtAppPeekEvent XTAPPPEEKEVENT
+#define XtAppPending XTAPPPENDING
+#define XtAppProcessEvent XTAPPPROCESSEVENT
+#define XtAppSetErrorHandler XTAPPSETERRORHANDLER
+#define XtAppSetFallbackResources XTAPPSETFALLBACKRESOURCES
+#define XtAppSetTypeConverter XTAPPSETTYPECONVERTER
+#define XtAppSetWarningHandler XTAPPSETWARNINGHANDLER
+#define XtAppWarningMsg XTAPPWARNINGMSG
+#define XtAppSetWarningMsgHandler XTAPPSETWARNINGMSGHANDLER
+#define XtAppWarning XTAPPWARNING
+#define XtAugmentTranslations XTAUGMENTTRANSLATIONS
+#define XtCallActionProc XTCALLACTIONPROC
+#define XtCallCallbackList XTCALLCALLBACKLIST
+#define XtCallCallbacks XTCALLCALLBACKS
+#define XtCallConverter XTCALLCONVERTER
+#define XtCalloc XTCALLOC
+#ifndef NOXTDISPLAY
+#define XtClass XTCLASS
+#endif
+#define XtCloseDisplay XTCLOSEDISPLAY
+#define XtConfigureWidget XTCONFIGUREWIDGET
+#define XtConvert XTCONVERT
+#define XtConvertAndStore XTCONVERTANDSTORE
+#define XtCreateApplicationContext XTCREATEAPPLICATIONCONTEXT
+#define XtCreateManagedWidget XTCREATEMANAGEDWIDGET
+#define XtCreatePopupShell XTCREATEPOPUPSHELL
+#define XtCreateWidget XTCREATEWIDGET
+#define XtCreateWindow XTCREATEWINDOW
+#define XtCvtStringToFont XTCVTSTRINGTOFONT
+#define XtDatabase XTDATABASE
+#define XtDestroyApplicationContext XTDESTROYAPPLICATIONCONTEXT
+#define XtDestroyWidget XTDESTROYWIDGET
+#define XtDisownSelection XTDISOWNSELECTION
+#define XtDispatchEvent XTDISPATCHEVENT
+#ifndef NOXTDISPLAY
+#define XtDisplay XTDISPLAY
+#endif
+#define XtDisplayInitialize XTDISPLAYINITIALIZE
+#define XtDisplayOfObject XTDISPLAYOFOBJECT
+#define XtDisplayStringConvWarning XTDISPLAYSTRINGCONVWARNING
+#define XtDisplayToApplicationContext XTDISPLAYTOAPPLICATIONCONTEXT
+#define XtError XTERROR
+#define XtErrorMsg XTERRORMSG
+#define XtFree XTFREE
+#define XtGetActionKeysym XTGETACTIONKEYSYM
+#define XtGetActionList XTGETACTIONLIST
+#define XtGetApplicationNameAndClass XTGETAPPLICATIONNAMEANDCLASS
+#define XtGetApplicationResources XTGETAPPLICATIONRESOURCES
+#define XtGetClassExtension XTGETCLASSEXTENSION
+#define XtGetConstraintResourceList XTGETCONSTRAINTRESOURCELIST
+#define XtGetGC XTGETGC
+#define XtGetMultiClickTime XTGETMULTICLICKTIME
+#define XtGetResourceList XTGETRESOURCELIST
+#define XtGetSelectionValue XTGETSELECTIONVALUE
+#define XtGetSelectionValues XTGETSELECTIONVALUES
+#define XtGetSubresources XTGETSUBRESOURCES
+#define XtGetValues XTGETVALUES
+#define XtGrabButton XTGRABBUTTON
+#define XtGrabKeyboard XTGRABKEYBOARD
+#define XtGrabPointer XTGRABPOINTER
+#define XtHasCallbacks XTHASCALLBACKS
+#define XtInitialize XTINITIALIZE
+#define XtInitializeWidgetClass XTINITIALIZEWIDGETCLASS
+#define XtInsertEventHandler XTINSERTEVENTHANDLER
+#define XtInsertRawEventHandler XTINSERTRAWEVENTHANDLER
+#define XtInstallAccelerators XTINSTALLACCELERATORS
+#define XtIsManaged XTISMANAGED
+#define XtIsObject XTISOBJECT
+#ifndef NOXTDISPLAY
+#define XtIsRealized XTISREALIZED
+#endif
+#define XtIsSensitive XTISSENSITIVE
+#define XtIsSubclass XTISSUBCLASS
+#define XtLastTimestampProcessed XTLASTTIMESTAMPPROCESSED
+#define XtMainLoop XTMAINLOOP
+#define XtMakeGeometryRequest XTMAKEGEOMETRYREQUEST
+#define XtMakeResizeRequest XTMAKERESIZEREQUEST
+#define XtMalloc XTMALLOC
+#define XtManageChild XTMANAGECHILD
+#define XtManageChildren XTMANAGECHILDREN
+#define XtMergeArgLists XTMERGEARGLISTS
+#define XtMoveWidget XTMOVEWIDGET
+#define XtName XTNAME
+#define XtNameToWidget XTNAMETOWIDGET
+#define XtOpenApplication XTOPENAPPLICATION
+#define XtOpenDisplay XTOPENDISPLAY
+#define XtOverrideTranslations XTOVERRIDETRANSLATIONS
+#define XtOwnSelection XTOWNSELECTION
+#ifndef NOXTDISPLAY
+#define XtParent XTPARENT
+#endif
+#define XtParseAcceleratorTable XTPARSEACCELERATORTABLE
+#define XtParseTranslationTable XTPARSETRANSLATIONTABLE
+#define XtPopdown XTPOPDOWN
+#define XtPopup XTPOPUP
+#define XtPopupSpringLoaded XTPOPUPSPRINGLOADED
+#define XtQueryGeometry XTQUERYGEOMETRY
+#define XtRealizeWidget XTREALIZEWIDGET
+#define XtRealloc XTREALLOC
+#define XtRegisterDrawable _XTREGISTERWINDOW
+#define XtRegisterGrabAction XTREGISTERGRABACTION
+#define XtReleaseGC XTRELEASEGC
+#define XtRemoveAllCallbacks XTREMOVEALLCALLBACKS
+#define XtRemoveCallback XTREMOVECALLBACK
+#define XtRemoveEventHandler XTREMOVEEVENTHANDLER
+#define XtRemoveGrab XTREMOVEGRAB
+#define XtRemoveInput XTREMOVEINPUT
+#define XtRemoveTimeOut XTREMOVETIMEOUT
+#define XtRemoveWorkProc XTREMOVEWORKPROC
+#define XtResizeWidget XTRESIZEWIDGET
+#define XtResolvePathname XTRESOLVEPATHNAME
+#ifndef NOXTDISPLAY
+#define XtScreen XTSCREEN
+#endif
+#define XtScreenDatabase XTSCREENDATABASE
+#define XtScreenOfObject XTSCREENOFOBJECT
+#define XtSessionReturnToken XTSESSIONRETURNTOKEN
+#define XtSetErrorHandler XTSETERRORHANDLER
+#define XtSetKeyboardFocus XTSETKEYBOARDFOCUS
+#define XtSetLanguageProc XTSETLANGUAGEPROC
+#define XtSetMappedWhenManaged XTSETMAPPEDWHENMANAGED
+#define XtSetSensitive XTSETSENSITIVE
+#define XtSetTypeConverter XTSETTYPECONVERTER
+#define XtSetValues XTSETVALUES
+#define XtShellStrings XTSHELLSTRINGS
+#define XtStringConversionWarning XTSTRINGCONVERSIONWARNING
+#define XtStrings XTSTRINGS
+#define XtToolkitInitialize XTTOOLKITINITIALIZE
+#define XtTranslateCoords XTTRANSLATECOORDS
+#define XtTranslateKeycode XTTRANSLATEKEYCODE
+#define XtUngrabButton XTUNGRABBUTTON
+#define XtUngrabKeyboard XTUNGRABKEYBOARD
+#define XtUngrabPointer XTUNGRABPOINTER
+#define XtUnmanageChild XTUNMANAGECHILD
+#define XtUnmanageChildren XTUNMANAGECHILDREN
+#define XtUnrealizeWidget XTUNREALIZEWIDGET
+#define XtUnregisterDrawable _XTUNREGISTERWINDOW
+#define XtVaAppCreateShell XTVAAPPCREATESHELL
+#define XtVaCreateManagedWidget XTVACREATEMANAGEDWIDGET
+#define XtVaCreatePopupShell XTVACREATEPOPUPSHELL
+#define XtVaCreateWidget XTVACREATEWIDGET
+#define XtVaGetApplicationResources XTVAGETAPPLICATIONRESOURCES
+#define XtVaGetValues XTVAGETVALUES
+#define XtVaSetValues XTVASETVALUES
+#define XtWarning XTWARNING
+#define XtWarningMsg XTWARNINGMSG
+#define XtWidgetToApplicationContext XTWIDGETTOAPPLICATIONCONTEXT
+#ifndef NOXTDISPLAY
+#define XtWindow XTWINDOW
+#endif
+#define XtWindowOfObject XTWINDOWOFOBJECT
+#define XtWindowToWidget XTWINDOWTOWIDGET
+#define XwcDrawImageString XWCDRAWIMAGESTRING
+#define XwcDrawString XWCDRAWSTRING
+#define XwcFreeStringList XWCFREESTRINGLIST
+#define XwcTextEscapement XWCTEXTESCAPEMENT
+#define XwcTextExtents XWCTEXTEXTENTS
+#define XwcTextListToTextProperty XWCTEXTLISTTOTEXTPROPERTY
+#define XwcLookupString XWCLOOKUPSTRING
+#define XwcTextPropertyToTextList XWCTEXTPROPERTYTOTEXTLIST
+#define _XAllocTemp _XALLOCTEMP
+#define _XDeqAsyncHandler _XDEQASYNCHANDLER
+#define _XEatData _XEATDATA
+#define _XFlush _XFLUSH
+#define _XFreeTemp _XFREETEMP
+#define _XGetAsyncReply _XGETASYNCREPLY
+#define _XInitImageFuncPtrs _XINITIMAGEFUNCPTRS
+#define _XRead _XREAD
+#define _XReadPad _XREADPAD
+#define _XRegisterFilterByType _XREGISTERFILTERBYTYPE
+#define _XReply _XREPLY
+#define _XSend _XSEND
+#define _XUnregisterFilter _XUNREGISTERFILTER
+#define _XVIDtoVisual _XVIDTOVISUAL
+#define _XmBottomShadowColorDefault _XMBOTTOMSHADOWCOLORDEFAULT
+#define _XmClearBorder _XMCLEARBORDER
+#define _XmConfigureObject _XMCONFIGUREOBJECT
+#define _XmDestroyParentCallback _XMDESTROYPARENTCALLBACK
+#define _XmDrawArrow _XMDRAWARROW
+#define _XmDrawShadows _XMDRAWSHADOWS
+#define _XmFontListGetDefaultFont _XMFONTLISTGETDEFAULTFONT
+#define _XmFromHorizontalPixels _XMFROMHORIZONTALPIXELS
+#define _XmFromVerticalPixels _XMFROMVERTICALPIXELS
+#define _XmGetClassExtensionPtr _XMGETCLASSEXTENSIONPTR
+#define _XmGetDefaultFontList _XMGETDEFAULTFONTLIST
+#define _XmGetTextualDragIcon _XMGETTEXTUALDRAGICON
+#define _XmGetWidgetExtData _XMGETWIDGETEXTDATA
+#define _XmGrabKeyboard _XMGRABKEYBOARD
+#define _XmGrabPointer _XMGRABPOINTER
+#define _XmInheritClass _XMINHERITCLASS
+#define _XmInputForGadget _XMINPUTFORGADGET
+#define _XmInputInGadget _XMINPUTINGADGET
+#define _XmMakeGeometryRequest _XMMAKEGEOMETRYREQUEST
+#define _XmMenuPopDown _XMMENUPOPDOWN
+#define _XmMoveObject _XMMOVEOBJECT
+#define _XmNavigChangeManaged _XMNAVIGCHANGEMANAGED
+#define _XmOSBuildFileList _XMOSBUILDFILELIST
+#define _XmOSFileCompare _XMOSFILECOMPARE
+#define _XmOSFindPatternPart _XMOSFINDPATTERNPART
+#define _XmOSQualifyFileSpec _XMOSQUALIFYFILESPEC
+#define _XmPostPopupMenu _XMPOSTPOPUPMENU
+#define _XmPrimitiveEnter _XMPRIMITIVEENTER
+#define _XmPrimitiveLeave _XMPRIMITIVELEAVE
+#define _XmRedisplayGadgets _XMREDISPLAYGADGETS
+#define _XmShellIsExclusive _XMSHELLISEXCLUSIVE
+#define _XmStringDraw _XMSTRINGDRAW
+#define _XmStringGetTextConcat _XMSTRINGGETTEXTCONCAT
+#define _XmStrings _XMSTRINGS
+#define _XmToHorizontalPixels _XMTOHORIZONTALPIXELS
+#define _XmToVerticalPixels _XMTOVERTICALPIXELS
+#define _XmTopShadowColorDefault _XMTOPSHADOWCOLORDEFAULT
+#define _Xm_fastPtr _XM_FASTPTR
+#define _XtCheckSubclassFlag _XTCHECKSUBCLASSFLAG
+#define _XtCopyFromArg _XTCOPYFROMARG
+#define _XtCountVaList _XTCOUNTVALIST
+#define _XtInherit _XTINHERIT
+#define _XtInheritTranslations _XTINHERITTRANSLATIONS
+#define _XtIsSubclassOf _XTISSUBCLASSOF
+#define _XtVaToArgList _XTVATOARGLIST
+#define applicationShellWidgetClass APPLICATIONSHELLWIDGETCLASS
+#define cli$dcl_parse CLI$DCL_PARSE
+#define cli$get_value CLI$GET_VALUE
+#define cli$present CLI$PRESENT
+#define compositeClassRec COMPOSITECLASSREC
+#define compositeWidgetClass COMPOSITEWIDGETCLASS
+#define constraintClassRec CONSTRAINTCLASSREC
+#define constraintWidgetClass CONSTRAINTWIDGETCLASS
+#define coreWidgetClass COREWIDGETCLASS
+#define exe$getspi EXE$GETSPI
+#define lbr$close LBR$CLOSE
+#define lbr$get_header LBR$GET_HEADER
+#define lbr$get_index LBR$GET_INDEX
+#define lbr$get_record LBR$GET_RECORD
+#define lbr$ini_control LBR$INI_CONTROL
+#define lbr$lookup_key LBR$LOOKUP_KEY
+#define lbr$open LBR$OPEN
+#define lbr$output_help LBR$OUTPUT_HELP
+#define lib$add_times LIB$ADD_TIMES
+#define lib$addx LIB$ADDX
+#define lib$create_dir LIB$CREATE_DIR
+#define lib$create_vm_zone LIB$CREATE_VM_ZONE
+#define lib$cvt_from_internal_time LIB$CVT_FROM_INTERNAL_TIME
+#define lib$cvt_htb LIB$CVT_HTB
+#define lib$cvt_vectim LIB$CVT_VECTIM
+#define lib$day LIB$DAY
+#define lib$day_of_week LIB$DAY_OF_WEEK
+#define lib$delete_symbol LIB$DELETE_SYMBOL
+#define lib$delete_vm_zone LIB$DELETE_VM_ZONE
+#define lib$disable_ctrl LIB$DISABLE_CTRL
+#define lib$ediv LIB$EDIV
+#define lib$emul LIB$EMUL
+#define lib$enable_ctrl LIB$ENABLE_CTRL
+#define lib$find_vm_zone LIB$FIND_VM_ZONE
+#define lib$format_date_time LIB$FORMAT_DATE_TIME
+#define lib$free_timer LIB$FREE_TIMER
+#define lib$free_vm LIB$FREE_VM
+#define lib$get_ef LIB$GET_EF
+#define lib$get_foreign LIB$GET_FOREIGN
+#define lib$get_input LIB$GET_INPUT
+#define lib$get_users_language LIB$GET_USERS_LANGUAGE
+#define lib$get_vm LIB$GET_VM
+#define lib$get_symbol LIB$GET_SYMBOL
+#define lib$getdvi LIB$GETDVI
+#define lib$init_date_time_context LIB$INIT_DATE_TIME_CONTEXT
+#define lib$init_timer LIB$INIT_TIMER
+#define lib$find_file LIB$FIND_FILE
+#define lib$find_file_end LIB$FIND_FILE_END
+#define lib$find_image_symbol LIB$FIND_IMAGE_SYMBOL
+#define lib$mult_delta_time LIB$MULT_DELTA_TIME
+#define lib$put_output LIB$PUT_OUTPUT
+#define lib$rename_file LIB$RENAME_FILE
+#define lib$reset_vm_zone LIB$RESET_VM_ZONE
+#define lib$set_symbol LIB$SET_SYMBOL
+#define lib$sfree1_dd LIB$SFREE1_DD
+#define lib$show_vm LIB$SHOW_VM
+#define lib$show_vm_zone LIB$SHOW_VM_ZONE
+#define lib$spawn LIB$SPAWN
+#define lib$stat_timer LIB$STAT_TIMER
+#define lib$subx LIB$SUBX
+#define lib$sub_times LIB$SUB_TIMES
+#define lib$wait LIB$WAIT
+#define mail$send_add_address MAIL$SEND_ADD_ADDRESS
+#define mail$send_add_attribute MAIL$SEND_ADD_ATTRIBUTE
+#define mail$send_add_bodypart MAIL$SEND_ADD_BODYPART
+#define mail$send_begin MAIL$SEND_BEGIN
+#define mail$send_end MAIL$SEND_END
+#define mail$send_message MAIL$SEND_MESSAGE
+#define ncs$convert NCS$CONVERT
+#define ncs$get_cf NCS$GET_CF
+#define objectClass OBJECTCLASS
+#define objectClassRec OBJECTCLASSREC
+#define overrideShellClassRec OVERRIDESHELLCLASSREC
+#define overrideShellWidgetClass OVERRIDESHELLWIDGETCLASS
+#define pthread_attr_create PTHREAD_ATTR_CREATE
+#define pthread_attr_delete PTHREAD_ATTR_DELETE
+#define pthread_attr_destroy PTHREAD_ATTR_DESTROY
+#define pthread_attr_getdetach_np PTHREAD_ATTR_GETDETACH_NP
+#define pthread_attr_getguardsize_np PTHREAD_ATTR_GETGUARDSIZE_NP
+#define pthread_attr_getinheritsched PTHREAD_ATTR_GETINHERITSCHED
+#define pthread_attr_getprio PTHREAD_ATTR_GETPRIO
+#define pthread_attr_getsched PTHREAD_ATTR_GETSCHED
+#define pthread_attr_getschedparam PTHREAD_ATTR_GETSCHEDPARAM
+#define pthread_attr_getschedpolicy PTHREAD_ATTR_GETSCHEDPOLICY
+#define pthread_attr_getstacksize PTHREAD_ATTR_GETSTACKSIZE
+#define pthread_attr_init PTHREAD_ATTR_INIT
+#define pthread_attr_setdetach_np PTHREAD_ATTR_SETDETACH_NP
+#define pthread_attr_setdetachstate PTHREAD_ATTR_SETDETACHSTATE
+#define pthread_attr_setguardsize_np PTHREAD_ATTR_SETGUARDSIZE_NP
+#define pthread_attr_setinheritsched PTHREAD_ATTR_SETINHERITSCHED
+#define pthread_attr_setprio PTHREAD_ATTR_SETPRIO
+#define pthread_attr_setsched PTHREAD_ATTR_SETSCHED
+#define pthread_attr_setschedparam PTHREAD_ATTR_SETSCHEDPARAM
+#define pthread_attr_setschedpolicy PTHREAD_ATTR_SETSCHEDPOLICY
+#ifndef pthread_attr_setscope
+# define pthread_attr_setscope PTHREAD_ATTR_SETSCOPE
+#endif
+#define pthread_attr_setstacksize PTHREAD_ATTR_SETSTACKSIZE
+#define pthread_cancel PTHREAD_CANCEL
+#define pthread_cancel_e PTHREAD_CANCEL_E
+#define pthread_cond_broadcast PTHREAD_COND_BROADCAST
+#define pthread_cond_destroy PTHREAD_COND_DESTROY
+#define pthread_cond_init PTHREAD_COND_INIT
+#define pthread_cond_sig_preempt_int_np PTHREAD_COND_SIG_PREEMPT_INT_NP
+#define pthread_cond_signal PTHREAD_COND_SIGNAL
+#define pthread_cond_signal_int_np PTHREAD_COND_SIGNAL_INT_NP
+#define pthread_cond_timedwait PTHREAD_COND_TIMEDWAIT
+#define pthread_cond_wait PTHREAD_COND_WAIT
+#define pthread_condattr_create PTHREAD_CONDATTR_CREATE
+#define pthread_condattr_delete PTHREAD_CONDATTR_DELETE
+#define pthread_condattr_init PTHREAD_CONDATTR_INIT
+#define pthread_create PTHREAD_CREATE
+#define pthread_delay_np PTHREAD_DELAY_NP
+#define pthread_detach PTHREAD_DETACH
+#define pthread_equal PTHREAD_EQUAL
+#define pthread_exc_fetch_fp_np PTHREAD_EXC_FETCH_FP_NP
+#define pthread_exc_handler_np PTHREAD_EXC_HANDLER_NP
+#define pthread_exc_matches_np PTHREAD_EXC_MATCHES_NP
+#define pthread_exc_pop_ctx_np PTHREAD_EXC_POP_CTX_NP
+#define pthread_exc_push_ctx_np PTHREAD_EXC_PUSH_CTX_NP
+#define pthread_exc_raise_np PTHREAD_EXC_RAISE_NP
+#define pthread_exc_savecontext_np PTHREAD_EXC_SAVECONTEXT_NP
+#define pthread_exit PTHREAD_EXIT
+#define pthread_get_expiration_np PTHREAD_GET_EXPIRATION_NP
+#define pthread_getprio PTHREAD_GETPRIO
+#define pthread_getschedparam PTHREAD_GETSCHEDPARAM
+#define pthread_getscheduler PTHREAD_GETSCHEDULER
+#define pthread_getspecific PTHREAD_GETSPECIFIC
+#define pthread_getunique_np PTHREAD_GETUNIQUE_NP
+#define pthread_join PTHREAD_JOIN
+#define pthread_join32 PTHREAD_JOIN32
+#define pthread_key_create PTHREAD_KEY_CREATE
+#define pthread_key_delete PTHREAD_KEY_DELETE
+#define pthread_keycreate PTHREAD_KEYCREATE
+#define pthread_kill PTHREAD_KILL
+#define pthread_lock_global_np PTHREAD_LOCK_GLOBAL_NP
+#define pthread_mutex_destroy PTHREAD_MUTEX_DESTROY
+#define pthread_mutex_init PTHREAD_MUTEX_INIT
+#define pthread_mutex_lock PTHREAD_MUTEX_LOCK
+#define pthread_mutex_trylock PTHREAD_MUTEX_TRYLOCK
+#define pthread_mutex_unlock PTHREAD_MUTEX_UNLOCK
+#define pthread_mutexattr_create PTHREAD_MUTEXATTR_CREATE
+#define pthread_mutexattr_delete PTHREAD_MUTEXATTR_DELETE
+#define pthread_mutexattr_destroy PTHREAD_MUTEXATTR_DESTROY
+#define pthread_mutexattr_getkind_np PTHREAD_MUTEXATTR_GETKIND_NP
+#define pthread_mutexattr_init PTHREAD_MUTEXATTR_INIT
+#define pthread_mutexattr_setkind_np PTHREAD_MUTEXATTR_SETKIND_NP
+#define pthread_mutexattr_settype_np PTHREAD_MUTEXATTR_SETTYPE_NP
+#define pthread_once PTHREAD_ONCE
+#define pthread_resume_np PTHREAD_RESUME_NP
+#define pthread_self PTHREAD_SELF
+#define pthread_setasynccancel PTHREAD_SETASYNCCANCEL
+#define pthread_setcancel PTHREAD_SETCANCEL
+#define pthread_setcancelstate PTHREAD_SETCANCELSTATE
+#define pthread_setcanceltype PTHREAD_SETCANCELTYPE
+#define pthread_setprio PTHREAD_SETPRIO
+#define pthread_setschedparam PTHREAD_SETSCHEDPARAM
+#define pthread_setscheduler PTHREAD_SETSCHEDULER
+#define pthread_setspecific PTHREAD_SETSPECIFIC
+#define pthread_suspend_np PTHREAD_SUSPEND_NP
+#define pthread_testcancel PTHREAD_TESTCANCEL
+#define pthread_unlock_global_np PTHREAD_UNLOCK_GLOBAL_NP
+#define pthread_yield PTHREAD_YIELD
+#define pthread_yield_np PTHREAD_YIELD_NP
+#define rectObjClass RECTOBJCLASS
+#define rectObjClassRec RECTOBJCLASSREC
+#define sessionShellWidgetClass SESSIONSHELLWIDGETCLASS
+#define shellWidgetClass SHELLWIDGETCLASS
+#define shmat SHMAT
+#define shmctl SHMCTL
+#define shmdt SHMDT
+#define shmget SHMGET
+#define smg$create_key_table SMG$CREATE_KEY_TABLE
+#define smg$create_virtual_keyboard SMG$CREATE_VIRTUAL_KEYBOARD
+#define smg$read_composed_line SMG$READ_COMPOSED_LINE
+#define sys$add_ident SYS$ADD_IDENT
+#define sys$asctoid SYS$ASCTOID
+#define sys$assign SYS$ASSIGN
+#define sys$bintim SYS$BINTIM
+#define sys$cancel SYS$CANCEL
+#define sys$cantim SYS$CANTIM
+#define sys$check_access SYS$CHECK_ACCESS
+#define sys$close SYS$CLOSE
+#define sys$connect SYS$CONNECT
+#define sys$create SYS$CREATE
+#define sys$create_user_profile SYS$CREATE_USER_PROFILE
+#define sys$crembx SYS$CREMBX
+#define sys$creprc SYS$CREPRC
+#define sys$crmpsc SYS$CRMPSC
+#define sys$dassgn SYS$DASSGN
+#define sys$dclast SYS$DCLAST
+#define sys$dclexh SYS$DCLEXH
+#define sys$delprc SYS$DELPRC
+#define sys$deq SYS$DEQ
+#define sys$dgblsc SYS$DGBLSC
+#define sys$display SYS$DISPLAY
+#define sys$enq SYS$ENQ
+#define sys$enqw SYS$ENQW
+#define sys$erase SYS$ERASE
+#define sys$fao SYS$FAO
+#define sys$faol SYS$FAOL
+#define sys$find_held SYS$FIND_HELD
+#define sys$finish_rdb SYS$FINISH_RDB
+#define sys$flush SYS$FLUSH
+#define sys$forcex SYS$FORCEX
+#define sys$get SYS$GET
+#define sys$get_security SYS$GET_SECURITY
+#define sys$getdviw SYS$GETDVIW
+#define sys$getjpi SYS$GETJPI
+#define sys$getjpiw SYS$GETJPIW
+#define sys$getlkiw SYS$GETLKIW
+#define sys$getmsg SYS$GETMSG
+#define sys$getsyi SYS$GETSYI
+#define sys$getsyiw SYS$GETSYIW
+#define sys$gettim SYS$GETTIM
+#define sys$getuai SYS$GETUAI
+#define sys$grantid SYS$GRANTID
+#define sys$hash_password SYS$HASH_PASSWORD
+#define sys$hiber SYS$HIBER
+#define sys$mgblsc SYS$MGBLSC
+#define sys$numtim SYS$NUMTIM
+#define sys$open SYS$OPEN
+#define sys$parse SYS$PARSE
+#define sys$parse_acl SYS$PARSE_ACL
+#define sys$parse_acl SYS$PARSE_ACL
+#define sys$persona_assume SYS$PERSONA_ASSUME
+#define sys$persona_create SYS$PERSONA_CREATE
+#define sys$persona_delete SYS$PERSONA_DELETE
+#define sys$process_scan SYS$PROCESS_SCAN
+#define sys$put SYS$PUT
+#define sys$qio SYS$QIO
+#define sys$qiow SYS$QIOW
+#define sys$read SYS$READ
+#define sys$resched SYS$RESCHED
+#define sys$rewind SYS$REWIND
+#define sys$search SYS$SEARCH
+#define sys$set_security SYS$SET_SECURITY
+#define sys$setast SYS$SETAST
+#define sys$setef SYS$SETEF
+#define sys$setimr SYS$SETIMR
+#define sys$setpri SYS$SETPRI
+#define sys$setprn SYS$SETPRN
+#define sys$setprv SYS$SETPRV
+#define sys$setswm SYS$SETSWM
+#define sys$setuai SYS$SETUAI
+#define sys$sndopr SYS$SNDOPR
+#define sys$synch SYS$SYNCH
+#define sys$trnlnm SYS$TRNLNM
+#define sys$update SYS$UPDATE
+#define sys$wake SYS$WAKE
+#define sys$write SYS$WRITE
+#define topLevelShellClassRec TOPLEVELSHELLCLASSREC
+#define topLevelShellWidgetClass TOPLEVELSHELLWIDGETCLASS
+#define transientShellWidgetClass TRANSIENTSHELLWIDGETCLASS
+#define vendorShellClassRec VENDORSHELLCLASSREC
+#define vendorShellWidgetClass VENDORSHELLWIDGETCLASS
+#define widgetClass WIDGETCLASS
+#define widgetClassRec WIDGETCLASSREC
+#define wmShellClassRec WMSHELLCLASSREC
+#define wmShellWidgetClass WMSHELLWIDGETCLASS
+#define x$soft_ast_lib_lock X$SOFT_AST_LIB_LOCK
+#define x$soft_ast_lock_depth X$SOFT_AST_LOCK_DEPTH
+#define x$soft_reenable_asts X$SOFT_REENABLE_ASTS
+#define xmArrowButtonWidgetClass XMARROWBUTTONWIDGETCLASS
+#define xmBulletinBoardWidgetClass XMBULLETINBOARDWIDGETCLASS
+#define xmCascadeButtonClassRec XMCASCADEBUTTONCLASSREC
+#define xmCascadeButtonGadgetClass XMCASCADEBUTTONGADGETCLASS
+#define xmCascadeButtonWidgetClass XMCASCADEBUTTONWIDGETCLASS
+#define xmCommandWidgetClass XMCOMMANDWIDGETCLASS
+#define xmDialogShellWidgetClass XMDIALOGSHELLWIDGETCLASS
+#define xmDrawingAreaWidgetClass XMDRAWINGAREAWIDGETCLASS
+#define xmDrawnButtonWidgetClass XMDRAWNBUTTONWIDGETCLASS
+#define xmFileSelectionBoxWidgetClass XMFILESELECTIONBOXWIDGETCLASS
+#define xmFormWidgetClass XMFORMWIDGETCLASS
+#define xmFrameWidgetClass XMFRAMEWIDGETCLASS
+#define xmGadgetClass XMGADGETCLASS
+#define xmLabelGadgetClass XMLABELGADGETCLASS
+#define xmLabelWidgetClass XMLABELWIDGETCLASS
+#define xmListWidgetClass XMLISTWIDGETCLASS
+#define xmMainWindowWidgetClass XMMAINWINDOWWIDGETCLASS
+#define xmManagerClassRec XMMANAGERCLASSREC
+#define xmManagerWidgetClass XMMANAGERWIDGETCLASS
+#define xmMenuShellWidgetClass XMMENUSHELLWIDGETCLASS
+#define xmMessageBoxWidgetClass XMMESSAGEBOXWIDGETCLASS
+#define xmPrimitiveClassRec XMPRIMITIVECLASSREC
+#define xmPrimitiveWidgetClass XMPRIMITIVEWIDGETCLASS
+#define xmPushButtonClassRec XMPUSHBUTTONCLASSREC
+#define xmPushButtonGadgetClass XMPUSHBUTTONGADGETCLASS
+#define xmPushButtonWidgetClass XMPUSHBUTTONWIDGETCLASS
+#define xmRowColumnWidgetClass XMROWCOLUMNWIDGETCLASS
+#define xmSashWidgetClass XMSASHWIDGETCLASS
+#define xmScaleWidgetClass XMSCALEWIDGETCLASS
+#define xmScrollBarWidgetClass XMSCROLLBARWIDGETCLASS
+#define xmScrolledWindowClassRec XMSCROLLEDWINDOWCLASSREC
+#define xmScrolledWindowWidgetClass XMSCROLLEDWINDOWWIDGETCLASS
+#define xmSeparatorGadgetClass XMSEPARATORGADGETCLASS
+#define xmSeparatorWidgetClass XMSEPARATORWIDGETCLASS
+#define xmTextFieldWidgetClass XMTEXTFIELDWIDGETCLASS
+#define xmTextWidgetClass XMTEXTWIDGETCLASS
+#define xmToggleButtonGadgetClass XMTOGGLEBUTTONGADGETCLASS
+#define xmToggleButtonWidgetClass XMTOGGLEBUTTONWIDGETCLASS
+
+#if (__VMS_VER < 80200000)
+# define SetReqLen(req,n,badlen) \
+ if ((req->length + n) > (unsigned)65535) { \
+ n = badlen; \
+ req->length += n; \
+ } else \
+ req->length += n
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+extern void XtFree(char*);
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/hw/yagl/yagl_inc/GL/wglext.h b/hw/yagl/yagl_inc/GL/wglext.h
new file mode 100644
index 0000000000..e60c6527d2
--- /dev/null
+++ b/hw/yagl/yagl_inc/GL/wglext.h
@@ -0,0 +1,901 @@
+#ifndef __wglext_h_
+#define __wglext_h_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+** Copyright (c) 2007-2010 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
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+
+/* Function declaration macros - to move into glplatform.h */
+
+#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
+#define WIN32_LEAN_AND_MEAN 1
+#include <windows.h>
+#endif
+
+#ifndef APIENTRY
+#define APIENTRY
+#endif
+#ifndef APIENTRYP
+#define APIENTRYP APIENTRY *
+#endif
+#ifndef GLAPI
+#define GLAPI extern
+#endif
+
+/*************************************************************/
+
+/* Header file version number */
+/* wglext.h last updated 2010/08/06 */
+/* Current version at http://www.opengl.org/registry/ */
+#define WGL_WGLEXT_VERSION 22
+
+#ifndef WGL_ARB_buffer_region
+#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001
+#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002
+#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004
+#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008
+#endif
+
+#ifndef WGL_ARB_multisample
+#define WGL_SAMPLE_BUFFERS_ARB 0x2041
+#define WGL_SAMPLES_ARB 0x2042
+#endif
+
+#ifndef WGL_ARB_extensions_string
+#endif
+
+#ifndef WGL_ARB_pixel_format
+#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000
+#define WGL_DRAW_TO_WINDOW_ARB 0x2001
+#define WGL_DRAW_TO_BITMAP_ARB 0x2002
+#define WGL_ACCELERATION_ARB 0x2003
+#define WGL_NEED_PALETTE_ARB 0x2004
+#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005
+#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006
+#define WGL_SWAP_METHOD_ARB 0x2007
+#define WGL_NUMBER_OVERLAYS_ARB 0x2008
+#define WGL_NUMBER_UNDERLAYS_ARB 0x2009
+#define WGL_TRANSPARENT_ARB 0x200A
+#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037
+#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038
+#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039
+#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A
+#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B
+#define WGL_SHARE_DEPTH_ARB 0x200C
+#define WGL_SHARE_STENCIL_ARB 0x200D
+#define WGL_SHARE_ACCUM_ARB 0x200E
+#define WGL_SUPPORT_GDI_ARB 0x200F
+#define WGL_SUPPORT_OPENGL_ARB 0x2010
+#define WGL_DOUBLE_BUFFER_ARB 0x2011
+#define WGL_STEREO_ARB 0x2012
+#define WGL_PIXEL_TYPE_ARB 0x2013
+#define WGL_COLOR_BITS_ARB 0x2014
+#define WGL_RED_BITS_ARB 0x2015
+#define WGL_RED_SHIFT_ARB 0x2016
+#define WGL_GREEN_BITS_ARB 0x2017
+#define WGL_GREEN_SHIFT_ARB 0x2018
+#define WGL_BLUE_BITS_ARB 0x2019
+#define WGL_BLUE_SHIFT_ARB 0x201A
+#define WGL_ALPHA_BITS_ARB 0x201B
+#define WGL_ALPHA_SHIFT_ARB 0x201C
+#define WGL_ACCUM_BITS_ARB 0x201D
+#define WGL_ACCUM_RED_BITS_ARB 0x201E
+#define WGL_ACCUM_GREEN_BITS_ARB 0x201F
+#define WGL_ACCUM_BLUE_BITS_ARB 0x2020
+#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021
+#define WGL_DEPTH_BITS_ARB 0x2022
+#define WGL_STENCIL_BITS_ARB 0x2023
+#define WGL_AUX_BUFFERS_ARB 0x2024
+#define WGL_NO_ACCELERATION_ARB 0x2025
+#define WGL_GENERIC_ACCELERATION_ARB 0x2026
+#define WGL_FULL_ACCELERATION_ARB 0x2027
+#define WGL_SWAP_EXCHANGE_ARB 0x2028
+#define WGL_SWAP_COPY_ARB 0x2029
+#define WGL_SWAP_UNDEFINED_ARB 0x202A
+#define WGL_TYPE_RGBA_ARB 0x202B
+#define WGL_TYPE_COLORINDEX_ARB 0x202C
+#endif
+
+#ifndef WGL_ARB_make_current_read
+#define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043
+#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054
+#endif
+
+#ifndef WGL_ARB_pbuffer
+#define WGL_DRAW_TO_PBUFFER_ARB 0x202D
+#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E
+#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F
+#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030
+#define WGL_PBUFFER_LARGEST_ARB 0x2033
+#define WGL_PBUFFER_WIDTH_ARB 0x2034
+#define WGL_PBUFFER_HEIGHT_ARB 0x2035
+#define WGL_PBUFFER_LOST_ARB 0x2036
+#endif
+
+#ifndef WGL_ARB_render_texture
+#define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070
+#define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071
+#define WGL_TEXTURE_FORMAT_ARB 0x2072
+#define WGL_TEXTURE_TARGET_ARB 0x2073
+#define WGL_MIPMAP_TEXTURE_ARB 0x2074
+#define WGL_TEXTURE_RGB_ARB 0x2075
+#define WGL_TEXTURE_RGBA_ARB 0x2076
+#define WGL_NO_TEXTURE_ARB 0x2077
+#define WGL_TEXTURE_CUBE_MAP_ARB 0x2078
+#define WGL_TEXTURE_1D_ARB 0x2079
+#define WGL_TEXTURE_2D_ARB 0x207A
+#define WGL_MIPMAP_LEVEL_ARB 0x207B
+#define WGL_CUBE_MAP_FACE_ARB 0x207C
+#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D
+#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E
+#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F
+#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080
+#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081
+#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082
+#define WGL_FRONT_LEFT_ARB 0x2083
+#define WGL_FRONT_RIGHT_ARB 0x2084
+#define WGL_BACK_LEFT_ARB 0x2085
+#define WGL_BACK_RIGHT_ARB 0x2086
+#define WGL_AUX0_ARB 0x2087
+#define WGL_AUX1_ARB 0x2088
+#define WGL_AUX2_ARB 0x2089
+#define WGL_AUX3_ARB 0x208A
+#define WGL_AUX4_ARB 0x208B
+#define WGL_AUX5_ARB 0x208C
+#define WGL_AUX6_ARB 0x208D
+#define WGL_AUX7_ARB 0x208E
+#define WGL_AUX8_ARB 0x208F
+#define WGL_AUX9_ARB 0x2090
+#endif
+
+#ifndef WGL_ARB_pixel_format_float
+#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0
+#endif
+
+#ifndef WGL_ARB_framebuffer_sRGB
+#define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9
+#endif
+
+#ifndef WGL_ARB_create_context
+#define WGL_CONTEXT_DEBUG_BIT_ARB 0x00000001
+#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002
+#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091
+#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092
+#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093
+#define WGL_CONTEXT_FLAGS_ARB 0x2094
+#define ERROR_INVALID_VERSION_ARB 0x2095
+#endif
+
+#ifndef WGL_ARB_create_context_profile
+#define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126
+#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001
+#define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002
+#define ERROR_INVALID_PROFILE_ARB 0x2096
+#endif
+
+#ifndef WGL_ARB_create_context_robustness
+#define WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004
+#define WGL_LOSE_CONTEXT_ON_RESET_ARB 0x8252
+#define WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
+#define WGL_NO_RESET_NOTIFICATION_ARB 0x8261
+#endif
+
+#ifndef WGL_EXT_make_current_read
+#define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043
+#endif
+
+#ifndef WGL_EXT_pixel_format
+#define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000
+#define WGL_DRAW_TO_WINDOW_EXT 0x2001
+#define WGL_DRAW_TO_BITMAP_EXT 0x2002
+#define WGL_ACCELERATION_EXT 0x2003
+#define WGL_NEED_PALETTE_EXT 0x2004
+#define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005
+#define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006
+#define WGL_SWAP_METHOD_EXT 0x2007
+#define WGL_NUMBER_OVERLAYS_EXT 0x2008
+#define WGL_NUMBER_UNDERLAYS_EXT 0x2009
+#define WGL_TRANSPARENT_EXT 0x200A
+#define WGL_TRANSPARENT_VALUE_EXT 0x200B
+#define WGL_SHARE_DEPTH_EXT 0x200C
+#define WGL_SHARE_STENCIL_EXT 0x200D
+#define WGL_SHARE_ACCUM_EXT 0x200E
+#define WGL_SUPPORT_GDI_EXT 0x200F
+#define WGL_SUPPORT_OPENGL_EXT 0x2010
+#define WGL_DOUBLE_BUFFER_EXT 0x2011
+#define WGL_STEREO_EXT 0x2012
+#define WGL_PIXEL_TYPE_EXT 0x2013
+#define WGL_COLOR_BITS_EXT 0x2014
+#define WGL_RED_BITS_EXT 0x2015
+#define WGL_RED_SHIFT_EXT 0x2016
+#define WGL_GREEN_BITS_EXT 0x2017
+#define WGL_GREEN_SHIFT_EXT 0x2018
+#define WGL_BLUE_BITS_EXT 0x2019
+#define WGL_BLUE_SHIFT_EXT 0x201A
+#define WGL_ALPHA_BITS_EXT 0x201B
+#define WGL_ALPHA_SHIFT_EXT 0x201C
+#define WGL_ACCUM_BITS_EXT 0x201D
+#define WGL_ACCUM_RED_BITS_EXT 0x201E
+#define WGL_ACCUM_GREEN_BITS_EXT 0x201F
+#define WGL_ACCUM_BLUE_BITS_EXT 0x2020
+#define WGL_ACCUM_ALPHA_BITS_EXT 0x2021
+#define WGL_DEPTH_BITS_EXT 0x2022
+#define WGL_STENCIL_BITS_EXT 0x2023
+#define WGL_AUX_BUFFERS_EXT 0x2024
+#define WGL_NO_ACCELERATION_EXT 0x2025
+#define WGL_GENERIC_ACCELERATION_EXT 0x2026
+#define WGL_FULL_ACCELERATION_EXT 0x2027
+#define WGL_SWAP_EXCHANGE_EXT 0x2028
+#define WGL_SWAP_COPY_EXT 0x2029
+#define WGL_SWAP_UNDEFINED_EXT 0x202A
+#define WGL_TYPE_RGBA_EXT 0x202B
+#define WGL_TYPE_COLORINDEX_EXT 0x202C
+#endif
+
+#ifndef WGL_EXT_pbuffer
+#define WGL_DRAW_TO_PBUFFER_EXT 0x202D
+#define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E
+#define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F
+#define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030
+#define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031
+#define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032
+#define WGL_PBUFFER_LARGEST_EXT 0x2033
+#define WGL_PBUFFER_WIDTH_EXT 0x2034
+#define WGL_PBUFFER_HEIGHT_EXT 0x2035
+#endif
+
+#ifndef WGL_EXT_depth_float
+#define WGL_DEPTH_FLOAT_EXT 0x2040
+#endif
+
+#ifndef WGL_3DFX_multisample
+#define WGL_SAMPLE_BUFFERS_3DFX 0x2060
+#define WGL_SAMPLES_3DFX 0x2061
+#endif
+
+#ifndef WGL_EXT_multisample
+#define WGL_SAMPLE_BUFFERS_EXT 0x2041
+#define WGL_SAMPLES_EXT 0x2042
+#endif
+
+#ifndef WGL_I3D_digital_video_control
+#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050
+#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051
+#define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052
+#define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053
+#endif
+
+#ifndef WGL_I3D_gamma
+#define WGL_GAMMA_TABLE_SIZE_I3D 0x204E
+#define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F
+#endif
+
+#ifndef WGL_I3D_genlock
+#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044
+#define WGL_GENLOCK_SOURCE_EXTENAL_SYNC_I3D 0x2045
+#define WGL_GENLOCK_SOURCE_EXTENAL_FIELD_I3D 0x2046
+#define WGL_GENLOCK_SOURCE_EXTENAL_TTL_I3D 0x2047
+#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048
+#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049
+#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A
+#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B
+#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C
+#endif
+
+#ifndef WGL_I3D_image_buffer
+#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001
+#define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002
+#endif
+
+#ifndef WGL_I3D_swap_frame_lock
+#endif
+
+#ifndef WGL_NV_render_depth_texture
+#define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4
+#define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5
+#define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6
+#define WGL_DEPTH_COMPONENT_NV 0x20A7
+#endif
+
+#ifndef WGL_NV_render_texture_rectangle
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1
+#define WGL_TEXTURE_RECTANGLE_NV 0x20A2
+#endif
+
+#ifndef WGL_ATI_pixel_format_float
+#define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0
+#endif
+
+#ifndef WGL_NV_float_buffer
+#define WGL_FLOAT_COMPONENTS_NV 0x20B0
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4
+#define WGL_TEXTURE_FLOAT_R_NV 0x20B5
+#define WGL_TEXTURE_FLOAT_RG_NV 0x20B6
+#define WGL_TEXTURE_FLOAT_RGB_NV 0x20B7
+#define WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8
+#endif
+
+#ifndef WGL_3DL_stereo_control
+#define WGL_STEREO_EMITTER_ENABLE_3DL 0x2055
+#define WGL_STEREO_EMITTER_DISABLE_3DL 0x2056
+#define WGL_STEREO_POLARITY_NORMAL_3DL 0x2057
+#define WGL_STEREO_POLARITY_INVERT_3DL 0x2058
+#endif
+
+#ifndef WGL_EXT_pixel_format_packed_float
+#define WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8
+#endif
+
+#ifndef WGL_EXT_framebuffer_sRGB
+#define WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9
+#endif
+
+#ifndef WGL_NV_present_video
+#define WGL_NUM_VIDEO_SLOTS_NV 0x20F0
+#endif
+
+#ifndef WGL_NV_video_out
+#define WGL_BIND_TO_VIDEO_RGB_NV 0x20C0
+#define WGL_BIND_TO_VIDEO_RGBA_NV 0x20C1
+#define WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV 0x20C2
+#define WGL_VIDEO_OUT_COLOR_NV 0x20C3
+#define WGL_VIDEO_OUT_ALPHA_NV 0x20C4
+#define WGL_VIDEO_OUT_DEPTH_NV 0x20C5
+#define WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6
+#define WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7
+#define WGL_VIDEO_OUT_FRAME 0x20C8
+#define WGL_VIDEO_OUT_FIELD_1 0x20C9
+#define WGL_VIDEO_OUT_FIELD_2 0x20CA
+#define WGL_VIDEO_OUT_STACKED_FIELDS_1_2 0x20CB
+#define WGL_VIDEO_OUT_STACKED_FIELDS_2_1 0x20CC
+#endif
+
+#ifndef WGL_NV_swap_group
+#endif
+
+#ifndef WGL_NV_gpu_affinity
+#define WGL_ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0
+#define WGL_ERROR_MISSING_AFFINITY_MASK_NV 0x20D1
+#endif
+
+#ifndef WGL_AMD_gpu_association
+#define WGL_GPU_VENDOR_AMD 0x1F00
+#define WGL_GPU_RENDERER_STRING_AMD 0x1F01
+#define WGL_GPU_OPENGL_VERSION_STRING_AMD 0x1F02
+#define WGL_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2
+#define WGL_GPU_RAM_AMD 0x21A3
+#define WGL_GPU_CLOCK_AMD 0x21A4
+#define WGL_GPU_NUM_PIPES_AMD 0x21A5
+#define WGL_GPU_NUM_SIMD_AMD 0x21A6
+#define WGL_GPU_NUM_RB_AMD 0x21A7
+#define WGL_GPU_NUM_SPI_AMD 0x21A8
+#endif
+
+#ifndef WGL_NV_video_capture
+#define WGL_UNIQUE_ID_NV 0x20CE
+#define WGL_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF
+#endif
+
+#ifndef WGL_NV_copy_image
+#endif
+
+#ifndef WGL_NV_multisample_coverage
+#define WGL_COVERAGE_SAMPLES_NV 0x2042
+#define WGL_COLOR_SAMPLES_NV 0x20B9
+#endif
+
+#ifndef WGL_EXT_create_context_es2_profile
+#define WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004
+#endif
+
+
+/*************************************************************/
+
+#ifndef WGL_ARB_pbuffer
+DECLARE_HANDLE(HPBUFFERARB);
+#endif
+#ifndef WGL_EXT_pbuffer
+DECLARE_HANDLE(HPBUFFEREXT);
+#endif
+#ifndef WGL_NV_present_video
+DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV);
+#endif
+#ifndef WGL_NV_video_output
+DECLARE_HANDLE(HPVIDEODEV);
+#endif
+#ifndef WGL_NV_gpu_affinity
+DECLARE_HANDLE(HPGPUNV);
+DECLARE_HANDLE(HGPUNV);
+
+typedef struct _GPU_DEVICE {
+ DWORD cb;
+ CHAR DeviceName[32];
+ CHAR DeviceString[128];
+ DWORD Flags;
+ RECT rcVirtualScreen;
+} GPU_DEVICE, *PGPU_DEVICE;
+#endif
+#ifndef WGL_NV_video_capture
+DECLARE_HANDLE(HVIDEOINPUTDEVICENV);
+#endif
+
+#ifndef WGL_ARB_buffer_region
+#define WGL_ARB_buffer_region 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern HANDLE WINAPI wglCreateBufferRegionARB (HDC hDC, int iLayerPlane, UINT uType);
+extern VOID WINAPI wglDeleteBufferRegionARB (HANDLE hRegion);
+extern BOOL WINAPI wglSaveBufferRegionARB (HANDLE hRegion, int x, int y, int width, int height);
+extern BOOL WINAPI wglRestoreBufferRegionARB (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType);
+typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion);
+typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height);
+typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);
+#endif
+
+#ifndef WGL_ARB_multisample
+#define WGL_ARB_multisample 1
+#endif
+
+#ifndef WGL_ARB_extensions_string
+#define WGL_ARB_extensions_string 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern const char * WINAPI wglGetExtensionsStringARB (HDC hdc);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc);
+#endif
+
+#ifndef WGL_ARB_pixel_format
+#define WGL_ARB_pixel_format 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglGetPixelFormatAttribivARB (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues);
+extern BOOL WINAPI wglGetPixelFormatAttribfvARB (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues);
+extern BOOL WINAPI wglChoosePixelFormatARB (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues);
+typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues);
+typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
+#endif
+
+#ifndef WGL_ARB_make_current_read
+#define WGL_ARB_make_current_read 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglMakeContextCurrentARB (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
+extern HDC WINAPI wglGetCurrentReadDCARB (void);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
+typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (void);
+#endif
+
+#ifndef WGL_ARB_pbuffer
+#define WGL_ARB_pbuffer 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern HPBUFFERARB WINAPI wglCreatePbufferARB (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
+extern HDC WINAPI wglGetPbufferDCARB (HPBUFFERARB hPbuffer);
+extern int WINAPI wglReleasePbufferDCARB (HPBUFFERARB hPbuffer, HDC hDC);
+extern BOOL WINAPI wglDestroyPbufferARB (HPBUFFERARB hPbuffer);
+extern BOOL WINAPI wglQueryPbufferARB (HPBUFFERARB hPbuffer, int iAttribute, int *piValue);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
+typedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer);
+typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC);
+typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer);
+typedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int *piValue);
+#endif
+
+#ifndef WGL_ARB_render_texture
+#define WGL_ARB_render_texture 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglBindTexImageARB (HPBUFFERARB hPbuffer, int iBuffer);
+extern BOOL WINAPI wglReleaseTexImageARB (HPBUFFERARB hPbuffer, int iBuffer);
+extern BOOL WINAPI wglSetPbufferAttribARB (HPBUFFERARB hPbuffer, const int *piAttribList);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
+typedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
+typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int *piAttribList);
+#endif
+
+#ifndef WGL_ARB_pixel_format_float
+#define WGL_ARB_pixel_format_float 1
+#endif
+
+#ifndef WGL_ARB_framebuffer_sRGB
+#define WGL_ARB_framebuffer_sRGB 1
+#endif
+
+#ifndef WGL_ARB_create_context
+#define WGL_ARB_create_context 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern HGLRC WINAPI wglCreateContextAttribsARB (HDC hDC, HGLRC hShareContext, const int *attribList);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int *attribList);
+#endif
+
+#ifndef WGL_ARB_create_context_profile
+#define WGL_ARB_create_context_profile 1
+#endif
+
+#ifndef WGL_ARB_create_context_robustness
+#define WGL_ARB_create_context_robustness 1
+#endif
+
+#ifndef WGL_EXT_display_color_table
+#define WGL_EXT_display_color_table 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern GLboolean WINAPI wglCreateDisplayColorTableEXT (GLushort id);
+extern GLboolean WINAPI wglLoadDisplayColorTableEXT (const GLushort *table, GLuint length);
+extern GLboolean WINAPI wglBindDisplayColorTableEXT (GLushort id);
+extern VOID WINAPI wglDestroyDisplayColorTableEXT (GLushort id);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id);
+typedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (const GLushort *table, GLuint length);
+typedef GLboolean (WINAPI * PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id);
+typedef VOID (WINAPI * PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id);
+#endif
+
+#ifndef WGL_EXT_extensions_string
+#define WGL_EXT_extensions_string 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern const char * WINAPI wglGetExtensionsStringEXT (void);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void);
+#endif
+
+#ifndef WGL_EXT_make_current_read
+#define WGL_EXT_make_current_read 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglMakeContextCurrentEXT (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
+extern HDC WINAPI wglGetCurrentReadDCEXT (void);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
+typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (void);
+#endif
+
+#ifndef WGL_EXT_pbuffer
+#define WGL_EXT_pbuffer 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern HPBUFFEREXT WINAPI wglCreatePbufferEXT (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
+extern HDC WINAPI wglGetPbufferDCEXT (HPBUFFEREXT hPbuffer);
+extern int WINAPI wglReleasePbufferDCEXT (HPBUFFEREXT hPbuffer, HDC hDC);
+extern BOOL WINAPI wglDestroyPbufferEXT (HPBUFFEREXT hPbuffer);
+extern BOOL WINAPI wglQueryPbufferEXT (HPBUFFEREXT hPbuffer, int iAttribute, int *piValue);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
+typedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer);
+typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC);
+typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer);
+typedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int *piValue);
+#endif
+
+#ifndef WGL_EXT_pixel_format
+#define WGL_EXT_pixel_format 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglGetPixelFormatAttribivEXT (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues);
+extern BOOL WINAPI wglGetPixelFormatAttribfvEXT (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues);
+extern BOOL WINAPI wglChoosePixelFormatEXT (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues);
+typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues);
+typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
+#endif
+
+#ifndef WGL_EXT_swap_control
+#define WGL_EXT_swap_control 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglSwapIntervalEXT (int interval);
+extern int WINAPI wglGetSwapIntervalEXT (void);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval);
+typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void);
+#endif
+
+#ifndef WGL_EXT_depth_float
+#define WGL_EXT_depth_float 1
+#endif
+
+#ifndef WGL_NV_vertex_array_range
+#define WGL_NV_vertex_array_range 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern void* WINAPI wglAllocateMemoryNV (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
+extern void WINAPI wglFreeMemoryNV (void *pointer);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef void* (WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
+typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer);
+#endif
+
+#ifndef WGL_3DFX_multisample
+#define WGL_3DFX_multisample 1
+#endif
+
+#ifndef WGL_EXT_multisample
+#define WGL_EXT_multisample 1
+#endif
+
+#ifndef WGL_OML_sync_control
+#define WGL_OML_sync_control 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglGetSyncValuesOML (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc);
+extern BOOL WINAPI wglGetMscRateOML (HDC hdc, INT32 *numerator, INT32 *denominator);
+extern INT64 WINAPI wglSwapBuffersMscOML (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder);
+extern INT64 WINAPI wglSwapLayerBuffersMscOML (HDC hdc, int fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder);
+extern BOOL WINAPI wglWaitForMscOML (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc);
+extern BOOL WINAPI wglWaitForSbcOML (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc);
+typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32 *numerator, INT32 *denominator);
+typedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder);
+typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, int fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder);
+typedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc);
+typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc);
+#endif
+
+#ifndef WGL_I3D_digital_video_control
+#define WGL_I3D_digital_video_control 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglGetDigitalVideoParametersI3D (HDC hDC, int iAttribute, int *piValue);
+extern BOOL WINAPI wglSetDigitalVideoParametersI3D (HDC hDC, int iAttribute, const int *piValue);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue);
+typedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue);
+#endif
+
+#ifndef WGL_I3D_gamma
+#define WGL_I3D_gamma 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglGetGammaTableParametersI3D (HDC hDC, int iAttribute, int *piValue);
+extern BOOL WINAPI wglSetGammaTableParametersI3D (HDC hDC, int iAttribute, const int *piValue);
+extern BOOL WINAPI wglGetGammaTableI3D (HDC hDC, int iEntries, USHORT *puRed, USHORT *puGreen, USHORT *puBlue);
+extern BOOL WINAPI wglSetGammaTableI3D (HDC hDC, int iEntries, const USHORT *puRed, const USHORT *puGreen, const USHORT *puBlue);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue);
+typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue);
+typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT *puRed, USHORT *puGreen, USHORT *puBlue);
+typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT *puRed, const USHORT *puGreen, const USHORT *puBlue);
+#endif
+
+#ifndef WGL_I3D_genlock
+#define WGL_I3D_genlock 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglEnableGenlockI3D (HDC hDC);
+extern BOOL WINAPI wglDisableGenlockI3D (HDC hDC);
+extern BOOL WINAPI wglIsEnabledGenlockI3D (HDC hDC, BOOL *pFlag);
+extern BOOL WINAPI wglGenlockSourceI3D (HDC hDC, UINT uSource);
+extern BOOL WINAPI wglGetGenlockSourceI3D (HDC hDC, UINT *uSource);
+extern BOOL WINAPI wglGenlockSourceEdgeI3D (HDC hDC, UINT uEdge);
+extern BOOL WINAPI wglGetGenlockSourceEdgeI3D (HDC hDC, UINT *uEdge);
+extern BOOL WINAPI wglGenlockSampleRateI3D (HDC hDC, UINT uRate);
+extern BOOL WINAPI wglGetGenlockSampleRateI3D (HDC hDC, UINT *uRate);
+extern BOOL WINAPI wglGenlockSourceDelayI3D (HDC hDC, UINT uDelay);
+extern BOOL WINAPI wglGetGenlockSourceDelayI3D (HDC hDC, UINT *uDelay);
+extern BOOL WINAPI wglQueryGenlockMaxSourceDelayI3D (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC);
+typedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC);
+typedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL *pFlag);
+typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource);
+typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT *uSource);
+typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge);
+typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT *uEdge);
+typedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate);
+typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT *uRate);
+typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay);
+typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT *uDelay);
+typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay);
+#endif
+
+#ifndef WGL_I3D_image_buffer
+#define WGL_I3D_image_buffer 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern LPVOID WINAPI wglCreateImageBufferI3D (HDC hDC, DWORD dwSize, UINT uFlags);
+extern BOOL WINAPI wglDestroyImageBufferI3D (HDC hDC, LPVOID pAddress);
+extern BOOL WINAPI wglAssociateImageBufferEventsI3D (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count);
+extern BOOL WINAPI wglReleaseImageBufferEventsI3D (HDC hDC, const LPVOID *pAddress, UINT count);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags);
+typedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress);
+typedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count);
+typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const LPVOID *pAddress, UINT count);
+#endif
+
+#ifndef WGL_I3D_swap_frame_lock
+#define WGL_I3D_swap_frame_lock 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglEnableFrameLockI3D (void);
+extern BOOL WINAPI wglDisableFrameLockI3D (void);
+extern BOOL WINAPI wglIsEnabledFrameLockI3D (BOOL *pFlag);
+extern BOOL WINAPI wglQueryFrameLockMasterI3D (BOOL *pFlag);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (void);
+typedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (void);
+typedef BOOL (WINAPI * PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL *pFlag);
+typedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL *pFlag);
+#endif
+
+#ifndef WGL_I3D_swap_frame_usage
+#define WGL_I3D_swap_frame_usage 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglGetFrameUsageI3D (float *pUsage);
+extern BOOL WINAPI wglBeginFrameTrackingI3D (void);
+extern BOOL WINAPI wglEndFrameTrackingI3D (void);
+extern BOOL WINAPI wglQueryFrameTrackingI3D (DWORD *pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float *pUsage);
+typedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void);
+typedef BOOL (WINAPI * PFNWGLENDFRAMETRACKINGI3DPROC) (void);
+typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD *pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage);
+#endif
+
+#ifndef WGL_ATI_pixel_format_float
+#define WGL_ATI_pixel_format_float 1
+#endif
+
+#ifndef WGL_NV_float_buffer
+#define WGL_NV_float_buffer 1
+#endif
+
+#ifndef WGL_3DL_stereo_control
+#define WGL_3DL_stereo_control 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglSetStereoEmitterState3DL (HDC hDC, UINT uState);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLSETSTEREOEMITTERSTATE3DLPROC) (HDC hDC, UINT uState);
+#endif
+
+#ifndef WGL_EXT_pixel_format_packed_float
+#define WGL_EXT_pixel_format_packed_float 1
+#endif
+
+#ifndef WGL_EXT_framebuffer_sRGB
+#define WGL_EXT_framebuffer_sRGB 1
+#endif
+
+#ifndef WGL_NV_present_video
+#define WGL_NV_present_video 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern int WINAPI wglEnumerateVideoDevicesNV (HDC hDC, HVIDEOOUTPUTDEVICENV *phDeviceList);
+extern BOOL WINAPI wglBindVideoDeviceNV (HDC hDC, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int *piAttribList);
+extern BOOL WINAPI wglQueryCurrentContextNV (int iAttribute, int *piValue);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef int (WINAPI * PFNWGLENUMERATEVIDEODEVICESNVPROC) (HDC hDC, HVIDEOOUTPUTDEVICENV *phDeviceList);
+typedef BOOL (WINAPI * PFNWGLBINDVIDEODEVICENVPROC) (HDC hDC, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int *piAttribList);
+typedef BOOL (WINAPI * PFNWGLQUERYCURRENTCONTEXTNVPROC) (int iAttribute, int *piValue);
+#endif
+
+#ifndef WGL_NV_video_output
+#define WGL_NV_video_output 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglGetVideoDeviceNV (HDC hDC, int numDevices, HPVIDEODEV *hVideoDevice);
+extern BOOL WINAPI wglReleaseVideoDeviceNV (HPVIDEODEV hVideoDevice);
+extern BOOL WINAPI wglBindVideoImageNV (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer);
+extern BOOL WINAPI wglReleaseVideoImageNV (HPBUFFERARB hPbuffer, int iVideoBuffer);
+extern BOOL WINAPI wglSendPbufferToVideoNV (HPBUFFERARB hPbuffer, int iBufferType, unsigned long *pulCounterPbuffer, BOOL bBlock);
+extern BOOL WINAPI wglGetVideoInfoNV (HPVIDEODEV hpVideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLGETVIDEODEVICENVPROC) (HDC hDC, int numDevices, HPVIDEODEV *hVideoDevice);
+typedef BOOL (WINAPI * PFNWGLRELEASEVIDEODEVICENVPROC) (HPVIDEODEV hVideoDevice);
+typedef BOOL (WINAPI * PFNWGLBINDVIDEOIMAGENVPROC) (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer);
+typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOIMAGENVPROC) (HPBUFFERARB hPbuffer, int iVideoBuffer);
+typedef BOOL (WINAPI * PFNWGLSENDPBUFFERTOVIDEONVPROC) (HPBUFFERARB hPbuffer, int iBufferType, unsigned long *pulCounterPbuffer, BOOL bBlock);
+typedef BOOL (WINAPI * PFNWGLGETVIDEOINFONVPROC) (HPVIDEODEV hpVideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
+#endif
+
+#ifndef WGL_NV_swap_group
+#define WGL_NV_swap_group 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglJoinSwapGroupNV (HDC hDC, GLuint group);
+extern BOOL WINAPI wglBindSwapBarrierNV (GLuint group, GLuint barrier);
+extern BOOL WINAPI wglQuerySwapGroupNV (HDC hDC, GLuint *group, GLuint *barrier);
+extern BOOL WINAPI wglQueryMaxSwapGroupsNV (HDC hDC, GLuint *maxGroups, GLuint *maxBarriers);
+extern BOOL WINAPI wglQueryFrameCountNV (HDC hDC, GLuint *count);
+extern BOOL WINAPI wglResetFrameCountNV (HDC hDC);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLJOINSWAPGROUPNVPROC) (HDC hDC, GLuint group);
+typedef BOOL (WINAPI * PFNWGLBINDSWAPBARRIERNVPROC) (GLuint group, GLuint barrier);
+typedef BOOL (WINAPI * PFNWGLQUERYSWAPGROUPNVPROC) (HDC hDC, GLuint *group, GLuint *barrier);
+typedef BOOL (WINAPI * PFNWGLQUERYMAXSWAPGROUPSNVPROC) (HDC hDC, GLuint *maxGroups, GLuint *maxBarriers);
+typedef BOOL (WINAPI * PFNWGLQUERYFRAMECOUNTNVPROC) (HDC hDC, GLuint *count);
+typedef BOOL (WINAPI * PFNWGLRESETFRAMECOUNTNVPROC) (HDC hDC);
+#endif
+
+#ifndef WGL_NV_gpu_affinity
+#define WGL_NV_gpu_affinity 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglEnumGpusNV (UINT iGpuIndex, HGPUNV *phGpu);
+extern BOOL WINAPI wglEnumGpuDevicesNV (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice);
+extern HDC WINAPI wglCreateAffinityDCNV (const HGPUNV *phGpuList);
+extern BOOL WINAPI wglEnumGpusFromAffinityDCNV (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu);
+extern BOOL WINAPI wglDeleteDCNV (HDC hdc);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLENUMGPUSNVPROC) (UINT iGpuIndex, HGPUNV *phGpu);
+typedef BOOL (WINAPI * PFNWGLENUMGPUDEVICESNVPROC) (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice);
+typedef HDC (WINAPI * PFNWGLCREATEAFFINITYDCNVPROC) (const HGPUNV *phGpuList);
+typedef BOOL (WINAPI * PFNWGLENUMGPUSFROMAFFINITYDCNVPROC) (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu);
+typedef BOOL (WINAPI * PFNWGLDELETEDCNVPROC) (HDC hdc);
+#endif
+
+#ifndef WGL_AMD_gpu_association
+#define WGL_AMD_gpu_association 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern UINT WINAPI wglGetGPUIDsAMD (UINT maxCount, UINT *ids);
+extern INT WINAPI wglGetGPUInfoAMD (UINT id, int property, GLenum dataType, UINT size, void *data);
+extern UINT WINAPI wglGetContextGPUIDAMD (HGLRC hglrc);
+extern HGLRC WINAPI wglCreateAssociatedContextAMD (UINT id);
+extern HGLRC WINAPI wglCreateAssociatedContextAttribsAMD (UINT id, HGLRC hShareContext, const int *attribList);
+extern BOOL WINAPI wglDeleteAssociatedContextAMD (HGLRC hglrc);
+extern BOOL WINAPI wglMakeAssociatedContextCurrentAMD (HGLRC hglrc);
+extern HGLRC WINAPI wglGetCurrentAssociatedContextAMD (void);
+extern VOID WINAPI wglBlitContextFramebufferAMD (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef UINT (WINAPI * PFNWGLGETGPUIDSAMDPROC) (UINT maxCount, UINT *ids);
+typedef INT (WINAPI * PFNWGLGETGPUINFOAMDPROC) (UINT id, int property, GLenum dataType, UINT size, void *data);
+typedef UINT (WINAPI * PFNWGLGETCONTEXTGPUIDAMDPROC) (HGLRC hglrc);
+typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC) (UINT id);
+typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (UINT id, HGLRC hShareContext, const int *attribList);
+typedef BOOL (WINAPI * PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC) (HGLRC hglrc);
+typedef BOOL (WINAPI * PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (HGLRC hglrc);
+typedef HGLRC (WINAPI * PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void);
+typedef VOID (WINAPI * PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC) (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+#endif
+
+#ifndef WGL_NV_video_capture
+#define WGL_NV_video_capture 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglBindVideoCaptureDeviceNV (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice);
+extern UINT WINAPI wglEnumerateVideoCaptureDevicesNV (HDC hDc, HVIDEOINPUTDEVICENV *phDeviceList);
+extern BOOL WINAPI wglLockVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
+extern BOOL WINAPI wglQueryVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int *piValue);
+extern BOOL WINAPI wglReleaseVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLBINDVIDEOCAPTUREDEVICENVPROC) (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice);
+typedef UINT (WINAPI * PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC) (HDC hDc, HVIDEOINPUTDEVICENV *phDeviceList);
+typedef BOOL (WINAPI * PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
+typedef BOOL (WINAPI * PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int *piValue);
+typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
+#endif
+
+#ifndef WGL_NV_copy_image
+#define WGL_NV_copy_image 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglCopyImageSubDataNV (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLCOPYIMAGESUBDATANVPROC) (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
+#endif
+
+#ifndef WGL_NV_multisample_coverage
+#define WGL_NV_multisample_coverage 1
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/hw/yagl/yagl_inc/GL/wmesa.h b/hw/yagl/yagl_inc/GL/wmesa.h
new file mode 100644
index 0000000000..f5f4f273ba
--- /dev/null
+++ b/hw/yagl/yagl_inc/GL/wmesa.h
@@ -0,0 +1,141 @@
+/*
+ * Mesa 3-D graphics library
+ * Version: 3.0
+ * Copyright (C) 1995-1998 Brian Paul
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+
+/*
+ * Windows driver by: Mark E. Peterson (markp@ic.mankato.mn.us)
+ * Updated by Li Wei (liwei@aiar.xjtu.edu.cn)
+ *
+ *
+ ***************************************************************
+ * WMesa *
+ * version 2.3 *
+ * *
+ * By *
+ * Li Wei *
+ * Institute of Artificial Intelligence & Robotics *
+ * Xi'an Jiaotong University *
+ * Email: liwei@aiar.xjtu.edu.cn *
+ * Web page: http://sun.aiar.xjtu.edu.cn *
+ * *
+ * July 7th, 1997 *
+ ***************************************************************
+ */
+
+
+#ifndef WMESA_H
+#define WMESA_H
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "GL/gl.h"
+
+#if defined(_MSV_VER) && !defined(__GNUC__)
+# pragma warning (disable:4273)
+# pragma warning( disable : 4244 ) /* '=' : conversion from 'const double ' to 'float ', possible loss of data */
+# pragma warning( disable : 4018 ) /* '<' : signed/unsigned mismatch */
+# pragma warning( disable : 4305 ) /* '=' : truncation from 'const double ' to 'float ' */
+# pragma warning( disable : 4013 ) /* 'function' undefined; assuming extern returning int */
+# pragma warning( disable : 4761 ) /* integral size mismatch in argument; conversion supplied */
+# pragma warning( disable : 4273 ) /* 'identifier' : inconsistent DLL linkage. dllexport assumed */
+# if (MESA_WARNQUIET>1)
+# pragma warning( disable : 4146 ) /* unary minus operator applied to unsigned type, result still unsigned */
+# endif
+#endif
+
+/*
+ * This is the WMesa context 'handle':
+ */
+typedef struct wmesa_context *WMesaContext;
+
+
+
+/*
+ * Create a new WMesaContext for rendering into a window. You must
+ * have already created the window of correct visual type and with an
+ * appropriate colormap.
+ *
+ * Input:
+ * hDC - Windows device or memory context
+ * Pal - Palette to use
+ * rgb_flag - GL_TRUE = RGB mode,
+ * GL_FALSE = color index mode
+ * db_flag - GL_TRUE = double-buffered,
+ * GL_FALSE = single buffered
+ * alpha_flag - GL_TRUE = create software alpha buffer,
+ * GL_FALSE = no software alpha buffer
+ *
+ * Note: Indexed mode requires double buffering under Windows.
+ *
+ * Return: a WMesa_context or NULL if error.
+ */
+extern WMesaContext WMesaCreateContext(HDC hDC,HPALETTE* pPal,
+ GLboolean rgb_flag,
+ GLboolean db_flag,
+ GLboolean alpha_flag);
+
+
+/*
+ * Destroy a rendering context as returned by WMesaCreateContext()
+ */
+extern void WMesaDestroyContext( WMesaContext ctx );
+
+
+
+/*
+ * Make the specified context the current one.
+ */
+extern void WMesaMakeCurrent( WMesaContext ctx, HDC hdc );
+
+
+/*
+ * Return a handle to the current context.
+ */
+extern WMesaContext WMesaGetCurrentContext( void );
+
+
+/*
+ * Swap the front and back buffers for the current context. No action
+ * taken if the context is not double buffered.
+ */
+extern void WMesaSwapBuffers(HDC hdc);
+
+
+/*
+ * In indexed color mode we need to know when the palette changes.
+ */
+extern void WMesaPaletteChange(HPALETTE Pal);
+
+extern void WMesaMove(void);
+
+void WMesaShareLists(WMesaContext ctx_to_share, WMesaContext ctx);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif
+
diff --git a/hw/yagl/yagl_inc/GLES/egl.h b/hw/yagl/yagl_inc/GLES/egl.h
new file mode 100644
index 0000000000..5778e00509
--- /dev/null
+++ b/hw/yagl/yagl_inc/GLES/egl.h
@@ -0,0 +1,15 @@
+/*
+ * Skeleton egl.h to provide compatibility for early GLES 1.0
+ * applications. Several early implementations included gl.h
+ * in egl.h leading applications to include only egl.h
+ *
+ * $Revision: 6252 $ on $Date:: 2008-08-06 16:35:08 -0700 #$
+ */
+
+#ifndef __legacy_egl_h_
+#define __legacy_egl_h_
+
+#include <EGL/egl.h>
+#include <GLES/gl.h>
+
+#endif /* __legacy_egl_h_ */
diff --git a/hw/yagl/yagl_inc/GLES/gl.h b/hw/yagl/yagl_inc/GLES/gl.h
new file mode 100644
index 0000000000..5b8d85a920
--- /dev/null
+++ b/hw/yagl/yagl_inc/GLES/gl.h
@@ -0,0 +1,770 @@
+#ifndef __gl_h_
+#define __gl_h_
+
+/* $Revision: 10601 $ on $Date:: 2010-03-04 22:15:27 -0800 #$ */
+
+#include <GLES/glplatform.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * This document is licensed under the SGI Free Software B License Version
+ * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
+ */
+
+typedef void GLvoid;
+typedef char GLchar;
+typedef unsigned int GLenum;
+typedef unsigned char GLboolean;
+typedef unsigned int GLbitfield;
+typedef khronos_int8_t GLbyte;
+typedef short GLshort;
+typedef int GLint;
+typedef int GLsizei;
+typedef khronos_uint8_t GLubyte;
+typedef unsigned short GLushort;
+typedef unsigned int GLuint;
+typedef khronos_float_t GLfloat;
+typedef khronos_float_t GLclampf;
+typedef khronos_int32_t GLfixed;
+typedef khronos_int32_t GLclampx;
+
+typedef khronos_intptr_t GLintptr;
+typedef khronos_ssize_t GLsizeiptr;
+
+
+/*************************************************************/
+
+/* OpenGL ES core versions */
+#define GL_VERSION_ES_CM_1_0 1
+#define GL_VERSION_ES_CL_1_0 1
+#define GL_VERSION_ES_CM_1_1 1
+#define GL_VERSION_ES_CL_1_1 1
+
+/* ClearBufferMask */
+#define GL_DEPTH_BUFFER_BIT 0x00000100
+#define GL_STENCIL_BUFFER_BIT 0x00000400
+#define GL_COLOR_BUFFER_BIT 0x00004000
+
+/* Boolean */
+#define GL_FALSE 0
+#define GL_TRUE 1
+
+/* BeginMode */
+#define GL_POINTS 0x0000
+#define GL_LINES 0x0001
+#define GL_LINE_LOOP 0x0002
+#define GL_LINE_STRIP 0x0003
+#define GL_TRIANGLES 0x0004
+#define GL_TRIANGLE_STRIP 0x0005
+#define GL_TRIANGLE_FAN 0x0006
+
+/* AlphaFunction */
+#define GL_NEVER 0x0200
+#define GL_LESS 0x0201
+#define GL_EQUAL 0x0202
+#define GL_LEQUAL 0x0203
+#define GL_GREATER 0x0204
+#define GL_NOTEQUAL 0x0205
+#define GL_GEQUAL 0x0206
+#define GL_ALWAYS 0x0207
+
+/* BlendingFactorDest */
+#define GL_ZERO 0
+#define GL_ONE 1
+#define GL_SRC_COLOR 0x0300
+#define GL_ONE_MINUS_SRC_COLOR 0x0301
+#define GL_SRC_ALPHA 0x0302
+#define GL_ONE_MINUS_SRC_ALPHA 0x0303
+#define GL_DST_ALPHA 0x0304
+#define GL_ONE_MINUS_DST_ALPHA 0x0305
+
+/* BlendingFactorSrc */
+/* GL_ZERO */
+/* GL_ONE */
+#define GL_DST_COLOR 0x0306
+#define GL_ONE_MINUS_DST_COLOR 0x0307
+#define GL_SRC_ALPHA_SATURATE 0x0308
+/* GL_SRC_ALPHA */
+/* GL_ONE_MINUS_SRC_ALPHA */
+/* GL_DST_ALPHA */
+/* GL_ONE_MINUS_DST_ALPHA */
+
+/* ClipPlaneName */
+#define GL_CLIP_PLANE0 0x3000
+#define GL_CLIP_PLANE1 0x3001
+#define GL_CLIP_PLANE2 0x3002
+#define GL_CLIP_PLANE3 0x3003
+#define GL_CLIP_PLANE4 0x3004
+#define GL_CLIP_PLANE5 0x3005
+
+/* ColorMaterialFace */
+/* GL_FRONT_AND_BACK */
+
+/* ColorMaterialParameter */
+/* GL_AMBIENT_AND_DIFFUSE */
+
+/* ColorPointerType */
+/* GL_UNSIGNED_BYTE */
+/* GL_FLOAT */
+/* GL_FIXED */
+
+/* CullFaceMode */
+#define GL_FRONT 0x0404
+#define GL_BACK 0x0405
+#define GL_FRONT_AND_BACK 0x0408
+
+/* DepthFunction */
+/* GL_NEVER */
+/* GL_LESS */
+/* GL_EQUAL */
+/* GL_LEQUAL */
+/* GL_GREATER */
+/* GL_NOTEQUAL */
+/* GL_GEQUAL */
+/* GL_ALWAYS */
+
+/* EnableCap */
+#define GL_FOG 0x0B60
+#define GL_LIGHTING 0x0B50
+#define GL_TEXTURE_2D 0x0DE1
+#define GL_CULL_FACE 0x0B44
+#define GL_ALPHA_TEST 0x0BC0
+#define GL_BLEND 0x0BE2
+#define GL_COLOR_LOGIC_OP 0x0BF2
+#define GL_DITHER 0x0BD0
+#define GL_STENCIL_TEST 0x0B90
+#define GL_DEPTH_TEST 0x0B71
+/* GL_LIGHT0 */
+/* GL_LIGHT1 */
+/* GL_LIGHT2 */
+/* GL_LIGHT3 */
+/* GL_LIGHT4 */
+/* GL_LIGHT5 */
+/* GL_LIGHT6 */
+/* GL_LIGHT7 */
+#define GL_POINT_SMOOTH 0x0B10
+#define GL_LINE_SMOOTH 0x0B20
+#define GL_SCISSOR_TEST 0x0C11
+#define GL_COLOR_MATERIAL 0x0B57
+#define GL_NORMALIZE 0x0BA1
+#define GL_RESCALE_NORMAL 0x803A
+#define GL_POLYGON_OFFSET_FILL 0x8037
+#define GL_VERTEX_ARRAY 0x8074
+#define GL_NORMAL_ARRAY 0x8075
+#define GL_COLOR_ARRAY 0x8076
+#define GL_TEXTURE_COORD_ARRAY 0x8078
+#define GL_MULTISAMPLE 0x809D
+#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE 0x809F
+#define GL_SAMPLE_COVERAGE 0x80A0
+
+/* ErrorCode */
+#define GL_NO_ERROR 0
+#define GL_INVALID_ENUM 0x0500
+#define GL_INVALID_VALUE 0x0501
+#define GL_INVALID_OPERATION 0x0502
+#define GL_STACK_OVERFLOW 0x0503
+#define GL_STACK_UNDERFLOW 0x0504
+#define GL_OUT_OF_MEMORY 0x0505
+
+/* FogMode */
+/* GL_LINEAR */
+#define GL_EXP 0x0800
+#define GL_EXP2 0x0801
+
+/* FogParameter */
+#define GL_FOG_DENSITY 0x0B62
+#define GL_FOG_START 0x0B63
+#define GL_FOG_END 0x0B64
+#define GL_FOG_MODE 0x0B65
+#define GL_FOG_COLOR 0x0B66
+
+/* FrontFaceDirection */
+#define GL_CW 0x0900
+#define GL_CCW 0x0901
+
+/* GetPName */
+#define GL_CURRENT_COLOR 0x0B00
+#define GL_CURRENT_NORMAL 0x0B02
+#define GL_CURRENT_TEXTURE_COORDS 0x0B03
+#define GL_POINT_SIZE 0x0B11
+#define GL_POINT_SIZE_MIN 0x8126
+#define GL_POINT_SIZE_MAX 0x8127
+#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128
+#define GL_POINT_DISTANCE_ATTENUATION 0x8129
+#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12
+#define GL_LINE_WIDTH 0x0B21
+#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22
+#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
+#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
+#define GL_CULL_FACE_MODE 0x0B45
+#define GL_FRONT_FACE 0x0B46
+#define GL_SHADE_MODEL 0x0B54
+#define GL_DEPTH_RANGE 0x0B70
+#define GL_DEPTH_WRITEMASK 0x0B72
+#define GL_DEPTH_CLEAR_VALUE 0x0B73
+#define GL_DEPTH_FUNC 0x0B74
+#define GL_STENCIL_CLEAR_VALUE 0x0B91
+#define GL_STENCIL_FUNC 0x0B92
+#define GL_STENCIL_VALUE_MASK 0x0B93
+#define GL_STENCIL_FAIL 0x0B94
+#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
+#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
+#define GL_STENCIL_REF 0x0B97
+#define GL_STENCIL_WRITEMASK 0x0B98
+#define GL_MATRIX_MODE 0x0BA0
+#define GL_VIEWPORT 0x0BA2
+#define GL_MODELVIEW_STACK_DEPTH 0x0BA3
+#define GL_PROJECTION_STACK_DEPTH 0x0BA4
+#define GL_TEXTURE_STACK_DEPTH 0x0BA5
+#define GL_MODELVIEW_MATRIX 0x0BA6
+#define GL_PROJECTION_MATRIX 0x0BA7
+#define GL_TEXTURE_MATRIX 0x0BA8
+#define GL_ALPHA_TEST_FUNC 0x0BC1
+#define GL_ALPHA_TEST_REF 0x0BC2
+#define GL_BLEND_DST 0x0BE0
+#define GL_BLEND_SRC 0x0BE1
+#define GL_LOGIC_OP_MODE 0x0BF0
+#define GL_SCISSOR_BOX 0x0C10
+#define GL_SCISSOR_TEST 0x0C11
+#define GL_COLOR_CLEAR_VALUE 0x0C22
+#define GL_COLOR_WRITEMASK 0x0C23
+#define GL_UNPACK_ALIGNMENT 0x0CF5
+#define GL_PACK_ALIGNMENT 0x0D05
+#define GL_MAX_LIGHTS 0x0D31
+#define GL_MAX_CLIP_PLANES 0x0D32
+#define GL_MAX_TEXTURE_SIZE 0x0D33
+#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36
+#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38
+#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39
+#define GL_MAX_VIEWPORT_DIMS 0x0D3A
+#define GL_MAX_TEXTURE_UNITS 0x84E2
+#define GL_SUBPIXEL_BITS 0x0D50
+#define GL_RED_BITS 0x0D52
+#define GL_GREEN_BITS 0x0D53
+#define GL_BLUE_BITS 0x0D54
+#define GL_ALPHA_BITS 0x0D55
+#define GL_DEPTH_BITS 0x0D56
+#define GL_STENCIL_BITS 0x0D57
+#define GL_POLYGON_OFFSET_UNITS 0x2A00
+#define GL_POLYGON_OFFSET_FILL 0x8037
+#define GL_POLYGON_OFFSET_FACTOR 0x8038
+#define GL_TEXTURE_BINDING_2D 0x8069
+#define GL_VERTEX_ARRAY_SIZE 0x807A
+#define GL_VERTEX_ARRAY_TYPE 0x807B
+#define GL_VERTEX_ARRAY_STRIDE 0x807C
+#define GL_NORMAL_ARRAY_TYPE 0x807E
+#define GL_NORMAL_ARRAY_STRIDE 0x807F
+#define GL_COLOR_ARRAY_SIZE 0x8081
+#define GL_COLOR_ARRAY_TYPE 0x8082
+#define GL_COLOR_ARRAY_STRIDE 0x8083
+#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088
+#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089
+#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A
+#define GL_VERTEX_ARRAY_POINTER 0x808E
+#define GL_NORMAL_ARRAY_POINTER 0x808F
+#define GL_COLOR_ARRAY_POINTER 0x8090
+#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092
+#define GL_SAMPLE_BUFFERS 0x80A8
+#define GL_SAMPLES 0x80A9
+#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
+#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
+
+/* GetTextureParameter */
+/* GL_TEXTURE_MAG_FILTER */
+/* GL_TEXTURE_MIN_FILTER */
+/* GL_TEXTURE_WRAP_S */
+/* GL_TEXTURE_WRAP_T */
+
+#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
+#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
+
+/* HintMode */
+#define GL_DONT_CARE 0x1100
+#define GL_FASTEST 0x1101
+#define GL_NICEST 0x1102
+
+/* HintTarget */
+#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50
+#define GL_POINT_SMOOTH_HINT 0x0C51
+#define GL_LINE_SMOOTH_HINT 0x0C52
+#define GL_FOG_HINT 0x0C54
+#define GL_GENERATE_MIPMAP_HINT 0x8192
+
+/* LightModelParameter */
+#define GL_LIGHT_MODEL_AMBIENT 0x0B53
+#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52
+
+/* LightParameter */
+#define GL_AMBIENT 0x1200
+#define GL_DIFFUSE 0x1201
+#define GL_SPECULAR 0x1202
+#define GL_POSITION 0x1203
+#define GL_SPOT_DIRECTION 0x1204
+#define GL_SPOT_EXPONENT 0x1205
+#define GL_SPOT_CUTOFF 0x1206
+#define GL_CONSTANT_ATTENUATION 0x1207
+#define GL_LINEAR_ATTENUATION 0x1208
+#define GL_QUADRATIC_ATTENUATION 0x1209
+
+/* DataType */
+#define GL_BYTE 0x1400
+#define GL_UNSIGNED_BYTE 0x1401
+#define GL_SHORT 0x1402
+#define GL_UNSIGNED_SHORT 0x1403
+#define GL_FLOAT 0x1406
+#define GL_FIXED 0x140C
+
+/* LogicOp */
+#define GL_CLEAR 0x1500
+#define GL_AND 0x1501
+#define GL_AND_REVERSE 0x1502
+#define GL_COPY 0x1503
+#define GL_AND_INVERTED 0x1504
+#define GL_NOOP 0x1505
+#define GL_XOR 0x1506
+#define GL_OR 0x1507
+#define GL_NOR 0x1508
+#define GL_EQUIV 0x1509
+#define GL_INVERT 0x150A
+#define GL_OR_REVERSE 0x150B
+#define GL_COPY_INVERTED 0x150C
+#define GL_OR_INVERTED 0x150D
+#define GL_NAND 0x150E
+#define GL_SET 0x150F
+
+/* MaterialFace */
+/* GL_FRONT_AND_BACK */
+
+/* MaterialParameter */
+#define GL_EMISSION 0x1600
+#define GL_SHININESS 0x1601
+#define GL_AMBIENT_AND_DIFFUSE 0x1602
+/* GL_AMBIENT */
+/* GL_DIFFUSE */
+/* GL_SPECULAR */
+
+/* MatrixMode */
+#define GL_MODELVIEW 0x1700
+#define GL_PROJECTION 0x1701
+#define GL_TEXTURE 0x1702
+
+/* NormalPointerType */
+/* GL_BYTE */
+/* GL_SHORT */
+/* GL_FLOAT */
+/* GL_FIXED */
+
+/* PixelFormat */
+#define GL_ALPHA 0x1906
+#define GL_RGB 0x1907
+#define GL_RGBA 0x1908
+#define GL_LUMINANCE 0x1909
+#define GL_LUMINANCE_ALPHA 0x190A
+
+/* PixelStoreParameter */
+#define GL_UNPACK_ALIGNMENT 0x0CF5
+#define GL_PACK_ALIGNMENT 0x0D05
+
+/* PixelType */
+/* GL_UNSIGNED_BYTE */
+#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
+#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
+#define GL_UNSIGNED_SHORT_5_6_5 0x8363
+
+/* ShadingModel */
+#define GL_FLAT 0x1D00
+#define GL_SMOOTH 0x1D01
+
+/* StencilFunction */
+/* GL_NEVER */
+/* GL_LESS */
+/* GL_EQUAL */
+/* GL_LEQUAL */
+/* GL_GREATER */
+/* GL_NOTEQUAL */
+/* GL_GEQUAL */
+/* GL_ALWAYS */
+
+/* StencilOp */
+/* GL_ZERO */
+#define GL_KEEP 0x1E00
+#define GL_REPLACE 0x1E01
+#define GL_INCR 0x1E02
+#define GL_DECR 0x1E03
+/* GL_INVERT */
+
+/* StringName */
+#define GL_VENDOR 0x1F00
+#define GL_RENDERER 0x1F01
+#define GL_VERSION 0x1F02
+#define GL_EXTENSIONS 0x1F03
+
+/* TexCoordPointerType */
+/* GL_SHORT */
+/* GL_FLOAT */
+/* GL_FIXED */
+/* GL_BYTE */
+
+/* TextureEnvMode */
+#define GL_MODULATE 0x2100
+#define GL_DECAL 0x2101
+/* GL_BLEND */
+#define GL_ADD 0x0104
+/* GL_REPLACE */
+
+/* TextureEnvParameter */
+#define GL_TEXTURE_ENV_MODE 0x2200
+#define GL_TEXTURE_ENV_COLOR 0x2201
+
+/* TextureEnvTarget */
+#define GL_TEXTURE_ENV 0x2300
+
+/* TextureMagFilter */
+#define GL_NEAREST 0x2600
+#define GL_LINEAR 0x2601
+
+/* TextureMinFilter */
+/* GL_NEAREST */
+/* GL_LINEAR */
+#define GL_NEAREST_MIPMAP_NEAREST 0x2700
+#define GL_LINEAR_MIPMAP_NEAREST 0x2701
+#define GL_NEAREST_MIPMAP_LINEAR 0x2702
+#define GL_LINEAR_MIPMAP_LINEAR 0x2703
+
+/* TextureParameterName */
+#define GL_TEXTURE_MAG_FILTER 0x2800
+#define GL_TEXTURE_MIN_FILTER 0x2801
+#define GL_TEXTURE_WRAP_S 0x2802
+#define GL_TEXTURE_WRAP_T 0x2803
+#define GL_GENERATE_MIPMAP 0x8191
+
+/* TextureTarget */
+/* GL_TEXTURE_2D */
+
+/* TextureUnit */
+#define GL_TEXTURE0 0x84C0
+#define GL_TEXTURE1 0x84C1
+#define GL_TEXTURE2 0x84C2
+#define GL_TEXTURE3 0x84C3
+#define GL_TEXTURE4 0x84C4
+#define GL_TEXTURE5 0x84C5
+#define GL_TEXTURE6 0x84C6
+#define GL_TEXTURE7 0x84C7
+#define GL_TEXTURE8 0x84C8
+#define GL_TEXTURE9 0x84C9
+#define GL_TEXTURE10 0x84CA
+#define GL_TEXTURE11 0x84CB
+#define GL_TEXTURE12 0x84CC
+#define GL_TEXTURE13 0x84CD
+#define GL_TEXTURE14 0x84CE
+#define GL_TEXTURE15 0x84CF
+#define GL_TEXTURE16 0x84D0
+#define GL_TEXTURE17 0x84D1
+#define GL_TEXTURE18 0x84D2
+#define GL_TEXTURE19 0x84D3
+#define GL_TEXTURE20 0x84D4
+#define GL_TEXTURE21 0x84D5
+#define GL_TEXTURE22 0x84D6
+#define GL_TEXTURE23 0x84D7
+#define GL_TEXTURE24 0x84D8
+#define GL_TEXTURE25 0x84D9
+#define GL_TEXTURE26 0x84DA
+#define GL_TEXTURE27 0x84DB
+#define GL_TEXTURE28 0x84DC
+#define GL_TEXTURE29 0x84DD
+#define GL_TEXTURE30 0x84DE
+#define GL_TEXTURE31 0x84DF
+#define GL_ACTIVE_TEXTURE 0x84E0
+#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1
+
+/* TextureWrapMode */
+#define GL_REPEAT 0x2901
+#define GL_CLAMP_TO_EDGE 0x812F
+
+/* VertexPointerType */
+/* GL_SHORT */
+/* GL_FLOAT */
+/* GL_FIXED */
+/* GL_BYTE */
+
+/* LightName */
+#define GL_LIGHT0 0x4000
+#define GL_LIGHT1 0x4001
+#define GL_LIGHT2 0x4002
+#define GL_LIGHT3 0x4003
+#define GL_LIGHT4 0x4004
+#define GL_LIGHT5 0x4005
+#define GL_LIGHT6 0x4006
+#define GL_LIGHT7 0x4007
+
+/* Buffer Objects */
+#define GL_ARRAY_BUFFER 0x8892
+#define GL_ELEMENT_ARRAY_BUFFER 0x8893
+
+#define GL_ARRAY_BUFFER_BINDING 0x8894
+#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
+#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896
+#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897
+#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898
+#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A
+
+#define GL_STATIC_DRAW 0x88E4
+#define GL_DYNAMIC_DRAW 0x88E8
+
+#define GL_BUFFER_SIZE 0x8764
+#define GL_BUFFER_USAGE 0x8765
+
+/* Texture combine + dot3 */
+#define GL_SUBTRACT 0x84E7
+#define GL_COMBINE 0x8570
+#define GL_COMBINE_RGB 0x8571
+#define GL_COMBINE_ALPHA 0x8572
+#define GL_RGB_SCALE 0x8573
+#define GL_ADD_SIGNED 0x8574
+#define GL_INTERPOLATE 0x8575
+#define GL_CONSTANT 0x8576
+#define GL_PRIMARY_COLOR 0x8577
+#define GL_PREVIOUS 0x8578
+#define GL_OPERAND0_RGB 0x8590
+#define GL_OPERAND1_RGB 0x8591
+#define GL_OPERAND2_RGB 0x8592
+#define GL_OPERAND0_ALPHA 0x8598
+#define GL_OPERAND1_ALPHA 0x8599
+#define GL_OPERAND2_ALPHA 0x859A
+
+#define GL_ALPHA_SCALE 0x0D1C
+
+#define GL_SRC0_RGB 0x8580
+#define GL_SRC1_RGB 0x8581
+#define GL_SRC2_RGB 0x8582
+#define GL_SRC0_ALPHA 0x8588
+#define GL_SRC1_ALPHA 0x8589
+#define GL_SRC2_ALPHA 0x858A
+
+#define GL_DOT3_RGB 0x86AE
+#define GL_DOT3_RGBA 0x86AF
+
+/*------------------------------------------------------------------------*
+ * required OES extension tokens
+ *------------------------------------------------------------------------*/
+
+/* OES_read_format */
+#ifndef GL_OES_read_format
+#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A
+#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B
+#endif
+
+/* GL_OES_compressed_paletted_texture */
+#ifndef GL_OES_compressed_paletted_texture
+#define GL_PALETTE4_RGB8_OES 0x8B90
+#define GL_PALETTE4_RGBA8_OES 0x8B91
+#define GL_PALETTE4_R5_G6_B5_OES 0x8B92
+#define GL_PALETTE4_RGBA4_OES 0x8B93
+#define GL_PALETTE4_RGB5_A1_OES 0x8B94
+#define GL_PALETTE8_RGB8_OES 0x8B95
+#define GL_PALETTE8_RGBA8_OES 0x8B96
+#define GL_PALETTE8_R5_G6_B5_OES 0x8B97
+#define GL_PALETTE8_RGBA4_OES 0x8B98
+#define GL_PALETTE8_RGB5_A1_OES 0x8B99
+#endif
+
+/* OES_point_size_array */
+#ifndef GL_OES_point_size_array
+#define GL_POINT_SIZE_ARRAY_OES 0x8B9C
+#define GL_POINT_SIZE_ARRAY_TYPE_OES 0x898A
+#define GL_POINT_SIZE_ARRAY_STRIDE_OES 0x898B
+#define GL_POINT_SIZE_ARRAY_POINTER_OES 0x898C
+#define GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES 0x8B9F
+#endif
+
+/* GL_OES_point_sprite */
+#ifndef GL_OES_point_sprite
+#define GL_POINT_SPRITE_OES 0x8861
+#define GL_COORD_REPLACE_OES 0x8862
+#endif
+
+/*************************************************************/
+
+/* Available only in Common profile */
+GL_API void GL_APIENTRY glAlphaFunc (GLenum func, GLclampf ref);
+GL_API void GL_APIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+GL_API void GL_APIENTRY glClearDepthf (GLclampf depth);
+GL_API void GL_APIENTRY glClipPlanef (GLenum plane, const GLfloat *equation);
+GL_API void GL_APIENTRY glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+GL_API void GL_APIENTRY glDepthRangef (GLclampf zNear, GLclampf zFar);
+GL_API void GL_APIENTRY glFogf (GLenum pname, GLfloat param);
+GL_API void GL_APIENTRY glFogfv (GLenum pname, const GLfloat *params);
+GL_API void GL_APIENTRY glFrustumf (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+GL_API void GL_APIENTRY glGetClipPlanef (GLenum pname, GLfloat eqn[4]);
+GL_API void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat *params);
+GL_API void GL_APIENTRY glGetLightfv (GLenum light, GLenum pname, GLfloat *params);
+GL_API void GL_APIENTRY glGetMaterialfv (GLenum face, GLenum pname, GLfloat *params);
+GL_API void GL_APIENTRY glGetTexEnvfv (GLenum env, GLenum pname, GLfloat *params);
+GL_API void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params);
+GL_API void GL_APIENTRY glLightModelf (GLenum pname, GLfloat param);
+GL_API void GL_APIENTRY glLightModelfv (GLenum pname, const GLfloat *params);
+GL_API void GL_APIENTRY glLightf (GLenum light, GLenum pname, GLfloat param);
+GL_API void GL_APIENTRY glLightfv (GLenum light, GLenum pname, const GLfloat *params);
+GL_API void GL_APIENTRY glLineWidth (GLfloat width);
+GL_API void GL_APIENTRY glLoadMatrixf (const GLfloat *m);
+GL_API void GL_APIENTRY glMaterialf (GLenum face, GLenum pname, GLfloat param);
+GL_API void GL_APIENTRY glMaterialfv (GLenum face, GLenum pname, const GLfloat *params);
+GL_API void GL_APIENTRY glMultMatrixf (const GLfloat *m);
+GL_API void GL_APIENTRY glMultiTexCoord4f (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+GL_API void GL_APIENTRY glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz);
+GL_API void GL_APIENTRY glOrthof (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+GL_API void GL_APIENTRY glPointParameterf (GLenum pname, GLfloat param);
+GL_API void GL_APIENTRY glPointParameterfv (GLenum pname, const GLfloat *params);
+GL_API void GL_APIENTRY glPointSize (GLfloat size);
+GL_API void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
+GL_API void GL_APIENTRY glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
+GL_API void GL_APIENTRY glScalef (GLfloat x, GLfloat y, GLfloat z);
+GL_API void GL_APIENTRY glTexEnvf (GLenum target, GLenum pname, GLfloat param);
+GL_API void GL_APIENTRY glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params);
+GL_API void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
+GL_API void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params);
+GL_API void GL_APIENTRY glTranslatef (GLfloat x, GLfloat y, GLfloat z);
+
+/* Available in both Common and Common-Lite profiles */
+GL_API void GL_APIENTRY glActiveTexture (GLenum texture);
+GL_API void GL_APIENTRY glAlphaFuncx (GLenum func, GLclampx ref);
+GL_API void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer);
+GL_API void GL_APIENTRY glBindTexture (GLenum target, GLuint texture);
+GL_API void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
+GL_API void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage);
+GL_API void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data);
+GL_API void GL_APIENTRY glClear (GLbitfield mask);
+GL_API void GL_APIENTRY glClearColorx (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha);
+GL_API void GL_APIENTRY glClearDepthx (GLclampx depth);
+GL_API void GL_APIENTRY glClearStencil (GLint s);
+GL_API void GL_APIENTRY glClientActiveTexture (GLenum texture);
+GL_API void GL_APIENTRY glClipPlanex (GLenum plane, const GLfixed *equation);
+GL_API void GL_APIENTRY glColor4ub (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
+GL_API void GL_APIENTRY glColor4x (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
+GL_API void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+GL_API void GL_APIENTRY glColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GL_API void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
+GL_API void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
+GL_API void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+GL_API void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GL_API void GL_APIENTRY glCullFace (GLenum mode);
+GL_API void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers);
+GL_API void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint *textures);
+GL_API void GL_APIENTRY glDepthFunc (GLenum func);
+GL_API void GL_APIENTRY glDepthMask (GLboolean flag);
+GL_API void GL_APIENTRY glDepthRangex (GLclampx zNear, GLclampx zFar);
+GL_API void GL_APIENTRY glDisable (GLenum cap);
+GL_API void GL_APIENTRY glDisableClientState (GLenum array);
+GL_API void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
+GL_API void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
+GL_API void GL_APIENTRY glEnable (GLenum cap);
+GL_API void GL_APIENTRY glEnableClientState (GLenum array);
+GL_API void GL_APIENTRY glFinish (void);
+GL_API void GL_APIENTRY glFlush (void);
+GL_API void GL_APIENTRY glFogx (GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glFogxv (GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glFrontFace (GLenum mode);
+GL_API void GL_APIENTRY glFrustumx (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+GL_API void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean *params);
+GL_API void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params);
+GL_API void GL_APIENTRY glGetClipPlanex (GLenum pname, GLfixed eqn[4]);
+GL_API void GL_APIENTRY glGenBuffers (GLsizei n, GLuint *buffers);
+GL_API void GL_APIENTRY glGenTextures (GLsizei n, GLuint *textures);
+GL_API GLenum GL_APIENTRY glGetError (void);
+GL_API void GL_APIENTRY glGetFixedv (GLenum pname, GLfixed *params);
+GL_API void GL_APIENTRY glGetIntegerv (GLenum pname, GLint *params);
+GL_API void GL_APIENTRY glGetLightxv (GLenum light, GLenum pname, GLfixed *params);
+GL_API void GL_APIENTRY glGetMaterialxv (GLenum face, GLenum pname, GLfixed *params);
+GL_API void GL_APIENTRY glGetPointerv (GLenum pname, GLvoid **params);
+GL_API const GLubyte * GL_APIENTRY glGetString (GLenum name);
+GL_API void GL_APIENTRY glGetTexEnviv (GLenum env, GLenum pname, GLint *params);
+GL_API void GL_APIENTRY glGetTexEnvxv (GLenum env, GLenum pname, GLfixed *params);
+GL_API void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params);
+GL_API void GL_APIENTRY glGetTexParameterxv (GLenum target, GLenum pname, GLfixed *params);
+GL_API void GL_APIENTRY glHint (GLenum target, GLenum mode);
+GL_API GLboolean GL_APIENTRY glIsBuffer (GLuint buffer);
+GL_API GLboolean GL_APIENTRY glIsEnabled (GLenum cap);
+GL_API GLboolean GL_APIENTRY glIsTexture (GLuint texture);
+GL_API void GL_APIENTRY glLightModelx (GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glLightModelxv (GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glLightx (GLenum light, GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glLightxv (GLenum light, GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glLineWidthx (GLfixed width);
+GL_API void GL_APIENTRY glLoadIdentity (void);
+GL_API void GL_APIENTRY glLoadMatrixx (const GLfixed *m);
+GL_API void GL_APIENTRY glLogicOp (GLenum opcode);
+GL_API void GL_APIENTRY glMaterialx (GLenum face, GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glMaterialxv (GLenum face, GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glMatrixMode (GLenum mode);
+GL_API void GL_APIENTRY glMultMatrixx (const GLfixed *m);
+GL_API void GL_APIENTRY glMultiTexCoord4x (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
+GL_API void GL_APIENTRY glNormal3x (GLfixed nx, GLfixed ny, GLfixed nz);
+GL_API void GL_APIENTRY glNormalPointer (GLenum type, GLsizei stride, const GLvoid *pointer);
+GL_API void GL_APIENTRY glOrthox (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+GL_API void GL_APIENTRY glPixelStorei (GLenum pname, GLint param);
+GL_API void GL_APIENTRY glPointParameterx (GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glPointParameterxv (GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glPointSizex (GLfixed size);
+GL_API void GL_APIENTRY glPolygonOffsetx (GLfixed factor, GLfixed units);
+GL_API void GL_APIENTRY glPopMatrix (void);
+GL_API void GL_APIENTRY glPushMatrix (void);
+GL_API void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
+GL_API void GL_APIENTRY glRotatex (GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
+GL_API void GL_APIENTRY glSampleCoverage (GLclampf value, GLboolean invert);
+GL_API void GL_APIENTRY glSampleCoveragex (GLclampx value, GLboolean invert);
+GL_API void GL_APIENTRY glScalex (GLfixed x, GLfixed y, GLfixed z);
+GL_API void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
+GL_API void GL_APIENTRY glShadeModel (GLenum mode);
+GL_API void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
+GL_API void GL_APIENTRY glStencilMask (GLuint mask);
+GL_API void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
+GL_API void GL_APIENTRY glTexCoordPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GL_API void GL_APIENTRY glTexEnvi (GLenum target, GLenum pname, GLint param);
+GL_API void GL_APIENTRY glTexEnvx (GLenum target, GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glTexEnviv (GLenum target, GLenum pname, const GLint *params);
+GL_API void GL_APIENTRY glTexEnvxv (GLenum target, GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+GL_API void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);
+GL_API void GL_APIENTRY glTexParameterx (GLenum target, GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params);
+GL_API void GL_APIENTRY glTexParameterxv (GLenum target, GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
+GL_API void GL_APIENTRY glTranslatex (GLfixed x, GLfixed y, GLfixed z);
+GL_API void GL_APIENTRY glVertexPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GL_API void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
+
+/*------------------------------------------------------------------------*
+ * Required OES extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_OES_read_format */
+#ifndef GL_OES_read_format
+#define GL_OES_read_format 1
+#endif
+
+/* GL_OES_compressed_paletted_texture */
+#ifndef GL_OES_compressed_paletted_texture
+#define GL_OES_compressed_paletted_texture 1
+#endif
+
+/* GL_OES_point_size_array */
+#ifndef GL_OES_point_size_array
+#define GL_OES_point_size_array 1
+GL_API void GL_APIENTRY glPointSizePointerOES (GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+/* GL_OES_point_sprite */
+#ifndef GL_OES_point_sprite
+#define GL_OES_point_sprite 1
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __gl_h_ */
+
diff --git a/hw/yagl/yagl_inc/GLES/glext.h b/hw/yagl/yagl_inc/GLES/glext.h
new file mode 100644
index 0000000000..130e4b063c
--- /dev/null
+++ b/hw/yagl/yagl_inc/GLES/glext.h
@@ -0,0 +1,1073 @@
+#ifndef __glext_h_
+#define __glext_h_
+
+/* $Revision: 13240 $ on $Date:: 2010-12-17 15:16:00 -0800 #$ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * This document is licensed under the SGI Free Software B License Version
+ * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
+ */
+
+#ifndef GL_APIENTRYP
+# define GL_APIENTRYP GL_APIENTRY*
+#endif
+
+/*------------------------------------------------------------------------*
+ * OES extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_OES_blend_equation_separate */
+#ifndef GL_OES_blend_equation_separate
+/* BLEND_EQUATION_RGB_OES same as BLEND_EQUATION_OES */
+#define GL_BLEND_EQUATION_RGB_OES 0x8009
+#define GL_BLEND_EQUATION_ALPHA_OES 0x883D
+#endif
+
+/* GL_OES_blend_func_separate */
+#ifndef GL_OES_blend_func_separate
+#define GL_BLEND_DST_RGB_OES 0x80C8
+#define GL_BLEND_SRC_RGB_OES 0x80C9
+#define GL_BLEND_DST_ALPHA_OES 0x80CA
+#define GL_BLEND_SRC_ALPHA_OES 0x80CB
+#endif
+
+/* GL_OES_blend_subtract */
+#ifndef GL_OES_blend_subtract
+#define GL_BLEND_EQUATION_OES 0x8009
+#define GL_FUNC_ADD_OES 0x8006
+#define GL_FUNC_SUBTRACT_OES 0x800A
+#define GL_FUNC_REVERSE_SUBTRACT_OES 0x800B
+#endif
+
+/* GL_OES_compressed_ETC1_RGB8_texture */
+#ifndef GL_OES_compressed_ETC1_RGB8_texture
+#define GL_ETC1_RGB8_OES 0x8D64
+#endif
+
+/* GL_OES_depth24 */
+#ifndef GL_OES_depth24
+#define GL_DEPTH_COMPONENT24_OES 0x81A6
+#endif
+
+/* GL_OES_depth32 */
+#ifndef GL_OES_depth32
+#define GL_DEPTH_COMPONENT32_OES 0x81A7
+#endif
+
+/* GL_OES_draw_texture */
+#ifndef GL_OES_draw_texture
+#define GL_TEXTURE_CROP_RECT_OES 0x8B9D
+#endif
+
+/* GL_OES_EGL_image */
+#ifndef GL_OES_EGL_image
+typedef void* GLeglImageOES;
+#endif
+
+/* GL_OES_EGL_image_external */
+#ifndef GL_OES_EGL_image_external
+/* GLeglImageOES defined in GL_OES_EGL_image already. */
+#define GL_TEXTURE_EXTERNAL_OES 0x8D65
+#define GL_TEXTURE_BINDING_EXTERNAL_OES 0x8D67
+#define GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES 0x8D68
+#endif
+
+/* GL_OES_element_index_uint */
+#ifndef GL_OES_element_index_uint
+#define GL_UNSIGNED_INT 0x1405
+#endif
+
+/* GL_OES_fixed_point */
+#ifndef GL_OES_fixed_point
+#define GL_FIXED_OES 0x140C
+#endif
+
+/* GL_OES_framebuffer_object */
+#ifndef GL_OES_framebuffer_object
+#define GL_NONE_OES 0
+#define GL_FRAMEBUFFER_OES 0x8D40
+#define GL_RENDERBUFFER_OES 0x8D41
+#define GL_RGBA4_OES 0x8056
+#define GL_RGB5_A1_OES 0x8057
+#define GL_RGB565_OES 0x8D62
+#define GL_DEPTH_COMPONENT16_OES 0x81A5
+#define GL_RENDERBUFFER_WIDTH_OES 0x8D42
+#define GL_RENDERBUFFER_HEIGHT_OES 0x8D43
+#define GL_RENDERBUFFER_INTERNAL_FORMAT_OES 0x8D44
+#define GL_RENDERBUFFER_RED_SIZE_OES 0x8D50
+#define GL_RENDERBUFFER_GREEN_SIZE_OES 0x8D51
+#define GL_RENDERBUFFER_BLUE_SIZE_OES 0x8D52
+#define GL_RENDERBUFFER_ALPHA_SIZE_OES 0x8D53
+#define GL_RENDERBUFFER_DEPTH_SIZE_OES 0x8D54
+#define GL_RENDERBUFFER_STENCIL_SIZE_OES 0x8D55
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_OES 0x8CD0
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_OES 0x8CD1
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_OES 0x8CD2
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_OES 0x8CD3
+#define GL_COLOR_ATTACHMENT0_OES 0x8CE0
+#define GL_DEPTH_ATTACHMENT_OES 0x8D00
+#define GL_STENCIL_ATTACHMENT_OES 0x8D20
+#define GL_FRAMEBUFFER_COMPLETE_OES 0x8CD5
+#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES 0x8CD6
+#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_OES 0x8CD7
+#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_OES 0x8CD9
+#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_OES 0x8CDA
+#define GL_FRAMEBUFFER_UNSUPPORTED_OES 0x8CDD
+#define GL_FRAMEBUFFER_BINDING_OES 0x8CA6
+#define GL_RENDERBUFFER_BINDING_OES 0x8CA7
+#define GL_MAX_RENDERBUFFER_SIZE_OES 0x84E8
+#define GL_INVALID_FRAMEBUFFER_OPERATION_OES 0x0506
+#endif
+
+/* GL_OES_mapbuffer */
+#ifndef GL_OES_mapbuffer
+#define GL_WRITE_ONLY_OES 0x88B9
+#define GL_BUFFER_ACCESS_OES 0x88BB
+#define GL_BUFFER_MAPPED_OES 0x88BC
+#define GL_BUFFER_MAP_POINTER_OES 0x88BD
+#endif
+
+/* GL_OES_matrix_get */
+#ifndef GL_OES_matrix_get
+#define GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES 0x898D
+#define GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES 0x898E
+#define GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES 0x898F
+#endif
+
+/* GL_OES_matrix_palette */
+#ifndef GL_OES_matrix_palette
+#define GL_MAX_VERTEX_UNITS_OES 0x86A4
+#define GL_MAX_PALETTE_MATRICES_OES 0x8842
+#define GL_MATRIX_PALETTE_OES 0x8840
+#define GL_MATRIX_INDEX_ARRAY_OES 0x8844
+#define GL_WEIGHT_ARRAY_OES 0x86AD
+#define GL_CURRENT_PALETTE_MATRIX_OES 0x8843
+#define GL_MATRIX_INDEX_ARRAY_SIZE_OES 0x8846
+#define GL_MATRIX_INDEX_ARRAY_TYPE_OES 0x8847
+#define GL_MATRIX_INDEX_ARRAY_STRIDE_OES 0x8848
+#define GL_MATRIX_INDEX_ARRAY_POINTER_OES 0x8849
+#define GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES 0x8B9E
+#define GL_WEIGHT_ARRAY_SIZE_OES 0x86AB
+#define GL_WEIGHT_ARRAY_TYPE_OES 0x86A9
+#define GL_WEIGHT_ARRAY_STRIDE_OES 0x86AA
+#define GL_WEIGHT_ARRAY_POINTER_OES 0x86AC
+#define GL_WEIGHT_ARRAY_BUFFER_BINDING_OES 0x889E
+#endif
+
+/* GL_OES_packed_depth_stencil */
+#ifndef GL_OES_packed_depth_stencil
+#define GL_DEPTH_STENCIL_OES 0x84F9
+#define GL_UNSIGNED_INT_24_8_OES 0x84FA
+#define GL_DEPTH24_STENCIL8_OES 0x88F0
+#endif
+
+/* GL_OES_rgb8_rgba8 */
+#ifndef GL_OES_rgb8_rgba8
+#define GL_RGB8_OES 0x8051
+#define GL_RGBA8_OES 0x8058
+#endif
+
+/* GL_OES_stencil1 */
+#ifndef GL_OES_stencil1
+#define GL_STENCIL_INDEX1_OES 0x8D46
+#endif
+
+/* GL_OES_stencil4 */
+#ifndef GL_OES_stencil4
+#define GL_STENCIL_INDEX4_OES 0x8D47
+#endif
+
+/* GL_OES_stencil8 */
+#ifndef GL_OES_stencil8
+#define GL_STENCIL_INDEX8_OES 0x8D48
+#endif
+
+/* GL_OES_stencil_wrap */
+#ifndef GL_OES_stencil_wrap
+#define GL_INCR_WRAP_OES 0x8507
+#define GL_DECR_WRAP_OES 0x8508
+#endif
+
+/* GL_OES_texture_cube_map */
+#ifndef GL_OES_texture_cube_map
+#define GL_NORMAL_MAP_OES 0x8511
+#define GL_REFLECTION_MAP_OES 0x8512
+#define GL_TEXTURE_CUBE_MAP_OES 0x8513
+#define GL_TEXTURE_BINDING_CUBE_MAP_OES 0x8514
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES 0x8515
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES 0x8516
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES 0x8517
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES 0x8518
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES 0x8519
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES 0x851A
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_OES 0x851C
+#define GL_TEXTURE_GEN_MODE_OES 0x2500
+#define GL_TEXTURE_GEN_STR_OES 0x8D60
+#endif
+
+/* GL_OES_texture_mirrored_repeat */
+#ifndef GL_OES_texture_mirrored_repeat
+#define GL_MIRRORED_REPEAT_OES 0x8370
+#endif
+
+/* GL_OES_vertex_array_object */
+#ifndef GL_OES_vertex_array_object
+#define GL_VERTEX_ARRAY_BINDING_OES 0x85B5
+#endif
+
+/*------------------------------------------------------------------------*
+ * AMD extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_AMD_compressed_3DC_texture */
+#ifndef GL_AMD_compressed_3DC_texture
+#define GL_3DC_X_AMD 0x87F9
+#define GL_3DC_XY_AMD 0x87FA
+#endif
+
+/* GL_AMD_compressed_ATC_texture */
+#ifndef GL_AMD_compressed_ATC_texture
+#define GL_ATC_RGB_AMD 0x8C92
+#define GL_ATC_RGBA_EXPLICIT_ALPHA_AMD 0x8C93
+#define GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD 0x87EE
+#endif
+
+/*------------------------------------------------------------------------*
+ * APPLE extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_APPLE_texture_2D_limited_npot */
+/* No new tokens introduced by this extension. */
+
+/* GL_APPLE_framebuffer_multisample */
+#ifndef GL_APPLE_framebuffer_multisample
+#define GL_RENDERBUFFER_SAMPLES_APPLE 0x8CAB
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_APPLE 0x8D56
+#define GL_MAX_SAMPLES_APPLE 0x8D57
+#define GL_READ_FRAMEBUFFER_APPLE 0x8CA8
+#define GL_DRAW_FRAMEBUFFER_APPLE 0x8CA9
+#define GL_DRAW_FRAMEBUFFER_BINDING_APPLE 0x8CA6
+#define GL_READ_FRAMEBUFFER_BINDING_APPLE 0x8CAA
+#endif
+
+/* GL_APPLE_texture_format_BGRA8888 */
+#ifndef GL_APPLE_texture_format_BGRA8888
+#define GL_BGRA_EXT 0x80E1
+#endif
+
+/* GL_APPLE_texture_max_level */
+#ifndef GL_APPLE_texture_max_level
+#define GL_TEXTURE_MAX_LEVEL_APPLE 0x813D
+#endif
+
+/*------------------------------------------------------------------------*
+ * ARM extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_ARM_rgba8 */
+/* No new tokens introduced by this extension. */
+
+/*------------------------------------------------------------------------*
+ * EXT extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_EXT_blend_minmax */
+#ifndef GL_EXT_blend_minmax
+#define GL_MIN_EXT 0x8007
+#define GL_MAX_EXT 0x8008
+#endif
+
+/* GL_EXT_discard_framebuffer */
+#ifndef GL_EXT_discard_framebuffer
+#define GL_COLOR_EXT 0x1800
+#define GL_DEPTH_EXT 0x1801
+#define GL_STENCIL_EXT 0x1802
+#endif
+
+/* GL_EXT_multi_draw_arrays */
+/* No new tokens introduced by this extension. */
+
+/* GL_EXT_read_format_bgra */
+#ifndef GL_EXT_read_format_bgra
+#define GL_BGRA_EXT 0x80E1
+#define GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT 0x8365
+#define GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT 0x8366
+#endif
+
+/* GL_EXT_texture_filter_anisotropic */
+#ifndef GL_EXT_texture_filter_anisotropic
+#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
+#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
+#endif
+
+/* GL_EXT_texture_format_BGRA8888 */
+#ifndef GL_EXT_texture_format_BGRA8888
+#define GL_BGRA_EXT 0x80E1
+#endif
+
+/* GL_EXT_texture_lod_bias */
+#ifndef GL_EXT_texture_lod_bias
+#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD
+#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500
+#define GL_TEXTURE_LOD_BIAS_EXT 0x8501
+#endif
+
+/*------------------------------------------------------------------------*
+ * IMG extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_IMG_read_format */
+#ifndef GL_IMG_read_format
+#define GL_BGRA_IMG 0x80E1
+#define GL_UNSIGNED_SHORT_4_4_4_4_REV_IMG 0x8365
+#endif
+
+/* GL_IMG_texture_compression_pvrtc */
+#ifndef GL_IMG_texture_compression_pvrtc
+#define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00
+#define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG 0x8C01
+#define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02
+#define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03
+#endif
+
+/* GL_IMG_texture_env_enhanced_fixed_function */
+#ifndef GL_IMG_texture_env_enhanced_fixed_function
+#define GL_MODULATE_COLOR_IMG 0x8C04
+#define GL_RECIP_ADD_SIGNED_ALPHA_IMG 0x8C05
+#define GL_TEXTURE_ALPHA_MODULATE_IMG 0x8C06
+#define GL_FACTOR_ALPHA_MODULATE_IMG 0x8C07
+#define GL_FRAGMENT_ALPHA_MODULATE_IMG 0x8C08
+#define GL_ADD_BLEND_IMG 0x8C09
+#define GL_DOT3_RGBA_IMG 0x86AF
+#endif
+
+/* GL_IMG_user_clip_plane */
+#ifndef GL_IMG_user_clip_plane
+#define GL_CLIP_PLANE0_IMG 0x3000
+#define GL_CLIP_PLANE1_IMG 0x3001
+#define GL_CLIP_PLANE2_IMG 0x3002
+#define GL_CLIP_PLANE3_IMG 0x3003
+#define GL_CLIP_PLANE4_IMG 0x3004
+#define GL_CLIP_PLANE5_IMG 0x3005
+#define GL_MAX_CLIP_PLANES_IMG 0x0D32
+#endif
+
+/* GL_IMG_multisampled_render_to_texture */
+#ifndef GL_IMG_multisampled_render_to_texture
+#define GL_RENDERBUFFER_SAMPLES_IMG 0x9133
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_IMG 0x9134
+#define GL_MAX_SAMPLES_IMG 0x9135
+#define GL_TEXTURE_SAMPLES_IMG 0x9136
+#endif
+
+/*------------------------------------------------------------------------*
+ * NV extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_NV_fence */
+#ifndef GL_NV_fence
+#define GL_ALL_COMPLETED_NV 0x84F2
+#define GL_FENCE_STATUS_NV 0x84F3
+#define GL_FENCE_CONDITION_NV 0x84F4
+#endif
+
+/*------------------------------------------------------------------------*
+ * QCOM extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_QCOM_driver_control */
+/* No new tokens introduced by this extension. */
+
+/* GL_QCOM_extended_get */
+#ifndef GL_QCOM_extended_get
+#define GL_TEXTURE_WIDTH_QCOM 0x8BD2
+#define GL_TEXTURE_HEIGHT_QCOM 0x8BD3
+#define GL_TEXTURE_DEPTH_QCOM 0x8BD4
+#define GL_TEXTURE_INTERNAL_FORMAT_QCOM 0x8BD5
+#define GL_TEXTURE_FORMAT_QCOM 0x8BD6
+#define GL_TEXTURE_TYPE_QCOM 0x8BD7
+#define GL_TEXTURE_IMAGE_VALID_QCOM 0x8BD8
+#define GL_TEXTURE_NUM_LEVELS_QCOM 0x8BD9
+#define GL_TEXTURE_TARGET_QCOM 0x8BDA
+#define GL_TEXTURE_OBJECT_VALID_QCOM 0x8BDB
+#define GL_STATE_RESTORE 0x8BDC
+#endif
+
+/* GL_QCOM_extended_get2 */
+/* No new tokens introduced by this extension. */
+
+/* GL_QCOM_perfmon_global_mode */
+#ifndef GL_QCOM_perfmon_global_mode
+#define GL_PERFMON_GLOBAL_MODE_QCOM 0x8FA0
+#endif
+
+/* GL_QCOM_writeonly_rendering */
+#ifndef GL_QCOM_writeonly_rendering
+#define GL_WRITEONLY_RENDERING_QCOM 0x8823
+#endif
+
+/* GL_QCOM_tiled_rendering */
+#ifndef GL_QCOM_tiled_rendering
+#define GL_COLOR_BUFFER_BIT0_QCOM 0x00000001
+#define GL_COLOR_BUFFER_BIT1_QCOM 0x00000002
+#define GL_COLOR_BUFFER_BIT2_QCOM 0x00000004
+#define GL_COLOR_BUFFER_BIT3_QCOM 0x00000008
+#define GL_COLOR_BUFFER_BIT4_QCOM 0x00000010
+#define GL_COLOR_BUFFER_BIT5_QCOM 0x00000020
+#define GL_COLOR_BUFFER_BIT6_QCOM 0x00000040
+#define GL_COLOR_BUFFER_BIT7_QCOM 0x00000080
+#define GL_DEPTH_BUFFER_BIT0_QCOM 0x00000100
+#define GL_DEPTH_BUFFER_BIT1_QCOM 0x00000200
+#define GL_DEPTH_BUFFER_BIT2_QCOM 0x00000400
+#define GL_DEPTH_BUFFER_BIT3_QCOM 0x00000800
+#define GL_DEPTH_BUFFER_BIT4_QCOM 0x00001000
+#define GL_DEPTH_BUFFER_BIT5_QCOM 0x00002000
+#define GL_DEPTH_BUFFER_BIT6_QCOM 0x00004000
+#define GL_DEPTH_BUFFER_BIT7_QCOM 0x00008000
+#define GL_STENCIL_BUFFER_BIT0_QCOM 0x00010000
+#define GL_STENCIL_BUFFER_BIT1_QCOM 0x00020000
+#define GL_STENCIL_BUFFER_BIT2_QCOM 0x00040000
+#define GL_STENCIL_BUFFER_BIT3_QCOM 0x00080000
+#define GL_STENCIL_BUFFER_BIT4_QCOM 0x00100000
+#define GL_STENCIL_BUFFER_BIT5_QCOM 0x00200000
+#define GL_STENCIL_BUFFER_BIT6_QCOM 0x00400000
+#define GL_STENCIL_BUFFER_BIT7_QCOM 0x00800000
+#define GL_MULTISAMPLE_BUFFER_BIT0_QCOM 0x01000000
+#define GL_MULTISAMPLE_BUFFER_BIT1_QCOM 0x02000000
+#define GL_MULTISAMPLE_BUFFER_BIT2_QCOM 0x04000000
+#define GL_MULTISAMPLE_BUFFER_BIT3_QCOM 0x08000000
+#define GL_MULTISAMPLE_BUFFER_BIT4_QCOM 0x10000000
+#define GL_MULTISAMPLE_BUFFER_BIT5_QCOM 0x20000000
+#define GL_MULTISAMPLE_BUFFER_BIT6_QCOM 0x40000000
+#define GL_MULTISAMPLE_BUFFER_BIT7_QCOM 0x80000000
+#endif
+
+/*------------------------------------------------------------------------*
+ * End of extension tokens, start of corresponding extension functions
+ *------------------------------------------------------------------------*/
+
+/*------------------------------------------------------------------------*
+ * OES extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_OES_blend_equation_separate */
+#ifndef GL_OES_blend_equation_separate
+#define GL_OES_blend_equation_separate 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glBlendEquationSeparateOES (GLenum modeRGB, GLenum modeAlpha);
+#endif
+typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONSEPARATEOESPROC) (GLenum modeRGB, GLenum modeAlpha);
+#endif
+
+/* GL_OES_blend_func_separate */
+#ifndef GL_OES_blend_func_separate
+#define GL_OES_blend_func_separate 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glBlendFuncSeparateOES (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+#endif
+typedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATEOESPROC) (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+#endif
+
+/* GL_OES_blend_subtract */
+#ifndef GL_OES_blend_subtract
+#define GL_OES_blend_subtract 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glBlendEquationOES (GLenum mode);
+#endif
+typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONOESPROC) (GLenum mode);
+#endif
+
+/* GL_OES_byte_coordinates */
+#ifndef GL_OES_byte_coordinates
+#define GL_OES_byte_coordinates 1
+#endif
+
+/* GL_OES_compressed_ETC1_RGB8_texture */
+#ifndef GL_OES_compressed_ETC1_RGB8_texture
+#define GL_OES_compressed_ETC1_RGB8_texture 1
+#endif
+
+/* GL_OES_depth24 */
+#ifndef GL_OES_depth24
+#define GL_OES_depth24 1
+#endif
+
+/* GL_OES_depth32 */
+#ifndef GL_OES_depth32
+#define GL_OES_depth32 1
+#endif
+
+/* GL_OES_draw_texture */
+#ifndef GL_OES_draw_texture
+#define GL_OES_draw_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glDrawTexsOES (GLshort x, GLshort y, GLshort z, GLshort width, GLshort height);
+GL_API void GL_APIENTRY glDrawTexiOES (GLint x, GLint y, GLint z, GLint width, GLint height);
+GL_API void GL_APIENTRY glDrawTexxOES (GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height);
+GL_API void GL_APIENTRY glDrawTexsvOES (const GLshort *coords);
+GL_API void GL_APIENTRY glDrawTexivOES (const GLint *coords);
+GL_API void GL_APIENTRY glDrawTexxvOES (const GLfixed *coords);
+GL_API void GL_APIENTRY glDrawTexfOES (GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height);
+GL_API void GL_APIENTRY glDrawTexfvOES (const GLfloat *coords);
+#endif
+typedef void (GL_APIENTRYP PFNGLDRAWTEXSOESPROC) (GLshort x, GLshort y, GLshort z, GLshort width, GLshort height);
+typedef void (GL_APIENTRYP PFNGLDRAWTEXIOESPROC) (GLint x, GLint y, GLint z, GLint width, GLint height);
+typedef void (GL_APIENTRYP PFNGLDRAWTEXXOESPROC) (GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height);
+typedef void (GL_APIENTRYP PFNGLDRAWTEXSVOESPROC) (const GLshort *coords);
+typedef void (GL_APIENTRYP PFNGLDRAWTEXIVOESPROC) (const GLint *coords);
+typedef void (GL_APIENTRYP PFNGLDRAWTEXXVOESPROC) (const GLfixed *coords);
+typedef void (GL_APIENTRYP PFNGLDRAWTEXFOESPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height);
+typedef void (GL_APIENTRYP PFNGLDRAWTEXFVOESPROC) (const GLfloat *coords);
+#endif
+
+/* GL_OES_EGL_image */
+#ifndef GL_OES_EGL_image
+#define GL_OES_EGL_image 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image);
+GL_API void GL_APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image);
+#endif
+typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image);
+typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image);
+#endif
+
+/* GL_OES_EGL_image_external */
+#ifndef GL_OES_EGL_image_external
+#define GL_OES_EGL_image_external 1
+/* glEGLImageTargetTexture2DOES defined in GL_OES_EGL_image already. */
+#endif
+
+/* GL_OES_element_index_uint */
+#ifndef GL_OES_element_index_uint
+#define GL_OES_element_index_uint 1
+#endif
+
+/* GL_OES_extended_matrix_palette */
+#ifndef GL_OES_extended_matrix_palette
+#define GL_OES_extended_matrix_palette 1
+#endif
+
+/* GL_OES_fbo_render_mipmap */
+#ifndef GL_OES_fbo_render_mipmap
+#define GL_OES_fbo_render_mipmap 1
+#endif
+
+/* GL_OES_fixed_point */
+#ifndef GL_OES_fixed_point
+#define GL_OES_fixed_point 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glAlphaFuncxOES (GLenum func, GLclampx ref);
+GL_API void GL_APIENTRY glClearColorxOES (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha);
+GL_API void GL_APIENTRY glClearDepthxOES (GLclampx depth);
+GL_API void GL_APIENTRY glClipPlanexOES (GLenum plane, const GLfixed *equation);
+GL_API void GL_APIENTRY glColor4xOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
+GL_API void GL_APIENTRY glDepthRangexOES (GLclampx zNear, GLclampx zFar);
+GL_API void GL_APIENTRY glFogxOES (GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glFogxvOES (GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glFrustumxOES (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+GL_API void GL_APIENTRY glGetClipPlanexOES (GLenum pname, GLfixed eqn[4]);
+GL_API void GL_APIENTRY glGetFixedvOES (GLenum pname, GLfixed *params);
+GL_API void GL_APIENTRY glGetLightxvOES (GLenum light, GLenum pname, GLfixed *params);
+GL_API void GL_APIENTRY glGetMaterialxvOES (GLenum face, GLenum pname, GLfixed *params);
+GL_API void GL_APIENTRY glGetTexEnvxvOES (GLenum env, GLenum pname, GLfixed *params);
+GL_API void GL_APIENTRY glGetTexParameterxvOES (GLenum target, GLenum pname, GLfixed *params);
+GL_API void GL_APIENTRY glLightModelxOES (GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glLightModelxvOES (GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glLightxOES (GLenum light, GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glLightxvOES (GLenum light, GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glLineWidthxOES (GLfixed width);
+GL_API void GL_APIENTRY glLoadMatrixxOES (const GLfixed *m);
+GL_API void GL_APIENTRY glMaterialxOES (GLenum face, GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glMaterialxvOES (GLenum face, GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glMultMatrixxOES (const GLfixed *m);
+GL_API void GL_APIENTRY glMultiTexCoord4xOES (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
+GL_API void GL_APIENTRY glNormal3xOES (GLfixed nx, GLfixed ny, GLfixed nz);
+GL_API void GL_APIENTRY glOrthoxOES (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+GL_API void GL_APIENTRY glPointParameterxOES (GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glPointParameterxvOES (GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glPointSizexOES (GLfixed size);
+GL_API void GL_APIENTRY glPolygonOffsetxOES (GLfixed factor, GLfixed units);
+GL_API void GL_APIENTRY glRotatexOES (GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
+GL_API void GL_APIENTRY glSampleCoveragexOES (GLclampx value, GLboolean invert);
+GL_API void GL_APIENTRY glScalexOES (GLfixed x, GLfixed y, GLfixed z);
+GL_API void GL_APIENTRY glTexEnvxOES (GLenum target, GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glTexEnvxvOES (GLenum target, GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glTexParameterxOES (GLenum target, GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glTexParameterxvOES (GLenum target, GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glTranslatexOES (GLfixed x, GLfixed y, GLfixed z);
+#endif
+typedef void (GL_APIENTRYP PFNGLALPHAFUNCXOESPROC) (GLenum func, GLclampx ref);
+typedef void (GL_APIENTRYP PFNGLCLEARCOLORXOESPROC) (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha);
+typedef void (GL_APIENTRYP PFNGLCLEARDEPTHXOESPROC) (GLclampx depth);
+typedef void (GL_APIENTRYP PFNGLCLIPPLANEXOESPROC) (GLenum plane, const GLfixed *equation);
+typedef void (GL_APIENTRYP PFNGLCOLOR4XOESPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
+typedef void (GL_APIENTRYP PFNGLDEPTHRANGEXOESPROC) (GLclampx zNear, GLclampx zFar);
+typedef void (GL_APIENTRYP PFNGLFOGXOESPROC) (GLenum pname, GLfixed param);
+typedef void (GL_APIENTRYP PFNGLFOGXVOESPROC) (GLenum pname, const GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLFRUSTUMXOESPROC) (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+typedef void (GL_APIENTRYP PFNGLGETCLIPPLANEXOESPROC) (GLenum pname, GLfixed eqn[4]);
+typedef void (GL_APIENTRYP PFNGLGETFIXEDVOESPROC) (GLenum pname, GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLGETLIGHTXVOESPROC) (GLenum light, GLenum pname, GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLGETMATERIALXVOESPROC) (GLenum face, GLenum pname, GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLGETTEXENVXVOESPROC) (GLenum env, GLenum pname, GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERXVOESPROC) (GLenum target, GLenum pname, GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLLIGHTMODELXOESPROC) (GLenum pname, GLfixed param);
+typedef void (GL_APIENTRYP PFNGLLIGHTMODELXVOESPROC) (GLenum pname, const GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLLIGHTXOESPROC) (GLenum light, GLenum pname, GLfixed param);
+typedef void (GL_APIENTRYP PFNGLLIGHTXVOESPROC) (GLenum light, GLenum pname, const GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLLINEWIDTHXOESPROC) (GLfixed width);
+typedef void (GL_APIENTRYP PFNGLLOADMATRIXXOESPROC) (const GLfixed *m);
+typedef void (GL_APIENTRYP PFNGLMATERIALXOESPROC) (GLenum face, GLenum pname, GLfixed param);
+typedef void (GL_APIENTRYP PFNGLMATERIALXVOESPROC) (GLenum face, GLenum pname, const GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLMULTMATRIXXOESPROC) (const GLfixed *m);
+typedef void (GL_APIENTRYP PFNGLMULTITEXCOORD4XOESPROC) (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
+typedef void (GL_APIENTRYP PFNGLNORMAL3XOESPROC) (GLfixed nx, GLfixed ny, GLfixed nz);
+typedef void (GL_APIENTRYP PFNGLORTHOXOESPROC) (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+typedef void (GL_APIENTRYP PFNGLPOINTPARAMETERXOESPROC) (GLenum pname, GLfixed param);
+typedef void (GL_APIENTRYP PFNGLPOINTPARAMETERXVOESPROC) (GLenum pname, const GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLPOINTSIZEXOESPROC) (GLfixed size);
+typedef void (GL_APIENTRYP PFNGLPOLYGONOFFSETXOESPROC) (GLfixed factor, GLfixed units);
+typedef void (GL_APIENTRYP PFNGLROTATEXOESPROC) (GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
+typedef void (GL_APIENTRYP PFNGLSAMPLECOVERAGEXOESPROC) (GLclampx value, GLboolean invert);
+typedef void (GL_APIENTRYP PFNGLSCALEXOESPROC) (GLfixed x, GLfixed y, GLfixed z);
+typedef void (GL_APIENTRYP PFNGLTEXENVXOESPROC) (GLenum target, GLenum pname, GLfixed param);
+typedef void (GL_APIENTRYP PFNGLTEXENVXVOESPROC) (GLenum target, GLenum pname, const GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLTEXPARAMETERXOESPROC) (GLenum target, GLenum pname, GLfixed param);
+typedef void (GL_APIENTRYP PFNGLTEXPARAMETERXVOESPROC) (GLenum target, GLenum pname, const GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLTRANSLATEXOESPROC) (GLfixed x, GLfixed y, GLfixed z);
+#endif
+
+/* GL_OES_framebuffer_object */
+#ifndef GL_OES_framebuffer_object
+#define GL_OES_framebuffer_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API GLboolean GL_APIENTRY glIsRenderbufferOES (GLuint renderbuffer);
+GL_API void GL_APIENTRY glBindRenderbufferOES (GLenum target, GLuint renderbuffer);
+GL_API void GL_APIENTRY glDeleteRenderbuffersOES (GLsizei n, const GLuint* renderbuffers);
+GL_API void GL_APIENTRY glGenRenderbuffersOES (GLsizei n, GLuint* renderbuffers);
+GL_API void GL_APIENTRY glRenderbufferStorageOES (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+GL_API void GL_APIENTRY glGetRenderbufferParameterivOES (GLenum target, GLenum pname, GLint* params);
+GL_API GLboolean GL_APIENTRY glIsFramebufferOES (GLuint framebuffer);
+GL_API void GL_APIENTRY glBindFramebufferOES (GLenum target, GLuint framebuffer);
+GL_API void GL_APIENTRY glDeleteFramebuffersOES (GLsizei n, const GLuint* framebuffers);
+GL_API void GL_APIENTRY glGenFramebuffersOES (GLsizei n, GLuint* framebuffers);
+GL_API GLenum GL_APIENTRY glCheckFramebufferStatusOES (GLenum target);
+GL_API void GL_APIENTRY glFramebufferRenderbufferOES (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+GL_API void GL_APIENTRY glFramebufferTexture2DOES (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GL_API void GL_APIENTRY glGetFramebufferAttachmentParameterivOES (GLenum target, GLenum attachment, GLenum pname, GLint* params);
+GL_API void GL_APIENTRY glGenerateMipmapOES (GLenum target);
+#endif
+typedef GLboolean (GL_APIENTRYP PFNGLISRENDERBUFFEROESPROC) (GLuint renderbuffer);
+typedef void (GL_APIENTRYP PFNGLBINDRENDERBUFFEROESPROC) (GLenum target, GLuint renderbuffer);
+typedef void (GL_APIENTRYP PFNGLDELETERENDERBUFFERSOESPROC) (GLsizei n, const GLuint* renderbuffers);
+typedef void (GL_APIENTRYP PFNGLGENRENDERBUFFERSOESPROC) (GLsizei n, GLuint* renderbuffers);
+typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVOESPROC) (GLenum target, GLenum pname, GLint* params);
+typedef GLboolean (GL_APIENTRYP PFNGLISFRAMEBUFFEROESPROC) (GLuint framebuffer);
+typedef void (GL_APIENTRYP PFNGLBINDFRAMEBUFFEROESPROC) (GLenum target, GLuint framebuffer);
+typedef void (GL_APIENTRYP PFNGLDELETEFRAMEBUFFERSOESPROC) (GLsizei n, const GLuint* framebuffers);
+typedef void (GL_APIENTRYP PFNGLGENFRAMEBUFFERSOESPROC) (GLsizei n, GLuint* framebuffers);
+typedef GLenum (GL_APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSOESPROC) (GLenum target);
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEROESPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DOESPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (GL_APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVOESPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params);
+typedef void (GL_APIENTRYP PFNGLGENERATEMIPMAPOESPROC) (GLenum target);
+#endif
+
+/* GL_OES_mapbuffer */
+#ifndef GL_OES_mapbuffer
+#define GL_OES_mapbuffer 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void* GL_APIENTRY glMapBufferOES (GLenum target, GLenum access);
+GL_API GLboolean GL_APIENTRY glUnmapBufferOES (GLenum target);
+GL_API void GL_APIENTRY glGetBufferPointervOES (GLenum target, GLenum pname, GLvoid ** params);
+#endif
+typedef void* (GL_APIENTRYP PFNGLMAPBUFFEROESPROC) (GLenum target, GLenum access);
+typedef GLboolean (GL_APIENTRYP PFNGLUNMAPBUFFEROESPROC) (GLenum target);
+typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum pname, GLvoid ** params);
+#endif
+
+/* GL_OES_matrix_get */
+#ifndef GL_OES_matrix_get
+#define GL_OES_matrix_get 1
+#endif
+
+/* GL_OES_matrix_palette */
+#ifndef GL_OES_matrix_palette
+#define GL_OES_matrix_palette 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glCurrentPaletteMatrixOES (GLuint matrixpaletteindex);
+GL_API void GL_APIENTRY glLoadPaletteFromModelViewMatrixOES (void);
+GL_API void GL_APIENTRY glMatrixIndexPointerOES (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GL_API void GL_APIENTRY glWeightPointerOES (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+typedef void (GL_APIENTRYP PFNGLCURRENTPALETTEMATRIXOESPROC) (GLuint matrixpaletteindex);
+typedef void (GL_APIENTRYP PFNGLLOADPALETTEFROMMODELVIEWMATRIXOESPROC) (void);
+typedef void (GL_APIENTRYP PFNGLMATRIXINDEXPOINTEROESPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (GL_APIENTRYP PFNGLWEIGHTPOINTEROESPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+/* GL_OES_packed_depth_stencil */
+#ifndef GL_OES_packed_depth_stencil
+#define GL_OES_packed_depth_stencil 1
+#endif
+
+/* GL_OES_query_matrix */
+#ifndef GL_OES_query_matrix
+#define GL_OES_query_matrix 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API GLbitfield GL_APIENTRY glQueryMatrixxOES (GLfixed mantissa[16], GLint exponent[16]);
+#endif
+typedef GLbitfield (GL_APIENTRYP PFNGLQUERYMATRIXXOESPROC) (GLfixed mantissa[16], GLint exponent[16]);
+#endif
+
+/* GL_OES_rgb8_rgba8 */
+#ifndef GL_OES_rgb8_rgba8
+#define GL_OES_rgb8_rgba8 1
+#endif
+
+/* GL_OES_single_precision */
+#ifndef GL_OES_single_precision
+#define GL_OES_single_precision 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glDepthRangefOES (GLclampf zNear, GLclampf zFar);
+GL_API void GL_APIENTRY glFrustumfOES (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+GL_API void GL_APIENTRY glOrthofOES (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+GL_API void GL_APIENTRY glClipPlanefOES (GLenum plane, const GLfloat *equation);
+GL_API void GL_APIENTRY glGetClipPlanefOES (GLenum pname, GLfloat eqn[4]);
+GL_API void GL_APIENTRY glClearDepthfOES (GLclampf depth);
+#endif
+typedef void (GL_APIENTRYP PFNGLDEPTHRANGEFOESPROC) (GLclampf zNear, GLclampf zFar);
+typedef void (GL_APIENTRYP PFNGLFRUSTUMFOESPROC) (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+typedef void (GL_APIENTRYP PFNGLORTHOFOESPROC) (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+typedef void (GL_APIENTRYP PFNGLCLIPPLANEFOESPROC) (GLenum plane, const GLfloat *equation);
+typedef void (GL_APIENTRYP PFNGLGETCLIPPLANEFOESPROC) (GLenum pname, GLfloat eqn[4]);
+typedef void (GL_APIENTRYP PFNGLCLEARDEPTHFOESPROC) (GLclampf depth);
+#endif
+
+/* GL_OES_stencil1 */
+#ifndef GL_OES_stencil1
+#define GL_OES_stencil1 1
+#endif
+
+/* GL_OES_stencil4 */
+#ifndef GL_OES_stencil4
+#define GL_OES_stencil4 1
+#endif
+
+/* GL_OES_stencil8 */
+#ifndef GL_OES_stencil8
+#define GL_OES_stencil8 1
+#endif
+
+/* GL_OES_stencil_wrap */
+#ifndef GL_OES_stencil_wrap
+#define GL_OES_stencil_wrap 1
+#endif
+
+/* GL_OES_texture_cube_map */
+#ifndef GL_OES_texture_cube_map
+#define GL_OES_texture_cube_map 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glTexGenfOES (GLenum coord, GLenum pname, GLfloat param);
+GL_API void GL_APIENTRY glTexGenfvOES (GLenum coord, GLenum pname, const GLfloat *params);
+GL_API void GL_APIENTRY glTexGeniOES (GLenum coord, GLenum pname, GLint param);
+GL_API void GL_APIENTRY glTexGenivOES (GLenum coord, GLenum pname, const GLint *params);
+GL_API void GL_APIENTRY glTexGenxOES (GLenum coord, GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glTexGenxvOES (GLenum coord, GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glGetTexGenfvOES (GLenum coord, GLenum pname, GLfloat *params);
+GL_API void GL_APIENTRY glGetTexGenivOES (GLenum coord, GLenum pname, GLint *params);
+GL_API void GL_APIENTRY glGetTexGenxvOES (GLenum coord, GLenum pname, GLfixed *params);
+#endif
+typedef void (GL_APIENTRYP PFNGLTEXGENFOESPROC) (GLenum coord, GLenum pname, GLfloat param);
+typedef void (GL_APIENTRYP PFNGLTEXGENFVOESPROC) (GLenum coord, GLenum pname, const GLfloat *params);
+typedef void (GL_APIENTRYP PFNGLTEXGENIOESPROC) (GLenum coord, GLenum pname, GLint param);
+typedef void (GL_APIENTRYP PFNGLTEXGENIVOESPROC) (GLenum coord, GLenum pname, const GLint *params);
+typedef void (GL_APIENTRYP PFNGLTEXGENXOESPROC) (GLenum coord, GLenum pname, GLfixed param);
+typedef void (GL_APIENTRYP PFNGLTEXGENXVOESPROC) (GLenum coord, GLenum pname, const GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLGETTEXGENFVOESPROC) (GLenum coord, GLenum pname, GLfloat *params);
+typedef void (GL_APIENTRYP PFNGLGETTEXGENIVOESPROC) (GLenum coord, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETTEXGENXVOESPROC) (GLenum coord, GLenum pname, GLfixed *params);
+#endif
+
+/* GL_OES_texture_env_crossbar */
+#ifndef GL_OES_texture_env_crossbar
+#define GL_OES_texture_env_crossbar 1
+#endif
+
+/* GL_OES_texture_mirrored_repeat */
+#ifndef GL_OES_texture_mirrored_repeat
+#define GL_OES_texture_mirrored_repeat 1
+#endif
+
+/* GL_OES_vertex_array_object */
+#ifndef GL_OES_vertex_array_object
+#define GL_OES_vertex_array_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glBindVertexArrayOES (GLuint array);
+GL_API void GL_APIENTRY glDeleteVertexArraysOES (GLsizei n, const GLuint *arrays);
+GL_API void GL_APIENTRY glGenVertexArraysOES (GLsizei n, GLuint *arrays);
+GL_API GLboolean GL_APIENTRY glIsVertexArrayOES (GLuint array);
+#endif
+typedef void (GL_APIENTRYP PFNGLBINDVERTEXARRAYOESPROC) (GLuint array);
+typedef void (GL_APIENTRYP PFNGLDELETEVERTEXARRAYSOESPROC) (GLsizei n, const GLuint *arrays);
+typedef void (GL_APIENTRYP PFNGLGENVERTEXARRAYSOESPROC) (GLsizei n, GLuint *arrays);
+typedef GLboolean (GL_APIENTRYP PFNGLISVERTEXARRAYOESPROC) (GLuint array);
+#endif
+
+/*------------------------------------------------------------------------*
+ * AMD extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_AMD_compressed_3DC_texture */
+#ifndef GL_AMD_compressed_3DC_texture
+#define GL_AMD_compressed_3DC_texture 1
+#endif
+
+/* GL_AMD_compressed_ATC_texture */
+#ifndef GL_AMD_compressed_ATC_texture
+#define GL_AMD_compressed_ATC_texture 1
+#endif
+
+/*------------------------------------------------------------------------*
+ * APPLE extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_APPLE_texture_2D_limited_npot */
+#ifndef GL_APPLE_texture_2D_limited_npot
+#define GL_APPLE_texture_2D_limited_npot 1
+#endif
+
+/* GL_APPLE_framebuffer_multisample */
+#ifndef GL_APPLE_framebuffer_multisample
+#define GL_APPLE_framebuffer_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glRenderbufferStorageMultisampleAPPLE (GLenum, GLsizei, GLenum, GLsizei, GLsizei);
+GL_API void GL_APIENTRY glResolveMultisampleFramebufferAPPLE (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC) (void);
+#endif
+
+/* GL_APPLE_texture_format_BGRA8888 */
+#ifndef GL_APPLE_texture_format_BGRA8888
+#define GL_APPLE_texture_format_BGRA8888 1
+#endif
+
+/* GL_APPLE_texture_max_level */
+#ifndef GL_APPLE_texture_max_level
+#define GL_APPLE_texture_max_level 1
+#endif
+
+/*------------------------------------------------------------------------*
+ * ARM extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_ARM_rgba8 */
+#ifndef GL_ARM_rgba8
+#define GL_ARM_rgba8 1
+#endif
+
+/*------------------------------------------------------------------------*
+ * EXT extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_EXT_blend_minmax */
+#ifndef GL_EXT_blend_minmax
+#define GL_EXT_blend_minmax 1
+#endif
+
+/* GL_EXT_discard_framebuffer */
+#ifndef GL_EXT_discard_framebuffer
+#define GL_EXT_discard_framebuffer 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glDiscardFramebufferEXT (GLenum target, GLsizei numAttachments, const GLenum *attachments);
+#endif
+typedef void (GL_APIENTRYP PFNGLDISCARDFRAMEBUFFEREXTPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments);
+#endif
+
+/* GL_EXT_multi_draw_arrays */
+#ifndef GL_EXT_multi_draw_arrays
+#define GL_EXT_multi_draw_arrays 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glMultiDrawArraysEXT (GLenum, GLint *, GLsizei *, GLsizei);
+GL_API void GL_APIENTRY glMultiDrawElementsEXT (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
+typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
+#endif
+
+/* GL_EXT_read_format_bgra */
+#ifndef GL_EXT_read_format_bgra
+#define GL_EXT_read_format_bgra 1
+#endif
+
+/* GL_EXT_texture_filter_anisotropic */
+#ifndef GL_EXT_texture_filter_anisotropic
+#define GL_EXT_texture_filter_anisotropic 1
+#endif
+
+/* GL_EXT_texture_format_BGRA8888 */
+#ifndef GL_EXT_texture_format_BGRA8888
+#define GL_EXT_texture_format_BGRA8888 1
+#endif
+
+/* GL_EXT_texture_lod_bias */
+#ifndef GL_EXT_texture_lod_bias
+#define GL_EXT_texture_lod_bias 1
+#endif
+
+/*------------------------------------------------------------------------*
+ * IMG extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_IMG_read_format */
+#ifndef GL_IMG_read_format
+#define GL_IMG_read_format 1
+#endif
+
+/* GL_IMG_texture_compression_pvrtc */
+#ifndef GL_IMG_texture_compression_pvrtc
+#define GL_IMG_texture_compression_pvrtc 1
+#endif
+
+/* GL_IMG_texture_env_enhanced_fixed_function */
+#ifndef GL_IMG_texture_env_enhanced_fixed_function
+#define GL_IMG_texture_env_enhanced_fixed_function 1
+#endif
+
+/* GL_IMG_user_clip_plane */
+#ifndef GL_IMG_user_clip_plane
+#define GL_IMG_user_clip_plane 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glClipPlanefIMG (GLenum, const GLfloat *);
+GL_API void GL_APIENTRY glClipPlanexIMG (GLenum, const GLfixed *);
+#endif
+typedef void (GL_APIENTRYP PFNGLCLIPPLANEFIMGPROC) (GLenum p, const GLfloat *eqn);
+typedef void (GL_APIENTRYP PFNGLCLIPPLANEXIMGPROC) (GLenum p, const GLfixed *eqn);
+#endif
+
+/* GL_IMG_multisampled_render_to_texture */
+#ifndef GL_IMG_multisampled_render_to_texture
+#define GL_IMG_multisampled_render_to_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glRenderbufferStorageMultisampleIMG (GLenum, GLsizei, GLenum, GLsizei, GLsizei);
+GL_API void GL_APIENTRY glFramebufferTexture2DMultisampleIMG (GLenum, GLenum, GLenum, GLuint, GLint, GLsizei);
+#endif
+typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMG) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMG) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
+#endif
+
+/*------------------------------------------------------------------------*
+ * NV extension functions
+ *------------------------------------------------------------------------*/
+
+/* NV_fence */
+#ifndef GL_NV_fence
+#define GL_NV_fence 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glDeleteFencesNV (GLsizei, const GLuint *);
+GL_API void GL_APIENTRY glGenFencesNV (GLsizei, GLuint *);
+GL_API GLboolean GL_APIENTRY glIsFenceNV (GLuint);
+GL_API GLboolean GL_APIENTRY glTestFenceNV (GLuint);
+GL_API void GL_APIENTRY glGetFenceivNV (GLuint, GLenum, GLint *);
+GL_API void GL_APIENTRY glFinishFenceNV (GLuint);
+GL_API void GL_APIENTRY glSetFenceNV (GLuint, GLenum);
+#endif
+typedef void (GL_APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences);
+typedef void (GL_APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences);
+typedef GLboolean (GL_APIENTRYP PFNGLISFENCENVPROC) (GLuint fence);
+typedef GLboolean (GL_APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence);
+typedef void (GL_APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence);
+typedef void (GL_APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition);
+#endif
+
+/*------------------------------------------------------------------------*
+ * QCOM extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_QCOM_driver_control */
+#ifndef GL_QCOM_driver_control
+#define GL_QCOM_driver_control 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glGetDriverControlsQCOM (GLint *num, GLsizei size, GLuint *driverControls);
+GL_API void GL_APIENTRY glGetDriverControlStringQCOM (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString);
+GL_API void GL_APIENTRY glEnableDriverControlQCOM (GLuint driverControl);
+GL_API void GL_APIENTRY glDisableDriverControlQCOM (GLuint driverControl);
+#endif
+typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSQCOMPROC) (GLint *num, GLsizei size, GLuint *driverControls);
+typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSTRINGQCOMPROC) (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString);
+typedef void (GL_APIENTRYP PFNGLENABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl);
+typedef void (GL_APIENTRYP PFNGLDISABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl);
+#endif
+
+/* GL_QCOM_extended_get */
+#ifndef GL_QCOM_extended_get
+#define GL_QCOM_extended_get 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glExtGetTexturesQCOM (GLuint *textures, GLint maxTextures, GLint *numTextures);
+GL_API void GL_APIENTRY glExtGetBuffersQCOM (GLuint *buffers, GLint maxBuffers, GLint *numBuffers);
+GL_API void GL_APIENTRY glExtGetRenderbuffersQCOM (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers);
+GL_API void GL_APIENTRY glExtGetFramebuffersQCOM (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers);
+GL_API void GL_APIENTRY glExtGetTexLevelParameterivQCOM (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params);
+GL_API void GL_APIENTRY glExtTexObjectStateOverrideiQCOM (GLenum target, GLenum pname, GLint param);
+GL_API void GL_APIENTRY glExtGetTexSubImageQCOM (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels);
+GL_API void GL_APIENTRY glExtGetBufferPointervQCOM (GLenum target, GLvoid **params);
+#endif
+typedef void (GL_APIENTRYP PFNGLEXTGETTEXTURESQCOMPROC) (GLuint *textures, GLint maxTextures, GLint *numTextures);
+typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERSQCOMPROC) (GLuint *buffers, GLint maxBuffers, GLint *numBuffers);
+typedef void (GL_APIENTRYP PFNGLEXTGETRENDERBUFFERSQCOMPROC) (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers);
+typedef void (GL_APIENTRYP PFNGLEXTGETFRAMEBUFFERSQCOMPROC) (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers);
+typedef void (GL_APIENTRYP PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC) (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC) (GLenum target, GLenum pname, GLint param);
+typedef void (GL_APIENTRYP PFNGLEXTGETTEXSUBIMAGEQCOMPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels);
+typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERPOINTERVQCOMPROC) (GLenum target, GLvoid **params);
+#endif
+
+/* GL_QCOM_extended_get2 */
+#ifndef GL_QCOM_extended_get2
+#define GL_QCOM_extended_get2 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glExtGetShadersQCOM (GLuint *shaders, GLint maxShaders, GLint *numShaders);
+GL_API void GL_APIENTRY glExtGetProgramsQCOM (GLuint *programs, GLint maxPrograms, GLint *numPrograms);
+GL_API GLboolean GL_APIENTRY glExtIsProgramBinaryQCOM (GLuint program);
+GL_API void GL_APIENTRY glExtGetProgramBinarySourceQCOM (GLuint program, GLenum shadertype, GLchar *source, GLint *length);
+#endif
+typedef void (GL_APIENTRYP PFNGLEXTGETSHADERSQCOMPROC) (GLuint *shaders, GLint maxShaders, GLint *numShaders);
+typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMSQCOMPROC) (GLuint *programs, GLint maxPrograms, GLint *numPrograms);
+typedef GLboolean (GL_APIENTRYP PFNGLEXTISPROGRAMBINARYQCOMPROC) (GLuint program);
+typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC) (GLuint program, GLenum shadertype, GLchar *source, GLint *length);
+#endif
+
+/* GL_QCOM_perfmon_global_mode */
+#ifndef GL_QCOM_perfmon_global_mode
+#define GL_QCOM_perfmon_global_mode 1
+#endif
+
+/* GL_QCOM_writeonly_rendering */
+#ifndef GL_QCOM_writeonly_rendering
+#define GL_QCOM_writeonly_rendering 1
+#endif
+
+/* GL_QCOM_tiled_rendering */
+#ifndef GL_QCOM_tiled_rendering
+#define GL_QCOM_tiled_rendering 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glStartTilingQCOM (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask);
+GL_API void GL_APIENTRY glEndTilingQCOM (GLbitfield preserveMask);
+#endif
+typedef void (GL_APIENTRYP PFNGLSTARTTILINGQCOMPROC) (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask);
+typedef void (GL_APIENTRYP PFNGLENDTILINGQCOMPROC) (GLbitfield preserveMask);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __glext_h_ */
+
diff --git a/hw/yagl/yagl_inc/GLES/glplatform.h b/hw/yagl/yagl_inc/GLES/glplatform.h
new file mode 100644
index 0000000000..2db6ee2ca6
--- /dev/null
+++ b/hw/yagl/yagl_inc/GLES/glplatform.h
@@ -0,0 +1,30 @@
+#ifndef __glplatform_h_
+#define __glplatform_h_
+
+/* $Revision: 10601 $ on $Date:: 2010-03-04 22:15:27 -0800 #$ */
+
+/*
+ * This document is licensed under the SGI Free Software B License Version
+ * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
+ */
+
+/* Platform-specific types and definitions for OpenGL ES 1.X gl.h
+ *
+ * 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
+ * they can be included in future versions of this file. Please submit changes
+ * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
+ * by filing a bug against product "OpenGL-ES" component "Registry".
+ */
+
+#include <KHR/khrplatform.h>
+
+#ifndef GL_API
+#define GL_API KHRONOS_APICALL
+#endif
+
+#ifndef GL_APIENTRY
+#define GL_APIENTRY KHRONOS_APIENTRY
+#endif
+
+#endif /* __glplatform_h_ */
diff --git a/hw/yagl/yagl_inc/GLES2/gl2.h b/hw/yagl/yagl_inc/GLES2/gl2.h
new file mode 100644
index 0000000000..e1d3b87cc5
--- /dev/null
+++ b/hw/yagl/yagl_inc/GLES2/gl2.h
@@ -0,0 +1,621 @@
+#ifndef __gl2_h_
+#define __gl2_h_
+
+/* $Revision: 10602 $ on $Date:: 2010-03-04 22:35:34 -0800 #$ */
+
+#include <GLES2/gl2platform.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * This document is licensed under the SGI Free Software B License Version
+ * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
+ */
+
+/*-------------------------------------------------------------------------
+ * Data type definitions
+ *-----------------------------------------------------------------------*/
+
+typedef void GLvoid;
+typedef char GLchar;
+typedef unsigned int GLenum;
+typedef unsigned char GLboolean;
+typedef unsigned int GLbitfield;
+typedef khronos_int8_t GLbyte;
+typedef short GLshort;
+typedef int GLint;
+typedef int GLsizei;
+typedef khronos_uint8_t GLubyte;
+typedef unsigned short GLushort;
+typedef unsigned int GLuint;
+typedef khronos_float_t GLfloat;
+typedef khronos_float_t GLclampf;
+typedef khronos_int32_t GLfixed;
+
+/* GL types for handling large vertex buffer objects */
+typedef khronos_intptr_t GLintptr;
+typedef khronos_ssize_t GLsizeiptr;
+
+/* OpenGL ES core versions */
+#define GL_ES_VERSION_2_0 1
+
+/* ClearBufferMask */
+#define GL_DEPTH_BUFFER_BIT 0x00000100
+#define GL_STENCIL_BUFFER_BIT 0x00000400
+#define GL_COLOR_BUFFER_BIT 0x00004000
+
+/* Boolean */
+#define GL_FALSE 0
+#define GL_TRUE 1
+
+/* BeginMode */
+#define GL_POINTS 0x0000
+#define GL_LINES 0x0001
+#define GL_LINE_LOOP 0x0002
+#define GL_LINE_STRIP 0x0003
+#define GL_TRIANGLES 0x0004
+#define GL_TRIANGLE_STRIP 0x0005
+#define GL_TRIANGLE_FAN 0x0006
+
+/* AlphaFunction (not supported in ES20) */
+/* GL_NEVER */
+/* GL_LESS */
+/* GL_EQUAL */
+/* GL_LEQUAL */
+/* GL_GREATER */
+/* GL_NOTEQUAL */
+/* GL_GEQUAL */
+/* GL_ALWAYS */
+
+/* BlendingFactorDest */
+#define GL_ZERO 0
+#define GL_ONE 1
+#define GL_SRC_COLOR 0x0300
+#define GL_ONE_MINUS_SRC_COLOR 0x0301
+#define GL_SRC_ALPHA 0x0302
+#define GL_ONE_MINUS_SRC_ALPHA 0x0303
+#define GL_DST_ALPHA 0x0304
+#define GL_ONE_MINUS_DST_ALPHA 0x0305
+
+/* BlendingFactorSrc */
+/* GL_ZERO */
+/* GL_ONE */
+#define GL_DST_COLOR 0x0306
+#define GL_ONE_MINUS_DST_COLOR 0x0307
+#define GL_SRC_ALPHA_SATURATE 0x0308
+/* GL_SRC_ALPHA */
+/* GL_ONE_MINUS_SRC_ALPHA */
+/* GL_DST_ALPHA */
+/* GL_ONE_MINUS_DST_ALPHA */
+
+/* BlendEquationSeparate */
+#define GL_FUNC_ADD 0x8006
+#define GL_BLEND_EQUATION 0x8009
+#define GL_BLEND_EQUATION_RGB 0x8009 /* same as BLEND_EQUATION */
+#define GL_BLEND_EQUATION_ALPHA 0x883D
+
+/* BlendSubtract */
+#define GL_FUNC_SUBTRACT 0x800A
+#define GL_FUNC_REVERSE_SUBTRACT 0x800B
+
+/* Separate Blend Functions */
+#define GL_BLEND_DST_RGB 0x80C8
+#define GL_BLEND_SRC_RGB 0x80C9
+#define GL_BLEND_DST_ALPHA 0x80CA
+#define GL_BLEND_SRC_ALPHA 0x80CB
+#define GL_CONSTANT_COLOR 0x8001
+#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
+#define GL_CONSTANT_ALPHA 0x8003
+#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
+#define GL_BLEND_COLOR 0x8005
+
+/* Buffer Objects */
+#define GL_ARRAY_BUFFER 0x8892
+#define GL_ELEMENT_ARRAY_BUFFER 0x8893
+#define GL_ARRAY_BUFFER_BINDING 0x8894
+#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
+
+#define GL_STREAM_DRAW 0x88E0
+#define GL_STATIC_DRAW 0x88E4
+#define GL_DYNAMIC_DRAW 0x88E8
+
+#define GL_BUFFER_SIZE 0x8764
+#define GL_BUFFER_USAGE 0x8765
+
+#define GL_CURRENT_VERTEX_ATTRIB 0x8626
+
+/* CullFaceMode */
+#define GL_FRONT 0x0404
+#define GL_BACK 0x0405
+#define GL_FRONT_AND_BACK 0x0408
+
+/* DepthFunction */
+/* GL_NEVER */
+/* GL_LESS */
+/* GL_EQUAL */
+/* GL_LEQUAL */
+/* GL_GREATER */
+/* GL_NOTEQUAL */
+/* GL_GEQUAL */
+/* GL_ALWAYS */
+
+/* EnableCap */
+#define GL_TEXTURE_2D 0x0DE1
+#define GL_CULL_FACE 0x0B44
+#define GL_BLEND 0x0BE2
+#define GL_DITHER 0x0BD0
+#define GL_STENCIL_TEST 0x0B90
+#define GL_DEPTH_TEST 0x0B71
+#define GL_SCISSOR_TEST 0x0C11
+#define GL_POLYGON_OFFSET_FILL 0x8037
+#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
+#define GL_SAMPLE_COVERAGE 0x80A0
+
+/* ErrorCode */
+#define GL_NO_ERROR 0
+#define GL_INVALID_ENUM 0x0500
+#define GL_INVALID_VALUE 0x0501
+#define GL_INVALID_OPERATION 0x0502
+#define GL_OUT_OF_MEMORY 0x0505
+
+/* FrontFaceDirection */
+#define GL_CW 0x0900
+#define GL_CCW 0x0901
+
+/* GetPName */
+#define GL_LINE_WIDTH 0x0B21
+#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
+#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
+#define GL_CULL_FACE_MODE 0x0B45
+#define GL_FRONT_FACE 0x0B46
+#define GL_DEPTH_RANGE 0x0B70
+#define GL_DEPTH_WRITEMASK 0x0B72
+#define GL_DEPTH_CLEAR_VALUE 0x0B73
+#define GL_DEPTH_FUNC 0x0B74
+#define GL_STENCIL_CLEAR_VALUE 0x0B91
+#define GL_STENCIL_FUNC 0x0B92
+#define GL_STENCIL_FAIL 0x0B94
+#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
+#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
+#define GL_STENCIL_REF 0x0B97
+#define GL_STENCIL_VALUE_MASK 0x0B93
+#define GL_STENCIL_WRITEMASK 0x0B98
+#define GL_STENCIL_BACK_FUNC 0x8800
+#define GL_STENCIL_BACK_FAIL 0x8801
+#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802
+#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803
+#define GL_STENCIL_BACK_REF 0x8CA3
+#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
+#define GL_STENCIL_BACK_WRITEMASK 0x8CA5
+#define GL_VIEWPORT 0x0BA2
+#define GL_SCISSOR_BOX 0x0C10
+/* GL_SCISSOR_TEST */
+#define GL_COLOR_CLEAR_VALUE 0x0C22
+#define GL_COLOR_WRITEMASK 0x0C23
+#define GL_UNPACK_ALIGNMENT 0x0CF5
+#define GL_PACK_ALIGNMENT 0x0D05
+#define GL_MAX_TEXTURE_SIZE 0x0D33
+#define GL_MAX_VIEWPORT_DIMS 0x0D3A
+#define GL_SUBPIXEL_BITS 0x0D50
+#define GL_RED_BITS 0x0D52
+#define GL_GREEN_BITS 0x0D53
+#define GL_BLUE_BITS 0x0D54
+#define GL_ALPHA_BITS 0x0D55
+#define GL_DEPTH_BITS 0x0D56
+#define GL_STENCIL_BITS 0x0D57
+#define GL_POLYGON_OFFSET_UNITS 0x2A00
+/* GL_POLYGON_OFFSET_FILL */
+#define GL_POLYGON_OFFSET_FACTOR 0x8038
+#define GL_TEXTURE_BINDING_2D 0x8069
+#define GL_SAMPLE_BUFFERS 0x80A8
+#define GL_SAMPLES 0x80A9
+#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
+#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
+
+/* GetTextureParameter */
+/* GL_TEXTURE_MAG_FILTER */
+/* GL_TEXTURE_MIN_FILTER */
+/* GL_TEXTURE_WRAP_S */
+/* GL_TEXTURE_WRAP_T */
+
+#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
+#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
+
+/* HintMode */
+#define GL_DONT_CARE 0x1100
+#define GL_FASTEST 0x1101
+#define GL_NICEST 0x1102
+
+/* HintTarget */
+#define GL_GENERATE_MIPMAP_HINT 0x8192
+
+/* DataType */
+#define GL_BYTE 0x1400
+#define GL_UNSIGNED_BYTE 0x1401
+#define GL_SHORT 0x1402
+#define GL_UNSIGNED_SHORT 0x1403
+#define GL_INT 0x1404
+#define GL_UNSIGNED_INT 0x1405
+#define GL_FLOAT 0x1406
+#define GL_FIXED 0x140C
+
+/* PixelFormat */
+#define GL_DEPTH_COMPONENT 0x1902
+#define GL_ALPHA 0x1906
+#define GL_RGB 0x1907
+#define GL_RGBA 0x1908
+#define GL_LUMINANCE 0x1909
+#define GL_LUMINANCE_ALPHA 0x190A
+
+/* PixelType */
+/* GL_UNSIGNED_BYTE */
+#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
+#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
+#define GL_UNSIGNED_SHORT_5_6_5 0x8363
+
+/* Shaders */
+#define GL_FRAGMENT_SHADER 0x8B30
+#define GL_VERTEX_SHADER 0x8B31
+#define GL_MAX_VERTEX_ATTRIBS 0x8869
+#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB
+#define GL_MAX_VARYING_VECTORS 0x8DFC
+#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
+#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
+#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
+#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD
+#define GL_SHADER_TYPE 0x8B4F
+#define GL_DELETE_STATUS 0x8B80
+#define GL_LINK_STATUS 0x8B82
+#define GL_VALIDATE_STATUS 0x8B83
+#define GL_ATTACHED_SHADERS 0x8B85
+#define GL_ACTIVE_UNIFORMS 0x8B86
+#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
+#define GL_ACTIVE_ATTRIBUTES 0x8B89
+#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
+#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
+#define GL_CURRENT_PROGRAM 0x8B8D
+
+/* StencilFunction */
+#define GL_NEVER 0x0200
+#define GL_LESS 0x0201
+#define GL_EQUAL 0x0202
+#define GL_LEQUAL 0x0203
+#define GL_GREATER 0x0204
+#define GL_NOTEQUAL 0x0205
+#define GL_GEQUAL 0x0206
+#define GL_ALWAYS 0x0207
+
+/* StencilOp */
+/* GL_ZERO */
+#define GL_KEEP 0x1E00
+#define GL_REPLACE 0x1E01
+#define GL_INCR 0x1E02
+#define GL_DECR 0x1E03
+#define GL_INVERT 0x150A
+#define GL_INCR_WRAP 0x8507
+#define GL_DECR_WRAP 0x8508
+
+/* StringName */
+#define GL_VENDOR 0x1F00
+#define GL_RENDERER 0x1F01
+#define GL_VERSION 0x1F02
+#define GL_EXTENSIONS 0x1F03
+
+/* TextureMagFilter */
+#define GL_NEAREST 0x2600
+#define GL_LINEAR 0x2601
+
+/* TextureMinFilter */
+/* GL_NEAREST */
+/* GL_LINEAR */
+#define GL_NEAREST_MIPMAP_NEAREST 0x2700
+#define GL_LINEAR_MIPMAP_NEAREST 0x2701
+#define GL_NEAREST_MIPMAP_LINEAR 0x2702
+#define GL_LINEAR_MIPMAP_LINEAR 0x2703
+
+/* TextureParameterName */
+#define GL_TEXTURE_MAG_FILTER 0x2800
+#define GL_TEXTURE_MIN_FILTER 0x2801
+#define GL_TEXTURE_WRAP_S 0x2802
+#define GL_TEXTURE_WRAP_T 0x2803
+
+/* TextureTarget */
+/* GL_TEXTURE_2D */
+#define GL_TEXTURE 0x1702
+
+#define GL_TEXTURE_CUBE_MAP 0x8513
+#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
+
+/* TextureUnit */
+#define GL_TEXTURE0 0x84C0
+#define GL_TEXTURE1 0x84C1
+#define GL_TEXTURE2 0x84C2
+#define GL_TEXTURE3 0x84C3
+#define GL_TEXTURE4 0x84C4
+#define GL_TEXTURE5 0x84C5
+#define GL_TEXTURE6 0x84C6
+#define GL_TEXTURE7 0x84C7
+#define GL_TEXTURE8 0x84C8
+#define GL_TEXTURE9 0x84C9
+#define GL_TEXTURE10 0x84CA
+#define GL_TEXTURE11 0x84CB
+#define GL_TEXTURE12 0x84CC
+#define GL_TEXTURE13 0x84CD
+#define GL_TEXTURE14 0x84CE
+#define GL_TEXTURE15 0x84CF
+#define GL_TEXTURE16 0x84D0
+#define GL_TEXTURE17 0x84D1
+#define GL_TEXTURE18 0x84D2
+#define GL_TEXTURE19 0x84D3
+#define GL_TEXTURE20 0x84D4
+#define GL_TEXTURE21 0x84D5
+#define GL_TEXTURE22 0x84D6
+#define GL_TEXTURE23 0x84D7
+#define GL_TEXTURE24 0x84D8
+#define GL_TEXTURE25 0x84D9
+#define GL_TEXTURE26 0x84DA
+#define GL_TEXTURE27 0x84DB
+#define GL_TEXTURE28 0x84DC
+#define GL_TEXTURE29 0x84DD
+#define GL_TEXTURE30 0x84DE
+#define GL_TEXTURE31 0x84DF
+#define GL_ACTIVE_TEXTURE 0x84E0
+
+/* TextureWrapMode */
+#define GL_REPEAT 0x2901
+#define GL_CLAMP_TO_EDGE 0x812F
+#define GL_MIRRORED_REPEAT 0x8370
+
+/* Uniform Types */
+#define GL_FLOAT_VEC2 0x8B50
+#define GL_FLOAT_VEC3 0x8B51
+#define GL_FLOAT_VEC4 0x8B52
+#define GL_INT_VEC2 0x8B53
+#define GL_INT_VEC3 0x8B54
+#define GL_INT_VEC4 0x8B55
+#define GL_BOOL 0x8B56
+#define GL_BOOL_VEC2 0x8B57
+#define GL_BOOL_VEC3 0x8B58
+#define GL_BOOL_VEC4 0x8B59
+#define GL_FLOAT_MAT2 0x8B5A
+#define GL_FLOAT_MAT3 0x8B5B
+#define GL_FLOAT_MAT4 0x8B5C
+#define GL_SAMPLER_2D 0x8B5E
+#define GL_SAMPLER_CUBE 0x8B60
+
+/* Vertex Arrays */
+#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
+#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
+#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
+#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
+#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
+#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
+#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
+
+/* Read Format */
+#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A
+#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
+
+/* Shader Source */
+#define GL_COMPILE_STATUS 0x8B81
+#define GL_INFO_LOG_LENGTH 0x8B84
+#define GL_SHADER_SOURCE_LENGTH 0x8B88
+#define GL_SHADER_COMPILER 0x8DFA
+
+/* Shader Binary */
+#define GL_SHADER_BINARY_FORMATS 0x8DF8
+#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9
+
+/* Shader Precision-Specified Types */
+#define GL_LOW_FLOAT 0x8DF0
+#define GL_MEDIUM_FLOAT 0x8DF1
+#define GL_HIGH_FLOAT 0x8DF2
+#define GL_LOW_INT 0x8DF3
+#define GL_MEDIUM_INT 0x8DF4
+#define GL_HIGH_INT 0x8DF5
+
+/* Framebuffer Object. */
+#define GL_FRAMEBUFFER 0x8D40
+#define GL_RENDERBUFFER 0x8D41
+
+#define GL_RGBA4 0x8056
+#define GL_RGB5_A1 0x8057
+#define GL_RGB565 0x8D62
+#define GL_DEPTH_COMPONENT16 0x81A5
+#define GL_STENCIL_INDEX 0x1901
+#define GL_STENCIL_INDEX8 0x8D48
+
+#define GL_RENDERBUFFER_WIDTH 0x8D42
+#define GL_RENDERBUFFER_HEIGHT 0x8D43
+#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44
+#define GL_RENDERBUFFER_RED_SIZE 0x8D50
+#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51
+#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52
+#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53
+#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54
+#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55
+
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
+
+#define GL_COLOR_ATTACHMENT0 0x8CE0
+#define GL_DEPTH_ATTACHMENT 0x8D00
+#define GL_STENCIL_ATTACHMENT 0x8D20
+
+#define GL_NONE 0
+
+#define GL_FRAMEBUFFER_COMPLETE 0x8CD5
+#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
+#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
+#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9
+#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
+
+#define GL_FRAMEBUFFER_BINDING 0x8CA6
+#define GL_RENDERBUFFER_BINDING 0x8CA7
+#define GL_MAX_RENDERBUFFER_SIZE 0x84E8
+
+#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
+
+/*-------------------------------------------------------------------------
+ * GL core functions.
+ *-----------------------------------------------------------------------*/
+
+GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture);
+GL_APICALL void GL_APIENTRY glAttachShader (GLuint program, GLuint shader);
+GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar* name);
+GL_APICALL void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer);
+GL_APICALL void GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer);
+GL_APICALL void GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer);
+GL_APICALL void GL_APIENTRY glBindTexture (GLenum target, GLuint texture);
+GL_APICALL void GL_APIENTRY glBlendColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+GL_APICALL void GL_APIENTRY glBlendEquation ( GLenum mode );
+GL_APICALL void GL_APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha);
+GL_APICALL void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
+GL_APICALL void GL_APIENTRY glBlendFuncSeparate (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage);
+GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data);
+GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus (GLenum target);
+GL_APICALL void GL_APIENTRY glClear (GLbitfield mask);
+GL_APICALL void GL_APIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+GL_APICALL void GL_APIENTRY glClearDepthf (GLclampf depth);
+GL_APICALL void GL_APIENTRY glClearStencil (GLint s);
+GL_APICALL void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+GL_APICALL void GL_APIENTRY glCompileShader (GLuint shader);
+GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data);
+GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data);
+GL_APICALL void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+GL_APICALL void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GL_APICALL GLuint GL_APIENTRY glCreateProgram (void);
+GL_APICALL GLuint GL_APIENTRY glCreateShader (GLenum type);
+GL_APICALL void GL_APIENTRY glCullFace (GLenum mode);
+GL_APICALL void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint* buffers);
+GL_APICALL void GL_APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint* framebuffers);
+GL_APICALL void GL_APIENTRY glDeleteProgram (GLuint program);
+GL_APICALL void GL_APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint* renderbuffers);
+GL_APICALL void GL_APIENTRY glDeleteShader (GLuint shader);
+GL_APICALL void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint* textures);
+GL_APICALL void GL_APIENTRY glDepthFunc (GLenum func);
+GL_APICALL void GL_APIENTRY glDepthMask (GLboolean flag);
+GL_APICALL void GL_APIENTRY glDepthRangef (GLclampf zNear, GLclampf zFar);
+GL_APICALL void GL_APIENTRY glDetachShader (GLuint program, GLuint shader);
+GL_APICALL void GL_APIENTRY glDisable (GLenum cap);
+GL_APICALL void GL_APIENTRY glDisableVertexAttribArray (GLuint index);
+GL_APICALL void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
+GL_APICALL void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid* indices);
+GL_APICALL void GL_APIENTRY glEnable (GLenum cap);
+GL_APICALL void GL_APIENTRY glEnableVertexAttribArray (GLuint index);
+GL_APICALL void GL_APIENTRY glFinish (void);
+GL_APICALL void GL_APIENTRY glFlush (void);
+GL_APICALL void GL_APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+GL_APICALL void GL_APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GL_APICALL void GL_APIENTRY glFrontFace (GLenum mode);
+GL_APICALL void GL_APIENTRY glGenBuffers (GLsizei n, GLuint* buffers);
+GL_APICALL void GL_APIENTRY glGenerateMipmap (GLenum target);
+GL_APICALL void GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint* framebuffers);
+GL_APICALL void GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint* renderbuffers);
+GL_APICALL void GL_APIENTRY glGenTextures (GLsizei n, GLuint* textures);
+GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
+GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
+GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders);
+GL_APICALL int GL_APIENTRY glGetAttribLocation (GLuint program, const GLchar* name);
+GL_APICALL void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean* params);
+GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint* params);
+GL_APICALL GLenum GL_APIENTRY glGetError (void);
+GL_APICALL void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat* params);
+GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint* params);
+GL_APICALL void GL_APIENTRY glGetIntegerv (GLenum pname, GLint* params);
+GL_APICALL void GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint* params);
+GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog);
+GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint* params);
+GL_APICALL void GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint* params);
+GL_APICALL void GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog);
+GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
+GL_APICALL void GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source);
+GL_APICALL const GLubyte* GL_APIENTRY glGetString (GLenum name);
+GL_APICALL void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat* params);
+GL_APICALL void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint* params);
+GL_APICALL void GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat* params);
+GL_APICALL void GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint* params);
+GL_APICALL int GL_APIENTRY glGetUniformLocation (GLuint program, const GLchar* name);
+GL_APICALL void GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat* params);
+GL_APICALL void GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint* params);
+GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, GLvoid** pointer);
+GL_APICALL void GL_APIENTRY glHint (GLenum target, GLenum mode);
+GL_APICALL GLboolean GL_APIENTRY glIsBuffer (GLuint buffer);
+GL_APICALL GLboolean GL_APIENTRY glIsEnabled (GLenum cap);
+GL_APICALL GLboolean GL_APIENTRY glIsFramebuffer (GLuint framebuffer);
+GL_APICALL GLboolean GL_APIENTRY glIsProgram (GLuint program);
+GL_APICALL GLboolean GL_APIENTRY glIsRenderbuffer (GLuint renderbuffer);
+GL_APICALL GLboolean GL_APIENTRY glIsShader (GLuint shader);
+GL_APICALL GLboolean GL_APIENTRY glIsTexture (GLuint texture);
+GL_APICALL void GL_APIENTRY glLineWidth (GLfloat width);
+GL_APICALL void GL_APIENTRY glLinkProgram (GLuint program);
+GL_APICALL void GL_APIENTRY glPixelStorei (GLenum pname, GLint param);
+GL_APICALL void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
+GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels);
+GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void);
+GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glSampleCoverage (GLclampf value, GLboolean invert);
+GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length);
+GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar** string, const GLint* length);
+GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
+GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);
+GL_APICALL void GL_APIENTRY glStencilMask (GLuint mask);
+GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask);
+GL_APICALL void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
+GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
+GL_APICALL void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
+GL_APICALL void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
+GL_APICALL void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat* params);
+GL_APICALL void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);
+GL_APICALL void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint* params);
+GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels);
+GL_APICALL void GL_APIENTRY glUniform1f (GLint location, GLfloat x);
+GL_APICALL void GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat* v);
+GL_APICALL void GL_APIENTRY glUniform1i (GLint location, GLint x);
+GL_APICALL void GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint* v);
+GL_APICALL void GL_APIENTRY glUniform2f (GLint location, GLfloat x, GLfloat y);
+GL_APICALL void GL_APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat* v);
+GL_APICALL void GL_APIENTRY glUniform2i (GLint location, GLint x, GLint y);
+GL_APICALL void GL_APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint* v);
+GL_APICALL void GL_APIENTRY glUniform3f (GLint location, GLfloat x, GLfloat y, GLfloat z);
+GL_APICALL void GL_APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat* v);
+GL_APICALL void GL_APIENTRY glUniform3i (GLint location, GLint x, GLint y, GLint z);
+GL_APICALL void GL_APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint* v);
+GL_APICALL void GL_APIENTRY glUniform4f (GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GL_APICALL void GL_APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat* v);
+GL_APICALL void GL_APIENTRY glUniform4i (GLint location, GLint x, GLint y, GLint z, GLint w);
+GL_APICALL void GL_APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint* v);
+GL_APICALL void GL_APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+GL_APICALL void GL_APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+GL_APICALL void GL_APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+GL_APICALL void GL_APIENTRY glUseProgram (GLuint program);
+GL_APICALL void GL_APIENTRY glValidateProgram (GLuint program);
+GL_APICALL void GL_APIENTRY glVertexAttrib1f (GLuint indx, GLfloat x);
+GL_APICALL void GL_APIENTRY glVertexAttrib1fv (GLuint indx, const GLfloat* values);
+GL_APICALL void GL_APIENTRY glVertexAttrib2f (GLuint indx, GLfloat x, GLfloat y);
+GL_APICALL void GL_APIENTRY glVertexAttrib2fv (GLuint indx, const GLfloat* values);
+GL_APICALL void GL_APIENTRY glVertexAttrib3f (GLuint indx, GLfloat x, GLfloat y, GLfloat z);
+GL_APICALL void GL_APIENTRY glVertexAttrib3fv (GLuint indx, const GLfloat* values);
+GL_APICALL void GL_APIENTRY glVertexAttrib4f (GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint indx, const GLfloat* values);
+GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr);
+GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __gl2_h_ */
diff --git a/hw/yagl/yagl_inc/GLES2/gl2ext.h b/hw/yagl/yagl_inc/GLES2/gl2ext.h
new file mode 100644
index 0000000000..4eae246352
--- /dev/null
+++ b/hw/yagl/yagl_inc/GLES2/gl2ext.h
@@ -0,0 +1,1138 @@
+#ifndef __gl2ext_h_
+#define __gl2ext_h_
+
+/* $Revision: 15049 $ on $Date:: 2011-07-06 17:28:16 -0700 #$ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * This document is licensed under the SGI Free Software B License Version
+ * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
+ */
+
+#ifndef GL_APIENTRYP
+# define GL_APIENTRYP GL_APIENTRY*
+#endif
+
+/*------------------------------------------------------------------------*
+ * OES extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_OES_compressed_ETC1_RGB8_texture */
+#ifndef GL_OES_compressed_ETC1_RGB8_texture
+#define GL_ETC1_RGB8_OES 0x8D64
+#endif
+
+/* GL_OES_compressed_paletted_texture */
+#ifndef GL_OES_compressed_paletted_texture
+#define GL_PALETTE4_RGB8_OES 0x8B90
+#define GL_PALETTE4_RGBA8_OES 0x8B91
+#define GL_PALETTE4_R5_G6_B5_OES 0x8B92
+#define GL_PALETTE4_RGBA4_OES 0x8B93
+#define GL_PALETTE4_RGB5_A1_OES 0x8B94
+#define GL_PALETTE8_RGB8_OES 0x8B95
+#define GL_PALETTE8_RGBA8_OES 0x8B96
+#define GL_PALETTE8_R5_G6_B5_OES 0x8B97
+#define GL_PALETTE8_RGBA4_OES 0x8B98
+#define GL_PALETTE8_RGB5_A1_OES 0x8B99
+#endif
+
+/* GL_OES_depth24 */
+#ifndef GL_OES_depth24
+#define GL_DEPTH_COMPONENT24_OES 0x81A6
+#endif
+
+/* GL_OES_depth32 */
+#ifndef GL_OES_depth32
+#define GL_DEPTH_COMPONENT32_OES 0x81A7
+#endif
+
+/* GL_OES_depth_texture */
+/* No new tokens introduced by this extension. */
+
+/* GL_OES_EGL_image */
+#ifndef GL_OES_EGL_image
+typedef void* GLeglImageOES;
+#endif
+
+/* GL_OES_EGL_image_external */
+#ifndef GL_OES_EGL_image_external
+/* GLeglImageOES defined in GL_OES_EGL_image already. */
+#define GL_TEXTURE_EXTERNAL_OES 0x8D65
+#define GL_SAMPLER_EXTERNAL_OES 0x8D66
+#define GL_TEXTURE_BINDING_EXTERNAL_OES 0x8D67
+#define GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES 0x8D68
+#endif
+
+/* GL_OES_element_index_uint */
+#ifndef GL_OES_element_index_uint
+#define GL_UNSIGNED_INT 0x1405
+#endif
+
+/* GL_OES_get_program_binary */
+#ifndef GL_OES_get_program_binary
+#define GL_PROGRAM_BINARY_LENGTH_OES 0x8741
+#define GL_NUM_PROGRAM_BINARY_FORMATS_OES 0x87FE
+#define GL_PROGRAM_BINARY_FORMATS_OES 0x87FF
+#endif
+
+/* GL_OES_mapbuffer */
+#ifndef GL_OES_mapbuffer
+#define GL_WRITE_ONLY_OES 0x88B9
+#define GL_BUFFER_ACCESS_OES 0x88BB
+#define GL_BUFFER_MAPPED_OES 0x88BC
+#define GL_BUFFER_MAP_POINTER_OES 0x88BD
+#endif
+
+/* GL_OES_packed_depth_stencil */
+#ifndef GL_OES_packed_depth_stencil
+#define GL_DEPTH_STENCIL_OES 0x84F9
+#define GL_UNSIGNED_INT_24_8_OES 0x84FA
+#define GL_DEPTH24_STENCIL8_OES 0x88F0
+#endif
+
+/* GL_OES_rgb8_rgba8 */
+#ifndef GL_OES_rgb8_rgba8
+#define GL_RGB8_OES 0x8051
+#define GL_RGBA8_OES 0x8058
+#endif
+
+/* GL_OES_standard_derivatives */
+#ifndef GL_OES_standard_derivatives
+#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES 0x8B8B
+#endif
+
+/* GL_OES_stencil1 */
+#ifndef GL_OES_stencil1
+#define GL_STENCIL_INDEX1_OES 0x8D46
+#endif
+
+/* GL_OES_stencil4 */
+#ifndef GL_OES_stencil4
+#define GL_STENCIL_INDEX4_OES 0x8D47
+#endif
+
+/* GL_OES_texture_3D */
+#ifndef GL_OES_texture_3D
+#define GL_TEXTURE_WRAP_R_OES 0x8072
+#define GL_TEXTURE_3D_OES 0x806F
+#define GL_TEXTURE_BINDING_3D_OES 0x806A
+#define GL_MAX_3D_TEXTURE_SIZE_OES 0x8073
+#define GL_SAMPLER_3D_OES 0x8B5F
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES 0x8CD4
+#endif
+
+/* GL_OES_texture_float */
+/* No new tokens introduced by this extension. */
+
+/* GL_OES_texture_float_linear */
+/* No new tokens introduced by this extension. */
+
+/* GL_OES_texture_half_float */
+#ifndef GL_OES_texture_half_float
+#define GL_HALF_FLOAT_OES 0x8D61
+#endif
+
+/* GL_OES_texture_half_float_linear */
+/* No new tokens introduced by this extension. */
+
+/* GL_OES_texture_npot */
+/* No new tokens introduced by this extension. */
+
+/* GL_OES_vertex_array_object */
+#ifndef GL_OES_vertex_array_object
+#define GL_VERTEX_ARRAY_BINDING_OES 0x85B5
+#endif
+
+/* GL_OES_vertex_half_float */
+/* GL_HALF_FLOAT_OES defined in GL_OES_texture_half_float already. */
+
+/* GL_OES_vertex_type_10_10_10_2 */
+#ifndef GL_OES_vertex_type_10_10_10_2
+#define GL_UNSIGNED_INT_10_10_10_2_OES 0x8DF6
+#define GL_INT_10_10_10_2_OES 0x8DF7
+#endif
+
+/*------------------------------------------------------------------------*
+ * AMD extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_AMD_compressed_3DC_texture */
+#ifndef GL_AMD_compressed_3DC_texture
+#define GL_3DC_X_AMD 0x87F9
+#define GL_3DC_XY_AMD 0x87FA
+#endif
+
+/* GL_AMD_compressed_ATC_texture */
+#ifndef GL_AMD_compressed_ATC_texture
+#define GL_ATC_RGB_AMD 0x8C92
+#define GL_ATC_RGBA_EXPLICIT_ALPHA_AMD 0x8C93
+#define GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD 0x87EE
+#endif
+
+/* GL_AMD_performance_monitor */
+#ifndef GL_AMD_performance_monitor
+#define GL_COUNTER_TYPE_AMD 0x8BC0
+#define GL_COUNTER_RANGE_AMD 0x8BC1
+#define GL_UNSIGNED_INT64_AMD 0x8BC2
+#define GL_PERCENTAGE_AMD 0x8BC3
+#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4
+#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5
+#define GL_PERFMON_RESULT_AMD 0x8BC6
+#endif
+
+/* GL_AMD_program_binary_Z400 */
+#ifndef GL_AMD_program_binary_Z400
+#define GL_Z400_BINARY_AMD 0x8740
+#endif
+
+/*------------------------------------------------------------------------*
+ * ANGLE extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_ANGLE_framebuffer_blit */
+#ifndef GL_ANGLE_framebuffer_blit
+#define GL_READ_FRAMEBUFFER_ANGLE 0x8CA8
+#define GL_DRAW_FRAMEBUFFER_ANGLE 0x8CA9
+#define GL_DRAW_FRAMEBUFFER_BINDING_ANGLE 0x8CA6
+#define GL_READ_FRAMEBUFFER_BINDING_ANGLE 0x8CAA
+#endif
+
+/* GL_ANGLE_framebuffer_multisample */
+#ifndef GL_ANGLE_framebuffer_multisample
+#define GL_RENDERBUFFER_SAMPLES_ANGLE 0x8CAB
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE 0x8D56
+#define GL_MAX_SAMPLES_ANGLE 0x8D57
+#endif
+
+/*------------------------------------------------------------------------*
+ * APPLE extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_APPLE_rgb_422 */
+#ifndef GL_APPLE_rgb_422
+#define GL_RGB_422_APPLE 0x8A1F
+#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA
+#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB
+#endif
+
+/* GL_APPLE_framebuffer_multisample */
+#ifndef GL_APPLE_framebuffer_multisample
+#define GL_RENDERBUFFER_SAMPLES_APPLE 0x8CAB
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_APPLE 0x8D56
+#define GL_MAX_SAMPLES_APPLE 0x8D57
+#define GL_READ_FRAMEBUFFER_APPLE 0x8CA8
+#define GL_DRAW_FRAMEBUFFER_APPLE 0x8CA9
+#define GL_DRAW_FRAMEBUFFER_BINDING_APPLE 0x8CA6
+#define GL_READ_FRAMEBUFFER_BINDING_APPLE 0x8CAA
+#endif
+
+/* GL_APPLE_texture_format_BGRA8888 */
+#ifndef GL_APPLE_texture_format_BGRA8888
+#define GL_BGRA_EXT 0x80E1
+#endif
+
+/* GL_APPLE_texture_max_level */
+#ifndef GL_APPLE_texture_max_level
+#define GL_TEXTURE_MAX_LEVEL_APPLE 0x813D
+#endif
+
+/*------------------------------------------------------------------------*
+ * ARM extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_ARM_mali_shader_binary */
+#ifndef GL_ARM_mali_shader_binary
+#define GL_MALI_SHADER_BINARY_ARM 0x8F60
+#endif
+
+/* GL_ARM_rgba8 */
+/* No new tokens introduced by this extension. */
+
+/*------------------------------------------------------------------------*
+ * EXT extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_EXT_blend_minmax */
+#ifndef GL_EXT_blend_minmax
+#define GL_MIN_EXT 0x8007
+#define GL_MAX_EXT 0x8008
+#endif
+
+/* GL_EXT_discard_framebuffer */
+#ifndef GL_EXT_discard_framebuffer
+#define GL_COLOR_EXT 0x1800
+#define GL_DEPTH_EXT 0x1801
+#define GL_STENCIL_EXT 0x1802
+#endif
+
+/* GL_EXT_multi_draw_arrays */
+/* No new tokens introduced by this extension. */
+
+/* GL_EXT_read_format_bgra */
+#ifndef GL_EXT_read_format_bgra
+#define GL_BGRA_EXT 0x80E1
+#define GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT 0x8365
+#define GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT 0x8366
+#endif
+
+/* GL_EXT_shader_texture_lod */
+/* No new tokens introduced by this extension. */
+
+/* GL_EXT_texture_filter_anisotropic */
+#ifndef GL_EXT_texture_filter_anisotropic
+#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
+#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
+#endif
+
+/* GL_EXT_texture_format_BGRA8888 */
+#ifndef GL_EXT_texture_format_BGRA8888
+#define GL_BGRA_EXT 0x80E1
+#endif
+
+/* GL_EXT_texture_type_2_10_10_10_REV */
+#ifndef GL_EXT_texture_type_2_10_10_10_REV
+#define GL_UNSIGNED_INT_2_10_10_10_REV_EXT 0x8368
+#endif
+
+/* GL_EXT_texture_compression_dxt1 */
+#ifndef GL_EXT_texture_compression_dxt1
+#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
+#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
+#endif
+
+/* GL_EXT_unpack_subimage */
+#ifndef GL_EXT_unpack_subimage
+#define GL_UNPACK_ROW_LENGTH 0x0CF2
+#define GL_UNPACK_SKIP_ROWS 0x0CF3
+#define GL_UNPACK_SKIP_PIXELS 0x0CF4
+#endif
+
+/*------------------------------------------------------------------------*
+ * DMP extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_DMP_shader_binary */
+#ifndef GL_DMP_shader_binary
+#define GL_SHADER_BINARY_DMP 0x9250
+#endif
+
+/*------------------------------------------------------------------------*
+ * IMG extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_IMG_program_binary */
+#ifndef GL_IMG_program_binary
+#define GL_SGX_PROGRAM_BINARY_IMG 0x9130
+#endif
+
+/* GL_IMG_read_format */
+#ifndef GL_IMG_read_format
+#define GL_BGRA_IMG 0x80E1
+#define GL_UNSIGNED_SHORT_4_4_4_4_REV_IMG 0x8365
+#endif
+
+/* GL_IMG_shader_binary */
+#ifndef GL_IMG_shader_binary
+#define GL_SGX_BINARY_IMG 0x8C0A
+#endif
+
+/* GL_IMG_texture_compression_pvrtc */
+#ifndef GL_IMG_texture_compression_pvrtc
+#define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00
+#define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG 0x8C01
+#define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02
+#define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03
+#endif
+
+/* GL_IMG_multisampled_render_to_texture */
+#ifndef GL_IMG_multisampled_render_to_texture
+#define GL_RENDERBUFFER_SAMPLES_IMG 0x9133
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_IMG 0x9134
+#define GL_MAX_SAMPLES_IMG 0x9135
+#define GL_TEXTURE_SAMPLES_IMG 0x9136
+#endif
+
+/*------------------------------------------------------------------------*
+ * NV extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_NV_coverage_sample */
+#ifndef GL_NV_coverage_sample
+#define GL_COVERAGE_COMPONENT_NV 0x8ED0
+#define GL_COVERAGE_COMPONENT4_NV 0x8ED1
+#define GL_COVERAGE_ATTACHMENT_NV 0x8ED2
+#define GL_COVERAGE_BUFFERS_NV 0x8ED3
+#define GL_COVERAGE_SAMPLES_NV 0x8ED4
+#define GL_COVERAGE_ALL_FRAGMENTS_NV 0x8ED5
+#define GL_COVERAGE_EDGE_FRAGMENTS_NV 0x8ED6
+#define GL_COVERAGE_AUTOMATIC_NV 0x8ED7
+#define GL_COVERAGE_BUFFER_BIT_NV 0x8000
+#endif
+
+/* GL_NV_depth_nonlinear */
+#ifndef GL_NV_depth_nonlinear
+#define GL_DEPTH_COMPONENT16_NONLINEAR_NV 0x8E2C
+#endif
+
+/* GL_NV_draw_buffers */
+#ifndef GL_NV_draw_buffers
+#define GL_MAX_DRAW_BUFFERS_NV 0x8824
+#define GL_DRAW_BUFFER0_NV 0x8825
+#define GL_DRAW_BUFFER1_NV 0x8826
+#define GL_DRAW_BUFFER2_NV 0x8827
+#define GL_DRAW_BUFFER3_NV 0x8828
+#define GL_DRAW_BUFFER4_NV 0x8829
+#define GL_DRAW_BUFFER5_NV 0x882A
+#define GL_DRAW_BUFFER6_NV 0x882B
+#define GL_DRAW_BUFFER7_NV 0x882C
+#define GL_DRAW_BUFFER8_NV 0x882D
+#define GL_DRAW_BUFFER9_NV 0x882E
+#define GL_DRAW_BUFFER10_NV 0x882F
+#define GL_DRAW_BUFFER11_NV 0x8830
+#define GL_DRAW_BUFFER12_NV 0x8831
+#define GL_DRAW_BUFFER13_NV 0x8832
+#define GL_DRAW_BUFFER14_NV 0x8833
+#define GL_DRAW_BUFFER15_NV 0x8834
+#define GL_COLOR_ATTACHMENT0_NV 0x8CE0
+#define GL_COLOR_ATTACHMENT1_NV 0x8CE1
+#define GL_COLOR_ATTACHMENT2_NV 0x8CE2
+#define GL_COLOR_ATTACHMENT3_NV 0x8CE3
+#define GL_COLOR_ATTACHMENT4_NV 0x8CE4
+#define GL_COLOR_ATTACHMENT5_NV 0x8CE5
+#define GL_COLOR_ATTACHMENT6_NV 0x8CE6
+#define GL_COLOR_ATTACHMENT7_NV 0x8CE7
+#define GL_COLOR_ATTACHMENT8_NV 0x8CE8
+#define GL_COLOR_ATTACHMENT9_NV 0x8CE9
+#define GL_COLOR_ATTACHMENT10_NV 0x8CEA
+#define GL_COLOR_ATTACHMENT11_NV 0x8CEB
+#define GL_COLOR_ATTACHMENT12_NV 0x8CEC
+#define GL_COLOR_ATTACHMENT13_NV 0x8CED
+#define GL_COLOR_ATTACHMENT14_NV 0x8CEE
+#define GL_COLOR_ATTACHMENT15_NV 0x8CEF
+#endif
+
+/* GL_NV_fbo_color_attachments */
+#ifndef GL_NV_fbo_color_attachments
+#define GL_MAX_COLOR_ATTACHMENTS_NV 0x8CDF
+/* GL_COLOR_ATTACHMENT{0-15}_NV defined in GL_NV_draw_buffers already. */
+#endif
+
+/* GL_NV_fence */
+#ifndef GL_NV_fence
+#define GL_ALL_COMPLETED_NV 0x84F2
+#define GL_FENCE_STATUS_NV 0x84F3
+#define GL_FENCE_CONDITION_NV 0x84F4
+#endif
+
+/* GL_NV_read_buffer */
+#ifndef GL_NV_read_buffer
+#define GL_READ_BUFFER_NV 0x0C02
+#endif
+
+/* GL_NV_read_buffer_front */
+/* No new tokens introduced by this extension. */
+
+/* GL_NV_read_depth */
+/* No new tokens introduced by this extension. */
+
+/* GL_NV_read_depth_stencil */
+/* No new tokens introduced by this extension. */
+
+/* GL_NV_read_stencil */
+/* No new tokens introduced by this extension. */
+
+/* GL_NV_texture_compression_s3tc_update */
+/* No new tokens introduced by this extension. */
+
+/* GL_NV_texture_npot_2D_mipmap */
+/* No new tokens introduced by this extension. */
+
+/*------------------------------------------------------------------------*
+ * QCOM extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_QCOM_alpha_test */
+#ifndef GL_QCOM_alpha_test
+#define GL_ALPHA_TEST_QCOM 0x0BC0
+#define GL_ALPHA_TEST_FUNC_QCOM 0x0BC1
+#define GL_ALPHA_TEST_REF_QCOM 0x0BC2
+#endif
+
+/* GL_QCOM_driver_control */
+/* No new tokens introduced by this extension. */
+
+/* GL_QCOM_extended_get */
+#ifndef GL_QCOM_extended_get
+#define GL_TEXTURE_WIDTH_QCOM 0x8BD2
+#define GL_TEXTURE_HEIGHT_QCOM 0x8BD3
+#define GL_TEXTURE_DEPTH_QCOM 0x8BD4
+#define GL_TEXTURE_INTERNAL_FORMAT_QCOM 0x8BD5
+#define GL_TEXTURE_FORMAT_QCOM 0x8BD6
+#define GL_TEXTURE_TYPE_QCOM 0x8BD7
+#define GL_TEXTURE_IMAGE_VALID_QCOM 0x8BD8
+#define GL_TEXTURE_NUM_LEVELS_QCOM 0x8BD9
+#define GL_TEXTURE_TARGET_QCOM 0x8BDA
+#define GL_TEXTURE_OBJECT_VALID_QCOM 0x8BDB
+#define GL_STATE_RESTORE 0x8BDC
+#endif
+
+/* GL_QCOM_extended_get2 */
+/* No new tokens introduced by this extension. */
+
+/* GL_QCOM_perfmon_global_mode */
+#ifndef GL_QCOM_perfmon_global_mode
+#define GL_PERFMON_GLOBAL_MODE_QCOM 0x8FA0
+#endif
+
+/* GL_QCOM_writeonly_rendering */
+#ifndef GL_QCOM_writeonly_rendering
+#define GL_WRITEONLY_RENDERING_QCOM 0x8823
+#endif
+
+/* GL_QCOM_tiled_rendering */
+#ifndef GL_QCOM_tiled_rendering
+#define GL_COLOR_BUFFER_BIT0_QCOM 0x00000001
+#define GL_COLOR_BUFFER_BIT1_QCOM 0x00000002
+#define GL_COLOR_BUFFER_BIT2_QCOM 0x00000004
+#define GL_COLOR_BUFFER_BIT3_QCOM 0x00000008
+#define GL_COLOR_BUFFER_BIT4_QCOM 0x00000010
+#define GL_COLOR_BUFFER_BIT5_QCOM 0x00000020
+#define GL_COLOR_BUFFER_BIT6_QCOM 0x00000040
+#define GL_COLOR_BUFFER_BIT7_QCOM 0x00000080
+#define GL_DEPTH_BUFFER_BIT0_QCOM 0x00000100
+#define GL_DEPTH_BUFFER_BIT1_QCOM 0x00000200
+#define GL_DEPTH_BUFFER_BIT2_QCOM 0x00000400
+#define GL_DEPTH_BUFFER_BIT3_QCOM 0x00000800
+#define GL_DEPTH_BUFFER_BIT4_QCOM 0x00001000
+#define GL_DEPTH_BUFFER_BIT5_QCOM 0x00002000
+#define GL_DEPTH_BUFFER_BIT6_QCOM 0x00004000
+#define GL_DEPTH_BUFFER_BIT7_QCOM 0x00008000
+#define GL_STENCIL_BUFFER_BIT0_QCOM 0x00010000
+#define GL_STENCIL_BUFFER_BIT1_QCOM 0x00020000
+#define GL_STENCIL_BUFFER_BIT2_QCOM 0x00040000
+#define GL_STENCIL_BUFFER_BIT3_QCOM 0x00080000
+#define GL_STENCIL_BUFFER_BIT4_QCOM 0x00100000
+#define GL_STENCIL_BUFFER_BIT5_QCOM 0x00200000
+#define GL_STENCIL_BUFFER_BIT6_QCOM 0x00400000
+#define GL_STENCIL_BUFFER_BIT7_QCOM 0x00800000
+#define GL_MULTISAMPLE_BUFFER_BIT0_QCOM 0x01000000
+#define GL_MULTISAMPLE_BUFFER_BIT1_QCOM 0x02000000
+#define GL_MULTISAMPLE_BUFFER_BIT2_QCOM 0x04000000
+#define GL_MULTISAMPLE_BUFFER_BIT3_QCOM 0x08000000
+#define GL_MULTISAMPLE_BUFFER_BIT4_QCOM 0x10000000
+#define GL_MULTISAMPLE_BUFFER_BIT5_QCOM 0x20000000
+#define GL_MULTISAMPLE_BUFFER_BIT6_QCOM 0x40000000
+#define GL_MULTISAMPLE_BUFFER_BIT7_QCOM 0x80000000
+#endif
+
+/*------------------------------------------------------------------------*
+ * VIV extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_VIV_shader_binary */
+#ifndef GL_VIV_shader_binary
+#define GL_SHADER_BINARY_VIV 0x8FC4
+#endif
+
+/*------------------------------------------------------------------------*
+ * End of extension tokens, start of corresponding extension functions
+ *------------------------------------------------------------------------*/
+
+/*------------------------------------------------------------------------*
+ * OES extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_OES_compressed_ETC1_RGB8_texture */
+#ifndef GL_OES_compressed_ETC1_RGB8_texture
+#define GL_OES_compressed_ETC1_RGB8_texture 1
+#endif
+
+/* GL_OES_compressed_paletted_texture */
+#ifndef GL_OES_compressed_paletted_texture
+#define GL_OES_compressed_paletted_texture 1
+#endif
+
+/* GL_OES_depth24 */
+#ifndef GL_OES_depth24
+#define GL_OES_depth24 1
+#endif
+
+/* GL_OES_depth32 */
+#ifndef GL_OES_depth32
+#define GL_OES_depth32 1
+#endif
+
+/* GL_OES_depth_texture */
+#ifndef GL_OES_depth_texture
+#define GL_OES_depth_texture 1
+#endif
+
+/* GL_OES_EGL_image */
+#ifndef GL_OES_EGL_image
+#define GL_OES_EGL_image 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image);
+GL_APICALL void GL_APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image);
+#endif
+typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image);
+typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image);
+#endif
+
+/* GL_OES_EGL_image_external */
+#ifndef GL_OES_EGL_image_external
+#define GL_OES_EGL_image_external 1
+/* glEGLImageTargetTexture2DOES defined in GL_OES_EGL_image already. */
+#endif
+
+/* GL_OES_element_index_uint */
+#ifndef GL_OES_element_index_uint
+#define GL_OES_element_index_uint 1
+#endif
+
+/* GL_OES_fbo_render_mipmap */
+#ifndef GL_OES_fbo_render_mipmap
+#define GL_OES_fbo_render_mipmap 1
+#endif
+
+/* GL_OES_fragment_precision_high */
+#ifndef GL_OES_fragment_precision_high
+#define GL_OES_fragment_precision_high 1
+#endif
+
+/* GL_OES_get_program_binary */
+#ifndef GL_OES_get_program_binary
+#define GL_OES_get_program_binary 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glGetProgramBinaryOES (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary);
+GL_APICALL void GL_APIENTRY glProgramBinaryOES (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length);
+#endif
+typedef void (GL_APIENTRYP PFNGLGETPROGRAMBINARYOESPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary);
+typedef void (GL_APIENTRYP PFNGLPROGRAMBINARYOESPROC) (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length);
+#endif
+
+/* GL_OES_mapbuffer */
+#ifndef GL_OES_mapbuffer
+#define GL_OES_mapbuffer 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void* GL_APIENTRY glMapBufferOES (GLenum target, GLenum access);
+GL_APICALL GLboolean GL_APIENTRY glUnmapBufferOES (GLenum target);
+GL_APICALL void GL_APIENTRY glGetBufferPointervOES (GLenum target, GLenum pname, GLvoid** params);
+#endif
+typedef void* (GL_APIENTRYP PFNGLMAPBUFFEROESPROC) (GLenum target, GLenum access);
+typedef GLboolean (GL_APIENTRYP PFNGLUNMAPBUFFEROESPROC) (GLenum target);
+typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum pname, GLvoid** params);
+#endif
+
+/* GL_OES_packed_depth_stencil */
+#ifndef GL_OES_packed_depth_stencil
+#define GL_OES_packed_depth_stencil 1
+#endif
+
+/* GL_OES_rgb8_rgba8 */
+#ifndef GL_OES_rgb8_rgba8
+#define GL_OES_rgb8_rgba8 1
+#endif
+
+/* GL_OES_standard_derivatives */
+#ifndef GL_OES_standard_derivatives
+#define GL_OES_standard_derivatives 1
+#endif
+
+/* GL_OES_stencil1 */
+#ifndef GL_OES_stencil1
+#define GL_OES_stencil1 1
+#endif
+
+/* GL_OES_stencil4 */
+#ifndef GL_OES_stencil4
+#define GL_OES_stencil4 1
+#endif
+
+/* GL_OES_texture_3D */
+#ifndef GL_OES_texture_3D
+#define GL_OES_texture_3D 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
+GL_APICALL void GL_APIENTRY glTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels);
+GL_APICALL void GL_APIENTRY glCopyTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glCompressedTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data);
+GL_APICALL void GL_APIENTRY glCompressedTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data);
+GL_APICALL void GL_APIENTRY glFramebufferTexture3DOES (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+#endif
+typedef void (GL_APIENTRYP PFNGLTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
+typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels);
+typedef void (GL_APIENTRYP PFNGLCOPYTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data);
+typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data);
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DOES) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+#endif
+
+/* GL_OES_texture_float */
+#ifndef GL_OES_texture_float
+#define GL_OES_texture_float 1
+#endif
+
+/* GL_OES_texture_float_linear */
+#ifndef GL_OES_texture_float_linear
+#define GL_OES_texture_float_linear 1
+#endif
+
+/* GL_OES_texture_half_float */
+#ifndef GL_OES_texture_half_float
+#define GL_OES_texture_half_float 1
+#endif
+
+/* GL_OES_texture_half_float_linear */
+#ifndef GL_OES_texture_half_float_linear
+#define GL_OES_texture_half_float_linear 1
+#endif
+
+/* GL_OES_texture_npot */
+#ifndef GL_OES_texture_npot
+#define GL_OES_texture_npot 1
+#endif
+
+/* GL_OES_vertex_array_object */
+#ifndef GL_OES_vertex_array_object
+#define GL_OES_vertex_array_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glBindVertexArrayOES (GLuint array);
+GL_APICALL void GL_APIENTRY glDeleteVertexArraysOES (GLsizei n, const GLuint *arrays);
+GL_APICALL void GL_APIENTRY glGenVertexArraysOES (GLsizei n, GLuint *arrays);
+GL_APICALL GLboolean GL_APIENTRY glIsVertexArrayOES (GLuint array);
+#endif
+typedef void (GL_APIENTRYP PFNGLBINDVERTEXARRAYOESPROC) (GLuint array);
+typedef void (GL_APIENTRYP PFNGLDELETEVERTEXARRAYSOESPROC) (GLsizei n, const GLuint *arrays);
+typedef void (GL_APIENTRYP PFNGLGENVERTEXARRAYSOESPROC) (GLsizei n, GLuint *arrays);
+typedef GLboolean (GL_APIENTRYP PFNGLISVERTEXARRAYOESPROC) (GLuint array);
+#endif
+
+/* GL_OES_vertex_half_float */
+#ifndef GL_OES_vertex_half_float
+#define GL_OES_vertex_half_float 1
+#endif
+
+/* GL_OES_vertex_type_10_10_10_2 */
+#ifndef GL_OES_vertex_type_10_10_10_2
+#define GL_OES_vertex_type_10_10_10_2 1
+#endif
+
+/*------------------------------------------------------------------------*
+ * AMD extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_AMD_compressed_3DC_texture */
+#ifndef GL_AMD_compressed_3DC_texture
+#define GL_AMD_compressed_3DC_texture 1
+#endif
+
+/* GL_AMD_compressed_ATC_texture */
+#ifndef GL_AMD_compressed_ATC_texture
+#define GL_AMD_compressed_ATC_texture 1
+#endif
+
+/* AMD_performance_monitor */
+#ifndef GL_AMD_performance_monitor
+#define GL_AMD_performance_monitor 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glGetPerfMonitorGroupsAMD (GLint *numGroups, GLsizei groupsSize, GLuint *groups);
+GL_APICALL void GL_APIENTRY glGetPerfMonitorCountersAMD (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters);
+GL_APICALL void GL_APIENTRY glGetPerfMonitorGroupStringAMD (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString);
+GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterStringAMD (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString);
+GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint group, GLuint counter, GLenum pname, GLvoid *data);
+GL_APICALL void GL_APIENTRY glGenPerfMonitorsAMD (GLsizei n, GLuint *monitors);
+GL_APICALL void GL_APIENTRY glDeletePerfMonitorsAMD (GLsizei n, GLuint *monitors);
+GL_APICALL void GL_APIENTRY glSelectPerfMonitorCountersAMD (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList);
+GL_APICALL void GL_APIENTRY glBeginPerfMonitorAMD (GLuint monitor);
+GL_APICALL void GL_APIENTRY glEndPerfMonitorAMD (GLuint monitor);
+GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterDataAMD (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten);
+#endif
+typedef void (GL_APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups);
+typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters);
+typedef void (GL_APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString);
+typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString);
+typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, GLvoid *data);
+typedef void (GL_APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors);
+typedef void (GL_APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors);
+typedef void (GL_APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList);
+typedef void (GL_APIENTRYP PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor);
+typedef void (GL_APIENTRYP PFNGLENDPERFMONITORAMDPROC) (GLuint monitor);
+typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten);
+#endif
+
+/* GL_AMD_program_binary_Z400 */
+#ifndef GL_AMD_program_binary_Z400
+#define GL_AMD_program_binary_Z400 1
+#endif
+
+/*------------------------------------------------------------------------*
+ * ANGLE extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_ANGLE_framebuffer_blit */
+#ifndef GL_ANGLE_framebuffer_blit
+#define GL_ANGLE_framebuffer_blit 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glBlitFramebufferANGLE (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+#endif
+typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERANGLEPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+#endif
+
+/* GL_ANGLE_framebuffer_multisample */
+#ifndef GL_ANGLE_framebuffer_multisample
+#define GL_ANGLE_framebuffer_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleANGLE (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+#endif
+typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+#endif
+
+/*------------------------------------------------------------------------*
+ * APPLE extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_APPLE_rgb_422 */
+#ifndef GL_APPLE_rgb_422
+#define GL_APPLE_rgb_422 1
+#endif
+
+/* GL_APPLE_framebuffer_multisample */
+#ifndef GL_APPLE_framebuffer_multisample
+#define GL_APPLE_framebuffer_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleAPPLE (GLenum, GLsizei, GLenum, GLsizei, GLsizei);
+GL_APICALL void GL_APIENTRY glResolveMultisampleFramebufferAPPLE (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC) (void);
+#endif
+
+/* GL_APPLE_texture_format_BGRA8888 */
+#ifndef GL_APPLE_texture_format_BGRA8888
+#define GL_APPLE_texture_format_BGRA8888 1
+#endif
+
+/* GL_APPLE_texture_max_level */
+#ifndef GL_APPLE_texture_max_level
+#define GL_APPLE_texture_max_level 1
+#endif
+
+/*------------------------------------------------------------------------*
+ * ARM extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_ARM_mali_shader_binary */
+#ifndef GL_ARM_mali_shader_binary
+#define GL_ARM_mali_shader_binary 1
+#endif
+
+/* GL_ARM_rgba8 */
+#ifndef GL_ARM_rgba8
+#define GL_ARM_rgba8 1
+#endif
+
+/*------------------------------------------------------------------------*
+ * EXT extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_EXT_blend_minmax */
+#ifndef GL_EXT_blend_minmax
+#define GL_EXT_blend_minmax 1
+#endif
+
+/* GL_EXT_discard_framebuffer */
+#ifndef GL_EXT_discard_framebuffer
+#define GL_EXT_discard_framebuffer 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glDiscardFramebufferEXT (GLenum target, GLsizei numAttachments, const GLenum *attachments);
+#endif
+typedef void (GL_APIENTRYP PFNGLDISCARDFRAMEBUFFEREXTPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments);
+#endif
+
+#ifndef GL_EXT_multi_draw_arrays
+#define GL_EXT_multi_draw_arrays 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glMultiDrawArraysEXT (GLenum, GLint *, GLsizei *, GLsizei);
+GL_APICALL void GL_APIENTRY glMultiDrawElementsEXT (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
+typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
+#endif
+
+/* GL_EXT_read_format_bgra */
+#ifndef GL_EXT_read_format_bgra
+#define GL_EXT_read_format_bgra 1
+#endif
+
+/* GL_EXT_shader_texture_lod */
+#ifndef GL_EXT_shader_texture_lod
+#define GL_EXT_shader_texture_lod 1
+#endif
+
+/* GL_EXT_texture_filter_anisotropic */
+#ifndef GL_EXT_texture_filter_anisotropic
+#define GL_EXT_texture_filter_anisotropic 1
+#endif
+
+/* GL_EXT_texture_format_BGRA8888 */
+#ifndef GL_EXT_texture_format_BGRA8888
+#define GL_EXT_texture_format_BGRA8888 1
+#endif
+
+/* GL_EXT_texture_type_2_10_10_10_REV */
+#ifndef GL_EXT_texture_type_2_10_10_10_REV
+#define GL_EXT_texture_type_2_10_10_10_REV 1
+#endif
+
+/* GL_EXT_texture_compression_dxt1 */
+#ifndef GL_EXT_texture_compression_dxt1
+#define GL_EXT_texture_compression_dxt1 1
+#endif
+
+/* GL_EXT_unpack_subimage */
+#ifndef GL_EXT_unpack_subimage
+#define GL_EXT_unpack_subimage 1
+#endif
+
+/*------------------------------------------------------------------------*
+ * DMP extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_DMP_shader_binary */
+#ifndef GL_DMP_shader_binary
+#define GL_DMP_shader_binary 1
+#endif
+
+/*------------------------------------------------------------------------*
+ * IMG extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_IMG_program_binary */
+#ifndef GL_IMG_program_binary
+#define GL_IMG_program_binary 1
+#endif
+
+/* GL_IMG_read_format */
+#ifndef GL_IMG_read_format
+#define GL_IMG_read_format 1
+#endif
+
+/* GL_IMG_shader_binary */
+#ifndef GL_IMG_shader_binary
+#define GL_IMG_shader_binary 1
+#endif
+
+/* GL_IMG_texture_compression_pvrtc */
+#ifndef GL_IMG_texture_compression_pvrtc
+#define GL_IMG_texture_compression_pvrtc 1
+#endif
+
+/* GL_IMG_multisampled_render_to_texture */
+#ifndef GL_IMG_multisampled_render_to_texture
+#define GL_IMG_multisampled_render_to_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleIMG (GLenum, GLsizei, GLenum, GLsizei, GLsizei);
+GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleIMG (GLenum, GLenum, GLenum, GLuint, GLint, GLsizei);
+#endif
+typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMG) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMG) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
+#endif
+
+/*------------------------------------------------------------------------*
+ * NV extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_NV_coverage_sample */
+#ifndef GL_NV_coverage_sample
+#define GL_NV_coverage_sample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glCoverageMaskNV (GLboolean mask);
+GL_APICALL void GL_APIENTRY glCoverageOperationNV (GLenum operation);
+#endif
+typedef void (GL_APIENTRYP PFNGLCOVERAGEMASKNVPROC) (GLboolean mask);
+typedef void (GL_APIENTRYP PFNGLCOVERAGEOPERATIONNVPROC) (GLenum operation);
+#endif
+
+/* GL_NV_depth_nonlinear */
+#ifndef GL_NV_depth_nonlinear
+#define GL_NV_depth_nonlinear 1
+#endif
+
+/* GL_NV_draw_buffers */
+#ifndef GL_NV_draw_buffers
+#define GL_NV_draw_buffers 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glDrawBuffersNV (GLsizei n, const GLenum *bufs);
+#endif
+typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSNVPROC) (GLsizei n, const GLenum *bufs);
+#endif
+
+/* GL_NV_fbo_color_attachments */
+#ifndef GL_NV_fbo_color_attachments
+#define GL_NV_fbo_color_attachments 1
+#endif
+
+/* GL_NV_fence */
+#ifndef GL_NV_fence
+#define GL_NV_fence 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glDeleteFencesNV (GLsizei, const GLuint *);
+GL_APICALL void GL_APIENTRY glGenFencesNV (GLsizei, GLuint *);
+GL_APICALL GLboolean GL_APIENTRY glIsFenceNV (GLuint);
+GL_APICALL GLboolean GL_APIENTRY glTestFenceNV (GLuint);
+GL_APICALL void GL_APIENTRY glGetFenceivNV (GLuint, GLenum, GLint *);
+GL_APICALL void GL_APIENTRY glFinishFenceNV (GLuint);
+GL_APICALL void GL_APIENTRY glSetFenceNV (GLuint, GLenum);
+#endif
+typedef void (GL_APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences);
+typedef void (GL_APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences);
+typedef GLboolean (GL_APIENTRYP PFNGLISFENCENVPROC) (GLuint fence);
+typedef GLboolean (GL_APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence);
+typedef void (GL_APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence);
+typedef void (GL_APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition);
+#endif
+
+/* GL_NV_read_buffer */
+#ifndef GL_NV_read_buffer
+#define GL_NV_read_buffer 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glReadBufferNV (GLenum mode);
+#endif
+typedef void (GL_APIENTRYP PFNGLREADBUFFERNVPROC) (GLenum mode);
+#endif
+
+/* GL_NV_read_buffer_front */
+#ifndef GL_NV_read_buffer_front
+#define GL_NV_read_buffer_front 1
+#endif
+
+/* GL_NV_read_depth */
+#ifndef GL_NV_read_depth
+#define GL_NV_read_depth 1
+#endif
+
+/* GL_NV_read_depth_stencil */
+#ifndef GL_NV_read_depth_stencil
+#define GL_NV_read_depth_stencil 1
+#endif
+
+/* GL_NV_read_stencil */
+#ifndef GL_NV_read_stencil
+#define GL_NV_read_stencil 1
+#endif
+
+/* GL_NV_texture_compression_s3tc_update */
+#ifndef GL_NV_texture_compression_s3tc_update
+#define GL_NV_texture_compression_s3tc_update 1
+#endif
+
+/* GL_NV_texture_npot_2D_mipmap */
+#ifndef GL_NV_texture_npot_2D_mipmap
+#define GL_NV_texture_npot_2D_mipmap 1
+#endif
+
+/*------------------------------------------------------------------------*
+ * QCOM extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_QCOM_alpha_test */
+#ifndef GL_QCOM_alpha_test
+#define GL_QCOM_alpha_test 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glAlphaFuncQCOM (GLenum func, GLclampf ref);
+#endif
+typedef void (GL_APIENTRYP PFNGLALPHAFUNCQCOMPROC) (GLenum func, GLclampf ref);
+#endif
+
+/* GL_QCOM_driver_control */
+#ifndef GL_QCOM_driver_control
+#define GL_QCOM_driver_control 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glGetDriverControlsQCOM (GLint *num, GLsizei size, GLuint *driverControls);
+GL_APICALL void GL_APIENTRY glGetDriverControlStringQCOM (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString);
+GL_APICALL void GL_APIENTRY glEnableDriverControlQCOM (GLuint driverControl);
+GL_APICALL void GL_APIENTRY glDisableDriverControlQCOM (GLuint driverControl);
+#endif
+typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSQCOMPROC) (GLint *num, GLsizei size, GLuint *driverControls);
+typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSTRINGQCOMPROC) (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString);
+typedef void (GL_APIENTRYP PFNGLENABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl);
+typedef void (GL_APIENTRYP PFNGLDISABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl);
+#endif
+
+/* GL_QCOM_extended_get */
+#ifndef GL_QCOM_extended_get
+#define GL_QCOM_extended_get 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glExtGetTexturesQCOM (GLuint *textures, GLint maxTextures, GLint *numTextures);
+GL_APICALL void GL_APIENTRY glExtGetBuffersQCOM (GLuint *buffers, GLint maxBuffers, GLint *numBuffers);
+GL_APICALL void GL_APIENTRY glExtGetRenderbuffersQCOM (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers);
+GL_APICALL void GL_APIENTRY glExtGetFramebuffersQCOM (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers);
+GL_APICALL void GL_APIENTRY glExtGetTexLevelParameterivQCOM (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glExtTexObjectStateOverrideiQCOM (GLenum target, GLenum pname, GLint param);
+GL_APICALL void GL_APIENTRY glExtGetTexSubImageQCOM (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels);
+GL_APICALL void GL_APIENTRY glExtGetBufferPointervQCOM (GLenum target, GLvoid **params);
+#endif
+typedef void (GL_APIENTRYP PFNGLEXTGETTEXTURESQCOMPROC) (GLuint *textures, GLint maxTextures, GLint *numTextures);
+typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERSQCOMPROC) (GLuint *buffers, GLint maxBuffers, GLint *numBuffers);
+typedef void (GL_APIENTRYP PFNGLEXTGETRENDERBUFFERSQCOMPROC) (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers);
+typedef void (GL_APIENTRYP PFNGLEXTGETFRAMEBUFFERSQCOMPROC) (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers);
+typedef void (GL_APIENTRYP PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC) (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC) (GLenum target, GLenum pname, GLint param);
+typedef void (GL_APIENTRYP PFNGLEXTGETTEXSUBIMAGEQCOMPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels);
+typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERPOINTERVQCOMPROC) (GLenum target, GLvoid **params);
+#endif
+
+/* GL_QCOM_extended_get2 */
+#ifndef GL_QCOM_extended_get2
+#define GL_QCOM_extended_get2 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glExtGetShadersQCOM (GLuint *shaders, GLint maxShaders, GLint *numShaders);
+GL_APICALL void GL_APIENTRY glExtGetProgramsQCOM (GLuint *programs, GLint maxPrograms, GLint *numPrograms);
+GL_APICALL GLboolean GL_APIENTRY glExtIsProgramBinaryQCOM (GLuint program);
+GL_APICALL void GL_APIENTRY glExtGetProgramBinarySourceQCOM (GLuint program, GLenum shadertype, GLchar *source, GLint *length);
+#endif
+typedef void (GL_APIENTRYP PFNGLEXTGETSHADERSQCOMPROC) (GLuint *shaders, GLint maxShaders, GLint *numShaders);
+typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMSQCOMPROC) (GLuint *programs, GLint maxPrograms, GLint *numPrograms);
+typedef GLboolean (GL_APIENTRYP PFNGLEXTISPROGRAMBINARYQCOMPROC) (GLuint program);
+typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC) (GLuint program, GLenum shadertype, GLchar *source, GLint *length);
+#endif
+
+/* GL_QCOM_perfmon_global_mode */
+#ifndef GL_QCOM_perfmon_global_mode
+#define GL_QCOM_perfmon_global_mode 1
+#endif
+
+/* GL_QCOM_writeonly_rendering */
+#ifndef GL_QCOM_writeonly_rendering
+#define GL_QCOM_writeonly_rendering 1
+#endif
+
+/* GL_QCOM_tiled_rendering */
+#ifndef GL_QCOM_tiled_rendering
+#define GL_QCOM_tiled_rendering 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glStartTilingQCOM (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask);
+GL_APICALL void GL_APIENTRY glEndTilingQCOM (GLbitfield preserveMask);
+#endif
+typedef void (GL_APIENTRYP PFNGLSTARTTILINGQCOMPROC) (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask);
+typedef void (GL_APIENTRYP PFNGLENDTILINGQCOMPROC) (GLbitfield preserveMask);
+#endif
+
+/*------------------------------------------------------------------------*
+ * VIV extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_VIV_shader_binary */
+#ifndef GL_VIV_shader_binary
+#define GL_VIV_shader_binary 1
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __gl2ext_h_ */
diff --git a/hw/yagl/yagl_inc/GLES2/gl2platform.h b/hw/yagl/yagl_inc/GLES2/gl2platform.h
new file mode 100644
index 0000000000..c9fa3c4d64
--- /dev/null
+++ b/hw/yagl/yagl_inc/GLES2/gl2platform.h
@@ -0,0 +1,30 @@
+#ifndef __gl2platform_h_
+#define __gl2platform_h_
+
+/* $Revision: 10602 $ on $Date:: 2010-03-04 22:35:34 -0800 #$ */
+
+/*
+ * This document is licensed under the SGI Free Software B License Version
+ * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
+ */
+
+/* Platform-specific types and definitions for OpenGL ES 2.X gl2.h
+ *
+ * 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
+ * they can be included in future versions of this file. Please submit changes
+ * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
+ * by filing a bug against product "OpenGL-ES" component "Registry".
+ */
+
+#include <KHR/khrplatform.h>
+
+#ifndef GL_APICALL
+#define GL_APICALL KHRONOS_APICALL
+#endif
+
+#ifndef GL_APIENTRY
+#define GL_APIENTRY KHRONOS_APIENTRY
+#endif
+
+#endif /* __gl2platform_h_ */
diff --git a/hw/yagl/yagl_inc/KHR/khrplatform.h b/hw/yagl/yagl_inc/KHR/khrplatform.h
new file mode 100644
index 0000000000..447953940e
--- /dev/null
+++ b/hw/yagl/yagl_inc/KHR/khrplatform.h
@@ -0,0 +1,277 @@
+#ifndef __khrplatform_h_
+#define __khrplatform_h_
+
+/*
+** Copyright (c) 2008-2009 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
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+
+/* Khronos platform-specific types and definitions.
+ *
+ * $Revision: 9356 $ on $Date: 2009-10-21 02:52:25 -0700 (Wed, 21 Oct 2009) $
+ *
+ * Adopters may modify this file to suit their platform. Adopters are
+ * encouraged to submit platform specific modifications to the Khronos
+ * group so that they can be included in future versions of this file.
+ * Please submit changes by sending them to the public Khronos Bugzilla
+ * (http://khronos.org/bugzilla) by filing a bug against product
+ * "Khronos (general)" component "Registry".
+ *
+ * A predefined template which fills in some of the bug fields can be
+ * reached using http://tinyurl.com/khrplatform-h-bugreport, but you
+ * must create a Bugzilla login first.
+ *
+ *
+ * See the Implementer's Guidelines for information about where this file
+ * should be located on your system and for more details of its use:
+ * http://www.khronos.org/registry/implementers_guide.pdf
+ *
+ * This file should be included as
+ * #include <KHR/khrplatform.h>
+ * by Khronos client API header files that use its types and defines.
+ *
+ * The types in khrplatform.h should only be used to define API-specific types.
+ *
+ * Types defined in khrplatform.h:
+ * khronos_int8_t signed 8 bit
+ * khronos_uint8_t unsigned 8 bit
+ * khronos_int16_t signed 16 bit
+ * khronos_uint16_t unsigned 16 bit
+ * khronos_int32_t signed 32 bit
+ * khronos_uint32_t unsigned 32 bit
+ * khronos_int64_t signed 64 bit
+ * khronos_uint64_t unsigned 64 bit
+ * khronos_intptr_t signed same number of bits as a pointer
+ * khronos_uintptr_t unsigned same number of bits as a pointer
+ * khronos_ssize_t signed size
+ * khronos_usize_t unsigned size
+ * khronos_float_t signed 32 bit floating point
+ * khronos_time_ns_t unsigned 64 bit time in nanoseconds
+ * khronos_utime_nanoseconds_t unsigned time interval or absolute time in
+ * nanoseconds
+ * khronos_stime_nanoseconds_t signed time interval in nanoseconds
+ * khronos_boolean_enum_t enumerated boolean type. This should
+ * only be used as a base type when a client API's boolean type is
+ * an enum. Client APIs which use an integer or other type for
+ * booleans cannot use this as the base type for their boolean.
+ *
+ * Tokens defined in khrplatform.h:
+ *
+ * KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values.
+ *
+ * KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0.
+ * KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0.
+ *
+ * Calling convention macros defined in this file:
+ * KHRONOS_APICALL
+ * KHRONOS_APIENTRY
+ * KHRONOS_APIATTRIBUTES
+ *
+ * These may be used in function prototypes as:
+ *
+ * KHRONOS_APICALL void KHRONOS_APIENTRY funcname(
+ * int arg1,
+ * int arg2) KHRONOS_APIATTRIBUTES;
+ */
+
+/*-------------------------------------------------------------------------
+ * Definition of KHRONOS_APICALL
+ *-------------------------------------------------------------------------
+ * 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
+#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
+
+/*-------------------------------------------------------------------------
+ * Definition of KHRONOS_APIENTRY
+ *-------------------------------------------------------------------------
+ * This follows the return type of the function and precedes the function
+ * name in the function prototype.
+ */
+#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__)
+ /* Win32 but not WinCE */
+# define KHRONOS_APIENTRY __stdcall
+#else
+# define KHRONOS_APIENTRY
+#endif
+
+/*-------------------------------------------------------------------------
+ * Definition of KHRONOS_APIATTRIBUTES
+ *-------------------------------------------------------------------------
+ * This follows the closing parenthesis of the function prototype arguments.
+ */
+#if defined (__ARMCC_2__)
+#define KHRONOS_APIATTRIBUTES __softfp
+#else
+#define KHRONOS_APIATTRIBUTES
+#endif
+
+/*-------------------------------------------------------------------------
+ * basic type definitions
+ *-----------------------------------------------------------------------*/
+#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__)
+
+
+/*
+ * Using <stdint.h>
+ */
+#include <stdint.h>
+typedef int32_t khronos_int32_t;
+typedef uint32_t khronos_uint32_t;
+typedef int64_t khronos_int64_t;
+typedef uint64_t khronos_uint64_t;
+#define KHRONOS_SUPPORT_INT64 1
+#define KHRONOS_SUPPORT_FLOAT 1
+
+#elif defined(__VMS ) || defined(__sgi)
+
+/*
+ * Using <inttypes.h>
+ */
+#include <inttypes.h>
+typedef int32_t khronos_int32_t;
+typedef uint32_t khronos_uint32_t;
+typedef int64_t khronos_int64_t;
+typedef uint64_t khronos_uint64_t;
+#define KHRONOS_SUPPORT_INT64 1
+#define KHRONOS_SUPPORT_FLOAT 1
+
+#elif defined(_WIN32) && !defined(__SCITECH_SNAP__)
+
+/*
+ * Win32
+ */
+typedef __int32 khronos_int32_t;
+typedef unsigned __int32 khronos_uint32_t;
+typedef __int64 khronos_int64_t;
+typedef unsigned __int64 khronos_uint64_t;
+#define KHRONOS_SUPPORT_INT64 1
+#define KHRONOS_SUPPORT_FLOAT 1
+
+#elif defined(__sun__) || defined(__digital__)
+
+/*
+ * Sun or Digital
+ */
+typedef int khronos_int32_t;
+typedef unsigned int khronos_uint32_t;
+#if defined(__arch64__) || defined(_LP64)
+typedef long int khronos_int64_t;
+typedef unsigned long int khronos_uint64_t;
+#else
+typedef long long int khronos_int64_t;
+typedef unsigned long long int khronos_uint64_t;
+#endif /* __arch64__ */
+#define KHRONOS_SUPPORT_INT64 1
+#define KHRONOS_SUPPORT_FLOAT 1
+
+#elif 0
+
+/*
+ * Hypothetical platform with no float or int64 support
+ */
+typedef int khronos_int32_t;
+typedef unsigned int khronos_uint32_t;
+#define KHRONOS_SUPPORT_INT64 0
+#define KHRONOS_SUPPORT_FLOAT 0
+
+#else
+
+/*
+ * Generic fallback
+ */
+#include <stdint.h>
+typedef int32_t khronos_int32_t;
+typedef uint32_t khronos_uint32_t;
+typedef int64_t khronos_int64_t;
+typedef uint64_t khronos_uint64_t;
+#define KHRONOS_SUPPORT_INT64 1
+#define KHRONOS_SUPPORT_FLOAT 1
+
+#endif
+
+
+/*
+ * Types that are (so far) the same on all platforms
+ */
+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;
+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;
+
+#if KHRONOS_SUPPORT_FLOAT
+/*
+ * Float type
+ */
+typedef float khronos_float_t;
+#endif
+
+#if KHRONOS_SUPPORT_INT64
+/* Time types
+ *
+ * These types can be used to represent a time interval in nanoseconds or
+ * an absolute Unadjusted System Time. Unadjusted System Time is the number
+ * of nanoseconds since some arbitrary system event (e.g. since the last
+ * time the system booted). The Unadjusted System Time is an unsigned
+ * 64 bit value that wraps back to 0 every 584 years. Time intervals
+ * may be either signed or unsigned.
+ */
+typedef khronos_uint64_t khronos_utime_nanoseconds_t;
+typedef khronos_int64_t khronos_stime_nanoseconds_t;
+#endif
+
+/*
+ * Dummy value used to pad enum types to 32 bits.
+ */
+#ifndef KHRONOS_MAX_ENUM
+#define KHRONOS_MAX_ENUM 0x7FFFFFFF
+#endif
+
+/*
+ * Enumerated boolean type
+ *
+ * Values other than zero should be considered to be true. Therefore
+ * comparisons should not be made against KHRONOS_TRUE.
+ */
+typedef enum {
+ KHRONOS_FALSE = 0,
+ KHRONOS_TRUE = 1,
+ KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM
+} khronos_boolean_enum_t;
+
+#endif /* __khrplatform_h_ */
diff --git a/hw/yagl/yagl_log.c b/hw/yagl/yagl_log.c
new file mode 100644
index 0000000000..ae39b9a811
--- /dev/null
+++ b/hw/yagl/yagl_log.c
@@ -0,0 +1,581 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "yagl_log.h"
+#include <stdlib.h>
+#include <string.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <pthread.h>
+
+static const char* g_log_level_to_str[yagl_log_level_max + 1] =
+{
+ "OFF",
+ "ERROR",
+ "WARN",
+ "INFO",
+ "DEBUG",
+ "TRACE"
+};
+
+static struct
+{
+ const char* datatype;
+ const char* format;
+} g_datatype_to_format[] =
+{
+ { "EGLboolean", "%u" },
+ { "EGLenum", "0x%x" },
+ { "EGLint", "%d" },
+ { "yagl_host_handle", "%u" },
+ { "yagl_winsys_id", "%u" },
+ { "uint32_t", "%u" },
+ { "int", "%d" },
+ { "GLenum", "0x%x" },
+ { "GLuint", "%u" },
+ { "GLbitfield", "%u" },
+ { "GLclampf", "%f" },
+ { "GLfloat", "%f" },
+ { "GLint", "%d" },
+ { "GLsizei", "%d" },
+ { "GLclampx", "%d" },
+ { "GLfixed", "%d" },
+ { "GLboolean", "%" PRIu8 },
+ { "GLchar", "%" PRIi8 },
+ { "GLintptr", "%ld" },
+ { "GLsizeiptr", "%ld" },
+#if TARGET_LONG_SIZE == 4
+ { "target_ulong", "0x%X" }
+#elif TARGET_LONG_SIZE == 8
+ { "target_ulong", "0x%" PRIX64 }
+#else
+#error TARGET_LONG_SIZE undefined
+#endif
+};
+
+static yagl_log_level g_log_level = yagl_log_level_off;
+static char** g_log_facilities_match = NULL;
+static char** g_log_facilities_no_match = NULL;
+static bool g_log_func_trace = false;
+
+static const char* yagl_log_datatype_to_format(const char* type)
+{
+ unsigned int i;
+
+ if (strchr(type, '*'))
+ {
+ return "%p";
+ }
+
+ for (i = 0; i < sizeof(g_datatype_to_format)/sizeof(g_datatype_to_format[0]); ++i)
+ {
+ if (strcmp(g_datatype_to_format[i].datatype, type) == 0)
+ {
+ return g_datatype_to_format[i].format;
+ }
+ }
+
+ return NULL;
+}
+
+static void yagl_log_print_current_time(void)
+{
+ char buff[128];
+#ifdef _WIN32
+ struct tm *ptm;
+#else
+ struct tm tm;
+#endif
+ qemu_timeval tv = { 0, 0 };
+ time_t ti;
+
+ qemu_gettimeofday(&tv);
+
+ ti = tv.tv_sec;
+
+#ifdef _WIN32
+ ptm = localtime(&ti);
+ strftime(buff, sizeof(buff),
+ "%H:%M:%S", ptm);
+#else
+ localtime_r(&ti, &tm);
+ strftime(buff, sizeof(buff),
+ "%H:%M:%S", &tm);
+#endif
+ fprintf(stderr, "%s", buff);
+}
+
+/*
+ * Simple asterisk pattern matcher.
+ */
+static bool yagl_log_match(const char* str, const char* expr)
+{
+ while (*str && *expr)
+ {
+ /*
+ * Swallow '**'.
+ */
+
+ while ((*expr == '*') &&
+ (*(expr + 1) == '*'))
+ {
+ ++expr;
+ }
+
+ if (*expr == '*')
+ {
+ if (!*(expr + 1))
+ {
+ /*
+ * Last '*' always matches.
+ */
+
+ return true;
+ }
+
+ /*
+ * Search for symbol after the asterisk.
+ */
+
+ while (*str && (*str != *(expr + 1)))
+ {
+ ++str;
+ }
+
+ if (!*str)
+ {
+ /*
+ * Reached the end, didn't find symbol following asterisk,
+ * no match.
+ */
+
+ return false;
+ }
+
+ /*
+ * Jump to the symbol after the one that's after asterisk.
+ */
+
+ ++str;
+ expr += 2;
+ }
+ else
+ {
+ /*
+ * No asterisk, exact match.
+ */
+
+ if (*str != *expr)
+ {
+ return false;
+ }
+
+ ++str;
+ ++expr;
+ }
+ }
+
+ /*
+ * Remaining '*' always match.
+ */
+
+ while (*expr == '*')
+ {
+ ++expr;
+ }
+
+ return (*str == 0) && (*expr == 0);
+}
+
+void yagl_log_init(void)
+{
+ char* level_str = getenv("YAGL_DEBUG");
+ int level = level_str ? atoi(level_str) : yagl_log_level_off;
+ char* facilities;
+ char* func_trace;
+
+ if (level < 0)
+ {
+ g_log_level = yagl_log_level_off;
+ }
+ else if (level > yagl_log_level_max)
+ {
+ g_log_level = (yagl_log_level)yagl_log_level_max;
+ }
+ else
+ {
+ g_log_level = (yagl_log_level)level;
+ }
+
+ facilities = getenv("YAGL_DEBUG_FACILITIES");
+
+ if (facilities)
+ {
+ char* tmp_facilities = facilities;
+ int i = 0, num_match = 0, num_no_match = 0;
+
+ while (1)
+ {
+ char* tmp = strchr(tmp_facilities, ',');
+
+ if (!tmp)
+ {
+ break;
+ }
+
+ if (tmp - tmp_facilities > 0)
+ {
+ ++i;
+ }
+
+ tmp_facilities = tmp + 1;
+ }
+
+ if (strlen(tmp_facilities) > 0)
+ {
+ ++i;
+ }
+
+ g_log_facilities_match = g_malloc0((i + 1) * sizeof(char*));
+ g_log_facilities_no_match = g_malloc0((i + 1) * sizeof(char*));
+
+ tmp_facilities = facilities;
+
+ while (1)
+ {
+ char* tmp = strchr(tmp_facilities, ',');
+
+ if (!tmp)
+ {
+ break;
+ }
+
+ if (tmp - tmp_facilities > 0)
+ {
+ if (*tmp_facilities == '^')
+ {
+ if ((tmp - tmp_facilities - 1) > 0)
+ {
+ g_log_facilities_no_match[num_no_match] = g_strndup(tmp_facilities + 1, tmp - tmp_facilities - 1);
+ ++num_no_match;
+ }
+ }
+ else
+ {
+ g_log_facilities_match[num_match] = g_strndup(tmp_facilities, tmp - tmp_facilities);
+ ++num_match;
+ }
+ }
+
+ tmp_facilities = tmp + 1;
+ }
+
+ if (strlen(tmp_facilities) > 0)
+ {
+ if (*tmp_facilities == '^')
+ {
+ if ((strlen(tmp_facilities) - 1) > 0)
+ {
+ g_log_facilities_no_match[num_no_match] = g_strdup(tmp_facilities + 1);
+ ++num_no_match;
+ }
+ }
+ else
+ {
+ g_log_facilities_match[num_match] = g_strdup(tmp_facilities);
+ ++num_match;
+ }
+ }
+
+ g_log_facilities_no_match[num_no_match] = NULL;
+ g_log_facilities_match[num_match] = NULL;
+
+ if (!num_no_match)
+ {
+ g_free(g_log_facilities_no_match);
+ g_log_facilities_no_match = NULL;
+ }
+
+ if (!num_match)
+ {
+ g_free(g_log_facilities_match);
+ g_log_facilities_match = NULL;
+ }
+ }
+
+ func_trace = getenv("YAGL_DEBUG_FUNC_TRACE");
+
+ g_log_func_trace = func_trace ? (atoi(func_trace) > 0) : false;
+}
+
+void yagl_log_cleanup(void)
+{
+ int i;
+ g_log_level = yagl_log_level_off;
+ if (g_log_facilities_no_match)
+ {
+ for (i = 0; g_log_facilities_no_match[i]; ++i)
+ {
+ g_free(g_log_facilities_no_match[i]);
+ g_log_facilities_no_match[i] = NULL;
+ }
+ g_free(g_log_facilities_no_match);
+ g_log_facilities_no_match = NULL;
+ }
+ if (g_log_facilities_match)
+ {
+ for (i = 0; g_log_facilities_match[i]; ++i)
+ {
+ g_free(g_log_facilities_match[i]);
+ g_log_facilities_match[i] = NULL;
+ }
+ g_free(g_log_facilities_match);
+ g_log_facilities_match = NULL;
+ }
+ g_log_func_trace = 0;
+}
+
+void yagl_log_event(yagl_log_level log_level,
+ yagl_pid process_id,
+ yagl_tid thread_id,
+ const char* facility,
+ int line,
+ const char* format, ...)
+{
+ va_list args;
+
+ yagl_log_print_current_time();
+ fprintf(stderr,
+ " %-5s [%u/%u] %s:%d",
+ g_log_level_to_str[log_level],
+ process_id,
+ thread_id,
+ facility,
+ line);
+ if (format)
+ {
+ va_start(args, format);
+ fprintf(stderr, " - ");
+ vfprintf(stderr, format, args);
+ va_end(args);
+ }
+ fprintf(stderr, "\n");
+}
+
+void yagl_log_func_enter(yagl_pid process_id,
+ yagl_tid thread_id,
+ const char* func,
+ int line,
+ const char* format, ...)
+{
+ va_list args;
+
+ yagl_log_print_current_time();
+ fprintf(stderr,
+ " %-5s [%u/%u] {{{ %s(",
+ g_log_level_to_str[yagl_log_level_trace],
+ process_id,
+ thread_id,
+ func);
+ if (format)
+ {
+ va_start(args, format);
+ vfprintf(stderr, format, args);
+ va_end(args);
+ }
+ fprintf(stderr, "):%d\n", line);
+}
+
+void yagl_log_func_exit(yagl_pid process_id,
+ yagl_tid thread_id,
+ const char* func,
+ int line,
+ const char* format, ...)
+{
+ va_list args;
+
+ yagl_log_print_current_time();
+ fprintf(stderr,
+ " %-5s [%u/%u] }}} %s:%d",
+ g_log_level_to_str[yagl_log_level_trace],
+ process_id,
+ thread_id,
+ func,
+ line);
+ if (format)
+ {
+ va_start(args, format);
+ fprintf(stderr, " = ");
+ vfprintf(stderr, format, args);
+ va_end(args);
+ }
+ fprintf(stderr, "\n");
+}
+
+void yagl_log_func_enter_split(yagl_pid process_id,
+ yagl_tid thread_id,
+ const char* func,
+ int line,
+ int num_args, ...)
+{
+ char format[1025] = { '\0' };
+ va_list args;
+
+ yagl_log_print_current_time();
+ fprintf(stderr,
+ " %-5s [%u/%u] {{{ %s(",
+ g_log_level_to_str[yagl_log_level_trace],
+ process_id,
+ thread_id,
+ func);
+
+ if (num_args > 0)
+ {
+ int i;
+ bool skip = false;
+
+ va_start(args, num_args);
+
+ for (i = 0; i < num_args;)
+ {
+ const char* arg_format = yagl_log_datatype_to_format(va_arg(args, const char*));
+ const char* arg_name;
+
+ if (!arg_format)
+ {
+ skip = true;
+ break;
+ }
+
+ arg_name = va_arg(args, const char*);
+
+ strcat(format, arg_name);
+ strcat(format, " = ");
+ strcat(format, arg_format);
+
+ ++i;
+
+ if (i < num_args)
+ {
+ strcat(format, ", ");
+ }
+ }
+
+ if (skip)
+ {
+ fprintf(stderr, "...");
+ }
+ else
+ {
+ vfprintf(stderr, format, args);
+ }
+
+ va_end(args);
+ }
+
+ fprintf(stderr, "):%d\n", line);
+}
+
+void yagl_log_func_exit_split(yagl_pid process_id,
+ yagl_tid thread_id,
+ const char* func,
+ int line,
+ const char* datatype, ...)
+{
+ va_list args;
+
+ yagl_log_print_current_time();
+ fprintf(stderr,
+ " %-5s [%u/%u] }}} %s:%d",
+ g_log_level_to_str[yagl_log_level_trace],
+ process_id,
+ thread_id,
+ func,
+ line);
+
+ if (datatype)
+ {
+ const char* format = yagl_log_datatype_to_format(datatype);
+ if (format)
+ {
+ fprintf(stderr, " = ");
+ va_start(args, datatype);
+ vfprintf(stderr, format, args);
+ va_end(args);
+ }
+ }
+
+ fprintf(stderr, "\n");
+}
+
+bool yagl_log_is_enabled_for_level(yagl_log_level log_level)
+{
+ return log_level <= g_log_level;
+}
+
+bool yagl_log_is_enabled_for_facility(const char* facility)
+{
+ int i;
+ bool res = false;
+
+ if (g_log_facilities_match)
+ {
+ for (i = 0; g_log_facilities_match[i]; ++i)
+ {
+ if (yagl_log_match(facility, g_log_facilities_match[i]))
+ {
+ res = true;
+ break;
+ }
+ }
+ }
+ else
+ {
+ res = true;
+ }
+
+ if (res && g_log_facilities_no_match)
+ {
+ for (i = 0; g_log_facilities_no_match[i]; ++i)
+ {
+ if (yagl_log_match(facility, g_log_facilities_no_match[i]))
+ {
+ res = false;
+ break;
+ }
+ }
+ }
+
+ return res;
+}
+
+bool yagl_log_is_enabled_for_func_tracing(void)
+{
+ return g_log_func_trace;
+}
diff --git a/hw/yagl/yagl_log.h b/hw/yagl/yagl_log.h
new file mode 100644
index 0000000000..81be9c59e4
--- /dev/null
+++ b/hw/yagl/yagl_log.h
@@ -0,0 +1,265 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_LOG_H
+#define _QEMU_YAGL_LOG_H
+
+#ifdef _WIN32
+#include <windows.h>
+#endif
+
+#include "yagl_types.h"
+
+//#define YAGL_LOG_DISABLE
+
+typedef enum
+{
+ yagl_log_level_off = 0,
+ yagl_log_level_error = 1,
+ yagl_log_level_warn = 2,
+ yagl_log_level_info = 3,
+ yagl_log_level_debug = 4,
+ yagl_log_level_trace = 5
+} yagl_log_level;
+
+#define yagl_log_level_max yagl_log_level_trace
+
+void yagl_log_init(void);
+
+void yagl_log_cleanup(void);
+
+void yagl_log_event(yagl_log_level log_level,
+ yagl_pid process_id,
+ yagl_tid thread_id,
+ const char* facility,
+ int line,
+ const char* format, ...);
+
+void yagl_log_func_enter(yagl_pid process_id,
+ yagl_tid thread_id,
+ const char* func,
+ int line,
+ const char* format, ...);
+
+void yagl_log_func_exit(yagl_pid process_id,
+ yagl_tid thread_id,
+ const char* func,
+ int line,
+ const char* format, ...);
+
+/*
+ * Convenience function that uses datatypes instead of format strings, one for each
+ * function argument.
+ *
+ * 'num_args' is number of arguments to the function, then come 'num_args'
+ * (datatype, arg) strings, then come 'num_args' arguments. i.e. the call is
+ * like this:
+ * yagl_log_func_enter_split(0, 0, "my_func", 123, 2, "EGLint", "arg_1", "EGLDisplay", "arg_2", 12, my_ptr);
+ *
+ * This function uses constant size storage for final format string creation,
+ * be sure not to pass too many arguments, the overall size must not
+ * exceed 1024 characters.
+ *
+ * If one of the argument datatypes is not a supported datatype, then argument
+ * formatting is skipped and "..." is printed instead.
+ */
+void yagl_log_func_enter_split(yagl_pid process_id,
+ yagl_tid thread_id,
+ const char* func,
+ int line,
+ int num_args, ...);
+
+/*
+ * Same as above, but only one datatype is required and only one argument
+ * is needed. i.e.:
+ * yagl_log_func_exit_split(0, 0, "my_func", 234, "EGLint", 123);
+ */
+void yagl_log_func_exit_split(yagl_pid process_id,
+ yagl_tid thread_id,
+ const char* func,
+ int line,
+ const char* datatype, ...);
+
+bool yagl_log_is_enabled_for_level(yagl_log_level log_level);
+
+bool yagl_log_is_enabled_for_facility(const char* facility);
+
+bool yagl_log_is_enabled_for_func_tracing(void);
+
+#ifndef YAGL_LOG_DISABLE
+#define YAGL_LOG_EVENT(log_level, pid, tid, facility, format, ...) \
+ do \
+ { \
+ if ( yagl_log_is_enabled_for_level(yagl_log_level_##log_level) && \
+ yagl_log_is_enabled_for_facility(facility) ) \
+ { \
+ yagl_log_event(yagl_log_level_##log_level, pid, tid, facility, __LINE__, format,##__VA_ARGS__); \
+ } \
+ } while(0)
+
+#define YAGL_LOG_FUNC_SET(func) \
+ const char* _yagl_log_current_func = #func; \
+ yagl_pid _yagl_log_current_pid = (cur_ts ? cur_ts->ps->id : 0); \
+ yagl_tid _yagl_log_current_tid = (cur_ts ? cur_ts->id : 0)
+
+#define YAGL_LOG_FUNC_ENTER(func, format, ...) \
+ YAGL_LOG_FUNC_SET(func); \
+ do \
+ { \
+ if ( yagl_log_is_enabled_for_func_tracing() && \
+ yagl_log_is_enabled_for_facility(_yagl_log_current_func) ) \
+ { \
+ yagl_log_func_enter(_yagl_log_current_pid, _yagl_log_current_tid, _yagl_log_current_func, __LINE__, format,##__VA_ARGS__); \
+ } \
+ } while(0)
+
+#define YAGL_LOG_FUNC_ENTER_SPLIT(func, num_args, ...) \
+ YAGL_LOG_FUNC_SET(func); \
+ do \
+ { \
+ if ( yagl_log_is_enabled_for_func_tracing() && \
+ yagl_log_is_enabled_for_facility(_yagl_log_current_func) ) \
+ { \
+ yagl_log_func_enter_split(_yagl_log_current_pid, _yagl_log_current_tid, _yagl_log_current_func, __LINE__, num_args,##__VA_ARGS__); \
+ } \
+ } while(0)
+
+#define YAGL_LOG_FUNC_EXIT(format, ...) \
+ do \
+ { \
+ if ( yagl_log_is_enabled_for_func_tracing() && \
+ yagl_log_is_enabled_for_facility(_yagl_log_current_func) ) \
+ { \
+ yagl_log_func_exit(_yagl_log_current_pid, _yagl_log_current_tid, _yagl_log_current_func, __LINE__, format,##__VA_ARGS__); \
+ } \
+ } while(0)
+
+#define YAGL_LOG_FUNC_EXIT_SPLIT(ret_type, ret) \
+ do \
+ { \
+ if ( yagl_log_is_enabled_for_func_tracing() && \
+ yagl_log_is_enabled_for_facility(_yagl_log_current_func) ) \
+ { \
+ yagl_log_func_exit_split(_yagl_log_current_pid, _yagl_log_current_tid, _yagl_log_current_func, __LINE__, #ret_type, ret); \
+ } \
+ } while(0)
+
+#ifdef _WIN32
+#define YAGL_LOG_EVENT_WIN(log_level, pid, tid, facility, format) \
+ do \
+ { \
+ DWORD err = GetLastError(); \
+ if ( yagl_log_is_enabled_for_level(yagl_log_level_##log_level) && \
+ yagl_log_is_enabled_for_facility(facility) ) \
+ { \
+ LPVOID err_msg; \
+ FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, \
+ NULL, err, 0, (LPTSTR)&err_msg, 0 , NULL); \
+ yagl_log_event(yagl_log_level_##log_level, pid, tid, facility, __LINE__, format"%s", err_msg); \
+ LocalFree(err_msg); \
+ } \
+ } while(0)
+#endif
+#else
+#define YAGL_LOG_EVENT(log_level, pid, tid, facility, format, ...)
+#define YAGL_LOG_FUNC_SET(func)
+#define YAGL_LOG_FUNC_ENTER(func, format, ...)
+#define YAGL_LOG_FUNC_ENTER_SPLIT(func, num_args, ...)
+#define YAGL_LOG_FUNC_EXIT(format, ...)
+#define YAGL_LOG_FUNC_EXIT_SPLIT(ret_type, ret)
+#define YAGL_LOG_EVENT_WIN(log_level, pid, tid, facility, format)
+#endif
+
+#define YAGL_LOG_FUNC_ENTER_SPLIT0(func) YAGL_LOG_FUNC_ENTER_SPLIT(func, 0)
+
+#define YAGL_LOG_FUNC_ENTER_SPLIT1(func, arg0_type, arg0) \
+ YAGL_LOG_FUNC_ENTER_SPLIT(func, 1, #arg0_type, #arg0, arg0)
+
+#define YAGL_LOG_FUNC_ENTER_SPLIT2(func, arg0_type, arg1_type, arg0, arg1) \
+ YAGL_LOG_FUNC_ENTER_SPLIT(func, 2, #arg0_type, #arg0, #arg1_type, #arg1, arg0, arg1)
+
+#define YAGL_LOG_FUNC_ENTER_SPLIT3( func, \
+ arg0_type, arg1_type, arg2_type, \
+ arg0, arg1, arg2 ) \
+ YAGL_LOG_FUNC_ENTER_SPLIT( func, 3, \
+ #arg0_type, #arg0, #arg1_type, #arg1, #arg2_type, #arg2, \
+ arg0, arg1, arg2 )
+
+#define YAGL_LOG_FUNC_ENTER_SPLIT4( func, \
+ arg0_type, arg1_type, arg2_type, arg3_type, \
+ arg0, arg1, arg2, arg3 ) \
+ YAGL_LOG_FUNC_ENTER_SPLIT( func, 4, \
+ #arg0_type, #arg0, #arg1_type, #arg1, #arg2_type, #arg2, #arg3_type, #arg3, \
+ arg0, arg1, arg2, arg3 )
+
+#define YAGL_LOG_FUNC_ENTER_SPLIT5( func, \
+ arg0_type, arg1_type, arg2_type, arg3_type, arg4_type, \
+ arg0, arg1, arg2, arg3, arg4 ) \
+ YAGL_LOG_FUNC_ENTER_SPLIT( func, 5, \
+ #arg0_type, #arg0, #arg1_type, #arg1, #arg2_type, #arg2, #arg3_type, #arg3, #arg4_type, #arg4, \
+ arg0, arg1, arg2, arg3, arg4 )
+
+#define YAGL_LOG_FUNC_ENTER_SPLIT6( func, \
+ arg0_type, arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, \
+ arg0, arg1, arg2, arg3, arg4, arg5 ) \
+ YAGL_LOG_FUNC_ENTER_SPLIT( func, 6, \
+ #arg0_type, #arg0, #arg1_type, #arg1, #arg2_type, #arg2, #arg3_type, #arg3, #arg4_type, #arg4, #arg5_type, #arg5, \
+ arg0, arg1, arg2, arg3, arg4, arg5 )
+
+#define YAGL_LOG_FUNC_ENTER_SPLIT7( func, \
+ arg0_type, arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, \
+ arg0, arg1, arg2, arg3, arg4, arg5, arg6 ) \
+ YAGL_LOG_FUNC_ENTER_SPLIT( func, 7, \
+ #arg0_type, #arg0, #arg1_type, #arg1, #arg2_type, #arg2, #arg3_type, #arg3, #arg4_type, #arg4, #arg5_type, #arg5, #arg6_type, #arg6, \
+ arg0, arg1, arg2, arg3, arg4, arg5, arg6 )
+
+#define YAGL_LOG_FUNC_ENTER_SPLIT8( func, \
+ arg0_type, arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, \
+ arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7 ) \
+ YAGL_LOG_FUNC_ENTER_SPLIT( func, 8, \
+ #arg0_type, #arg0, #arg1_type, #arg1, #arg2_type, #arg2, #arg3_type, #arg3, #arg4_type, #arg4, #arg5_type, #arg5, #arg6_type, #arg6, #arg7_type, #arg7, \
+ arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7 )
+
+#define YAGL_LOG_FUNC_ENTER_SPLIT9( func, \
+ arg0_type, arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, arg8_type, \
+ arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8 ) \
+ YAGL_LOG_FUNC_ENTER_SPLIT( func, 9, \
+ #arg0_type, #arg0, #arg1_type, #arg1, #arg2_type, #arg2, #arg3_type, #arg3, #arg4_type, #arg4, #arg5_type, #arg5, #arg6_type, #arg6, #arg7_type, #arg7, #arg8_type, #arg8, \
+ arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8 )
+
+#define YAGL_LOG_TRACE(format, ...) YAGL_LOG_EVENT(trace, _yagl_log_current_pid, _yagl_log_current_tid, _yagl_log_current_func, format,##__VA_ARGS__)
+#define YAGL_LOG_DEBUG(format, ...) YAGL_LOG_EVENT(debug, _yagl_log_current_pid, _yagl_log_current_tid, _yagl_log_current_func, format,##__VA_ARGS__)
+#define YAGL_LOG_INFO(format, ...) YAGL_LOG_EVENT(info, _yagl_log_current_pid, _yagl_log_current_tid, _yagl_log_current_func, format,##__VA_ARGS__)
+#define YAGL_LOG_WARN(format, ...) YAGL_LOG_EVENT(warn, _yagl_log_current_pid, _yagl_log_current_tid, _yagl_log_current_func, format,##__VA_ARGS__)
+#define YAGL_LOG_ERROR(format, ...) YAGL_LOG_EVENT(error, _yagl_log_current_pid, _yagl_log_current_tid, _yagl_log_current_func, format,##__VA_ARGS__)
+#define YAGL_LOG_ERROR_WIN() YAGL_LOG_EVENT_WIN(error, _yagl_log_current_pid, _yagl_log_current_tid, _yagl_log_current_func, "OS ERROR: ")
+#define YAGL_LOG_CRITICAL(format, ...) \
+ yagl_log_event(yagl_log_level_error, 0, 0, __FUNCTION__, __LINE__, format,##__VA_ARGS__)
+
+#endif
diff --git a/hw/yagl/yagl_mem.c b/hw/yagl/yagl_mem.c
new file mode 100644
index 0000000000..8534581a54
--- /dev/null
+++ b/hw/yagl/yagl_mem.c
@@ -0,0 +1,152 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "yagl_mem.h"
+#include "yagl_process.h"
+#include "yagl_thread.h"
+#include "yagl_log.h"
+#include "exec/cpu-all.h"
+
+struct yagl_mem_transfer *yagl_mem_transfer_create(void)
+{
+ struct yagl_mem_transfer *mt;
+
+ mt = g_malloc0(sizeof(*mt));
+
+ return mt;
+}
+
+void yagl_mem_transfer_destroy(struct yagl_mem_transfer *mt)
+{
+ g_free(mt->pages);
+ g_free(mt);
+}
+
+bool yagl_mem_prepare(struct yagl_mem_transfer *mt,
+ target_ulong va,
+ int len)
+{
+ bool res = true;
+ int l;
+ hwaddr page_pa;
+ target_ulong page_va;
+
+ YAGL_LOG_FUNC_ENTER(yagl_mem_prepare, "va = 0x%X, len = %d", (uint32_t)va, len);
+
+ if (len >= 0) {
+ int max_pages = ((len + TARGET_PAGE_SIZE - 1) / TARGET_PAGE_SIZE) + 1;
+
+ if (max_pages > mt->max_pages) {
+ g_free(mt->pages);
+ mt->pages = g_malloc(sizeof(*mt->pages) * max_pages);
+ }
+
+ mt->max_pages = max_pages;
+ }
+
+ mt->va = va;
+ mt->offset = (va & ~TARGET_PAGE_MASK);
+ mt->len = len;
+ mt->num_pages = 0;
+
+ if (va) {
+ while (len > 0) {
+ page_va = va & TARGET_PAGE_MASK;
+ page_pa = cpu_get_phys_page_debug(current_cpu, page_va);
+
+ if (page_pa == -1) {
+ YAGL_LOG_WARN("page fault at 0x%X", (uint32_t)page_va);
+ res = false;
+ break;
+ }
+
+ l = (page_va + TARGET_PAGE_SIZE) - va;
+ if (l > len) {
+ l = len;
+ }
+
+ len -= l;
+ va += l;
+
+ assert(mt->num_pages < mt->max_pages);
+
+ mt->pages[mt->num_pages++] = page_pa;
+ }
+ }
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return res;
+}
+
+void yagl_mem_put(struct yagl_mem_transfer *mt, const void *data, int len)
+{
+ int offset = mt->offset, i = 0;
+
+ YAGL_LOG_FUNC_ENTER(yagl_mem_put, "va = 0X%X, data = %p, len = %d", (uint32_t)mt->va, data, len);
+
+ if (!mt->va) {
+ assert(false);
+ YAGL_LOG_CRITICAL("mt->va is 0");
+ YAGL_LOG_FUNC_EXIT(NULL);
+ return;
+ }
+
+ while (len > 0) {
+ int l = MIN(len, (TARGET_PAGE_SIZE - offset));
+
+ assert(i < mt->num_pages);
+
+ cpu_physical_memory_write_rom(mt->pages[i++] + offset, data, l);
+
+ offset = 0;
+
+ data += l;
+ len -= l;
+ }
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+bool yagl_mem_get(target_ulong va, uint32_t len, void* data)
+{
+ int ret;
+
+ YAGL_LOG_FUNC_ENTER(yagl_mem_get, "va = 0x%X, len = %u", (uint32_t)va, len);
+
+ ret = cpu_memory_rw_debug(current_cpu, va, data, len, 0);
+
+ if (ret == -1) {
+ YAGL_LOG_WARN("page fault at 0x%X", (uint32_t)va, len);
+ }
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return ret != -1;
+}
diff --git a/hw/yagl/yagl_mem.h b/hw/yagl/yagl_mem.h
new file mode 100644
index 0000000000..75b8fc7db3
--- /dev/null
+++ b/hw/yagl/yagl_mem.h
@@ -0,0 +1,61 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_MEM_H
+#define _QEMU_YAGL_MEM_H
+
+#include "yagl_types.h"
+
+struct yagl_mem_transfer
+{
+ hwaddr *pages;
+ int max_pages;
+
+ target_ulong va;
+ int offset;
+ int len;
+ int num_pages;
+};
+
+/*
+ * Guaranteed to succeed.
+ */
+struct yagl_mem_transfer *yagl_mem_transfer_create(void);
+
+void yagl_mem_transfer_destroy(struct yagl_mem_transfer *mt);
+
+bool yagl_mem_prepare(struct yagl_mem_transfer *mt,
+ target_ulong va,
+ int len);
+
+void yagl_mem_put(struct yagl_mem_transfer *mt, const void *data, int len);
+
+bool yagl_mem_get(target_ulong va, uint32_t len, void *data);
+
+#endif
diff --git a/hw/yagl/yagl_object_map.c b/hw/yagl/yagl_object_map.c
new file mode 100644
index 0000000000..40fd897da7
--- /dev/null
+++ b/hw/yagl/yagl_object_map.c
@@ -0,0 +1,137 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "yagl_object_map.h"
+#include "yagl_avl.h"
+
+struct yagl_object_map_entry
+{
+ yagl_object_name local_name;
+
+ struct yagl_object *obj;
+};
+
+static int yagl_object_map_entry_comparison_func(const void *avl_a,
+ const void *avl_b,
+ void *avl_param)
+{
+ const struct yagl_object_map_entry *a = avl_a;
+ const struct yagl_object_map_entry *b = avl_b;
+
+ if (a->local_name < b->local_name) {
+ return -1;
+ } else if (a->local_name > b->local_name) {
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
+static void yagl_object_map_entry_destroy_func(void *avl_item, void *avl_param)
+{
+ struct yagl_object_map_entry *item = avl_item;
+
+ item->obj->destroy(item->obj);
+
+ g_free(item);
+}
+
+struct yagl_object_map *yagl_object_map_create(void)
+{
+ struct yagl_object_map *object_map = g_malloc0(sizeof(struct yagl_object_map));
+
+ object_map->entries = yagl_avl_create(&yagl_object_map_entry_comparison_func,
+ object_map,
+ NULL);
+ assert(object_map->entries);
+
+ return object_map;
+}
+
+void yagl_object_map_destroy(struct yagl_object_map *object_map)
+{
+ yagl_avl_destroy(object_map->entries, &yagl_object_map_entry_destroy_func);
+ object_map->entries = NULL;
+
+ g_free(object_map);
+}
+
+void yagl_object_map_add(struct yagl_object_map *object_map,
+ yagl_object_name local_name,
+ struct yagl_object *obj)
+{
+ struct yagl_object_map_entry *item =
+ g_malloc0(sizeof(struct yagl_object_map_entry));
+
+ item->local_name = local_name;
+ item->obj = obj;
+
+ yagl_avl_assert_insert(object_map->entries, item);
+}
+
+void yagl_object_map_remove(struct yagl_object_map *object_map,
+ yagl_object_name local_name)
+{
+ void *item;
+ struct yagl_object_map_entry dummy;
+
+ dummy.local_name = local_name;
+
+ item = yagl_avl_assert_delete(object_map->entries, &dummy);
+
+ yagl_object_map_entry_destroy_func(item, object_map->entries->avl_param);
+}
+
+void yagl_object_map_remove_all(struct yagl_object_map *object_map)
+{
+ yagl_avl_destroy(object_map->entries, &yagl_object_map_entry_destroy_func);
+
+ object_map->entries = yagl_avl_create(&yagl_object_map_entry_comparison_func,
+ object_map,
+ NULL);
+ assert(object_map->entries);
+}
+
+yagl_object_name yagl_object_map_get(struct yagl_object_map *object_map,
+ yagl_object_name local_name)
+{
+ struct yagl_object_map_entry *item;
+ struct yagl_object_map_entry dummy;
+
+ dummy.local_name = local_name;
+
+ item = yagl_avl_find(object_map->entries, &dummy);
+
+ if (item) {
+ return item->obj->global_name;
+ } else {
+ assert(0);
+ return 0;
+ }
+}
diff --git a/hw/yagl/yagl_object_map.h b/hw/yagl/yagl_object_map.h
new file mode 100644
index 0000000000..cd8ee4aa99
--- /dev/null
+++ b/hw/yagl/yagl_object_map.h
@@ -0,0 +1,65 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_OBJECT_MAP_H
+#define _QEMU_YAGL_OBJECT_MAP_H
+
+#include "yagl_types.h"
+
+struct yagl_avl_table;
+
+struct yagl_object
+{
+ yagl_object_name global_name;
+
+ void (*destroy)(struct yagl_object */*obj*/);
+};
+
+struct yagl_object_map
+{
+ struct yagl_avl_table *entries;
+};
+
+struct yagl_object_map *yagl_object_map_create(void);
+
+void yagl_object_map_destroy(struct yagl_object_map *object_map);
+
+void yagl_object_map_add(struct yagl_object_map *object_map,
+ yagl_object_name local_name,
+ struct yagl_object *obj);
+
+void yagl_object_map_remove(struct yagl_object_map *object_map,
+ yagl_object_name local_name);
+
+void yagl_object_map_remove_all(struct yagl_object_map *object_map);
+
+yagl_object_name yagl_object_map_get(struct yagl_object_map *object_map,
+ yagl_object_name local_name);
+
+#endif
diff --git a/hw/yagl/yagl_process.c b/hw/yagl/yagl_process.c
new file mode 100644
index 0000000000..9ff1f4b2e4
--- /dev/null
+++ b/hw/yagl/yagl_process.c
@@ -0,0 +1,174 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "yagl_process.h"
+#include "yagl_thread.h"
+#include "yagl_server.h"
+#include "yagl_log.h"
+#include "yagl_stats.h"
+#include "yagl_object_map.h"
+#include "sysemu/kvm.h"
+
+struct yagl_process_state
+ *yagl_process_state_create(struct yagl_server_state *ss,
+ yagl_pid id)
+{
+ struct yagl_process_state *ps =
+ g_malloc0(sizeof(struct yagl_process_state));
+
+ ps->ss = ss;
+ ps->id = id;
+ ps->object_map = yagl_object_map_create();
+ QLIST_INIT(&ps->threads);
+
+#ifdef CONFIG_KVM
+ cpu_synchronize_state(current_cpu);
+ memcpy(&ps->cr[0], &((CPUX86State*)current_cpu->env_ptr)->cr[0], sizeof(ps->cr));
+#endif
+
+ return ps;
+}
+
+void yagl_process_state_destroy(struct yagl_process_state *ps)
+{
+ struct yagl_thread_state *ts, *next;
+
+ YAGL_LOG_FUNC_ENTER(yagl_process_state_destroy, NULL);
+
+ QLIST_FOREACH_SAFE(ts, &ps->threads, entry, next) {
+ bool is_last;
+ QLIST_REMOVE(ts, entry);
+ is_last = QLIST_EMPTY(&ps->threads);
+ yagl_thread_state_destroy(ts, is_last);
+ }
+
+ assert(QLIST_EMPTY(&ps->threads));
+
+ yagl_object_map_destroy(ps->object_map);
+
+ g_free(ps);
+
+ yagl_stats_dump();
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+void yagl_process_register_egl_interface(struct yagl_process_state *ps,
+ struct yagl_egl_interface *egl_iface)
+{
+ YAGL_LOG_FUNC_ENTER(yagl_process_register_egl_interface, NULL);
+
+ assert(egl_iface);
+ assert(!ps->egl_iface);
+
+ if (ps->egl_iface) {
+ YAGL_LOG_CRITICAL("EGL interface is already registered");
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return;
+ }
+
+ ps->egl_iface = egl_iface;
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+void yagl_process_unregister_egl_interface(struct yagl_process_state *ps)
+{
+ YAGL_LOG_FUNC_ENTER(yagl_process_unregister_egl_interface, NULL);
+
+ assert(ps->egl_iface);
+
+ if (!ps->egl_iface) {
+ YAGL_LOG_CRITICAL("EGL interface was not registered");
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return;
+ }
+
+ ps->egl_iface = NULL;
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+struct yagl_thread_state*
+ yagl_process_find_thread(struct yagl_process_state *ps,
+ yagl_tid id)
+{
+ struct yagl_thread_state *ts = NULL;
+
+ QLIST_FOREACH(ts, &ps->threads, entry) {
+ if (ts->id == id) {
+ return ts;
+ }
+ }
+
+ return NULL;
+}
+
+struct yagl_thread_state*
+ yagl_process_add_thread(struct yagl_process_state *ps,
+ yagl_tid id)
+{
+ bool is_first = QLIST_EMPTY(&ps->threads);
+ struct yagl_thread_state *ts =
+ yagl_thread_state_create(ps, id, is_first);
+
+ if (!ts) {
+ return NULL;
+ }
+
+ QLIST_INSERT_HEAD(&ps->threads, ts, entry);
+
+ return ts;
+}
+
+void yagl_process_remove_thread(struct yagl_process_state *ps,
+ yagl_tid id)
+{
+ struct yagl_thread_state *ts =
+ yagl_process_find_thread(ps, id);
+
+ if (ts) {
+ bool is_last;
+
+ QLIST_REMOVE(ts, entry);
+
+ is_last = QLIST_EMPTY(&ps->threads);
+
+ yagl_thread_state_destroy(ts, is_last);
+ }
+}
+
+bool yagl_process_has_threads(struct yagl_process_state *ps)
+{
+ return !QLIST_EMPTY(&ps->threads);
+}
diff --git a/hw/yagl/yagl_process.h b/hw/yagl/yagl_process.h
new file mode 100644
index 0000000000..6dc996a4f5
--- /dev/null
+++ b/hw/yagl/yagl_process.h
@@ -0,0 +1,87 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_PROCESS_H
+#define _QEMU_YAGL_PROCESS_H
+
+#include "yagl_types.h"
+#include "qemu/queue.h"
+
+struct yagl_server_state;
+struct yagl_thread_state;
+struct yagl_object_map;
+struct yagl_api_ps;
+struct yagl_egl_interface;
+
+struct yagl_process_state
+{
+ struct yagl_server_state *ss;
+
+ QLIST_ENTRY(yagl_process_state) entry;
+
+ yagl_pid id;
+
+ struct yagl_api_ps *api_states[YAGL_NUM_APIS];
+
+ struct yagl_egl_interface *egl_iface;
+
+ struct yagl_object_map *object_map;
+
+ QLIST_HEAD(, yagl_thread_state) threads;
+
+#ifdef CONFIG_KVM
+ target_ulong cr[5];
+#endif
+};
+
+struct yagl_process_state
+ *yagl_process_state_create(struct yagl_server_state *ss,
+ yagl_pid id);
+
+void yagl_process_state_destroy(struct yagl_process_state *ps);
+
+void yagl_process_register_egl_interface(struct yagl_process_state *ps,
+ struct yagl_egl_interface *egl_iface);
+
+void yagl_process_unregister_egl_interface(struct yagl_process_state *ps);
+
+struct yagl_thread_state*
+ yagl_process_find_thread(struct yagl_process_state *ps,
+ yagl_tid id);
+
+struct yagl_thread_state*
+ yagl_process_add_thread(struct yagl_process_state *ps,
+ yagl_tid id);
+
+void yagl_process_remove_thread(struct yagl_process_state *ps,
+ yagl_tid id);
+
+bool yagl_process_has_threads(struct yagl_process_state *ps);
+
+#endif
diff --git a/hw/yagl/yagl_ref.c b/hw/yagl/yagl_ref.c
new file mode 100644
index 0000000000..e01ea4fce8
--- /dev/null
+++ b/hw/yagl/yagl_ref.c
@@ -0,0 +1,72 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "yagl_ref.h"
+#include "yagl_stats.h"
+
+void yagl_ref_init(struct yagl_ref *ref, yagl_ref_destroy_func destroy)
+{
+ assert(ref);
+ assert(destroy);
+
+ memset(ref, 0, sizeof(*ref));
+
+ ref->destroy = destroy;
+ ref->count = 1;
+
+ yagl_stats_new_ref();
+}
+
+void yagl_ref_cleanup(struct yagl_ref *ref)
+{
+ assert(ref);
+ assert(!ref->count);
+
+ yagl_stats_delete_ref();
+}
+
+void yagl_ref_acquire(struct yagl_ref *ref)
+{
+ assert(ref);
+ assert(ref->count > 0);
+
+ ++ref->count;
+}
+
+void yagl_ref_release(struct yagl_ref *ref)
+{
+ assert(ref);
+ assert(ref->count > 0);
+
+ if (--ref->count == 0)
+ {
+ assert(ref->destroy);
+ ref->destroy(ref);
+ }
+}
diff --git a/hw/yagl/yagl_ref.h b/hw/yagl/yagl_ref.h
new file mode 100644
index 0000000000..902296ec66
--- /dev/null
+++ b/hw/yagl/yagl_ref.h
@@ -0,0 +1,63 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_REF_H
+#define _QEMU_YAGL_REF_H
+
+#include "yagl_types.h"
+
+struct yagl_ref;
+
+typedef void (*yagl_ref_destroy_func)(struct yagl_ref */*ref*/);
+
+struct yagl_ref
+{
+ yagl_ref_destroy_func destroy;
+
+ uint32_t count;
+};
+
+/*
+ * Initializes ref count to 1.
+ */
+void yagl_ref_init(struct yagl_ref *ref, yagl_ref_destroy_func destroy);
+
+void yagl_ref_cleanup(struct yagl_ref *ref);
+
+/*
+ * Increments ref count.
+ */
+void yagl_ref_acquire(struct yagl_ref *ref);
+
+/*
+ * Decrements ref count and releases when 0.
+ */
+void yagl_ref_release(struct yagl_ref *ref);
+
+#endif
diff --git a/hw/yagl/yagl_resource.c b/hw/yagl/yagl_resource.c
new file mode 100644
index 0000000000..d70dca9926
--- /dev/null
+++ b/hw/yagl/yagl_resource.c
@@ -0,0 +1,58 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "yagl_resource.h"
+#include "yagl_handle_gen.h"
+
+void yagl_resource_init(struct yagl_resource *res,
+ yagl_ref_destroy_func destroy)
+{
+ yagl_ref_init(&res->ref, destroy);
+ res->handle = yagl_handle_gen();
+}
+
+void yagl_resource_cleanup(struct yagl_resource *res)
+{
+ res->handle = 0;
+ yagl_ref_cleanup(&res->ref);
+}
+
+void yagl_resource_acquire(struct yagl_resource *res)
+{
+ if (res) {
+ yagl_ref_acquire(&res->ref);
+ }
+}
+
+void yagl_resource_release(struct yagl_resource *res)
+{
+ if (res) {
+ yagl_ref_release(&res->ref);
+ }
+}
diff --git a/hw/yagl/yagl_resource.h b/hw/yagl/yagl_resource.h
new file mode 100644
index 0000000000..68e91e6013
--- /dev/null
+++ b/hw/yagl/yagl_resource.h
@@ -0,0 +1,69 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_RESOURCE_H
+#define _QEMU_YAGL_RESOURCE_H
+
+#include "yagl_types.h"
+#include "yagl_ref.h"
+#include "qemu/queue.h"
+
+struct yagl_resource
+{
+ struct yagl_ref ref;
+
+ QTAILQ_ENTRY(yagl_resource) entry;
+
+ yagl_host_handle handle;
+};
+
+/*
+ * For implementations.
+ * @{
+ */
+
+void yagl_resource_init(struct yagl_resource *res,
+ yagl_ref_destroy_func destroy);
+void yagl_resource_cleanup(struct yagl_resource *res);
+
+/*
+ * @}
+ */
+
+/*
+ * Passing NULL won't hurt, this is for convenience.
+ */
+void yagl_resource_acquire(struct yagl_resource *res);
+
+/*
+ * Passing NULL won't hurt, this is for convenience.
+ */
+void yagl_resource_release(struct yagl_resource *res);
+
+#endif
diff --git a/hw/yagl/yagl_resource_list.c b/hw/yagl/yagl_resource_list.c
new file mode 100644
index 0000000000..ad7cee6d44
--- /dev/null
+++ b/hw/yagl/yagl_resource_list.c
@@ -0,0 +1,110 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "yagl_resource_list.h"
+#include "yagl_resource.h"
+
+void yagl_resource_list_init(struct yagl_resource_list *list)
+{
+ QTAILQ_INIT(&list->resources);
+ list->count = 0;
+}
+
+void yagl_resource_list_cleanup(struct yagl_resource_list *list)
+{
+ struct yagl_resource *res, *next;
+
+ QTAILQ_FOREACH_SAFE(res, &list->resources, entry, next) {
+ QTAILQ_REMOVE(&list->resources, res, entry);
+ yagl_resource_release(res);
+ }
+
+ assert(QTAILQ_EMPTY(&list->resources));
+ list->count = 0;
+}
+
+int yagl_resource_list_get_count(struct yagl_resource_list *list)
+{
+ return list->count;
+}
+
+void yagl_resource_list_add(struct yagl_resource_list *list,
+ struct yagl_resource *res)
+{
+ yagl_resource_acquire(res);
+ QTAILQ_INSERT_TAIL(&list->resources, res, entry);
+ ++list->count;
+}
+
+void yagl_resource_list_move(struct yagl_resource_list *from_list,
+ struct yagl_resource_list *to_list)
+{
+ struct yagl_resource *res, *next;
+
+ QTAILQ_FOREACH_SAFE(res, &from_list->resources, entry, next) {
+ QTAILQ_REMOVE(&from_list->resources, res, entry);
+ QTAILQ_INSERT_TAIL(&to_list->resources, res, entry);
+ --from_list->count;
+ ++to_list->count;
+ }
+
+ assert(QTAILQ_EMPTY(&from_list->resources));
+}
+
+struct yagl_resource
+ *yagl_resource_list_acquire(struct yagl_resource_list *list,
+ yagl_host_handle handle)
+{
+ struct yagl_resource *res;
+
+ QTAILQ_FOREACH(res, &list->resources, entry) {
+ if (res->handle == handle) {
+ yagl_resource_acquire(res);
+ return res;
+ }
+ }
+
+ return NULL;
+}
+
+bool yagl_resource_list_remove(struct yagl_resource_list *list,
+ yagl_host_handle handle)
+{
+ struct yagl_resource *res;
+
+ QTAILQ_FOREACH(res, &list->resources, entry) {
+ if (res->handle == handle) {
+ QTAILQ_REMOVE(&list->resources, res, entry);
+ yagl_resource_release(res);
+ return true;
+ }
+ }
+
+ return false;
+}
diff --git a/hw/yagl/yagl_resource_list.h b/hw/yagl/yagl_resource_list.h
new file mode 100644
index 0000000000..5ef3ae8324
--- /dev/null
+++ b/hw/yagl/yagl_resource_list.h
@@ -0,0 +1,94 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_RESOURCE_LIST_H
+#define _QEMU_YAGL_RESOURCE_LIST_H
+
+#include "yagl_types.h"
+#include "qemu/queue.h"
+
+/*
+ * reference counted resource management.
+ */
+
+struct yagl_resource;
+
+struct yagl_resource_list
+{
+ QTAILQ_HEAD(, yagl_resource) resources;
+ int count;
+};
+
+
+/*
+ * Initialize the list.
+ */
+void yagl_resource_list_init(struct yagl_resource_list *list);
+
+/*
+ * Release all resources in the list and empty the list. The
+ * list should be initialized again in order to be used after this.
+ */
+void yagl_resource_list_cleanup(struct yagl_resource_list *list);
+
+int yagl_resource_list_get_count(struct yagl_resource_list *list);
+
+/*
+ * Add a resource to the end of the list, this acquires 'res', so the
+ * caller should
+ * release 'res' if he doesn't want to use it and wants it to belong to this
+ * list alone.
+ */
+void yagl_resource_list_add(struct yagl_resource_list *list,
+ struct yagl_resource *res);
+
+/*
+ * Moves all resources from 'from_list' to 'to_list'. The resources will be
+ * added to the tail of the 'to_list'. 'from_list' will be empty. Resource
+ * reference count will remain the same.
+ */
+void yagl_resource_list_move(struct yagl_resource_list *from_list,
+ struct yagl_resource_list *to_list);
+
+/*
+ * Acquires a resource by handle. Be sure to release the resource when
+ * you're done.
+ */
+struct yagl_resource
+ *yagl_resource_list_acquire(struct yagl_resource_list *list,
+ yagl_host_handle handle);
+
+/*
+ * Removes a resource from the end of the list, this also releases
+ * the resource.
+ */
+bool yagl_resource_list_remove(struct yagl_resource_list *list,
+ yagl_host_handle handle);
+
+#endif
diff --git a/hw/yagl/yagl_server.c b/hw/yagl/yagl_server.c
new file mode 100644
index 0000000000..ea24759ab6
--- /dev/null
+++ b/hw/yagl/yagl_server.c
@@ -0,0 +1,409 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "yagl_server.h"
+#include "yagl_api.h"
+#include "yagl_process.h"
+#include "yagl_thread.h"
+#include "yagl_version.h"
+#include "yagl_log.h"
+#include "yagl_transport.h"
+#include "yagl_egl_backend.h"
+#include "yagl_apis/egl/yagl_egl_api.h"
+#include "yagl_apis/gles/yagl_gles_api.h"
+#include <GL/gl.h>
+#include "yagl_gles_driver.h"
+
+static __inline void yagl_marshal_put_uint32_t(uint8_t** buff, uint32_t value)
+{
+ *(uint32_t*)(*buff) = value;
+ *buff += 8;
+}
+
+static __inline uint32_t yagl_marshal_get_uint32_t(uint8_t** buff)
+{
+ uint32_t tmp = *(uint32_t*)*buff;
+ *buff += 8;
+ return tmp;
+}
+
+static struct yagl_thread_state
+ *yagl_server_find_thread(struct yagl_server_state *ss,
+ yagl_pid target_pid,
+ yagl_tid target_tid)
+{
+ struct yagl_process_state *ps = NULL;
+
+ QLIST_FOREACH(ps, &ss->processes, entry) {
+ if (ps->id == target_pid) {
+ return yagl_process_find_thread(ps, target_tid);
+ }
+ }
+
+ return NULL;
+}
+
+struct yagl_server_state
+ *yagl_server_state_create(struct yagl_egl_backend *egl_backend,
+ struct yagl_gles_driver *gles_driver)
+{
+ int i;
+ struct yagl_server_state *ss =
+ g_malloc0(sizeof(struct yagl_server_state));
+
+ QLIST_INIT(&ss->processes);
+
+ ss->t = yagl_transport_create();
+
+ if (!ss->t) {
+ egl_backend->destroy(egl_backend);
+ gles_driver->destroy(gles_driver);
+
+ goto fail;
+ }
+
+ ss->apis[yagl_api_id_egl - 1] = yagl_egl_api_create(egl_backend);
+
+ if (!ss->apis[yagl_api_id_egl - 1]) {
+ egl_backend->destroy(egl_backend);
+ gles_driver->destroy(gles_driver);
+
+ goto fail;
+ }
+
+ ss->apis[yagl_api_id_gles - 1] = yagl_gles_api_create(gles_driver);
+
+ if (!ss->apis[yagl_api_id_gles - 1]) {
+ gles_driver->destroy(gles_driver);
+
+ goto fail;
+ }
+
+ ss->render_type = egl_backend->render_type;
+
+ return ss;
+
+fail:
+ for (i = 0; i < YAGL_NUM_APIS; ++i) {
+ if (ss->apis[i]) {
+ ss->apis[i]->destroy(ss->apis[i]);
+ ss->apis[i] = NULL;
+ }
+ }
+
+ if (ss->t) {
+ yagl_transport_destroy(ss->t);
+ }
+
+ g_free(ss);
+
+ return NULL;
+}
+
+void yagl_server_state_destroy(struct yagl_server_state *ss)
+{
+ int i;
+
+ yagl_server_reset(ss);
+
+ for (i = 0; i < YAGL_NUM_APIS; ++i) {
+ if (ss->apis[i]) {
+ ss->apis[i]->destroy(ss->apis[i]);
+ ss->apis[i] = NULL;
+ }
+ }
+
+ yagl_transport_destroy(ss->t);
+
+ g_free(ss);
+}
+
+void yagl_server_reset(struct yagl_server_state *ss)
+{
+ struct yagl_process_state *ps, *next;
+
+ QLIST_FOREACH_SAFE(ps, &ss->processes, entry, next) {
+ QLIST_REMOVE(ps, entry);
+ yagl_process_state_destroy(ps);
+ }
+
+ assert(QLIST_EMPTY(&ss->processes));
+}
+
+/*
+ * buff is:
+ * IN (uint32_t) version
+ * IN (uint32_t) pid
+ * IN (uint32_t) tid
+ * OUT (uint32_t) res: 1 - init ok, 0 - init error
+ * OUT (uint32_t) render_type: in case of init ok
+ */
+bool yagl_server_dispatch_init(struct yagl_server_state *ss,
+ uint8_t *buff,
+ yagl_pid *target_pid,
+ yagl_tid *target_tid)
+{
+ uint8_t *orig_buff;
+ uint32_t version;
+ struct yagl_process_state *ps = NULL;
+ struct yagl_thread_state *ts = NULL;
+ uint8_t **pages;
+
+ YAGL_LOG_FUNC_ENTER(yagl_server_dispatch_init, NULL);
+
+ orig_buff = buff;
+
+ version = yagl_marshal_get_uint32_t(&buff);
+ *target_pid = yagl_marshal_get_uint32_t(&buff);
+ *target_tid = yagl_marshal_get_uint32_t(&buff);
+
+ if (version != YAGL_VERSION) {
+ YAGL_LOG_CRITICAL(
+ "target-host version mismatch, target version is %u, host version is %u",
+ version,
+ YAGL_VERSION);
+
+ yagl_marshal_put_uint32_t(&buff, 0);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return false;
+ }
+
+ QLIST_FOREACH(ps, &ss->processes, entry) {
+ if (ps->id == *target_pid) {
+ /*
+ * Process already exists.
+ */
+
+ ts = yagl_process_find_thread(ps, *target_tid);
+
+ if (ts) {
+ YAGL_LOG_CRITICAL(
+ "thread %u already initialized in process %u",
+ *target_tid, *target_pid);
+
+ yagl_marshal_put_uint32_t(&buff, 0);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return false;
+ } else {
+ ts = yagl_process_add_thread(ps, *target_tid);
+
+ if (!ts) {
+ YAGL_LOG_CRITICAL(
+ "cannot add thread %u to process %u",
+ *target_tid, *target_pid);
+
+ yagl_marshal_put_uint32_t(&buff, 0);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return false;
+ } else {
+ goto out;
+ }
+ }
+ }
+ }
+
+ /*
+ * No process found, create one.
+ */
+
+ ps = yagl_process_state_create(ss, *target_pid);
+
+ if (!ps) {
+ YAGL_LOG_CRITICAL("cannot create process %u", *target_pid);
+
+ yagl_marshal_put_uint32_t(&buff, 0);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return false;
+ }
+
+ ts = yagl_process_add_thread(ps, *target_tid);
+
+ if (!ts) {
+ YAGL_LOG_CRITICAL(
+ "cannot add thread %u to process %u",
+ *target_tid, *target_pid);
+
+ yagl_process_state_destroy(ps);
+
+ yagl_marshal_put_uint32_t(&buff, 0);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return false;
+ } else {
+ QLIST_INSERT_HEAD(&ss->processes, ps, entry);
+
+ goto out;
+ }
+
+out:
+ pages = g_malloc0(2 * sizeof(*pages));
+
+ pages[0] = orig_buff;
+
+ yagl_thread_set_buffer(ts, pages);
+
+ yagl_marshal_put_uint32_t(&buff, 1);
+ yagl_marshal_put_uint32_t(&buff, ss->render_type);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return true;
+}
+
+/*
+ * buff is:
+ * IN (uint32_t) count
+ * IN (uint32_t) phys_addr
+ * ...
+ * IN (uint32_t) phys_addr
+ * OUT (uint32_t) res: 1 - update ok, no change - update error
+ */
+void yagl_server_dispatch_update(struct yagl_server_state *ss,
+ yagl_pid target_pid,
+ yagl_tid target_tid,
+ uint8_t *buff)
+{
+ struct yagl_thread_state *ts;
+ uint32_t i, count = 0;
+ uint8_t **pages = NULL;
+
+ YAGL_LOG_FUNC_ENTER(yagl_server_dispatch_update, NULL);
+
+ ts = yagl_server_find_thread(ss, target_pid, target_tid);
+
+ if (!ts) {
+ YAGL_LOG_CRITICAL("process/thread %u/%u not found",
+ target_pid, target_tid);
+ goto fail;
+ }
+
+ count = yagl_marshal_get_uint32_t(&buff);
+
+ if (count > ((TARGET_PAGE_SIZE / 8) - 2)) {
+ YAGL_LOG_CRITICAL("bad count = %u", count);
+ goto fail;
+ }
+
+ pages = g_malloc0((count + 1) * sizeof(*pages));
+
+ for (i = 0; i < count; ++i) {
+ hwaddr page_pa = yagl_marshal_get_uint32_t(&buff);
+ hwaddr len = TARGET_PAGE_SIZE;
+
+ pages[i] = cpu_physical_memory_map(page_pa, &len, false);
+
+ if (!pages[i] || (len != TARGET_PAGE_SIZE)) {
+ YAGL_LOG_CRITICAL("cpu_physical_memory_map(read) failed for page_pa = 0x%X",
+ (uint32_t)page_pa);
+ goto fail;
+ }
+ }
+
+ yagl_thread_set_buffer(ts, pages);
+
+ yagl_marshal_put_uint32_t(&buff, 1);
+
+ goto out;
+
+fail:
+ for (i = count; i > 0; --i) {
+ if (pages[i - 1]) {
+ cpu_physical_memory_unmap(pages[i - 1],
+ TARGET_PAGE_SIZE,
+ false,
+ TARGET_PAGE_SIZE);
+ }
+ }
+ g_free(pages);
+
+out:
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+void yagl_server_dispatch_batch(struct yagl_server_state *ss,
+ yagl_pid target_pid,
+ yagl_tid target_tid,
+ uint32_t offset)
+{
+ struct yagl_thread_state *ts;
+
+ YAGL_LOG_FUNC_ENTER(yagl_server_dispatch_batch, NULL);
+
+ ts = yagl_server_find_thread(ss, target_pid, target_tid);
+
+ if (ts) {
+ yagl_thread_call(ts, offset);
+ } else {
+ YAGL_LOG_CRITICAL("process/thread %u/%u not found",
+ target_pid, target_tid);
+ }
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+void yagl_server_dispatch_exit(struct yagl_server_state *ss,
+ yagl_pid target_pid,
+ yagl_tid target_tid)
+{
+ struct yagl_thread_state *ts =
+ yagl_server_find_thread(ss, target_pid, target_tid);
+ struct yagl_process_state *ps = NULL;
+
+ YAGL_LOG_FUNC_ENTER(yagl_server_dispatch_exit, NULL);
+
+ if (!ts) {
+ YAGL_LOG_CRITICAL("process/thread %u/%u not found",
+ target_pid, target_tid);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return;
+ }
+
+ ps = ts->ps;
+
+ yagl_process_remove_thread(ps, target_tid);
+
+ if (!yagl_process_has_threads(ps)) {
+ QLIST_REMOVE(ps, entry);
+
+ yagl_process_state_destroy(ps);
+ }
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
diff --git a/hw/yagl/yagl_server.h b/hw/yagl/yagl_server.h
new file mode 100644
index 0000000000..09aacb1043
--- /dev/null
+++ b/hw/yagl/yagl_server.h
@@ -0,0 +1,111 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_SERVER_H
+#define _QEMU_YAGL_SERVER_H
+
+#include "yagl_types.h"
+#include "qemu/queue.h"
+
+struct yagl_api;
+struct yagl_process_state;
+struct yagl_egl_backend;
+struct yagl_gles_driver;
+struct yagl_transport;
+
+struct yagl_server_state
+{
+ yagl_render_type render_type;
+
+ struct yagl_api *apis[YAGL_NUM_APIS];
+
+ QLIST_HEAD(, yagl_process_state) processes;
+
+ /*
+ * Single transport that's used by all threads.
+ */
+ struct yagl_transport *t;
+};
+
+/*
+ * Create/destroy YaGL server state. Typically, there should be one and only
+ * server state which is a part of YaGL device.
+ * @{
+ */
+
+/*
+ * 'egl_backend' and 'gles_driver' will be owned by
+ * returned server state or destroyed in case of error.
+ */
+struct yagl_server_state
+ *yagl_server_state_create(struct yagl_egl_backend *egl_backend,
+ struct yagl_gles_driver *gles_driver);
+
+void yagl_server_state_destroy(struct yagl_server_state *ss);
+/*
+ * @}
+ */
+
+/*
+ * Don't destroy the state, just drop all processes/threads.
+ */
+void yagl_server_reset(struct yagl_server_state *ss);
+
+/*
+ * This is called for first YaGL call.
+ */
+bool yagl_server_dispatch_init(struct yagl_server_state *ss,
+ uint8_t *buff,
+ yagl_pid *target_pid,
+ yagl_tid *target_tid);
+
+/*
+ * This is called for each YaGL transport buffer update.
+ */
+void yagl_server_dispatch_update(struct yagl_server_state *ss,
+ yagl_pid target_pid,
+ yagl_tid target_tid,
+ uint8_t *buff);
+
+/*
+ * This is called for each YaGL batch.
+ */
+void yagl_server_dispatch_batch(struct yagl_server_state *ss,
+ yagl_pid target_pid,
+ yagl_tid target_tid,
+ uint32_t offset);
+
+/*
+ * This is called for last YaGL call.
+ */
+void yagl_server_dispatch_exit(struct yagl_server_state *ss,
+ yagl_pid target_pid,
+ yagl_tid target_tid);
+
+#endif
diff --git a/hw/yagl/yagl_stats.c b/hw/yagl/yagl_stats.c
new file mode 100644
index 0000000000..8c2cc952f6
--- /dev/null
+++ b/hw/yagl/yagl_stats.c
@@ -0,0 +1,107 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "yagl_stats.h"
+#include "yagl_log.h"
+#include "yagl_process.h"
+#include "yagl_thread.h"
+
+#ifdef CONFIG_YAGL_STATS
+
+#define YAGL_STATS_MAX_BATCHES 100
+
+static uint32_t g_num_refs = 0;
+
+static uint32_t g_num_batches = 0;
+
+static uint32_t g_num_calls_min = UINT32_MAX;
+static uint32_t g_num_calls_max = 0;
+
+static uint32_t g_bytes_used_min = UINT32_MAX;
+static uint32_t g_bytes_used_max = 0;
+
+void yagl_stats_new_ref(void)
+{
+ ++g_num_refs;
+}
+
+void yagl_stats_delete_ref(void)
+{
+ if (g_num_refs-- == 0) {
+ assert(0);
+ }
+}
+
+void yagl_stats_batch(uint32_t num_calls, uint32_t bytes_used)
+{
+ if (num_calls > g_num_calls_max) {
+ g_num_calls_max = num_calls;
+ }
+
+ if (bytes_used > g_bytes_used_max) {
+ g_bytes_used_max = bytes_used;
+ }
+
+ if (num_calls < g_num_calls_min) {
+ g_num_calls_min = num_calls;
+ }
+
+ if (bytes_used < g_bytes_used_min) {
+ g_bytes_used_min = bytes_used;
+ }
+
+ if (++g_num_batches >= YAGL_STATS_MAX_BATCHES) {
+ yagl_stats_dump();
+
+ g_num_batches = 0;
+ g_num_calls_min = UINT32_MAX;
+ g_num_calls_max = 0;
+ g_bytes_used_min = UINT32_MAX;
+ g_bytes_used_max = 0;
+ }
+}
+
+void yagl_stats_dump(void)
+{
+ YAGL_LOG_FUNC_ENTER(yagl_stats_dump, NULL);
+
+ YAGL_LOG_DEBUG("<<STATS");
+ YAGL_LOG_DEBUG("# yagl_ref's: %u", g_num_refs);
+ YAGL_LOG_DEBUG("# of calls per batch: %u - %u",
+ ((g_num_calls_min == UINT32_MAX) ? 0 : g_num_calls_min),
+ g_num_calls_max);
+ YAGL_LOG_DEBUG("# of bytes used per batch: %u - %u",
+ ((g_bytes_used_min == UINT32_MAX) ? 0 : g_bytes_used_min),
+ g_bytes_used_max);
+ YAGL_LOG_DEBUG(">>STATS");
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+#endif
diff --git a/hw/yagl/yagl_stats.h b/hw/yagl/yagl_stats.h
new file mode 100644
index 0000000000..532ba94d04
--- /dev/null
+++ b/hw/yagl/yagl_stats.h
@@ -0,0 +1,51 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_STATS_H
+#define _QEMU_STATS_H
+
+#include "yagl_types.h"
+
+#ifdef CONFIG_YAGL_STATS
+
+void yagl_stats_new_ref(void);
+void yagl_stats_delete_ref(void);
+
+void yagl_stats_batch(uint32_t num_calls, uint32_t bytes_used);
+
+void yagl_stats_dump(void);
+
+#else
+#define yagl_stats_new_ref()
+#define yagl_stats_delete_ref()
+#define yagl_stats_batch(num_calls, bytes_used)
+#define yagl_stats_dump()
+#endif
+
+#endif
diff --git a/hw/yagl/yagl_thread.c b/hw/yagl/yagl_thread.c
new file mode 100644
index 0000000000..f92a8e716f
--- /dev/null
+++ b/hw/yagl/yagl_thread.c
@@ -0,0 +1,240 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "yagl_thread.h"
+#include "yagl_process.h"
+#include "yagl_server.h"
+#include "yagl_api.h"
+#include "yagl_log.h"
+#include "yagl_stats.h"
+#include "yagl_transport.h"
+#include "yagl_object_map.h"
+#include "sysemu/kvm.h"
+#include "sysemu/hax.h"
+
+YAGL_DEFINE_TLS(struct yagl_thread_state*, cur_ts);
+
+#ifdef CONFIG_KVM
+static __inline void yagl_cpu_synchronize_state(struct yagl_process_state *ps)
+{
+ if (kvm_enabled()) {
+ memcpy(&((CPUX86State*)current_cpu->env_ptr)->cr[0], &ps->cr[0], sizeof(ps->cr));
+ }
+}
+#else
+static __inline void yagl_cpu_synchronize_state(struct yagl_process_state *ps)
+{
+}
+#endif
+
+struct yagl_thread_state
+ *yagl_thread_state_create(struct yagl_process_state *ps,
+ yagl_tid id,
+ bool is_first)
+{
+ int i;
+
+ struct yagl_thread_state *ts =
+ g_malloc0(sizeof(struct yagl_thread_state));
+
+ ts->ps = ps;
+ ts->id = id;
+
+ cur_ts = ts;
+
+ if (is_first) {
+ /*
+ * Init APIs (process).
+ */
+
+ for (i = 0; i < YAGL_NUM_APIS; ++i) {
+ if (ts->ps->ss->apis[i]) {
+ ts->ps->api_states[i] = ts->ps->ss->apis[i]->process_init(ts->ps->ss->apis[i]);
+ assert(ts->ps->api_states[i]);
+ }
+ }
+ }
+
+ /*
+ * Init APIs (thread).
+ */
+
+ for (i = 0; i < YAGL_NUM_APIS; ++i) {
+ if (ts->ps->api_states[i]) {
+ ts->ps->api_states[i]->thread_init(ts->ps->api_states[i]);
+ }
+ }
+
+ return ts;
+}
+
+void yagl_thread_state_destroy(struct yagl_thread_state *ts,
+ bool is_last)
+{
+ int i;
+
+ cur_ts = ts;
+
+ /*
+ * Fini APIs (thread).
+ */
+
+ for (i = 0; i < YAGL_NUM_APIS; ++i) {
+ if (ts->ps->api_states[i]) {
+ ts->ps->api_states[i]->thread_fini(ts->ps->api_states[i]);
+ }
+ }
+
+ if (is_last) {
+ /*
+ * First, remove all objects.
+ */
+
+ yagl_object_map_remove_all(ts->ps->object_map);
+
+ /*
+ * Destroy APIs (process).
+ */
+
+ for (i = 0; i < YAGL_NUM_APIS; ++i) {
+ if (ts->ps->api_states[i]) {
+ ts->ps->api_states[i]->destroy(ts->ps->api_states[i]);
+ ts->ps->api_states[i] = NULL;
+ }
+ }
+ }
+
+ cur_ts = NULL;
+
+ yagl_thread_set_buffer(ts, NULL);
+
+ g_free(ts);
+}
+
+void yagl_thread_set_buffer(struct yagl_thread_state *ts, uint8_t **pages)
+{
+ if (ts->pages) {
+ uint8_t **tmp;
+
+ for (tmp = ts->pages; *tmp; ++tmp) {
+ cpu_physical_memory_unmap(*tmp,
+ TARGET_PAGE_SIZE,
+ false,
+ TARGET_PAGE_SIZE);
+ }
+
+ g_free(ts->pages);
+ ts->pages = NULL;
+ }
+
+ ts->pages = pages;
+}
+
+void yagl_thread_call(struct yagl_thread_state *ts, uint32_t offset)
+{
+ int i;
+ uint32_t num_calls = 0;
+ struct yagl_transport *t = ts->ps->ss->t;
+
+ YAGL_LOG_FUNC_SET(yagl_thread_call);
+
+ assert(current_cpu);
+
+ yagl_cpu_synchronize_state(ts->ps);
+
+ YAGL_LOG_TRACE("batch started");
+
+ cur_ts = ts;
+
+ for (i = 0; i < YAGL_NUM_APIS; ++i) {
+ if (ts->ps->api_states[i]) {
+ ts->ps->api_states[i]->batch_start(ts->ps->api_states[i]);
+ }
+ }
+
+ yagl_transport_begin(t, ts->pages, offset);
+
+ while (true) {
+ yagl_api_id api_id;
+ yagl_func_id func_id;
+ struct yagl_api_ps *api_ps;
+ yagl_api_func func;
+
+ yagl_transport_begin_call(t, &api_id, &func_id);
+
+ if (api_id == 0) {
+ /*
+ * Batch ended.
+ */
+ break;
+ }
+
+ if ((api_id <= 0) || (api_id > YAGL_NUM_APIS)) {
+ YAGL_LOG_CRITICAL("target-host protocol error, bad api_id - %u", api_id);
+ break;
+ }
+
+ api_ps = ts->ps->api_states[api_id - 1];
+
+ if (!api_ps) {
+ YAGL_LOG_CRITICAL("uninitialized api - %u. host logic error", api_id);
+ break;
+ }
+
+ func = api_ps->get_func(api_ps, func_id);
+
+ if (func) {
+ if (func(t)) {
+ yagl_transport_end_call(t);
+ } else {
+ /*
+ * Retry is requested.
+ */
+ break;
+ }
+ } else {
+ YAGL_LOG_CRITICAL("bad function call (api = %u, func = %u)",
+ api_id,
+ func_id);
+ break;
+ }
+
+ ++num_calls;
+ }
+
+ YAGL_LOG_TRACE("batch ended: %u calls", num_calls);
+
+ yagl_stats_batch(num_calls, yagl_transport_bytes_processed(t));
+
+ for (i = 0; i < YAGL_NUM_APIS; ++i) {
+ if (ts->ps->api_states[i]) {
+ ts->ps->api_states[i]->batch_end(ts->ps->api_states[i]);
+ }
+ }
+}
diff --git a/hw/yagl/yagl_thread.h b/hw/yagl/yagl_thread.h
new file mode 100644
index 0000000000..05330670eb
--- /dev/null
+++ b/hw/yagl/yagl_thread.h
@@ -0,0 +1,78 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_THREAD_H
+#define _QEMU_YAGL_THREAD_H
+
+#include "yagl_types.h"
+#include "yagl_event.h"
+#include "yagl_tls.h"
+#include "qemu/queue.h"
+#include "qemu/thread.h"
+
+struct yagl_process_state;
+
+struct yagl_thread_state
+{
+ struct yagl_process_state *ps;
+
+ QLIST_ENTRY(yagl_thread_state) entry;
+
+ yagl_tid id;
+
+ uint8_t **pages;
+
+ /*
+ * Fake TLS.
+ * @{
+ */
+ void *egl_api_ts;
+ void *gles_api_ts;
+ void *egl_offscreen_ts;
+ void *egl_onscreen_ts;
+ /*
+ * @}
+ */
+};
+
+YAGL_DECLARE_TLS(struct yagl_thread_state*, cur_ts);
+
+struct yagl_thread_state
+ *yagl_thread_state_create(struct yagl_process_state *ps,
+ yagl_tid id,
+ bool is_first);
+
+void yagl_thread_state_destroy(struct yagl_thread_state *ts,
+ bool is_last);
+
+void yagl_thread_set_buffer(struct yagl_thread_state *ts, uint8_t **pages);
+
+void yagl_thread_call(struct yagl_thread_state *ts, uint32_t offset);
+
+#endif
diff --git a/hw/yagl/yagl_tls.h b/hw/yagl/yagl_tls.h
new file mode 100644
index 0000000000..19c638852d
--- /dev/null
+++ b/hw/yagl/yagl_tls.h
@@ -0,0 +1,38 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_TLS_H
+#define _QEMU_YAGL_TLS_H
+
+#include "yagl_types.h"
+
+#define YAGL_DEFINE_TLS(type, x) type x
+#define YAGL_DECLARE_TLS(type, x) extern YAGL_DEFINE_TLS(type, x)
+
+#endif
diff --git a/hw/yagl/yagl_transport.c b/hw/yagl/yagl_transport.c
new file mode 100644
index 0000000000..6287d84bce
--- /dev/null
+++ b/hw/yagl/yagl_transport.c
@@ -0,0 +1,296 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "yagl_transport.h"
+#include "yagl_mem.h"
+
+typedef enum
+{
+ yagl_call_result_ok = 0xA, /* Call is ok. */
+ yagl_call_result_retry = 0xB, /* Page fault on host, retry is required. */
+} yagl_call_result;
+
+static void yagl_transport_copy_from(struct yagl_transport *t,
+ uint8_t *data,
+ uint32_t size)
+{
+ while (size > 0) {
+ uint32_t rem = t->next_page - t->ptr;
+ rem = MIN(rem, size);
+
+ memcpy(data, t->ptr, rem);
+
+ size -= rem;
+ data += rem;
+
+ yagl_transport_advance(t, rem);
+ }
+}
+
+static void yagl_transport_copy_to(struct yagl_transport *t,
+ uint32_t page_index,
+ uint8_t *ptr,
+ uint8_t *data,
+ uint32_t size)
+{
+ while (size > 0) {
+ uint32_t rem = t->pages[page_index] + TARGET_PAGE_SIZE - ptr;
+ rem = MIN(rem, size);
+
+ memcpy(ptr, data, rem);
+
+ size -= rem;
+ data += rem;
+
+ ++page_index;
+ ptr = t->pages[page_index];
+ }
+}
+
+struct yagl_transport *yagl_transport_create(void)
+{
+ struct yagl_transport *t;
+ uint32_t i;
+
+ t = g_malloc0(sizeof(*t));
+
+ for (i = 0; i < YAGL_TRANSPORT_MAX_OUT; ++i) {
+ yagl_vector_init(&t->out_arrays[i], 1, 0);
+ }
+
+ for (i = 0; i < YAGL_TRANSPORT_MAX_IN; ++i) {
+ yagl_vector_init(&t->in_arrays[i].v, 1, 0);
+ t->in_arrays[i].mt = yagl_mem_transfer_create();
+ }
+
+ return t;
+}
+
+void yagl_transport_destroy(struct yagl_transport *t)
+{
+ uint32_t i;
+
+ for (i = 0; i < YAGL_TRANSPORT_MAX_OUT; ++i) {
+ yagl_vector_cleanup(&t->out_arrays[i]);
+ }
+
+ for (i = 0; i < YAGL_TRANSPORT_MAX_IN; ++i) {
+ yagl_vector_cleanup(&t->in_arrays[i].v);
+ yagl_mem_transfer_destroy(t->in_arrays[i].mt);
+ }
+
+ g_free(t);
+}
+
+void yagl_transport_begin(struct yagl_transport *t,
+ uint8_t **pages,
+ uint32_t offset)
+{
+ t->pages = pages;
+ t->offset = offset;
+ t->page_index = offset / TARGET_PAGE_SIZE;
+ t->ptr = t->pages[t->page_index] + (offset & ~TARGET_PAGE_MASK);
+ t->next_page = t->pages[t->page_index] + TARGET_PAGE_SIZE;
+}
+
+void yagl_transport_begin_call(struct yagl_transport *t,
+ yagl_api_id *api_id,
+ yagl_func_id *func_id)
+{
+ *api_id = yagl_transport_get_out_uint32_t(t);
+
+ if (!*api_id) {
+ return;
+ }
+
+ *func_id = yagl_transport_get_out_uint32_t(t);
+
+ t->res = (uint32_t*)t->ptr;
+ t->direct = yagl_transport_get_out_uint32_t(t);
+ t->num_out_arrays = t->num_in_arrays = 0;
+}
+
+void yagl_transport_end_call(struct yagl_transport *t)
+{
+ uint32_t i;
+
+ for (i = 0; i < t->num_in_arrays; ++i) {
+ struct yagl_transport_in_array *in_array = &t->in_arrays[i];
+
+ if (*in_array->count > 0) {
+ if (t->direct) {
+ yagl_mem_put(in_array->mt,
+ yagl_vector_data(&in_array->v),
+ *in_array->count * in_array->el_size);
+ } else {
+ yagl_transport_copy_to(t,
+ in_array->page_index,
+ in_array->ptr,
+ yagl_vector_data(&in_array->v),
+ *in_array->count * in_array->el_size);
+ }
+ }
+ }
+
+ *t->res = yagl_call_result_ok;
+}
+
+uint32_t yagl_transport_bytes_processed(struct yagl_transport *t)
+{
+ uint32_t start_page_index = t->offset / TARGET_PAGE_SIZE;
+ uint32_t start_page_offset = t->offset & ~TARGET_PAGE_MASK;
+ uint32_t end_page_offset = t->ptr - t->pages[t->page_index];
+
+ return (t->page_index - start_page_index) * TARGET_PAGE_SIZE +
+ end_page_offset - start_page_offset;
+}
+
+bool yagl_transport_get_out_array(struct yagl_transport *t,
+ int32_t el_size,
+ const void **data,
+ int32_t *count)
+{
+ target_ulong va = (target_ulong)yagl_transport_get_out_uint32_t(t);
+ uint32_t size;
+ struct yagl_vector *v;
+
+ *count = yagl_transport_get_out_uint32_t(t);
+
+ if (!va) {
+ *data = NULL;
+ return true;
+ }
+
+ size = (*count > 0) ? (*count * el_size) : 0;
+
+ if (t->direct) {
+ v = &t->out_arrays[t->num_out_arrays];
+
+ yagl_vector_resize(v, size);
+
+ if (!yagl_mem_get(va, size, yagl_vector_data(v))) {
+ *t->res = yagl_call_result_retry;
+ return false;
+ }
+
+ ++t->num_out_arrays;
+
+ *data = yagl_vector_data(v);
+
+ return true;
+ }
+
+ if ((t->ptr + size) <= t->next_page) {
+ *data = t->ptr;
+
+ yagl_transport_advance(t, (size + 7U) & ~7U);
+
+ return true;
+ }
+
+ v = &t->out_arrays[t->num_out_arrays];
+
+ yagl_vector_resize(v, size);
+
+ yagl_transport_copy_from(t, yagl_vector_data(v), size);
+ yagl_transport_advance(t, 7U - ((size + 7U) & 7U));
+
+ ++t->num_out_arrays;
+
+ *data = yagl_vector_data(v);
+
+ return true;
+}
+
+bool yagl_transport_get_in_array(struct yagl_transport *t,
+ int32_t el_size,
+ void **data,
+ int32_t *maxcount,
+ int32_t **count)
+{
+ target_ulong va = (target_ulong)yagl_transport_get_out_uint32_t(t);
+ uint32_t size;
+ struct yagl_transport_in_array *in_array;
+
+ *count = (int32_t*)t->ptr;
+ *maxcount = yagl_transport_get_out_uint32_t(t);
+
+ if (!va) {
+ *data = NULL;
+ return true;
+ }
+
+ size = (*maxcount > 0) ? (*maxcount * el_size) : 0;
+
+ if (t->direct) {
+ in_array = &t->in_arrays[t->num_in_arrays];
+
+ if (!yagl_mem_prepare(in_array->mt, va, size)) {
+ *t->res = yagl_call_result_retry;
+ return false;
+ }
+
+ yagl_vector_resize(&in_array->v, size);
+
+ in_array->el_size = el_size;
+ in_array->count = *count;
+
+ ++t->num_in_arrays;
+
+ *data = yagl_vector_data(&in_array->v);
+
+ return true;
+ }
+
+ if ((t->ptr + size) <= t->next_page) {
+ *data = t->ptr;
+
+ yagl_transport_advance(t, (size + 7U) & ~7U);
+
+ return true;
+ }
+
+ in_array = &t->in_arrays[t->num_in_arrays];
+
+ in_array->page_index = t->page_index;
+ in_array->ptr = t->ptr;
+
+ yagl_vector_resize(&in_array->v, size);
+
+ in_array->el_size = el_size;
+ in_array->count = *count;
+
+ yagl_transport_advance(t, (size + 7U) & ~7U);
+
+ ++t->num_in_arrays;
+
+ *data = yagl_vector_data(&in_array->v);
+
+ return true;
+}
diff --git a/hw/yagl/yagl_transport.h b/hw/yagl/yagl_transport.h
new file mode 100644
index 0000000000..07cc5027af
--- /dev/null
+++ b/hw/yagl/yagl_transport.h
@@ -0,0 +1,182 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_TRANSPORT_H
+#define _QEMU_YAGL_TRANSPORT_H
+
+#include "yagl_types.h"
+#include "yagl_vector.h"
+
+#define YAGL_TRANSPORT_MAX_IN 8
+#define YAGL_TRANSPORT_MAX_OUT 8
+
+struct yagl_mem_transfer;
+
+struct yagl_transport_in_array
+{
+ struct yagl_mem_transfer *mt;
+ struct yagl_vector v;
+
+ uint32_t page_index;
+ uint8_t *ptr;
+
+ int32_t el_size;
+ int32_t *count;
+};
+
+struct yagl_transport
+{
+ /*
+ * per-batch.
+ * @{
+ */
+
+ uint8_t **pages;
+ uint32_t offset;
+
+ uint32_t page_index;
+ uint8_t *next_page;
+
+ uint8_t *ptr;
+
+ /*
+ * @}
+ */
+
+ /*
+ * per-call.
+ * @{
+ */
+
+ bool direct;
+
+ uint32_t *res;
+
+ uint32_t num_out_arrays;
+ uint32_t num_in_arrays;
+
+ struct yagl_vector out_arrays[YAGL_TRANSPORT_MAX_OUT];
+ struct yagl_transport_in_array in_arrays[YAGL_TRANSPORT_MAX_IN];
+
+ /*
+ * @}
+ */
+};
+
+struct yagl_transport *yagl_transport_create(void);
+
+void yagl_transport_destroy(struct yagl_transport *t);
+
+void yagl_transport_begin(struct yagl_transport *t,
+ uint8_t **pages,
+ uint32_t offset);
+
+void yagl_transport_begin_call(struct yagl_transport *t,
+ yagl_api_id *api_id,
+ yagl_func_id *func_id);
+
+void yagl_transport_end_call(struct yagl_transport *t);
+
+uint32_t yagl_transport_bytes_processed(struct yagl_transport *t);
+
+bool yagl_transport_get_out_array(struct yagl_transport *t,
+ int32_t el_size,
+ const void **data,
+ int32_t *count);
+
+bool yagl_transport_get_in_array(struct yagl_transport *t,
+ int32_t el_size,
+ void **data,
+ int32_t *maxcount,
+ int32_t **count);
+
+static __inline void yagl_transport_advance(struct yagl_transport *t,
+ uint32_t size)
+{
+ t->ptr += size;
+
+ if (t->ptr >= t->next_page) {
+ uint32_t offset = t->ptr - t->next_page;
+
+ t->page_index += 1 + (offset / TARGET_PAGE_SIZE);
+ t->ptr = t->pages[t->page_index] + (offset & ~TARGET_PAGE_MASK);
+ t->next_page = t->pages[t->page_index] + TARGET_PAGE_SIZE;
+ }
+}
+
+static __inline uint8_t yagl_transport_get_out_uint8_t(struct yagl_transport *t)
+{
+ uint8_t tmp = *t->ptr;
+ yagl_transport_advance(t, 8);
+ return tmp;
+}
+
+static __inline uint32_t yagl_transport_get_out_uint32_t(struct yagl_transport *t)
+{
+ uint32_t tmp = *(uint32_t*)t->ptr;
+ yagl_transport_advance(t, 8);
+ return tmp;
+}
+
+static __inline float yagl_transport_get_out_float(struct yagl_transport *t)
+{
+ float tmp = *(float*)t->ptr;
+ yagl_transport_advance(t, 8);
+ return tmp;
+}
+
+static __inline void yagl_transport_get_in_arg(struct yagl_transport *t,
+ void **value)
+{
+ target_ulong va = (target_ulong)yagl_transport_get_out_uint32_t(t);
+
+ if (va) {
+ *value = t->ptr;
+ yagl_transport_advance(t, 8);
+ } else {
+ *value = NULL;
+ }
+}
+
+static __inline yagl_host_handle yagl_transport_get_out_yagl_host_handle(struct yagl_transport *t)
+{
+ return yagl_transport_get_out_uint32_t(t);
+}
+
+static __inline yagl_winsys_id yagl_transport_get_out_yagl_winsys_id(struct yagl_transport *t)
+{
+ return yagl_transport_get_out_uint32_t(t);
+}
+
+static __inline target_ulong yagl_transport_get_out_va(struct yagl_transport *t)
+{
+ return (target_ulong)yagl_transport_get_out_uint32_t(t);
+}
+
+#endif
diff --git a/hw/yagl/yagl_transport_egl.h b/hw/yagl/yagl_transport_egl.h
new file mode 100644
index 0000000000..38869df906
--- /dev/null
+++ b/hw/yagl/yagl_transport_egl.h
@@ -0,0 +1,47 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_TRANSPORT_EGL_H
+#define _QEMU_YAGL_TRANSPORT_EGL_H
+
+#include "yagl_types.h"
+#include "yagl_transport.h"
+#include <EGL/egl.h>
+
+static __inline EGLint yagl_transport_get_out_EGLint(struct yagl_transport *t)
+{
+ return yagl_transport_get_out_uint32_t(t);
+}
+
+static __inline EGLenum yagl_transport_get_out_EGLenum(struct yagl_transport *t)
+{
+ return yagl_transport_get_out_uint32_t(t);
+}
+
+#endif
diff --git a/hw/yagl/yagl_transport_gl.h b/hw/yagl/yagl_transport_gl.h
new file mode 100644
index 0000000000..bd5af3423f
--- /dev/null
+++ b/hw/yagl/yagl_transport_gl.h
@@ -0,0 +1,81 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_TRANSPORT_GL_H
+#define _QEMU_YAGL_TRANSPORT_GL_H
+
+#include "yagl_types.h"
+#include "yagl_transport.h"
+
+static __inline GLbitfield yagl_transport_get_out_GLbitfield(struct yagl_transport *t)
+{
+ return yagl_transport_get_out_uint32_t(t);
+}
+
+static __inline GLboolean yagl_transport_get_out_GLboolean(struct yagl_transport *t)
+{
+ return yagl_transport_get_out_uint8_t(t);
+}
+
+static __inline GLubyte yagl_transport_get_out_GLubyte(struct yagl_transport *t)
+{
+ return yagl_transport_get_out_uint8_t(t);
+}
+
+static __inline GLclampf yagl_transport_get_out_GLclampf(struct yagl_transport *t)
+{
+ return yagl_transport_get_out_float(t);
+}
+
+static __inline GLenum yagl_transport_get_out_GLenum(struct yagl_transport *t)
+{
+ return yagl_transport_get_out_uint32_t(t);
+}
+
+static __inline GLfloat yagl_transport_get_out_GLfloat(struct yagl_transport *t)
+{
+ return yagl_transport_get_out_float(t);
+}
+
+static __inline GLint yagl_transport_get_out_GLint(struct yagl_transport *t)
+{
+ return yagl_transport_get_out_uint32_t(t);
+}
+
+static __inline GLsizei yagl_transport_get_out_GLsizei(struct yagl_transport *t)
+{
+ return yagl_transport_get_out_uint32_t(t);
+}
+
+static __inline GLuint yagl_transport_get_out_GLuint(struct yagl_transport *t)
+{
+ return yagl_transport_get_out_uint32_t(t);
+}
+
+#endif
diff --git a/hw/yagl/yagl_types.h b/hw/yagl/yagl_types.h
new file mode 100644
index 0000000000..e5d01093be
--- /dev/null
+++ b/hw/yagl/yagl_types.h
@@ -0,0 +1,79 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_TYPES_H
+#define _QEMU_YAGL_TYPES_H
+
+#include "qemu-common.h"
+
+typedef uint32_t yagl_pid;
+typedef uint32_t yagl_tid;
+typedef uint32_t yagl_func_id;
+typedef uint32_t yagl_host_handle;
+typedef uint32_t yagl_object_name;
+typedef uint32_t yagl_winsys_id;
+
+struct yagl_transport;
+
+/*
+ * YaGL supported render types.
+ */
+typedef enum
+{
+ yagl_render_type_offscreen = 1,
+ yagl_render_type_onscreen = 2,
+} yagl_render_type;
+
+/*
+ * YaGL supported API ids.
+ */
+typedef enum
+{
+ yagl_api_id_egl = 1,
+ yagl_api_id_gles = 2
+} yagl_api_id;
+
+#define YAGL_NUM_APIS 2
+
+/*
+ * EGL client APIs.
+ */
+typedef enum
+{
+ yagl_client_api_ogl = 0,
+ yagl_client_api_gles1 = 1,
+ yagl_client_api_gles2 = 2,
+ yagl_client_api_ovg = 3
+} yagl_client_api;
+
+#define YAGL_NUM_CLIENT_APIS 4
+
+typedef bool (*yagl_api_func)(struct yagl_transport */*t*/);
+
+#endif
diff --git a/hw/yagl/yagl_vector.c b/hw/yagl/yagl_vector.c
new file mode 100644
index 0000000000..9beef4ab51
--- /dev/null
+++ b/hw/yagl/yagl_vector.c
@@ -0,0 +1,113 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "yagl_vector.h"
+
+#define YAGL_VECTOR_DEFAULT_CAPACITY 10
+
+void yagl_vector_init(struct yagl_vector *v,
+ int elem_size,
+ int initial_capacity)
+{
+ assert(elem_size > 0);
+
+ v->elem_size = elem_size;
+ v->capacity = (initial_capacity < YAGL_VECTOR_DEFAULT_CAPACITY) ?
+ YAGL_VECTOR_DEFAULT_CAPACITY
+ : initial_capacity;
+ v->data = g_malloc0(v->capacity * v->elem_size);
+ v->size = 0;
+}
+
+void yagl_vector_cleanup(struct yagl_vector *v)
+{
+ g_free(v->data);
+ memset(v, 0, sizeof(*v));
+}
+
+void *yagl_vector_detach(struct yagl_vector *v)
+{
+ void *tmp = v->data;
+ memset(v, 0, sizeof(*v));
+ return tmp;
+}
+
+int yagl_vector_size(struct yagl_vector *v)
+{
+ return v->size;
+}
+
+int yagl_vector_capacity(struct yagl_vector *v)
+{
+ return v->capacity;
+}
+
+void yagl_vector_push_back(struct yagl_vector *v, const void *elem)
+{
+ if (v->size >= v->capacity) {
+ void *tmp;
+
+ v->capacity = (v->size * 3) / 2;
+
+ tmp = g_malloc(v->capacity * v->elem_size);
+ memcpy(tmp, v->data, (v->size * v->elem_size));
+
+ g_free(v->data);
+
+ v->data = tmp;
+ }
+
+ memcpy((char*)v->data + (v->size * v->elem_size), elem, v->elem_size);
+
+ ++v->size;
+}
+
+void yagl_vector_resize(struct yagl_vector *v, int new_size)
+{
+ if (new_size <= v->capacity) {
+ v->size = new_size;
+ } else {
+ void *tmp;
+
+ v->capacity = (new_size * 3) / 2;
+
+ tmp = g_malloc(v->capacity * v->elem_size);
+ memcpy(tmp, v->data, (v->size * v->elem_size));
+
+ g_free(v->data);
+
+ v->data = tmp;
+ v->size = new_size;
+ }
+}
+
+void *yagl_vector_data(struct yagl_vector *v)
+{
+ return v->data;
+}
diff --git a/hw/yagl/yagl_vector.h b/hw/yagl/yagl_vector.h
new file mode 100644
index 0000000000..a09b2f723d
--- /dev/null
+++ b/hw/yagl/yagl_vector.h
@@ -0,0 +1,69 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_VECTOR_H
+#define _QEMU_YAGL_VECTOR_H
+
+#include "yagl_types.h"
+
+struct yagl_vector
+{
+ void *data;
+ int elem_size;
+ int size;
+ int capacity;
+};
+
+void yagl_vector_init(struct yagl_vector *v,
+ int elem_size,
+ int initial_capacity);
+
+/*
+ * Cleans up the vector, you must call 'yagl_vector_init' again to be able
+ * to use it.
+ */
+void yagl_vector_cleanup(struct yagl_vector *v);
+
+/*
+ * Detaches the buffer from vector. vector will automatically clean up,
+ * you must call 'yagl_vector_init' again to be able to use it.
+ */
+void *yagl_vector_detach(struct yagl_vector *v);
+
+int yagl_vector_size(struct yagl_vector *v);
+
+int yagl_vector_capacity(struct yagl_vector *v);
+
+void yagl_vector_push_back(struct yagl_vector *v, const void *elem);
+
+void yagl_vector_resize(struct yagl_vector *v, int new_size);
+
+void *yagl_vector_data(struct yagl_vector *v);
+
+#endif
diff --git a/hw/yagl/yagl_version.h b/hw/yagl/yagl_version.h
new file mode 100644
index 0000000000..638149e64a
--- /dev/null
+++ b/hw/yagl/yagl_version.h
@@ -0,0 +1,40 @@
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_VERSION_H
+#define _QEMU_YAGL_VERSION_H
+
+#include "qemu-common.h"
+
+/*
+ * Whenever protocol changes be sure to bump this.
+ */
+#define YAGL_VERSION 21
+
+#endif