summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile21
-rw-r--r--configs/linux-opengl-es27
-rw-r--r--configure.ac18
-rw-r--r--progs/es1/.gitignore10
-rw-r--r--progs/es1/screen/Makefile32
-rw-r--r--progs/es1/screen/gears.c374
-rw-r--r--progs/es1/screen/tri.c129
-rw-r--r--progs/es1/screen/winsys.c272
-rw-r--r--progs/es1/screen/winsys.h36
-rw-r--r--progs/es1/xegl/Makefile77
-rw-r--r--progs/es1/xegl/drawtex.c427
-rw-r--r--progs/es1/xegl/es1_info.c274
-rw-r--r--progs/es1/xegl/msaa.c442
-rw-r--r--progs/es1/xegl/pbuffer.c607
-rw-r--r--progs/es1/xegl/render_tex.c657
-rw-r--r--progs/es1/xegl/torus.c656
-rw-r--r--progs/es1/xegl/tri.c470
-rw-r--r--progs/es1/xegl/two_win.c433
-rw-r--r--progs/es2/.gitignore3
-rw-r--r--progs/es2/xegl/Makefile51
-rw-r--r--progs/es2/xegl/tri.c514
-rw-r--r--src/gallium/state_trackers/Makefile6
-rw-r--r--src/gallium/state_trackers/egl/egl_tracker.c2
-rw-r--r--src/gallium/state_trackers/es/Makefile88
-rw-r--r--src/gallium/state_trackers/es/st_es1.c1
-rw-r--r--src/gallium/state_trackers/es/st_es2.c1
-rw-r--r--src/gallium/winsys/drm/intel/egl/Makefile29
-rw-r--r--src/gallium/winsys/drm/intel/egl/dummy.c1
-rw-r--r--src/gallium/winsys/drm/radeon/egl/Makefile28
-rw-r--r--src/gallium/winsys/drm/radeon/egl/dummy.c1
-rw-r--r--src/gallium/winsys/egl_xlib/Makefile15
-rw-r--r--src/gallium/winsys/xlib/xlib.c30
-rw-r--r--src/mesa/drivers/x11/glxapi.c30
-rw-r--r--src/mesa/es/.gitignore5
-rw-r--r--src/mesa/es/Makefile134
-rw-r--r--src/mesa/es/glapi/Makefile94
-rw-r--r--src/mesa/es/glapi/base1_API.xml744
-rw-r--r--src/mesa/es/glapi/base2_API.xml533
-rw-r--r--src/mesa/es/glapi/es1_API.xml1100
-rw-r--r--src/mesa/es/glapi/es1_COMPAT.xml135
-rw-r--r--src/mesa/es/glapi/es1_EXT.xml699
-rw-r--r--src/mesa/es/glapi/es2_API.xml294
-rw-r--r--src/mesa/es/glapi/es2_COMPAT.xml368
-rw-r--r--src/mesa/es/glapi/es2_EXT.xml162
-rw-r--r--src/mesa/es/glapi/es_COMPAT.xml2646
-rw-r--r--src/mesa/es/glapi/es_EXT.xml122
-rw-r--r--src/mesa/es/glapi/gl_compare.py354
-rw-r--r--src/mesa/es/glapi/gl_parse_header.py450
-rw-r--r--src/mesa/es/main/APIspec.dtd52
-rw-r--r--src/mesa/es/main/APIspec.py617
-rw-r--r--src/mesa/es/main/APIspec.xml4297
-rw-r--r--src/mesa/es/main/APIspecutil.py265
-rw-r--r--src/mesa/es/main/drawtex.c148
-rw-r--r--src/mesa/es/main/drawtex.h77
-rw-r--r--src/mesa/es/main/es_cpaltex.c231
-rw-r--r--src/mesa/es/main/es_enable.c91
-rw-r--r--src/mesa/es/main/es_fbo.c37
-rw-r--r--src/mesa/es/main/es_generator.py685
-rw-r--r--src/mesa/es/main/es_query_matrix.c199
-rw-r--r--src/mesa/es/main/es_texgen.c73
-rw-r--r--src/mesa/es/main/get_gen.py809
-rw-r--r--src/mesa/es/main/mfeatures_es1.h116
-rw-r--r--src/mesa/es/main/mfeatures_es2.h116
-rw-r--r--src/mesa/es/main/specials_es1.c213
-rw-r--r--src/mesa/es/main/specials_es2.c174
-rw-r--r--src/mesa/es/main/stubs.c138
-rw-r--r--src/mesa/es/sources.mak167
-rw-r--r--src/mesa/es/state_tracker/st_cb_drawtex.c297
-rw-r--r--src/mesa/es/state_tracker/st_cb_drawtex.h18
-rw-r--r--src/mesa/glapi/dispatch.h6
-rw-r--r--src/mesa/glapi/gl_XML.py3
-rw-r--r--src/mesa/glapi/gl_apitemp.py121
-rw-r--r--src/mesa/glapi/gl_enums.py8
-rw-r--r--src/mesa/glapi/gl_offsets.py30
-rw-r--r--src/mesa/glapi/gl_procs.py37
-rw-r--r--src/mesa/glapi/gl_table.py49
-rw-r--r--src/mesa/glapi/gl_x86-64_asm.py2
-rw-r--r--src/mesa/glapi/gl_x86_asm.py2
-rw-r--r--src/mesa/glapi/glapi.c8
-rw-r--r--src/mesa/glapi/glapi_getproc.c8
-rw-r--r--src/mesa/glapi/glapitemp.h385
-rw-r--r--src/mesa/glapi/glthread.c2
-rw-r--r--src/mesa/glapi/remap_helper.py24
-rw-r--r--src/mesa/main/dd.h10
-rw-r--r--src/mesa/main/dispatch.c4
-rw-r--r--src/mesa/main/enums.c8
-rw-r--r--src/mesa/main/extensions.c3
-rw-r--r--src/mesa/main/getstring.c5
-rw-r--r--src/mesa/main/glheader.h7
-rw-r--r--src/mesa/main/mtypes.h3
-rw-r--r--src/mesa/main/remap.c2
-rw-r--r--src/mesa/main/texgen.c4
-rw-r--r--src/mesa/main/texgen.h6
-rw-r--r--src/mesa/main/texgetimage.c62
-rw-r--r--src/mesa/state_tracker/st_context.c9
-rw-r--r--src/mesa/state_tracker/st_extensions.c4
-rw-r--r--src/mesa/swrast/swrast.h6
-rw-r--r--src/mesa/x86-64/glapi_x86-64.S2
-rw-r--r--src/mesa/x86/glapi_x86.S2
99 files changed, 22897 insertions, 347 deletions
diff --git a/Makefile b/Makefile
index 1b46a9193e..16395bcc8b 100644
--- a/Makefile
+++ b/Makefile
@@ -127,6 +127,7 @@ linux-ia64-icc-static \
linux-icc \
linux-icc-static \
linux-llvm \
+linux-opengl-es \
linux-osmesa \
linux-osmesa-static \
linux-osmesa16 \
@@ -308,10 +309,25 @@ MAIN_FILES = \
$(DIRECTORY)/progs/util/sampleMakefile \
$(DIRECTORY)/windows/VC8/
-EGL_FILES = \
- $(DIRECTORY)/include/EGL/*.h \
+ES_FILES = \
$(DIRECTORY)/include/GLES/*.h \
$(DIRECTORY)/include/GLES2/*.h \
+ $(DIRECTORY)/src/mesa/glapi/*.xml \
+ $(DIRECTORY)/src/mesa/glapi/*.py \
+ $(DIRECTORY)/src/mesa/glapi/*.dtd \
+ $(DIRECTORY)/src/mesa/es/glapi/Makefile \
+ $(DIRECTORY)/src/mesa/es/glapi/*.xml \
+ $(DIRECTORY)/src/mesa/es/glapi/*.py \
+ $(DIRECTORY)/src/mesa/es/state_tracker/*.[ch] \
+ $(DIRECTORY)/src/mesa/es/main/*.[ch] \
+ $(DIRECTORY)/src/mesa/es/main/*.xml \
+ $(DIRECTORY)/src/mesa/es/main/*.py \
+ $(DIRECTORY)/src/mesa/es/main/*.dtd \
+ $(DIRECTORY)/src/mesa/es/Makefile \
+ $(DIRECTORY)/src/mesa/es/sources.mak \
+
+EGL_FILES = \
+ $(DIRECTORY)/include/EGL/*.h \
$(DIRECTORY)/src/egl/Makefile \
$(DIRECTORY)/src/egl/*/Makefile \
$(DIRECTORY)/src/egl/*/*.[ch] \
@@ -479,6 +495,7 @@ DEPEND_FILES = \
LIB_FILES = \
$(MAIN_FILES) \
+ $(ES_FILES) \
$(EGL_FILES) \
$(GALLIUM_FILES) \
$(DRI_FILES) \
diff --git a/configs/linux-opengl-es b/configs/linux-opengl-es
new file mode 100644
index 0000000000..1254f0693d
--- /dev/null
+++ b/configs/linux-opengl-es
@@ -0,0 +1,27 @@
+# Configuration for OpenGL ES on Linux
+
+include $(TOP)/configs/linux
+
+CONFIG_NAME = linux-opengl-es
+
+# Directories to build
+LIB_DIR = lib
+SRC_DIRS = egl mesa/es gallium gallium/winsys
+PROGRAM_DIRS = es1/screen es1/xegl es2/xegl
+
+# no mesa or egl drivers
+DRIVER_DIRS =
+EGL_DRIVERS_DIRS =
+
+GALLIUM_DRIVERS_DIRS = softpipe
+
+# build egl_softpipe.so
+GALLIUM_WINSYS_DIRS = egl_xlib
+# and libGLES*.so
+GALLIUM_STATE_TRACKERS_DIRS = es
+
+# build egl_i915.so
+GALLIUM_DRIVERS_DIRS += trace i915
+GALLIUM_STATE_TRACKERS_DIRS += egl
+GALLIUM_WINSYS_DIRS += drm
+GALLIUM_WINSYS_DRM_DIRS = intel
diff --git a/configure.ac b/configure.ac
index 23bce96ca6..1f94248824 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1178,14 +1178,22 @@ yes)
test -d "$srcdir/src/gallium/state_trackers/$tracker" || \
AC_MSG_ERROR([state tracker '$tracker' doesn't exist])
- if test "$tracker" = egl && test "x$enable_egl" != xyes; then
- AC_MSG_ERROR([cannot build egl state tracker without EGL library])
- fi
- if test "$tracker" = xorg; then
+ case "$tracker" in
+ egl)
+ if test "x$enable_egl" != xyes; then
+ AC_MSG_ERROR([cannot build egl state tracker without EGL library])
+ fi
+ ;;
+ xorg)
PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
HAVE_XEXTPROTO_71="yes"; DEFINES="$DEFINES -DHAVE_XEXTPROTO_71",
HAVE_XEXTPROTO_71="no")
- fi
+ ;;
+ es)
+ # mesa/es is required to build es state tracker
+ SRC_DIRS="mesa/es $SRC_DIRS"
+ ;;
+ esac
done
GALLIUM_STATE_TRACKERS_DIRS="$state_trackers"
;;
diff --git a/progs/es1/.gitignore b/progs/es1/.gitignore
new file mode 100644
index 0000000000..4f1427531a
--- /dev/null
+++ b/progs/es1/.gitignore
@@ -0,0 +1,10 @@
+screen/gears
+screen/tri
+xegl/drawtex
+xegl/es1_info
+xegl/msaa
+xegl/pbuffer
+xegl/render_tex
+xegl/torus
+xegl/tri
+xegl/two_win
diff --git a/progs/es1/screen/Makefile b/progs/es1/screen/Makefile
new file mode 100644
index 0000000000..4ba2f9a7dc
--- /dev/null
+++ b/progs/es1/screen/Makefile
@@ -0,0 +1,32 @@
+# progs/es1/screen/Makefile
+
+TOP = ../../..
+include $(TOP)/configs/current
+
+ES1_CFLAGS = -I$(TOP)/include
+ES1_LIBS = -L$(TOP)/$(LIB_DIR) -lEGL -lGLESv1_CM
+
+ES1_LIB_DEPS = \
+ $(TOP)/$(LIB_DIR)/libEGL.so \
+ $(TOP)/$(LIB_DIR)/libGLESv1_CM.so
+
+WINSYS_OBJS = winsys.o
+
+PROGRAMS = \
+ gears \
+ tri
+
+.c.o:
+ $(CC) -c $(ES1_CFLAGS) $(CFLAGS) $< -o $@
+
+default: $(PROGRAMS)
+
+gears: gears.o $(WINSYS_OBJS) $(ES1_LIB_DEPS)
+ $(CC) $(CFLAGS) -o $@ $@.o $(WINSYS_OBJS) $(ES1_LIBS)
+
+tri: tri.o $(WINSYS_OBJS) $(ES1_LIB_DEPS)
+ $(CC) $(CFLAGS) -o $@ $@.o $(WINSYS_OBJS) $(ES1_LIBS)
+
+clean:
+ -rm -f *.o *~
+ -rm -f $(PROGRAMS)
diff --git a/progs/es1/screen/gears.c b/progs/es1/screen/gears.c
new file mode 100644
index 0000000000..c7625826b9
--- /dev/null
+++ b/progs/es1/screen/gears.c
@@ -0,0 +1,374 @@
+/*
+ * Copyright (C) 2009 Chia-I Wu <olv@0xlab.org>
+ *
+ * Based on eglgears by
+ * Copyright (C) 1999-2001 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.
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <math.h>
+#include <assert.h>
+
+#include <GLES/gl.h>
+#include "winsys.h"
+
+#ifndef M_PI
+#define M_PI 3.14159265
+#endif
+
+
+struct gear {
+ GLuint vbo;
+ GLfloat *vertices;
+ GLsizei stride;
+
+ GLint num_teeth;
+};
+
+static GLfloat view_rotx = 20.0, view_roty = 30.0, view_rotz = 0.0;
+static struct gear gears[3];
+static GLfloat angle = 0.0;
+
+/*
+ * Initialize a gear wheel.
+ *
+ * Input: gear - gear to initialize
+ * inner_radius - radius of hole at center
+ * outer_radius - radius at center of teeth
+ * width - width of gear
+ * teeth - number of teeth
+ * tooth_depth - depth of tooth
+ */
+static void
+init_gear(struct gear *gear, GLfloat inner_radius, GLfloat outer_radius,
+ GLfloat width, GLint teeth, GLfloat tooth_depth)
+{
+ GLfloat r0, r1, r2;
+ GLfloat a0, da;
+ GLint verts_per_tooth, total_verts, total_size;
+ GLint count, i;
+ GLfloat *verts;
+
+ r0 = inner_radius;
+ r1 = outer_radius - tooth_depth / 2.0;
+ r2 = outer_radius + tooth_depth / 2.0;
+
+ a0 = 2.0 * M_PI / teeth;
+ da = a0 / 4.0;
+
+ gear->vbo = 0;
+ gear->vertices = NULL;
+ gear->stride = sizeof(GLfloat) * 6; /* XYZ + normal */
+ gear->num_teeth = teeth;
+
+ verts_per_tooth = 10 + 4;
+ total_verts = teeth * verts_per_tooth;
+ total_size = total_verts * gear->stride;
+
+ verts = malloc(total_size);
+ if (!verts) {
+ printf("failed to allocate vertices\n");
+ return;
+ }
+
+#define GEAR_VERT(r, n, sign) \
+ do { \
+ verts[count * 6 + 0] = (r) * vx[n]; \
+ verts[count * 6 + 1] = (r) * vy[n]; \
+ verts[count * 6 + 2] = (sign) * width * 0.5; \
+ verts[count * 6 + 3] = normal[0]; \
+ verts[count * 6 + 4] = normal[1]; \
+ verts[count * 6 + 5] = normal[2]; \
+ count++; \
+ } while (0)
+
+ count = 0;
+ for (i = 0; i < teeth; i++) {
+ GLfloat normal[3];
+ GLfloat vx[5], vy[5];
+ GLfloat u, v;
+
+ normal[0] = 0.0;
+ normal[1] = 0.0;
+ normal[2] = 0.0;
+
+ vx[0] = cos(i * a0 + 0 * da);
+ vy[0] = sin(i * a0 + 0 * da);
+ vx[1] = cos(i * a0 + 1 * da);
+ vy[1] = sin(i * a0 + 1 * da);
+ vx[2] = cos(i * a0 + 2 * da);
+ vy[2] = sin(i * a0 + 2 * da);
+ vx[3] = cos(i * a0 + 3 * da);
+ vy[3] = sin(i * a0 + 3 * da);
+ vx[4] = cos(i * a0 + 4 * da);
+ vy[4] = sin(i * a0 + 4 * da);
+
+ /* outward faces of a tooth, 10 verts */
+ normal[0] = vx[0];
+ normal[1] = vy[0];
+ GEAR_VERT(r1, 0, 1);
+ GEAR_VERT(r1, 0, -1);
+
+ u = r2 * vx[1] - r1 * vx[0];
+ v = r2 * vy[1] - r1 * vy[0];
+ normal[0] = v;
+ normal[1] = -u;
+ GEAR_VERT(r2, 1, 1);
+ GEAR_VERT(r2, 1, -1);
+
+ normal[0] = vx[0];
+ normal[1] = vy[0];
+ GEAR_VERT(r2, 2, 1);
+ GEAR_VERT(r2, 2, -1);
+
+ u = r1 * vx[3] - r2 * vx[2];
+ v = r1 * vy[3] - r2 * vy[2];
+ normal[0] = v;
+ normal[1] = -u;
+ GEAR_VERT(r1, 3, 1);
+ GEAR_VERT(r1, 3, -1);
+
+ normal[0] = vx[0];
+ normal[1] = vy[0];
+ GEAR_VERT(r1, 4, 1);
+ GEAR_VERT(r1, 4, -1);
+
+ /* inside radius cylinder, 4 verts */
+ normal[0] = -vx[4];
+ normal[1] = -vy[4];
+ GEAR_VERT(r0, 4, 1);
+ GEAR_VERT(r0, 4, -1);
+
+ normal[0] = -vx[0];
+ normal[1] = -vy[0];
+ GEAR_VERT(r0, 0, 1);
+ GEAR_VERT(r0, 0, -1);
+
+ assert(count % verts_per_tooth == 0);
+ }
+ assert(count == total_verts);
+#undef GEAR_VERT
+
+ gear->vertices = verts;
+
+ /* setup VBO */
+ glGenBuffers(1, &gear->vbo);
+ if (gear->vbo) {
+ glBindBuffer(GL_ARRAY_BUFFER, gear->vbo);
+ glBufferData(GL_ARRAY_BUFFER, total_size, verts, GL_STATIC_DRAW);
+ }
+}
+
+
+static void
+draw_gear(const struct gear *gear)
+{
+ GLint i;
+
+ if (!gear->vbo && !gear->vertices) {
+ printf("nothing to be drawn\n");
+ return;
+ }
+
+ if (gear->vbo) {
+ glBindBuffer(GL_ARRAY_BUFFER, gear->vbo);
+ glVertexPointer(3, GL_FLOAT, gear->stride, (const GLvoid *) 0);
+ glNormalPointer(GL_FLOAT, gear->stride, (const GLvoid *) (sizeof(GLfloat) * 3));
+ } else {
+ glBindBuffer(GL_ARRAY_BUFFER, 0);
+ glVertexPointer(3, GL_FLOAT, gear->stride, gear->vertices);
+ glNormalPointer(GL_FLOAT, gear->stride, gear->vertices + 3);
+ }
+
+ glEnableClientState(GL_VERTEX_ARRAY);
+
+ for (i = 0; i < gear->num_teeth; i++) {
+ const GLint base = (10 + 4) * i;
+ GLushort indices[7];
+
+ glShadeModel(GL_FLAT);
+
+ /* front face */
+ indices[0] = base + 12;
+ indices[1] = base + 0;
+ indices[2] = base + 2;
+ indices[3] = base + 4;
+ indices[4] = base + 6;
+ indices[5] = base + 8;
+ indices[6] = base + 10;
+
+ glNormal3f(0.0, 0.0, 1.0);
+ glDrawElements(GL_TRIANGLE_FAN, 7, GL_UNSIGNED_SHORT, indices);
+
+ /* back face */
+ indices[0] = base + 13;
+ indices[1] = base + 11;
+ indices[2] = base + 9;
+ indices[3] = base + 7;
+ indices[4] = base + 5;
+ indices[5] = base + 3;
+ indices[6] = base + 1;
+
+ glNormal3f(0.0, 0.0, -1.0);
+ glDrawElements(GL_TRIANGLE_FAN, 7, GL_UNSIGNED_SHORT, indices);
+
+ glEnableClientState(GL_NORMAL_ARRAY);
+
+ /* outward face of a tooth */
+ glDrawArrays(GL_TRIANGLE_STRIP, base, 10);
+
+ /* inside radius cylinder */
+ glShadeModel(GL_SMOOTH);
+ glDrawArrays(GL_TRIANGLE_STRIP, base + 10, 4);
+
+ glDisableClientState(GL_NORMAL_ARRAY);
+ }
+
+ glDisableClientState(GL_VERTEX_ARRAY);
+}
+
+
+static void
+gears_draw(void *data)
+{
+ static const GLfloat red[4] = { 0.8, 0.1, 0.0, 1.0 };
+ static const GLfloat green[4] = { 0.0, 0.8, 0.2, 1.0 };
+ static const GLfloat blue[4] = { 0.2, 0.2, 1.0, 1.0 };
+
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ glPushMatrix();
+ glRotatef(view_rotx, 1.0, 0.0, 0.0);
+ glRotatef(view_roty, 0.0, 1.0, 0.0);
+ glRotatef(view_rotz, 0.0, 0.0, 1.0);
+
+ glPushMatrix();
+ glTranslatef(-3.0, -2.0, 0.0);
+ glRotatef(angle, 0.0, 0.0, 1.0);
+
+ glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, red);
+ draw_gear(&gears[0]);
+
+ glPopMatrix();
+
+ glPushMatrix();
+ glTranslatef(3.1, -2.0, 0.0);
+ glRotatef(-2.0 * angle - 9.0, 0.0, 0.0, 1.0);
+
+ glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, green);
+ draw_gear(&gears[1]);
+
+ glPopMatrix();
+
+ glPushMatrix();
+ glTranslatef(-3.1, 4.2, 0.0);
+ glRotatef(-2.0 * angle - 25.0, 0.0, 0.0, 1.0);
+
+ glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, blue);
+ draw_gear(&gears[2]);
+
+ glPopMatrix();
+
+ glPopMatrix();
+
+ /* advance rotation for next frame */
+ angle += 0.5; /* 0.5 degree per frame */
+ if (angle > 3600.0)
+ angle -= 3600.0;
+}
+
+
+static void gears_fini(void)
+{
+ GLint i;
+ for (i = 0; i < 3; i++) {
+ struct gear *gear = &gears[i];
+ if (gear->vbo) {
+ glDeleteBuffers(1, &gear->vbo);
+ gear->vbo = 0;
+ }
+ if (gear->vertices) {
+ free(gear->vertices);
+ gear->vertices = NULL;
+ }
+ }
+}
+
+
+static void gears_init(void)
+{
+ static const GLfloat pos[4] = { 5.0, 5.0, 10.0, 0.0 };
+
+ glLightfv(GL_LIGHT0, GL_POSITION, pos);
+ glEnable(GL_CULL_FACE);
+ glEnable(GL_LIGHTING);
+ glEnable(GL_LIGHT0);
+ glEnable(GL_DEPTH_TEST);
+ glEnable(GL_NORMALIZE);
+
+ init_gear(&gears[0], 1.0, 4.0, 1.0, 20, 0.7);
+ init_gear(&gears[1], 0.5, 2.0, 2.0, 10, 0.7);
+ init_gear(&gears[2], 1.3, 2.0, 0.5, 10, 0.7);
+}
+
+
+/* new window size or exposure */
+static void
+gears_reshape(int width, int height)
+{
+ GLfloat h = (GLfloat) height / (GLfloat) width;
+
+ glViewport(0, 0, (GLint) width, (GLint) height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glFrustumf(-1.0, 1.0, -h, h, 5.0, 60.0);
+
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+ glTranslatef(0.0, 0.0, -40.0);
+}
+
+
+static void gears_run(void)
+{
+ winsysRun(5.0, gears_draw, NULL);
+}
+
+
+int
+main(int argc, char *argv[])
+{
+ EGLint width, height;
+
+ if (!winsysInitScreen())
+ exit(1);
+ winsysQueryScreenSize(&width, &height);
+
+ gears_init();
+ gears_reshape(width, height);
+ gears_run();
+ gears_fini();
+
+ winsysFiniScreen();
+
+ return 0;
+}
diff --git a/progs/es1/screen/tri.c b/progs/es1/screen/tri.c
new file mode 100644
index 0000000000..bab9499944
--- /dev/null
+++ b/progs/es1/screen/tri.c
@@ -0,0 +1,129 @@
+/*
+ * Copyright (C) 2009 Chia-I Wu <olv@0xlab.org>
+ *
+ * Based on egltri by
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * Copyright (C) 2008 Brian Paul All Rights Reserved.
+ * Copyright (C) 2008 Jakob Bornecrantz 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.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <GLES/gl.h>
+#include "winsys.h"
+
+static GLfloat view_rotx = 0.0, view_roty = 0.0, view_rotz = 0.0;
+
+static void tri_init()
+{
+ glClearColor(0.4, 0.4, 0.4, 0.0);
+}
+
+static void tri_reshape(int width, int height)
+{
+ GLfloat ar = (GLfloat) width / (GLfloat) height;
+
+ glViewport(0, 0, (GLint) width, (GLint) height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glFrustumf(-ar, ar, -1, 1, 5.0, 60.0);
+
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+ glTranslatef(0.0, 0.0, -10.0);
+}
+
+static void tri_draw(void *data)
+{
+ static const GLfloat verts[3][2] = {
+ { -1, -1 },
+ { 1, -1 },
+ { 0, 1 }
+ };
+ static const GLfloat colors[3][4] = {
+ { 1, 0, 0, 1 },
+ { 0, 1, 0, 1 },
+ { 0, 0, 1, 1 }
+ };
+
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ glPushMatrix();
+ glRotatef(view_rotx, 1, 0, 0);
+ glRotatef(view_roty, 0, 1, 0);
+ glRotatef(view_rotz, 0, 0, 1);
+
+ {
+ glVertexPointer(2, GL_FLOAT, 0, verts);
+ glColorPointer(4, GL_FLOAT, 0, colors);
+ glEnableClientState(GL_VERTEX_ARRAY);
+ glEnableClientState(GL_COLOR_ARRAY);
+
+ glDrawArrays(GL_TRIANGLES, 0, 3);
+
+ glDisableClientState(GL_VERTEX_ARRAY);
+ glDisableClientState(GL_COLOR_ARRAY);
+ }
+
+ glPopMatrix();
+}
+
+static void tri_run(void)
+{
+ winsysRun(3.0, tri_draw, NULL);
+}
+
+int main(int argc, char *argv[])
+{
+ EGLint width, height;
+ GLboolean printInfo = GL_FALSE;
+ int i;
+
+ /* parse cmd line args */
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-info") == 0) {
+ printInfo = GL_TRUE;
+ }
+ else {
+ printf("Warning: unknown parameter: %s\n", argv[i]);
+ }
+ }
+
+ if (!winsysInitScreen())
+ exit(1);
+ winsysQueryScreenSize(&width, &height);
+
+ if (printInfo) {
+ printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+ printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS));
+ }
+
+ tri_init();
+ tri_reshape(width, height);
+ tri_run();
+
+ winsysFiniScreen();
+
+ return 0;
+}
diff --git a/progs/es1/screen/winsys.c b/progs/es1/screen/winsys.c
new file mode 100644
index 0000000000..84d00471eb
--- /dev/null
+++ b/progs/es1/screen/winsys.c
@@ -0,0 +1,272 @@
+/*
+ * Copyright (C) 2009 Chia-I Wu <olv@0xlab.org>
+ *
+ * Based on eglgears by
+ * Copyright (C) 1999-2001 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.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <sys/time.h>
+
+#define EGL_EGLEXT_PROTOTYPES
+
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
+
+#include "winsys.h"
+
+#define MAX_MODES 100
+
+static struct {
+ EGLBoolean verbose;
+
+ EGLDisplay dpy;
+ EGLConfig conf;
+
+ EGLScreenMESA screen;
+ EGLModeMESA mode;
+ EGLint width, height;
+
+ EGLContext ctx;
+ EGLSurface surf;
+} screen;
+
+
+static EGLBoolean
+init_screen(void)
+{
+ EGLModeMESA modes[MAX_MODES];
+ EGLint num_screens, num_modes;
+ EGLint width, height, best_mode;
+ EGLint i;
+
+ if (!eglGetScreensMESA(screen.dpy, &screen.screen, 1, &num_screens) ||
+ !num_screens) {
+ printf("eglGetScreensMESA failed\n");
+ return EGL_FALSE;
+ }
+
+ if (!eglGetModesMESA(screen.dpy, screen.screen, modes, MAX_MODES,
+ &num_modes) ||
+ !num_modes) {
+ printf("eglGetModesMESA failed!\n");
+ return EGL_FALSE;
+ }
+
+ printf("Found %d modes:\n", num_modes);
+
+ best_mode = 0;
+ width = 0;
+ height = 0;
+ for (i = 0; i < num_modes; i++) {
+ EGLint w, h;
+ eglGetModeAttribMESA(screen.dpy, modes[i], EGL_WIDTH, &w);
+ eglGetModeAttribMESA(screen.dpy, modes[i], EGL_HEIGHT, &h);
+ printf("%3d: %d x %d\n", i, w, h);
+ if (w > width && h > height) {
+ width = w;
+ height = h;
+ best_mode = i;
+ }
+ }
+
+ screen.mode = modes[best_mode];
+ screen.width = width;
+ screen.height = height;
+
+ return EGL_TRUE;
+}
+
+
+static EGLBoolean
+init_display(void)
+{
+ EGLint maj, min;
+ const char *exts;
+ const EGLint attribs[] = {
+ EGL_SURFACE_TYPE, 0x0, /* should be EGL_SCREEN_BIT_MESA */
+ EGL_RENDERABLE_TYPE, 0x0, /* should be EGL_OPENGL_ES_BIT */
+ EGL_NONE
+ };
+ EGLint num_configs;
+
+ screen.dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY);
+ if (!screen.dpy) {
+ printf("eglGetDisplay failed\n");
+ return EGL_FALSE;
+ }
+
+ if (!eglInitialize(screen.dpy, &maj, &min)) {
+ printf("eglInitialize failed\n");
+ return EGL_FALSE;
+ }
+
+ printf("EGL_VERSION = %s\n", eglQueryString(screen.dpy, EGL_VERSION));
+ printf("EGL_VENDOR = %s\n", eglQueryString(screen.dpy, EGL_VENDOR));
+
+ exts = eglQueryString(screen.dpy, EGL_EXTENSIONS);
+ assert(exts);
+
+ if (!strstr(exts, "EGL_MESA_screen_surface")) {
+ printf("EGL_MESA_screen_surface is not supported\n");
+ return EGL_FALSE;
+ }
+
+ if (!eglChooseConfig(screen.dpy, attribs, &screen.conf, 1,
+ &num_configs) ||
+ !num_configs) {
+ printf("eglChooseConfig failed\n");
+ return EGL_FALSE;
+ }
+
+ return EGL_TRUE;
+}
+
+
+EGLBoolean
+winsysInitScreen(void)
+{
+ EGLint surf_attribs[20];
+ EGLint i;
+ EGLBoolean ok;
+
+ if (!init_display())
+ goto fail;
+ if (!init_screen())
+ goto fail;
+
+ /* create context */
+ screen.ctx = eglCreateContext(screen.dpy, screen.conf,
+ EGL_NO_CONTEXT, NULL);
+ if (screen.ctx == EGL_NO_CONTEXT) {
+ printf("eglCreateContext failed\n");
+ goto fail;
+ }
+
+ i = 0;
+ surf_attribs[i++] = EGL_WIDTH;
+ surf_attribs[i++] = screen.width;
+ surf_attribs[i++] = EGL_HEIGHT;
+ surf_attribs[i++] = screen.height;
+ surf_attribs[i++] = EGL_NONE;
+
+ /* create surface */
+ printf("Using screen size: %d x %d\n", screen.width, screen.height);
+ screen.surf = eglCreateScreenSurfaceMESA(screen.dpy, screen.conf,
+ surf_attribs);
+ if (screen.surf == EGL_NO_SURFACE) {
+ printf("eglCreateScreenSurfaceMESA failed\n");
+ goto fail;
+ }
+
+ ok = eglMakeCurrent(screen.dpy, screen.surf, screen.surf, screen.ctx);
+ if (!ok) {
+ printf("eglMakeCurrent failed\n");
+ goto fail;
+ }
+
+ ok = eglShowScreenSurfaceMESA(screen.dpy, screen.screen,
+ screen.surf, screen.mode);
+ if (!ok) {
+ printf("eglShowScreenSurfaceMESA failed\n");
+ goto fail;
+ }
+
+ return EGL_TRUE;
+
+fail:
+ winsysFiniScreen();
+ return EGL_FALSE;
+}
+
+
+EGLBoolean
+winsysQueryScreenSize(EGLint *width, EGLint *height)
+{
+ if (!screen.dpy)
+ return EGL_FALSE;
+
+ if (width)
+ *width = screen.width;
+ if (height)
+ *height = screen.height;
+
+ return EGL_TRUE;
+}
+
+
+void
+winsysFiniScreen(void)
+{
+ if (screen.dpy) {
+ eglMakeCurrent(screen.dpy, EGL_NO_SURFACE, EGL_NO_SURFACE,
+ EGL_NO_CONTEXT);
+ if (screen.surf != EGL_NO_SURFACE)
+ eglDestroySurface(screen.dpy, screen.surf);
+ if (screen.ctx != EGL_NO_CONTEXT)
+ eglDestroyContext(screen.dpy, screen.ctx);
+ eglTerminate(screen.dpy);
+
+ memset(&screen, 0, sizeof(screen));
+ }
+}
+
+
+void
+winsysSwapBuffers(void)
+{
+ eglSwapBuffers(screen.dpy, screen.surf);
+}
+
+
+/* return current time (in seconds) */
+double
+winsysNow(void)
+{
+ struct timeval tv;
+ gettimeofday(&tv, NULL);
+ return (double) tv.tv_sec + tv.tv_usec / 1000000.0;
+}
+
+
+void
+winsysRun(double seconds, void (*draw_frame)(void *data), void *data)
+{
+ double begin, end, last_frame, duration;
+ EGLint num_frames = 0;
+
+ begin = winsysNow();
+ end = begin + seconds;
+
+ last_frame = begin;
+ while (last_frame < end) {
+ draw_frame(data);
+ winsysSwapBuffers();
+ last_frame = winsysNow();
+ num_frames++;
+ }
+
+ duration = last_frame - begin;
+ printf("%d frames in %3.1f seconds = %6.3f FPS\n",
+ num_frames, duration, (double) num_frames / duration);
+}
diff --git a/progs/es1/screen/winsys.h b/progs/es1/screen/winsys.h
new file mode 100644
index 0000000000..679c7e0bd6
--- /dev/null
+++ b/progs/es1/screen/winsys.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2009 Chia-I Wu <olv@0xlab.org>
+ *
+ * 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 _WINSYS_H_
+#define _WINSYS_H_
+
+#include <EGL/egl.h>
+
+EGLBoolean winsysInitScreen(void);
+EGLBoolean winsysQueryScreenSize(EGLint *width, EGLint *height);
+void winsysFiniScreen(void);
+
+void winsysSwapBuffers(void);
+double winsysNow(void);
+
+void winsysRun(double seconds, void (*draw_frame)(void *data), void *data);
+
+#endif /* _WINSYS_H_ */
diff --git a/progs/es1/xegl/Makefile b/progs/es1/xegl/Makefile
new file mode 100644
index 0000000000..7f684d68e3
--- /dev/null
+++ b/progs/es1/xegl/Makefile
@@ -0,0 +1,77 @@
+# progs/es1/xegl/Makefile
+
+TOP = ../../..
+include $(TOP)/configs/current
+
+
+INCLUDE_DIRS = \
+ -I$(TOP)/include \
+
+HEADERS = $(TOP)/include/GLES/egl.h
+
+
+ES1_LIB_DEPS = \
+ $(TOP)/$(LIB_DIR)/libEGL.so \
+ $(TOP)/$(LIB_DIR)/libGLESv1_CM.so
+
+
+ES1_LIBS = \
+ -L$(TOP)/$(LIB_DIR) -lEGL \
+ -L$(TOP)/$(LIB_DIR) -lGLESv1_CM $(LIBDRM_LIB) -lX11
+
+PROGRAMS = \
+ drawtex \
+ es1_info \
+ msaa \
+ pbuffer \
+ render_tex \
+ torus \
+ tri \
+ two_win
+
+
+.c.o:
+ $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
+
+
+
+default: $(PROGRAMS)
+
+
+
+drawtex: drawtex.o $(ES1_LIB_DEPS)
+ $(CC) $(CFLAGS) drawtex.o $(ES1_LIBS) -o $@
+
+
+es1_info: es1_info.o $(ES1_LIB_DEPS)
+ $(CC) $(CFLAGS) es1_info.o $(ES1_LIBS) -o $@
+
+
+msaa: msaa.o $(ES1_LIB_DEPS)
+ $(CC) $(CFLAGS) msaa.o $(ES1_LIBS) -o $@
+
+
+pbuffer: pbuffer.o $(ES1_LIB_DEPS)
+ $(CC) $(CFLAGS) pbuffer.o $(ES1_LIBS) -o $@
+
+
+render_tex: render_tex.o $(ES1_LIB_DEPS)
+ $(CC) $(CFLAGS) render_tex.o $(ES1_LIBS) -o $@
+
+
+torus: torus.o $(ES1_LIB_DEPS)
+ $(CC) $(CFLAGS) torus.o $(ES1_LIBS) -o $@
+
+
+two_win: two_win.o $(ES1_LIB_DEPS)
+ $(CC) $(CFLAGS) two_win.o $(ES1_LIBS) -o $@
+
+
+tri: tri.o $(ES1_LIB_DEPS)
+ $(CC) $(CFLAGS) tri.o $(ES1_LIBS) -o $@
+
+
+clean:
+ rm -f *.o *~
+ rm -f $(PROGRAMS)
+
diff --git a/progs/es1/xegl/drawtex.c b/progs/es1/xegl/drawtex.c
new file mode 100644
index 0000000000..ca0615e267
--- /dev/null
+++ b/progs/es1/xegl/drawtex.c
@@ -0,0 +1,427 @@
+/*
+ * Copyright (C) 2008 Tunsgten Graphics,Inc. All Rights Reserved.
+ */
+
+/*
+ * Test GL_OES_draw_texture
+ * Brian Paul
+ * August 2008
+ */
+
+#define GL_GLEXT_PROTOTYPES
+
+#include <assert.h>
+#include <math.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <X11/keysym.h>
+#include <GLES/gl.h>
+#include <GLES/glext.h>
+#include <EGL/egl.h>
+
+
+
+static GLfloat view_posx = 10.0, view_posy = 20.0;
+static GLfloat width = 200, height = 200;
+
+
+static void
+draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glDrawTexfOES(view_posx, view_posy, 0.0, width, height);
+}
+
+
+/* new window size or exposure */
+static void
+reshape(int width, int height)
+{
+ GLfloat ar = (GLfloat) width / (GLfloat) height;
+
+ glViewport(0, 0, (GLint) width, (GLint) height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+
+#ifdef GL_VERSION_ES_CM_1_0
+ glFrustumf(-ar, ar, -1, 1, 5.0, 60.0);
+#else
+ glFrustum(-ar, ar, -1, 1, 5.0, 60.0);
+#endif
+
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+ glTranslatef(0.0, 0.0, -15.0);
+}
+
+
+static float
+dist(GLuint i, GLuint j, float x, float y)
+{
+ return sqrt((i-x) * (i-x) + (j-y) * (j-y));
+}
+
+static void
+make_smile_texture(void)
+{
+#define SZ 128
+ GLenum Filter = GL_LINEAR;
+ GLubyte image[SZ][SZ][4];
+ GLuint i, j;
+ GLint cropRect[4];
+
+ for (i = 0; i < SZ; i++) {
+ for (j = 0; j < SZ; j++) {
+ GLfloat d_mouth = dist(i, j, SZ/2, SZ/2);
+ GLfloat d_rt_eye = dist(i, j, SZ*3/4, SZ*3/4);
+ GLfloat d_lt_eye = dist(i, j, SZ*3/4, SZ*1/4);
+ if (d_rt_eye < SZ / 8 || d_lt_eye < SZ / 8) {
+ image[i][j][0] = 20;
+ image[i][j][1] = 50;
+ image[i][j][2] = 255;
+ image[i][j][3] = 255;
+ }
+ else if (i < SZ/2 && d_mouth < SZ/3) {
+ image[i][j][0] = 255;
+ image[i][j][1] = 20;
+ image[i][j][2] = 20;
+ image[i][j][3] = 255;
+ }
+ else {
+ image[i][j][0] = 200;
+ image[i][j][1] = 200;
+ image[i][j][2] = 200;
+ image[i][j][3] = 255;
+ }
+ }
+ }
+
+ glActiveTexture(GL_TEXTURE0); /* unit 0 */
+ glBindTexture(GL_TEXTURE_2D, 42);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, SZ, SZ, 0,
+ GL_RGBA, GL_UNSIGNED_BYTE, image);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, Filter);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, Filter);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
+
+ cropRect[0] = 0;
+ cropRect[1] = 0;
+ cropRect[2] = SZ;
+ cropRect[3] = SZ;
+ glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, cropRect);
+#undef SZ
+}
+
+
+
+static void
+init(void)
+{
+ const char *ext = (char *) glGetString(GL_EXTENSIONS);
+
+ if (!strstr(ext, "GL_OES_draw_texture")) {
+ fprintf(stderr, "Sorry, this program requires GL_OES_draw_texture");
+ exit(1);
+ }
+
+ glClearColor(0.4, 0.4, 0.4, 0.0);
+
+ make_smile_texture();
+ glEnable(GL_TEXTURE_2D);
+}
+
+
+/*
+ * Create an RGB, double-buffered X window.
+ * Return the window and context handles.
+ */
+static void
+make_x_window(Display *x_dpy, EGLDisplay egl_dpy,
+ const char *name,
+ int x, int y, int width, int height,
+ Window *winRet,
+ EGLContext *ctxRet,
+ EGLSurface *surfRet)
+{
+ static const EGLint attribs[] = {
+ EGL_RED_SIZE, 1,
+ EGL_GREEN_SIZE, 1,
+ EGL_BLUE_SIZE, 1,
+ EGL_NONE
+ };
+
+ int scrnum;
+ XSetWindowAttributes attr;
+ unsigned long mask;
+ Window root;
+ Window win;
+ XVisualInfo *visInfo, visTemplate;
+ int num_visuals;
+ EGLContext ctx;
+ EGLConfig config;
+ EGLint num_configs;
+ EGLint vid;
+
+ scrnum = DefaultScreen( x_dpy );
+ root = RootWindow( x_dpy, scrnum );
+
+ if (!eglChooseConfig( egl_dpy, attribs, &config, 1, &num_configs)) {
+ printf("Error: couldn't get an EGL visual config\n");
+ exit(1);
+ }
+
+ assert(config);
+ assert(num_configs > 0);
+
+ if (!eglGetConfigAttrib(egl_dpy, config, EGL_NATIVE_VISUAL_ID, &vid)) {
+ printf("Error: eglGetConfigAttrib() failed\n");
+ exit(1);
+ }
+
+ /* The X window visual must match the EGL config */
+ visTemplate.visualid = vid;
+ visInfo = XGetVisualInfo(x_dpy, VisualIDMask, &visTemplate, &num_visuals);
+ if (!visInfo) {
+ printf("Error: couldn't get X visual\n");
+ exit(1);
+ }
+
+ /* window attributes */
+ attr.background_pixel = 0;
+ attr.border_pixel = 0;
+ attr.colormap = XCreateColormap( x_dpy, root, visInfo->visual, AllocNone);
+ attr.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask;
+ mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
+
+ win = XCreateWindow( x_dpy, root, 0, 0, width, height,
+ 0, visInfo->depth, InputOutput,
+ visInfo->visual, mask, &attr );
+
+ /* set hints and properties */
+ {
+ XSizeHints sizehints;
+ sizehints.x = x;
+ sizehints.y = y;
+ sizehints.width = width;
+ sizehints.height = height;
+ sizehints.flags = USSize | USPosition;
+ XSetNormalHints(x_dpy, win, &sizehints);
+ XSetStandardProperties(x_dpy, win, name, name,
+ None, (char **)NULL, 0, &sizehints);
+ }
+
+ eglBindAPI(EGL_OPENGL_ES_API);
+
+ ctx = eglCreateContext(egl_dpy, config, EGL_NO_CONTEXT, NULL );
+ if (!ctx) {
+ printf("Error: eglCreateContext failed\n");
+ exit(1);
+ }
+
+ *surfRet = eglCreateWindowSurface(egl_dpy, config, win, NULL);
+
+ if (!*surfRet) {
+ printf("Error: eglCreateWindowSurface failed\n");
+ exit(1);
+ }
+
+ XFree(visInfo);
+
+ *winRet = win;
+ *ctxRet = ctx;
+}
+
+
+static void
+event_loop(Display *dpy, Window win,
+ EGLDisplay egl_dpy, EGLSurface egl_surf)
+{
+ int anim = 0;
+
+ while (1) {
+ int redraw = 0;
+
+ if (!anim || XPending(dpy)) {
+ XEvent event;
+ XNextEvent(dpy, &event);
+
+ switch (event.type) {
+ case Expose:
+ redraw = 1;
+ break;
+ case ConfigureNotify:
+ reshape(event.xconfigure.width, event.xconfigure.height);
+ break;
+ case KeyPress:
+ {
+ char buffer[10];
+ int r, code;
+ code = XLookupKeysym(&event.xkey, 0);
+ if (code == XK_Left) {
+ view_posx -= 1.0;
+ }
+ else if (code == XK_Right) {
+ view_posx += 1.0;
+ }
+ else if (code == XK_Up) {
+ view_posy += 1.0;
+ }
+ else if (code == XK_Down) {
+ view_posy -= 1.0;
+ }
+ else {
+ r = XLookupString(&event.xkey, buffer, sizeof(buffer),
+ NULL, NULL);
+ if (buffer[0] == ' ') {
+ anim = !anim;
+ }
+ else if (buffer[0] == 'w') {
+ width -= 1.0f;
+ }
+ else if (buffer[0] == 'W') {
+ width += 1.0f;
+ }
+ else if (buffer[0] == 'h') {
+ height -= 1.0f;
+ }
+ else if (buffer[0] == 'H') {
+ height += 1.0f;
+ }
+ else if (buffer[0] == 27) {
+ /* escape */
+ return;
+ }
+ }
+ }
+ redraw = 1;
+ break;
+ default:
+ ; /*no-op*/
+ }
+ }
+
+ if (anim) {
+ view_posx += 1.0;
+ view_posy += 2.0;
+ redraw = 1;
+ }
+
+ if (redraw) {
+ draw();
+ eglSwapBuffers(egl_dpy, egl_surf);
+ }
+ }
+}
+
+
+static void
+usage(void)
+{
+ printf("Usage:\n");
+ printf(" -display <displayname> set the display to run on\n");
+ printf(" -info display OpenGL renderer info\n");
+}
+
+
+int
+main(int argc, char *argv[])
+{
+ const int winWidth = 400, winHeight = 300;
+ Display *x_dpy;
+ Window win;
+ EGLSurface egl_surf;
+ EGLContext egl_ctx;
+ EGLDisplay egl_dpy;
+ char *dpyName = NULL;
+ GLboolean printInfo = GL_FALSE;
+ EGLint egl_major, egl_minor;
+ int i;
+ const char *s;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-display") == 0) {
+ dpyName = argv[i+1];
+ i++;
+ }
+ else if (strcmp(argv[i], "-info") == 0) {
+ printInfo = GL_TRUE;
+ }
+ else {
+ usage();
+ return -1;
+ }
+ }
+
+ x_dpy = XOpenDisplay(dpyName);
+ if (!x_dpy) {
+ printf("Error: couldn't open display %s\n",
+ dpyName ? dpyName : getenv("DISPLAY"));
+ return -1;
+ }
+
+ egl_dpy = eglGetDisplay(x_dpy);
+ if (!egl_dpy) {
+ printf("Error: eglGetDisplay() failed\n");
+ return -1;
+ }
+
+ if (!eglInitialize(egl_dpy, &egl_major, &egl_minor)) {
+ printf("Error: eglInitialize() failed\n");
+ return -1;
+ }
+
+ s = eglQueryString(egl_dpy, EGL_VERSION);
+ printf("EGL_VERSION = %s\n", s);
+
+ s = eglQueryString(egl_dpy, EGL_VENDOR);
+ printf("EGL_VENDOR = %s\n", s);
+
+ s = eglQueryString(egl_dpy, EGL_EXTENSIONS);
+ printf("EGL_EXTENSIONS = %s\n", s);
+
+ s = eglQueryString(egl_dpy, EGL_CLIENT_APIS);
+ printf("EGL_CLIENT_APIS = %s\n", s);
+
+ make_x_window(x_dpy, egl_dpy,
+ "drawtex", 0, 0, winWidth, winHeight,
+ &win, &egl_ctx, &egl_surf);
+
+ XMapWindow(x_dpy, win);
+ if (!eglMakeCurrent(egl_dpy, egl_surf, egl_surf, egl_ctx)) {
+ printf("Error: eglMakeCurrent() failed\n");
+ return -1;
+ }
+
+ if (printInfo) {
+ printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+ printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS));
+ }
+
+ init();
+
+ /* Set initial projection/viewing transformation.
+ * We can't be sure we'll get a ConfigureNotify event when the window
+ * first appears.
+ */
+ reshape(winWidth, winHeight);
+
+ event_loop(x_dpy, win, egl_dpy, egl_surf);
+
+ eglDestroyContext(egl_dpy, egl_ctx);
+ eglDestroySurface(egl_dpy, egl_surf);
+ eglTerminate(egl_dpy);
+
+
+ XDestroyWindow(x_dpy, win);
+ XCloseDisplay(x_dpy);
+
+ return 0;
+}
diff --git a/progs/es1/xegl/es1_info.c b/progs/es1/xegl/es1_info.c
new file mode 100644
index 0000000000..963304de13
--- /dev/null
+++ b/progs/es1/xegl/es1_info.c
@@ -0,0 +1,274 @@
+/*
+ * Copyright (C) 2008 Tunsgten Graphics,Inc. All Rights Reserved.
+ */
+
+/*
+ * List OpenGL ES extensions.
+ * Print ES 1 or ES 2 extensions depending on which library we're
+ * linked with: libGLESv1_CM.so vs libGLESv2.so
+ */
+
+#define GL_GLEXT_PROTOTYPES
+
+#include <assert.h>
+#include <math.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <X11/keysym.h>
+#include <GLES/gl.h>
+#include <GLES/glext.h>
+#include <EGL/egl.h>
+
+
+/*
+ * Print a list of extensions, with word-wrapping.
+ */
+static void
+print_extension_list(const char *ext)
+{
+ const char *indentString = " ";
+ const int indent = 4;
+ const int max = 79;
+ int width, i, j;
+
+ if (!ext || !ext[0])
+ return;
+
+ width = indent;
+ printf(indentString);
+ i = j = 0;
+ while (1) {
+ if (ext[j] == ' ' || ext[j] == 0) {
+ /* found end of an extension name */
+ const int len = j - i;
+ if (width + len > max) {
+ /* start a new line */
+ printf("\n");
+ width = indent;
+ printf(indentString);
+ }
+ /* print the extension name between ext[i] and ext[j] */
+ while (i < j) {
+ printf("%c", ext[i]);
+ i++;
+ }
+ /* either we're all done, or we'll continue with next extension */
+ width += len + 1;
+ if (ext[j] == 0) {
+ break;
+ }
+ else {
+ i++;
+ j++;
+ if (ext[j] == 0)
+ break;
+ printf(", ");
+ width += 2;
+ }
+ }
+ j++;
+ }
+ printf("\n");
+}
+
+
+static void
+info(EGLDisplay egl_dpy)
+{
+ const char *s;
+
+ s = eglQueryString(egl_dpy, EGL_VERSION);
+ printf("EGL_VERSION = %s\n", s);
+
+ s = eglQueryString(egl_dpy, EGL_VENDOR);
+ printf("EGL_VENDOR = %s\n", s);
+
+ s = eglQueryString(egl_dpy, EGL_EXTENSIONS);
+ printf("EGL_EXTENSIONS = %s\n", s);
+
+ s = eglQueryString(egl_dpy, EGL_CLIENT_APIS);
+ printf("EGL_CLIENT_APIS = %s\n", s);
+
+ printf("GL_VERSION: %s\n", (char *) glGetString(GL_VERSION));
+ printf("GL_RENDERER: %s\n", (char *) glGetString(GL_RENDERER));
+ printf("GL_EXTENSIONS:\n");
+ print_extension_list((char *) glGetString(GL_EXTENSIONS));
+}
+
+
+/*
+ * Create an RGB, double-buffered X window.
+ * Return the window and context handles.
+ */
+static void
+make_x_window(Display *x_dpy, EGLDisplay egl_dpy,
+ const char *name,
+ int x, int y, int width, int height,
+ Window *winRet,
+ EGLContext *ctxRet,
+ EGLSurface *surfRet)
+{
+ static const EGLint attribs[] = {
+ EGL_RED_SIZE, 1,
+ EGL_GREEN_SIZE, 1,
+ EGL_BLUE_SIZE, 1,
+ EGL_NONE
+ };
+
+ int scrnum;
+ XSetWindowAttributes attr;
+ unsigned long mask;
+ Window root;
+ Window win;
+ XVisualInfo *visInfo, visTemplate;
+ int num_visuals;
+ EGLContext ctx;
+ EGLConfig config;
+ EGLint num_configs;
+ EGLint vid;
+
+ scrnum = DefaultScreen( x_dpy );
+ root = RootWindow( x_dpy, scrnum );
+
+ if (!eglChooseConfig( egl_dpy, attribs, &config, 1, &num_configs)) {
+ printf("Error: couldn't get an EGL visual config\n");
+ exit(1);
+ }
+
+ assert(config);
+ assert(num_configs > 0);
+
+ if (!eglGetConfigAttrib(egl_dpy, config, EGL_NATIVE_VISUAL_ID, &vid)) {
+ printf("Error: eglGetConfigAttrib() failed\n");
+ exit(1);
+ }
+
+ /* The X window visual must match the EGL config */
+ visTemplate.visualid = vid;
+ visInfo = XGetVisualInfo(x_dpy, VisualIDMask, &visTemplate, &num_visuals);
+ if (!visInfo) {
+ printf("Error: couldn't get X visual\n");
+ exit(1);
+ }
+
+ /* window attributes */
+ attr.background_pixel = 0;
+ attr.border_pixel = 0;
+ attr.colormap = XCreateColormap( x_dpy, root, visInfo->visual, AllocNone);
+ attr.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask;
+ mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
+
+ win = XCreateWindow( x_dpy, root, 0, 0, width, height,
+ 0, visInfo->depth, InputOutput,
+ visInfo->visual, mask, &attr );
+
+ /* set hints and properties */
+ {
+ XSizeHints sizehints;
+ sizehints.x = x;
+ sizehints.y = y;
+ sizehints.width = width;
+ sizehints.height = height;
+ sizehints.flags = USSize | USPosition;
+ XSetNormalHints(x_dpy, win, &sizehints);
+ XSetStandardProperties(x_dpy, win, name, name,
+ None, (char **)NULL, 0, &sizehints);
+ }
+
+ eglBindAPI(EGL_OPENGL_ES_API);
+
+ ctx = eglCreateContext(egl_dpy, config, EGL_NO_CONTEXT, NULL );
+ if (!ctx) {
+ printf("Error: eglCreateContext failed\n");
+ exit(1);
+ }
+
+ *surfRet = eglCreateWindowSurface(egl_dpy, config, win, NULL);
+
+ if (!*surfRet) {
+ printf("Error: eglCreateWindowSurface failed\n");
+ exit(1);
+ }
+
+ XFree(visInfo);
+
+ *winRet = win;
+ *ctxRet = ctx;
+}
+
+
+static void
+usage(void)
+{
+ printf("Usage:\n");
+ printf(" -display <displayname> set the display to run on\n");
+}
+
+
+int
+main(int argc, char *argv[])
+{
+ const int winWidth = 400, winHeight = 300;
+ Display *x_dpy;
+ Window win;
+ EGLSurface egl_surf;
+ EGLContext egl_ctx;
+ EGLDisplay egl_dpy;
+ char *dpyName = NULL;
+ EGLint egl_major, egl_minor;
+ int i;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-display") == 0) {
+ dpyName = argv[i+1];
+ i++;
+ }
+ else {
+ usage();
+ return -1;
+ }
+ }
+
+ x_dpy = XOpenDisplay(dpyName);
+ if (!x_dpy) {
+ printf("Error: couldn't open display %s\n",
+ dpyName ? dpyName : getenv("DISPLAY"));
+ return -1;
+ }
+
+ egl_dpy = eglGetDisplay(x_dpy);
+ if (!egl_dpy) {
+ printf("Error: eglGetDisplay() failed\n");
+ return -1;
+ }
+
+ if (!eglInitialize(egl_dpy, &egl_major, &egl_minor)) {
+ printf("Error: eglInitialize() failed\n");
+ return -1;
+ }
+
+ make_x_window(x_dpy, egl_dpy,
+ "ES info", 0, 0, winWidth, winHeight,
+ &win, &egl_ctx, &egl_surf);
+
+ /*XMapWindow(x_dpy, win);*/
+ if (!eglMakeCurrent(egl_dpy, egl_surf, egl_surf, egl_ctx)) {
+ printf("Error: eglMakeCurrent() failed\n");
+ return -1;
+ }
+
+ info(egl_dpy);
+
+ eglDestroyContext(egl_dpy, egl_ctx);
+ eglDestroySurface(egl_dpy, egl_surf);
+ eglTerminate(egl_dpy);
+
+
+ XDestroyWindow(x_dpy, win);
+ XCloseDisplay(x_dpy);
+
+ return 0;
+}
diff --git a/progs/es1/xegl/msaa.c b/progs/es1/xegl/msaa.c
new file mode 100644
index 0000000000..b4c6c63217
--- /dev/null
+++ b/progs/es1/xegl/msaa.c
@@ -0,0 +1,442 @@
+/*
+ * Copyright (C) 2008 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.
+ */
+
+/*
+ * Test MSAA with X/EGL and OpenGL ES 1.x
+ * Brian Paul
+ * 15 September 2008
+ */
+
+#define USE_FULL_GL 0
+
+
+#include <assert.h>
+#include <math.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <X11/keysym.h>
+#if USE_FULL_GL
+#include <GL/gl.h> /* use full OpenGL */
+#else
+#include <GLES/gl.h> /* use OpenGL ES 1.x */
+#include <GLES/glext.h>
+#endif
+#include <EGL/egl.h>
+
+
+
+static GLfloat view_rotx = 0.0, view_roty = 0.0, view_rotz = 0.0;
+static GLboolean AA = 0*GL_TRUE;
+
+
+static void
+draw(void)
+{
+ float a;
+
+ static const GLfloat verts[4][2] = {
+ { -1, -.1 },
+ { 1, -.1 },
+ { -1, .1 },
+ { 1, .1 }
+ };
+ static const GLfloat colors[4][4] = {
+ { 1, 0, 0, 1 },
+ { 0, 1, 0, 1 },
+ { 0, 0, 1, 1 },
+ { 1, 0, 1, 1 }
+ };
+
+ if (AA) {
+ printf("MSAA enabled\n");
+ glEnable(GL_MULTISAMPLE);
+ }
+ else {
+ printf("MSAA disabled\n");
+ glDisable(GL_MULTISAMPLE);
+ }
+
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ glPushMatrix();
+ glRotatef(view_rotx, 1, 0, 0);
+ glRotatef(view_roty, 0, 1, 0);
+ glRotatef(view_rotz, 0, 0, 1);
+
+ {
+ glVertexPointer(2, GL_FLOAT, 0, verts);
+ glColorPointer(4, GL_FLOAT, 0, colors);
+
+ glEnableClientState(GL_VERTEX_ARRAY);
+ glEnableClientState(GL_COLOR_ARRAY);
+
+ for (a = 0; a < 360; a += 20.0) {
+ glPushMatrix();
+
+ glRotatef(a, 0, 0, 1);
+ glTranslatef(1.5, 0, 0);
+
+ /* draw triangle */
+ glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
+
+ glPopMatrix();
+ }
+
+ glDisableClientState(GL_VERTEX_ARRAY);
+ glDisableClientState(GL_COLOR_ARRAY);
+ }
+
+ glPopMatrix();
+}
+
+
+/* new window size or exposure */
+static void
+reshape(int width, int height)
+{
+ GLfloat ary = 3.0;
+ GLfloat arx = ary * (GLfloat) width / (GLfloat) height;
+
+ glViewport(0, 0, (GLint) width, (GLint) height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+#ifdef GL_VERSION_ES_CM_1_0
+ glOrthof(-arx, arx, -ary, ary, -1.0, 1.0);
+#else
+ glOrtho(-arx, arx, -ary, ary, -1.0, 1.0);
+#endif
+
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+}
+
+
+
+static void
+init(void)
+{
+ printf("Press 'a' to toggle multisample antialiasing\n");
+ printf("Press 'Esc' to exit\n");
+}
+
+
+/*
+ * Create an RGB, double-buffered X window.
+ * Return the window and context handles.
+ */
+static void
+make_x_window(Display *x_dpy, EGLDisplay egl_dpy,
+ const char *name,
+ int x, int y, int width, int height,
+ Window *winRet,
+ EGLContext *ctxRet,
+ EGLSurface *surfRet)
+{
+ static const EGLint attribs[] = {
+ EGL_RED_SIZE, 1,
+ EGL_GREEN_SIZE, 1,
+ EGL_BLUE_SIZE, 1,
+ EGL_DEPTH_SIZE, 1,
+ EGL_SAMPLES, 1,
+ EGL_SAMPLE_BUFFERS, 1,
+ EGL_NONE
+ };
+
+ int scrnum;
+ XSetWindowAttributes attr;
+ unsigned long mask;
+ Window root;
+ Window win;
+ XVisualInfo *visInfo, visTemplate;
+ int num_visuals;
+ EGLContext ctx;
+ EGLConfig config;
+ EGLint num_configs;
+ EGLint vid;
+
+ scrnum = DefaultScreen( x_dpy );
+ root = RootWindow( x_dpy, scrnum );
+
+ if (!eglChooseConfig( egl_dpy, attribs, &config, 1, &num_configs)) {
+ printf("Error: couldn't get an EGL visual config\n");
+ exit(1);
+ }
+
+ if (num_configs < 1) {
+ printf("Error: Unable to find multisample pixel format.\n");
+ printf("Try running glxinfo to see if your server supports MSAA.\n");
+ exit(1);
+ }
+
+ if (!eglGetConfigAttrib(egl_dpy, config, EGL_NATIVE_VISUAL_ID, &vid)) {
+ printf("Error: eglGetConfigAttrib() failed\n");
+ exit(1);
+ }
+
+ /* The X window visual must match the EGL config */
+ visTemplate.visualid = vid;
+ visInfo = XGetVisualInfo(x_dpy, VisualIDMask, &visTemplate, &num_visuals);
+ if (!visInfo) {
+ printf("Error: couldn't get X visual\n");
+ exit(1);
+ }
+
+ /* window attributes */
+ attr.background_pixel = 0;
+ attr.border_pixel = 0;
+ attr.colormap = XCreateColormap( x_dpy, root, visInfo->visual, AllocNone);
+ attr.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask;
+ mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
+
+ win = XCreateWindow( x_dpy, root, 0, 0, width, height,
+ 0, visInfo->depth, InputOutput,
+ visInfo->visual, mask, &attr );
+
+ /* set hints and properties */
+ {
+ XSizeHints sizehints;
+ sizehints.x = x;
+ sizehints.y = y;
+ sizehints.width = width;
+ sizehints.height = height;
+ sizehints.flags = USSize | USPosition;
+ XSetNormalHints(x_dpy, win, &sizehints);
+ XSetStandardProperties(x_dpy, win, name, name,
+ None, (char **)NULL, 0, &sizehints);
+ }
+
+#if USE_FULL_GL
+ eglBindAPI(EGL_OPENGL_API);
+#else
+ eglBindAPI(EGL_OPENGL_ES_API);
+#endif
+
+ ctx = eglCreateContext(egl_dpy, config, EGL_NO_CONTEXT, NULL );
+ if (!ctx) {
+ printf("Error: eglCreateContext failed\n");
+ exit(1);
+ }
+
+ *surfRet = eglCreateWindowSurface(egl_dpy, config, win, NULL);
+
+ if (!*surfRet) {
+ printf("Error: eglCreateWindowSurface failed\n");
+ exit(1);
+ }
+
+ XFree(visInfo);
+
+ *winRet = win;
+ *ctxRet = ctx;
+}
+
+
+static void
+event_loop(Display *dpy, Window win,
+ EGLDisplay egl_dpy, EGLSurface egl_surf)
+{
+ while (1) {
+ int redraw = 0;
+ XEvent event;
+
+ XNextEvent(dpy, &event);
+
+ switch (event.type) {
+ case Expose:
+ redraw = 1;
+ break;
+ case ConfigureNotify:
+ reshape(event.xconfigure.width, event.xconfigure.height);
+ break;
+ case KeyPress:
+ {
+ char buffer[10];
+ int r, code;
+ code = XLookupKeysym(&event.xkey, 0);
+ if (code == XK_Left) {
+ view_roty += 5.0;
+ }
+ else if (code == XK_Right) {
+ view_roty -= 5.0;
+ }
+ else if (code == XK_Up) {
+ view_rotx += 5.0;
+ }
+ else if (code == XK_Down) {
+ view_rotx -= 5.0;
+ }
+ else {
+ r = XLookupString(&event.xkey, buffer, sizeof(buffer),
+ NULL, NULL);
+ if (buffer[0] == 'a') {
+ AA = !AA;
+ redraw = 1;
+ }
+ else if (buffer[0] == 27) {
+ /* escape */
+ return;
+ }
+ }
+ }
+ redraw = 1;
+ break;
+ default:
+ ; /*no-op*/
+ }
+
+ if (redraw) {
+ draw();
+ eglSwapBuffers(egl_dpy, egl_surf);
+ }
+ }
+}
+
+
+static void
+usage(void)
+{
+ printf("Usage:\n");
+ printf(" -display <displayname> set the display to run on\n");
+ printf(" -info display OpenGL renderer info\n");
+}
+
+
+int
+main(int argc, char *argv[])
+{
+ const int winWidth = 600, winHeight = 600;
+ Display *x_dpy;
+ Window win;
+ EGLSurface egl_surf;
+ EGLContext egl_ctx;
+ EGLDisplay egl_dpy;
+ char *dpyName = NULL;
+ GLboolean printInfo = GL_FALSE;
+ EGLint egl_major, egl_minor;
+ int i;
+ const char *s;
+
+ static struct {
+ char *name;
+ GLenum value;
+ enum {GetString, GetInteger} type;
+ } info_items[] = {
+ {"GL_RENDERER", GL_RENDERER, GetString},
+ {"GL_VERSION", GL_VERSION, GetString},
+ {"GL_VENDOR", GL_VENDOR, GetString},
+ {"GL_EXTENSIONS", GL_EXTENSIONS, GetString},
+ {"GL_MAX_PALETTE_MATRICES_OES", GL_MAX_PALETTE_MATRICES_OES, GetInteger},
+ {"GL_MAX_VERTEX_UNITS_OES", GL_MAX_VERTEX_UNITS_OES, GetInteger},
+ };
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-display") == 0) {
+ dpyName = argv[i+1];
+ i++;
+ }
+ else if (strcmp(argv[i], "-info") == 0) {
+ printInfo = GL_TRUE;
+ }
+ else {
+ usage();
+ return -1;
+ }
+ }
+
+ x_dpy = XOpenDisplay(dpyName);
+ if (!x_dpy) {
+ printf("Error: couldn't open display %s\n",
+ dpyName ? dpyName : getenv("DISPLAY"));
+ return -1;
+ }
+
+ egl_dpy = eglGetDisplay(x_dpy);
+ if (!egl_dpy) {
+ printf("Error: eglGetDisplay() failed\n");
+ return -1;
+ }
+
+ if (!eglInitialize(egl_dpy, &egl_major, &egl_minor)) {
+ printf("Error: eglInitialize() failed\n");
+ return -1;
+ }
+
+ s = eglQueryString(egl_dpy, EGL_VERSION);
+ printf("EGL_VERSION = %s\n", s);
+
+ s = eglQueryString(egl_dpy, EGL_VENDOR);
+ printf("EGL_VENDOR = %s\n", s);
+
+ s = eglQueryString(egl_dpy, EGL_EXTENSIONS);
+ printf("EGL_EXTENSIONS = %s\n", s);
+
+ s = eglQueryString(egl_dpy, EGL_CLIENT_APIS);
+ printf("EGL_CLIENT_APIS = %s\n", s);
+
+ make_x_window(x_dpy, egl_dpy,
+ "msaa", 0, 0, winWidth, winHeight,
+ &win, &egl_ctx, &egl_surf);
+
+ XMapWindow(x_dpy, win);
+ if (!eglMakeCurrent(egl_dpy, egl_surf, egl_surf, egl_ctx)) {
+ printf("Error: eglMakeCurrent() failed\n");
+ return -1;
+ }
+
+ if (printInfo) {
+ for (i = 0; i < sizeof(info_items)/sizeof(info_items[0]); i++) {
+ switch (info_items[i].type) {
+ case GetString:
+ printf("%s = %s\n", info_items[i].name, (char *)glGetString(info_items[i].value));
+ break;
+ case GetInteger: {
+ GLint rv = -1;
+ glGetIntegerv(info_items[i].value, &rv);
+ printf("%s = %d\n", info_items[i].name, rv);
+ break;
+ }
+ }
+ }
+ };
+ init();
+
+ /* Set initial projection/viewing transformation.
+ * We can't be sure we'll get a ConfigureNotify event when the window
+ * first appears.
+ */
+ reshape(winWidth, winHeight);
+
+ event_loop(x_dpy, win, egl_dpy, egl_surf);
+
+ eglDestroyContext(egl_dpy, egl_ctx);
+ eglDestroySurface(egl_dpy, egl_surf);
+ eglTerminate(egl_dpy);
+
+
+ XDestroyWindow(x_dpy, win);
+ XCloseDisplay(x_dpy);
+
+ return 0;
+}
diff --git a/progs/es1/xegl/pbuffer.c b/progs/es1/xegl/pbuffer.c
new file mode 100644
index 0000000000..011c2af58f
--- /dev/null
+++ b/progs/es1/xegl/pbuffer.c
@@ -0,0 +1,607 @@
+/*
+ * Copyright (C) 2008 Tunsgten Graphics,Inc. All Rights Reserved.
+ */
+
+/*
+ * Test EGL Pbuffers
+ * Brian Paul
+ * August 2008
+ */
+
+
+#include <assert.h>
+#include <math.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <X11/keysym.h>
+#include <GLES/gl.h>
+#include <GLES/glext.h>
+#include <EGL/egl.h>
+
+
+
+static int WinWidth = 300, WinHeight = 300;
+
+static GLfloat view_rotx = 0.0, view_roty = 0.0, view_rotz = 0.0;
+
+
+static void
+Normal(GLfloat *n, GLfloat nx, GLfloat ny, GLfloat nz)
+{
+ n[0] = nx;
+ n[1] = ny;
+ n[2] = nz;
+}
+
+static void
+Vertex(GLfloat *v, GLfloat vx, GLfloat vy, GLfloat vz)
+{
+ v[0] = vx;
+ v[1] = vy;
+ v[2] = vz;
+}
+
+static void
+Texcoord(GLfloat *v, GLfloat s, GLfloat t)
+{
+ v[0] = s;
+ v[1] = t;
+}
+
+
+/* Borrowed from glut, adapted */
+static void
+draw_torus(GLfloat r, GLfloat R, GLint nsides, GLint rings)
+{
+ int i, j;
+ GLfloat theta, phi, theta1;
+ GLfloat cosTheta, sinTheta;
+ GLfloat cosTheta1, sinTheta1;
+ GLfloat ringDelta, sideDelta;
+ GLfloat varray[100][3], narray[100][3], tarray[100][2];
+ int vcount;
+
+ glVertexPointer(3, GL_FLOAT, 0, varray);
+ glNormalPointer(GL_FLOAT, 0, narray);
+ glTexCoordPointer(2, GL_FLOAT, 0, tarray);
+ glEnableClientState(GL_VERTEX_ARRAY);
+ glEnableClientState(GL_NORMAL_ARRAY);
+ glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+
+ ringDelta = 2.0 * M_PI / rings;
+ sideDelta = 2.0 * M_PI / nsides;
+
+ theta = 0.0;
+ cosTheta = 1.0;
+ sinTheta = 0.0;
+ for (i = rings - 1; i >= 0; i--) {
+ theta1 = theta + ringDelta;
+ cosTheta1 = cos(theta1);
+ sinTheta1 = sin(theta1);
+
+ vcount = 0; /* glBegin(GL_QUAD_STRIP); */
+
+ phi = 0.0;
+ for (j = nsides; j >= 0; j--) {
+ GLfloat s0, s1, t;
+ GLfloat cosPhi, sinPhi, dist;
+
+ phi += sideDelta;
+ cosPhi = cos(phi);
+ sinPhi = sin(phi);
+ dist = R + r * cosPhi;
+
+ s0 = 20.0 * theta / (2.0 * M_PI);
+ s1 = 20.0 * theta1 / (2.0 * M_PI);
+ t = 8.0 * phi / (2.0 * M_PI);
+
+ Normal(narray[vcount], cosTheta1 * cosPhi, -sinTheta1 * cosPhi, sinPhi);
+ Texcoord(tarray[vcount], s1, t);
+ Vertex(varray[vcount], cosTheta1 * dist, -sinTheta1 * dist, r * sinPhi);
+ vcount++;
+
+ Normal(narray[vcount], cosTheta * cosPhi, -sinTheta * cosPhi, sinPhi);
+ Texcoord(tarray[vcount], s0, t);
+ Vertex(varray[vcount], cosTheta * dist, -sinTheta * dist, r * sinPhi);
+ vcount++;
+ }
+
+ /*glEnd();*/
+ assert(vcount <= 100);
+ glDrawArrays(GL_TRIANGLE_STRIP, 0, vcount);
+
+ theta = theta1;
+ cosTheta = cosTheta1;
+ sinTheta = sinTheta1;
+ }
+
+ glDisableClientState(GL_VERTEX_ARRAY);
+ glDisableClientState(GL_NORMAL_ARRAY);
+ glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+}
+
+
+static void
+draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ glPushMatrix();
+ glRotatef(view_rotx, 1, 0, 0);
+ glRotatef(view_roty, 0, 1, 0);
+ glRotatef(view_rotz, 0, 0, 1);
+ glScalef(0.5, 0.5, 0.5);
+
+ draw_torus(1.0, 3.0, 30, 60);
+
+ glPopMatrix();
+
+ glFinish();
+}
+
+
+/**
+ * Draw to both the window and pbuffer and compare results.
+ */
+static void
+draw_both(EGLDisplay egl_dpy, EGLSurface egl_surf, EGLSurface egl_pbuf,
+ EGLContext egl_ctx)
+{
+ unsigned *wbuf, *pbuf;
+ int x = 100, y = 110;
+ int i, dif;
+
+ wbuf = (unsigned *) malloc(WinWidth * WinHeight * 4);
+ pbuf = (unsigned *) malloc(WinWidth * WinHeight * 4);
+
+ glPixelStorei(GL_PACK_ALIGNMENT, 1);
+
+ /* first draw to window */
+ if (!eglMakeCurrent(egl_dpy, egl_surf, egl_surf, egl_ctx)) {
+ printf("Error: eglMakeCurrent(window) failed\n");
+ return;
+ }
+ draw();
+ glReadPixels(0, 0, WinWidth, WinHeight, GL_RGBA, GL_UNSIGNED_BYTE, wbuf);
+ printf("Window[%d,%d] = 0x%08x\n", x, y, wbuf[y*WinWidth+x]);
+
+ /* then draw to pbuffer */
+ if (!eglMakeCurrent(egl_dpy, egl_pbuf, egl_pbuf, egl_ctx)) {
+ printf("Error: eglMakeCurrent(pbuffer) failed\n");
+ return;
+ }
+ draw();
+ glReadPixels(0, 0, WinWidth, WinHeight, GL_RGBA, GL_UNSIGNED_BYTE, pbuf);
+ printf("Pbuffer[%d,%d] = 0x%08x\n", x, y, pbuf[y*WinWidth+x]);
+
+ eglSwapBuffers(egl_dpy, egl_surf);
+
+ /* compare renderings */
+ for (dif = i = 0; i < WinWidth * WinHeight; i++) {
+ if (wbuf[i] != pbuf[i]) {
+ dif = 1;
+ break;
+ }
+ }
+
+ if (dif)
+ printf("Difference at %d: 0x%08x vs. 0x%08x\n", i, wbuf[i], pbuf[i]);
+ else
+ printf("Window rendering matches Pbuffer rendering!\n");
+
+ free(wbuf);
+ free(pbuf);
+}
+
+
+/* new window size or exposure */
+static void
+reshape(int width, int height)
+{
+ GLfloat ar = (GLfloat) width / (GLfloat) height;
+
+ WinWidth = width;
+ WinHeight = height;
+
+ glViewport(0, 0, (GLint) width, (GLint) height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+
+#ifdef GL_VERSION_ES_CM_1_0
+ glFrustumf(-ar, ar, -1, 1, 5.0, 60.0);
+#else
+ glFrustum(-ar, ar, -1, 1, 5.0, 60.0);
+#endif
+
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+ glTranslatef(0.0, 0.0, -15.0);
+}
+
+
+static void
+make_texture(void)
+{
+#define SZ 64
+ GLenum Filter = GL_LINEAR;
+ GLubyte image[SZ][SZ][4];
+ GLuint i, j;
+
+ for (i = 0; i < SZ; i++) {
+ for (j = 0; j < SZ; j++) {
+ GLfloat d = (i - SZ/2) * (i - SZ/2) + (j - SZ/2) * (j - SZ/2);
+ d = sqrt(d);
+ if (d < SZ/3) {
+ image[i][j][0] = 255;
+ image[i][j][1] = 255;
+ image[i][j][2] = 255;
+ image[i][j][3] = 255;
+ }
+ else {
+ image[i][j][0] = 127;
+ image[i][j][1] = 127;
+ image[i][j][2] = 127;
+ image[i][j][3] = 255;
+ }
+ }
+ }
+
+ glActiveTexture(GL_TEXTURE0); /* unit 0 */
+ glBindTexture(GL_TEXTURE_2D, 42);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, SZ, SZ, 0,
+ GL_RGBA, GL_UNSIGNED_BYTE, image);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, Filter);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, Filter);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
+#undef SZ
+}
+
+
+
+static void
+init(void)
+{
+ static const GLfloat red[4] = {1, 0, 0, 0};
+ static const GLfloat white[4] = {1.0, 1.0, 1.0, 1.0};
+ static const GLfloat diffuse[4] = {0.7, 0.7, 0.7, 1.0};
+ static const GLfloat specular[4] = {0.001, 0.001, 0.001, 1.0};
+ static const GLfloat pos[4] = {20, 20, 50, 1};
+
+ glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, red);
+ glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, white);
+ glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, 9.0);
+
+ glEnable(GL_LIGHTING);
+ glEnable(GL_LIGHT0);
+ glLightfv(GL_LIGHT0, GL_POSITION, pos);
+ glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse);
+ glLightfv(GL_LIGHT0, GL_SPECULAR, specular);
+
+ glClearColor(0.4, 0.4, 0.4, 0.0);
+ glEnable(GL_DEPTH_TEST);
+
+ make_texture();
+ glEnable(GL_TEXTURE_2D);
+}
+
+
+/*
+ * Create an RGB, double-buffered X window.
+ * Return the window and context handles.
+ */
+static void
+make_x_window(Display *x_dpy, EGLDisplay egl_dpy,
+ const char *name,
+ int x, int y, int width, int height,
+ Window *winRet,
+ EGLContext *ctxRet,
+ EGLSurface *surfRet)
+{
+ static const EGLint attribs[] = {
+ EGL_RED_SIZE, 1,
+ EGL_GREEN_SIZE, 1,
+ EGL_BLUE_SIZE, 1,
+ EGL_DEPTH_SIZE, 1,
+ EGL_NONE
+ };
+
+ int scrnum;
+ XSetWindowAttributes attr;
+ unsigned long mask;
+ Window root;
+ Window win;
+ XVisualInfo *visInfo, visTemplate;
+ int num_visuals;
+ EGLContext ctx;
+ EGLConfig config;
+ EGLint num_configs;
+ EGLint vid;
+
+ scrnum = DefaultScreen( x_dpy );
+ root = RootWindow( x_dpy, scrnum );
+
+ if (!eglChooseConfig( egl_dpy, attribs, &config, 1, &num_configs)) {
+ printf("Error: couldn't get an EGL visual config\n");
+ exit(1);
+ }
+
+ assert(config);
+ assert(num_configs > 0);
+
+ if (!eglGetConfigAttrib(egl_dpy, config, EGL_NATIVE_VISUAL_ID, &vid)) {
+ printf("Error: eglGetConfigAttrib() failed\n");
+ exit(1);
+ }
+
+ /* The X window visual must match the EGL config */
+ visTemplate.visualid = vid;
+ visInfo = XGetVisualInfo(x_dpy, VisualIDMask, &visTemplate, &num_visuals);
+ if (!visInfo) {
+ printf("Error: couldn't get X visual\n");
+ exit(1);
+ }
+
+ /* window attributes */
+ attr.background_pixel = 0;
+ attr.border_pixel = 0;
+ attr.colormap = XCreateColormap( x_dpy, root, visInfo->visual, AllocNone);
+ attr.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask;
+ mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
+
+ win = XCreateWindow( x_dpy, root, 0, 0, width, height,
+ 0, visInfo->depth, InputOutput,
+ visInfo->visual, mask, &attr );
+
+ /* set hints and properties */
+ {
+ XSizeHints sizehints;
+ sizehints.x = x;
+ sizehints.y = y;
+ sizehints.width = width;
+ sizehints.height = height;
+ sizehints.flags = USSize | USPosition;
+ XSetNormalHints(x_dpy, win, &sizehints);
+ XSetStandardProperties(x_dpy, win, name, name,
+ None, (char **)NULL, 0, &sizehints);
+ }
+
+ eglBindAPI(EGL_OPENGL_ES_API);
+
+ ctx = eglCreateContext(egl_dpy, config, EGL_NO_CONTEXT, NULL );
+ if (!ctx) {
+ printf("Error: eglCreateContext failed\n");
+ exit(1);
+ }
+
+ *surfRet = eglCreateWindowSurface(egl_dpy, config, win, NULL);
+
+ if (!*surfRet) {
+ printf("Error: eglCreateWindowSurface failed\n");
+ exit(1);
+ }
+
+ XFree(visInfo);
+
+ *winRet = win;
+ *ctxRet = ctx;
+}
+
+
+static EGLSurface
+make_pbuffer(Display *x_dpy, EGLDisplay egl_dpy, int width, int height)
+{
+ static const EGLint config_attribs[] = {
+ EGL_RED_SIZE, 1,
+ EGL_GREEN_SIZE, 1,
+ EGL_BLUE_SIZE, 1,
+ EGL_DEPTH_SIZE, 1,
+ EGL_NONE
+ };
+ EGLConfig config;
+ EGLSurface pbuf;
+ EGLint num_configs;
+ EGLint pbuf_attribs[5];
+
+ pbuf_attribs[0] = EGL_WIDTH;
+ pbuf_attribs[1] = width;
+ pbuf_attribs[2] = EGL_HEIGHT;
+ pbuf_attribs[3] = height;
+ pbuf_attribs[4] = EGL_NONE;
+
+ if (!eglChooseConfig( egl_dpy, config_attribs, &config, 1, &num_configs)) {
+ printf("Error: couldn't get an EGL config for pbuffer\n");
+ exit(1);
+ }
+
+ pbuf = eglCreatePbufferSurface(egl_dpy, config, pbuf_attribs);
+
+ return pbuf;
+}
+
+
+static void
+event_loop(Display *dpy, Window win,
+ EGLDisplay egl_dpy, EGLSurface egl_surf, EGLSurface egl_pbuf,
+ EGLContext egl_ctx)
+{
+ int anim = 0;
+
+ while (1) {
+ int redraw = 0;
+
+ if (!anim || XPending(dpy)) {
+ XEvent event;
+ XNextEvent(dpy, &event);
+
+ switch (event.type) {
+ case Expose:
+ redraw = 1;
+ break;
+ case ConfigureNotify:
+ if (event.xconfigure.window == win)
+ reshape(event.xconfigure.width, event.xconfigure.height);
+ break;
+ case KeyPress:
+ {
+ char buffer[10];
+ int r, code;
+ code = XLookupKeysym(&event.xkey, 0);
+ if (code == XK_Left) {
+ view_roty += 5.0;
+ }
+ else if (code == XK_Right) {
+ view_roty -= 5.0;
+ }
+ else if (code == XK_Up) {
+ view_rotx += 5.0;
+ }
+ else if (code == XK_Down) {
+ view_rotx -= 5.0;
+ }
+ else {
+ r = XLookupString(&event.xkey, buffer, sizeof(buffer),
+ NULL, NULL);
+ if (buffer[0] == ' ') {
+ anim = !anim;
+ }
+ else if (buffer[0] == 27) {
+ /* escape */
+ return;
+ }
+ }
+ }
+ redraw = 1;
+ break;
+ default:
+ ; /*no-op*/
+ }
+ }
+
+ if (anim) {
+ view_rotx += 1.0;
+ view_roty += 2.0;
+ redraw = 1;
+ }
+
+ if (redraw) {
+ draw_both(egl_dpy, egl_surf, egl_pbuf, egl_ctx);
+ }
+ }
+}
+
+
+static void
+usage(void)
+{
+ printf("Usage:\n");
+ printf(" -display <displayname> set the display to run on\n");
+ printf(" -info display OpenGL renderer info\n");
+}
+
+
+int
+main(int argc, char *argv[])
+{
+ Display *x_dpy;
+ Window win;
+ EGLSurface egl_surf, egl_pbuf;
+ EGLContext egl_ctx;
+ EGLDisplay egl_dpy;
+ char *dpyName = NULL;
+ GLboolean printInfo = GL_FALSE;
+ EGLint egl_major, egl_minor;
+ int i;
+ const char *s;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-display") == 0) {
+ dpyName = argv[i+1];
+ i++;
+ }
+ else if (strcmp(argv[i], "-info") == 0) {
+ printInfo = GL_TRUE;
+ }
+ else {
+ usage();
+ return -1;
+ }
+ }
+
+ x_dpy = XOpenDisplay(dpyName);
+ if (!x_dpy) {
+ printf("Error: couldn't open display %s\n",
+ dpyName ? dpyName : getenv("DISPLAY"));
+ return -1;
+ }
+
+ egl_dpy = eglGetDisplay(x_dpy);
+ if (!egl_dpy) {
+ printf("Error: eglGetDisplay() failed\n");
+ return -1;
+ }
+
+ if (!eglInitialize(egl_dpy, &egl_major, &egl_minor)) {
+ printf("Error: eglInitialize() failed\n");
+ return -1;
+ }
+
+ s = eglQueryString(egl_dpy, EGL_VERSION);
+ printf("EGL_VERSION = %s\n", s);
+
+ s = eglQueryString(egl_dpy, EGL_VENDOR);
+ printf("EGL_VENDOR = %s\n", s);
+
+ s = eglQueryString(egl_dpy, EGL_EXTENSIONS);
+ printf("EGL_EXTENSIONS = %s\n", s);
+
+ s = eglQueryString(egl_dpy, EGL_CLIENT_APIS);
+ printf("EGL_CLIENT_APIS = %s\n", s);
+
+ make_x_window(x_dpy, egl_dpy,
+ "pbuffer", 0, 0, WinWidth, WinHeight,
+ &win, &egl_ctx, &egl_surf);
+
+ egl_pbuf = make_pbuffer(x_dpy, egl_dpy, WinWidth, WinHeight);
+ if (!egl_pbuf) {
+ printf("Error: eglCreatePBufferSurface() failed\n");
+ return -1;
+ }
+
+ XMapWindow(x_dpy, win);
+ if (!eglMakeCurrent(egl_dpy, egl_surf, egl_surf, egl_ctx)) {
+ printf("Error: eglMakeCurrent() failed\n");
+ return -1;
+ }
+
+ if (printInfo) {
+ printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+ printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS));
+ }
+
+ init();
+
+ /* Set initial projection/viewing transformation.
+ * We can't be sure we'll get a ConfigureNotify event when the window
+ * first appears.
+ */
+ reshape(WinWidth, WinHeight);
+
+ event_loop(x_dpy, win, egl_dpy, egl_surf, egl_pbuf, egl_ctx);
+
+ eglDestroyContext(egl_dpy, egl_ctx);
+ eglDestroySurface(egl_dpy, egl_surf);
+ eglTerminate(egl_dpy);
+
+
+ XDestroyWindow(x_dpy, win);
+ XCloseDisplay(x_dpy);
+
+ return 0;
+}
diff --git a/progs/es1/xegl/render_tex.c b/progs/es1/xegl/render_tex.c
new file mode 100644
index 0000000000..0d1027b712
--- /dev/null
+++ b/progs/es1/xegl/render_tex.c
@@ -0,0 +1,657 @@
+/*
+ * Copyright (C) 2008 Tunsgten Graphics,Inc. All Rights Reserved.
+ */
+
+/*
+ * Test EGL render to texture.
+ * Brian Paul
+ * August 2008
+ */
+
+
+#include <assert.h>
+#include <math.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <X11/keysym.h>
+#include <GLES/gl.h>
+#include <GLES/glext.h>
+#include <EGL/egl.h>
+
+
+static int TexWidth = 256, TexHeight = 256;
+
+static int WinWidth = 300, WinHeight = 300;
+
+static GLfloat view_rotx = 0.0, view_roty = 0.0, view_rotz = 0.0;
+
+static GLuint DotTexture, RenderTexture;
+
+
+static void
+Normal(GLfloat *n, GLfloat nx, GLfloat ny, GLfloat nz)
+{
+ n[0] = nx;
+ n[1] = ny;
+ n[2] = nz;
+}
+
+static void
+Vertex(GLfloat *v, GLfloat vx, GLfloat vy, GLfloat vz)
+{
+ v[0] = vx;
+ v[1] = vy;
+ v[2] = vz;
+}
+
+static void
+Texcoord(GLfloat *v, GLfloat s, GLfloat t)
+{
+ v[0] = s;
+ v[1] = t;
+}
+
+
+/* Borrowed from glut, adapted */
+static void
+draw_torus(GLfloat r, GLfloat R, GLint nsides, GLint rings)
+{
+ int i, j;
+ GLfloat theta, phi, theta1;
+ GLfloat cosTheta, sinTheta;
+ GLfloat cosTheta1, sinTheta1;
+ GLfloat ringDelta, sideDelta;
+ GLfloat varray[100][3], narray[100][3], tarray[100][2];
+ int vcount;
+
+ glVertexPointer(3, GL_FLOAT, 0, varray);
+ glNormalPointer(GL_FLOAT, 0, narray);
+ glTexCoordPointer(2, GL_FLOAT, 0, tarray);
+ glEnableClientState(GL_VERTEX_ARRAY);
+ glEnableClientState(GL_NORMAL_ARRAY);
+ glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+
+ ringDelta = 2.0 * M_PI / rings;
+ sideDelta = 2.0 * M_PI / nsides;
+
+ theta = 0.0;
+ cosTheta = 1.0;
+ sinTheta = 0.0;
+ for (i = rings - 1; i >= 0; i--) {
+ theta1 = theta + ringDelta;
+ cosTheta1 = cos(theta1);
+ sinTheta1 = sin(theta1);
+
+ vcount = 0; /* glBegin(GL_QUAD_STRIP); */
+
+ phi = 0.0;
+ for (j = nsides; j >= 0; j--) {
+ GLfloat s0, s1, t;
+ GLfloat cosPhi, sinPhi, dist;
+
+ phi += sideDelta;
+ cosPhi = cos(phi);
+ sinPhi = sin(phi);
+ dist = R + r * cosPhi;
+
+ s0 = 20.0 * theta / (2.0 * M_PI);
+ s1 = 20.0 * theta1 / (2.0 * M_PI);
+ t = 8.0 * phi / (2.0 * M_PI);
+
+ Normal(narray[vcount], cosTheta1 * cosPhi, -sinTheta1 * cosPhi, sinPhi);
+ Texcoord(tarray[vcount], s1, t);
+ Vertex(varray[vcount], cosTheta1 * dist, -sinTheta1 * dist, r * sinPhi);
+ vcount++;
+
+ Normal(narray[vcount], cosTheta * cosPhi, -sinTheta * cosPhi, sinPhi);
+ Texcoord(tarray[vcount], s0, t);
+ Vertex(varray[vcount], cosTheta * dist, -sinTheta * dist, r * sinPhi);
+ vcount++;
+ }
+
+ /*glEnd();*/
+ assert(vcount <= 100);
+ glDrawArrays(GL_TRIANGLE_STRIP, 0, vcount);
+
+ theta = theta1;
+ cosTheta = cosTheta1;
+ sinTheta = sinTheta1;
+ }
+
+ glDisableClientState(GL_VERTEX_ARRAY);
+ glDisableClientState(GL_NORMAL_ARRAY);
+ glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+}
+
+
+static void
+draw_torus_to_texture(void)
+{
+ glViewport(0, 0, TexWidth, TexHeight);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glFrustumf(-1, 1, -1, 1, 5.0, 60.0);
+
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+ glTranslatef(0.0, 0.0, -15.0);
+
+ glClearColor(0.4, 0.4, 0.4, 0.0);
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ glBindTexture(GL_TEXTURE_2D, DotTexture);
+
+ glEnable(GL_LIGHTING);
+
+ glPushMatrix();
+ glRotatef(view_roty, 0, 1, 0);
+ glScalef(0.5, 0.5, 0.5);
+
+ draw_torus(1.0, 3.0, 30, 60);
+
+ glPopMatrix();
+
+ glDisable(GL_LIGHTING);
+
+#if 0
+ glBindTexture(GL_TEXTURE_2D, RenderTexture);
+ glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, TexWidth, TexHeight);
+#endif
+
+ glFinish();
+}
+
+
+static void
+draw_textured_quad(void)
+{
+ GLfloat ar = (GLfloat) WinWidth / (GLfloat) WinHeight;
+
+ glViewport(0, 0, WinWidth, WinHeight);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glFrustumf(-ar, ar, -1, 1, 5.0, 60.0);
+
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+ glTranslatef(0.0, 0.0, -8.0);
+
+ glClearColor(0.4, 0.4, 1.0, 0.0);
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ glBindTexture(GL_TEXTURE_2D, RenderTexture);
+
+ glPushMatrix();
+ glRotatef(view_rotx, 1, 0, 0);
+ glRotatef(view_rotz, 0, 0, 1);
+
+ {
+ static const GLfloat texcoord[4][2] = {
+ { 0, 0 }, { 1, 0 }, { 0, 1 }, { 1, 1 }
+ };
+ static const GLfloat vertex[4][2] = {
+ { -1, -1 }, { 1, -1 }, { -1, 1 }, { 1, 1 }
+ };
+
+ glVertexPointer(2, GL_FLOAT, 0, vertex);
+ glTexCoordPointer(2, GL_FLOAT, 0, texcoord);
+ glEnableClientState(GL_VERTEX_ARRAY);
+ glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+
+ glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
+
+ glDisableClientState(GL_VERTEX_ARRAY);
+ glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+ }
+
+ glPopMatrix();
+}
+
+
+
+static void
+draw(EGLDisplay egl_dpy, EGLSurface egl_surf, EGLSurface egl_pbuf,
+ EGLContext egl_ctx)
+{
+ /*printf("Begin draw\n");*/
+
+ /* first draw torus to pbuffer /texture */
+#if 01
+ if (!eglMakeCurrent(egl_dpy, egl_pbuf, egl_pbuf, egl_ctx)) {
+#else
+ if (!eglMakeCurrent(egl_dpy, egl_surf, egl_surf, egl_ctx)) {
+#endif
+ printf("Error: eglMakeCurrent(pbuf) failed\n");
+ return;
+ }
+ glBindTexture(GL_TEXTURE_2D, RenderTexture);
+ eglBindTexImage(egl_dpy, egl_pbuf, EGL_BACK_BUFFER);
+ draw_torus_to_texture();
+ eglReleaseTexImage(egl_dpy, egl_pbuf, EGL_BACK_BUFFER);
+
+ /* draw textured quad to window */
+ if (!eglMakeCurrent(egl_dpy, egl_surf, egl_surf, egl_ctx)) {
+ printf("Error: eglMakeCurrent(pbuffer) failed\n");
+ return;
+ }
+ draw_textured_quad();
+ eglSwapBuffers(egl_dpy, egl_surf);
+
+ /*printf("End draw\n");*/
+}
+
+
+
+static void
+make_dot_texture(void)
+{
+#define SZ 64
+ GLenum Filter = GL_LINEAR;
+ GLubyte image[SZ][SZ][4];
+ GLuint i, j;
+
+ for (i = 0; i < SZ; i++) {
+ for (j = 0; j < SZ; j++) {
+ GLfloat d = (i - SZ/2) * (i - SZ/2) + (j - SZ/2) * (j - SZ/2);
+ d = sqrt(d);
+ if (d < SZ/3) {
+ image[i][j][0] = 255;
+ image[i][j][1] = 255;
+ image[i][j][2] = 255;
+ image[i][j][3] = 255;
+ }
+ else {
+ image[i][j][0] = 127;
+ image[i][j][1] = 127;
+ image[i][j][2] = 127;
+ image[i][j][3] = 255;
+ }
+ }
+ }
+
+ glGenTextures(1, &DotTexture);
+ glBindTexture(GL_TEXTURE_2D, DotTexture);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, SZ, SZ, 0,
+ GL_RGBA, GL_UNSIGNED_BYTE, image);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, Filter);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, Filter);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
+#undef SZ
+}
+
+
+static void
+make_render_texture(void)
+{
+ GLenum Filter = GL_LINEAR;
+ glGenTextures(1, &RenderTexture);
+ glBindTexture(GL_TEXTURE_2D, RenderTexture);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, TexWidth, TexHeight, 0,
+ GL_RGBA, GL_UNSIGNED_BYTE, NULL);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, Filter);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, Filter);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
+}
+
+
+static void
+init(void)
+{
+ static const GLfloat red[4] = {1, 0, 0, 0};
+ static const GLfloat white[4] = {1.0, 1.0, 1.0, 1.0};
+ static const GLfloat diffuse[4] = {0.7, 0.7, 0.7, 1.0};
+ static const GLfloat specular[4] = {0.001, 0.001, 0.001, 1.0};
+ static const GLfloat pos[4] = {20, 20, 50, 1};
+
+ glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, red);
+ glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, white);
+ glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, 9.0);
+
+ glEnable(GL_LIGHT0);
+ glLightfv(GL_LIGHT0, GL_POSITION, pos);
+ glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse);
+ glLightfv(GL_LIGHT0, GL_SPECULAR, specular);
+
+ glEnable(GL_DEPTH_TEST);
+
+ make_dot_texture();
+ make_render_texture();
+
+ printf("DotTexture=%u RenderTexture=%u\n", DotTexture, RenderTexture);
+
+ glEnable(GL_TEXTURE_2D);
+}
+
+
+/*
+ * Create an RGB, double-buffered X window.
+ * Return the window and context handles.
+ */
+static void
+make_x_window(Display *x_dpy, EGLDisplay egl_dpy,
+ const char *name,
+ int x, int y, int width, int height,
+ Window *winRet,
+ EGLContext *ctxRet,
+ EGLSurface *surfRet)
+{
+ static const EGLint attribs[] = {
+ EGL_RED_SIZE, 1,
+ EGL_GREEN_SIZE, 1,
+ EGL_BLUE_SIZE, 1,
+ EGL_DEPTH_SIZE, 1,
+ EGL_NONE
+ };
+
+ int scrnum;
+ XSetWindowAttributes attr;
+ unsigned long mask;
+ Window root;
+ Window win;
+ XVisualInfo *visInfo, visTemplate;
+ int num_visuals;
+ EGLContext ctx;
+ EGLConfig config;
+ EGLint num_configs;
+ EGLint vid;
+
+ scrnum = DefaultScreen( x_dpy );
+ root = RootWindow( x_dpy, scrnum );
+
+ if (!eglChooseConfig( egl_dpy, attribs, &config, 1, &num_configs)) {
+ printf("Error: couldn't get an EGL visual config\n");
+ exit(1);
+ }
+
+ assert(config);
+ assert(num_configs > 0);
+
+ if (!eglGetConfigAttrib(egl_dpy, config, EGL_NATIVE_VISUAL_ID, &vid)) {
+ printf("Error: eglGetConfigAttrib() failed\n");
+ exit(1);
+ }
+
+ /* The X window visual must match the EGL config */
+ visTemplate.visualid = vid;
+ visInfo = XGetVisualInfo(x_dpy, VisualIDMask, &visTemplate, &num_visuals);
+ if (!visInfo) {
+ printf("Error: couldn't get X visual\n");
+ exit(1);
+ }
+
+ /* window attributes */
+ attr.background_pixel = 0;
+ attr.border_pixel = 0;
+ attr.colormap = XCreateColormap( x_dpy, root, visInfo->visual, AllocNone);
+ attr.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask;
+ mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
+
+ win = XCreateWindow( x_dpy, root, 0, 0, width, height,
+ 0, visInfo->depth, InputOutput,
+ visInfo->visual, mask, &attr );
+
+ /* set hints and properties */
+ {
+ XSizeHints sizehints;
+ sizehints.x = x;
+ sizehints.y = y;
+ sizehints.width = width;
+ sizehints.height = height;
+ sizehints.flags = USSize | USPosition;
+ XSetNormalHints(x_dpy, win, &sizehints);
+ XSetStandardProperties(x_dpy, win, name, name,
+ None, (char **)NULL, 0, &sizehints);
+ }
+
+ eglBindAPI(EGL_OPENGL_ES_API);
+
+ ctx = eglCreateContext(egl_dpy, config, EGL_NO_CONTEXT, NULL );
+ if (!ctx) {
+ printf("Error: eglCreateContext failed\n");
+ exit(1);
+ }
+
+ *surfRet = eglCreateWindowSurface(egl_dpy, config, win, NULL);
+
+ if (!*surfRet) {
+ printf("Error: eglCreateWindowSurface failed\n");
+ exit(1);
+ }
+
+ XFree(visInfo);
+
+ *winRet = win;
+ *ctxRet = ctx;
+}
+
+
+static EGLSurface
+make_pbuffer(Display *x_dpy, EGLDisplay egl_dpy, int width, int height)
+{
+ static const EGLint config_attribs[] = {
+ EGL_RED_SIZE, 1,
+ EGL_GREEN_SIZE, 1,
+ EGL_BLUE_SIZE, 1,
+ EGL_DEPTH_SIZE, 1,
+ EGL_NONE
+ };
+ EGLConfig config;
+ EGLSurface pbuf;
+ EGLint num_configs;
+ EGLint pbuf_attribs[15];
+ int i = 0;
+
+ pbuf_attribs[i++] = EGL_WIDTH;
+ pbuf_attribs[i++] = width;
+ pbuf_attribs[i++] = EGL_HEIGHT;
+ pbuf_attribs[i++] = height;
+ pbuf_attribs[i++] = EGL_TEXTURE_FORMAT;
+ pbuf_attribs[i++] = EGL_TEXTURE_RGBA;
+ pbuf_attribs[i++] = EGL_TEXTURE_TARGET;
+ pbuf_attribs[i++] = EGL_TEXTURE_2D;
+ pbuf_attribs[i++] = EGL_MIPMAP_TEXTURE;
+ pbuf_attribs[i++] = EGL_FALSE;
+ pbuf_attribs[i++] = EGL_NONE;
+ assert(i <= 15);
+
+ if (!eglChooseConfig( egl_dpy, config_attribs, &config, 1, &num_configs)) {
+ printf("Error: couldn't get an EGL config for pbuffer\n");
+ exit(1);
+ }
+
+ pbuf = eglCreatePbufferSurface(egl_dpy, config, pbuf_attribs);
+
+ return pbuf;
+}
+
+
+static void
+event_loop(Display *dpy, Window win,
+ EGLDisplay egl_dpy, EGLSurface egl_surf, EGLSurface egl_pbuf,
+ EGLContext egl_ctx)
+{
+ int anim = 0;
+
+ while (1) {
+ int redraw = 0;
+
+ if (!anim || XPending(dpy)) {
+ XEvent event;
+ XNextEvent(dpy, &event);
+
+ switch (event.type) {
+ case Expose:
+ redraw = 1;
+ break;
+ case ConfigureNotify:
+ if (event.xconfigure.window == win) {
+ WinWidth = event.xconfigure.width;
+ WinHeight = event.xconfigure.height;
+ }
+ break;
+ case KeyPress:
+ {
+ char buffer[10];
+ int r, code;
+ code = XLookupKeysym(&event.xkey, 0);
+ if (code == XK_Left) {
+ view_roty += 5.0;
+ }
+ else if (code == XK_Right) {
+ view_roty -= 5.0;
+ }
+ else if (code == XK_Up) {
+ view_rotx += 5.0;
+ }
+ else if (code == XK_Down) {
+ view_rotx -= 5.0;
+ }
+ else {
+ r = XLookupString(&event.xkey, buffer, sizeof(buffer),
+ NULL, NULL);
+ if (buffer[0] == ' ') {
+ anim = !anim;
+ }
+ else if (buffer[0] == 'z') {
+ view_rotz += 5.0;
+ }
+ else if (buffer[0] == 'Z') {
+ view_rotz -= 5.0;
+ }
+ else if (buffer[0] == 27) {
+ /* escape */
+ return;
+ }
+ }
+ }
+ redraw = 1;
+ break;
+ default:
+ ; /*no-op*/
+ }
+ }
+
+ if (anim) {
+ view_rotx += 1.0;
+ view_roty += 2.0;
+ redraw = 1;
+ }
+
+ if (redraw) {
+ draw(egl_dpy, egl_surf, egl_pbuf, egl_ctx);
+ }
+ }
+}
+
+
+static void
+usage(void)
+{
+ printf("Usage:\n");
+ printf(" -display <displayname> set the display to run on\n");
+ printf(" -info display OpenGL renderer info\n");
+}
+
+
+int
+main(int argc, char *argv[])
+{
+ Display *x_dpy;
+ Window win;
+ EGLSurface egl_surf, egl_pbuf;
+ EGLContext egl_ctx;
+ EGLDisplay egl_dpy;
+ char *dpyName = NULL;
+ GLboolean printInfo = GL_FALSE;
+ EGLint egl_major, egl_minor;
+ int i;
+ const char *s;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-display") == 0) {
+ dpyName = argv[i+1];
+ i++;
+ }
+ else if (strcmp(argv[i], "-info") == 0) {
+ printInfo = GL_TRUE;
+ }
+ else {
+ usage();
+ return -1;
+ }
+ }
+
+ x_dpy = XOpenDisplay(dpyName);
+ if (!x_dpy) {
+ printf("Error: couldn't open display %s\n",
+ dpyName ? dpyName : getenv("DISPLAY"));
+ return -1;
+ }
+
+ egl_dpy = eglGetDisplay(x_dpy);
+ if (!egl_dpy) {
+ printf("Error: eglGetDisplay() failed\n");
+ return -1;
+ }
+
+ if (!eglInitialize(egl_dpy, &egl_major, &egl_minor)) {
+ printf("Error: eglInitialize() failed\n");
+ return -1;
+ }
+
+ s = eglQueryString(egl_dpy, EGL_VERSION);
+ printf("EGL_VERSION = %s\n", s);
+
+ s = eglQueryString(egl_dpy, EGL_VENDOR);
+ printf("EGL_VENDOR = %s\n", s);
+
+ s = eglQueryString(egl_dpy, EGL_EXTENSIONS);
+ printf("EGL_EXTENSIONS = %s\n", s);
+
+ s = eglQueryString(egl_dpy, EGL_CLIENT_APIS);
+ printf("EGL_CLIENT_APIS = %s\n", s);
+
+ make_x_window(x_dpy, egl_dpy,
+ "render_tex", 0, 0, WinWidth, WinHeight,
+ &win, &egl_ctx, &egl_surf);
+
+ egl_pbuf = make_pbuffer(x_dpy, egl_dpy, TexWidth, TexHeight);
+ if (!egl_pbuf) {
+ printf("Error: eglCreatePBufferSurface() failed\n");
+ return -1;
+ }
+
+ XMapWindow(x_dpy, win);
+ if (!eglMakeCurrent(egl_dpy, egl_surf, egl_surf, egl_ctx)) {
+ printf("Error: eglMakeCurrent() failed\n");
+ return -1;
+ }
+
+ if (printInfo) {
+ printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+ printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS));
+ }
+
+ init();
+
+ event_loop(x_dpy, win, egl_dpy, egl_surf, egl_pbuf, egl_ctx);
+
+ eglDestroyContext(egl_dpy, egl_ctx);
+ eglDestroySurface(egl_dpy, egl_surf);
+ eglTerminate(egl_dpy);
+
+
+ XDestroyWindow(x_dpy, win);
+ XCloseDisplay(x_dpy);
+
+ return 0;
+}
diff --git a/progs/es1/xegl/torus.c b/progs/es1/xegl/torus.c
new file mode 100644
index 0000000000..9438a4fe59
--- /dev/null
+++ b/progs/es1/xegl/torus.c
@@ -0,0 +1,656 @@
+/*
+ * Copyright (C) 2008 Tunsgten Graphics,Inc. All Rights Reserved.
+ */
+
+/*
+ * Draw a lit, textured torus with X/EGL and OpenGL ES 1.x
+ * Brian Paul
+ * July 2008
+ */
+
+
+#include <assert.h>
+#include <math.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <X11/keysym.h>
+#include <GLES/gl.h>
+#include <GLES/glext.h>
+#include <EGL/egl.h>
+
+
+static const struct {
+ GLenum internalFormat;
+ const char *name;
+ GLuint num_entries;
+ GLuint size;
+} cpal_formats[] = {
+ { GL_PALETTE4_RGB8_OES, "GL_PALETTE4_RGB8_OES", 16, 3 },
+ { GL_PALETTE4_RGBA8_OES, "GL_PALETTE4_RGBA8_OES", 16, 4 },
+ { GL_PALETTE4_R5_G6_B5_OES, "GL_PALETTE4_R5_G6_B5_OES", 16, 2 },
+ { GL_PALETTE4_RGBA4_OES, "GL_PALETTE4_RGBA4_OES", 16, 2 },
+ { GL_PALETTE4_RGB5_A1_OES, "GL_PALETTE4_RGB5_A1_OES", 16, 2 },
+ { GL_PALETTE8_RGB8_OES, "GL_PALETTE8_RGB8_OES", 256, 3 },
+ { GL_PALETTE8_RGBA8_OES, "GL_PALETTE8_RGBA8_OES", 256, 4 },
+ { GL_PALETTE8_R5_G6_B5_OES, "GL_PALETTE8_R5_G6_B5_OES", 256, 2 },
+ { GL_PALETTE8_RGBA4_OES, "GL_PALETTE8_RGBA4_OES", 256, 2 },
+ { GL_PALETTE8_RGB5_A1_OES, "GL_PALETTE8_RGB5_A1_OES", 256, 2 }
+};
+#define NUM_CPAL_FORMATS (sizeof(cpal_formats) / sizeof(cpal_formats[0]))
+
+static GLfloat view_rotx = 0.0, view_roty = 0.0, view_rotz = 0.0;
+static GLint tex_format = NUM_CPAL_FORMATS;
+
+
+static void
+Normal(GLfloat *n, GLfloat nx, GLfloat ny, GLfloat nz)
+{
+ n[0] = nx;
+ n[1] = ny;
+ n[2] = nz;
+}
+
+static void
+Vertex(GLfloat *v, GLfloat vx, GLfloat vy, GLfloat vz)
+{
+ v[0] = vx;
+ v[1] = vy;
+ v[2] = vz;
+}
+
+static void
+Texcoord(GLfloat *v, GLfloat s, GLfloat t)
+{
+ v[0] = s;
+ v[1] = t;
+}
+
+
+/* Borrowed from glut, adapted */
+static void
+draw_torus(GLfloat r, GLfloat R, GLint nsides, GLint rings)
+{
+ int i, j;
+ GLfloat theta, phi, theta1;
+ GLfloat cosTheta, sinTheta;
+ GLfloat cosTheta1, sinTheta1;
+ GLfloat ringDelta, sideDelta;
+ GLfloat varray[100][3], narray[100][3], tarray[100][2];
+ int vcount;
+
+ glVertexPointer(3, GL_FLOAT, 0, varray);
+ glNormalPointer(GL_FLOAT, 0, narray);
+ glTexCoordPointer(2, GL_FLOAT, 0, tarray);
+ glEnableClientState(GL_VERTEX_ARRAY);
+ glEnableClientState(GL_NORMAL_ARRAY);
+ glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+
+ ringDelta = 2.0 * M_PI / rings;
+ sideDelta = 2.0 * M_PI / nsides;
+
+ theta = 0.0;
+ cosTheta = 1.0;
+ sinTheta = 0.0;
+ for (i = rings - 1; i >= 0; i--) {
+ theta1 = theta + ringDelta;
+ cosTheta1 = cos(theta1);
+ sinTheta1 = sin(theta1);
+
+ vcount = 0; /* glBegin(GL_QUAD_STRIP); */
+
+ phi = 0.0;
+ for (j = nsides; j >= 0; j--) {
+ GLfloat s0, s1, t;
+ GLfloat cosPhi, sinPhi, dist;
+
+ phi += sideDelta;
+ cosPhi = cos(phi);
+ sinPhi = sin(phi);
+ dist = R + r * cosPhi;
+
+ s0 = 20.0 * theta / (2.0 * M_PI);
+ s1 = 20.0 * theta1 / (2.0 * M_PI);
+ t = 8.0 * phi / (2.0 * M_PI);
+
+ Normal(narray[vcount], cosTheta1 * cosPhi, -sinTheta1 * cosPhi, sinPhi);
+ Texcoord(tarray[vcount], s1, t);
+ Vertex(varray[vcount], cosTheta1 * dist, -sinTheta1 * dist, r * sinPhi);
+ vcount++;
+
+ Normal(narray[vcount], cosTheta * cosPhi, -sinTheta * cosPhi, sinPhi);
+ Texcoord(tarray[vcount], s0, t);
+ Vertex(varray[vcount], cosTheta * dist, -sinTheta * dist, r * sinPhi);
+ vcount++;
+ }
+
+ /*glEnd();*/
+ assert(vcount <= 100);
+ glDrawArrays(GL_TRIANGLE_STRIP, 0, vcount);
+
+ theta = theta1;
+ cosTheta = cosTheta1;
+ sinTheta = sinTheta1;
+ }
+
+ glDisableClientState(GL_VERTEX_ARRAY);
+ glDisableClientState(GL_NORMAL_ARRAY);
+ glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+}
+
+
+static void
+draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ glPushMatrix();
+ glRotatef(view_rotx, 1, 0, 0);
+ glRotatef(view_roty, 0, 1, 0);
+ glRotatef(view_rotz, 0, 0, 1);
+ glScalef(0.5, 0.5, 0.5);
+
+ draw_torus(1.0, 3.0, 30, 60);
+
+ glPopMatrix();
+}
+
+
+/* new window size or exposure */
+static void
+reshape(int width, int height)
+{
+ GLfloat ar = (GLfloat) width / (GLfloat) height;
+
+ glViewport(0, 0, (GLint) width, (GLint) height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+
+#ifdef GL_VERSION_ES_CM_1_0
+ glFrustumf(-ar, ar, -1, 1, 5.0, 60.0);
+#else
+ glFrustum(-ar, ar, -1, 1, 5.0, 60.0);
+#endif
+
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+ glTranslatef(0.0, 0.0, -15.0);
+}
+
+
+static GLint
+make_cpal_texture(GLint idx)
+{
+#define SZ 64
+ GLenum internalFormat = GL_PALETTE4_RGB8_OES + idx;
+ GLenum Filter = GL_LINEAR;
+ GLubyte palette[256 * 4 + SZ * SZ];
+ GLubyte *indices;
+ GLsizei image_size;
+ GLuint i, j;
+ GLuint packed_indices = 0;
+
+ assert(cpal_formats[idx].internalFormat == internalFormat);
+
+ /* init palette */
+ switch (internalFormat) {
+ case GL_PALETTE4_RGB8_OES:
+ case GL_PALETTE8_RGB8_OES:
+ /* first entry */
+ palette[0] = 255;
+ palette[1] = 255;
+ palette[2] = 255;
+ /* second entry */
+ palette[3] = 127;
+ palette[4] = 127;
+ palette[5] = 127;
+ break;
+ case GL_PALETTE4_RGBA8_OES:
+ case GL_PALETTE8_RGBA8_OES:
+ /* first entry */
+ palette[0] = 255;
+ palette[1] = 255;
+ palette[2] = 255;
+ palette[3] = 255;
+ /* second entry */
+ palette[4] = 127;
+ palette[5] = 127;
+ palette[6] = 127;
+ palette[7] = 255;
+ break;
+ case GL_PALETTE4_R5_G6_B5_OES:
+ case GL_PALETTE8_R5_G6_B5_OES:
+ {
+ GLushort *pal = (GLushort *) palette;
+ /* first entry */
+ pal[0] = (31 << 11 | 63 << 5 | 31);
+ /* second entry */
+ pal[1] = (15 << 11 | 31 << 5 | 15);
+ }
+ break;
+ case GL_PALETTE4_RGBA4_OES:
+ case GL_PALETTE8_RGBA4_OES:
+ {
+ GLushort *pal = (GLushort *) palette;
+ /* first entry */
+ pal[0] = (15 << 12 | 15 << 8 | 15 << 4 | 15);
+ /* second entry */
+ pal[1] = (7 << 12 | 7 << 8 | 7 << 4 | 15);
+ }
+ break;
+ case GL_PALETTE4_RGB5_A1_OES:
+ case GL_PALETTE8_RGB5_A1_OES:
+ {
+ GLushort *pal = (GLushort *) palette;
+ /* first entry */
+ pal[0] = (31 << 11 | 31 << 6 | 31 << 1 | 1);
+ /* second entry */
+ pal[1] = (15 << 11 | 15 << 6 | 15 << 1 | 1);
+ }
+ break;
+ }
+
+ image_size = cpal_formats[idx].size * cpal_formats[idx].num_entries;
+ indices = palette + image_size;
+ for (i = 0; i < SZ; i++) {
+ for (j = 0; j < SZ; j++) {
+ GLfloat d;
+ GLint index;
+ d = (i - SZ/2) * (i - SZ/2) + (j - SZ/2) * (j - SZ/2);
+ d = sqrt(d);
+ index = (d < SZ / 3) ? 0 : 1;
+
+ if (cpal_formats[idx].num_entries == 16) {
+ /* 4-bit indices packed in GLubyte */
+ packed_indices |= index << (4 * (1 - (j % 2)));
+ if (j % 2) {
+ *(indices + (i * SZ + j - 1) / 2) = packed_indices & 0xff;
+ packed_indices = 0;
+ image_size += 1;
+ }
+ }
+ else {
+ /* 8-bit indices */
+ *(indices + i * SZ + j) = index;
+ image_size += 1;
+ }
+ }
+ }
+
+ glActiveTexture(GL_TEXTURE0); /* unit 0 */
+ glBindTexture(GL_TEXTURE_2D, 42);
+ glCompressedTexImage2D(GL_TEXTURE_2D, 0, internalFormat, SZ, SZ, 0,
+ image_size, palette);
+
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, Filter);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, Filter);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
+#undef SZ
+
+ return image_size;
+}
+
+
+static GLint
+make_texture(void)
+{
+#define SZ 64
+ GLenum Filter = GL_LINEAR;
+ GLubyte image[SZ][SZ][4];
+ GLuint i, j;
+
+ for (i = 0; i < SZ; i++) {
+ for (j = 0; j < SZ; j++) {
+ GLfloat d = (i - SZ/2) * (i - SZ/2) + (j - SZ/2) * (j - SZ/2);
+ d = sqrt(d);
+ if (d < SZ/3) {
+ image[i][j][0] = 255;
+ image[i][j][1] = 255;
+ image[i][j][2] = 255;
+ image[i][j][3] = 255;
+ }
+ else {
+ image[i][j][0] = 127;
+ image[i][j][1] = 127;
+ image[i][j][2] = 127;
+ image[i][j][3] = 255;
+ }
+ }
+ }
+
+ glActiveTexture(GL_TEXTURE0); /* unit 0 */
+ glBindTexture(GL_TEXTURE_2D, 42);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, SZ, SZ, 0,
+ GL_RGBA, GL_UNSIGNED_BYTE, image);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, Filter);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, Filter);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
+#undef SZ
+
+ return sizeof(image);
+}
+
+
+
+static void
+init(void)
+{
+ static const GLfloat red[4] = {1, 0, 0, 0};
+ static const GLfloat white[4] = {1.0, 1.0, 1.0, 1.0};
+ static const GLfloat diffuse[4] = {0.7, 0.7, 0.7, 1.0};
+ static const GLfloat specular[4] = {0.001, 0.001, 0.001, 1.0};
+ static const GLfloat pos[4] = {20, 20, 50, 1};
+
+ glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, red);
+ glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, white);
+ glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, 9.0);
+
+ glEnable(GL_LIGHTING);
+ glEnable(GL_LIGHT0);
+ glLightfv(GL_LIGHT0, GL_POSITION, pos);
+ glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse);
+ glLightfv(GL_LIGHT0, GL_SPECULAR, specular);
+
+ glClearColor(0.4, 0.4, 0.4, 0.0);
+ glEnable(GL_DEPTH_TEST);
+
+ make_texture();
+ glEnable(GL_TEXTURE_2D);
+}
+
+
+/*
+ * Create an RGB, double-buffered X window.
+ * Return the window and context handles.
+ */
+static void
+make_x_window(Display *x_dpy, EGLDisplay egl_dpy,
+ const char *name,
+ int x, int y, int width, int height,
+ Window *winRet,
+ EGLContext *ctxRet,
+ EGLSurface *surfRet)
+{
+ static const EGLint attribs[] = {
+ EGL_RED_SIZE, 1,
+ EGL_GREEN_SIZE, 1,
+ EGL_BLUE_SIZE, 1,
+ EGL_DEPTH_SIZE, 1,
+ EGL_NONE
+ };
+
+ int scrnum;
+ XSetWindowAttributes attr;
+ unsigned long mask;
+ Window root;
+ Window win;
+ XVisualInfo *visInfo, visTemplate;
+ int num_visuals;
+ EGLContext ctx;
+ EGLConfig config;
+ EGLint num_configs;
+ EGLint vid;
+
+ scrnum = DefaultScreen( x_dpy );
+ root = RootWindow( x_dpy, scrnum );
+
+ if (!eglChooseConfig( egl_dpy, attribs, &config, 1, &num_configs)) {
+ printf("Error: couldn't get an EGL visual config\n");
+ exit(1);
+ }
+
+ assert(config);
+ assert(num_configs > 0);
+
+ if (!eglGetConfigAttrib(egl_dpy, config, EGL_NATIVE_VISUAL_ID, &vid)) {
+ printf("Error: eglGetConfigAttrib() failed\n");
+ exit(1);
+ }
+
+ /* The X window visual must match the EGL config */
+ visTemplate.visualid = vid;
+ visInfo = XGetVisualInfo(x_dpy, VisualIDMask, &visTemplate, &num_visuals);
+ if (!visInfo) {
+ printf("Error: couldn't get X visual\n");
+ exit(1);
+ }
+
+ /* window attributes */
+ attr.background_pixel = 0;
+ attr.border_pixel = 0;
+ attr.colormap = XCreateColormap( x_dpy, root, visInfo->visual, AllocNone);
+ attr.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask;
+ mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
+
+ win = XCreateWindow( x_dpy, root, 0, 0, width, height,
+ 0, visInfo->depth, InputOutput,
+ visInfo->visual, mask, &attr );
+
+ /* set hints and properties */
+ {
+ XSizeHints sizehints;
+ sizehints.x = x;
+ sizehints.y = y;
+ sizehints.width = width;
+ sizehints.height = height;
+ sizehints.flags = USSize | USPosition;
+ XSetNormalHints(x_dpy, win, &sizehints);
+ XSetStandardProperties(x_dpy, win, name, name,
+ None, (char **)NULL, 0, &sizehints);
+ }
+
+ eglBindAPI(EGL_OPENGL_ES_API);
+
+ ctx = eglCreateContext(egl_dpy, config, EGL_NO_CONTEXT, NULL );
+ if (!ctx) {
+ printf("Error: eglCreateContext failed\n");
+ exit(1);
+ }
+
+ *surfRet = eglCreateWindowSurface(egl_dpy, config, win, NULL);
+
+ if (!*surfRet) {
+ printf("Error: eglCreateWindowSurface failed\n");
+ exit(1);
+ }
+
+ XFree(visInfo);
+
+ *winRet = win;
+ *ctxRet = ctx;
+}
+
+
+static void
+event_loop(Display *dpy, Window win,
+ EGLDisplay egl_dpy, EGLSurface egl_surf)
+{
+ int anim = 1;
+
+ while (1) {
+ int redraw = 0;
+
+ if (!anim || XPending(dpy)) {
+ XEvent event;
+ XNextEvent(dpy, &event);
+
+ switch (event.type) {
+ case Expose:
+ redraw = 1;
+ break;
+ case ConfigureNotify:
+ reshape(event.xconfigure.width, event.xconfigure.height);
+ break;
+ case KeyPress:
+ {
+ char buffer[10];
+ int r, code;
+ code = XLookupKeysym(&event.xkey, 0);
+ if (code == XK_Left) {
+ view_roty += 5.0;
+ }
+ else if (code == XK_Right) {
+ view_roty -= 5.0;
+ }
+ else if (code == XK_Up) {
+ view_rotx += 5.0;
+ }
+ else if (code == XK_Down) {
+ view_rotx -= 5.0;
+ }
+ else if (code == XK_t) {
+ GLint size;
+ tex_format = (tex_format + 1) % (NUM_CPAL_FORMATS + 1);
+ if (tex_format < NUM_CPAL_FORMATS) {
+ size = make_cpal_texture(tex_format);
+ printf("Using %s (%d bytes)\n",
+ cpal_formats[tex_format].name, size);
+ }
+ else {
+ size = make_texture();
+ printf("Using uncompressed texture (%d bytes)\n", size);
+ }
+ }
+ else {
+ r = XLookupString(&event.xkey, buffer, sizeof(buffer),
+ NULL, NULL);
+ if (buffer[0] == ' ') {
+ anim = !anim;
+ }
+ else if (buffer[0] == 27) {
+ /* escape */
+ return;
+ }
+ }
+ }
+ redraw = 1;
+ break;
+ default:
+ ; /*no-op*/
+ }
+ }
+
+ if (anim) {
+ view_rotx += 1.0;
+ view_roty += 2.0;
+ redraw = 1;
+ }
+
+ if (redraw) {
+ draw();
+ eglSwapBuffers(egl_dpy, egl_surf);
+ }
+ }
+}
+
+
+static void
+usage(void)
+{
+ printf("Usage:\n");
+ printf(" -display <displayname> set the display to run on\n");
+ printf(" -info display OpenGL renderer info\n");
+}
+
+
+int
+main(int argc, char *argv[])
+{
+ const int winWidth = 300, winHeight = 300;
+ Display *x_dpy;
+ Window win;
+ EGLSurface egl_surf;
+ EGLContext egl_ctx;
+ EGLDisplay egl_dpy;
+ char *dpyName = NULL;
+ GLboolean printInfo = GL_FALSE;
+ EGLint egl_major, egl_minor;
+ int i;
+ const char *s;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-display") == 0) {
+ dpyName = argv[i+1];
+ i++;
+ }
+ else if (strcmp(argv[i], "-info") == 0) {
+ printInfo = GL_TRUE;
+ }
+ else {
+ usage();
+ return -1;
+ }
+ }
+
+ x_dpy = XOpenDisplay(dpyName);
+ if (!x_dpy) {
+ printf("Error: couldn't open display %s\n",
+ dpyName ? dpyName : getenv("DISPLAY"));
+ return -1;
+ }
+
+ egl_dpy = eglGetDisplay(x_dpy);
+ if (!egl_dpy) {
+ printf("Error: eglGetDisplay() failed\n");
+ return -1;
+ }
+
+ if (!eglInitialize(egl_dpy, &egl_major, &egl_minor)) {
+ printf("Error: eglInitialize() failed\n");
+ return -1;
+ }
+
+ s = eglQueryString(egl_dpy, EGL_VERSION);
+ printf("EGL_VERSION = %s\n", s);
+
+ s = eglQueryString(egl_dpy, EGL_VENDOR);
+ printf("EGL_VENDOR = %s\n", s);
+
+ s = eglQueryString(egl_dpy, EGL_EXTENSIONS);
+ printf("EGL_EXTENSIONS = %s\n", s);
+
+ s = eglQueryString(egl_dpy, EGL_CLIENT_APIS);
+ printf("EGL_CLIENT_APIS = %s\n", s);
+
+ make_x_window(x_dpy, egl_dpy,
+ "torus", 0, 0, winWidth, winHeight,
+ &win, &egl_ctx, &egl_surf);
+
+ XMapWindow(x_dpy, win);
+ if (!eglMakeCurrent(egl_dpy, egl_surf, egl_surf, egl_ctx)) {
+ printf("Error: eglMakeCurrent() failed\n");
+ return -1;
+ }
+
+ if (printInfo) {
+ printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+ printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS));
+ }
+
+ init();
+
+ /* Set initial projection/viewing transformation.
+ * We can't be sure we'll get a ConfigureNotify event when the window
+ * first appears.
+ */
+ reshape(winWidth, winHeight);
+
+ event_loop(x_dpy, win, egl_dpy, egl_surf);
+
+ eglDestroyContext(egl_dpy, egl_ctx);
+ eglDestroySurface(egl_dpy, egl_surf);
+ eglTerminate(egl_dpy);
+
+
+ XDestroyWindow(x_dpy, win);
+ XCloseDisplay(x_dpy);
+
+ return 0;
+}
diff --git a/progs/es1/xegl/tri.c b/progs/es1/xegl/tri.c
new file mode 100644
index 0000000000..42a978207c
--- /dev/null
+++ b/progs/es1/xegl/tri.c
@@ -0,0 +1,470 @@
+/*
+ * Copyright (C) 2008 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.
+ */
+
+/*
+ * Draw a triangle with X/EGL and OpenGL ES 1.x
+ * Brian Paul
+ * 5 June 2008
+ */
+
+#define USE_FULL_GL 0
+
+#define USE_FIXED_POINT 0
+
+
+#include <assert.h>
+#include <math.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <X11/keysym.h>
+#if USE_FULL_GL
+#include <GL/gl.h> /* use full OpenGL */
+#else
+#include <GLES/gl.h> /* use OpenGL ES 1.x */
+#include <GLES/glext.h>
+#endif
+#include <EGL/egl.h>
+
+
+#define FLOAT_TO_FIXED(X) ((X) * 65535.0)
+
+
+
+static GLfloat view_rotx = 0.0, view_roty = 0.0, view_rotz = 0.0;
+
+
+static void
+draw(void)
+{
+#if USE_FIXED_POINT
+ static const GLfixed verts[3][2] = {
+ { -65536, -65536 },
+ { 65536, -65536 },
+ { 0, 65536 }
+ };
+ static const GLfixed colors[3][4] = {
+ { 65536, 0, 0, 65536 },
+ { 0, 65536, 0 , 65536},
+ { 0, 0, 65536 , 65536}
+ };
+#else
+ static const GLfloat verts[3][2] = {
+ { -1, -1 },
+ { 1, -1 },
+ { 0, 1 }
+ };
+ static const GLfloat colors[3][4] = {
+ { 1, 0, 0, 1 },
+ { 0, 1, 0, 1 },
+ { 0, 0, 1, 1 }
+ };
+#endif
+
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ glPushMatrix();
+ glRotatef(view_rotx, 1, 0, 0);
+ glRotatef(view_roty, 0, 1, 0);
+ glRotatef(view_rotz, 0, 0, 1);
+
+ {
+#if USE_FIXED_POINT
+ glVertexPointer(2, GL_FIXED, 0, verts);
+ glColorPointer(4, GL_FIXED, 0, colors);
+#else
+ glVertexPointer(2, GL_FLOAT, 0, verts);
+ glColorPointer(4, GL_FLOAT, 0, colors);
+#endif
+ glEnableClientState(GL_VERTEX_ARRAY);
+ glEnableClientState(GL_COLOR_ARRAY);
+
+ /* draw triangle */
+ glDrawArrays(GL_TRIANGLES, 0, 3);
+
+ /* draw some points */
+ glPointSizex(FLOAT_TO_FIXED(15.5));
+ glDrawArrays(GL_POINTS, 0, 3);
+
+ glDisableClientState(GL_VERTEX_ARRAY);
+ glDisableClientState(GL_COLOR_ARRAY);
+ }
+
+ if (0) {
+ /* test code */
+ GLfixed size;
+ glGetFixedv(GL_POINT_SIZE, &size);
+ printf("GL_POINT_SIZE = 0x%x %f\n", size, size / 65536.0);
+ }
+
+ glPopMatrix();
+}
+
+
+/* new window size or exposure */
+static void
+reshape(int width, int height)
+{
+ GLfloat ar = (GLfloat) width / (GLfloat) height;
+
+ glViewport(0, 0, (GLint) width, (GLint) height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+#ifdef GL_VERSION_ES_CM_1_0
+ glFrustumf(-ar, ar, -1, 1, 5.0, 60.0);
+#else
+ glFrustum(-ar, ar, -1, 1, 5.0, 60.0);
+#endif
+
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+ glTranslatef(0.0, 0.0, -10.0);
+}
+
+
+static void
+test_query_matrix(void)
+{
+ PFNGLQUERYMATRIXXOESPROC procQueryMatrixx;
+ typedef void (*voidproc)();
+ GLfixed mantissa[16];
+ GLint exponent[16];
+ GLbitfield rv;
+ int i;
+
+ procQueryMatrixx = (PFNGLQUERYMATRIXXOESPROC) eglGetProcAddress("glQueryMatrixxOES");
+ assert(procQueryMatrixx);
+ /* Actually try out this one */
+ rv = (*procQueryMatrixx)(mantissa, exponent);
+ for (i = 0; i < 16; i++) {
+ if (rv & (1<<i)) {
+ printf("matrix[%d] invalid\n", i);
+ }
+ else {
+ printf("matrix[%d] = %f * 2^(%d)\n", i, mantissa[i]/65536.0, exponent[i]);
+ }
+ }
+ assert(!eglGetProcAddress("glFoo"));
+}
+
+
+static void
+init(void)
+{
+ glClearColor(0.4, 0.4, 0.4, 0.0);
+
+ if (0)
+ test_query_matrix();
+}
+
+
+/*
+ * Create an RGB, double-buffered X window.
+ * Return the window and context handles.
+ */
+static void
+make_x_window(Display *x_dpy, EGLDisplay egl_dpy,
+ const char *name,
+ int x, int y, int width, int height,
+ Window *winRet,
+ EGLContext *ctxRet,
+ EGLSurface *surfRet)
+{
+ static const EGLint attribs[] = {
+ EGL_RED_SIZE, 1,
+ EGL_GREEN_SIZE, 1,
+ EGL_BLUE_SIZE, 1,
+ EGL_DEPTH_SIZE, 1,
+ EGL_NONE
+ };
+
+ int scrnum;
+ XSetWindowAttributes attr;
+ unsigned long mask;
+ Window root;
+ Window win;
+ XVisualInfo *visInfo, visTemplate;
+ int num_visuals;
+ EGLContext ctx;
+ EGLConfig config;
+ EGLint num_configs;
+ EGLint vid;
+
+ scrnum = DefaultScreen( x_dpy );
+ root = RootWindow( x_dpy, scrnum );
+
+ if (!eglChooseConfig( egl_dpy, attribs, &config, 1, &num_configs)) {
+ printf("Error: couldn't get an EGL visual config\n");
+ exit(1);
+ }
+
+ assert(config);
+ assert(num_configs > 0);
+
+ if (!eglGetConfigAttrib(egl_dpy, config, EGL_NATIVE_VISUAL_ID, &vid)) {
+ printf("Error: eglGetConfigAttrib() failed\n");
+ exit(1);
+ }
+
+ /* The X window visual must match the EGL config */
+ visTemplate.visualid = vid;
+ visInfo = XGetVisualInfo(x_dpy, VisualIDMask, &visTemplate, &num_visuals);
+ if (!visInfo) {
+ printf("Error: couldn't get X visual\n");
+ exit(1);
+ }
+
+ /* window attributes */
+ attr.background_pixel = 0;
+ attr.border_pixel = 0;
+ attr.colormap = XCreateColormap( x_dpy, root, visInfo->visual, AllocNone);
+ attr.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask;
+ mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
+
+ win = XCreateWindow( x_dpy, root, 0, 0, width, height,
+ 0, visInfo->depth, InputOutput,
+ visInfo->visual, mask, &attr );
+
+ /* set hints and properties */
+ {
+ XSizeHints sizehints;
+ sizehints.x = x;
+ sizehints.y = y;
+ sizehints.width = width;
+ sizehints.height = height;
+ sizehints.flags = USSize | USPosition;
+ XSetNormalHints(x_dpy, win, &sizehints);
+ XSetStandardProperties(x_dpy, win, name, name,
+ None, (char **)NULL, 0, &sizehints);
+ }
+
+#if USE_FULL_GL
+ eglBindAPI(EGL_OPENGL_API);
+#else
+ eglBindAPI(EGL_OPENGL_ES_API);
+#endif
+
+ ctx = eglCreateContext(egl_dpy, config, EGL_NO_CONTEXT, NULL );
+ if (!ctx) {
+ printf("Error: eglCreateContext failed\n");
+ exit(1);
+ }
+
+ *surfRet = eglCreateWindowSurface(egl_dpy, config, win, NULL);
+
+ if (!*surfRet) {
+ printf("Error: eglCreateWindowSurface failed\n");
+ exit(1);
+ }
+
+ XFree(visInfo);
+
+ *winRet = win;
+ *ctxRet = ctx;
+}
+
+
+static void
+event_loop(Display *dpy, Window win,
+ EGLDisplay egl_dpy, EGLSurface egl_surf)
+{
+ while (1) {
+ int redraw = 0;
+ XEvent event;
+
+ XNextEvent(dpy, &event);
+
+ switch (event.type) {
+ case Expose:
+ redraw = 1;
+ break;
+ case ConfigureNotify:
+ reshape(event.xconfigure.width, event.xconfigure.height);
+ break;
+ case KeyPress:
+ {
+ char buffer[10];
+ int r, code;
+ code = XLookupKeysym(&event.xkey, 0);
+ if (code == XK_Left) {
+ view_roty += 5.0;
+ }
+ else if (code == XK_Right) {
+ view_roty -= 5.0;
+ }
+ else if (code == XK_Up) {
+ view_rotx += 5.0;
+ }
+ else if (code == XK_Down) {
+ view_rotx -= 5.0;
+ }
+ else {
+ r = XLookupString(&event.xkey, buffer, sizeof(buffer),
+ NULL, NULL);
+ if (buffer[0] == 27) {
+ /* escape */
+ return;
+ }
+ }
+ }
+ redraw = 1;
+ break;
+ default:
+ ; /*no-op*/
+ }
+
+ if (redraw) {
+ draw();
+ eglSwapBuffers(egl_dpy, egl_surf);
+ }
+ }
+}
+
+
+static void
+usage(void)
+{
+ printf("Usage:\n");
+ printf(" -display <displayname> set the display to run on\n");
+ printf(" -info display OpenGL renderer info\n");
+}
+
+
+int
+main(int argc, char *argv[])
+{
+ const int winWidth = 300, winHeight = 300;
+ Display *x_dpy;
+ Window win;
+ EGLSurface egl_surf;
+ EGLContext egl_ctx;
+ EGLDisplay egl_dpy;
+ char *dpyName = NULL;
+ GLboolean printInfo = GL_FALSE;
+ EGLint egl_major, egl_minor;
+ int i;
+ const char *s;
+
+ static struct {
+ char *name;
+ GLenum value;
+ enum {GetString, GetInteger} type;
+ } info_items[] = {
+ {"GL_RENDERER", GL_RENDERER, GetString},
+ {"GL_VERSION", GL_VERSION, GetString},
+ {"GL_VENDOR", GL_VENDOR, GetString},
+ {"GL_EXTENSIONS", GL_EXTENSIONS, GetString},
+ {"GL_MAX_PALETTE_MATRICES_OES", GL_MAX_PALETTE_MATRICES_OES, GetInteger},
+ {"GL_MAX_VERTEX_UNITS_OES", GL_MAX_VERTEX_UNITS_OES, GetInteger},
+ };
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-display") == 0) {
+ dpyName = argv[i+1];
+ i++;
+ }
+ else if (strcmp(argv[i], "-info") == 0) {
+ printInfo = GL_TRUE;
+ }
+ else {
+ usage();
+ return -1;
+ }
+ }
+
+ x_dpy = XOpenDisplay(dpyName);
+ if (!x_dpy) {
+ printf("Error: couldn't open display %s\n",
+ dpyName ? dpyName : getenv("DISPLAY"));
+ return -1;
+ }
+
+ egl_dpy = eglGetDisplay(x_dpy);
+ if (!egl_dpy) {
+ printf("Error: eglGetDisplay() failed\n");
+ return -1;
+ }
+
+ if (!eglInitialize(egl_dpy, &egl_major, &egl_minor)) {
+ printf("Error: eglInitialize() failed\n");
+ return -1;
+ }
+
+ s = eglQueryString(egl_dpy, EGL_VERSION);
+ printf("EGL_VERSION = %s\n", s);
+
+ s = eglQueryString(egl_dpy, EGL_VENDOR);
+ printf("EGL_VENDOR = %s\n", s);
+
+ s = eglQueryString(egl_dpy, EGL_EXTENSIONS);
+ printf("EGL_EXTENSIONS = %s\n", s);
+
+ s = eglQueryString(egl_dpy, EGL_CLIENT_APIS);
+ printf("EGL_CLIENT_APIS = %s\n", s);
+
+ make_x_window(x_dpy, egl_dpy,
+ "OpenGL ES 1.x tri", 0, 0, winWidth, winHeight,
+ &win, &egl_ctx, &egl_surf);
+
+ XMapWindow(x_dpy, win);
+ if (!eglMakeCurrent(egl_dpy, egl_surf, egl_surf, egl_ctx)) {
+ printf("Error: eglMakeCurrent() failed\n");
+ return -1;
+ }
+
+ if (printInfo) {
+ for (i = 0; i < sizeof(info_items)/sizeof(info_items[0]); i++) {
+ switch (info_items[i].type) {
+ case GetString:
+ printf("%s = %s\n", info_items[i].name, (char *)glGetString(info_items[i].value));
+ break;
+ case GetInteger: {
+ GLint rv = -1;
+ glGetIntegerv(info_items[i].value, &rv);
+ printf("%s = %d\n", info_items[i].name, rv);
+ break;
+ }
+ }
+ }
+ };
+ init();
+
+ /* Set initial projection/viewing transformation.
+ * We can't be sure we'll get a ConfigureNotify event when the window
+ * first appears.
+ */
+ reshape(winWidth, winHeight);
+
+ event_loop(x_dpy, win, egl_dpy, egl_surf);
+
+ eglDestroyContext(egl_dpy, egl_ctx);
+ eglDestroySurface(egl_dpy, egl_surf);
+ eglTerminate(egl_dpy);
+
+
+ XDestroyWindow(x_dpy, win);
+ XCloseDisplay(x_dpy);
+
+ return 0;
+}
diff --git a/progs/es1/xegl/two_win.c b/progs/es1/xegl/two_win.c
new file mode 100644
index 0000000000..4785e5304d
--- /dev/null
+++ b/progs/es1/xegl/two_win.c
@@ -0,0 +1,433 @@
+/*
+ * Copyright (C) 2008 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.
+ */
+
+/*
+ * Test drawing to two windows.
+ * Brian Paul
+ * August 2008
+ */
+
+
+#include <assert.h>
+#include <math.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <X11/keysym.h>
+#include <GLES/gl.h>
+#include <GLES/glext.h>
+#include <EGL/egl.h>
+
+
+static int WinWidth[2] = {150, 300}, WinHeight[2] = {150, 300};
+
+
+static GLfloat view_rotx = 0.0, view_roty = 0.0, view_rotz = 0.0;
+
+
+/* new window size or exposure */
+static void
+reshape(int width, int height)
+{
+ GLfloat ar = (GLfloat) width / (GLfloat) height;
+
+ glViewport(0, 0, (GLint) width, (GLint) height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+#ifdef GL_VERSION_ES_CM_1_0
+ glFrustumf(-ar, ar, -1, 1, 5.0, 60.0);
+#else
+ glFrustum(-ar, ar, -1, 1, 5.0, 60.0);
+#endif
+
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+ glTranslatef(0.0, 0.0, -10.0);
+}
+
+
+static void
+draw(int win)
+{
+ static const GLfloat verts[3][2] = {
+ { -1, -1 },
+ { 1, -1 },
+ { 0, 1 }
+ };
+ static const GLfloat colors[3][4] = {
+ { 1, 0, 0, 1 },
+ { 0, 1, 0, 1 },
+ { 0, 0, 1, 1 }
+ };
+
+ assert(win == 0 || win == 1);
+
+ reshape(WinWidth[win], WinHeight[win]);
+
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ glPushMatrix();
+ glRotatef(view_rotx, 1, 0, 0);
+ glRotatef(view_roty, 0, 1, 0);
+ glRotatef(view_rotz, 0, 0, 1);
+
+ /* draw triangle */
+ {
+ glVertexPointer(2, GL_FLOAT, 0, verts);
+ glColorPointer(4, GL_FLOAT, 0, colors);
+
+ glEnableClientState(GL_VERTEX_ARRAY);
+ glEnableClientState(GL_COLOR_ARRAY);
+
+ glDrawArrays(GL_TRIANGLES, 0, 3);
+
+ glDisableClientState(GL_VERTEX_ARRAY);
+ glDisableClientState(GL_COLOR_ARRAY);
+ }
+
+ glPopMatrix();
+}
+
+
+static void
+init(void)
+{
+ glClearColor(0.4, 0.4, 0.4, 0.0);
+}
+
+
+/*
+ * Create an RGB, double-buffered X window.
+ * Return the window and context handles.
+ */
+static void
+make_x_window(Display *x_dpy, EGLDisplay egl_dpy,
+ const char *name,
+ int x, int y, int width, int height,
+ Window *winRet,
+ EGLContext *ctxRet,
+ EGLSurface *surfRet)
+{
+ static const EGLint attribs[] = {
+ EGL_RED_SIZE, 1,
+ EGL_GREEN_SIZE, 1,
+ EGL_BLUE_SIZE, 1,
+ EGL_DEPTH_SIZE, 1,
+ EGL_NONE
+ };
+
+ int scrnum;
+ XSetWindowAttributes attr;
+ unsigned long mask;
+ Window root;
+ Window win;
+ XVisualInfo *visInfo, visTemplate;
+ int num_visuals;
+ EGLContext ctx;
+ EGLConfig config;
+ EGLint num_configs;
+ EGLint vid;
+
+ scrnum = DefaultScreen( x_dpy );
+ root = RootWindow( x_dpy, scrnum );
+
+ if (!eglChooseConfig( egl_dpy, attribs, &config, 1, &num_configs)) {
+ printf("Error: couldn't get an EGL visual config\n");
+ exit(1);
+ }
+
+ assert(config);
+ assert(num_configs > 0);
+
+ if (!eglGetConfigAttrib(egl_dpy, config, EGL_NATIVE_VISUAL_ID, &vid)) {
+ printf("Error: eglGetConfigAttrib() failed\n");
+ exit(1);
+ }
+
+ /* The X window visual must match the EGL config */
+ visTemplate.visualid = vid;
+ visInfo = XGetVisualInfo(x_dpy, VisualIDMask, &visTemplate, &num_visuals);
+ if (!visInfo) {
+ printf("Error: couldn't get X visual\n");
+ exit(1);
+ }
+
+ /* window attributes */
+ attr.background_pixel = 0;
+ attr.border_pixel = 0;
+ attr.colormap = XCreateColormap( x_dpy, root, visInfo->visual, AllocNone);
+ attr.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask;
+ mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
+
+ win = XCreateWindow( x_dpy, root, x, y, width, height,
+ 0, visInfo->depth, InputOutput,
+ visInfo->visual, mask, &attr );
+
+ /* set hints and properties */
+ {
+ XSizeHints sizehints;
+ sizehints.x = x;
+ sizehints.y = y;
+ sizehints.width = width;
+ sizehints.height = height;
+ sizehints.flags = USSize | USPosition;
+ XSetNormalHints(x_dpy, win, &sizehints);
+ XSetStandardProperties(x_dpy, win, name, name,
+ None, (char **)NULL, 0, &sizehints);
+ }
+
+#if USE_FULL_GL
+ eglBindAPI(EGL_OPENGL_API);
+#else
+ eglBindAPI(EGL_OPENGL_ES_API);
+#endif
+
+ if (ctxRet) {
+ ctx = eglCreateContext(egl_dpy, config, EGL_NO_CONTEXT, NULL );
+ if (!ctx) {
+ printf("Error: eglCreateContext failed\n");
+ exit(1);
+ }
+ *ctxRet = ctx;
+ }
+
+ *surfRet = eglCreateWindowSurface(egl_dpy, config, win, NULL);
+
+ if (!*surfRet) {
+ printf("Error: eglCreateWindowSurface failed\n");
+ exit(1);
+ }
+
+ XFree(visInfo);
+
+ *winRet = win;
+}
+
+
+static void
+event_loop(Display *dpy, Window win1, Window win2,
+ EGLDisplay egl_dpy, EGLSurface egl_surf1, EGLSurface egl_surf2,
+ EGLContext egl_ctx)
+{
+ while (1) {
+ int redraw = 0;
+ int win;
+ XEvent event;
+
+ XNextEvent(dpy, &event);
+
+ switch (event.type) {
+ case Expose:
+ redraw = 1;
+ break;
+ case ConfigureNotify:
+ if (event.xconfigure.window == win1)
+ win = 0;
+ else
+ win = 1;
+ WinWidth[win] = event.xconfigure.width;
+ WinHeight[win] = event.xconfigure.height;
+ break;
+ case KeyPress:
+ {
+ char buffer[10];
+ int r, code;
+ code = XLookupKeysym(&event.xkey, 0);
+ if (code == XK_Left) {
+ view_roty += 5.0;
+ }
+ else if (code == XK_Right) {
+ view_roty -= 5.0;
+ }
+ else if (code == XK_Up) {
+ view_rotx += 5.0;
+ }
+ else if (code == XK_Down) {
+ view_rotx -= 5.0;
+ }
+ else {
+ r = XLookupString(&event.xkey, buffer, sizeof(buffer),
+ NULL, NULL);
+ if (buffer[0] == 27) {
+ /* escape */
+ return;
+ }
+ }
+ }
+ redraw = 1;
+ break;
+ default:
+ ; /*no-op*/
+ }
+
+ if (redraw) {
+ /* win 1 */
+ if (!eglMakeCurrent(egl_dpy, egl_surf1, egl_surf1, egl_ctx)) {
+ printf("Error: eglMakeCurrent(1) failed\n");
+ return;
+ }
+ draw(0);
+ eglSwapBuffers(egl_dpy, egl_surf1);
+
+ /* win 2 */
+ if (!eglMakeCurrent(egl_dpy, egl_surf2, egl_surf2, egl_ctx)) {
+ printf("Error: eglMakeCurrent(2) failed\n");
+ return;
+ }
+ draw(1);
+ eglSwapBuffers(egl_dpy, egl_surf2);
+ }
+ }
+}
+
+
+static void
+usage(void)
+{
+ printf("Usage:\n");
+ printf(" -display <displayname> set the display to run on\n");
+ printf(" -info display OpenGL renderer info\n");
+}
+
+
+int
+main(int argc, char *argv[])
+{
+ Display *x_dpy;
+ Window win1, win2;
+ EGLSurface egl_surf1, egl_surf2;
+ EGLContext egl_ctx;
+ EGLDisplay egl_dpy;
+ char *dpyName = NULL;
+ GLboolean printInfo = GL_FALSE;
+ EGLint egl_major, egl_minor;
+ int i;
+ const char *s;
+
+ static struct {
+ char *name;
+ GLenum value;
+ enum {GetString, GetInteger} type;
+ } info_items[] = {
+ {"GL_RENDERER", GL_RENDERER, GetString},
+ {"GL_VERSION", GL_VERSION, GetString},
+ {"GL_VENDOR", GL_VENDOR, GetString},
+ {"GL_EXTENSIONS", GL_EXTENSIONS, GetString},
+ {"GL_MAX_PALETTE_MATRICES_OES", GL_MAX_PALETTE_MATRICES_OES, GetInteger},
+ {"GL_MAX_VERTEX_UNITS_OES", GL_MAX_VERTEX_UNITS_OES, GetInteger},
+ };
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-display") == 0) {
+ dpyName = argv[i+1];
+ i++;
+ }
+ else if (strcmp(argv[i], "-info") == 0) {
+ printInfo = GL_TRUE;
+ }
+ else {
+ usage();
+ return -1;
+ }
+ }
+
+ x_dpy = XOpenDisplay(dpyName);
+ if (!x_dpy) {
+ printf("Error: couldn't open display %s\n",
+ dpyName ? dpyName : getenv("DISPLAY"));
+ return -1;
+ }
+
+ egl_dpy = eglGetDisplay(x_dpy);
+ if (!egl_dpy) {
+ printf("Error: eglGetDisplay() failed\n");
+ return -1;
+ }
+
+ if (!eglInitialize(egl_dpy, &egl_major, &egl_minor)) {
+ printf("Error: eglInitialize() failed\n");
+ return -1;
+ }
+
+ s = eglQueryString(egl_dpy, EGL_VERSION);
+ printf("EGL_VERSION = %s\n", s);
+
+ s = eglQueryString(egl_dpy, EGL_VENDOR);
+ printf("EGL_VENDOR = %s\n", s);
+
+ s = eglQueryString(egl_dpy, EGL_EXTENSIONS);
+ printf("EGL_EXTENSIONS = %s\n", s);
+
+ s = eglQueryString(egl_dpy, EGL_CLIENT_APIS);
+ printf("EGL_CLIENT_APIS = %s\n", s);
+
+ make_x_window(x_dpy, egl_dpy,
+ "xegl_two_win #1", 0, 0, WinWidth[0], WinHeight[0],
+ &win1, &egl_ctx, &egl_surf1);
+
+ make_x_window(x_dpy, egl_dpy,
+ "xegl_two_win #2", WinWidth[0] + 50, 0,
+ WinWidth[1], WinHeight[1],
+ &win2, NULL, &egl_surf2);
+
+ XMapWindow(x_dpy, win1);
+
+ XMapWindow(x_dpy, win2);
+
+ if (!eglMakeCurrent(egl_dpy, egl_surf1, egl_surf1, egl_ctx)) {
+ printf("Error: eglMakeCurrent() failed\n");
+ return -1;
+ }
+
+ if (printInfo) {
+ for (i = 0; i < sizeof(info_items)/sizeof(info_items[0]); i++) {
+ switch (info_items[i].type) {
+ case GetString:
+ printf("%s = %s\n", info_items[i].name, (char *)glGetString(info_items[i].value));
+ break;
+ case GetInteger: {
+ GLint rv = -1;
+ glGetIntegerv(info_items[i].value, &rv);
+ printf("%s = %d\n", info_items[i].name, rv);
+ break;
+ }
+ }
+ }
+ };
+
+ init();
+
+ event_loop(x_dpy, win1, win2, egl_dpy, egl_surf1, egl_surf2, egl_ctx);
+
+ eglDestroyContext(egl_dpy, egl_ctx);
+ eglDestroySurface(egl_dpy, egl_surf1);
+ eglDestroySurface(egl_dpy, egl_surf2);
+ eglTerminate(egl_dpy);
+
+ XDestroyWindow(x_dpy, win1);
+ XDestroyWindow(x_dpy, win2);
+ XCloseDisplay(x_dpy);
+
+ return 0;
+}
diff --git a/progs/es2/.gitignore b/progs/es2/.gitignore
new file mode 100644
index 0000000000..7d5c16936c
--- /dev/null
+++ b/progs/es2/.gitignore
@@ -0,0 +1,3 @@
+xegl/es2_info.c
+xegl/es2_info
+xegl/tri
diff --git a/progs/es2/xegl/Makefile b/progs/es2/xegl/Makefile
new file mode 100644
index 0000000000..88bb0127f8
--- /dev/null
+++ b/progs/es2/xegl/Makefile
@@ -0,0 +1,51 @@
+# progs/es2/xegl/Makefile
+
+TOP = ../../..
+include $(TOP)/configs/current
+
+
+INCLUDE_DIRS = \
+ -I$(TOP)/include \
+
+HEADERS = $(TOP)/include/GLES/egl.h
+
+
+ES2_LIB_DEPS = \
+ $(TOP)/$(LIB_DIR)/libEGL.so \
+ $(TOP)/$(LIB_DIR)/libGLESv2.so
+
+
+ES2_LIBS = \
+ -L$(TOP)/$(LIB_DIR) -lEGL \
+ -L$(TOP)/$(LIB_DIR) -lGLESv2 $(LIBDRM_LIB) -lX11
+
+PROGRAMS = \
+ es2_info \
+ tri
+
+
+.c.o:
+ $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
+
+
+
+default: $(PROGRAMS)
+
+
+
+es2_info.c:
+ cp ../../es1/xegl/es1_info.c es2_info.c
+
+es2_info: es2_info.o $(ES2_LIB_DEPS)
+ $(CC) $(CFLAGS) es2_info.o $(ES2_LIBS) -o $@
+
+tri: tri.o $(ES2_LIB_DEPS)
+ $(CC) $(CFLAGS) tri.o $(ES2_LIBS) -o $@
+
+
+
+clean:
+ rm -f *.o *~
+ rm -f $(PROGRAMS)
+ rm -f es2_info.c
+
diff --git a/progs/es2/xegl/tri.c b/progs/es2/xegl/tri.c
new file mode 100644
index 0000000000..eb52b10620
--- /dev/null
+++ b/progs/es2/xegl/tri.c
@@ -0,0 +1,514 @@
+/**************************************************************************
+ *
+ * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ **************************************************************************/
+
+/*
+ * Draw a triangle with X/EGL and OpenGL ES 2.x
+ */
+
+#define USE_FULL_GL 0
+
+
+
+#include <assert.h>
+#include <math.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <X11/keysym.h>
+#if USE_FULL_GL
+#include <GL/gl.h> /* use full OpenGL */
+#else
+#include <GLES2/gl2.h> /* use OpenGL ES 2.x */
+#endif
+#include <EGL/egl.h>
+
+
+#define FLOAT_TO_FIXED(X) ((X) * 65535.0)
+
+
+
+static GLfloat view_rotx = 0.0, view_roty = 0.0;
+
+static GLint u_matrix = -1;
+static GLint attr_pos = 0, attr_color = 1;
+
+
+static void
+make_z_rot_matrix(GLfloat angle, GLfloat *m)
+{
+ float c = cos(angle * M_PI / 180.0);
+ float s = sin(angle * M_PI / 180.0);
+ int i;
+ for (i = 0; i < 16; i++)
+ m[i] = 0.0;
+ m[0] = m[5] = m[10] = m[15] = 1.0;
+
+ m[0] = c;
+ m[1] = s;
+ m[4] = -s;
+ m[5] = c;
+}
+
+static void
+make_scale_matrix(GLfloat xs, GLfloat ys, GLfloat zs, GLfloat *m)
+{
+ int i;
+ for (i = 0; i < 16; i++)
+ m[i] = 0.0;
+ m[0] = xs;
+ m[5] = ys;
+ m[10] = zs;
+ m[15] = 1.0;
+}
+
+
+static void
+mul_matrix(GLfloat *prod, const GLfloat *a, const GLfloat *b)
+{
+#define A(row,col) a[(col<<2)+row]
+#define B(row,col) b[(col<<2)+row]
+#define P(row,col) p[(col<<2)+row]
+ GLfloat p[16];
+ GLint i;
+ for (i = 0; i < 4; i++) {
+ const GLfloat ai0=A(i,0), ai1=A(i,1), ai2=A(i,2), ai3=A(i,3);
+ P(i,0) = ai0 * B(0,0) + ai1 * B(1,0) + ai2 * B(2,0) + ai3 * B(3,0);
+ P(i,1) = ai0 * B(0,1) + ai1 * B(1,1) + ai2 * B(2,1) + ai3 * B(3,1);
+ P(i,2) = ai0 * B(0,2) + ai1 * B(1,2) + ai2 * B(2,2) + ai3 * B(3,2);
+ P(i,3) = ai0 * B(0,3) + ai1 * B(1,3) + ai2 * B(2,3) + ai3 * B(3,3);
+ }
+ memcpy(prod, p, sizeof(p));
+#undef A
+#undef B
+#undef PROD
+}
+
+
+static void
+draw(void)
+{
+ static const GLfloat verts[3][2] = {
+ { -1, -1 },
+ { 1, -1 },
+ { 0, 1 }
+ };
+ static const GLfloat colors[3][3] = {
+ { 1, 0, 0 },
+ { 0, 1, 0 },
+ { 0, 0, 1 }
+ };
+ GLfloat mat[16], rot[16], scale[16];
+
+ /* Set modelview/projection matrix */
+ make_z_rot_matrix(view_rotx, rot);
+ make_scale_matrix(0.5, 0.5, 0.5, scale);
+ mul_matrix(mat, rot, scale);
+ glUniformMatrix4fv(u_matrix, 1, GL_FALSE, mat);
+
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ {
+ glVertexAttribPointer(attr_pos, 2, GL_FLOAT, GL_FALSE, 0, verts);
+ glVertexAttribPointer(attr_color, 3, GL_FLOAT, GL_FALSE, 0, colors);
+ glEnableVertexAttribArray(attr_pos);
+ glEnableVertexAttribArray(attr_color);
+
+ glDrawArrays(GL_TRIANGLES, 0, 3);
+
+ glDisableVertexAttribArray(attr_pos);
+ glDisableVertexAttribArray(attr_color);
+ }
+}
+
+
+/* new window size or exposure */
+static void
+reshape(int width, int height)
+{
+ glViewport(0, 0, (GLint) width, (GLint) height);
+}
+
+
+static void
+create_shaders(void)
+{
+ static const char *fragShaderText =
+ "varying vec4 v_color;\n"
+ "void main() {\n"
+ " gl_FragColor = v_color;\n"
+ "}\n";
+ static const char *vertShaderText =
+ "uniform mat4 modelviewProjection;\n"
+ "attribute vec4 pos;\n"
+ "attribute vec4 color;\n"
+ "varying vec4 v_color;\n"
+ "void main() {\n"
+ " gl_Position = modelviewProjection * pos;\n"
+ " v_color = color;\n"
+ "}\n";
+
+ GLuint fragShader, vertShader, program;
+ GLint stat;
+
+ fragShader = glCreateShader(GL_FRAGMENT_SHADER);
+ glShaderSource(fragShader, 1, (const char **) &fragShaderText, NULL);
+ glCompileShader(fragShader);
+ glGetShaderiv(fragShader, GL_COMPILE_STATUS, &stat);
+ if (!stat) {
+ printf("Error: fragment shader did not compile!\n");
+ exit(1);
+ }
+
+ vertShader = glCreateShader(GL_VERTEX_SHADER);
+ glShaderSource(vertShader, 1, (const char **) &vertShaderText, NULL);
+ glCompileShader(vertShader);
+ glGetShaderiv(vertShader, GL_COMPILE_STATUS, &stat);
+ if (!stat) {
+ printf("Error: vertex shader did not compile!\n");
+ exit(1);
+ }
+
+ program = glCreateProgram();
+ glAttachShader(program, fragShader);
+ glAttachShader(program, vertShader);
+ glLinkProgram(program);
+
+ glGetProgramiv(program, GL_LINK_STATUS, &stat);
+ if (!stat) {
+ char log[1000];
+ GLsizei len;
+ glGetProgramInfoLog(program, 1000, &len, log);
+ printf("Error: linking:\n%s\n", log);
+ exit(1);
+ }
+
+ glUseProgram(program);
+
+ if (1) {
+ /* test setting attrib locations */
+ glBindAttribLocation(program, attr_pos, "pos");
+ glBindAttribLocation(program, attr_color, "color");
+ glLinkProgram(program); /* needed to put attribs into effect */
+ }
+ else {
+ /* test automatic attrib locations */
+ attr_pos = glGetAttribLocation(program, "pos");
+ attr_color = glGetAttribLocation(program, "color");
+ }
+
+ u_matrix = glGetUniformLocation(program, "modelviewProjection");
+ printf("Uniform modelviewProjection at %d\n", u_matrix);
+ printf("Attrib pos at %d\n", attr_pos);
+ printf("Attrib color at %d\n", attr_color);
+}
+
+
+static void
+init(void)
+{
+ typedef void (*proc)();
+
+#if 1 /* test code */
+ proc p = eglGetProcAddress("glMapBufferOES");
+ assert(p);
+#endif
+
+ glClearColor(0.4, 0.4, 0.4, 0.0);
+
+ create_shaders();
+}
+
+
+/*
+ * Create an RGB, double-buffered X window.
+ * Return the window and context handles.
+ */
+static void
+make_x_window(Display *x_dpy, EGLDisplay egl_dpy,
+ const char *name,
+ int x, int y, int width, int height,
+ Window *winRet,
+ EGLContext *ctxRet,
+ EGLSurface *surfRet)
+{
+ static const EGLint attribs[] = {
+ EGL_RED_SIZE, 1,
+ EGL_GREEN_SIZE, 1,
+ EGL_BLUE_SIZE, 1,
+ EGL_DEPTH_SIZE, 1,
+ EGL_NONE
+ };
+ static const EGLint ctx_attribs[] = {
+ EGL_CONTEXT_CLIENT_VERSION, 2,
+ EGL_NONE
+ };
+ int scrnum;
+ XSetWindowAttributes attr;
+ unsigned long mask;
+ Window root;
+ Window win;
+ XVisualInfo *visInfo, visTemplate;
+ int num_visuals;
+ EGLContext ctx;
+ EGLConfig config;
+ EGLint num_configs;
+ EGLint vid;
+
+ scrnum = DefaultScreen( x_dpy );
+ root = RootWindow( x_dpy, scrnum );
+
+ if (!eglChooseConfig( egl_dpy, attribs, &config, 1, &num_configs)) {
+ printf("Error: couldn't get an EGL visual config\n");
+ exit(1);
+ }
+
+ assert(config);
+ assert(num_configs > 0);
+
+ if (!eglGetConfigAttrib(egl_dpy, config, EGL_NATIVE_VISUAL_ID, &vid)) {
+ printf("Error: eglGetConfigAttrib() failed\n");
+ exit(1);
+ }
+
+ /* The X window visual must match the EGL config */
+ visTemplate.visualid = vid;
+ visInfo = XGetVisualInfo(x_dpy, VisualIDMask, &visTemplate, &num_visuals);
+ if (!visInfo) {
+ printf("Error: couldn't get X visual\n");
+ exit(1);
+ }
+
+ /* window attributes */
+ attr.background_pixel = 0;
+ attr.border_pixel = 0;
+ attr.colormap = XCreateColormap( x_dpy, root, visInfo->visual, AllocNone);
+ attr.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask;
+ mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
+
+ win = XCreateWindow( x_dpy, root, 0, 0, width, height,
+ 0, visInfo->depth, InputOutput,
+ visInfo->visual, mask, &attr );
+
+ /* set hints and properties */
+ {
+ XSizeHints sizehints;
+ sizehints.x = x;
+ sizehints.y = y;
+ sizehints.width = width;
+ sizehints.height = height;
+ sizehints.flags = USSize | USPosition;
+ XSetNormalHints(x_dpy, win, &sizehints);
+ XSetStandardProperties(x_dpy, win, name, name,
+ None, (char **)NULL, 0, &sizehints);
+ }
+
+#if USE_FULL_GL /* XXX fix this when eglBindAPI() works */
+ eglBindAPI(EGL_OPENGL_API);
+#else
+ eglBindAPI(EGL_OPENGL_ES_API);
+#endif
+
+ ctx = eglCreateContext(egl_dpy, config, EGL_NO_CONTEXT, ctx_attribs );
+ if (!ctx) {
+ printf("Error: eglCreateContext failed\n");
+ exit(1);
+ }
+
+ /* test eglQueryContext() */
+ {
+ EGLint val;
+ eglQueryContext(egl_dpy, ctx, EGL_CONTEXT_CLIENT_VERSION, &val);
+ assert(val == 2);
+ }
+
+ *surfRet = eglCreateWindowSurface(egl_dpy, config, win, NULL);
+ if (!*surfRet) {
+ printf("Error: eglCreateWindowSurface failed\n");
+ exit(1);
+ }
+
+ {
+ EGLint val;
+ eglQuerySurface(egl_dpy, *surfRet, EGL_WIDTH, &val);
+ assert(val == width);
+ eglQuerySurface(egl_dpy, *surfRet, EGL_HEIGHT, &val);
+ assert(val == height);
+ eglQuerySurface(egl_dpy, *surfRet, EGL_SURFACE_TYPE, &val);
+ assert(val == EGL_WINDOW_BIT);
+ }
+
+ XFree(visInfo);
+
+ *winRet = win;
+ *ctxRet = ctx;
+}
+
+
+static void
+event_loop(Display *dpy, Window win,
+ EGLDisplay egl_dpy, EGLSurface egl_surf)
+{
+ while (1) {
+ int redraw = 0;
+ XEvent event;
+
+ XNextEvent(dpy, &event);
+
+ switch (event.type) {
+ case Expose:
+ redraw = 1;
+ break;
+ case ConfigureNotify:
+ reshape(event.xconfigure.width, event.xconfigure.height);
+ break;
+ case KeyPress:
+ {
+ char buffer[10];
+ int r, code;
+ code = XLookupKeysym(&event.xkey, 0);
+ if (code == XK_Left) {
+ view_roty += 5.0;
+ }
+ else if (code == XK_Right) {
+ view_roty -= 5.0;
+ }
+ else if (code == XK_Up) {
+ view_rotx += 5.0;
+ }
+ else if (code == XK_Down) {
+ view_rotx -= 5.0;
+ }
+ else {
+ r = XLookupString(&event.xkey, buffer, sizeof(buffer),
+ NULL, NULL);
+ if (buffer[0] == 27) {
+ /* escape */
+ return;
+ }
+ }
+ }
+ redraw = 1;
+ break;
+ default:
+ ; /*no-op*/
+ }
+
+ if (redraw) {
+ draw();
+ eglSwapBuffers(egl_dpy, egl_surf);
+ }
+ }
+}
+
+
+static void
+usage(void)
+{
+ printf("Usage:\n");
+ printf(" -display <displayname> set the display to run on\n");
+ printf(" -info display OpenGL renderer info\n");
+}
+
+
+int
+main(int argc, char *argv[])
+{
+ const int winWidth = 300, winHeight = 300;
+ Display *x_dpy;
+ Window win;
+ EGLSurface egl_surf;
+ EGLContext egl_ctx;
+ EGLDisplay egl_dpy;
+ char *dpyName = NULL;
+ GLboolean printInfo = GL_FALSE;
+ EGLint egl_major, egl_minor;
+ int i;
+ const char *s;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-display") == 0) {
+ dpyName = argv[i+1];
+ i++;
+ }
+ else if (strcmp(argv[i], "-info") == 0) {
+ printInfo = GL_TRUE;
+ }
+ else {
+ usage();
+ return -1;
+ }
+ }
+
+ x_dpy = XOpenDisplay(dpyName);
+ if (!x_dpy) {
+ printf("Error: couldn't open display %s\n",
+ dpyName ? dpyName : getenv("DISPLAY"));
+ return -1;
+ }
+
+ egl_dpy = eglGetDisplay(x_dpy);
+ if (!egl_dpy) {
+ printf("Error: eglGetDisplay() failed\n");
+ return -1;
+ }
+
+ if (!eglInitialize(egl_dpy, &egl_major, &egl_minor)) {
+ printf("Error: eglInitialize() failed\n");
+ return -1;
+ }
+
+ s = eglQueryString(egl_dpy, EGL_VERSION);
+ printf("EGL_VERSION = %s\n", s);
+
+ s = eglQueryString(egl_dpy, EGL_VENDOR);
+ printf("EGL_VENDOR = %s\n", s);
+
+ s = eglQueryString(egl_dpy, EGL_EXTENSIONS);
+ printf("EGL_EXTENSIONS = %s\n", s);
+
+ s = eglQueryString(egl_dpy, EGL_CLIENT_APIS);
+ printf("EGL_CLIENT_APIS = %s\n", s);
+
+ make_x_window(x_dpy, egl_dpy,
+ "OpenGL ES 2.x tri", 0, 0, winWidth, winHeight,
+ &win, &egl_ctx, &egl_surf);
+
+ XMapWindow(x_dpy, win);
+ if (!eglMakeCurrent(egl_dpy, egl_surf, egl_surf, egl_ctx)) {
+ printf("Error: eglMakeCurrent() failed\n");
+ return -1;
+ }
+
+ if (printInfo) {
+ printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+ printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS));
+ }
+
+ init();
+
+ /* Set initial projection/viewing transformation.
+ * We can't be sure we'll get a ConfigureNotify event when the window
+ * first appears.
+ */
+ reshape(winWidth, winHeight);
+
+ event_loop(x_dpy, win, egl_dpy, egl_surf);
+
+ eglDestroyContext(egl_dpy, egl_ctx);
+ eglDestroySurface(egl_dpy, egl_surf);
+ eglTerminate(egl_dpy);
+
+
+ XDestroyWindow(x_dpy, win);
+ XCloseDisplay(x_dpy);
+
+ return 0;
+}
diff --git a/src/gallium/state_trackers/Makefile b/src/gallium/state_trackers/Makefile
index 265ca468c2..0900efc664 100644
--- a/src/gallium/state_trackers/Makefile
+++ b/src/gallium/state_trackers/Makefile
@@ -21,5 +21,9 @@ clean:
rm -f `find . -name depend`
-# Dummy install target
install:
+ @for dir in $(SUBDIRS) ; do \
+ if [ -d $$dir ] ; then \
+ (cd $$dir && $(MAKE) $@) || exit 1 ; \
+ fi \
+ done
diff --git a/src/gallium/state_trackers/egl/egl_tracker.c b/src/gallium/state_trackers/egl/egl_tracker.c
index 9345b0f490..11583ec41c 100644
--- a/src/gallium/state_trackers/egl/egl_tracker.c
+++ b/src/gallium/state_trackers/egl/egl_tracker.c
@@ -172,8 +172,6 @@ drm_initialize(_EGLDriver *drv, _EGLDisplay *disp, EGLint *major, EGLint *minor)
goto err_screen;
dev->winsys = dev->screen->winsys;
- driInitExtensions(NULL, NULL, GL_FALSE);
-
drm_update_res(dev);
res = dev->res;
if (res)
diff --git a/src/gallium/state_trackers/es/Makefile b/src/gallium/state_trackers/es/Makefile
new file mode 100644
index 0000000000..41d4ccb1a6
--- /dev/null
+++ b/src/gallium/state_trackers/es/Makefile
@@ -0,0 +1,88 @@
+# src/gallium/state_trackers/es/Makefile
+
+# Build the ES 1/2 state tracker libraries
+# This consists of core Mesa ES, plus GL/gallium state tracker.
+
+TOP = ../../../..
+include $(TOP)/configs/current
+
+GLES_1_VERSION_MAJOR = 1
+GLES_1_VERSION_MINOR = 1
+GLES_1_VERSION_PATCH = 0
+
+GLES_2_VERSION_MAJOR = 2
+GLES_2_VERSION_MINOR = 0
+GLES_2_VERSION_PATCH = 0
+
+
+# Maybe move these into configs/default:
+GLES_1_LIB = GLESv1_CM
+GLES_1_LIB_NAME = lib$(GLES_1_LIB).so
+GLES_2_LIB = GLESv2
+GLES_2_LIB_NAME = lib$(GLES_2_LIB).so
+
+
+ES1_OBJECTS = st_es1.o
+ES2_OBJECTS = st_es2.o
+
+
+# we only need the gallium libs that the state trackers directly use:
+GALLIUM_LIBS = \
+ $(TOP)/src/gallium/auxiliary/cso_cache/libcso_cache.a \
+ $(TOP)/src/gallium/auxiliary/rtasm/librtasm.a \
+ $(TOP)/src/gallium/auxiliary/tgsi/libtgsi.a \
+ $(TOP)/src/gallium/auxiliary/util/libutil.a
+
+ES1_LIBS = \
+ $(TOP)/src/mesa/es/libes1gallium.a \
+ $(TOP)/src/mesa/es/libes1api.a
+
+ES2_LIBS = \
+ $(TOP)/src/mesa/es/libes2gallium.a \
+ $(TOP)/src/mesa/es/libes2api.a
+
+SYS_LIBS = -lm -pthread
+
+
+.c.o:
+ $(CC) -c $(CFLAGS) $< -o $@
+
+
+# Default: make both GL ES 1.1 and GL ES 2.0 libraries
+default: $(TOP)/$(LIB_DIR)/$(GLES_1_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLES_2_LIB_NAME)
+
+# Make the shared libs
+$(TOP)/$(LIB_DIR)/$(GLES_1_LIB_NAME): $(ES1_OBJECTS) $(ES1_LIBS)
+ $(TOP)/bin/mklib -o $(GLES_1_LIB) \
+ -major $(GLES_1_VERSION_MAJOR) \
+ -minor $(GLES_1_VERSION_MINOR) \
+ -patch $(GLES_1_VERSION_PATCH) \
+ -install $(TOP)/$(LIB_DIR) \
+ $(ES1_OBJECTS) \
+ -Wl,--whole-archive $(ES1_LIBS) -Wl,--no-whole-archive \
+ -Wl,--start-group $(GALLIUM_LIBS) -Wl,--end-group \
+ $(SYS_LIBS)
+
+$(TOP)/$(LIB_DIR)/$(GLES_2_LIB_NAME): $(ES2_OBJECTS) $(ES1_LIBS)
+ $(TOP)/bin/mklib -o $(GLES_2_LIB) \
+ -major $(GLES_2_VERSION_MAJOR) \
+ -minor $(GLES_2_VERSION_MINOR) \
+ -patch $(GLES_2_VERSION_PATCH) \
+ -install $(TOP)/$(LIB_DIR) \
+ $(ES2_OBJECTS) \
+ -Wl,--whole-archive $(ES2_LIBS) -Wl,--no-whole-archive \
+ -Wl,--start-group $(GALLIUM_LIBS) -Wl,--end-group \
+ $(SYS_LIBS)
+
+install: default
+ $(INSTALL) -d $(INSTALL_DIR)/include/GLES
+ $(INSTALL) -m 644 $(TOP)/include/GLES/*.h $(INSTALL_DIR)/include/GLES
+ $(INSTALL) -d $(INSTALL_DIR)/include/GLES2
+ $(INSTALL) -m 644 $(TOP)/include/GLES2/*.h $(INSTALL_DIR)/include/GLES2
+ $(INSTALL) -d $(INSTALL_DIR)/$(LIB_DIR)
+ $(INSTALL) $(TOP)/$(LIB_DIR)/libGLESv1* $(INSTALL_DIR)/$(LIB_DIR)
+ $(INSTALL) $(TOP)/$(LIB_DIR)/libGLESv2* $(INSTALL_DIR)/$(LIB_DIR)
+
+clean:
+ -rm -f *.o *~
+ -rm -f $(TOP)/$(LIB_DIR)/$(GLES_1_LIB_NAME)* $(TOP)/$(LIB_DIR)/$(GLES_2_LIB_NAME)*
diff --git a/src/gallium/state_trackers/es/st_es1.c b/src/gallium/state_trackers/es/st_es1.c
new file mode 100644
index 0000000000..7f0c038957
--- /dev/null
+++ b/src/gallium/state_trackers/es/st_es1.c
@@ -0,0 +1 @@
+const int st_api_OpenGL_ES1 = 1;
diff --git a/src/gallium/state_trackers/es/st_es2.c b/src/gallium/state_trackers/es/st_es2.c
new file mode 100644
index 0000000000..78e3791fbe
--- /dev/null
+++ b/src/gallium/state_trackers/es/st_es2.c
@@ -0,0 +1 @@
+const int st_api_OpenGL_ES2 = 1;
diff --git a/src/gallium/winsys/drm/intel/egl/Makefile b/src/gallium/winsys/drm/intel/egl/Makefile
index 1397e9f729..c9c92b69b6 100644
--- a/src/gallium/winsys/drm/intel/egl/Makefile
+++ b/src/gallium/winsys/drm/intel/egl/Makefile
@@ -2,7 +2,7 @@ TOP = ../../../../../..
GALLIUMDIR = ../../../..
include $(TOP)/configs/current
-LIBNAME = EGL_i915.so
+LIBNAME = egl_i915.so
PIPE_DRIVERS = \
$(TOP)/src/gallium/state_trackers/egl/libegldrm.a \
@@ -11,19 +11,28 @@ PIPE_DRIVERS = \
$(TOP)/src/gallium/drivers/trace/libtrace.a \
$(TOP)/src/gallium/drivers/i915/libi915.a
-DRIVER_SOURCES =
+DRIVER_EXTRAS = -lm -lpthread -ldrm_intel
-C_SOURCES = \
- $(COMMON_GALLIUM_SOURCES) \
- $(DRIVER_SOURCES)
+OBJECTS = dummy.o
-DRIVER_EXTRAS = -ldrm_intel
+default: $(TOP)/$(LIB_DIR)/$(LIBNAME)
-ASM_SOURCES =
+$(TOP)/$(LIB_DIR)/$(LIBNAME): $(LIBNAME)
+ @mkdir -p $(TOP)/$(LIB_DIR)
+ $(INSTALL) $(LIBNAME) $(TOP)/$(LIB_DIR)
-DRIVER_DEFINES = -I../gem $(shell pkg-config libdrm --atleast-version=2.3.1 \
- && echo "-DDRM_VBLANK_FLIP=DRM_VBLANK_FLIP")
+$(LIBNAME): $(OBJECTS) $(GALLIUM_AUXILIARIES) $(PIPE_DRIVERS) Makefile
+ $(MKLIB) -noprefix -o $@ $(OBJECTS) \
+ -Wl,--whole-archive $(PIPE_DRIVERS) -Wl,--no-whole-archive \
+ -Wl,--start-group $(GALLIUM_AUXILIARIES) -Wl,--end-group \
+ $(DRI_LIB_DEPS) $(DRIVER_EXTRAS)
-include ../../Makefile.template
+clean:
+ -rm -f *.o *.so *~
+
+depend:
symlinks:
+
+install: $(LIBNAME)
+ $(MINSTALL) -m 755 $(LIBNAME) $(INSTALL_DIR)/$(LIB_DIR)
diff --git a/src/gallium/winsys/drm/intel/egl/dummy.c b/src/gallium/winsys/drm/intel/egl/dummy.c
new file mode 100644
index 0000000000..58c7af84e0
--- /dev/null
+++ b/src/gallium/winsys/drm/intel/egl/dummy.c
@@ -0,0 +1 @@
+/* mklib expects at least one .o is given */
diff --git a/src/gallium/winsys/drm/radeon/egl/Makefile b/src/gallium/winsys/drm/radeon/egl/Makefile
index 6a1448d1b9..2bd05a8175 100644
--- a/src/gallium/winsys/drm/radeon/egl/Makefile
+++ b/src/gallium/winsys/drm/radeon/egl/Makefile
@@ -2,7 +2,7 @@ TOP = ../../../../../..
GALLIUMDIR = ../../../..
include $(TOP)/configs/current
-LIBNAME = EGL_r300.so
+LIBNAME = egl_r300.so
PIPE_DRIVERS = \
$(TOP)/src/gallium/state_trackers/egl/libegldrm.a \
@@ -11,16 +11,28 @@ PIPE_DRIVERS = \
$(TOP)/src/gallium/drivers/trace/libtrace.a \
$(TOP)/src/gallium/drivers/r300/libr300.a
-DRIVER_SOURCES =
+DRIVER_EXTRAS = -lm -lpthread -ldrm_radeon
-C_SOURCES = \
- $(COMMON_GALLIUM_SOURCES) \
- $(DRIVER_SOURCES)
+OBJECTS = dummy.o
-DRIVER_EXTRAS = -ldrm_radeon
+default: $(TOP)/$(LIB_DIR)/$(LIBNAME)
-ASM_SOURCES =
+$(TOP)/$(LIB_DIR)/$(LIBNAME): $(LIBNAME)
+ @mkdir -p $(TOP)/$(LIB_DIR)
+ $(INSTALL) $(LIBNAME) $(TOP)/$(LIB_DIR)
-include ../../Makefile.template
+$(LIBNAME): $(OBJECTS) $(GALLIUM_AUXILIARIES) $(PIPE_DRIVERS) Makefile
+ $(MKLIB) -noprefix -o $@ $(OBJECTS) \
+ -Wl,--whole-archive $(PIPE_DRIVERS) -Wl,--no-whole-archive \
+ -Wl,--start-group $(GALLIUM_AUXILIARIES) -Wl,--end-group \
+ $(DRI_LIB_DEPS) $(DRIVER_EXTRAS)
+
+clean:
+ -rm -f *.o *.so *~
+
+depend:
symlinks:
+
+install: $(LIBNAME)
+ $(MINSTALL) -m 755 $(LIBNAME) $(INSTALL_DIR)/$(LIB_DIR)
diff --git a/src/gallium/winsys/drm/radeon/egl/dummy.c b/src/gallium/winsys/drm/radeon/egl/dummy.c
new file mode 100644
index 0000000000..58c7af84e0
--- /dev/null
+++ b/src/gallium/winsys/drm/radeon/egl/dummy.c
@@ -0,0 +1 @@
+/* mklib expects at least one .o is given */
diff --git a/src/gallium/winsys/egl_xlib/Makefile b/src/gallium/winsys/egl_xlib/Makefile
index 3efb7ed4af..06c1fb0b91 100644
--- a/src/gallium/winsys/egl_xlib/Makefile
+++ b/src/gallium/winsys/egl_xlib/Makefile
@@ -29,13 +29,7 @@ WINSYS_OBJECTS = $(WINSYS_SOURCES:.c=.o)
LIBS = \
$(GALLIUM_DRIVERS) \
$(GALLIUM_AUXILIARIES)
-
-# XXX temporary (should create a separate lib with the GL API funcs and
-# mesa code, as done for ES 1.x, 2.x, OpenVG, etc)
-UNUSED_LIBS = \
- $(TOP)/src/mesa/libglapi.a \
- $(TOP)/src/mesa/libmesagallium.a \
-
+LIB_DEPS = $(EGL_LIB_DEPS) -lm -lX11
LOCAL_CFLAGS =
@@ -60,14 +54,15 @@ $(TOP)/$(LIB_DIR)/$(DRIVER_NAME): $(WINSYS_OBJECTS) $(LIBS)
-noprefix \
-install $(TOP)/$(LIB_DIR) \
$(MKLIB_OPTIONS) $(WINSYS_OBJECTS) \
- -Wl,--whole-archive $(LIBS) -Wl,--no-whole-archive
+ -Wl,--whole-archive $(LIBS) -Wl,--no-whole-archive \
+ $(LIB_DEPS)
-depend: $(ALL_SOURCES)
+depend: $(WINSYS_SOURCES)
@ echo "running $(MKDEP)"
@ rm -f depend # workaround oops on gutsy?!?
@ touch depend
- @ $(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDE_DIRS) $(ALL_SOURCES) \
+ @ $(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDE_DIRS) $(WINSYS_SOURCES) \
> /dev/null 2>/dev/null
diff --git a/src/gallium/winsys/xlib/xlib.c b/src/gallium/winsys/xlib/xlib.c
index 13117712c2..541ea7ae35 100644
--- a/src/gallium/winsys/xlib/xlib.c
+++ b/src/gallium/winsys/xlib/xlib.c
@@ -105,3 +105,33 @@ extern void (*linker_foo(const unsigned char *procName))()
{
return glXGetProcAddress(procName);
}
+
+
+/**
+ * When GLX_INDIRECT_RENDERING is defined, some symbols are missing in
+ * libglapi.a. We need to define them here.
+ */
+#ifdef GLX_INDIRECT_RENDERING
+
+#define GL_GLEXT_PROTOTYPES
+#include "GL/gl.h"
+#include "glapi/glapi.h"
+#include "glapi/dispatch.h"
+
+#if defined(USE_MGL_NAMESPACE)
+#define NAME(func) mgl##func
+#else
+#define NAME(func) gl##func
+#endif
+
+#define DISPATCH(FUNC, ARGS, MESSAGE) \
+ CALL_ ## FUNC(GET_DISPATCH(), ARGS);
+
+#define RETURN_DISPATCH(FUNC, ARGS, MESSAGE) \
+ return CALL_ ## FUNC(GET_DISPATCH(), ARGS);
+
+/* skip normal ones */
+#define _GLAPI_SKIP_NORMAL_ENTRY_POINTS
+#include "glapi/glapitemp.h"
+
+#endif /* GLX_INDIRECT_RENDERING */
diff --git a/src/mesa/drivers/x11/glxapi.c b/src/mesa/drivers/x11/glxapi.c
index a17c2c3ffc..5c7e8eb90c 100644
--- a/src/mesa/drivers/x11/glxapi.c
+++ b/src/mesa/drivers/x11/glxapi.c
@@ -50,6 +50,36 @@ struct display_dispatch {
struct display_dispatch *Next;
};
+
+/**
+ * When GLX_INDIRECT_RENDERING is defined, some symbols are missing in
+ * libglapi.a. We need to define them here.
+ */
+#ifdef GLX_INDIRECT_RENDERING
+
+#include "glapi/dispatch.h"
+
+#define KEYWORD1 PUBLIC
+
+#if defined(USE_MGL_NAMESPACE)
+#define NAME(func) mgl##func
+#else
+#define NAME(func) gl##func
+#endif
+
+#define DISPATCH(FUNC, ARGS, MESSAGE) \
+ CALL_ ## FUNC(GET_DISPATCH(), ARGS);
+
+#define RETURN_DISPATCH(FUNC, ARGS, MESSAGE) \
+ return CALL_ ## FUNC(GET_DISPATCH(), ARGS);
+
+/* skip normal ones */
+#define _GLAPI_SKIP_NORMAL_ENTRY_POINTS
+#include "glapi/glapitemp.h"
+
+#endif /* GLX_INDIRECT_RENDERING */
+
+
static struct display_dispatch *DispatchList = NULL;
diff --git a/src/mesa/es/.gitignore b/src/mesa/es/.gitignore
new file mode 100644
index 0000000000..7643e9f0db
--- /dev/null
+++ b/src/mesa/es/.gitignore
@@ -0,0 +1,5 @@
+glapi/glapi-es*
+glapi/glapi-stamp
+main/get_es*.c
+main/api_exec_es*.c
+objs-es*
diff --git a/src/mesa/es/Makefile b/src/mesa/es/Makefile
new file mode 100644
index 0000000000..6a4756c1b5
--- /dev/null
+++ b/src/mesa/es/Makefile
@@ -0,0 +1,134 @@
+# src/mesa/es/Makefile
+#
+TOP := ../../..
+MESA := ..
+
+include $(TOP)/configs/current
+include sources.mak
+
+ES1_LIBS := libes1gallium.a libes1api.a
+ES2_LIBS := libes2gallium.a libes2api.a
+
+# Default rule: create ES1 and ES2 libs
+.PHONY: default
+default: subdirs depend es1 es2
+
+es1: $(ES1_LIBS)
+
+es2: $(ES2_LIBS)
+
+# force the inclusion of es's mfeatures.h
+ES1_CPPFLAGS := -include main/mfeatures_es1.h -D__GL_EXPORTS
+ES2_CPPFLAGS := -include main/mfeatures_es2.h -D__GL_EXPORTS
+
+ES1_OBJ_DIR := objs-es1
+ES2_OBJ_DIR := objs-es2
+
+# adjust output dirs
+ES1_OBJECTS := $(addprefix $(ES1_OBJ_DIR)/, $(ES1_OBJECTS))
+ES1_GALLIUM_OBJECTS := $(addprefix $(ES1_OBJ_DIR)/, $(ES1_GALLIUM_OBJECTS))
+ES1_API_OBJECTS := $(addprefix $(ES1_OBJ_DIR)/, $(ES1_API_OBJECTS))
+
+ES2_OBJECTS := $(addprefix $(ES2_OBJ_DIR)/, $(ES2_OBJECTS))
+ES2_GALLIUM_OBJECTS := $(addprefix $(ES2_OBJ_DIR)/, $(ES2_GALLIUM_OBJECTS))
+ES2_API_OBJECTS := $(addprefix $(ES2_OBJ_DIR)/, $(ES2_API_OBJECTS))
+
+# compile either ES1 or ES2 sources
+define es-compile
+ @mkdir -p $(dir $@)
+ $(CC) -c $(CFLAGS) $(ES$(1)_CPPFLAGS) $(ES$(1)_INCLUDES) -o $@ $<
+endef
+
+$(ES1_OBJ_DIR)/%.o: %.c
+ $(call es-compile,1)
+
+$(ES1_OBJ_DIR)/%.o: %.S
+ $(call es-compile,1)
+
+$(ES1_OBJ_DIR)/%.o: $(MESA)/%.c
+ $(call es-compile,1)
+
+$(ES1_OBJ_DIR)/%.o: $(MESA)/%.S
+ $(call es-compile,1)
+
+$(ES2_OBJ_DIR)/%.o: %.c
+ $(call es-compile,2)
+
+$(ES2_OBJ_DIR)/%.o: %.S
+ $(call es-compile,2)
+
+$(ES2_OBJ_DIR)/%.o: $(MESA)/%.c
+ $(call es-compile,2)
+
+$(ES2_OBJ_DIR)/%.o: $(MESA)/%.S
+ $(call es-compile,2)
+
+libes1.a: $(ES1_OBJECTS)
+ @$(TOP)/bin/mklib -o es1 -static $(ES1_OBJECTS)
+
+libes2.a: $(ES2_OBJECTS)
+ @$(TOP)/bin/mklib -o es2 -static $(ES1_OBJECTS)
+
+libes1gallium.a: $(ES1_GALLIUM_OBJECTS)
+ @$(TOP)/bin/mklib -o es1gallium -static $(ES1_GALLIUM_OBJECTS)
+
+libes2gallium.a: $(ES2_GALLIUM_OBJECTS)
+ @$(TOP)/bin/mklib -o es2gallium -static $(ES2_GALLIUM_OBJECTS)
+
+libes1api.a: $(ES1_API_OBJECTS)
+ @$(TOP)/bin/mklib -o es1api -static $(ES1_API_OBJECTS)
+
+libes2api.a: $(ES2_API_OBJECTS)
+ @$(TOP)/bin/mklib -o es2api -static $(ES2_API_OBJECTS)
+
+GENERATED_SOURCES := \
+ main/api_exec_es1.c \
+ main/api_exec_es2.c \
+ main/get_es1.c \
+ main/get_es2.c
+
+main/api_exec_es1.c: main/APIspec.xml main/es_generator.py main/APIspecutil.py main/APIspec.py
+ $(PYTHON2) $(PYTHON_FLAGS) main/es_generator.py -S main/APIspec.xml -V GLES1.1 > $@
+
+main/api_exec_es2.c: main/APIspec.xml main/es_generator.py main/APIspecutil.py main/APIspec.py
+ $(PYTHON2) $(PYTHON_FLAGS) main/es_generator.py -S main/APIspec.xml -V GLES2.0 > $@
+
+main/get_es1.c: main/get_gen.py
+ $(PYTHON2) $(PYTHON_FLAGS) $< 1 > $@
+
+main/get_es2.c: main/get_gen.py
+ $(PYTHON2) $(PYTHON_FLAGS) $< 2 > $@
+
+.PHONY: clean
+clean:
+ -rm -f $(ES1_LIBS) $(ES2_LIBS)
+ -rm -rf $(ES1_OBJ_DIR) $(ES2_OBJ_DIR)
+ -rm -f $(GENERATED_SOURCES)
+ -rm -f depend
+ -rm -f *~
+
+# nothing to install
+install:
+
+glapi/glapi-stamp:
+ $(MAKE) -C glapi
+
+subdirs: glapi/glapi-stamp
+ $(MAKE) -C $(MESA) asm_subdirs
+
+# remove generated sources because "depend" is checked even when "make clean"
+DEPEND_SOURCES := $(filter-out $(GENERATED_SOURCES), $(ES1_ALL_SOURCES) $(ES2_ALL_SOURCES))
+DEPEND_SOURCES := $(filter-out glapi/%, $(DEPEND_SOURCES))
+
+depend: glapi/glapi-stamp $(DEPEND_SOURCES)
+ @echo "running $(MKDEP)"
+ @touch depend
+ @# MESA is "..", but luckily, directories are longer than 2 characters
+ @$(MKDEP) -f- -p$(ES1_OBJ_DIR)/ $(DEFINES) $(ES1_CFLAGS) \
+ $(ES1_INCLUDES) $(ES1_ALL_SOURCES) 2>/dev/null | \
+ sed -e 's,^$(ES1_OBJ_DIR)/$(MESA)/,$(ES1_OBJ_DIR)/,' > depend
+ @$(MKDEP) -f- -p$(ES2_OBJ_DIR)/ $(DEFINES) $(ES2_CFLAGS) \
+ $(ES2_INCLUDES) $(ES2_ALL_SOURCES) 2>/dev/null | \
+ sed -e 's,^$(ES2_OBJ_DIR)/$(MESA)/,$(ES2_OBJ_DIR)/,' >> depend
+
+-include depend
diff --git a/src/mesa/es/glapi/Makefile b/src/mesa/es/glapi/Makefile
new file mode 100644
index 0000000000..1256be953d
--- /dev/null
+++ b/src/mesa/es/glapi/Makefile
@@ -0,0 +1,94 @@
+TOP = ../../../..
+GLAPI = ../../glapi
+include $(TOP)/configs/current
+
+OUTPUTS := \
+ glapi/glapidispatch.h \
+ glapi/glapioffsets.h \
+ glapi/glapitable.h \
+ glapi/glapitemp.h \
+ glapi/glprocs.h \
+ sparc/glapi_sparc.S \
+ x86-64/glapi_x86-64.S \
+ x86/glapi_x86.S \
+ main/enums.c \
+ main/remap_helper.h
+
+COMMON = gl_XML.py glX_XML.py license.py typeexpr.py
+COMMON := $(addprefix $(GLAPI)/, $(COMMON))
+
+ES1_APIXML := es1_API.xml
+ES2_APIXML := es2_API.xml
+ES1_OUTPUT_DIR := glapi-es1
+ES2_OUTPUT_DIR := glapi-es2
+
+ES1_DEPS = $(ES1_APIXML) base1_API.xml es1_EXT.xml es_EXT.xml \
+ es1_COMPAT.xml es_COMPAT.xml
+ES2_DEPS = $(ES2_APIXML) base2_API.xml es2_EXT.xml es_EXT.xml \
+ es2_COMPAT.xml es_COMPAT.xml
+
+ES1_OUTPUTS := $(addprefix $(ES1_OUTPUT_DIR)/, $(OUTPUTS))
+ES2_OUTPUTS := $(addprefix $(ES2_OUTPUT_DIR)/, $(OUTPUTS))
+
+all: glapi-stamp
+
+glapi-stamp: $(ES1_OUTPUTS) $(ES2_OUTPUTS)
+ @touch glapi-stamp
+
+$(ES1_OUTPUTS): APIXML := $(ES1_APIXML)
+$(ES2_OUTPUTS): APIXML := $(ES2_APIXML)
+$(ES1_OUTPUTS): $(ES1_DEPS)
+$(ES2_OUTPUTS): $(ES2_DEPS)
+
+define gen-glapi
+ @mkdir -p $(dir $@)
+ $(PYTHON2) $(PYTHON_FLAGS) $< -f $(APIXML) $(1) > $@
+endef
+
+%/glapidispatch.h: $(GLAPI)/gl_table.py $(COMMON)
+ $(call gen-glapi,-c -m remap_table)
+
+%/glapioffsets.h: $(GLAPI)/gl_offsets.py $(COMMON)
+ $(call gen-glapi,-c)
+
+%/glapitable.h: $(GLAPI)/gl_table.py $(COMMON)
+ $(call gen-glapi,-c)
+
+%/glapitemp.h: $(GLAPI)/gl_apitemp.py $(COMMON)
+ $(call gen-glapi,-c)
+
+%/glprocs.h: $(GLAPI)/gl_procs.py $(COMMON)
+ $(call gen-glapi,-c)
+
+%/sparc/glapi_sparc.S: $(GLAPI)/gl_SPARC_asm.py $(COMMON)
+ $(call gen-glapi)
+
+%/x86-64/glapi_x86-64.S: $(GLAPI)/gl_x86-64_asm.py $(COMMON)
+ $(call gen-glapi)
+
+%/x86/glapi_x86.S: $(GLAPI)/gl_x86_asm.py $(COMMON)
+ $(call gen-glapi)
+
+%/main/enums.c: $(GLAPI)/gl_enums.py $(COMMON)
+ $(call gen-glapi)
+
+%/main/remap_helper.h: $(GLAPI)/remap_helper.py $(COMMON)
+ $(call gen-glapi)
+
+verify_xml:
+ @if [ ! -f gl.h ]; then \
+ echo "Please copy gl.h and gl2.h to this directory"; \
+ exit 1; \
+ fi
+ @echo "Verifying that es1_API.xml covers OpenGL ES 1.1..."
+ @$(PYTHON2) $(PYTHON_FLAGS) gl_parse_header.py gl.h > tmp.xml
+ @$(PYTHON2) $(PYTHON_FLAGS) gl_compare.py difference tmp.xml es1_API.xml
+ @echo "Verifying that es2_API.xml covers OpenGL ES 2.0..."
+ @$(PYTHON2) $(PYTHON_FLAGS) gl_parse_header.py gl2.h > tmp.xml
+ @$(PYTHON2) $(PYTHON_FLAGS) gl_compare.py difference tmp.xml es2_API.xml
+ @rm -f tmp.xml
+
+clean:
+ -rm -f glapi-stamp
+ -rm -rf $(ES1_OUTPUT_DIR) $(ES2_OUTPUT_DIR)
+ -rm -f *~ *.pyc *.pyo
diff --git a/src/mesa/es/glapi/base1_API.xml b/src/mesa/es/glapi/base1_API.xml
new file mode 100644
index 0000000000..f5d136ccef
--- /dev/null
+++ b/src/mesa/es/glapi/base1_API.xml
@@ -0,0 +1,744 @@
+<?xml version="1.0"?>
+<!DOCTYPE OpenGLAPI SYSTEM "../../glapi/gl_API.dtd">
+
+<!-- OpenGL and OpenGL ES 1.x APIs
+ This file defines the base categories that can be shared by all APIs.
+ They are defined in an incremental fashion.
+-->
+
+<OpenGLAPI>
+
+<!-- base subset of OpenGL 1.0 -->
+<category name="base1.0">
+ <enum name="FALSE" value="0x0"/>
+ <enum name="TRUE" value="0x1"/>
+ <enum name="ZERO" value="0x0"/>
+ <enum name="ONE" value="0x1"/>
+ <enum name="NO_ERROR" value="0x0"/>
+
+ <enum name="POINTS" value="0x0000"/>
+ <enum name="LINES" value="0x0001"/>
+ <enum name="LINE_LOOP" value="0x0002"/>
+ <enum name="LINE_STRIP" value="0x0003"/>
+ <enum name="TRIANGLES" value="0x0004"/>
+ <enum name="TRIANGLE_STRIP" value="0x0005"/>
+ <enum name="TRIANGLE_FAN" value="0x0006"/>
+ <enum name="NEVER" value="0x0200"/>
+ <enum name="LESS" value="0x0201"/>
+ <enum name="EQUAL" value="0x0202"/>
+ <enum name="LEQUAL" value="0x0203"/>
+ <enum name="GREATER" value="0x0204"/>
+ <enum name="NOTEQUAL" value="0x0205"/>
+ <enum name="GEQUAL" value="0x0206"/>
+ <enum name="ALWAYS" value="0x0207"/>
+ <enum name="SRC_COLOR" value="0x0300"/>
+ <enum name="ONE_MINUS_SRC_COLOR" value="0x0301"/>
+ <enum name="SRC_ALPHA" value="0x0302"/>
+ <enum name="ONE_MINUS_SRC_ALPHA" value="0x0303"/>
+ <enum name="DST_ALPHA" value="0x0304"/>
+ <enum name="ONE_MINUS_DST_ALPHA" value="0x0305"/>
+ <enum name="DST_COLOR" value="0x0306"/>
+ <enum name="ONE_MINUS_DST_COLOR" value="0x0307"/>
+ <enum name="SRC_ALPHA_SATURATE" value="0x0308"/>
+ <enum name="FRONT" value="0x0404"/>
+ <enum name="BACK" value="0x0405"/>
+ <enum name="FRONT_AND_BACK" value="0x0408"/>
+ <enum name="INVALID_ENUM" value="0x0500"/>
+ <enum name="INVALID_VALUE" value="0x0501"/>
+ <enum name="INVALID_OPERATION" value="0x0502"/>
+ <enum name="OUT_OF_MEMORY" value="0x0505"/>
+ <enum name="CW" value="0x0900"/>
+ <enum name="CCW" value="0x0901"/>
+ <enum name="CULL_FACE" count="1" value="0x0B44">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DEPTH_TEST" count="1" value="0x0B71">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="STENCIL_TEST" count="1" value="0x0B90">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DITHER" count="1" value="0x0BD0">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="BLEND" count="1" value="0x0BE2">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="SCISSOR_TEST" count="1" value="0x0C11">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="UNPACK_ALIGNMENT" count="1" value="0x0CF5">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="PACK_ALIGNMENT" count="1" value="0x0D05">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MAX_TEXTURE_SIZE" count="1" value="0x0D33">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MAX_VIEWPORT_DIMS" count="2" value="0x0D3A">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="SUBPIXEL_BITS" count="1" value="0x0D50">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="RED_BITS" count="1" value="0x0D52">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="GREEN_BITS" count="1" value="0x0D53">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="BLUE_BITS" count="1" value="0x0D54">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="ALPHA_BITS" count="1" value="0x0D55">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DEPTH_BITS" count="1" value="0x0D56">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="STENCIL_BITS" count="1" value="0x0D57">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_2D" count="1" value="0x0DE1">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DONT_CARE" value="0x1100"/>
+ <enum name="FASTEST" value="0x1101"/>
+ <enum name="NICEST" value="0x1102"/>
+ <enum name="BYTE" count="1" value="0x1400">
+ <size name="CallLists"/>
+ </enum>
+ <enum name="UNSIGNED_BYTE" count="1" value="0x1401">
+ <size name="CallLists"/>
+ </enum>
+ <enum name="SHORT" count="2" value="0x1402">
+ <size name="CallLists"/>
+ </enum>
+ <enum name="UNSIGNED_SHORT" count="2" value="0x1403">
+ <size name="CallLists"/>
+ </enum>
+ <enum name="FLOAT" count="4" value="0x1406">
+ <size name="CallLists"/>
+ </enum>
+ <enum name="INVERT" value="0x150A"/>
+ <enum name="TEXTURE" value="0x1702"/>
+ <enum name="ALPHA" value="0x1906"/>
+ <enum name="RGB" value="0x1907"/>
+ <enum name="RGBA" value="0x1908"/>
+ <enum name="LUMINANCE" value="0x1909"/>
+ <enum name="LUMINANCE_ALPHA" value="0x190A"/>
+ <enum name="KEEP" value="0x1E00"/>
+ <enum name="REPLACE" value="0x1E01"/>
+ <enum name="INCR" value="0x1E02"/>
+ <enum name="DECR" value="0x1E03"/>
+ <enum name="VENDOR" value="0x1F00"/>
+ <enum name="RENDERER" value="0x1F01"/>
+ <enum name="VERSION" value="0x1F02"/>
+ <enum name="EXTENSIONS" value="0x1F03"/>
+ <enum name="NEAREST" value="0x2600"/>
+ <enum name="LINEAR" value="0x2601"/>
+ <enum name="NEAREST_MIPMAP_NEAREST" value="0x2700"/>
+ <enum name="LINEAR_MIPMAP_NEAREST" value="0x2701"/>
+ <enum name="NEAREST_MIPMAP_LINEAR" value="0x2702"/>
+ <enum name="LINEAR_MIPMAP_LINEAR" value="0x2703"/>
+ <enum name="TEXTURE_MAG_FILTER" count="1" value="0x2800">
+ <size name="TexParameterfv"/>
+ <size name="TexParameteriv"/>
+ <size name="GetTexParameterfv" mode="get"/>
+ <size name="GetTexParameteriv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_MIN_FILTER" count="1" value="0x2801">
+ <size name="TexParameterfv"/>
+ <size name="TexParameteriv"/>
+ <size name="GetTexParameterfv" mode="get"/>
+ <size name="GetTexParameteriv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_WRAP_S" count="1" value="0x2802">
+ <size name="TexParameterfv"/>
+ <size name="TexParameteriv"/>
+ <size name="GetTexParameterfv" mode="get"/>
+ <size name="GetTexParameteriv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_WRAP_T" count="1" value="0x2803">
+ <size name="TexParameterfv"/>
+ <size name="TexParameteriv"/>
+ <size name="GetTexParameterfv" mode="get"/>
+ <size name="GetTexParameteriv" mode="get"/>
+ </enum>
+ <enum name="REPEAT" value="0x2901"/>
+
+ <enum name="DEPTH_BUFFER_BIT" value="0x00000100"/>
+ <enum name="STENCIL_BUFFER_BIT" value="0x00000400"/>
+ <enum name="COLOR_BUFFER_BIT" value="0x00004000"/>
+
+ <type name="float" size="4" float="true" glx_name="FLOAT32"/>
+ <type name="clampf" size="4" float="true" glx_name="FLOAT32"/>
+
+ <type name="int" size="4" glx_name="CARD32"/>
+ <type name="uint" size="4" unsigned="true" glx_name="CARD32"/>
+ <type name="sizei" size="4" glx_name="CARD32"/>
+ <type name="enum" size="4" unsigned="true" glx_name="ENUM"/>
+ <type name="bitfield" size="4" unsigned="true" glx_name="CARD32"/>
+
+ <type name="short" size="2" glx_name="CARD16"/>
+ <type name="ushort" size="2" unsigned="true" glx_name="CARD16"/>
+
+ <type name="byte" size="1" glx_name="CARD8"/>
+ <type name="ubyte" size="1" unsigned="true" glx_name="CARD8"/>
+ <type name="boolean" size="1" unsigned="true" glx_name="CARD8"/>
+
+ <type name="void" size="1"/>
+
+ <function name="BlendFunc" offset="241">
+ <param name="sfactor" type="GLenum"/>
+ <param name="dfactor" type="GLenum"/>
+ <glx rop="160"/>
+ </function>
+
+ <function name="Clear" offset="203">
+ <param name="mask" type="GLbitfield"/>
+ <glx rop="127"/>
+ </function>
+
+ <function name="ClearColor" offset="206">
+ <param name="red" type="GLclampf"/>
+ <param name="green" type="GLclampf"/>
+ <param name="blue" type="GLclampf"/>
+ <param name="alpha" type="GLclampf"/>
+ <glx rop="130"/>
+ </function>
+
+ <function name="ClearStencil" offset="207">
+ <param name="s" type="GLint"/>
+ <glx rop="131"/>
+ </function>
+
+ <function name="ColorMask" offset="210">
+ <param name="red" type="GLboolean"/>
+ <param name="green" type="GLboolean"/>
+ <param name="blue" type="GLboolean"/>
+ <param name="alpha" type="GLboolean"/>
+ <glx rop="134"/>
+ </function>
+
+ <function name="CullFace" offset="152">
+ <param name="mode" type="GLenum"/>
+ <glx rop="79"/>
+ </function>
+
+ <function name="DepthFunc" offset="245">
+ <param name="func" type="GLenum"/>
+ <glx rop="164"/>
+ </function>
+
+ <function name="DepthMask" offset="211">
+ <param name="flag" type="GLboolean"/>
+ <glx rop="135"/>
+ </function>
+
+ <function name="Disable" offset="214">
+ <param name="cap" type="GLenum"/>
+ <glx rop="138" handcode="client"/>
+ </function>
+
+ <function name="Enable" offset="215">
+ <param name="cap" type="GLenum"/>
+ <glx rop="139" handcode="client"/>
+ </function>
+
+ <function name="Finish" offset="216">
+ <glx sop="108" handcode="true"/>
+ </function>
+
+ <function name="Flush" offset="217">
+ <glx sop="142" handcode="true"/>
+ </function>
+
+ <function name="FrontFace" offset="157">
+ <param name="mode" type="GLenum"/>
+ <glx rop="84"/>
+ </function>
+
+ <function name="GetError" offset="261">
+ <return type="GLenum"/>
+ <glx sop="115" handcode="client"/>
+ </function>
+
+ <function name="GetIntegerv" offset="263">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx sop="117" handcode="client"/>
+ </function>
+
+ <function name="GetString" offset="275">
+ <param name="name" type="GLenum"/>
+ <return type="const GLubyte *"/>
+ <glx sop="129" handcode="true"/>
+ </function>
+
+ <function name="Hint" offset="158">
+ <param name="target" type="GLenum"/>
+ <param name="mode" type="GLenum"/>
+ <glx rop="85"/>
+ </function>
+
+ <function name="LineWidth" offset="168">
+ <param name="width" type="GLfloat"/>
+ <glx rop="95"/>
+ </function>
+
+ <function name="PixelStorei" offset="250">
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLint"/>
+ <glx sop="110" handcode="client"/>
+ </function>
+
+ <function name="ReadPixels" offset="256">
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="pixels" type="GLvoid *" output="true" img_width="width" img_height="height" img_format="format" img_type="type" img_target="0"/>
+ <glx sop="111"/>
+ </function>
+
+ <function name="Scissor" offset="176">
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <glx rop="103"/>
+ </function>
+
+ <function name="StencilFunc" offset="243">
+ <param name="func" type="GLenum"/>
+ <param name="ref" type="GLint"/>
+ <param name="mask" type="GLuint"/>
+ <glx rop="162"/>
+ </function>
+
+ <function name="StencilMask" offset="209">
+ <param name="mask" type="GLuint"/>
+ <glx rop="133"/>
+ </function>
+
+ <function name="StencilOp" offset="244">
+ <param name="fail" type="GLenum"/>
+ <param name="zfail" type="GLenum"/>
+ <param name="zpass" type="GLenum"/>
+ <glx rop="163"/>
+ </function>
+
+ <function name="TexParameterf" offset="178">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfloat"/>
+ <glx rop="105"/>
+ </function>
+
+ <function name="Viewport" offset="305">
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <glx rop="191"/>
+ </function>
+
+ <!-- these are not in OpenGL ES 1.0 -->
+ <enum name="LINE_WIDTH" count="1" value="0x0B21">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="CULL_FACE_MODE" count="1" value="0x0B45">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="FRONT_FACE" count="1" value="0x0B46">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DEPTH_RANGE" count="2" value="0x0B70">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DEPTH_WRITEMASK" count="1" value="0x0B72">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DEPTH_CLEAR_VALUE" count="1" value="0x0B73">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DEPTH_FUNC" count="1" value="0x0B74">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="STENCIL_CLEAR_VALUE" count="1" value="0x0B91">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="STENCIL_FUNC" count="1" value="0x0B92">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="STENCIL_VALUE_MASK" count="1" value="0x0B93">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="STENCIL_FAIL" count="1" value="0x0B94">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="STENCIL_PASS_DEPTH_FAIL" count="1" value="0x0B95">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="STENCIL_PASS_DEPTH_PASS" count="1" value="0x0B96">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="STENCIL_REF" count="1" value="0x0B97">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="STENCIL_WRITEMASK" count="1" value="0x0B98">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="VIEWPORT" count="4" value="0x0BA2">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="SCISSOR_BOX" count="4" value="0x0C10">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="COLOR_CLEAR_VALUE" count="4" value="0x0C22">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="COLOR_WRITEMASK" count="4" value="0x0C23">
+ <size name="Get" mode="get"/>
+ </enum>
+
+ <function name="TexParameterfv" offset="179">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *" variable_param="pname"/>
+ <glx rop="106"/>
+ </function>
+
+ <function name="TexParameteri" offset="180">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLint"/>
+ <glx rop="107"/>
+ </function>
+
+ <function name="TexParameteriv" offset="181">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLint *" variable_param="pname"/>
+ <glx rop="108"/>
+ </function>
+
+ <function name="GetBooleanv" offset="258">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLboolean *" output="true" variable_param="pname"/>
+ <glx sop="112" handcode="client"/>
+ </function>
+
+ <function name="GetFloatv" offset="262">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx sop="116" handcode="client"/>
+ </function>
+
+ <function name="GetTexParameterfv" offset="282">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx sop="136"/>
+ </function>
+
+ <function name="GetTexParameteriv" offset="283">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx sop="137"/>
+ </function>
+
+ <function name="IsEnabled" offset="286">
+ <param name="cap" type="GLenum"/>
+ <return type="GLboolean"/>
+ <glx sop="140" handcode="client"/>
+ </function>
+</category>
+
+<!-- base subset of OpenGL 1.1 -->
+<category name="base1.1">
+ <enum name="POLYGON_OFFSET_FILL" value="0x8037"/>
+
+ <function name="BindTexture" offset="307">
+ <param name="target" type="GLenum"/>
+ <param name="texture" type="GLuint"/>
+ <glx rop="4117"/>
+ </function>
+
+ <function name="CopyTexImage2D" offset="324">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="border" type="GLint"/>
+ <glx rop="4120"/>
+ </function>
+
+ <function name="CopyTexSubImage2D" offset="326">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="xoffset" type="GLint"/>
+ <param name="yoffset" type="GLint"/>
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <glx rop="4122"/>
+ </function>
+
+ <function name="DeleteTextures" offset="327">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="textures" type="const GLuint *" count="n"/>
+ <glx sop="144"/>
+ </function>
+
+ <function name="DrawArrays" offset="310">
+ <param name="mode" type="GLenum"/>
+ <param name="first" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <glx rop="193" handcode="true"/>
+ </function>
+
+ <function name="DrawElements" offset="311">
+ <param name="mode" type="GLenum"/>
+ <param name="count" type="GLsizei"/>
+ <param name="type" type="GLenum"/>
+ <param name="indices" type="const GLvoid *"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="GenTextures" offset="328">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="textures" type="GLuint *" output="true" count="n"/>
+ <glx sop="145" always_array="true"/>
+ </function>
+
+ <function name="PolygonOffset" offset="319">
+ <param name="factor" type="GLfloat"/>
+ <param name="units" type="GLfloat"/>
+ <glx rop="192"/>
+ </function>
+
+ <function name="TexSubImage2D" offset="333">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="xoffset" type="GLint"/>
+ <param name="yoffset" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="UNUSED" type="GLuint" padding="true"/>
+ <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_xoff="xoffset" img_yoff="yoffset" img_format="format" img_type="type" img_target="target" img_pad_dimensions="true"/>
+ <glx rop="4100" large="true"/>
+ </function>
+
+ <!-- these are not in OpenGL ES 1.0 -->
+ <enum name="POLYGON_OFFSET_UNITS" count="1" value="0x2A00">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POLYGON_OFFSET_FACTOR" count="1" value="0x8038">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_BINDING_2D" count="1" value="0x8069">
+ <size name="Get" mode="get"/>
+ </enum>
+
+ <function name="IsTexture" offset="330">
+ <param name="texture" type="GLuint"/>
+ <return type="GLboolean"/>
+ <glx sop="146"/>
+ </function>
+</category>
+
+<!-- base subset of OpenGL 1.2 -->
+<category name="base1.2">
+ <enum name="UNSIGNED_SHORT_4_4_4_4" value="0x8033"/>
+ <enum name="UNSIGNED_SHORT_5_5_5_1" value="0x8034"/>
+ <enum name="CLAMP_TO_EDGE" value="0x812F"/>
+ <enum name="UNSIGNED_SHORT_5_6_5" value="0x8363"/>
+ <enum name="ALIASED_POINT_SIZE_RANGE" count="2" value="0x846D">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="ALIASED_LINE_WIDTH_RANGE" count="2" value="0x846E">
+ <size name="Get" mode="get"/>
+ </enum>
+</category>
+
+<!-- base subset of OpenGL 1.3 -->
+<category name="base1.3">
+ <enum name="SAMPLE_ALPHA_TO_COVERAGE" count="1" value="0x809E">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="SAMPLE_COVERAGE" count="1" value="0x80A0">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="TEXTURE0" value="0x84C0"/>
+ <enum name="TEXTURE1" value="0x84C1"/>
+ <enum name="TEXTURE2" value="0x84C2"/>
+ <enum name="TEXTURE3" value="0x84C3"/>
+ <enum name="TEXTURE4" value="0x84C4"/>
+ <enum name="TEXTURE5" value="0x84C5"/>
+ <enum name="TEXTURE6" value="0x84C6"/>
+ <enum name="TEXTURE7" value="0x84C7"/>
+ <enum name="TEXTURE8" value="0x84C8"/>
+ <enum name="TEXTURE9" value="0x84C9"/>
+ <enum name="TEXTURE10" value="0x84CA"/>
+ <enum name="TEXTURE11" value="0x84CB"/>
+ <enum name="TEXTURE12" value="0x84CC"/>
+ <enum name="TEXTURE13" value="0x84CD"/>
+ <enum name="TEXTURE14" value="0x84CE"/>
+ <enum name="TEXTURE15" value="0x84CF"/>
+ <enum name="TEXTURE16" value="0x84D0"/>
+ <enum name="TEXTURE17" value="0x84D1"/>
+ <enum name="TEXTURE18" value="0x84D2"/>
+ <enum name="TEXTURE19" value="0x84D3"/>
+ <enum name="TEXTURE20" value="0x84D4"/>
+ <enum name="TEXTURE21" value="0x84D5"/>
+ <enum name="TEXTURE22" value="0x84D6"/>
+ <enum name="TEXTURE23" value="0x84D7"/>
+ <enum name="TEXTURE24" value="0x84D8"/>
+ <enum name="TEXTURE25" value="0x84D9"/>
+ <enum name="TEXTURE26" value="0x84DA"/>
+ <enum name="TEXTURE27" value="0x84DB"/>
+ <enum name="TEXTURE28" value="0x84DC"/>
+ <enum name="TEXTURE29" value="0x84DD"/>
+ <enum name="TEXTURE30" value="0x84DE"/>
+ <enum name="TEXTURE31" value="0x84DF"/>
+ <enum name="NUM_COMPRESSED_TEXTURE_FORMATS" count="1" value="0x86A2">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="COMPRESSED_TEXTURE_FORMATS" count="-1" value="0x86A3">
+ <size name="Get" mode="get"/>
+ </enum>
+
+ <function name="ActiveTexture" offset="374">
+ <param name="texture" type="GLenum"/>
+ <glx rop="197"/>
+ </function>
+
+ <function name="CompressedTexImage2D" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="border" type="GLint"/>
+ <param name="imageSize" type="GLsizei" counter="true"/>
+ <param name="data" type="const GLvoid *" count="imageSize"/>
+ <glx rop="215" handcode="client"/>
+ </function>
+
+ <function name="CompressedTexSubImage2D" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="xoffset" type="GLint"/>
+ <param name="yoffset" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="imageSize" type="GLsizei" counter="true"/>
+ <param name="data" type="const GLvoid *" count="imageSize"/>
+ <glx rop="218" handcode="client"/>
+ </function>
+
+ <function name="SampleCoverage" offset="assign">
+ <param name="value" type="GLclampf"/>
+ <param name="invert" type="GLboolean"/>
+ <glx rop="229"/>
+ </function>
+
+ <!-- these are not in OpenGL ES 1.0 -->
+ <enum name="SAMPLE_BUFFERS" count="1" value="0x80A8">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="SAMPLES" count="1" value="0x80A9">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="SAMPLE_COVERAGE_VALUE" count="1" value="0x80AA">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="SAMPLE_COVERAGE_INVERT" count="1" value="0x80AB">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="ACTIVE_TEXTURE" count="1" value="0x84E0">
+ <size name="Get" mode="get"/>
+ </enum>
+</category>
+
+<!-- base subset of OpenGL 1.4 -->
+<category name="base1.4">
+ <enum name="GENERATE_MIPMAP_HINT" value="0x8192"/>
+</category>
+
+<!-- base subset of OpenGL 1.5 -->
+<category name="base1.5">
+ <enum name="BUFFER_SIZE" value="0x8764"/>
+ <enum name="BUFFER_USAGE" value="0x8765"/>
+ <enum name="ARRAY_BUFFER" value="0x8892"/>
+ <enum name="ELEMENT_ARRAY_BUFFER" value="0x8893"/>
+ <enum name="ARRAY_BUFFER_BINDING" value="0x8894"/>
+ <enum name="ELEMENT_ARRAY_BUFFER_BINDING" value="0x8895"/>
+ <enum name="STATIC_DRAW" value="0x88E4"/>
+ <enum name="DYNAMIC_DRAW" value="0x88E8"/>
+
+ <type name="intptr" size="4" glx_name="CARD32"/>
+ <type name="sizeiptr" size="4" glx_name="CARD32"/>
+
+ <function name="BindBuffer" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="buffer" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="BufferData" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="size" type="GLsizeiptr" counter="true"/>
+ <param name="data" type="const GLvoid *" count="size" img_null_flag="true"/>
+ <param name="usage" type="GLenum"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="BufferSubData" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="offset" type="GLintptr"/>
+ <param name="size" type="GLsizeiptr" counter="true"/>
+ <param name="data" type="const GLvoid *" count="size"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="DeleteBuffers" offset="assign">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="buffer" type="const GLuint *" count="n"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GenBuffers" offset="assign">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="buffer" type="GLuint *" output="true" count="n"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetBufferParameteriv" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="IsBuffer" offset="assign">
+ <param name="buffer" type="GLuint"/>
+ <return type="GLboolean"/>
+ <glx ignore="true"/>
+ </function>
+</category>
+
+</OpenGLAPI>
diff --git a/src/mesa/es/glapi/base2_API.xml b/src/mesa/es/glapi/base2_API.xml
new file mode 100644
index 0000000000..6aa43b728a
--- /dev/null
+++ b/src/mesa/es/glapi/base2_API.xml
@@ -0,0 +1,533 @@
+<?xml version="1.0"?>
+<!DOCTYPE OpenGLAPI SYSTEM "../../glapi/gl_API.dtd">
+
+<!-- OpenGL and OpenGL ES 2.x APIs -->
+
+<OpenGLAPI>
+
+<xi:include href="base1_API.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+<!-- base subset of OpenGL 2.0 -->
+<category name="base2.0">
+ <enum name="BLEND_EQUATION_RGB" count="1" value="0x8009"> <!-- same as BLEND_EQUATION -->
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="VERTEX_ATTRIB_ARRAY_ENABLED" count="1" value="0x8622">
+ <size name="GetVertexAttribdv" mode="get"/>
+ <size name="GetVertexAttribfv" mode="get"/>
+ <size name="GetVertexAttribiv" mode="get"/>
+ </enum>
+ <enum name="VERTEX_ATTRIB_ARRAY_SIZE" count="1" value="0x8623">
+ <size name="GetVertexAttribdv" mode="get"/>
+ <size name="GetVertexAttribfv" mode="get"/>
+ <size name="GetVertexAttribiv" mode="get"/>
+ </enum>
+ <enum name="VERTEX_ATTRIB_ARRAY_STRIDE" count="1" value="0x8624">
+ <size name="GetVertexAttribdv" mode="get"/>
+ <size name="GetVertexAttribfv" mode="get"/>
+ <size name="GetVertexAttribiv" mode="get"/>
+ </enum>
+ <enum name="VERTEX_ATTRIB_ARRAY_TYPE" count="1" value="0x8625">
+ <size name="GetVertexAttribdv" mode="get"/>
+ <size name="GetVertexAttribfv" mode="get"/>
+ <size name="GetVertexAttribiv" mode="get"/>
+ </enum>
+ <enum name="CURRENT_VERTEX_ATTRIB" count="1" value="0x8626">
+ <size name="GetVertexAttribdv" mode="get"/>
+ <size name="GetVertexAttribfv" mode="get"/>
+ <size name="GetVertexAttribiv" mode="get"/>
+ </enum>
+ <enum name="VERTEX_ATTRIB_ARRAY_POINTER" value="0x8645"/>
+ <enum name="STENCIL_BACK_FUNC" count="1" value="0x8800">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="STENCIL_BACK_FAIL" count="1" value="0x8801">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="STENCIL_BACK_PASS_DEPTH_FAIL" count="1" value="0x8802">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="STENCIL_BACK_PASS_DEPTH_PASS" count="1" value="0x8803">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="BLEND_EQUATION_ALPHA" count="1" value="0x883D">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MAX_VERTEX_ATTRIBS" count="1" value="0x8869">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="VERTEX_ATTRIB_ARRAY_NORMALIZED" value="0x886A"/>
+ <enum name="MAX_TEXTURE_IMAGE_UNITS" count="1" value="0x8872">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="FRAGMENT_SHADER" value="0x8B30"/>
+ <enum name="VERTEX_SHADER" value="0x8B31"/>
+ <enum name="MAX_VERTEX_TEXTURE_IMAGE_UNITS" value="0x8B4C"/>
+ <enum name="MAX_COMBINED_TEXTURE_IMAGE_UNITS" value="0x8B4D"/>
+ <enum name="SHADER_TYPE" value="0x8B4F"/>
+ <enum name="FLOAT_VEC2" value="0x8B50"/>
+ <enum name="FLOAT_VEC3" value="0x8B51"/>
+ <enum name="FLOAT_VEC4" value="0x8B52"/>
+ <enum name="INT_VEC2" value="0x8B53"/>
+ <enum name="INT_VEC3" value="0x8B54"/>
+ <enum name="INT_VEC4" value="0x8B55"/>
+ <enum name="BOOL" value="0x8B56"/>
+ <enum name="BOOL_VEC2" value="0x8B57"/>
+ <enum name="BOOL_VEC3" value="0x8B58"/>
+ <enum name="BOOL_VEC4" value="0x8B59"/>
+ <enum name="FLOAT_MAT2" value="0x8B5A"/>
+ <enum name="FLOAT_MAT3" value="0x8B5B"/>
+ <enum name="FLOAT_MAT4" value="0x8B5C"/>
+ <enum name="SAMPLER_2D" value="0x8B5E"/>
+ <enum name="SAMPLER_CUBE" value="0x8B60"/>
+ <enum name="DELETE_STATUS" value="0x8B80"/>
+ <enum name="COMPILE_STATUS" value="0x8B81"/>
+ <enum name="LINK_STATUS" value="0x8B82"/>
+ <enum name="VALIDATE_STATUS" value="0x8B83"/>
+ <enum name="INFO_LOG_LENGTH" value="0x8B84"/>
+ <enum name="ATTACHED_SHADERS" value="0x8B85"/>
+ <enum name="ACTIVE_UNIFORMS" value="0x8B86"/>
+ <enum name="ACTIVE_UNIFORM_MAX_LENGTH" value="0x8B87"/>
+ <enum name="SHADER_SOURCE_LENGTH" value="0x8B88"/>
+ <enum name="ACTIVE_ATTRIBUTES" value="0x8B89"/>
+ <enum name="ACTIVE_ATTRIBUTE_MAX_LENGTH" value="0x8B8A"/>
+ <enum name="SHADING_LANGUAGE_VERSION" value="0x8B8C"/>
+ <enum name="CURRENT_PROGRAM" value="0x8B8D"/>
+ <enum name="STENCIL_BACK_REF" value="0x8CA3"/>
+ <enum name="STENCIL_BACK_VALUE_MASK" value="0x8CA4"/>
+ <enum name="STENCIL_BACK_WRITEMASK" value="0x8CA5"/>
+
+ <type name="char" size="1" glx_name="CARD8"/>
+
+ <function name="AttachShader" offset="assign">
+ <param name="program" type="GLuint"/>
+ <param name="shader" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="BindAttribLocation" offset="assign">
+ <param name="program" type="GLuint"/>
+ <param name="index" type="GLuint"/>
+ <param name="name" type="const GLchar *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="BlendEquationSeparate" offset="assign">
+ <param name="modeRGB" type="GLenum"/>
+ <param name="modeA" type="GLenum"/>
+ <glx rop="4228"/>
+ </function>
+
+ <function name="CompileShader" offset="assign">
+ <param name="shader" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="CreateProgram" offset="assign">
+ <return type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="CreateShader" offset="assign">
+ <param name="type" type="GLenum"/>
+ <return type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="DeleteProgram" offset="assign">
+ <param name="program" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="DeleteShader" offset="assign">
+ <param name="program" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="DetachShader" offset="assign">
+ <param name="program" type="GLuint"/>
+ <param name="shader" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="DisableVertexAttribArray" offset="assign">
+ <param name="index" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="EnableVertexAttribArray" offset="assign">
+ <param name="index" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetActiveAttrib" offset="assign">
+ <param name="program" type="GLuint"/>
+ <param name="index" type="GLuint"/>
+ <param name="bufSize" type="GLsizei "/>
+ <param name="length" type="GLsizei *" output="true"/>
+ <param name="size" type="GLint *" output="true"/>
+ <param name="type" type="GLenum *" output="true"/>
+ <param name="name" type="GLchar *" output="true"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetActiveUniform" offset="assign">
+ <param name="program" type="GLuint"/>
+ <param name="index" type="GLuint"/>
+ <param name="bufSize" type="GLsizei"/>
+ <param name="length" type="GLsizei *" output="true"/>
+ <param name="size" type="GLint *" output="true"/>
+ <param name="type" type="GLenum *" output="true"/>
+ <param name="name" type="GLchar *" output="true"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetAttachedShaders" offset="assign">
+ <param name="program" type="GLuint"/>
+ <param name="maxCount" type="GLsizei"/>
+ <param name="count" type="GLsizei *" output="true"/>
+ <param name="obj" type="GLuint *" output="true"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetAttribLocation" offset="assign">
+ <param name="program" type="GLuint"/>
+ <param name="name" type="const GLchar *"/>
+ <return type="GLint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetProgramiv" offset="assign">
+ <param name="program" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetProgramInfoLog" offset="assign">
+ <param name="program" type="GLuint"/>
+ <param name="bufSize" type="GLsizei"/>
+ <param name="length" type="GLsizei *"/>
+ <param name="infoLog" type="GLchar *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetShaderiv" offset="assign">
+ <param name="shader" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetShaderInfoLog" offset="assign">
+ <param name="shader" type="GLuint"/>
+ <param name="bufSize" type="GLsizei"/>
+ <param name="length" type="GLsizei *"/>
+ <param name="infoLog" type="GLchar *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetShaderSource" offset="assign">
+ <param name="shader" type="GLuint"/>
+ <param name="bufSize" type="GLsizei"/>
+ <param name="length" type="GLsizei *" output="true"/>
+ <param name="source" type="GLchar *" output="true"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetUniformfv" offset="assign">
+ <param name="program" type="GLuint"/>
+ <param name="location" type="GLint"/>
+ <param name="params" type="GLfloat *" output="true"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetUniformiv" offset="assign">
+ <param name="program" type="GLuint"/>
+ <param name="location" type="GLint"/>
+ <param name="params" type="GLint *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetUniformLocation" offset="assign">
+ <param name="program" type="GLuint"/>
+ <param name="name" type="const GLchar *"/>
+ <return type="GLint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetVertexAttribfv" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetVertexAttribiv" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetVertexAttribPointerv" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="pointer" type="GLvoid **" output="true"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="IsProgram" offset="assign">
+ <param name="program" type="GLuint"/>
+ <return type="GLboolean"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="IsShader" offset="assign">
+ <param name="shader" type="GLuint"/>
+ <return type="GLboolean"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="LinkProgram" offset="assign">
+ <param name="program" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="ShaderSource" offset="assign">
+ <param name="shader" type="GLuint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="string" type="const GLchar **"/>
+ <param name="length" type="const GLint *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="StencilFuncSeparate" offset="assign">
+ <param name="face" type="GLenum"/>
+ <param name="func" type="GLenum"/>
+ <param name="ref" type="GLint"/>
+ <param name="mask" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="StencilOpSeparate" offset="assign">
+ <param name="face" type="GLenum"/>
+ <param name="sfail" type="GLenum"/>
+ <param name="zfail" type="GLenum"/>
+ <param name="zpass" type="GLenum"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="StencilMaskSeparate" offset="assign">
+ <param name="face" type="GLenum"/>
+ <param name="mask" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="Uniform1f" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="v0" type="GLfloat"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="Uniform1fv" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="Uniform1i" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="v0" type="GLint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="Uniform1iv" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="value" type="const GLint *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="Uniform2f" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="v0" type="GLfloat"/>
+ <param name="v1" type="GLfloat"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="Uniform2fv" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="Uniform2i" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="v0" type="GLint"/>
+ <param name="v1" type="GLint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="Uniform2iv" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="value" type="const GLint *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="Uniform3f" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="v0" type="GLfloat"/>
+ <param name="v1" type="GLfloat"/>
+ <param name="v2" type="GLfloat"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="Uniform3fv" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="Uniform3i" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="v0" type="GLint"/>
+ <param name="v1" type="GLint"/>
+ <param name="v2" type="GLint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="Uniform3iv" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="value" type="const GLint *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="Uniform4f" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="v0" type="GLfloat"/>
+ <param name="v1" type="GLfloat"/>
+ <param name="v2" type="GLfloat"/>
+ <param name="v3" type="GLfloat"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="Uniform4fv" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="Uniform4i" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="v0" type="GLint"/>
+ <param name="v1" type="GLint"/>
+ <param name="v2" type="GLint"/>
+ <param name="v3" type="GLint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="Uniform4iv" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="value" type="const GLint *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="UniformMatrix2fv" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="transpose" type="GLboolean"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="UniformMatrix3fv" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="transpose" type="GLboolean"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="UniformMatrix4fv" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="transpose" type="GLboolean"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="UseProgram" offset="assign">
+ <param name="program" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="ValidateProgram" offset="assign">
+ <param name="program" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="VertexAttrib1f" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLfloat"/>
+ </function>
+
+ <function name="VertexAttrib1fv" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLfloat *"/>
+ </function>
+
+ <function name="VertexAttrib2f" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ </function>
+
+ <function name="VertexAttrib2fv" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLfloat *"/>
+ </function>
+
+ <function name="VertexAttrib3f" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ </function>
+
+ <function name="VertexAttrib3fv" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLfloat *"/>
+ </function>
+
+ <function name="VertexAttrib4f" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ <param name="w" type="GLfloat"/>
+ </function>
+
+ <function name="VertexAttrib4fv" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLfloat *"/>
+ </function>
+
+ <function name="VertexAttribPointer" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="size" type="GLint"/>
+ <param name="type" type="GLenum"/>
+ <param name="normalized" type="GLboolean"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ </function>
+</category>
+
+</OpenGLAPI>
diff --git a/src/mesa/es/glapi/es1_API.xml b/src/mesa/es/glapi/es1_API.xml
new file mode 100644
index 0000000000..7ee5515f19
--- /dev/null
+++ b/src/mesa/es/glapi/es1_API.xml
@@ -0,0 +1,1100 @@
+<?xml version="1.0"?>
+<!DOCTYPE OpenGLAPI SYSTEM "../../glapi/gl_API.dtd">
+
+<!-- OpenGL ES 1.x API -->
+
+<OpenGLAPI>
+
+<xi:include href="base1_API.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+<!-- core subset of OpenGL 1.3 defined in OpenGL ES 1.0 -->
+<category name="core1.0">
+ <!-- addition to base1.0 -->
+ <enum name="ADD" value="0x0104"/>
+ <enum name="STACK_OVERFLOW" value="0x0503"/>
+ <enum name="STACK_UNDERFLOW" value="0x0504"/>
+ <enum name="EXP" value="0x0800"/>
+ <enum name="EXP2" value="0x0801"/>
+ <enum name="POINT_SMOOTH" count="1" value="0x0B10">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="LINE_SMOOTH" count="1" value="0x0B20">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="LIGHTING" count="1" value="0x0B50">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="LIGHT_MODEL_TWO_SIDE" count="1" value="0x0B52">
+ <size name="LightModelfv"/>
+ <size name="LightModeliv"/>
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="LIGHT_MODEL_AMBIENT" count="4" value="0x0B53">
+ <size name="LightModelfv"/>
+ <size name="LightModeliv"/>
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="COLOR_MATERIAL" count="1" value="0x0B57">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="FOG" count="1" value="0x0B60">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="FOG_DENSITY" count="1" value="0x0B62">
+ <size name="Fogfv"/>
+ <size name="Fogiv"/>
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="FOG_START" count="1" value="0x0B63">
+ <size name="Fogfv"/>
+ <size name="Fogiv"/>
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="FOG_END" count="1" value="0x0B64">
+ <size name="Fogfv"/>
+ <size name="Fogiv"/>
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="FOG_MODE" count="1" value="0x0B65">
+ <size name="Fogfv"/>
+ <size name="Fogiv"/>
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="FOG_COLOR" count="4" value="0x0B66">
+ <size name="Fogfv"/>
+ <size name="Fogiv"/>
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="NORMALIZE" count="1" value="0x0BA1">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="ALPHA_TEST" count="1" value="0x0BC0">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="PERSPECTIVE_CORRECTION_HINT" count="1" value="0x0C50">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POINT_SMOOTH_HINT" count="1" value="0x0C51">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="LINE_SMOOTH_HINT" count="1" value="0x0C52">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POLYGON_SMOOTH_HINT" count="1" value="0x0C53">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="FOG_HINT" count="1" value="0x0C54">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MAX_LIGHTS" count="1" value="0x0D31">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MAX_MODELVIEW_STACK_DEPTH" count="1" value="0x0D36">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MAX_PROJECTION_STACK_DEPTH" count="1" value="0x0D38">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MAX_TEXTURE_STACK_DEPTH" count="1" value="0x0D39">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="AMBIENT" count="4" value="0x1200">
+ <size name="Materialfv"/>
+ <size name="Materialiv"/>
+ <size name="Lightfv"/>
+ <size name="Lightiv"/>
+ <size name="GetMaterialfv" mode="get"/>
+ <size name="GetMaterialiv" mode="get"/>
+ <size name="GetLightfv" mode="get"/>
+ <size name="GetLightiv" mode="get"/>
+ </enum>
+ <enum name="DIFFUSE" count="4" value="0x1201">
+ <size name="Materialfv"/>
+ <size name="Materialiv"/>
+ <size name="Lightfv"/>
+ <size name="Lightiv"/>
+ <size name="GetMaterialfv" mode="get"/>
+ <size name="GetMaterialiv" mode="get"/>
+ <size name="GetLightfv" mode="get"/>
+ <size name="GetLightiv" mode="get"/>
+ </enum>
+ <enum name="SPECULAR" count="4" value="0x1202">
+ <size name="Materialfv"/>
+ <size name="Materialiv"/>
+ <size name="Lightfv"/>
+ <size name="Lightiv"/>
+ <size name="GetMaterialfv" mode="get"/>
+ <size name="GetMaterialiv" mode="get"/>
+ <size name="GetLightfv" mode="get"/>
+ <size name="GetLightiv" mode="get"/>
+ </enum>
+ <enum name="POSITION" count="4" value="0x1203">
+ <size name="Lightfv"/>
+ <size name="Lightiv"/>
+ <size name="GetLightfv" mode="get"/>
+ <size name="GetLightiv" mode="get"/>
+ </enum>
+ <enum name="SPOT_DIRECTION" count="3" value="0x1204">
+ <size name="Lightfv"/>
+ <size name="Lightiv"/>
+ <size name="GetLightfv" mode="get"/>
+ <size name="GetLightiv" mode="get"/>
+ </enum>
+ <enum name="SPOT_EXPONENT" count="1" value="0x1205">
+ <size name="Lightfv"/>
+ <size name="Lightiv"/>
+ <size name="GetLightfv" mode="get"/>
+ <size name="GetLightiv" mode="get"/>
+ </enum>
+ <enum name="SPOT_CUTOFF" count="1" value="0x1206">
+ <size name="Lightfv"/>
+ <size name="Lightiv"/>
+ <size name="GetLightfv" mode="get"/>
+ <size name="GetLightiv" mode="get"/>
+ </enum>
+ <enum name="CONSTANT_ATTENUATION" count="1" value="0x1207">
+ <size name="Lightfv"/>
+ <size name="Lightiv"/>
+ <size name="GetLightfv" mode="get"/>
+ <size name="GetLightiv" mode="get"/>
+ </enum>
+ <enum name="LINEAR_ATTENUATION" count="1" value="0x1208">
+ <size name="Lightfv"/>
+ <size name="Lightiv"/>
+ <size name="GetLightfv" mode="get"/>
+ <size name="GetLightiv" mode="get"/>
+ </enum>
+ <enum name="QUADRATIC_ATTENUATION" count="1" value="0x1209">
+ <size name="Lightfv"/>
+ <size name="Lightiv"/>
+ <size name="GetLightfv" mode="get"/>
+ <size name="GetLightiv" mode="get"/>
+ </enum>
+ <enum name="CLEAR" value="0x1500"/>
+ <enum name="AND" value="0x1501"/>
+ <enum name="AND_REVERSE" value="0x1502"/>
+ <enum name="COPY" value="0x1503"/>
+ <enum name="AND_INVERTED" value="0x1504"/>
+ <enum name="NOOP" value="0x1505"/>
+ <enum name="XOR" value="0x1506"/>
+ <enum name="OR" value="0x1507"/>
+ <enum name="NOR" value="0x1508"/>
+ <enum name="EQUIV" value="0x1509"/>
+ <enum name="OR_REVERSE" value="0x150B"/>
+ <enum name="COPY_INVERTED" value="0x150C"/>
+ <enum name="OR_INVERTED" value="0x150D"/>
+ <enum name="NAND" value="0x150E"/>
+ <enum name="SET" value="0x150F"/>
+ <enum name="EMISSION" count="4" value="0x1600">
+ <size name="Materialfv"/>
+ <size name="Materialiv"/>
+ <size name="GetMaterialfv" mode="get"/>
+ <size name="GetMaterialiv" mode="get"/>
+ </enum>
+ <enum name="SHININESS" count="1" value="0x1601">
+ <size name="Materialfv"/>
+ <size name="Materialiv"/>
+ <size name="GetMaterialfv" mode="get"/>
+ <size name="GetMaterialiv" mode="get"/>
+ </enum>
+ <enum name="AMBIENT_AND_DIFFUSE" count="4" value="0x1602">
+ <size name="Materialfv"/>
+ <size name="Materialiv"/>
+ <size name="GetMaterialfv" mode="get"/>
+ <size name="GetMaterialiv" mode="get"/>
+ </enum>
+ <enum name="MODELVIEW" value="0x1700"/>
+ <enum name="PROJECTION" value="0x1701"/>
+ <enum name="FLAT" value="0x1D00"/>
+ <enum name="SMOOTH" value="0x1D01"/>
+ <enum name="MODULATE" value="0x2100"/>
+ <enum name="DECAL" value="0x2101"/>
+ <enum name="TEXTURE_ENV_MODE" count="1" value="0x2200">
+ <size name="TexEnvfv"/>
+ <size name="TexEnviv"/>
+ <size name="GetTexEnvfv" mode="get"/>
+ <size name="GetTexEnviv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_ENV_COLOR" count="4" value="0x2201">
+ <size name="TexEnvfv"/>
+ <size name="TexEnviv"/>
+ <size name="GetTexEnvfv" mode="get"/>
+ <size name="GetTexEnviv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_ENV" value="0x2300"/>
+ <enum name="LIGHT0" count="1" value="0x4000">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="LIGHT1" count="1" value="0x4001">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="LIGHT2" count="1" value="0x4002">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="LIGHT3" count="1" value="0x4003">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="LIGHT4" count="1" value="0x4004">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="LIGHT5" count="1" value="0x4005">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="LIGHT6" count="1" value="0x4006">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="LIGHT7" count="1" value="0x4007">
+ <size name="Get" mode="get"/>
+ </enum>
+
+ <function name="AlphaFunc" offset="240">
+ <param name="func" type="GLenum"/>
+ <param name="ref" type="GLclampf"/>
+ <glx rop="159"/>
+ </function>
+
+ <function name="Color4f" offset="29" vectorequiv="Color4fv">
+ <param name="red" type="GLfloat"/>
+ <param name="green" type="GLfloat"/>
+ <param name="blue" type="GLfloat"/>
+ <param name="alpha" type="GLfloat"/>
+ </function>
+
+ <function name="Fogf" offset="153">
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfloat"/>
+ <glx rop="80"/>
+ </function>
+
+ <function name="Fogfv" offset="154">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *" variable_param="pname"/>
+ <glx rop="81"/>
+ </function>
+
+ <function name="Lightf" offset="159">
+ <param name="light" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfloat"/>
+ <glx rop="86"/>
+ </function>
+
+ <function name="Lightfv" offset="160">
+ <param name="light" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *" variable_param="pname"/>
+ <glx rop="87"/>
+ </function>
+
+ <function name="LightModelf" offset="163">
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfloat"/>
+ <glx rop="90"/>
+ </function>
+
+ <function name="LightModelfv" offset="164">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *" variable_param="pname"/>
+ <glx rop="91"/>
+ </function>
+
+ <function name="LoadIdentity" offset="290">
+ <glx rop="176"/>
+ </function>
+
+ <function name="LoadMatrixf" offset="291">
+ <param name="m" type="const GLfloat *" count="16"/>
+ <glx rop="177"/>
+ </function>
+
+ <function name="LogicOp" offset="242">
+ <param name="opcode" type="GLenum"/>
+ <glx rop="161"/>
+ </function>
+
+ <function name="Materialf" offset="169">
+ <param name="face" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfloat"/>
+ <glx rop="96"/>
+ </function>
+
+ <function name="Materialfv" offset="170">
+ <param name="face" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *" variable_param="pname"/>
+ <glx rop="97"/>
+ </function>
+
+ <function name="MatrixMode" offset="293">
+ <param name="mode" type="GLenum"/>
+ <glx rop="179"/>
+ </function>
+
+ <function name="MultMatrixf" offset="294">
+ <param name="m" type="const GLfloat *" count="16"/>
+ <glx rop="180"/>
+ </function>
+
+ <function name="Normal3f" offset="56" vectorequiv="Normal3fv">
+ <param name="nx" type="GLfloat"/>
+ <param name="ny" type="GLfloat"/>
+ <param name="nz" type="GLfloat"/>
+ </function>
+
+ <function name="PointSize" offset="173">
+ <param name="size" type="GLfloat"/>
+ <glx rop="100"/>
+ </function>
+
+ <function name="PopMatrix" offset="297">
+ <glx rop="183"/>
+ </function>
+
+ <function name="PushMatrix" offset="298">
+ <glx rop="184"/>
+ </function>
+
+ <function name="Rotatef" offset="300">
+ <param name="angle" type="GLfloat"/>
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ <glx rop="186"/>
+ </function>
+
+ <function name="Scalef" offset="302">
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ <glx rop="188"/>
+ </function>
+
+ <function name="ShadeModel" offset="177">
+ <param name="mode" type="GLenum"/>
+ <glx rop="104"/>
+ </function>
+
+ <function name="TexEnvf" offset="184">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfloat"/>
+ <glx rop="111"/>
+ </function>
+
+ <function name="TexEnvfv" offset="185">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *" variable_param="pname"/>
+ <glx rop="112"/>
+ </function>
+
+ <function name="TexImage2D" offset="183">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="internalformat" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="border" type="GLint"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_format="format" img_type="type" img_target="target" img_send_null="true" img_pad_dimensions="true"/>
+ <glx rop="110" large="true"/>
+ </function>
+
+ <function name="Translatef" offset="304">
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ <glx rop="190"/>
+ </function>
+
+ <!-- addition to base1.1 -->
+ <enum name="COLOR_LOGIC_OP" value="0x0BF2"/>
+ <enum name="VERTEX_ARRAY" count="1" value="0x8074">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="NORMAL_ARRAY" count="1" value="0x8075">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="COLOR_ARRAY" count="1" value="0x8076">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_COORD_ARRAY" count="1" value="0x8078">
+ <size name="Get" mode="get"/>
+ </enum>
+
+ <function name="ColorPointer" offset="308">
+ <param name="size" type="GLint"/>
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="DisableClientState" offset="309">
+ <param name="array" type="GLenum"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="EnableClientState" offset="313">
+ <param name="array" type="GLenum"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="NormalPointer" offset="318">
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="TexCoordPointer" offset="320">
+ <param name="size" type="GLint"/>
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="VertexPointer" offset="321">
+ <param name="size" type="GLint"/>
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ <glx handcode="true"/>
+ </function>
+
+ <!-- addition to base1.2 -->
+ <enum name="SMOOTH_POINT_SIZE_RANGE" count="2" value="0x0B12">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="SMOOTH_LINE_WIDTH_RANGE" count="2" value="0x0B22">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="RESCALE_NORMAL" count="1" value="0x803A">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MAX_ELEMENTS_VERTICES" count="1" value="0x80E8">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MAX_ELEMENTS_INDICES" count="1" value="0x80E9">
+ <size name="Get" mode="get"/>
+ </enum>
+
+ <!-- addition to base1.3 -->
+ <enum name="MULTISAMPLE" count="1" value="0x809D">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="SAMPLE_ALPHA_TO_ONE" count="1" value="0x809F">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MAX_TEXTURE_UNITS" count="1" value="0x84E2">
+ <size name="Get" mode="get"/>
+ </enum>
+
+ <function name="ClientActiveTexture" offset="375">
+ <param name="texture" type="GLenum"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="MultiTexCoord4f" offset="402" vectorequiv="MultiTexCoord4fv">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLfloat"/>
+ <param name="t" type="GLfloat"/>
+ <param name="r" type="GLfloat"/>
+ <param name="q" type="GLfloat"/>
+ </function>
+</category>
+
+<!-- core subset of OpenGL 1.5 defined in OpenGL ES 1.1 -->
+<category name="core1.1">
+ <!-- addition to base1.0 -->
+ <enum name="CURRENT_COLOR" count="4" value="0x0B00">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="CURRENT_NORMAL" count="3" value="0x0B02">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="CURRENT_TEXTURE_COORDS" count="4" value="0x0B03">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POINT_SIZE" count="1" value="0x0B11">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="SHADE_MODEL" count="1" value="0x0B54">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MATRIX_MODE" count="1" value="0x0BA0">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MODELVIEW_STACK_DEPTH" count="1" value="0x0BA3">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="PROJECTION_STACK_DEPTH" count="1" value="0x0BA4">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_STACK_DEPTH" count="1" value="0x0BA5">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MODELVIEW_MATRIX" count="16" value="0x0BA6">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="PROJECTION_MATRIX" count="16" value="0x0BA7">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_MATRIX" count="16" value="0x0BA8">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="ALPHA_TEST_FUNC" count="1" value="0x0BC1">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="ALPHA_TEST_REF" count="1" value="0x0BC2">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="BLEND_DST" count="1" value="0x0BE0">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="BLEND_SRC" count="1" value="0x0BE1">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="LOGIC_OP_MODE" count="1" value="0x0BF0">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="ALPHA_SCALE" count="1" value="0x0D1C">
+ <size name="TexEnvfv"/>
+ <size name="TexEnviv"/>
+ <size name="GetTexEnvfv" mode="get"/>
+ <size name="GetTexEnviv" mode="get"/>
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MAX_CLIP_PLANES" count="1" value="0x0D32">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="CLIP_PLANE0" count="1" value="0x3000">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="CLIP_PLANE1" count="1" value="0x3001">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="CLIP_PLANE2" count="1" value="0x3002">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="CLIP_PLANE3" count="1" value="0x3003">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="CLIP_PLANE4" count="1" value="0x3004">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="CLIP_PLANE5" count="1" value="0x3005">
+ <size name="Get" mode="get"/>
+ </enum>
+
+ <function name="Color4ub" offset="35" vectorequiv="Color4ubv">
+ <param name="red" type="GLubyte"/>
+ <param name="green" type="GLubyte"/>
+ <param name="blue" type="GLubyte"/>
+ <param name="alpha" type="GLubyte"/>
+ </function>
+
+ <function name="GetLightfv" offset="264">
+ <param name="light" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx sop="118"/>
+ </function>
+
+ <function name="GetMaterialfv" offset="269">
+ <param name="face" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx sop="123"/>
+ </function>
+
+ <function name="GetTexEnvfv" offset="276">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx sop="130"/>
+ </function>
+
+ <function name="GetTexEnviv" offset="277">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx sop="131"/>
+ </function>
+
+ <function name="TexEnvi" offset="186">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLint"/>
+ <glx rop="113"/>
+ </function>
+
+ <function name="TexEnviv" offset="187">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLint *" variable_param="pname"/>
+ <glx rop="114"/>
+ </function>
+
+ <!-- addition to base1.1 -->
+ <enum name="VERTEX_ARRAY_SIZE" count="1" value="0x807A">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="VERTEX_ARRAY_TYPE" count="1" value="0x807B">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="VERTEX_ARRAY_STRIDE" count="1" value="0x807C">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="NORMAL_ARRAY_TYPE" count="1" value="0x807E">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="NORMAL_ARRAY_STRIDE" count="1" value="0x807F">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="COLOR_ARRAY_SIZE" count="1" value="0x8081">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="COLOR_ARRAY_TYPE" count="1" value="0x8082">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="COLOR_ARRAY_STRIDE" count="1" value="0x8083">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_COORD_ARRAY_SIZE" count="1" value="0x8088">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_COORD_ARRAY_TYPE" count="1" value="0x8089">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_COORD_ARRAY_STRIDE" count="1" value="0x808A">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="VERTEX_ARRAY_POINTER" value="0x808E"/>
+ <enum name="NORMAL_ARRAY_POINTER" value="0x808F"/>
+ <enum name="COLOR_ARRAY_POINTER" value="0x8090"/>
+ <enum name="TEXTURE_COORD_ARRAY_POINTER" value="0x8092"/>
+
+ <function name="GetPointerv" offset="329">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLvoid **" output="true"/>
+ <glx handcode="true"/>
+ </function>
+
+ <!-- addition to base1.2 -->
+
+ <!-- addition to base1.3 -->
+ <enum name="CLIENT_ACTIVE_TEXTURE" count="1" value="0x84E1">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="SUBTRACT" value="0x84E7"/>
+ <enum name="COMBINE" value="0x8570"/>
+ <enum name="COMBINE_RGB" count="1" value="0x8571">
+ <size name="TexEnvfv"/>
+ <size name="TexEnviv"/>
+ <size name="GetTexEnvfv" mode="get"/>
+ <size name="GetTexEnviv" mode="get"/>
+ </enum>
+ <enum name="COMBINE_ALPHA" count="1" value="0x8572">
+ <size name="TexEnvfv"/>
+ <size name="TexEnviv"/>
+ <size name="GetTexEnvfv" mode="get"/>
+ <size name="GetTexEnviv" mode="get"/>
+ </enum>
+ <enum name="RGB_SCALE" count="1" value="0x8573">
+ <size name="TexEnvfv"/>
+ <size name="TexEnviv"/>
+ <size name="GetTexEnvfv" mode="get"/>
+ <size name="GetTexEnviv" mode="get"/>
+ </enum>
+ <enum name="ADD_SIGNED" value="0x8574"/>
+ <enum name="INTERPOLATE" value="0x8575"/>
+ <enum name="CONSTANT" value="0x8576"/>
+ <enum name="PRIMARY_COLOR" value="0x8577"/>
+ <enum name="PREVIOUS" value="0x8578"/>
+ <enum name="OPERAND0_RGB" count="1" value="0x8590">
+ <size name="TexEnvfv"/>
+ <size name="TexEnviv"/>
+ <size name="GetTexEnvfv" mode="get"/>
+ <size name="GetTexEnviv" mode="get"/>
+ </enum>
+ <enum name="OPERAND1_RGB" count="1" value="0x8591">
+ <size name="TexEnvfv"/>
+ <size name="TexEnviv"/>
+ <size name="GetTexEnvfv" mode="get"/>
+ <size name="GetTexEnviv" mode="get"/>
+ </enum>
+ <enum name="OPERAND2_RGB" count="1" value="0x8592">
+ <size name="TexEnvfv"/>
+ <size name="TexEnviv"/>
+ <size name="GetTexEnvfv" mode="get"/>
+ <size name="GetTexEnviv" mode="get"/>
+ </enum>
+ <enum name="OPERAND0_ALPHA" count="1" value="0x8598">
+ <size name="TexEnvfv"/>
+ <size name="TexEnviv"/>
+ <size name="GetTexEnvfv" mode="get"/>
+ <size name="GetTexEnviv" mode="get"/>
+ </enum>
+ <enum name="OPERAND1_ALPHA" count="1" value="0x8599">
+ <size name="TexEnvfv"/>
+ <size name="TexEnviv"/>
+ <size name="GetTexEnvfv" mode="get"/>
+ <size name="GetTexEnviv" mode="get"/>
+ </enum>
+ <enum name="OPERAND2_ALPHA" count="1" value="0x859A">
+ <size name="TexEnvfv"/>
+ <size name="TexEnviv"/>
+ <size name="GetTexEnvfv" mode="get"/>
+ <size name="GetTexEnviv" mode="get"/>
+ </enum>
+ <enum name="DOT3_RGB" value="0x86AE"/>
+ <enum name="DOT3_RGBA" value="0x86AF"/>
+
+ <!-- addition to base1.4 -->
+ <enum name="POINT_SIZE_MIN" count="1" value="0x8126">
+ <size name="PointParameterfv"/>
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POINT_SIZE_MAX" count="1" value="0x8127">
+ <size name="PointParameterfv"/>
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POINT_FADE_THRESHOLD_SIZE" count="1" value="0x8128">
+ <size name="PointParameterfv"/>
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POINT_DISTANCE_ATTENUATION" count="3" value="0x8129">
+ <size name="PointParameterfv"/>
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="GENERATE_MIPMAP" count="1" value="0x8191">
+ <size name="TexParameterfv"/>
+ <size name="TexParameteriv"/>
+ <size name="GetTexParameterfv" mode="get"/>
+ <size name="GetTexParameteriv" mode="get"/>
+ </enum>
+
+ <function name="PointParameterf" offset="assign">
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfloat"/>
+ <glx rop="2065"/>
+ </function>
+
+ <function name="PointParameterfv" offset="assign">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *" variable_param="pname"/>
+ <glx rop="2066"/>
+ </function>
+
+ <!-- addition to base1.5 -->
+ <enum name="SRC0_RGB" value="0x8580"/>
+ <enum name="SRC1_RGB" value="0x8581"/>
+ <enum name="SRC2_RGB" value="0x8582"/>
+ <enum name="SRC0_ALPHA" value="0x8588"/>
+ <enum name="SRC1_ALPHA" value="0x8589"/>
+ <enum name="SRC2_ALPHA" value="0x858A"/>
+ <enum name="VERTEX_ARRAY_BUFFER_BINDING" count="1" value="0x8896">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="NORMAL_ARRAY_BUFFER_BINDING" count="1" value="0x8897">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="COLOR_ARRAY_BUFFER_BINDING" count="1" value="0x8898">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_COORD_ARRAY_BUFFER_BINDING" count="1" value="0x889A">
+ <size name="Get" mode="get"/>
+ </enum>
+</category>
+
+<!-- OpenGL ES 1.0 -->
+<category name="es1.0">
+ <!-- addition to core1.0 -->
+
+ <!-- from GL_OES_fixed_point -->
+ <enum name="FIXED" value="0x140C"/>
+
+ <type name="fixed" size="4" />
+ <type name="clampx" size="4" />
+
+ <function name="AlphaFuncx" offset="assign">
+ <param name="func" type="GLenum"/>
+ <param name="ref" type="GLclampx"/>
+ </function>
+
+ <function name="ClearColorx" offset="assign">
+ <param name="red" type="GLclampx"/>
+ <param name="green" type="GLclampx"/>
+ <param name="blue" type="GLclampx"/>
+ <param name="alpha" type="GLclampx"/>
+ </function>
+
+ <function name="ClearDepthx" offset="assign">
+ <param name="depth" type="GLclampx"/>
+ </function>
+
+ <function name="Color4x" offset="assign">
+ <param name="red" type="GLfixed"/>
+ <param name="green" type="GLfixed"/>
+ <param name="blue" type="GLfixed"/>
+ <param name="alpha" type="GLfixed"/>
+ </function>
+
+ <function name="DepthRangex" offset="assign">
+ <param name="zNear" type="GLclampx"/>
+ <param name="zFar" type="GLclampx"/>
+ </function>
+
+ <function name="Fogx" offset="assign">
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfixed"/>
+ </function>
+
+ <function name="Fogxv" offset="assign">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfixed *" variable_param="pname"/>
+ </function>
+
+ <function name="Frustumx" offset="assign">
+ <param name="left" type="GLfixed"/>
+ <param name="right" type="GLfixed"/>
+ <param name="bottom" type="GLfixed"/>
+ <param name="top" type="GLfixed"/>
+ <param name="zNear" type="GLfixed"/>
+ <param name="zFar" type="GLfixed"/>
+ </function>
+
+ <function name="LightModelx" offset="assign">
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfixed"/>
+ </function>
+
+ <function name="LightModelxv" offset="assign">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfixed *" variable_param="pname"/>
+ </function>
+
+ <function name="Lightx" offset="assign">
+ <param name="light" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfixed"/>
+ </function>
+
+ <function name="Lightxv" offset="assign">
+ <param name="light" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfixed *" variable_param="pname"/>
+ </function>
+
+ <function name="LineWidthx" offset="assign">
+ <param name="width" type="GLfixed"/>
+ </function>
+
+ <function name="LoadMatrixx" offset="assign">
+ <param name="m" type="const GLfixed *" count="16"/>
+ </function>
+
+ <function name="Materialx" offset="assign">
+ <param name="face" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfixed"/>
+ </function>
+
+ <function name="Materialxv" offset="assign">
+ <param name="face" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfixed *" variable_param="pname"/>
+ </function>
+
+ <function name="MultMatrixx" offset="assign">
+ <param name="m" type="const GLfixed *" count="16"/>
+ </function>
+
+ <function name="MultiTexCoord4x" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLfixed"/>
+ <param name="t" type="GLfixed"/>
+ <param name="r" type="GLfixed"/>
+ <param name="q" type="GLfixed"/>
+ </function>
+
+ <function name="Normal3x" offset="assign">
+ <param name="nx" type="GLfixed"/>
+ <param name="ny" type="GLfixed"/>
+ <param name="nz" type="GLfixed"/>
+ </function>
+
+ <function name="Orthox" offset="assign">
+ <param name="left" type="GLfixed"/>
+ <param name="right" type="GLfixed"/>
+ <param name="bottom" type="GLfixed"/>
+ <param name="top" type="GLfixed"/>
+ <param name="zNear" type="GLfixed"/>
+ <param name="zFar" type="GLfixed"/>
+ </function>
+
+ <function name="PointSizex" offset="assign">
+ <param name="size" type="GLfixed"/>
+ </function>
+
+ <function name="PolygonOffsetx" offset="assign">
+ <param name="factor" type="GLfixed"/>
+ <param name="units" type="GLfixed"/>
+ </function>
+
+ <function name="Rotatex" offset="assign">
+ <param name="angle" type="GLfixed"/>
+ <param name="x" type="GLfixed"/>
+ <param name="y" type="GLfixed"/>
+ <param name="z" type="GLfixed"/>
+ </function>
+
+ <function name="SampleCoveragex" offset="assign">
+ <param name="value" type="GLclampx"/>
+ <param name="invert" type="GLboolean"/>
+ </function>
+
+ <function name="Scalex" offset="assign">
+ <param name="x" type="GLfixed"/>
+ <param name="y" type="GLfixed"/>
+ <param name="z" type="GLfixed"/>
+ </function>
+
+ <function name="TexEnvx" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfixed"/>
+ </function>
+
+ <function name="TexEnvxv" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfixed *" variable_param="pname"/>
+ </function>
+
+ <function name="TexParameterx" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfixed"/>
+ </function>
+
+ <function name="Translatex" offset="assign">
+ <param name="x" type="GLfixed"/>
+ <param name="y" type="GLfixed"/>
+ <param name="z" type="GLfixed"/>
+ </function>
+
+ <!-- from GL_OES_single_precision -->
+ <function name="ClearDepthf" offset="assign">
+ <param name="depth" type="GLclampf"/>
+ </function>
+
+ <function name="DepthRangef" offset="assign">
+ <param name="zNear" type="GLclampf"/>
+ <param name="zFar" type="GLclampf"/>
+ </function>
+
+ <function name="Frustumf" offset="assign">
+ <param name="left" type="GLfloat"/>
+ <param name="right" type="GLfloat"/>
+ <param name="bottom" type="GLfloat"/>
+ <param name="top" type="GLfloat"/>
+ <param name="zNear" type="GLfloat"/>
+ <param name="zFar" type="GLfloat"/>
+ </function>
+
+ <function name="Orthof" offset="assign">
+ <param name="left" type="GLfloat"/>
+ <param name="right" type="GLfloat"/>
+ <param name="bottom" type="GLfloat"/>
+ <param name="top" type="GLfloat"/>
+ <param name="zNear" type="GLfloat"/>
+ <param name="zFar" type="GLfloat"/>
+ </function>
+</category>
+
+<!-- OpenGL ES 1.1 -->
+<category name="es1.1">
+ <!-- addition to core1.1 -->
+
+ <!-- from GL_OES_fixed_point -->
+ <function name="ClipPlanex" offset="assign">
+ <param name="plane" type="GLenum"/>
+ <param name="equation" type="const GLfixed *" count="4"/>
+ </function>
+
+ <function name="GetClipPlanex" offset="assign">
+ <param name="plane" type="GLenum"/>
+ <param name="equation" type="GLfixed *" output="true" count="4"/>
+ </function>
+
+ <function name="GetFixedv" offset="assign">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfixed *" output="true" variable_param="pname"/>
+ </function>
+
+ <function name="GetLightxv" offset="assign">
+ <param name="light" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfixed *" output="true" variable_param="pname"/>
+ </function>
+
+ <function name="GetMaterialxv" offset="assign">
+ <param name="face" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfixed *" output="true" variable_param="pname"/>
+ </function>
+
+ <function name="GetTexEnvxv" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfixed *" output="true" variable_param="pname"/>
+ </function>
+
+ <function name="GetTexParameterxv" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfixed *" output="true" variable_param="pname"/>
+ </function>
+
+ <function name="PointParameterx" offset="assign">
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfixed"/>
+ </function>
+
+ <function name="PointParameterxv" offset="assign">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfixed *"/>
+ </function>
+
+ <function name="TexParameterxv" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfixed *" variable_param="pname"/>
+ </function>
+
+ <!-- from GL_OES_matrix_get -->
+ <enum name="MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES" value="0x898D"/>
+ <enum name="PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES" value="0x898E"/>
+ <enum name="TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES" value="0x898F"/>
+
+ <!-- from GL_OES_single_precision -->
+ <function name="ClipPlanef" offset="assign">
+ <param name="plane" type="GLenum"/>
+ <param name="equation" type="const GLfloat *" count="4"/>
+ </function>
+
+ <function name="GetClipPlanef" offset="assign">
+ <param name="plane" type="GLenum"/>
+ <param name="equation" type="GLfloat *" output="true" count="4"/>
+ </function>
+</category>
+
+<xi:include href="es1_EXT.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+<xi:include href="es1_COMPAT.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+</OpenGLAPI>
diff --git a/src/mesa/es/glapi/es1_COMPAT.xml b/src/mesa/es/glapi/es1_COMPAT.xml
new file mode 100644
index 0000000000..4fc9223cc0
--- /dev/null
+++ b/src/mesa/es/glapi/es1_COMPAT.xml
@@ -0,0 +1,135 @@
+<?xml version="1.0"?>
+<!DOCTYPE OpenGLAPI SYSTEM "../../glapi/gl_API.dtd">
+
+<OpenGLAPI>
+
+<!-- This file defines the functions that are needed by Mesa. It
+ makes sure the generated glapi headers are compatible with Mesa.
+ It mainly consists of missing functions and aliases in OpenGL ES.
+-->
+
+<xi:include href="es_COMPAT.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+<!-- except for those defined by es_COMPAT.xml, these are also needed -->
+<category name="compat">
+ <!-- OpenGL 1.0 -->
+ <function name="TexGenf" alias="TexGenfOES" static_dispatch="false">
+ <param name="coord" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfloat"/>
+ <glx rop="117"/>
+ </function>
+
+ <function name="TexGenfv" alias="TexGenfvOES" static_dispatch="false">
+ <param name="coord" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *" variable_param="pname"/>
+ <glx rop="118"/>
+ </function>
+
+ <function name="TexGeni" alias="TexGeniOES" static_dispatch="false">
+ <param name="coord" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLint"/>
+ <glx rop="119"/>
+ </function>
+
+ <function name="TexGeniv" alias="TexGenivOES" static_dispatch="false">
+ <param name="coord" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLint *" variable_param="pname"/>
+ <glx rop="120"/>
+ </function>
+
+ <function name="GetTexGenfv" alias="GetTexGenfvOES" static_dispatch="false">
+ <param name="coord" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx sop="133"/>
+ </function>
+
+ <function name="GetTexGeniv" alias="GetTexGenivOES" static_dispatch="false">
+ <param name="coord" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx sop="134"/>
+ </function>
+
+ <!-- OpenGL 1.2 -->
+ <function name="BlendColor" offset="336" static_dispatch="false">
+ <param name="red" type="GLclampf"/>
+ <param name="green" type="GLclampf"/>
+ <param name="blue" type="GLclampf"/>
+ <param name="alpha" type="GLclampf"/>
+ <glx rop="4096"/>
+ </function>
+
+ <function name="BlendEquation" alias="BlendEquationOES" static_dispatch="false">
+ <param name="mode" type="GLenum"/>
+ <glx rop="4097"/>
+ </function>
+
+ <function name="TexImage3D" offset="371" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="internalformat" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="depth" type="GLsizei"/>
+ <param name="border" type="GLint"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_depth="depth" img_format="format" img_type="type" img_target="target" img_null_flag="true" img_pad_dimensions="true"/>
+ <glx rop="4114" large="true"/>
+ </function>
+
+ <function name="TexSubImage3D" offset="372" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="xoffset" type="GLint"/>
+ <param name="yoffset" type="GLint"/>
+ <param name="zoffset" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="depth" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="UNUSED" type="GLuint" padding="true"/>
+ <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_depth="depth" img_xoff="xoffset" img_yoff="yoffset" img_zoff="zoffset" img_format="format" img_type="type" img_target="target" img_pad_dimensions="true"/>
+ <glx rop="4115" large="true"/>
+ </function>
+
+ <function name="CopyTexSubImage3D" offset="373" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="xoffset" type="GLint"/>
+ <param name="yoffset" type="GLint"/>
+ <param name="zoffset" type="GLint"/>
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <glx rop="4123"/>
+ </function>
+
+ <!-- GL_ARB_multitexture -->
+ <function name="ActiveTextureARB" alias="ActiveTexture" static_dispatch="false">
+ <param name="texture" type="GLenum"/>
+ <glx rop="197"/>
+ </function>
+
+ <function name="ClientActiveTextureARB" alias="ClientActiveTexture" static_dispatch="false">
+ <param name="texture" type="GLenum"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="MultiTexCoord4fARB" alias="MultiTexCoord4f" vectorequiv="MultiTexCoord4fvARB" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLfloat"/>
+ <param name="t" type="GLfloat"/>
+ <param name="r" type="GLfloat"/>
+ <param name="q" type="GLfloat"/>
+ </function>
+</category>
+
+</OpenGLAPI>
diff --git a/src/mesa/es/glapi/es1_EXT.xml b/src/mesa/es/glapi/es1_EXT.xml
new file mode 100644
index 0000000000..de4868cfd4
--- /dev/null
+++ b/src/mesa/es/glapi/es1_EXT.xml
@@ -0,0 +1,699 @@
+<?xml version="1.0"?>
+<!DOCTYPE OpenGLAPI SYSTEM "../../glapi/gl_API.dtd">
+
+<!-- OpenGL ES 1.x extensions -->
+
+<OpenGLAPI>
+
+<xi:include href="es_EXT.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+<!-- part of es1.1 extension pack -->
+<category name="GL_OES_blend_equation_separate" number="1">
+ <enum name="BLEND_EQUATION_RGB_OES" count="1" value="0x8009">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="BLEND_EQUATION_ALPHA_OES" count="1" value="0x883D">
+ <size name="Get" mode="get"/>
+ </enum>
+
+ <function name="BlendEquationSeparateOES" offset="assign">
+ <param name="modeRGB" type="GLenum"/>
+ <param name="modeA" type="GLenum"/>
+ <glx rop="4228"/>
+ </function>
+</category>
+
+<!-- part of es1.1 extension pack -->
+<category name="GL_OES_blend_func_separate" number="2">
+ <enum name="BLEND_DST_RGB_OES" count="1" value="0x80C8">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="BLEND_SRC_RGB_OES" count="1" value="0x80C9">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="BLEND_DST_ALPHA_OES" count="1" value="0x80CA">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="BLEND_SRC_ALPHA_OES" count="1" value="0x80CB">
+ <size name="Get" mode="get"/>
+ </enum>
+
+ <function name="BlendFuncSeparateOES" offset="assign">
+ <param name="sfactorRGB" type="GLenum"/>
+ <param name="dfactorRGB" type="GLenum"/>
+ <param name="sfactorAlpha" type="GLenum"/>
+ <param name="dfactorAlpha" type="GLenum"/>
+ <glx rop="4134"/>
+ </function>
+</category>
+
+<!-- part of es1.1 extension pack -->
+<category name="GL_OES_blend_subtract" number="3">
+ <enum name="FUNC_ADD_OES" value="0x8006"/>
+ <enum name="BLEND_EQUATION_OES" count="1" value="0x8009">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="FUNC_SUBTRACT_OES" value="0x800A"/>
+ <enum name="FUNC_REVERSE_SUBTRACT_OES" value="0x800B"/>
+
+ <function name="BlendEquationOES" offset="337">
+ <param name="mode" type="GLenum"/>
+ <glx rop="4097"/>
+ </function>
+</category>
+
+<!-- core addition to es1.0 and later -->
+<category name="GL_OES_byte_coordinates" number="4">
+ <enum name="BYTE" value="0x1400"/>
+</category>
+
+<!-- optional for es1.1 -->
+<category name="GL_OES_draw_texture" number="7">
+ <enum name="TEXTURE_CROP_RECT_OES" value="0x8B9D"/>
+
+ <function name="DrawTexiOES" offset="assign">
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="z" type="GLint"/>
+ <param name="width" type="GLint"/>
+ <param name="height" type="GLint"/>
+ </function>
+
+ <function name="DrawTexivOES" offset="assign">
+ <param name="coords" type="const GLint *" count="5"/>
+ </function>
+
+ <function name="DrawTexfOES" offset="assign">
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ <param name="width" type="GLfloat"/>
+ <param name="height" type="GLfloat"/>
+ </function>
+
+ <function name="DrawTexfvOES" offset="assign">
+ <param name="coords" type="const GLfloat *" count="5"/>
+ </function>
+
+ <function name="DrawTexsOES" offset="assign">
+ <param name="x" type="GLshort"/>
+ <param name="y" type="GLshort"/>
+ <param name="z" type="GLshort"/>
+ <param name="width" type="GLshort"/>
+ <param name="height" type="GLshort"/>
+ </function>
+
+ <function name="DrawTexsvOES" offset="assign">
+ <param name="coords" type="const GLshort *" count="5"/>
+ </function>
+
+ <function name="DrawTexxOES" offset="assign">
+ <param name="x" type="GLfixed"/>
+ <param name="y" type="GLfixed"/>
+ <param name="z" type="GLfixed"/>
+ <param name="width" type="GLfixed"/>
+ <param name="height" type="GLfixed"/>
+ </function>
+
+ <function name="DrawTexxvOES" offset="assign">
+ <param name="coords" type="const GLfixed *" count="5"/>
+ </function>
+
+ <!-- TexParameter{ifx}v is skipped here -->
+</category>
+
+<!-- core addition to es1.0 and later -->
+<category name="GL_OES_fixed_point" number="9">
+ <enum name="FIXED_OES" value="0x140C"/>
+
+ <!-- additon to es1.0 -->
+ <function name="AlphaFuncxOES" alias="AlphaFuncx">
+ <param name="func" type="GLenum"/>
+ <param name="ref" type="GLclampx"/>
+ </function>
+
+ <function name="ClearColorxOES" alias="ClearColorx">
+ <param name="red" type="GLclampx"/>
+ <param name="green" type="GLclampx"/>
+ <param name="blue" type="GLclampx"/>
+ <param name="alpha" type="GLclampx"/>
+ </function>
+
+ <function name="ClearDepthxOES" alias="ClearDepthx">
+ <param name="depth" type="GLclampx"/>
+ </function>
+
+ <function name="Color4xOES" alias="Color4x">
+ <param name="red" type="GLfixed"/>
+ <param name="green" type="GLfixed"/>
+ <param name="blue" type="GLfixed"/>
+ <param name="alpha" type="GLfixed"/>
+ </function>
+
+ <function name="DepthRangexOES" alias="DepthRangex">
+ <param name="zNear" type="GLclampx"/>
+ <param name="zFar" type="GLclampx"/>
+ </function>
+
+ <function name="FogxOES" alias="Fogx">
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfixed"/>
+ </function>
+
+ <function name="FogxvOES" alias="Fogxv">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfixed *" variable_param="pname"/>
+ </function>
+
+ <function name="FrustumxOES" alias="Frustumx">
+ <param name="left" type="GLfixed"/>
+ <param name="right" type="GLfixed"/>
+ <param name="bottom" type="GLfixed"/>
+ <param name="top" type="GLfixed"/>
+ <param name="zNear" type="GLfixed"/>
+ <param name="zFar" type="GLfixed"/>
+ </function>
+
+ <function name="LightModelxOES" alias="LightModelx">
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfixed"/>
+ </function>
+
+ <function name="LightModelxvOES" alias="LightModelxv">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfixed *" variable_param="pname"/>
+ </function>
+
+ <function name="LightxOES" alias="Lightx">
+ <param name="light" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfixed"/>
+ </function>
+
+ <function name="LightxvOES" alias="Lightxv">
+ <param name="light" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfixed *" variable_param="pname"/>
+ </function>
+
+ <function name="LineWidthxOES" alias="LineWidthx">
+ <param name="width" type="GLfixed"/>
+ </function>
+
+ <function name="LoadMatrixxOES" alias="LoadMatrixx">
+ <param name="m" type="const GLfixed *" count="16"/>
+ </function>
+
+ <function name="MaterialxOES" alias="Materialx">
+ <param name="face" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfixed"/>
+ </function>
+
+ <function name="MaterialxvOES" alias="Materialxv">
+ <param name="face" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfixed *" variable_param="pname"/>
+ </function>
+
+ <function name="MultiTexCoord4xOES" alias="MultiTexCoord4x">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLfixed"/>
+ <param name="t" type="GLfixed"/>
+ <param name="r" type="GLfixed"/>
+ <param name="q" type="GLfixed"/>
+ </function>
+
+ <function name="MultMatrixxOES" alias="MultMatrixx">
+ <param name="m" type="const GLfixed *" count="16"/>
+ </function>
+
+ <function name="Normal3xOES" alias="Normal3x">
+ <param name="nx" type="GLfixed"/>
+ <param name="ny" type="GLfixed"/>
+ <param name="nz" type="GLfixed"/>
+ </function>
+
+ <function name="OrthoxOES" alias="Orthox">
+ <param name="left" type="GLfixed"/>
+ <param name="right" type="GLfixed"/>
+ <param name="bottom" type="GLfixed"/>
+ <param name="top" type="GLfixed"/>
+ <param name="zNear" type="GLfixed"/>
+ <param name="zFar" type="GLfixed"/>
+ </function>
+
+ <function name="PointSizexOES" alias="PointSizex">
+ <param name="size" type="GLfixed"/>
+ </function>
+
+ <function name="PolygonOffsetxOES" alias="PolygonOffsetx">
+ <param name="factor" type="GLfixed"/>
+ <param name="units" type="GLfixed"/>
+ </function>
+
+ <function name="RotatexOES" alias="Rotatex">
+ <param name="angle" type="GLfixed"/>
+ <param name="x" type="GLfixed"/>
+ <param name="y" type="GLfixed"/>
+ <param name="z" type="GLfixed"/>
+ </function>
+
+ <function name="SampleCoveragexOES" alias="SampleCoveragex">
+ <param name="value" type="GLclampx"/>
+ <param name="invert" type="GLboolean"/>
+ </function>
+
+ <function name="ScalexOES" alias="Scalex">
+ <param name="x" type="GLfixed"/>
+ <param name="y" type="GLfixed"/>
+ <param name="z" type="GLfixed"/>
+ </function>
+
+ <function name="TexEnvxOES" alias="TexEnvx">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfixed"/>
+ </function>
+
+ <function name="TexEnvxvOES" alias="TexEnvxv">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfixed *" variable_param="pname"/>
+ </function>
+
+ <function name="TexParameterxOES" alias="TexParameterx">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfixed"/>
+ </function>
+
+ <function name="TranslatexOES" alias="Translatex">
+ <param name="x" type="GLfixed"/>
+ <param name="y" type="GLfixed"/>
+ <param name="z" type="GLfixed"/>
+ </function>
+
+ <!-- additon to es1.1 -->
+ <function name="ClipPlanexOES" alias="ClipPlanex">
+ <param name="plane" type="GLenum"/>
+ <param name="equation" type="const GLfixed *" count="4"/>
+ </function>
+
+ <function name="GetClipPlanexOES" alias="GetClipPlanex">
+ <param name="plane" type="GLenum"/>
+ <param name="equation" type="GLfixed *" output="true" count="4"/>
+ </function>
+
+ <function name="GetFixedvOES" alias="GetFixedv">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfixed *" output="true" variable_param="pname"/>
+ </function>
+
+ <function name="GetLightxvOES" alias="GetLightxv">
+ <param name="light" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfixed *" output="true" variable_param="pname"/>
+ </function>
+
+ <function name="GetMaterialxvOES" alias="GetMaterialxv">
+ <param name="face" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfixed *" output="true" variable_param="pname"/>
+ </function>
+
+ <function name="GetTexEnvxvOES" alias="GetTexEnvxv">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfixed *" output="true" variable_param="pname"/>
+ </function>
+
+ <function name="GetTexParameterxvOES" alias="GetTexParameterxv">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfixed *" output="true" variable_param="pname"/>
+ </function>
+
+ <function name="PointParameterxOES" alias="PointParameterx">
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfixed"/>
+ </function>
+
+ <function name="PointParameterxvOES" alias="PointParameterxv">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfixed *"/>
+ </function>
+
+ <function name="TexParameterxvOES" alias="TexParameterxv">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfixed *" variable_param="pname"/>
+ </function>
+</category>
+
+<!-- part of es1.1 extension pack -->
+<category name="GL_OES_framebuffer_object" number="10">
+ <enum name="NONE_OES" value="0"/>
+ <enum name="INVALID_FRAMEBUFFER_OPERATION_OES" value="0x0506"/>
+ <enum name="RGBA4_OES" value="0x8056"/>
+ <enum name="RGB5_A1_OES" value="0x8057"/>
+ <enum name="DEPTH_COMPONENT16_OES" value="0x81A5"/>
+
+ <enum name="MAX_RENDERBUFFER_SIZE_OES" value="0x84E8"/>
+ <enum name="FRAMEBUFFER_BINDING_OES" value="0x8CA6"/>
+ <enum name="RENDERBUFFER_BINDING_OES" value="0x8CA7"/>
+ <enum name="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_OES" value="0x8CD0"/>
+ <enum name="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_OES" value="0x8CD1"/>
+ <enum name="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_OES" value="0x8CD2"/>
+ <enum name="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_OES" value="0x8CD3"/>
+ <enum name="FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES" value="0x8CD4"/>
+ <enum name="FRAMEBUFFER_COMPLETE_OES" value="0x8CD5"/>
+ <enum name="FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES" value="0x8CD6"/>
+ <enum name="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_OES" value="0x8CD7"/>
+ <enum name="FRAMEBUFFER_INCOMPLETE_DIMENSIONS_OES" value="0x8CD9"/>
+ <enum name="FRAMEBUFFER_INCOMPLETE_FORMATS_OES" value="0x8CDA"/>
+ <enum name="FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_OES" value="0x8CDB"/>
+ <enum name="FRAMEBUFFER_INCOMPLETE_READ_BUFFER_OES" value="0x8CDC"/>
+ <enum name="FRAMEBUFFER_UNSUPPORTED_OES" value="0x8CDD"/>
+ <enum name="COLOR_ATTACHMENT0_OES" value="0x8CE0"/>
+ <enum name="DEPTH_ATTACHMENT_OES" value="0x8D00"/>
+ <enum name="STENCIL_ATTACHMENT_OES" value="0x8D20"/>
+ <enum name="FRAMEBUFFER_OES" value="0x8D40"/>
+ <enum name="RENDERBUFFER_OES" value="0x8D41"/>
+ <enum name="RENDERBUFFER_WIDTH_OES" value="0x8D42"/>
+ <enum name="RENDERBUFFER_HEIGHT_OES" value="0x8D43"/>
+ <enum name="RENDERBUFFER_INTERNAL_FORMAT_OES" value="0x8D44"/>
+ <enum name="STENCIL_INDEX1_OES" value="0x8D46"/>
+ <enum name="STENCIL_INDEX4_OES" value="0x8D47"/>
+ <enum name="STENCIL_INDEX8_OES" value="0x8D48"/>
+ <enum name="RENDERBUFFER_RED_SIZE_OES" value="0x8D50"/>
+ <enum name="RENDERBUFFER_GREEN_SIZE_OES" value="0x8D51"/>
+ <enum name="RENDERBUFFER_BLUE_SIZE_OES" value="0x8D52"/>
+ <enum name="RENDERBUFFER_ALPHA_SIZE_OES" value="0x8D53"/>
+ <enum name="RENDERBUFFER_DEPTH_SIZE_OES" value="0x8D54"/>
+ <enum name="RENDERBUFFER_STENCIL_SIZE_OES" value="0x8D55"/>
+ <enum name="RGB565_OES" value="0x8D62"/>
+
+ <function name="BindFramebufferOES" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="framebuffer" type="GLuint"/>
+ </function>
+
+ <function name="BindRenderbufferOES" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="renderbuffer" type="GLuint"/>
+ </function>
+
+ <function name="CheckFramebufferStatusOES" offset="assign">
+ <param name="target" type="GLenum"/>
+ <return type="GLenum"/>
+ </function>
+
+ <function name="DeleteFramebuffersOES" offset="assign">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="framebuffers" type="const GLuint *" count="n"/>
+ </function>
+
+ <function name="DeleteRenderbuffersOES" offset="assign">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="renderbuffers" type="const GLuint *" count="n"/>
+ </function>
+
+ <function name="FramebufferRenderbufferOES" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="attachment" type="GLenum"/>
+ <param name="renderbuffertarget" type="GLenum"/>
+ <param name="renderbuffer" type="GLuint"/>
+ </function>
+
+ <function name="FramebufferTexture2DOES" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="attachment" type="GLenum"/>
+ <param name="textarget" type="GLenum"/>
+ <param name="texture" type="GLuint"/>
+ <param name="level" type="GLint"/>
+ </function>
+
+ <function name="GenerateMipmapOES" offset="assign">
+ <param name="target" type="GLenum"/>
+ </function>
+
+ <function name="GenFramebuffersOES" offset="assign">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="framebuffers" type="GLuint *" count="n" output="true"/>
+ </function>
+
+ <function name="GenRenderbuffersOES" offset="assign">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="renderbuffers" type="GLuint *" count="n" output="true"/>
+ </function>
+
+ <function name="GetFramebufferAttachmentParameterivOES" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="attachment" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true"/>
+ </function>
+
+ <function name="GetRenderbufferParameterivOES" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true"/>
+ </function>
+
+ <function name="IsFramebufferOES" offset="assign">
+ <param name="framebuffer" type="GLuint"/>
+ <return type="GLboolean"/>
+ </function>
+
+ <function name="IsRenderbufferOES" offset="assign">
+ <param name="renderbuffer" type="GLuint"/>
+ <return type="GLboolean"/>
+ </function>
+
+ <function name="RenderbufferStorageOES" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ </function>
+</category>
+
+<!-- core addition to es1.1 -->
+<category name="GL_OES_matrix_get" number="11">
+ <enum name="MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES" value="0x898D"/>
+ <enum name="PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES" value="0x898E"/>
+ <enum name="TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES" value="0x898F"/>
+</category>
+
+<!-- optional for es1.1 -->
+<category name="GL_OES_matrix_palette" number="12">
+ <enum name="MAX_VERTEX_UNITS_OES" value="0x86A4"/>
+ <enum name="WEIGHT_ARRAY_TYPE_OES" value="0x86A9"/>
+ <enum name="WEIGHT_ARRAY_STRIDE_OES" value="0x86AA"/>
+ <enum name="WEIGHT_ARRAY_SIZE_OES" value="0x86AB"/>
+ <enum name="WEIGHT_ARRAY_POINTER_OES" value="0x86AC"/>
+ <enum name="WEIGHT_ARRAY_OES" value="0x86AD"/>
+ <enum name="MATRIX_PALETTE_OES" value="0x8840"/>
+ <enum name="MAX_PALETTE_MATRICES_OES" value="0x8842"/>
+ <enum name="CURRENT_PALETTE_MATRIX_OES" value="0x8843"/>
+ <enum name="MATRIX_INDEX_ARRAY_OES" value="0x8844"/>
+ <enum name="MATRIX_INDEX_ARRAY_SIZE_OES" value="0x8846"/>
+ <enum name="MATRIX_INDEX_ARRAY_TYPE_OES" value="0x8847"/>
+ <enum name="MATRIX_INDEX_ARRAY_STRIDE_OES" value="0x8848"/>
+ <enum name="MATRIX_INDEX_ARRAY_POINTER_OES" value="0x8849"/>
+ <enum name="WEIGHT_ARRAY_BUFFER_BINDING_OES" value="0x889E"/>
+ <enum name="MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES" value="0x8B9E"/>
+
+ <function name="CurrentPaletteMatrixOES">
+ <param name="matrixpaletteindex" type="GLuint"/>
+ </function>
+
+ <function name="LoadPaletteFromModelViewMatrixOES">
+ </function>
+
+ <function name="MatrixIndexPointerOES">
+ <param name="size" type="GLint"/>
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ </function>
+
+ <function name="WeightPointerOES">
+ <param name="size" type="GLint"/>
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ </function>
+</category>
+
+<!-- required for es1.1 -->
+<category name="GL_OES_point_size_array" number="14">
+ <enum name="POINT_SIZE_ARRAY_TYPE_OES" value="0x898A"/>
+ <enum name="POINT_SIZE_ARRAY_STRIDE_OES" value="0x898B"/>
+ <enum name="POINT_SIZE_ARRAY_POINTER_OES" value="0x898C"/>
+ <enum name="POINT_SIZE_ARRAY_OES" value="0x8B9C"/>
+ <enum name="POINT_SIZE_ARRAY_BUFFER_BINDING_OES" value="0x8B9F"/>
+
+ <function name="PointSizePointerOES" offset="assign">
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ </function>
+</category>
+
+<!-- required for es1.1 -->
+<category name="GL_OES_point_sprite" number="15">
+ <enum name="POINT_SPRITE_OES" value="0x8861"/>
+ <enum name="COORD_REPLACE_OES" value="0x8862"/>
+</category>
+
+<!-- optional for es1.0 -->
+<category name="GL_OES_query_matrix" number="16">
+ <function name="QueryMatrixxOES" offset="assign">
+ <param name="mantissa" type="GLfixed *" count="16" />
+ <param name="exponent" type="GLint *" count="16" />
+ <return type="GLbitfield"/>
+ </function>
+</category>
+
+<!-- required for es1.0 and later -->
+<category name="GL_OES_read_format" number="17">
+ <enum name="IMPLEMENTATION_COLOR_READ_TYPE_OES" value="0x8B9A"/>
+ <enum name="IMPLEMENTATION_COLOR_READ_FORMAT_OES" value="0x8B9B"/>
+</category>
+
+<!-- core addition to es1.0 and later -->
+<category name="GL_OES_single_precision" number="18">
+ <!-- additon to es1.0 -->
+ <function name="ClearDepthfOES" alias="ClearDepthf">
+ <param name="depth" type="GLclampf"/>
+ </function>
+
+ <function name="DepthRangefOES" alias="DepthRangef">
+ <param name="zNear" type="GLclampf"/>
+ <param name="zFar" type="GLclampf"/>
+ </function>
+
+ <function name="FrustumfOES" alias="Frustumf">
+ <param name="left" type="GLfloat"/>
+ <param name="right" type="GLfloat"/>
+ <param name="bottom" type="GLfloat"/>
+ <param name="top" type="GLfloat"/>
+ <param name="zNear" type="GLfloat"/>
+ <param name="zFar" type="GLfloat"/>
+ </function>
+
+ <function name="OrthofOES" alias="Orthof">
+ <param name="left" type="GLfloat"/>
+ <param name="right" type="GLfloat"/>
+ <param name="bottom" type="GLfloat"/>
+ <param name="top" type="GLfloat"/>
+ <param name="zNear" type="GLfloat"/>
+ <param name="zFar" type="GLfloat"/>
+ </function>
+
+ <!-- additon to es1.1 -->
+ <function name="ClipPlanefOES" alias="ClipPlanef">
+ <param name="plane" type="GLenum"/>
+ <param name="equation" type="const GLfloat *" count="4"/>
+ </function>
+
+ <function name="GetClipPlanefOES" alias="GetClipPlanef">
+ <param name="plane" type="GLenum"/>
+ <param name="equation" type="GLfloat *" output="true" count="4"/>
+ </function>
+</category>
+
+<!-- part of es1.1 extension pack -->
+<category name="GL_OES_texture_cube_map" number="20">
+ <enum name="TEXTURE_GEN_MODE_OES" value="0x2500"/>
+ <enum name="NORMAL_MAP_OES" value="0x8511"/>
+ <enum name="REFLECTION_MAP_OES" value="0x8512"/>
+ <enum name="TEXTURE_CUBE_MAP_OES" value="0x8513"/>
+ <enum name="TEXTURE_BINDING_CUBE_MAP_OES" value="0x8514"/>
+ <enum name="TEXTURE_CUBE_MAP_POSITIVE_X_OES" value="0x8515"/>
+ <enum name="TEXTURE_CUBE_MAP_NEGATIVE_X_OES" value="0x8516"/>
+ <enum name="TEXTURE_CUBE_MAP_POSITIVE_Y_OES" value="0x8517"/>
+ <enum name="TEXTURE_CUBE_MAP_NEGATIVE_Y_OES" value="0x8518"/>
+ <enum name="TEXTURE_CUBE_MAP_POSITIVE_Z_OES" value="0x8519"/>
+ <enum name="TEXTURE_CUBE_MAP_NEGATIVE_Z_OES" value="0x851A"/>
+ <enum name="MAX_CUBE_MAP_TEXTURE_SIZE_OES" value="0x851C"/>
+ <enum name="TEXTURE_GEN_STR_OES" value="0x8D60"/>
+
+ <function name="GetTexGenfvOES" offset="279">
+ <param name="coord" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx sop="133"/>
+ </function>
+
+ <function name="GetTexGenivOES" offset="280">
+ <param name="coord" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx sop="134"/>
+ </function>
+
+ <function name="GetTexGenxvOES" offset="assign">
+ <param name="coord" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfixed *" output="true" variable_param="pname"/>
+ </function>
+
+ <function name="TexGenfOES" offset="190">
+ <param name="coord" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfloat"/>
+ <glx rop="117"/>
+ </function>
+
+ <function name="TexGenfvOES" offset="191">
+ <param name="coord" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *" variable_param="pname"/>
+ <glx rop="118"/>
+ </function>
+
+ <function name="TexGeniOES" offset="192">
+ <param name="coord" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLint"/>
+ <glx rop="119"/>
+ </function>
+
+ <function name="TexGenivOES" offset="193">
+ <param name="coord" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLint *" variable_param="pname"/>
+ <glx rop="120"/>
+ </function>
+
+ <function name="TexGenxOES" offset="assign">
+ <param name="coord" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLint"/>
+ </function>
+
+ <function name="TexGenxvOES" offset="assign">
+ <param name="coord" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfixed *" variable_param="pname"/>
+ </function>
+</category>
+
+<category name="GL_OES_texture_env_crossbar" number="21">
+ <!-- No new functions, types, enums. -->
+</category>
+
+<category name="GL_OES_texture_mirrored_repeat" number="22">
+ <!-- No new functions, types, enums. -->
+</category>
+
+<category name="GL_EXT_texture_lod_bias" number="60">
+ <enum name="TEXTURE_FILTER_CONTROL_EXT" value="0x8500"/>
+ <enum name="TEXTURE_LOD_BIAS_EXT" value="0x8501"/>
+ <enum name="MAX_TEXTURE_LOD_BIAS_EXT" value="0x84FD"/>
+</category>
+
+</OpenGLAPI>
diff --git a/src/mesa/es/glapi/es2_API.xml b/src/mesa/es/glapi/es2_API.xml
new file mode 100644
index 0000000000..266c07613c
--- /dev/null
+++ b/src/mesa/es/glapi/es2_API.xml
@@ -0,0 +1,294 @@
+<?xml version="1.0"?>
+<!DOCTYPE OpenGLAPI SYSTEM "../../glapi/gl_API.dtd">
+
+<!-- OpenGL ES 2.x API -->
+
+<OpenGLAPI>
+
+<xi:include href="base2_API.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+<!-- core subset of OpenGL 2.0 defined in OpenGL ES 2.0 -->
+<category name="core2.0">
+ <!-- addition to base1.0 -->
+ <enum name="NONE" value="0x0"/>
+ <enum name="INT" count="4" value="0x1404">
+ <size name="CallLists"/>
+ </enum>
+ <enum name="UNSIGNED_INT" count="4" value="0x1405">
+ <size name="CallLists"/>
+ </enum>
+ <enum name="STENCIL_INDEX" value="0x1901"/>
+ <enum name="DEPTH_COMPONENT" value="0x1902"/>
+
+ <function name="TexImage2D" offset="183">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="internalformat" type="GLint"/> <!-- XXX the actual type is GLenum... -->
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="border" type="GLint"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_format="format" img_type="type" img_target="target" img_send_null="true" img_pad_dimensions="true"/>
+ <glx rop="110" large="true"/>
+ </function>
+
+ <!-- addition to base1.1 -->
+ <enum name="RGBA4" value="0x8056"/>
+ <enum name="RGB5_A1" value="0x8057"/>
+
+ <!-- addition to base1.2 -->
+ <enum name="CONSTANT_COLOR" value="0x8001"/>
+ <enum name="ONE_MINUS_CONSTANT_COLOR" value="0x8002"/>
+ <enum name="CONSTANT_ALPHA" value="0x8003"/>
+ <enum name="ONE_MINUS_CONSTANT_ALPHA" value="0x8004"/>
+ <enum name="BLEND_COLOR" count="4" value="0x8005">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="FUNC_ADD" value="0x8006"/>
+ <enum name="BLEND_EQUATION" count="1" value="0x8009">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="FUNC_SUBTRACT" value="0x800A"/>
+ <enum name="FUNC_REVERSE_SUBTRACT" value="0x800B"/>
+
+ <function name="BlendColor" offset="336">
+ <param name="red" type="GLclampf"/>
+ <param name="green" type="GLclampf"/>
+ <param name="blue" type="GLclampf"/>
+ <param name="alpha" type="GLclampf"/>
+ <glx rop="4096"/>
+ </function>
+
+ <function name="BlendEquation" offset="337">
+ <param name="mode" type="GLenum"/>
+ <glx rop="4097"/>
+ </function>
+
+ <!-- addition to base1.3 -->
+ <enum name="TEXTURE_CUBE_MAP" count="1" value="0x8513">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_BINDING_CUBE_MAP" count="1" value="0x8514">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_CUBE_MAP_POSITIVE_X" value="0x8515"/>
+ <enum name="TEXTURE_CUBE_MAP_NEGATIVE_X" value="0x8516"/>
+ <enum name="TEXTURE_CUBE_MAP_POSITIVE_Y" value="0x8517"/>
+ <enum name="TEXTURE_CUBE_MAP_NEGATIVE_Y" value="0x8518"/>
+ <enum name="TEXTURE_CUBE_MAP_POSITIVE_Z" value="0x8519"/>
+ <enum name="TEXTURE_CUBE_MAP_NEGATIVE_Z" value="0x851A"/>
+ <enum name="MAX_CUBE_MAP_TEXTURE_SIZE" count="1" value="0x851C">
+ <size name="Get" mode="get"/>
+ </enum>
+
+ <!-- addition to base1.4 -->
+ <enum name="BLEND_DST_RGB" count="1" value="0x80C8">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="BLEND_SRC_RGB" count="1" value="0x80C9">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="BLEND_DST_ALPHA" count="1" value="0x80CA">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="BLEND_SRC_ALPHA" count="1" value="0x80CB">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DEPTH_COMPONENT16" value="0x81A5"/>
+ <enum name="MIRRORED_REPEAT" value="0x8370"/>
+ <enum name="INCR_WRAP" value="0x8507"/>
+ <enum name="DECR_WRAP" value="0x8508"/>
+
+ <function name="BlendFuncSeparate" offset="assign">
+ <param name="sfactorRGB" type="GLenum"/>
+ <param name="dfactorRGB" type="GLenum"/>
+ <param name="sfactorAlpha" type="GLenum"/>
+ <param name="dfactorAlpha" type="GLenum"/>
+ <glx rop="4134"/>
+ </function>
+
+ <!-- addition to base1.5 -->
+ <enum name="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING" count="1" value="0x889F">
+ <size name="GetVertexAttribdv" mode="get"/>
+ <size name="GetVertexAttribfv" mode="get"/>
+ <size name="GetVertexAttribiv" mode="get"/>
+ </enum>
+ <enum name="STREAM_DRAW" value="0x88E0"/>
+
+ <!-- addition to base2.0 -->
+ <!-- base2.0 should have everything defined -->
+</category>
+
+<!-- OpenGL ES 2.0 -->
+<category name="es2.0">
+ <!-- addition to core2.0 -->
+ <enum name="LOW_FLOAT" value="0x8DF0"/>
+ <enum name="MEDIUM_FLOAT" value="0x8DF1"/>
+ <enum name="HIGH_FLOAT" value="0x8DF2"/>
+ <enum name="LOW_INT" value="0x8DF3"/>
+ <enum name="MEDIUM_INT" value="0x8DF4"/>
+ <enum name="HIGH_INT" value="0x8DF5"/>
+ <enum name="SHADER_BINARY_FORMATS" value="0x8DF8"/>
+ <enum name="NUM_SHADER_BINARY_FORMATS" value="0x8DF9"/>
+ <enum name="SHADER_COMPILER" value="0x8DFA"/>
+ <enum name="MAX_VERTEX_UNIFORM_VECTORS" value="0x8DFB"/>
+ <enum name="MAX_VARYING_VECTORS" value="0x8DFC"/>
+ <enum name="MAX_FRAGMENT_UNIFORM_VECTORS" value="0x8DFD"/>
+
+ <function name="GetShaderPrecisionFormat" offset="assign">
+ <param name="shadertype" type="GLenum"/>
+ <param name="precisiontype" type="GLenum"/>
+ <param name="range" type="GLint *"/>
+ <param name="precision" type="GLint *"/>
+ </function>
+
+ <function name="ReleaseShaderCompiler" offset="assign">
+ </function>
+
+ <function name="ShaderBinary" offset="assign">
+ <param name="n" type="GLsizei"/>
+ <param name="shaders" type="const GLuint *"/>
+ <param name="binaryformat" type="GLenum"/>
+ <param name="binary" type="const GLvoid *"/>
+ <param name="length" type="GLsizei"/>
+ </function>
+
+ <!-- from GL_OES_fixed_point -->
+ <enum name="FIXED" value="0x140C"/>
+ <type name="fixed" size="4" />
+
+ <!-- from GL_OES_framebuffer_object -->
+ <enum name="INVALID_FRAMEBUFFER_OPERATION" value="0x0506"/>
+ <enum name="MAX_RENDERBUFFER_SIZE" value="0x84E8"/>
+ <enum name="FRAMEBUFFER_BINDING" value="0x8CA6"/>
+ <enum name="RENDERBUFFER_BINDING" value="0x8CA7"/>
+ <enum name="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE" value="0x8CD0"/>
+ <enum name="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME" value="0x8CD1"/>
+ <enum name="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL" value="0x8CD2"/>
+ <enum name="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE" value="0x8CD3"/>
+ <enum name="FRAMEBUFFER_COMPLETE" value="0x8CD5"/>
+ <enum name="FRAMEBUFFER_INCOMPLETE_ATTACHMENT" value="0x8CD6"/>
+ <enum name="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT" value="0x8CD7"/>
+ <enum name="FRAMEBUFFER_INCOMPLETE_DIMENSIONS" value="0x8CD9"/>
+ <enum name="FRAMEBUFFER_UNSUPPORTED" value="0x8CDD"/>
+ <enum name="COLOR_ATTACHMENT0" value="0x8CE0"/>
+ <enum name="DEPTH_ATTACHMENT" value="0x8D00"/>
+ <enum name="STENCIL_ATTACHMENT" value="0x8D20"/>
+ <enum name="FRAMEBUFFER" value="0x8D40"/>
+ <enum name="RENDERBUFFER" value="0x8D41"/>
+ <enum name="RENDERBUFFER_WIDTH" value="0x8D42"/>
+ <enum name="RENDERBUFFER_HEIGHT" value="0x8D43"/>
+ <enum name="RENDERBUFFER_INTERNAL_FORMAT" value="0x8D44"/>
+ <enum name="STENCIL_INDEX8" value="0x8D48"/>
+ <enum name="RENDERBUFFER_RED_SIZE" value="0x8D50"/>
+ <enum name="RENDERBUFFER_GREEN_SIZE" value="0x8D51"/>
+ <enum name="RENDERBUFFER_BLUE_SIZE" value="0x8D52"/>
+ <enum name="RENDERBUFFER_ALPHA_SIZE" value="0x8D53"/>
+ <enum name="RENDERBUFFER_DEPTH_SIZE" value="0x8D54"/>
+ <enum name="RENDERBUFFER_STENCIL_SIZE" value="0x8D55"/>
+ <enum name="RGB565" value="0x8D62"/>
+
+ <function name="BindFramebuffer" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="framebuffer" type="GLuint"/>
+ </function>
+
+ <function name="BindRenderbuffer" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="renderbuffer" type="GLuint"/>
+ </function>
+
+ <function name="CheckFramebufferStatus" offset="assign">
+ <param name="target" type="GLenum"/>
+ <return type="GLenum"/>
+ </function>
+
+ <function name="DeleteFramebuffers" offset="assign">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="framebuffers" type="const GLuint *" count="n"/>
+ </function>
+
+ <function name="DeleteRenderbuffers" offset="assign">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="renderbuffers" type="const GLuint *" count="n"/>
+ </function>
+
+ <function name="FramebufferRenderbuffer" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="attachment" type="GLenum"/>
+ <param name="renderbuffertarget" type="GLenum"/>
+ <param name="renderbuffer" type="GLuint"/>
+ </function>
+
+ <function name="FramebufferTexture2D" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="attachment" type="GLenum"/>
+ <param name="textarget" type="GLenum"/>
+ <param name="texture" type="GLuint"/>
+ <param name="level" type="GLint"/>
+ </function>
+
+ <function name="GenerateMipmap" offset="assign">
+ <param name="target" type="GLenum"/>
+ </function>
+
+ <function name="GenFramebuffers" offset="assign">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="framebuffers" type="GLuint *" count="n" output="true"/>
+ </function>
+
+ <function name="GenRenderbuffers" offset="assign">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="renderbuffers" type="GLuint *" count="n" output="true"/>
+ </function>
+
+ <function name="GetFramebufferAttachmentParameteriv" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="attachment" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true"/>
+ </function>
+
+ <function name="GetRenderbufferParameteriv" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true"/>
+ </function>
+
+ <function name="IsFramebuffer" offset="assign">
+ <param name="framebuffer" type="GLuint"/>
+ <return type="GLboolean"/>
+ </function>
+
+ <function name="IsRenderbuffer" offset="assign">
+ <param name="renderbuffer" type="GLuint"/>
+ <return type="GLboolean"/>
+ </function>
+
+ <function name="RenderbufferStorage" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ </function>
+
+ <!-- from GL_OES_read_format -->
+ <enum name="IMPLEMENTATION_COLOR_READ_TYPE" value="0x8B9A"/>
+ <enum name="IMPLEMENTATION_COLOR_READ_FORMAT" value="0x8B9B"/>
+
+ <!-- from GL_OES_single_precision -->
+ <function name="ClearDepthf" offset="assign">
+ <param name="depth" type="GLclampf"/>
+ </function>
+
+ <function name="DepthRangef" offset="assign">
+ <param name="zNear" type="GLclampf"/>
+ <param name="zFar" type="GLclampf"/>
+ </function>
+</category>
+
+<xi:include href="es2_EXT.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+<xi:include href="es2_COMPAT.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+</OpenGLAPI>
diff --git a/src/mesa/es/glapi/es2_COMPAT.xml b/src/mesa/es/glapi/es2_COMPAT.xml
new file mode 100644
index 0000000000..61f11a604e
--- /dev/null
+++ b/src/mesa/es/glapi/es2_COMPAT.xml
@@ -0,0 +1,368 @@
+<?xml version="1.0"?>
+<!DOCTYPE OpenGLAPI SYSTEM "../../glapi/gl_API.dtd">
+
+<OpenGLAPI>
+
+<!-- This file defines the functions that are needed by Mesa. It
+ makes sure the generated glapi headers are compatible with Mesa.
+ It mainly consists of missing functions and aliases in OpenGL ES.
+-->
+
+<xi:include href="es_COMPAT.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+<!-- except for those defined by es_COMPAT.xml, these are also needed -->
+<category name="compat">
+ <!-- OpenGL 1.0 -->
+ <function name="Color4f" offset="29" vectorequiv="Color4fv" static_dispatch="false">
+ <param name="red" type="GLfloat"/>
+ <param name="green" type="GLfloat"/>
+ <param name="blue" type="GLfloat"/>
+ <param name="alpha" type="GLfloat"/>
+ </function>
+
+ <function name="Color4ub" offset="35" vectorequiv="Color4ubv" static_dispatch="false">
+ <param name="red" type="GLubyte"/>
+ <param name="green" type="GLubyte"/>
+ <param name="blue" type="GLubyte"/>
+ <param name="alpha" type="GLubyte"/>
+ </function>
+
+ <function name="Normal3f" offset="56" vectorequiv="Normal3fv" static_dispatch="false">
+ <param name="nx" type="GLfloat"/>
+ <param name="ny" type="GLfloat"/>
+ <param name="nz" type="GLfloat"/>
+ </function>
+
+ <function name="Fogf" offset="153" static_dispatch="false">
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfloat"/>
+ <glx rop="80"/>
+ </function>
+
+ <function name="Fogfv" offset="154" static_dispatch="false">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *" variable_param="pname"/>
+ <glx rop="81"/>
+ </function>
+
+ <function name="Lightf" offset="159" static_dispatch="false">
+ <param name="light" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfloat"/>
+ <glx rop="86"/>
+ </function>
+
+ <function name="Lightfv" offset="160" static_dispatch="false">
+ <param name="light" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *" variable_param="pname"/>
+ <glx rop="87"/>
+ </function>
+
+ <function name="LightModelf" offset="163" static_dispatch="false">
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfloat"/>
+ <glx rop="90"/>
+ </function>
+
+ <function name="LightModelfv" offset="164" static_dispatch="false">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *" variable_param="pname"/>
+ <glx rop="91"/>
+ </function>
+
+ <function name="Materialf" offset="169" static_dispatch="false">
+ <param name="face" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfloat"/>
+ <glx rop="96"/>
+ </function>
+
+ <function name="Materialfv" offset="170" static_dispatch="false">
+ <param name="face" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *" variable_param="pname"/>
+ <glx rop="97"/>
+ </function>
+
+ <function name="PointSize" offset="173" static_dispatch="false">
+ <param name="size" type="GLfloat"/>
+ <glx rop="100"/>
+ </function>
+
+ <function name="ShadeModel" offset="177" static_dispatch="false">
+ <param name="mode" type="GLenum"/>
+ <glx rop="104"/>
+ </function>
+
+ <function name="TexEnvf" offset="184" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfloat"/>
+ <glx rop="111"/>
+ </function>
+
+ <function name="TexEnvfv" offset="185" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *" variable_param="pname"/>
+ <glx rop="112"/>
+ </function>
+
+ <function name="TexEnvi" offset="186" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLint"/>
+ <glx rop="113"/>
+ </function>
+
+ <function name="TexEnviv" offset="187" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLint *" variable_param="pname"/>
+ <glx rop="114"/>
+ </function>
+
+ <function name="TexGenf" offset="190" static_dispatch="false">
+ <param name="coord" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfloat"/>
+ <glx rop="117"/>
+ </function>
+
+ <function name="TexGenfv" offset="191" static_dispatch="false">
+ <param name="coord" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *" variable_param="pname"/>
+ <glx rop="118"/>
+ </function>
+
+ <function name="TexGeni" offset="192" static_dispatch="false">
+ <param name="coord" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLint"/>
+ <glx rop="119"/>
+ </function>
+
+ <function name="TexGeniv" offset="193" static_dispatch="false">
+ <param name="coord" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLint *" variable_param="pname"/>
+ <glx rop="120"/>
+ </function>
+
+ <function name="AlphaFunc" offset="240" static_dispatch="false">
+ <param name="func" type="GLenum"/>
+ <param name="ref" type="GLclampf"/>
+ <glx rop="159"/>
+ </function>
+
+ <function name="LogicOp" offset="242" static_dispatch="false">
+ <param name="opcode" type="GLenum"/>
+ <glx rop="161"/>
+ </function>
+
+ <function name="GetLightfv" offset="264" static_dispatch="false">
+ <param name="light" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx sop="118"/>
+ </function>
+
+ <function name="GetMaterialfv" offset="269" static_dispatch="false">
+ <param name="face" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx sop="123"/>
+ </function>
+
+ <function name="GetTexEnvfv" offset="276" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx sop="130"/>
+ </function>
+
+ <function name="GetTexEnviv" offset="277" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx sop="131"/>
+ </function>
+
+ <function name="GetTexGenfv" offset="279" static_dispatch="false">
+ <param name="coord" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx sop="133"/>
+ </function>
+
+ <function name="GetTexGeniv" offset="280" static_dispatch="false">
+ <param name="coord" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx sop="134"/>
+ </function>
+
+ <function name="LoadIdentity" offset="290" static_dispatch="false">
+ <glx rop="176"/>
+ </function>
+
+ <function name="LoadMatrixf" offset="291" static_dispatch="false">
+ <param name="m" type="const GLfloat *" count="16"/>
+ <glx rop="177"/>
+ </function>
+
+ <function name="MatrixMode" offset="293" static_dispatch="false">
+ <param name="mode" type="GLenum"/>
+ <glx rop="179"/>
+ </function>
+
+ <function name="MultMatrixf" offset="294" static_dispatch="false">
+ <param name="m" type="const GLfloat *" count="16"/>
+ <glx rop="180"/>
+ </function>
+
+ <function name="PopMatrix" offset="297" static_dispatch="false">
+ <glx rop="183"/>
+ </function>
+
+ <function name="PushMatrix" offset="298" static_dispatch="false">
+ <glx rop="184"/>
+ </function>
+
+ <function name="Rotatef" offset="300" static_dispatch="false">
+ <param name="angle" type="GLfloat"/>
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ <glx rop="186"/>
+ </function>
+
+ <function name="Scalef" offset="302" static_dispatch="false">
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ <glx rop="188"/>
+ </function>
+
+ <function name="Translatef" offset="304" static_dispatch="false">
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ <glx rop="190"/>
+ </function>
+
+ <!-- OpenGL 1.1 -->
+ <function name="ColorPointer" offset="308" static_dispatch="false">
+ <param name="size" type="GLint"/>
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="DisableClientState" offset="309" static_dispatch="false">
+ <param name="array" type="GLenum"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="EnableClientState" offset="313" static_dispatch="false">
+ <param name="array" type="GLenum"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="NormalPointer" offset="318" static_dispatch="false">
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="TexCoordPointer" offset="320" static_dispatch="false">
+ <param name="size" type="GLint"/>
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="VertexPointer" offset="321" static_dispatch="false">
+ <param name="size" type="GLint"/>
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="GetPointerv" offset="329" static_dispatch="false">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLvoid **" output="true"/>
+ <glx handcode="true"/>
+ </function>
+
+ <!-- OpenGL 1.2 -->
+ <function name="TexImage3D" alias="TexImage3DOES" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="internalformat" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="depth" type="GLsizei"/>
+ <param name="border" type="GLint"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_depth="depth" img_format="format" img_type="type" img_target="target" img_null_flag="true" img_pad_dimensions="true"/>
+ <glx rop="4114" large="true"/>
+ </function>
+
+ <function name="TexSubImage3D" alias="TexSubImage3DOES" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="xoffset" type="GLint"/>
+ <param name="yoffset" type="GLint"/>
+ <param name="zoffset" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="depth" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="UNUSED" type="GLuint" padding="true"/>
+ <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_depth="depth" img_xoff="xoffset" img_yoff="yoffset" img_zoff="zoffset" img_format="format" img_type="type" img_target="target" img_pad_dimensions="true"/>
+ <glx rop="4115" large="true"/>
+ </function>
+
+ <function name="CopyTexSubImage3D" alias="CopyTexSubImage3DOES" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="xoffset" type="GLint"/>
+ <param name="yoffset" type="GLint"/>
+ <param name="zoffset" type="GLint"/>
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <glx rop="4123"/>
+ </function>
+
+ <!-- GL_ARB_multitexture -->
+ <function name="ActiveTextureARB" alias="ActiveTexture" static_dispatch="false">
+ <param name="texture" type="GLenum"/>
+ <glx rop="197"/>
+ </function>
+
+ <function name="ClientActiveTextureARB" offset="375" static_dispatch="false">
+ <param name="texture" type="GLenum"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="MultiTexCoord4fARB" offset="402" vectorequiv="MultiTexCoord4fvARB" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLfloat"/>
+ <param name="t" type="GLfloat"/>
+ <param name="r" type="GLfloat"/>
+ <param name="q" type="GLfloat"/>
+ </function>
+</category>
+
+</OpenGLAPI>
diff --git a/src/mesa/es/glapi/es2_EXT.xml b/src/mesa/es/glapi/es2_EXT.xml
new file mode 100644
index 0000000000..3615772b56
--- /dev/null
+++ b/src/mesa/es/glapi/es2_EXT.xml
@@ -0,0 +1,162 @@
+<?xml version="1.0"?>
+<!DOCTYPE OpenGLAPI SYSTEM "../../glapi/gl_API.dtd">
+
+<!-- OpenGL ES 2.x extensions -->
+
+<OpenGLAPI>
+
+<xi:include href="es_EXT.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+<category name="GL_OES_texture_3D" number="34">
+ <enum name="TEXTURE_BINDING_3D_OES" value="0x806A"/>
+ <enum name="TEXTURE_3D_OES" value="0x806F"/>
+ <enum name="TEXTURE_WRAP_R_OES" value="0x8072"/>
+ <enum name="MAX_3D_TEXTURE_SIZE_OES" value="0x8073"/>
+ <enum name="SAMPLER_3D_OES" value="0x8B5F"/>
+ <enum name="FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES" value="0x8CD4"/>
+
+ <function name="CompressedTexImage3DOES" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="depth" type="GLsizei"/>
+ <param name="border" type="GLint"/>
+ <param name="imageSize" type="GLsizei" counter="true"/>
+ <param name="data" type="const GLvoid *" count="imageSize"/>
+ <glx rop="216" handcode="client"/>
+ </function>
+
+ <function name="CompressedTexSubImage3DOES" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="xoffset" type="GLint"/>
+ <param name="yoffset" type="GLint"/>
+ <param name="zoffset" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="depth" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="imageSize" type="GLsizei" counter="true"/>
+ <param name="data" type="const GLvoid *" count="imageSize"/>
+ <glx rop="219" handcode="client"/>
+ </function>
+
+ <function name="CopyTexSubImage3DOES" offset="373">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="xoffset" type="GLint"/>
+ <param name="yoffset" type="GLint"/>
+ <param name="zoffset" type="GLint"/>
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <glx rop="4123"/>
+ </function>
+
+ <function name="FramebufferTexture3DOES" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="attachment" type="GLenum"/>
+ <param name="textarget" type="GLenum"/>
+ <param name="texture" type="GLuint"/>
+ <param name="level" type="GLint"/>
+ <param name="zoffset" type="GLint"/>
+ <glx rop="4323"/>
+ </function>
+
+ <function name="TexImage3DOES" offset="371">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="depth" type="GLsizei"/>
+ <param name="border" type="GLint"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_depth="depth" img_format="format" img_type="type" img_target="target" img_null_flag="true" img_pad_dimensions="true"/>
+ <glx rop="4114" large="true"/>
+ </function>
+
+ <function name="TexSubImage3DOES" offset="372">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="xoffset" type="GLint"/>
+ <param name="yoffset" type="GLint"/>
+ <param name="zoffset" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="depth" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="UNUSED" type="GLuint" padding="true"/>
+ <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_depth="depth" img_xoff="xoffset" img_yoff="yoffset" img_zoff="zoffset" img_format="format" img_type="type" img_target="target" img_pad_dimensions="true"/>
+ <glx rop="4115" large="true"/>
+ </function>
+</category>
+
+<!-- the other name is OES_texture_float_linear -->
+<category name="OES_texture_half_float_linear" number="35">
+ <!-- No new functions, types, enums. -->
+</category>
+
+<!-- the other name is OES_texture_float -->
+<category name="OES_texture_half_float" number="36">
+ <enum name="HALF_FLOAT_OES" value="0x8D61"/>
+</category>
+
+<category name="GL_OES_texture_npot" number="37">
+ <!-- No new functions, types, enums. -->
+</category>
+
+<category name="GL_OES_vertex_half_float" number="38">
+ <enum name="HALF_FLOAT_OES" value="0x8D61"/>
+</category>
+
+<category name="GL_EXT_texture_type_2_10_10_10_REV" number="42">
+ <enum name="UNSIGNED_INT_2_10_10_10_REV_EXT" value="0x8368"/>
+</category>
+
+<category name="GL_OES_packed_depth_stencil" number="43">
+ <enum name="DEPTH_STENCIL_OES" value="0x84F9"/>
+ <enum name="UNSIGNED_INT_24_8_OES" value="0x84FA"/>
+ <enum name="DEPTH24_STENCIL8_OES" value="0x88F0"/>
+</category>
+
+<category name="GL_OES_depth_texture" number="44">
+ <!-- No new functions, types, enums. -->
+</category>
+
+<category name="GL_OES_standard_derivatives" number="45">
+ <enum name="FRAGMENT_SHADER_DERIVATIVE_HINT_OES" value="0x8B8B"/>
+</category>
+
+<category name="GL_OES_vertex_type_10_10_10_2" number="46">
+ <enum name="UNSIGNED_INT_10_10_10_2_OES" value="0x8DF6"/>
+ <enum name="INT_10_10_10_2_OES" value="0x8DF7"/>
+</category>
+
+<category name="GL_OES_get_program_binary" number="47">
+ <enum name="PROGRAM_BINARY_LENGTH_OES" value="0x8741"/>
+ <enum name="NUM_PROGRAM_BINARY_FORMATS_OES" value="0x87FE"/>
+ <enum name="PROGRAM_BINARY_FORMATS_OES" value="0x87FF"/>
+
+ <function name="GetProgramBinaryOES" offset="assign">
+ <param name="program" type="GLuint"/>
+ <param name="bufSize" type="GLsizei"/>
+ <param name="length" type="GLsizei *"/>
+ <param name="binaryFormat" type="GLenum *"/>
+ <param name="binary" type="GLvoid *"/>
+ </function>
+
+ <function name="ProgramBinaryOES" offset="assign">
+ <param name="program" type="GLuint"/>
+ <param name="binaryFormat" type="GLenum"/>
+ <param name="binary" type="const GLvoid *"/>
+ <param name="length" type="GLint"/>
+ </function>
+</category>
+
+</OpenGLAPI>
diff --git a/src/mesa/es/glapi/es_COMPAT.xml b/src/mesa/es/glapi/es_COMPAT.xml
new file mode 100644
index 0000000000..bb6d28db83
--- /dev/null
+++ b/src/mesa/es/glapi/es_COMPAT.xml
@@ -0,0 +1,2646 @@
+<?xml version="1.0"?>
+<!DOCTYPE OpenGLAPI SYSTEM "../../glapi/gl_API.dtd">
+
+<OpenGLAPI>
+
+<!-- This file defines the following categories
+
+ a subset of 1.0
+ a subset of 1.1
+ a subset of 1.2
+ a subset of GL_ARB_multitexture
+ GL_APPLE_vertex_array_object
+
+ to make sure the generated glapi headers are compatible with Mesa.
+ It is included by es1_COMPAT.xml and es2_COMPAT.xml.
+-->
+
+<category name="1.0">
+ <type name="double" size="8" float="true" glx_name="FLOAT64"/>
+ <type name="clampd" size="8" float="true" glx_name="FLOAT64"/>
+
+ <type name="float" size="4" float="true" glx_name="FLOAT32"/>
+ <type name="clampf" size="4" float="true" glx_name="FLOAT32"/>
+
+ <type name="int" size="4" glx_name="CARD32"/>
+ <type name="uint" size="4" unsigned="true" glx_name="CARD32"/>
+ <type name="sizei" size="4" unsigned="true" glx_name="CARD32"/>
+ <type name="enum" size="4" unsigned="true" glx_name="ENUM"/>
+ <type name="bitfield" size="4" unsigned="true" glx_name="CARD32"/>
+
+ <type name="short" size="2" glx_name="CARD16"/>
+ <type name="ushort" size="2" unsigned="true" glx_name="CARD16"/>
+
+ <type name="byte" size="1" glx_name="CARD8"/>
+ <type name="ubyte" size="1" unsigned="true" glx_name="CARD8"/>
+ <type name="boolean" size="1" unsigned="true" glx_name="CARD8"/>
+
+ <type name="void" size="1"/>
+
+ <function name="NewList" offset="0" static_dispatch="false">
+ <param name="list" type="GLuint"/>
+ <param name="mode" type="GLenum"/>
+ <glx sop="101"/>
+ </function>
+
+ <function name="EndList" offset="1" static_dispatch="false">
+ <glx sop="102"/>
+ </function>
+
+ <function name="CallList" offset="2" static_dispatch="false">
+ <param name="list" type="GLuint"/>
+ <glx rop="1"/>
+ </function>
+
+ <function name="CallLists" offset="3" static_dispatch="false">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="type" type="GLenum"/>
+ <param name="lists" type="const GLvoid *" variable_param="type" count="n"/>
+ <glx rop="2" large="true"/>
+ </function>
+
+ <function name="DeleteLists" offset="4" static_dispatch="false">
+ <param name="list" type="GLuint"/>
+ <param name="range" type="GLsizei"/>
+ <glx sop="103"/>
+ </function>
+
+ <function name="GenLists" offset="5" static_dispatch="false">
+ <param name="range" type="GLsizei"/>
+ <return type="GLuint"/>
+ <glx sop="104"/>
+ </function>
+
+ <function name="ListBase" offset="6" static_dispatch="false">
+ <param name="base" type="GLuint"/>
+ <glx rop="3"/>
+ </function>
+
+ <function name="Begin" offset="7" static_dispatch="false">
+ <param name="mode" type="GLenum"/>
+ <glx rop="4"/>
+ </function>
+
+ <function name="Bitmap" offset="8" static_dispatch="false">
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="xorig" type="GLfloat"/>
+ <param name="yorig" type="GLfloat"/>
+ <param name="xmove" type="GLfloat"/>
+ <param name="ymove" type="GLfloat"/>
+ <param name="bitmap" type="const GLubyte *" img_width="width" img_height="height" img_format="GL_COLOR_INDEX" img_type="GL_BITMAP" img_target="0" img_pad_dimensions="false"/>
+ <glx rop="5" large="true"/>
+ </function>
+
+ <function name="Color3b" offset="9" vectorequiv="Color3bv" static_dispatch="false">
+ <param name="red" type="GLbyte"/>
+ <param name="green" type="GLbyte"/>
+ <param name="blue" type="GLbyte"/>
+ </function>
+
+ <function name="Color3bv" offset="10" static_dispatch="false">
+ <param name="v" type="const GLbyte *" count="3"/>
+ <glx rop="6"/>
+ </function>
+
+ <function name="Color3d" offset="11" vectorequiv="Color3dv" static_dispatch="false">
+ <param name="red" type="GLdouble"/>
+ <param name="green" type="GLdouble"/>
+ <param name="blue" type="GLdouble"/>
+ </function>
+
+ <function name="Color3dv" offset="12" static_dispatch="false">
+ <param name="v" type="const GLdouble *" count="3"/>
+ <glx rop="7"/>
+ </function>
+
+ <function name="Color3f" offset="13" vectorequiv="Color3fv" static_dispatch="false">
+ <param name="red" type="GLfloat"/>
+ <param name="green" type="GLfloat"/>
+ <param name="blue" type="GLfloat"/>
+ </function>
+
+ <function name="Color3fv" offset="14" static_dispatch="false">
+ <param name="v" type="const GLfloat *" count="3"/>
+ <glx rop="8"/>
+ </function>
+
+ <function name="Color3i" offset="15" vectorequiv="Color3iv" static_dispatch="false">
+ <param name="red" type="GLint"/>
+ <param name="green" type="GLint"/>
+ <param name="blue" type="GLint"/>
+ </function>
+
+ <function name="Color3iv" offset="16" static_dispatch="false">
+ <param name="v" type="const GLint *" count="3"/>
+ <glx rop="9"/>
+ </function>
+
+ <function name="Color3s" offset="17" vectorequiv="Color3sv" static_dispatch="false">
+ <param name="red" type="GLshort"/>
+ <param name="green" type="GLshort"/>
+ <param name="blue" type="GLshort"/>
+ </function>
+
+ <function name="Color3sv" offset="18" static_dispatch="false">
+ <param name="v" type="const GLshort *" count="3"/>
+ <glx rop="10"/>
+ </function>
+
+ <function name="Color3ub" offset="19" vectorequiv="Color3ubv" static_dispatch="false">
+ <param name="red" type="GLubyte"/>
+ <param name="green" type="GLubyte"/>
+ <param name="blue" type="GLubyte"/>
+ </function>
+
+ <function name="Color3ubv" offset="20" static_dispatch="false">
+ <param name="v" type="const GLubyte *" count="3"/>
+ <glx rop="11"/>
+ </function>
+
+ <function name="Color3ui" offset="21" vectorequiv="Color3uiv" static_dispatch="false">
+ <param name="red" type="GLuint"/>
+ <param name="green" type="GLuint"/>
+ <param name="blue" type="GLuint"/>
+ </function>
+
+ <function name="Color3uiv" offset="22" static_dispatch="false">
+ <param name="v" type="const GLuint *" count="3"/>
+ <glx rop="12"/>
+ </function>
+
+ <function name="Color3us" offset="23" vectorequiv="Color3usv" static_dispatch="false">
+ <param name="red" type="GLushort"/>
+ <param name="green" type="GLushort"/>
+ <param name="blue" type="GLushort"/>
+ </function>
+
+ <function name="Color3usv" offset="24" static_dispatch="false">
+ <param name="v" type="const GLushort *" count="3"/>
+ <glx rop="13"/>
+ </function>
+
+ <function name="Color4b" offset="25" vectorequiv="Color4bv" static_dispatch="false">
+ <param name="red" type="GLbyte"/>
+ <param name="green" type="GLbyte"/>
+ <param name="blue" type="GLbyte"/>
+ <param name="alpha" type="GLbyte"/>
+ </function>
+
+ <function name="Color4bv" offset="26" static_dispatch="false">
+ <param name="v" type="const GLbyte *" count="4"/>
+ <glx rop="14"/>
+ </function>
+
+ <function name="Color4d" offset="27" vectorequiv="Color4dv" static_dispatch="false">
+ <param name="red" type="GLdouble"/>
+ <param name="green" type="GLdouble"/>
+ <param name="blue" type="GLdouble"/>
+ <param name="alpha" type="GLdouble"/>
+ </function>
+
+ <function name="Color4dv" offset="28" static_dispatch="false">
+ <param name="v" type="const GLdouble *" count="4"/>
+ <glx rop="15"/>
+ </function>
+
+ <!--function name="Color4f" offset="29" vectorequiv="Color4fv" static_dispatch="false">
+ <param name="red" type="GLfloat"/>
+ <param name="green" type="GLfloat"/>
+ <param name="blue" type="GLfloat"/>
+ <param name="alpha" type="GLfloat"/>
+ </function-->
+
+ <function name="Color4fv" offset="30" static_dispatch="false">
+ <param name="v" type="const GLfloat *" count="4"/>
+ <glx rop="16"/>
+ </function>
+
+ <function name="Color4i" offset="31" vectorequiv="Color4iv" static_dispatch="false">
+ <param name="red" type="GLint"/>
+ <param name="green" type="GLint"/>
+ <param name="blue" type="GLint"/>
+ <param name="alpha" type="GLint"/>
+ </function>
+
+ <function name="Color4iv" offset="32" static_dispatch="false">
+ <param name="v" type="const GLint *" count="4"/>
+ <glx rop="17"/>
+ </function>
+
+ <function name="Color4s" offset="33" vectorequiv="Color4sv" static_dispatch="false">
+ <param name="red" type="GLshort"/>
+ <param name="green" type="GLshort"/>
+ <param name="blue" type="GLshort"/>
+ <param name="alpha" type="GLshort"/>
+ </function>
+
+ <function name="Color4sv" offset="34" static_dispatch="false">
+ <param name="v" type="const GLshort *" count="4"/>
+ <glx rop="18"/>
+ </function>
+
+ <!--function name="Color4ub" offset="35" vectorequiv="Color4ubv" static_dispatch="false">
+ <param name="red" type="GLubyte"/>
+ <param name="green" type="GLubyte"/>
+ <param name="blue" type="GLubyte"/>
+ <param name="alpha" type="GLubyte"/>
+ </function-->
+
+ <function name="Color4ubv" offset="36" static_dispatch="false">
+ <param name="v" type="const GLubyte *" count="4"/>
+ <glx rop="19"/>
+ </function>
+
+ <function name="Color4ui" offset="37" vectorequiv="Color4uiv" static_dispatch="false">
+ <param name="red" type="GLuint"/>
+ <param name="green" type="GLuint"/>
+ <param name="blue" type="GLuint"/>
+ <param name="alpha" type="GLuint"/>
+ </function>
+
+ <function name="Color4uiv" offset="38" static_dispatch="false">
+ <param name="v" type="const GLuint *" count="4"/>
+ <glx rop="20"/>
+ </function>
+
+ <function name="Color4us" offset="39" vectorequiv="Color4usv" static_dispatch="false">
+ <param name="red" type="GLushort"/>
+ <param name="green" type="GLushort"/>
+ <param name="blue" type="GLushort"/>
+ <param name="alpha" type="GLushort"/>
+ </function>
+
+ <function name="Color4usv" offset="40" static_dispatch="false">
+ <param name="v" type="const GLushort *" count="4"/>
+ <glx rop="21"/>
+ </function>
+
+ <function name="EdgeFlag" offset="41" vectorequiv="EdgeFlagv" static_dispatch="false">
+ <param name="flag" type="GLboolean"/>
+ </function>
+
+ <function name="EdgeFlagv" offset="42" static_dispatch="false">
+ <param name="flag" type="const GLboolean *" count="1"/>
+ <glx rop="22"/>
+ </function>
+
+ <function name="End" offset="43" static_dispatch="false">
+ <glx rop="23"/>
+ </function>
+
+ <function name="Indexd" offset="44" vectorequiv="Indexdv" static_dispatch="false">
+ <param name="c" type="GLdouble"/>
+ </function>
+
+ <function name="Indexdv" offset="45" static_dispatch="false">
+ <param name="c" type="const GLdouble *" count="1"/>
+ <glx rop="24"/>
+ </function>
+
+ <function name="Indexf" offset="46" vectorequiv="Indexfv" static_dispatch="false">
+ <param name="c" type="GLfloat"/>
+ </function>
+
+ <function name="Indexfv" offset="47" static_dispatch="false">
+ <param name="c" type="const GLfloat *" count="1"/>
+ <glx rop="25"/>
+ </function>
+
+ <function name="Indexi" offset="48" vectorequiv="Indexiv" static_dispatch="false">
+ <param name="c" type="GLint"/>
+ </function>
+
+ <function name="Indexiv" offset="49" static_dispatch="false">
+ <param name="c" type="const GLint *" count="1"/>
+ <glx rop="26"/>
+ </function>
+
+ <function name="Indexs" offset="50" vectorequiv="Indexsv" static_dispatch="false">
+ <param name="c" type="GLshort"/>
+ </function>
+
+ <function name="Indexsv" offset="51" static_dispatch="false">
+ <param name="c" type="const GLshort *" count="1"/>
+ <glx rop="27"/>
+ </function>
+
+ <function name="Normal3b" offset="52" vectorequiv="Normal3bv" static_dispatch="false">
+ <param name="nx" type="GLbyte"/>
+ <param name="ny" type="GLbyte"/>
+ <param name="nz" type="GLbyte"/>
+ </function>
+
+ <function name="Normal3bv" offset="53" static_dispatch="false">
+ <param name="v" type="const GLbyte *" count="3"/>
+ <glx rop="28"/>
+ </function>
+
+ <function name="Normal3d" offset="54" vectorequiv="Normal3dv" static_dispatch="false">
+ <param name="nx" type="GLdouble"/>
+ <param name="ny" type="GLdouble"/>
+ <param name="nz" type="GLdouble"/>
+ </function>
+
+ <function name="Normal3dv" offset="55" static_dispatch="false">
+ <param name="v" type="const GLdouble *" count="3"/>
+ <glx rop="29"/>
+ </function>
+
+ <!--function name="Normal3f" offset="56" vectorequiv="Normal3fv" static_dispatch="false">
+ <param name="nx" type="GLfloat"/>
+ <param name="ny" type="GLfloat"/>
+ <param name="nz" type="GLfloat"/>
+ </function-->
+
+ <function name="Normal3fv" offset="57" static_dispatch="false">
+ <param name="v" type="const GLfloat *" count="3"/>
+ <glx rop="30"/>
+ </function>
+
+ <function name="Normal3i" offset="58" vectorequiv="Normal3iv" static_dispatch="false">
+ <param name="nx" type="GLint"/>
+ <param name="ny" type="GLint"/>
+ <param name="nz" type="GLint"/>
+ </function>
+
+ <function name="Normal3iv" offset="59" static_dispatch="false">
+ <param name="v" type="const GLint *" count="3"/>
+ <glx rop="31"/>
+ </function>
+
+ <function name="Normal3s" offset="60" vectorequiv="Normal3sv" static_dispatch="false">
+ <param name="nx" type="GLshort"/>
+ <param name="ny" type="GLshort"/>
+ <param name="nz" type="GLshort"/>
+ </function>
+
+ <function name="Normal3sv" offset="61" static_dispatch="false">
+ <param name="v" type="const GLshort *" count="3"/>
+ <glx rop="32"/>
+ </function>
+
+ <function name="RasterPos2d" offset="62" vectorequiv="RasterPos2dv" static_dispatch="false">
+ <param name="x" type="GLdouble"/>
+ <param name="y" type="GLdouble"/>
+ </function>
+
+ <function name="RasterPos2dv" offset="63" static_dispatch="false">
+ <param name="v" type="const GLdouble *" count="2"/>
+ <glx rop="33"/>
+ </function>
+
+ <function name="RasterPos2f" offset="64" vectorequiv="RasterPos2fv" static_dispatch="false">
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ </function>
+
+ <function name="RasterPos2fv" offset="65" static_dispatch="false">
+ <param name="v" type="const GLfloat *" count="2"/>
+ <glx rop="34"/>
+ </function>
+
+ <function name="RasterPos2i" offset="66" vectorequiv="RasterPos2iv" static_dispatch="false">
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ </function>
+
+ <function name="RasterPos2iv" offset="67" static_dispatch="false">
+ <param name="v" type="const GLint *" count="2"/>
+ <glx rop="35"/>
+ </function>
+
+ <function name="RasterPos2s" offset="68" vectorequiv="RasterPos2sv" static_dispatch="false">
+ <param name="x" type="GLshort"/>
+ <param name="y" type="GLshort"/>
+ </function>
+
+ <function name="RasterPos2sv" offset="69" static_dispatch="false">
+ <param name="v" type="const GLshort *" count="2"/>
+ <glx rop="36"/>
+ </function>
+
+ <function name="RasterPos3d" offset="70" vectorequiv="RasterPos3dv" static_dispatch="false">
+ <param name="x" type="GLdouble"/>
+ <param name="y" type="GLdouble"/>
+ <param name="z" type="GLdouble"/>
+ </function>
+
+ <function name="RasterPos3dv" offset="71" static_dispatch="false">
+ <param name="v" type="const GLdouble *" count="3"/>
+ <glx rop="37"/>
+ </function>
+
+ <function name="RasterPos3f" offset="72" vectorequiv="RasterPos3fv" static_dispatch="false">
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ </function>
+
+ <function name="RasterPos3fv" offset="73" static_dispatch="false">
+ <param name="v" type="const GLfloat *" count="3"/>
+ <glx rop="38"/>
+ </function>
+
+ <function name="RasterPos3i" offset="74" vectorequiv="RasterPos3iv" static_dispatch="false">
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="z" type="GLint"/>
+ </function>
+
+ <function name="RasterPos3iv" offset="75" static_dispatch="false">
+ <param name="v" type="const GLint *" count="3"/>
+ <glx rop="39"/>
+ </function>
+
+ <function name="RasterPos3s" offset="76" vectorequiv="RasterPos3sv" static_dispatch="false">
+ <param name="x" type="GLshort"/>
+ <param name="y" type="GLshort"/>
+ <param name="z" type="GLshort"/>
+ </function>
+
+ <function name="RasterPos3sv" offset="77" static_dispatch="false">
+ <param name="v" type="const GLshort *" count="3"/>
+ <glx rop="40"/>
+ </function>
+
+ <function name="RasterPos4d" offset="78" vectorequiv="RasterPos4dv" static_dispatch="false">
+ <param name="x" type="GLdouble"/>
+ <param name="y" type="GLdouble"/>
+ <param name="z" type="GLdouble"/>
+ <param name="w" type="GLdouble"/>
+ </function>
+
+ <function name="RasterPos4dv" offset="79" static_dispatch="false">
+ <param name="v" type="const GLdouble *" count="4"/>
+ <glx rop="41"/>
+ </function>
+
+ <function name="RasterPos4f" offset="80" vectorequiv="RasterPos4fv" static_dispatch="false">
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ <param name="w" type="GLfloat"/>
+ </function>
+
+ <function name="RasterPos4fv" offset="81" static_dispatch="false">
+ <param name="v" type="const GLfloat *" count="4"/>
+ <glx rop="42"/>
+ </function>
+
+ <function name="RasterPos4i" offset="82" vectorequiv="RasterPos4iv" static_dispatch="false">
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="z" type="GLint"/>
+ <param name="w" type="GLint"/>
+ </function>
+
+ <function name="RasterPos4iv" offset="83" static_dispatch="false">
+ <param name="v" type="const GLint *" count="4"/>
+ <glx rop="43"/>
+ </function>
+
+ <function name="RasterPos4s" offset="84" vectorequiv="RasterPos4sv" static_dispatch="false">
+ <param name="x" type="GLshort"/>
+ <param name="y" type="GLshort"/>
+ <param name="z" type="GLshort"/>
+ <param name="w" type="GLshort"/>
+ </function>
+
+ <function name="RasterPos4sv" offset="85" static_dispatch="false">
+ <param name="v" type="const GLshort *" count="4"/>
+ <glx rop="44"/>
+ </function>
+
+ <function name="Rectd" offset="86" vectorequiv="Rectdv" static_dispatch="false">
+ <param name="x1" type="GLdouble"/>
+ <param name="y1" type="GLdouble"/>
+ <param name="x2" type="GLdouble"/>
+ <param name="y2" type="GLdouble"/>
+ </function>
+
+ <function name="Rectdv" offset="87" static_dispatch="false">
+ <param name="v1" type="const GLdouble *" count="2"/>
+ <param name="v2" type="const GLdouble *" count="2"/>
+ <glx rop="45"/>
+ </function>
+
+ <function name="Rectf" offset="88" vectorequiv="Rectfv" static_dispatch="false">
+ <param name="x1" type="GLfloat"/>
+ <param name="y1" type="GLfloat"/>
+ <param name="x2" type="GLfloat"/>
+ <param name="y2" type="GLfloat"/>
+ </function>
+
+ <function name="Rectfv" offset="89" static_dispatch="false">
+ <param name="v1" type="const GLfloat *" count="2"/>
+ <param name="v2" type="const GLfloat *" count="2"/>
+ <glx rop="46"/>
+ </function>
+
+ <function name="Recti" offset="90" vectorequiv="Rectiv" static_dispatch="false">
+ <param name="x1" type="GLint"/>
+ <param name="y1" type="GLint"/>
+ <param name="x2" type="GLint"/>
+ <param name="y2" type="GLint"/>
+ </function>
+
+ <function name="Rectiv" offset="91" static_dispatch="false">
+ <param name="v1" type="const GLint *" count="2"/>
+ <param name="v2" type="const GLint *" count="2"/>
+ <glx rop="47"/>
+ </function>
+
+ <function name="Rects" offset="92" vectorequiv="Rectsv" static_dispatch="false">
+ <param name="x1" type="GLshort"/>
+ <param name="y1" type="GLshort"/>
+ <param name="x2" type="GLshort"/>
+ <param name="y2" type="GLshort"/>
+ </function>
+
+ <function name="Rectsv" offset="93" static_dispatch="false">
+ <param name="v1" type="const GLshort *" count="2"/>
+ <param name="v2" type="const GLshort *" count="2"/>
+ <glx rop="48"/>
+ </function>
+
+ <function name="TexCoord1d" offset="94" vectorequiv="TexCoord1dv" static_dispatch="false">
+ <param name="s" type="GLdouble"/>
+ </function>
+
+ <function name="TexCoord1dv" offset="95" static_dispatch="false">
+ <param name="v" type="const GLdouble *" count="1"/>
+ <glx rop="49"/>
+ </function>
+
+ <function name="TexCoord1f" offset="96" vectorequiv="TexCoord1fv" static_dispatch="false">
+ <param name="s" type="GLfloat"/>
+ </function>
+
+ <function name="TexCoord1fv" offset="97" static_dispatch="false">
+ <param name="v" type="const GLfloat *" count="1"/>
+ <glx rop="50"/>
+ </function>
+
+ <function name="TexCoord1i" offset="98" vectorequiv="TexCoord1iv" static_dispatch="false">
+ <param name="s" type="GLint"/>
+ </function>
+
+ <function name="TexCoord1iv" offset="99" static_dispatch="false">
+ <param name="v" type="const GLint *" count="1"/>
+ <glx rop="51"/>
+ </function>
+
+ <function name="TexCoord1s" offset="100" vectorequiv="TexCoord1sv" static_dispatch="false">
+ <param name="s" type="GLshort"/>
+ </function>
+
+ <function name="TexCoord1sv" offset="101" static_dispatch="false">
+ <param name="v" type="const GLshort *" count="1"/>
+ <glx rop="52"/>
+ </function>
+
+ <function name="TexCoord2d" offset="102" vectorequiv="TexCoord2dv" static_dispatch="false">
+ <param name="s" type="GLdouble"/>
+ <param name="t" type="GLdouble"/>
+ </function>
+
+ <function name="TexCoord2dv" offset="103" static_dispatch="false">
+ <param name="v" type="const GLdouble *" count="2"/>
+ <glx rop="53"/>
+ </function>
+
+ <function name="TexCoord2f" offset="104" vectorequiv="TexCoord2fv" static_dispatch="false">
+ <param name="s" type="GLfloat"/>
+ <param name="t" type="GLfloat"/>
+ </function>
+
+ <function name="TexCoord2fv" offset="105" static_dispatch="false">
+ <param name="v" type="const GLfloat *" count="2"/>
+ <glx rop="54"/>
+ </function>
+
+ <function name="TexCoord2i" offset="106" vectorequiv="TexCoord2iv" static_dispatch="false">
+ <param name="s" type="GLint"/>
+ <param name="t" type="GLint"/>
+ </function>
+
+ <function name="TexCoord2iv" offset="107" static_dispatch="false">
+ <param name="v" type="const GLint *" count="2"/>
+ <glx rop="55"/>
+ </function>
+
+ <function name="TexCoord2s" offset="108" vectorequiv="TexCoord2sv" static_dispatch="false">
+ <param name="s" type="GLshort"/>
+ <param name="t" type="GLshort"/>
+ </function>
+
+ <function name="TexCoord2sv" offset="109" static_dispatch="false">
+ <param name="v" type="const GLshort *" count="2"/>
+ <glx rop="56"/>
+ </function>
+
+ <function name="TexCoord3d" offset="110" vectorequiv="TexCoord3dv" static_dispatch="false">
+ <param name="s" type="GLdouble"/>
+ <param name="t" type="GLdouble"/>
+ <param name="r" type="GLdouble"/>
+ </function>
+
+ <function name="TexCoord3dv" offset="111" static_dispatch="false">
+ <param name="v" type="const GLdouble *" count="3"/>
+ <glx rop="57"/>
+ </function>
+
+ <function name="TexCoord3f" offset="112" vectorequiv="TexCoord3fv" static_dispatch="false">
+ <param name="s" type="GLfloat"/>
+ <param name="t" type="GLfloat"/>
+ <param name="r" type="GLfloat"/>
+ </function>
+
+ <function name="TexCoord3fv" offset="113" static_dispatch="false">
+ <param name="v" type="const GLfloat *" count="3"/>
+ <glx rop="58"/>
+ </function>
+
+ <function name="TexCoord3i" offset="114" vectorequiv="TexCoord3iv" static_dispatch="false">
+ <param name="s" type="GLint"/>
+ <param name="t" type="GLint"/>
+ <param name="r" type="GLint"/>
+ </function>
+
+ <function name="TexCoord3iv" offset="115" static_dispatch="false">
+ <param name="v" type="const GLint *" count="3"/>
+ <glx rop="59"/>
+ </function>
+
+ <function name="TexCoord3s" offset="116" vectorequiv="TexCoord3sv" static_dispatch="false">
+ <param name="s" type="GLshort"/>
+ <param name="t" type="GLshort"/>
+ <param name="r" type="GLshort"/>
+ </function>
+
+ <function name="TexCoord3sv" offset="117" static_dispatch="false">
+ <param name="v" type="const GLshort *" count="3"/>
+ <glx rop="60"/>
+ </function>
+
+ <function name="TexCoord4d" offset="118" vectorequiv="TexCoord4dv" static_dispatch="false">
+ <param name="s" type="GLdouble"/>
+ <param name="t" type="GLdouble"/>
+ <param name="r" type="GLdouble"/>
+ <param name="q" type="GLdouble"/>
+ </function>
+
+ <function name="TexCoord4dv" offset="119" static_dispatch="false">
+ <param name="v" type="const GLdouble *" count="4"/>
+ <glx rop="61"/>
+ </function>
+
+ <function name="TexCoord4f" offset="120" vectorequiv="TexCoord4fv" static_dispatch="false">
+ <param name="s" type="GLfloat"/>
+ <param name="t" type="GLfloat"/>
+ <param name="r" type="GLfloat"/>
+ <param name="q" type="GLfloat"/>
+ </function>
+
+ <function name="TexCoord4fv" offset="121" static_dispatch="false">
+ <param name="v" type="const GLfloat *" count="4"/>
+ <glx rop="62"/>
+ </function>
+
+ <function name="TexCoord4i" offset="122" vectorequiv="TexCoord4iv" static_dispatch="false">
+ <param name="s" type="GLint"/>
+ <param name="t" type="GLint"/>
+ <param name="r" type="GLint"/>
+ <param name="q" type="GLint"/>
+ </function>
+
+ <function name="TexCoord4iv" offset="123" static_dispatch="false">
+ <param name="v" type="const GLint *" count="4"/>
+ <glx rop="63"/>
+ </function>
+
+ <function name="TexCoord4s" offset="124" vectorequiv="TexCoord4sv" static_dispatch="false">
+ <param name="s" type="GLshort"/>
+ <param name="t" type="GLshort"/>
+ <param name="r" type="GLshort"/>
+ <param name="q" type="GLshort"/>
+ </function>
+
+ <function name="TexCoord4sv" offset="125" static_dispatch="false">
+ <param name="v" type="const GLshort *" count="4"/>
+ <glx rop="64"/>
+ </function>
+
+ <function name="Vertex2d" offset="126" vectorequiv="Vertex2dv" static_dispatch="false">
+ <param name="x" type="GLdouble"/>
+ <param name="y" type="GLdouble"/>
+ </function>
+
+ <function name="Vertex2dv" offset="127" static_dispatch="false">
+ <param name="v" type="const GLdouble *" count="2"/>
+ <glx rop="65"/>
+ </function>
+
+ <function name="Vertex2f" offset="128" vectorequiv="Vertex2fv" static_dispatch="false">
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ </function>
+
+ <function name="Vertex2fv" offset="129" static_dispatch="false">
+ <param name="v" type="const GLfloat *" count="2"/>
+ <glx rop="66"/>
+ </function>
+
+ <function name="Vertex2i" offset="130" vectorequiv="Vertex2iv" static_dispatch="false">
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ </function>
+
+ <function name="Vertex2iv" offset="131" static_dispatch="false">
+ <param name="v" type="const GLint *" count="2"/>
+ <glx rop="67"/>
+ </function>
+
+ <function name="Vertex2s" offset="132" vectorequiv="Vertex2sv" static_dispatch="false">
+ <param name="x" type="GLshort"/>
+ <param name="y" type="GLshort"/>
+ </function>
+
+ <function name="Vertex2sv" offset="133" static_dispatch="false">
+ <param name="v" type="const GLshort *" count="2"/>
+ <glx rop="68"/>
+ </function>
+
+ <function name="Vertex3d" offset="134" vectorequiv="Vertex3dv" static_dispatch="false">
+ <param name="x" type="GLdouble"/>
+ <param name="y" type="GLdouble"/>
+ <param name="z" type="GLdouble"/>
+ </function>
+
+ <function name="Vertex3dv" offset="135" static_dispatch="false">
+ <param name="v" type="const GLdouble *" count="3"/>
+ <glx rop="69"/>
+ </function>
+
+ <function name="Vertex3f" offset="136" vectorequiv="Vertex3fv" static_dispatch="false">
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ </function>
+
+ <function name="Vertex3fv" offset="137" static_dispatch="false">
+ <param name="v" type="const GLfloat *" count="3"/>
+ <glx rop="70"/>
+ </function>
+
+ <function name="Vertex3i" offset="138" vectorequiv="Vertex3iv" static_dispatch="false">
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="z" type="GLint"/>
+ </function>
+
+ <function name="Vertex3iv" offset="139" static_dispatch="false">
+ <param name="v" type="const GLint *" count="3"/>
+ <glx rop="71"/>
+ </function>
+
+ <function name="Vertex3s" offset="140" vectorequiv="Vertex3sv" static_dispatch="false">
+ <param name="x" type="GLshort"/>
+ <param name="y" type="GLshort"/>
+ <param name="z" type="GLshort"/>
+ </function>
+
+ <function name="Vertex3sv" offset="141" static_dispatch="false">
+ <param name="v" type="const GLshort *" count="3"/>
+ <glx rop="72"/>
+ </function>
+
+ <function name="Vertex4d" offset="142" vectorequiv="Vertex4dv" static_dispatch="false">
+ <param name="x" type="GLdouble"/>
+ <param name="y" type="GLdouble"/>
+ <param name="z" type="GLdouble"/>
+ <param name="w" type="GLdouble"/>
+ </function>
+
+ <function name="Vertex4dv" offset="143" static_dispatch="false">
+ <param name="v" type="const GLdouble *" count="4"/>
+ <glx rop="73"/>
+ </function>
+
+ <function name="Vertex4f" offset="144" vectorequiv="Vertex4fv" static_dispatch="false">
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ <param name="w" type="GLfloat"/>
+ </function>
+
+ <function name="Vertex4fv" offset="145" static_dispatch="false">
+ <param name="v" type="const GLfloat *" count="4"/>
+ <glx rop="74"/>
+ </function>
+
+ <function name="Vertex4i" offset="146" vectorequiv="Vertex4iv" static_dispatch="false">
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="z" type="GLint"/>
+ <param name="w" type="GLint"/>
+ </function>
+
+ <function name="Vertex4iv" offset="147" static_dispatch="false">
+ <param name="v" type="const GLint *" count="4"/>
+ <glx rop="75"/>
+ </function>
+
+ <function name="Vertex4s" offset="148" vectorequiv="Vertex4sv" static_dispatch="false">
+ <param name="x" type="GLshort"/>
+ <param name="y" type="GLshort"/>
+ <param name="z" type="GLshort"/>
+ <param name="w" type="GLshort"/>
+ </function>
+
+ <function name="Vertex4sv" offset="149" static_dispatch="false">
+ <param name="v" type="const GLshort *" count="4"/>
+ <glx rop="76"/>
+ </function>
+
+ <function name="ClipPlane" offset="150" static_dispatch="false">
+ <param name="plane" type="GLenum"/>
+ <param name="equation" type="const GLdouble *" count="4"/>
+ <glx rop="77"/>
+ </function>
+
+ <function name="ColorMaterial" offset="151" static_dispatch="false">
+ <param name="face" type="GLenum"/>
+ <param name="mode" type="GLenum"/>
+ <glx rop="78"/>
+ </function>
+
+ <!--function name="CullFace" offset="152" static_dispatch="false">
+ <param name="mode" type="GLenum"/>
+ <glx rop="79"/>
+ </function>
+
+ <function name="Fogf" offset="153" static_dispatch="false">
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfloat"/>
+ <glx rop="80"/>
+ </function>
+
+ <function name="Fogfv" offset="154" static_dispatch="false">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *" variable_param="pname"/>
+ <glx rop="81"/>
+ </function-->
+
+ <function name="Fogi" offset="155" static_dispatch="false">
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLint"/>
+ <glx rop="82"/>
+ </function>
+
+ <function name="Fogiv" offset="156" static_dispatch="false">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLint *" variable_param="pname"/>
+ <glx rop="83"/>
+ </function>
+
+ <!--function name="FrontFace" offset="157" static_dispatch="false">
+ <param name="mode" type="GLenum"/>
+ <glx rop="84"/>
+ </function>
+
+ <function name="Hint" offset="158" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="mode" type="GLenum"/>
+ <glx rop="85"/>
+ </function>
+
+ <function name="Lightf" offset="159" static_dispatch="false">
+ <param name="light" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfloat"/>
+ <glx rop="86"/>
+ </function>
+
+ <function name="Lightfv" offset="160" static_dispatch="false">
+ <param name="light" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *" variable_param="pname"/>
+ <glx rop="87"/>
+ </function-->
+
+ <function name="Lighti" offset="161" static_dispatch="false">
+ <param name="light" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLint"/>
+ <glx rop="88"/>
+ </function>
+
+ <function name="Lightiv" offset="162" static_dispatch="false">
+ <param name="light" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLint *" variable_param="pname"/>
+ <glx rop="89"/>
+ </function>
+
+ <!--function name="LightModelf" offset="163" static_dispatch="false">
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfloat"/>
+ <glx rop="90"/>
+ </function>
+
+ <function name="LightModelfv" offset="164" static_dispatch="false">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *" variable_param="pname"/>
+ <glx rop="91"/>
+ </function-->
+
+ <function name="LightModeli" offset="165" static_dispatch="false">
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLint"/>
+ <glx rop="92"/>
+ </function>
+
+ <function name="LightModeliv" offset="166" static_dispatch="false">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLint *" variable_param="pname"/>
+ <glx rop="93"/>
+ </function>
+
+ <function name="LineStipple" offset="167" static_dispatch="false">
+ <param name="factor" type="GLint"/>
+ <param name="pattern" type="GLushort"/>
+ <glx rop="94"/>
+ </function>
+
+ <!--function name="LineWidth" offset="168" static_dispatch="false">
+ <param name="width" type="GLfloat"/>
+ <glx rop="95"/>
+ </function>
+
+ <function name="Materialf" offset="169" static_dispatch="false">
+ <param name="face" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfloat"/>
+ <glx rop="96"/>
+ </function>
+
+ <function name="Materialfv" offset="170" static_dispatch="false">
+ <param name="face" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *" variable_param="pname"/>
+ <glx rop="97"/>
+ </function-->
+
+ <function name="Materiali" offset="171" static_dispatch="false">
+ <param name="face" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLint"/>
+ <glx rop="98"/>
+ </function>
+
+ <function name="Materialiv" offset="172" static_dispatch="false">
+ <param name="face" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLint *" variable_param="pname"/>
+ <glx rop="99"/>
+ </function>
+
+ <!--function name="PointSize" offset="173" static_dispatch="false">
+ <param name="size" type="GLfloat"/>
+ <glx rop="100"/>
+ </function-->
+
+ <function name="PolygonMode" offset="174" static_dispatch="false">
+ <param name="face" type="GLenum"/>
+ <param name="mode" type="GLenum"/>
+ <glx rop="101"/>
+ </function>
+
+ <function name="PolygonStipple" offset="175" static_dispatch="false">
+ <param name="mask" type="const GLubyte *" img_width="32" img_height="32" img_format="GL_COLOR_INDEX" img_type="GL_BITMAP" img_target="0" img_pad_dimensions="false"/>
+ <glx rop="102"/>
+ </function>
+
+ <!--function name="Scissor" offset="176" static_dispatch="false">
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <glx rop="103"/>
+ </function>
+
+ <function name="ShadeModel" offset="177" static_dispatch="false">
+ <param name="mode" type="GLenum"/>
+ <glx rop="104"/>
+ </function>
+
+ <function name="TexParameterf" offset="178" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfloat"/>
+ <glx rop="105"/>
+ </function>
+
+ <function name="TexParameterfv" offset="179" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *" variable_param="pname"/>
+ <glx rop="106"/>
+ </function>
+
+ <function name="TexParameteri" offset="180" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLint"/>
+ <glx rop="107"/>
+ </function>
+
+ <function name="TexParameteriv" offset="181" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLint *" variable_param="pname"/>
+ <glx rop="108"/>
+ </function-->
+
+ <function name="TexImage1D" offset="182" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="internalformat" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="border" type="GLint"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="pixels" type="const GLvoid *" img_width="width" img_format="format" img_type="type" img_target="target" img_send_null="true" img_pad_dimensions="true"/>
+ <glx rop="109" large="true"/>
+ </function>
+
+ <!--function name="TexImage2D" offset="183" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="internalformat" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="border" type="GLint"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_format="format" img_type="type" img_target="target" img_send_null="true" img_pad_dimensions="true"/>
+ <glx rop="110" large="true"/>
+ </function>
+
+ <function name="TexEnvf" offset="184" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfloat"/>
+ <glx rop="111"/>
+ </function>
+
+ <function name="TexEnvfv" offset="185" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *" variable_param="pname"/>
+ <glx rop="112"/>
+ </function>
+
+ <function name="TexEnvi" offset="186" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLint"/>
+ <glx rop="113"/>
+ </function>
+
+ <function name="TexEnviv" offset="187" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLint *" variable_param="pname"/>
+ <glx rop="114"/>
+ </function-->
+
+ <function name="TexGend" offset="188" static_dispatch="false">
+ <param name="coord" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLdouble"/>
+ <glx rop="115"/>
+ </function>
+
+ <function name="TexGendv" offset="189" static_dispatch="false">
+ <param name="coord" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLdouble *" variable_param="pname"/>
+ <glx rop="116"/>
+ </function>
+
+ <!--function name="TexGenf" offset="190" static_dispatch="false">
+ <param name="coord" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfloat"/>
+ <glx rop="117"/>
+ </function>
+
+ <function name="TexGenfv" offset="191" static_dispatch="false">
+ <param name="coord" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *" variable_param="pname"/>
+ <glx rop="118"/>
+ </function>
+
+ <function name="TexGeni" offset="192" static_dispatch="false">
+ <param name="coord" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLint"/>
+ <glx rop="119"/>
+ </function>
+
+ <function name="TexGeniv" offset="193" static_dispatch="false">
+ <param name="coord" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLint *" variable_param="pname"/>
+ <glx rop="120"/>
+ </function-->
+
+ <function name="FeedbackBuffer" offset="194" static_dispatch="false">
+ <param name="size" type="GLsizei"/>
+ <param name="type" type="GLenum"/>
+ <param name="buffer" type="GLfloat *" output="true"/>
+ <glx sop="105" handcode="true"/>
+ </function>
+
+ <function name="SelectBuffer" offset="195" static_dispatch="false">
+ <param name="size" type="GLsizei"/>
+ <param name="buffer" type="GLuint *" output="true"/>
+ <glx sop="106" handcode="true"/>
+ </function>
+
+ <function name="RenderMode" offset="196" static_dispatch="false">
+ <param name="mode" type="GLenum"/>
+ <return type="GLint"/>
+ <glx sop="107" handcode="true"/>
+ </function>
+
+ <function name="InitNames" offset="197" static_dispatch="false">
+ <glx rop="121"/>
+ </function>
+
+ <function name="LoadName" offset="198" static_dispatch="false">
+ <param name="name" type="GLuint"/>
+ <glx rop="122"/>
+ </function>
+
+ <function name="PassThrough" offset="199" static_dispatch="false">
+ <param name="token" type="GLfloat"/>
+ <glx rop="123"/>
+ </function>
+
+ <function name="PopName" offset="200" static_dispatch="false">
+ <glx rop="124"/>
+ </function>
+
+ <function name="PushName" offset="201" static_dispatch="false">
+ <param name="name" type="GLuint"/>
+ <glx rop="125"/>
+ </function>
+
+ <function name="DrawBuffer" offset="202" static_dispatch="false">
+ <param name="mode" type="GLenum"/>
+ <glx rop="126"/>
+ </function>
+
+ <!--function name="Clear" offset="203" static_dispatch="false">
+ <param name="mask" type="GLbitfield"/>
+ <glx rop="127"/>
+ </function-->
+
+ <function name="ClearAccum" offset="204" static_dispatch="false">
+ <param name="red" type="GLfloat"/>
+ <param name="green" type="GLfloat"/>
+ <param name="blue" type="GLfloat"/>
+ <param name="alpha" type="GLfloat"/>
+ <glx rop="128"/>
+ </function>
+
+ <function name="ClearIndex" offset="205" static_dispatch="false">
+ <param name="c" type="GLfloat"/>
+ <glx rop="129"/>
+ </function>
+
+ <!--function name="ClearColor" offset="206" static_dispatch="false">
+ <param name="red" type="GLclampf"/>
+ <param name="green" type="GLclampf"/>
+ <param name="blue" type="GLclampf"/>
+ <param name="alpha" type="GLclampf"/>
+ <glx rop="130"/>
+ </function>
+
+ <function name="ClearStencil" offset="207" static_dispatch="false">
+ <param name="s" type="GLint"/>
+ <glx rop="131"/>
+ </function-->
+
+ <function name="ClearDepth" offset="208" static_dispatch="false">
+ <param name="depth" type="GLclampd"/>
+ <glx rop="132"/>
+ </function>
+
+ <!--function name="StencilMask" offset="209" static_dispatch="false">
+ <param name="mask" type="GLuint"/>
+ <glx rop="133"/>
+ </function>
+
+ <function name="ColorMask" offset="210" static_dispatch="false">
+ <param name="red" type="GLboolean"/>
+ <param name="green" type="GLboolean"/>
+ <param name="blue" type="GLboolean"/>
+ <param name="alpha" type="GLboolean"/>
+ <glx rop="134"/>
+ </function>
+
+ <function name="DepthMask" offset="211" static_dispatch="false">
+ <param name="flag" type="GLboolean"/>
+ <glx rop="135"/>
+ </function-->
+
+ <function name="IndexMask" offset="212" static_dispatch="false">
+ <param name="mask" type="GLuint"/>
+ <glx rop="136"/>
+ </function>
+
+ <function name="Accum" offset="213" static_dispatch="false">
+ <param name="op" type="GLenum"/>
+ <param name="value" type="GLfloat"/>
+ <glx rop="137"/>
+ </function>
+
+ <!--function name="Disable" offset="214" static_dispatch="false">
+ <param name="cap" type="GLenum"/>
+ <glx rop="138" handcode="client"/>
+ </function>
+
+ <function name="Enable" offset="215" static_dispatch="false">
+ <param name="cap" type="GLenum"/>
+ <glx rop="139" handcode="client"/>
+ </function>
+
+ <function name="Finish" offset="216" static_dispatch="false">
+ <glx sop="108" handcode="true"/>
+ </function>
+
+ <function name="Flush" offset="217" static_dispatch="false">
+ <glx sop="142" handcode="true"/>
+ </function-->
+
+ <function name="PopAttrib" offset="218" static_dispatch="false">
+ <glx rop="141"/>
+ </function>
+
+ <function name="PushAttrib" offset="219" static_dispatch="false">
+ <param name="mask" type="GLbitfield"/>
+ <glx rop="142"/>
+ </function>
+
+ <function name="Map1d" offset="220" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="u1" type="GLdouble"/>
+ <param name="u2" type="GLdouble"/>
+ <param name="stride" type="GLint" client_only="true"/>
+ <param name="order" type="GLint"/>
+ <param name="points" type="const GLdouble *" variable_param="order"/>
+ <glx rop="143" handcode="true"/>
+ </function>
+
+ <function name="Map1f" offset="221" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="u1" type="GLfloat"/>
+ <param name="u2" type="GLfloat"/>
+ <param name="stride" type="GLint" client_only="true"/>
+ <param name="order" type="GLint"/>
+ <param name="points" type="const GLfloat *" variable_param="order"/>
+ <glx rop="144" handcode="true"/>
+ </function>
+
+ <function name="Map2d" offset="222" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="u1" type="GLdouble"/>
+ <param name="u2" type="GLdouble"/>
+ <param name="ustride" type="GLint" client_only="true"/>
+ <param name="uorder" type="GLint"/>
+ <param name="v1" type="GLdouble"/>
+ <param name="v2" type="GLdouble"/>
+ <param name="vstride" type="GLint" client_only="true"/>
+ <param name="vorder" type="GLint"/>
+ <param name="points" type="const GLdouble *" variable_param="uorder"/>
+ <glx rop="145" handcode="true"/>
+ </function>
+
+ <function name="Map2f" offset="223" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="u1" type="GLfloat"/>
+ <param name="u2" type="GLfloat"/>
+ <param name="ustride" type="GLint" client_only="true"/>
+ <param name="uorder" type="GLint"/>
+ <param name="v1" type="GLfloat"/>
+ <param name="v2" type="GLfloat"/>
+ <param name="vstride" type="GLint" client_only="true"/>
+ <param name="vorder" type="GLint"/>
+ <param name="points" type="const GLfloat *" variable_param="uorder"/>
+ <glx rop="146" handcode="true"/>
+ </function>
+
+ <function name="MapGrid1d" offset="224" static_dispatch="false">
+ <param name="un" type="GLint"/>
+ <param name="u1" type="GLdouble"/>
+ <param name="u2" type="GLdouble"/>
+ <glx rop="147"/>
+ </function>
+
+ <function name="MapGrid1f" offset="225" static_dispatch="false">
+ <param name="un" type="GLint"/>
+ <param name="u1" type="GLfloat"/>
+ <param name="u2" type="GLfloat"/>
+ <glx rop="148"/>
+ </function>
+
+ <function name="MapGrid2d" offset="226" static_dispatch="false">
+ <param name="un" type="GLint"/>
+ <param name="u1" type="GLdouble"/>
+ <param name="u2" type="GLdouble"/>
+ <param name="vn" type="GLint"/>
+ <param name="v1" type="GLdouble"/>
+ <param name="v2" type="GLdouble"/>
+ <glx rop="149"/>
+ </function>
+
+ <function name="MapGrid2f" offset="227" static_dispatch="false">
+ <param name="un" type="GLint"/>
+ <param name="u1" type="GLfloat"/>
+ <param name="u2" type="GLfloat"/>
+ <param name="vn" type="GLint"/>
+ <param name="v1" type="GLfloat"/>
+ <param name="v2" type="GLfloat"/>
+ <glx rop="150"/>
+ </function>
+
+ <function name="EvalCoord1d" offset="228" vectorequiv="EvalCoord1dv" static_dispatch="false">
+ <param name="u" type="GLdouble"/>
+ </function>
+
+ <function name="EvalCoord1dv" offset="229" static_dispatch="false">
+ <param name="u" type="const GLdouble *" count="1"/>
+ <glx rop="151"/>
+ </function>
+
+ <function name="EvalCoord1f" offset="230" vectorequiv="EvalCoord1fv" static_dispatch="false">
+ <param name="u" type="GLfloat"/>
+ </function>
+
+ <function name="EvalCoord1fv" offset="231" static_dispatch="false">
+ <param name="u" type="const GLfloat *" count="1"/>
+ <glx rop="152"/>
+ </function>
+
+ <function name="EvalCoord2d" offset="232" vectorequiv="EvalCoord2dv" static_dispatch="false">
+ <param name="u" type="GLdouble"/>
+ <param name="v" type="GLdouble"/>
+ </function>
+
+ <function name="EvalCoord2dv" offset="233" static_dispatch="false">
+ <param name="u" type="const GLdouble *" count="2"/>
+ <glx rop="153"/>
+ </function>
+
+ <function name="EvalCoord2f" offset="234" vectorequiv="EvalCoord2fv" static_dispatch="false">
+ <param name="u" type="GLfloat"/>
+ <param name="v" type="GLfloat"/>
+ </function>
+
+ <function name="EvalCoord2fv" offset="235" static_dispatch="false">
+ <param name="u" type="const GLfloat *" count="2"/>
+ <glx rop="154"/>
+ </function>
+
+ <function name="EvalMesh1" offset="236" static_dispatch="false">
+ <param name="mode" type="GLenum"/>
+ <param name="i1" type="GLint"/>
+ <param name="i2" type="GLint"/>
+ <glx rop="155"/>
+ </function>
+
+ <function name="EvalPoint1" offset="237" static_dispatch="false">
+ <param name="i" type="GLint"/>
+ <glx rop="156"/>
+ </function>
+
+ <function name="EvalMesh2" offset="238" static_dispatch="false">
+ <param name="mode" type="GLenum"/>
+ <param name="i1" type="GLint"/>
+ <param name="i2" type="GLint"/>
+ <param name="j1" type="GLint"/>
+ <param name="j2" type="GLint"/>
+ <glx rop="157"/>
+ </function>
+
+ <function name="EvalPoint2" offset="239" static_dispatch="false">
+ <param name="i" type="GLint"/>
+ <param name="j" type="GLint"/>
+ <glx rop="158"/>
+ </function>
+
+ <!--function name="AlphaFunc" offset="240" static_dispatch="false">
+ <param name="func" type="GLenum"/>
+ <param name="ref" type="GLclampf"/>
+ <glx rop="159"/>
+ </function>
+
+ <function name="BlendFunc" offset="241" static_dispatch="false">
+ <param name="sfactor" type="GLenum"/>
+ <param name="dfactor" type="GLenum"/>
+ <glx rop="160"/>
+ </function>
+
+ <function name="LogicOp" offset="242" static_dispatch="false">
+ <param name="opcode" type="GLenum"/>
+ <glx rop="161"/>
+ </function>
+
+ <function name="StencilFunc" offset="243" static_dispatch="false">
+ <param name="func" type="GLenum"/>
+ <param name="ref" type="GLint"/>
+ <param name="mask" type="GLuint"/>
+ <glx rop="162"/>
+ </function>
+
+ <function name="StencilOp" offset="244" static_dispatch="false">
+ <param name="fail" type="GLenum"/>
+ <param name="zfail" type="GLenum"/>
+ <param name="zpass" type="GLenum"/>
+ <glx rop="163"/>
+ </function>
+
+ <function name="DepthFunc" offset="245" static_dispatch="false">
+ <param name="func" type="GLenum"/>
+ <glx rop="164"/>
+ </function-->
+
+ <function name="PixelZoom" offset="246" static_dispatch="false">
+ <param name="xfactor" type="GLfloat"/>
+ <param name="yfactor" type="GLfloat"/>
+ <glx rop="165"/>
+ </function>
+
+ <function name="PixelTransferf" offset="247" static_dispatch="false">
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfloat"/>
+ <glx rop="166"/>
+ </function>
+
+ <function name="PixelTransferi" offset="248" static_dispatch="false">
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLint"/>
+ <glx rop="167"/>
+ </function>
+
+ <function name="PixelStoref" offset="249" static_dispatch="false">
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfloat"/>
+ <glx sop="109" handcode="client"/>
+ </function>
+
+ <!--function name="PixelStorei" offset="250" static_dispatch="false">
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLint"/>
+ <glx sop="110" handcode="client"/>
+ </function-->
+
+ <function name="PixelMapfv" offset="251" static_dispatch="false">
+ <param name="map" type="GLenum"/>
+ <param name="mapsize" type="GLsizei" counter="true"/>
+ <param name="values" type="const GLfloat *" count="mapsize"/>
+ <glx rop="168" large="true"/>
+ </function>
+
+ <function name="PixelMapuiv" offset="252" static_dispatch="false">
+ <param name="map" type="GLenum"/>
+ <param name="mapsize" type="GLsizei" counter="true"/>
+ <param name="values" type="const GLuint *" count="mapsize"/>
+ <glx rop="169" large="true"/>
+ </function>
+
+ <function name="PixelMapusv" offset="253" static_dispatch="false">
+ <param name="map" type="GLenum"/>
+ <param name="mapsize" type="GLsizei" counter="true"/>
+ <param name="values" type="const GLushort *" count="mapsize"/>
+ <glx rop="170" large="true"/>
+ </function>
+
+ <function name="ReadBuffer" offset="254" static_dispatch="false">
+ <param name="mode" type="GLenum"/>
+ <glx rop="171"/>
+ </function>
+
+ <function name="CopyPixels" offset="255" static_dispatch="false">
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="type" type="GLenum"/>
+ <glx rop="172"/>
+ </function>
+
+ <!--function name="ReadPixels" offset="256" static_dispatch="false">
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="pixels" type="GLvoid *" output="true" img_width="width" img_height="height" img_format="format" img_type="type" img_target="0"/>
+ <glx sop="111"/>
+ </function-->
+
+ <function name="DrawPixels" offset="257" static_dispatch="false">
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_format="format" img_type="type" img_target="0" img_pad_dimensions="false"/>
+ <glx rop="173" large="true"/>
+ </function>
+
+ <!--function name="GetBooleanv" offset="258" static_dispatch="false">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLboolean *" output="true" variable_param="pname"/>
+ <glx sop="112" handcode="client"/>
+ </function-->
+
+ <function name="GetClipPlane" offset="259" static_dispatch="false">
+ <param name="plane" type="GLenum"/>
+ <param name="equation" type="GLdouble *" output="true" count="4"/>
+ <glx sop="113" always_array="true"/>
+ </function>
+
+ <function name="GetDoublev" offset="260" static_dispatch="false">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLdouble *" output="true" variable_param="pname"/>
+ <glx sop="114" handcode="client"/>
+ </function>
+
+ <!--function name="GetError" offset="261" static_dispatch="false">
+ <return type="GLenum"/>
+ <glx sop="115" handcode="client"/>
+ </function>
+
+ <function name="GetFloatv" offset="262" static_dispatch="false">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx sop="116" handcode="client"/>
+ </function>
+
+ <function name="GetIntegerv" offset="263" static_dispatch="false">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx sop="117" handcode="client"/>
+ </function>
+
+ <function name="GetLightfv" offset="264" static_dispatch="false">
+ <param name="light" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx sop="118"/>
+ </function-->
+
+ <function name="GetLightiv" offset="265" static_dispatch="false">
+ <param name="light" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx sop="119"/>
+ </function>
+
+ <function name="GetMapdv" offset="266" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="query" type="GLenum"/>
+ <param name="v" type="GLdouble *" output="true" variable_param="target query"/>
+ <glx sop="120"/>
+ </function>
+
+ <function name="GetMapfv" offset="267" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="query" type="GLenum"/>
+ <param name="v" type="GLfloat *" output="true" variable_param="target query"/>
+ <glx sop="121"/>
+ </function>
+
+ <function name="GetMapiv" offset="268" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="query" type="GLenum"/>
+ <param name="v" type="GLint *" output="true" variable_param="target query"/>
+ <glx sop="122"/>
+ </function>
+
+ <!--function name="GetMaterialfv" offset="269" static_dispatch="false">
+ <param name="face" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx sop="123"/>
+ </function-->
+
+ <function name="GetMaterialiv" offset="270" static_dispatch="false">
+ <param name="face" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx sop="124"/>
+ </function>
+
+ <function name="GetPixelMapfv" offset="271" static_dispatch="false">
+ <param name="map" type="GLenum"/>
+ <param name="values" type="GLfloat *" output="true" variable_param="map"/>
+ <glx sop="125"/>
+ </function>
+
+ <function name="GetPixelMapuiv" offset="272" static_dispatch="false">
+ <param name="map" type="GLenum"/>
+ <param name="values" type="GLuint *" output="true" variable_param="map"/>
+ <glx sop="126"/>
+ </function>
+
+ <function name="GetPixelMapusv" offset="273" static_dispatch="false">
+ <param name="map" type="GLenum"/>
+ <param name="values" type="GLushort *" output="true" variable_param="map"/>
+ <glx sop="127"/>
+ </function>
+
+ <function name="GetPolygonStipple" offset="274" static_dispatch="false">
+ <param name="mask" type="GLubyte *" output="true" img_width="32" img_height="32" img_format="GL_COLOR_INDEX" img_type="GL_BITMAP"/>
+ <glx sop="128"/>
+ </function>
+
+ <!--function name="GetString" offset="275" static_dispatch="false">
+ <param name="name" type="GLenum"/>
+ <return type="const GLubyte *"/>
+ <glx sop="129" handcode="true"/>
+ </function>
+
+ <function name="GetTexEnvfv" offset="276" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx sop="130"/>
+ </function>
+
+ <function name="GetTexEnviv" offset="277" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx sop="131"/>
+ </function-->
+
+ <function name="GetTexGendv" offset="278" static_dispatch="false">
+ <param name="coord" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLdouble *" output="true" variable_param="pname"/>
+ <glx sop="132"/>
+ </function>
+
+ <!--function name="GetTexGenfv" offset="279" static_dispatch="false">
+ <param name="coord" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx sop="133"/>
+ </function>
+
+ <function name="GetTexGeniv" offset="280" static_dispatch="false">
+ <param name="coord" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx sop="134"/>
+ </function-->
+
+ <function name="GetTexImage" offset="281" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="pixels" type="GLvoid *" output="true" img_width="width" img_height="height" img_depth="depth" img_format="format" img_type="type"/>
+ <glx sop="135" dimensions_in_reply="true"/>
+ </function>
+
+ <!--function name="GetTexParameterfv" offset="282" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx sop="136"/>
+ </function>
+
+ <function name="GetTexParameteriv" offset="283" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx sop="137"/>
+ </function-->
+
+ <function name="GetTexLevelParameterfv" offset="284" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx sop="138"/>
+ </function>
+
+ <function name="GetTexLevelParameteriv" offset="285" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx sop="139"/>
+ </function>
+
+ <!--function name="IsEnabled" offset="286" static_dispatch="false">
+ <param name="cap" type="GLenum"/>
+ <return type="GLboolean"/>
+ <glx sop="140" handcode="client"/>
+ </function-->
+
+ <function name="IsList" offset="287" static_dispatch="false">
+ <param name="list" type="GLuint"/>
+ <return type="GLboolean"/>
+ <glx sop="141"/>
+ </function>
+
+ <function name="DepthRange" offset="288" static_dispatch="false">
+ <param name="zNear" type="GLclampd"/>
+ <param name="zFar" type="GLclampd"/>
+ <glx rop="174"/>
+ </function>
+
+ <function name="Frustum" offset="289" static_dispatch="false">
+ <param name="left" type="GLdouble"/>
+ <param name="right" type="GLdouble"/>
+ <param name="bottom" type="GLdouble"/>
+ <param name="top" type="GLdouble"/>
+ <param name="zNear" type="GLdouble"/>
+ <param name="zFar" type="GLdouble"/>
+ <glx rop="175"/>
+ </function>
+
+ <!--function name="LoadIdentity" offset="290" static_dispatch="false">
+ <glx rop="176"/>
+ </function>
+
+ <function name="LoadMatrixf" offset="291" static_dispatch="false">
+ <param name="m" type="const GLfloat *" count="16"/>
+ <glx rop="177"/>
+ </function-->
+
+ <function name="LoadMatrixd" offset="292" static_dispatch="false">
+ <param name="m" type="const GLdouble *" count="16"/>
+ <glx rop="178"/>
+ </function>
+
+ <!--function name="MatrixMode" offset="293" static_dispatch="false">
+ <param name="mode" type="GLenum"/>
+ <glx rop="179"/>
+ </function>
+
+ <function name="MultMatrixf" offset="294" static_dispatch="false">
+ <param name="m" type="const GLfloat *" count="16"/>
+ <glx rop="180"/>
+ </function-->
+
+ <function name="MultMatrixd" offset="295" static_dispatch="false">
+ <param name="m" type="const GLdouble *" count="16"/>
+ <glx rop="181"/>
+ </function>
+
+ <function name="Ortho" offset="296" static_dispatch="false">
+ <param name="left" type="GLdouble"/>
+ <param name="right" type="GLdouble"/>
+ <param name="bottom" type="GLdouble"/>
+ <param name="top" type="GLdouble"/>
+ <param name="zNear" type="GLdouble"/>
+ <param name="zFar" type="GLdouble"/>
+ <glx rop="182"/>
+ </function>
+
+ <!--function name="PopMatrix" offset="297" static_dispatch="false">
+ <glx rop="183"/>
+ </function>
+
+ <function name="PushMatrix" offset="298" static_dispatch="false">
+ <glx rop="184"/>
+ </function-->
+
+ <function name="Rotated" offset="299" static_dispatch="false">
+ <param name="angle" type="GLdouble"/>
+ <param name="x" type="GLdouble"/>
+ <param name="y" type="GLdouble"/>
+ <param name="z" type="GLdouble"/>
+ <glx rop="185"/>
+ </function>
+
+ <!--function name="Rotatef" offset="300" static_dispatch="false">
+ <param name="angle" type="GLfloat"/>
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ <glx rop="186"/>
+ </function-->
+
+ <function name="Scaled" offset="301" static_dispatch="false">
+ <param name="x" type="GLdouble"/>
+ <param name="y" type="GLdouble"/>
+ <param name="z" type="GLdouble"/>
+ <glx rop="187"/>
+ </function>
+
+ <!--function name="Scalef" offset="302" static_dispatch="false">
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ <glx rop="188"/>
+ </function-->
+
+ <function name="Translated" offset="303" static_dispatch="false">
+ <param name="x" type="GLdouble"/>
+ <param name="y" type="GLdouble"/>
+ <param name="z" type="GLdouble"/>
+ <glx rop="189"/>
+ </function>
+
+ <!--function name="Translatef" offset="304" static_dispatch="false">
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ <glx rop="190"/>
+ </function>
+
+ <function name="Viewport" offset="305" static_dispatch="false">
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <glx rop="191"/>
+ </function-->
+</category>
+
+<category name="1.1">
+ <function name="ArrayElement" offset="306" static_dispatch="false">
+ <param name="i" type="GLint"/>
+ <glx handcode="true"/>
+ </function>
+
+ <!--function name="ColorPointer" offset="308" static_dispatch="false">
+ <param name="size" type="GLint"/>
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="DisableClientState" offset="309" static_dispatch="false">
+ <param name="array" type="GLenum"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="DrawArrays" offset="310" static_dispatch="false">
+ <param name="mode" type="GLenum"/>
+ <param name="first" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <glx rop="193" handcode="true"/>
+ </function>
+
+ <function name="DrawElements" offset="311" static_dispatch="false">
+ <param name="mode" type="GLenum"/>
+ <param name="count" type="GLsizei"/>
+ <param name="type" type="GLenum"/>
+ <param name="indices" type="const GLvoid *"/>
+ <glx handcode="true"/>
+ </function-->
+
+ <function name="EdgeFlagPointer" offset="312" static_dispatch="false">
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ <glx handcode="true"/>
+ </function>
+
+ <!--function name="EnableClientState" offset="313" static_dispatch="false">
+ <param name="array" type="GLenum"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="GetPointerv" offset="329" static_dispatch="false">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLvoid **" output="true"/>
+ <glx handcode="true"/>
+ </function-->
+
+ <function name="IndexPointer" offset="314" static_dispatch="false">
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="InterleavedArrays" offset="317" static_dispatch="false">
+ <param name="format" type="GLenum"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ <glx handcode="true"/>
+ </function>
+
+ <!--function name="NormalPointer" offset="318" static_dispatch="false">
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="TexCoordPointer" offset="320" static_dispatch="false">
+ <param name="size" type="GLint"/>
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="VertexPointer" offset="321" static_dispatch="false">
+ <param name="size" type="GLint"/>
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="PolygonOffset" offset="319" static_dispatch="false">
+ <param name="factor" type="GLfloat"/>
+ <param name="units" type="GLfloat"/>
+ <glx rop="192"/>
+ </function-->
+
+ <function name="CopyTexImage1D" offset="323" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="border" type="GLint"/>
+ <glx rop="4119"/>
+ </function>
+
+ <!--function name="CopyTexImage2D" offset="324" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="border" type="GLint"/>
+ <glx rop="4120"/>
+ </function-->
+
+ <function name="CopyTexSubImage1D" offset="325" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="xoffset" type="GLint"/>
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <glx rop="4121"/>
+ </function>
+
+ <!--function name="CopyTexSubImage2D" offset="326" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="xoffset" type="GLint"/>
+ <param name="yoffset" type="GLint"/>
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <glx rop="4122"/>
+ </function-->
+
+ <function name="TexSubImage1D" offset="332" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="xoffset" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="UNUSED" type="GLuint" padding="true"/>
+ <param name="pixels" type="const GLvoid *" img_width="width" img_xoff="xoffset" img_format="format" img_type="type" img_target="target" img_pad_dimensions="true"/>
+ <glx rop="4099" large="true"/>
+ </function>
+
+ <!--function name="TexSubImage2D" offset="333" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="xoffset" type="GLint"/>
+ <param name="yoffset" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="UNUSED" type="GLuint" padding="true"/>
+ <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_xoff="xoffset" img_yoff="yoffset" img_format="format" img_type="type" img_target="target" img_pad_dimensions="true"/>
+ <glx rop="4100" large="true"/>
+ </function-->
+
+ <function name="AreTexturesResident" offset="322" static_dispatch="false">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="textures" type="const GLuint *" count="n"/>
+ <param name="residences" type="GLboolean *" output="true" count="n"/>
+ <return type="GLboolean"/>
+ <glx sop="143" handcode="client" always_array="true"/>
+ </function>
+
+ <!--function name="BindTexture" offset="307" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="texture" type="GLuint"/>
+ <glx rop="4117"/>
+ </function>
+
+ <function name="DeleteTextures" offset="327" static_dispatch="false">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="textures" type="const GLuint *" count="n"/>
+ <glx sop="144"/>
+ </function>
+
+ <function name="GenTextures" offset="328" static_dispatch="false">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="textures" type="GLuint *" output="true" count="n"/>
+ <glx sop="145" always_array="true"/>
+ </function>
+
+ <function name="IsTexture" offset="330" static_dispatch="false">
+ <param name="texture" type="GLuint"/>
+ <return type="GLboolean"/>
+ <glx sop="146"/>
+ </function-->
+
+ <function name="PrioritizeTextures" offset="331" static_dispatch="false">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="textures" type="const GLuint *" count="n"/>
+ <param name="priorities" type="const GLclampf *" count="n"/>
+ <glx rop="4118"/>
+ </function>
+
+ <function name="Indexub" offset="315" vectorequiv="Indexubv" static_dispatch="false">
+ <param name="c" type="GLubyte"/>
+ </function>
+
+ <function name="Indexubv" offset="316" static_dispatch="false">
+ <param name="c" type="const GLubyte *" count="1"/>
+ <glx rop="194"/>
+ </function>
+
+ <function name="PopClientAttrib" offset="334" static_dispatch="false">
+ <glx handcode="true"/>
+ </function>
+
+ <function name="PushClientAttrib" offset="335" static_dispatch="false">
+ <param name="mask" type="GLbitfield"/>
+ <glx handcode="true"/>
+ </function>
+</category>
+
+<category name="1.2">
+ <!--function name="BlendColor" offset="336" static_dispatch="false">
+ <param name="red" type="GLclampf"/>
+ <param name="green" type="GLclampf"/>
+ <param name="blue" type="GLclampf"/>
+ <param name="alpha" type="GLclampf"/>
+ <glx rop="4096"/>
+ </function>
+
+ <function name="BlendEquation" offset="337" static_dispatch="false">
+ <param name="mode" type="GLenum"/>
+ <glx rop="4097"/>
+ </function-->
+
+ <function name="DrawRangeElements" offset="338" static_dispatch="false">
+ <param name="mode" type="GLenum"/>
+ <param name="start" type="GLuint"/>
+ <param name="end" type="GLuint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="type" type="GLenum"/>
+ <param name="indices" type="const GLvoid *"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="ColorTable" offset="339" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="width" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="table" type="const GLvoid *" img_width="width" img_pad_dimensions="false" img_format="format" img_type="type" img_target="target"/>
+ <glx rop="2053" large="true"/>
+ </function>
+
+ <function name="ColorTableParameterfv" offset="340" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *" variable_param="pname"/>
+ <glx rop="2054"/>
+ </function>
+
+ <function name="ColorTableParameteriv" offset="341" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLint *" variable_param="pname"/>
+ <glx rop="2055"/>
+ </function>
+
+ <function name="CopyColorTable" offset="342" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <glx rop="2056"/>
+ </function>
+
+ <function name="GetColorTable" offset="343" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="table" type="GLvoid *" output="true" img_width="width" img_format="format" img_type="type"/>
+ <glx sop="147" dimensions_in_reply="true"/>
+ </function>
+
+ <function name="GetColorTableParameterfv" offset="344" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx sop="148"/>
+ </function>
+
+ <function name="GetColorTableParameteriv" offset="345" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx sop="149"/>
+ </function>
+
+ <function name="ColorSubTable" offset="346" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="start" type="GLsizei"/>
+ <param name="count" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="data" type="const GLvoid *" img_width="count" img_pad_dimensions="false" img_format="format" img_type="type" img_target="target"/>
+ <glx rop="195" large="true"/>
+ </function>
+
+ <function name="CopyColorSubTable" offset="347" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="start" type="GLsizei"/>
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <glx rop="196"/>
+ </function>
+
+ <function name="ConvolutionFilter1D" offset="348" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="width" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="image" type="const GLvoid *" img_width="width" img_format="format" img_type="type" img_target="target" img_pad_dimensions="true"/>
+ <glx rop="4101" large="true"/>
+ </function>
+
+ <function name="ConvolutionFilter2D" offset="349" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="image" type="const GLvoid *" img_width="width" img_height="height" img_format="format" img_type="type" img_target="target" img_pad_dimensions="true"/>
+ <glx rop="4102" large="true"/>
+ </function>
+
+ <function name="ConvolutionParameterf" offset="350" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat"/>
+ <glx rop="4103"/>
+ </function>
+
+ <function name="ConvolutionParameterfv" offset="351" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *" variable_param="pname"/>
+ <glx rop="4104"/>
+ </function>
+
+ <function name="ConvolutionParameteri" offset="352" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint"/>
+ <glx rop="4105"/>
+ </function>
+
+ <function name="ConvolutionParameteriv" offset="353" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLint *" variable_param="pname"/>
+ <glx rop="4106"/>
+ </function>
+
+ <function name="CopyConvolutionFilter1D" offset="354" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <glx rop="4107"/>
+ </function>
+
+ <function name="CopyConvolutionFilter2D" offset="355" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <glx rop="4108"/>
+ </function>
+
+ <function name="GetConvolutionFilter" offset="356" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="image" type="GLvoid *" output="true" img_width="width" img_height="height" img_format="format" img_type="type"/>
+ <glx sop="150" dimensions_in_reply="true"/>
+ </function>
+
+ <function name="GetConvolutionParameterfv" offset="357" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx sop="151"/>
+ </function>
+
+ <function name="GetConvolutionParameteriv" offset="358" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx sop="152"/>
+ </function>
+
+ <function name="GetSeparableFilter" offset="359" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="row" type="GLvoid *" output="true"/>
+ <param name="column" type="GLvoid *" output="true"/>
+ <param name="span" type="GLvoid *" output="true"/>
+ <glx sop="153" handcode="true"/>
+ </function>
+
+ <function name="SeparableFilter2D" offset="360" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="row" type="const GLvoid *"/>
+ <param name="column" type="const GLvoid *"/>
+ <glx rop="4109" handcode="true"/>
+ </function>
+
+ <function name="GetHistogram" offset="361" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="reset" type="GLboolean"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="values" type="GLvoid *" output="true" img_width="width" img_format="format" img_type="type"/>
+ <glx sop="154" dimensions_in_reply="true" img_reset="reset"/>
+ </function>
+
+ <function name="GetHistogramParameterfv" offset="362" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx sop="155"/>
+ </function>
+
+ <function name="GetHistogramParameteriv" offset="363" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx sop="156"/>
+ </function>
+
+ <function name="GetMinmax" offset="364" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="reset" type="GLboolean"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="values" type="GLvoid *" output="true" img_width="2" img_format="format" img_type="type"/>
+ <glx sop="157" img_reset="reset"/>
+ </function>
+
+ <function name="GetMinmaxParameterfv" offset="365" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx sop="158"/>
+ </function>
+
+ <function name="GetMinmaxParameteriv" offset="366" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx sop="159"/>
+ </function>
+
+ <function name="Histogram" offset="367" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="width" type="GLsizei"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="sink" type="GLboolean"/>
+ <glx rop="4110"/>
+ </function>
+
+ <function name="Minmax" offset="368" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="sink" type="GLboolean"/>
+ <glx rop="4111"/>
+ </function>
+
+ <function name="ResetHistogram" offset="369" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <glx rop="4112"/>
+ </function>
+
+ <function name="ResetMinmax" offset="370" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <glx rop="4113"/>
+ </function>
+
+ <!--function name="TexImage3D" offset="371" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="internalformat" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="depth" type="GLsizei"/>
+ <param name="border" type="GLint"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_depth="depth" img_format="format" img_type="type" img_target="target" img_null_flag="true" img_pad_dimensions="true"/>
+ <glx rop="4114" large="true"/>
+ </function>
+
+ <function name="TexSubImage3D" offset="372" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="xoffset" type="GLint"/>
+ <param name="yoffset" type="GLint"/>
+ <param name="zoffset" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="depth" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="UNUSED" type="GLuint" padding="true"/>
+ <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_depth="depth" img_xoff="xoffset" img_yoff="yoffset" img_zoff="zoffset" img_format="format" img_type="type" img_target="target" img_pad_dimensions="true"/>
+ <glx rop="4115" large="true"/>
+ </function>
+
+ <function name="CopyTexSubImage3D" offset="373" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="xoffset" type="GLint"/>
+ <param name="yoffset" type="GLint"/>
+ <param name="zoffset" type="GLint"/>
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <glx rop="4123"/>
+ </function-->
+</category>
+
+<category name="GL_ARB_multitexture" number="1">
+ <!--function name="ActiveTextureARB" offset="374" static_dispatch="false">
+ <param name="texture" type="GLenum"/>
+ <glx rop="197"/>
+ </function>
+
+ <function name="ClientActiveTextureARB" offset="375" static_dispatch="false">
+ <param name="texture" type="GLenum"/>
+ <glx handcode="true"/>
+ </function-->
+
+ <function name="MultiTexCoord1dARB" offset="376" vectorequiv="MultiTexCoord1dvARB" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLdouble"/>
+ </function>
+
+ <function name="MultiTexCoord1dvARB" offset="377" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLdouble *" count="1"/>
+ <glx rop="198"/>
+ </function>
+
+ <function name="MultiTexCoord1fARB" offset="378" vectorequiv="MultiTexCoord1fvARB" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLfloat"/>
+ </function>
+
+ <function name="MultiTexCoord1fvARB" offset="379" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLfloat *" count="1"/>
+ <glx rop="199"/>
+ </function>
+
+ <function name="MultiTexCoord1iARB" offset="380" vectorequiv="MultiTexCoord1ivARB" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLint"/>
+ </function>
+
+ <function name="MultiTexCoord1ivARB" offset="381" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLint *" count="1"/>
+ <glx rop="200"/>
+ </function>
+
+ <function name="MultiTexCoord1sARB" offset="382" vectorequiv="MultiTexCoord1svARB" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLshort"/>
+ </function>
+
+ <function name="MultiTexCoord1svARB" offset="383" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLshort *" count="1"/>
+ <glx rop="201"/>
+ </function>
+
+ <function name="MultiTexCoord2dARB" offset="384" vectorequiv="MultiTexCoord2dvARB" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLdouble"/>
+ <param name="t" type="GLdouble"/>
+ </function>
+
+ <function name="MultiTexCoord2dvARB" offset="385" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLdouble *" count="2"/>
+ <glx rop="202"/>
+ </function>
+
+ <function name="MultiTexCoord2fARB" offset="386" vectorequiv="MultiTexCoord2fvARB" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLfloat"/>
+ <param name="t" type="GLfloat"/>
+ </function>
+
+ <function name="MultiTexCoord2fvARB" offset="387" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLfloat *" count="2"/>
+ <glx rop="203"/>
+ </function>
+
+ <function name="MultiTexCoord2iARB" offset="388" vectorequiv="MultiTexCoord2ivARB" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLint"/>
+ <param name="t" type="GLint"/>
+ </function>
+
+ <function name="MultiTexCoord2ivARB" offset="389" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLint *" count="2"/>
+ <glx rop="204"/>
+ </function>
+
+ <function name="MultiTexCoord2sARB" offset="390" vectorequiv="MultiTexCoord2svARB" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLshort"/>
+ <param name="t" type="GLshort"/>
+ </function>
+
+ <function name="MultiTexCoord2svARB" offset="391" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLshort *" count="2"/>
+ <glx rop="205"/>
+ </function>
+
+ <function name="MultiTexCoord3dARB" offset="392" vectorequiv="MultiTexCoord3dvARB" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLdouble"/>
+ <param name="t" type="GLdouble"/>
+ <param name="r" type="GLdouble"/>
+ </function>
+
+ <function name="MultiTexCoord3dvARB" offset="393" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLdouble *" count="3"/>
+ <glx rop="206"/>
+ </function>
+
+ <function name="MultiTexCoord3fARB" offset="394" vectorequiv="MultiTexCoord3fvARB" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLfloat"/>
+ <param name="t" type="GLfloat"/>
+ <param name="r" type="GLfloat"/>
+ </function>
+
+ <function name="MultiTexCoord3fvARB" offset="395" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLfloat *" count="3"/>
+ <glx rop="207"/>
+ </function>
+
+ <function name="MultiTexCoord3iARB" offset="396" vectorequiv="MultiTexCoord3ivARB" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLint"/>
+ <param name="t" type="GLint"/>
+ <param name="r" type="GLint"/>
+ </function>
+
+ <function name="MultiTexCoord3ivARB" offset="397" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLint *" count="3"/>
+ <glx rop="208"/>
+ </function>
+
+ <function name="MultiTexCoord3sARB" offset="398" vectorequiv="MultiTexCoord3svARB" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLshort"/>
+ <param name="t" type="GLshort"/>
+ <param name="r" type="GLshort"/>
+ </function>
+
+ <function name="MultiTexCoord3svARB" offset="399" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLshort *" count="3"/>
+ <glx rop="209"/>
+ </function>
+
+ <function name="MultiTexCoord4dARB" offset="400" vectorequiv="MultiTexCoord4dvARB" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLdouble"/>
+ <param name="t" type="GLdouble"/>
+ <param name="r" type="GLdouble"/>
+ <param name="q" type="GLdouble"/>
+ </function>
+
+ <function name="MultiTexCoord4dvARB" offset="401" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLdouble *" count="4"/>
+ <glx rop="210"/>
+ </function>
+
+ <!--function name="MultiTexCoord4fARB" offset="402" vectorequiv="MultiTexCoord4fvARB" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLfloat"/>
+ <param name="t" type="GLfloat"/>
+ <param name="r" type="GLfloat"/>
+ <param name="q" type="GLfloat"/>
+ </function-->
+
+ <function name="MultiTexCoord4fvARB" offset="403" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLfloat *" count="4"/>
+ <glx rop="211"/>
+ </function>
+
+ <function name="MultiTexCoord4iARB" offset="404" vectorequiv="MultiTexCoord4ivARB" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLint"/>
+ <param name="t" type="GLint"/>
+ <param name="r" type="GLint"/>
+ <param name="q" type="GLint"/>
+ </function>
+
+ <function name="MultiTexCoord4ivARB" offset="405" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLint *" count="4"/>
+ <glx rop="212"/>
+ </function>
+
+ <function name="MultiTexCoord4sARB" offset="406" vectorequiv="MultiTexCoord4svARB" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLshort"/>
+ <param name="t" type="GLshort"/>
+ <param name="r" type="GLshort"/>
+ <param name="q" type="GLshort"/>
+ </function>
+
+ <function name="MultiTexCoord4svARB" offset="407" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLshort *" count="4"/>
+ <glx rop="213"/>
+ </function>
+</category>
+
+<xi:include href="../../glapi/APPLE_vertex_array_object.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+</OpenGLAPI>
diff --git a/src/mesa/es/glapi/es_EXT.xml b/src/mesa/es/glapi/es_EXT.xml
new file mode 100644
index 0000000000..b76cda929a
--- /dev/null
+++ b/src/mesa/es/glapi/es_EXT.xml
@@ -0,0 +1,122 @@
+<?xml version="1.0"?>
+<!DOCTYPE OpenGLAPI SYSTEM "../../glapi/gl_API.dtd">
+
+<!-- OpenGL ES extensions -->
+
+<OpenGLAPI>
+
+<category name="GL_OES_compressed_paletted_texture" number="6">
+ <enum name="PALETTE4_RGB8_OES" value="0x8B90"/>
+ <enum name="PALETTE4_RGBA8_OES" value="0x8B91"/>
+ <enum name="PALETTE4_R5_G6_B5_OES" value="0x8B92"/>
+ <enum name="PALETTE4_RGBA4_OES" value="0x8B93"/>
+ <enum name="PALETTE4_RGB5_A1_OES" value="0x8B94"/>
+ <enum name="PALETTE8_RGB8_OES" value="0x8B95"/>
+ <enum name="PALETTE8_RGBA8_OES" value="0x8B96"/>
+ <enum name="PALETTE8_R5_G6_B5_OES" value="0x8B97"/>
+ <enum name="PALETTE8_RGBA4_OES" value="0x8B98"/>
+ <enum name="PALETTE8_RGB5_A1_OES" value="0x8B99"/>
+</category>
+
+<category name="GL_OES_depth24" number="24">
+ <enum name="DEPTH_COMPONENT24_OES" value="0x81A6"/>
+</category>
+
+<category name="GL_OES_depth32" number="25">
+ <enum name="DEPTH_COMPONENT32_OES" value="0x81A7"/>
+</category>
+
+<category name="GL_OES_element_index_uint" number="26">
+ <!-- No new functions, types, enums. -->
+</category>
+
+<category name="GL_OES_fbo_render_mipmap" number="27">
+ <!-- No new functions, types, enums. -->
+</category>
+
+<category name="GL_OES_mapbuffer" number="29">
+ <enum name="WRITE_ONLY_OES" value="0x88B9"/>
+ <enum name="BUFFER_ACCESS_OES" value="0x88BB"/>
+ <enum name="BUFFER_MAPPED_OES" value="0x88BC"/>
+ <enum name="BUFFER_MAP_POINTER_OES" value="0x88BD"/>
+
+ <function name="GetBufferPointervOES" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLvoid **"/>
+ </function>
+
+ <function name="MapBufferOES" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="access" type="GLenum"/>
+ <return type="GLvoid *"/>
+ </function>
+
+ <function name="UnmapBufferOES" offset="assign">
+ <param name="target" type="GLenum"/>
+ <return type="GLboolean"/>
+ </function>
+</category>
+
+<category name="GL_OES_rgb8_rgba8" number="30">
+ <enum name="RGB8_OES" value="0x8051"/>
+ <enum name="RGBA8_OES" value="0x8058"/>
+</category>
+
+<category name="GL_OES_stencil1" number="31">
+ <enum name="STENCIL_INDEX1_OES" value="0x8D46"/>
+</category>
+
+<category name="GL_OES_stencil4" number="32">
+ <enum name="STENCIL_INDEX4_OES" value="0x8D47"/>
+</category>
+
+<category name="GL_OES_stencil8" number="33">
+ <enum name="STENCIL_INDEX8_OES" value="0x8D48"/>
+</category>
+
+<category name="GL_EXT_texture_filter_anisotropic" number="41">
+ <enum name="TEXTURE_MAX_ANISOTROPY_EXT" value="0x84FE"/>
+ <enum name="MAX_TEXTURE_MAX_ANISOTROPY_EXT" value="0x84FF"/>
+</category>
+
+<category name="GL_EXT_texture_compression_dxt1" number="49">
+ <enum name="COMPRESSED_RGB_S3TC_DXT1_EXT" value="0x83F0"/>
+ <enum name="COMPRESSED_RGBA_S3TC_DXT1_EXT" value="0x83F1"/>
+</category>
+
+<category name="GL_EXT_texture_format_BGRA8888" number="51">
+ <enum name="BGRA_EXT" value="0x80E1"/>
+</category>
+
+<category name="GL_EXT_blend_minmax" number="65">
+ <enum name="MIN_EXT" value="0x8007"/>
+ <enum name="MAX_EXT" value="0x8008"/>
+</category>
+
+<category name="GL_EXT_read_format_bgra" number="66">
+ <enum name="BGRA_EXT" value="0x80E1"/>
+ <enum name="UNSIGNED_SHORT_4_4_4_4_REV_EXT" value="0x8365"/>
+ <enum name="UNSIGNED_SHORT_1_5_5_5_REV_EXT" value="0x8366"/>
+</category>
+
+<category name="GL_EXT_multi_draw_arrays" number="69">
+ <function name="MultiDrawArraysEXT" offset="assign">
+ <param name="mode" type="GLenum"/>
+ <param name="first" type="GLint *"/> <!-- Spec bug. Should be const. -->
+ <param name="count" type="GLsizei *"/> <!-- Spec bug. Should be const. -->
+ <param name="primcount" type="GLsizei"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="MultiDrawElementsEXT" offset="assign">
+ <param name="mode" type="GLenum"/>
+ <param name="count" type="const GLsizei *"/>
+ <param name="type" type="GLenum"/>
+ <param name="indices" type="const GLvoid **"/>
+ <param name="primcount" type="GLsizei"/>
+ <glx handcode="true"/>
+ </function>
+</category>
+
+</OpenGLAPI>
diff --git a/src/mesa/es/glapi/gl_compare.py b/src/mesa/es/glapi/gl_compare.py
new file mode 100644
index 0000000000..7a2148cb1f
--- /dev/null
+++ b/src/mesa/es/glapi/gl_compare.py
@@ -0,0 +1,354 @@
+#!/usr/bin/python
+#
+# Copyright (C) 2009 Chia-I Wu <olv@0xlab.org>
+#
+# 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
+# IBM 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.
+
+import sys
+import os.path
+import getopt
+
+GLAPI = "../../glapi"
+sys.path.append(GLAPI)
+
+import gl_XML
+import glX_XML
+
+class ApiSet(object):
+ def __init__(self, api, elts=["enum", "type", "function"]):
+ self.api = api
+ self.elts = elts
+
+ def _check_enum(self, e1, e2, strict=True):
+ if e1.name != e2.name:
+ raise ValueError("%s: name mismatch" % e1.name)
+ if e1.value != e2.value:
+ raise ValueError("%s: value 0x%04x != 0x%04x"
+ % (e1.name, e1.value, e2.value))
+
+ def _check_type(self, t1, t2, strict=True):
+ if t1.name != t2.name:
+ raise ValueError("%s: name mismatch" % t1.name)
+ if t1.type_expr.string() != t2.type_expr.string():
+ raise ValueError("%s: type %s != %s"
+ % (t1.name, t1.type_expr.string(), t2.type_expr.string()))
+
+ def _check_function(self, f1, f2, strict=True):
+ if f1.name != f2.name:
+ raise ValueError("%s: name mismatch" % f1.name)
+ if f1.return_type != f2.return_type:
+ raise ValueError("%s: return type %s != %s"
+ % (f1.name, f1.return_type, f2.return_type))
+ # there might be padded parameters
+ if strict and len(f1.parameters) != len(f2.parameters):
+ raise ValueError("%s: parameter length %d != %d"
+ % (f1.name, len(f1.parameters), len(f2.parameters)))
+ if f1.assign_offset != f2.assign_offset:
+ if ((f1.assign_offset and f2.offset < 0) or
+ (f2.assign_offset and f1.offset < 0)):
+ raise ValueError("%s: assign offset %d != %d"
+ % (f1.name, f1.assign_offset, f2.assign_offset))
+ elif not f1.assign_offset:
+ if f1.offset != f2.offset:
+ raise ValueError("%s: offset %d != %d"
+ % (f1.name, f1.offset, f2.offset))
+
+ if strict:
+ l1 = f1.entry_points
+ l2 = f2.entry_points
+ l1.sort()
+ l2.sort()
+ if l1 != l2:
+ raise ValueError("%s: entry points %s != %s"
+ % (f1.name, l1, l2))
+
+ l1 = f1.static_entry_points
+ l2 = f2.static_entry_points
+ l1.sort()
+ l2.sort()
+ if l1 != l2:
+ raise ValueError("%s: static entry points %s != %s"
+ % (f1.name, l1, l2))
+
+ pad = 0
+ for i in xrange(len(f1.parameters)):
+ p1 = f1.parameters[i]
+ p2 = f2.parameters[i + pad]
+
+ if not strict and p1.is_padding != p2.is_padding:
+ if p1.is_padding:
+ pad -= 1
+ continue
+ else:
+ pad += 1
+ p2 = f2.parameters[i + pad]
+
+ if strict and p1.name != p2.name:
+ raise ValueError("%s: parameter %d name %s != %s"
+ % (f1.name, i, p1.name, p2.name))
+ if p1.type_expr.string() != p2.type_expr.string():
+ if (strict or
+ # special case
+ f1.name == "TexImage2D" and p1.name != "internalformat"):
+ raise ValueError("%s: parameter %s type %s != %s"
+ % (f1.name, p1.name, p1.type_expr.string(),
+ p2.type_expr.string()))
+
+ def union(self, other):
+ union = gl_XML.gl_api(None)
+
+ if "enum" in self.elts:
+ union.enums_by_name = other.enums_by_name.copy()
+ for key, val in self.api.enums_by_name.iteritems():
+ if key not in union.enums_by_name:
+ union.enums_by_name[key] = val
+ else:
+ self._check_enum(val, other.enums_by_name[key])
+
+ if "type" in self.elts:
+ union.types_by_name = other.types_by_name.copy()
+ for key, val in self.api.types_by_name.iteritems():
+ if key not in union.types_by_name:
+ union.types_by_name[key] = val
+ else:
+ self._check_type(val, other.types_by_name[key])
+
+ if "function" in self.elts:
+ union.functions_by_name = other.functions_by_name.copy()
+ for key, val in self.api.functions_by_name.iteritems():
+ if key not in union.functions_by_name:
+ union.functions_by_name[key] = val
+ else:
+ self._check_function(val, other.functions_by_name[key])
+
+ return union
+
+ def intersection(self, other):
+ intersection = gl_XML.gl_api(None)
+
+ if "enum" in self.elts:
+ for key, val in self.api.enums_by_name.iteritems():
+ if key in other.enums_by_name:
+ self._check_enum(val, other.enums_by_name[key])
+ intersection.enums_by_name[key] = val
+
+ if "type" in self.elts:
+ for key, val in self.api.types_by_name.iteritems():
+ if key in other.types_by_name:
+ self._check_type(val, other.types_by_name[key])
+ intersection.types_by_name[key] = val
+
+ if "function" in self.elts:
+ for key, val in self.api.functions_by_name.iteritems():
+ if key in other.functions_by_name:
+ self._check_function(val, other.functions_by_name[key])
+ intersection.functions_by_name[key] = val
+
+ return intersection
+
+ def difference(self, other):
+ difference = gl_XML.gl_api(None)
+
+ if "enum" in self.elts:
+ for key, val in self.api.enums_by_name.iteritems():
+ if key not in other.enums_by_name:
+ difference.enums_by_name[key] = val
+ else:
+ self._check_enum(val, other.enums_by_name[key])
+
+ if "type" in self.elts:
+ for key, val in self.api.types_by_name.iteritems():
+ if key not in other.types_by_name:
+ difference.types_by_name[key] = val
+ else:
+ self._check_type(val, other.types_by_name[key])
+
+ if "function" in self.elts:
+ for key, val in self.api.functions_by_name.iteritems():
+ if key not in other.functions_by_name:
+ difference.functions_by_name[key] = val
+ else:
+ self._check_function(val, other.functions_by_name[key], False)
+
+ return difference
+
+def cmp_enum(e1, e2):
+ if e1.value < e2.value:
+ return -1
+ elif e1.value > e2.value:
+ return 1
+ else:
+ return 0
+
+def cmp_type(t1, t2):
+ return t1.size - t2.size
+
+def cmp_function(f1, f2):
+ if f1.name > f2.name:
+ return 1
+ elif f1.name < f2.name:
+ return -1
+ else:
+ return 0
+
+def spaces(n, str=""):
+ spaces = n - len(str)
+ if spaces < 1:
+ spaces = 1
+ return " " * spaces
+
+def output_enum(e, indent=0):
+ attrs = 'name="%s"' % e.name
+ if e.default_count > 0:
+ tab = spaces(37, attrs)
+ attrs += '%scount="%d"' % (tab, e.default_count)
+ tab = spaces(48, attrs)
+ val = "%04x" % e.value
+ val = "0x" + val.upper()
+ attrs += '%svalue="%s"' % (tab, val)
+
+ # no child
+ if not e.functions:
+ print '%s<enum %s/>' % (spaces(indent), attrs)
+ return
+
+ print '%s<enum %s>' % (spaces(indent), attrs)
+ for key, val in e.functions.iteritems():
+ attrs = 'name="%s"' % key
+ if val[0] != e.default_count:
+ attrs += ' count="%d"' % val[0]
+ if not val[1]:
+ attrs += ' mode="get"'
+
+ print '%s<size %s/>' % (spaces(indent * 2), attrs)
+
+ print '%s</enum>' % spaces(indent)
+
+def output_type(t, indent=0):
+ tab = spaces(16, t.name)
+ attrs = 'name="%s"%ssize="%d"' % (t.name, tab, t.size)
+ ctype = t.type_expr.string()
+ if ctype.find("unsigned") != -1:
+ attrs += ' unsigned="true"'
+ elif ctype.find("signed") == -1:
+ attrs += ' float="true"'
+ print '%s<type %s/>' % (spaces(indent), attrs)
+
+def output_function(f, indent=0):
+ attrs = 'name="%s"' % f.name
+ if f.offset > 0:
+ if f.assign_offset:
+ attrs += ' offset="assign"'
+ else:
+ attrs += ' offset="%d"' % f.offset
+ print '%s<function %s>' % (spaces(indent), attrs)
+
+ for p in f.parameters:
+ attrs = 'name="%s" type="%s"' \
+ % (p.name, p.type_expr.original_string)
+ print '%s<param %s/>' % (spaces(indent * 2), attrs)
+ if f.return_type != "void":
+ attrs = 'type="%s"' % f.return_type
+ print '%s<return %s/>' % (spaces(indent * 2), attrs)
+
+ print '%s</function>' % spaces(indent)
+
+def output_category(api, indent=0):
+ enums = api.enums_by_name.values()
+ enums.sort(cmp_enum)
+ types = api.types_by_name.values()
+ types.sort(cmp_type)
+ functions = api.functions_by_name.values()
+ functions.sort(cmp_function)
+
+ for e in enums:
+ output_enum(e, indent)
+ if enums and types:
+ print
+ for t in types:
+ output_type(t, indent)
+ if enums or types:
+ print
+ for f in functions:
+ output_function(f, indent)
+ if f != functions[-1]:
+ print
+
+def is_api_empty(api):
+ return bool(not api.enums_by_name and
+ not api.types_by_name and
+ not api.functions_by_name)
+
+def show_usage(ops):
+ print "Usage: %s [-k elts] <%s> <file1> <file2>" % (sys.argv[0], "|".join(ops))
+ print " -k elts A comma separated string of types of elements to"
+ print " skip. Possible types are enum, type, and function."
+ sys.exit(1)
+
+def main():
+ ops = ["union", "intersection", "difference"]
+ elts = ["enum", "type", "function"]
+
+ try:
+ options, args = getopt.getopt(sys.argv[1:], "k:")
+ except Exception, e:
+ show_usage(ops)
+
+ if len(args) != 3:
+ show_usage(ops)
+ op, file1, file2 = args
+ if op not in ops:
+ show_usage(ops)
+
+ skips = []
+ for opt, val in options:
+ if opt == "-k":
+ skips = val.split(",")
+
+ for elt in skips:
+ try:
+ elts.remove(elt)
+ except ValueError:
+ show_usage(ops)
+
+ api1 = gl_XML.parse_GL_API(file1, glX_XML.glx_item_factory())
+ api2 = gl_XML.parse_GL_API(file2, glX_XML.glx_item_factory())
+
+ set = ApiSet(api1, elts)
+ func = getattr(set, op)
+ result = func(api2)
+
+ if not is_api_empty(result):
+ cat_name = "%s_of_%s_and_%s" \
+ % (op, os.path.basename(file1), os.path.basename(file2))
+
+ print '<?xml version="1.0"?>'
+ print '<!DOCTYPE OpenGLAPI SYSTEM "%s/gl_API.dtd">' % GLAPI
+ print
+ print '<OpenGLAPI>'
+ print
+ print '<category name="%s">' % (cat_name)
+ output_category(result, 4)
+ print '</category>'
+ print
+ print '</OpenGLAPI>'
+
+if __name__ == "__main__":
+ main()
diff --git a/src/mesa/es/glapi/gl_parse_header.py b/src/mesa/es/glapi/gl_parse_header.py
new file mode 100644
index 0000000000..8b8d16b395
--- /dev/null
+++ b/src/mesa/es/glapi/gl_parse_header.py
@@ -0,0 +1,450 @@
+#!/usr/bin/python
+#
+# Copyright (C) 2009 Chia-I Wu <olv@0xlab.org>
+#
+# 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
+# IBM 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.
+
+import sys
+import os.path
+import getopt
+import re
+
+GLAPI = "../../glapi"
+sys.path.append(GLAPI)
+
+class HeaderParser(object):
+ """Parser for GL header files."""
+
+ def __init__(self, verbose=0):
+ # match #if and #ifdef
+ self.IFDEF = re.compile('#\s*if(n?def\s+(?P<ifdef>\w+)|\s+(?P<if>.+))')
+ # match #endif
+ self.ENDIF = re.compile('#\s*endif')
+ # match typedef abc def;
+ self.TYPEDEF = re.compile('typedef\s+(?P<from>[\w ]+)\s+(?P<to>\w+);')
+ # match #define XYZ VAL
+ self.DEFINE = re.compile('#\s*define\s+(?P<key>\w+)(?P<value>\s+[\w"]*)?')
+ # match GLAPI
+ self.GLAPI = re.compile('^GL_?API(CALL)?\s+(?P<return>[\w\s*]+[\w*])\s+(GL)?_?APIENTRY\s+(?P<name>\w+)\s*\((?P<params>[\w\s(,*\[\])]+)\)\s*;')
+
+ self.split_params = re.compile('\s*,\s*')
+ self.split_ctype = re.compile('(\W)')
+ # ignore GL_VERSION_X_Y
+ self.ignore_enum = re.compile('GL(_ES)?_VERSION(_ES_C[ML])?_\d_\d')
+
+ self.verbose = verbose
+ self._reset()
+
+ def _reset(self):
+ """Reset to initial state."""
+ self.ifdef_levels = []
+ self.need_char = False
+
+ # use typeexpr?
+ def _format_ctype(self, ctype, fix=True):
+ """Format a ctype string, optionally fix it."""
+ # split the type string
+ tmp = self.split_ctype.split(ctype)
+ tmp = [s for s in tmp if s and s != " "]
+
+ pretty = ""
+ for i in xrange(len(tmp)):
+ # add missing GL prefix
+ if (fix and tmp[i] != "const" and tmp[i] != "*" and
+ not tmp[i].startswith("GL")):
+ tmp[i] = "GL" + tmp[i]
+
+ if i == 0:
+ pretty = tmp[i]
+ else:
+ sep = " "
+ if tmp[i - 1] == "*":
+ sep = ""
+ pretty += sep + tmp[i]
+ return pretty
+
+ # use typeexpr?
+ def _get_ctype_attrs(self, ctype):
+ """Get the attributes of a ctype."""
+ is_float = (ctype.find("float") != -1 or ctype.find("double") != -1)
+ is_signed = not (ctype.find("unsigned") != -1)
+
+ size = 0
+ if ctype.find("char") != -1:
+ size = 1
+ elif ctype.find("short") != -1:
+ size = 2
+ elif ctype.find("int") != -1:
+ size = 4
+ elif is_float:
+ if ctype.find("float") != -1:
+ size = 4
+ else:
+ size = 8
+
+ return (size, is_float, is_signed)
+
+ def _parse_define(self, line):
+ """Parse a #define line for an <enum>."""
+ m = self.DEFINE.search(line)
+ if not m:
+ if self.verbose and line.find("#define") >= 0:
+ print "ignore %s" % (line)
+ return None
+
+ key = m.group("key").strip()
+ val = m.group("value").strip()
+
+ # enum must begin with GL_ and be all uppercase
+ if ((not (key.startswith("GL_") and key.isupper())) or
+ (self.ignore_enum.match(key) and val == "1")):
+ if self.verbose:
+ print "ignore enum %s" % (key)
+ return None
+
+ return (key, val)
+
+ def _parse_typedef(self, line):
+ """Parse a typedef line for a <type>."""
+ m = self.TYPEDEF.search(line)
+ if not m:
+ if self.verbose and line.find("typedef") >= 0:
+ print "ignore %s" % (line)
+ return None
+
+ f = m.group("from").strip()
+ t = m.group("to").strip()
+ if not t.startswith("GL"):
+ if self.verbose:
+ print "ignore type %s" % (t)
+ return None
+ attrs = self._get_ctype_attrs(f)
+
+ return (f, t, attrs)
+
+ def _parse_gl_api(self, line):
+ """Parse a GLAPI line for a <function>."""
+ m = self.GLAPI.search(line)
+ if not m:
+ if self.verbose and line.find("APIENTRY") >= 0:
+ print "ignore %s" % (line)
+ return None
+
+ rettype = m.group("return")
+ rettype = self._format_ctype(rettype)
+ if rettype == "GLvoid":
+ rettype = ""
+
+ name = m.group("name")
+
+ param_str = m.group("params")
+ chunks = self.split_params.split(param_str)
+ chunks = [s.strip() for s in chunks]
+ if len(chunks) == 1 and (chunks[0] == "void" or chunks[0] == "GLvoid"):
+ chunks = []
+
+ params = []
+ for c in chunks:
+ # split type and variable name
+ idx = c.rfind("*")
+ if idx < 0:
+ idx = c.rfind(" ")
+ if idx >= 0:
+ idx += 1
+ ctype = c[:idx]
+ var = c[idx:]
+ else:
+ ctype = c
+ var = "unnamed"
+
+ # convert array to pointer
+ idx = var.find("[")
+ if idx >= 0:
+ var = var[:idx]
+ ctype += "*"
+
+ ctype = self._format_ctype(ctype)
+ var = var.strip()
+
+ if not self.need_char and ctype.find("GLchar") >= 0:
+ self.need_char = True
+
+ params.append((ctype, var))
+
+ return (rettype, name, params)
+
+ def _change_level(self, line):
+ """Parse a #ifdef line and change level."""
+ m = self.IFDEF.search(line)
+ if m:
+ ifdef = m.group("ifdef")
+ if not ifdef:
+ ifdef = m.group("if")
+ self.ifdef_levels.append(ifdef)
+ return True
+ m = self.ENDIF.search(line)
+ if m:
+ self.ifdef_levels.pop()
+ return True
+ return False
+
+ def _read_header(self, header):
+ """Open a header file and read its contents."""
+ lines = []
+ try:
+ fp = open(header, "rb")
+ lines = fp.readlines()
+ fp.close()
+ except IOError, e:
+ print "failed to read %s: %s" % (header, e)
+ return lines
+
+ def _cmp_enum(self, enum1, enum2):
+ """Compare two enums."""
+ # sort by length of the values as strings
+ val1 = enum1[1]
+ val2 = enum2[1]
+ ret = len(val1) - len(val2)
+ # sort by the values
+ if not ret:
+ val1 = int(val1, 16)
+ val2 = int(val2, 16)
+ ret = val1 - val2
+ # in case int cannot hold the result
+ if ret > 0:
+ ret = 1
+ elif ret < 0:
+ ret = -1
+ # sort by the names
+ if not ret:
+ if enum1[0] < enum2[0]:
+ ret = -1
+ elif enum1[0] > enum2[0]:
+ ret = 1
+ return ret
+
+ def _cmp_type(self, type1, type2):
+ """Compare two types."""
+ attrs1 = type1[2]
+ attrs2 = type2[2]
+ # sort by type size
+ ret = attrs1[0] - attrs2[0]
+ # float is larger
+ if not ret:
+ ret = attrs1[1] - attrs2[1]
+ # signed is larger
+ if not ret:
+ ret = attrs1[2] - attrs2[2]
+ # reverse
+ ret = -ret
+ return ret
+
+ def _cmp_function(self, func1, func2):
+ """Compare two functions."""
+ name1 = func1[1]
+ name2 = func2[1]
+ ret = 0
+ # sort by the names
+ if name1 < name2:
+ ret = -1
+ elif name1 > name2:
+ ret = 1
+ return ret
+
+ def _postprocess_dict(self, hdict):
+ """Post-process a header dict and return an ordered list."""
+ hlist = []
+ largest = 0
+ for key, cat in hdict.iteritems():
+ size = len(cat["enums"]) + len(cat["types"]) + len(cat["functions"])
+ # ignore empty category
+ if not size:
+ continue
+
+ cat["enums"].sort(self._cmp_enum)
+ # remove duplicates
+ dup = []
+ for i in xrange(1, len(cat["enums"])):
+ if cat["enums"][i] == cat["enums"][i - 1]:
+ dup.insert(0, i)
+ for i in dup:
+ e = cat["enums"].pop(i)
+ if self.verbose:
+ print "remove duplicate enum %s" % e[0]
+
+ cat["types"].sort(self._cmp_type)
+ cat["functions"].sort(self._cmp_function)
+
+ # largest category comes first
+ if size > largest:
+ hlist.insert(0, (key, cat))
+ largest = size
+ else:
+ hlist.append((key, cat))
+ return hlist
+
+ def parse(self, header):
+ """Parse a header file."""
+ self._reset()
+
+ if self.verbose:
+ print "Parsing %s" % (header)
+
+ hdict = {}
+ lines = self._read_header(header)
+ for line in lines:
+ if self._change_level(line):
+ continue
+
+ # skip until the first ifdef (i.e. __gl_h_)
+ if not self.ifdef_levels:
+ continue
+
+ cat_name = os.path.basename(header)
+ # check if we are in an extension
+ if (len(self.ifdef_levels) > 1 and
+ self.ifdef_levels[-1].startswith("GL_")):
+ cat_name = self.ifdef_levels[-1]
+
+ try:
+ cat = hdict[cat_name]
+ except KeyError:
+ cat = {
+ "enums": [],
+ "types": [],
+ "functions": []
+ }
+ hdict[cat_name] = cat
+
+ key = "enums"
+ elem = self._parse_define(line)
+ if not elem:
+ key = "types"
+ elem = self._parse_typedef(line)
+ if not elem:
+ key = "functions"
+ elem = self._parse_gl_api(line)
+
+ if elem:
+ cat[key].append(elem)
+
+ if self.need_char:
+ if self.verbose:
+ print "define GLchar"
+ elem = self._parse_typedef("typedef char GLchar;")
+ cat["types"].append(elem)
+ return self._postprocess_dict(hdict)
+
+def spaces(n, str=""):
+ spaces = n - len(str)
+ if spaces < 1:
+ spaces = 1
+ return " " * spaces
+
+def output_xml(name, hlist):
+ """Output a parsed header in OpenGLAPI XML."""
+
+ for i in xrange(len(hlist)):
+ cat_name, cat = hlist[i]
+
+ print '<category name="%s">' % (cat_name)
+ indent = 4
+
+ for enum in cat["enums"]:
+ name = enum[0][3:]
+ value = enum[1]
+ tab = spaces(41, name)
+ attrs = 'name="%s"%svalue="%s"' % (name, tab, value)
+ print '%s<enum %s/>' % (spaces(indent), attrs)
+
+ if cat["enums"] and cat["types"]:
+ print
+
+ for type in cat["types"]:
+ ctype = type[0]
+ size, is_float, is_signed = type[2]
+
+ attrs = 'name="%s"' % (type[1][2:])
+ attrs += spaces(16, attrs) + 'size="%d"' % (size)
+ if is_float:
+ attrs += ' float="true"'
+ elif not is_signed:
+ attrs += ' unsigned="true"'
+
+ print '%s<type %s/>' % (spaces(indent), attrs)
+
+ for func in cat["functions"]:
+ print
+ ret = func[0]
+ name = func[1][2:]
+ params = func[2]
+
+ attrs = 'name="%s" offset="assign"' % name
+ print '%s<function %s>' % (spaces(indent), attrs)
+
+ for param in params:
+ attrs = 'name="%s" type="%s"' % (param[1], param[0])
+ print '%s<param %s/>' % (spaces(indent * 2), attrs)
+ if ret:
+ attrs = 'type="%s"' % ret
+ print '%s<return %s/>' % (spaces(indent * 2), attrs)
+
+ print '%s</function>' % spaces(indent)
+
+ print '</category>'
+ print
+
+def show_usage():
+ print "Usage: %s [-v] <header> ..." % sys.argv[0]
+ sys.exit(1)
+
+def main():
+ try:
+ args, headers = getopt.getopt(sys.argv[1:], "v")
+ except Exception, e:
+ show_usage()
+ if not headers:
+ show_usage()
+
+ verbose = 0
+ for arg in args:
+ if arg[0] == "-v":
+ verbose += 1
+
+ need_xml_header = True
+ parser = HeaderParser(verbose)
+ for h in headers:
+ h = os.path.abspath(h)
+ hlist = parser.parse(h)
+
+ if need_xml_header:
+ print '<?xml version="1.0"?>'
+ print '<!DOCTYPE OpenGLAPI SYSTEM "%s/gl_API.dtd">' % GLAPI
+ need_xml_header = False
+
+ print
+ print '<!-- %s -->' % (h)
+ print '<OpenGLAPI>'
+ print
+ output_xml(h, hlist)
+ print '</OpenGLAPI>'
+
+if __name__ == '__main__':
+ main()
diff --git a/src/mesa/es/main/APIspec.dtd b/src/mesa/es/main/APIspec.dtd
new file mode 100644
index 0000000000..efcfa31f10
--- /dev/null
+++ b/src/mesa/es/main/APIspec.dtd
@@ -0,0 +1,52 @@
+<!ELEMENT apispec (template|api)+>
+
+<!ELEMENT api (category*, function*)>
+<!ELEMENT category EMPTY>
+<!ELEMENT function EMPTY>
+
+<!ELEMENT template (proto, desc*)>
+<!ELEMENT proto (return, (param|vector)*)>
+<!ELEMENT return EMPTY>
+<!ELEMENT param EMPTY>
+<!ELEMENT vector (param*)>
+<!ELEMENT desc ((value|range)*, desc*)>
+<!ELEMENT value EMPTY>
+<!ELEMENT range EMPTY>
+
+<!ATTLIST api name NMTOKEN #REQUIRED
+ implementation (true | false) "false">
+<!ATTLIST category name NMTOKEN #REQUIRED>
+<!ATTLIST function name NMTOKEN #REQUIRED
+ default_prefix NMTOKEN "_mesa_"
+ external (true | false) "false"
+ template NMTOKEN #REQUIRED
+ gltype CDATA #IMPLIED
+ vector_size NMTOKEN #IMPLIED
+ expand_vector (true | false) "false"
+ skip_desc (true | false) "false">
+
+<!ATTLIST template name NMTOKEN #REQUIRED
+ direction (set | get) "set">
+
+<!ATTLIST return type CDATA #REQUIRED>
+<!ATTLIST param name NMTOKEN #REQUIRED
+ type CDATA #REQUIRED
+ hide_if_expanded (true | false) "false"
+ category NMTOKEN #IMPLIED>
+<!ATTLIST vector name NMTOKEN #REQUIRED
+ type CDATA #REQUIRED
+ size NMTOKEN #REQUIRED
+ category NMTOKEN #IMPLIED>
+
+<!ATTLIST desc name NMTOKEN #REQUIRED
+ vector_size CDATA #IMPLIED
+ convert (true | false) #IMPLIED
+ error NMTOKEN "GL_INVALID_ENUM"
+ category NMTOKEN #IMPLIED>
+
+<!ATTLIST value name CDATA #REQUIRED
+ category NMTOKEN #IMPLIED>
+<!ATTLIST range from NMTOKEN #REQUIRED
+ to NMTOKEN #REQUIRED
+ base NMTOKEN #IMPLIED
+ category NMTOKEN #IMPLIED>
diff --git a/src/mesa/es/main/APIspec.py b/src/mesa/es/main/APIspec.py
new file mode 100644
index 0000000000..6947f7301c
--- /dev/null
+++ b/src/mesa/es/main/APIspec.py
@@ -0,0 +1,617 @@
+#!/usr/bin/python
+#
+# Copyright (C) 2009 Chia-I Wu <olv@0xlab.org>
+#
+# 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
+# IBM 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.
+"""
+A parser for APIspec.
+"""
+
+class SpecError(Exception):
+ """Error in the spec file."""
+
+
+class Spec(object):
+ """A Spec is an abstraction of the API spec."""
+
+ def __init__(self, doc):
+ self.doc = doc
+
+ self.spec_node = doc.getRootElement()
+ self.tmpl_nodes = {}
+ self.api_nodes = {}
+ self.impl_node = None
+
+ # parse <apispec>
+ node = self.spec_node.children
+ while node:
+ if node.type == "element":
+ if node.name == "template":
+ self.tmpl_nodes[node.prop("name")] = node
+ elif node.name == "api":
+ self.api_nodes[node.prop("name")] = node
+ else:
+ raise SpecError("unexpected node %s in apispec" %
+ node.name)
+ node = node.next
+
+ # find an implementation
+ for name, node in self.api_nodes.iteritems():
+ if node.prop("implementation") == "true":
+ self.impl_node = node
+ break
+ if not self.impl_node:
+ raise SpecError("unable to find an implementation")
+
+ def get_impl(self):
+ """Return the implementation."""
+ return API(self, self.impl_node)
+
+ def get_api(self, name):
+ """Return an API."""
+ return API(self, self.api_nodes[name])
+
+
+class API(object):
+ """An API consists of categories and functions."""
+
+ def __init__(self, spec, api_node):
+ self.name = api_node.prop("name")
+ self.is_impl = (api_node.prop("implementation") == "true")
+
+ self.categories = []
+ self.functions = []
+
+ # parse <api>
+ func_nodes = []
+ node = api_node.children
+ while node:
+ if node.type == "element":
+ if node.name == "category":
+ cat = node.prop("name")
+ self.categories.append(cat)
+ elif node.name == "function":
+ func_nodes.append(node)
+ else:
+ raise SpecError("unexpected node %s in api" % node.name)
+ node = node.next
+
+ # realize functions
+ for func_node in func_nodes:
+ tmpl_node = spec.tmpl_nodes[func_node.prop("template")]
+ try:
+ func = Function(tmpl_node, func_node, self.is_impl,
+ self.categories)
+ except SpecError, e:
+ func_name = func_node.prop("name")
+ raise SpecError("failed to parse %s: %s" % (func_name, e))
+ self.functions.append(func)
+
+ def match(self, func, conversions={}):
+ """Find a matching function in the API."""
+ match = None
+ need_conv = False
+ for f in self.functions:
+ matched, conv = f.match(func, conversions)
+ if matched:
+ match = f
+ need_conv = conv
+ # exact match
+ if not need_conv:
+ break
+ return (match, need_conv)
+
+
+class Function(object):
+ """Parse and realize a <template> node."""
+
+ def __init__(self, tmpl_node, func_node, force_skip_desc=False, categories=[]):
+ self.tmpl_name = tmpl_node.prop("name")
+ self.direction = tmpl_node.prop("direction")
+
+ self.name = func_node.prop("name")
+ self.prefix = func_node.prop("default_prefix")
+ self.is_external = (func_node.prop("external") == "true")
+
+ if force_skip_desc:
+ self._skip_desc = True
+ else:
+ self._skip_desc = (func_node.prop("skip_desc") == "true")
+
+ self._categories = categories
+
+ # these attributes decide how the template is realized
+ self._gltype = func_node.prop("gltype")
+ if func_node.hasProp("vector_size"):
+ self._vector_size = int(func_node.prop("vector_size"))
+ else:
+ self._vector_size = 0
+ self._expand_vector = (func_node.prop("expand_vector") == "true")
+
+ self.return_type = "void"
+ param_nodes = []
+
+ # find <proto>
+ proto_node = tmpl_node.children
+ while proto_node:
+ if proto_node.type == "element" and proto_node.name == "proto":
+ break
+ proto_node = proto_node.next
+ if not proto_node:
+ raise SpecError("no proto")
+ # and parse it
+ node = proto_node.children
+ while node:
+ if node.type == "element":
+ if node.name == "return":
+ self.return_type = node.prop("type")
+ elif node.name == "param" or node.name == "vector":
+ if self.support_node(node):
+ # make sure the node is not hidden
+ if not (self._expand_vector and
+ (node.prop("hide_if_expanded") == "true")):
+ param_nodes.append(node)
+ else:
+ raise SpecError("unexpected node %s in proto" % node.name)
+ node = node.next
+
+ self._init_params(param_nodes)
+ self._init_descs(tmpl_node, param_nodes)
+
+ def __str__(self):
+ return "%s %s%s(%s)" % (self.return_type, self.prefix, self.name,
+ self.param_string(True))
+
+ def _init_params(self, param_nodes):
+ """Parse and initialize parameters."""
+ self.params = []
+
+ for param_node in param_nodes:
+ size = self.param_node_size(param_node)
+ # when no expansion, vector is just like param
+ if param_node.name == "param" or not self._expand_vector:
+ param = Parameter(param_node, self._gltype, size)
+ self.params.append(param)
+ continue
+
+ if not size or size > param_node.lsCountNode():
+ raise SpecError("could not expand %s with unknown or "
+ "mismatch sizes" % param.name)
+
+ # expand the vector
+ expanded_params = []
+ child = param_node.children
+ while child:
+ if (child.type == "element" and child.name == "param" and
+ self.support_node(child)):
+ expanded_params.append(Parameter(child, self._gltype))
+ if len(expanded_params) == size:
+ break
+ child = child.next
+ # just in case that lsCountNode counts unknown nodes
+ if len(expanded_params) < size:
+ raise SpecError("not enough named parameters")
+
+ self.params.extend(expanded_params)
+
+ def _init_descs(self, tmpl_node, param_nodes):
+ """Parse and initialize parameter descriptions."""
+ self.checker = Checker()
+ if self._skip_desc:
+ return
+
+ node = tmpl_node.children
+ while node:
+ if node.type == "element" and node.name == "desc":
+ if self.support_node(node):
+ # parse <desc>
+ desc = Description(node, self._categories)
+ self.checker.add_desc(desc)
+ node = node.next
+
+ self.checker.validate(self, param_nodes)
+
+ def support_node(self, node):
+ """Return true if a node is in the supported category."""
+ return (not node.hasProp("category") or
+ node.prop("category") in self._categories)
+
+ def get_param(self, name):
+ """Return the named parameter."""
+ for param in self.params:
+ if param.name == name:
+ return param
+ return None
+
+ def param_node_size(self, param):
+ """Return the size of a vector."""
+ if param.name != "vector":
+ return 0
+
+ size = param.prop("size")
+ if size.isdigit():
+ size = int(size)
+ else:
+ size = 0
+ if not size:
+ size = self._vector_size
+ if not size and self._expand_vector:
+ # return the number of named parameters
+ size = param.lsCountNode()
+ return size
+
+ def param_string(self, declaration):
+ """Return the C code of the parameters."""
+ args = []
+ if declaration:
+ for param in self.params:
+ sep = "" if param.type.endswith("*") else " "
+ args.append("%s%s%s" % (param.type, sep, param.name))
+ if not args:
+ args.append("void")
+ else:
+ for param in self.params:
+ args.append(param.name)
+ return ", ".join(args)
+
+ def match(self, other, conversions={}):
+ """Return true if the functions match, probably with a conversion."""
+ if (self.tmpl_name != other.tmpl_name or
+ self.return_type != other.return_type or
+ len(self.params) != len(other.params)):
+ return (False, False)
+
+ need_conv = False
+ for i in xrange(len(self.params)):
+ src = other.params[i]
+ dst = self.params[i]
+ if (src.is_vector != dst.is_vector or src.size != dst.size):
+ return (False, False)
+ if src.type != dst.type:
+ if dst.base_type() in conversions.get(src.base_type(), []):
+ need_conv = True
+ else:
+ # unable to convert
+ return (False, False)
+
+ return (True, need_conv)
+
+
+class Parameter(object):
+ """A parameter of a function."""
+
+ def __init__(self, param_node, gltype=None, size=0):
+ self.is_vector = (param_node.name == "vector")
+
+ self.name = param_node.prop("name")
+ self.size = size
+
+ type = param_node.prop("type")
+ if gltype:
+ type = type.replace("GLtype", gltype)
+ elif type.find("GLtype") != -1:
+ raise SpecError("parameter %s has unresolved type" % self.name)
+
+ self.type = type
+
+ def base_type(self):
+ """Return the base GL type by stripping qualifiers."""
+ return [t for t in self.type.split(" ") if t.startswith("GL")][0]
+
+
+class Checker(object):
+ """A checker is the collection of all descriptions on the same level.
+ Descriptions of the same parameter are concatenated.
+ """
+
+ def __init__(self):
+ self.switches = {}
+ self.switch_constants = {}
+
+ def add_desc(self, desc):
+ """Add a description."""
+ # TODO allow index to vary
+ const_attrs = ["index", "error", "convert", "size_str"]
+ if desc.name not in self.switches:
+ self.switches[desc.name] = []
+ self.switch_constants[desc.name] = {}
+ for attr in const_attrs:
+ self.switch_constants[desc.name][attr] = None
+
+ # some attributes, like error code, should be the same for all descs
+ consts = self.switch_constants[desc.name]
+ for attr in const_attrs:
+ if getattr(desc, attr) is not None:
+ if (consts[attr] is not None and
+ consts[attr] != getattr(desc, attr)):
+ raise SpecError("mismatch %s for %s" % (attr, desc.name))
+ consts[attr] = getattr(desc, attr)
+
+ self.switches[desc.name].append(desc)
+
+ def validate(self, func, param_nodes):
+ """Validate the checker against a function."""
+ tmp = Checker()
+
+ for switch in self.switches.itervalues():
+ valid_descs = []
+ for desc in switch:
+ if desc.validate(func, param_nodes):
+ valid_descs.append(desc)
+ # no possible values
+ if not valid_descs:
+ return False
+ for desc in valid_descs:
+ if not desc._is_noop:
+ tmp.add_desc(desc)
+
+ self.switches = tmp.switches
+ self.switch_constants = tmp.switch_constants
+ return True
+
+ def flatten(self, name=None):
+ """Return a flat list of all descriptions of the named parameter."""
+ flat_list = []
+ for switch in self.switches.itervalues():
+ for desc in switch:
+ if not name or desc.name == name:
+ flat_list.append(desc)
+ flat_list.extend(desc.checker.flatten(name))
+ return flat_list
+
+ def always_check(self, name):
+ """Return true if the parameter is checked in all possible pathes."""
+ if name in self.switches:
+ return True
+
+ # a param is always checked if any of the switch always checks it
+ for switch in self.switches.itervalues():
+ # a switch always checks it if all of the descs always check it
+ always = True
+ for desc in switch:
+ if not desc.checker.always_check(name):
+ always = False
+ break
+ if always:
+ return True
+ return False
+
+ def _c_switch(self, name, indent="\t"):
+ """Output C switch-statement for the named parameter, for debug."""
+ switch = self.switches.get(name, [])
+ # make sure there are valid values
+ need_switch = False
+ for desc in switch:
+ if desc.values:
+ need_switch = True
+ if not need_switch:
+ return []
+
+ stmts = []
+ var = switch[0].name
+ if switch[0].index >= 0:
+ var += "[%d]" % switch[0].index
+ stmts.append("switch (%s) { /* assume GLenum */" % var)
+
+ for desc in switch:
+ if desc.values:
+ for val in desc.values:
+ stmts.append("case %s:" % val)
+ for dep_name in desc.checker.switches.iterkeys():
+ dep_stmts = [indent + s for s in desc.checker._c_switch(dep_name, indent)]
+ stmts.extend(dep_stmts)
+ stmts.append(indent + "break;")
+
+ stmts.append("default:")
+ stmts.append(indent + "ON_ERROR(%s);" % switch[0].error);
+ stmts.append(indent + "break;")
+ stmts.append("}")
+
+ return stmts
+
+ def dump(self, indent="\t"):
+ """Dump the descriptions in C code."""
+ stmts = []
+ for name in self.switches.iterkeys():
+ c_switch = self._c_switch(name)
+ print "\n".join(c_switch)
+
+
+class Description(object):
+ """A description desribes a parameter and its relationship with other
+ parameters.
+ """
+
+ def __init__(self, desc_node, categories=[]):
+ self._categories = categories
+ self._is_noop = False
+
+ self.name = desc_node.prop("name")
+ self.index = -1
+
+ self.error = desc_node.prop("error") or "GL_INVALID_ENUM"
+ # vector_size may be C code
+ self.size_str = desc_node.prop("vector_size")
+
+ self._has_enum = False
+ self.values = []
+ dep_nodes = []
+
+ # parse <desc>
+ valid_names = ["value", "range", "desc"]
+ node = desc_node.children
+ while node:
+ if node.type == "element":
+ if node.name in valid_names:
+ # ignore nodes that require unsupported categories
+ if (node.prop("category") and
+ node.prop("category") not in self._categories):
+ node = node.next
+ continue
+ else:
+ raise SpecError("unexpected node %s in desc" % node.name)
+
+ if node.name == "value":
+ val = node.prop("name")
+ if not self._has_enum and val.startswith("GL_"):
+ self._has_enum = True
+ self.values.append(val)
+ elif node.name == "range":
+ first = int(node.prop("from"))
+ last = int(node.prop("to"))
+ base = node.prop("base") or ""
+ if not self._has_enum and base.startswith("GL_"):
+ self._has_enum = True
+ # expand range
+ for i in xrange(first, last + 1):
+ self.values.append("%s%d" % (base, i))
+ else: # dependent desc
+ dep_nodes.append(node)
+ node = node.next
+
+ # default to convert if there is no enum
+ self.convert = not self._has_enum
+ if desc_node.hasProp("convert"):
+ self.convert = (desc_node.prop("convert") == "true")
+
+ self._init_deps(dep_nodes)
+
+ def _init_deps(self, dep_nodes):
+ """Parse and initialize dependents."""
+ self.checker = Checker()
+
+ for dep_node in dep_nodes:
+ # recursion!
+ dep = Description(dep_node, self._categories)
+ self.checker.add_desc(dep)
+
+ def _search_param_node(self, param_nodes, name=None):
+ """Search the template parameters for the named node."""
+ param_node = None
+ param_index = -1
+
+ if not name:
+ name = self.name
+ for node in param_nodes:
+ if name == node.prop("name"):
+ param_node = node
+ elif node.name == "vector":
+ child = node.children
+ idx = 0
+ while child:
+ if child.type == "element" and child.name == "param":
+ if name == child.prop("name"):
+ param_node = node
+ param_index = idx
+ break
+ idx += 1
+ child = child.next
+ if param_node:
+ break
+ return (param_node, param_index)
+
+ def _find_final(self, func, param_nodes):
+ """Find the final parameter."""
+ param = func.get_param(self.name)
+ param_index = -1
+
+ # the described param is not in the final function
+ if not param:
+ # search the template parameters
+ node, index = self._search_param_node(param_nodes)
+ if not node:
+ raise SpecError("invalid desc %s in %s" %
+ (self.name, func.name))
+
+ # a named parameter of a vector
+ if index >= 0:
+ param = func.get_param(node.prop("name"))
+ param_index = index
+ elif node.name == "vector":
+ # must be an expanded vector, check its size
+ if self.size_str and self.size_str.isdigit():
+ size = int(self.size_str)
+ expanded_size = func.param_node_size(node)
+ if size != expanded_size:
+ return (False, None, -1)
+ # otherwise, it is a valid, but no-op, description
+
+ return (True, param, param_index)
+
+ def validate(self, func, param_nodes):
+ """Validate a description against certain function."""
+ if self.checker.switches and not self.values:
+ raise SpecError("no valid values for %s" % self.name)
+
+ valid, param, param_index = self._find_final(func, param_nodes)
+ if not valid:
+ return False
+
+ # the description is valid, but the param is gone
+ # mark it no-op so that it will be skipped
+ if not param:
+ self._is_noop = True
+ return True
+
+ if param.is_vector:
+ # if param was known, this should have been done in __init__
+ if self._has_enum:
+ self.size_str = "1"
+ # size mismatch
+ if (param.size and self.size_str and self.size_str.isdigit() and
+ param.size != int(self.size_str)):
+ return False
+ elif self.size_str:
+ # only vector accepts vector_size
+ raise SpecError("vector_size is invalid for %s" % param.name)
+
+ if not self.checker.validate(func, param_nodes):
+ return False
+
+ # update the description
+ self.name = param.name
+ self.index = param_index
+
+ return True
+
+
+def main():
+ import libxml2
+
+ filename = "APIspec.xml"
+ apinames = ["GLES1.1", "GLES2.0"]
+
+ doc = libxml2.readFile(filename, None,
+ libxml2.XML_PARSE_DTDLOAD +
+ libxml2.XML_PARSE_DTDVALID +
+ libxml2.XML_PARSE_NOBLANKS)
+
+ spec = Spec(doc)
+ impl = spec.get_impl()
+ for apiname in apinames:
+ spec.get_api(apiname)
+
+ doc.freeDoc()
+
+ print "%s is successfully parsed" % filename
+
+
+if __name__ == "__main__":
+ main()
diff --git a/src/mesa/es/main/APIspec.xml b/src/mesa/es/main/APIspec.xml
new file mode 100644
index 0000000000..f6f33130b1
--- /dev/null
+++ b/src/mesa/es/main/APIspec.xml
@@ -0,0 +1,4297 @@
+<?xml version="1.0"?>
+<!DOCTYPE apispec SYSTEM "APIspec.dtd">
+
+<!-- A function is generated from a template. Multiple functions can be
+ generated from a single template with different arguments. For example,
+ glColor3f can be generated from
+
+ <function name="Color3f" template="Color" gltype="GLfloat" vector_size="3" expand_vector="true"/>
+
+ and glColor4iv can be generated from
+
+ <function name="Color4iv" template="Color" gltype="GLint" vector_size="4"/>
+
+ In a template, there are <desc>s that describe the properties of
+ parameters. A <desc> can enumerate the valid values of a parameter. It
+ can also specify the error code when an invalid value is given, and etc.
+ By nesting <desc>s, they can create dependency between parameters.
+
+ A function can be marked as external. It means that the function cannot
+ be dispatched to the corresponding mesa function, if one exists, directly,
+ and requires an external implementation.
+-->
+
+<apispec>
+
+<template name="Color">
+ <proto>
+ <return type="void"/>
+ <vector name="v" type="const GLtype *" size="dynamic">
+ <param name="red" type="GLtype"/>
+ <param name="green" type="GLtype"/>
+ <param name="blue" type="GLtype"/>
+ <param name="alpha" type="GLtype"/>
+ </vector>
+ </proto>
+</template>
+
+<template name="ClipPlane">
+ <proto>
+ <return type="void"/>
+ <param name="plane" type="GLenum"/>
+ <vector name="equation" type="const GLtype *" size="4"/>
+ </proto>
+
+ <desc name="plane">
+ <range base="GL_CLIP_PLANE" from="0" to="5"/>
+ </desc>
+</template>
+
+<template name="CullFace">
+ <proto>
+ <return type="void"/>
+ <param name="mode" type="GLenum"/>
+ </proto>
+
+ <desc name="mode">
+ <value name="GL_FRONT"/>
+ <value name="GL_BACK"/>
+ <value name="GL_FRONT_AND_BACK"/>
+ </desc>
+</template>
+
+<template name="Fog">
+ <proto>
+ <return type="void"/>
+ <param name="pname" type="GLenum"/>
+ <vector name="params" type="const GLtype *" size="dynamic">
+ <param name="param" type="GLtype"/>
+ </vector>
+ </proto>
+
+ <desc name="pname">
+ <value name="GL_FOG_MODE"/>
+ <desc name="param">
+ <value name="GL_EXP"/>
+ <value name="GL_EXP2"/>
+ <value name="GL_LINEAR"/>
+ </desc>
+ </desc>
+
+ <desc name="pname">
+ <value name="GL_FOG_COLOR"/>
+
+ <desc name="params" vector_size="4"/>
+ </desc>
+
+ <desc name="pname">
+ <value name="GL_FOG_DENSITY"/>
+ <value name="GL_FOG_START"/>
+ <value name="GL_FOG_END"/>
+
+ <desc name="params" vector_size="1"/>
+ </desc>
+</template>
+
+<template name="FrontFace">
+ <proto>
+ <return type="void"/>
+ <param name="mode" type="GLenum"/>
+ </proto>
+
+ <desc name="mode">
+ <value name="GL_CW"/>
+ <value name="GL_CCW"/>
+ </desc>
+</template>
+
+<template name="Hint">
+ <proto>
+ <return type="void"/>
+ <param name="target" type="GLenum"/>
+ <param name="mode" type="GLenum"/>
+ </proto>
+
+ <desc name="target" category="GLES1.1">
+ <value name="GL_FOG_HINT"/>
+ <value name="GL_LINE_SMOOTH_HINT"/>
+ <value name="GL_PERSPECTIVE_CORRECTION_HINT"/>
+ <value name="GL_POINT_SMOOTH_HINT"/>
+ </desc>
+ <desc name="target" category="OES_standard_derivatives">
+ <value name="GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES"/>
+ </desc>
+ <desc name="target">
+ <value name="GL_GENERATE_MIPMAP_HINT"/>
+ </desc>
+
+ <desc name="mode">
+ <value name="GL_FASTEST"/>
+ <value name="GL_NICEST"/>
+ <value name="GL_DONT_CARE"/>
+ </desc>
+</template>
+
+<template name="Light">
+ <proto>
+ <return type="void"/>
+ <param name="light" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <vector name="params" type="const GLtype *" size="dynamic">
+ <param name="param" type="GLtype"/>
+ </vector>
+ </proto>
+
+ <desc name="light">
+ <range base="GL_LIGHT" from="0" to="7"/>
+ </desc>
+
+ <desc name="pname">
+ <value name="GL_AMBIENT"/>
+ <value name="GL_DIFFUSE"/>
+ <value name="GL_SPECULAR"/>
+ <value name="GL_POSITION"/>
+
+ <desc name="params" vector_size="4"/>
+ </desc>
+
+ <desc name="pname">
+ <value name="GL_SPOT_DIRECTION"/>
+
+ <desc name="params" vector_size="3"/>
+ </desc>
+
+ <desc name="pname">
+ <value name="GL_SPOT_EXPONENT"/>
+ <value name="GL_SPOT_CUTOFF"/>
+ <value name="GL_CONSTANT_ATTENUATION"/>
+ <value name="GL_LINEAR_ATTENUATION"/>
+ <value name="GL_QUADRATIC_ATTENUATION"/>
+
+ <desc name="params" vector_size="1"/>
+ </desc>
+</template>
+
+<template name="LightModel">
+ <proto>
+ <return type="void"/>
+ <param name="pname" type="GLenum"/>
+ <vector name="params" type="const GLtype *" size="dynamic">
+ <param name="param" type="GLtype"/>
+ </vector>
+ </proto>
+
+ <desc name="pname">
+ <value name="GL_LIGHT_MODEL_AMBIENT"/>
+
+ <desc name="params" vector_size="4"/>
+ </desc>
+
+ <desc name="pname">
+ <value name="GL_LIGHT_MODEL_TWO_SIDE"/>
+ <desc name="param">
+ <value name="GL_TRUE"/>
+ <value name="GL_FALSE"/>
+ </desc>
+ </desc>
+</template>
+
+<template name="LineWidth">
+ <proto>
+ <return type="void"/>
+ <param name="width" type="GLtype"/>
+ </proto>
+</template>
+
+<template name="Material">
+ <proto>
+ <return type="void"/>
+ <param name="face" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <vector name="params" type="const GLtype *" size="dynamic">
+ <param name="param" type="GLtype"/>
+ </vector>
+ </proto>
+
+ <desc name="face">
+ <value name="GL_FRONT_AND_BACK"/>
+ </desc>
+
+ <desc name="pname">
+ <value name="GL_AMBIENT"/>
+ <value name="GL_DIFFUSE"/>
+ <value name="GL_AMBIENT_AND_DIFFUSE"/>
+ <value name="GL_SPECULAR"/>
+ <value name="GL_EMISSION"/>
+
+ <desc name="params" vector_size="4"/>
+ </desc>
+
+ <desc name="pname">
+ <value name="GL_SHININESS"/>
+
+ <desc name="params" vector_size="1"/>
+ </desc>
+</template>
+
+<template name="PointSize">
+ <proto>
+ <return type="void"/>
+ <param name="size" type="GLtype"/>
+ </proto>
+</template>
+
+<template name="PointSizePointer">
+ <proto>
+ <return type="void"/>
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ </proto>
+
+ <desc name="type">
+ <value name="GL_FLOAT"/>
+ <value name="GL_FIXED"/>
+ </desc>
+</template>
+
+<template name="Scissor">
+ <proto>
+ <return type="void"/>
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ </proto>
+</template>
+
+<template name="ShadeModel">
+ <proto>
+ <return type="void"/>
+ <param name="mode" type="GLenum"/>
+ </proto>
+
+ <desc name="mode">
+ <value name="GL_FLAT"/>
+ <value name="GL_SMOOTH"/>
+ </desc>
+</template>
+
+<template name="TexParameter">
+ <proto>
+ <return type="void"/>
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <vector name="params" type="const GLtype *" size="dynamic">
+ <param name="param" type="GLtype"/>
+ </vector>
+ </proto>
+
+ <desc name="target">
+ <value name="GL_TEXTURE_2D"/>
+ <value name="GL_TEXTURE_CUBE_MAP" category="GLES2.0"/>
+ <value name="GL_TEXTURE_CUBE_MAP_OES" category="OES_texture_cube_map"/>
+ <value name="GL_TEXTURE_3D_OES" category="OES_texture_3D"/>
+ </desc>
+
+ <desc name="pname">
+ <value name="GL_TEXTURE_WRAP_S"/>
+ <value name="GL_TEXTURE_WRAP_T"/>
+ <value name="GL_TEXTURE_WRAP_R_OES" category="OES_texture_3D"/>
+
+ <desc name="param">
+ <value name="GL_CLAMP_TO_EDGE"/>
+ <value name="GL_REPEAT"/>
+ <value name="GL_MIRRORED_REPEAT" category="GLES2.0"/>
+ <value name="GL_MIRRORED_REPEAT_OES" category="OES_texture_mirrored_repeat"/>
+ </desc>
+ </desc>
+
+ <desc name="pname">
+ <value name="GL_TEXTURE_MIN_FILTER"/>
+
+ <desc name="param">
+ <value name="GL_NEAREST"/>
+ <value name="GL_LINEAR"/>
+ <value name="GL_NEAREST_MIPMAP_NEAREST"/>
+ <value name="GL_NEAREST_MIPMAP_LINEAR"/>
+ <value name="GL_LINEAR_MIPMAP_NEAREST"/>
+ <value name="GL_LINEAR_MIPMAP_LINEAR"/>
+ </desc>
+ </desc>
+
+ <desc name="pname">
+ <value name="GL_TEXTURE_MAG_FILTER"/>
+
+ <desc name="param">
+ <value name="GL_NEAREST"/>
+ <value name="GL_LINEAR"/>
+ </desc>
+ </desc>
+
+ <desc name="pname" category="GLES1.1">
+ <value name="GL_GENERATE_MIPMAP"/>
+
+ <desc name="param">
+ <value name="GL_TRUE"/>
+ <value name="GL_FALSE"/>
+ </desc>
+ </desc>
+
+ <desc name="pname" category="EXT_texture_filter_anisotropic">
+ <value name="GL_TEXTURE_MAX_ANISOTROPY_EXT"/>
+ <desc name="params" vector_size="1"/>
+ </desc>
+
+ <desc name="pname" category="OES_draw_texture">
+ <value name="GL_TEXTURE_CROP_RECT_OES"/>
+ <desc name="params" vector_size="4"/>
+ </desc>
+</template>
+
+<template name="TexImage2D">
+ <proto>
+ <return type="void"/>
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="internalFormat" type="GLint"/> <!-- should be GLenum -->
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="border" type="GLint"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="pixels" type="const GLvoid *"/>
+ </proto>
+
+ <desc name="target">
+ <value name="GL_TEXTURE_2D"/>
+ <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_X" category="GLES2.0"/>
+ <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Y" category="GLES2.0"/>
+ <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Z" category="GLES2.0"/>
+ <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_X" category="GLES2.0"/>
+ <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Y" category="GLES2.0"/>
+ <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Z" category="GLES2.0"/>
+ <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES" category="OES_texture_cube_map"/>
+ <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES" category="OES_texture_cube_map"/>
+ <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES" category="OES_texture_cube_map"/>
+ <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES" category="OES_texture_cube_map"/>
+ <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES" category="OES_texture_cube_map"/>
+ <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES" category="OES_texture_cube_map"/>
+ </desc>
+
+ <desc name="internalFormat" error="GL_INVALID_VALUE">
+ <value name="GL_ALPHA"/>
+ <value name="GL_RGB"/>
+ <value name="GL_RGBA"/>
+ <value name="GL_LUMINANCE"/>
+ <value name="GL_LUMINANCE_ALPHA"/>
+ <value name="GL_DEPTH_COMPONENT" category="OES_depth_texture"/>
+ <value name="GL_DEPTH_STENCIL_OES" category="OES_packed_depth_stencil"/>
+ </desc>
+
+ <desc name="border" error="GL_INVALID_VALUE">
+ <value name="0"/>
+ </desc>
+
+ <desc name="format">
+ <value name="GL_ALPHA"/>
+
+ <desc name="type" error="GL_INVALID_OPERATION">
+ <value name="GL_UNSIGNED_BYTE"/>
+ <value name="GL_FLOAT" category="OES_texture_float"/>
+ <value name="GL_HALF_FLOAT_OES" category="OES_texture_half_float"/>
+ </desc>
+ </desc>
+
+ <desc name="format">
+ <value name="GL_RGB"/>
+
+ <desc name="type" error="GL_INVALID_OPERATION">
+ <value name="GL_UNSIGNED_BYTE"/>
+ <value name="GL_UNSIGNED_SHORT_5_6_5"/>
+ <value name="GL_FLOAT" category="OES_texture_float"/>
+ <value name="GL_HALF_FLOAT_OES" category="OES_texture_half_float"/>
+ </desc>
+ </desc>
+
+ <desc name="format">
+ <value name="GL_RGBA"/>
+
+ <desc name="type" error="GL_INVALID_OPERATION">
+ <value name="GL_UNSIGNED_BYTE"/>
+ <value name="GL_UNSIGNED_SHORT_4_4_4_4"/>
+ <value name="GL_UNSIGNED_SHORT_5_5_5_1"/>
+ <value name="GL_FLOAT" category="OES_texture_float"/>
+ <value name="GL_HALF_FLOAT_OES" category="OES_texture_half_float"/>
+ <value name="GL_UNSIGNED_INT_2_10_10_10_REV_EXT" category="EXT_texture_type_2_10_10_10_REV"/>
+ </desc>
+ </desc>
+
+ <desc name="format">
+ <value name="GL_LUMINANCE"/>
+
+ <desc name="type" error="GL_INVALID_OPERATION">
+ <value name="GL_UNSIGNED_BYTE"/>
+ <value name="GL_FLOAT" category="OES_texture_float"/>
+ <value name="GL_HALF_FLOAT_OES" category="OES_texture_half_float"/>
+ </desc>
+ </desc>
+
+ <desc name="format">
+ <value name="GL_LUMINANCE_ALPHA"/>
+
+ <desc name="type" error="GL_INVALID_OPERATION">
+ <value name="GL_UNSIGNED_BYTE"/>
+ <value name="GL_FLOAT" category="OES_texture_float"/>
+ <value name="GL_HALF_FLOAT_OES" category="OES_texture_half_float"/>
+ </desc>
+ </desc>
+
+ <desc name="format" category="OES_depth_texture">
+ <value name="GL_DEPTH_COMPONENT"/>
+
+ <desc name="type" error="GL_INVALID_OPERATION">
+ <value name="GL_UNSIGNED_SHORT"/>
+ <value name="GL_UNSIGNED_INT"/>
+ </desc>
+ </desc>
+
+ <desc name="format" category="OES_packed_depth_stencil">
+ <value name="GL_DEPTH_STENCIL_OES"/>
+
+ <desc name="type" error="GL_INVALID_OPERATION">
+ <value name="GL_UNSIGNED_INT_24_8_OES"/>
+ </desc>
+ </desc>
+</template>
+
+<template name="TexEnv">
+ <proto>
+ <return type="void"/>
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <vector name="params" type="const GLtype *" size="dynamic">
+ <param name="param" type="GLtype"/>
+ </vector>
+ </proto>
+
+ <desc name="target" category="OES_point_sprite">
+ <value name="GL_POINT_SPRITE_OES"/>
+
+ <desc name="pname">
+ <value name="GL_COORD_REPLACE_OES"/>
+ </desc>
+ </desc>
+
+ <desc name="pname" category="OES_point_sprite">
+ <value name="GL_COORD_REPLACE_OES"/>
+
+ <desc name="param">
+ <value name="GL_TRUE"/>
+ <value name="GL_FALSE"/>
+ </desc>
+ </desc>
+
+ <desc name="target" category="EXT_texture_lod_bias">
+ <value name="GL_TEXTURE_FILTER_CONTROL_EXT"/>
+
+ <desc name="pname">
+ <value name="GL_TEXTURE_LOD_BIAS_EXT"/>
+ </desc>
+ </desc>
+
+ <desc name="pname" category="EXT_texture_lod_bias">
+ <value name="GL_TEXTURE_LOD_BIAS_EXT"/>
+ <desc name="params" vector_size="1"/>
+ </desc>
+
+ <desc name="target">
+ <value name="GL_TEXTURE_ENV"/>
+
+ <desc name="pname">
+ <value name="GL_TEXTURE_ENV_MODE"/>
+ <value name="GL_COMBINE_RGB"/>
+ <value name="GL_COMBINE_ALPHA"/>
+ <value name="GL_RGB_SCALE"/>
+ <value name="GL_ALPHA_SCALE"/>
+ <value name="GL_SRC0_RGB"/>
+ <value name="GL_SRC1_RGB"/>
+ <value name="GL_SRC2_RGB"/>
+ <value name="GL_SRC0_ALPHA"/>
+ <value name="GL_SRC1_ALPHA"/>
+ <value name="GL_SRC2_ALPHA"/>
+ <value name="GL_OPERAND0_RGB"/>
+ <value name="GL_OPERAND1_RGB"/>
+ <value name="GL_OPERAND2_RGB"/>
+ <value name="GL_OPERAND0_ALPHA"/>
+ <value name="GL_OPERAND1_ALPHA"/>
+ <value name="GL_OPERAND2_ALPHA"/>
+ <value name="GL_TEXTURE_ENV_COLOR"/>
+ </desc>
+ </desc>
+
+ <desc name="pname">
+ <value name="GL_TEXTURE_ENV_MODE"/>
+
+ <desc name="param">
+ <value name="GL_REPLACE"/>
+ <value name="GL_MODULATE"/>
+ <value name="GL_DECAL"/>
+ <value name="GL_BLEND"/>
+ <value name="GL_ADD"/>
+ <value name="GL_COMBINE"/>
+ </desc>
+ </desc>
+
+ <desc name="pname">
+ <value name="GL_COMBINE_RGB"/>
+
+ <desc name="param">
+ <value name="GL_REPLACE"/>
+ <value name="GL_MODULATE"/>
+ <value name="GL_ADD"/>
+ <value name="GL_ADD_SIGNED"/>
+ <value name="GL_INTERPOLATE"/>
+ <value name="GL_SUBTRACT"/>
+ <value name="GL_DOT3_RGB"/>
+ <value name="GL_DOT3_RGBA"/>
+ </desc>
+ </desc>
+
+ <desc name="pname">
+ <value name="GL_COMBINE_ALPHA"/>
+
+ <desc name="param">
+ <value name="GL_REPLACE"/>
+ <value name="GL_MODULATE"/>
+ <value name="GL_ADD"/>
+ <value name="GL_ADD_SIGNED"/>
+ <value name="GL_INTERPOLATE"/>
+ <value name="GL_SUBTRACT"/>
+ </desc>
+ </desc>
+
+ <desc name="pname">
+ <value name="GL_RGB_SCALE"/>
+ <value name="GL_ALPHA_SCALE"/>
+
+ <desc name="param" convert="true" error="GL_INVALID_VALUE">
+ <value name="1.0"/>
+ <value name="2.0"/>
+ <value name="4.0"/>
+ </desc>
+ </desc>
+
+ <desc name="pname">
+ <value name="GL_SRC0_RGB"/>
+ <value name="GL_SRC1_RGB"/>
+ <value name="GL_SRC2_RGB"/>
+ <value name="GL_SRC0_ALPHA"/>
+ <value name="GL_SRC1_ALPHA"/>
+ <value name="GL_SRC2_ALPHA"/>
+
+ <desc name="param">
+ <value name="GL_TEXTURE"/>
+ <value name="GL_CONSTANT"/>
+ <value name="GL_PRIMARY_COLOR"/>
+ <value name="GL_PREVIOUS"/>
+
+ <range base="GL_TEXTURE" from="0" to="31" category="OES_texture_env_crossbar"/>
+ </desc>
+ </desc>
+
+ <desc name="pname">
+ <value name="GL_OPERAND0_RGB"/>
+ <value name="GL_OPERAND1_RGB"/>
+ <value name="GL_OPERAND2_RGB"/>
+
+ <desc name="param">
+ <value name="GL_SRC_COLOR"/>
+ <value name="GL_ONE_MINUS_SRC_COLOR"/>
+ <value name="GL_SRC_ALPHA"/>
+ <value name="GL_ONE_MINUS_SRC_ALPHA"/>
+ </desc>
+ </desc>
+
+ <desc name="pname">
+ <value name="GL_OPERAND0_ALPHA"/>
+ <value name="GL_OPERAND1_ALPHA"/>
+ <value name="GL_OPERAND2_ALPHA"/>
+
+ <desc name="param">
+ <value name="GL_SRC_ALPHA"/>
+ <value name="GL_ONE_MINUS_SRC_ALPHA"/>
+ </desc>
+ </desc>
+
+ <desc name="pname">
+ <value name="GL_TEXTURE_ENV_COLOR"/>
+
+ <desc name="params" vector_size="4"/>
+ </desc>
+</template>
+
+<template name="TexGen">
+ <proto>
+ <return type="void"/>
+ <param name="coord" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <vector name="params" type="const GLtype *" size="dynamic">
+ <param name="param" type="GLtype"/>
+ </vector>
+ </proto>
+
+ <desc name="coord" category="OES_texture_cube_map">
+ <value name="GL_TEXTURE_GEN_STR_OES"/>
+ </desc>
+
+ <desc name="pname" category="OES_texture_cube_map">
+ <value name="GL_TEXTURE_GEN_MODE_OES"/>
+
+ <desc name="param">
+ <value name="GL_NORMAL_MAP_OES"/>
+ <value name="GL_REFLECTION_MAP_OES"/>
+ </desc>
+ </desc>
+</template>
+
+<template name="Clear">
+ <proto>
+ <return type="void"/>
+ <param name="mask" type="GLbitfield"/>
+ </proto>
+
+ <desc name="mask" error="GL_INVALID_VALUE">
+ <value name="0"/>
+ <value name="(GL_COLOR_BUFFER_BIT)"/>
+ <value name="(GL_DEPTH_BUFFER_BIT)"/>
+ <value name="(GL_STENCIL_BUFFER_BIT)"/>
+ <value name="(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT)"/>
+ <value name="(GL_COLOR_BUFFER_BIT|GL_STENCIL_BUFFER_BIT)"/>
+ <value name="(GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT)"/>
+ <value name="(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT)"/>
+ </desc>
+</template>
+
+<template name="ClearColor">
+ <proto>
+ <return type="void"/>
+ <param name="red" type="GLtype"/>
+ <param name="green" type="GLtype"/>
+ <param name="blue" type="GLtype"/>
+ <param name="alpha" type="GLtype"/>
+ </proto>
+</template>
+
+<template name="ClearStencil">
+ <proto>
+ <return type="void"/>
+ <param name="s" type="GLint"/>
+ </proto>
+</template>
+
+<template name="ClearDepth">
+ <proto>
+ <return type="void"/>
+ <param name="depth" type="GLtype"/>
+ </proto>
+</template>
+
+<template name="StencilMask">
+ <proto>
+ <return type="void"/>
+ <param name="mask" type="GLuint"/>
+ </proto>
+</template>
+
+<template name="StencilMaskSeparate">
+ <proto>
+ <return type="void"/>
+ <param name="face" type="GLenum"/>
+ <param name="mask" type="GLuint"/>
+ </proto>
+
+ <desc name="face">
+ <value name="GL_FRONT"/>
+ <value name="GL_BACK"/>
+ <value name="GL_FRONT_AND_BACK"/>
+ </desc>
+</template>
+
+<template name="ColorMask">
+ <proto>
+ <return type="void"/>
+ <param name="red" type="GLboolean"/>
+ <param name="green" type="GLboolean"/>
+ <param name="blue" type="GLboolean"/>
+ <param name="alpha" type="GLboolean"/>
+ </proto>
+</template>
+
+<template name="DepthMask">
+ <proto>
+ <return type="void"/>
+ <param name="flag" type="GLboolean"/>
+ </proto>
+</template>
+
+<template name="Disable">
+ <proto>
+ <return type="void"/>
+ <param name="cap" type="GLenum"/>
+ </proto>
+
+ <desc name="cap" category="GLES1.1">
+ <value name="GL_NORMALIZE"/>
+ <value name="GL_RESCALE_NORMAL"/>
+
+ <range base="GL_CLIP_PLANE" from="0" to="5"/>
+
+ <value name="GL_FOG"/>
+ <value name="GL_LIGHTING"/>
+ <value name="GL_COLOR_MATERIAL"/>
+
+ <range base="GL_LIGHT" from="0" to="7"/>
+
+ <value name="GL_POINT_SMOOTH"/>
+ <value name="GL_LINE_SMOOTH"/>
+ <value name="GL_CULL_FACE"/>
+ <value name="GL_POLYGON_OFFSET_FILL"/>
+ <value name="GL_MULTISAMPLE"/>
+ <value name="GL_SAMPLE_ALPHA_TO_COVERAGE"/>
+ <value name="GL_SAMPLE_ALPHA_TO_ONE"/>
+ <value name="GL_SAMPLE_COVERAGE"/>
+ <value name="GL_TEXTURE_2D"/>
+ <value name="GL_SCISSOR_TEST"/>
+ <value name="GL_ALPHA_TEST"/>
+ <value name="GL_STENCIL_TEST"/>
+ <value name="GL_DEPTH_TEST"/>
+ <value name="GL_BLEND"/>
+ <value name="GL_DITHER"/>
+ <value name="GL_COLOR_LOGIC_OP"/>
+
+ <value name="GL_POINT_SPRITE_OES" category="OES_point_sprite"/>
+ <value name="GL_MATRIX_PALETTE_OES" category="OES_matrix_palette"/>
+ <value name="GL_TEXTURE_CUBE_MAP_OES" category="OES_texture_cube_map"/>
+ <value name="GL_TEXTURE_GEN_STR_OES" category="OES_texture_cube_map"/>
+ </desc>
+
+ <desc name="cap" category="GLES2.0">
+ <value name="GL_CULL_FACE"/>
+ <value name="GL_SCISSOR_TEST"/>
+ <value name="GL_POLYGON_OFFSET_FILL"/>
+ <value name="GL_SAMPLE_ALPHA_TO_COVERAGE"/>
+ <value name="GL_SAMPLE_COVERAGE"/>
+ <value name="GL_STENCIL_TEST"/>
+ <value name="GL_DEPTH_TEST"/>
+ <value name="GL_DITHER"/>
+ <value name="GL_BLEND"/>
+ </desc>
+</template>
+
+<!-- it is exactly the same as Disable -->
+<template name="Enable">
+ <proto>
+ <return type="void"/>
+ <param name="cap" type="GLenum"/>
+ </proto>
+
+ <desc name="cap" category="GLES1.1">
+ <value name="GL_NORMALIZE"/>
+ <value name="GL_RESCALE_NORMAL"/>
+
+ <range base="GL_CLIP_PLANE" from="0" to="5"/>
+
+ <value name="GL_FOG"/>
+ <value name="GL_LIGHTING"/>
+ <value name="GL_COLOR_MATERIAL"/>
+
+ <range base="GL_LIGHT" from="0" to="7"/>
+
+ <value name="GL_POINT_SMOOTH"/>
+ <value name="GL_LINE_SMOOTH"/>
+ <value name="GL_CULL_FACE"/>
+ <value name="GL_POLYGON_OFFSET_FILL"/>
+ <value name="GL_MULTISAMPLE"/>
+ <value name="GL_SAMPLE_ALPHA_TO_COVERAGE"/>
+ <value name="GL_SAMPLE_ALPHA_TO_ONE"/>
+ <value name="GL_SAMPLE_COVERAGE"/>
+ <value name="GL_TEXTURE_2D"/>
+ <value name="GL_SCISSOR_TEST"/>
+ <value name="GL_ALPHA_TEST"/>
+ <value name="GL_STENCIL_TEST"/>
+ <value name="GL_DEPTH_TEST"/>
+ <value name="GL_BLEND"/>
+ <value name="GL_DITHER"/>
+ <value name="GL_COLOR_LOGIC_OP"/>
+
+ <value name="GL_POINT_SPRITE_OES" category="OES_point_sprite"/>
+ <value name="GL_MATRIX_PALETTE_OES" category="OES_matrix_palette"/>
+ <value name="GL_TEXTURE_CUBE_MAP_OES" category="OES_texture_cube_map"/>
+ <value name="GL_TEXTURE_GEN_STR_OES" category="OES_texture_cube_map"/>
+ </desc>
+
+ <desc name="cap" category="GLES2.0">
+ <value name="GL_CULL_FACE"/>
+ <value name="GL_SCISSOR_TEST"/>
+ <value name="GL_POLYGON_OFFSET_FILL"/>
+ <value name="GL_SAMPLE_ALPHA_TO_COVERAGE"/>
+ <value name="GL_SAMPLE_COVERAGE"/>
+ <value name="GL_STENCIL_TEST"/>
+ <value name="GL_DEPTH_TEST"/>
+ <value name="GL_DITHER"/>
+ <value name="GL_BLEND"/>
+ </desc>
+</template>
+
+<template name="Finish">
+ <proto>
+ <return type="void"/>
+ </proto>
+</template>
+
+<template name="Flush">
+ <proto>
+ <return type="void"/>
+ </proto>
+</template>
+
+<template name="AlphaFunc">
+ <proto>
+ <return type="void"/>
+ <param name="func" type="GLenum"/>
+ <param name="ref" type="GLtype"/>
+ </proto>
+ <desc name="func">
+ <value name="GL_NEVER"/>
+ <value name="GL_LESS"/>
+ <value name="GL_EQUAL"/>
+ <value name="GL_LEQUAL"/>
+ <value name="GL_GREATER"/>
+ <value name="GL_NOTEQUAL"/>
+ <value name="GL_GEQUAL"/>
+ <value name="GL_ALWAYS"/>
+ </desc>
+</template>
+
+<template name="BlendFunc">
+ <proto>
+ <return type="void"/>
+ <param name="sfactor" type="GLenum"/>
+ <param name="dfactor" type="GLenum"/>
+ </proto>
+
+ <desc name="sfactor">
+ <value name="GL_ZERO"/>
+ <value name="GL_ONE"/>
+ <value name="GL_SRC_COLOR"/>
+ <value name="GL_ONE_MINUS_SRC_COLOR"/>
+ <value name="GL_SRC_ALPHA"/>
+ <value name="GL_ONE_MINUS_SRC_ALPHA"/>
+ <value name="GL_DST_ALPHA"/>
+ <value name="GL_ONE_MINUS_DST_ALPHA"/>
+ <value name="GL_DST_COLOR"/>
+ <value name="GL_ONE_MINUS_DST_COLOR"/>
+ <value name="GL_SRC_ALPHA_SATURATE"/>
+
+ <value name="GL_CONSTANT_COLOR" category="GLES2.0"/>
+ <value name="GL_CONSTANT_ALPHA" category="GLES2.0"/>
+ <value name="GL_ONE_MINUS_CONSTANT_COLOR" category="GLES2.0"/>
+ <value name="GL_ONE_MINUS_CONSTANT_ALPHA" category="GLES2.0"/>
+ </desc>
+
+ <desc name="dfactor">
+ <value name="GL_ZERO"/>
+ <value name="GL_ONE"/>
+ <value name="GL_SRC_COLOR"/>
+ <value name="GL_ONE_MINUS_SRC_COLOR"/>
+ <value name="GL_SRC_ALPHA"/>
+ <value name="GL_ONE_MINUS_SRC_ALPHA"/>
+ <value name="GL_DST_ALPHA"/>
+ <value name="GL_ONE_MINUS_DST_ALPHA"/>
+ <value name="GL_DST_COLOR"/>
+ <value name="GL_ONE_MINUS_DST_COLOR"/>
+
+ <value name="GL_CONSTANT_COLOR" category="GLES2.0"/>
+ <value name="GL_CONSTANT_ALPHA" category="GLES2.0"/>
+ <value name="GL_ONE_MINUS_CONSTANT_COLOR" category="GLES2.0"/>
+ <value name="GL_ONE_MINUS_CONSTANT_ALPHA" category="GLES2.0"/>
+ </desc>
+</template>
+
+<template name="LogicOp">
+ <proto>
+ <return type="void"/>
+ <param name="opcode" type="GLenum"/>
+ </proto>
+
+ <desc name="opcode">
+ <value name="GL_CLEAR"/>
+ <value name="GL_SET"/>
+ <value name="GL_COPY"/>
+ <value name="GL_COPY_INVERTED"/>
+ <value name="GL_NOOP"/>
+ <value name="GL_INVERT"/>
+ <value name="GL_AND"/>
+ <value name="GL_NAND"/>
+ <value name="GL_OR"/>
+ <value name="GL_NOR"/>
+ <value name="GL_XOR"/>
+ <value name="GL_EQUIV"/>
+ <value name="GL_AND_REVERSE"/>
+ <value name="GL_AND_INVERTED"/>
+ <value name="GL_OR_REVERSE"/>
+ <value name="GL_OR_INVERTED"/>
+ </desc>
+</template>
+
+<template name="StencilFunc">
+ <proto>
+ <return type="void"/>
+ <param name="func" type="GLenum"/>
+ <param name="ref" type="GLint"/>
+ <param name="mask" type="GLuint"/>
+ </proto>
+
+ <desc name="func">
+ <value name="GL_NEVER"/>
+ <value name="GL_LESS"/>
+ <value name="GL_LEQUAL"/>
+ <value name="GL_GREATER"/>
+ <value name="GL_GEQUAL"/>
+ <value name="GL_EQUAL"/>
+ <value name="GL_NOTEQUAL"/>
+ <value name="GL_ALWAYS"/>
+ </desc>
+</template>
+
+<template name="StencilFuncSeparate">
+ <proto>
+ <return type="void"/>
+ <param name="face" type="GLenum"/>
+ <param name="func" type="GLenum"/>
+ <param name="ref" type="GLint"/>
+ <param name="mask" type="GLuint"/>
+ </proto>
+
+ <desc name="face">
+ <value name="GL_FRONT"/>
+ <value name="GL_BACK"/>
+ <value name="GL_FRONT_AND_BACK"/>
+ </desc>
+
+ <desc name="func">
+ <value name="GL_NEVER"/>
+ <value name="GL_LESS"/>
+ <value name="GL_LEQUAL"/>
+ <value name="GL_GREATER"/>
+ <value name="GL_GEQUAL"/>
+ <value name="GL_EQUAL"/>
+ <value name="GL_NOTEQUAL"/>
+ <value name="GL_ALWAYS"/>
+ </desc>
+</template>
+
+<template name="StencilOp">
+ <proto>
+ <return type="void"/>
+ <param name="fail" type="GLenum"/>
+ <param name="zfail" type="GLenum"/>
+ <param name="zpass" type="GLenum"/>
+ </proto>
+
+ <desc name="fail">
+ <value name="GL_KEEP"/>
+ <value name="GL_ZERO"/>
+ <value name="GL_REPLACE"/>
+ <value name="GL_INCR"/>
+ <value name="GL_DECR"/>
+ <value name="GL_INVERT"/>
+ <value name="GL_INCR_WRAP" category="GLES2.0"/>
+ <value name="GL_DECR_WRAP" category="GLES2.0"/>
+ <value name="GL_INCR_WRAP_OES" category="OES_stencil_wrap"/>
+ <value name="GL_DECR_WRAP_OES" category="OES_stencil_wrap"/>
+ </desc>
+
+ <desc name="zfail">
+ <value name="GL_KEEP"/>
+ <value name="GL_ZERO"/>
+ <value name="GL_REPLACE"/>
+ <value name="GL_INCR"/>
+ <value name="GL_DECR"/>
+ <value name="GL_INVERT"/>
+ <value name="GL_INCR_WRAP" category="GLES2.0"/>
+ <value name="GL_DECR_WRAP" category="GLES2.0"/>
+ <value name="GL_INCR_WRAP_OES" category="OES_stencil_wrap"/>
+ <value name="GL_DECR_WRAP_OES" category="OES_stencil_wrap"/>
+ </desc>
+
+ <desc name="zpass">
+ <value name="GL_KEEP"/>
+ <value name="GL_ZERO"/>
+ <value name="GL_REPLACE"/>
+ <value name="GL_INCR"/>
+ <value name="GL_DECR"/>
+ <value name="GL_INVERT"/>
+ <value name="GL_INCR_WRAP" category="GLES2.0"/>
+ <value name="GL_DECR_WRAP" category="GLES2.0"/>
+ <value name="GL_INCR_WRAP_OES" category="OES_stencil_wrap"/>
+ <value name="GL_DECR_WRAP_OES" category="OES_stencil_wrap"/>
+ </desc>
+</template>
+
+<template name="StencilOpSeparate">
+ <proto>
+ <return type="void"/>
+ <param name="face" type="GLenum"/>
+ <param name="fail" type="GLenum"/>
+ <param name="zfail" type="GLenum"/>
+ <param name="zpass" type="GLenum"/>
+ </proto>
+
+ <desc name="face">
+ <value name="GL_FRONT"/>
+ <value name="GL_BACK"/>
+ <value name="GL_FRONT_AND_BACK"/>
+ </desc>
+
+ <desc name="fail">
+ <value name="GL_KEEP"/>
+ <value name="GL_ZERO"/>
+ <value name="GL_REPLACE"/>
+ <value name="GL_INCR"/>
+ <value name="GL_DECR"/>
+ <value name="GL_INVERT"/>
+ <value name="GL_INCR_WRAP"/>
+ <value name="GL_DECR_WRAP"/>
+ </desc>
+
+ <desc name="zfail">
+ <value name="GL_KEEP"/>
+ <value name="GL_ZERO"/>
+ <value name="GL_REPLACE"/>
+ <value name="GL_INCR"/>
+ <value name="GL_DECR"/>
+ <value name="GL_INVERT"/>
+ <value name="GL_INCR_WRAP"/>
+ <value name="GL_DECR_WRAP"/>
+ </desc>
+
+ <desc name="zpass">
+ <value name="GL_KEEP"/>
+ <value name="GL_ZERO"/>
+ <value name="GL_REPLACE"/>
+ <value name="GL_INCR"/>
+ <value name="GL_DECR"/>
+ <value name="GL_INVERT"/>
+ <value name="GL_INCR_WRAP"/>
+ <value name="GL_DECR_WRAP"/>
+ </desc>
+</template>
+
+<template name="DepthFunc">
+ <proto>
+ <return type="void"/>
+ <param name="func" type="GLenum"/>
+ </proto>
+
+ <desc name="func">
+ <value name="GL_NEVER"/>
+ <value name="GL_LESS"/>
+ <value name="GL_EQUAL"/>
+ <value name="GL_LEQUAL"/>
+ <value name="GL_GREATER"/>
+ <value name="GL_NOTEQUAL"/>
+ <value name="GL_GEQUAL"/>
+ <value name="GL_ALWAYS"/>
+ </desc>
+</template>
+
+<template name="PixelStore">
+ <proto>
+ <return type="void"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLtype"/>
+ </proto>
+
+ <desc name="pname">
+ <value name="GL_PACK_ALIGNMENT"/>
+ <value name="GL_UNPACK_ALIGNMENT"/>
+ </desc>
+
+ <desc name="param" error="GL_INVALID_VALUE">
+ <value name="1"/>
+ <value name="2"/>
+ <value name="4"/>
+ <value name="8"/>
+ </desc>
+</template>
+
+<template name="ReadPixels" direction="get">
+ <proto>
+ <return type="void"/>
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="pixels" type="GLvoid *"/>
+ </proto>
+
+ <!-- Technically, only two combinations are actually allowed:
+ GL_RGBA/GL_UNSIGNED_BYTE, and some implementation-specific
+ internal preferred combination. I don't know what that is, so I'm
+ allowing any valid combination for now; the underlying support
+ should fail when necessary.-->
+ <desc name="format">
+ <value name="GL_ALPHA"/>
+ <desc name="type" error="GL_INVALID_OPERATION">
+ <value name="GL_UNSIGNED_BYTE"/>
+ </desc>
+ </desc>
+
+ <desc name="format">
+ <value name="GL_RGB"/>
+ <desc name="type" error="GL_INVALID_OPERATION">
+ <value name="GL_UNSIGNED_BYTE"/>
+ <value name="GL_UNSIGNED_SHORT_5_6_5"/>
+ </desc>
+ </desc>
+
+ <desc name="format">
+ <value name="GL_RGBA"/>
+ <desc name="type" error="GL_INVALID_OPERATION">
+ <value name="GL_UNSIGNED_BYTE"/>
+ <value name="GL_UNSIGNED_SHORT_4_4_4_4"/>
+ <value name="GL_UNSIGNED_SHORT_5_5_5_1"/>
+ </desc>
+ </desc>
+
+ <desc name="format">
+ <value name="GL_LUMINANCE"/>
+ <desc name="type" error="GL_INVALID_OPERATION">
+ <value name="GL_UNSIGNED_BYTE"/>
+ </desc>
+ </desc>
+
+ <desc name="format">
+ <value name="GL_LUMINANCE_ALPHA"/>
+ <desc name="type" error="GL_INVALID_OPERATION">
+ <value name="GL_UNSIGNED_BYTE"/>
+ </desc>
+ </desc>
+
+ <desc name="format" category="EXT_read_format_bgra">
+ <value name="GL_BGRA_EXT"/>
+
+ <desc name="type" error="GL_INVALID_OPERATION">
+ <value name="GL_UNSIGNED_BYTE"/>
+ <value name="GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT"/>
+ <value name="GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT"/>
+ </desc>
+ </desc>
+</template>
+
+<template name="GetClipPlane" direction="get">
+ <proto>
+ <return type="void"/>
+ <param name="plane" type="GLenum"/>
+ <vector name="equation" type="GLtype *" size="4"/>
+ </proto>
+
+ <desc name="plane">
+ <range base="GL_CLIP_PLANE" from="0" to="5"/>
+ </desc>
+</template>
+
+<template name="GetError" direction="get">
+ <proto>
+ <return type="GLenum"/>
+ </proto>
+</template>
+
+<!-- template for GetFloatv, GetIntegerv, GetBoolean, and GetFixedv -->
+<template name="GetState" direction="get">
+ <proto>
+ <return type="void"/>
+ <param name="pname" type="GLenum"/>
+ <vector name="params" type="GLtype *" size="dynamic"/>
+ </proto>
+ <!-- param checking is done in mesa -->
+</template>
+
+<template name="GetLight" direction="get">
+ <proto>
+ <return type="void"/>
+ <param name="light" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <vector name="params" type="GLtype *" size="dynamic"/>
+ </proto>
+
+ <desc name="light">
+ <range base="GL_LIGHT" from="0" to="7"/>
+ </desc>
+
+ <desc name="pname">
+ <value name="GL_AMBIENT"/>
+ <value name="GL_DIFFUSE"/>
+ <value name="GL_SPECULAR"/>
+ <value name="GL_POSITION"/>
+
+ <desc name="params" vector_size="4"/>
+ </desc>
+
+ <desc name="pname">
+ <value name="GL_SPOT_DIRECTION"/>
+
+ <desc name="params" vector_size="3"/>
+ </desc>
+
+ <desc name="pname">
+ <value name="GL_SPOT_EXPONENT"/>
+ <value name="GL_SPOT_CUTOFF"/>
+ <value name="GL_CONSTANT_ATTENUATION"/>
+ <value name="GL_LINEAR_ATTENUATION"/>
+ <value name="GL_QUADRATIC_ATTENUATION"/>
+
+ <desc name="params" vector_size="1"/>
+ </desc>
+</template>
+
+<template name="GetMaterial" direction="get">
+ <proto>
+ <return type="void"/>
+ <param name="face" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <vector name="params" type="GLtype *" size="dynamic">
+ <param name="param" type="GLtype"/>
+ </vector>
+ </proto>
+
+ <desc name="face">
+ <value name="GL_FRONT"/>
+ <value name="GL_BACK"/>
+ </desc>
+
+ <desc name="pname">
+ <value name="GL_SHININESS"/>
+ <desc name="params" vector_size="1"/>
+ </desc>
+
+ <desc name="pname">
+ <value name="GL_AMBIENT"/>
+ <value name="GL_DIFFUSE"/>
+ <value name="GL_AMBIENT_AND_DIFFUSE"/>
+ <value name="GL_SPECULAR"/>
+ <value name="GL_EMISSION"/>
+
+ <desc name="params" vector_size="4"/>
+ </desc>
+</template>
+
+<template name="GetString" direction="get">
+ <proto>
+ <return type="const GLubyte *"/>
+ <param name="name" type="GLenum"/>
+ </proto>
+
+ <desc name="name">
+ <value name="GL_VENDOR"/>
+ <value name="GL_RENDERER"/>
+ <value name="GL_VERSION"/>
+ <value name="GL_EXTENSIONS"/>
+ <value name="GL_SHADING_LANGUAGE_VERSION" category="GLES2.0"/>
+ </desc>
+</template>
+
+<template name="GetTexEnv" direction="get">
+ <proto>
+ <return type="void"/>
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <vector name="params" type="GLtype *" size="dynamic"/>
+ </proto>
+
+ <desc name="target" category="OES_point_sprite">
+ <value name="GL_POINT_SPRITE_OES"/>
+ <desc name="pname">
+ <value name="GL_COORD_REPLACE_OES"/>
+ </desc>
+ </desc>
+
+ <desc name="pname" category="OES_point_sprite">
+ <value name="GL_COORD_REPLACE_OES"/>
+ <desc name="params" vector_size="1" convert="false"/>
+ </desc>
+
+ <desc name="target" category="EXT_texture_lod_bias">
+ <value name="GL_TEXTURE_FILTER_CONTROL_EXT"/>
+
+ <desc name="pname">
+ <value name="GL_TEXTURE_LOD_BIAS_EXT"/>
+ </desc>
+ </desc>
+
+ <desc name="pname" category="EXT_texture_lod_bias">
+ <value name="GL_TEXTURE_LOD_BIAS_EXT"/>
+ <desc name="params" vector_size="1"/>
+ </desc>
+
+ <desc name="target">
+ <value name="GL_TEXTURE_ENV"/>
+
+ <desc name="pname">
+ <value name="GL_TEXTURE_ENV_COLOR"/>
+ <value name="GL_RGB_SCALE"/>
+ <value name="GL_ALPHA_SCALE"/>
+ <value name="GL_TEXTURE_ENV_MODE"/>
+ <value name="GL_COMBINE_RGB"/>
+ <value name="GL_COMBINE_ALPHA"/>
+ <value name="GL_SRC0_RGB"/>
+ <value name="GL_SRC1_RGB"/>
+ <value name="GL_SRC2_RGB"/>
+ <value name="GL_SRC0_ALPHA"/>
+ <value name="GL_SRC1_ALPHA"/>
+ <value name="GL_SRC2_ALPHA"/>
+ <value name="GL_OPERAND0_RGB"/>
+ <value name="GL_OPERAND1_RGB"/>
+ <value name="GL_OPERAND2_RGB"/>
+ <value name="GL_OPERAND0_ALPHA"/>
+ <value name="GL_OPERAND1_ALPHA"/>
+ <value name="GL_OPERAND2_ALPHA"/>
+ </desc>
+ </desc>
+
+ <desc name="pname">
+ <value name="GL_TEXTURE_ENV_COLOR"/>
+ <desc name="params" vector_size="4"/>
+ </desc>
+
+ <desc name="pname">
+ <value name="GL_RGB_SCALE"/>
+ <value name="GL_ALPHA_SCALE"/>
+
+ <desc name="params" vector_size="1"/>
+ </desc>
+
+ <desc name="pname">
+ <value name="GL_TEXTURE_ENV_MODE"/>
+ <value name="GL_COMBINE_RGB"/>
+ <value name="GL_COMBINE_ALPHA"/>
+ <value name="GL_SRC0_RGB"/>
+ <value name="GL_SRC1_RGB"/>
+ <value name="GL_SRC2_RGB"/>
+ <value name="GL_SRC0_ALPHA"/>
+ <value name="GL_SRC1_ALPHA"/>
+ <value name="GL_SRC2_ALPHA"/>
+ <value name="GL_OPERAND0_RGB"/>
+ <value name="GL_OPERAND1_RGB"/>
+ <value name="GL_OPERAND2_RGB"/>
+ <value name="GL_OPERAND0_ALPHA"/>
+ <value name="GL_OPERAND1_ALPHA"/>
+ <value name="GL_OPERAND2_ALPHA"/>
+
+ <desc name="params" vector_size="1" convert="false"/>
+ </desc>
+</template>
+
+<template name="GetTexGen" direction="get">
+ <proto>
+ <return type="void"/>
+ <param name="coord" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <vector name="params" type="GLtype *" size="dynamic"/>
+ </proto>
+
+ <desc name="coord">
+ <value name="GL_TEXTURE_GEN_STR_OES"/>
+ </desc>
+ <desc name="pname">
+ <value name="GL_TEXTURE_GEN_MODE_OES"/>
+ <desc name="params" vector_size="1" convert="false"/>
+ </desc>
+</template>
+
+<template name="GetTexParameter" direction="get">
+ <proto>
+ <return type="void"/>
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <vector name="params" type="GLtype *" size="dynamic"/>
+ </proto>
+
+ <desc name="target">
+ <value name="GL_TEXTURE_2D"/>
+ <value name="GL_TEXTURE_CUBE_MAP" category="GLES2.0"/>
+ <value name="GL_TEXTURE_CUBE_MAP_OES" category="OES_texture_cube_map"/>
+ <value name="GL_TEXTURE_3D_OES" category="OES_texture_3D"/>
+ </desc>
+
+ <desc name="pname">
+ <value name="GL_TEXTURE_WRAP_S"/>
+ <value name="GL_TEXTURE_WRAP_T"/>
+ <value name="GL_TEXTURE_WRAP_R_OES" category="OES_texture_3D"/>
+ <value name="GL_TEXTURE_MIN_FILTER"/>
+ <value name="GL_TEXTURE_MAG_FILTER"/>
+ <value name="GL_GENERATE_MIPMAP" category="GLES1.1"/>
+
+ <desc name="params" vector_size="1" convert="false"/>
+ </desc>
+
+ <desc name="pname" category="OES_draw_texture">
+ <value name="GL_TEXTURE_CROP_RECT_OES"/>
+ <desc name="params" vector_size="4"/>
+ </desc>
+</template>
+
+<template name="IsEnabled" direction="get">
+ <proto>
+ <return type="GLboolean"/>
+ <param name="cap" type="GLenum"/>
+ </proto>
+
+ <desc name="cap" category="GLES1.1">
+ <value name="GL_NORMALIZE"/>
+ <value name="GL_RESCALE_NORMAL"/>
+
+ <range base="GL_CLIP_PLANE" from="0" to="5"/>
+
+ <value name="GL_FOG"/>
+ <value name="GL_LIGHTING"/>
+ <value name="GL_COLOR_MATERIAL"/>
+
+ <range base="GL_LIGHT" from="0" to="7"/>
+
+ <value name="GL_POINT_SMOOTH"/>
+ <value name="GL_LINE_SMOOTH"/>
+ <value name="GL_CULL_FACE"/>
+ <value name="GL_POLYGON_OFFSET_FILL"/>
+ <value name="GL_MULTISAMPLE"/>
+ <value name="GL_SAMPLE_ALPHA_TO_COVERAGE"/>
+ <value name="GL_SAMPLE_ALPHA_TO_ONE"/>
+ <value name="GL_SAMPLE_COVERAGE"/>
+ <value name="GL_TEXTURE_2D"/>
+ <value name="GL_SCISSOR_TEST"/>
+ <value name="GL_ALPHA_TEST"/>
+ <value name="GL_STENCIL_TEST"/>
+ <value name="GL_DEPTH_TEST"/>
+ <value name="GL_BLEND"/>
+ <value name="GL_DITHER"/>
+ <value name="GL_COLOR_LOGIC_OP"/>
+
+ <value name="GL_POINT_SPRITE_OES" category="OES_point_sprite"/>
+ <value name="GL_TEXTURE_CUBE_MAP_OES" category="OES_texture_cube_map"/>
+ <value name="GL_TEXTURE_GEN_STR_OES" category="OES_texture_cube_map"/>
+
+ <value name="GL_VERTEX_ARRAY"/>
+ <value name="GL_NORMAL_ARRAY"/>
+ <value name="GL_COLOR_ARRAY"/>
+ <value name="GL_TEXTURE_COORD_ARRAY"/>
+ <value name="GL_MATRIX_INDEX_ARRAY_OES" category="OES_matrix_palette"/>
+ <value name="GL_WEIGHT_ARRAY_OES" category="OES_matrix_palette"/>
+ <value name="GL_POINT_SIZE_ARRAY_OES" category="OES_point_size_array"/>
+ </desc>
+
+ <desc name="cap" category="GLES2.0">
+ <value name="GL_CULL_FACE"/>
+ <value name="GL_SCISSOR_TEST"/>
+ <value name="GL_POLYGON_OFFSET_FILL"/>
+ <value name="GL_SAMPLE_ALPHA_TO_COVERAGE"/>
+ <value name="GL_SAMPLE_COVERAGE"/>
+ <value name="GL_STENCIL_TEST"/>
+ <value name="GL_DEPTH_TEST"/>
+ <value name="GL_DITHER"/>
+ <value name="GL_BLEND"/>
+ </desc>
+</template>
+
+<template name="DepthRange">
+ <proto>
+ <return type="void"/>
+ <param name="zNear" type="GLtype"/>
+ <param name="zFar" type="GLtype"/>
+ </proto>
+</template>
+
+<template name="Frustum">
+ <proto>
+ <return type="void"/>
+ <param name="left" type="GLtype"/>
+ <param name="right" type="GLtype"/>
+ <param name="bottom" type="GLtype"/>
+ <param name="top" type="GLtype"/>
+ <param name="zNear" type="GLtype"/>
+ <param name="zFar" type="GLtype"/>
+ </proto>
+</template>
+
+<template name="LoadIdentity">
+ <proto>
+ <return type="void"/>
+ </proto>
+</template>
+
+<template name="LoadMatrix">
+ <proto>
+ <return type="void"/>
+ <vector name="m" type="const GLtype *" size="16"/>
+ </proto>
+</template>
+
+<template name="MatrixMode">
+ <proto>
+ <return type="void"/>
+ <param name="mode" type="GLenum"/>
+ </proto>
+
+ <desc name="mode">
+ <value name="GL_MODELVIEW"/>
+ <value name="GL_PROJECTION"/>
+ <value name="GL_TEXTURE"/>
+ <value name="GL_MATRIX_PALETTE_OES" category="OES_matrix_palette"/>
+ </desc>
+</template>
+
+<template name="MultMatrix">
+ <proto>
+ <return type="void"/>
+ <vector name="m" type="const GLtype *" size="16"/>
+ </proto>
+</template>
+
+<template name="Ortho">
+ <proto>
+ <return type="void"/>
+ <param name="left" type="GLtype"/>
+ <param name="right" type="GLtype"/>
+ <param name="bottom" type="GLtype"/>
+ <param name="top" type="GLtype"/>
+ <param name="zNear" type="GLtype"/>
+ <param name="zFar" type="GLtype"/>
+ </proto>
+</template>
+
+<template name="PopMatrix">
+ <proto>
+ <return type="void"/>
+ </proto>
+</template>
+
+<template name="PushMatrix">
+ <proto>
+ <return type="void"/>
+ </proto>
+</template>
+
+<template name="Rotate">
+ <proto>
+ <return type="void"/>
+ <param name="angle" type="GLtype"/>
+ <param name="x" type="GLtype"/>
+ <param name="y" type="GLtype"/>
+ <param name="z" type="GLtype"/>
+ </proto>
+</template>
+
+<template name="Scale">
+ <proto>
+ <return type="void"/>
+ <param name="x" type="GLtype"/>
+ <param name="y" type="GLtype"/>
+ <param name="z" type="GLtype"/>
+ </proto>
+</template>
+
+<template name="Translate">
+ <proto>
+ <return type="void"/>
+ <param name="x" type="GLtype"/>
+ <param name="y" type="GLtype"/>
+ <param name="z" type="GLtype"/>
+ </proto>
+</template>
+
+<template name="Viewport">
+ <proto>
+ <return type="void"/>
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ </proto>
+</template>
+
+<template name="ColorPointer">
+ <proto>
+ <return type="void"/>
+ <param name="size" type="GLint"/>
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ </proto>
+
+ <desc name="size" error="GL_INVALID_VALUE">
+ <value name="4"/>
+ </desc>
+
+ <desc name="type">
+ <value name="GL_UNSIGNED_BYTE"/>
+ <value name="GL_FLOAT"/>
+ <value name="GL_FIXED"/>
+ <value name="GL_HALF_FLOAT_OES" category="OES_vertex_half_float"/>
+ </desc>
+</template>
+
+<template name="DisableClientState">
+ <proto>
+ <return type="void"/>
+ <param name="array" type="GLenum"/>
+ </proto>
+
+ <desc name="array">
+ <value name="GL_VERTEX_ARRAY"/>
+ <value name="GL_NORMAL_ARRAY"/>
+ <value name="GL_COLOR_ARRAY"/>
+ <value name="GL_TEXTURE_COORD_ARRAY"/>
+ <value name="GL_MATRIX_INDEX_ARRAY_OES" category="OES_matrix_palette"/>
+ <value name="GL_WEIGHT_ARRAY_OES" category="OES_matrix_palette"/>
+ <value name="GL_POINT_SIZE_ARRAY_OES" category="OES_point_size_array"/>
+ </desc>
+</template>
+
+<template name="DrawArrays">
+ <proto>
+ <return type="void"/>
+ <param name="mode" type="GLenum"/>
+ <param name="first" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ </proto>
+
+ <desc name="mode">
+ <value name="GL_POINTS"/>
+ <value name="GL_LINES"/>
+ <value name="GL_LINE_LOOP"/>
+ <value name="GL_LINE_STRIP"/>
+ <value name="GL_TRIANGLES"/>
+ <value name="GL_TRIANGLE_STRIP"/>
+ <value name="GL_TRIANGLE_FAN"/>
+ </desc>
+</template>
+
+<template name="DrawElements">
+ <proto>
+ <return type="void"/>
+ <param name="mode" type="GLenum"/>
+ <param name="count" type="GLsizei"/>
+ <param name="type" type="GLenum"/>
+ <param name="indices" type="const GLvoid *"/>
+ </proto>
+
+ <desc name="mode">
+ <value name="GL_POINTS"/>
+ <value name="GL_LINES"/>
+ <value name="GL_LINE_LOOP"/>
+ <value name="GL_LINE_STRIP"/>
+ <value name="GL_TRIANGLES"/>
+ <value name="GL_TRIANGLE_STRIP"/>
+ <value name="GL_TRIANGLE_FAN"/>
+ </desc>
+
+ <desc name="type">
+ <value name="GL_UNSIGNED_BYTE"/>
+ <value name="GL_UNSIGNED_SHORT"/>
+ <!-- GL_UNSIGNED_INT is not defined in GLES1.1 headers -->
+ <value name="(0x1405 /* GL_UNSIGNED_INT */)" category="OES_element_index_uint"/>
+ </desc>
+</template>
+
+<template name="EnableClientState">
+ <proto>
+ <return type="void"/>
+ <param name="array" type="GLenum"/>
+ </proto>
+
+ <desc name="array">
+ <value name="GL_VERTEX_ARRAY"/>
+ <value name="GL_NORMAL_ARRAY"/>
+ <value name="GL_COLOR_ARRAY"/>
+ <value name="GL_TEXTURE_COORD_ARRAY"/>
+ <value name="GL_MATRIX_INDEX_ARRAY_OES" category="OES_matrix_palette"/>
+ <value name="GL_WEIGHT_ARRAY_OES" category="OES_matrix_palette"/>
+ <value name="GL_POINT_SIZE_ARRAY_OES" category="OES_point_size_array"/>
+ </desc>
+</template>
+
+<template name="GetPointer" direction="get">
+ <proto>
+ <return type="void"/>
+ <param name="pname" type="GLenum"/>
+ <vector name="params" type="GLvoid **" size="dynamic"/>
+ </proto>
+
+ <desc name="pname">
+ <value name="GL_VERTEX_ARRAY_POINTER"/>
+ <value name="GL_NORMAL_ARRAY_POINTER"/>
+ <value name="GL_COLOR_ARRAY_POINTER"/>
+ <value name="GL_TEXTURE_COORD_ARRAY_POINTER"/>
+ <value name="GL_MATRIX_INDEX_ARRAY_POINTER_OES" category="OES_matrix_palette"/>
+ <value name="GL_WEIGHT_ARRAY_POINTER_OES" category="OES_matrix_palette"/>
+ <value name="GL_POINT_SIZE_ARRAY_POINTER_OES" category="OES_point_size_array"/>
+ </desc>
+</template>
+
+<template name="Normal">
+ <proto>
+ <return type="void"/>
+ <vector name="v" type="const GLtype *" size="3">
+ <param name="nx" type="GLtype"/>
+ <param name="ny" type="GLtype"/>
+ <param name="nz" type="GLtype"/>
+ </vector>
+ </proto>
+</template>
+
+<template name="NormalPointer">
+ <proto>
+ <return type="void"/>
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ </proto>
+
+ <desc name="type">
+ <value name="GL_BYTE"/>
+ <value name="GL_SHORT"/>
+ <value name="GL_FLOAT"/>
+ <value name="GL_FIXED"/>
+ <value name="GL_HALF_FLOAT_OES" category="OES_vertex_half_float"/>
+ </desc>
+</template>
+
+<template name="TexCoordPointer">
+ <proto>
+ <return type="void"/>
+ <param name="size" type="GLint"/>
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ </proto>
+
+ <desc name="size" error="GL_INVALID_VALUE">
+ <value name="2"/>
+ <value name="3"/>
+ <value name="4"/>
+ </desc>
+
+ <desc name="type">
+ <value name="GL_BYTE"/>
+ <value name="GL_SHORT"/>
+ <value name="GL_FLOAT"/>
+ <value name="GL_FIXED"/>
+ <value name="GL_HALF_FLOAT_OES" category="OES_vertex_half_float"/>
+ </desc>
+</template>
+
+<template name="VertexPointer">
+ <proto>
+ <return type="void"/>
+ <param name="size" type="GLint"/>
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ </proto>
+
+ <desc name="size" error="GL_INVALID_VALUE">
+ <value name="2"/>
+ <value name="3"/>
+ <value name="4"/>
+ </desc>
+
+ <desc name="type">
+ <value name="GL_BYTE"/>
+ <value name="GL_SHORT"/>
+ <value name="GL_FLOAT"/>
+ <value name="GL_FIXED"/>
+ <value name="GL_HALF_FLOAT_OES" category="OES_vertex_half_float"/>
+ </desc>
+</template>
+
+<template name="PolygonOffset">
+ <proto>
+ <return type="void"/>
+ <param name="factor" type="GLtype"/>
+ <param name="units" type="GLtype"/>
+ </proto>
+</template>
+
+<template name="CopyTexImage2D">
+ <proto>
+ <return type="void"/>
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="internalFormat" type="GLenum"/>
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="border" type="GLint"/>
+ </proto>
+
+ <desc name="target">
+ <value name="GL_TEXTURE_2D"/>
+ <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_X" category="GLES2.0"/>
+ <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Y" category="GLES2.0"/>
+ <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Z" category="GLES2.0"/>
+ <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_X" category="GLES2.0"/>
+ <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Y" category="GLES2.0"/>
+ <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Z" category="GLES2.0"/>
+ <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES" category="OES_texture_cube_map"/>
+ <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES" category="OES_texture_cube_map"/>
+ <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES" category="OES_texture_cube_map"/>
+ <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES" category="OES_texture_cube_map"/>
+ <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES" category="OES_texture_cube_map"/>
+ <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES" category="OES_texture_cube_map"/>
+ </desc>
+
+ <desc name="internalFormat" error="GL_INVALID_VALUE">
+ <value name="GL_ALPHA"/>
+ <value name="GL_RGB"/>
+ <value name="GL_RGBA"/>
+ <value name="GL_LUMINANCE"/>
+ <value name="GL_LUMINANCE_ALPHA"/>
+ </desc>
+
+ <desc name="border" error="GL_INVALID_VALUE">
+ <value name="0"/>
+ </desc>
+</template>
+
+<template name="CopyTexSubImage2D">
+ <proto>
+ <return type="void"/>
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="xoffset" type="GLint"/>
+ <param name="yoffset" type="GLint"/>
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ </proto>
+
+ <desc name="target">
+ <value name="GL_TEXTURE_2D"/>
+ <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_X" category="GLES2.0"/>
+ <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Y" category="GLES2.0"/>
+ <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Z" category="GLES2.0"/>
+ <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_X" category="GLES2.0"/>
+ <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Y" category="GLES2.0"/>
+ <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Z" category="GLES2.0"/>
+ <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES" category="OES_texture_cube_map"/>
+ <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES" category="OES_texture_cube_map"/>
+ <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES" category="OES_texture_cube_map"/>
+ <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES" category="OES_texture_cube_map"/>
+ <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES" category="OES_texture_cube_map"/>
+ <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES" category="OES_texture_cube_map"/>
+ </desc>
+</template>
+
+<template name="TexSubImage2D">
+ <proto>
+ <return type="void"/>
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="xoffset" type="GLint"/>
+ <param name="yoffset" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="pixels" type="const GLvoid *"/>
+ </proto>
+
+ <desc name="target">
+ <value name="GL_TEXTURE_2D"/>
+ <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_X" category="GLES2.0"/>
+ <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Y" category="GLES2.0"/>
+ <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Z" category="GLES2.0"/>
+ <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_X" category="GLES2.0"/>
+ <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Y" category="GLES2.0"/>
+ <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Z" category="GLES2.0"/>
+ <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES" category="OES_texture_cube_map"/>
+ <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES" category="OES_texture_cube_map"/>
+ <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES" category="OES_texture_cube_map"/>
+ <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES" category="OES_texture_cube_map"/>
+ <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES" category="OES_texture_cube_map"/>
+ <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES" category="OES_texture_cube_map"/>
+ </desc>
+
+ <desc name="format">
+ <value name="GL_ALPHA"/>
+
+ <desc name="type" error="GL_INVALID_OPERATION">
+ <value name="GL_UNSIGNED_BYTE"/>
+ <value name="GL_FLOAT" category="OES_texture_float"/>
+ <value name="GL_HALF_FLOAT_OES" category="OES_texture_half_float"/>
+ </desc>
+ </desc>
+
+ <desc name="format">
+ <value name="GL_RGB"/>
+
+ <desc name="type" error="GL_INVALID_OPERATION">
+ <value name="GL_UNSIGNED_BYTE"/>
+ <value name="GL_UNSIGNED_SHORT_5_6_5"/>
+ <value name="GL_FLOAT" category="OES_texture_float"/>
+ <value name="GL_HALF_FLOAT_OES" category="OES_texture_half_float"/>
+ </desc>
+ </desc>
+
+ <desc name="format">
+ <value name="GL_RGBA"/>
+
+ <desc name="type" error="GL_INVALID_OPERATION">
+ <value name="GL_UNSIGNED_BYTE"/>
+ <value name="GL_UNSIGNED_SHORT_4_4_4_4"/>
+ <value name="GL_UNSIGNED_SHORT_5_5_5_1"/>
+ <value name="GL_FLOAT" category="OES_texture_float"/>
+ <value name="GL_HALF_FLOAT_OES" category="OES_texture_half_float"/>
+ <value name="GL_UNSIGNED_INT_2_10_10_10_REV_EXT" category="EXT_texture_type_2_10_10_10_REV"/>
+ </desc>
+ </desc>
+
+ <desc name="format">
+ <value name="GL_LUMINANCE"/>
+
+ <desc name="type" error="GL_INVALID_OPERATION">
+ <value name="GL_UNSIGNED_BYTE"/>
+ <value name="GL_FLOAT" category="OES_texture_float"/>
+ <value name="GL_HALF_FLOAT_OES" category="OES_texture_half_float"/>
+ </desc>
+ </desc>
+
+ <desc name="format">
+ <value name="GL_LUMINANCE_ALPHA"/>
+
+ <desc name="type" error="GL_INVALID_OPERATION">
+ <value name="GL_UNSIGNED_BYTE"/>
+ <value name="GL_FLOAT" category="OES_texture_float"/>
+ <value name="GL_HALF_FLOAT_OES" category="OES_texture_half_float"/>
+ </desc>
+ </desc>
+
+ <desc name="format" category="OES_depth_texture">
+ <value name="GL_DEPTH_COMPONENT"/>
+
+ <desc name="type" error="GL_INVALID_OPERATION">
+ <value name="GL_UNSIGNED_SHORT"/>
+ <value name="GL_UNSIGNED_INT"/>
+ </desc>
+ </desc>
+
+ <desc name="format" category="OES_packed_depth_stencil">
+ <value name="GL_DEPTH_STENCIL_OES"/>
+
+ <desc name="type" error="GL_INVALID_OPERATION">
+ <value name="GL_UNSIGNED_INT_24_8_OES"/>
+ </desc>
+ </desc>
+</template>
+
+<template name="BindTexture">
+ <proto>
+ <return type="void"/>
+ <param name="target" type="GLenum"/>
+ <param name="texture" type="GLuint"/>
+ </proto>
+
+ <desc name="target">
+ <value name="GL_TEXTURE_2D"/>
+ <value name="GL_TEXTURE_CUBE_MAP" category="GLES2.0"/>
+ <value name="GL_TEXTURE_CUBE_MAP_OES" category="OES_texture_cube_map"/>
+ <value name="GL_TEXTURE_3D_OES" category="OES_texture_3D"/>
+ </desc>
+</template>
+
+<template name="DeleteTextures">
+ <proto>
+ <return type="void"/>
+ <param name="n" type="GLsizei"/>
+ <param name="textures" type="const GLuint *"/>
+ </proto>
+</template>
+
+<template name="GenTextures" direction="get">
+ <proto>
+ <return type="void"/>
+ <param name="n" type="GLsizei"/>
+ <param name="textures" type="GLuint *"/>
+ </proto>
+</template>
+
+<template name="IsTexture" direction="get">
+ <proto>
+ <return type="GLboolean"/>
+ <param name="texture" type="GLuint"/>
+ </proto>
+</template>
+
+<template name="BlendColor">
+ <proto>
+ <return type="void"/>
+ <param name="red" type="GLtype"/>
+ <param name="green" type="GLtype"/>
+ <param name="blue" type="GLtype"/>
+ <param name="alpha" type="GLtype"/>
+ </proto>
+</template>
+
+<template name="BlendEquation">
+ <proto>
+ <return type="void"/>
+ <param name="mode" type="GLenum"/>
+ </proto>
+
+ <desc name="mode">
+ <value name="GL_FUNC_ADD" category="GLES2.0"/>
+ <value name="GL_FUNC_SUBTRACT" category="GLES2.0"/>
+ <value name="GL_FUNC_REVERSE_SUBTRACT" category="GLES2.0"/>
+ <value name="GL_FUNC_ADD_OES" category="OES_blend_subtract"/>
+ <value name="GL_FUNC_SUBTRACT_OES" category="OES_blend_subtract"/>
+ <value name="GL_FUNC_REVERSE_SUBTRACT_OES" category="OES_blend_subtract"/>
+
+ <value name="GL_MIN_EXT" category="EXT_blend_minmax"/>
+ <value name="GL_MAX_EXT" category="EXT_blend_minmax"/>
+ </desc>
+</template>
+
+<template name="BlendEquationSeparate">
+ <proto>
+ <return type="void"/>
+ <param name="modeRGB" type="GLenum"/>
+ <param name="modeAlpha" type="GLenum"/>
+ </proto>
+
+ <desc name="modeRGB">
+ <value name="GL_FUNC_ADD" category="GLES2.0"/>
+ <value name="GL_FUNC_SUBTRACT" category="GLES2.0"/>
+ <value name="GL_FUNC_REVERSE_SUBTRACT" category="GLES2.0"/>
+ <value name="GL_FUNC_ADD_OES" category="OES_blend_subtract"/>
+ <value name="GL_FUNC_SUBTRACT_OES" category="OES_blend_subtract"/>
+ <value name="GL_FUNC_REVERSE_SUBTRACT_OES" category="OES_blend_subtract"/>
+
+ <value name="GL_MIN_EXT" category="EXT_blend_minmax"/>
+ <value name="GL_MAX_EXT" category="EXT_blend_minmax"/>
+ </desc>
+
+ <desc name="modeAlpha">
+ <value name="GL_FUNC_ADD" category="GLES2.0"/>
+ <value name="GL_FUNC_SUBTRACT" category="GLES2.0"/>
+ <value name="GL_FUNC_REVERSE_SUBTRACT" category="GLES2.0"/>
+ <value name="GL_FUNC_ADD_OES" category="OES_blend_subtract"/>
+ <value name="GL_FUNC_SUBTRACT_OES" category="OES_blend_subtract"/>
+ <value name="GL_FUNC_REVERSE_SUBTRACT_OES" category="OES_blend_subtract"/>
+
+ <value name="GL_MIN_EXT" category="EXT_blend_minmax"/>
+ <value name="GL_MAX_EXT" category="EXT_blend_minmax"/>
+ </desc>
+</template>
+
+<template name="TexImage3D">
+ <proto>
+ <return type="void"/>
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="internalFormat" type="GLenum"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="depth" type="GLsizei"/>
+ <param name="border" type="GLint"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="pixels" type="const GLvoid *"/>
+ </proto>
+
+ <desc name="target">
+ <value name="GL_TEXTURE_3D_OES"/>
+ </desc>
+
+ <desc name="internalFormat">
+ <value name="GL_ALPHA"/>
+ <value name="GL_RGB"/>
+ <value name="GL_RGBA"/>
+ <value name="GL_LUMINANCE"/>
+ <value name="GL_LUMINANCE_ALPHA"/>
+ </desc>
+
+ <desc name="format">
+ <value name="GL_ALPHA"/>
+
+ <desc name="type" error="GL_INVALID_OPERATION">
+ <value name="GL_UNSIGNED_BYTE"/>
+ <value name="GL_FLOAT" category="OES_texture_float"/>
+ <value name="GL_HALF_FLOAT_OES" category="OES_texture_half_float"/>
+ </desc>
+ </desc>
+
+ <desc name="format">
+ <value name="GL_RGB"/>
+
+ <desc name="type" error="GL_INVALID_OPERATION">
+ <value name="GL_UNSIGNED_BYTE"/>
+ <value name="GL_UNSIGNED_SHORT_5_6_5"/>
+ <value name="GL_FLOAT" category="OES_texture_float"/>
+ <value name="GL_HALF_FLOAT_OES" category="OES_texture_half_float"/>
+ </desc>
+ </desc>
+
+ <desc name="format">
+ <value name="GL_RGBA"/>
+
+ <desc name="type" error="GL_INVALID_OPERATION">
+ <value name="GL_UNSIGNED_BYTE"/>
+ <value name="GL_UNSIGNED_SHORT_4_4_4_4"/>
+ <value name="GL_UNSIGNED_SHORT_5_5_5_1"/>
+ <value name="GL_FLOAT" category="OES_texture_float"/>
+ <value name="GL_HALF_FLOAT_OES" category="OES_texture_half_float"/>
+ <value name="GL_UNSIGNED_INT_2_10_10_10_REV_EXT" category="EXT_texture_type_2_10_10_10_REV"/>
+ </desc>
+ </desc>
+
+ <desc name="format">
+ <value name="GL_LUMINANCE"/>
+
+ <desc name="type" error="GL_INVALID_OPERATION">
+ <value name="GL_UNSIGNED_BYTE"/>
+ <value name="GL_FLOAT" category="OES_texture_float"/>
+ <value name="GL_HALF_FLOAT_OES" category="OES_texture_half_float"/>
+ </desc>
+ </desc>
+
+ <desc name="format">
+ <value name="GL_LUMINANCE_ALPHA"/>
+
+ <desc name="type" error="GL_INVALID_OPERATION">
+ <value name="GL_UNSIGNED_BYTE"/>
+ <value name="GL_FLOAT" category="OES_texture_float"/>
+ <value name="GL_HALF_FLOAT_OES" category="OES_texture_half_float"/>
+ </desc>
+ </desc>
+</template>
+
+<template name="TexSubImage3D">
+ <proto>
+ <return type="void"/>
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="xoffset" type="GLint"/>
+ <param name="yoffset" type="GLint"/>
+ <param name="zoffset" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="depth" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="pixels" type="const GLvoid *"/>
+ </proto>
+
+ <desc name="target">
+ <value name="GL_TEXTURE_3D_OES"/>
+ </desc>
+
+ <desc name="format">
+ <value name="GL_ALPHA"/>
+
+ <desc name="type" error="GL_INVALID_OPERATION">
+ <value name="GL_UNSIGNED_BYTE"/>
+ <value name="GL_FLOAT" category="OES_texture_float"/>
+ <value name="GL_HALF_FLOAT_OES" category="OES_texture_half_float"/>
+ </desc>
+ </desc>
+
+ <desc name="format">
+ <value name="GL_RGB"/>
+
+ <desc name="type" error="GL_INVALID_OPERATION">
+ <value name="GL_UNSIGNED_BYTE"/>
+ <value name="GL_UNSIGNED_SHORT_5_6_5"/>
+ <value name="GL_FLOAT" category="OES_texture_float"/>
+ <value name="GL_HALF_FLOAT_OES" category="OES_texture_half_float"/>
+ </desc>
+ </desc>
+
+ <desc name="format">
+ <value name="GL_RGBA"/>
+
+ <desc name="type" error="GL_INVALID_OPERATION">
+ <value name="GL_UNSIGNED_BYTE"/>
+ <value name="GL_UNSIGNED_SHORT_4_4_4_4"/>
+ <value name="GL_UNSIGNED_SHORT_5_5_5_1"/>
+ <value name="GL_FLOAT" category="OES_texture_float"/>
+ <value name="GL_HALF_FLOAT_OES" category="OES_texture_half_float"/>
+ <value name="GL_UNSIGNED_INT_2_10_10_10_REV_EXT" category="EXT_texture_type_2_10_10_10_REV"/>
+ </desc>
+ </desc>
+
+ <desc name="format">
+ <value name="GL_LUMINANCE"/>
+
+ <desc name="type" error="GL_INVALID_OPERATION">
+ <value name="GL_UNSIGNED_BYTE"/>
+ <value name="GL_FLOAT" category="OES_texture_float"/>
+ <value name="GL_HALF_FLOAT_OES" category="OES_texture_half_float"/>
+ </desc>
+ </desc>
+
+ <desc name="format">
+ <value name="GL_LUMINANCE_ALPHA"/>
+
+ <desc name="type" error="GL_INVALID_OPERATION">
+ <value name="GL_UNSIGNED_BYTE"/>
+ <value name="GL_FLOAT" category="OES_texture_float"/>
+ <value name="GL_HALF_FLOAT_OES" category="OES_texture_half_float"/>
+ </desc>
+ </desc>
+</template>
+
+<template name="CopyTexSubImage3D">
+ <proto>
+ <return type="void"/>
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="xoffset" type="GLint"/>
+ <param name="yoffset" type="GLint"/>
+ <param name="zoffset" type="GLint"/>
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ </proto>
+
+ <desc name="target">
+ <value name="GL_TEXTURE_3D_OES"/>
+ </desc>
+</template>
+
+<template name="MultiTexCoord">
+ <proto>
+ <return type="void"/>
+ <param name="texture" type="GLenum"/>
+ <vector name="v" type="const GLtype *" size="dynamic">
+ <param name="s" type="GLtype"/>
+ <param name="t" type="GLtype"/>
+ <param name="r" type="GLtype"/>
+ <param name="q" type="GLtype"/>
+ </vector>
+ </proto>
+
+ <desc name="texture">
+ <range base="GL_TEXTURE" from="0" to="31"/>
+ </desc>
+</template>
+
+<template name="CompressedTexImage3D">
+ <proto>
+ <return type="void"/>
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="internalFormat" type="GLenum"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="depth" type="GLsizei"/>
+ <param name="border" type="GLint"/>
+ <param name="imagesize" type="GLsizei"/>
+ <param name="data" type="const GLvoid *"/>
+ </proto>
+
+ <desc name="target">
+ <value name="GL_TEXTURE_3D_OES"/>
+ </desc>
+
+ <desc name="internalFormat">
+ <value name="GL_3DC_X_AMD" category="AMD_compressed_3DC_texture"/>
+ <value name="GL_3DC_XY_AMD" category="AMD_compressed_3DC_texture"/>
+ <value name="GL_ATC_RGB_AMD" category="AMD_compressed_ATC_texture"/>
+ <value name="GL_ATC_RGBA_EXPLICIT_ALPHA_AMD" category="AMD_compressed_ATC_texture"/>
+ <value name="GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD" category="AMD_compressed_ATC_texture"/>
+ </desc>
+</template>
+
+<template name="CompressedTexSubImage3D">
+ <proto>
+ <return type="void"/>
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="xoffset" type="GLint"/>
+ <param name="yoffset" type="GLint"/>
+ <param name="zoffset" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="depth" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="imagesize" type="GLsizei"/>
+ <param name="data" type="const GLvoid *"/>
+ </proto>
+
+ <desc name="target">
+ <value name="GL_TEXTURE_3D_OES"/>
+ </desc>
+</template>
+
+<template name="ActiveTexture">
+ <proto>
+ <return type="void"/>
+ <param name="texture" type="GLenum"/>
+ </proto>
+
+ <desc name="texture">
+ <range base="GL_TEXTURE" from="0" to="31"/>
+ </desc>
+</template>
+
+<template name="ClientActiveTexture">
+ <proto>
+ <return type="void"/>
+ <param name="texture" type="GLenum"/>
+ </proto>
+
+ <desc name="texture">
+ <range base="GL_TEXTURE" from="0" to="31"/>
+ </desc>
+</template>
+
+<template name="SampleCoverage">
+ <proto>
+ <return type="void"/>
+ <param name="value" type="GLtype"/>
+ <param name="invert" type="GLboolean"/>
+ </proto>
+</template>
+
+<template name="CompressedTexImage2D">
+ <proto>
+ <return type="void"/>
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="internalFormat" type="GLenum"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="border" type="GLint"/>
+ <param name="imageSize" type="GLsizei"/>
+ <param name="data" type="const GLvoid *"/>
+ </proto>
+
+ <desc name="target">
+ <value name="GL_TEXTURE_2D"/>
+ <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_X" category="GLES2.0"/>
+ <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Y" category="GLES2.0"/>
+ <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Z" category="GLES2.0"/>
+ <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_X" category="GLES2.0"/>
+ <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Y" category="GLES2.0"/>
+ <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Z" category="GLES2.0"/>
+ <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES" category="OES_texture_cube_map"/>
+ <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES" category="OES_texture_cube_map"/>
+ <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES" category="OES_texture_cube_map"/>
+ <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES" category="OES_texture_cube_map"/>
+ <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES" category="OES_texture_cube_map"/>
+ <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES" category="OES_texture_cube_map"/>
+ </desc>
+
+ <desc name="internalFormat">
+ <value name="GL_ETC1_RGB8_OES" category="OES_compressed_ETC1_RGB8_texture"/>
+
+ <value name="GL_PALETTE4_RGB8_OES" category="OES_compressed_paletted_texture"/>
+ <value name="GL_PALETTE4_RGBA8_OES" category="OES_compressed_paletted_texture"/>
+ <value name="GL_PALETTE4_R5_G6_B5_OES" category="OES_compressed_paletted_texture"/>
+ <value name="GL_PALETTE4_RGBA4_OES" category="OES_compressed_paletted_texture"/>
+ <value name="GL_PALETTE4_RGB5_A1_OES" category="OES_compressed_paletted_texture"/>
+ <value name="GL_PALETTE8_RGB8_OES" category="OES_compressed_paletted_texture"/>
+ <value name="GL_PALETTE8_RGBA8_OES" category="OES_compressed_paletted_texture"/>
+ <value name="GL_PALETTE8_R5_G6_B5_OES" category="OES_compressed_paletted_texture"/>
+ <value name="GL_PALETTE8_RGBA4_OES" category="OES_compressed_paletted_texture"/>
+ <value name="GL_PALETTE8_RGB5_A1_OES" category="OES_compressed_paletted_texture"/>
+
+ <value name="GL_3DC_X_AMD" category="AMD_compressed_3DC_texture"/>
+ <value name="GL_3DC_XY_AMD" category="AMD_compressed_3DC_texture"/>
+
+ <value name="GL_ATC_RGB_AMD" category="AMD_compressed_ATC_texture"/>
+ <value name="GL_ATC_RGBA_EXPLICIT_ALPHA_AMD" category="AMD_compressed_ATC_texture"/>
+ <value name="GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD" category="AMD_compressed_ATC_texture"/>
+
+ <value name="GL_COMPRESSED_RGB_S3TC_DXT1_EXT" category="EXT_texture_compression_dxt1"/>
+ <value name="GL_COMPRESSED_RGBA_S3TC_DXT1_EXT" category="EXT_texture_compression_dxt1"/>
+ </desc>
+
+ <desc name="border" error="GL_INVALID_VALUE">
+ <value name="0"/>
+ </desc>
+</template>
+
+<template name="CompressedTexSubImage2D">
+ <proto>
+ <return type="void"/>
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="xoffset" type="GLint"/>
+ <param name="yoffset" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="imageSize" type="GLsizei"/>
+ <param name="data" type="const GLvoid *"/>
+ </proto>
+
+ <desc name="target">
+ <value name="GL_TEXTURE_2D"/>
+ <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_X" category="GLES2.0"/>
+ <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Y" category="GLES2.0"/>
+ <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Z" category="GLES2.0"/>
+ <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_X" category="GLES2.0"/>
+ <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Y" category="GLES2.0"/>
+ <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Z" category="GLES2.0"/>
+ <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES" category="OES_texture_cube_map"/>
+ <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES" category="OES_texture_cube_map"/>
+ <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES" category="OES_texture_cube_map"/>
+ <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES" category="OES_texture_cube_map"/>
+ <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES" category="OES_texture_cube_map"/>
+ <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES" category="OES_texture_cube_map"/>
+ </desc>
+
+ <desc name="format">
+ <value name="GL_COMPRESSED_RGB_S3TC_DXT1_EXT" category="EXT_texture_compression_dxt1"/>
+ <value name="GL_COMPRESSED_RGBA_S3TC_DXT1_EXT" category="EXT_texture_compression_dxt1"/>
+ </desc>
+</template>
+
+<template name="BlendFuncSeparate">
+ <proto>
+ <return type="void"/>
+ <param name="srcRGB" type="GLenum"/>
+ <param name="dstRGB" type="GLenum"/>
+ <param name="srcAlpha" type="GLenum"/>
+ <param name="dstAlpha" type="GLenum"/>
+ </proto>
+
+ <desc name="srcRGB">
+ <value name="GL_ZERO"/>
+ <value name="GL_ONE"/>
+ <value name="GL_SRC_COLOR"/>
+ <value name="GL_ONE_MINUS_SRC_COLOR"/>
+ <value name="GL_SRC_ALPHA"/>
+ <value name="GL_ONE_MINUS_SRC_ALPHA"/>
+ <value name="GL_DST_ALPHA"/>
+ <value name="GL_ONE_MINUS_DST_ALPHA"/>
+ <value name="GL_DST_COLOR"/>
+ <value name="GL_ONE_MINUS_DST_COLOR"/>
+ <value name="GL_SRC_ALPHA_SATURATE"/>
+
+ <value name="GL_CONSTANT_COLOR" category="GLES2.0"/>
+ <value name="GL_ONE_MINUS_CONSTANT_COLOR" category="GLES2.0"/>
+ <value name="GL_CONSTANT_ALPHA" category="GLES2.0"/>
+ <value name="GL_ONE_MINUS_CONSTANT_ALPHA" category="GLES2.0"/>
+ </desc>
+
+ <desc name="dstRGB">
+ <value name="GL_ZERO"/>
+ <value name="GL_ONE"/>
+ <value name="GL_SRC_COLOR"/>
+ <value name="GL_ONE_MINUS_SRC_COLOR"/>
+ <value name="GL_SRC_ALPHA"/>
+ <value name="GL_ONE_MINUS_SRC_ALPHA"/>
+ <value name="GL_DST_ALPHA"/>
+ <value name="GL_ONE_MINUS_DST_ALPHA"/>
+ <value name="GL_DST_COLOR"/>
+ <value name="GL_ONE_MINUS_DST_COLOR"/>
+
+ <value name="GL_CONSTANT_COLOR" category="GLES2.0"/>
+ <value name="GL_ONE_MINUS_CONSTANT_COLOR" category="GLES2.0"/>
+ <value name="GL_CONSTANT_ALPHA" category="GLES2.0"/>
+ <value name="GL_ONE_MINUS_CONSTANT_ALPHA" category="GLES2.0"/>
+ </desc>
+
+ <desc name="srcAlpha">
+ <value name="GL_ZERO"/>
+ <value name="GL_ONE"/>
+ <value name="GL_SRC_COLOR"/>
+ <value name="GL_ONE_MINUS_SRC_COLOR"/>
+ <value name="GL_SRC_ALPHA"/>
+ <value name="GL_ONE_MINUS_SRC_ALPHA"/>
+ <value name="GL_DST_ALPHA"/>
+ <value name="GL_ONE_MINUS_DST_ALPHA"/>
+ <value name="GL_DST_COLOR"/>
+ <value name="GL_ONE_MINUS_DST_COLOR"/>
+ <value name="GL_SRC_ALPHA_SATURATE"/>
+
+ <value name="GL_CONSTANT_COLOR" category="GLES2.0"/>
+ <value name="GL_ONE_MINUS_CONSTANT_COLOR" category="GLES2.0"/>
+ <value name="GL_CONSTANT_ALPHA" category="GLES2.0"/>
+ <value name="GL_ONE_MINUS_CONSTANT_ALPHA" category="GLES2.0"/>
+ </desc>
+
+ <desc name="dstAlpha">
+ <value name="GL_ZERO"/>
+ <value name="GL_ONE"/>
+ <value name="GL_SRC_COLOR"/>
+ <value name="GL_ONE_MINUS_SRC_COLOR"/>
+ <value name="GL_SRC_ALPHA"/>
+ <value name="GL_ONE_MINUS_SRC_ALPHA"/>
+ <value name="GL_DST_ALPHA"/>
+ <value name="GL_ONE_MINUS_DST_ALPHA"/>
+ <value name="GL_DST_COLOR"/>
+ <value name="GL_ONE_MINUS_DST_COLOR"/>
+
+ <value name="GL_CONSTANT_COLOR" category="GLES2.0"/>
+ <value name="GL_ONE_MINUS_CONSTANT_COLOR" category="GLES2.0"/>
+ <value name="GL_CONSTANT_ALPHA" category="GLES2.0"/>
+ <value name="GL_ONE_MINUS_CONSTANT_ALPHA" category="GLES2.0"/>
+ </desc>
+</template>
+
+<template name="PointParameter">
+ <proto>
+ <return type="void"/>
+ <param name="pname" type="GLenum"/>
+ <vector name="params" type="const GLtype *" size="dynamic">
+ <param name="param" type="GLtype"/>
+ </vector>
+ </proto>
+
+ <desc name="pname">
+ <value name="GL_POINT_SIZE_MIN"/>
+ <value name="GL_POINT_SIZE_MAX"/>
+ <value name="GL_POINT_FADE_THRESHOLD_SIZE"/>
+
+ <desc name="params" vector_size="1"/>
+ </desc>
+
+ <desc name="pname">
+ <value name="GL_POINT_DISTANCE_ATTENUATION"/>
+ <desc name="params" vector_size="3"/>
+ </desc>
+</template>
+
+<template name="VertexAttrib">
+ <proto>
+ <return type="void"/>
+ <param name="index" type="GLuint"/>
+ <vector name="v" type="const GLtype *" size="dynamic">
+ <param name="x" type="GLtype"/>
+ <param name="y" type="GLtype"/>
+ <param name="z" type="GLtype"/>
+ <param name="w" type="GLtype"/>
+ </vector>
+ </proto>
+</template>
+
+<template name="VertexAttribPointer">
+ <proto>
+ <return type="void"/>
+ <param name="index" type="GLuint"/>
+ <param name="size" type="GLint"/>
+ <param name="type" type="GLenum"/>
+ <param name="normalized" type="GLboolean"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ </proto>
+
+ <desc name="size" error="GL_INVALID_VALUE">
+ <value name="1"/>
+ <value name="2"/>
+ <value name="3"/>
+ <value name="4"/>
+ </desc>
+
+ <desc name="type" error="GL_INVALID_VALUE">
+ <value name="GL_BYTE"/>
+ <value name="GL_UNSIGNED_BYTE"/>
+ <value name="GL_SHORT"/>
+ <value name="GL_UNSIGNED_SHORT"/>
+ <value name="GL_FLOAT"/>
+ <value name="GL_FIXED"/>
+ <value name="GL_HALF_FLOAT_OES" category="OES_vertex_half_float"/>
+ <value name="GL_UNSIGNED_INT_10_10_10_2_OES" category="OES_vertex_type_10_10_10_2"/>
+ <value name="GL_INT_10_10_10_2_OES" category="OES_vertex_type_10_10_10_2"/>
+ </desc>
+
+ <desc name="type" category="OES_vertex_type_10_10_10_2">
+ <value name="GL_UNSIGNED_INT_10_10_10_2_OES"/>
+ <value name="GL_INT_10_10_10_2_OES"/>
+
+ <desc name="size">
+ <value name="3"/>
+ <value name="4"/>
+ </desc>
+ </desc>
+</template>
+
+<template name="EnableVertexAttribArray">
+ <proto>
+ <return type="void"/>
+ <param name="index" type="GLuint"/>
+ </proto>
+</template>
+
+<template name="DisableVertexAttribArray">
+ <proto>
+ <return type="void"/>
+ <param name="index" type="GLuint"/>
+ </proto>
+</template>
+
+<template name="IsProgram" direction="get">
+ <proto>
+ <return type="GLboolean"/>
+ <param name="program" type="GLuint"/>
+ </proto>
+</template>
+
+<template name="GetProgram" direction="get">
+ <proto>
+ <return type="void"/>
+ <param name="program" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <vector name="params" type="GLtype *" size="dynamic"/>
+ </proto>
+
+ <desc name="pname">
+ <value name="GL_DELETE_STATUS"/>
+ <value name="GL_LINK_STATUS"/>
+ <value name="GL_VALIDATE_STATUS"/>
+ <value name="GL_INFO_LOG_LENGTH"/>
+ <value name="GL_ATTACHED_SHADERS"/>
+ <value name="GL_ACTIVE_ATTRIBUTES"/>
+ <value name="GL_ACTIVE_ATTRIBUTE_MAX_LENGTH"/>
+ <value name="GL_ACTIVE_UNIFORMS"/>
+ <value name="GL_ACTIVE_UNIFORM_MAX_LENGTH"/>
+ <value name="GL_PROGRAM_BINARY_LENGTH_OES" category="OES_get_program_binary"/>
+
+ <desc name="params" convert="false"/>
+ </desc>
+</template>
+
+<template name="GetVertexAttrib" direction="get">
+ <proto>
+ <return type="void"/>
+ <param name="index" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <vector name="params" type="GLtype *" size="dynamic"/>
+ </proto>
+
+ <desc name="pname">
+ <value name="GL_VERTEX_ATTRIB_ARRAY_ENABLED"/>
+ <value name="GL_VERTEX_ATTRIB_ARRAY_SIZE"/>
+ <value name="GL_VERTEX_ATTRIB_ARRAY_STRIDE"/>
+ <value name="GL_VERTEX_ATTRIB_ARRAY_TYPE"/>
+ <value name="GL_VERTEX_ATTRIB_ARRAY_NORMALIZED"/>
+ <value name="GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING"/>
+
+ <desc name="params" vector_size="1" convert="false"/>
+ </desc>
+
+ <desc name="pname">
+ <value name="GL_CURRENT_VERTEX_ATTRIB"/>
+ <desc name="params" vector_size="16?" convert="false"/>
+ </desc>
+</template>
+
+<template name="GetVertexAttribPointer" direction="get">
+ <proto>
+ <return type="void"/>
+ <param name="index" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <vector name="pointer" type="GLvoid **" size="dynamic"/>
+ </proto>
+
+ <desc name="pname">
+ <value name="GL_VERTEX_ATTRIB_ARRAY_POINTER"/>
+ </desc>
+</template>
+
+<template name="GetBufferPointer" direction="get">
+ <proto>
+ <return type="void"/>
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <vector name="params" type="GLvoid **" size="dynamic"/>
+ </proto>
+
+ <desc name="target">
+ <value name="GL_ARRAY_BUFFER"/>
+ <value name="GL_ELEMENT_ARRAY_BUFFER"/>
+ </desc>
+
+ <desc name="pname">
+ <value name="GL_BUFFER_MAP_POINTER_OES"/>
+ </desc>
+</template>
+
+<template name="MapBuffer" direction="get">
+ <proto>
+ <return type="void *"/>
+ <param name="target" type="GLenum"/>
+ <param name="access" type="GLenum"/>
+ </proto>
+
+ <desc name="target">
+ <value name="GL_ARRAY_BUFFER"/>
+ <value name="GL_ELEMENT_ARRAY_BUFFER"/>
+ </desc>
+
+ <desc name="access">
+ <value name="GL_WRITE_ONLY_OES"/>
+ </desc>
+</template>
+
+<template name="UnmapBuffer" direction="get">
+ <proto>
+ <return type="GLboolean"/>
+ <param name="target" type="GLenum"/>
+ </proto>
+
+ <desc name="target">
+ <value name="GL_ARRAY_BUFFER"/>
+ <value name="GL_ELEMENT_ARRAY_BUFFER"/>
+ </desc>
+</template>
+
+<template name="BindBuffer">
+ <proto>
+ <return type="void"/>
+ <param name="target" type="GLenum"/>
+ <param name="buffer" type="GLuint"/>
+ </proto>
+
+ <desc name="target">
+ <value name="GL_ARRAY_BUFFER"/>
+ <value name="GL_ELEMENT_ARRAY_BUFFER"/>
+ </desc>
+</template>
+
+<template name="BufferData">
+ <proto>
+ <return type="void"/>
+ <param name="target" type="GLenum"/>
+ <param name="size" type="GLsizeiptr"/>
+ <param name="data" type="const GLvoid *"/>
+ <param name="usage" type="GLenum"/>
+ </proto>
+
+ <desc name="target">
+ <value name="GL_ARRAY_BUFFER"/>
+ <value name="GL_ELEMENT_ARRAY_BUFFER"/>
+ </desc>
+
+ <desc name="usage">
+ <value name="GL_STATIC_DRAW"/>
+ <value name="GL_DYNAMIC_DRAW"/>
+ <value name="GL_STREAM_DRAW" category="GLES2.0"/>
+ </desc>
+</template>
+
+<template name="BufferSubData">
+ <proto>
+ <return type="void"/>
+ <param name="target" type="GLenum"/>
+ <param name="offset" type="GLintptr"/>
+ <param name="size" type="GLsizeiptr"/>
+ <param name="data" type="const GLvoid *"/>
+ </proto>
+
+ <desc name="target">
+ <value name="GL_ARRAY_BUFFER"/>
+ <value name="GL_ELEMENT_ARRAY_BUFFER"/>
+ </desc>
+</template>
+
+<template name="DeleteBuffers">
+ <proto>
+ <return type="void"/>
+ <param name="n" type="GLsizei"/>
+ <param name="buffer" type="const GLuint *"/>
+ </proto>
+</template>
+
+<template name="GenBuffers" direction="get">
+ <proto>
+ <return type="void"/>
+ <param name="n" type="GLsizei"/>
+ <param name="buffer" type="GLuint *"/>
+ </proto>
+</template>
+
+<template name="GetBufferParameter" direction="get">
+ <proto>
+ <return type="void"/>
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <vector name="params" type="GLtype *" size="dynamic"/>
+ </proto>
+
+ <desc name="target">
+ <value name="GL_ARRAY_BUFFER"/>
+ <value name="GL_ELEMENT_ARRAY_BUFFER"/>
+ </desc>
+
+ <desc name="pname">
+ <value name="GL_BUFFER_SIZE"/>
+ <value name="GL_BUFFER_USAGE"/>
+ <value name="GL_BUFFER_ACCESS_OES" category="OES_mapbuffer"/>
+ <value name="GL_BUFFER_MAPPED_OES" category="OES_mapbuffer"/>
+ </desc>
+</template>
+
+<template name="IsBuffer" direction="get">
+ <proto>
+ <return type="GLboolean"/>
+ <param name="buffer" type="GLuint"/>
+ </proto>
+</template>
+
+<template name="CreateShader">
+ <proto>
+ <return type="GLuint"/>
+ <param name="type" type="GLenum"/>
+ </proto>
+
+ <desc name="type">
+ <value name="GL_VERTEX_SHADER"/>
+ <value name="GL_FRAGMENT_SHADER"/>
+ </desc>
+</template>
+
+<template name="ShaderSource">
+ <proto>
+ <return type="void"/>
+ <param name="shader" type="GLuint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="string" type="const GLchar **"/>
+ <param name="length" type="const int *"/>
+ </proto>
+</template>
+
+<template name="CompileShader">
+ <proto>
+ <return type="void"/>
+ <param name="shader" type="GLuint"/>
+ </proto>
+</template>
+
+<template name="ReleaseShaderCompiler">
+ <proto>
+ <return type="void"/>
+ </proto>
+</template>
+
+<template name="DeleteShader">
+ <proto>
+ <return type="void"/>
+ <param name="shader" type="GLuint"/>
+ </proto>
+</template>
+
+<template name="ShaderBinary">
+ <proto>
+ <return type="void"/>
+ <param name="n" type="GLsizei"/>
+ <param name="shaders" type="const GLuint *"/>
+ <param name="binaryformat" type="GLenum"/>
+ <param name="binary" type="const GLvoid *"/>
+ <param name="length" type="GLsizei"/>
+ </proto>
+</template>
+
+<template name="CreateProgram">
+ <proto>
+ <return type="GLuint"/>
+ </proto>
+</template>
+
+<template name="AttachShader">
+ <proto>
+ <return type="void"/>
+ <param name="program" type="GLuint"/>
+ <param name="shader" type="GLuint"/>
+ </proto>
+</template>
+
+<template name="DetachShader">
+ <proto>
+ <return type="void"/>
+ <param name="program" type="GLuint"/>
+ <param name="shader" type="GLuint"/>
+ </proto>
+</template>
+
+<template name="LinkProgram">
+ <proto>
+ <return type="void"/>
+ <param name="program" type="GLuint"/>
+ </proto>
+</template>
+
+<template name="UseProgram">
+ <proto>
+ <return type="void"/>
+ <param name="program" type="GLuint"/>
+ </proto>
+</template>
+
+<template name="DeleteProgram">
+ <proto>
+ <return type="void"/>
+ <param name="program" type="GLuint"/>
+ </proto>
+</template>
+
+<template name="GetActiveAttrib" direction="get">
+ <proto>
+ <return type="void"/>
+ <param name="program" type="GLuint"/>
+ <param name="index" type="GLuint"/>
+ <param name="bufSize" type="GLsizei"/>
+ <param name="length" type="GLsizei *"/>
+ <param name="size" type="GLint *"/>
+ <param name="type" type="GLenum *"/>
+ <param name="name" type="GLchar *"/>
+ </proto>
+</template>
+
+<template name="GetAttribLocation" direction="get">
+ <proto>
+ <return type="GLint"/>
+ <param name="program" type="GLuint"/>
+ <param name="name" type="const char *"/>
+ </proto>
+</template>
+
+<template name="BindAttribLocation">
+ <proto>
+ <return type="void"/>
+ <param name="program" type="GLuint"/>
+ <param name="index" type="GLuint"/>
+ <param name="name" type="const char *"/>
+ </proto>
+</template>
+
+<template name="GetUniformLocation" direction="get">
+ <proto>
+ <return type="GLint"/>
+ <param name="program" type="GLuint"/>
+ <param name="name" type="const char *"/>
+ </proto>
+</template>
+
+<template name="GetActiveUniform" direction="get">
+ <proto>
+ <return type="void"/>
+ <param name="program" type="GLuint"/>
+ <param name="index" type="GLuint"/>
+ <param name="bufSize" type="GLsizei"/>
+ <param name="length" type="GLsizei *"/>
+ <param name="size" type="GLint *"/>
+ <param name="type" type="GLenum *"/>
+ <param name="name" type="GLchar *"/>
+ </proto>
+</template>
+
+<template name="Uniform">
+ <proto>
+ <return type="void"/>
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei" hide_if_expanded="true"/>
+ <vector name="values" type="const GLtype *" size="dynamic">
+ <param name="v0" type="GLtype"/>
+ <param name="v1" type="GLtype"/>
+ <param name="v2" type="GLtype"/>
+ <param name="v3" type="GLtype"/>
+ </vector>
+ </proto>
+</template>
+
+<template name="UniformMatrix">
+ <proto>
+ <return type="void"/>
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="transpose" type="GLboolean"/>
+ <vector name="value" type="const GLtype *" size="dynamic"/>
+ </proto>
+</template>
+
+<template name="ValidateProgram">
+ <proto>
+ <return type="void"/>
+ <param name="program" type="GLuint"/>
+ </proto>
+</template>
+
+<template name="GenerateMipmap">
+ <proto>
+ <return type="void"/>
+ <param name="target" type="GLenum"/>
+ </proto>
+
+ <desc name="target">
+ <value name="GL_TEXTURE_2D"/>
+ <value name="GL_TEXTURE_CUBE_MAP" category="GLES2.0"/>
+ <value name="GL_TEXTURE_CUBE_MAP_OES" category="OES_texture_cube_map"/>
+ <value name="GL_TEXTURE_3D_OES" category="OES_texture_3D"/>
+ </desc>
+</template>
+
+<template name="BindFramebuffer">
+ <proto>
+ <return type="void"/>
+ <param name="target" type="GLenum"/>
+ <param name="framebuffer" type="GLuint"/>
+ </proto>
+
+ <desc name="target">
+ <value name="GL_FRAMEBUFFER_OES" category="OES_framebuffer_object"/>
+ <value name="GL_FRAMEBUFFER" category="GLES2.0"/>
+ </desc>
+</template>
+
+<template name="DeleteFramebuffers">
+ <proto>
+ <return type="void"/>
+ <param name="n" type="GLsizei"/>
+ <param name="framebuffers" type="const GLuint *"/>
+ </proto>
+</template>
+
+<template name="GenFramebuffers">
+ <proto>
+ <return type="void"/>
+ <param name="n" type="GLsizei"/>
+ <param name="ids" type="GLuint *"/>
+ </proto>
+</template>
+
+<template name="BindRenderbuffer">
+ <proto>
+ <return type="void"/>
+ <param name="target" type="GLenum"/>
+ <param name="renderbuffer" type="GLuint"/>
+ </proto>
+
+ <desc name="target">
+ <value name="GL_RENDERBUFFER_OES" category="OES_framebuffer_object"/>
+ <value name="GL_RENDERBUFFER" category="GLES2.0"/>
+ </desc>
+</template>
+
+<template name="DeleteRenderbuffers">
+ <proto>
+ <return type="void"/>
+ <param name="n" type="GLsizei"/>
+ <param name="renderbuffers" type="const GLuint *"/>
+ </proto>
+</template>
+
+<template name="GenRenderbuffers">
+ <proto>
+ <return type="void"/>
+ <param name="n" type="GLsizei"/>
+ <param name="renderbuffers" type="GLuint *"/>
+ </proto>
+</template>
+
+<template name="RenderbufferStorage">
+ <proto>
+ <return type="void"/>
+ <param name="target" type="GLenum"/>
+ <param name="internalFormat" type="GLenum"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ </proto>
+
+ <desc name="target">
+ <value name="GL_RENDERBUFFER_OES" category="OES_framebuffer_object"/>
+ <value name="GL_RENDERBUFFER" category="GLES2.0"/>
+ </desc>
+
+ <desc name="internalFormat">
+ <value name="GL_DEPTH_COMPONENT16_OES" category="OES_framebuffer_object"/>
+ <value name="GL_RGBA4_OES" category="OES_framebuffer_object"/>
+ <value name="GL_RGB5_A1_OES" category="OES_framebuffer_object"/>
+ <value name="GL_RGB565_OES" category="OES_framebuffer_object"/>
+ <value name="GL_STENCIL_INDEX8_OES" category="OES_stencil8"/>
+
+ <value name="GL_DEPTH_COMPONENT16" category="GLES2.0"/>
+ <value name="GL_RGBA4" category="GLES2.0"/>
+ <value name="GL_RGB5_A1" category="GLES2.0"/>
+ <value name="GL_RGB565" category="GLES2.0"/>
+ <value name="GL_STENCIL_INDEX8" category="GLES2.0"/>
+
+ <value name="GL_DEPTH_COMPONENT24_OES" category="OES_depth24"/>
+ <value name="GL_DEPTH_COMPONENT32_OES" category="OES_depth32"/>
+ <value name="GL_RGB8_OES" category="OES_rgb8_rgba8"/>
+ <value name="GL_RGBA8_OES" category="OES_rgb8_rgba8"/>
+ <value name="GL_STENCIL_INDEX1_OES" category="OES_stencil1"/>
+ <value name="GL_STENCIL_INDEX4_OES" category="OES_stencil4"/>
+ <value name="GL_DEPTH24_STENCIL8_OES" category="OES_packed_depth_stencil"/>
+ </desc>
+</template>
+
+<template name="FramebufferRenderbuffer">
+ <proto>
+ <return type="void"/>
+ <param name="target" type="GLenum"/>
+ <param name="attachment" type="GLenum"/>
+ <param name="renderbuffertarget" type="GLenum"/>
+ <param name="renderbuffer" type="GLuint"/>
+ </proto>
+
+ <desc name="target">
+ <value name="GL_FRAMEBUFFER_OES" category="OES_framebuffer_object"/>
+ <value name="GL_FRAMEBUFFER" category="GLES2.0"/>
+ </desc>
+
+ <desc name="attachment">
+ <value name="GL_COLOR_ATTACHMENT0_OES" category="OES_framebuffer_object"/>
+ <value name="GL_DEPTH_ATTACHMENT_OES" category="OES_framebuffer_object"/>
+ <value name="GL_STENCIL_ATTACHMENT_OES" category="OES_framebuffer_object"/>
+ <value name="GL_COLOR_ATTACHMENT0" category="GLES2.0"/>
+ <value name="GL_DEPTH_ATTACHMENT" category="GLES2.0"/>
+ <value name="GL_STENCIL_ATTACHMENT" category="GLES2.0"/>
+ </desc>
+
+ <desc name="renderbuffertarget">
+ <value name="GL_RENDERBUFFER_OES" category="OES_framebuffer_object"/>
+ <value name="GL_RENDERBUFFER" category="GLES2.0"/>
+ </desc>
+</template>
+
+<template name="FramebufferTexture2D">
+ <proto>
+ <return type="void"/>
+ <param name="target" type="GLenum"/>
+ <param name="attachment" type="GLenum"/>
+ <param name="textarget" type="GLenum"/>
+ <param name="texture" type="GLuint"/>
+ <param name="level" type="GLint"/>
+ </proto>
+
+ <desc name="target">
+ <value name="GL_FRAMEBUFFER_OES" category="OES_framebuffer_object"/>
+ <value name="GL_FRAMEBUFFER" category="GLES2.0"/>
+ </desc>
+
+ <desc name="attachment">
+ <value name="GL_COLOR_ATTACHMENT0_OES" category="OES_framebuffer_object"/>
+ <value name="GL_DEPTH_ATTACHMENT_OES" category="OES_framebuffer_object"/>
+ <value name="GL_STENCIL_ATTACHMENT_OES" category="OES_framebuffer_object"/>
+ <value name="GL_COLOR_ATTACHMENT0" category="GLES2.0"/>
+ <value name="GL_DEPTH_ATTACHMENT" category="GLES2.0"/>
+ <value name="GL_STENCIL_ATTACHMENT" category="GLES2.0"/>
+ </desc>
+
+ <desc name="textarget" error="GL_INVALID_OPERATION">
+ <value name="GL_TEXTURE_2D"/>
+ <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_X" category="GLES2.0"/>
+ <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Y" category="GLES2.0"/>
+ <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Z" category="GLES2.0"/>
+ <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_X" category="GLES2.0"/>
+ <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Y" category="GLES2.0"/>
+ <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Z" category="GLES2.0"/>
+ <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES" category="OES_texture_cube_map"/>
+ <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES" category="OES_texture_cube_map"/>
+ <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES" category="OES_texture_cube_map"/>
+ <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES" category="OES_texture_cube_map"/>
+ <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES" category="OES_texture_cube_map"/>
+ <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES" category="OES_texture_cube_map"/>
+ </desc>
+ <!-- According to the base specification, "level" must be 0. But
+ extension GL_OES_fbo_render_mipmap lifts that restriction,
+ so no restriction is placed here. -->
+</template>
+
+<template name="FramebufferTexture3D">
+ <proto>
+ <return type="void"/>
+ <param name="target" type="GLenum"/>
+ <param name="attachment" type="GLenum"/>
+ <param name="textarget" type="GLenum"/>
+ <param name="texture" type="GLuint"/>
+ <param name="level" type="GLint"/>
+ <param name="zoffset" type="GLint"/>
+ </proto>
+
+ <desc name="target">
+ <value name="GL_FRAMEBUFFER_OES" category="OES_framebuffer_object"/>
+ <value name="GL_FRAMEBUFFER" category="GLES2.0"/>
+ </desc>
+
+ <desc name="attachment">
+ <value name="GL_COLOR_ATTACHMENT0_OES" category="OES_framebuffer_object"/>
+ <value name="GL_DEPTH_ATTACHMENT_OES" category="OES_framebuffer_object"/>
+ <value name="GL_STENCIL_ATTACHMENT_OES" category="OES_framebuffer_object"/>
+ <value name="GL_COLOR_ATTACHMENT0" category="GLES2.0"/>
+ <value name="GL_DEPTH_ATTACHMENT" category="GLES2.0"/>
+ <value name="GL_STENCIL_ATTACHMENT" category="GLES2.0"/>
+ </desc>
+
+ <desc name="textarget" error="GL_INVALID_OPERATION">
+ <value name="GL_TEXTURE_3D_OES" category="OES_texture_3D"/>
+ </desc>
+</template>
+
+<template name="CheckFramebufferStatus" direction="get">
+ <proto>
+ <return type="GLenum"/>
+ <param name="target" type="GLenum"/>
+ </proto>
+
+ <desc name="target">
+ <value name="GL_FRAMEBUFFER_OES" category="OES_framebuffer_object"/>
+ <value name="GL_FRAMEBUFFER" category="GLES2.0"/>
+ </desc>
+</template>
+
+<template name="GetFramebufferAttachmentParameter" direction="get">
+ <proto>
+ <return type="void"/>
+ <param name="target" type="GLenum"/>
+ <param name="attachment" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <vector name="params" type="GLtype *" size="dynamic"/>
+ </proto>
+
+ <desc name="target">
+ <value name="GL_FRAMEBUFFER_OES" category="OES_framebuffer_object"/>
+ <value name="GL_FRAMEBUFFER" category="GLES2.0"/>
+ </desc>
+
+ <desc name="pname">
+ <value name="GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_OES" category="OES_framebuffer_object"/>
+ <value name="GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_OES" category="OES_framebuffer_object"/>
+ <value name="GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_OES" category="OES_framebuffer_object"/>
+ <value name="GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_OES" category="OES_framebuffer_object"/>
+
+ <value name="GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE" category="GLES2.0"/>
+ <value name="GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME" category="GLES2.0"/>
+ <value name="GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL" category="GLES2.0"/>
+ <value name="GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE" category="GLES2.0"/>
+ <value name="GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES" category="OES_texture_3D"/>
+
+ <desc name="params" vector_size="1" convert="false"/>
+ </desc>
+</template>
+
+<template name="GetRenderbufferParameter" direction="get">
+ <proto>
+ <return type="void"/>
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <vector name="params" type="GLtype *" size="dynamic"/>
+ </proto>
+
+ <desc name="target">
+ <value name="GL_RENDERBUFFER_OES" category="OES_framebuffer_object"/>
+ <value name="GL_RENDERBUFFER" category="GLES2.0"/>
+ </desc>
+
+ <desc name="pname" category="OES_framebuffer_object">
+ <value name="GL_RENDERBUFFER_WIDTH_OES"/>
+ <value name="GL_RENDERBUFFER_HEIGHT_OES"/>
+ <value name="GL_RENDERBUFFER_INTERNAL_FORMAT_OES"/>
+ <value name="GL_RENDERBUFFER_RED_SIZE_OES"/>
+ <value name="GL_RENDERBUFFER_GREEN_SIZE_OES"/>
+ <value name="GL_RENDERBUFFER_BLUE_SIZE_OES"/>
+ <value name="GL_RENDERBUFFER_ALPHA_SIZE_OES"/>
+ <value name="GL_RENDERBUFFER_DEPTH_SIZE_OES"/>
+ <value name="GL_RENDERBUFFER_STENCIL_SIZE_OES"/>
+
+ <desc name="params" vector_size="1" convert="false"/>
+ </desc>
+
+ <desc name="pname" category="GLES2.0">
+ <value name="GL_RENDERBUFFER_WIDTH"/>
+ <value name="GL_RENDERBUFFER_HEIGHT"/>
+ <value name="GL_RENDERBUFFER_INTERNAL_FORMAT"/>
+ <value name="GL_RENDERBUFFER_RED_SIZE"/>
+ <value name="GL_RENDERBUFFER_GREEN_SIZE"/>
+ <value name="GL_RENDERBUFFER_BLUE_SIZE"/>
+ <value name="GL_RENDERBUFFER_ALPHA_SIZE"/>
+ <value name="GL_RENDERBUFFER_DEPTH_SIZE"/>
+ <value name="GL_RENDERBUFFER_STENCIL_SIZE"/>
+
+ <desc name="params" vector_size="1" convert="false"/>
+ </desc>
+</template>
+
+<template name="IsRenderbuffer" direction="get">
+ <proto>
+ <return type="GLboolean"/>
+ <param name="renderbuffer" type="GLuint"/>
+ </proto>
+</template>
+
+<template name="IsFramebuffer" direction="get">
+ <proto>
+ <return type="GLboolean"/>
+ <param name="framebuffer" type="GLuint"/>
+ </proto>
+</template>
+
+<template name="IsShader" direction="get">
+ <proto>
+ <return type="GLboolean"/>
+ <param name="shader" type="GLuint"/>
+ </proto>
+</template>
+
+<template name="GetShader" direction="get">
+ <proto>
+ <return type="void"/>
+ <param name="shader" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <vector name="params" type="GLtype *" size="dynamic"/>
+ </proto>
+
+ <desc name="pname">
+ <value name="GL_SHADER_TYPE"/>
+ <value name="GL_COMPILE_STATUS"/>
+ <value name="GL_DELETE_STATUS"/>
+ <value name="GL_INFO_LOG_LENGTH"/>
+ <value name="GL_SHADER_SOURCE_LENGTH"/>
+ </desc>
+</template>
+
+<template name="GetAttachedShaders" direction="get">
+ <proto>
+ <return type="void"/>
+ <param name="program" type="GLuint"/>
+ <param name="maxCount" type="GLsizei"/>
+ <param name="count" type="GLsizei *"/>
+ <param name="shaders" type="GLuint *"/>
+ </proto>
+</template>
+
+<template name="GetShaderInfoLog" direction="get">
+ <proto>
+ <return type="void"/>
+ <param name="shader" type="GLuint"/>
+ <param name="bufSize" type="GLsizei"/>
+ <param name="length" type="GLsizei *"/>
+ <param name="infoLog" type="GLchar *"/>
+ </proto>
+</template>
+
+<template name="GetProgramInfoLog" direction="get">
+ <proto>
+ <return type="void"/>
+ <param name="program" type="GLuint"/>
+ <param name="bufSize" type="GLsizei"/>
+ <param name="length" type="GLsizei *"/>
+ <param name="infoLog" type="GLchar *"/>
+ </proto>
+</template>
+
+<template name="GetShaderSource" direction="get">
+ <proto>
+ <return type="void"/>
+ <param name="shader" type="GLuint"/>
+ <param name="bufSize" type="GLsizei"/>
+ <param name="length" type="GLsizei *"/>
+ <param name="source" type="GLchar *"/>
+ </proto>
+</template>
+
+<template name="GetShaderPrecisionFormat" direction="get">
+ <proto>
+ <return type="void"/>
+ <param name="shadertype" type="GLenum"/>
+ <param name="precisiontype" type="GLenum"/>
+ <param name="range" type="GLint *"/>
+ <param name="precision" type="GLint *"/>
+ </proto>
+
+ <desc name="shadertype">
+ <value name="GL_VERTEX_SHADER"/>
+ <value name="GL_FRAGMENT_SHADER"/>
+ </desc>
+
+ <desc name="precisiontype">
+ <value name="GL_LOW_FLOAT"/>
+ <value name="GL_MEDIUM_FLOAT"/>
+ <value name="GL_HIGH_FLOAT"/>
+ <value name="GL_LOW_INT"/>
+ <value name="GL_MEDIUM_INT"/>
+ <value name="GL_HIGH_INT"/>
+ </desc>
+</template>
+
+<template name="GetUniform" direction="get">
+ <proto>
+ <return type="void"/>
+ <param name="program" type="GLuint"/>
+ <param name="location" type="GLint"/>
+ <vector name="params" type="GLtype *" size="dynamic"/>
+ </proto>
+</template>
+
+<template name="QueryMatrix" direction="get">
+ <proto>
+ <return type="GLbitfield"/>
+ <vector name="mantissa" type="GLtype *" size="16"/>
+ <vector name="exponent" type="GLint *" size="16"/>
+ </proto>
+</template>
+
+<template name="DrawTex">
+ <proto>
+ <return type="void"/>
+ <vector name="coords" type="const GLtype *" size="5">
+ <param name="x" type="GLtype"/>
+ <param name="y" type="GLtype"/>
+ <param name="z" type="GLtype"/>
+ <param name="w" type="GLtype"/>
+ <param name="h" type="GLtype"/>
+ </vector>
+ </proto>
+</template>
+
+<template name="MultiDrawArrays">
+ <proto>
+ <return type="void"/>
+ <param name="mode" type="GLenum"/>
+ <param name="first" type="GLint *"/>
+ <param name="count" type="GLsizei *"/>
+ <param name="primcount" type="GLsizei"/>
+ </proto>
+
+ <desc name="mode">
+ <value name="GL_POINTS"/>
+ <value name="GL_LINES"/>
+ <value name="GL_LINE_LOOP"/>
+ <value name="GL_LINE_STRIP"/>
+ <value name="GL_TRIANGLES"/>
+ <value name="GL_TRIANGLE_STRIP"/>
+ <value name="GL_TRIANGLE_FAN"/>
+ </desc>
+</template>
+
+<template name="MultiDrawElements">
+ <proto>
+ <return type="void"/>
+ <param name="mode" type="GLenum"/>
+ <param name="count" type="const GLsizei *"/>
+ <param name="type" type="GLenum"/>
+ <param name="indices" type="const GLvoid **"/>
+ <param name="primcount" type="GLsizei"/>
+ </proto>
+
+ <desc name="mode">
+ <value name="GL_POINTS"/>
+ <value name="GL_LINES"/>
+ <value name="GL_LINE_LOOP"/>
+ <value name="GL_LINE_STRIP"/>
+ <value name="GL_TRIANGLES"/>
+ <value name="GL_TRIANGLE_STRIP"/>
+ <value name="GL_TRIANGLE_FAN"/>
+ </desc>
+
+ <desc name="type">
+ <value name="GL_UNSIGNED_BYTE"/>
+ <value name="GL_UNSIGNED_SHORT"/>
+ <!-- GL_UNSIGNED_INT is not defined in GLES1.1 headers -->
+ <value name="(0x1405 /* GL_UNSIGNED_INT */)" category="OES_element_index_uint"/>
+ </desc>
+</template>
+
+<api name="mesa" implementation="true">
+ <category name="MESA"/>
+
+ <function name="Color4f" default_prefix="_vbo_" template="Color" gltype="GLfloat" vector_size="4" expand_vector="true"/>
+ <function name="ClipPlane" template="ClipPlane" gltype="GLdouble"/>
+ <function name="CullFace" template="CullFace"/>
+
+ <function name="Fogf" template="Fog" gltype="GLfloat" expand_vector="true"/>
+ <function name="Fogfv" template="Fog" gltype="GLfloat"/>
+
+ <function name="FrontFace" template="FrontFace"/>
+ <function name="Hint" template="Hint"/>
+
+ <function name="Lightf" template="Light" gltype="GLfloat" expand_vector="true"/>
+ <function name="Lightfv" template="Light" gltype="GLfloat"/>
+
+ <function name="LightModelf" template="LightModel" gltype="GLfloat" expand_vector="true"/>
+ <function name="LightModelfv" template="LightModel" gltype="GLfloat"/>
+
+ <function name="LineWidth" template="LineWidth" gltype="GLfloat"/>
+
+ <function name="Materialf" default_prefix="_vbo_" template="Material" gltype="GLfloat" expand_vector="true"/>
+ <function name="Materialfv" default_prefix="_vbo_" template="Material" gltype="GLfloat"/>
+
+ <function name="PointSize" template="PointSize" gltype="GLfloat"/>
+ <function name="PointSizePointer" template="PointSizePointer"/>
+
+ <function name="Scissor" template="Scissor"/>
+ <function name="ShadeModel" template="ShadeModel"/>
+
+ <function name="TexParameterf" template="TexParameter" gltype="GLfloat" expand_vector="true"/>
+ <function name="TexParameterfv" template="TexParameter" gltype="GLfloat"/>
+ <function name="TexParameteri" template="TexParameter" gltype="GLint" expand_vector="true"/>
+ <function name="TexParameteriv" template="TexParameter" gltype="GLint"/>
+
+ <function name="TexImage2D" template="TexImage2D"/>
+
+ <function name="TexEnvf" template="TexEnv" gltype="GLfloat" expand_vector="true"/>
+ <function name="TexEnvi" template="TexEnv" gltype="GLint" expand_vector="true"/>
+ <function name="TexEnvfv" template="TexEnv" gltype="GLfloat"/>
+ <function name="TexEnviv" template="TexEnv" gltype="GLint"/>
+
+ <function name="TexGenf" template="TexGen" gltype="GLfloat" expand_vector="true"/>
+ <function name="TexGenfv" template="TexGen" gltype="GLfloat"/>
+
+ <function name="Clear" template="Clear"/>
+ <function name="ClearColor" template="ClearColor" gltype="GLclampf"/>
+ <function name="ClearStencil" template="ClearStencil"/>
+ <function name="ClearDepth" template="ClearDepth" gltype="GLclampd"/>
+
+ <function name="StencilMask" template="StencilMask"/>
+ <function name="StencilMaskSeparate" template="StencilMaskSeparate"/>
+ <function name="ColorMask" template="ColorMask"/>
+ <function name="DepthMask" template="DepthMask"/>
+ <function name="Disable" template="Disable"/>
+ <function name="Enable" template="Enable"/>
+ <function name="Finish" template="Finish"/>
+ <function name="Flush" template="Flush"/>
+
+ <function name="AlphaFunc" template="AlphaFunc" gltype="GLclampf"/>
+
+ <function name="BlendFunc" template="BlendFunc"/>
+ <function name="LogicOp" template="LogicOp"/>
+ <function name="StencilFunc" template="StencilFunc"/>
+ <function name="StencilFuncSeparate" template="StencilFuncSeparate"/>
+ <function name="StencilOp" template="StencilOp"/>
+ <function name="StencilOpSeparate" template="StencilOpSeparate"/>
+ <function name="DepthFunc" template="DepthFunc"/>
+ <function name="PixelStorei" template="PixelStore" gltype="GLint"/>
+
+ <function name="ReadPixels" template="ReadPixels"/>
+ <function name="GetBooleanv" template="GetState" gltype="GLboolean"/>
+ <function name="GetClipPlane" template="GetClipPlane" gltype="GLdouble"/>
+ <function name="GetError" template="GetError"/>
+ <function name="GetFloatv" template="GetState" gltype="GLfloat"/>
+ <function name="GetFixedv" template="GetState" gltype="GLfixed"/>
+ <function name="GetIntegerv" template="GetState" gltype="GLint"/>
+
+ <function name="GetLightfv" template="GetLight" gltype="GLfloat"/>
+ <function name="GetMaterialfv" template="GetMaterial" gltype="GLfloat"/>
+ <function name="GetMaterialiv" template="GetMaterial" gltype="GLint"/>
+
+ <function name="GetString" template="GetString"/>
+
+ <function name="GetTexEnvfv" template="GetTexEnv" gltype="GLfloat"/>
+ <function name="GetTexEnviv" template="GetTexEnv" gltype="GLint"/>
+ <function name="GetTexGenfv" template="GetTexGen" gltype="GLfloat"/>
+ <function name="GetTexParameterfv" template="GetTexParameter" gltype="GLfloat"/>
+ <function name="GetTexParameteriv" template="GetTexParameter" gltype="GLint"/>
+
+ <function name="IsEnabled" template="IsEnabled"/>
+
+ <function name="DepthRange" template="DepthRange" gltype="GLclampd"/>
+ <function name="Frustum" template="Frustum" gltype="GLdouble"/>
+
+ <function name="LoadIdentity" template="LoadIdentity"/>
+ <function name="LoadMatrixf" template="LoadMatrix" gltype="GLfloat"/>
+ <function name="MatrixMode" template="MatrixMode"/>
+
+ <function name="MultMatrixf" template="MultMatrix" gltype="GLfloat"/>
+ <function name="Ortho" template="Ortho" gltype="GLdouble"/>
+ <function name="PopMatrix" template="PopMatrix"/>
+ <function name="PushMatrix" template="PushMatrix"/>
+
+ <function name="Rotatef" template="Rotate" gltype="GLfloat"/>
+ <function name="Scalef" template="Scale" gltype="GLfloat"/>
+ <function name="Translatef" template="Translate" gltype="GLfloat"/>
+
+ <function name="Viewport" template="Viewport"/>
+
+ <function name="ColorPointer" template="ColorPointer"/>
+ <function name="DisableClientState" template="DisableClientState"/>
+ <function name="DrawArrays" template="DrawArrays"/>
+ <function name="DrawElements" template="DrawElements"/>
+ <function name="EnableClientState" template="EnableClientState"/>
+
+ <function name="GetPointerv" template="GetPointer"/>
+ <function name="Normal3f" default_prefix="_vbo_" template="Normal" gltype="GLfloat" expand_vector="true"/>
+ <function name="NormalPointer" template="NormalPointer"/>
+ <function name="TexCoordPointer" template="TexCoordPointer"/>
+ <function name="VertexPointer" template="VertexPointer"/>
+
+ <function name="PolygonOffset" template="PolygonOffset" gltype="GLfloat"/>
+ <function name="CopyTexImage2D" template="CopyTexImage2D"/>
+ <function name="CopyTexSubImage2D" template="CopyTexSubImage2D"/>
+ <function name="TexSubImage2D" template="TexSubImage2D"/>
+
+ <function name="BindTexture" template="BindTexture"/>
+ <function name="DeleteTextures" template="DeleteTextures"/>
+ <function name="GenTextures" template="GenTextures"/>
+ <function name="IsTexture" template="IsTexture"/>
+
+ <function name="BlendColor" template="BlendColor" gltype="GLclampf"/>
+ <function name="BlendEquation" template="BlendEquation"/>
+ <function name="BlendEquationSeparateEXT" template="BlendEquationSeparate"/>
+
+ <function name="TexImage3D" template="TexImage3D"/>
+ <function name="TexSubImage3D" template="TexSubImage3D"/>
+ <function name="CopyTexSubImage3D" template="CopyTexSubImage3D"/>
+
+ <function name="CompressedTexImage3DARB" template="CompressedTexImage3D"/>
+ <function name="CompressedTexSubImage3DARB" template="CompressedTexSubImage3D"/>
+
+ <function name="ActiveTextureARB" template="ActiveTexture"/>
+ <function name="ClientActiveTextureARB" template="ClientActiveTexture"/>
+
+ <function name="MultiTexCoord4f" default_prefix="_vbo_" template="MultiTexCoord" gltype="GLfloat" vector_size="4" expand_vector="true"/>
+
+ <function name="SampleCoverageARB" template="SampleCoverage" gltype="GLclampf"/>
+
+ <function name="CompressedTexImage2DARB" template="CompressedTexImage2D"/>
+ <function name="CompressedTexSubImage2DARB" template="CompressedTexSubImage2D"/>
+
+ <function name="BlendFuncSeparateEXT" template="BlendFuncSeparate"/>
+
+ <function name="PointParameterf" template="PointParameter" gltype="GLfloat" expand_vector="true"/>
+ <function name="PointParameterfv" template="PointParameter" gltype="GLfloat"/>
+
+ <function name="VertexAttrib1f" default_prefix="_vbo_" template="VertexAttrib" gltype="GLfloat" vector_size="1" expand_vector="true"/>
+ <function name="VertexAttrib2f" default_prefix="_vbo_" template="VertexAttrib" gltype="GLfloat" vector_size="2" expand_vector="true"/>
+ <function name="VertexAttrib3f" default_prefix="_vbo_" template="VertexAttrib" gltype="GLfloat" vector_size="3" expand_vector="true"/>
+ <function name="VertexAttrib4f" default_prefix="_vbo_" template="VertexAttrib" gltype="GLfloat" vector_size="4" expand_vector="true"/>
+ <function name="VertexAttrib1fv" default_prefix="_vbo_" template="VertexAttrib" gltype="GLfloat" vector_size="1"/>
+ <function name="VertexAttrib2fv" default_prefix="_vbo_" template="VertexAttrib" gltype="GLfloat" vector_size="2"/>
+ <function name="VertexAttrib3fv" default_prefix="_vbo_" template="VertexAttrib" gltype="GLfloat" vector_size="3"/>
+ <function name="VertexAttrib4fv" default_prefix="_vbo_" template="VertexAttrib" gltype="GLfloat" vector_size="4"/>
+
+ <function name="VertexAttribPointerARB" template="VertexAttribPointer"/>
+ <function name="EnableVertexAttribArrayARB" template="EnableVertexAttribArray"/>
+ <function name="DisableVertexAttribArrayARB" template="DisableVertexAttribArray"/>
+
+ <function name="IsProgram" template="IsProgram"/>
+ <function name="GetProgramiv" template="GetProgram" gltype="GLint"/>
+
+ <function name="GetVertexAttribfvARB" template="GetVertexAttrib" gltype="GLfloat"/>
+ <function name="GetVertexAttribivARB" template="GetVertexAttrib" gltype="GLint"/>
+ <function name="GetVertexAttribPointervARB" template="GetVertexAttribPointer"/>
+
+ <function name="GetBufferPointervARB" template="GetBufferPointer"/>
+ <function name="MapBufferARB" template="MapBuffer"/>
+ <function name="UnmapBufferARB" template="UnmapBuffer"/>
+ <function name="BindBufferARB" template="BindBuffer"/>
+ <function name="BufferDataARB" template="BufferData"/>
+ <function name="BufferSubDataARB" template="BufferSubData"/>
+ <function name="DeleteBuffersARB" template="DeleteBuffers"/>
+ <function name="GenBuffersARB" template="GenBuffers"/>
+ <function name="GetBufferParameterivARB" template="GetBufferParameter" gltype="GLint"/>
+ <function name="IsBufferARB" template="IsBuffer"/>
+
+ <function name="CreateShader" template="CreateShader"/>
+ <function name="ShaderSourceARB" template="ShaderSource"/>
+ <function name="CompileShaderARB" template="CompileShader"/>
+ <function name="ReleaseShaderCompiler" template="ReleaseShaderCompiler"/>
+ <function name="DeleteShader" template="DeleteShader"/>
+ <function name="ShaderBinary" template="ShaderBinary"/>
+ <function name="CreateProgram" template="CreateProgram"/>
+ <function name="AttachShader" template="AttachShader"/>
+ <function name="DetachShader" template="DetachShader"/>
+ <function name="LinkProgramARB" template="LinkProgram"/>
+ <function name="UseProgramObjectARB" template="UseProgram"/>
+ <function name="DeleteProgram" template="DeleteProgram"/>
+
+ <function name="GetActiveAttribARB" template="GetActiveAttrib"/>
+ <function name="GetAttribLocationARB" template="GetAttribLocation"/>
+ <function name="BindAttribLocationARB" template="BindAttribLocation"/>
+ <function name="GetUniformLocationARB" template="GetUniformLocation"/>
+ <function name="GetActiveUniformARB" template="GetActiveUniform"/>
+
+ <function name="Uniform1fARB" template="Uniform" gltype="GLfloat" vector_size="1" expand_vector="true"/>
+ <function name="Uniform2fARB" template="Uniform" gltype="GLfloat" vector_size="2" expand_vector="true"/>
+ <function name="Uniform3fARB" template="Uniform" gltype="GLfloat" vector_size="3" expand_vector="true"/>
+ <function name="Uniform4fARB" template="Uniform" gltype="GLfloat" vector_size="4" expand_vector="true"/>
+ <function name="Uniform1iARB" template="Uniform" gltype="GLint" vector_size="1" expand_vector="true"/>
+ <function name="Uniform2iARB" template="Uniform" gltype="GLint" vector_size="2" expand_vector="true"/>
+ <function name="Uniform3iARB" template="Uniform" gltype="GLint" vector_size="3" expand_vector="true"/>
+ <function name="Uniform4iARB" template="Uniform" gltype="GLint" vector_size="4" expand_vector="true"/>
+ <function name="Uniform1fvARB" template="Uniform" gltype="GLfloat" vector_size="1"/>
+ <function name="Uniform2fvARB" template="Uniform" gltype="GLfloat" vector_size="2"/>
+ <function name="Uniform3fvARB" template="Uniform" gltype="GLfloat" vector_size="3"/>
+ <function name="Uniform4fvARB" template="Uniform" gltype="GLfloat" vector_size="4"/>
+ <function name="Uniform1ivARB" template="Uniform" gltype="GLint" vector_size="1"/>
+ <function name="Uniform2ivARB" template="Uniform" gltype="GLint" vector_size="2"/>
+ <function name="Uniform3ivARB" template="Uniform" gltype="GLint" vector_size="3"/>
+ <function name="Uniform4ivARB" template="Uniform" gltype="GLint" vector_size="4"/>
+
+ <function name="UniformMatrix2fvARB" template="UniformMatrix" gltype="GLfloat" vector_size="2"/>
+ <function name="UniformMatrix3fvARB" template="UniformMatrix" gltype="GLfloat" vector_size="3"/>
+ <function name="UniformMatrix4fvARB" template="UniformMatrix" gltype="GLfloat" vector_size="4"/>
+
+ <function name="ValidateProgramARB" template="ValidateProgram"/>
+
+ <function name="GenerateMipmapEXT" template="GenerateMipmap"/>
+ <function name="BindFramebufferEXT" template="BindFramebuffer"/>
+ <function name="DeleteFramebuffersEXT" template="DeleteFramebuffers"/>
+ <function name="GenFramebuffersEXT" template="GenFramebuffers"/>
+ <function name="BindRenderbufferEXT" template="BindRenderbuffer"/>
+ <function name="DeleteRenderbuffersEXT" template="DeleteRenderbuffers"/>
+ <function name="GenRenderbuffersEXT" template="GenRenderbuffers"/>
+ <function name="RenderbufferStorageEXT" template="RenderbufferStorage"/>
+ <function name="FramebufferRenderbufferEXT" template="FramebufferRenderbuffer"/>
+ <function name="FramebufferTexture2DEXT" template="FramebufferTexture2D"/>
+ <function name="FramebufferTexture3DEXT" template="FramebufferTexture3D"/>
+ <function name="CheckFramebufferStatusEXT" template="CheckFramebufferStatus"/>
+ <function name="GetFramebufferAttachmentParameterivEXT" template="GetFramebufferAttachmentParameter" gltype="GLint"/>
+ <function name="GetRenderbufferParameterivEXT" template="GetRenderbufferParameter" gltype="GLint"/>
+ <function name="IsRenderbufferEXT" template="IsRenderbuffer"/>
+ <function name="IsFramebufferEXT" template="IsFramebuffer"/>
+
+ <function name="IsShader" template="IsShader"/>
+ <function name="GetShaderiv" template="GetShader" gltype="GLint"/>
+ <function name="GetAttachedShaders" template="GetAttachedShaders"/>
+ <function name="GetShaderInfoLog" template="GetShaderInfoLog"/>
+ <function name="GetProgramInfoLog" template="GetProgramInfoLog"/>
+ <function name="GetShaderSourceARB" template="GetShaderSource"/>
+ <function name="GetShaderPrecisionFormat" template="GetShaderPrecisionFormat"/>
+ <function name="GetUniformfvARB" template="GetUniform" gltype="GLfloat"/>
+ <function name="GetUniformivARB" template="GetUniform" gltype="GLint"/>
+
+ <function name="DrawTexf" template="DrawTex" gltype="GLfloat" expand_vector="true"/>
+ <function name="DrawTexfv" template="DrawTex" gltype="GLfloat"/>
+ <function name="DrawTexi" template="DrawTex" gltype="GLint" expand_vector="true"/>
+ <function name="DrawTexiv" template="DrawTex" gltype="GLint"/>
+ <function name="DrawTexs" template="DrawTex" gltype="GLshort" expand_vector="true"/>
+ <function name="DrawTexsv" template="DrawTex" gltype="GLshort"/>
+
+ <!-- EXT_multi_draw_arrays -->
+ <function name="MultiDrawArraysEXT" template="MultiDrawArrays"/>
+ <function name="MultiDrawElementsEXT" template="MultiDrawElements"/>
+</api>
+
+<api name="GLES1.1">
+ <category name="GLES1.1"/>
+
+ <category name="OES_byte_coordinates"/>
+ <category name="OES_fixed_point"/>
+ <category name="OES_single_precision"/>
+ <category name="OES_matrix_get"/>
+ <category name="OES_read_format"/>
+ <category name="OES_compressed_paletted_texture"/>
+ <category name="OES_point_size_array"/>
+ <category name="OES_point_sprite"/>
+ <category name="OES_query_matrix"/>
+ <category name="OES_draw_texture"/>
+ <category name="OES_blend_equation_separate"/>
+ <category name="OES_blend_func_separate"/>
+ <category name="OES_blend_subtract"/>
+ <category name="OES_stencil_wrap"/>
+ <category name="OES_texture_cube_map"/>
+ <category name="OES_texture_env_crossbar"/>
+ <category name="OES_texture_mirrored_repeat"/>
+ <category name="OES_framebuffer_object"/>
+ <category name="OES_depth24"/>
+ <category name="OES_depth32"/>
+ <category name="OES_fbo_render_mipmap"/>
+ <category name="OES_rgb8_rgba8"/>
+ <category name="OES_stencil1"/>
+ <category name="OES_stencil4"/>
+ <category name="OES_stencil8"/>
+ <category name="OES_element_index_uint"/>
+ <category name="OES_mapbuffer"/>
+ <category name="EXT_texture_filter_anisotropic"/>
+
+ <category name="ARB_texture_non_power_of_two"/>
+ <!-- disabled due to missing enums
+ <category name="EXT_texture_compression_dxt1"/>
+ <category name="EXT_texture_lod_bias"/>
+ <category name="EXT_blend_minmax"/>
+ -->
+ <category name="EXT_multi_draw_arrays"/>
+
+ <category name="OES_matrix_palette"/>
+
+ <function name="Color4f" template="Color" gltype="GLfloat" vector_size="4" expand_vector="true"/>
+ <function name="Color4ub" template="Color" gltype="GLubyte" vector_size="4" expand_vector="true"/>
+ <function name="Color4x" template="Color" gltype="GLfixed" vector_size="4" expand_vector="true"/>
+
+ <function name="ClipPlanef" template="ClipPlane" gltype="GLfloat"/>
+ <function name="ClipPlanex" template="ClipPlane" gltype="GLfixed"/>
+
+ <function name="CullFace" template="CullFace"/>
+
+ <function name="Fogf" template="Fog" gltype="GLfloat" expand_vector="true"/>
+ <function name="Fogx" template="Fog" gltype="GLfixed" expand_vector="true"/>
+ <function name="Fogfv" template="Fog" gltype="GLfloat"/>
+ <function name="Fogxv" template="Fog" gltype="GLfixed"/>
+
+ <function name="FrontFace" template="FrontFace"/>
+ <function name="Hint" template="Hint"/>
+
+ <function name="Lightf" template="Light" gltype="GLfloat" expand_vector="true"/>
+ <function name="Lightx" template="Light" gltype="GLfixed" expand_vector="true"/>
+ <function name="Lightfv" template="Light" gltype="GLfloat"/>
+ <function name="Lightxv" template="Light" gltype="GLfixed"/>
+
+ <function name="LightModelf" template="LightModel" gltype="GLfloat" expand_vector="true"/>
+ <function name="LightModelx" template="LightModel" gltype="GLfixed" expand_vector="true"/>
+ <function name="LightModelfv" template="LightModel" gltype="GLfloat"/>
+ <function name="LightModelxv" template="LightModel" gltype="GLfixed"/>
+
+ <function name="LineWidth" template="LineWidth" gltype="GLfloat"/>
+ <function name="LineWidthx" template="LineWidth" gltype="GLfixed"/>
+
+ <function name="Materialf" template="Material" gltype="GLfloat" expand_vector="true"/>
+ <function name="Materialfv" template="Material" gltype="GLfloat"/>
+ <function name="Materialx" template="Material" gltype="GLfixed" expand_vector="true"/>
+ <function name="Materialxv" template="Material" gltype="GLfixed"/>
+
+ <function name="PointSize" template="PointSize" gltype="GLfloat"/>
+ <function name="PointSizex" template="PointSize" gltype="GLfixed"/>
+ <function name="PointSizePointerOES" template="PointSizePointer"/>
+
+ <function name="Scissor" template="Scissor"/>
+ <function name="ShadeModel" template="ShadeModel"/>
+
+ <function name="TexParameterf" template="TexParameter" gltype="GLfloat" expand_vector="true"/>
+ <function name="TexParameterfv" template="TexParameter" gltype="GLfloat"/>
+ <function name="TexParameteri" template="TexParameter" gltype="GLint" expand_vector="true"/>
+ <function name="TexParameteriv" template="TexParameter" gltype="GLint"/>
+ <function name="TexParameterx" template="TexParameter" gltype="GLfixed" expand_vector="true"/>
+ <function name="TexParameterxv" template="TexParameter" gltype="GLfixed"/>
+
+ <function name="TexImage2D" template="TexImage2D"/>
+
+ <function name="TexEnvf" template="TexEnv" gltype="GLfloat" expand_vector="true"/>
+ <function name="TexEnvfv" template="TexEnv" gltype="GLfloat"/>
+ <function name="TexEnvi" template="TexEnv" gltype="GLint" expand_vector="true"/>
+ <function name="TexEnviv" template="TexEnv" gltype="GLint"/>
+ <function name="TexEnvx" template="TexEnv" gltype="GLfixed" expand_vector="true"/>
+ <function name="TexEnvxv" template="TexEnv" gltype="GLfixed"/>
+
+ <function name="TexGenfOES" external="true" template="TexGen" gltype="GLfloat" expand_vector="true"/>
+ <function name="TexGenfvOES" external="true" template="TexGen" gltype="GLfloat"/>
+ <function name="TexGeniOES" external="true" template="TexGen" gltype="GLint" expand_vector="true"/>
+ <function name="TexGenivOES" external="true" template="TexGen" gltype="GLint"/>
+ <function name="TexGenxOES" external="true" template="TexGen" gltype="GLfixed" expand_vector="true"/>
+ <function name="TexGenxvOES" external="true" template="TexGen" gltype="GLfixed"/>
+
+ <function name="Clear" template="Clear"/>
+ <function name="ClearColor" template="ClearColor" gltype="GLclampf"/>
+ <function name="ClearColorx" template="ClearColor" gltype="GLclampx"/>
+
+ <function name="ClearStencil" template="ClearStencil"/>
+ <function name="ClearDepthf" template="ClearDepth" gltype="GLclampf"/>
+ <function name="ClearDepthx" template="ClearDepth" gltype="GLclampx"/>
+
+ <function name="StencilMask" template="StencilMask"/>
+ <function name="ColorMask" template="ColorMask"/>
+ <function name="DepthMask" template="DepthMask"/>
+
+ <function name="Disable" external="true" template="Disable"/>
+ <function name="Enable" external="true" template="Enable"/>
+ <function name="Finish" template="Finish"/>
+ <function name="Flush" template="Flush"/>
+
+ <function name="AlphaFunc" template="AlphaFunc" gltype="GLclampf"/>
+ <function name="AlphaFuncx" template="AlphaFunc" gltype="GLclampx"/>
+
+ <function name="BlendFunc" template="BlendFunc"/>
+ <function name="LogicOp" template="LogicOp"/>
+ <function name="StencilFunc" template="StencilFunc"/>
+
+ <function name="StencilOp" template="StencilOp"/>
+ <function name="DepthFunc" template="DepthFunc"/>
+
+ <function name="PixelStorei" template="PixelStore" gltype="GLint"/>
+ <function name="ReadPixels" template="ReadPixels"/>
+
+ <function name="GetBooleanv" template="GetState" gltype="GLboolean"/>
+
+ <function name="GetClipPlanef" template="GetClipPlane" gltype="GLfloat"/>
+ <function name="GetClipPlanex" template="GetClipPlane" gltype="GLfixed"/>
+
+ <function name="GetError" template="GetError"/>
+ <function name="GetFloatv" template="GetState" gltype="GLfloat"/>
+ <function name="GetFixedv" template="GetState" gltype="GLfixed"/>
+ <function name="GetIntegerv" template="GetState" gltype="GLint"/>
+
+ <function name="GetLightfv" template="GetLight" gltype="GLfloat"/>
+ <function name="GetLightxv" template="GetLight" gltype="GLfixed"/>
+
+ <function name="GetMaterialfv" template="GetMaterial" gltype="GLfloat"/>
+ <function name="GetMaterialxv" template="GetMaterial" gltype="GLfixed"/>
+
+ <function name="GetString" external="true" template="GetString"/>
+
+ <function name="GetTexEnvfv" template="GetTexEnv" gltype="GLfloat"/>
+ <function name="GetTexEnviv" template="GetTexEnv" gltype="GLint"/>
+ <function name="GetTexEnvxv" template="GetTexEnv" gltype="GLfixed"/>
+
+ <function name="GetTexGenfvOES" external="true" template="GetTexGen" gltype="GLfloat"/>
+ <function name="GetTexGenivOES" external="true" template="GetTexGen" gltype="GLint"/>
+ <function name="GetTexGenxvOES" external="true" template="GetTexGen" gltype="GLfixed"/>
+
+ <function name="GetTexParameterfv" template="GetTexParameter" gltype="GLfloat"/>
+ <function name="GetTexParameteriv" template="GetTexParameter" gltype="GLint"/>
+ <function name="GetTexParameterxv" template="GetTexParameter" gltype="GLfixed"/>
+
+ <function name="IsEnabled" external="true" template="IsEnabled"/>
+
+ <function name="DepthRangef" template="DepthRange" gltype="GLclampf"/>
+ <function name="DepthRangex" template="DepthRange" gltype="GLclampx"/>
+
+ <function name="Frustumf" template="Frustum" gltype="GLfloat"/>
+ <function name="Frustumx" template="Frustum" gltype="GLfixed"/>
+
+ <function name="LoadIdentity" template="LoadIdentity"/>
+ <function name="LoadMatrixf" template="LoadMatrix" gltype="GLfloat"/>
+ <function name="LoadMatrixx" template="LoadMatrix" gltype="GLfixed"/>
+ <function name="MatrixMode" template="MatrixMode"/>
+
+ <function name="MultMatrixf" template="MultMatrix" gltype="GLfloat"/>
+ <function name="MultMatrixx" template="MultMatrix" gltype="GLfixed"/>
+ <function name="Orthof" template="Ortho" gltype="GLfloat"/>
+ <function name="Orthox" template="Ortho" gltype="GLfixed"/>
+
+ <function name="PopMatrix" template="PopMatrix"/>
+ <function name="PushMatrix" template="PushMatrix"/>
+
+ <function name="Rotatef" template="Rotate" gltype="GLfloat"/>
+ <function name="Rotatex" template="Rotate" gltype="GLfixed"/>
+ <function name="Scalef" template="Scale" gltype="GLfloat"/>
+ <function name="Scalex" template="Scale" gltype="GLfixed"/>
+ <function name="Translatef" template="Translate" gltype="GLfloat"/>
+ <function name="Translatex" template="Translate" gltype="GLfixed"/>
+
+ <function name="Viewport" template="Viewport"/>
+ <function name="ColorPointer" template="ColorPointer"/>
+ <function name="DisableClientState" template="DisableClientState"/>
+ <function name="DrawArrays" template="DrawArrays"/>
+ <function name="DrawElements" template="DrawElements"/>
+ <function name="EnableClientState" template="EnableClientState"/>
+
+ <function name="GetPointerv" template="GetPointer"/>
+
+ <function name="Normal3f" template="Normal" gltype="GLfloat" expand_vector="true"/>
+ <function name="Normal3x" template="Normal" gltype="GLfixed" expand_vector="true"/>
+ <function name="NormalPointer" template="NormalPointer"/>
+ <function name="TexCoordPointer" template="TexCoordPointer"/>
+ <function name="VertexPointer" template="VertexPointer"/>
+
+ <function name="PolygonOffset" template="PolygonOffset" gltype="GLfloat"/>
+ <function name="PolygonOffsetx" template="PolygonOffset" gltype="GLfixed"/>
+
+ <function name="CopyTexImage2D" template="CopyTexImage2D"/>
+ <function name="CopyTexSubImage2D" template="CopyTexSubImage2D"/>
+
+ <function name="TexSubImage2D" template="TexSubImage2D"/>
+
+ <function name="BindTexture" template="BindTexture"/>
+ <function name="DeleteTextures" template="DeleteTextures"/>
+ <function name="GenTextures" template="GenTextures"/>
+ <function name="IsTexture" template="IsTexture"/>
+
+ <function name="BlendEquationOES" template="BlendEquation"/>
+ <function name="BlendEquationSeparateOES" template="BlendEquationSeparate"/>
+
+ <function name="MultiTexCoord4x" template="MultiTexCoord" gltype="GLfixed" vector_size="4" expand_vector="true"/>
+
+ <function name="ActiveTexture" template="ActiveTexture"/>
+ <function name="ClientActiveTexture" template="ClientActiveTexture"/>
+
+ <function name="MultiTexCoord4f" template="MultiTexCoord" gltype="GLfloat" vector_size="4" expand_vector="true"/>
+
+ <function name="SampleCoverage" template="SampleCoverage" gltype="GLclampf"/>
+ <function name="SampleCoveragex" template="SampleCoverage" gltype="GLclampx"/>
+
+ <!-- CompressedTexImage2D calls out to two different functions based on
+ whether the image is a paletted image or not -->
+ <function name="CompressedTexImage2D" external="true" template="CompressedTexImage2D"/>
+ <function name="CompressedTexSubImage2D" template="CompressedTexSubImage2D"/>
+
+ <function name="BlendFuncSeparateOES" template="BlendFuncSeparate"/>
+
+ <function name="PointParameterf" template="PointParameter" gltype="GLfloat" expand_vector="true"/>
+ <function name="PointParameterfv" template="PointParameter" gltype="GLfloat"/>
+ <function name="PointParameterx" template="PointParameter" gltype="GLfixed" expand_vector="true"/>
+ <function name="PointParameterxv" template="PointParameter" gltype="GLfixed"/>
+
+ <!-- OES_mapbuffer -->
+ <function name="GetBufferPointervOES" template="GetBufferPointer"/>
+ <function name="MapBufferOES" template="MapBuffer"/>
+ <function name="UnmapBufferOES" template="UnmapBuffer"/>
+
+ <function name="BindBuffer" template="BindBuffer"/>
+ <function name="BufferData" template="BufferData"/>
+ <function name="BufferSubData" template="BufferSubData"/>
+ <function name="DeleteBuffers" template="DeleteBuffers"/>
+ <function name="GenBuffers" template="GenBuffers"/>
+ <function name="GetBufferParameteriv" template="GetBufferParameter" gltype="GLint"/>
+ <function name="IsBuffer" template="IsBuffer"/>
+
+ <!-- OES_framebuffer_object -->
+ <function name="GenerateMipmapOES" template="GenerateMipmap"/>
+ <function name="BindFramebufferOES" template="BindFramebuffer"/>
+ <function name="DeleteFramebuffersOES" template="DeleteFramebuffers"/>
+ <function name="GenFramebuffersOES" template="GenFramebuffers"/>
+ <function name="BindRenderbufferOES" template="BindRenderbuffer"/>
+ <function name="DeleteRenderbuffersOES" template="DeleteRenderbuffers"/>
+ <function name="GenRenderbuffersOES" template="GenRenderbuffers"/>
+ <function name="RenderbufferStorageOES" external="true" template="RenderbufferStorage"/>
+ <function name="FramebufferRenderbufferOES" template="FramebufferRenderbuffer"/>
+ <function name="FramebufferTexture2DOES" template="FramebufferTexture2D"/>
+ <function name="CheckFramebufferStatusOES" template="CheckFramebufferStatus"/>
+ <function name="GetFramebufferAttachmentParameterivOES" template="GetFramebufferAttachmentParameter" gltype="GLint"/>
+ <function name="GetRenderbufferParameterivOES" template="GetRenderbufferParameter" gltype="GLint"/>
+ <function name="IsRenderbufferOES" template="IsRenderbuffer"/>
+ <function name="IsFramebufferOES" template="IsFramebuffer"/>
+
+ <!-- OES_query_matrix -->
+ <!-- QueryMatrixx returns values in an unusual, decomposed, fixed-value
+ form; it has its own code for this -->
+ <function name="QueryMatrixxOES" external="true" template="QueryMatrix" gltype="GLfixed"/>
+
+ <!-- OES_draw_texture -->
+ <function name="DrawTexfOES" template="DrawTex" gltype="GLfloat" expand_vector="true"/>
+ <function name="DrawTexiOES" template="DrawTex" gltype="GLint" expand_vector="true"/>
+ <function name="DrawTexsOES" template="DrawTex" gltype="GLshort" expand_vector="true"/>
+ <function name="DrawTexxOES" template="DrawTex" gltype="GLfixed" expand_vector="true"/>
+ <function name="DrawTexfvOES" template="DrawTex" gltype="GLfloat"/>
+ <function name="DrawTexivOES" template="DrawTex" gltype="GLint"/>
+ <function name="DrawTexsvOES" template="DrawTex" gltype="GLshort"/>
+ <function name="DrawTexxvOES" template="DrawTex" gltype="GLfixed"/>
+
+ <!-- EXT_multi_draw_arrays -->
+ <function name="MultiDrawArraysEXT" template="MultiDrawArrays"/>
+ <function name="MultiDrawElementsEXT" template="MultiDrawElements"/>
+</api>
+
+<api name="GLES2.0">
+ <category name="GLES2.0"/>
+
+ <category name="OES_compressed_paletted_texture"/>
+ <category name="OES_depth24"/>
+ <category name="OES_depth32"/>
+ <category name="OES_fbo_render_mipmap"/>
+ <category name="OES_rgb8_rgba8"/>
+ <category name="OES_stencil1"/>
+ <category name="OES_stencil4"/>
+ <category name="OES_element_index_uint"/>
+ <category name="OES_mapbuffer"/>
+ <category name="OES_texture_3D"/>
+ <category name="OES_texture_npot"/>
+ <category name="EXT_texture_filter_anisotropic"/>
+ <category name="EXT_texture_type_2_10_10_10_REV"/>
+ <category name="OES_depth_texture"/>
+ <category name="OES_packed_depth_stencil"/>
+ <category name="OES_standard_derivatives"/>
+
+ <!-- disabled due to missing enums
+ <category name="EXT_texture_compression_dxt1"/>
+ <category name="EXT_blend_minmax"/>
+ -->
+ <category name="EXT_multi_draw_arrays"/>
+
+ <function name="CullFace" template="CullFace"/>
+
+ <function name="FrontFace" template="FrontFace"/>
+ <function name="Hint" template="Hint"/>
+
+ <function name="LineWidth" template="LineWidth" gltype="GLfloat"/>
+
+ <function name="Scissor" template="Scissor"/>
+
+ <function name="TexParameterf" template="TexParameter" gltype="GLfloat" expand_vector="true"/>
+ <function name="TexParameterfv" template="TexParameter" gltype="GLfloat"/>
+ <function name="TexParameteri" template="TexParameter" gltype="GLint" expand_vector="true"/>
+ <function name="TexParameteriv" template="TexParameter" gltype="GLint"/>
+
+ <function name="TexImage2D" template="TexImage2D"/>
+
+ <function name="Clear" template="Clear"/>
+ <function name="ClearColor" template="ClearColor" gltype="GLclampf"/>
+ <function name="ClearStencil" template="ClearStencil"/>
+ <function name="ClearDepthf" template="ClearDepth" gltype="GLclampf"/>
+
+ <function name="StencilMask" template="StencilMask"/>
+ <function name="StencilMaskSeparate" template="StencilMaskSeparate"/>
+ <function name="ColorMask" template="ColorMask"/>
+ <function name="DepthMask" template="DepthMask"/>
+ <function name="Disable" template="Disable"/>
+ <function name="Enable" template="Enable"/>
+ <function name="Finish" template="Finish"/>
+ <function name="Flush" template="Flush"/>
+
+ <function name="BlendFunc" template="BlendFunc"/>
+
+ <function name="StencilFunc" template="StencilFunc"/>
+ <function name="StencilFuncSeparate" template="StencilFuncSeparate"/>
+ <function name="StencilOp" template="StencilOp"/>
+ <function name="StencilOpSeparate" template="StencilOpSeparate"/>
+
+ <function name="DepthFunc" template="DepthFunc"/>
+
+ <function name="PixelStorei" template="PixelStore" gltype="GLint"/>
+ <function name="ReadPixels" template="ReadPixels"/>
+
+ <function name="GetBooleanv" template="GetState" gltype="GLboolean"/>
+ <function name="GetError" template="GetError"/>
+ <function name="GetFloatv" template="GetState" gltype="GLfloat"/>
+ <function name="GetIntegerv" template="GetState" gltype="GLint"/>
+
+ <function name="GetString" external="true" template="GetString"/>
+
+ <function name="GetTexParameterfv" template="GetTexParameter" gltype="GLfloat"/>
+ <function name="GetTexParameteriv" template="GetTexParameter" gltype="GLint"/>
+
+ <function name="IsEnabled" template="IsEnabled"/>
+
+ <function name="DepthRangef" template="DepthRange" gltype="GLclampf"/>
+
+ <function name="Viewport" template="Viewport"/>
+
+ <function name="DrawArrays" template="DrawArrays"/>
+ <function name="DrawElements" template="DrawElements"/>
+
+ <function name="PolygonOffset" template="PolygonOffset" gltype="GLfloat"/>
+ <function name="CopyTexImage2D" template="CopyTexImage2D"/>
+ <function name="CopyTexSubImage2D" template="CopyTexSubImage2D"/>
+ <function name="TexSubImage2D" template="TexSubImage2D"/>
+
+ <function name="BindTexture" template="BindTexture"/>
+ <function name="DeleteTextures" template="DeleteTextures"/>
+ <function name="GenTextures" template="GenTextures"/>
+ <function name="IsTexture" template="IsTexture"/>
+
+ <function name="BlendColor" template="BlendColor" gltype="GLclampf"/>
+ <function name="BlendEquation" template="BlendEquation"/>
+ <function name="BlendEquationSeparate" template="BlendEquationSeparate"/>
+
+ <function name="TexImage3DOES" template="TexImage3D"/>
+ <function name="TexSubImage3DOES" template="TexSubImage3D"/>
+ <function name="CopyTexSubImage3DOES" template="CopyTexSubImage3D"/>
+
+ <function name="CompressedTexImage3DOES" template="CompressedTexImage3D"/>
+ <function name="CompressedTexSubImage3DOES" template="CompressedTexSubImage3D"/>
+
+ <function name="ActiveTexture" template="ActiveTexture"/>
+
+ <function name="SampleCoverage" template="SampleCoverage" gltype="GLclampf"/>
+
+ <function name="CompressedTexImage2D" external="true" template="CompressedTexImage2D"/>
+ <function name="CompressedTexSubImage2D" template="CompressedTexSubImage2D"/>
+
+ <function name="BlendFuncSeparate" template="BlendFuncSeparate"/>
+
+ <function name="VertexAttrib1f" template="VertexAttrib" gltype="GLfloat" vector_size="1" expand_vector="true"/>
+ <function name="VertexAttrib2f" template="VertexAttrib" gltype="GLfloat" vector_size="2" expand_vector="true"/>
+ <function name="VertexAttrib3f" template="VertexAttrib" gltype="GLfloat" vector_size="3" expand_vector="true"/>
+ <function name="VertexAttrib4f" template="VertexAttrib" gltype="GLfloat" vector_size="4" expand_vector="true"/>
+ <function name="VertexAttrib1fv" template="VertexAttrib" gltype="GLfloat" vector_size="1"/>
+ <function name="VertexAttrib2fv" template="VertexAttrib" gltype="GLfloat" vector_size="2"/>
+ <function name="VertexAttrib3fv" template="VertexAttrib" gltype="GLfloat" vector_size="3"/>
+ <function name="VertexAttrib4fv" template="VertexAttrib" gltype="GLfloat" vector_size="4"/>
+
+ <function name="VertexAttribPointer" template="VertexAttribPointer"/>
+
+ <function name="EnableVertexAttribArray" template="EnableVertexAttribArray"/>
+ <function name="DisableVertexAttribArray" template="DisableVertexAttribArray"/>
+
+ <function name="IsProgram" template="IsProgram"/>
+ <function name="GetProgramiv" template="GetProgram" gltype="GLint"/>
+
+ <function name="GetVertexAttribfv" template="GetVertexAttrib" gltype="GLfloat"/>
+ <function name="GetVertexAttribiv" template="GetVertexAttrib" gltype="GLint"/>
+ <function name="GetVertexAttribPointerv" template="GetVertexAttribPointer"/>
+
+ <function name="GetBufferPointervOES" template="GetBufferPointer"/>
+ <function name="MapBufferOES" template="MapBuffer"/>
+ <function name="UnmapBufferOES" template="UnmapBuffer"/>
+ <function name="BindBuffer" template="BindBuffer"/>
+ <function name="BufferData" template="BufferData"/>
+ <function name="BufferSubData" template="BufferSubData"/>
+ <function name="DeleteBuffers" template="DeleteBuffers"/>
+ <function name="GenBuffers" template="GenBuffers"/>
+ <function name="GetBufferParameteriv" template="GetBufferParameter" gltype="GLint"/>
+ <function name="IsBuffer" template="IsBuffer"/>
+
+ <function name="CreateShader" template="CreateShader"/>
+ <function name="ShaderSource" template="ShaderSource"/>
+ <function name="CompileShader" template="CompileShader"/>
+ <function name="ReleaseShaderCompiler" template="ReleaseShaderCompiler"/>
+ <function name="DeleteShader" template="DeleteShader"/>
+ <function name="ShaderBinary" template="ShaderBinary"/>
+ <function name="CreateProgram" template="CreateProgram"/>
+ <function name="AttachShader" template="AttachShader"/>
+ <function name="DetachShader" template="DetachShader"/>
+ <function name="LinkProgram" template="LinkProgram"/>
+ <function name="UseProgram" template="UseProgram"/>
+ <function name="DeleteProgram" template="DeleteProgram"/>
+
+ <function name="GetActiveAttrib" template="GetActiveAttrib"/>
+ <function name="GetAttribLocation" template="GetAttribLocation"/>
+ <function name="BindAttribLocation" template="BindAttribLocation"/>
+ <function name="GetUniformLocation" template="GetUniformLocation"/>
+ <function name="GetActiveUniform" template="GetActiveUniform"/>
+
+ <function name="Uniform1f" template="Uniform" gltype="GLfloat" vector_size="1" expand_vector="true"/>
+ <function name="Uniform2f" template="Uniform" gltype="GLfloat" vector_size="2" expand_vector="true"/>
+ <function name="Uniform3f" template="Uniform" gltype="GLfloat" vector_size="3" expand_vector="true"/>
+ <function name="Uniform4f" template="Uniform" gltype="GLfloat" vector_size="4" expand_vector="true"/>
+ <function name="Uniform1i" template="Uniform" gltype="GLint" vector_size="1" expand_vector="true"/>
+ <function name="Uniform2i" template="Uniform" gltype="GLint" vector_size="2" expand_vector="true"/>
+ <function name="Uniform3i" template="Uniform" gltype="GLint" vector_size="3" expand_vector="true"/>
+ <function name="Uniform4i" template="Uniform" gltype="GLint" vector_size="4" expand_vector="true"/>
+
+ <function name="Uniform1fv" template="Uniform" gltype="GLfloat" vector_size="1"/>
+ <function name="Uniform2fv" template="Uniform" gltype="GLfloat" vector_size="2"/>
+ <function name="Uniform3fv" template="Uniform" gltype="GLfloat" vector_size="3"/>
+ <function name="Uniform4fv" template="Uniform" gltype="GLfloat" vector_size="4"/>
+ <function name="Uniform1iv" template="Uniform" gltype="GLint" vector_size="1"/>
+ <function name="Uniform2iv" template="Uniform" gltype="GLint" vector_size="2"/>
+ <function name="Uniform3iv" template="Uniform" gltype="GLint" vector_size="3"/>
+ <function name="Uniform4iv" template="Uniform" gltype="GLint" vector_size="4"/>
+
+ <function name="UniformMatrix2fv" template="UniformMatrix" gltype="GLfloat" vector_size="2"/>
+ <function name="UniformMatrix3fv" template="UniformMatrix" gltype="GLfloat" vector_size="3"/>
+ <function name="UniformMatrix4fv" template="UniformMatrix" gltype="GLfloat" vector_size="4"/>
+
+ <function name="ValidateProgram" template="ValidateProgram"/>
+
+ <function name="GenerateMipmap" template="GenerateMipmap"/>
+ <function name="BindFramebuffer" template="BindFramebuffer"/>
+ <function name="DeleteFramebuffers" template="DeleteFramebuffers"/>
+ <function name="GenFramebuffers" template="GenFramebuffers"/>
+ <function name="BindRenderbuffer" template="BindRenderbuffer"/>
+ <function name="DeleteRenderbuffers" template="DeleteRenderbuffers"/>
+ <function name="GenRenderbuffers" template="GenRenderbuffers"/>
+ <function name="RenderbufferStorage" external="true" template="RenderbufferStorage"/>
+ <function name="FramebufferRenderbuffer" template="FramebufferRenderbuffer"/>
+ <function name="FramebufferTexture2D" template="FramebufferTexture2D"/>
+ <function name="FramebufferTexture3DOES" template="FramebufferTexture3D"/>
+ <function name="CheckFramebufferStatus" template="CheckFramebufferStatus"/>
+ <function name="GetFramebufferAttachmentParameteriv" template="GetFramebufferAttachmentParameter" gltype="GLint"/>
+ <function name="GetRenderbufferParameteriv" template="GetRenderbufferParameter" gltype="GLint"/>
+ <function name="IsRenderbuffer" template="IsRenderbuffer"/>
+ <function name="IsFramebuffer" template="IsFramebuffer"/>
+
+ <function name="IsShader" template="IsShader"/>
+ <function name="GetShaderiv" template="GetShader" gltype="GLint"/>
+ <function name="GetAttachedShaders" template="GetAttachedShaders"/>
+ <function name="GetShaderInfoLog" template="GetShaderInfoLog"/>
+ <function name="GetProgramInfoLog" template="GetProgramInfoLog"/>
+ <function name="GetShaderSource" template="GetShaderSource"/>
+ <function name="GetShaderPrecisionFormat" template="GetShaderPrecisionFormat"/>
+ <function name="GetUniformfv" template="GetUniform" gltype="GLfloat"/>
+ <function name="GetUniformiv" template="GetUniform" gltype="GLint"/>
+
+ <!-- EXT_multi_draw_arrays -->
+ <function name="MultiDrawArraysEXT" template="MultiDrawArrays"/>
+ <function name="MultiDrawElementsEXT" template="MultiDrawElements"/>
+</api>
+
+</apispec>
diff --git a/src/mesa/es/main/APIspecutil.py b/src/mesa/es/main/APIspecutil.py
new file mode 100644
index 0000000000..27a8fe8a6d
--- /dev/null
+++ b/src/mesa/es/main/APIspecutil.py
@@ -0,0 +1,265 @@
+#!/usr/bin/python
+#
+# Copyright (C) 2009 Chia-I Wu <olv@0xlab.org>
+#
+# 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
+# IBM 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.
+"""
+Minimal apiutil.py interface for use by es_generator.py.
+"""
+
+import sys
+import libxml2
+
+import APIspec
+
+__spec = {}
+__functions = {}
+__aliases = {}
+
+def _ParseXML(filename, apiname):
+ conversions = {
+ # from to
+ 'GLfloat': [ 'GLdouble' ],
+ 'GLclampf': [ 'GLclampd' ],
+ 'GLubyte': [ 'GLfloat', 'GLdouble' ],
+ 'GLint': [ 'GLfloat', 'GLdouble' ],
+ 'GLfixed': [ 'GLfloat', 'GLdouble' ],
+ 'GLclampx': [ 'GLclampf', 'GLclampd' ],
+ }
+
+ doc = libxml2.readFile(filename, None,
+ libxml2.XML_PARSE_DTDLOAD +
+ libxml2.XML_PARSE_DTDVALID +
+ libxml2.XML_PARSE_NOBLANKS)
+ spec = APIspec.Spec(doc)
+ impl = spec.get_impl()
+ api = spec.get_api(apiname)
+ doc.freeDoc()
+
+ __spec["impl"] = impl
+ __spec["api"] = api
+
+ for func in api.functions:
+ alias, need_conv = impl.match(func, conversions)
+ if not alias:
+ # external functions are manually dispatched
+ if not func.is_external:
+ print >>sys.stderr, "Error: unable to dispatch %s" % func.name
+ alias = func
+ need_conv = False
+
+ __functions[func.name] = func
+ __aliases[func.name] = (alias, need_conv)
+
+
+def AllSpecials(notused=None):
+ """Return a list of all external functions in the API."""
+ api = __spec["api"]
+
+ specials = []
+ for func in api.functions:
+ if func.is_external:
+ specials.append(func.name)
+
+ return specials
+
+
+def GetAllFunctions(filename, api):
+ """Return sorted list of all functions in the API."""
+ if not __spec:
+ _ParseXML(filename, api)
+
+ api = __spec["api"]
+ names = []
+ for func in api.functions:
+ names.append(func.name)
+ names.sort()
+ return names
+
+
+def ReturnType(funcname):
+ """Return the C return type of named function."""
+ func = __functions[funcname]
+ return func.return_type
+
+
+def Properties(funcname):
+ """Return list of properties of the named GL function."""
+ func = __functions[funcname]
+ return [func.direction]
+
+
+def _ValidValues(func, param):
+ """Return the valid values of a parameter."""
+ valid_values = []
+ switch = func.checker.switches.get(param.name, [])
+ for desc in switch:
+ # no dependent vector
+ if not desc.checker.switches:
+ for val in desc.values:
+ valid_values.append((val, None, None, [], desc.error, None))
+ continue
+
+ items = desc.checker.switches.items()
+ if len(items) > 1:
+ print >>sys.stderr, "%s: more than one parameter depend on %s" % \
+ (func.name, desc.name)
+ dep_name, dep_switch = items[0]
+
+ for dep_desc in dep_switch:
+ if dep_desc.index >= 0 and dep_desc.index != 0:
+ print >>sys.stderr, "%s: not first element of a vector" % func.name
+ if dep_desc.checker.switches:
+ print >>sys.stderr, "%s: deep nested dependence" % func.name
+
+ convert = None if dep_desc.convert else "noconvert"
+ for val in desc.values:
+ valid_values.append((val, dep_desc.size_str, dep_desc.name,
+ dep_desc.values, dep_desc.error, convert))
+ return valid_values
+
+
+def _Conversion(func, src_param):
+ """Return the destination type of the conversion, or None."""
+ alias, need_conv = __aliases[func.name]
+ if need_conv:
+ dst_param = alias.get_param(src_param.name)
+ if src_param.type == dst_param.type:
+ need_conv = False
+ if not need_conv:
+ return (None, "none")
+
+ converts = { True: 0, False: 0 }
+
+ # In Fogx, for example, pname may be GL_FOG_DENSITY/GL_FOG_START/GL_FOG_END
+ # or GL_FOG_MODE. In the former three cases, param is not checked and the
+ # default is to convert.
+ if not func.checker.always_check(src_param.name):
+ converts[True] += 1
+
+ for desc in func.checker.flatten(src_param.name):
+ converts[desc.convert] += 1
+ if converts[True] and converts[False]:
+ break
+
+ # it should be "never", "sometimes", and "always"...
+ if converts[False]:
+ if converts[True]:
+ conversion = "some"
+ else:
+ conversion = "none"
+ else:
+ conversion = "all"
+
+ return (dst_param.base_type(), conversion)
+
+
+def _MaxVecSize(func, param):
+ """Return the largest possible size of a vector."""
+ if not param.is_vector:
+ return 0
+ if param.size:
+ return param.size
+
+ # need to look at all descriptions
+ size = 0
+ for desc in func.checker.flatten(param.name):
+ if desc.size_str and desc.size_str.isdigit():
+ s = int(desc.size_str)
+ if s > size:
+ size = s
+ if not size:
+ need_conv = __aliases[func.name][1]
+ if need_conv:
+ print >>sys.stderr, \
+ "Error: unable to dicide the max size of %s in %s" % \
+ (param.name, func.name)
+ return size
+
+
+def _ParameterTuple(func, param):
+ """Return a parameter tuple.
+
+ [0] -- parameter name
+ [1] -- parameter type
+ [2] -- max vector size or 0
+ [3] -- dest type the parameter converts to, or None
+ [4] -- valid values
+ [5] -- how often does the conversion happen
+
+ """
+ vec_size = _MaxVecSize(func, param)
+ dst_type, conversion = _Conversion(func, param)
+ valid_values = _ValidValues(func, param)
+
+ return (param.name, param.type, vec_size, dst_type, valid_values, conversion)
+
+
+def Parameters(funcname):
+ """Return list of tuples of function parameters."""
+ func = __functions[funcname]
+ params = []
+ for param in func.params:
+ params.append(_ParameterTuple(func, param))
+
+ return params
+
+
+def FindParamIndex(params, paramname):
+ """Find the index of a named parameter."""
+ for i in xrange(len(params)):
+ if params[i][0] == paramname:
+ return i
+ return None
+
+
+def MakeDeclarationString(params):
+ """Return a C-style parameter declaration string."""
+ string = []
+ for p in params:
+ sep = "" if p[1].endswith("*") else " "
+ string.append("%s%s%s" % (p[1], sep, p[0]))
+ if not string:
+ return "void"
+ return ", ".join(string)
+
+
+def AliasPrefix(funcname):
+ """Return the prefix of the function the named function is an alias of."""
+ alias = __aliases[funcname][0]
+ return alias.prefix
+
+
+def Alias(funcname):
+ """Return the name of the function the named function is an alias of."""
+ alias, need_conv = __aliases[funcname]
+ return alias.name if not need_conv else None
+
+
+def ConversionFunction(funcname):
+ """Return the name of the function the named function converts to."""
+ alias, need_conv = __aliases[funcname]
+ return alias.name if need_conv else None
+
+
+def Categories(funcname):
+ """Return all the categories of the named GL function."""
+ api = __spec["api"]
+ return [api.name]
diff --git a/src/mesa/es/main/drawtex.c b/src/mesa/es/main/drawtex.c
new file mode 100644
index 0000000000..cbd41ca975
--- /dev/null
+++ b/src/mesa/es/main/drawtex.c
@@ -0,0 +1,148 @@
+/*
+ * Copyright (C) 2009 Chia-I Wu <olv@0xlab.org>
+ *
+ * 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 (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.
+ */
+
+#include "drawtex.h"
+#include "main/state.h"
+#include "main/imports.h"
+
+#include "glapi/dispatch.h"
+
+
+#if FEATURE_OES_draw_texture
+
+
+static void
+draw_texture(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z,
+ GLfloat width, GLfloat height)
+{
+ if (!ctx->Extensions.OES_draw_texture) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glDrawTex(unsupported)");
+ return;
+ }
+ if (width <= 0.0f || height <= 0.0f) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glDrawTex(width or height <= 0)");
+ return;
+ }
+
+ if (ctx->NewState)
+ _mesa_update_state(ctx);
+
+ ASSERT(ctx->Driver.DrawTex);
+ ctx->Driver.DrawTex(ctx, x, y, z, width, height);
+}
+
+
+void GLAPIENTRY
+_mesa_DrawTexf(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ draw_texture(ctx, x, y, z, width, height);
+}
+
+
+void GLAPIENTRY
+_mesa_DrawTexfv(const GLfloat *coords)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ draw_texture(ctx, coords[0], coords[1], coords[2], coords[3], coords[4]);
+}
+
+
+void GLAPIENTRY
+_mesa_DrawTexi(GLint x, GLint y, GLint z, GLint width, GLint height)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ draw_texture(ctx, (GLfloat) x, (GLfloat) y, (GLfloat) z,
+ (GLfloat) width, (GLfloat) height);
+}
+
+
+void GLAPIENTRY
+_mesa_DrawTexiv(const GLint *coords)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ draw_texture(ctx, (GLfloat) coords[0], (GLfloat) coords[1],
+ (GLfloat) coords[2], (GLfloat) coords[3], (GLfloat) coords[4]);
+}
+
+
+void GLAPIENTRY
+_mesa_DrawTexs(GLshort x, GLshort y, GLshort z, GLshort width, GLshort height)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ draw_texture(ctx, (GLfloat) x, (GLfloat) y, (GLfloat) z,
+ (GLfloat) width, (GLfloat) height);
+}
+
+
+void GLAPIENTRY
+_mesa_DrawTexsv(const GLshort *coords)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ draw_texture(ctx, (GLfloat) coords[0], (GLfloat) coords[1],
+ (GLfloat) coords[2], (GLfloat) coords[3], (GLfloat) coords[4]);
+}
+
+
+void GLAPIENTRY
+_mesa_DrawTexx(GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ draw_texture(ctx,
+ (GLfloat) x / 65536.0f,
+ (GLfloat) y / 65536.0f,
+ (GLfloat) z / 65536.0f,
+ (GLfloat) width / 65536.0f,
+ (GLfloat) height / 65536.0f);
+}
+
+
+void GLAPIENTRY
+_mesa_DrawTexxv(const GLfixed *coords)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ draw_texture(ctx,
+ (GLfloat) coords[0] / 65536.0f,
+ (GLfloat) coords[1] / 65536.0f,
+ (GLfloat) coords[2] / 65536.0f,
+ (GLfloat) coords[3] / 65536.0f,
+ (GLfloat) coords[4] / 65536.0f);
+}
+
+
+void
+_mesa_init_drawtex_dispatch(struct _glapi_table *disp)
+{
+ SET_DrawTexfOES(disp, _mesa_DrawTexf);
+ SET_DrawTexfvOES(disp, _mesa_DrawTexfv);
+ SET_DrawTexiOES(disp, _mesa_DrawTexi);
+ SET_DrawTexivOES(disp, _mesa_DrawTexiv);
+ SET_DrawTexsOES(disp, _mesa_DrawTexs);
+ SET_DrawTexsvOES(disp, _mesa_DrawTexsv);
+ SET_DrawTexxOES(disp, _mesa_DrawTexx);
+ SET_DrawTexxvOES(disp, _mesa_DrawTexxv);
+}
+
+
+#endif /* FEATURE_OES_draw_texture */
diff --git a/src/mesa/es/main/drawtex.h b/src/mesa/es/main/drawtex.h
new file mode 100644
index 0000000000..0f3bac38c7
--- /dev/null
+++ b/src/mesa/es/main/drawtex.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2009 Chia-I Wu <olv@0xlab.org>
+ *
+ * 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 (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 DRAWTEX_H
+#define DRAWTEX_H
+
+
+#include "main/mtypes.h"
+
+
+#if FEATURE_OES_draw_texture
+
+#define _MESA_INIT_DRAWTEX_FUNCTIONS(driver, impl) \
+ do { \
+ (driver)->DrawTex = impl ## DrawTex; \
+ } while (0)
+
+extern void GLAPIENTRY
+_mesa_DrawTexf(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height);
+
+extern void GLAPIENTRY
+_mesa_DrawTexfv(const GLfloat *coords);
+
+extern void GLAPIENTRY
+_mesa_DrawTexi(GLint x, GLint y, GLint z, GLint width, GLint height);
+
+extern void GLAPIENTRY
+_mesa_DrawTexiv(const GLint *coords);
+
+extern void GLAPIENTRY
+_mesa_DrawTexs(GLshort x, GLshort y, GLshort z, GLshort width, GLshort height);
+
+extern void GLAPIENTRY
+_mesa_DrawTexsv(const GLshort *coords);
+
+extern void GLAPIENTRY
+_mesa_DrawTexx(GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height);
+
+extern void GLAPIENTRY
+_mesa_DrawTexxv(const GLfixed *coords);
+
+extern void
+_mesa_init_drawtex_dispatch(struct _glapi_table *disp);
+
+#else /* FEATURE_OES_draw_texture */
+
+#define _MESA_INIT_DRAWTEX_FUNCTIONS(driver, impl) do { } while (0)
+
+static INLINE void
+_mesa_init_drawtex_dispatch(struct _glapi_table *disp)
+{
+}
+
+#endif /* FEATURE_OES_draw_texture */
+
+
+#endif /* DRAWTEX_H */
diff --git a/src/mesa/es/main/es_cpaltex.c b/src/mesa/es/main/es_cpaltex.c
new file mode 100644
index 0000000000..0c497774ff
--- /dev/null
+++ b/src/mesa/es/main/es_cpaltex.c
@@ -0,0 +1,231 @@
+/**************************************************************************
+ *
+ * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ **************************************************************************/
+
+
+/**
+ * Code to convert compressed/paletted texture images to ordinary images.
+ * See the GL_OES_compressed_paletted_texture spec at
+ * http://khronos.org/registry/gles/extensions/OES/OES_compressed_paletted_texture.txt
+ *
+ * XXX this makes it impossible to add hardware support...
+ */
+
+
+#include "GLES/gl.h"
+#include "GLES/glext.h"
+
+#include "main/compiler.h" /* for ASSERT */
+
+
+void GL_APIENTRY _es_CompressedTexImage2DARB(GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
+
+void GL_APIENTRY _mesa_GetIntegerv(GLenum pname, GLint *params);
+void GL_APIENTRY _mesa_PixelStorei(GLenum pname, GLint param);
+void GL_APIENTRY _mesa_TexImage2D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+void GL_APIENTRY _mesa_CompressedTexImage2DARB(GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
+
+void *_mesa_get_current_context(void);
+void _mesa_error(void *ctx, GLenum error, const char *fmtString, ... );
+
+
+static const struct cpal_format_info {
+ GLenum cpal_format;
+ GLenum format;
+ GLenum type;
+ GLuint palette_size;
+ GLuint size;
+} formats[] = {
+ { GL_PALETTE4_RGB8_OES, GL_RGB, GL_UNSIGNED_BYTE, 16, 3 },
+ { GL_PALETTE4_RGBA8_OES, GL_RGBA, GL_UNSIGNED_BYTE, 16, 4 },
+ { GL_PALETTE4_R5_G6_B5_OES, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, 16, 2 },
+ { GL_PALETTE4_RGBA4_OES, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4, 16, 2 },
+ { GL_PALETTE4_RGB5_A1_OES, GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1, 16, 2 },
+ { GL_PALETTE8_RGB8_OES, GL_RGB, GL_UNSIGNED_BYTE, 256, 3 },
+ { GL_PALETTE8_RGBA8_OES, GL_RGBA, GL_UNSIGNED_BYTE, 256, 4 },
+ { GL_PALETTE8_R5_G6_B5_OES, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, 256, 2 },
+ { GL_PALETTE8_RGBA4_OES, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4, 256, 2 },
+ { GL_PALETTE8_RGB5_A1_OES, GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1, 256, 2 }
+};
+
+
+/**
+ * Get a color/entry from the palette.
+ */
+static GLuint
+get_palette_entry(const struct cpal_format_info *info, const GLubyte *palette,
+ GLuint index, GLubyte *pixel)
+{
+ memcpy(pixel, palette + info->size * index, info->size);
+ return info->size;
+}
+
+
+/**
+ * Convert paletted texture to color texture.
+ */
+static void
+paletted_to_color(const struct cpal_format_info *info, const GLubyte *palette,
+ const void *indices, GLuint num_pixels, GLubyte *image)
+{
+ GLubyte *pix = image;
+ GLuint remain, i;
+
+ if (info->palette_size == 16) {
+ /* 4 bits per index */
+ const GLubyte *ind = (const GLubyte *) indices;
+
+ /* two pixels per iteration */
+ remain = num_pixels % 2;
+ for (i = 0; i < num_pixels / 2; i++) {
+ pix += get_palette_entry(info, palette, (ind[i] >> 4) & 0xf, pix);
+ pix += get_palette_entry(info, palette, ind[i] & 0xf, pix);
+ }
+ if (remain) {
+ get_palette_entry(info, palette, (ind[i] >> 4) & 0xf, pix);
+ }
+ }
+ else {
+ /* 8 bits per index */
+ const GLubyte *ind = (const GLubyte *) indices;
+ for (i = 0; i < num_pixels; i++)
+ pix += get_palette_entry(info, palette, ind[i], pix);
+ }
+}
+
+
+static const struct cpal_format_info *
+cpal_get_info(GLint level, GLenum internalFormat,
+ GLsizei width, GLsizei height, GLsizei imageSize)
+{
+ const struct cpal_format_info *info;
+ GLint lvl, num_levels;
+ GLsizei w, h, expect_size;
+
+ info = &formats[internalFormat - GL_PALETTE4_RGB8_OES];
+ ASSERT(info->cpal_format == internalFormat);
+
+ if (level > 0) {
+ _mesa_error(_mesa_get_current_context(), GL_INVALID_VALUE,
+ "glCompressedTexImage2D(level=%d)", level);
+ return NULL;
+ }
+
+ num_levels = -level + 1;
+ expect_size = info->palette_size * info->size;
+ for (lvl = 0; lvl < num_levels; lvl++) {
+ w = width >> lvl;
+ if (!w)
+ w = 1;
+ h = height >> lvl;
+ if (!h)
+ h = 1;
+
+ if (info->palette_size == 16)
+ expect_size += (w * h + 1) / 2;
+ else
+ expect_size += w * h;
+ }
+ if (expect_size > imageSize) {
+ _mesa_error(_mesa_get_current_context(), GL_INVALID_VALUE,
+ "glCompressedTexImage2D(imageSize=%d)", imageSize);
+ return NULL;
+ }
+ return info;
+}
+
+/**
+ * Convert a call to glCompressedTexImage2D() where internalFormat is a
+ * compressed palette format into a regular GLubyte/RGBA glTexImage2D() call.
+ */
+static void
+cpal_compressed_teximage2d(GLenum target, GLint level, GLenum internalFormat,
+ GLsizei width, GLsizei height, GLsizei imageSize,
+ const void *palette)
+{
+ const struct cpal_format_info *info;
+ GLint lvl, num_levels;
+ const GLubyte *indices;
+ GLint saved_align, align;
+
+ info = cpal_get_info(level, internalFormat, width, height, imageSize);
+ if (!info)
+ return;
+
+ info = &formats[internalFormat - GL_PALETTE4_RGB8_OES];
+ ASSERT(info->cpal_format == internalFormat);
+ num_levels = -level + 1;
+
+ /* first image follows the palette */
+ indices = (const GLubyte *) palette + info->palette_size * info->size;
+
+ _mesa_GetIntegerv(GL_UNPACK_ALIGNMENT, &saved_align);
+ align = saved_align;
+
+ for (lvl = 0; lvl < num_levels; lvl++) {
+ GLsizei w, h;
+ GLuint num_texels;
+ GLubyte *image = NULL;
+
+ w = width >> lvl;
+ if (!w)
+ w = 1;
+ h = height >> lvl;
+ if (!h)
+ h = 1;
+ num_texels = w * h;
+ if (w * info->size % align) {
+ _mesa_PixelStorei(GL_UNPACK_ALIGNMENT, 1);
+ align = 1;
+ }
+
+ /* allocate and fill dest image buffer */
+ if (palette) {
+ image = (GLubyte *) malloc(num_texels * info->size);
+ paletted_to_color(info, palette, indices, num_texels, image);
+ }
+
+ _mesa_TexImage2D(target, lvl, info->format, w, h, 0,
+ info->format, info->type, image);
+ if (image)
+ free(image);
+
+ /* advance index pointer to point to next src mipmap */
+ if (info->palette_size == 16)
+ indices += (num_texels + 1) / 2;
+ else
+ indices += num_texels;
+ }
+
+ if (saved_align != align)
+ _mesa_PixelStorei(GL_UNPACK_ALIGNMENT, saved_align);
+}
+
+
+void GL_APIENTRY
+_es_CompressedTexImage2DARB(GLenum target, GLint level, GLenum internalFormat,
+ GLsizei width, GLsizei height, GLint border,
+ GLsizei imageSize, const GLvoid *data)
+{
+ switch (internalFormat) {
+ case GL_PALETTE4_RGB8_OES:
+ case GL_PALETTE4_RGBA8_OES:
+ case GL_PALETTE4_R5_G6_B5_OES:
+ case GL_PALETTE4_RGBA4_OES:
+ case GL_PALETTE4_RGB5_A1_OES:
+ case GL_PALETTE8_RGB8_OES:
+ case GL_PALETTE8_RGBA8_OES:
+ case GL_PALETTE8_R5_G6_B5_OES:
+ case GL_PALETTE8_RGBA4_OES:
+ case GL_PALETTE8_RGB5_A1_OES:
+ cpal_compressed_teximage2d(target, level, internalFormat,
+ width, height, imageSize, data);
+ break;
+ default:
+ _mesa_CompressedTexImage2DARB(target, level, internalFormat,
+ width, height, border, imageSize, data);
+ }
+}
diff --git a/src/mesa/es/main/es_enable.c b/src/mesa/es/main/es_enable.c
new file mode 100644
index 0000000000..351caacd77
--- /dev/null
+++ b/src/mesa/es/main/es_enable.c
@@ -0,0 +1,91 @@
+/*
+ * Copyright (C) 2009 Chia-I Wu <olv@0xlab.org>
+ *
+ * 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 (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.
+ */
+
+#include "GLES/gl.h"
+#include "GLES/glext.h"
+
+#include "main/compiler.h" /* for ASSERT */
+
+
+#ifndef GL_TEXTURE_GEN_S
+#define GL_TEXTURE_GEN_S 0x0C60
+#define GL_TEXTURE_GEN_T 0x0C61
+#define GL_TEXTURE_GEN_R 0x0C62
+#endif
+
+
+extern void GL_APIENTRY _es_Disable(GLenum cap);
+extern void GL_APIENTRY _es_Enable(GLenum cap);
+extern GLboolean GL_APIENTRY _es_IsEnabled(GLenum cap);
+
+extern void GL_APIENTRY _mesa_Disable(GLenum cap);
+extern void GL_APIENTRY _mesa_Enable(GLenum cap);
+extern GLboolean GL_APIENTRY _mesa_IsEnabled(GLenum cap);
+
+
+void GL_APIENTRY
+_es_Disable(GLenum cap)
+{
+ switch (cap) {
+ case GL_TEXTURE_GEN_STR_OES:
+ /* disable S, T, and R at the same time */
+ _mesa_Disable(GL_TEXTURE_GEN_S);
+ _mesa_Disable(GL_TEXTURE_GEN_T);
+ _mesa_Disable(GL_TEXTURE_GEN_R);
+ break;
+ default:
+ _mesa_Disable(cap);
+ break;
+ }
+}
+
+
+void GL_APIENTRY
+_es_Enable(GLenum cap)
+{
+ switch (cap) {
+ case GL_TEXTURE_GEN_STR_OES:
+ /* enable S, T, and R at the same time */
+ _mesa_Enable(GL_TEXTURE_GEN_S);
+ _mesa_Enable(GL_TEXTURE_GEN_T);
+ _mesa_Enable(GL_TEXTURE_GEN_R);
+ break;
+ default:
+ _mesa_Enable(cap);
+ break;
+ }
+}
+
+
+GLboolean GL_APIENTRY
+_es_IsEnabled(GLenum cap)
+{
+ switch (cap) {
+ case GL_TEXTURE_GEN_STR_OES:
+ cap = GL_TEXTURE_GEN_S;
+ default:
+ break;
+ }
+
+ return _mesa_IsEnabled(cap);
+}
diff --git a/src/mesa/es/main/es_fbo.c b/src/mesa/es/main/es_fbo.c
new file mode 100644
index 0000000000..1803637830
--- /dev/null
+++ b/src/mesa/es/main/es_fbo.c
@@ -0,0 +1,37 @@
+/**************************************************************************
+ *
+ * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ **************************************************************************/
+
+
+#include "GLES2/gl2.h"
+#include "GLES2/gl2ext.h"
+
+
+#ifndef GL_RGB5
+#define GL_RGB5 0x8050
+#endif
+
+
+extern void GL_APIENTRY _es_RenderbufferStorageEXT(GLenum target, GLenum internalFormat, GLsizei width, GLsizei height);
+
+extern void GL_APIENTRY _mesa_RenderbufferStorageEXT(GLenum target, GLenum internalFormat, GLsizei width, GLsizei height);
+
+
+void GL_APIENTRY
+_es_RenderbufferStorageEXT(GLenum target, GLenum internalFormat,
+ GLsizei width, GLsizei height)
+{
+ switch (internalFormat) {
+ case GL_RGB565:
+ /* XXX this confuses GL_RENDERBUFFER_INTERNAL_FORMAT_OES */
+ /* choose a closest format */
+ internalFormat = GL_RGB5;
+ break;
+ default:
+ break;
+ }
+ _mesa_RenderbufferStorageEXT(target, internalFormat, width, height);
+}
diff --git a/src/mesa/es/main/es_generator.py b/src/mesa/es/main/es_generator.py
new file mode 100644
index 0000000000..590f5940a7
--- /dev/null
+++ b/src/mesa/es/main/es_generator.py
@@ -0,0 +1,685 @@
+#*************************************************************************
+# 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, 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
+# TUNGSTEN GRAPHICS 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.
+#*************************************************************************
+
+
+import sys, os
+import APIspecutil as apiutil
+
+# These dictionary entries are used for automatic conversion.
+# The string will be used as a format string with the conversion
+# variable.
+Converters = {
+ 'GLfloat': {
+ 'GLdouble': "(GLdouble) (%s)",
+ 'GLfixed' : "(GLint) (%s * 65536)",
+ },
+ 'GLfixed': {
+ 'GLfloat': "(GLfloat) (%s / 65536.0f)",
+ 'GLdouble': "(GLdouble) (%s / 65536.0)",
+ },
+ 'GLdouble': {
+ 'GLfloat': "(GLfloat) (%s)",
+ 'GLfixed': "(GLfixed) (%s * 65536)",
+ },
+ 'GLclampf': {
+ 'GLclampd': "(GLclampd) (%s)",
+ 'GLclampx': "(GLclampx) (%s * 65536)",
+ },
+ 'GLclampx': {
+ 'GLclampf': "(GLclampf) (%s / 65536.0f)",
+ 'GLclampd': "(GLclampd) (%s / 65536.0)",
+ },
+ 'GLubyte': {
+ 'GLfloat': "(GLfloat) (%s / 255.0f)",
+ },
+}
+
+def GetBaseType(type):
+ typeTokens = type.split(' ')
+ baseType = None
+ typeModifiers = []
+ for t in typeTokens:
+ if t in ['const', '*']:
+ typeModifiers.append(t)
+ else:
+ baseType = t
+ return (baseType, typeModifiers)
+
+def ConvertValue(value, fromType, toType):
+ """Returns a string that represents the given parameter string,
+ type-converted if necessary."""
+
+ if not Converters.has_key(fromType):
+ print >> sys.stderr, "No base converter for type '%s' found. Ignoring." % fromType
+ return value
+
+ if not Converters[fromType].has_key(toType):
+ print >> sys.stderr, "No converter found for type '%s' to type '%s'. Ignoring." % (fromType, toType)
+ return value
+
+ # This part is simple. Return the proper conversion.
+ conversionString = Converters[fromType][toType]
+ return conversionString % value
+
+FormatStrings = {
+ 'GLenum' : '0x%x',
+ 'GLfloat' : '%f',
+ 'GLint' : '%d',
+ 'GLbitfield' : '0x%x',
+}
+def GetFormatString(type):
+ if FormatStrings.has_key(type):
+ return FormatStrings[type]
+ else:
+ return None
+
+
+######################################################################
+# Version-specific values to be used in the main script
+# header: which header file to include
+# api: what text specifies an API-level function
+VersionSpecificValues = {
+ 'GLES1.1' : {
+ 'description' : 'GLES1.1 functions',
+ 'header' : 'GLES/gl.h',
+ 'extheader' : 'GLES/glext.h',
+ },
+ 'GLES2.0': {
+ 'description' : 'GLES2.0 functions',
+ 'header' : 'GLES2/gl2.h',
+ 'extheader' : 'GLES2/gl2ext.h',
+ }
+}
+
+
+######################################################################
+# Main code for the script begins here.
+
+# Get the name of the program (without the directory part) for use in
+# error messages.
+program = os.path.basename(sys.argv[0])
+
+# Set default values
+verbose = 0
+functionList = "APIspec.xml"
+version = "GLES1.1"
+
+# Allow for command-line switches
+import getopt, time
+options = "hvV:S:"
+try:
+ optlist, args = getopt.getopt(sys.argv[1:], options)
+except getopt.GetoptError, message:
+ sys.stderr.write("%s: %s. Use -h for help.\n" % (program, message))
+ sys.exit(1)
+
+for option, optarg in optlist:
+ if option == "-h":
+ sys.stderr.write("Usage: %s [-%s]\n" % (program, options))
+ sys.stderr.write("Parse an API specification file and generate wrapper functions for a given GLES version\n")
+ sys.stderr.write("-h gives help\n")
+ sys.stderr.write("-v is verbose\n")
+ sys.stderr.write("-V specifies GLES version to generate [%s]:\n" % version)
+ for key in VersionSpecificValues.keys():
+ sys.stderr.write(" %s - %s\n" % (key, VersionSpecificValues[key]['description']))
+ sys.stderr.write("-S specifies API specification file to use [%s]\n" % functionList)
+ sys.exit(1)
+ elif option == "-v":
+ verbose += 1
+ elif option == "-V":
+ version = optarg
+ elif option == "-S":
+ functionList = optarg
+
+# Beyond switches, we support no further command-line arguments
+if len(args) > 0:
+ sys.stderr.write("%s: only switch arguments are supported - use -h for help\n" % program)
+ sys.exit(1)
+
+# If we don't have a valid version, abort.
+if not VersionSpecificValues.has_key(version):
+ sys.stderr.write("%s: version '%s' is not valid - use -h for help\n" % (program, version))
+ sys.exit(1)
+
+# Grab the version-specific items we need to use
+versionHeader = VersionSpecificValues[version]['header']
+versionExtHeader = VersionSpecificValues[version]['extheader']
+
+# If we get to here, we're good to go. The "version" parameter
+# directs GetDispatchedFunctions to only allow functions from
+# that "category" (version in our parlance). This allows
+# functions with different declarations in different categories
+# to exist (glTexImage2D, for example, is different between
+# GLES1 and GLES2).
+keys = apiutil.GetAllFunctions(functionList, version)
+
+allSpecials = apiutil.AllSpecials()
+
+print """/* DO NOT EDIT *************************************************
+ * THIS FILE AUTOMATICALLY GENERATED BY THE %s SCRIPT
+ * API specification file: %s
+ * GLES version: %s
+ * date: %s
+ */
+""" % (program, functionList, version, time.strftime("%Y-%m-%d %H:%M:%S"))
+
+# The headers we choose are version-specific.
+print """
+#include "%s"
+#include "%s"
+""" % (versionHeader, versionExtHeader)
+
+# Everyone needs these types.
+print """
+/* These types are needed for the Mesa veneer, but are not defined in
+ * the standard GLES headers.
+ */
+typedef double GLdouble;
+typedef double GLclampd;
+
+/* This type is normally in glext.h, but needed here */
+typedef char GLchar;
+
+/* Mesa error handling requires these */
+extern void *_mesa_get_current_context(void);
+extern void _mesa_error(void *ctx, GLenum error, const char *fmtString, ... );
+
+#include "main/compiler.h"
+#include "main/api_exec.h"
+
+#include "glapi/dispatch.h"
+
+typedef void (*_glapi_proc)(void); /* generic function pointer */
+"""
+
+# Finally we get to the all-important functions
+print """/*************************************************************
+ * Generated functions begin here
+ */
+"""
+for funcName in keys:
+ if verbose > 0: sys.stderr.write("%s: processing function %s\n" % (program, funcName))
+
+ # start figuring out what this function will look like.
+ returnType = apiutil.ReturnType(funcName)
+ props = apiutil.Properties(funcName)
+ params = apiutil.Parameters(funcName)
+ declarationString = apiutil.MakeDeclarationString(params)
+
+ # In case of error, a function may have to return. Make
+ # sure we have valid return values in this case.
+ if returnType == "void":
+ errorReturn = "return"
+ elif returnType == "GLboolean":
+ errorReturn = "return GL_FALSE"
+ else:
+ errorReturn = "return (%s) 0" % returnType
+
+ # These are the output of this large calculation block.
+ # passthroughDeclarationString: a typed set of parameters that
+ # will be used to create the "extern" reference for the
+ # underlying Mesa or support function. Note that as generated
+ # these have an extra ", " at the beginning, which will be
+ # removed before use.
+ #
+ # passthroughDeclarationString: an untyped list of parameters
+ # that will be used to call the underlying Mesa or support
+ # function (including references to converted parameters).
+ # This will also be generated with an extra ", " at the
+ # beginning, which will be removed before use.
+ #
+ # variables: C code to create any local variables determined to
+ # be necessary.
+ # conversionCodeOutgoing: C code to convert application parameters
+ # to a necessary type before calling the underlying support code.
+ # May be empty if no conversion is required.
+ # conversionCodeIncoming: C code to do the converse: convert
+ # values returned by underlying Mesa code to the types needed
+ # by the application.
+ # Note that *either* the conversionCodeIncoming will be used (for
+ # generated query functions), *or* the conversionCodeOutgoing will
+ # be used (for generated non-query functions), never both.
+ passthroughFuncName = ""
+ passthroughDeclarationString = ""
+ passthroughCallString = ""
+ variables = []
+ conversionCodeOutgoing = []
+ conversionCodeIncoming = []
+ switchCode = []
+
+ # Calculate the name of the underlying support function to call.
+ # By default, the passthrough function is named _mesa_<funcName>.
+ # We're allowed to override the prefix and/or the function name
+ # for each function record, though. The "ConversionFunction"
+ # utility is poorly named, BTW...
+ if funcName in allSpecials:
+ # perform checks and pass through
+ funcPrefix = "_check_"
+ aliasprefix = "_es_"
+ else:
+ funcPrefix = "_es_"
+ aliasprefix = apiutil.AliasPrefix(funcName)
+ alias = apiutil.ConversionFunction(funcName)
+ if not alias:
+ # There may still be a Mesa alias for the function
+ if apiutil.Alias(funcName):
+ passthroughFuncName = "%s%s" % (aliasprefix, apiutil.Alias(funcName))
+ else:
+ passthroughFuncName = "%s%s" % (aliasprefix, funcName)
+ else: # a specific alias is provided
+ passthroughFuncName = "%s%s" % (aliasprefix, alias)
+
+ # Look at every parameter: each one may have only specific
+ # allowed values, or dependent parameters to check, or
+ # variant-sized vector arrays to calculate
+ for (paramName, paramType, paramMaxVecSize, paramConvertToType, paramValidValues, paramValueConversion) in params:
+ # We'll need this below if we're doing conversions
+ (paramBaseType, paramTypeModifiers) = GetBaseType(paramType)
+
+ # Conversion management.
+ # We'll handle three cases, easiest to hardest: a parameter
+ # that doesn't require conversion, a scalar parameter that
+ # requires conversion, and a vector parameter that requires
+ # conversion.
+ if paramConvertToType == None:
+ # Unconverted parameters are easy, whether they're vector
+ # or scalar - just add them to the call list. No conversions
+ # or anything to worry about.
+ passthroughDeclarationString += ", %s %s" % (paramType, paramName)
+ passthroughCallString += ", %s" % paramName
+
+ elif paramMaxVecSize == 0: # a scalar parameter that needs conversion
+ # A scalar to hold a converted parameter
+ variables.append(" %s converted_%s;" % (paramConvertToType, paramName))
+
+ # Outgoing conversion depends on whether we have to conditionally
+ # perform value conversion.
+ if paramValueConversion == "none":
+ conversionCodeOutgoing.append(" converted_%s = (%s) %s;" % (paramName, paramConvertToType, paramName))
+ elif paramValueConversion == "some":
+ # We'll need a conditional variable to keep track of
+ # whether we're converting values or not.
+ if (" int convert_%s_value = 1;" % paramName) not in variables:
+ variables.append(" int convert_%s_value = 1;" % paramName)
+
+ # Write code based on that conditional.
+ conversionCodeOutgoing.append(" if (convert_%s_value) {" % paramName)
+ conversionCodeOutgoing.append(" converted_%s = %s;" % (paramName, ConvertValue(paramName, paramBaseType, paramConvertToType)))
+ conversionCodeOutgoing.append(" } else {")
+ conversionCodeOutgoing.append(" converted_%s = (%s) %s;" % (paramName, paramConvertToType, paramName))
+ conversionCodeOutgoing.append(" }")
+ else: # paramValueConversion == "all"
+ conversionCodeOutgoing.append(" converted_%s = %s;" % (paramName, ConvertValue(paramName, paramBaseType, paramConvertToType)))
+
+ # Note that there can be no incoming conversion for a
+ # scalar parameter; changing the scalar will only change
+ # the local value, and won't ultimately change anything
+ # that passes back to the application.
+
+ # Call strings. The unusual " ".join() call will join the
+ # array of parameter modifiers with spaces as separators.
+ passthroughDeclarationString += ", %s %s %s" % (paramConvertToType, " ".join(paramTypeModifiers), paramName)
+ passthroughCallString += ", converted_%s" % paramName
+
+ else: # a vector parameter that needs conversion
+ # We'll need an index variable for conversions
+ if " register unsigned int i;" not in variables:
+ variables.append(" register unsigned int i;")
+
+ # This variable will hold the (possibly variant) size of
+ # this array needing conversion. By default, we'll set
+ # it to the maximal size (which is correct for functions
+ # with a constant-sized vector parameter); for true
+ # variant arrays, we'll modify it with other code.
+ variables.append(" unsigned int n_%s = %d;" % (paramName, paramMaxVecSize))
+
+ # This array will hold the actual converted values.
+ variables.append(" %s converted_%s[%d];" % (paramConvertToType, paramName, paramMaxVecSize))
+
+ # Again, we choose the conversion code based on whether we
+ # have to always convert values, never convert values, or
+ # conditionally convert values.
+ if paramValueConversion == "none":
+ conversionCodeOutgoing.append(" for (i = 0; i < n_%s; i++) {" % paramName)
+ conversionCodeOutgoing.append(" converted_%s[i] = (%s) %s[i];" % (paramName, paramConvertToType, paramName))
+ conversionCodeOutgoing.append(" }")
+ elif paramValueConversion == "some":
+ # We'll need a conditional variable to keep track of
+ # whether we're converting values or not.
+ if (" int convert_%s_value = 1;" % paramName) not in variables:
+ variables.append(" int convert_%s_value = 1;" % paramName)
+ # Write code based on that conditional.
+ conversionCodeOutgoing.append(" if (convert_%s_value) {" % paramName)
+ conversionCodeOutgoing.append(" for (i = 0; i < n_%s; i++) {" % paramName)
+ conversionCodeOutgoing.append(" converted_%s[i] = %s;" % (paramName, ConvertValue("%s[i]" % paramName, paramBaseType, paramConvertToType)))
+ conversionCodeOutgoing.append(" }")
+ conversionCodeOutgoing.append(" } else {")
+ conversionCodeOutgoing.append(" for (i = 0; i < n_%s; i++) {" % paramName)
+ conversionCodeOutgoing.append(" converted_%s[i] = (%s) %s[i];" % (paramName, paramConvertToType, paramName))
+ conversionCodeOutgoing.append(" }")
+ conversionCodeOutgoing.append(" }")
+ else: # paramValueConversion == "all"
+ conversionCodeOutgoing.append(" for (i = 0; i < n_%s; i++) {" % paramName)
+ conversionCodeOutgoing.append(" converted_%s[i] = %s;" % (paramName, ConvertValue("%s[i]" % paramName, paramBaseType, paramConvertToType)))
+
+ conversionCodeOutgoing.append(" }")
+
+ # If instead we need an incoming conversion (i.e. results
+ # from Mesa have to be converted before handing back
+ # to the application), this is it. Fortunately, we don't
+ # have to worry about conditional value conversion - the
+ # functions that do (e.g. glGetFixedv()) are handled
+ # specially, outside this code generation.
+ #
+ # Whether we use incoming conversion or outgoing conversion
+ # is determined later - we only ever use one or the other.
+
+ if paramValueConversion == "none":
+ conversionCodeIncoming.append(" for (i = 0; i < n_%s; i++) {" % paramName)
+ conversionCodeIncoming.append(" %s[i] = (%s) converted_%s[i];" % (paramName, paramConvertToType, paramName))
+ conversionCodeIncoming.append(" }")
+ elif paramValueConversion == "some":
+ # We'll need a conditional variable to keep track of
+ # whether we're converting values or not.
+ if (" int convert_%s_value = 1;" % paramName) not in variables:
+ variables.append(" int convert_%s_value = 1;" % paramName)
+
+ # Write code based on that conditional.
+ conversionCodeIncoming.append(" if (convert_%s_value) {" % paramName)
+ conversionCodeIncoming.append(" for (i = 0; i < n_%s; i++) {" % paramName)
+ conversionCodeIncoming.append(" %s[i] = %s;" % (paramName, ConvertValue("converted_%s[i]" % paramName, paramConvertToType, paramBaseType)))
+ conversionCodeIncoming.append(" }")
+ conversionCodeIncoming.append(" } else {")
+ conversionCodeIncoming.append(" for (i = 0; i < n_%s; i++) {" % paramName)
+ conversionCodeIncoming.append(" %s[i] = (%s) converted_%s[i];" % (paramName, paramBaseType, paramName))
+ conversionCodeIncoming.append(" }")
+ conversionCodeIncoming.append(" }")
+ else: # paramValueConversion == "all"
+ conversionCodeIncoming.append(" for (i = 0; i < n_%s; i++) {" % paramName)
+ conversionCodeIncoming.append(" %s[i] = %s;" % (paramName, ConvertValue("converted_%s[i]" % paramName, paramConvertToType, paramBaseType)))
+ conversionCodeIncoming.append(" }")
+
+ # Call strings. The unusual " ".join() call will join the
+ # array of parameter modifiers with spaces as separators.
+ passthroughDeclarationString += ", %s %s %s" % (paramConvertToType, " ".join(paramTypeModifiers), paramName)
+ passthroughCallString += ", converted_%s" % paramName
+
+ # endif conversion management
+
+ # Parameter checking. If the parameter has a specific list of
+ # valid values, we have to make sure that the passed-in values
+ # match these, or we make an error.
+ if len(paramValidValues) > 0:
+ # We're about to make a big switch statement with an
+ # error at the end. By default, the error is GL_INVALID_ENUM,
+ # unless we find a "case" statement in the middle with a
+ # non-GLenum value.
+ errorDefaultCase = "GL_INVALID_ENUM"
+
+ # This parameter has specific valid values. Make a big
+ # switch statement to handle it. Note that the original
+ # parameters are always what is checked, not the
+ # converted parameters.
+ switchCode.append(" switch(%s) {" % paramName)
+
+ for valueIndex in range(len(paramValidValues)):
+ (paramValue, dependentVecSize, dependentParamName, dependentValidValues, errorCode, valueConvert) = paramValidValues[valueIndex]
+
+ # We're going to need information on the dependent param
+ # as well.
+ if dependentParamName:
+ depParamIndex = apiutil.FindParamIndex(params, dependentParamName)
+ if depParamIndex == None:
+ sys.stderr.write("%s: can't find dependent param '%s' for function '%s'\n" % (program, dependentParamName, funcName))
+
+ (depParamName, depParamType, depParamMaxVecSize, depParamConvertToType, depParamValidValues, depParamValueConversion) = params[depParamIndex]
+ else:
+ (depParamName, depParamType, depParamMaxVecSize, depParamConvertToType, depParamValidValues, depParamValueConversion) = (None, None, None, None, [], None)
+
+ # This is a sneaky trick. It's valid syntax for a parameter
+ # that is *not* going to be converted to be declared
+ # with a dependent vector size; but in this case, the
+ # dependent vector size is unused and unnecessary.
+ # So check for this and ignore the dependent vector size
+ # if the parameter is not going to be converted.
+ if depParamConvertToType:
+ usedDependentVecSize = dependentVecSize
+ else:
+ usedDependentVecSize = None
+
+ # We'll peek ahead at the next parameter, to see whether
+ # we can combine cases
+ if valueIndex + 1 < len(paramValidValues) :
+ (nextParamValue, nextDependentVecSize, nextDependentParamName, nextDependentValidValues, nextErrorCode, nextValueConvert) = paramValidValues[valueIndex + 1]
+ if depParamConvertToType:
+ usedNextDependentVecSize = nextDependentVecSize
+ else:
+ usedNextDependentVecSize = None
+
+ # Create a case for this value. As a mnemonic,
+ # if we have a dependent vector size that we're ignoring,
+ # add it as a comment.
+ if usedDependentVecSize == None and dependentVecSize != None:
+ switchCode.append(" case %s: /* size %s */" % (paramValue, dependentVecSize))
+ else:
+ switchCode.append(" case %s:" % paramValue)
+
+ # If this is not a GLenum case, then switch our error
+ # if no value is matched to be GL_INVALID_VALUE instead
+ # of GL_INVALID_ENUM. (Yes, this does get confused
+ # if there are both values and GLenums in the same
+ # switch statement, which shouldn't happen.)
+ if paramValue[0:3] != "GL_":
+ errorDefaultCase = "GL_INVALID_VALUE"
+
+ # If all the remaining parameters are identical to the
+ # next set, then we're done - we'll just create the
+ # official code on the next pass through, and the two
+ # cases will share the code.
+ if valueIndex + 1 < len(paramValidValues) and usedDependentVecSize == usedNextDependentVecSize and dependentParamName == nextDependentParamName and dependentValidValues == nextDependentValidValues and errorCode == nextErrorCode and valueConvert == nextValueConvert:
+ continue
+
+ # Otherwise, we'll have to generate code for this case.
+ # Start off with a check: if there is a dependent parameter,
+ # and a list of valid values for that parameter, we need
+ # to generate an error if something other than one
+ # of those values is passed.
+ if len(dependentValidValues) > 0:
+ conditional=""
+
+ # If the parameter being checked is actually an array,
+ # check only its first element.
+ if depParamMaxVecSize == 0:
+ valueToCheck = dependentParamName
+ else:
+ valueToCheck = "%s[0]" % dependentParamName
+
+ for v in dependentValidValues:
+ conditional += " && %s != %s" % (valueToCheck, v)
+ switchCode.append(" if (%s) {" % conditional[4:])
+ if errorCode == None:
+ errorCode = "GL_INVALID_ENUM"
+ switchCode.append(' _mesa_error(_mesa_get_current_context(), %s, "gl%s(%s=0x%s)", %s);' % (errorCode, funcName, paramName, "%x", paramName))
+ switchCode.append(" %s;" % errorReturn)
+ switchCode.append(" }")
+ # endif there are dependent valid values
+
+ # The dependent parameter may require conditional
+ # value conversion. If it does, and we don't want
+ # to convert values, we'll have to generate code for that
+ if depParamValueConversion == "some" and valueConvert == "noconvert":
+ switchCode.append(" convert_%s_value = 0;" % dependentParamName)
+
+ # If there's a dependent vector size for this parameter
+ # that we're actually going to use (i.e. we need conversion),
+ # mark it.
+ if usedDependentVecSize:
+ switchCode.append(" n_%s = %s;" % (dependentParamName, dependentVecSize))
+
+ # In all cases, break out of the switch if any valid
+ # value is found.
+ switchCode.append(" break;")
+
+
+ # Need a default case to catch all the other, invalid
+ # parameter values. These will all generate errors.
+ switchCode.append(" default:")
+ if errorCode == None:
+ errorCode = "GL_INVALID_ENUM"
+ formatString = GetFormatString(paramType)
+ if formatString == None:
+ switchCode.append(' _mesa_error(_mesa_get_current_context(), %s, "gl%s(%s)");' % (errorCode, funcName, paramName))
+ else:
+ switchCode.append(' _mesa_error(_mesa_get_current_context(), %s, "gl%s(%s=%s)", %s);' % (errorCode, funcName, paramName, formatString, paramName))
+ switchCode.append(" %s;" % errorReturn)
+
+ # End of our switch code.
+ switchCode.append(" }")
+
+ # endfor every recognized parameter value
+
+ # endfor every param
+
+ # Here, the passthroughDeclarationString and passthroughCallString
+ # are complete; remove the extra ", " at the front of each.
+ passthroughDeclarationString = passthroughDeclarationString[2:]
+ passthroughCallString = passthroughCallString[2:]
+
+ # The Mesa functions are scattered across all the Mesa
+ # header files. The easiest way to manage declarations
+ # is to create them ourselves.
+ if funcName in allSpecials:
+ print "/* this function is special and is defined elsewhere */"
+ print "extern %s GLAPIENTRY %s(%s);" % (returnType, passthroughFuncName, passthroughDeclarationString)
+
+ # A function may be a core function (i.e. it exists in
+ # the core specification), a core addition (extension
+ # functions added officially to the core), a required
+ # extension (usually an extension for an earlier version
+ # that has been officially adopted), or an optional extension.
+ #
+ # Core functions have a simple category (e.g. "GLES1.1");
+ # we generate only a simple callback for them.
+ #
+ # Core additions have two category listings, one simple
+ # and one compound (e.g. ["GLES1.1", "GLES1.1:OES_fixed_point"]).
+ # We generate the core function, and also an extension function.
+ #
+ # Required extensions and implemented optional extensions
+ # have a single compound category "GLES1.1:OES_point_size_array".
+ # For these we generate just the extension function.
+ for categorySpec in apiutil.Categories(funcName):
+ compoundCategory = categorySpec.split(":")
+
+ # This category isn't for us, if the base category doesn't match
+ # our version
+ if compoundCategory[0] != version:
+ continue
+
+ # Otherwise, determine if we're writing code for a core
+ # function (no suffix) or an extension function.
+ if len(compoundCategory) == 1:
+ # This is a core function
+ extensionName = None
+ extensionSuffix = ""
+ else:
+ # This is an extension function. We'll need to append
+ # the extension suffix.
+ extensionName = compoundCategory[1]
+ extensionSuffix = extensionName.split("_")[0]
+ fullFuncName = funcPrefix + funcName + extensionSuffix
+
+ # Now the generated function. The text used to mark an API-level
+ # function, oddly, is version-specific.
+ if extensionName:
+ print "/* Extension %s */" % extensionName
+
+ if (not variables and
+ not switchCode and
+ not conversionCodeOutgoing and
+ not conversionCodeIncoming):
+ # pass through directly
+ print "#define %s %s" % (fullFuncName, passthroughFuncName)
+ print
+ continue
+
+ print "static %s %s(%s)" % (returnType, fullFuncName, declarationString)
+ print "{"
+
+ # Start printing our code pieces. Start with any local
+ # variables we need. This unusual syntax joins the
+ # lines in the variables[] array with the "\n" separator.
+ if len(variables) > 0:
+ print "\n".join(variables) + "\n"
+
+ # If there's any sort of parameter checking or variable
+ # array sizing, the switch code will contain it.
+ if len(switchCode) > 0:
+ print "\n".join(switchCode) + "\n"
+
+ # In the case of an outgoing conversion (i.e. parameters must
+ # be converted before calling the underlying Mesa function),
+ # use the appropriate code.
+ if "get" not in props and len(conversionCodeOutgoing) > 0:
+ print "\n".join(conversionCodeOutgoing) + "\n"
+
+ # Call the Mesa function. Note that there are very few functions
+ # that return a value (i.e. returnType is not "void"), and that
+ # none of them require incoming translation; so we're safe
+ # to generate code that directly returns in those cases,
+ # even though it's not completely independent.
+
+ if returnType == "void":
+ print " %s(%s);" % (passthroughFuncName, passthroughCallString)
+ else:
+ print " return %s(%s);" % (passthroughFuncName, passthroughCallString)
+
+ # If the function is one that returns values (i.e. "get" in props),
+ # it might return values of a different type than we need, that
+ # require conversion before passing back to the application.
+ if "get" in props and len(conversionCodeIncoming) > 0:
+ print "\n".join(conversionCodeIncoming)
+
+ # All done.
+ print "}"
+ print
+ # end for each category provided for a function
+
+# end for each function
+
+print "void"
+print "_mesa_init_exec_table(struct _glapi_table *exec)"
+print "{"
+for func in keys:
+ prefix = "_es_" if func not in allSpecials else "_check_"
+ for spec in apiutil.Categories(func):
+ ext = spec.split(":")
+ # version does not match
+ if ext.pop(0) != version:
+ continue
+ entry = func
+ if ext:
+ suffix = ext[0].split("_")[0]
+ entry += suffix
+ print " SET_%s(exec, %s%s);" % (entry, prefix, entry)
+print "}"
diff --git a/src/mesa/es/main/es_query_matrix.c b/src/mesa/es/main/es_query_matrix.c
new file mode 100644
index 0000000000..82b6fe7ab9
--- /dev/null
+++ b/src/mesa/es/main/es_query_matrix.c
@@ -0,0 +1,199 @@
+/**************************************************************************
+ *
+ * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ **************************************************************************/
+
+
+/**
+ * Code to implement GL_OES_query_matrix. See the spec at:
+ * http://www.khronos.org/registry/gles/extensions/OES/OES_query_matrix.txt
+ */
+
+
+#include <stdlib.h>
+#include <math.h>
+#include "GLES/gl.h"
+#include "GLES/glext.h"
+
+
+/**
+ * This is from the GL_OES_query_matrix extension specification:
+ *
+ * GLbitfield glQueryMatrixxOES( GLfixed mantissa[16],
+ * GLint exponent[16] )
+ * mantissa[16] contains the contents of the current matrix in GLfixed
+ * format. exponent[16] contains the unbiased exponents applied to the
+ * matrix components, so that the internal representation of component i
+ * is close to mantissa[i] * 2^exponent[i]. The function returns a status
+ * word which is zero if all the components are valid. If
+ * status & (1<<i) != 0, the component i is invalid (e.g., NaN, Inf).
+ * The implementations are not required to keep track of overflows. In
+ * that case, the invalid bits are never set.
+ */
+
+#define INT_TO_FIXED(x) ((GLfixed) ((x) << 16))
+#define FLOAT_TO_FIXED(x) ((GLfixed) ((x) * 65536.0))
+
+#if defined(WIN32) || defined(_WIN32_WCE)
+/* Oddly, the fpclassify() function doesn't exist in such a form
+ * on Windows. This is an implementation using slightly different
+ * lower-level Windows functions.
+ */
+#include <float.h>
+
+enum {FP_NAN, FP_INFINITE, FP_ZERO, FP_SUBNORMAL, FP_NORMAL}
+fpclassify(double x)
+{
+ switch(_fpclass(x)) {
+ case _FPCLASS_SNAN: /* signaling NaN */
+ case _FPCLASS_QNAN: /* quiet NaN */
+ return FP_NAN;
+ case _FPCLASS_NINF: /* negative infinity */
+ case _FPCLASS_PINF: /* positive infinity */
+ return FP_INFINITE;
+ case _FPCLASS_NN: /* negative normal */
+ case _FPCLASS_PN: /* positive normal */
+ return FP_NORMAL;
+ case _FPCLASS_ND: /* negative denormalized */
+ case _FPCLASS_PD: /* positive denormalized */
+ return FP_SUBNORMAL;
+ case _FPCLASS_NZ: /* negative zero */
+ case _FPCLASS_PZ: /* positive zero */
+ return FP_ZERO;
+ default:
+ /* Should never get here; but if we do, this will guarantee
+ * that the pattern is not treated like a number.
+ */
+ return FP_NAN;
+ }
+}
+#endif
+
+extern GLbitfield GL_APIENTRY _es_QueryMatrixxOES(GLfixed mantissa[16], GLint exponent[16]);
+
+/* The Mesa functions we'll need */
+extern void GL_APIENTRY _mesa_GetIntegerv(GLenum pname, GLint *params);
+extern void GL_APIENTRY _mesa_GetFloatv(GLenum pname, GLfloat *params);
+
+GLbitfield GL_APIENTRY _es_QueryMatrixxOES(GLfixed mantissa[16], GLint exponent[16])
+{
+ GLfloat matrix[16];
+ GLint tmp;
+ GLenum currentMode = GL_FALSE;
+ GLenum desiredMatrix = GL_FALSE;
+ /* The bitfield returns 1 for each component that is invalid (i.e.
+ * NaN or Inf). In case of error, everything is invalid.
+ */
+ GLbitfield rv;
+ register unsigned int i;
+ unsigned int bit;
+
+ /* This data structure defines the mapping between the current matrix
+ * mode and the desired matrix identifier.
+ */
+ static struct {
+ GLenum currentMode;
+ GLenum desiredMatrix;
+ } modes[] = {
+ {GL_MODELVIEW, GL_MODELVIEW_MATRIX},
+ {GL_PROJECTION, GL_PROJECTION_MATRIX},
+ {GL_TEXTURE, GL_TEXTURE_MATRIX},
+#if 0
+ /* this doesn't exist in GLES */
+ {GL_COLOR, GL_COLOR_MATRIX},
+#endif
+ };
+
+ /* Call Mesa to get the current matrix in floating-point form. First,
+ * we have to figure out what the current matrix mode is.
+ */
+ _mesa_GetIntegerv(GL_MATRIX_MODE, &tmp);
+ currentMode = (GLenum) tmp;
+
+ /* The mode is either GL_FALSE, if for some reason we failed to query
+ * the mode, or a given mode from the above table. Search for the
+ * returned mode to get the desired matrix; if we don't find it,
+ * we can return immediately, as _mesa_GetInteger() will have
+ * logged the necessary error already.
+ */
+ for (i = 0; i < sizeof(modes)/sizeof(modes[0]); i++) {
+ if (modes[i].currentMode == currentMode) {
+ desiredMatrix = modes[i].desiredMatrix;
+ break;
+ }
+ }
+ if (desiredMatrix == GL_FALSE) {
+ /* Early error means all values are invalid. */
+ return 0xffff;
+ }
+
+ /* Now pull the matrix itself. */
+ _mesa_GetFloatv(desiredMatrix, matrix);
+
+ rv = 0;
+ for (i = 0, bit = 1; i < 16; i++, bit<<=1) {
+ float normalizedFraction;
+ int exp;
+
+ switch (fpclassify(matrix[i])) {
+ /* A "subnormal" or denormalized number is too small to be
+ * represented in normal format; but despite that it's a
+ * valid floating point number. FP_ZERO and FP_NORMAL
+ * are both valid as well. We should be fine treating
+ * these three cases as legitimate floating-point numbers.
+ */
+ case FP_SUBNORMAL:
+ case FP_NORMAL:
+ case FP_ZERO:
+ normalizedFraction = (GLfloat)frexp(matrix[i], &exp);
+ mantissa[i] = FLOAT_TO_FIXED(normalizedFraction);
+ exponent[i] = (GLint) exp;
+ break;
+
+ /* If the entry is not-a-number or an infinity, then the
+ * matrix component is invalid. The invalid flag for
+ * the component is already set; might as well set the
+ * other return values to known values. We'll set
+ * distinct values so that a savvy end user could determine
+ * whether the matrix component was a NaN or an infinity,
+ * but this is more useful for debugging than anything else
+ * since the standard doesn't specify any such magic
+ * values to return.
+ */
+ case FP_NAN:
+ mantissa[i] = INT_TO_FIXED(0);
+ exponent[i] = (GLint) 0;
+ rv |= bit;
+ break;
+
+ case FP_INFINITE:
+ /* Return +/- 1 based on whether it's a positive or
+ * negative infinity.
+ */
+ if (matrix[i] > 0) {
+ mantissa[i] = INT_TO_FIXED(1);
+ }
+ else {
+ mantissa[i] = -INT_TO_FIXED(1);
+ }
+ exponent[i] = (GLint) 0;
+ rv |= bit;
+ break;
+
+ /* We should never get here; but here's a catching case
+ * in case fpclassify() is returnings something unexpected.
+ */
+ default:
+ mantissa[i] = INT_TO_FIXED(2);
+ exponent[i] = (GLint) 0;
+ rv |= bit;
+ break;
+ }
+
+ } /* for each component */
+
+ /* All done */
+ return rv;
+}
diff --git a/src/mesa/es/main/es_texgen.c b/src/mesa/es/main/es_texgen.c
new file mode 100644
index 0000000000..c29a0a7f13
--- /dev/null
+++ b/src/mesa/es/main/es_texgen.c
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2009 Chia-I Wu <olv@0xlab.org>
+ *
+ * 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 (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.
+ */
+
+#include "GLES/gl.h"
+#include "GLES/glext.h"
+
+#include "main/compiler.h" /* for ASSERT */
+
+
+#ifndef GL_S
+#define GL_S 0x2000
+#define GL_T 0x2001
+#define GL_R 0x2002
+#endif
+
+
+extern void GL_APIENTRY _es_GetTexGenfv(GLenum coord, GLenum pname, GLfloat *params);
+extern void GL_APIENTRY _es_TexGenf(GLenum coord, GLenum pname, GLfloat param);
+extern void GL_APIENTRY _es_TexGenfv(GLenum coord, GLenum pname, const GLfloat *params);
+
+extern void GL_APIENTRY _mesa_GetTexGenfv(GLenum coord, GLenum pname, GLfloat *params);
+extern void GL_APIENTRY _mesa_TexGenf(GLenum coord, GLenum pname, GLfloat param);
+extern void GL_APIENTRY _mesa_TexGenfv(GLenum coord, GLenum pname, const GLfloat *params);
+
+
+void GL_APIENTRY
+_es_GetTexGenfv(GLenum coord, GLenum pname, GLfloat *params)
+{
+ ASSERT(coord == GL_TEXTURE_GEN_STR_OES);
+ _mesa_GetTexGenfv(GL_S, pname, params);
+}
+
+
+void GL_APIENTRY
+_es_TexGenf(GLenum coord, GLenum pname, GLfloat param)
+{
+ ASSERT(coord == GL_TEXTURE_GEN_STR_OES);
+ /* set S, T, and R at the same time */
+ _mesa_TexGenf(GL_S, pname, param);
+ _mesa_TexGenf(GL_T, pname, param);
+ _mesa_TexGenf(GL_R, pname, param);
+}
+
+
+void GL_APIENTRY
+_es_TexGenfv(GLenum coord, GLenum pname, const GLfloat *params)
+{
+ ASSERT(coord == GL_TEXTURE_GEN_STR_OES);
+ /* set S, T, and R at the same time */
+ _mesa_TexGenfv(GL_S, pname, params);
+ _mesa_TexGenfv(GL_T, pname, params);
+ _mesa_TexGenfv(GL_R, pname, params);
+}
diff --git a/src/mesa/es/main/get_gen.py b/src/mesa/es/main/get_gen.py
new file mode 100644
index 0000000000..fee6670104
--- /dev/null
+++ b/src/mesa/es/main/get_gen.py
@@ -0,0 +1,809 @@
+#!/usr/bin/env python
+
+# Mesa 3-D graphics library
+#
+# 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.
+
+
+# This script is used to generate the get.c file:
+# python get_gen.py > get.c
+
+
+import string
+import sys
+
+
+GLint = 1
+GLenum = 2
+GLfloat = 3
+GLdouble = 4
+GLboolean = 5
+GLfloatN = 6 # A normalized value, such as a color or depth range
+GLfixed = 7
+
+
+TypeStrings = {
+ GLint : "GLint",
+ GLenum : "GLenum",
+ GLfloat : "GLfloat",
+ GLdouble : "GLdouble",
+ GLboolean : "GLboolean",
+ GLfixed : "GLfixed"
+}
+
+
+# Each entry is a tuple of:
+# - the GL state name, such as GL_CURRENT_COLOR
+# - the state datatype, one of GLint, GLfloat, GLboolean or GLenum
+# - list of code fragments to get the state, such as ["ctx->Foo.Bar"]
+# - optional extra code or empty string
+# - optional extensions to check, or None
+#
+
+# Present in ES 1.x and 2.x:
+StateVars_common = [
+ ( "GL_ALPHA_BITS", GLint, ["ctx->DrawBuffer->Visual.alphaBits"],
+ "", None ),
+ ( "GL_BLEND", GLboolean, ["ctx->Color.BlendEnabled"], "", None ),
+ ( "GL_BLEND_SRC", GLenum, ["ctx->Color.BlendSrcRGB"], "", None ),
+ ( "GL_BLUE_BITS", GLint, ["ctx->DrawBuffer->Visual.blueBits"], "", None ),
+ ( "GL_COLOR_CLEAR_VALUE", GLfloatN,
+ [ "ctx->Color.ClearColor[0]",
+ "ctx->Color.ClearColor[1]",
+ "ctx->Color.ClearColor[2]",
+ "ctx->Color.ClearColor[3]" ], "", None ),
+ ( "GL_COLOR_WRITEMASK", GLint,
+ [ "ctx->Color.ColorMask[RCOMP] ? 1 : 0",
+ "ctx->Color.ColorMask[GCOMP] ? 1 : 0",
+ "ctx->Color.ColorMask[BCOMP] ? 1 : 0",
+ "ctx->Color.ColorMask[ACOMP] ? 1 : 0" ], "", None ),
+ ( "GL_CULL_FACE", GLboolean, ["ctx->Polygon.CullFlag"], "", None ),
+ ( "GL_CULL_FACE_MODE", GLenum, ["ctx->Polygon.CullFaceMode"], "", None ),
+ ( "GL_DEPTH_BITS", GLint, ["ctx->DrawBuffer->Visual.depthBits"],
+ "", None ),
+ ( "GL_DEPTH_CLEAR_VALUE", GLfloatN, ["ctx->Depth.Clear"], "", None ),
+ ( "GL_DEPTH_FUNC", GLenum, ["ctx->Depth.Func"], "", None ),
+ ( "GL_DEPTH_RANGE", GLfloatN,
+ [ "ctx->Viewport.Near", "ctx->Viewport.Far" ], "", None ),
+ ( "GL_DEPTH_TEST", GLboolean, ["ctx->Depth.Test"], "", None ),
+ ( "GL_DEPTH_WRITEMASK", GLboolean, ["ctx->Depth.Mask"], "", None ),
+ ( "GL_DITHER", GLboolean, ["ctx->Color.DitherFlag"], "", None ),
+ ( "GL_FRONT_FACE", GLenum, ["ctx->Polygon.FrontFace"], "", None ),
+ ( "GL_GREEN_BITS", GLint, ["ctx->DrawBuffer->Visual.greenBits"],
+ "", None ),
+ ( "GL_LINE_WIDTH", GLfloat, ["ctx->Line.Width"], "", None ),
+ ( "GL_ALIASED_LINE_WIDTH_RANGE", GLfloat,
+ ["ctx->Const.MinLineWidth",
+ "ctx->Const.MaxLineWidth"], "", None ),
+ ( "GL_MAX_ELEMENTS_INDICES", GLint, ["ctx->Const.MaxArrayLockSize"], "", None ),
+ ( "GL_MAX_ELEMENTS_VERTICES", GLint, ["ctx->Const.MaxArrayLockSize"], "", None ),
+
+ ( "GL_MAX_TEXTURE_SIZE", GLint, ["1 << (ctx->Const.MaxTextureLevels - 1)"], "", None ),
+ ( "GL_MAX_VIEWPORT_DIMS", GLint,
+ ["ctx->Const.MaxViewportWidth", "ctx->Const.MaxViewportHeight"],
+ "", None ),
+ ( "GL_PACK_ALIGNMENT", GLint, ["ctx->Pack.Alignment"], "", None ),
+ ( "GL_ALIASED_POINT_SIZE_RANGE", GLfloat,
+ ["ctx->Const.MinPointSize",
+ "ctx->Const.MaxPointSize"], "", None ),
+ ( "GL_POLYGON_OFFSET_FACTOR", GLfloat, ["ctx->Polygon.OffsetFactor "], "", None ),
+ ( "GL_POLYGON_OFFSET_UNITS", GLfloat, ["ctx->Polygon.OffsetUnits "], "", None ),
+ ( "GL_RED_BITS", GLint, ["ctx->DrawBuffer->Visual.redBits"], "", None ),
+ ( "GL_SCISSOR_BOX", GLint,
+ ["ctx->Scissor.X",
+ "ctx->Scissor.Y",
+ "ctx->Scissor.Width",
+ "ctx->Scissor.Height"], "", None ),
+ ( "GL_SCISSOR_TEST", GLboolean, ["ctx->Scissor.Enabled"], "", None ),
+ ( "GL_STENCIL_BITS", GLint, ["ctx->DrawBuffer->Visual.stencilBits"], "", None ),
+ ( "GL_STENCIL_CLEAR_VALUE", GLint, ["ctx->Stencil.Clear"], "", None ),
+ ( "GL_STENCIL_FAIL", GLenum,
+ ["ctx->Stencil.FailFunc[ctx->Stencil.ActiveFace]"], "", None ),
+ ( "GL_STENCIL_FUNC", GLenum,
+ ["ctx->Stencil.Function[ctx->Stencil.ActiveFace]"], "", None ),
+ ( "GL_STENCIL_PASS_DEPTH_FAIL", GLenum,
+ ["ctx->Stencil.ZFailFunc[ctx->Stencil.ActiveFace]"], "", None ),
+ ( "GL_STENCIL_PASS_DEPTH_PASS", GLenum,
+ ["ctx->Stencil.ZPassFunc[ctx->Stencil.ActiveFace]"], "", None ),
+ ( "GL_STENCIL_REF", GLint,
+ ["ctx->Stencil.Ref[ctx->Stencil.ActiveFace]"], "", None ),
+ ( "GL_STENCIL_TEST", GLboolean, ["ctx->Stencil.Enabled"], "", None ),
+ ( "GL_STENCIL_VALUE_MASK", GLint,
+ ["ctx->Stencil.ValueMask[ctx->Stencil.ActiveFace]"], "", None ),
+ ( "GL_STENCIL_WRITEMASK", GLint,
+ ["ctx->Stencil.WriteMask[ctx->Stencil.ActiveFace]"], "", None ),
+ ( "GL_SUBPIXEL_BITS", GLint, ["ctx->Const.SubPixelBits"], "", None ),
+ ( "GL_TEXTURE_BINDING_2D", GLint,
+ ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_2D_INDEX]->Name"], "", None ),
+ ( "GL_UNPACK_ALIGNMENT", GLint, ["ctx->Unpack.Alignment"], "", None ),
+ ( "GL_VIEWPORT", GLint, [ "ctx->Viewport.X", "ctx->Viewport.Y",
+ "ctx->Viewport.Width", "ctx->Viewport.Height" ], "", None ),
+
+ # GL_ARB_multitexture
+ ( "GL_ACTIVE_TEXTURE_ARB", GLint,
+ [ "GL_TEXTURE0_ARB + ctx->Texture.CurrentUnit"], "", ["ARB_multitexture"] ),
+
+ # Note that all the OES_* extensions require that the Mesa
+ # "struct gl_extensions" include a member with the name of
+ # the extension. That structure does not yet include OES
+ # extensions (and we're not sure whether it will). If
+ # it does, all the OES_* extensions below should mark the
+ # dependency.
+
+ # OES_texture_cube_map
+ ( "GL_TEXTURE_BINDING_CUBE_MAP_ARB", GLint,
+ ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_CUBE_INDEX]->Name"],
+ "", None),
+ ( "GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB", GLint,
+ ["(1 << (ctx->Const.MaxCubeTextureLevels - 1))"],
+ "", None),
+
+ # OES_blend_subtract
+ ( "GL_BLEND_SRC_RGB_EXT", GLenum, ["ctx->Color.BlendSrcRGB"], "", None),
+ ( "GL_BLEND_DST_RGB_EXT", GLenum, ["ctx->Color.BlendDstRGB"], "", None),
+ ( "GL_BLEND_SRC_ALPHA_EXT", GLenum, ["ctx->Color.BlendSrcA"], "", None),
+ ( "GL_BLEND_DST_ALPHA_EXT", GLenum, ["ctx->Color.BlendDstA"], "", None),
+
+ # GL_BLEND_EQUATION_RGB, which is what we're really after,
+ # is defined identically to GL_BLEND_EQUATION.
+ ( "GL_BLEND_EQUATION", GLenum, ["ctx->Color.BlendEquationRGB "], "", None),
+ ( "GL_BLEND_EQUATION_ALPHA_EXT", GLenum, ["ctx->Color.BlendEquationA "],
+ "", None),
+
+ # GL_ARB_texture_compression */
+# ( "GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB", GLint,
+# ["_mesa_get_compressed_formats(ctx, NULL, GL_FALSE)"],
+# "", ["ARB_texture_compression"] ),
+# ( "GL_COMPRESSED_TEXTURE_FORMATS_ARB", GLenum,
+# [],
+# """GLint formats[100];
+# GLuint i, n = _mesa_get_compressed_formats(ctx, formats, GL_FALSE);
+# ASSERT(n <= 100);
+# for (i = 0; i < n; i++)
+# params[i] = ENUM_TO_INT(formats[i]);""",
+# ["ARB_texture_compression"] ),
+
+ # GL_ARB_multisample
+ ( "GL_SAMPLE_ALPHA_TO_COVERAGE_ARB", GLboolean,
+ ["ctx->Multisample.SampleAlphaToCoverage"], "", ["ARB_multisample"] ),
+ ( "GL_SAMPLE_COVERAGE_ARB", GLboolean,
+ ["ctx->Multisample.SampleCoverage"], "", ["ARB_multisample"] ),
+ ( "GL_SAMPLE_COVERAGE_VALUE_ARB", GLfloat,
+ ["ctx->Multisample.SampleCoverageValue"], "", ["ARB_multisample"] ),
+ ( "GL_SAMPLE_COVERAGE_INVERT_ARB", GLboolean,
+ ["ctx->Multisample.SampleCoverageInvert"], "", ["ARB_multisample"] ),
+ ( "GL_SAMPLE_BUFFERS_ARB", GLint,
+ ["ctx->DrawBuffer->Visual.sampleBuffers"], "", ["ARB_multisample"] ),
+ ( "GL_SAMPLES_ARB", GLint,
+ ["ctx->DrawBuffer->Visual.samples"], "", ["ARB_multisample"] ),
+
+
+ # GL_SGIS_generate_mipmap
+ ( "GL_GENERATE_MIPMAP_HINT_SGIS", GLenum, ["ctx->Hint.GenerateMipmap"],
+ "", ["SGIS_generate_mipmap"] ),
+
+ # GL_ARB_vertex_buffer_object
+ ( "GL_ARRAY_BUFFER_BINDING_ARB", GLint,
+ ["ctx->Array.ArrayBufferObj->Name"], "", ["ARB_vertex_buffer_object"] ),
+ # GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB - not supported
+ ( "GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB", GLint,
+ ["ctx->Array.ElementArrayBufferObj->Name"],
+ "", ["ARB_vertex_buffer_object"] ),
+
+ # GL_OES_read_format
+ ( "GL_IMPLEMENTATION_COLOR_READ_TYPE_OES", GLint,
+ ["ctx->Const.ColorReadType"], "", None),
+ ( "GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES", GLint,
+ ["ctx->Const.ColorReadFormat"], "", None),
+
+ # GL_OES_framebuffer_object
+ ( "GL_FRAMEBUFFER_BINDING_EXT", GLint, ["ctx->DrawBuffer->Name"], "",
+ None),
+ ( "GL_RENDERBUFFER_BINDING_EXT", GLint,
+ ["ctx->CurrentRenderbuffer ? ctx->CurrentRenderbuffer->Name : 0"], "",
+ None),
+ ( "GL_MAX_RENDERBUFFER_SIZE_EXT", GLint,
+ ["ctx->Const.MaxRenderbufferSize"], "",
+ None),
+
+ # OpenGL ES 1/2 special:
+ ( "GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB", GLint,
+ [ "ARRAY_SIZE(compressed_formats)" ],
+ "",
+ None ),
+
+ ("GL_COMPRESSED_TEXTURE_FORMATS_ARB", GLint,
+ [],
+ """
+ int i;
+ for (i = 0; i < ARRAY_SIZE(compressed_formats); i++) {
+ params[i] = compressed_formats[i];
+ }""",
+ None ),
+
+ ( "GL_POLYGON_OFFSET_FILL", GLboolean, ["ctx->Polygon.OffsetFill"], "", None ),
+
+]
+
+# Only present in ES 1.x:
+StateVars_es1 = [
+ ( "GL_MAX_LIGHTS", GLint, ["ctx->Const.MaxLights"], "", None ),
+ ( "GL_LIGHT0", GLboolean, ["ctx->Light.Light[0].Enabled"], "", None ),
+ ( "GL_LIGHT1", GLboolean, ["ctx->Light.Light[1].Enabled"], "", None ),
+ ( "GL_LIGHT2", GLboolean, ["ctx->Light.Light[2].Enabled"], "", None ),
+ ( "GL_LIGHT3", GLboolean, ["ctx->Light.Light[3].Enabled"], "", None ),
+ ( "GL_LIGHT4", GLboolean, ["ctx->Light.Light[4].Enabled"], "", None ),
+ ( "GL_LIGHT5", GLboolean, ["ctx->Light.Light[5].Enabled"], "", None ),
+ ( "GL_LIGHT6", GLboolean, ["ctx->Light.Light[6].Enabled"], "", None ),
+ ( "GL_LIGHT7", GLboolean, ["ctx->Light.Light[7].Enabled"], "", None ),
+ ( "GL_LIGHTING", GLboolean, ["ctx->Light.Enabled"], "", None ),
+ ( "GL_LIGHT_MODEL_AMBIENT", GLfloatN,
+ ["ctx->Light.Model.Ambient[0]",
+ "ctx->Light.Model.Ambient[1]",
+ "ctx->Light.Model.Ambient[2]",
+ "ctx->Light.Model.Ambient[3]"], "", None ),
+ ( "GL_LIGHT_MODEL_TWO_SIDE", GLboolean, ["ctx->Light.Model.TwoSide"], "", None ),
+ ( "GL_ALPHA_TEST", GLboolean, ["ctx->Color.AlphaEnabled"], "", None ),
+ ( "GL_ALPHA_TEST_FUNC", GLenum, ["ctx->Color.AlphaFunc"], "", None ),
+ ( "GL_ALPHA_TEST_REF", GLfloatN, ["ctx->Color.AlphaRef"], "", None ),
+ ( "GL_BLEND_DST", GLenum, ["ctx->Color.BlendDstRGB"], "", None ),
+ ( "GL_MAX_CLIP_PLANES", GLint, ["ctx->Const.MaxClipPlanes"], "", None ),
+ ( "GL_CLIP_PLANE0", GLboolean,
+ [ "(ctx->Transform.ClipPlanesEnabled >> 0) & 1" ], "", None ),
+ ( "GL_CLIP_PLANE1", GLboolean,
+ [ "(ctx->Transform.ClipPlanesEnabled >> 1) & 1" ], "", None ),
+ ( "GL_CLIP_PLANE2", GLboolean,
+ [ "(ctx->Transform.ClipPlanesEnabled >> 2) & 1" ], "", None ),
+ ( "GL_CLIP_PLANE3", GLboolean,
+ [ "(ctx->Transform.ClipPlanesEnabled >> 3) & 1" ], "", None ),
+ ( "GL_CLIP_PLANE4", GLboolean,
+ [ "(ctx->Transform.ClipPlanesEnabled >> 4) & 1" ], "", None ),
+ ( "GL_CLIP_PLANE5", GLboolean,
+ [ "(ctx->Transform.ClipPlanesEnabled >> 5) & 1" ], "", None ),
+ ( "GL_COLOR_MATERIAL", GLboolean,
+ ["ctx->Light.ColorMaterialEnabled"], "", None ),
+ ( "GL_CURRENT_COLOR", GLfloatN,
+ [ "ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0]",
+ "ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1]",
+ "ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2]",
+ "ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3]" ],
+ "FLUSH_CURRENT(ctx, 0);", None ),
+ ( "GL_CURRENT_NORMAL", GLfloatN,
+ [ "ctx->Current.Attrib[VERT_ATTRIB_NORMAL][0]",
+ "ctx->Current.Attrib[VERT_ATTRIB_NORMAL][1]",
+ "ctx->Current.Attrib[VERT_ATTRIB_NORMAL][2]"],
+ "FLUSH_CURRENT(ctx, 0);", None ),
+ ( "GL_CURRENT_TEXTURE_COORDS", GLfloat,
+ ["ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][0]",
+ "ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][1]",
+ "ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][2]",
+ "ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][3]"],
+ "const GLuint texUnit = ctx->Texture.CurrentUnit;", None ),
+ ( "GL_DISTANCE_ATTENUATION_EXT", GLfloat,
+ ["ctx->Point.Params[0]",
+ "ctx->Point.Params[1]",
+ "ctx->Point.Params[2]"], "", None ),
+ ( "GL_FOG", GLboolean, ["ctx->Fog.Enabled"], "", None ),
+ ( "GL_FOG_COLOR", GLfloatN,
+ [ "ctx->Fog.Color[0]",
+ "ctx->Fog.Color[1]",
+ "ctx->Fog.Color[2]",
+ "ctx->Fog.Color[3]" ], "", None ),
+ ( "GL_FOG_DENSITY", GLfloat, ["ctx->Fog.Density"], "", None ),
+ ( "GL_FOG_END", GLfloat, ["ctx->Fog.End"], "", None ),
+ ( "GL_FOG_HINT", GLenum, ["ctx->Hint.Fog"], "", None ),
+ ( "GL_FOG_MODE", GLenum, ["ctx->Fog.Mode"], "", None ),
+ ( "GL_FOG_START", GLfloat, ["ctx->Fog.Start"], "", None ),
+ ( "GL_LINE_SMOOTH", GLboolean, ["ctx->Line.SmoothFlag"], "", None ),
+ ( "GL_LINE_SMOOTH_HINT", GLenum, ["ctx->Hint.LineSmooth"], "", None ),
+ ( "GL_LINE_WIDTH_RANGE", GLfloat,
+ ["ctx->Const.MinLineWidthAA",
+ "ctx->Const.MaxLineWidthAA"], "", None ),
+ ( "GL_COLOR_LOGIC_OP", GLboolean, ["ctx->Color.ColorLogicOpEnabled"], "", None ),
+ ( "GL_LOGIC_OP_MODE", GLenum, ["ctx->Color.LogicOp"], "", None ),
+ ( "GL_MATRIX_MODE", GLenum, ["ctx->Transform.MatrixMode"], "", None ),
+
+ ( "GL_MAX_MODELVIEW_STACK_DEPTH", GLint, ["MAX_MODELVIEW_STACK_DEPTH"], "", None ),
+ ( "GL_MAX_PROJECTION_STACK_DEPTH", GLint, ["MAX_PROJECTION_STACK_DEPTH"], "", None ),
+ ( "GL_MAX_TEXTURE_STACK_DEPTH", GLint, ["MAX_TEXTURE_STACK_DEPTH"], "", None ),
+ ( "GL_MODELVIEW_MATRIX", GLfloat,
+ [ "matrix[0]", "matrix[1]", "matrix[2]", "matrix[3]",
+ "matrix[4]", "matrix[5]", "matrix[6]", "matrix[7]",
+ "matrix[8]", "matrix[9]", "matrix[10]", "matrix[11]",
+ "matrix[12]", "matrix[13]", "matrix[14]", "matrix[15]" ],
+ "const GLfloat *matrix = ctx->ModelviewMatrixStack.Top->m;", None ),
+ ( "GL_MODELVIEW_STACK_DEPTH", GLint, ["ctx->ModelviewMatrixStack.Depth + 1"], "", None ),
+ ( "GL_NORMALIZE", GLboolean, ["ctx->Transform.Normalize"], "", None ),
+ ( "GL_PACK_SKIP_IMAGES_EXT", GLint, ["ctx->Pack.SkipImages"], "", None ),
+ ( "GL_PERSPECTIVE_CORRECTION_HINT", GLenum,
+ ["ctx->Hint.PerspectiveCorrection"], "", None ),
+ ( "GL_POINT_SIZE", GLfloat, ["ctx->Point.Size"], "", None ),
+ ( "GL_POINT_SIZE_RANGE", GLfloat,
+ ["ctx->Const.MinPointSizeAA",
+ "ctx->Const.MaxPointSizeAA"], "", None ),
+ ( "GL_POINT_SMOOTH", GLboolean, ["ctx->Point.SmoothFlag"], "", None ),
+ ( "GL_POINT_SMOOTH_HINT", GLenum, ["ctx->Hint.PointSmooth"], "", None ),
+ ( "GL_POINT_SIZE_MIN_EXT", GLfloat, ["ctx->Point.MinSize"], "", None ),
+ ( "GL_POINT_SIZE_MAX_EXT", GLfloat, ["ctx->Point.MaxSize"], "", None ),
+ ( "GL_POINT_FADE_THRESHOLD_SIZE_EXT", GLfloat,
+ ["ctx->Point.Threshold"], "", None ),
+ ( "GL_PROJECTION_MATRIX", GLfloat,
+ [ "matrix[0]", "matrix[1]", "matrix[2]", "matrix[3]",
+ "matrix[4]", "matrix[5]", "matrix[6]", "matrix[7]",
+ "matrix[8]", "matrix[9]", "matrix[10]", "matrix[11]",
+ "matrix[12]", "matrix[13]", "matrix[14]", "matrix[15]" ],
+ "const GLfloat *matrix = ctx->ProjectionMatrixStack.Top->m;", None ),
+ ( "GL_PROJECTION_STACK_DEPTH", GLint,
+ ["ctx->ProjectionMatrixStack.Depth + 1"], "", None ),
+ ( "GL_RESCALE_NORMAL", GLboolean,
+ ["ctx->Transform.RescaleNormals"], "", None ),
+ ( "GL_SHADE_MODEL", GLenum, ["ctx->Light.ShadeModel"], "", None ),
+ ( "GL_TEXTURE_2D", GLboolean, ["_mesa_IsEnabled(GL_TEXTURE_2D)"], "", None ),
+ ( "GL_TEXTURE_MATRIX", GLfloat,
+ ["matrix[0]", "matrix[1]", "matrix[2]", "matrix[3]",
+ "matrix[4]", "matrix[5]", "matrix[6]", "matrix[7]",
+ "matrix[8]", "matrix[9]", "matrix[10]", "matrix[11]",
+ "matrix[12]", "matrix[13]", "matrix[14]", "matrix[15]" ],
+ "const GLfloat *matrix = ctx->TextureMatrixStack[ctx->Texture.CurrentUnit].Top->m;", None ),
+ ( "GL_TEXTURE_STACK_DEPTH", GLint,
+ ["ctx->TextureMatrixStack[ctx->Texture.CurrentUnit].Depth + 1"], "", None ),
+ ( "GL_VERTEX_ARRAY", GLboolean, ["ctx->Array.ArrayObj->Vertex.Enabled"], "", None ),
+ ( "GL_VERTEX_ARRAY_SIZE", GLint, ["ctx->Array.ArrayObj->Vertex.Size"], "", None ),
+ ( "GL_VERTEX_ARRAY_TYPE", GLenum, ["ctx->Array.ArrayObj->Vertex.Type"], "", None ),
+ ( "GL_VERTEX_ARRAY_STRIDE", GLint, ["ctx->Array.ArrayObj->Vertex.Stride"], "", None ),
+ ( "GL_NORMAL_ARRAY", GLenum, ["ctx->Array.ArrayObj->Normal.Enabled"], "", None ),
+ ( "GL_NORMAL_ARRAY_TYPE", GLenum, ["ctx->Array.ArrayObj->Normal.Type"], "", None ),
+ ( "GL_NORMAL_ARRAY_STRIDE", GLint, ["ctx->Array.ArrayObj->Normal.Stride"], "", None ),
+ ( "GL_COLOR_ARRAY", GLboolean, ["ctx->Array.ArrayObj->Color.Enabled"], "", None ),
+ ( "GL_COLOR_ARRAY_SIZE", GLint, ["ctx->Array.ArrayObj->Color.Size"], "", None ),
+ ( "GL_COLOR_ARRAY_TYPE", GLenum, ["ctx->Array.ArrayObj->Color.Type"], "", None ),
+ ( "GL_COLOR_ARRAY_STRIDE", GLint, ["ctx->Array.ArrayObj->Color.Stride"], "", None ),
+ ( "GL_TEXTURE_COORD_ARRAY", GLboolean,
+ ["ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Enabled"], "", None ),
+ ( "GL_TEXTURE_COORD_ARRAY_SIZE", GLint,
+ ["ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Size"], "", None ),
+ ( "GL_TEXTURE_COORD_ARRAY_TYPE", GLenum,
+ ["ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Type"], "", None ),
+ ( "GL_TEXTURE_COORD_ARRAY_STRIDE", GLint,
+ ["ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Stride"], "", None ),
+ # GL_ARB_multitexture
+ ( "GL_MAX_TEXTURE_UNITS_ARB", GLint,
+ ["ctx->Const.MaxTextureUnits"], "", ["ARB_multitexture"] ),
+ ( "GL_CLIENT_ACTIVE_TEXTURE_ARB", GLint,
+ ["GL_TEXTURE0_ARB + ctx->Array.ActiveTexture"], "", ["ARB_multitexture"] ),
+ # OES_texture_cube_map
+ ( "GL_TEXTURE_CUBE_MAP_ARB", GLboolean,
+ ["_mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB)"], "", None),
+ ( "GL_TEXTURE_GEN_STR_OES", GLboolean,
+ # S, T, and R are always set at the same time
+ ["((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & S_BIT) ? 1 : 0)"], "", None),
+ # ARB_multisample
+ ( "GL_MULTISAMPLE_ARB", GLboolean,
+ ["ctx->Multisample.Enabled"], "", ["ARB_multisample"] ),
+ ( "GL_SAMPLE_ALPHA_TO_ONE_ARB", GLboolean,
+ ["ctx->Multisample.SampleAlphaToOne"], "", ["ARB_multisample"] ),
+
+ ( "GL_VERTEX_ARRAY_BUFFER_BINDING_ARB", GLint,
+ ["ctx->Array.ArrayObj->Vertex.BufferObj->Name"], "", ["ARB_vertex_buffer_object"] ),
+ ( "GL_NORMAL_ARRAY_BUFFER_BINDING_ARB", GLint,
+ ["ctx->Array.ArrayObj->Normal.BufferObj->Name"], "", ["ARB_vertex_buffer_object"] ),
+ ( "GL_COLOR_ARRAY_BUFFER_BINDING_ARB", GLint,
+ ["ctx->Array.ArrayObj->Color.BufferObj->Name"], "", ["ARB_vertex_buffer_object"] ),
+ ( "GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB", GLint,
+ ["ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].BufferObj->Name"],
+ "", ["ARB_vertex_buffer_object"] ),
+
+ # OES_point_sprite
+ ( "GL_POINT_SPRITE_NV", GLboolean, ["ctx->Point.PointSprite"], # == GL_POINT_SPRITE_ARB
+ "", None),
+
+ # GL_ARB_fragment_shader
+ ( "GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB", GLint,
+ ["ctx->Const.FragmentProgram.MaxUniformComponents"], "",
+ ["ARB_fragment_shader"] ),
+
+ # GL_ARB_vertex_shader
+ ( "GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB", GLint,
+ ["ctx->Const.VertexProgram.MaxUniformComponents"], "",
+ ["ARB_vertex_shader"] ),
+ ( "GL_MAX_VARYING_FLOATS_ARB", GLint,
+ ["ctx->Const.MaxVarying * 4"], "", ["ARB_vertex_shader"] ),
+
+ # OES_matrix_get
+ ( "GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES", GLint, [],
+ """
+ /* See GL_OES_matrix_get */
+ {
+ const GLfloat *matrix = ctx->ModelviewMatrixStack.Top->m;
+ memcpy(params, matrix, 16 * sizeof(GLint));
+ }""",
+ None),
+
+ ( "GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES", GLint, [],
+ """
+ /* See GL_OES_matrix_get */
+ {
+ const GLfloat *matrix = ctx->ProjectionMatrixStack.Top->m;
+ memcpy(params, matrix, 16 * sizeof(GLint));
+ }""",
+ None),
+
+ ( "GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES", GLint, [],
+ """
+ /* See GL_OES_matrix_get */
+ {
+ const GLfloat *matrix =
+ ctx->TextureMatrixStack[ctx->Texture.CurrentUnit].Top->m;
+ memcpy(params, matrix, 16 * sizeof(GLint));
+ }""",
+ None),
+
+ # OES_point_size_array
+ ("GL_POINT_SIZE_ARRAY_OES", GLboolean,
+ ["ctx->Array.ArrayObj->PointSize.Enabled"], "", None),
+ ("GL_POINT_SIZE_ARRAY_TYPE_OES", GLenum,
+ ["ctx->Array.ArrayObj->PointSize.Type"], "", None),
+ ("GL_POINT_SIZE_ARRAY_STRIDE_OES", GLint,
+ ["ctx->Array.ArrayObj->PointSize.Stride"], "", None),
+ ("GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES", GLint,
+ ["ctx->Array.ArrayObj->PointSize.BufferObj->Name"], "", None),
+
+ # GL_EXT_texture_lod_bias
+ ( "GL_MAX_TEXTURE_LOD_BIAS_EXT", GLfloat,
+ ["ctx->Const.MaxTextureLodBias"], "", ["EXT_texture_lod_bias"]),
+
+ # GL_EXT_texture_filter_anisotropic
+ ( "GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT", GLfloat,
+ ["ctx->Const.MaxTextureMaxAnisotropy"], "", ["EXT_texture_filter_anisotropic"]),
+
+]
+
+# Only present in ES 2.x:
+StateVars_es2 = [
+ # XXX These entries are not spec'ed for GLES 2, but are
+ # needed for Mesa's GLSL:
+ ( "GL_MAX_LIGHTS", GLint, ["ctx->Const.MaxLights"], "", None ),
+ ( "GL_MAX_CLIP_PLANES", GLint, ["ctx->Const.MaxClipPlanes"], "", None ),
+ ( "GL_MAX_TEXTURE_COORDS_ARB", GLint, # == GL_MAX_TEXTURE_COORDS_NV
+ ["ctx->Const.MaxTextureCoordUnits"], "",
+ ["ARB_fragment_program", "NV_fragment_program"] ),
+ ( "GL_MAX_DRAW_BUFFERS_ARB", GLint,
+ ["ctx->Const.MaxDrawBuffers"], "", ["ARB_draw_buffers"] ),
+ ( "GL_BLEND_COLOR_EXT", GLfloatN,
+ [ "ctx->Color.BlendColor[0]",
+ "ctx->Color.BlendColor[1]",
+ "ctx->Color.BlendColor[2]",
+ "ctx->Color.BlendColor[3]"], "", None ),
+
+ # This is required for GLES2, but also needed for GLSL:
+ ( "GL_MAX_TEXTURE_IMAGE_UNITS_ARB", GLint, # == GL_MAX_TEXTURE_IMAGE_UNI
+ ["ctx->Const.MaxTextureImageUnits"], "",
+ ["ARB_fragment_program", "NV_fragment_program"] ),
+
+ ( "GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB", GLint,
+ ["ctx->Const.MaxVertexTextureImageUnits"], "", ["ARB_vertex_shader"] ),
+ ( "GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB", GLint,
+ ["MAX_COMBINED_TEXTURE_IMAGE_UNITS"], "", ["ARB_vertex_shader"] ),
+
+ # GL_ARB_shader_objects
+ # Actually, this token isn't part of GL_ARB_shader_objects, but is
+ # close enough for now.
+ ( "GL_CURRENT_PROGRAM", GLint,
+ ["ctx->Shader.CurrentProgram ? ctx->Shader.CurrentProgram->Name : 0"],
+ "", ["ARB_shader_objects"] ),
+
+ # OpenGL 2.0
+ ( "GL_STENCIL_BACK_FUNC", GLenum, ["ctx->Stencil.Function[1]"], "", None ),
+ ( "GL_STENCIL_BACK_VALUE_MASK", GLint, ["ctx->Stencil.ValueMask[1]"], "", None ),
+ ( "GL_STENCIL_BACK_WRITEMASK", GLint, ["ctx->Stencil.WriteMask[1]"], "", None ),
+ ( "GL_STENCIL_BACK_REF", GLint, ["ctx->Stencil.Ref[1]"], "", None ),
+ ( "GL_STENCIL_BACK_FAIL", GLenum, ["ctx->Stencil.FailFunc[1]"], "", None ),
+ ( "GL_STENCIL_BACK_PASS_DEPTH_FAIL", GLenum, ["ctx->Stencil.ZFailFunc[1]"], "", None ),
+ ( "GL_STENCIL_BACK_PASS_DEPTH_PASS", GLenum, ["ctx->Stencil.ZPassFunc[1]"], "", None ),
+
+ ( "GL_MAX_VERTEX_ATTRIBS_ARB", GLint,
+ ["ctx->Const.VertexProgram.MaxAttribs"], "", ["ARB_vertex_program"] ),
+
+ # OES_texture_3D
+ ( "GL_TEXTURE_BINDING_3D", GLint,
+ ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_3D_INDEX]->Name"], "", None),
+ ( "GL_MAX_3D_TEXTURE_SIZE", GLint, ["1 << (ctx->Const.Max3DTextureLevels - 1)"], "", None),
+
+ # OES_standard_derivatives
+ ( "GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB", GLenum,
+ ["ctx->Hint.FragmentShaderDerivative"], "", ["ARB_fragment_shader"] ),
+
+ # Unique to ES 2 (not in full GL)
+ ( "GL_MAX_FRAGMENT_UNIFORM_VECTORS", GLint,
+ ["ctx->Const.FragmentProgram.MaxUniformComponents / 4"], "", None),
+ ( "GL_MAX_VARYING_VECTORS", GLint,
+ ["ctx->Const.MaxVarying"], "", None),
+ ( "GL_MAX_VERTEX_UNIFORM_VECTORS", GLint,
+ ["ctx->Const.VertexProgram.MaxUniformComponents / 4"], "", None),
+ ( "GL_SHADER_COMPILER", GLint, ["1"], "", None),
+ # OES_get_program_binary
+ ( "GL_NUM_SHADER_BINARY_FORMATS", GLint, ["0"], "", None),
+ ( "GL_SHADER_BINARY_FORMATS", GLint, [], "", None),
+]
+
+
+
+def ConversionFunc(fromType, toType):
+ """Return the name of the macro to convert between two data types."""
+ if fromType == toType:
+ return ""
+ elif fromType == GLfloat and toType == GLint:
+ return "IROUND"
+ elif fromType == GLfloatN and toType == GLfloat:
+ return ""
+ elif fromType == GLint and toType == GLfloat: # but not GLfloatN!
+ return "(GLfloat)"
+ else:
+ if fromType == GLfloatN:
+ fromType = GLfloat
+ fromStr = TypeStrings[fromType]
+ fromStr = string.upper(fromStr[2:])
+ toStr = TypeStrings[toType]
+ toStr = string.upper(toStr[2:])
+ return fromStr + "_TO_" + toStr
+
+
+def EmitGetFunction(stateVars, returnType):
+ """Emit the code to implement glGetBooleanv, glGetIntegerv or glGetFloatv."""
+ assert (returnType == GLboolean or
+ returnType == GLint or
+ returnType == GLfloat or
+ returnType == GLfixed)
+
+ strType = TypeStrings[returnType]
+ # Capitalize first letter of return type
+ if returnType == GLint:
+ function = "_mesa_GetIntegerv"
+ elif returnType == GLboolean:
+ function = "_mesa_GetBooleanv"
+ elif returnType == GLfloat:
+ function = "_mesa_GetFloatv"
+ elif returnType == GLfixed:
+ function = "_mesa_GetFixedv"
+ else:
+ abort()
+
+ print "void GLAPIENTRY"
+ print "%s( GLenum pname, %s *params )" % (function, strType)
+ print "{"
+ print " GET_CURRENT_CONTEXT(ctx);"
+ print " ASSERT_OUTSIDE_BEGIN_END(ctx);"
+ print ""
+ print " if (!params)"
+ print " return;"
+ print ""
+ print " if (ctx->NewState)"
+ print " _mesa_update_state(ctx);"
+ print ""
+ print " switch (pname) {"
+
+ for (name, varType, state, optionalCode, extensions) in stateVars:
+ print " case " + name + ":"
+ if extensions:
+ if len(extensions) == 1:
+ print (' CHECK_EXT1(%s, "%s");' %
+ (extensions[0], function))
+ elif len(extensions) == 2:
+ print (' CHECK_EXT2(%s, %s, "%s");' %
+ (extensions[0], extensions[1], function))
+ elif len(extensions) == 3:
+ print (' CHECK_EXT3(%s, %s, %s, "%s");' %
+ (extensions[0], extensions[1], extensions[2], function))
+ else:
+ assert len(extensions) == 4
+ print (' CHECK_EXT4(%s, %s, %s, %s, "%s");' %
+ (extensions[0], extensions[1], extensions[2], extensions[3], function))
+ if optionalCode:
+ print " {"
+ print " " + optionalCode
+ conversion = ConversionFunc(varType, returnType)
+ n = len(state)
+ for i in range(n):
+ if conversion:
+ print " params[%d] = %s(%s);" % (i, conversion, state[i])
+ else:
+ print " params[%d] = %s;" % (i, state[i])
+ if optionalCode:
+ print " }"
+ print " break;"
+
+ print " default:"
+ print ' _mesa_error(ctx, GL_INVALID_ENUM, "gl%s(pname=0x%%x)", pname);' % function
+ print " }"
+ print "}"
+ print ""
+ return
+
+
+
+def EmitHeader():
+ """Print the get.c file header."""
+ print """
+/***
+ *** NOTE!!! DO NOT EDIT THIS FILE!!! IT IS GENERATED BY get_gen.py
+ ***/
+
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/enable.h"
+#include "main/extensions.h"
+#include "main/fbobject.h"
+#include "main/get.h"
+#include "main/macros.h"
+#include "main/mtypes.h"
+#include "main/state.h"
+#include "main/texcompress.h"
+
+
+/* ES1 tokens that should be in gl.h but aren't */
+#define GL_MAX_ELEMENTS_INDICES 0x80E9
+#define GL_MAX_ELEMENTS_VERTICES 0x80E8
+
+
+/* ES2 special tokens */
+#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD
+#define GL_MAX_VARYING_VECTORS 0x8DFC
+#define GL_MAX_VARYING_VECTORS 0x8DFC
+#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB
+#define GL_SHADER_COMPILER 0x8DFA
+#define GL_PLATFORM_BINARY 0x8D63
+#define GL_SHADER_BINARY_FORMATS 0x8DF8
+#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9
+
+
+#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
+
+#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_texture_cube_map */
+#ifndef GL_OES_texture_cube_map
+#define GL_TEXTURE_GEN_STR_OES 0x8D60
+#endif
+
+#define FLOAT_TO_BOOLEAN(X) ( (X) ? GL_TRUE : GL_FALSE )
+#define FLOAT_TO_FIXED(F) ( ((F) * 65536.0f > INT_MAX) ? INT_MAX : \\
+ ((F) * 65536.0f < INT_MIN) ? INT_MIN : \\
+ (GLint) ((F) * 65536.0f) )
+
+#define INT_TO_BOOLEAN(I) ( (I) ? GL_TRUE : GL_FALSE )
+#define INT_TO_FIXED(I) ( ((I) > SHRT_MAX) ? INT_MAX : \\
+ ((I) < SHRT_MIN) ? INT_MIN : \\
+ (GLint) ((I) * 65536) )
+
+#define BOOLEAN_TO_INT(B) ( (GLint) (B) )
+#define BOOLEAN_TO_FLOAT(B) ( (B) ? 1.0F : 0.0F )
+#define BOOLEAN_TO_FIXED(B) ( (GLint) ((B) ? 1 : 0) << 16 )
+
+#define ENUM_TO_FIXED(E) (E)
+
+
+/*
+ * Check if named extension is enabled, if not generate error and return.
+ */
+#define CHECK_EXT1(EXT1, FUNC) \\
+ if (!ctx->Extensions.EXT1) { \\
+ _mesa_error(ctx, GL_INVALID_ENUM, FUNC "(0x%x)", (int) pname); \\
+ return; \\
+ }
+
+/*
+ * Check if either of two extensions is enabled.
+ */
+#define CHECK_EXT2(EXT1, EXT2, FUNC) \\
+ if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2) { \\
+ _mesa_error(ctx, GL_INVALID_ENUM, FUNC "(0x%x)", (int) pname); \\
+ return; \\
+ }
+
+/*
+ * Check if either of three extensions is enabled.
+ */
+#define CHECK_EXT3(EXT1, EXT2, EXT3, FUNC) \\
+ if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2 && \\
+ !ctx->Extensions.EXT3) { \\
+ _mesa_error(ctx, GL_INVALID_ENUM, FUNC "(0x%x)", (int) pname); \\
+ return; \\
+ }
+
+/*
+ * Check if either of four extensions is enabled.
+ */
+#define CHECK_EXT4(EXT1, EXT2, EXT3, EXT4, FUNC) \\
+ if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2 && \\
+ !ctx->Extensions.EXT3 && !ctx->Extensions.EXT4) { \\
+ _mesa_error(ctx, GL_INVALID_ENUM, FUNC "(0x%x)", (int) pname); \\
+ return; \\
+ }
+
+
+
+/**
+ * List of compressed texture formats supported by ES.
+ */
+static GLenum compressed_formats[] = {
+ GL_PALETTE4_RGB8_OES,
+ GL_PALETTE4_RGBA8_OES,
+ GL_PALETTE4_R5_G6_B5_OES,
+ GL_PALETTE4_RGBA4_OES,
+ GL_PALETTE4_RGB5_A1_OES,
+ GL_PALETTE8_RGB8_OES,
+ GL_PALETTE8_RGBA8_OES,
+ GL_PALETTE8_R5_G6_B5_OES,
+ GL_PALETTE8_RGBA4_OES,
+ GL_PALETTE8_RGB5_A1_OES
+};
+
+#define ARRAY_SIZE(A) (sizeof(A) / sizeof(A[0]))
+
+void GLAPIENTRY
+_mesa_GetFixedv( GLenum pname, GLfixed *params );
+
+"""
+ return
+
+
+def EmitAll(stateVars, API):
+ EmitHeader()
+ EmitGetFunction(stateVars, GLboolean)
+ EmitGetFunction(stateVars, GLfloat)
+ EmitGetFunction(stateVars, GLint)
+ if API == 1:
+ EmitGetFunction(stateVars, GLfixed)
+
+
+def main(args):
+ # Determine whether to generate ES1 or ES2 queries
+ if len(args) > 1 and args[1] == "1":
+ API = 1
+ elif len(args) > 1 and args[1] == "2":
+ API = 2
+ else:
+ API = 1
+ #print "len args = %d API = %d" % (len(args), API)
+
+ if API == 1:
+ vars = StateVars_common + StateVars_es1
+ else:
+ vars = StateVars_common + StateVars_es2
+
+ EmitAll(vars, API)
+
+
+main(sys.argv)
diff --git a/src/mesa/es/main/mfeatures_es1.h b/src/mesa/es/main/mfeatures_es1.h
new file mode 100644
index 0000000000..6c2ece2608
--- /dev/null
+++ b/src/mesa/es/main/mfeatures_es1.h
@@ -0,0 +1,116 @@
+/**************************************************************************
+ *
+ * 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 NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS 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.
+ *
+ **************************************************************************/
+
+/**
+ * \file mfeatures.h
+ *
+ * The #defines in this file enable/disable Mesa features needed
+ * for OpenGL ES 1.1.
+ */
+
+
+#ifndef MFEATURES_ES1_H
+#define MFEATURES_ES1_H
+
+/* this file replaces main/mfeatures.h */
+#ifdef FEATURES_H
+#error "main/mfeatures.h was wrongly included"
+#endif
+#define FEATURES_H
+
+#define ASSERT_NO_FEATURE() ASSERT(0)
+
+/*
+ * Enable/disable features (blocks of code) by setting FEATURE_xyz to 0 or 1.
+ */
+#ifndef _HAVE_FULL_GL
+#define _HAVE_FULL_GL 1
+#endif
+
+#ifdef IN_DRI_DRIVER
+#define FEATURE_remap_table 1
+#else
+#define FEATURE_remap_table 0
+#endif
+
+#define FEATURE_accum 0
+#define FEATURE_arrayelt 0
+#define FEATURE_attrib 0
+#define FEATURE_beginend 0
+#define FEATURE_colortable 0
+#define FEATURE_convolve 0
+#define FEATURE_dispatch 1
+#define FEATURE_dlist 0
+#define FEATURE_draw_read_buffer 0
+#define FEATURE_drawpix 0
+#define FEATURE_eval 0
+#define FEATURE_feedback 0
+#define FEATURE_fixedpt 1
+#define FEATURE_histogram 0
+#define FEATURE_pixel 0
+#define FEATURE_point_size_array 1
+#define FEATURE_queryobj 0
+#define FEATURE_rastpos 0
+#define FEATURE_texgen 1
+#define FEATURE_texture_fxt1 0
+#define FEATURE_texture_s3tc 0
+#define FEATURE_userclip 1
+#define FEATURE_vertex_array_byte 1
+#define FEATURE_es2_glsl 0
+
+#define FEATURE_ARB_fragment_program _HAVE_FULL_GL
+#define FEATURE_ARB_vertex_buffer_object _HAVE_FULL_GL
+#define FEATURE_ARB_vertex_program _HAVE_FULL_GL
+
+#define FEATURE_ARB_vertex_shader _HAVE_FULL_GL
+#define FEATURE_ARB_fragment_shader _HAVE_FULL_GL
+#define FEATURE_ARB_shader_objects (FEATURE_ARB_vertex_shader || FEATURE_ARB_fragment_shader)
+#define FEATURE_ARB_shading_language_100 FEATURE_ARB_shader_objects
+#define FEATURE_ARB_shading_language_120 FEATURE_ARB_shader_objects
+
+#define FEATURE_EXT_framebuffer_blit 0
+#define FEATURE_EXT_framebuffer_object _HAVE_FULL_GL
+#define FEATURE_EXT_pixel_buffer_object _HAVE_FULL_GL
+#define FEATURE_EXT_texture_sRGB 0
+#define FEATURE_ATI_fragment_shader 0
+#define FEATURE_MESA_program_debug _HAVE_FULL_GL
+#define FEATURE_NV_fence 0
+#define FEATURE_NV_fragment_program 0
+#define FEATURE_NV_vertex_program 0
+
+#define FEATURE_OES_framebuffer_object 1
+#define FEATURE_OES_draw_texture 1
+#define FEATURE_OES_mapbuffer 1
+
+#define FEATURE_extra_context_init 1
+
+/*@}*/
+
+
+
+
+#endif /* MFEATURES_ES1_H */
diff --git a/src/mesa/es/main/mfeatures_es2.h b/src/mesa/es/main/mfeatures_es2.h
new file mode 100644
index 0000000000..f34782fedb
--- /dev/null
+++ b/src/mesa/es/main/mfeatures_es2.h
@@ -0,0 +1,116 @@
+/**************************************************************************
+ *
+ * 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 NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS 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.
+ *
+ **************************************************************************/
+
+/**
+ * \file mfeatures.h
+ *
+ * The #defines in this file enable/disable Mesa features needed
+ * for OpenGL ES 2.0.
+ */
+
+
+#ifndef MFEATURES_ES2_H
+#define MFEATURES_ES2_H
+
+/* this file replaces main/mfeatures.h */
+#ifdef FEATURES_H
+#error "main/mfeatures.h was wrongly included"
+#endif
+#define FEATURES_H
+
+#define ASSERT_NO_FEATURE() ASSERT(0)
+
+/*
+ * Enable/disable features (blocks of code) by setting FEATURE_xyz to 0 or 1.
+ */
+#ifndef _HAVE_FULL_GL
+#define _HAVE_FULL_GL 1
+#endif
+
+#ifdef IN_DRI_DRIVER
+#define FEATURE_remap_table 1
+#else
+#define FEATURE_remap_table 0
+#endif
+
+#define FEATURE_accum 0
+#define FEATURE_arrayelt 0
+#define FEATURE_attrib 0
+#define FEATURE_beginend 0
+#define FEATURE_colortable 0
+#define FEATURE_convolve 0
+#define FEATURE_dispatch 1
+#define FEATURE_dlist 0
+#define FEATURE_draw_read_buffer 0
+#define FEATURE_drawpix 0
+#define FEATURE_eval 0
+#define FEATURE_feedback 0
+#define FEATURE_fixedpt 1
+#define FEATURE_histogram 0
+#define FEATURE_pixel 0
+#define FEATURE_point_size_array 1
+#define FEATURE_queryobj 0
+#define FEATURE_rastpos 0
+#define FEATURE_texgen 1
+#define FEATURE_texture_fxt1 0
+#define FEATURE_texture_s3tc 0
+#define FEATURE_userclip 1
+#define FEATURE_vertex_array_byte 1
+#define FEATURE_es2_glsl 1
+
+#define FEATURE_ARB_fragment_program _HAVE_FULL_GL
+#define FEATURE_ARB_vertex_buffer_object _HAVE_FULL_GL
+#define FEATURE_ARB_vertex_program _HAVE_FULL_GL
+
+#define FEATURE_ARB_vertex_shader _HAVE_FULL_GL
+#define FEATURE_ARB_fragment_shader _HAVE_FULL_GL
+#define FEATURE_ARB_shader_objects (FEATURE_ARB_vertex_shader || FEATURE_ARB_fragment_shader)
+#define FEATURE_ARB_shading_language_100 FEATURE_ARB_shader_objects
+#define FEATURE_ARB_shading_language_120 FEATURE_ARB_shader_objects
+
+#define FEATURE_EXT_framebuffer_blit 0
+#define FEATURE_EXT_framebuffer_object _HAVE_FULL_GL
+#define FEATURE_EXT_pixel_buffer_object _HAVE_FULL_GL
+#define FEATURE_EXT_texture_sRGB 0
+#define FEATURE_ATI_fragment_shader 0
+#define FEATURE_MESA_program_debug _HAVE_FULL_GL
+#define FEATURE_NV_fence 0
+#define FEATURE_NV_fragment_program 0
+#define FEATURE_NV_vertex_program 0
+
+#define FEATURE_OES_framebuffer_object 1
+#define FEATURE_OES_draw_texture 0
+#define FEATURE_OES_mapbuffer 1
+
+#define FEATURE_extra_context_init 1
+
+/*@}*/
+
+
+
+
+#endif /* MFEATURES_ES2_H */
diff --git a/src/mesa/es/main/specials_es1.c b/src/mesa/es/main/specials_es1.c
new file mode 100644
index 0000000000..a4f14490f3
--- /dev/null
+++ b/src/mesa/es/main/specials_es1.c
@@ -0,0 +1,213 @@
+/**************************************************************************
+ *
+ * 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, 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
+ * TUNGSTEN GRAPHICS 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.
+ **************************************************************************/
+
+
+#include "main/mtypes.h"
+#include "main/context.h"
+#include "main/imports.h"
+#include "main/get.h"
+
+
+extern const GLubyte * GLAPIENTRY _es_GetString(GLenum name);
+
+
+static const GLubyte *
+compute_es_version(void)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ static const char es_1_0[] = "OpenGL ES-CM 1.0";
+ static const char es_1_1[] = "OpenGL ES-CM 1.1";
+ /* OpenGL ES 1.0 is derived from OpenGL 1.3 */
+ const GLboolean ver_1_0 = (ctx->Extensions.ARB_multisample &&
+ ctx->Extensions.ARB_multitexture &&
+ ctx->Extensions.ARB_texture_compression &&
+ ctx->Extensions.EXT_texture_env_add &&
+ ctx->Extensions.ARB_texture_env_combine &&
+ ctx->Extensions.ARB_texture_env_dot3);
+ /* OpenGL ES 1.1 is derived from OpenGL 1.5 */
+ const GLboolean ver_1_1 = (ver_1_0 &&
+ ctx->Extensions.EXT_point_parameters &&
+ ctx->Extensions.SGIS_generate_mipmap &&
+ ctx->Extensions.ARB_vertex_buffer_object);
+ if (ver_1_1)
+ return (const GLubyte *) es_1_1;
+
+ if (!ver_1_0)
+ _mesa_problem(ctx, "Incomplete OpenGL ES 1.0 support.");
+ return (const GLubyte *) es_1_0;
+}
+
+
+static size_t
+append_extension(char **str, const char *ext)
+{
+ char *s = *str;
+ size_t len = strlen(ext);
+
+ if (s) {
+ memcpy(s, ext, len);
+ s[len++] = ' ';
+ s[len] = '\0';
+
+ *str += len;
+ }
+ else {
+ len++;
+ }
+
+ return len;
+}
+
+
+static size_t
+make_extension_string(const GLcontext *ctx, char *str)
+{
+ size_t len = 0;
+
+ /* Core additions */
+ len += append_extension(&str, "GL_OES_byte_coordinates");
+ len += append_extension(&str, "GL_OES_fixed_point");
+ len += append_extension(&str, "GL_OES_single_precision");
+ len += append_extension(&str, "GL_OES_matrix_get");
+
+ /* 1.1 required extensions */
+ len += append_extension(&str, "GL_OES_read_format");
+ len += append_extension(&str, "GL_OES_compressed_paletted_texture");
+ len += append_extension(&str, "GL_OES_point_size_array");
+ len += append_extension(&str, "GL_OES_point_sprite");
+
+ /* 1.1 deprecated extensions */
+ len += append_extension(&str, "GL_OES_query_matrix");
+
+#if FEATURE_OES_draw_texture
+ if (ctx->Extensions.OES_draw_texture)
+ len += append_extension(&str, "GL_OES_draw_texture");
+#endif
+
+ if (ctx->Extensions.EXT_blend_equation_separate)
+ len += append_extension(&str, "GL_OES_blend_equation_separate");
+ if (ctx->Extensions.EXT_blend_func_separate)
+ len += append_extension(&str, "GL_OES_blend_func_separate");
+ if (ctx->Extensions.EXT_blend_subtract)
+ len += append_extension(&str, "GL_OES_blend_subtract");
+
+ if (ctx->Extensions.EXT_stencil_wrap)
+ len += append_extension(&str, "GL_OES_stencil_wrap");
+
+ if (ctx->Extensions.ARB_texture_cube_map)
+ len += append_extension(&str, "GL_OES_texture_cube_map");
+ if (ctx->Extensions.ARB_texture_env_crossbar)
+ len += append_extension(&str, "GL_OES_texture_env_crossbar");
+ if (ctx->Extensions.ARB_texture_mirrored_repeat)
+ len += append_extension(&str, "GL_OES_texture_mirrored_repeat");
+
+ if (ctx->Extensions.ARB_framebuffer_object) {
+ len += append_extension(&str, "GL_OES_framebuffer_object");
+ len += append_extension(&str, "GL_OES_depth24");
+ len += append_extension(&str, "GL_OES_depth32");
+ len += append_extension(&str, "GL_OES_fbo_render_mipmap");
+ len += append_extension(&str, "GL_OES_rgb8_rgba8");
+ len += append_extension(&str, "GL_OES_stencil1");
+ len += append_extension(&str, "GL_OES_stencil4");
+ len += append_extension(&str, "GL_OES_stencil8");
+ }
+
+ if (ctx->Extensions.EXT_vertex_array)
+ len += append_extension(&str, "GL_OES_element_index_uint");
+ if (ctx->Extensions.ARB_vertex_buffer_object)
+ len += append_extension(&str, "GL_OES_mapbuffer");
+ if (ctx->Extensions.EXT_texture_filter_anisotropic)
+ len += append_extension(&str, "GL_EXT_texture_filter_anisotropic");
+
+ /* some applications check this for NPOT support */
+ if (ctx->Extensions.ARB_texture_non_power_of_two)
+ len += append_extension(&str, "GL_ARB_texture_non_power_of_two");
+
+ if (ctx->Extensions.EXT_texture_compression_s3tc)
+ len += append_extension(&str, "GL_EXT_texture_compression_dxt1");
+ if (ctx->Extensions.EXT_texture_lod_bias)
+ len += append_extension(&str, "GL_EXT_texture_lod_bias");
+ if (ctx->Extensions.EXT_blend_minmax)
+ len += append_extension(&str, "GL_EXT_blend_minmax");
+ if (ctx->Extensions.EXT_multi_draw_arrays)
+ len += append_extension(&str, "GL_EXT_multi_draw_arrays");
+
+ return len;
+}
+
+
+static const GLubyte *
+compute_es_extensions(void)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ if (!ctx->Extensions.String) {
+ char *s;
+ unsigned int len;
+
+ len = make_extension_string(ctx, NULL);
+ s = (char *) _mesa_malloc(len + 1);
+ if (!s)
+ return NULL;
+ make_extension_string(ctx, s);
+ ctx->Extensions.String = (const GLubyte *) s;
+ }
+
+ return ctx->Extensions.String;
+}
+
+
+const GLubyte * GLAPIENTRY
+_es_GetString(GLenum name)
+{
+ switch (name) {
+ case GL_VERSION:
+ return compute_es_version();
+ case GL_EXTENSIONS:
+ return compute_es_extensions();
+ default:
+ return _mesa_GetString(name);
+ }
+}
+
+
+void
+_mesa_initialize_context_extra(GLcontext *ctx)
+{
+ GLuint i;
+
+ /**
+ * GL_OES_texture_cube_map says
+ * "Initially all texture generation modes are set to REFLECTION_MAP_OES"
+ */
+ for (i = 0; i < MAX_TEXTURE_UNITS; i++) {
+ struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i];
+ texUnit->GenS.Mode = GL_REFLECTION_MAP_NV;
+ texUnit->GenT.Mode = GL_REFLECTION_MAP_NV;
+ texUnit->GenR.Mode = GL_REFLECTION_MAP_NV;
+ texUnit->GenS._ModeBit = TEXGEN_REFLECTION_MAP_NV;
+ texUnit->GenT._ModeBit = TEXGEN_REFLECTION_MAP_NV;
+ texUnit->GenR._ModeBit = TEXGEN_REFLECTION_MAP_NV;
+ }
+}
diff --git a/src/mesa/es/main/specials_es2.c b/src/mesa/es/main/specials_es2.c
new file mode 100644
index 0000000000..e11ade9b94
--- /dev/null
+++ b/src/mesa/es/main/specials_es2.c
@@ -0,0 +1,174 @@
+/**************************************************************************
+ *
+ * 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, 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
+ * TUNGSTEN GRAPHICS 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.
+ **************************************************************************/
+
+
+#include "main/mtypes.h"
+#include "main/context.h"
+#include "main/imports.h"
+#include "main/get.h"
+
+
+const GLubyte * GLAPIENTRY _es_GetString(GLenum name);
+
+
+static const GLubyte *
+compute_es_version(void)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ static const char es_2_0[] = "OpenGL ES 2.0";
+ /* OpenGL ES 2.0 is derived from OpenGL 2.0 */
+ const GLboolean ver_2_0 = (ctx->Extensions.ARB_multisample &&
+ ctx->Extensions.ARB_multitexture &&
+ ctx->Extensions.ARB_texture_compression &&
+ ctx->Extensions.ARB_texture_cube_map &&
+ ctx->Extensions.ARB_texture_mirrored_repeat &&
+ ctx->Extensions.EXT_blend_color &&
+ ctx->Extensions.EXT_blend_func_separate &&
+ ctx->Extensions.EXT_blend_minmax &&
+ ctx->Extensions.EXT_blend_subtract &&
+ ctx->Extensions.EXT_stencil_wrap &&
+ ctx->Extensions.ARB_vertex_buffer_object &&
+ ctx->Extensions.ARB_shader_objects &&
+ ctx->Extensions.ARB_vertex_shader &&
+ ctx->Extensions.ARB_fragment_shader &&
+ ctx->Extensions.ARB_texture_non_power_of_two &&
+ ctx->Extensions.EXT_blend_equation_separate);
+ if (!ver_2_0)
+ _mesa_problem(ctx, "Incomplete OpenGL ES 2.0 support.");
+ return (const GLubyte *) es_2_0;
+}
+
+
+static size_t
+append_extension(char **str, const char *ext)
+{
+ char *s = *str;
+ size_t len = strlen(ext);
+
+ if (s) {
+ memcpy(s, ext, len);
+ s[len++] = ' ';
+ s[len] = '\0';
+
+ *str += len;
+ }
+ else {
+ len++;
+ }
+
+ return len;
+}
+
+
+static size_t
+make_extension_string(const GLcontext *ctx, char *str)
+{
+ size_t len = 0;
+
+ len += append_extension(&str, "GL_OES_compressed_paletted_texture");
+
+ if (ctx->Extensions.ARB_framebuffer_object) {
+ len += append_extension(&str, "GL_OES_depth24");
+ len += append_extension(&str, "GL_OES_depth32");
+ len += append_extension(&str, "GL_OES_fbo_render_mipmap");
+ len += append_extension(&str, "GL_OES_rgb8_rgba8");
+ len += append_extension(&str, "GL_OES_stencil1");
+ len += append_extension(&str, "GL_OES_stencil4");
+ }
+
+ if (ctx->Extensions.EXT_vertex_array)
+ len += append_extension(&str, "GL_OES_element_index_uint");
+ if (ctx->Extensions.ARB_vertex_buffer_object)
+ len += append_extension(&str, "GL_OES_mapbuffer");
+
+ if (ctx->Extensions.EXT_texture3D)
+ len += append_extension(&str, "GL_OES_texture_3D");
+ if (ctx->Extensions.ARB_texture_non_power_of_two)
+ len += append_extension(&str, "GL_OES_texture_npot");
+ if (ctx->Extensions.EXT_texture_filter_anisotropic)
+ len += append_extension(&str, "GL_EXT_texture_filter_anisotropic");
+
+ len += append_extension(&str, "GL_EXT_texture_type_2_10_10_10_REV");
+ if (ctx->Extensions.ARB_depth_texture)
+ len += append_extension(&str, "GL_OES_depth_texture");
+ if (ctx->Extensions.EXT_packed_depth_stencil)
+ len += append_extension(&str, "GL_OES_packed_depth_stencil");
+ if (ctx->Extensions.ARB_fragment_shader)
+ len += append_extension(&str, "GL_OES_standard_derivatives");
+
+ if (ctx->Extensions.EXT_texture_compression_s3tc)
+ len += append_extension(&str, "GL_EXT_texture_compression_dxt1");
+ if (ctx->Extensions.EXT_blend_minmax)
+ len += append_extension(&str, "GL_EXT_blend_minmax");
+ if (ctx->Extensions.EXT_multi_draw_arrays)
+ len += append_extension(&str, "GL_EXT_multi_draw_arrays");
+
+ return len;
+}
+
+
+static const GLubyte *
+compute_es_extensions(void)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ if (!ctx->Extensions.String) {
+ char *s;
+ unsigned int len;
+
+ len = make_extension_string(ctx, NULL);
+ s = (char *) _mesa_malloc(len + 1);
+ if (!s)
+ return NULL;
+ make_extension_string(ctx, s);
+ ctx->Extensions.String = (const GLubyte *) s;
+ }
+
+ return ctx->Extensions.String;
+}
+
+const GLubyte * GLAPIENTRY
+_es_GetString(GLenum name)
+{
+ switch (name) {
+ case GL_VERSION:
+ return compute_es_version();
+ case GL_SHADING_LANGUAGE_VERSION:
+ return (const GLubyte *) "OpenGL ES GLSL ES 1.0.16";
+ case GL_EXTENSIONS:
+ return compute_es_extensions();
+ default:
+ return _mesa_GetString(name);
+ }
+}
+
+
+void
+_mesa_initialize_context_extra(GLcontext *ctx)
+{
+ ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE;
+ ctx->VertexProgram._MaintainTnlProgram = GL_TRUE;
+
+ ctx->Point.PointSprite = GL_TRUE; /* always on for ES 2.x */
+}
diff --git a/src/mesa/es/main/stubs.c b/src/mesa/es/main/stubs.c
new file mode 100644
index 0000000000..e7b8bc780f
--- /dev/null
+++ b/src/mesa/es/main/stubs.c
@@ -0,0 +1,138 @@
+/**************************************************************************
+ *
+ * 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, 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
+ * TUNGSTEN GRAPHICS 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.
+ **************************************************************************/
+
+
+/**
+ * Temporary stubs for "missing" mesa functions.
+ */
+
+
+#include "main/mtypes.h"
+#include "main/imports.h"
+#include "vbo/vbo.h"
+
+#define NEED_IMPLEMENT() do { \
+ GET_CURRENT_CONTEXT(ctx); \
+ _mesa_error(ctx, GL_INVALID_OPERATION, __FUNCTION__); \
+ } while (0)
+
+#if FEATURE_accum
+/* This is a sanity check that to be sure we're using the correct mfeatures.h
+ * header. We don't want to accidentally use the one from mainline Mesa.
+ */
+#error "The wrong mfeatures.h file is being included!"
+#endif
+
+
+/* silence compiler warnings */
+extern void GLAPIENTRY _vbo_Materialf(GLenum face, GLenum pname, GLfloat param);
+extern void GLAPIENTRY _mesa_GetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
+extern void GLAPIENTRY _mesa_ReleaseShaderCompiler(void);
+extern void GLAPIENTRY _mesa_ShaderBinary(GLint n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLint length);
+extern void GLAPIENTRY _vbo_VertexAttrib1f(GLuint indx, GLfloat x);
+extern void GLAPIENTRY _vbo_VertexAttrib1fv(GLuint indx, const GLfloat* values);
+extern void GLAPIENTRY _vbo_VertexAttrib2f(GLuint indx, GLfloat x, GLfloat y);
+extern void GLAPIENTRY _vbo_VertexAttrib2fv(GLuint indx, const GLfloat* values);
+extern void GLAPIENTRY _vbo_VertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z);
+extern void GLAPIENTRY _vbo_VertexAttrib3fv(GLuint indx, const GLfloat* values);
+extern void GLAPIENTRY _vbo_VertexAttrib4fv(GLuint indx, const GLfloat* values);
+
+
+void GLAPIENTRY
+_vbo_Materialf(GLenum face, GLenum pname, GLfloat param)
+{
+ _vbo_Materialfv(face, pname, &param);
+}
+
+
+void GLAPIENTRY
+_mesa_GetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype,
+ GLint* range, GLint* precision)
+{
+ NEED_IMPLEMENT();
+}
+
+
+void GLAPIENTRY
+_mesa_ReleaseShaderCompiler(void)
+{
+ NEED_IMPLEMENT();
+}
+
+
+void GLAPIENTRY
+_mesa_ShaderBinary(GLint n, const GLuint* shaders, GLenum binaryformat,
+ const void* binary, GLint length)
+{
+ NEED_IMPLEMENT();
+}
+
+
+void GLAPIENTRY
+_vbo_VertexAttrib1f(GLuint indx, GLfloat x)
+{
+ _vbo_VertexAttrib4f(indx, x, 0.0, 0.0, 1.0f);
+}
+
+
+void GLAPIENTRY
+_vbo_VertexAttrib1fv(GLuint indx, const GLfloat* values)
+{
+ _vbo_VertexAttrib4f(indx, values[0], 0.0, 0.0, 1.0f);
+}
+
+
+void GLAPIENTRY
+_vbo_VertexAttrib2f(GLuint indx, GLfloat x, GLfloat y)
+{
+ _vbo_VertexAttrib4f(indx, x, y, 0.0, 1.0f);
+}
+
+
+void GLAPIENTRY
+_vbo_VertexAttrib2fv(GLuint indx, const GLfloat* values)
+{
+ _vbo_VertexAttrib4f(indx, values[0], values[1], 0.0, 1.0f);
+}
+
+
+void GLAPIENTRY
+_vbo_VertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z)
+{
+ _vbo_VertexAttrib4f(indx, x, y, z, 1.0f);
+}
+
+
+void GLAPIENTRY
+_vbo_VertexAttrib3fv(GLuint indx, const GLfloat* values)
+{
+ _vbo_VertexAttrib4f(indx, values[0], values[1], values[2], 1.0f);
+}
+
+
+void GLAPIENTRY
+_vbo_VertexAttrib4fv(GLuint indx, const GLfloat* values)
+{
+ _vbo_VertexAttrib4f(indx, values[0], values[1], values[2], values[3]);
+}
diff --git a/src/mesa/es/sources.mak b/src/mesa/es/sources.mak
new file mode 100644
index 0000000000..84fad26773
--- /dev/null
+++ b/src/mesa/es/sources.mak
@@ -0,0 +1,167 @@
+include $(MESA)/sources.mak
+
+# LOCAL sources
+
+LOCAL_ES1_SOURCES := \
+ main/api_exec_es1.c \
+ main/get_es1.c \
+ main/specials_es1.c \
+ main/drawtex.c \
+ main/es_cpaltex.c \
+ main/es_enable.c \
+ main/es_fbo.c \
+ main/es_query_matrix.c \
+ main/es_texgen.c \
+ main/stubs.c \
+ glapi/glapi-es1/main/enums.c
+
+LOCAL_ES1_GALLIUM_SOURCES := \
+ $(LOCAL_ES1_SOURCES) \
+ state_tracker/st_cb_drawtex.c
+
+# always use local version of GLAPI_ASM_SOURCES
+LOCAL_ES1_API_ASM := $(addprefix glapi/glapi-es1/, $(GLAPI_ASM_SOURCES))
+
+LOCAL_ES1_INCLUDES := \
+ -I. \
+ -I./glapi/glapi-es1 \
+ -I./state_tracker \
+ -I$(MESA)/state_tracker
+
+LOCAL_ES2_SOURCES := \
+ main/api_exec_es2.c \
+ main/get_es2.c \
+ main/specials_es2.c \
+ main/es_cpaltex.c \
+ main/es_fbo.c \
+ main/stubs.c \
+ glapi/glapi-es2/main/enums.c
+
+LOCAL_ES2_GALLIUM_SOURCES := \
+ $(LOCAL_ES2_SOURCES)
+
+LOCAL_ES2_API_ASM := $(subst es1,es2, $(LOCAL_ES1_API_ASM))
+LOCAL_ES2_INCLUDES := $(subst es1,es2, $(LOCAL_ES1_INCLUDES))
+
+# MESA sources
+
+MAIN_OMITTED := \
+ main/api_exec.c \
+ main/dlopen.c \
+ main/enums.c \
+ main/get.c
+MAIN_SOURCES := $(filter-out $(MAIN_OMITTED), $(MAIN_SOURCES))
+
+VBO_OMITTED := \
+ vbo/vbo_save.c \
+ vbo/vbo_save_api.c \
+ vbo/vbo_save_draw.c \
+ vbo/vbo_save_loopback.c
+VBO_SOURCES := $(filter-out $(VBO_OMITTED), $(VBO_SOURCES))
+
+STATETRACKER_OMITTED := \
+ state_tracker/st_api.c \
+ state_tracker/st_cb_drawpixels.c \
+ state_tracker/st_cb_feedback.c \
+ state_tracker/st_cb_rasterpos.c \
+ state_tracker/st_draw_feedback.c
+STATETRACKER_SOURCES := $(filter-out $(STATETRACKER_OMITTED), $(STATETRACKER_SOURCES))
+
+SHADER_OMITTED := \
+ shader/atifragshader.c \
+ shader/nvfragparse.c \
+ shader/nvprogram.c \
+ shader/nvvertparse.c
+SHADER_SOURCES := $(filter-out $(SHADER_OMITTED), $(SHADER_SOURCES))
+
+MESA_ES1_SOURCES := \
+ $(MAIN_SOURCES) \
+ $(MATH_SOURCES) \
+ $(MATH_XFORM_SOURCES) \
+ $(VBO_SOURCES) \
+ $(TNL_SOURCES) \
+ $(SHADER_SOURCES) \
+ $(SWRAST_SOURCES) \
+ $(SWRAST_SETUP_SOURCES) \
+ $(COMMON_DRIVER_SOURCES) \
+ $(ASM_C_SOURCES) \
+ $(SLANG_SOURCES)
+
+MESA_ES1_GALLIUM_SOURCES := \
+ $(MAIN_SOURCES) \
+ $(MATH_SOURCES) \
+ $(VBO_SOURCES) \
+ $(STATETRACKER_SOURCES) \
+ $(SHADER_SOURCES) \
+ ppc/common_ppc.c \
+ x86/common_x86.c \
+ $(SLANG_SOURCES)
+
+MESA_ES1_API_SOURCES := \
+ $(GLAPI_SOURCES)
+
+MESA_ES1_INCLUDES := $(INCLUDE_DIRS)
+
+# remove LOCAL sources from MESA sources
+MESA_ES1_SOURCES := $(filter-out $(LOCAL_ES1_SOURCES), $(MESA_ES1_SOURCES))
+MESA_ES1_GALLIUM_SOURCES := $(filter-out $(LOCAL_ES1_GALLIUM_SOURCES), $(MESA_ES1_GALLIUM_SOURCES))
+
+# right now es2 and es1 share MESA sources
+MESA_ES2_SOURCES := $(MESA_ES1_SOURCES)
+MESA_ES2_GALLIUM_SOURCES := $(MESA_ES1_GALLIUM_SOURCES)
+MESA_ES2_API_SOURCES := $(MESA_ES1_API_SOURCES)
+
+MESA_ES2_INCLUDES := $(MESA_ES1_INCLUDES)
+
+# asm is shared by any ES version and any library
+MESA_ES_ASM := $(MESA_ASM_SOURCES)
+
+# collect sources, adjust the pathes
+ES1_SOURCES := $(LOCAL_ES1_SOURCES) $(addprefix $(MESA)/,$(MESA_ES1_SOURCES))
+ES1_GALLIUM_SOURCES := $(LOCAL_ES1_GALLIUM_SOURCES) $(addprefix $(MESA)/,$(MESA_ES1_GALLIUM_SOURCES))
+ES1_API_SOURCES := $(addprefix $(MESA)/,$(MESA_ES1_API_SOURCES))
+
+ES2_SOURCES := $(LOCAL_ES2_SOURCES) $(addprefix $(MESA)/,$(MESA_ES2_SOURCES))
+ES2_GALLIUM_SOURCES := $(LOCAL_ES2_GALLIUM_SOURCES) $(addprefix $(MESA)/,$(MESA_ES2_GALLIUM_SOURCES))
+ES2_API_SOURCES := $(addprefix $(MESA)/,$(MESA_ES2_API_SOURCES))
+
+# collect includes
+ES1_INCLUDES := $(LOCAL_ES1_INCLUDES) $(MESA_ES1_INCLUDES)
+ES2_INCLUDES := $(LOCAL_ES2_INCLUDES) $(MESA_ES2_INCLUDES)
+
+# collect objects, including asm
+ES1_OBJECTS := \
+ $(LOCAL_ES1_SOURCES:.c=.o) \
+ $(MESA_ES1_SOURCES:.c=.o) \
+ $(MESA_ES_ASM:.S=.o)
+
+ES1_GALLIUM_OBJECTS := \
+ $(LOCAL_ES1_GALLIUM_SOURCES:.c=.o) \
+ $(MESA_ES1_GALLIUM_SOURCES:.c=.o) \
+ $(MESA_ES_ASM:.S=.o)
+
+ES1_API_OBJECTS := \
+ $(LOCAL_ES1_API_ASM:.S=.o) \
+ $(MESA_ES1_API_SOURCES:.c=.o)
+
+ES2_OBJECTS := \
+ $(LOCAL_ES2_SOURCES:.c=.o) \
+ $(MESA_ES2_SOURCES:.c=.o) \
+ $(MESA_ES_ASM:.S=.o)
+
+ES2_GALLIUM_OBJECTS := \
+ $(LOCAL_ES2_GALLIUM_SOURCES:.c=.o) \
+ $(MESA_ES2_GALLIUM_SOURCES:.c=.o) \
+ $(MESA_ES_ASM:.S=.o)
+
+ES2_API_OBJECTS := \
+ $(LOCAL_ES2_API_ASM:.S=.o) \
+ $(MESA_ES2_API_SOURCES:.c=.o)
+
+# collect sources for makedepend
+ES1_ALL_SOURCES := $(ES1_SOURCES) $(ES1_GALLIUM_SOURCES) $(ES1_API_SOURCES)
+ES2_ALL_SOURCES := $(ES2_SOURCES) $(ES2_GALLIUM_SOURCES) $(ES2_API_SOURCES)
+
+# sort to remove duplicates
+ES1_ALL_SOURCES := $(sort $(ES1_ALL_SOURCES))
+ES2_ALL_SOURCES := $(sort $(ES2_ALL_SOURCES))
diff --git a/src/mesa/es/state_tracker/st_cb_drawtex.c b/src/mesa/es/state_tracker/st_cb_drawtex.c
new file mode 100644
index 0000000000..3b98b9c40b
--- /dev/null
+++ b/src/mesa/es/state_tracker/st_cb_drawtex.c
@@ -0,0 +1,297 @@
+/**************************************************************************
+ *
+ * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ **************************************************************************/
+
+
+/**
+ * Implementation of glDrawTex() for GL_OES_draw_tex
+ */
+
+
+
+#include "main/imports.h"
+#include "main/image.h"
+#include "main/bufferobj.h"
+#include "main/drawtex.h"
+#include "main/macros.h"
+#include "main/state.h"
+#include "main/texformat.h"
+#include "shader/program.h"
+#include "shader/prog_parameter.h"
+#include "shader/prog_print.h"
+
+#include "st_context.h"
+#include "st_atom.h"
+#include "st_atom_constbuf.h"
+#include "st_draw.h"
+#include "st_cb_drawtex.h"
+
+#include "pipe/p_context.h"
+#include "pipe/p_defines.h"
+#include "pipe/p_inlines.h"
+#include "pipe/p_shader_tokens.h"
+#include "util/u_tile.h"
+#include "util/u_draw_quad.h"
+#include "util/u_simple_shaders.h"
+
+#include "cso_cache/cso_context.h"
+
+
+struct cached_shader
+{
+ //struct pipe_shader_state shader;
+ void *handle;
+
+ uint num_attribs;
+ uint semantic_names[2 + MAX_TEXTURE_UNITS];
+ uint semantic_indexes[2 + MAX_TEXTURE_UNITS];
+};
+
+#define MAX_SHADERS (2 * MAX_TEXTURE_UNITS)
+
+/**
+ * Simple linear list cache.
+ * Most of the time there'll only be one cached shader.
+ */
+static struct cached_shader CachedShaders[MAX_SHADERS];
+static GLuint NumCachedShaders = 0;
+
+
+#if FEATURE_OES_draw_texture
+
+
+static void *
+lookup_shader(struct pipe_context *pipe,
+ uint num_attribs,
+ const uint *semantic_names,
+ const uint *semantic_indexes)
+{
+ GLuint i, j;
+
+ /* look for existing shader with same attributes */
+ for (i = 0; i < NumCachedShaders; i++) {
+ if (CachedShaders[i].num_attribs == num_attribs) {
+ GLboolean match = GL_TRUE;
+ for (j = 0; j < num_attribs; j++) {
+ if (semantic_names[j] != CachedShaders[i].semantic_names[j] ||
+ semantic_indexes[j] != CachedShaders[i].semantic_indexes[j]) {
+ match = GL_FALSE;
+ break;
+ }
+ }
+ if (match)
+ return CachedShaders[i].handle;
+ }
+ }
+
+ /* not found - create new one now */
+ if (NumCachedShaders >= MAX_SHADERS) {
+ return NULL;
+ }
+
+ CachedShaders[i].num_attribs = num_attribs;
+ for (j = 0; j < num_attribs; j++) {
+ CachedShaders[i].semantic_names[j] = semantic_names[j];
+ CachedShaders[i].semantic_indexes[j] = semantic_indexes[j];
+ }
+
+ CachedShaders[i].handle =
+ util_make_vertex_passthrough_shader(pipe,
+ num_attribs,
+ semantic_names,
+ semantic_indexes);
+ NumCachedShaders++;
+
+ return CachedShaders[i].handle;
+}
+
+static void
+st_DrawTex(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z,
+ GLfloat width, GLfloat height)
+{
+ struct st_context *st = ctx->st;
+ struct pipe_context *pipe = st->pipe;
+ struct cso_context *cso = ctx->st->cso_context;
+ struct pipe_buffer *vbuffer;
+ GLuint i, numTexCoords, numAttribs;
+ GLboolean emitColor;
+ uint semantic_names[2 + MAX_TEXTURE_UNITS];
+ uint semantic_indexes[2 + MAX_TEXTURE_UNITS];
+ GLbitfield inputs = VERT_BIT_POS;
+
+ /* determine if we need vertex color */
+ if (ctx->FragmentProgram._Current->Base.InputsRead & FRAG_BIT_COL0)
+ emitColor = GL_TRUE;
+ else
+ emitColor = GL_FALSE;
+
+ /* determine how many enabled sets of texcoords */
+ numTexCoords = 0;
+ for (i = 0; i < ctx->Const.MaxTextureUnits; i++) {
+ if (ctx->Texture.Unit[i]._ReallyEnabled & TEXTURE_2D_BIT) {
+ inputs |= VERT_BIT_TEX(i);
+ numTexCoords++;
+ }
+ }
+
+ /* total number of attributes per vertex */
+ numAttribs = 1 + emitColor + numTexCoords;
+
+
+ /* create the vertex buffer */
+ vbuffer = pipe_buffer_create(pipe->screen, 32, PIPE_BUFFER_USAGE_VERTEX,
+ numAttribs * 4 * 4 * sizeof(GLfloat));
+
+ /* load vertex buffer */
+ {
+#define SET_ATTRIB(VERT, ATTR, X, Y, Z, W) \
+ do { \
+ GLuint k = (((VERT) * numAttribs + (ATTR)) * 4); \
+ assert(k < 4 * 4 * numAttribs); \
+ vbuf[k + 0] = X; \
+ vbuf[k + 1] = Y; \
+ vbuf[k + 2] = Z; \
+ vbuf[k + 3] = W; \
+ } while (0)
+
+ const GLfloat x0 = x, y0 = y, x1 = x + width, y1 = y + height;
+ GLfloat *vbuf = (GLfloat *) pipe_buffer_map(pipe->screen, vbuffer,
+ PIPE_BUFFER_USAGE_CPU_WRITE);
+ GLuint attr;
+
+ z = CLAMP(z, 0.0f, 1.0f);
+
+ /* positions (in clip coords) */
+ {
+ const struct gl_framebuffer *fb = st->ctx->DrawBuffer;
+ const GLfloat fb_width = (GLfloat)fb->Width;
+ const GLfloat fb_height = (GLfloat)fb->Height;
+
+ const GLfloat clip_x0 = (GLfloat)(x0 / fb_width * 2.0 - 1.0);
+ const GLfloat clip_y0 = (GLfloat)(y0 / fb_height * 2.0 - 1.0);
+ const GLfloat clip_x1 = (GLfloat)(x1 / fb_width * 2.0 - 1.0);
+ const GLfloat clip_y1 = (GLfloat)(y1 / fb_height * 2.0 - 1.0);
+
+ SET_ATTRIB(0, 0, clip_x0, clip_y0, z, 1.0f); /* lower left */
+ SET_ATTRIB(1, 0, clip_x1, clip_y0, z, 1.0f); /* lower right */
+ SET_ATTRIB(2, 0, clip_x1, clip_y1, z, 1.0f); /* upper right */
+ SET_ATTRIB(3, 0, clip_x0, clip_y1, z, 1.0f); /* upper left */
+
+ semantic_names[0] = TGSI_SEMANTIC_POSITION;
+ semantic_indexes[0] = 0;
+ }
+
+ /* colors */
+ if (emitColor) {
+ const GLfloat *c = ctx->Current.Attrib[VERT_ATTRIB_COLOR0];
+ SET_ATTRIB(0, 1, c[0], c[1], c[2], c[3]);
+ SET_ATTRIB(1, 1, c[0], c[1], c[2], c[3]);
+ SET_ATTRIB(2, 1, c[0], c[1], c[2], c[3]);
+ SET_ATTRIB(3, 1, c[0], c[1], c[2], c[3]);
+ semantic_names[1] = TGSI_SEMANTIC_COLOR;
+ semantic_indexes[1] = 0;
+ attr = 2;
+ }
+ else {
+ attr = 1;
+ }
+
+ /* texcoords */
+ for (i = 0; i < ctx->Const.MaxTextureUnits; i++) {
+ if (ctx->Texture.Unit[i]._ReallyEnabled & TEXTURE_2D_BIT) {
+ struct gl_texture_object *obj = ctx->Texture.Unit[i]._Current;
+ struct gl_texture_image *img = obj->Image[0][obj->BaseLevel];
+ const GLfloat wt = (GLfloat) img->Width;
+ const GLfloat ht = (GLfloat) img->Height;
+ const GLfloat s0 = obj->CropRect[0] / wt;
+ const GLfloat t0 = obj->CropRect[1] / ht;
+ const GLfloat s1 = (obj->CropRect[0] + obj->CropRect[2]) / wt;
+ const GLfloat t1 = (obj->CropRect[1] + obj->CropRect[3]) / ht;
+
+ /*printf("crop texcoords: %g, %g .. %g, %g\n", s0, t0, s1, t1);*/
+ SET_ATTRIB(0, attr, s0, t0, 0.0f, 1.0f); /* lower left */
+ SET_ATTRIB(1, attr, s1, t0, 0.0f, 1.0f); /* lower right */
+ SET_ATTRIB(2, attr, s1, t1, 0.0f, 1.0f); /* upper right */
+ SET_ATTRIB(3, attr, s0, t1, 0.0f, 1.0f); /* upper left */
+
+ semantic_names[attr] = TGSI_SEMANTIC_GENERIC;
+ semantic_indexes[attr] = 0;
+
+ attr++;
+ }
+ }
+
+ pipe_buffer_unmap(pipe->screen, vbuffer);
+
+#undef SET_ATTRIB
+ }
+
+
+ cso_save_viewport(cso);
+ cso_save_vertex_shader(cso);
+
+ {
+ void *vs = lookup_shader(pipe, numAttribs,
+ semantic_names, semantic_indexes);
+ cso_set_vertex_shader_handle(cso, vs);
+ }
+
+ /* viewport state: viewport matching window dims */
+ {
+ const struct gl_framebuffer *fb = st->ctx->DrawBuffer;
+ const GLboolean invert = (st_fb_orientation(fb) == Y_0_TOP);
+ const GLfloat width = (GLfloat)fb->Width;
+ const GLfloat height = (GLfloat)fb->Height;
+ struct pipe_viewport_state vp;
+ vp.scale[0] = 0.5f * width;
+ vp.scale[1] = height * (invert ? -0.5f : 0.5f);
+ vp.scale[2] = 1.0f;
+ vp.scale[3] = 1.0f;
+ vp.translate[0] = 0.5f * width;
+ vp.translate[1] = 0.5f * height;
+ vp.translate[2] = 0.0f;
+ vp.translate[3] = 0.0f;
+ cso_set_viewport(cso, &vp);
+ }
+
+
+ util_draw_vertex_buffer(pipe, vbuffer,
+ 0, /* offset */
+ PIPE_PRIM_TRIANGLE_FAN,
+ 4, /* verts */
+ numAttribs); /* attribs/vert */
+
+
+ pipe_buffer_reference(&vbuffer, NULL);
+
+ /* restore state */
+ cso_restore_viewport(cso);
+ cso_restore_vertex_shader(cso);
+}
+
+
+#endif /* FEATURE_OES_draw_texture */
+
+
+void
+st_init_drawtex_functions(struct dd_function_table *functions)
+{
+ _MESA_INIT_DRAWTEX_FUNCTIONS(functions, st_);
+}
+
+
+/**
+ * Free any cached shaders
+ */
+void
+st_destroy_drawtex(struct st_context *st)
+{
+ GLuint i;
+ for (i = 0; i < NumCachedShaders; i++) {
+ cso_delete_vertex_shader(st->cso_context, CachedShaders[i].handle);
+ }
+ NumCachedShaders = 0;
+}
diff --git a/src/mesa/es/state_tracker/st_cb_drawtex.h b/src/mesa/es/state_tracker/st_cb_drawtex.h
new file mode 100644
index 0000000000..7b0da70279
--- /dev/null
+++ b/src/mesa/es/state_tracker/st_cb_drawtex.h
@@ -0,0 +1,18 @@
+/**************************************************************************
+ *
+ * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ **************************************************************************/
+
+
+#ifndef ST_CB_DRAWTEX_H
+#define ST_CB_DRAWTEX_H
+
+extern void
+st_init_drawtex_functions(struct dd_function_table *functions);
+
+extern void
+st_destroy_drawtex(struct st_context *st);
+
+#endif /* ST_CB_DRAWTEX_H */
diff --git a/src/mesa/glapi/dispatch.h b/src/mesa/glapi/dispatch.h
index 6623d52469..27f80a5062 100644
--- a/src/mesa/glapi/dispatch.h
+++ b/src/mesa/glapi/dispatch.h
@@ -30,8 +30,8 @@
#define _GLAPI_USE_REMAP_TABLE
#endif
-#include "glapitable.h"
-#include "glapioffsets.h"
-#include "glapidispatch.h"
+#include "glapi/glapitable.h"
+#include "glapi/glapioffsets.h"
+#include "glapi/glapidispatch.h"
#endif /* _DISPATCH_H */
diff --git a/src/mesa/glapi/gl_XML.py b/src/mesa/glapi/gl_XML.py
index b98919134f..bafb00306f 100644
--- a/src/mesa/glapi/gl_XML.py
+++ b/src/mesa/glapi/gl_XML.py
@@ -738,6 +738,9 @@ class gl_function( gl_item ):
return p_string
+ def is_abi(self):
+ return (self.offset >= 0 and not self.assign_offset)
+
def is_static_entry_point(self, name):
return name in self.static_entry_points
diff --git a/src/mesa/glapi/gl_apitemp.py b/src/mesa/glapi/gl_apitemp.py
index a37c08d6ce..09b0d364ce 100644
--- a/src/mesa/glapi/gl_apitemp.py
+++ b/src/mesa/glapi/gl_apitemp.py
@@ -30,7 +30,7 @@ import license
import sys, getopt
class PrintGlOffsets(gl_XML.gl_print_base):
- def __init__(self):
+ def __init__(self, es=False):
gl_XML.gl_print_base.__init__(self)
self.name = "gl_apitemp.py (from Mesa)"
@@ -38,6 +38,8 @@ class PrintGlOffsets(gl_XML.gl_print_base):
"""Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
(C) Copyright IBM Corporation 2004""", "BRIAN PAUL, IBM")
+ self.es = es
+
self.undef_list.append( "KEYWORD1" )
self.undef_list.append( "KEYWORD1_ALT" )
self.undef_list.append( "KEYWORD2" )
@@ -82,10 +84,14 @@ class PrintGlOffsets(gl_XML.gl_print_base):
else:
dispatch = "DISPATCH"
- if f.has_different_protocol(name):
- print '#ifndef GLX_INDIRECT_RENDERING'
-
+ need_proto = False
if not f.is_static_entry_point(name):
+ need_proto = True
+ elif self.es:
+ cat, num = api.get_category_for_name(name)
+ if (cat.startswith("es") or cat.startswith("GL_OES")):
+ need_proto = True
+ if need_proto:
print '%s %s KEYWORD2 NAME(%s)(%s);' % (keyword, f.return_type, n, f.get_parameter_string(name))
print ''
@@ -98,8 +104,6 @@ class PrintGlOffsets(gl_XML.gl_print_base):
print ' %s(%s, (%s), (F, "gl%s(%s);\\n", %s));' \
% (dispatch, f.name, p_string, name, t_string, o_string)
print '}'
- if f.has_different_protocol(name):
- print '#endif /* GLX_INDIRECT_RENDERING */'
print ''
return
@@ -172,6 +176,10 @@ class PrintGlOffsets(gl_XML.gl_print_base):
#error TABLE_ENTRY must be defined
#endif
+#ifdef _GLAPI_SKIP_NORMAL_ENTRY_POINTS
+#error _GLAPI_SKIP_NORMAL_ENTRY_POINTS must not be defined
+#endif
+
static _glapi_proc DISPATCH_TABLE_NAME[] = {"""
for f in api.functionIterateByOffset():
print ' TABLE_ENTRY(%s),' % (f.dispatch_name())
@@ -198,33 +206,88 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = {"""
#ifdef UNUSED_TABLE_NAME
static _glapi_proc UNUSED_TABLE_NAME[] = {"""
+ normal_entries = []
+ proto_entries = []
for f in api.functionIterateByOffset():
- for n in f.entry_points:
- if n != f.name:
- if f.is_static_entry_point(n):
- text = ' TABLE_ENTRY(%s),' % (n)
-
- if f.has_different_protocol(n):
- print '#ifndef GLX_INDIRECT_RENDERING'
- print text
- print '#endif'
- else:
- print text
+ normal_ents, proto_ents = self.classifyEntryPoints(f)
+
+ # exclude f.name
+ if f.name in normal_ents:
+ normal_ents.remove(f.name)
+ elif f.name in proto_ents:
+ proto_ents.remove(f.name)
+
+ normal_ents = [f.static_name(ent) for ent in normal_ents]
+ proto_ents = [f.static_name(ent) for ent in proto_ents]
+
+ normal_entries.extend(normal_ents)
+ proto_entries.extend(proto_ents)
+
+ print '#ifndef _GLAPI_SKIP_NORMAL_ENTRY_POINTS'
+ for ent in normal_entries:
+ print ' TABLE_ENTRY(%s),' % (ent)
+ print '#endif /* _GLAPI_SKIP_NORMAL_ENTRY_POINTS */'
+ print '#ifndef _GLAPI_SKIP_PROTO_ENTRY_POINTS'
+ for ent in proto_entries:
+ print ' TABLE_ENTRY(%s),' % (ent)
+ print '#endif /* _GLAPI_SKIP_PROTO_ENTRY_POINTS */'
+
print '};'
print '#endif /*UNUSED_TABLE_NAME*/'
print ''
return
+ def classifyEntryPoints(self, func):
+ normal_names = []
+ normal_stubs = []
+ proto_names = []
+ proto_stubs = []
+ # classify the entry points
+ for name in func.entry_points:
+ if func.has_different_protocol(name):
+ if func.is_static_entry_point(name):
+ proto_names.append(name)
+ else:
+ proto_stubs.append(name)
+ else:
+ if func.is_static_entry_point(name):
+ normal_names.append(name)
+ else:
+ normal_stubs.append(name)
+ # there can be at most one stub for a function
+ if normal_stubs:
+ normal_names.append(normal_stubs[0])
+ elif proto_stubs:
+ proto_names.append(proto_stubs[0])
+
+ return (normal_names, proto_names)
+
def printBody(self, api):
+ normal_entry_points = []
+ proto_entry_points = []
for func in api.functionIterateByOffset():
- got_stub = 0
- for n in func.entry_points:
- if func.is_static_entry_point(n):
- self.printFunction(func, n)
- elif not got_stub:
- self.printFunction(func, n)
- got_stub = 1
+ normal_ents, proto_ents = self.classifyEntryPoints(func)
+ normal_entry_points.append((func, normal_ents))
+ proto_entry_points.append((func, proto_ents))
+
+ print '#ifndef _GLAPI_SKIP_NORMAL_ENTRY_POINTS'
+ print ''
+ for func, ents in normal_entry_points:
+ for ent in ents:
+ self.printFunction(func, ent)
+ print ''
+ print '#endif /* _GLAPI_SKIP_NORMAL_ENTRY_POINTS */'
+ print ''
+ print '/* these entry points might require different protocols */'
+ print '#ifndef _GLAPI_SKIP_PROTO_ENTRY_POINTS'
+ print ''
+ for func, ents in proto_entry_points:
+ for ent in ents:
+ self.printFunction(func, ent)
+ print ''
+ print '#endif /* _GLAPI_SKIP_PROTO_ENTRY_POINTS */'
+ print ''
self.printInitDispatch(api)
self.printAliasedTable(api)
@@ -232,22 +295,26 @@ static _glapi_proc UNUSED_TABLE_NAME[] = {"""
def show_usage():
- print "Usage: %s [-f input_file_name]" % sys.argv[0]
+ print "Usage: %s [-f input_file_name] [-c]" % sys.argv[0]
+ print "-c Enable compatibility with OpenGL ES."
sys.exit(1)
if __name__ == '__main__':
file_name = "gl_API.xml"
try:
- (args, trail) = getopt.getopt(sys.argv[1:], "f:")
+ (args, trail) = getopt.getopt(sys.argv[1:], "f:c")
except Exception,e:
show_usage()
+ es = False
for (arg,val) in args:
if arg == "-f":
file_name = val
+ elif arg == "-c":
+ es = True
api = gl_XML.parse_GL_API(file_name, glX_XML.glx_item_factory())
- printer = PrintGlOffsets()
+ printer = PrintGlOffsets(es)
printer.Print(api)
diff --git a/src/mesa/glapi/gl_enums.py b/src/mesa/glapi/gl_enums.py
index 27ab119537..acaa06ab37 100644
--- a/src/mesa/glapi/gl_enums.py
+++ b/src/mesa/glapi/gl_enums.py
@@ -42,10 +42,10 @@ class PrintGlEnums(gl_XML.gl_print_base):
def printRealHeader(self):
- print '#include "glheader.h"'
- print '#include "mfeatures.h"'
- print '#include "enums.h"'
- print '#include "imports.h"'
+ print '#include "main/glheader.h"'
+ print '#include "main/mfeatures.h"'
+ print '#include "main/enums.h"'
+ print '#include "main/imports.h"'
print ''
print 'typedef struct {'
print ' size_t offset;'
diff --git a/src/mesa/glapi/gl_offsets.py b/src/mesa/glapi/gl_offsets.py
index ca6c90ffd8..54867b3463 100644
--- a/src/mesa/glapi/gl_offsets.py
+++ b/src/mesa/glapi/gl_offsets.py
@@ -30,9 +30,10 @@ import license
import sys, getopt
class PrintGlOffsets(gl_XML.gl_print_base):
- def __init__(self):
+ def __init__(self, es=False):
gl_XML.gl_print_base.__init__(self)
+ self.es = es
self.name = "gl_offsets.py (from Mesa)"
self.header_tag = '_GLAPI_OFFSETS_H_'
self.license = license.bsd_license_template % ( \
@@ -41,22 +42,24 @@ class PrintGlOffsets(gl_XML.gl_print_base):
return
def printBody(self, api):
- abi = [ "1.0", "1.1", "1.2", "GL_ARB_multitexture" ]
-
print '/* this file should not be included directly in mesa */'
print ''
functions = []
abi_functions = []
+ alias_functions = []
count = 0
for f in api.functionIterateByOffset():
- [category, num] = api.get_category_for_name( f.name )
- if category not in abi:
+ if not f.is_abi():
functions.append( [f, count] )
count += 1
else:
abi_functions.append( f )
+ if self.es:
+ # remember functions with aliases
+ if len(f.entry_points) > 1:
+ alias_functions.append(f)
for f in abi_functions:
print '#define _gloffset_%s %d' % (f.name, f.offset)
@@ -81,26 +84,37 @@ class PrintGlOffsets(gl_XML.gl_print_base):
print ''
print '#endif /* !defined(_GLAPI_USE_REMAP_TABLE) */'
+ if alias_functions:
+ print ''
+ print '/* define aliases for compatibility */'
+ for f in alias_functions:
+ for name in f.entry_points:
+ if name != f.name:
+ print '#define _gloffset_%s _gloffset_%s' % (name, f.name)
return
def show_usage():
- print "Usage: %s [-f input_file_name]" % sys.argv[0]
+ print "Usage: %s [-f input_file_name] [-c]" % sys.argv[0]
+ print " -c Enable compatibility with OpenGL ES."
sys.exit(1)
if __name__ == '__main__':
file_name = "gl_API.xml"
try:
- (args, trail) = getopt.getopt(sys.argv[1:], "f:")
+ (args, trail) = getopt.getopt(sys.argv[1:], "f:c")
except Exception,e:
show_usage()
+ es = False
for (arg,val) in args:
if arg == "-f":
file_name = val
+ elif arg == "-c":
+ es = True
api = gl_XML.parse_GL_API( file_name )
- printer = PrintGlOffsets()
+ printer = PrintGlOffsets(es)
printer.Print( api )
diff --git a/src/mesa/glapi/gl_procs.py b/src/mesa/glapi/gl_procs.py
index cd1a68cee1..5de61fbdfe 100644
--- a/src/mesa/glapi/gl_procs.py
+++ b/src/mesa/glapi/gl_procs.py
@@ -30,9 +30,10 @@ import gl_XML, glX_XML
import sys, getopt
class PrintGlProcs(gl_XML.gl_print_base):
- def __init__(self, long_strings):
+ def __init__(self, long_strings, es=False):
gl_XML.gl_print_base.__init__(self)
+ self.es = es
self.long_strings = long_strings
self.name = "gl_procs.py (from Mesa)"
self.license = license.bsd_license_template % ( \
@@ -141,6 +142,28 @@ typedef struct {
print '%s GLAPIENTRY gl_dispatch_stub_%u(%s);' % (func.return_type, func.offset, func.get_parameter_string())
break
+ if self.es:
+ categories = {}
+ for func in api.functionIterateByOffset():
+ for n in func.entry_points:
+ cat, num = api.get_category_for_name(n)
+ if (cat.startswith("es") or cat.startswith("GL_OES")):
+ if not categories.has_key(cat):
+ categories[cat] = []
+ proto = 'GLAPI %s GLAPIENTRY %s(%s);' \
+ % (func.return_type, "gl" + n, func.get_parameter_string(n))
+ categories[cat].append(proto)
+ if categories:
+ print ''
+ print '/* OpenGL ES specific prototypes */'
+ print ''
+ keys = categories.keys()
+ keys.sort()
+ for key in keys:
+ print '/* category %s */' % key
+ print "\n".join(categories[key])
+ print ''
+
print '#endif /* defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING) */'
print ''
@@ -155,8 +178,9 @@ typedef struct {
def show_usage():
- print "Usage: %s [-f input_file_name] [-m mode]" % sys.argv[0]
- print "mode can be one of:"
+ print "Usage: %s [-f input_file_name] [-m mode] [-c]" % sys.argv[0]
+ print "-c Enable compatibility with OpenGL ES."
+ print "-m mode mode can be one of:"
print " long - Create code for compilers that can handle very"
print " long string constants. (default)"
print " short - Create code for compilers that can only handle"
@@ -167,11 +191,12 @@ if __name__ == '__main__':
file_name = "gl_API.xml"
try:
- (args, trail) = getopt.getopt(sys.argv[1:], "f:m:")
+ (args, trail) = getopt.getopt(sys.argv[1:], "f:m:c")
except Exception,e:
show_usage()
long_string = 1
+ es = False
for (arg,val) in args:
if arg == "-f":
file_name = val
@@ -182,7 +207,9 @@ if __name__ == '__main__':
long_string = 1
else:
show_usage()
+ elif arg == "-c":
+ es = True
api = gl_XML.parse_GL_API(file_name, glX_XML.glx_item_factory())
- printer = PrintGlProcs(long_string)
+ printer = PrintGlProcs(long_string, es)
printer.Print(api)
diff --git a/src/mesa/glapi/gl_table.py b/src/mesa/glapi/gl_table.py
index 0e05b3431a..3bd7569e92 100644
--- a/src/mesa/glapi/gl_table.py
+++ b/src/mesa/glapi/gl_table.py
@@ -30,9 +30,10 @@ import license
import sys, getopt
class PrintGlTable(gl_XML.gl_print_base):
- def __init__(self):
+ def __init__(self, es=False):
gl_XML.gl_print_base.__init__(self)
+ self.es = es
self.header_tag = '_GLAPI_TABLE_H_'
self.name = "gl_table.py (from Mesa)"
self.license = license.bsd_license_template % ( \
@@ -68,9 +69,10 @@ class PrintGlTable(gl_XML.gl_print_base):
class PrintRemapTable(gl_XML.gl_print_base):
- def __init__(self):
+ def __init__(self, es=False):
gl_XML.gl_print_base.__init__(self)
+ self.es = es
self.header_tag = '_GLAPI_DISPATCH_H_'
self.name = "gl_table.py (from Mesa)"
self.license = license.bsd_license_template % ("(C) Copyright IBM Corporation 2005", "IBM")
@@ -113,19 +115,22 @@ class PrintRemapTable(gl_XML.gl_print_base):
print ' } while(0)'
print ''
- abi = [ "1.0", "1.1", "1.2", "GL_ARB_multitexture" ]
-
functions = []
abi_functions = []
+ alias_functions = []
count = 0
for f in api.functionIterateByOffset():
- [category, num] = api.get_category_for_name( f.name )
- if category not in abi:
+ if not f.is_abi():
functions.append( [f, count] )
count += 1
else:
abi_functions.append( f )
+ if self.es:
+ # remember functions with aliases
+ if len(f.entry_points) > 1:
+ alias_functions.append(f)
+
for f in abi_functions:
print '#define CALL_%s(disp, parameters) (*((disp)->%s)) parameters' % (f.name, f.name)
@@ -165,33 +170,57 @@ class PrintRemapTable(gl_XML.gl_print_base):
print ''
print '#endif /* !defined(_GLAPI_USE_REMAP_TABLE) */'
+
+ if alias_functions:
+ print ''
+ print '/* define aliases for compatibility */'
+ for f in alias_functions:
+ for name in f.entry_points:
+ if name != f.name:
+ print '#define CALL_%s(disp, parameters) CALL_%s(disp, parameters)' % (name, f.name)
+ print '#define GET_%s(disp) GET_%s(disp)' % (name, f.name)
+ print '#define SET_%s(disp, fn) SET_%s(disp, fn)' % (name, f.name)
+ print ''
+
+ print '#if defined(_GLAPI_USE_REMAP_TABLE)'
+ for f in alias_functions:
+ for name in f.entry_points:
+ if name != f.name:
+ print '#define %s_remap_index %s_remap_index' % (name, f.name)
+ print '#endif /* defined(_GLAPI_USE_REMAP_TABLE) */'
+ print ''
+
return
def show_usage():
- print "Usage: %s [-f input_file_name] [-m mode]" % sys.argv[0]
+ print "Usage: %s [-f input_file_name] [-m mode] [-c]" % sys.argv[0]
print " -m mode Mode can be 'table' or 'remap_table'."
+ print " -c Enable compatibility with OpenGL ES."
sys.exit(1)
if __name__ == '__main__':
file_name = "gl_API.xml"
try:
- (args, trail) = getopt.getopt(sys.argv[1:], "f:m:")
+ (args, trail) = getopt.getopt(sys.argv[1:], "f:m:c")
except Exception,e:
show_usage()
mode = "table"
+ es = False
for (arg,val) in args:
if arg == "-f":
file_name = val
elif arg == "-m":
mode = val
+ elif arg == "-c":
+ es = True
if mode == "table":
- printer = PrintGlTable()
+ printer = PrintGlTable(es)
elif mode == "remap_table":
- printer = PrintRemapTable()
+ printer = PrintRemapTable(es)
else:
show_usage()
diff --git a/src/mesa/glapi/gl_x86-64_asm.py b/src/mesa/glapi/gl_x86-64_asm.py
index f36ad3a5d8..31c1a2b93a 100644
--- a/src/mesa/glapi/gl_x86-64_asm.py
+++ b/src/mesa/glapi/gl_x86-64_asm.py
@@ -122,7 +122,7 @@ class PrintGenericStubs(gl_XML.gl_print_base):
print " * the symbol visibility mode to 'default'."
print ' */'
print ''
- print '#include "../x86/assyntax.h"'
+ print '#include "x86/assyntax.h"'
print ''
print '#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303'
print '# pragma GCC visibility push(default)'
diff --git a/src/mesa/glapi/gl_x86_asm.py b/src/mesa/glapi/gl_x86_asm.py
index 36f0e31fe2..d293497736 100644
--- a/src/mesa/glapi/gl_x86_asm.py
+++ b/src/mesa/glapi/gl_x86_asm.py
@@ -53,7 +53,7 @@ class PrintGenericStubs(gl_XML.gl_print_base):
def printRealHeader(self):
- print '#include "assyntax.h"'
+ print '#include "x86/assyntax.h"'
print '#include "glapi/glapioffsets.h"'
print ''
print '#if defined(STDCALL_API)'
diff --git a/src/mesa/glapi/glapi.c b/src/mesa/glapi/glapi.c
index 84e5a8270a..adb47f9fec 100644
--- a/src/mesa/glapi/glapi.c
+++ b/src/mesa/glapi/glapi.c
@@ -69,9 +69,9 @@
#include <assert.h>
#endif
-#include "glapi.h"
-#include "glapioffsets.h"
-#include "glapitable.h"
+#include "glapi/glapi.h"
+#include "glapi/glapioffsets.h"
+#include "glapi/glapitable.h"
/***** BEGIN NO-OP DISPATCH *****/
@@ -148,7 +148,7 @@ static GLint NoOpUnused(void)
return warn("extension function");
}
-#include "glapitemp.h"
+#include "glapi/glapitemp.h"
/***** END NO-OP DISPATCH *****/
diff --git a/src/mesa/glapi/glapi_getproc.c b/src/mesa/glapi/glapi_getproc.c
index 1401c1cb58..eecfb9c1ae 100644
--- a/src/mesa/glapi/glapi_getproc.c
+++ b/src/mesa/glapi/glapi_getproc.c
@@ -34,9 +34,9 @@
#include <string.h>
#include "main/glheader.h"
#include "main/compiler.h"
-#include "glapi.h"
-#include "glapioffsets.h"
-#include "glapitable.h"
+#include "glapi/glapi.h"
+#include "glapi/glapioffsets.h"
+#include "glapi/glapitable.h"
static void
@@ -75,7 +75,7 @@ str_dup(const char *str)
#endif
/* The code in this file is auto-generated with Python */
-#include "glprocs.h"
+#include "glapi/glprocs.h"
/**
diff --git a/src/mesa/glapi/glapitemp.h b/src/mesa/glapi/glapitemp.h
index 96b2ac7268..6767a07673 100644
--- a/src/mesa/glapi/glapitemp.h
+++ b/src/mesa/glapi/glapitemp.h
@@ -80,6 +80,8 @@
#endif
+#ifndef _GLAPI_SKIP_NORMAL_ENTRY_POINTS
+
KEYWORD1 void KEYWORD2 NAME(NewList)(GLuint list, GLenum mode)
{
DISPATCH(NewList, (list, mode), (F, "glNewList(%d, 0x%x);\n", list, mode));
@@ -1710,13 +1712,6 @@ KEYWORD1 GLboolean KEYWORD2 NAME(AreTexturesResident)(GLsizei n, const GLuint *
RETURN_DISPATCH(AreTexturesResident, (n, textures, residences), (F, "glAreTexturesResident(%d, %p, %p);\n", n, (const void *) textures, (const void *) residences));
}
-#ifndef GLX_INDIRECT_RENDERING
-KEYWORD1 GLboolean KEYWORD2 NAME(AreTexturesResidentEXT)(GLsizei n, const GLuint * textures, GLboolean * residences)
-{
- RETURN_DISPATCH(AreTexturesResident, (n, textures, residences), (F, "glAreTexturesResidentEXT(%d, %p, %p);\n", n, (const void *) textures, (const void *) residences));
-}
-#endif /* GLX_INDIRECT_RENDERING */
-
KEYWORD1 void KEYWORD2 NAME(CopyTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border)
{
DISPATCH(CopyTexImage1D, (target, level, internalformat, x, y, width, border), (F, "glCopyTexImage1D(0x%x, %d, 0x%x, %d, %d, %d, %d);\n", target, level, internalformat, x, y, width, border));
@@ -1762,25 +1757,11 @@ KEYWORD1 void KEYWORD2 NAME(DeleteTextures)(GLsizei n, const GLuint * textures)
DISPATCH(DeleteTextures, (n, textures), (F, "glDeleteTextures(%d, %p);\n", n, (const void *) textures));
}
-#ifndef GLX_INDIRECT_RENDERING
-KEYWORD1 void KEYWORD2 NAME(DeleteTexturesEXT)(GLsizei n, const GLuint * textures)
-{
- DISPATCH(DeleteTextures, (n, textures), (F, "glDeleteTexturesEXT(%d, %p);\n", n, (const void *) textures));
-}
-#endif /* GLX_INDIRECT_RENDERING */
-
KEYWORD1 void KEYWORD2 NAME(GenTextures)(GLsizei n, GLuint * textures)
{
DISPATCH(GenTextures, (n, textures), (F, "glGenTextures(%d, %p);\n", n, (const void *) textures));
}
-#ifndef GLX_INDIRECT_RENDERING
-KEYWORD1 void KEYWORD2 NAME(GenTexturesEXT)(GLsizei n, GLuint * textures)
-{
- DISPATCH(GenTextures, (n, textures), (F, "glGenTexturesEXT(%d, %p);\n", n, (const void *) textures));
-}
-#endif /* GLX_INDIRECT_RENDERING */
-
KEYWORD1 void KEYWORD2 NAME(GetPointerv)(GLenum pname, GLvoid ** params)
{
DISPATCH(GetPointerv, (pname, params), (F, "glGetPointerv(0x%x, %p);\n", pname, (const void *) params));
@@ -1796,13 +1777,6 @@ KEYWORD1 GLboolean KEYWORD2 NAME(IsTexture)(GLuint texture)
RETURN_DISPATCH(IsTexture, (texture), (F, "glIsTexture(%d);\n", texture));
}
-#ifndef GLX_INDIRECT_RENDERING
-KEYWORD1 GLboolean KEYWORD2 NAME(IsTextureEXT)(GLuint texture)
-{
- RETURN_DISPATCH(IsTexture, (texture), (F, "glIsTextureEXT(%d);\n", texture));
-}
-#endif /* GLX_INDIRECT_RENDERING */
-
KEYWORD1 void KEYWORD2 NAME(PrioritizeTextures)(GLsizei n, const GLuint * textures, const GLclampf * priorities)
{
DISPATCH(PrioritizeTextures, (n, textures, priorities), (F, "glPrioritizeTextures(%d, %p, %p);\n", n, (const void *) textures, (const void *) priorities));
@@ -1878,6 +1852,11 @@ KEYWORD1 void KEYWORD2 NAME(ColorTable)(GLenum target, GLenum internalformat, GL
DISPATCH(ColorTable, (target, internalformat, width, format, type, table), (F, "glColorTable(0x%x, 0x%x, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, format, type, (const void *) table));
}
+KEYWORD1 void KEYWORD2 NAME(ColorTableEXT)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table)
+{
+ DISPATCH(ColorTable, (target, internalformat, width, format, type, table), (F, "glColorTableEXT(0x%x, 0x%x, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, format, type, (const void *) table));
+}
+
KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_339)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table);
KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_339)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table)
@@ -1885,11 +1864,6 @@ KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_339)(GLenum target, GLenum intern
DISPATCH(ColorTable, (target, internalformat, width, format, type, table), (F, "glColorTableSGI(0x%x, 0x%x, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, format, type, (const void *) table));
}
-KEYWORD1 void KEYWORD2 NAME(ColorTableEXT)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table)
-{
- DISPATCH(ColorTable, (target, internalformat, width, format, type, table), (F, "glColorTableEXT(0x%x, 0x%x, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, format, type, (const void *) table));
-}
-
KEYWORD1 void KEYWORD2 NAME(ColorTableParameterfv)(GLenum target, GLenum pname, const GLfloat * params)
{
DISPATCH(ColorTableParameterfv, (target, pname, params), (F, "glColorTableParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
@@ -1931,64 +1905,16 @@ KEYWORD1 void KEYWORD2 NAME(GetColorTable)(GLenum target, GLenum format, GLenum
DISPATCH(GetColorTable, (target, format, type, table), (F, "glGetColorTable(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) table));
}
-#ifndef GLX_INDIRECT_RENDERING
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_343)(GLenum target, GLenum format, GLenum type, GLvoid * table);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_343)(GLenum target, GLenum format, GLenum type, GLvoid * table)
-{
- DISPATCH(GetColorTable, (target, format, type, table), (F, "glGetColorTableSGI(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) table));
-}
-#endif /* GLX_INDIRECT_RENDERING */
-
-#ifndef GLX_INDIRECT_RENDERING
-KEYWORD1 void KEYWORD2 NAME(GetColorTableEXT)(GLenum target, GLenum format, GLenum type, GLvoid * table)
-{
- DISPATCH(GetColorTable, (target, format, type, table), (F, "glGetColorTableEXT(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) table));
-}
-#endif /* GLX_INDIRECT_RENDERING */
-
KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterfv)(GLenum target, GLenum pname, GLfloat * params)
{
DISPATCH(GetColorTableParameterfv, (target, pname, params), (F, "glGetColorTableParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
}
-#ifndef GLX_INDIRECT_RENDERING
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_344)(GLenum target, GLenum pname, GLfloat * params);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_344)(GLenum target, GLenum pname, GLfloat * params)
-{
- DISPATCH(GetColorTableParameterfv, (target, pname, params), (F, "glGetColorTableParameterfvSGI(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-#endif /* GLX_INDIRECT_RENDERING */
-
-#ifndef GLX_INDIRECT_RENDERING
-KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterfvEXT)(GLenum target, GLenum pname, GLfloat * params)
-{
- DISPATCH(GetColorTableParameterfv, (target, pname, params), (F, "glGetColorTableParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-#endif /* GLX_INDIRECT_RENDERING */
-
KEYWORD1 void KEYWORD2 NAME(GetColorTableParameteriv)(GLenum target, GLenum pname, GLint * params)
{
DISPATCH(GetColorTableParameteriv, (target, pname, params), (F, "glGetColorTableParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
}
-#ifndef GLX_INDIRECT_RENDERING
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_345)(GLenum target, GLenum pname, GLint * params);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_345)(GLenum target, GLenum pname, GLint * params)
-{
- DISPATCH(GetColorTableParameteriv, (target, pname, params), (F, "glGetColorTableParameterivSGI(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-#endif /* GLX_INDIRECT_RENDERING */
-
-#ifndef GLX_INDIRECT_RENDERING
-KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterivEXT)(GLenum target, GLenum pname, GLint * params)
-{
- DISPATCH(GetColorTableParameteriv, (target, pname, params), (F, "glGetColorTableParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-#endif /* GLX_INDIRECT_RENDERING */
-
KEYWORD1 void KEYWORD2 NAME(ColorSubTable)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data)
{
DISPATCH(ColorSubTable, (target, start, count, format, type, data), (F, "glColorSubTable(0x%x, %d, %d, 0x%x, 0x%x, %p);\n", target, start, count, format, type, (const void *) data));
@@ -2114,57 +2040,21 @@ KEYWORD1 void KEYWORD2 NAME(GetConvolutionFilter)(GLenum target, GLenum format,
DISPATCH(GetConvolutionFilter, (target, format, type, image), (F, "glGetConvolutionFilter(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) image));
}
-#ifndef GLX_INDIRECT_RENDERING
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_356)(GLenum target, GLenum format, GLenum type, GLvoid * image);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_356)(GLenum target, GLenum format, GLenum type, GLvoid * image)
-{
- DISPATCH(GetConvolutionFilter, (target, format, type, image), (F, "glGetConvolutionFilterEXT(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) image));
-}
-#endif /* GLX_INDIRECT_RENDERING */
-
KEYWORD1 void KEYWORD2 NAME(GetConvolutionParameterfv)(GLenum target, GLenum pname, GLfloat * params)
{
DISPATCH(GetConvolutionParameterfv, (target, pname, params), (F, "glGetConvolutionParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
}
-#ifndef GLX_INDIRECT_RENDERING
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_357)(GLenum target, GLenum pname, GLfloat * params);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_357)(GLenum target, GLenum pname, GLfloat * params)
-{
- DISPATCH(GetConvolutionParameterfv, (target, pname, params), (F, "glGetConvolutionParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-#endif /* GLX_INDIRECT_RENDERING */
-
KEYWORD1 void KEYWORD2 NAME(GetConvolutionParameteriv)(GLenum target, GLenum pname, GLint * params)
{
DISPATCH(GetConvolutionParameteriv, (target, pname, params), (F, "glGetConvolutionParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
}
-#ifndef GLX_INDIRECT_RENDERING
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_358)(GLenum target, GLenum pname, GLint * params);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_358)(GLenum target, GLenum pname, GLint * params)
-{
- DISPATCH(GetConvolutionParameteriv, (target, pname, params), (F, "glGetConvolutionParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-#endif /* GLX_INDIRECT_RENDERING */
-
KEYWORD1 void KEYWORD2 NAME(GetSeparableFilter)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span)
{
DISPATCH(GetSeparableFilter, (target, format, type, row, column, span), (F, "glGetSeparableFilter(0x%x, 0x%x, 0x%x, %p, %p, %p);\n", target, format, type, (const void *) row, (const void *) column, (const void *) span));
}
-#ifndef GLX_INDIRECT_RENDERING
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_359)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_359)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span)
-{
- DISPATCH(GetSeparableFilter, (target, format, type, row, column, span), (F, "glGetSeparableFilterEXT(0x%x, 0x%x, 0x%x, %p, %p, %p);\n", target, format, type, (const void *) row, (const void *) column, (const void *) span));
-}
-#endif /* GLX_INDIRECT_RENDERING */
-
KEYWORD1 void KEYWORD2 NAME(SeparableFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column)
{
DISPATCH(SeparableFilter2D, (target, internalformat, width, height, format, type, row, column), (F, "glSeparableFilter2D(0x%x, 0x%x, %d, %d, 0x%x, 0x%x, %p, %p);\n", target, internalformat, width, height, format, type, (const void *) row, (const void *) column));
@@ -2182,85 +2072,31 @@ KEYWORD1 void KEYWORD2 NAME(GetHistogram)(GLenum target, GLboolean reset, GLenum
DISPATCH(GetHistogram, (target, reset, format, type, values), (F, "glGetHistogram(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values));
}
-#ifndef GLX_INDIRECT_RENDERING
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_361)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_361)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values)
-{
- DISPATCH(GetHistogram, (target, reset, format, type, values), (F, "glGetHistogramEXT(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values));
-}
-#endif /* GLX_INDIRECT_RENDERING */
-
KEYWORD1 void KEYWORD2 NAME(GetHistogramParameterfv)(GLenum target, GLenum pname, GLfloat * params)
{
DISPATCH(GetHistogramParameterfv, (target, pname, params), (F, "glGetHistogramParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
}
-#ifndef GLX_INDIRECT_RENDERING
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_362)(GLenum target, GLenum pname, GLfloat * params);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_362)(GLenum target, GLenum pname, GLfloat * params)
-{
- DISPATCH(GetHistogramParameterfv, (target, pname, params), (F, "glGetHistogramParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-#endif /* GLX_INDIRECT_RENDERING */
-
KEYWORD1 void KEYWORD2 NAME(GetHistogramParameteriv)(GLenum target, GLenum pname, GLint * params)
{
DISPATCH(GetHistogramParameteriv, (target, pname, params), (F, "glGetHistogramParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
}
-#ifndef GLX_INDIRECT_RENDERING
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_363)(GLenum target, GLenum pname, GLint * params);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_363)(GLenum target, GLenum pname, GLint * params)
-{
- DISPATCH(GetHistogramParameteriv, (target, pname, params), (F, "glGetHistogramParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-#endif /* GLX_INDIRECT_RENDERING */
-
KEYWORD1 void KEYWORD2 NAME(GetMinmax)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values)
{
DISPATCH(GetMinmax, (target, reset, format, type, values), (F, "glGetMinmax(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values));
}
-#ifndef GLX_INDIRECT_RENDERING
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_364)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_364)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values)
-{
- DISPATCH(GetMinmax, (target, reset, format, type, values), (F, "glGetMinmaxEXT(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values));
-}
-#endif /* GLX_INDIRECT_RENDERING */
-
KEYWORD1 void KEYWORD2 NAME(GetMinmaxParameterfv)(GLenum target, GLenum pname, GLfloat * params)
{
DISPATCH(GetMinmaxParameterfv, (target, pname, params), (F, "glGetMinmaxParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
}
-#ifndef GLX_INDIRECT_RENDERING
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_365)(GLenum target, GLenum pname, GLfloat * params);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_365)(GLenum target, GLenum pname, GLfloat * params)
-{
- DISPATCH(GetMinmaxParameterfv, (target, pname, params), (F, "glGetMinmaxParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-#endif /* GLX_INDIRECT_RENDERING */
-
KEYWORD1 void KEYWORD2 NAME(GetMinmaxParameteriv)(GLenum target, GLenum pname, GLint * params)
{
DISPATCH(GetMinmaxParameteriv, (target, pname, params), (F, "glGetMinmaxParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
}
-#ifndef GLX_INDIRECT_RENDERING
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_366)(GLenum target, GLenum pname, GLint * params);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_366)(GLenum target, GLenum pname, GLint * params)
-{
- DISPATCH(GetMinmaxParameteriv, (target, pname, params), (F, "glGetMinmaxParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-#endif /* GLX_INDIRECT_RENDERING */
-
KEYWORD1 void KEYWORD2 NAME(Histogram)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink)
{
DISPATCH(Histogram, (target, width, internalformat, sink), (F, "glHistogram(0x%x, %d, 0x%x, %d);\n", target, width, internalformat, sink));
@@ -5777,6 +5613,141 @@ KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_802)(GLuint id, GLenum pname, GLu
}
+#endif /* _GLAPI_SKIP_NORMAL_ENTRY_POINTS */
+
+/* these entry points might require different protocols */
+#ifndef _GLAPI_SKIP_PROTO_ENTRY_POINTS
+
+KEYWORD1 GLboolean KEYWORD2 NAME(AreTexturesResidentEXT)(GLsizei n, const GLuint * textures, GLboolean * residences)
+{
+ RETURN_DISPATCH(AreTexturesResident, (n, textures, residences), (F, "glAreTexturesResidentEXT(%d, %p, %p);\n", n, (const void *) textures, (const void *) residences));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DeleteTexturesEXT)(GLsizei n, const GLuint * textures)
+{
+ DISPATCH(DeleteTextures, (n, textures), (F, "glDeleteTexturesEXT(%d, %p);\n", n, (const void *) textures));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GenTexturesEXT)(GLsizei n, GLuint * textures)
+{
+ DISPATCH(GenTextures, (n, textures), (F, "glGenTexturesEXT(%d, %p);\n", n, (const void *) textures));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(IsTextureEXT)(GLuint texture)
+{
+ RETURN_DISPATCH(IsTexture, (texture), (F, "glIsTextureEXT(%d);\n", texture));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetColorTableEXT)(GLenum target, GLenum format, GLenum type, GLvoid * table)
+{
+ DISPATCH(GetColorTable, (target, format, type, table), (F, "glGetColorTableEXT(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) table));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_343)(GLenum target, GLenum format, GLenum type, GLvoid * table);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_343)(GLenum target, GLenum format, GLenum type, GLvoid * table)
+{
+ DISPATCH(GetColorTable, (target, format, type, table), (F, "glGetColorTableSGI(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) table));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterfvEXT)(GLenum target, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetColorTableParameterfv, (target, pname, params), (F, "glGetColorTableParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_344)(GLenum target, GLenum pname, GLfloat * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_344)(GLenum target, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetColorTableParameterfv, (target, pname, params), (F, "glGetColorTableParameterfvSGI(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterivEXT)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetColorTableParameteriv, (target, pname, params), (F, "glGetColorTableParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_345)(GLenum target, GLenum pname, GLint * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_345)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetColorTableParameteriv, (target, pname, params), (F, "glGetColorTableParameterivSGI(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_356)(GLenum target, GLenum format, GLenum type, GLvoid * image);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_356)(GLenum target, GLenum format, GLenum type, GLvoid * image)
+{
+ DISPATCH(GetConvolutionFilter, (target, format, type, image), (F, "glGetConvolutionFilterEXT(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) image));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_357)(GLenum target, GLenum pname, GLfloat * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_357)(GLenum target, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetConvolutionParameterfv, (target, pname, params), (F, "glGetConvolutionParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_358)(GLenum target, GLenum pname, GLint * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_358)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetConvolutionParameteriv, (target, pname, params), (F, "glGetConvolutionParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_359)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_359)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span)
+{
+ DISPATCH(GetSeparableFilter, (target, format, type, row, column, span), (F, "glGetSeparableFilterEXT(0x%x, 0x%x, 0x%x, %p, %p, %p);\n", target, format, type, (const void *) row, (const void *) column, (const void *) span));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_361)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_361)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values)
+{
+ DISPATCH(GetHistogram, (target, reset, format, type, values), (F, "glGetHistogramEXT(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_362)(GLenum target, GLenum pname, GLfloat * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_362)(GLenum target, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetHistogramParameterfv, (target, pname, params), (F, "glGetHistogramParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_363)(GLenum target, GLenum pname, GLint * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_363)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetHistogramParameteriv, (target, pname, params), (F, "glGetHistogramParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_364)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_364)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values)
+{
+ DISPATCH(GetMinmax, (target, reset, format, type, values), (F, "glGetMinmaxEXT(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_365)(GLenum target, GLenum pname, GLfloat * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_365)(GLenum target, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetMinmaxParameterfv, (target, pname, params), (F, "glGetMinmaxParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_366)(GLenum target, GLenum pname, GLint * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_366)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetMinmaxParameteriv, (target, pname, params), (F, "glGetMinmaxParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+
+#endif /* _GLAPI_SKIP_PROTO_ENTRY_POINTS */
+
+
#endif /* defined( NAME ) */
/*
@@ -5789,6 +5760,10 @@ KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_802)(GLuint id, GLenum pname, GLu
#error TABLE_ENTRY must be defined
#endif
+#ifdef _GLAPI_SKIP_NORMAL_ENTRY_POINTS
+#error _GLAPI_SKIP_NORMAL_ENTRY_POINTS must not be defined
+#endif
+
static _glapi_proc DISPATCH_TABLE_NAME[] = {
TABLE_ENTRY(NewList),
TABLE_ENTRY(EndList),
@@ -6706,26 +6681,15 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = {
*/
#ifdef UNUSED_TABLE_NAME
static _glapi_proc UNUSED_TABLE_NAME[] = {
+#ifndef _GLAPI_SKIP_NORMAL_ENTRY_POINTS
TABLE_ENTRY(ArrayElementEXT),
TABLE_ENTRY(BindTextureEXT),
TABLE_ENTRY(DrawArraysEXT),
-#ifndef GLX_INDIRECT_RENDERING
- TABLE_ENTRY(AreTexturesResidentEXT),
-#endif
TABLE_ENTRY(CopyTexImage1DEXT),
TABLE_ENTRY(CopyTexImage2DEXT),
TABLE_ENTRY(CopyTexSubImage1DEXT),
TABLE_ENTRY(CopyTexSubImage2DEXT),
-#ifndef GLX_INDIRECT_RENDERING
- TABLE_ENTRY(DeleteTexturesEXT),
-#endif
-#ifndef GLX_INDIRECT_RENDERING
- TABLE_ENTRY(GenTexturesEXT),
-#endif
TABLE_ENTRY(GetPointervEXT),
-#ifndef GLX_INDIRECT_RENDERING
- TABLE_ENTRY(IsTextureEXT),
-#endif
TABLE_ENTRY(PrioritizeTexturesEXT),
TABLE_ENTRY(TexSubImage1DEXT),
TABLE_ENTRY(TexSubImage2DEXT),
@@ -6733,15 +6697,25 @@ static _glapi_proc UNUSED_TABLE_NAME[] = {
TABLE_ENTRY(BlendEquationEXT),
TABLE_ENTRY(DrawRangeElementsEXT),
TABLE_ENTRY(ColorTableEXT),
-#ifndef GLX_INDIRECT_RENDERING
- TABLE_ENTRY(GetColorTableEXT),
-#endif
-#ifndef GLX_INDIRECT_RENDERING
- TABLE_ENTRY(GetColorTableParameterfvEXT),
-#endif
-#ifndef GLX_INDIRECT_RENDERING
- TABLE_ENTRY(GetColorTableParameterivEXT),
-#endif
+ TABLE_ENTRY(_dispatch_stub_339),
+ TABLE_ENTRY(_dispatch_stub_340),
+ TABLE_ENTRY(_dispatch_stub_341),
+ TABLE_ENTRY(_dispatch_stub_342),
+ TABLE_ENTRY(_dispatch_stub_346),
+ TABLE_ENTRY(_dispatch_stub_347),
+ TABLE_ENTRY(_dispatch_stub_348),
+ TABLE_ENTRY(_dispatch_stub_349),
+ TABLE_ENTRY(_dispatch_stub_350),
+ TABLE_ENTRY(_dispatch_stub_351),
+ TABLE_ENTRY(_dispatch_stub_352),
+ TABLE_ENTRY(_dispatch_stub_353),
+ TABLE_ENTRY(_dispatch_stub_354),
+ TABLE_ENTRY(_dispatch_stub_355),
+ TABLE_ENTRY(_dispatch_stub_360),
+ TABLE_ENTRY(_dispatch_stub_367),
+ TABLE_ENTRY(_dispatch_stub_368),
+ TABLE_ENTRY(_dispatch_stub_369),
+ TABLE_ENTRY(_dispatch_stub_370),
TABLE_ENTRY(TexImage3DEXT),
TABLE_ENTRY(TexSubImage3DEXT),
TABLE_ENTRY(CopyTexSubImage3DEXT),
@@ -6779,6 +6753,7 @@ static _glapi_proc UNUSED_TABLE_NAME[] = {
TABLE_ENTRY(MultiTexCoord4iv),
TABLE_ENTRY(MultiTexCoord4s),
TABLE_ENTRY(MultiTexCoord4sv),
+ TABLE_ENTRY(_dispatch_stub_423),
TABLE_ENTRY(LoadTransposeMatrixd),
TABLE_ENTRY(LoadTransposeMatrixf),
TABLE_ENTRY(MultTransposeMatrixd),
@@ -6893,8 +6868,10 @@ static _glapi_proc UNUSED_TABLE_NAME[] = {
TABLE_ENTRY(RenderbufferStorageMultisampleEXT),
TABLE_ENTRY(PointParameterf),
TABLE_ENTRY(PointParameterfARB),
+ TABLE_ENTRY(_dispatch_stub_592),
TABLE_ENTRY(PointParameterfv),
TABLE_ENTRY(PointParameterfvARB),
+ TABLE_ENTRY(_dispatch_stub_593),
TABLE_ENTRY(SecondaryColor3b),
TABLE_ENTRY(SecondaryColor3bv),
TABLE_ENTRY(SecondaryColor3d),
@@ -6920,6 +6897,7 @@ static _glapi_proc UNUSED_TABLE_NAME[] = {
TABLE_ENTRY(FogCoordf),
TABLE_ENTRY(FogCoordfv),
TABLE_ENTRY(BlendFuncSeparate),
+ TABLE_ENTRY(_dispatch_stub_623),
TABLE_ENTRY(WindowPos2d),
TABLE_ENTRY(WindowPos2dARB),
TABLE_ENTRY(WindowPos2dv),
@@ -6983,6 +6961,29 @@ static _glapi_proc UNUSED_TABLE_NAME[] = {
TABLE_ENTRY(BlitFramebuffer),
TABLE_ENTRY(FramebufferTextureLayer),
TABLE_ENTRY(ProvokingVertex),
+#endif /* _GLAPI_SKIP_NORMAL_ENTRY_POINTS */
+#ifndef _GLAPI_SKIP_PROTO_ENTRY_POINTS
+ TABLE_ENTRY(AreTexturesResidentEXT),
+ TABLE_ENTRY(DeleteTexturesEXT),
+ TABLE_ENTRY(GenTexturesEXT),
+ TABLE_ENTRY(IsTextureEXT),
+ TABLE_ENTRY(GetColorTableEXT),
+ TABLE_ENTRY(_dispatch_stub_343),
+ TABLE_ENTRY(GetColorTableParameterfvEXT),
+ TABLE_ENTRY(_dispatch_stub_344),
+ TABLE_ENTRY(GetColorTableParameterivEXT),
+ TABLE_ENTRY(_dispatch_stub_345),
+ TABLE_ENTRY(_dispatch_stub_356),
+ TABLE_ENTRY(_dispatch_stub_357),
+ TABLE_ENTRY(_dispatch_stub_358),
+ TABLE_ENTRY(_dispatch_stub_359),
+ TABLE_ENTRY(_dispatch_stub_361),
+ TABLE_ENTRY(_dispatch_stub_362),
+ TABLE_ENTRY(_dispatch_stub_363),
+ TABLE_ENTRY(_dispatch_stub_364),
+ TABLE_ENTRY(_dispatch_stub_365),
+ TABLE_ENTRY(_dispatch_stub_366),
+#endif /* _GLAPI_SKIP_PROTO_ENTRY_POINTS */
};
#endif /*UNUSED_TABLE_NAME*/
diff --git a/src/mesa/glapi/glthread.c b/src/mesa/glapi/glthread.c
index f480edff4e..1c2c386571 100644
--- a/src/mesa/glapi/glthread.c
+++ b/src/mesa/glapi/glthread.c
@@ -33,7 +33,7 @@
#endif
#include "main/compiler.h"
-#include "glthread.h"
+#include "glapi/glthread.h"
/*
diff --git a/src/mesa/glapi/remap_helper.py b/src/mesa/glapi/remap_helper.py
index e47583a5d3..d93c7a4285 100644
--- a/src/mesa/glapi/remap_helper.py
+++ b/src/mesa/glapi/remap_helper.py
@@ -123,18 +123,26 @@ class PrintGlRemap(gl_XML.gl_print_base):
print '};'
print ''
- abi = [ "1.0", "1.1", "1.2", "GL_ARB_multitexture" ]
+ # collect functions by versions/extensions
extension_functions = {}
-
- # collect non-ABI functions
+ abi_extensions = []
for f in api.functionIterateAll():
for n in f.entry_points:
category, num = api.get_category_for_name(n)
- if category not in abi:
- c = gl_XML.real_category_name(category)
+ # consider only GL_VERSION_X_Y or extensions
+ c = gl_XML.real_category_name(category)
+ if c.startswith("GL_"):
if not extension_functions.has_key(c):
extension_functions[c] = []
extension_functions[c].append(f)
+ # remember the ext names of the ABI
+ if (f.is_abi() and n == f.name and
+ c not in abi_extensions):
+ abi_extensions.append(c)
+ # ignore the ABI itself
+ for ext in abi_extensions:
+ extension_functions.pop(ext)
+
extensions = extension_functions.keys()
extensions.sort()
@@ -144,8 +152,8 @@ class PrintGlRemap(gl_XML.gl_print_base):
for ext in extensions:
funcs = []
for f in extension_functions[ext]:
- # test if the function is in the ABI
- if not f.assign_offset and f.offset >= 0:
+ # test if the function is in the ABI and has alt names
+ if f.is_abi() and len(f.entry_points) > 1:
funcs.append(f)
if not funcs:
continue
@@ -171,7 +179,7 @@ class PrintGlRemap(gl_XML.gl_print_base):
remapped.append(f)
else:
# these functions are either in the
- # abi, or have offset -1
+ # abi, or have offset -1
funcs.append(f)
print '#if defined(need_%s)' % (ext)
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index e99e87d905..6705c901dd 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -1021,6 +1021,16 @@ struct dd_function_table {
void (*BeginConditionalRender)(GLcontext *ctx, struct gl_query_object *q,
GLenum mode);
void (*EndConditionalRender)(GLcontext *ctx, struct gl_query_object *q);
+
+#if FEATURE_OES_draw_texture
+ /**
+ * \name GL_OES_draw_texture interface
+ */
+ /*@{*/
+ void (*DrawTex)(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z,
+ GLfloat width, GLfloat height);
+ /*@}*/
+#endif
};
diff --git a/src/mesa/main/dispatch.c b/src/mesa/main/dispatch.c
index eb0d1ff8a7..a6a57020cc 100644
--- a/src/mesa/main/dispatch.c
+++ b/src/mesa/main/dispatch.c
@@ -87,6 +87,10 @@
#define GLAPIENTRY
#endif
+#ifdef GLX_INDIRECT_RENDERING
+/* those link to libglapi.a should provide the entry points */
+#define _GLAPI_SKIP_PROTO_ENTRY_POINTS
+#endif
#include "glapi/glapitemp.h"
#endif /* USE_X86_ASM */
diff --git a/src/mesa/main/enums.c b/src/mesa/main/enums.c
index 2273138d23..aaf17aafdd 100644
--- a/src/mesa/main/enums.c
+++ b/src/mesa/main/enums.c
@@ -25,10 +25,10 @@
* SOFTWARE.
*/
-#include "glheader.h"
-#include "mfeatures.h"
-#include "enums.h"
-#include "imports.h"
+#include "main/glheader.h"
+#include "main/mfeatures.h"
+#include "main/enums.h"
+#include "main/imports.h"
typedef struct {
size_t offset;
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 5fc0b1cfde..00427aa580 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -189,6 +189,9 @@ static const struct {
{ ON, "GL_SGIS_texture_lod", F(SGIS_texture_lod) },
{ ON, "GL_SUN_multi_draw_arrays", F(EXT_multi_draw_arrays) },
{ OFF, "GL_S3_s3tc", F(S3_s3tc) },
+#if FEATURE_OES_draw_texture
+ { OFF, "GL_OES_draw_texture", F(OES_draw_texture) },
+#endif /* FEATURE_OES_draw_texture */
};
diff --git a/src/mesa/main/getstring.c b/src/mesa/main/getstring.c
index e76a790d0a..c203b046a5 100644
--- a/src/mesa/main/getstring.c
+++ b/src/mesa/main/getstring.c
@@ -191,6 +191,11 @@ _mesa_GetPointerv( GLenum pname, GLvoid **params )
case GL_SELECTION_BUFFER_POINTER:
*params = ctx->Select.Buffer;
break;
+#if FEATURE_point_size_array
+ case GL_POINT_SIZE_ARRAY_POINTER_OES:
+ *params = (GLvoid *) ctx->Array.ArrayObj->PointSize.Ptr;
+ break;
+#endif
default:
_mesa_error( ctx, GL_INVALID_ENUM, "glGetPointerv" );
return;
diff --git a/src/mesa/main/glheader.h b/src/mesa/main/glheader.h
index 81d4ccf919..77544c88c6 100644
--- a/src/mesa/main/glheader.h
+++ b/src/mesa/main/glheader.h
@@ -57,6 +57,13 @@
#ifndef GL_FIXED
#define GL_FIXED 0x140C
+typedef int GLfixed;
+typedef int GLclampx;
+#endif
+
+
+#ifndef GL_OES_EGL_image
+typedef void *GLeglImageOES;
#endif
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 5227565f87..7eff5cadd0 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2519,6 +2519,9 @@ struct gl_extensions
GLboolean SGIS_texture_lod;
GLboolean TDFX_texture_compression_FXT1;
GLboolean S3_s3tc;
+#if FEATURE_OES_draw_texture
+ GLboolean OES_draw_texture;
+#endif /* FEATURE_OES_draw_texture */
/** The extension string */
const GLubyte *String;
/** Number of supported extensions */
diff --git a/src/mesa/main/remap.c b/src/mesa/main/remap.c
index 0385ae8d7d..5f32a48258 100644
--- a/src/mesa/main/remap.c
+++ b/src/mesa/main/remap.c
@@ -45,7 +45,7 @@
#define need_MESA_remap_table
-#include "remap_helper.h"
+#include "main/remap_helper.h"
#define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0]))
#define MAX_ENTRY_POINTS 16
diff --git a/src/mesa/main/texgen.c b/src/mesa/main/texgen.c
index be4e03bc56..2ae839b2a6 100644
--- a/src/mesa/main/texgen.c
+++ b/src/mesa/main/texgen.c
@@ -210,7 +210,7 @@ _mesa_TexGendv(GLenum coord, GLenum pname, const GLdouble *params )
}
-static void GLAPIENTRY
+void GLAPIENTRY
_mesa_TexGenf( GLenum coord, GLenum pname, GLfloat param )
{
GLfloat p[4];
@@ -269,7 +269,7 @@ _mesa_GetTexGendv( GLenum coord, GLenum pname, GLdouble *params )
-static void GLAPIENTRY
+void GLAPIENTRY
_mesa_GetTexGenfv( GLenum coord, GLenum pname, GLfloat *params )
{
struct gl_texture_unit *texUnit;
diff --git a/src/mesa/main/texgen.h b/src/mesa/main/texgen.h
index f6924ef722..eb4626033a 100644
--- a/src/mesa/main/texgen.h
+++ b/src/mesa/main/texgen.h
@@ -41,8 +41,14 @@ extern void GLAPIENTRY
_mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params );
extern void GLAPIENTRY
+_mesa_TexGenf( GLenum coord, GLenum pname, GLfloat param );
+
+extern void GLAPIENTRY
_mesa_TexGeni( GLenum coord, GLenum pname, GLint param );
+extern void GLAPIENTRY
+_mesa_GetTexGenfv( GLenum coord, GLenum pname, GLfloat *params );
+
extern void
_mesa_init_texgen_dispatch(struct _glapi_table *disp);
diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
index d786c41d2e..d7943eaa1e 100644
--- a/src/mesa/main/texgetimage.c
+++ b/src/mesa/main/texgetimage.c
@@ -42,30 +42,6 @@
-#if FEATURE_EXT_texture_sRGB
-
-/**
- * Convert a float value from linear space to a
- * non-linear sRGB value in [0, 255].
- * Not terribly efficient.
- */
-static INLINE GLfloat
-linear_to_nonlinear(GLfloat cl)
-{
- /* can't have values outside [0, 1] */
- GLfloat cs;
- if (cl < 0.0031308f) {
- cs = 12.92f * cl;
- }
- else {
- cs = (GLfloat)(1.055 * _mesa_pow(cl, 0.41666) - 0.055);
- }
- return cs;
-}
-
-#endif /* FEATURE_EXT_texture_sRGB */
-
-
/**
* Can the given type represent negative values?
*/
@@ -233,6 +209,29 @@ get_tex_ycbcr(GLcontext *ctx, GLuint dimensions,
}
+#if FEATURE_EXT_texture_sRGB
+
+
+/**
+ * Convert a float value from linear space to a
+ * non-linear sRGB value in [0, 255].
+ * Not terribly efficient.
+ */
+static INLINE GLfloat
+linear_to_nonlinear(GLfloat cl)
+{
+ /* can't have values outside [0, 1] */
+ GLfloat cs;
+ if (cl < 0.0031308f) {
+ cs = 12.92f * cl;
+ }
+ else {
+ cs = (GLfloat)(1.055 * _mesa_pow(cl, 0.41666) - 0.055);
+ }
+ return cs;
+}
+
+
/**
* glGetTexImagefor sRGB pixels;
*/
@@ -284,6 +283,21 @@ get_tex_srgb(GLcontext *ctx, GLuint dimensions,
}
+#else /* FEATURE_EXT_texture_sRGB */
+
+
+static INLINE void
+get_tex_srgb(GLcontext *ctx, GLuint dimensions,
+ GLenum format, GLenum type, GLvoid *pixels,
+ const struct gl_texture_image *texImage)
+{
+ ASSERT_NO_FEATURE();
+}
+
+
+#endif /* FEATURE_EXT_texture_sRGB */
+
+
/**
* glGetTexImagefor RGBA, Luminance, etc. pixels.
* This is the slow way since we use texture sampling.
diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c
index e4f18c842c..145bd62b83 100644
--- a/src/mesa/state_tracker/st_context.c
+++ b/src/mesa/state_tracker/st_context.c
@@ -48,7 +48,7 @@
#include "st_cb_drawpixels.h"
#include "st_cb_rasterpos.h"
#endif
-#ifdef FEATURE_OES_draw_texture
+#if FEATURE_OES_draw_texture
#include "st_cb_drawtex.h"
#endif
#include "st_cb_fbo.h"
@@ -209,7 +209,7 @@ static void st_destroy_context_priv( struct st_context *st )
st_destroy_bitmap(st);
st_destroy_drawpix(st);
#endif
-#ifdef FEATURE_OES_draw_texture
+#if FEATURE_OES_draw_texture
st_destroy_drawtex(st);
#endif
@@ -330,6 +330,11 @@ void st_init_driver_functions(struct dd_function_table *functions)
st_init_drawpixels_functions(functions);
st_init_rasterpos_functions(functions);
#endif
+
+#if FEATURE_OES_draw_texture
+ st_init_drawtex_functions(functions);
+#endif
+
st_init_fbo_functions(functions);
#if FEATURE_feedback
st_init_feedback_functions(functions);
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index 35e08749df..e25a613d8a 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -187,6 +187,10 @@ void st_init_extensions(struct st_context *st)
ctx->Extensions.NV_texgen_reflection = GL_TRUE;
ctx->Extensions.NV_texture_env_combine4 = GL_TRUE;
+#if FEATURE_OES_draw_texture
+ ctx->Extensions.OES_draw_texture = GL_TRUE;
+#endif
+
ctx->Extensions.SGI_color_matrix = GL_TRUE;
ctx->Extensions.SGIS_generate_mipmap = GL_TRUE;
diff --git a/src/mesa/swrast/swrast.h b/src/mesa/swrast/swrast.h
index c183b315b6..c01cf7d1f0 100644
--- a/src/mesa/swrast/swrast.h
+++ b/src/mesa/swrast/swrast.h
@@ -75,12 +75,6 @@ typedef struct {
} SWvertex;
-/**
- * Fixed point data type.
- */
-typedef int GLfixed;
-
-
#define FRAG_ATTRIB_CI FRAG_ATTRIB_COL0
diff --git a/src/mesa/x86-64/glapi_x86-64.S b/src/mesa/x86-64/glapi_x86-64.S
index bc83b5a0bd..8edb69bf84 100644
--- a/src/mesa/x86-64/glapi_x86-64.S
+++ b/src/mesa/x86-64/glapi_x86-64.S
@@ -29,7 +29,7 @@
* the symbol visibility mode to 'default'.
*/
-#include "../x86/assyntax.h"
+#include "x86/assyntax.h"
#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303
# pragma GCC visibility push(default)
diff --git a/src/mesa/x86/glapi_x86.S b/src/mesa/x86/glapi_x86.S
index 6668852514..2e640ec95d 100644
--- a/src/mesa/x86/glapi_x86.S
+++ b/src/mesa/x86/glapi_x86.S
@@ -26,7 +26,7 @@
* SOFTWARE.
*/
-#include "assyntax.h"
+#include "x86/assyntax.h"
#include "glapi/glapioffsets.h"
#if defined(STDCALL_API)