$(call LINK,$^)
endif
-CHECK_GL_OBJS = check_gl.o
+CHECK_GL_OBJS = check_gl.o check_gl_core.o
CHECK_GL_LDFLAGS =
CHECK_GL_TARGET =
ifdef CONFIG_LINUX
gcc -o $(CHECK_GL_TARGET) $(CHECK_GL_OBJS) $(CHECK_GL_LDFLAGS)
check_gl.o: check_gl.c
gcc -c ../tizen/src/check_gl.c -I../hw/yagl/yagl_inc
+check_gl_core.o: check_gl_core.c
+ gcc -c ../tizen/src/check_gl_core.c -I../hw/yagl/yagl_inc
check_gl_glx.o: check_gl_glx.c
gcc -c ../tizen/src/check_gl_glx.c -I../hw/yagl/yagl_inc
check_gl_wgl.o: check_gl_wgl.c
coroutine=""
coroutine_pool=""
seccomp=""
-gl="yes"
# for TIZEN-maru
maru="no"
;;
--enable-kvm) kvm="yes"
;;
- --disable-gl) gl="no"
- ;;
- --enable-gl) gl="yes"
- ;;
--disable-hax) hax="no"
;;
--enable-hax) hax="yes"
--disable-hax disable HAX acceleration support
--enable-hax enable HAX acceleration support
- --disable-gl disable GL acceleration support
- --enable-gl enable GL acceleration support
--enable-yagl enable YaGL device
--disable-yagl disable YaGL device
--enable-yagl-stats enable YaGL stats
echo "snappy support $snappy"
echo "HAX support $hax"
-echo "GL support $gl"
echo "YaGL support $yagl"
echo "YaGL stats $yagl_stats"
echo "OpenGL support $opengl"
if test "$yagl" = "yes" ; then
echo "CONFIG_YAGL=y" >> $config_host_mak
if test "$linux" = "yes" ; then
- echo -n;
+ LIBS="-lGLU -ldl $LIBS"
elif test "$mingw32" = "yes" ; then
- echo -n;
+ LIBS="-lopengl32 -lglu32 $LIBS"
elif test "$darwin" = "yes" ; then
- echo -n; else
+ LIBS="-framework OpenGL -framework AGL -framework GLUT $LIBS"
+ else
echo "ERROR: YaGL is not available on $targetos"
exit 1
fi
if test "$shm" = "yes" ; then
echo "CONFIG_USE_SHM=y" >> $config_host_mak
fi
-if test "$gl" = "yes" ; then
- echo "CONFIG_GL_BACKEND=y" >> $config_host_mak
-fi
if test "$libav" = "yes" ; then
echo "CONFIG_LIBAV=y" >> $config_host_mak
fi
echo "CONFIG_NO_HAX=y" >> $config_target_mak
fi
fi
-if test "$gl" = "yes" ; then
- case "$target_name" in
- i386|x86_64|arm)
- echo "CONFIG_GL=y" >> $config_target_mak
- if test "$mingw32" = "yes" ; then
- echo "LIBS+=-lopengl32 -lglu32" >> $config_target_mak
- elif test "$darwin" = "yes" ; then
- echo "LIBS+=-framework OpenGL -framework AGL " >> $config_target_mak
- else
- echo "LIBS+=-lGLU -ldl" >> $config_target_mak
- fi
- ;;
- *)
- echo "CONFIG_NO_GL=y" >> $config_target_mak
- ;;
- esac
-fi
if test "$target_bigendian" = "yes" ; then
echo "TARGET_WORDS_BIGENDIAN=y" >> $config_target_mak
fi
};
#ifdef CONFIG_MARU
-/* virtio-gl-pci */
-
-static int virtio_gl_pci_init(VirtIOPCIProxy *vpci_dev)
-{
- VirtIOGLPCI *dev = VIRTIO_GL_PCI(vpci_dev);
- DeviceState *vdev = DEVICE(&dev->vdev);
-
- qdev_set_parent_bus(vdev, BUS(&vpci_dev->bus));
- if (qdev_init(vdev) < 0) {
- return -1;
- }
-
- return 0;
-}
-
-static void virtio_gl_pci_class_init(ObjectClass *klass, void *data)
-{
- VirtioPCIClass *k = VIRTIO_PCI_CLASS(klass);
- PCIDeviceClass *pcidev_k = PCI_DEVICE_CLASS(klass);
-
- k->init = virtio_gl_pci_init;
- pcidev_k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET;
- pcidev_k->device_id = PCI_DEVICE_ID_VIRTIO_GL;
- pcidev_k->revision = VIRTIO_PCI_ABI_VERSION;
- pcidev_k->class_id = PCI_CLASS_OTHERS;
-}
-
-static void virtio_gl_pci_instance_init(Object *obj)
-{
- VirtIOGLPCI *dev = VIRTIO_GL_PCI(obj);
- object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VIRTIO_GL);
- object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), NULL);
-}
-
-static TypeInfo virtio_gl_pci_info = {
- .name = TYPE_VIRTIO_GL_PCI,
- .parent = TYPE_VIRTIO_PCI,
- .instance_size = sizeof(VirtIOGLPCI),
- .instance_init = virtio_gl_pci_instance_init,
- .class_init = virtio_gl_pci_class_init,
-};
-
/* virtio-touchscreen-pci */
static Property virtio_touchscreen_pci_properties[] = {
type_register_static(&virtio_hwkey_pci_info);
type_register_static(&virtio_keyboard_pci_info);
type_register_static(&virtio_touchscreen_pci_info);
- type_register_static(&virtio_gl_pci_info);
type_register_static(&virtio_sensor_pci_info);
type_register_static(&virtio_nfc_pci_info);
type_register_static(&virtio_jack_pci_info);
#endif
#ifdef CONFIG_MARU
-#ifdef CONFIG_GL_BACKEND
-// #include "../tizen/src/hw/maru_virtio_gl.h"
-#endif
#include "../tizen/src/mloop_event.h"
#include "../tizen/src/hw/maru_device_ids.h"
#include "../tizen/src/hw/maru_virtio_evdi.h"
#include "../tizen/src/hw/maru_virtio_hwkey.h"
#include "../tizen/src/hw/maru_virtio_keyboard.h"
#include "../tizen/src/hw/maru_virtio_touchscreen.h"
-#include "../tizen/src/hw/virtio-gl.h"
#include "../tizen/src/hw/maru_virtio_sensor.h"
#include "../tizen/src/hw/maru_virtio_jack.h"
#include "../tizen/src/hw/maru_virtio_power.h"
typedef struct VirtIORngPCI VirtIORngPCI;
#ifdef CONFIG_MARU
-typedef struct VirtIOGLPCI VirtIOGLPCI;
typedef struct VirtIOTouchscreenPCI VirtIOTouchscreenPCI;
typedef struct VirtIOEVDIPCI VirtIOEVDIPCI;
typedef struct VirtIOESMPCI VirtIOESMPCI;
#ifdef CONFIG_MARU
/*
- * virtio-gl-pci: This extends VirtioPCIProxy.
- */
-#define TYPE_VIRTIO_GL_PCI "virtio-gl-pci"
-#define VIRTIO_GL_PCI(obj) \
- OBJECT_CHECK(VirtIOGLPCI, (obj), TYPE_VIRTIO_GL_PCI)
-
-struct VirtIOGLPCI {
- VirtIOPCIProxy parent_obj;
- VirtIOGL vdev;
-};
-
-/*
* virtio-touchscreen-pci: This extends VirtioPCIProxy.
*/
#define TYPE_VIRTIO_TOUCHSCREEN_PCI "virtio-touchscreen-pci"
if KVM support is enabled when compiling.
ETEXI
-DEF("enable-gl", 0, QEMU_OPTION_enable_gl, \
- "-enable-gl enable OpenGL passthrough support\n", QEMU_ARCH_ALL)
-STEXI
-@item -enable-gl
-@findex -enable-gl
-Enable OpenGL passthrough support. This option requires the support of a
-special libGL installed on the guest OS.
-ETEXI
-
DEF("enable-yagl", 0, QEMU_OPTION_enable_yagl, \
"-enable-yagl enable OpenGLES passthrough support\n", QEMU_ARCH_ALL)
STEXI
CONFIGURE_APPEND=""
EMUL_TARGET_LIST=""
-VIRTIOGL_EN=""
YAGL_EN=""
YAGL_STATS_EN=""
VIGS_EN=""
echo "options:"
echo "-d, --debug"
echo " build debug configuration"
- echo "-vgl|--virtio-gl"
- echo " enable virtio GL support"
echo "-yagl|--yagl-device"
echo " enable YaGL passthrough device"
echo "-ys|--yagl-stats"
echo " display this help message and exit"
}
-virtgl_enable() {
- case "$1" in
- 0|no|disable)
- VIRTIOGL_EN="no"
- ;;
- 1|yes|enable)
- VIRTIOGL_EN="yes"
- ;;
- *)
- usage
- exit 1
- ;;
- esac
-}
-
yagl_enable() {
case "$1" in
0|no|disable)
case "$1" in
x86|i386|i486|i586|i686)
EMUL_TARGET_LIST="i386-softmmu"
- if [ -z "$VIRTIOGL_EN" ] ; then
- virtgl_enable yes
- fi
if [ -z "$YAGL_EN" ] ; then
yagl_enable yes
fi
all)
# EMUL_TARGET_LIST="i386-softmmu,arm-softmmu"
EMUL_TARGET_LIST="i386-softmmu"
- if [ -z "$VIRTIOGL_EN" ] ; then
- virtgl_enable yes
- fi
- if [ -z "$YAGL_EN" ] ; then
+ if [ -z "$YAGL_EN" ] ; then
yagl_enable yes
fi
if [ -z "$VIGS_EN" ] ; then
shift
CONFIGURE_APPEND="$CONFIGURE_APPEND $1"
;;
- -vgl|--virtio-gl)
- virtgl_enable 1
- ;;
-yagl|--yagl-device)
yagl_enable 1
;;
CONFIGURE_APPEND="--target-list=$EMUL_TARGET_LIST $CONFIGURE_APPEND"
-if test "$VIRTIOGL_EN" = "yes" ; then
- CONFIGURE_APPEND="$CONFIGURE_APPEND --enable-gl"
-else
- CONFIGURE_APPEND="$CONFIGURE_APPEND --disable-gl"
-fi
-
if test "$YAGL_EN" = "yes" ; then
CONFIGURE_APPEND="$CONFIGURE_APPEND --enable-yagl"
else
endif
ifdef CONFIG_WIN32
-LIBS += -lopengl32 -lglu32 -lgdi32 -lpng14
+LIBS += -lpng14
endif
ifdef CONFIG_LINUX
-LIBS += -lGL -lXcomposite -lXext -lpng
+LIBS += -lpng
endif
ifdef CONFIG_DEBUG_EXEC
GL_CFLAGS := -Wall -g -O2 -fno-strict-aliasing
endif
-#ifndef CONFIG_DARWIN
-###########################################################
-## Build openGL
-# i386
-ifdef CONFIG_GL
-
-GL_CUR_PATH = $(SRC_PATH)/tizen/src/hw
-
-GL_CFLAGS += -I$(GL_CUR_PATH) -I$(SRC_PATH)/fpu
-GL_CFLAGS += -I$(SRC_PATH)/$(TARGET_NAME)-softmmu $(QEMU_CFLAGS) $(CFLAGS)
-
-parse_gl_h: parse_gl_h.c
- $(CC) -g -o $@ $<
-server_stub.c: parse_gl_h
- ./parse_gl_h 2>/dev/null
-gl_func.h: parse_gl_h
- ./parse_gl_h 2>/dev/null
-opengl_func.h: gl_func.h
-helper_opengl.o: helper_opengl.c opengl_func.h server_stub.c opengl_process.h
- $(CC) $(GL_CFLAGS) $(DEFINES) $(GL_LDFLAGS) -c -o $@ $<
-gl_beginend.h: $(GL_CUR_PATH)/beginend_funcs.sh
- $< > $@
-mesa_mipmap.o : mesa_mipmap.c
- $(CC) $(GL_CFLAGS) $(DEFINES) $(GL_LDFLAGS) -c -o $@ $<
-opengl_exec.o : opengl_exec.c server_stub.c opengl_func.h gl_beginend.h opengl_process.h mesa_mipmap.o
- $(CC) $(GL_CFLAGS) $(DEFINES) $(GL_LDFLAGS) -c -o $@ $<
-
-endif #CONFIG_GL
-
-###########################################################
-#endif #!CONFIG_DARWIN
-
# maru loader
obj-y += emulator.o emul_state.o maru_err_table.o
obj-$(CONFIG_DARWIN) += maru_camera_darwin_pci.o
obj-$(CONFIG_DARWIN) += emul_state_darwin.o
+obj-y += check_gl_core.o
+obj-$(CONFIG_LINUX) += check_gl_glx.o
+obj-$(CONFIG_WIN32) += check_gl_wgl.o
+obj-$(CONFIG_DARWIN) += check_gl_cgl.o
+
ifdef CONFIG_LINUX # libs for maru camera on linux host
LIBS += -lv4l2 -lv4lconvert
endif
# guest server
obj-y += guest_server.o
-
-#ifndef CONFIG_DARWIN
-###########################################################
-## opengl library for i386
-obj-$(CONFIG_GL) += virtio-gl.o
-obj-$(CONFIG_GL) += helper_opengl.o opengl_exec.o mesa_mipmap.o
-obj-$(CONFIG_NO_GL) += virtio-gl-stub.o
-obj-y += gloffscreen_test.o gloffscreen_xcomposite.o gloffscreen_common.o gloffscreen_wgl.o gloffscreen_agl.o
-###########################################################
-#endif
*/
#include "check_gl.h"
-#include <GL/gl.h>
-#include <GL/glext.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <string.h>
-
-static const char *log_level_str[gl_error + 1] =
-{
- "INFO",
- "WARN",
- "ERROR"
-};
-
-static const char *gl_version_str[gl_3_2 + 1] =
-{
- "2.1",
- "3.1",
- "3.2"
-};
-
-void check_gl_log(gl_log_level level, const char *format, ...)
-{
- va_list args;
-
- fprintf(stderr, "%-5s", log_level_str[level]);
-
- va_start(args, format);
- fprintf(stderr, " - ");
- vfprintf(stderr, format, args);
- va_end(args);
-
- fprintf(stderr, "\n");
-}
-
-static const GLubyte *(GLAPIENTRY *get_string)(GLenum);
-static const GLubyte *(GLAPIENTRY *get_stringi)(GLenum, GLuint);
-static void (GLAPIENTRY *get_integerv)(GLenum, GLint*);
-
-static struct gl_context *check_gl_version(gl_version version)
-{
- struct gl_context *ctx = NULL;
- int hw = 1;
-
- ctx = check_gl_context_create(NULL, version);
-
- if (!ctx) {
- goto fail;
- }
-
- if (!check_gl_make_current(ctx)) {
- goto fail;
- }
-
- if ((strstr((const char*)get_string(GL_RENDERER), "Software") != NULL)) {
- check_gl_log(gl_warn,
- "Host OpenGL %s - software",
- gl_version_str[version]);
- hw = 0;
- } else if (strncmp((const char*)get_string(GL_VERSION),
- "1.4", strlen("1.4")) == 0) {
- /*
- * Handle LIBGL_ALWAYS_INDIRECT=1 case.
- */
- check_gl_log(gl_warn,
- "Host OpenGL %s - NOT supported",
- gl_version_str[version]);
- hw = 0;
- } else {
- check_gl_log(gl_info,
- "Host OpenGL %s - supported",
- gl_version_str[version]);
- }
-
- check_gl_log(gl_info, "+ GL_VENDOR = %s", (const char*)get_string(GL_VENDOR));
- check_gl_log(gl_info, "+ GL_RENDERER = %s", (const char*)get_string(GL_RENDERER));
- check_gl_log(gl_info, "+ GL_VERSION = %s", (const char*)get_string(GL_VERSION));
-
- if (!hw) {
- check_gl_context_destroy(ctx);
- ctx = NULL;
- }
-
- check_gl_make_current(NULL);
-
- return ctx;
-
-fail:
- if (ctx) {
- check_gl_context_destroy(ctx);
- }
-
- check_gl_log(gl_info,
- "Host OpenGL %s - NOT supported",
- gl_version_str[version]);
-
- return NULL;
-}
int main(int argc, char *argv[])
{
- struct gl_context *ctx_2;
- struct gl_context *ctx_3_1;
- struct gl_context *ctx_3_2;
- int have_es3 = 0;
- int have_es1 = 0;
-
- if (!check_gl_init()) {
- return 1;
- }
-
- if (!check_gl_procaddr((void**)&get_string, "glGetString", 0) ||
- !check_gl_procaddr((void**)&get_stringi, "glGetStringi", 1) ||
- !check_gl_procaddr((void**)&get_integerv, "glGetIntegerv", 0)) {
- return 1;
- }
-
- ctx_2 = check_gl_version(gl_2);
- ctx_3_1 = check_gl_version(gl_3_1);
- ctx_3_2 = check_gl_version(gl_3_2);
-
- if (!ctx_2 && !ctx_3_1 && !ctx_3_2) {
- check_gl_log(gl_info, "Host does not have hardware GL acceleration!");
- return 1;
- }
-
- have_es1 = (ctx_2 != NULL);
- have_es3 = (ctx_3_2 != NULL);
-
- /*
- * Check if GL_ARB_ES3_compatibility is supported within
- * OpenGL 3.1 context.
- */
-
- if (ctx_3_1 && get_stringi && check_gl_make_current(ctx_3_1)) {
- GLint i, num_extensions = 0;
-
- get_integerv(GL_NUM_EXTENSIONS, &num_extensions);
-
- for (i = 0; i < num_extensions; ++i) {
- const char *tmp;
-
- tmp = (const char*)get_stringi(GL_EXTENSIONS, i);
-
- if (strcmp(tmp, "GL_ARB_ES3_compatibility") == 0) {
- have_es3 = 1;
- break;
- }
- }
-
- check_gl_make_current(NULL);
- }
-
- /*
- * Check if OpenGL 2.1 contexts can be shared with OpenGL 3.x contexts
- */
-
- if (ctx_2 && ((ctx_3_1 && have_es3) || ctx_3_2)) {
- struct gl_context *ctx = NULL;
-
- ctx = check_gl_context_create(((ctx_3_1 && have_es3) ? ctx_3_1
- : ctx_3_2),
- gl_2);
-
- if (ctx) {
- if (check_gl_make_current(ctx)) {
- check_gl_make_current(NULL);
- } else {
- have_es1 = 0;
- }
- check_gl_context_destroy(ctx);
- } else {
- have_es1 = 0;
- }
- }
-
- if (have_es1) {
- check_gl_log(gl_info, "Guest OpenGL ES v1_CM - supported");
- } else {
- check_gl_log(gl_warn, "Guest OpenGL ES v1_CM - NOT supported");
- }
- check_gl_log(gl_info, "Guest OpenGL ES 2.0 - supported");
- if (have_es3) {
- check_gl_log(gl_info, "Guest OpenGL ES 3.0 - supported");
- } else {
- check_gl_log(gl_warn, "Guest OpenGL ES 3.0 - NOT supported");
- }
-
- check_gl_log(gl_info, "Host has hardware GL acceleration!");
-
- return 0;
+ return check_gl();
}
int check_gl_init(void);
+int check_gl(void);
+
struct gl_context *check_gl_context_create(struct gl_context *share_ctx,
gl_version version);
--- /dev/null
+/*
+ * Copyright (c) 2011 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "check_gl.h"
+#include <GL/gl.h>
+#include <GL/glext.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <string.h>
+
+static const char *log_level_str[gl_error + 1] =
+{
+ "INFO",
+ "WARN",
+ "ERROR"
+};
+
+static const char *gl_version_str[gl_3_2 + 1] =
+{
+ "2.1",
+ "3.1",
+ "3.2"
+};
+
+void check_gl_log(gl_log_level level, const char *format, ...)
+{
+ va_list args;
+
+ fprintf(stderr, "%-5s", log_level_str[level]);
+
+ va_start(args, format);
+ fprintf(stderr, " - ");
+ vfprintf(stderr, format, args);
+ va_end(args);
+
+ fprintf(stderr, "\n");
+}
+
+static const GLubyte *(GLAPIENTRY *get_string)(GLenum);
+static const GLubyte *(GLAPIENTRY *get_stringi)(GLenum, GLuint);
+static void (GLAPIENTRY *get_integerv)(GLenum, GLint*);
+
+static struct gl_context *check_gl_version(gl_version version)
+{
+ struct gl_context *ctx = NULL;
+ int hw = 1;
+
+ ctx = check_gl_context_create(NULL, version);
+
+ if (!ctx) {
+ goto fail;
+ }
+
+ if (!check_gl_make_current(ctx)) {
+ goto fail;
+ }
+
+ if ((strstr((const char*)get_string(GL_RENDERER), "Software") != NULL)) {
+ check_gl_log(gl_warn,
+ "Host OpenGL %s - software",
+ gl_version_str[version]);
+ hw = 0;
+ } else if (strncmp((const char*)get_string(GL_VERSION),
+ "1.4", strlen("1.4")) == 0) {
+ /*
+ * Handle LIBGL_ALWAYS_INDIRECT=1 case.
+ */
+ check_gl_log(gl_warn,
+ "Host OpenGL %s - NOT supported",
+ gl_version_str[version]);
+ hw = 0;
+ } else {
+ check_gl_log(gl_info,
+ "Host OpenGL %s - supported",
+ gl_version_str[version]);
+ }
+
+ check_gl_log(gl_info, "+ GL_VENDOR = %s", (const char*)get_string(GL_VENDOR));
+ check_gl_log(gl_info, "+ GL_RENDERER = %s", (const char*)get_string(GL_RENDERER));
+ check_gl_log(gl_info, "+ GL_VERSION = %s", (const char*)get_string(GL_VERSION));
+
+ if (!hw) {
+ check_gl_context_destroy(ctx);
+ ctx = NULL;
+ }
+
+ check_gl_make_current(NULL);
+
+ return ctx;
+
+fail:
+ if (ctx) {
+ check_gl_context_destroy(ctx);
+ }
+
+ check_gl_log(gl_info,
+ "Host OpenGL %s - NOT supported",
+ gl_version_str[version]);
+
+ return NULL;
+}
+
+int check_gl(void)
+{
+ struct gl_context *ctx_2;
+ struct gl_context *ctx_3_1;
+ struct gl_context *ctx_3_2;
+ int have_es3 = 0;
+ int have_es1 = 0;
+
+ if (!check_gl_init()) {
+ return 1;
+ }
+
+ if (!check_gl_procaddr((void**)&get_string, "glGetString", 0) ||
+ !check_gl_procaddr((void**)&get_stringi, "glGetStringi", 1) ||
+ !check_gl_procaddr((void**)&get_integerv, "glGetIntegerv", 0)) {
+ return 1;
+ }
+
+ ctx_2 = check_gl_version(gl_2);
+ ctx_3_1 = check_gl_version(gl_3_1);
+ ctx_3_2 = check_gl_version(gl_3_2);
+
+ if (!ctx_2 && !ctx_3_1 && !ctx_3_2) {
+ check_gl_log(gl_info, "Host does not have hardware GL acceleration!");
+ return 1;
+ }
+
+ have_es1 = (ctx_2 != NULL);
+ have_es3 = (ctx_3_2 != NULL);
+
+ /*
+ * Check if GL_ARB_ES3_compatibility is supported within
+ * OpenGL 3.1 context.
+ */
+
+ if (ctx_3_1 && get_stringi && check_gl_make_current(ctx_3_1)) {
+ GLint i, num_extensions = 0;
+
+ get_integerv(GL_NUM_EXTENSIONS, &num_extensions);
+
+ for (i = 0; i < num_extensions; ++i) {
+ const char *tmp;
+
+ tmp = (const char*)get_stringi(GL_EXTENSIONS, i);
+
+ if (strcmp(tmp, "GL_ARB_ES3_compatibility") == 0) {
+ have_es3 = 1;
+ break;
+ }
+ }
+
+ check_gl_make_current(NULL);
+ }
+
+ /*
+ * Check if OpenGL 2.1 contexts can be shared with OpenGL 3.x contexts
+ */
+
+ if (ctx_2 && ((ctx_3_1 && have_es3) || ctx_3_2)) {
+ struct gl_context *ctx = NULL;
+
+ ctx = check_gl_context_create(((ctx_3_1 && have_es3) ? ctx_3_1
+ : ctx_3_2),
+ gl_2);
+
+ if (ctx) {
+ if (check_gl_make_current(ctx)) {
+ check_gl_make_current(NULL);
+ } else {
+ have_es1 = 0;
+ }
+ check_gl_context_destroy(ctx);
+ } else {
+ have_es1 = 0;
+ }
+ }
+
+ if (have_es1) {
+ check_gl_log(gl_info, "Guest OpenGL ES v1_CM - supported");
+ } else {
+ check_gl_log(gl_warn, "Guest OpenGL ES v1_CM - NOT supported");
+ }
+ check_gl_log(gl_info, "Guest OpenGL ES 2.0 - supported");
+ if (have_es3) {
+ check_gl_log(gl_info, "Guest OpenGL ES 3.0 - supported");
+ } else {
+ check_gl_log(gl_warn, "Guest OpenGL ES 3.0 - NOT supported");
+ }
+
+ check_gl_log(gl_info, "Host has hardware GL acceleration!");
+
+ return 0;
+}
#include "guest_server.h"
#include "hw/maru_camera_common.h"
#include "hw/maru_virtio_touchscreen.h"
-#include "hw/gloffscreen_test.h"
+#include "check_gl.h"
#include "maru_common.h"
#include "maru_err_table.h"
#include "maru_display.h"
char tizen_target_path[PATH_MAX];
char tizen_target_img_path[PATH_MAX];
-int enable_gl = 0;
int enable_yagl = 0;
int enable_spice = 0;
g_free(tmp_str);
}
-#define VIRTIOGL_DEV_NAME "virtio-gl-pci"
-#ifdef CONFIG_GL_BACKEND
+#ifdef CONFIG_YAGL
static void prepare_opengl_acceleration(void)
{
int capability_check_gl = 0;
- if (enable_gl && enable_yagl) {
- ERR("Error: only one openGL passthrough device can be used at one time!\n");
- exit(1);
- }
-
-
- if (enable_gl || enable_yagl) {
- capability_check_gl = gl_acceleration_capability_check();
+ if (enable_yagl) {
+ capability_check_gl = check_gl();
if (capability_check_gl != 0) {
- enable_gl = enable_yagl = 0;
+ enable_yagl = 0;
INFO("<WARNING> GL acceleration was disabled due to the fail of GL check!\n");
}
}
- if (enable_gl) {
- if (!qemu_opts_parse(qemu_find_opts("device"), VIRTIOGL_DEV_NAME, 1)) {
- ERR("Failed to initialize the virtio-gl device.\n");
- exit(1);
- }
- }
- gchar * const tmp_str = g_strdup_printf(" gles=%d yagl=%d", (enable_gl || enable_yagl), enable_yagl);
+ gchar * const tmp_str = g_strdup_printf(" yagl=%d", enable_yagl);
g_strlcat(maru_kernel_cmdline, tmp_str, LEN_MARU_KERNEL_CMDLINE);
g_strlcpy(maru_kernel_cmdline, kernel_cmdline, LEN_MARU_KERNEL_CMDLINE);
- // Prepare GL acceleration
-#ifdef CONFIG_GL_BACKEND
+ /* Prepare GL acceleration */
+#ifdef CONFIG_YAGL
prepare_opengl_acceleration();
#endif
- // Prepare basic features
+ /* Prepare basic features */
prepare_basic_features();
INFO("kernel command : %s\n", maru_kernel_cmdline);
+++ /dev/null
-#ifndef __wglext_h_
-#define __wglext_h_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
-** Copyright (c) 2007-2012 The Khronos Group Inc.
-**
-** Permission is hereby granted, free of charge, to any person obtaining a
-** copy of this software and/or associated documentation files (the
-** "Materials"), to deal in the Materials without restriction, including
-** without limitation the rights to use, copy, modify, merge, publish,
-** distribute, sublicense, and/or sell copies of the Materials, and to
-** permit persons to whom the Materials are furnished to do so, subject to
-** the following conditions:
-**
-** The above copyright notice and this permission notice shall be included
-** in all copies or substantial portions of the Materials.
-**
-** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
-*/
-
-/* Function declaration macros - to move into glplatform.h */
-
-#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
-#define WIN32_LEAN_AND_MEAN 1
-#include <windows.h>
-#endif
-
-#ifndef APIENTRY
-#define APIENTRY
-#endif
-#ifndef APIENTRYP
-#define APIENTRYP APIENTRY *
-#endif
-#ifndef GLAPI
-#define GLAPI extern
-#endif
-
-/*************************************************************/
-
-/* Header file version number */
-/* wglext.h last updated 2012/01/04 */
-/* Current version at http://www.opengl.org/registry/ */
-#define WGL_WGLEXT_VERSION 24
-
-#ifndef WGL_ARB_buffer_region
-#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001
-#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002
-#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004
-#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008
-#endif
-
-#ifndef WGL_ARB_multisample
-#define WGL_SAMPLE_BUFFERS_ARB 0x2041
-#define WGL_SAMPLES_ARB 0x2042
-#endif
-
-#ifndef WGL_ARB_extensions_string
-#endif
-
-#ifndef WGL_ARB_pixel_format
-#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000
-#define WGL_DRAW_TO_WINDOW_ARB 0x2001
-#define WGL_DRAW_TO_BITMAP_ARB 0x2002
-#define WGL_ACCELERATION_ARB 0x2003
-#define WGL_NEED_PALETTE_ARB 0x2004
-#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005
-#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006
-#define WGL_SWAP_METHOD_ARB 0x2007
-#define WGL_NUMBER_OVERLAYS_ARB 0x2008
-#define WGL_NUMBER_UNDERLAYS_ARB 0x2009
-#define WGL_TRANSPARENT_ARB 0x200A
-#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037
-#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038
-#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039
-#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A
-#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B
-#define WGL_SHARE_DEPTH_ARB 0x200C
-#define WGL_SHARE_STENCIL_ARB 0x200D
-#define WGL_SHARE_ACCUM_ARB 0x200E
-#define WGL_SUPPORT_GDI_ARB 0x200F
-#define WGL_SUPPORT_OPENGL_ARB 0x2010
-#define WGL_DOUBLE_BUFFER_ARB 0x2011
-#define WGL_STEREO_ARB 0x2012
-#define WGL_PIXEL_TYPE_ARB 0x2013
-#define WGL_COLOR_BITS_ARB 0x2014
-#define WGL_RED_BITS_ARB 0x2015
-#define WGL_RED_SHIFT_ARB 0x2016
-#define WGL_GREEN_BITS_ARB 0x2017
-#define WGL_GREEN_SHIFT_ARB 0x2018
-#define WGL_BLUE_BITS_ARB 0x2019
-#define WGL_BLUE_SHIFT_ARB 0x201A
-#define WGL_ALPHA_BITS_ARB 0x201B
-#define WGL_ALPHA_SHIFT_ARB 0x201C
-#define WGL_ACCUM_BITS_ARB 0x201D
-#define WGL_ACCUM_RED_BITS_ARB 0x201E
-#define WGL_ACCUM_GREEN_BITS_ARB 0x201F
-#define WGL_ACCUM_BLUE_BITS_ARB 0x2020
-#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021
-#define WGL_DEPTH_BITS_ARB 0x2022
-#define WGL_STENCIL_BITS_ARB 0x2023
-#define WGL_AUX_BUFFERS_ARB 0x2024
-#define WGL_NO_ACCELERATION_ARB 0x2025
-#define WGL_GENERIC_ACCELERATION_ARB 0x2026
-#define WGL_FULL_ACCELERATION_ARB 0x2027
-#define WGL_SWAP_EXCHANGE_ARB 0x2028
-#define WGL_SWAP_COPY_ARB 0x2029
-#define WGL_SWAP_UNDEFINED_ARB 0x202A
-#define WGL_TYPE_RGBA_ARB 0x202B
-#define WGL_TYPE_COLORINDEX_ARB 0x202C
-#endif
-
-#ifndef WGL_ARB_make_current_read
-#define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043
-#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054
-#endif
-
-#ifndef WGL_ARB_pbuffer
-#define WGL_DRAW_TO_PBUFFER_ARB 0x202D
-#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E
-#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F
-#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030
-#define WGL_PBUFFER_LARGEST_ARB 0x2033
-#define WGL_PBUFFER_WIDTH_ARB 0x2034
-#define WGL_PBUFFER_HEIGHT_ARB 0x2035
-#define WGL_PBUFFER_LOST_ARB 0x2036
-#endif
-
-#ifndef WGL_ARB_render_texture
-#define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070
-#define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071
-#define WGL_TEXTURE_FORMAT_ARB 0x2072
-#define WGL_TEXTURE_TARGET_ARB 0x2073
-#define WGL_MIPMAP_TEXTURE_ARB 0x2074
-#define WGL_TEXTURE_RGB_ARB 0x2075
-#define WGL_TEXTURE_RGBA_ARB 0x2076
-#define WGL_NO_TEXTURE_ARB 0x2077
-#define WGL_TEXTURE_CUBE_MAP_ARB 0x2078
-#define WGL_TEXTURE_1D_ARB 0x2079
-#define WGL_TEXTURE_2D_ARB 0x207A
-#define WGL_MIPMAP_LEVEL_ARB 0x207B
-#define WGL_CUBE_MAP_FACE_ARB 0x207C
-#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D
-#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E
-#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F
-#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080
-#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081
-#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082
-#define WGL_FRONT_LEFT_ARB 0x2083
-#define WGL_FRONT_RIGHT_ARB 0x2084
-#define WGL_BACK_LEFT_ARB 0x2085
-#define WGL_BACK_RIGHT_ARB 0x2086
-#define WGL_AUX0_ARB 0x2087
-#define WGL_AUX1_ARB 0x2088
-#define WGL_AUX2_ARB 0x2089
-#define WGL_AUX3_ARB 0x208A
-#define WGL_AUX4_ARB 0x208B
-#define WGL_AUX5_ARB 0x208C
-#define WGL_AUX6_ARB 0x208D
-#define WGL_AUX7_ARB 0x208E
-#define WGL_AUX8_ARB 0x208F
-#define WGL_AUX9_ARB 0x2090
-#endif
-
-#ifndef WGL_ARB_pixel_format_float
-#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0
-#endif
-
-#ifndef WGL_ARB_framebuffer_sRGB
-#define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9
-#endif
-
-#ifndef WGL_ARB_create_context
-#define WGL_CONTEXT_DEBUG_BIT_ARB 0x00000001
-#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002
-#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091
-#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092
-#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093
-#define WGL_CONTEXT_FLAGS_ARB 0x2094
-#define ERROR_INVALID_VERSION_ARB 0x2095
-#endif
-
-#ifndef WGL_ARB_create_context_profile
-#define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126
-#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001
-#define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002
-#define ERROR_INVALID_PROFILE_ARB 0x2096
-#endif
-
-#ifndef WGL_ARB_create_context_robustness
-#define WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004
-#define WGL_LOSE_CONTEXT_ON_RESET_ARB 0x8252
-#define WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
-#define WGL_NO_RESET_NOTIFICATION_ARB 0x8261
-#endif
-
-#ifndef WGL_EXT_make_current_read
-#define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043
-#endif
-
-#ifndef WGL_EXT_pixel_format
-#define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000
-#define WGL_DRAW_TO_WINDOW_EXT 0x2001
-#define WGL_DRAW_TO_BITMAP_EXT 0x2002
-#define WGL_ACCELERATION_EXT 0x2003
-#define WGL_NEED_PALETTE_EXT 0x2004
-#define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005
-#define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006
-#define WGL_SWAP_METHOD_EXT 0x2007
-#define WGL_NUMBER_OVERLAYS_EXT 0x2008
-#define WGL_NUMBER_UNDERLAYS_EXT 0x2009
-#define WGL_TRANSPARENT_EXT 0x200A
-#define WGL_TRANSPARENT_VALUE_EXT 0x200B
-#define WGL_SHARE_DEPTH_EXT 0x200C
-#define WGL_SHARE_STENCIL_EXT 0x200D
-#define WGL_SHARE_ACCUM_EXT 0x200E
-#define WGL_SUPPORT_GDI_EXT 0x200F
-#define WGL_SUPPORT_OPENGL_EXT 0x2010
-#define WGL_DOUBLE_BUFFER_EXT 0x2011
-#define WGL_STEREO_EXT 0x2012
-#define WGL_PIXEL_TYPE_EXT 0x2013
-#define WGL_COLOR_BITS_EXT 0x2014
-#define WGL_RED_BITS_EXT 0x2015
-#define WGL_RED_SHIFT_EXT 0x2016
-#define WGL_GREEN_BITS_EXT 0x2017
-#define WGL_GREEN_SHIFT_EXT 0x2018
-#define WGL_BLUE_BITS_EXT 0x2019
-#define WGL_BLUE_SHIFT_EXT 0x201A
-#define WGL_ALPHA_BITS_EXT 0x201B
-#define WGL_ALPHA_SHIFT_EXT 0x201C
-#define WGL_ACCUM_BITS_EXT 0x201D
-#define WGL_ACCUM_RED_BITS_EXT 0x201E
-#define WGL_ACCUM_GREEN_BITS_EXT 0x201F
-#define WGL_ACCUM_BLUE_BITS_EXT 0x2020
-#define WGL_ACCUM_ALPHA_BITS_EXT 0x2021
-#define WGL_DEPTH_BITS_EXT 0x2022
-#define WGL_STENCIL_BITS_EXT 0x2023
-#define WGL_AUX_BUFFERS_EXT 0x2024
-#define WGL_NO_ACCELERATION_EXT 0x2025
-#define WGL_GENERIC_ACCELERATION_EXT 0x2026
-#define WGL_FULL_ACCELERATION_EXT 0x2027
-#define WGL_SWAP_EXCHANGE_EXT 0x2028
-#define WGL_SWAP_COPY_EXT 0x2029
-#define WGL_SWAP_UNDEFINED_EXT 0x202A
-#define WGL_TYPE_RGBA_EXT 0x202B
-#define WGL_TYPE_COLORINDEX_EXT 0x202C
-#endif
-
-#ifndef WGL_EXT_pbuffer
-#define WGL_DRAW_TO_PBUFFER_EXT 0x202D
-#define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E
-#define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F
-#define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030
-#define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031
-#define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032
-#define WGL_PBUFFER_LARGEST_EXT 0x2033
-#define WGL_PBUFFER_WIDTH_EXT 0x2034
-#define WGL_PBUFFER_HEIGHT_EXT 0x2035
-#endif
-
-#ifndef WGL_EXT_depth_float
-#define WGL_DEPTH_FLOAT_EXT 0x2040
-#endif
-
-#ifndef WGL_3DFX_multisample
-#define WGL_SAMPLE_BUFFERS_3DFX 0x2060
-#define WGL_SAMPLES_3DFX 0x2061
-#endif
-
-#ifndef WGL_EXT_multisample
-#define WGL_SAMPLE_BUFFERS_EXT 0x2041
-#define WGL_SAMPLES_EXT 0x2042
-#endif
-
-#ifndef WGL_I3D_digital_video_control
-#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050
-#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051
-#define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052
-#define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053
-#endif
-
-#ifndef WGL_I3D_gamma
-#define WGL_GAMMA_TABLE_SIZE_I3D 0x204E
-#define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F
-#endif
-
-#ifndef WGL_I3D_genlock
-#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044
-#define WGL_GENLOCK_SOURCE_EXTENAL_SYNC_I3D 0x2045
-#define WGL_GENLOCK_SOURCE_EXTENAL_FIELD_I3D 0x2046
-#define WGL_GENLOCK_SOURCE_EXTENAL_TTL_I3D 0x2047
-#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048
-#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049
-#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A
-#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B
-#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C
-#endif
-
-#ifndef WGL_I3D_image_buffer
-#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001
-#define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002
-#endif
-
-#ifndef WGL_I3D_swap_frame_lock
-#endif
-
-#ifndef WGL_NV_render_depth_texture
-#define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3
-#define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4
-#define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5
-#define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6
-#define WGL_DEPTH_COMPONENT_NV 0x20A7
-#endif
-
-#ifndef WGL_NV_render_texture_rectangle
-#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0
-#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1
-#define WGL_TEXTURE_RECTANGLE_NV 0x20A2
-#endif
-
-#ifndef WGL_ATI_pixel_format_float
-#define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0
-#endif
-
-#ifndef WGL_NV_float_buffer
-#define WGL_FLOAT_COMPONENTS_NV 0x20B0
-#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1
-#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2
-#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3
-#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4
-#define WGL_TEXTURE_FLOAT_R_NV 0x20B5
-#define WGL_TEXTURE_FLOAT_RG_NV 0x20B6
-#define WGL_TEXTURE_FLOAT_RGB_NV 0x20B7
-#define WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8
-#endif
-
-#ifndef WGL_3DL_stereo_control
-#define WGL_STEREO_EMITTER_ENABLE_3DL 0x2055
-#define WGL_STEREO_EMITTER_DISABLE_3DL 0x2056
-#define WGL_STEREO_POLARITY_NORMAL_3DL 0x2057
-#define WGL_STEREO_POLARITY_INVERT_3DL 0x2058
-#endif
-
-#ifndef WGL_EXT_pixel_format_packed_float
-#define WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8
-#endif
-
-#ifndef WGL_EXT_framebuffer_sRGB
-#define WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9
-#endif
-
-#ifndef WGL_NV_present_video
-#define WGL_NUM_VIDEO_SLOTS_NV 0x20F0
-#endif
-
-#ifndef WGL_NV_video_out
-#define WGL_BIND_TO_VIDEO_RGB_NV 0x20C0
-#define WGL_BIND_TO_VIDEO_RGBA_NV 0x20C1
-#define WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV 0x20C2
-#define WGL_VIDEO_OUT_COLOR_NV 0x20C3
-#define WGL_VIDEO_OUT_ALPHA_NV 0x20C4
-#define WGL_VIDEO_OUT_DEPTH_NV 0x20C5
-#define WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6
-#define WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7
-#define WGL_VIDEO_OUT_FRAME 0x20C8
-#define WGL_VIDEO_OUT_FIELD_1 0x20C9
-#define WGL_VIDEO_OUT_FIELD_2 0x20CA
-#define WGL_VIDEO_OUT_STACKED_FIELDS_1_2 0x20CB
-#define WGL_VIDEO_OUT_STACKED_FIELDS_2_1 0x20CC
-#endif
-
-#ifndef WGL_NV_swap_group
-#endif
-
-#ifndef WGL_NV_gpu_affinity
-#define WGL_ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0
-#define WGL_ERROR_MISSING_AFFINITY_MASK_NV 0x20D1
-#endif
-
-#ifndef WGL_AMD_gpu_association
-#define WGL_GPU_VENDOR_AMD 0x1F00
-#define WGL_GPU_RENDERER_STRING_AMD 0x1F01
-#define WGL_GPU_OPENGL_VERSION_STRING_AMD 0x1F02
-#define WGL_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2
-#define WGL_GPU_RAM_AMD 0x21A3
-#define WGL_GPU_CLOCK_AMD 0x21A4
-#define WGL_GPU_NUM_PIPES_AMD 0x21A5
-#define WGL_GPU_NUM_SIMD_AMD 0x21A6
-#define WGL_GPU_NUM_RB_AMD 0x21A7
-#define WGL_GPU_NUM_SPI_AMD 0x21A8
-#endif
-
-#ifndef WGL_NV_video_capture
-#define WGL_UNIQUE_ID_NV 0x20CE
-#define WGL_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF
-#endif
-
-#ifndef WGL_NV_copy_image
-#endif
-
-#ifndef WGL_NV_multisample_coverage
-#define WGL_COVERAGE_SAMPLES_NV 0x2042
-#define WGL_COLOR_SAMPLES_NV 0x20B9
-#endif
-
-#ifndef WGL_EXT_create_context_es2_profile
-#define WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004
-#endif
-
-#ifndef WGL_NV_DX_interop
-#define WGL_ACCESS_READ_ONLY_NV 0x00000000
-#define WGL_ACCESS_READ_WRITE_NV 0x00000001
-#define WGL_ACCESS_WRITE_DISCARD_NV 0x00000002
-#endif
-
-#ifndef WGL_NV_DX_interop2
-#endif
-
-#ifndef WGL_EXT_swap_control_tear
-#endif
-
-
-/*************************************************************/
-
-#ifndef WGL_ARB_pbuffer
-DECLARE_HANDLE(HPBUFFERARB);
-#endif
-#ifndef WGL_EXT_pbuffer
-DECLARE_HANDLE(HPBUFFEREXT);
-#endif
-#ifndef WGL_NV_present_video
-DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV);
-#endif
-#ifndef WGL_NV_video_output
-DECLARE_HANDLE(HPVIDEODEV);
-#endif
-#ifndef WGL_NV_gpu_affinity
-DECLARE_HANDLE(HPGPUNV);
-DECLARE_HANDLE(HGPUNV);
-
-typedef struct _GPU_DEVICE {
- DWORD cb;
- CHAR DeviceName[32];
- CHAR DeviceString[128];
- DWORD Flags;
- RECT rcVirtualScreen;
-} GPU_DEVICE, *PGPU_DEVICE;
-#endif
-#ifndef WGL_NV_video_capture
-DECLARE_HANDLE(HVIDEOINPUTDEVICENV);
-#endif
-
-#ifndef WGL_ARB_buffer_region
-#define WGL_ARB_buffer_region 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern HANDLE WINAPI wglCreateBufferRegionARB (HDC hDC, int iLayerPlane, UINT uType);
-extern VOID WINAPI wglDeleteBufferRegionARB (HANDLE hRegion);
-extern BOOL WINAPI wglSaveBufferRegionARB (HANDLE hRegion, int x, int y, int width, int height);
-extern BOOL WINAPI wglRestoreBufferRegionARB (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);
-#endif /* WGL_WGLEXT_PROTOTYPES */
-typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType);
-typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion);
-typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height);
-typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);
-#endif
-
-#ifndef WGL_ARB_multisample
-#define WGL_ARB_multisample 1
-#endif
-
-#ifndef WGL_ARB_extensions_string
-#define WGL_ARB_extensions_string 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern const char * WINAPI wglGetExtensionsStringARB (HDC hdc);
-#endif /* WGL_WGLEXT_PROTOTYPES */
-typedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc);
-#endif
-
-#ifndef WGL_ARB_pixel_format
-#define WGL_ARB_pixel_format 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern BOOL WINAPI wglGetPixelFormatAttribivARB (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues);
-extern BOOL WINAPI wglGetPixelFormatAttribfvARB (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues);
-extern BOOL WINAPI wglChoosePixelFormatARB (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
-#endif /* WGL_WGLEXT_PROTOTYPES */
-typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues);
-typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues);
-typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
-#endif
-
-#ifndef WGL_ARB_make_current_read
-#define WGL_ARB_make_current_read 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern BOOL WINAPI wglMakeContextCurrentARB (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
-extern HDC WINAPI wglGetCurrentReadDCARB (void);
-#endif /* WGL_WGLEXT_PROTOTYPES */
-typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
-typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (void);
-#endif
-
-#ifndef WGL_ARB_pbuffer
-#define WGL_ARB_pbuffer 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern HPBUFFERARB WINAPI wglCreatePbufferARB (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
-extern HDC WINAPI wglGetPbufferDCARB (HPBUFFERARB hPbuffer);
-extern int WINAPI wglReleasePbufferDCARB (HPBUFFERARB hPbuffer, HDC hDC);
-extern BOOL WINAPI wglDestroyPbufferARB (HPBUFFERARB hPbuffer);
-extern BOOL WINAPI wglQueryPbufferARB (HPBUFFERARB hPbuffer, int iAttribute, int *piValue);
-#endif /* WGL_WGLEXT_PROTOTYPES */
-typedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
-typedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer);
-typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC);
-typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer);
-typedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int *piValue);
-#endif
-
-#ifndef WGL_ARB_render_texture
-#define WGL_ARB_render_texture 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern BOOL WINAPI wglBindTexImageARB (HPBUFFERARB hPbuffer, int iBuffer);
-extern BOOL WINAPI wglReleaseTexImageARB (HPBUFFERARB hPbuffer, int iBuffer);
-extern BOOL WINAPI wglSetPbufferAttribARB (HPBUFFERARB hPbuffer, const int *piAttribList);
-#endif /* WGL_WGLEXT_PROTOTYPES */
-typedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
-typedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
-typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int *piAttribList);
-#endif
-
-#ifndef WGL_ARB_pixel_format_float
-#define WGL_ARB_pixel_format_float 1
-#endif
-
-#ifndef WGL_ARB_framebuffer_sRGB
-#define WGL_ARB_framebuffer_sRGB 1
-#endif
-
-#ifndef WGL_ARB_create_context
-#define WGL_ARB_create_context 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern HGLRC WINAPI wglCreateContextAttribsARB (HDC hDC, HGLRC hShareContext, const int *attribList);
-#endif /* WGL_WGLEXT_PROTOTYPES */
-typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int *attribList);
-#endif
-
-#ifndef WGL_ARB_create_context_profile
-#define WGL_ARB_create_context_profile 1
-#endif
-
-#ifndef WGL_ARB_create_context_robustness
-#define WGL_ARB_create_context_robustness 1
-#endif
-
-#ifndef WGL_EXT_display_color_table
-#define WGL_EXT_display_color_table 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern GLboolean WINAPI wglCreateDisplayColorTableEXT (GLushort id);
-extern GLboolean WINAPI wglLoadDisplayColorTableEXT (const GLushort *table, GLuint length);
-extern GLboolean WINAPI wglBindDisplayColorTableEXT (GLushort id);
-extern VOID WINAPI wglDestroyDisplayColorTableEXT (GLushort id);
-#endif /* WGL_WGLEXT_PROTOTYPES */
-typedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id);
-typedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (const GLushort *table, GLuint length);
-typedef GLboolean (WINAPI * PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id);
-typedef VOID (WINAPI * PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id);
-#endif
-
-#ifndef WGL_EXT_extensions_string
-#define WGL_EXT_extensions_string 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern const char * WINAPI wglGetExtensionsStringEXT (void);
-#endif /* WGL_WGLEXT_PROTOTYPES */
-typedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void);
-#endif
-
-#ifndef WGL_EXT_make_current_read
-#define WGL_EXT_make_current_read 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern BOOL WINAPI wglMakeContextCurrentEXT (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
-extern HDC WINAPI wglGetCurrentReadDCEXT (void);
-#endif /* WGL_WGLEXT_PROTOTYPES */
-typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
-typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (void);
-#endif
-
-#ifndef WGL_EXT_pbuffer
-#define WGL_EXT_pbuffer 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern HPBUFFEREXT WINAPI wglCreatePbufferEXT (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
-extern HDC WINAPI wglGetPbufferDCEXT (HPBUFFEREXT hPbuffer);
-extern int WINAPI wglReleasePbufferDCEXT (HPBUFFEREXT hPbuffer, HDC hDC);
-extern BOOL WINAPI wglDestroyPbufferEXT (HPBUFFEREXT hPbuffer);
-extern BOOL WINAPI wglQueryPbufferEXT (HPBUFFEREXT hPbuffer, int iAttribute, int *piValue);
-#endif /* WGL_WGLEXT_PROTOTYPES */
-typedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
-typedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer);
-typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC);
-typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer);
-typedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int *piValue);
-#endif
-
-#ifndef WGL_EXT_pixel_format
-#define WGL_EXT_pixel_format 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern BOOL WINAPI wglGetPixelFormatAttribivEXT (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues);
-extern BOOL WINAPI wglGetPixelFormatAttribfvEXT (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues);
-extern BOOL WINAPI wglChoosePixelFormatEXT (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
-#endif /* WGL_WGLEXT_PROTOTYPES */
-typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues);
-typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues);
-typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
-#endif
-
-#ifndef WGL_EXT_swap_control
-#define WGL_EXT_swap_control 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern BOOL WINAPI wglSwapIntervalEXT (int interval);
-extern int WINAPI wglGetSwapIntervalEXT (void);
-#endif /* WGL_WGLEXT_PROTOTYPES */
-typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval);
-typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void);
-#endif
-
-#ifndef WGL_EXT_depth_float
-#define WGL_EXT_depth_float 1
-#endif
-
-#ifndef WGL_NV_vertex_array_range
-#define WGL_NV_vertex_array_range 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern void* WINAPI wglAllocateMemoryNV (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
-extern void WINAPI wglFreeMemoryNV (void *pointer);
-#endif /* WGL_WGLEXT_PROTOTYPES */
-typedef void* (WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
-typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer);
-#endif
-
-#ifndef WGL_3DFX_multisample
-#define WGL_3DFX_multisample 1
-#endif
-
-#ifndef WGL_EXT_multisample
-#define WGL_EXT_multisample 1
-#endif
-
-#ifndef WGL_OML_sync_control
-#define WGL_OML_sync_control 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern BOOL WINAPI wglGetSyncValuesOML (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc);
-extern BOOL WINAPI wglGetMscRateOML (HDC hdc, INT32 *numerator, INT32 *denominator);
-extern INT64 WINAPI wglSwapBuffersMscOML (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder);
-extern INT64 WINAPI wglSwapLayerBuffersMscOML (HDC hdc, int fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder);
-extern BOOL WINAPI wglWaitForMscOML (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc);
-extern BOOL WINAPI wglWaitForSbcOML (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc);
-#endif /* WGL_WGLEXT_PROTOTYPES */
-typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc);
-typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32 *numerator, INT32 *denominator);
-typedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder);
-typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, int fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder);
-typedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc);
-typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc);
-#endif
-
-#ifndef WGL_I3D_digital_video_control
-#define WGL_I3D_digital_video_control 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern BOOL WINAPI wglGetDigitalVideoParametersI3D (HDC hDC, int iAttribute, int *piValue);
-extern BOOL WINAPI wglSetDigitalVideoParametersI3D (HDC hDC, int iAttribute, const int *piValue);
-#endif /* WGL_WGLEXT_PROTOTYPES */
-typedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue);
-typedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue);
-#endif
-
-#ifndef WGL_I3D_gamma
-#define WGL_I3D_gamma 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern BOOL WINAPI wglGetGammaTableParametersI3D (HDC hDC, int iAttribute, int *piValue);
-extern BOOL WINAPI wglSetGammaTableParametersI3D (HDC hDC, int iAttribute, const int *piValue);
-extern BOOL WINAPI wglGetGammaTableI3D (HDC hDC, int iEntries, USHORT *puRed, USHORT *puGreen, USHORT *puBlue);
-extern BOOL WINAPI wglSetGammaTableI3D (HDC hDC, int iEntries, const USHORT *puRed, const USHORT *puGreen, const USHORT *puBlue);
-#endif /* WGL_WGLEXT_PROTOTYPES */
-typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue);
-typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue);
-typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT *puRed, USHORT *puGreen, USHORT *puBlue);
-typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT *puRed, const USHORT *puGreen, const USHORT *puBlue);
-#endif
-
-#ifndef WGL_I3D_genlock
-#define WGL_I3D_genlock 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern BOOL WINAPI wglEnableGenlockI3D (HDC hDC);
-extern BOOL WINAPI wglDisableGenlockI3D (HDC hDC);
-extern BOOL WINAPI wglIsEnabledGenlockI3D (HDC hDC, BOOL *pFlag);
-extern BOOL WINAPI wglGenlockSourceI3D (HDC hDC, UINT uSource);
-extern BOOL WINAPI wglGetGenlockSourceI3D (HDC hDC, UINT *uSource);
-extern BOOL WINAPI wglGenlockSourceEdgeI3D (HDC hDC, UINT uEdge);
-extern BOOL WINAPI wglGetGenlockSourceEdgeI3D (HDC hDC, UINT *uEdge);
-extern BOOL WINAPI wglGenlockSampleRateI3D (HDC hDC, UINT uRate);
-extern BOOL WINAPI wglGetGenlockSampleRateI3D (HDC hDC, UINT *uRate);
-extern BOOL WINAPI wglGenlockSourceDelayI3D (HDC hDC, UINT uDelay);
-extern BOOL WINAPI wglGetGenlockSourceDelayI3D (HDC hDC, UINT *uDelay);
-extern BOOL WINAPI wglQueryGenlockMaxSourceDelayI3D (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay);
-#endif /* WGL_WGLEXT_PROTOTYPES */
-typedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC);
-typedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC);
-typedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL *pFlag);
-typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource);
-typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT *uSource);
-typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge);
-typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT *uEdge);
-typedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate);
-typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT *uRate);
-typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay);
-typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT *uDelay);
-typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay);
-#endif
-
-#ifndef WGL_I3D_image_buffer
-#define WGL_I3D_image_buffer 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern LPVOID WINAPI wglCreateImageBufferI3D (HDC hDC, DWORD dwSize, UINT uFlags);
-extern BOOL WINAPI wglDestroyImageBufferI3D (HDC hDC, LPVOID pAddress);
-extern BOOL WINAPI wglAssociateImageBufferEventsI3D (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count);
-extern BOOL WINAPI wglReleaseImageBufferEventsI3D (HDC hDC, const LPVOID *pAddress, UINT count);
-#endif /* WGL_WGLEXT_PROTOTYPES */
-typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags);
-typedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress);
-typedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count);
-typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const LPVOID *pAddress, UINT count);
-#endif
-
-#ifndef WGL_I3D_swap_frame_lock
-#define WGL_I3D_swap_frame_lock 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern BOOL WINAPI wglEnableFrameLockI3D (void);
-extern BOOL WINAPI wglDisableFrameLockI3D (void);
-extern BOOL WINAPI wglIsEnabledFrameLockI3D (BOOL *pFlag);
-extern BOOL WINAPI wglQueryFrameLockMasterI3D (BOOL *pFlag);
-#endif /* WGL_WGLEXT_PROTOTYPES */
-typedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (void);
-typedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (void);
-typedef BOOL (WINAPI * PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL *pFlag);
-typedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL *pFlag);
-#endif
-
-#ifndef WGL_I3D_swap_frame_usage
-#define WGL_I3D_swap_frame_usage 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern BOOL WINAPI wglGetFrameUsageI3D (float *pUsage);
-extern BOOL WINAPI wglBeginFrameTrackingI3D (void);
-extern BOOL WINAPI wglEndFrameTrackingI3D (void);
-extern BOOL WINAPI wglQueryFrameTrackingI3D (DWORD *pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage);
-#endif /* WGL_WGLEXT_PROTOTYPES */
-typedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float *pUsage);
-typedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void);
-typedef BOOL (WINAPI * PFNWGLENDFRAMETRACKINGI3DPROC) (void);
-typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD *pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage);
-#endif
-
-#ifndef WGL_ATI_pixel_format_float
-#define WGL_ATI_pixel_format_float 1
-#endif
-
-#ifndef WGL_NV_float_buffer
-#define WGL_NV_float_buffer 1
-#endif
-
-#ifndef WGL_3DL_stereo_control
-#define WGL_3DL_stereo_control 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern BOOL WINAPI wglSetStereoEmitterState3DL (HDC hDC, UINT uState);
-#endif /* WGL_WGLEXT_PROTOTYPES */
-typedef BOOL (WINAPI * PFNWGLSETSTEREOEMITTERSTATE3DLPROC) (HDC hDC, UINT uState);
-#endif
-
-#ifndef WGL_EXT_pixel_format_packed_float
-#define WGL_EXT_pixel_format_packed_float 1
-#endif
-
-#ifndef WGL_EXT_framebuffer_sRGB
-#define WGL_EXT_framebuffer_sRGB 1
-#endif
-
-#ifndef WGL_NV_present_video
-#define WGL_NV_present_video 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern int WINAPI wglEnumerateVideoDevicesNV (HDC hDC, HVIDEOOUTPUTDEVICENV *phDeviceList);
-extern BOOL WINAPI wglBindVideoDeviceNV (HDC hDC, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int *piAttribList);
-extern BOOL WINAPI wglQueryCurrentContextNV (int iAttribute, int *piValue);
-#endif /* WGL_WGLEXT_PROTOTYPES */
-typedef int (WINAPI * PFNWGLENUMERATEVIDEODEVICESNVPROC) (HDC hDC, HVIDEOOUTPUTDEVICENV *phDeviceList);
-typedef BOOL (WINAPI * PFNWGLBINDVIDEODEVICENVPROC) (HDC hDC, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int *piAttribList);
-typedef BOOL (WINAPI * PFNWGLQUERYCURRENTCONTEXTNVPROC) (int iAttribute, int *piValue);
-#endif
-
-#ifndef WGL_NV_video_output
-#define WGL_NV_video_output 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern BOOL WINAPI wglGetVideoDeviceNV (HDC hDC, int numDevices, HPVIDEODEV *hVideoDevice);
-extern BOOL WINAPI wglReleaseVideoDeviceNV (HPVIDEODEV hVideoDevice);
-extern BOOL WINAPI wglBindVideoImageNV (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer);
-extern BOOL WINAPI wglReleaseVideoImageNV (HPBUFFERARB hPbuffer, int iVideoBuffer);
-extern BOOL WINAPI wglSendPbufferToVideoNV (HPBUFFERARB hPbuffer, int iBufferType, unsigned long *pulCounterPbuffer, BOOL bBlock);
-extern BOOL WINAPI wglGetVideoInfoNV (HPVIDEODEV hpVideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
-#endif /* WGL_WGLEXT_PROTOTYPES */
-typedef BOOL (WINAPI * PFNWGLGETVIDEODEVICENVPROC) (HDC hDC, int numDevices, HPVIDEODEV *hVideoDevice);
-typedef BOOL (WINAPI * PFNWGLRELEASEVIDEODEVICENVPROC) (HPVIDEODEV hVideoDevice);
-typedef BOOL (WINAPI * PFNWGLBINDVIDEOIMAGENVPROC) (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer);
-typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOIMAGENVPROC) (HPBUFFERARB hPbuffer, int iVideoBuffer);
-typedef BOOL (WINAPI * PFNWGLSENDPBUFFERTOVIDEONVPROC) (HPBUFFERARB hPbuffer, int iBufferType, unsigned long *pulCounterPbuffer, BOOL bBlock);
-typedef BOOL (WINAPI * PFNWGLGETVIDEOINFONVPROC) (HPVIDEODEV hpVideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
-#endif
-
-#ifndef WGL_NV_swap_group
-#define WGL_NV_swap_group 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern BOOL WINAPI wglJoinSwapGroupNV (HDC hDC, GLuint group);
-extern BOOL WINAPI wglBindSwapBarrierNV (GLuint group, GLuint barrier);
-extern BOOL WINAPI wglQuerySwapGroupNV (HDC hDC, GLuint *group, GLuint *barrier);
-extern BOOL WINAPI wglQueryMaxSwapGroupsNV (HDC hDC, GLuint *maxGroups, GLuint *maxBarriers);
-extern BOOL WINAPI wglQueryFrameCountNV (HDC hDC, GLuint *count);
-extern BOOL WINAPI wglResetFrameCountNV (HDC hDC);
-#endif /* WGL_WGLEXT_PROTOTYPES */
-typedef BOOL (WINAPI * PFNWGLJOINSWAPGROUPNVPROC) (HDC hDC, GLuint group);
-typedef BOOL (WINAPI * PFNWGLBINDSWAPBARRIERNVPROC) (GLuint group, GLuint barrier);
-typedef BOOL (WINAPI * PFNWGLQUERYSWAPGROUPNVPROC) (HDC hDC, GLuint *group, GLuint *barrier);
-typedef BOOL (WINAPI * PFNWGLQUERYMAXSWAPGROUPSNVPROC) (HDC hDC, GLuint *maxGroups, GLuint *maxBarriers);
-typedef BOOL (WINAPI * PFNWGLQUERYFRAMECOUNTNVPROC) (HDC hDC, GLuint *count);
-typedef BOOL (WINAPI * PFNWGLRESETFRAMECOUNTNVPROC) (HDC hDC);
-#endif
-
-#ifndef WGL_NV_gpu_affinity
-#define WGL_NV_gpu_affinity 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern BOOL WINAPI wglEnumGpusNV (UINT iGpuIndex, HGPUNV *phGpu);
-extern BOOL WINAPI wglEnumGpuDevicesNV (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice);
-extern HDC WINAPI wglCreateAffinityDCNV (const HGPUNV *phGpuList);
-extern BOOL WINAPI wglEnumGpusFromAffinityDCNV (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu);
-extern BOOL WINAPI wglDeleteDCNV (HDC hdc);
-#endif /* WGL_WGLEXT_PROTOTYPES */
-typedef BOOL (WINAPI * PFNWGLENUMGPUSNVPROC) (UINT iGpuIndex, HGPUNV *phGpu);
-typedef BOOL (WINAPI * PFNWGLENUMGPUDEVICESNVPROC) (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice);
-typedef HDC (WINAPI * PFNWGLCREATEAFFINITYDCNVPROC) (const HGPUNV *phGpuList);
-typedef BOOL (WINAPI * PFNWGLENUMGPUSFROMAFFINITYDCNVPROC) (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu);
-typedef BOOL (WINAPI * PFNWGLDELETEDCNVPROC) (HDC hdc);
-#endif
-
-#ifndef WGL_AMD_gpu_association
-#define WGL_AMD_gpu_association 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern UINT WINAPI wglGetGPUIDsAMD (UINT maxCount, UINT *ids);
-extern INT WINAPI wglGetGPUInfoAMD (UINT id, int property, GLenum dataType, UINT size, void *data);
-extern UINT WINAPI wglGetContextGPUIDAMD (HGLRC hglrc);
-extern HGLRC WINAPI wglCreateAssociatedContextAMD (UINT id);
-extern HGLRC WINAPI wglCreateAssociatedContextAttribsAMD (UINT id, HGLRC hShareContext, const int *attribList);
-extern BOOL WINAPI wglDeleteAssociatedContextAMD (HGLRC hglrc);
-extern BOOL WINAPI wglMakeAssociatedContextCurrentAMD (HGLRC hglrc);
-extern HGLRC WINAPI wglGetCurrentAssociatedContextAMD (void);
-extern VOID WINAPI wglBlitContextFramebufferAMD (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-#endif /* WGL_WGLEXT_PROTOTYPES */
-typedef UINT (WINAPI * PFNWGLGETGPUIDSAMDPROC) (UINT maxCount, UINT *ids);
-typedef INT (WINAPI * PFNWGLGETGPUINFOAMDPROC) (UINT id, int property, GLenum dataType, UINT size, void *data);
-typedef UINT (WINAPI * PFNWGLGETCONTEXTGPUIDAMDPROC) (HGLRC hglrc);
-typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC) (UINT id);
-typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (UINT id, HGLRC hShareContext, const int *attribList);
-typedef BOOL (WINAPI * PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC) (HGLRC hglrc);
-typedef BOOL (WINAPI * PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (HGLRC hglrc);
-typedef HGLRC (WINAPI * PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void);
-typedef VOID (WINAPI * PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC) (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-#endif
-
-#ifndef WGL_NV_video_capture
-#define WGL_NV_video_capture 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern BOOL WINAPI wglBindVideoCaptureDeviceNV (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice);
-extern UINT WINAPI wglEnumerateVideoCaptureDevicesNV (HDC hDc, HVIDEOINPUTDEVICENV *phDeviceList);
-extern BOOL WINAPI wglLockVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
-extern BOOL WINAPI wglQueryVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int *piValue);
-extern BOOL WINAPI wglReleaseVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
-#endif /* WGL_WGLEXT_PROTOTYPES */
-typedef BOOL (WINAPI * PFNWGLBINDVIDEOCAPTUREDEVICENVPROC) (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice);
-typedef UINT (WINAPI * PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC) (HDC hDc, HVIDEOINPUTDEVICENV *phDeviceList);
-typedef BOOL (WINAPI * PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
-typedef BOOL (WINAPI * PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int *piValue);
-typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
-#endif
-
-#ifndef WGL_NV_copy_image
-#define WGL_NV_copy_image 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern BOOL WINAPI wglCopyImageSubDataNV (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
-#endif /* WGL_WGLEXT_PROTOTYPES */
-typedef BOOL (WINAPI * PFNWGLCOPYIMAGESUBDATANVPROC) (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
-#endif
-
-#ifndef WGL_NV_multisample_coverage
-#define WGL_NV_multisample_coverage 1
-#endif
-
-#ifndef WGL_NV_DX_interop
-#define WGL_NV_DX_interop 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern BOOL WINAPI wglDXSetResourceShareHandleNV (void *dxObject, HANDLE shareHandle);
-extern HANDLE WINAPI wglDXOpenDeviceNV (void *dxDevice);
-extern BOOL WINAPI wglDXCloseDeviceNV (HANDLE hDevice);
-extern HANDLE WINAPI wglDXRegisterObjectNV (HANDLE hDevice, void *dxObject, GLuint name, GLenum type, GLenum access);
-extern BOOL WINAPI wglDXUnregisterObjectNV (HANDLE hDevice, HANDLE hObject);
-extern BOOL WINAPI wglDXObjectAccessNV (HANDLE hObject, GLenum access);
-extern BOOL WINAPI wglDXLockObjectsNV (HANDLE hDevice, GLint count, HANDLE *hObjects);
-extern BOOL WINAPI wglDXUnlockObjectsNV (HANDLE hDevice, GLint count, HANDLE *hObjects);
-#endif /* WGL_WGLEXT_PROTOTYPES */
-typedef BOOL (WINAPI * PFNWGLDXSETRESOURCESHAREHANDLENVPROC) (void *dxObject, HANDLE shareHandle);
-typedef HANDLE (WINAPI * PFNWGLDXOPENDEVICENVPROC) (void *dxDevice);
-typedef BOOL (WINAPI * PFNWGLDXCLOSEDEVICENVPROC) (HANDLE hDevice);
-typedef HANDLE (WINAPI * PFNWGLDXREGISTEROBJECTNVPROC) (HANDLE hDevice, void *dxObject, GLuint name, GLenum type, GLenum access);
-typedef BOOL (WINAPI * PFNWGLDXUNREGISTEROBJECTNVPROC) (HANDLE hDevice, HANDLE hObject);
-typedef BOOL (WINAPI * PFNWGLDXOBJECTACCESSNVPROC) (HANDLE hObject, GLenum access);
-typedef BOOL (WINAPI * PFNWGLDXLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE *hObjects);
-typedef BOOL (WINAPI * PFNWGLDXUNLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE *hObjects);
-#endif
-
-#ifndef WGL_NV_DX_interop2
-#define WGL_NV_DX_interop2 1
-#endif
-
-#ifndef WGL_EXT_swap_control_tear
-#define WGL_EXT_swap_control_tear 1
-#endif
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
+++ /dev/null
-#! /bin/bash
-# Copyright 2008 (C) Intel Corporation
-#
-# 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
-# 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.
-#
-# echo names of functions that are legal between a glBegin and glEnd pair.
-echo -e MAGIC_MACRO\(glVertex{2,3,4}{s,i,f,d}{,v}\)\\n
-echo -e MAGIC_MACRO\(glTexCoord{1,2,3,4}{s,i,f,d}{,v}\)\\n
-echo -e MAGIC_MACRO\(glMultiTexCoord{1,2,3,4}{s,i,f,d}{,v}\)\\n
-echo -e MAGIC_MACRO\(glNormal3{b,s,i,f,d}{,v}\)\\n
-echo -e MAGIC_MACRO\(glFogCoord{f,d}{,v}\)\\n
-echo -e MAGIC_MACRO\(glColor{3,4}{b,s,i,f,d,ub,us,ui}{,v}\)\\n
-echo -e MAGIC_MACRO\(glSecondaryColor3{b,s,i,f,d,ub,us,ui}{,v}\)\\n
-echo -e MAGIC_MACRO\(glIndex{s,i,f,d,ub}{,v}\)\\n
-echo -e MAGIC_MACRO\(glVertexAttrib{1,2,3,4}{s,f,d}{,v}\)\\n
-echo -e MAGIC_MACRO\(glVertexAttrib4{b,i,ub,us,ui}v\)\\n
-echo -e MAGIC_MACRO\(glVertexAttrib4Nub\)\\n
-echo -e MAGIC_MACRO\(glVertexAttrib4N{b,s,i,ub,us,ui}v\)\\n
-echo -e MAGIC_MACRO\(glArrayElement\)\\n
-echo -e MAGIC_MACRO\(glEvalCoord{1,2}{f,d}{,v}\)\\n
-echo -e MAGIC_MACRO\(glEvalPoint{1,2}\)\\n
-echo -e MAGIC_MACRO\(glMaterial{i,f}{,v}\)\\n
-echo -e MAGIC_MACRO\(glCallList\)\\n
-echo -e MAGIC_MACRO\(glCallLists\)\\n
-echo -e MAGIC_MACRO\(glEdgeFlag{,v}\)\\n
+++ /dev/null
-/*
- * Hand-implemented GL/GLX API
- *
- * Copyright (c) 2006,2007 Even Rouault
- *
- * 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
- * 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.
- */
-
-MAGIC_MACRO(_init32),
-MAGIC_MACRO(_init64),
-MAGIC_MACRO(_resize_surface),
-MAGIC_MACRO(_render_surface),
-
-/* When you add a glX call here, you HAVE TO update IS_GLX_CALL */
-MAGIC_MACRO(glXChooseVisual),
-MAGIC_MACRO(glXQueryExtensionsString),
-MAGIC_MACRO(glXQueryServerString),
-MAGIC_MACRO(glXCreateContext),
-MAGIC_MACRO(glXCopyContext),
-MAGIC_MACRO(glXDestroyContext),
-MAGIC_MACRO(glXGetClientString),
-MAGIC_MACRO(glXQueryVersion),
-MAGIC_MACRO(glXMakeCurrent),
-MAGIC_MACRO(glXGetConfig),
-MAGIC_MACRO(glXGetConfig_extended),
-MAGIC_MACRO(glXWaitGL),
-MAGIC_MACRO(glXWaitX),
-MAGIC_MACRO(glXGetFBConfigAttrib_extended),
-MAGIC_MACRO(glXChooseFBConfig),
-MAGIC_MACRO(glXGetFBConfigs),
-MAGIC_MACRO(glXCreateNewContext),
-MAGIC_MACRO(glXGetVisualFromFBConfig),
-MAGIC_MACRO(glXGetFBConfigAttrib),
-MAGIC_MACRO(glXQueryContext),
-MAGIC_MACRO(glXQueryDrawable),
-MAGIC_MACRO(glXUseXFont),
-MAGIC_MACRO(glXIsDirect),
-MAGIC_MACRO(glXGetProcAddress_fake),
-MAGIC_MACRO(glXGetProcAddress_global_fake),
-MAGIC_MACRO(glXSwapBuffers),
-MAGIC_MACRO(glXQueryExtension),
-MAGIC_MACRO(glXGetScreenDriver),
-MAGIC_MACRO(glXGetDriverConfig),
-MAGIC_MACRO(glXSwapIntervalSGI),
-MAGIC_MACRO(glXCreatePixmap),
-MAGIC_MACRO(glXDestroyPixmap),
-MAGIC_MACRO(glXBindTexImageARB_fake),
-MAGIC_MACRO(glXReleaseTexImageARB_fake),
-MAGIC_MACRO(glXCreatePbuffer),
-MAGIC_MACRO(glXDestroyPbuffer),
-
-MAGIC_MACRO(glGetString),
-
-MAGIC_MACRO(glShaderSourceARB_fake),
-MAGIC_MACRO(glShaderSource_fake),
-MAGIC_MACRO(glVertexPointer_fake),
-MAGIC_MACRO(glNormalPointer_fake),
-MAGIC_MACRO(glColorPointer_fake),
-MAGIC_MACRO(glSecondaryColorPointer_fake),
-MAGIC_MACRO(glIndexPointer_fake),
-MAGIC_MACRO(glTexCoordPointer_fake),
-MAGIC_MACRO(glEdgeFlagPointer_fake),
-MAGIC_MACRO(glVertexAttribPointerARB_fake),
-MAGIC_MACRO(glVertexAttribPointerNV_fake),
-MAGIC_MACRO(glWeightPointerARB_fake),
-MAGIC_MACRO(glMatrixIndexPointerARB_fake),
-MAGIC_MACRO(glFogCoordPointer_fake),
-MAGIC_MACRO(glVariantPointerEXT_fake),
-MAGIC_MACRO(glInterleavedArrays_fake),
-MAGIC_MACRO(glElementPointerATI_fake),
-MAGIC_MACRO(glTuxRacerDrawElements_fake),
-MAGIC_MACRO(glVertexAndNormalPointer_fake),
-MAGIC_MACRO(glTexCoordPointer01_fake),
-MAGIC_MACRO(glTexCoordPointer012_fake),
-MAGIC_MACRO(glVertexNormalPointerInterlaced_fake),
-MAGIC_MACRO(glVertexNormalColorPointerInterlaced_fake),
-MAGIC_MACRO(glVertexColorTexCoord0PointerInterlaced_fake),
-MAGIC_MACRO(glVertexNormalTexCoord0PointerInterlaced_fake),
-MAGIC_MACRO(glVertexNormalTexCoord01PointerInterlaced_fake),
-MAGIC_MACRO(glVertexNormalTexCoord012PointerInterlaced_fake),
-MAGIC_MACRO(glVertexNormalColorTexCoord0PointerInterlaced_fake),
-MAGIC_MACRO(glVertexNormalColorTexCoord01PointerInterlaced_fake),
-MAGIC_MACRO(glVertexNormalColorTexCoord012PointerInterlaced_fake),
-MAGIC_MACRO(glGenTextures_fake),
-MAGIC_MACRO(glGenBuffersARB_fake),
-MAGIC_MACRO(glGenLists_fake),
-MAGIC_MACRO(glEGLImageTargetTexture2DOES_fake),
-MAGIC_MACRO(_glDrawElements_buffer),
-MAGIC_MACRO(_glDrawRangeElements_buffer),
-MAGIC_MACRO(_glMultiDrawElements_buffer),
-MAGIC_MACRO(_glVertexPointer_buffer),
-MAGIC_MACRO(_glNormalPointer_buffer),
-MAGIC_MACRO(_glColorPointer_buffer),
-MAGIC_MACRO(_glSecondaryColorPointer_buffer),
-MAGIC_MACRO(_glIndexPointer_buffer),
-MAGIC_MACRO(_glTexCoordPointer_buffer),
-MAGIC_MACRO(_glEdgeFlagPointer_buffer),
-MAGIC_MACRO(_glVertexAttribPointerARB_buffer),
-MAGIC_MACRO(_glWeightPointerARB_buffer),
-MAGIC_MACRO(_glMatrixIndexPointerARB_buffer),
-MAGIC_MACRO(_glFogCoordPointer_buffer),
-MAGIC_MACRO(_glVariantPointerEXT_buffer),
-MAGIC_MACRO(_glGetError_fake),
-MAGIC_MACRO(_glReadPixels_pbo),
-MAGIC_MACRO(_glDrawPixels_pbo),
-MAGIC_MACRO(_glMapBufferARB_fake),
-MAGIC_MACRO(_glSelectBuffer_fake),
-MAGIC_MACRO(_glGetSelectBuffer_fake),
-MAGIC_MACRO(_glFeedbackBuffer_fake),
-MAGIC_MACRO(_glGetFeedbackBuffer_fake),
+++ /dev/null
-/*
- * Offscreen OpenGL abstraction layer
- *
- * Copyright (c) 2010 Intel Corporation
- * Written by:
- * Gordon Williams <gordon.williams@collabora.co.uk>
- * Ian Molton <ian.molton@collabora.co.uk>
- *
- * 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
- * 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 GLOFFSCREEN_H_
-#define GLOFFSCREEN_H_
-
-/* Used to hold data for the OpenGL context */
-struct _GloContext;
-typedef struct _GloContext GloContext;
-/* Used to hold data for an offscreen surface. */
-struct _GloSurface;
-typedef struct _GloSurface GloSurface;
-
-/* Format flags for glo_surface_create */
-#define GLO_FF_ALPHA_MASK (0x0001)
-#define GLO_FF_NOALPHA (0x0000)
-#define GLO_FF_ALPHA (0x0001)
-
-#define GLO_FF_BITS_MASK (0x00F0)
-#define GLO_FF_BITS_16 (0x0020)
-#define GLO_FF_BITS_24 (0x0030)
-#define GLO_FF_BITS_32 (0x0040)
-
-#define GLO_FF_DEPTH_MASK (0x0F00)
-#define GLO_FF_DEPTH_16 (0x0100)
-#define GLO_FF_DEPTH_24 (0x0200)
-#define GLO_FF_DEPTH_32 (0x0300)
-
-#define GLO_FF_STENCIL_MASK (0xF000)
-#define GLO_FF_STENCIL_8 (0x1000)
-
-/* The only currently supported format */
-#define GLO_FF_DEFAULT (GLO_FF_BITS_24|GLO_FF_DEPTH_24)
-
-/* Has gloffscreen been previously initialised? */
-extern int glo_initialised(void);
-
-/* Initialise gloffscreen */
-extern int glo_init(void);
-
-/* Uninitialise gloffscreen */
-extern void glo_kill(void);
-
-/* Like wglGetProcAddress/glxGetProcAddress */
-extern void *glo_getprocaddress(const char *procName);
-
-/* OS-independent glXQueryExtensionsString */
-extern const char *glo_glXQueryExtensionsString(void);
-
-/* Create a light-weight context just for creating surface */
-extern GloContext *__glo_context_create(int formatFlags);
-
-/* Create an OpenGL context for a certain pixel format. formatflags are from the GLO_ constants */
-extern GloContext *glo_context_create(int formatFlags, GloContext *shareLists);
-
-/* Destroy a previouslu created OpenGL context */
-extern void glo_context_destroy(GloContext *context);
-
-/* Update the context in surface and free previous light-weight context */
-extern void glo_surface_update_context(GloSurface *surface, GloContext *context, int free_flags);
-
-/* Link the pixmap/pbuffer associated with surface as texture.
- * ctxt is the target context for the texture operation
- */
-extern void glo_surface_as_texture(GloContext *ctxt, GloSurface *surface, int surface_type);
-
-/* Create a surface with given width and height, */
-extern GloSurface *glo_surface_create(int width, int height, GloContext *context);
-
-/* Destroy the given surface */
-extern void glo_surface_destroy(GloSurface *surface);
-
-/* Make the given surface current */
-extern int glo_surface_makecurrent(GloSurface *surface);
-
-/* Get the contents of the given surface. Note that this is top-down, not
- * bottom-up as glReadPixels would do. */
-extern void glo_surface_getcontents(GloSurface *surface, int stride, int type, void *data);
-
-/* Return the width and height of the given surface */
-extern void glo_surface_get_size(GloSurface *surface, int *width, int *height);
-
-/* Functions to decode the format flags */
-extern int glo_flags_get_depth_bits(int formatFlags);
-extern int glo_flags_get_stencil_bits(int formatFlags);
-extern void glo_flags_get_rgba_bits(int formatFlags, int *rgba);
-extern int glo_flags_get_bytes_per_pixel(int formatFlags);
-extern void glo_flags_get_readpixel_type(int formatFlags, int *glFormat, int *glType);
-/* Score how close the given format flags match. 0=great, >0 not so great */
-extern int glo_flags_score(int formatFlagsExpected, int formatFlagsReal);
-
-/* Create a set of format flags from a null-terminated list
- * of GLX fbConfig flags. If assumeBooleans is set, items such
- * as GLX_RGBA/GLX_DOUBLEBUFFER are treated as booleans, not key-value pairs
- * (glXChooseVisual treats them as booleans, glXChooseFBConfig as key-value pairs)
- */
-extern int glo_flags_get_from_glx(const int *fbConfig, int assumeBooleans);
-/* Use in place of glxGetConfig - returns information from flags based on a GLX enum */
-extern int glo_get_glx_from_flags(int formatFlags, int glxEnum);
-
-/* Get the width and height from attrib_list */
-extern void glo_geometry_get_from_glx(const int* attrib_list, int* width, int* height);
-
-extern void glo_surface_release_texture(GloSurface *surface);
-extern void glo_surface_updatecontents(GloSurface *surface);
-
-/* In terms of speed, glReadPixels actually seems the best we can do.
- * * On Windows PFB_DRAW_TO_BITMAP is software-only.
- * * http://www.opengl.org/registry/specs/ARB/pixel_buffer_object.txt would be
- * useful if we didn't want the data right away (as we could avoid flushing the
- * pipeline).
- * * The internal data format seems to be GL_BGRA - and this is indeed faster.
- * * Apple suggests using GL_UNSIGNED_INT_8_8_8_8_REV instead of
- * GL_UNSIGNED_BYTE, but there don't appear to be any speed increase from
- * doing this on Windows at least.
- */
-
-#endif /* GLOFFSCREEN_H_ */
+++ /dev/null
-/*Offscreen OpenGL abstraction layer - AGL specific
-*
-* Copyright (c) 2010 Intel Corporation
-*
-* 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
-* 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.
-*/
-#ifdef __APPLE__
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <inttypes.h>
-#include <dlfcn.h>
-#include <glib.h>
-
-/*hack due to conflicting typedefs in qemu's softfloat.h*/
-#define __SECURITYHI__ 1
-
-#include <OpenGL/OpenGL.h>
-#include <AGL/agl.h>
-#include "gloffscreen.h"
-
-#ifdef GL_DEBUG
-#define TRACE(fmt, ...) printf("%s@%d: " fmt "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__)
-#else
-#define TRACE(...)
-#endif
-
-
-
-struct _GloContext
-{
- GLuint formatFlags;
- AGLPixelFormat pixelFormat;
- AGLContext context;
- };
-
-struct _GloSurface
-{
- GLuint width;
- GLuint height;
- GloContext *context;
- AGLPbuffer pbuffer;
- };
-
-extern void glo_surface_getcontents_readpixels(int formatFlags, int stride,
- int bpp, int width, int height,
- void *data, int noflip);
-
-
-
-/* Initialise gloffscreen */
-int glo_init(void)
-{
- int major, minor;
- aglGetVersion(&major, &minor);
- fprintf(stdout, "%s----AGL version %d.%d\n",__FUNCTION__, major, minor);
- return 0;
- }
-
-/* Uninitialise gloffscreen */
-void glo_kill(void)
-{
-
-}
-
-const char *glo_glXQueryExtensionsString(void)
-{
- return "";
- }
-
-/* Like wglGetProcAddress/glxGetProcAddress */
- void *glo_getprocaddress(const char *procName)
- {
- void *ret = NULL;
-
- if (procName)
- {
- if (!strncmp(procName, "glX", 3))
- ret = (void *)1;
- else
- ret = dlsym(RTLD_NEXT, procName);
- }
-
-#if 0//standard code for mac to look up procaddress, but seems slow that above.
- NSSymbol symbol;
- char *symbolname;
- symbolname = malloc(strlen(procName) +2);
- strcpy(symbolname +1, procName);
- symbolname[0] = '_';
- symbol = NULL;
- if(NSIsSymbolNameDefined(symbolname))
- symbol = NSLookupAndBindSymbol(symbolname);
- free(symbolname);
- ret = symbol ? NSAddressOfSymbol (symbol) : NULL;
-#endif
- TRACE("'%s' --> %p", procName, ret);
- return ret;
-}
-
-/* Create an OpenGL context for a certain pixel format.
-* formatflags are from the GLO_ constants
-*/
-
-GloContext *__glo_context_create(int formatFlags)
-{
- int rgba[4];
- glo_flags_get_rgba_bits(formatFlags, rgba);
- const int attribs[] = {
- AGL_RGBA,
- AGL_MINIMUM_POLICY,
- AGL_PIXEL_SIZE, glo_flags_get_bytes_per_pixel(formatFlags) * 8,
- AGL_RED_SIZE, rgba[0],
- AGL_GREEN_SIZE, rgba[1],
- AGL_BLUE_SIZE, rgba[2],
- AGL_ALPHA_SIZE, rgba[3],
- AGL_DEPTH_SIZE, glo_flags_get_depth_bits(formatFlags),
- AGL_STENCIL_SIZE, glo_flags_get_stencil_bits(formatFlags),
- AGL_ACCELERATED,
- AGL_NO_RECOVERY,
- AGL_NONE
- };
-
- TRACE("req %dbpp %d-%d-%d-%d depth %d stencil %d",
- glo_flags_get_bytes_per_pixel(formatFlags) * 8,
- rgba[0], rgba[1], rgba[2], rgba[3],
- glo_flags_get_depth_bits(formatFlags),
- glo_flags_get_stencil_bits(formatFlags));
-
- AGLPixelFormat pf = aglChoosePixelFormat(NULL, 0, attribs);
- if (pf == NULL)
- fprintf(stderr, "No matching pixelformat found.");
- else
- {
- GLint bpp = 0, a = 0, d = 0, s = 0;
- aglDescribePixelFormat(pf, AGL_PIXEL_SIZE, &bpp);
- aglDescribePixelFormat(pf, AGL_ALPHA_SIZE, &a);
- aglDescribePixelFormat(pf, AGL_DEPTH_SIZE, &d);
- aglDescribePixelFormat(pf, AGL_STENCIL_SIZE, &s);
-
- formatFlags &= ~(GLO_FF_ALPHA_MASK | GLO_FF_BITS_MASK | GLO_FF_DEPTH_MASK | GLO_FF_STENCIL_MASK);
- switch (bpp) {
- case 16: formatFlags |= GLO_FF_BITS_16; break;
- case 24: formatFlags |= GLO_FF_BITS_24; break;
- case 32: formatFlags |= GLO_FF_BITS_32; break;
- default: fprintf(stderr, "got unsupported bpp %d", bpp); break;
- }
-
- if (a > 0)
- {
- formatFlags |= GLO_FF_ALPHA;
- }
-
- switch (d) {
- case 0: break;
- case 16: formatFlags |= GLO_FF_DEPTH_16; break;
- case 24: formatFlags |= GLO_FF_DEPTH_24; break;
- case 32: formatFlags |= GLO_FF_DEPTH_32; break;
- default: fprintf(stderr, "got unsupported depth %d", d); break;
- }
-
- switch (s) {
- case 0: break;
- case 8: formatFlags |= GLO_FF_STENCIL_8; break;
- default: fprintf(stderr, "got unsupported stencil %d", s); break;
- }
- }
- GloContext *context = (GloContext *)g_malloc(sizeof(*context));
-
- memset(context, 0, sizeof(*context));
- context->formatFlags = formatFlags;
- context->pixelFormat = pf;
-
- return context;
-
-}
-
-GloContext *glo_context_create(int formatFlags, GloContext *shareLists)
-{
- GloContext *context = __glo_context_create(formatFlags);
- if(!context)
- return NULL;
-
- context->context = aglCreateContext(context->pixelFormat, shareLists ? shareLists->context : NULL);
- if (context->context == NULL)
- {
- fprintf(stderr, "aglCreateContext failed: %s", aglErrorString(aglGetError()));
- }
-
- else
- {
- if(context->pixelFormat != NULL)
- {
- aglDestroyPixelFormat(context->pixelFormat);
- context->pixelFormat = NULL;
- }
- }
-
- TRACE("context=%p", context);
- return context;
-}
-
-/* Destroy a previously created OpenGL context */
-void glo_context_destroy(GloContext *context)
-{
- TRACE("context=%p", context);
- if (context)
- {
- aglDestroyContext(context->context);
- if(context->pixelFormat != NULL)
- {
- aglDestroyPixelFormat(context->pixelFormat);
- context->pixelFormat = NULL;
- }
- context->context = NULL;
- g_free(context);
- }
-}
-
-void glo_surface_update_context(GloSurface *surface, GloContext *context, int free_flags)
-{
- if ( surface->context )
- {
- if ( free_flags) /* light-weight context */
- g_free(surface->context);
- }
- surface->context = context;
-}
-
-
-
-/* Create a surface with given width and height, formatflags are from the
- * GLO_ constants */
-GloSurface *glo_surface_create(int width, int height, GloContext *context)
-{
- GloSurface *surface = NULL;
- if (context)
- {
- surface = (GloSurface *)g_malloc(sizeof(*surface));
- memset(surface, 0, sizeof(*surface));
- surface->width = width;
- surface->height = height;
- surface->context = context;
-
- TRACE("%dx%d", surface->width, surface->height);
- if (aglCreatePBuffer(width, height, GL_TEXTURE_2D, GL_RGBA, 0, &surface->pbuffer) == GL_FALSE)
- fprintf(stderr, "aglCreatePbuffer failed: %s", aglErrorString(aglGetError()));
-
- }
- TRACE("surface=%p", surface);
- return surface;
-}
-
-/* Destroy the given surface */
-void glo_surface_destroy(GloSurface *surface)
-{
- TRACE("surface=%p", surface);
- if (surface)
- {
- aglDestroyPBuffer(surface->pbuffer);
- surface->pbuffer = NULL;
- g_free(surface);
- }
-}
-
-/* Make the given surface current */
-int glo_surface_makecurrent(GloSurface *surface)
-{
- int ret = GL_FALSE;
- TRACE("surface=%p", surface);
- if (surface)
- {
- if (aglSetPBuffer(surface->context->context, surface->pbuffer, 0, 0, 0) == GL_FALSE)
- fprintf(stderr, "aglSetPbuffer failed: %s", aglErrorString(aglGetError()));
- ret = aglSetCurrentContext(surface->context->context);
- } else
- {
- ret = aglSetCurrentContext(NULL);
- }
-
- if (ret == GL_FALSE)
- fprintf(stderr, "aglSetCurrentContext failed: %s", aglErrorString(aglGetError()));
-
- TRACE("Return ret=%d\n", ret);
- return ret;
- }
-
-void glo_surface_updatecontents(GloSurface *surface)
-{
- const GLint swap_interval = 1;
-
- if(!surface)
- return;
- aglSwapBuffers(surface->context->context);
- aglSetInteger(surface->context->context, AGL_SWAP_INTERVAL, &swap_interval);
-}
-
-
-/* Get the contents of the given surface */
-void glo_surface_getcontents(GloSurface *surface, int stride, int bpp,
- void *data)
-{
- const GLint swap_interval = 1;
- if (surface)
- {
- aglSwapBuffers(surface->context->context);
- aglSetInteger(surface->context->context, AGL_SWAP_INTERVAL, &swap_interval);
- glo_surface_getcontents_readpixels(surface->context->formatFlags, stride, bpp, surface->width, surface->height, data, 0);
- }
-}
-
-/* Return the width and height of the given surface */
-void glo_surface_get_size(GloSurface *surface, int *width, int *height)
-{
- if (width)
- {
- *width = surface->width;
- }
-
- if (height)
- {
- *height = surface->height;
- }
-}
-
-/* Bind the surface as texture */
-void glo_surface_as_texture(GloContext *ctxt, GloSurface *surface, int surface_type)
-{
-#if 0
- //Not QUit sure about this function;
- int glFormat, glType;
- glo_surface_updatecontents(surface);
- /*XXX: changet the fixed target: GL_TEXTURE_2D*/
- glo_flags_get_readpixel_type(surface->context->formatFlags, &glFormat, &glType);
- fprintf(stderr, "surface_as_texture:teximage:width=%d,height=%d, glFormat=0x%x, glType=0x%x.\n", surface->width, surface->height, glFormat, glType);
- /* glTexImage2D use different RGB order than the contexts in the pixmap surface */
-/* glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, surface->width, surface->height, 0, GL_RGBA, GL_UNSIGNED_BYTE, surface->image->data);*/
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, surface->width, surface->height, 0, glFormat, glType, surface->pbuffer);
-#else
- if (aglTexImagePBuffer(ctxt->context, surface->pbuffer, GL_BACK) == GL_FALSE)
- fprintf(stderr, "aglTexImagePBuffer failed: %s", aglErrorString(aglGetError()));
-
- glFinish();
-#endif
-}
-
-void glo_surface_release_texture(GloSurface *surface)
-{
-
-}
-
-#endif
-
+++ /dev/null
-/*
- * Offscreen OpenGL abstraction layer - Common utilities
- *
- * Copyright (c) 2010 Intel Corporation
- * Written by:
- * Gordon Williams <gordon.williams@collabora.co.uk>
- * Ian Molton <ian.molton@collabora.co.uk>
- *
- * 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
- * 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 "gloffscreen.h"
-
-#ifdef _WIN32
-#include <windows.h>
-#include <GL/gl.h>
-#include <GL/glext.h>
-#elif defined __APPLE__
-#include <OpenGL/gl.h>
-#else
-#include <GL/gl.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#ifdef MANGLE_OPENGL_SYMBOLS
-#include "gl_mangled.h"
-#endif
-
-void *g_malloc(size_t size);
-void *g_realloc(void *ptr, size_t size);
-void g_free(void *ptr);
-
-// ---------------------------------------------------
-// Copied from glx.h as we need them in windows too
-/*
- * Tokens for glXChooseVisual and glXGetConfig:
- */
-#define GLX_USE_GL 1
-#define GLX_BUFFER_SIZE 2
-#define GLX_LEVEL 3
-#define GLX_RGBA 4
-#define GLX_DOUBLEBUFFER 5
-#define GLX_STEREO 6
-#define GLX_AUX_BUFFERS 7
-#define GLX_RED_SIZE 8
-#define GLX_GREEN_SIZE 9
-#define GLX_BLUE_SIZE 10
-#define GLX_ALPHA_SIZE 11
-#define GLX_DEPTH_SIZE 12
-#define GLX_STENCIL_SIZE 13
-#define GLX_ACCUM_RED_SIZE 14
-#define GLX_ACCUM_GREEN_SIZE 15
-#define GLX_ACCUM_BLUE_SIZE 16
-#define GLX_ACCUM_ALPHA_SIZE 17
-/*
- * GLX 1.3 and later:
- */
-#define GLX_CONFIG_CAVEAT 0x20
-#define GLX_DONT_CARE 0xFFFFFFFF
-#define GLX_X_VISUAL_TYPE 0x22
-#define GLX_TRANSPARENT_TYPE 0x23
-#define GLX_TRANSPARENT_INDEX_VALUE 0x24
-#define GLX_TRANSPARENT_RED_VALUE 0x25
-#define GLX_TRANSPARENT_GREEN_VALUE 0x26
-#define GLX_TRANSPARENT_BLUE_VALUE 0x27
-#define GLX_TRANSPARENT_ALPHA_VALUE 0x28
-#define GLX_WINDOW_BIT 0x00000001
-#define GLX_NONE 0x8000
-#define GLX_TRUE_COLOR 0x8002
-#define GLX_VISUAL_ID 0x800B
-#define GLX_DRAWABLE_TYPE 0x8010
-#define GLX_RENDER_TYPE 0x8011
-#define GLX_X_RENDERABLE 0x8012
-#define GLX_FBCONFIG_ID 0x8013
-#define GLX_RGBA_TYPE 0x8014
-#define GLX_MAX_PBUFFER_WIDTH 0x8016
-#define GLX_MAX_PBUFFER_HEIGHT 0x8017
-#define GLX_MAX_PBUFFER_PIXELS 0x8018
-#define GLX_LARGEST_PBUFFER 0x801C
-#define GLX_WIDTH 0x801D
-#define GLX_HEIGHT 0x801E
-#define GLX_RGBA_BIT 0x00000001
-
-// ---------------------------------------------------
-
-extern void glo_surface_getcontents_readpixels(int formatFlags, int stride,
- int bpp, int width, int height, void *data, int noflip);
-
-// ---------------------------------------------------
-
-int glo_flags_get_depth_bits(int formatFlags) {
- switch ( formatFlags & GLO_FF_DEPTH_MASK ) {
- case GLO_FF_DEPTH_16: return 16;
- case GLO_FF_DEPTH_24: return 24;
- case GLO_FF_DEPTH_32: return 32;
- default: return 0;
- }
-}
-
-int glo_flags_get_stencil_bits(int formatFlags) {
- switch ( formatFlags & GLO_FF_STENCIL_MASK ) {
- case GLO_FF_STENCIL_8: return 8;
- default: return 0;
- }
-}
-
-void glo_flags_get_rgba_bits(int formatFlags, int *rgba) {
- int alpha = (formatFlags & GLO_FF_ALPHA) != 0;
- switch ( formatFlags & GLO_FF_BITS_MASK ) {
- case GLO_FF_BITS_16:
- rgba[0] = alpha ? 4 : 5;
- rgba[1] = alpha ? 4 : 6;
- rgba[2] = alpha ? 4 : 5;
- rgba[3] = alpha ? 4 : 0;
- break;
- case GLO_FF_BITS_24:
- // ignore alpha
- rgba[0] = 8;
- rgba[1] = 8;
- rgba[2] = 8;
- rgba[3] = 0;
- break;
- case GLO_FF_BITS_32:
- rgba[0] = 8;
- rgba[1] = 8;
- rgba[2] = 8;
- rgba[3] = 8;
- break;
- default:
- rgba[0] = 8;
- rgba[1] = 8;
- rgba[2] = 8;
- rgba[3] = 0;
- break;
- }
-}
-
-int glo_flags_get_bytes_per_pixel(int formatFlags) {
- switch ( formatFlags & GLO_FF_BITS_MASK ) {
- case GLO_FF_BITS_16: return 2;
- case GLO_FF_BITS_24: return 3;
- case GLO_FF_BITS_32: return 4;
- default: return 3;
- }
-}
-
-void glo_flags_get_readpixel_type(int formatFlags, int *glFormat, int *glType) {
- GLenum gFormat, gType;
-
- if (formatFlags & GLO_FF_ALPHA) {
- switch ( formatFlags & GLO_FF_BITS_MASK ) {
- case GLO_FF_BITS_16:
- gFormat = GL_RGBA;
- gType = GL_UNSIGNED_SHORT_4_4_4_4;
- break;
- case GLO_FF_BITS_24:
- case GLO_FF_BITS_32:
- default:
- gFormat = GL_BGRA;
- gType = GL_UNSIGNED_BYTE;
- break;
- }
- } else {
- switch ( formatFlags & GLO_FF_BITS_MASK ) {
- case GLO_FF_BITS_16:
- gFormat = GL_RGB;
- gType = GL_UNSIGNED_SHORT_5_6_5;
- break;
- case GLO_FF_BITS_24:
- case GLO_FF_BITS_32:
- default:
- gFormat = GL_BGR;
- gType = GL_UNSIGNED_BYTE;
- break;
- }
- }
-
- if (glFormat)
- *glFormat = gFormat;
- if (glType)
- *glType = gType;
-}
-
-#if 0
-// seems wrong below.
-int glo_flags_score(int formatFlagsExpected, int formatFlagsReal) {
-
- if (formatFlagsExpected == formatFlagsReal)
- return 0;
-
- int score = 1;
-
- // we wanted alpha, but we didn't get it
- if ((formatFlagsExpected&GLO_FF_ALPHA_MASK) <
- (formatFlagsReal&GLO_FF_ALPHA_MASK))
- score++;
- // less bits than we expected
- if ((formatFlagsExpected&GLO_FF_BITS_MASK) <
- !(formatFlagsReal&GLO_FF_BITS_MASK))
- score++;
- // less depth bits than we expected
- if ((formatFlagsExpected&GLO_FF_DEPTH_MASK) <
- !(formatFlagsReal&GLO_FF_DEPTH_MASK))
- score++;
- // less stencil bits than we expected
- if ((formatFlagsExpected&GLO_FF_STENCIL_MASK) <
- !(formatFlagsReal&GLO_FF_STENCIL_MASK))
- score++;
-
- return score;
-}
-#else
-int glo_flags_score(int formatFlagsExpected, int formatFlagsReal) {
-
- if (formatFlagsExpected == formatFlagsReal)
- return 0;
-
- int score = 1;
-
- // we wanted alpha, but we didn't get it
- if ((formatFlagsReal & GLO_FF_ALPHA_MASK) <
- (formatFlagsExpected & GLO_FF_ALPHA_MASK))
- score++;
- // less bits than we expected
- if ((formatFlagsReal & GLO_FF_BITS_MASK) <
- (formatFlagsExpected & GLO_FF_BITS_MASK))
- score++;
- // less depth bits than we expected
- if ((formatFlagsReal & GLO_FF_DEPTH_MASK) <
- (formatFlagsExpected & GLO_FF_DEPTH_MASK))
- score++;
- // less stencil bits than we expected
- if ((formatFlagsReal & GLO_FF_STENCIL_MASK) <
- (formatFlagsExpected & GLO_FF_STENCIL_MASK))
- score++;
-
- return score;
-}
-#endif
-
-int glo_flags_get_from_glx(const int *fbConfig, int assumeBooleans) {
- int bufferSize = 0;
- int depthSize = 0;
- int stencilSize = 0;
- int rgbaSize[] = {0,0,0,0};
- int flags = 0;
-
- while (*fbConfig) {
- int isSingle = 0;
- switch (*fbConfig) {
- case GLX_USE_GL:
- isSingle = 1;
- break;
- case GLX_BUFFER_SIZE:
- bufferSize = fbConfig[1];
- break;
- case GLX_LEVEL:
- break;
- case GLX_RGBA:
- flags |= GLO_FF_ALPHA;
- break;
- case GLX_DOUBLEBUFFER:
- isSingle = 1;
- break;
- case GLX_STEREO:
- isSingle = 1;
- break;
- case GLX_AUX_BUFFERS:
- break;
- case GLX_RED_SIZE:
- rgbaSize[0] = fbConfig[1];
- break;
- case GLX_GREEN_SIZE:
- rgbaSize[1] = fbConfig[1];
- break;
- case GLX_BLUE_SIZE:
- rgbaSize[2] = fbConfig[1];
- break;
- case GLX_ALPHA_SIZE:
- rgbaSize[3] = fbConfig[1];
- break;
- case GLX_DEPTH_SIZE:
- depthSize = fbConfig[1];
- break;
- case GLX_STENCIL_SIZE:
- stencilSize = fbConfig[1];
- break;
- case GLX_ACCUM_RED_SIZE:
- case GLX_ACCUM_GREEN_SIZE:
- case GLX_ACCUM_BLUE_SIZE:
- case GLX_ACCUM_ALPHA_SIZE:
- break;
- default:
- break;
- }
-
- // go to next
- if (isSingle && assumeBooleans)
- fbConfig++;
- else
- fbConfig+=2;
- }
-
- if (rgbaSize[3])
- flags |= GLO_FF_ALPHA;
- // ensure we have room for *some* alpha
- if ((flags & GLO_FF_ALPHA) && (rgbaSize[3]==0))
- rgbaSize[3] = 1;
- // Buffer size flag
- if (bufferSize==0)
- bufferSize = rgbaSize[0]+rgbaSize[1]+rgbaSize[2]+rgbaSize[3];
- if (bufferSize==0)
- bufferSize = (flags & GLO_FF_ALPHA) ? 32 : 24;
- if (bufferSize<=16)
- flags |= GLO_FF_BITS_16;
- else if (bufferSize<=24)
- flags |= GLO_FF_BITS_24;
- else
- flags |= GLO_FF_BITS_32;
-
- // Depth
- if (depthSize<=16)
- flags |= GLO_FF_DEPTH_16;
- else if (depthSize<=24)
- flags |= GLO_FF_DEPTH_24;
- else
- flags |= GLO_FF_DEPTH_32;
- // Stencil
- if (stencilSize>0)
- flags |= GLO_FF_STENCIL_8;
-
- return flags;
-}
-
-void glo_geometry_get_from_glx(const int* attrib_list, int* width, int* height)
-{
- while ( *attrib_list )
- {
- switch (*attrib_list)
- {
- case GLX_WIDTH:
- *width = attrib_list[1];
- break;
- case GLX_HEIGHT:
- *height = attrib_list[1];
- break;
- default:
- fprintf(stderr, "Should not pass any attribs except for width and height for glXCreiatePixmap. \n");
- }
- attrib_list += 2;
- }
-}
-
-void glo_surface_getcontents_readpixels(int formatFlags, int stride, int bpp,
- int width, int height, void *data, int noflip) {
- int glFormat, glType, rl, pa;
- static int once;
-
- glo_flags_get_readpixel_type(formatFlags, &glFormat, &glType);
- switch(bpp) {
- case 24:
- if(glFormat != GL_BGR) {
- if(!once) {
- fprintf(stderr, "Warning: compressing alpha\n");
- once = 1;
- }
- glFormat = GL_BGR;
- }
- break;
- case 32:
- if(glFormat != GL_BGRA) {
- fprintf(stderr, "Warning: expanding alpha!\n");
- glFormat = GL_BGRA;
- }
- break;
- default:
- fprintf(stderr, "Warning: unsupported colourdepth\n");
- break;
- }
-
- // Save guest processes GL state before we ReadPixels()
- glGetIntegerv(GL_PACK_ROW_LENGTH, &rl);
- glGetIntegerv(GL_PACK_ALIGNMENT, &pa);
- glPixelStorei(GL_PACK_ROW_LENGTH, 0);
- glPixelStorei(GL_PACK_ALIGNMENT, 4);
-
-#ifdef GETCONTENTS_INDIVIDUAL
- GLubyte *b = (GLubyte *)data;
- int irow;
- for(irow = height-1 ; irow >= 0 ; irow--) {
- glReadPixels(0, irow, width, 1, glFormat, glType, b);
- b += stride;
- }
-#else
- // Faster buffer flip
- GLubyte *b = (GLubyte *)data;
- GLubyte *c = &((GLubyte *)data)[stride*(height-1)];
- GLubyte *tmp = (GLubyte*)g_malloc(stride);
- int irow;
-
- glReadPixels(0, 0, width, height, glFormat, glType, data);
-
- if (noflip == 0) {
- for(irow = 0; irow < height/2; irow++) {
- memcpy(tmp, b, stride);
- memcpy(b, c, stride);
- memcpy(c, tmp, stride);
- b += stride;
- c -= stride;
- }
- }
- g_free(tmp);
-
-#endif
-
- // Restore GL state
- glPixelStorei(GL_PACK_ROW_LENGTH, rl);
- glPixelStorei(GL_PACK_ALIGNMENT, pa);
-}
-
-int glo_get_glx_from_flags(int formatFlags, int glxEnum) {
- int rgba[4];
- glo_flags_get_rgba_bits(formatFlags, rgba);
-
- switch (glxEnum) {
- case GLX_USE_GL: return 1;
- case GLX_BUFFER_SIZE:
- return glo_flags_get_bytes_per_pixel(formatFlags)*8;
- case GLX_LEVEL: return 0;
- case GLX_RGBA: return formatFlags & GLO_FF_ALPHA;
- case GLX_DOUBLEBUFFER: return 1;
- case GLX_STEREO: return 0;
- case GLX_AUX_BUFFERS: return 0;
- case GLX_RED_SIZE: return rgba[0];
- case GLX_GREEN_SIZE: return rgba[1];
- case GLX_BLUE_SIZE: return rgba[2];
- case GLX_ALPHA_SIZE: return rgba[3];
- case GLX_DEPTH_SIZE: return glo_flags_get_depth_bits(formatFlags);
- case GLX_STENCIL_SIZE: return glo_flags_get_stencil_bits(formatFlags);
- case GLX_ACCUM_RED_SIZE:
- case GLX_ACCUM_GREEN_SIZE:
- case GLX_ACCUM_BLUE_SIZE:
- case GLX_ACCUM_ALPHA_SIZE:
- return 0;
- //the attributes for glXGetFBConfigAttrib
- case GLX_FBCONFIG_ID: return 0;
- case GLX_RENDER_TYPE: return GLX_RGBA_BIT;
- case GLX_DRAWABLE_TYPE: return GLX_WINDOW_BIT;
- case GLX_X_RENDERABLE: return 1;
- case GLX_VISUAL_ID:
- case GLX_X_VISUAL_TYPE:
- // the real value is obtained in client side.
- return 0;
- case GLX_CONFIG_CAVEAT: return GLX_NONE;
- case GLX_TRANSPARENT_TYPE: return GLX_NONE;
- case GLX_TRANSPARENT_INDEX_VALUE:
- case GLX_TRANSPARENT_RED_VALUE:
- case GLX_TRANSPARENT_GREEN_VALUE:
- case GLX_TRANSPARENT_BLUE_VALUE:
- case GLX_TRANSPARENT_ALPHA_VALUE:
- return 0;
- case GLX_MAX_PBUFFER_WIDTH:
- case GLX_MAX_PBUFFER_HEIGHT:
- case GLX_MAX_PBUFFER_PIXELS:
- return 0;
- default:
- return 0;
- }
- return 0;
-}
-
+++ /dev/null
-/*
- * Offscreen OpenGL abstraction layer - GLX specific
- *
- * Copyright (c) 2010 Intel Corporation
- * Written by:
- * Gordon Williams <gordon.williams@collabora.co.uk>
- * Ian Molton <ian.molton@collabora.co.uk>
- *
- * 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
- * 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 _WIN32
-#include "gloffscreen.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include <GL/gl.h>
-#include <GL/glx.h>
-
-#include <sys/shm.h>
-#include <X11/extensions/XShm.h>
-
-#ifdef MANGLE_OPENGL_SYMBOLS
-#include "gl_mangled.h"
-#endif
-
-struct GloMain {
- Display *dpy;
- int use_ximage;
-};
-struct GloMain glo;
-int glo_inited = 0;
-
-struct _GloContext {
- GLuint formatFlags;
-
- GLXFBConfig fbConfig;
- GLXContext context;
-};
-
-struct _GloSurface {
- GLuint width;
- GLuint height;
-
- GloContext *context;
- Pixmap xPixmap;
- GLXPixmap glxPixmap;
-
- // For use by the 'fast' copy code.
- XImage *image;
- XShmSegmentInfo shminfo;
-};
-
-extern void glo_surface_getcontents_readpixels(int formatFlags, int stride,
- int bpp, int width, int height, void *data, int noflip);
-static void glo_test_readback_methods(void);
-
-/* ------------------------------------------------------------------------ */
-
-int glo_initialised(void) {
- return glo_inited;
-}
-
-/* Initialise gloffscreen */
-int glo_init(void) {
- if (glo_inited) {
- printf( "gloffscreen already inited\n" );
- //exit( EXIT_FAILURE );
- return 1;
- }
- /* Open a connection to the X server */
- glo.dpy = XOpenDisplay( NULL );
- if ( glo.dpy == NULL ) {
- printf( "Unable to open a connection to the X server\n" );
- //exit( EXIT_FAILURE );
- return 1;
- }
- glo_inited = 1;
- glo_test_readback_methods();
-
- return 0;
-}
-
-/* Uninitialise gloffscreen */
-void glo_kill(void) {
- XCloseDisplay(glo.dpy);
- glo.dpy = NULL;
-}
-
-
-/* Like wglGetProcAddress/glxGetProcAddress */
-void *glo_getprocaddress(const char *procName) {
- if (!glo_inited)
- glo_init();
- return glXGetProcAddressARB((const GLubyte *) procName);
-}
-
-/* ------------------------------------------------------------------------ */
-
-/* Create a light-weight context just for creating surface */
-GloContext *__glo_context_create(int formatFlags) {
-
- GLXFBConfig *fbConfigs;
- int numReturned;
- GloContext *context;
- int rgbaBits[4];
- int bufferAttributes[] = {
- GLX_DRAWABLE_TYPE, GLX_PIXMAP_BIT,
- GLX_RENDER_TYPE, GLX_RGBA_BIT,
- GLX_RED_SIZE, 8,
- GLX_GREEN_SIZE, 8,
- GLX_BLUE_SIZE, 8,
- GLX_ALPHA_SIZE, 8,
- GLX_DEPTH_SIZE, 0,
- GLX_STENCIL_SIZE, 0,
- None
- };
-
- if (!glo_inited)
- glo_init();
-
- // set up the surface format from the flags we were given
- glo_flags_get_rgba_bits(formatFlags, rgbaBits);
- bufferAttributes[5] = rgbaBits[0];
- bufferAttributes[7] = rgbaBits[1];
- bufferAttributes[9] = rgbaBits[2];
- bufferAttributes[11] = rgbaBits[3];
- bufferAttributes[13] = glo_flags_get_depth_bits(formatFlags);
- bufferAttributes[15] = glo_flags_get_stencil_bits(formatFlags);
-
- //printf("Got R%d, G%d, B%d, A%d\n", rgbaBits[0], rgbaBits[1], rgbaBits[2], rgbaBits[3]);
-
- fbConfigs = glXChooseFBConfig( glo.dpy, DefaultScreen(glo.dpy),
- bufferAttributes, &numReturned );
- if (numReturned==0) {
- printf( "No matching configs found.\n" );
- //exit( EXIT_FAILURE );
- return NULL;
- }
- context = (GloContext*)qemu_malloc(sizeof(GloContext));
- memset(context, 0, sizeof(GloContext));
- context->formatFlags = formatFlags;
- context->fbConfig = fbConfigs[0];
-
- return context;
-}
-
-/* Create an OpenGL context for a certain pixel format. formatflags are from the GLO_ constants */
-GloContext *glo_context_create(int formatFlags, GloContext *shareLists) {
-
- GloContext *context = __glo_context_create(formatFlags);
-
- if (!context) {
- return NULL;
- }
-
- /* Create a GLX context for OpenGL rendering */
- context->context = glXCreateNewContext(glo.dpy, context->fbConfig,
- GLX_RGBA_TYPE,
- shareLists ? shareLists->context: NULL,
- True );
-
- if (!context->context) {
- printf( "glXCreateNewContext failed\n" );
- //exit( EXIT_FAILURE );
- return NULL;
- }
-
- return context;
-}
-
-/* Destroy a previouslu created OpenGL context */
-void glo_context_destroy(GloContext *context) {
- if (!context) return;
- // TODO: check for GloSurfaces using this?
- glXDestroyContext( glo.dpy, context->context);
- qemu_free(context);
-}
-
-static void glo_surface_free_xshm_image(GloSurface *surface) {
- XShmDetach(glo.dpy, &surface->shminfo);
- surface->image->data = NULL;
- XDestroyImage(surface->image);
- shmdt(surface->shminfo.shmaddr);
- shmctl(surface->shminfo.shmid, IPC_RMID, NULL);
-}
-
-//FIXMEIM - handle failure to allocate.
-static void glo_surface_try_alloc_xshm_image(GloSurface *surface) {
- if(surface->image)
- glo_surface_free_xshm_image(surface);
-
- surface->image =
- XShmCreateImage(glo.dpy, DefaultVisual(glo.dpy, 0), 24, ZPixmap, NULL,
- &surface->shminfo, surface->width, surface->height);
- surface->shminfo.shmid = shmget(IPC_PRIVATE,
- surface->image->bytes_per_line *
- surface->height,
- IPC_CREAT | 0777);
- surface->shminfo.shmaddr = shmat(surface->shminfo.shmid, NULL, 0);
- surface->image->data = surface->shminfo.shmaddr;
- surface->shminfo.readOnly = False;
- XShmAttach(glo.dpy, &surface->shminfo);
-}
-
-/* ------------------------------------------------------------------------ */
-
-/* Update the context in surface and handle previous context */
-int glo_surface_update_context(GloSurface *surface, GloContext *context)
- {
- /* If previous context is light-weight context, just free it. If previous
- * context is valid one binded with surface via MakeCurrent, we need unbind
- * from original glstate */
- int prev_context_valid = 0;
-
- if ( surface->context )
- {
- prev_context_valid = (surface->context->context != 0);
- if ( !prev_context_valid ) /* light-weight context */
- g_free(surface->context);
- }
- surface->context = context;
- return prev_context_valid;
-}
-
-
-/* Create a surface with given width and height, formatflags are from the
- * GLO_ constants */
-GloSurface *glo_surface_create(int width, int height, GloContext *context) {
- GloSurface *surface;
-
- if (!context) return 0;
-
- surface = (GloSurface*)qemu_malloc(sizeof(GloSurface));
- memset(surface, 0, sizeof(GloSurface));
- surface->width = width;
- surface->height = height;
- surface->context = context;
- surface->xPixmap = XCreatePixmap( glo.dpy, DefaultRootWindow(glo.dpy),
- width, height,
- glo_flags_get_bytes_per_pixel(context->formatFlags)*8);
-
- if (!surface->xPixmap) {
- printf( "XCreatePixmap failed\n" );
- //exit( EXIT_FAILURE );
- return NULL;
- }
-
- /* Create a GLX window to associate the frame buffer configuration
- ** with the created X window */
- surface->glxPixmap = glXCreatePixmap( glo.dpy, context->fbConfig, surface->xPixmap, NULL );
- if (!surface->glxPixmap) {
- printf( "glXCreatePixmap failed\n" );
- //exit( EXIT_FAILURE );
- return NULL;
- }
-
- // If we're using XImages to pull the data from the graphics card...
- glo_surface_try_alloc_xshm_image(surface);
-
- return surface;
-}
-
-/* Destroy the given surface */
-void glo_surface_destroy(GloSurface *surface) {
- glXDestroyPixmap( glo.dpy, surface->glxPixmap);
- XFreePixmap( glo.dpy, surface->xPixmap);
- if(surface->image)
- glo_surface_free_xshm_image(surface);
- qemu_free(surface);
-}
-
-/* Make the given surface current */
-int glo_surface_makecurrent(GloSurface *surface) {
- int ret;
-
- if (!glo_inited)
- glo_init();
-
- if (surface) {
- ret = glXMakeCurrent(glo.dpy, surface->glxPixmap, surface->context->context);
- } else {
- ret = glXMakeCurrent(glo.dpy, 0, NULL);
- }
-
- return ret;
-}
-
-/*
-#define geti(a) \
- do { \
- int b; \
- glGetIntegerv(a, &b); \
- fprintf(stderr, "%s: %d\n", #a, b); \
- } while (0);
-*/
-
-/* Get the contents of the given surface */
-void glo_surface_getcontents(GloSurface *surface, int stride, int bpp, void *data) {
- static int once;
- XImage *img;
-
- if (!surface)
- return;
-
- if(glo.use_ximage) {
- glXWaitGL();
-
- if(surface->image) {
- XShmGetImage (glo.dpy, surface->xPixmap, surface->image, 0, 0, AllPlanes);
- img = surface->image;
- }
- else {
- img = XGetImage(glo.dpy, surface->xPixmap, 0, 0, surface->width, surface->height, AllPlanes, ZPixmap);
- }
-
- if (img) {
- if(bpp != 32 && bpp != 24 && !once) {
- fprintf(stderr, "Warning: unsupported colourdepth\n");
- once = 1;
- }
-
- if(bpp == img->bits_per_pixel && stride == img->bytes_per_line)
- {
- memcpy(data, img->data, stride * surface->height);
- }
- else
- {
- int x, y;
- for(y = 0 ; y < surface->height ; y++) {
- for(x = 0 ; x < surface->width ; x++) {
- char *src = ((char*)img->data) + (x*(img->bits_per_pixel/8)) + (y*img->bytes_per_line);
- char *dst = ((char*)data) + x*(bpp/8) + (y*stride);
- dst[0] = src[0];
- dst[1] = src[1];
- dst[2] = src[2];
- if(bpp == 32)
- dst[3] = 0xff; // if guest is 32 bit and host is 24
- }
- }
- }
-
- // If we're not using Shm
- if(!surface->image)
- XDestroyImage(img);
-
- return; // We're done.
- }
- // Uh oh... better fallback. Perhaps get glo.use_ximage to 0?
- }
-
- // Compatible / fallback method.
- glo_surface_getcontents_readpixels(surface->context->formatFlags,
- stride, bpp, surface->width,
- surface->height, data, 0);
-}
-
-// while(0) {
-// char fname[30];
-// int y;
-// sprintf(fname, "dbg_%08x_%dx%d.rgb", surface, surface->width, surface->height);
-// FILE *d = fopen(fname, "wb");
-// for(y = 0 ; y < surface->height ; y++)
-// fwrite(data + (y*stride), surface->width*3, 1, d);
-// fclose(d);
-// }
-
-/* Return the width and height of the given surface */
-void glo_surface_get_size(GloSurface *surface, int *width, int *height) {
- if (width)
- *width = surface->width;
- if (height)
- *height = surface->height;
-}
-
-/* Abstract glXQueryExtensionString() */
-const char *glo_glXQueryExtensionsString(void) {
- return glXQueryExtensionsString(glo.dpy, 0);
-}
-
-
-#define TX (17)
-#define TY (16)
-
-static int glo_can_readback(void) {
- GloContext *context;
- GloSurface *surface;
-
- unsigned char *datain = (unsigned char *)qemu_malloc(4*TX*TY);
- unsigned char *datain_flip = (unsigned char *)qemu_malloc(4*TX*TY); // flipped input data (for GL)
- unsigned char *dataout = (unsigned char *)qemu_malloc(4*TX*TY);
- unsigned char *p;
- int x,y;
-
- const int bufferAttributes[] = {
- GLX_RED_SIZE, 8,
- GLX_GREEN_SIZE, 8,
- GLX_BLUE_SIZE, 8,
- GLX_ALPHA_SIZE, 8,
- GLX_DEPTH_SIZE, 0,
- GLX_STENCIL_SIZE, 0,
- 0,
- };
-
- int bufferFlags = glo_flags_get_from_glx(bufferAttributes, 0);
- int bpp = glo_flags_get_bytes_per_pixel(bufferFlags);
- int glFormat, glType;
-
- memset(datain_flip, 0, TX*TY*4);
- memset(datain, 0, TX*TY*4);
-
- p = datain;
- for (y=0;y<TY;y++) {
- for (x=0;x<TX;x++) {
- p[0] = x;
- p[1] = y;
- //if (y&1) { p[0]=0; p[1]=0; }
- if (bpp>2) p[2] = 0;
- if (bpp>3) p[3] = 0xFF;
- p+=bpp;
- }
- memcpy(&datain_flip[((TY-1)-y)*bpp*TX], &datain[y*bpp*TX], bpp*TX);
- }
-
- context = glo_context_create(bufferFlags, 0);
- surface = glo_surface_create(TX, TY, context);
-
- glo_surface_makecurrent(surface);
-
- glClear(GL_COLOR_BUFFER_BIT);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(0,TX, 0,TY, 0, 1);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- glRasterPos2f(0,0);
- glo_flags_get_readpixel_type(bufferFlags, &glFormat, &glType);
- glDrawPixels(TX,TY,glFormat, glType, datain_flip);
- glFlush();
-
- memset(dataout, 0, bpp*TX*TY);
-
- glo_surface_getcontents(surface, TX*4, bpp*8, dataout);
-
- glo_surface_destroy(surface);
- glo_context_destroy(context);
-
- if (memcmp(datain, dataout, bpp*TX*TY)==0)
- return 1;
-
- return 0;
-}
-
-static void glo_test_readback_methods(void) {
- glo.use_ximage = 1;
- if(!glo_can_readback())
- glo.use_ximage = 0;
-
- fprintf(stderr, "VM GL: Using %s readback\n", glo.use_ximage?"XImage":"glReadPixels");
-}
-
-#endif
+++ /dev/null
-/*
- * Offscreen OpenGL abstraction layer
- *
- * Copyright (c) 2010 Intel Corporation
- * Written by:
- * Gordon Williams <gordon.williams@collabora.co.uk>
- *
- * 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
- * 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 "gloffscreen_test.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#ifdef _WIN32
-#include <windows.h>
-#include <GL/gl.h>
-#include <GL/glext.h>
-#elif defined __APPLE__
-#include <OpenGL/gl.h>
-#include <sys/time.h>
-#else
-#include <GL/gl.h>
-#include <sys/time.h>
-#endif
-
-#ifdef MANGLE_OPENGL_SYMBOLS
-#include "gl_mangled.h"
-#endif
-
-// ---------------------------------------------------
-// Copied from glx.h as we need them in windows too
-/*
- * Tokens for glXChooseVisual and glXGetConfig:
- */
-#define GLX_USE_GL 1
-#define GLX_BUFFER_SIZE 2
-#define GLX_LEVEL 3
-#define GLX_RGBA 4
-#define GLX_DOUBLEBUFFER 5
-#define GLX_STEREO 6
-#define GLX_AUX_BUFFERS 7
-#define GLX_RED_SIZE 8
-#define GLX_GREEN_SIZE 9
-#define GLX_BLUE_SIZE 10
-#define GLX_ALPHA_SIZE 11
-#define GLX_DEPTH_SIZE 12
-#define GLX_STENCIL_SIZE 13
-#define GLX_ACCUM_RED_SIZE 14
-#define GLX_ACCUM_GREEN_SIZE 15
-#define GLX_ACCUM_BLUE_SIZE 16
-#define GLX_ACCUM_ALPHA_SIZE 17
-// ---------------------------------------------------
-
-#define TX (32)
-#define TY (32)
-
-#define CHECK_SUCCESS 0
-#define CHECK_FAIL 1
-int gl_acceleration_capability_check (void) {
- //int test_failure = 0;
- GloContext *context;
- GloSurface *surface;
- unsigned char *datain;
- unsigned char *datain_flip;
- unsigned char *dataout;
- unsigned char *p;
- int x,y;
- const int bufferAttributes[] = {
- GLX_RED_SIZE, 8,
- GLX_GREEN_SIZE, 8,
- GLX_BLUE_SIZE, 8,
- GLX_ALPHA_SIZE, 8,
- GLX_DEPTH_SIZE, 0,
- GLX_STENCIL_SIZE, 0,
- 0,
- };
-
-#ifdef MANGLE_OPENGL_SYMBOLS
- if (mgl_load_symbols("libGL.so.1")) {
- return CHECK_FAIL;
- }
-#endif
-
- int bufferFlags = glo_flags_get_from_glx(bufferAttributes, 0);
- int bpp = glo_flags_get_bytes_per_pixel(bufferFlags);
- int glFormat, glType;
-/*
- if (glo_sanity_test () != 0) {
- // test failed.
- return 1;
- }
-*/
- datain = (unsigned char *)malloc(4*TX*TY);
- datain_flip = (unsigned char *)malloc(4*TX*TY);
-
- memset(datain, 0, TX*TY*4);
- memset(datain_flip, 0, TX*TY*4);
-
- p = datain;
- for (y=0;y<TY;y++) {
- for (x=0;x<TX;x++) {
- p[0] = x;
- p[1] = y;
- //if (y&1) { p[0]=0; p[1]=0; }
- if (bpp>2) p[2] = 0;
- if (bpp>3) p[3] = 0xFF;
- p+=bpp;
- }
- memcpy(&datain_flip[((TY-1)-y)*bpp*TX], &datain[y*bpp*TX], bpp*TX);
- }
-
- if (glo_init() != 0) {
- printf ("Host does not have GL hardware acceleration!(glo_init() failed)\n");
- free (datain);
- free (datain_flip);
- return CHECK_FAIL;
- }
-
- // new surface
- context = glo_context_create(bufferFlags, 0);
- if (context == NULL) {
- printf ("Host does not have GL hardware acceleration!(context_create() failed)\n");
- free (datain);
- free (datain_flip);
- return CHECK_FAIL;
- }
-
- surface = glo_surface_create(TX, TY, context);
- if (surface == NULL) {
- printf ("Host does not have GL hardware acceleration!(surface_create() failed)\n");
- free (datain);
- free (datain_flip);
- return CHECK_FAIL;
- }
-
- glo_surface_makecurrent(surface);
- printf("GL VENDOR %s\n", glGetString(GL_VENDOR));
- printf("GL RENDERER %s\n", glGetString(GL_RENDERER));
- printf("GL VERSION %s\n", glGetString(GL_VERSION));
- //printf("GLSL VERSION %s\n", glGetString(GL_SHADING_LANGUAGE_VERSION));
-
- if (strstr((const char*)glGetString(GL_RENDERER), "Software")) {
- printf ("Host does not have GL hardware acceleration!(No host gl driver)\n");
- free (datain);
- free (datain_flip);
- return CHECK_FAIL;
- }
-
- // fill with stuff (in correctly ordered way)
- glClear(GL_COLOR_BUFFER_BIT);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(0,TX, 0,TY, 0, 1);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- glRasterPos2f(0,0);
- glo_flags_get_readpixel_type(bufferFlags, &glFormat, &glType);
- printf("glFormat: 0x%08X glType: 0x%08X\n", glFormat, glType);
- glDrawPixels(TX,TY,glFormat, glType, datain_flip);
- glFlush();
-
- dataout = (unsigned char *)malloc(4*TX*TY);
- memset(dataout, 0, bpp*TX*TY);
-
- glo_surface_getcontents(surface, TX*bpp, bpp*8, dataout);
-
- // destroy surface
- glo_surface_destroy(surface);
- glo_context_destroy(context);
- // compare
- if (memcmp(datain, dataout, bpp*TX*TY)!=0) {
- printf ("Host does not have GL hardware acceleration!(datain != dataout)\n");
- free (datain);
- free (datain_flip);
- free (dataout);
- return CHECK_FAIL;
- }
-
- //glo_kill();
- //printf ("Testing %s\n", (test_failure ? "FAILED" : "PASSED"));
- free (datain);
- free (datain_flip);
- free (dataout);
-
- return CHECK_SUCCESS;
-}
+++ /dev/null
-/*
- * Offscreen OpenGL abstraction layer
- *
- * Copyright (c) 2010 Intel Corporation
- * Written by:
- * Gordon Williams <gordon.williams@collabora.co.uk>
- *
- * 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
- * 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 __GLOFFSCREEN_TEST_H__
-#define __GLOFFSCREEN_TEST_H__
-
-#include "gloffscreen.h"
-
-int gl_acceleration_capability_check(void);
-
-#endif /* __GLOFFSCREEN_TEST_H__ */
+++ /dev/null
-/*
- * Offscreen OpenGL abstraction layer - WGL (windows) specific
- *
- * Copyright (c) 2010 Intel Corporation
- * Written by:
- * Gordon Williams <gordon.williams@collabora.co.uk>
- * Ian Molton <ian.molton@collabora.co.uk>
- *
- * 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
- * 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.
- */
-#ifdef _WIN32
-#include "gloffscreen.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include <windows.h>
-#include <wingdi.h>
-#include <glib.h>
-#include <GL/gl.h>
-#include <GL/glext.h>
-#include "GL/wglext.h"
-
-#define MAX_ATTRIBS 12 /*Max attributes of pixel format we need*/
-
-#ifdef MANGLE_OPENGL_SYMBOLS
-#include "gl_mangled.h"
-#endif
-
-enum {
- SURFACE_WINDOW,
- SURFACE_PIXMAP,
- SURFACE_PBUFFER
-};
-
-/* In Windows, you must create a window *before* you can create a pbuffer or
- * get a context. So we create a hidden Window on startup (see glo_init/GloMain).
- *
- * Also, you can't share contexts that have different pixel formats, so we can't just
- * create a new context from the window. We must create a whole new PBuffer just for
- * a context :(
- */
-
-struct GloMain {
- HINSTANCE hInstance;
- HDC hDC;
- HWND hWnd; /* Our hidden window */
- HGLRC hContext;
-};
-struct GloMain glo;
-int glo_inited = 0;
-int Render_texture_support = 0;
-
-struct _GloContext {
- int formatFlags;
-
- /* Pixel format returned by wglChoosePixelFormat */
- int wglPixelFormat;
- /* We need a pbuffer to make a context of the right pixelformat :( */
- HPBUFFERARB hPBuffer;
- HDC hDC;
- HGLRC hContext;
-};
-
-struct _GloSurface {
- GLuint width;
- GLuint height;
-
- GloContext *context;
- HPBUFFERARB hPBuffer;
- HDC hDC;
-};
-
-#define GLO_WINDOW_CLASS "QEmuGLClass"
-#define DEFAULT_DEPTH_BUFFER (16)
-
-PFNWGLCHOOSEPIXELFORMATARBPROC wglChoosePixelFormatARB;
-PFNWGLGETPBUFFERDCARBPROC wglGetPbufferDCARB;
-PFNWGLRELEASEPBUFFERDCARBPROC wglReleasePbufferDCARB;
-PFNWGLCREATEPBUFFERARBPROC wglCreatePbufferARB;
-PFNWGLDESTROYPBUFFERARBPROC wglDestroyPbufferARB;
-PFNWGLBINDTEXIMAGEARBPROC wglBindTexImageARB;
-PFNWGLRELEASETEXIMAGEARBPROC wglReleaseTexImageARB;
-PFNWGLGETEXTENSIONSSTRINGARBPROC wglGetExtensionsStringARB;
-
-/* ------------------------------------------------------------------------ */
-
-extern void glo_surface_getcontents_readpixels(int formatFlags, int stride,
- int bpp, int width, int height, void *data, int noflip);
-
-/* ------------------------------------------------------------------------ */
-
-int glo_initialised(void) {
- return glo_inited;
-}
-
-#if 0
-/* Sanity test of the host GL capabilities to see whether the gl offscreen
- * could be well supported
- */
-int glo_sanity_test (void) {
- PFNWGLCHOOSEPIXELFORMATARBPROC wglChoosePixelFormatARB;
- PFNWGLGETPBUFFERDCARBPROC wglGetPbufferDCARB;
- PFNWGLRELEASEPBUFFERDCARBPROC wglReleasePbufferDCARB;
- PFNWGLCREATEPBUFFERARBPROC wglCreatePbufferARB;
- PFNWGLDESTROYPBUFFERARBPROC wglDestroyPbufferARB;
-
- wglChoosePixelFormatARB = (PFNWGLCHOOSEPIXELFORMATARBPROC)wglGetProcAddress("wglChoosePixelFormatARB");
- wglGetPbufferDCARB = (PFNWGLGETPBUFFERDCARBPROC)wglGetProcAddress("wglGetPbufferDCARB");
- wglReleasePbufferDCARB = (PFNWGLRELEASEPBUFFERDCARBPROC)wglGetProcAddress("wglReleasePbufferDCARB");
- wglCreatePbufferARB = (PFNWGLCREATEPBUFFERARBPROC)wglGetProcAddress("wglCreatePbufferARB");
- wglDestroyPbufferARB = (PFNWGLDESTROYPBUFFERARBPROC)wglGetProcAddress("wglDestroyPbufferARB");
- if (!wglChoosePixelFormatARB ||
- !wglGetPbufferDCARB ||
- !wglReleasePbufferDCARB ||
- !wglCreatePbufferARB ||
- !wglDestroyPbufferARB) {
- fprintf (stderr, "Unable to load the required WGL extensions\n");
- return 1;
- }
- // check the shader support. It is for mcompositor to run.
-
- if (!wglGetProcAddress("glShaderSource")) {
- fprintf (stderr, "Unable to find shader support\n");
- return 1;
- }
- return 0;
-}
-#endif
-
-/* Initialise gloffscreen */
-int glo_init(void) {
- WNDCLASSEX wcx;
- PIXELFORMATDESCRIPTOR pfd;
- const char *ext_str;
-
- if (glo_inited) {
- printf( "gloffscreen already inited\n" );
- //exit( EXIT_FAILURE );
- return 1;
- }
-
- glo.hInstance = GetModuleHandle(NULL); // Grab An Instance For Our Window
-
- wcx.cbSize = sizeof(wcx);
- wcx.style = 0;
- wcx.lpfnWndProc = DefWindowProc;
- wcx.cbClsExtra = 0;
- wcx.cbWndExtra = 0;
- wcx.hInstance = glo.hInstance;
- wcx.hIcon = NULL;
- wcx.hCursor = NULL;
- wcx.hbrBackground = NULL;
- wcx.lpszMenuName = NULL;
- wcx.lpszClassName = GLO_WINDOW_CLASS;
- wcx.hIconSm = NULL;
- RegisterClassEx(&wcx);
- glo.hWnd = CreateWindow(
- GLO_WINDOW_CLASS,
- "QEmuGL",
- 0,0,0,0,0,
- (HWND)NULL, (HMENU)NULL,
- glo.hInstance,
- (LPVOID) NULL);
-
- if (!glo.hWnd) {
- printf( "Unable to create window\n" );
- //exit( EXIT_FAILURE );
- return 1;
- }
- glo.hDC = GetDC(glo.hWnd);
-
- memset(&pfd, 0, sizeof(PIXELFORMATDESCRIPTOR));
- pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR);
- pfd.nVersion = 1;
- pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL;
- pfd.iPixelType = PFD_TYPE_RGBA;
- pfd.cColorBits = 24;
- pfd.iLayerType = PFD_MAIN_PLANE;
- unsigned int pixelFormat = ChoosePixelFormat(glo.hDC, &pfd);
- DescribePixelFormat(glo.hDC, pixelFormat, sizeof(PIXELFORMATDESCRIPTOR), &pfd);
- if (!SetPixelFormat(glo.hDC, pixelFormat, &pfd))
- return 1;
-
- glo.hContext = wglCreateContext(glo.hDC);
- if (glo.hContext == NULL) {
- printf( "Unable to create GL context\n" );
- //exit( EXIT_FAILURE );
- return 1;
- }
- wglMakeCurrent(glo.hDC, glo.hContext);
-
- // FIXME GW
- // Need to share lists AND copy state
-
- // load in the extensions we need
- //const char *ext = wglGetExtensionsStringARB(hdc);
- //"WGL_ARB_pixel_format" "WGL_ARB_pbuffer"
-
- wglChoosePixelFormatARB = (PFNWGLCHOOSEPIXELFORMATARBPROC)wglGetProcAddress("wglChoosePixelFormatARB");
- wglGetPbufferDCARB = (PFNWGLGETPBUFFERDCARBPROC)wglGetProcAddress("wglGetPbufferDCARB");
- wglReleasePbufferDCARB = (PFNWGLRELEASEPBUFFERDCARBPROC)wglGetProcAddress("wglReleasePbufferDCARB");
- wglCreatePbufferARB = (PFNWGLCREATEPBUFFERARBPROC)wglGetProcAddress("wglCreatePbufferARB");
- wglDestroyPbufferARB = (PFNWGLDESTROYPBUFFERARBPROC)wglGetProcAddress("wglDestroyPbufferARB");
- wglBindTexImageARB = (PFNWGLBINDTEXIMAGEARBPROC)wglGetProcAddress("wglBindTexImageARB");
- wglReleaseTexImageARB = (PFNWGLRELEASETEXIMAGEARBPROC)wglGetProcAddress("wglReleaseTexImageARB");
- wglGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)wglGetProcAddress("wglGetExtensionsStringARB");
-
- if (!wglChoosePixelFormatARB ||
- !wglGetPbufferDCARB ||
- !wglReleasePbufferDCARB ||
- !wglCreatePbufferARB ||
- !wglDestroyPbufferARB ||
- !wglGetExtensionsStringARB ) {
- printf( "Unable to load the required WGL extensions\n" );
- //exit( EXIT_FAILURE );
- return 1;
- }
-
- if(wglGetExtensionsStringARB)
- {
- ext_str = wglGetExtensionsStringARB(wglGetCurrentDC());
- if(ext_str == NULL)
- {
- fprintf(stderr, "Failed tp get extensions string!\n");
- Render_texture_support = 0;
- }
- else
- {
- if(strstr(ext_str, "WGL_ARB_render_texture") != NULL)
- {
- fprintf(stdout, "WGL_ARB_render_texture supported!\n");
- Render_texture_support = 1;
- }
- else
- {
- fprintf(stderr, "WGL_ARB_render_texture not supported!\n");
- Render_texture_support = 0;
- }
- }
- }
-
-
- if ( !wglBindTexImageARB ||
- !wglReleaseTexImageARB )
- fprintf (stderr, "Warning: no [Bind|Release]TexImageARB extensions.\n");
-
- glo_inited = 1;
-
- return 0;
-}
-
-/* Uninitialise gloffscreen */
-void glo_kill(void) {
- if (glo.hContext) {
- wglMakeCurrent(NULL, NULL);
- wglDeleteContext(glo.hContext);
- glo.hContext = NULL;
- }
- if (glo.hDC) {
- ReleaseDC(glo.hWnd, glo.hDC);
- glo.hDC = NULL;
- }
- if (glo.hWnd) {
- DestroyWindow(glo.hWnd);
- glo.hWnd = NULL;
- }
- UnregisterClass(GLO_WINDOW_CLASS, glo.hInstance);
-}
-
-const char *glo_glXQueryExtensionsString(void) {
- return "";
-}
-
-
-static const char *STANDARD_GL_FUNCTIONS ={
-/* Miscellaneous */
-"glClearIndex\0"
-"glClearColor\0"
-"glClear\0"
-"glIndexMask\0"
-"glColorMask\0"
-"glAlphaFunc\0"
-"glBlendFunc\0"
-"glLogicOp\0"
-"glCullFace\0"
-"glFrontFace\0"
-"glPointSize\0"
-"glLineWidth\0"
-"glLineStipple\0"
-"glPolygonMode\0"
-"glPolygonOffset\0"
-"glPolygonStipple\0"
-"glGetPolygonStipple\0"
-"glEdgeFlag\0"
-"glEdgeFlagv\0"
-"glScissor\0"
-"glClipPlane\0"
-"glGetClipPlane\0"
-"glDrawBuffer\0"
-"glReadBuffer\0"
-"glEnable\0"
-"glDisable\0"
-"glIsEnabled\0"
-"glEnableClientState\0"
-"glDisableClientState\0"
-"glGetBooleanv\0"
-"glGetDoublev\0"
-"glGetFloatv\0"
-"glGetIntegerv\0"
-"glPushAttrib\0"
-"glPopAttrib\0"
-"glPushClientAttrib\0"
-"glPopClientAttrib\0"
-"glRenderMode\0"
-"glGetError\0"
-"glGetString\0"
-"glFinish\0"
-"glFlush\0"
-"glHint\0"
-/* Depth Buffer */
-"glClearDepth\0"
-"glDepthFunc\0"
-"glDepthMask\0"
-"glDepthRange\0"
-/* Accumulation Buffer */
-"glClearAccum\0"
-"glAccum\0"
-/* Transformation */
-"glMatrixMode\0"
-"glOrtho\0"
-"glFrustum\0"
-"glViewport\0"
-"glPushMatrix\0"
-"glPopMatrix\0"
-"glLoadIdentity\0"
-"glLoadMatrixd\0"
-"glLoadMatrixf\0"
-"glMultMatrixd\0"
-"glMultMatrixf\0"
-"glRotated\0"
-"glRotatef\0"
-"glScaled\0"
-"glScalef\0"
-"glTranslated\0"
-"glTranslatef\0"
-/* Display Lists */
-"glIsList\0"
-"glDeleteLists\0"
-"glGenLists\0"
-"glNewList\0"
-"glEndList\0"
-"glCallList\0"
-"glCallLists\0"
-"glListBase\0"
-/* Drawing Functions */
-"glBegin\0"
-"glEnd\0"
-"glVertex2d\0"
-"glVertex2f\0"
-"glVertex2i\0"
-"glVertex2s\0"
-"glVertex3d\0"
-"glVertex3f\0"
-"glVertex3i\0"
-"glVertex3s\0"
-"glVertex4d\0"
-"glVertex4f\0"
-"glVertex4i\0"
-"glVertex4s\0"
-"glVertex2dv\0"
-"glVertex2fv\0"
-"glVertex2iv\0"
-"glVertex2sv\0"
-"glVertex3dv\0"
-"glVertex3fv\0"
-"glVertex3iv\0"
-"glVertex3sv\0"
-"glVertex4dv\0"
-"glVertex4fv\0"
-"glVertex4iv\0"
-"glVertex4sv\0"
-"glNormal3b\0"
-"glNormal3d\0"
-"glNormal3f\0"
-"glNormal3i\0"
-"glNormal3s\0"
-"glNormal3bv\0"
-"glNormal3dv\0"
-"glNormal3fv\0"
-"glNormal3iv\0"
-"glNormal3sv\0"
-"glIndexd\0"
-"glIndexf\0"
-"glIndexi\0"
-"glIndexs\0"
-"glIndexub\0"
-"glIndexdv\0"
-"glIndexfv\0"
-"glIndexiv\0"
-"glIndexsv\0"
-"glIndexubv\0"
-"glColor3b\0"
-"glColor3d\0"
-"glColor3f\0"
-"glColor3i\0"
-"glColor3s\0"
-"glColor3ub\0"
-"glColor3ui\0"
-"glColor3us\0"
-"glColor4b\0"
-"glColor4d\0"
-"glColor4f\0"
-"glColor4i\0"
-"glColor4s\0"
-"glColor4ub\0"
-"glColor4ui\0"
-"glColor4us\0"
-"glColor3bv\0"
-"glColor3dv\0"
-"glColor3fv\0"
-"glColor3iv\0"
-"glColor3sv\0"
-"glColor3ubv\0"
-"glColor3uiv\0"
-"glColor3usv\0"
-"glColor4bv\0"
-"glColor4dv\0"
-"glColor4fv\0"
-"glColor4iv\0"
-"glColor4sv\0"
-"glColor4ubv\0"
-"glColor4uiv\0"
-"glColor4usv\0"
-"glTexCoord1d\0"
-"glTexCoord1f\0"
-"glTexCoord1i\0"
-"glTexCoord1s\0"
-"glTexCoord2d\0"
-"glTexCoord2f\0"
-"glTexCoord2i\0"
-"glTexCoord2s\0"
-"glTexCoord3d\0"
-"glTexCoord3f\0"
-"glTexCoord3i\0"
-"glTexCoord3s\0"
-"glTexCoord4d\0"
-"glTexCoord4f\0"
-"glTexCoord4i\0"
-"glTexCoord4s\0"
-"glTexCoord1dv\0"
-"glTexCoord1fv\0"
-"glTexCoord1iv\0"
-"glTexCoord1sv\0"
-"glTexCoord2dv\0"
-"glTexCoord2fv\0"
-"glTexCoord2iv\0"
-"glTexCoord2sv\0"
-"glTexCoord3dv\0"
-"glTexCoord3fv\0"
-"glTexCoord3iv\0"
-"glTexCoord3sv\0"
-"glTexCoord4dv\0"
-"glTexCoord4fv\0"
-"glTexCoord4iv\0"
-"glTexCoord4sv\0"
-"glRasterPos2d\0"
-"glRasterPos2f\0"
-"glRasterPos2i\0"
-"glRasterPos2s\0"
-"glRasterPos3d\0"
-"glRasterPos3f\0"
-"glRasterPos3i\0"
-"glRasterPos3s\0"
-"glRasterPos4d\0"
-"glRasterPos4f\0"
-"glRasterPos4i\0"
-"glRasterPos4s\0"
-"glRasterPos2dv\0"
-"glRasterPos2fv\0"
-"glRasterPos2iv\0"
-"glRasterPos2sv\0"
-"glRasterPos3dv\0"
-"glRasterPos3fv\0"
-"glRasterPos3iv\0"
-"glRasterPos3sv\0"
-"glRasterPos4dv\0"
-"glRasterPos4fv\0"
-"glRasterPos4iv\0"
-"glRasterPos4sv\0"
-"glRectd\0"
-"glRectf\0"
-"glRecti\0"
-"glRects\0"
-"glRectdv\0"
-"glRectfv\0"
-"glRectiv\0"
-"glRectsv\0"
-/* Lighting */
-"glShadeModel\0"
-"glLightf\0"
-"glLighti\0"
-"glLightfv\0"
-"glLightiv\0"
-"glGetLightfv\0"
-"glGetLightiv\0"
-"glLightModelf\0"
-"glLightModeli\0"
-"glLightModelfv\0"
-"glLightModeliv\0"
-"glMaterialf\0"
-"glMateriali\0"
-"glMaterialfv\0"
-"glMaterialiv\0"
-"glGetMaterialfv\0"
-"glGetMaterialiv\0"
-"glColorMaterial\0"
-/* Raster functions */
-"glPixelZoom\0"
-"glPixelStoref\0"
-"glPixelStorei\0"
-"glPixelTransferf\0"
-"glPixelTransferi\0"
-"glPixelMapfv\0"
-"glPixelMapuiv\0"
-"glPixelMapusv\0"
-"glGetPixelMapfv\0"
-"glGetPixelMapuiv\0"
-"glGetPixelMapusv\0"
-"glBitmap\0"
-"glReadPixels\0"
-"glDrawPixels\0"
-"glCopyPixels\0"
-/* Stenciling */
-"glStencilFunc\0"
-"glStencilMask\0"
-"glStencilOp\0"
-"glClearStencil\0"
-/* Texture mapping */
-"glTexGend\0"
-"glTexGenf\0"
-"glTexGeni\0"
-"glTexGendv\0"
-"glTexGenfv\0"
-"glTexGeniv\0"
-"glGetTexGendv\0"
-"glGetTexGenfv\0"
-"glGetTexGeniv\0"
-"glTexEnvf\0"
-"glTexEnvi\0"
-"glTexEnvfv\0"
-"glTexEnviv\0"
-"glGetTexEnvfv\0"
-"glGetTexEnviv\0"
-"glTexParameterf\0"
-"glTexParameteri\0"
-"glTexParameterfv\0"
-"glTexParameteriv\0"
-"glGetTexParameterfv\0"
-"glGetTexParameteriv\0"
-"glGetTexLevelParameterfv\0"
-"glGetTexLevelParameteriv\0"
-"glTexImage1D\0"
-"glTexImage2D\0"
-"glGetTexImage\0"
-/* Evaluators */
-"glMap1d\0"
-"glMap1f\0"
-"glMap2d\0"
-"glMap2f\0"
-"glGetMapdv\0"
-"glGetMapfv\0"
-"glGetMapiv\0"
-"glEvalCoord1d\0"
-"glEvalCoord1f\0"
-"glEvalCoord1dv\0"
-"glEvalCoord1fv\0"
-"glEvalCoord2d\0"
-"glEvalCoord2f\0"
-"glEvalCoord2dv\0"
-"glEvalCoord2fv\0"
-"glMapGrid1d\0"
-"glMapGrid1f\0"
-"glMapGrid2d\0"
-"glMapGrid2f\0"
-"glEvalPoint1\0"
-"glEvalPoint2\0"
-"glEvalMesh1\0"
-"glEvalMesh2\0"
-/* Fog */
-"glFogf\0"
-"glFogi\0"
-"glFogfv\0"
-"glFogiv\0"
-/* Selection and Feedback */
-"glFeedbackBuffer\0"
-"glPassThrough\0"
-"glSelectBuffer\0"
-"glInitNames\0"
-"glLoadName\0"
-"glPushName\0"
-"glPopName\0"
-/* 1.1 functions */
-/* texture objects */
-"glGenTextures\0"
-"glDeleteTextures\0"
-"glBindTexture\0"
-"glPrioritizeTextures\0"
-"glAreTexturesResident\0"
-"glIsTexture\0"
-/* texture mapping */
-"glTexSubImage1D\0"
-"glTexSubImage2D\0"
-"glCopyTexImage1D\0"
-"glCopyTexImage2D\0"
-"glCopyTexSubImage1D\0"
-"glCopyTexSubImage2D\0"
-/* vertex arrays */
-"glVertexPointer\0"
-"glNormalPointer\0"
-"glColorPointer\0"
-"glIndexPointer\0"
-"glTexCoordPointer\0"
-"glEdgeFlagPointer\0"
-"glGetPointerv\0"
-"glArrayElement\0"
-"glDrawArrays\0"
-"glDrawElements\0"
-"glInterleavedArrays\0"
-/* GLX */
-"glXChooseVisual\0"
-"glXQueryExtensionsString\0"
-"glXQueryServerString\0"
-"glXGetClientString\0"
-"glXCreateContext\0"
-"glXCreateNewContext\0"
-"glXCopyContext\0"
-"glXDestroyContext\0"
-"glXQueryVersion\0"
-"glXMakeCurrent\0"
-"glXSwapBuffers\0"
-"glXGetConfig\0"
-"glXQueryExtension\0"
-"glXChooseFBConfig\0"
-"glXGetFBConfigs\0"
-"glXGetFBConfigAttrib\0"
-"glXQueryContext\0"
-"glXQueryDrawable\0"
-"glXGetVisualFromFBConfig\0"
-"glXIsDirect\0"
-"glXCreatePixmap\0"
-"glXDestroyPixmap\0"
-"glXCreatePbuffer\0"
-"glXDestroyPbuffer\0"
-"\0"
-};
-
-/* Like wglGetProcAddress/glxGetProcAddress */
-void *glo_getprocaddress(const char *procName) {
- HGLRC oldCtx;
- HDC oldDC;
- if (!glo_inited)
- glo_init();
-
- oldCtx = wglGetCurrentContext();
- oldDC = wglGetCurrentDC();
- if (oldDC!=glo.hDC || oldCtx!=glo.hContext)
- wglMakeCurrent(glo.hDC, glo.hContext);
-
- void *procAddr = wglGetProcAddress(procName);
-
- if (oldDC!=glo.hDC || oldCtx!=glo.hContext)
- wglMakeCurrent(oldDC, oldCtx);
-
- /* wgl doesn't know about the glx functions - but
- we never call these anyway (they're implemented in
- opengl_exec), so all we need to do is return a nunzero value...
-
- But we also have to check for 'standard' GL function names
- too as wgl doesn't return those either! */
- /* Caller in opengl_exec.c may query some base GL API, then call them
- * directly. On windows, wglGetProcAddress usually return NULL in such
- * case, then we return 1, which casue segfault when accessing (void*)1. We
- * should call base GL API directly instead of GET_EXT_PTR + ptr_func_*.
- * TODO: add LoadLibrary + GetProcAddress as call back.
- */
- if (procAddr==0) {
- const char *p = STANDARD_GL_FUNCTIONS;
- while (*p) {
- if (!strcmp(procName, p)) {
- procAddr = (void*)1;
- break;
- }
- // skip to the next '0' and then just over it
- while (*p) p++;
- p++;
- }
- }
-
- /*printf("wglGetProcAddress '%s' -> %p\n", procName, procAddr);
- fflush(stdout);*/
-
- return procAddr;
-}
-void glo_surface_updatecontents(GloSurface *surface) {
- /* NOT IMPLEMENTED YET. */
- printf("glo_surface_updatecontents() is not implemented for windows. \n");
-}
-
-/* ------------------------------------------------------------------------ */
-
-/* Create a light-weight context just for creating surface */
-GloContext *__glo_context_create(int formatFlags) {
- GloContext *context;
- // pixel format attributes
- int pf_attri[2*MAX_ATTRIBS];
- float pf_attrf[] = {0, 0};
- unsigned int numReturned = 0;
- int pb_attr[] = { 0 };
- int rgbaBits[4];
- int index = 0;
-
- /*Initlized array because it needs to be terminated by 0*/
- for(index = 0; index < 2*MAX_ATTRIBS; index ++)
- pf_attri[index] = 0;
-
- index = 0;
- pf_attri[2*index] = WGL_SUPPORT_OPENGL_ARB;
- pf_attri[2*index +1 ] = TRUE;
- index ++;
-
- pf_attri[2*index] = WGL_DRAW_TO_PBUFFER_ARB;
- pf_attri[2*index +1 ] = TRUE;
- index ++;
-
- pf_attri[2*index] = WGL_RED_BITS_ARB;
- pf_attri[2*index +1 ] = 8;
- index ++;
-
- pf_attri[2*index] = WGL_GREEN_BITS_ARB;
- pf_attri[2*index +1 ] = 8;
- index ++;
-
- pf_attri[2*index] = WGL_BLUE_BITS_ARB;
- pf_attri[2*index +1 ] = 8;
- index ++;
-
- pf_attri[2*index] = WGL_ALPHA_BITS_ARB;
- pf_attri[2*index +1 ] = 8;
- index ++;
-
- pf_attri[2*index] = WGL_DEPTH_BITS_ARB;
- pf_attri[2*index +1 ] = 0;
- index ++;
-
- pf_attri[2*index] = WGL_STENCIL_BITS_ARB;
- pf_attri[2*index +1 ] = 0;
- index ++;
-
- pf_attri[2*index] = WGL_DOUBLE_BUFFER_ARB;
- pf_attri[2*index +1 ] = FALSE;
- index ++;
-
- if(Render_texture_support)
- {
- fprintf(stdout, "Render to texture supported, add attributes in array!\n");
- pf_attri[2*index] = WGL_DRAW_TO_PBUFFER_ARB;
- pf_attri[2*index +1 ] = TRUE;
- index ++;
-
- pf_attri[2*index] = WGL_BIND_TO_TEXTURE_RGBA_ARB;
- pf_attri[2*index +1 ] = TRUE;
-
- } else {
- fprintf(stderr, "Render to Texture not supported, disable attributes in array!\n");
- }
-
-
-
- if (!glo_inited)
- glo_init();
-
- context = (GloContext*)malloc(sizeof(GloContext));
- memset(context, 0, sizeof(GloContext));
- context->formatFlags = formatFlags;
-
- // set up the surface format from the flags we were given
- glo_flags_get_rgba_bits(context->formatFlags, rgbaBits);
- pf_attri[5] = rgbaBits[0];
- pf_attri[7] = rgbaBits[1];
- pf_attri[9] = rgbaBits[2];
- pf_attri[11] = rgbaBits[3];
- pf_attri[13] = glo_flags_get_depth_bits(context->formatFlags);
- pf_attri[15] = glo_flags_get_stencil_bits(context->formatFlags);
-
- // find out what pixel format to use
- wglChoosePixelFormatARB( glo.hDC, pf_attri, pf_attrf, 1, &context->wglPixelFormat, &numReturned);
- if( numReturned == 0 ) {
- printf( "No matching configs found.\n" );
- //exit( EXIT_FAILURE );
- return NULL;
- }
-
- // We create a tiny pbuffer - just so we can make a context of the right pixel format
- context->hPBuffer = wglCreatePbufferARB( glo.hDC, context->wglPixelFormat,
- 16, 16, pb_attr );
- if( !context->hPBuffer ) {
- printf( "Couldn't create the PBuffer\n" );
- //exit( EXIT_FAILURE );
- return NULL;
- }
- context->hDC = wglGetPbufferDCARB( context->hPBuffer );
- if( !context->hDC ) {
- printf( "Couldn't create the DC\n" );
- //exit( EXIT_FAILURE );
- return NULL;
- }
-
- return context;
-}
-
-/* Create an OpenGL context for a certain pixel format. formatflags are from the GLO_ constants */
-GloContext *glo_context_create(int formatFlags, GloContext *shareLists) {
-
- GloContext *context = __glo_context_create(formatFlags);
-
- if (!context) {
- return NULL;
- }
-
- context->hContext = wglCreateContext(context->hDC);
- if (context->hContext == NULL) {
- printf( "Unable to create GL context\n" );
- //exit( EXIT_FAILURE );
- return NULL;
- }
-
- if (shareLists) {
- // Need to share lists...
- wglShareLists(shareLists->hContext, context->hContext);
- }
-
- return context;
-}
-
-/* Destroy a previouslu created OpenGL context */
-void glo_context_destroy(GloContext *context) {
- if (!context) return;
-
- if (context->hContext) {
- wglDeleteContext(context->hContext);
- }
- free(context);
-}
-
-/* ------------------------------------------------------------------------ */
-
-/* Update the context in surface and handle previous context */
-void glo_surface_update_context(GloSurface *surface, GloContext *context, int free_flags)
-{
- /* If previous context is light-weight context, just free it. If previous
- * context is valid one binded with surface via MakeCurrent, we need unbind
- * from original glstate */
-
- if ( surface->context )
- {
- if ( free_flags ) /* light-weight context */
- g_free(surface->context);
- }
- surface->context = context;
-}
-
-/* Create a surface with given width and height, formatflags are from the
- * GLO_ constants */
-GloSurface *glo_surface_create(int width, int height, GloContext *context) {
- GloSurface *surface;
- int pb_attr[] = {
- /* Need following 2 to support surface as texture */
- WGL_TEXTURE_FORMAT_ARB, WGL_TEXTURE_RGBA_ARB,
- WGL_TEXTURE_TARGET_ARB, WGL_TEXTURE_2D_ARB,
- 0
- };
-
- // Create the p-buffer...
- surface = (GloSurface*)malloc(sizeof(GloSurface));
- memset(surface, 0, sizeof(GloSurface));
- surface->width = width;
- surface->height = height;
- surface->context = context;
-
- surface->hPBuffer = wglCreatePbufferARB( glo.hDC, context->wglPixelFormat,
- surface->width, surface->height, pb_attr );
- if( !surface->hPBuffer ) {
- printf( "Couldn't create the PBuffer\n" );
- //exit( EXIT_FAILURE );
- return NULL;
- }
- surface->hDC = wglGetPbufferDCARB( surface->hPBuffer );
- if( !surface->hDC ) {
- printf( "Couldn't create the DC\n" );
- //exit( EXIT_FAILURE );
- return NULL;
- }
-
- return surface;
-}
-
-/* Destroy the given surface */
-void glo_surface_destroy(GloSurface *surface) {
- if (!surface) return;
-
- if( surface->hPBuffer != NULL ) {
- wglReleasePbufferDCARB( surface->hPBuffer, surface->hDC );
- wglDestroyPbufferARB( surface->hPBuffer );
- }
- if( surface->hDC != NULL ) {
- ReleaseDC( glo.hWnd, surface->hDC );
- }
- free(surface);
-}
-
-/* Make the given surface current */
-int glo_surface_makecurrent(GloSurface *surface) {
- if (surface) {
- return wglMakeCurrent( surface->hDC, surface->context->hContext );
- } else {
- return wglMakeCurrent( NULL, NULL );
- }
-}
-
-/* Get the contents of the given surface */
-void glo_surface_getcontents(GloSurface *surface, int stride, int bpp, void *data) {
-
- if (!surface)
- return;
- // Compatible / fallback method.
- glo_surface_getcontents_readpixels(surface->context->formatFlags,
- stride, bpp, surface->width,
- surface->height, data, 0);
-}
-
-/* Return the width and height of the given surface */
-void glo_surface_get_size(GloSurface *surface, int *width, int *height) {
- if (width)
- *width = surface->width;
- if (height)
- *height = surface->height;
-}
-
-/* Bind the surface as texture */
-void glo_surface_as_texture(GloContext *ctxt, GloSurface *surface, int surface_type)
-{
- int glFormat, glType;
- int bpp = 4;
- int stride = surface->width * bpp;
- char *data;
- HGLRC oldCtx;
- HDC oldDC;
-
- data = malloc(surface->width * surface->height * bpp);
- if (!data)
- return;
-
- /* Read pixels from Speficied context */
- oldCtx = wglGetCurrentContext();
- oldDC = wglGetCurrentDC();
- glo_surface_makecurrent(surface);
- glo_surface_updatecontents(surface);
- glo_flags_get_readpixel_type(surface->context->formatFlags, &glFormat, &glType);
- // Make sure we do not flip pbuffer surfaces on Windows
- glo_surface_getcontents_readpixels(surface->context->formatFlags,
- stride, bpp *8, surface->width,
- surface->height, data, (surface_type == SURFACE_PBUFFER));
-
- /* Restore previous context for setting texture */
- wglMakeCurrent(oldDC, oldCtx);
-
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, surface->width, surface->height, 0, glFormat, glType, data);
- free(data);
-}
-
-void glo_surface_release_texture(GloSurface *surface)
-{
- if(!Render_texture_support)
- return ;
-
- if (!wglReleaseTexImageARB)
- {
- fprintf (stderr, "wglReleaseTexImageARB not supported! Can't emulate glEGLImageTargetTexture2DOES!\n");
- return;
- }
-
- if ( !wglReleaseTexImageARB(surface->hPBuffer, WGL_FRONT_LEFT_ARB) )
- {
- fprintf(stderr, "wglBindTexImageARBr error=%d.\n", glGetError());
- }
-
-}
-
-#endif
+++ /dev/null
-/*
- * Offscreen OpenGL abstraction layer - GLX specific
- *
- * Copyright (c) 2010 Intel
- * Written by:
- * Gordon Williams <gordon.williams@collabora.co.uk>
- * Ian Molton <ian.molton@collabora.co.uk>
- *
- * 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
- * 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.
- */
-#if (!defined _WIN32) && (!defined __APPLE__)
-#include "gloffscreen.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include <GL/gl.h>
-#include <GL/glx.h>
-
-#include <sys/shm.h>
-#include <X11/extensions/XShm.h>
-#include <X11/extensions/Xcomposite.h>
-
-#ifdef MANGLE_OPENGL_SYMBOLS
-#include "gl_mangled.h"
-#endif
-
-enum{
- SURFACE_WINDOW,
- SURFACE_PIXMAP,
- SURFACE_PBUFFER,
-};
-
-void *g_malloc(size_t size);
-void *g_realloc(void *ptr, size_t size);
-void g_free(void *ptr);
-
-struct GloMain {
- Display *dpy;
- int use_ximage;
-};
-struct GloMain glo;
-int glo_inited = 0;
-
-struct _GloContext {
- GLuint formatFlags;
-
- GLXFBConfig fbConfig;
- GLXContext context;
-};
-
-struct _GloSurface {
- GLuint width;
- GLuint height;
-
- GloContext *context;
- Window window;
-
- // For use by the 'fast' copy code.
- Pixmap pixmap;
- XImage *image;
- XShmSegmentInfo shminfo;
- GLXPixmap glxPixmap;
-};
-
-extern void glo_surface_getcontents_readpixels(int formatFlags, int stride,
- int bpp, int width, int height, void *data, int noflip);
-static void glo_test_readback_methods(void);
-
-/* ------------------------------------------------------------------------ */
-
-int glo_initialised(void) {
- return glo_inited;
-}
-
-/*
- * The X error was disabled, otherwise QEMU will abort. Printing more error
- * messages inside below function could help debug potential bugs. On the
- * other hand, since the X errors could be caused by the GL calls forwarded
- * from client OS side, which does not make sense to abort the whole QEMU,
- * so it is reasonable to redirect error handler here.
- *
- */
-static int x_errhandler(Display *dpy, XErrorEvent *e)
-{
- //fprintf (stderr, "X Error Happened!\n");
- return 0;
-}
-
-#if 0
-/* Sanity test of the host GL capabilities to see whether the gl offscreen
- * could be well supported
- */
-int glo_sanity_test (void) {
- return 0;
-}
-#endif
-
-/* Initialise gloffscreen */
-int glo_init(void) {
- if (glo_inited) {
- printf( "gloffscreen already inited\n" );
- //exit( EXIT_FAILURE );
- return 1;
- }
-
- /* Open a connection to the X server */
- glo.dpy = XOpenDisplay( NULL );
- if ( glo.dpy == NULL ) {
- printf( "Unable to open a connection to the X server\n" );
- //exit( EXIT_FAILURE );
- return 1;
- }
-
- glo_inited = 1; // safe because we are single threaded. Otherwise we cause
- // recursion on the next call.
- // set the X error handler.
- XSetErrorHandler (x_errhandler);
- glo_test_readback_methods();
- return 0;
-}
-
-/* Uninitialise gloffscreen */
-void glo_kill(void) {
- XCloseDisplay(glo.dpy);
- glo.dpy = NULL;
-}
-
-
-/* Like wglGetProcAddress/glxGetProcAddress */
-void *glo_getprocaddress(const char *procName) {
- if (!glo_inited)
- glo_init();
-
- return glXGetProcAddressARB((const GLubyte *) procName);
-}
-
-/* ------------------------------------------------------------------------ */
-
-/* Create a light-weight context just for creating surface */
-GloContext *__glo_context_create(int formatFlags) {
-
- GLXFBConfig *fbConfigs;
- int numReturned;
- GloContext *context;
- int rgbaBits[4];
- int bufferAttributes[] = {
- GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT,
- GLX_RENDER_TYPE, GLX_RGBA_BIT,
- GLX_RED_SIZE, 8,
- GLX_GREEN_SIZE, 8,
- GLX_BLUE_SIZE, 8,
- GLX_ALPHA_SIZE, 8,
- GLX_DEPTH_SIZE, 0,
- GLX_STENCIL_SIZE, 0,
- None
- };
-
- if (!glo_inited)
- glo_init();
-
- // set up the surface format from the flags we were given
- glo_flags_get_rgba_bits(formatFlags, rgbaBits);
- bufferAttributes[5] = rgbaBits[0];
- bufferAttributes[7] = rgbaBits[1];
- bufferAttributes[9] = rgbaBits[2];
- bufferAttributes[11] = rgbaBits[3];
- bufferAttributes[13] = glo_flags_get_depth_bits(formatFlags);
- bufferAttributes[15] = glo_flags_get_stencil_bits(formatFlags);
-
- fbConfigs = glXChooseFBConfig( glo.dpy, DefaultScreen(glo.dpy),
- bufferAttributes, &numReturned );
- if (numReturned==0) {
- printf( "No matching configs found.\n" );
- //exit( EXIT_FAILURE );
- return NULL;
- }
- context = (GloContext*)g_malloc(sizeof(GloContext));
- memset(context, 0, sizeof(GloContext));
- context->formatFlags = formatFlags;
- context->fbConfig = fbConfigs[0];
-
- return context;
-}
-
-/* Create an OpenGL context for a certain pixel format.
- formatflags are from the GLO_ constants */
-
-GloContext *glo_context_create(int formatFlags, GloContext *shareLists) {
-
- GloContext *context = __glo_context_create(formatFlags);
-
- if (!context) {
- return NULL;
- }
-
- /* Create a GLX context for OpenGL rendering */
- context->context = glXCreateNewContext(glo.dpy, context->fbConfig,
- GLX_RGBA_TYPE,
- shareLists ? shareLists->context: NULL,
- True );
-
- if (!context->context) {
- printf( "glXCreateNewContext failed\n" );
- //exit( EXIT_FAILURE );
- return NULL;
- }
-
- return context;
-}
-
-/* Destroy a previously created OpenGL context */
-void glo_context_destroy(GloContext *context) {
- if (!context) return;
-
- // TODO: check for GloSurfaces using this?
- glXDestroyContext( glo.dpy, context->context);
- g_free(context);
-}
-
-static void glo_surface_free_xshm_image(GloSurface *surface) {
- XShmDetach(glo.dpy, &surface->shminfo);
- surface->image->data = NULL;
- XDestroyImage(surface->image);
- shmdt(surface->shminfo.shmaddr);
- shmctl(surface->shminfo.shmid, IPC_RMID, NULL);
-}
-
-//FIXMEIM - handle failure to allocate.
-static void glo_surface_try_alloc_xshm_image(GloSurface *surface) {
-
- if(surface->image)
- glo_surface_free_xshm_image(surface);
-
- surface->image =
- XShmCreateImage(glo.dpy, DefaultVisual(glo.dpy, 0), 24, ZPixmap, NULL,
- &surface->shminfo, surface->width, surface->height);
-
- surface->shminfo.shmid = shmget(IPC_PRIVATE,
- surface->image->bytes_per_line *
- surface->height,
- IPC_CREAT | 0777);
- surface->shminfo.shmaddr = shmat(surface->shminfo.shmid, NULL, 0);
- surface->image->data = surface->shminfo.shmaddr;
- surface->shminfo.readOnly = False;
- XShmAttach(glo.dpy, &surface->shminfo);
-}
-
-/* ------------------------------------------------------------------------ */
-
-/* Update the context in surface and handle previous context */
-void glo_surface_update_context(GloSurface *surface, GloContext *context, int free_flags)
- {
- /* If previous context is light-weight context, just free it. If previous
- * context is valid one binded with surface via MakeCurrent, we need unbind
- * from original glstate */
-
- if ( surface->context )
- {
- if (free_flags) /* light-weight context */
- g_free(surface->context);
- }
- surface->context = context;
-}
-
-/* Create a surface with given width and height, formatflags are from the
- * GLO_ constants */
-GloSurface *glo_surface_create(int width, int height, GloContext *context) {
- GloSurface *surface;
- XSetWindowAttributes attr = { 0 };
- unsigned long mask;
- XVisualInfo *vis;
-
- if (!context)
- return 0;
-
- surface = (GloSurface*)g_malloc(sizeof(GloSurface));
- memset(surface, 0, sizeof(GloSurface));
- surface->width = width;
- surface->height = height;
- surface->context = context;
-
- vis = glXGetVisualFromFBConfig(glo.dpy, ((struct _GloContext*)context)->fbConfig);
-
- attr.background_pixel = 0xff000000;
- attr.border_pixel = 0;
- attr.colormap = XCreateColormap(glo.dpy, DefaultRootWindow(glo.dpy),
- vis->visual, AllocNone);
- attr.event_mask = 0;
- attr.save_under = True;
- attr.override_redirect = True;
- attr.cursor = None;
- mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask |
- CWOverrideRedirect | CWSaveUnder;
-
- surface->window = XCreateWindow(glo.dpy, DefaultRootWindow(glo.dpy), 0, 3000, width, height, 0, vis->depth, InputOutput, vis->visual, mask, &attr);
-
- if (!surface->window) {
- printf( "XCreateWindow failed\n" );
- //exit( EXIT_FAILURE );
- return NULL;
- }
-
- XMapWindow(glo.dpy, surface->window);
- XCompositeRedirectWindow (glo.dpy, surface->window, CompositeRedirectAutomatic);
-
- if(glo.use_ximage) {
- surface->pixmap = XCompositeNameWindowPixmap(glo.dpy, surface->window);
- } else {
- surface->pixmap = XCreatePixmap( glo.dpy, DefaultRootWindow(glo.dpy),
- width, height,
- glo_flags_get_bytes_per_pixel(context->formatFlags)*8);
- }
-
- if(surface->pixmap == 0) {
- fprintf(stderr, "Failed to allocate pixmap!\n");
- //exit(EXIT_FAILURE);
- return NULL;
- }
-
- /* Create a GLX pixmap to associate the frame buffer configuration with the
- * created X window */
- /*XXX: need attribute_list? */
- surface->glxPixmap = glXCreatePixmap( glo.dpy, context->fbConfig, surface->pixmap, NULL );
- if (!surface->glxPixmap) {
- printf( "glXCreatePixmap failed\n" );
- //exit( EXIT_FAILURE );
- return NULL;
- }
-
- XSync(glo.dpy, 0);
-
- /* set hints and properties */
- {
- XSizeHints sizehints;
-
- sizehints.x = 0;
- sizehints.y = 0;
- sizehints.width = width;
- sizehints.height = height;
- sizehints.flags = USSize | USPosition;
- XSetWMNormalHints(glo.dpy, surface->window, &sizehints);
- XSetStandardProperties(glo.dpy, surface->window, "", "", None,
- (char **) NULL, 0, &sizehints);
- }
-
- XSync(glo.dpy, 0);
-
- // If we're using XImages to pull the data from the graphics card...
- glo_surface_try_alloc_xshm_image(surface);
-
- return surface;
-}
-
-/* Destroy the given surface */
-void glo_surface_destroy(GloSurface *surface) {
-
- if(surface->pixmap)
- XFreePixmap( glo.dpy, surface->pixmap);
-
- if(surface->glxPixmap)
- glXDestroyPixmap( glo.dpy, surface->glxPixmap);
-
- XDestroyWindow( glo.dpy, surface->window);
- if(surface->image)
- glo_surface_free_xshm_image(surface);
- g_free(surface);
-
-}
-
-/* Make the given surface current */
-int glo_surface_makecurrent(GloSurface *surface) {
- int ret;
-
- if (!glo_inited)
- glo_init();
-
- if (surface)
- ret = glXMakeCurrent(glo.dpy, surface->window,
- surface->context->context);
- else
- ret = glXMakeCurrent(glo.dpy, 0, NULL);
-
- return ret;
-}
-
-void glo_surface_updatecontents(GloSurface *surface) {
- if (!surface)
- return;
-
- if(glo.use_ximage) {
- glXWaitGL();
-
- if(surface->image) {
- XShmGetImage (glo.dpy, surface->pixmap, surface->image, 0, 0, AllPlanes);
- }
- else {
- XGetImage(glo.dpy, surface->pixmap, 0, 0, surface->width, surface->height, AllPlanes, ZPixmap);
- }
- }
-
-}
-
-/* Get the contents of the given surface */
-void glo_surface_getcontents(GloSurface *surface, int stride, int bpp, void *data) {
- static int once;
- XImage *img;
-
- if (!surface)
- return;
-
- if(glo.use_ximage) {
- glXWaitGL();
-
- if(surface->image) {
- XShmGetImage (glo.dpy, surface->pixmap, surface->image, 0, 0, AllPlanes);
- img = surface->image;
- }
- else {
- img = XGetImage(glo.dpy, surface->pixmap, 0, 0, surface->width, surface->height, AllPlanes, ZPixmap);
- }
-
- if (img) {
- if(bpp != 32 && bpp != 24 && !once) {
- fprintf(stderr, "Warning: unsupported colourdepth\n");
- once = 1;
- }
-
- if(bpp == img->bits_per_pixel && stride == img->bytes_per_line)
- {
- memcpy(data, img->data, stride * surface->height);
- }
- else
- {
- int x, y;
- for(y = 0 ; y < surface->height ; y++) {
- for(x = 0 ; x < surface->width ; x++) {
- char *src = ((char*)img->data) +
- (x*(img->bits_per_pixel/8)) +
- (y*img->bytes_per_line);
- char *dst = ((char*)data) + x*(bpp/8) + (y*stride);
- dst[0] = src[0];
- dst[1] = src[1];
- dst[2] = src[2];
- if(bpp == 32)
- dst[3] = 0xff; // if guest is 32 bit and host is 24
- }
- }
- }
-
- // If we're not using Shm
- if(!surface->image)
- XDestroyImage(img);
-
- return; // We're done.
- }
- // Uh oh... better fallback. Perhaps get glo.use_ximage to 0?
- }
-
- // Compatible / fallback method.
- glo_surface_getcontents_readpixels(surface->context->formatFlags,
- stride, bpp, surface->width,
- surface->height, data, 0);
-}
-
-/* Return the width and height of the given surface */
-void glo_surface_get_size(GloSurface *surface, int *width, int *height) {
- if (width)
- *width = surface->width;
- if (height)
- *height = surface->height;
-}
-
-/* Bind the surface as texture */
-void glo_surface_as_texture(GloContext *ctxt, GloSurface *surface, int surface_type)
-{
-#if 0
- void (*ptr_func_glXBindTexImageEXT) (Display *dpy, GLXDrawable draw, int buffer, int *attrib_list);
- ptr_func_glXBindTexImageEXT =
- (void(*)(Display*, GLXDrawable, int, int*))glo_getprocaddress((const char*)"glXBindTexImageEXT");
-
- /*XXX: When to call the glXReleaseTexImageEXT?*/
- if (!ptr_func_glXBindTexImageEXT)
- {
- fprintf (stderr, "glXBindTexImageEXT not supported! Can't emulate glEGLImageTargetTexture2DOES!\n");
- }
-
- fprintf(stderr, "surface_as_texture:error=%d.\n", glGetError());
- ptr_func_glXBindTexImageEXT(glo.dpy, surface->glxPixmap, GLX_FRONT_LEFT_EXT, NULL);
- fprintf(stderr, "surface_as_texture:2:error=%d.\n", glGetError());
-#else
- int glFormat, glType;
- glo_surface_updatecontents(surface);
- /*XXX: changet the fixed target: GL_TEXTURE_2D*/
- glo_flags_get_readpixel_type(surface->context->formatFlags, &glFormat, &glType);
-/* fprintf(stderr, "surface_as_texture:teximage:width=%d,height=%d, glFormat=0x%x, glType=0x%x.\n", surface->width, surface->height, glFormat, glType);*/
- /* glTexImage2D use different RGB order than the contexts in the pixmap surface */
-/* glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, surface->width, surface->height, 0, GL_RGBA, GL_UNSIGNED_BYTE, surface->image->data);*/
-
- if(surface_type == SURFACE_PBUFFER)
- {
- if ((glFormat == GL_RGBA || glFormat == GL_BGRA) && glType == GL_UNSIGNED_BYTE) {
- GLubyte *b = (GLubyte *)surface->image->data;
- int stride = surface->width * 4;
- GLubyte *c = &((GLubyte *)surface->image->data)[stride*(surface->height-1)];
- GLubyte *tmp = (GLubyte*)g_malloc(stride);
- int irow;
-
- for(irow = 0; irow < surface->height / 2; irow++) {
- memcpy(tmp, b, stride);
- memcpy(b, c, stride);
- memcpy(c, tmp, stride);
- b += stride;
- c -= stride;
- }
- g_free(tmp);
- }
- }
-
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, surface->width, surface->height, 0, glFormat, glType, surface->image->data);
-#endif
-}
-
-void glo_surface_release_texture(GloSurface *surface)
-{
-}
-
- /* Abstract glXQueryExtensionString() */
-const char *glo_glXQueryExtensionsString(void) {
- return glXQueryExtensionsString(glo.dpy, 0);
-}
-
-
-#define TX (17)
-#define TY (16)
-
-static int glo_can_readback(void) {
- GloContext *context;
- GloSurface *surface;
-
- unsigned char *datain = (unsigned char *)g_malloc(4*TX*TY);
- unsigned char *datain_flip = (unsigned char *)g_malloc(4*TX*TY); // flipped input data (for GL)
- unsigned char *dataout;
- unsigned char *p;
- int x,y;
-
- const int bufferAttributes[] = {
- GLX_RED_SIZE, 8,
- GLX_GREEN_SIZE, 8,
- GLX_BLUE_SIZE, 8,
- GLX_ALPHA_SIZE, 8,
- GLX_DEPTH_SIZE, 0,
- GLX_STENCIL_SIZE, 0,
- 0,
- };
-
- int bufferFlags = glo_flags_get_from_glx(bufferAttributes, 0);
- int bpp = glo_flags_get_bytes_per_pixel(bufferFlags);
- int glFormat, glType;
-
- memset(datain_flip, 0, TX*TY*4);
- memset(datain, 0, TX*TY*4);
-
- p = datain;
- for (y=0;y<TY;y++) {
- for (x=0;x<TX;x++) {
- p[0] = x;
- p[1] = y;
- if (bpp>2) p[2] = 0;
- if (bpp>3) p[3] = 0xFF;
- p+=bpp;
- }
- memcpy(&datain_flip[((TY-1)-y)*bpp*TX], &datain[y*bpp*TX], bpp*TX);
- }
-
- context = glo_context_create(bufferFlags, 0);
- if (context == NULL) {
- g_free(datain);
- g_free(datain_flip);
- return 1;
- }
- surface = glo_surface_create(TX, TY, context);
- if (surface == NULL) {
- g_free(datain);
- g_free(datain_flip);
- return 1;
- }
-
- glo_surface_makecurrent(surface);
-
- glClear(GL_COLOR_BUFFER_BIT);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(0,TX, 0,TY, 0, 1);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- glRasterPos2f(0,0);
- glo_flags_get_readpixel_type(bufferFlags, &glFormat, &glType);
- glDrawPixels(TX,TY,glFormat, glType, datain_flip);
- glFlush();
-
- dataout = (unsigned char *)g_malloc(4*TX*TY);
- memset(dataout, 0, bpp*TX*TY);
-
- glo_surface_getcontents(surface, TX*4, bpp*8, dataout);
-
- glo_surface_destroy(surface);
- glo_context_destroy(context);
-
- if (memcmp(datain, dataout, bpp*TX*TY)==0) {
- g_free(datain);
- g_free(datain_flip);
- g_free(dataout);
- return 1;
- }
-
- g_free(datain);
- g_free(datain_flip);
- g_free(dataout);
-
- return 0;
-}
-
-static void glo_test_readback_methods(void) {
- glo.use_ximage = 1;
- if(!glo_can_readback())
- glo.use_ximage = 0;
-
- //fprintf(stderr, "VM GL: Using %s readback\n", glo.use_ximage?"XImage":"glReadPixels");
-}
-
-#endif
+++ /dev/null
-/*
- * Host-side implementation of GL/GLX API
- *
- * Copyright (c) 2006,2007 Even Rouault
- * Modified by:
- * Gordon Williams <gordon.williams@collabora.co.uk>
- * Ian Molton <ian.molton@collabora.co.uk>
- *
- * 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
- * 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.
- */
-
-#define _XOPEN_SOURCE 600
-
-#include <string.h>
-#include <stdlib.h>
-#include <assert.h>
-#include "qemu/osdep.h"
-#include "opengl_func.h"
-#include "opengl_process.h"
-#include "opengl_exec.h"
-#include "helper_opengl.h"
-
-#include "tizen/src/debug_ch.h"
-MULTI_DEBUG_CHANNEL(qemu, opengl);
-#define DEBUGF TRACE
-
-#if 0
-#ifdef _WIN32
-#define DEBUGF(...) printf(__VA_ARGS__)
-#else
-extern struct FILE *stderr; /* Standard error output stream. */
-#define DEBUGF(...) fprintf(stderr, __VA_ARGS__)
-#endif
-#endif
-
-/* do_decode_call_int()
- *
- * Loop through the buffered command stream executing each OpenGL call in
- * sequence. due to the way calls are buffered, only the last call in the
- * buffer may have 'out' parameters or a non-void return code. This allows
- * for efficient buffering whilst avoiding un-necessary buffer flushes.
- */
-
-typedef unsigned long host_ptr;
-
-static inline int do_decode_call_int(ProcessStruct *process, void *args_in, int args_len, char *r_buffer)
-{
- Signature *signature;
- int i, ret;
- char *argptr;
- static host_ptr args[50];
- int func_number;
-#ifdef __APPLE__
- char temp4mac[256];
-#endif
-
- if(!args_len)
- return 0;
-
- argptr = args_in;
-
- while((char*)argptr < (char*)args_in + args_len) {
- func_number = *(short*)argptr;
- argptr += 2;
-
- if(func_number >= GL_N_CALLS) {
- DEBUGF("Bad function number or corrupt command queue\n");
- return 0;
- }
-
- signature = (Signature *) tab_opengl_calls[func_number];
-
- for (i = 0; i < signature->nb_args; i++) {
- int args_size = *(int*)argptr;
- argptr+=4;
- switch (signature->args_type[i]) {
- case TYPE_UNSIGNED_INT:
- case TYPE_INT:
- case TYPE_UNSIGNED_CHAR:
- case TYPE_CHAR:
- case TYPE_UNSIGNED_SHORT:
- case TYPE_SHORT:
- case TYPE_FLOAT:
- args[i] = *(int*)argptr;
- break;
-
- case TYPE_NULL_TERMINATED_STRING:
- CASE_IN_UNKNOWN_SIZE_POINTERS:
- {
- if(*(int*)argptr)
- args[i] = (host_ptr)argptr+4;
- else
- args[i] = (host_ptr)NULL;
-
- if ((args[i] == 0 && args_size == 0 &&
- !IS_NULL_POINTER_OK_FOR_FUNC(func_number)) ||
- (args[i] == 0 && args_size != 0))
- return 0;
-
- argptr += 4;
- break;
- }
-
- CASE_IN_LENGTH_DEPENDING_ON_PREVIOUS_ARGS:
- {
- if(*(int*)argptr)
- args[i] = (host_ptr)argptr+4;
- else
- args[i] = (host_ptr)NULL;
-
- if (args[i] == 0 && args_size != 0)
- return 0;
-
- argptr += 4;
- break;
- }
-
- CASE_OUT_POINTERS:
- {
- /* NULL pointer is used as output pointer
- since the argument size is zero. */
- if (args_size == 0) {
- *(int*)r_buffer = 0;
- r_buffer += 4;
-#ifdef __APPLE__
-/*On MAC OS, GL call glGetProgramInfoLog and glGetShaderInfoLog will crash if ouput pointer is NULL*/
- args[i] = (host_ptr)temp4mac;
-#else
- args[i] = (host_ptr)NULL;
-#endif
- } else if(*(int*)argptr) {
- *(int*)r_buffer = args_size;
- r_buffer+=4;
- args[i] = (host_ptr)r_buffer;
- r_buffer += args_size;
- }
- else {
- args[i] = 0;
- }
-
- argptr += 4;
- args_size = 0;
- break;
- }
-
- case TYPE_DOUBLE:
- CASE_IN_KNOWN_SIZE_POINTERS:
- {
- if(*(int*)argptr)
- args[i] = (host_ptr)argptr+4;
- else
- args[i] = (host_ptr)NULL;
-
- if (args[i] == 0 && args_size != 0)
- return 0;
-
- argptr += 4;
- break;
- }
-
- case TYPE_IN_IGNORED_POINTER:
- args[i] = 0;
- break;
-
- default:
- DEBUGF( "Oops : call %s arg %d pid=%d\n",
- tab_opengl_calls_name[func_number], i,
- process->process_id);
- return 0;
- }
- argptr += args_size;
- }
-
- if((char*)argptr > (char*)args_in + args_len) {
- DEBUGF("Client bug: malformed command, killing process\n");
- return 0;
- }
-
- if (signature->ret_type == TYPE_CONST_CHAR)
- r_buffer[0] = 0; // In case high bits are set.
-
- ret = do_function_call(process, func_number, args, r_buffer);
- switch(signature->ret_type) {
- case TYPE_INT:
- case TYPE_UNSIGNED_INT:
- memcpy(r_buffer, &ret, sizeof(int));
- break;
- case TYPE_CHAR:
- case TYPE_UNSIGNED_CHAR:
- *r_buffer = ret & 0xff;
- break;
- case TYPE_CONST_CHAR:
- case TYPE_NONE:
- break;
- default:
- DEBUGF("Unsupported GL API return type %i!\n", signature->ret_type);
- exit (-1);
- }
- } // endwhile
-/*
- switch(signature->ret_type) {
- case TYPE_INT:
- case TYPE_UNSIGNED_INT:
- memcpy(r_buffer, &ret, sizeof(int));
- break;
- case TYPE_CHAR:
- case TYPE_UNSIGNED_CHAR:
- *r_buffer = ret & 0xff;
- break;
- case TYPE_CONST_CHAR:
- case TYPE_NONE:
- break;
- default:
- DEBUGF("Unsupported GL API return type %i!\n", signature->ret_type);
- exit (-1);
- }
-*/
- return 1;
-}
-#define GL_PASSINGTHROUGH_ABI 1
-
-#define GLINIT_FAIL_ABI 3
-#define GLINIT_QUEUE 2
-#define GLINIT_NOQUEUE 1
-
-int decode_call_int(ProcessStruct *process, char *in_args, int args_len, char *r_buffer)
-{
- static ProcessStruct *cur_process = NULL;
- int ret;
- int first_func = *(short*)in_args;
-
- /* Select the appropriate context for this pid if it isnt already active
- * Note: if we're about to execute glXMakeCurrent() then we tell the
- * renderer not to waste its time switching contexts
- */
-
- if (cur_process != process) {
- cur_process = process;
- vmgl_context_switch(cur_process, (first_func == glXMakeCurrent_func)?0:1);
- }
-
- if(unlikely(first_func == _init32_func || first_func == _init64_func)) {
- if(!cur_process->wordsize) {
- int *version = (int*)(in_args+2);
- cur_process->wordsize = first_func == _init32_func?4:8;
-
- if((version[0] != 1) || (version[1] < GL_PASSINGTHROUGH_ABI)) {
- *(int*)r_buffer = GLINIT_FAIL_ABI; // ABI check FAIL
- TRACE("Error! The GL passing through package in the image does not match the version of QEMUGL. Please update the image!\n");
- exit (1);
- } else if(version[1] > GL_PASSINGTHROUGH_ABI) {
- *(int*)r_buffer = GLINIT_FAIL_ABI; // ABI check FAIL
- TRACE("Error! The GL passing through package in the image does not match the version of QEMUGL. Please update the QEMUGL!\n");
- exit (1);
- }
- else
- *(int*)r_buffer = GLINIT_QUEUE; // Indicate that we can buffer commands
-
- return 1; // Initialisation done
- }
- else {
- DEBUGF("Attempt to init twice. Continuing regardless.\n");
- return 1;
- }
- }
-
- if(unlikely(first_func == -1 || !cur_process->wordsize)) {
- if(!cur_process->wordsize && first_func != -1)
- DEBUGF("commands submitted before process init.\n");
- ret = 0;
- }
- else {
- ret = do_decode_call_int(cur_process, in_args, args_len, r_buffer);
- }
-
- if(!ret)
- cur_process = NULL;
-
- return ret;
-}
+++ /dev/null
-/*
- * Host-side implementation of GL/GLX API
- *
- * Copyright (c) 2013 Intel Corporation
- *
- * 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
- * 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 "opengl_process.h"
-
-int decode_call_int(ProcessStruct *p, char *in_args, int args_len, char *r_buffer);
#define PCI_DEVICE_ID_VIRTIO_ESM 0x1024
#define PCI_DEVICE_ID_VIRTIO_HWKEY 0x1028
#define PCI_DEVICE_ID_VIRTIO_EVDI 0x102C
-#define PCI_DEVICE_ID_VIRTIO_GL 0x1030
#define PCI_DEVICE_ID_VIRTIO_SENSOR 0x1034
#define PCI_DEVICE_ID_VIRTIO_POWER 0x1035
#define PCI_DEVICE_ID_VIRTIO_JACK 0x1036
#define VIRTIO_ID_ESM 33
#define VIRTIO_ID_HWKEY 34
#define VIRTIO_ID_EVDI 35
-#define VIRTIO_ID_GL 36
#define VIRTIO_ID_SENSOR 37
#define VIRTIO_ID_NFC 38
#define VIRTIO_ID_JACK 39
+++ /dev/null
-/*
- * Mesa 3-D graphics library
- * Version: 6.5.1
- *
- * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-#ifndef __gl_h_
-#define __gl_h_
-
-#if defined(USE_MGL_NAMESPACE)
-#include "gl_mangle.h"
-#endif
-
-
-/**********************************************************************
- * Begin system-specific stuff. Do not do any of this when building
- * for SciTech SNAP, as this is all done before this header file is
- * included.
- */
-#if !defined(__SCITECH_SNAP__)
-
-#if defined(__BEOS__)
-#include <stdlib.h> /* to get some BeOS-isms */
-#endif
-
-#if !defined(OPENSTEP) && (defined(NeXT) || defined(NeXT_PDO))
-#define OPENSTEP
-#endif
-
-#if defined(_WIN32) && !defined(__WIN32__) && !defined(__CYGWIN__)
-#define __WIN32__
-#endif
-
-#if !defined(OPENSTEP) && (defined(__WIN32__) && !defined(__CYGWIN__))
-# if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */
-# define GLAPI __declspec(dllexport)
-# elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
-# define GLAPI __declspec(dllimport)
-# else /* for use with static link lib build of Win32 edition only */
-# define GLAPI extern
-# endif /* _STATIC_MESA support */
-# define GLAPIENTRY __stdcall
-#elif defined(__CYGWIN__) && defined(USE_OPENGL32) /* use native windows opengl32 */
-# define GLAPI extern
-# define GLAPIENTRY __stdcall
-#elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303
-# define GLAPI __attribute__((visibility("default")))
-# define GLAPIENTRY
-#endif /* WIN32 && !CYGWIN */
-
-#if (defined(__BEOS__) && defined(__POWERPC__)) || defined(__QUICKDRAW__)
-# define PRAGMA_EXPORT_SUPPORTED 1
-#endif
-
-/*
- * WINDOWS: Include windows.h here to define APIENTRY.
- * It is also useful when applications include this file by
- * including only glut.h, since glut.h depends on windows.h.
- * Applications needing to include windows.h with parms other
- * than "WIN32_LEAN_AND_MEAN" may include windows.h before
- * glut.h or gl.h.
- */
-#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__)
-#define WIN32_LEAN_AND_MEAN 1
-#include <windows.h>
-#endif
-
-#if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP) && !defined(__CYGWIN__)
-#include <GL/mesa_wgl.h>
-#endif
-
-#if defined(macintosh) && PRAGMA_IMPORT_SUPPORTED
-#pragma import on
-#endif
-
-#ifndef GLAPI
-#define GLAPI extern
-#endif
-
-#ifndef GLAPIENTRY
-#define GLAPIENTRY
-#endif
-
-#ifndef APIENTRY
-#define APIENTRY GLAPIENTRY
-#endif
-
-/* "P" suffix to be used for a pointer to a function */
-#ifndef APIENTRYP
-#define APIENTRYP APIENTRY *
-#endif
-
-#ifndef GLAPIENTRYP
-#define GLAPIENTRYP GLAPIENTRY *
-#endif
-
-#ifdef CENTERLINE_CLPP
-#define signed
-#endif
-
-#if defined(PRAGMA_EXPORT_SUPPORTED)
-#pragma export on
-#endif
-
-#endif /* !__SCITECH_SNAP__ */
-/*
- * End system-specific stuff.
- **********************************************************************/
-
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-
-#define GL_VERSION_1_1 1
-#define GL_VERSION_1_2 1
-#define GL_VERSION_1_3 1
-#define GL_ARB_imaging 1
-
-
-/*
- * Datatypes
- */
-typedef unsigned int GLenum;
-typedef unsigned char GLboolean;
-typedef unsigned int GLbitfield;
-typedef void GLvoid;
-typedef signed char GLbyte; /* 1-byte signed */
-typedef short GLshort; /* 2-byte signed */
-typedef int GLint; /* 4-byte signed */
-typedef unsigned char GLubyte; /* 1-byte unsigned */
-typedef unsigned short GLushort; /* 2-byte unsigned */
-typedef unsigned int GLuint; /* 4-byte unsigned */
-typedef int GLsizei; /* 4-byte signed */
-typedef float GLfloat; /* single precision float */
-typedef float GLclampf; /* single precision float in [0,1] */
-typedef double GLdouble; /* double precision float */
-typedef double GLclampd; /* double precision float in [0,1] */
-
-
-
-/*
- * Constants
- */
-
-/* Boolean values */
-#define GL_FALSE 0x0
-#define GL_TRUE 0x1
-
-/* Data types */
-#define GL_BYTE 0x1400
-#define GL_UNSIGNED_BYTE 0x1401
-#define GL_SHORT 0x1402
-#define GL_UNSIGNED_SHORT 0x1403
-#define GL_INT 0x1404
-#define GL_UNSIGNED_INT 0x1405
-#define GL_FLOAT 0x1406
-#define GL_2_BYTES 0x1407
-#define GL_3_BYTES 0x1408
-#define GL_4_BYTES 0x1409
-#define GL_DOUBLE 0x140A
-
-/* Primitives */
-#define GL_POINTS 0x0000
-#define GL_LINES 0x0001
-#define GL_LINE_LOOP 0x0002
-#define GL_LINE_STRIP 0x0003
-#define GL_TRIANGLES 0x0004
-#define GL_TRIANGLE_STRIP 0x0005
-#define GL_TRIANGLE_FAN 0x0006
-#define GL_QUADS 0x0007
-#define GL_QUAD_STRIP 0x0008
-#define GL_POLYGON 0x0009
-
-/* Vertex Arrays */
-#define GL_VERTEX_ARRAY 0x8074
-#define GL_NORMAL_ARRAY 0x8075
-#define GL_COLOR_ARRAY 0x8076
-#define GL_INDEX_ARRAY 0x8077
-#define GL_TEXTURE_COORD_ARRAY 0x8078
-#define GL_EDGE_FLAG_ARRAY 0x8079
-#define GL_VERTEX_ARRAY_SIZE 0x807A
-#define GL_VERTEX_ARRAY_TYPE 0x807B
-#define GL_VERTEX_ARRAY_STRIDE 0x807C
-#define GL_NORMAL_ARRAY_TYPE 0x807E
-#define GL_NORMAL_ARRAY_STRIDE 0x807F
-#define GL_COLOR_ARRAY_SIZE 0x8081
-#define GL_COLOR_ARRAY_TYPE 0x8082
-#define GL_COLOR_ARRAY_STRIDE 0x8083
-#define GL_INDEX_ARRAY_TYPE 0x8085
-#define GL_INDEX_ARRAY_STRIDE 0x8086
-#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088
-#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089
-#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A
-#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C
-#define GL_VERTEX_ARRAY_POINTER 0x808E
-#define GL_NORMAL_ARRAY_POINTER 0x808F
-#define GL_COLOR_ARRAY_POINTER 0x8090
-#define GL_INDEX_ARRAY_POINTER 0x8091
-#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092
-#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093
-#define GL_V2F 0x2A20
-#define GL_V3F 0x2A21
-#define GL_C4UB_V2F 0x2A22
-#define GL_C4UB_V3F 0x2A23
-#define GL_C3F_V3F 0x2A24
-#define GL_N3F_V3F 0x2A25
-#define GL_C4F_N3F_V3F 0x2A26
-#define GL_T2F_V3F 0x2A27
-#define GL_T4F_V4F 0x2A28
-#define GL_T2F_C4UB_V3F 0x2A29
-#define GL_T2F_C3F_V3F 0x2A2A
-#define GL_T2F_N3F_V3F 0x2A2B
-#define GL_T2F_C4F_N3F_V3F 0x2A2C
-#define GL_T4F_C4F_N3F_V4F 0x2A2D
-
-/* Matrix Mode */
-#define GL_MATRIX_MODE 0x0BA0
-#define GL_MODELVIEW 0x1700
-#define GL_PROJECTION 0x1701
-#define GL_TEXTURE 0x1702
-
-/* Points */
-#define GL_POINT_SMOOTH 0x0B10
-#define GL_POINT_SIZE 0x0B11
-#define GL_POINT_SIZE_GRANULARITY 0x0B13
-#define GL_POINT_SIZE_RANGE 0x0B12
-
-/* Lines */
-#define GL_LINE_SMOOTH 0x0B20
-#define GL_LINE_STIPPLE 0x0B24
-#define GL_LINE_STIPPLE_PATTERN 0x0B25
-#define GL_LINE_STIPPLE_REPEAT 0x0B26
-#define GL_LINE_WIDTH 0x0B21
-#define GL_LINE_WIDTH_GRANULARITY 0x0B23
-#define GL_LINE_WIDTH_RANGE 0x0B22
-
-/* Polygons */
-#define GL_POINT 0x1B00
-#define GL_LINE 0x1B01
-#define GL_FILL 0x1B02
-#define GL_CW 0x0900
-#define GL_CCW 0x0901
-#define GL_FRONT 0x0404
-#define GL_BACK 0x0405
-#define GL_POLYGON_MODE 0x0B40
-#define GL_POLYGON_SMOOTH 0x0B41
-#define GL_POLYGON_STIPPLE 0x0B42
-#define GL_EDGE_FLAG 0x0B43
-#define GL_CULL_FACE 0x0B44
-#define GL_CULL_FACE_MODE 0x0B45
-#define GL_FRONT_FACE 0x0B46
-#define GL_POLYGON_OFFSET_FACTOR 0x8038
-#define GL_POLYGON_OFFSET_UNITS 0x2A00
-#define GL_POLYGON_OFFSET_POINT 0x2A01
-#define GL_POLYGON_OFFSET_LINE 0x2A02
-#define GL_POLYGON_OFFSET_FILL 0x8037
-
-/* Display Lists */
-#define GL_COMPILE 0x1300
-#define GL_COMPILE_AND_EXECUTE 0x1301
-#define GL_LIST_BASE 0x0B32
-#define GL_LIST_INDEX 0x0B33
-#define GL_LIST_MODE 0x0B30
-
-/* Depth buffer */
-#define GL_NEVER 0x0200
-#define GL_LESS 0x0201
-#define GL_EQUAL 0x0202
-#define GL_LEQUAL 0x0203
-#define GL_GREATER 0x0204
-#define GL_NOTEQUAL 0x0205
-#define GL_GEQUAL 0x0206
-#define GL_ALWAYS 0x0207
-#define GL_DEPTH_TEST 0x0B71
-#define GL_DEPTH_BITS 0x0D56
-#define GL_DEPTH_CLEAR_VALUE 0x0B73
-#define GL_DEPTH_FUNC 0x0B74
-#define GL_DEPTH_RANGE 0x0B70
-#define GL_DEPTH_WRITEMASK 0x0B72
-#define GL_DEPTH_COMPONENT 0x1902
-
-/* Lighting */
-#define GL_LIGHTING 0x0B50
-#define GL_LIGHT0 0x4000
-#define GL_LIGHT1 0x4001
-#define GL_LIGHT2 0x4002
-#define GL_LIGHT3 0x4003
-#define GL_LIGHT4 0x4004
-#define GL_LIGHT5 0x4005
-#define GL_LIGHT6 0x4006
-#define GL_LIGHT7 0x4007
-#define GL_SPOT_EXPONENT 0x1205
-#define GL_SPOT_CUTOFF 0x1206
-#define GL_CONSTANT_ATTENUATION 0x1207
-#define GL_LINEAR_ATTENUATION 0x1208
-#define GL_QUADRATIC_ATTENUATION 0x1209
-#define GL_AMBIENT 0x1200
-#define GL_DIFFUSE 0x1201
-#define GL_SPECULAR 0x1202
-#define GL_SHININESS 0x1601
-#define GL_EMISSION 0x1600
-#define GL_POSITION 0x1203
-#define GL_SPOT_DIRECTION 0x1204
-#define GL_AMBIENT_AND_DIFFUSE 0x1602
-#define GL_COLOR_INDEXES 0x1603
-#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52
-#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51
-#define GL_LIGHT_MODEL_AMBIENT 0x0B53
-#define GL_FRONT_AND_BACK 0x0408
-#define GL_SHADE_MODEL 0x0B54
-#define GL_FLAT 0x1D00
-#define GL_SMOOTH 0x1D01
-#define GL_COLOR_MATERIAL 0x0B57
-#define GL_COLOR_MATERIAL_FACE 0x0B55
-#define GL_COLOR_MATERIAL_PARAMETER 0x0B56
-#define GL_NORMALIZE 0x0BA1
-
-/* User clipping planes */
-#define GL_CLIP_PLANE0 0x3000
-#define GL_CLIP_PLANE1 0x3001
-#define GL_CLIP_PLANE2 0x3002
-#define GL_CLIP_PLANE3 0x3003
-#define GL_CLIP_PLANE4 0x3004
-#define GL_CLIP_PLANE5 0x3005
-
-/* Accumulation buffer */
-#define GL_ACCUM_RED_BITS 0x0D58
-#define GL_ACCUM_GREEN_BITS 0x0D59
-#define GL_ACCUM_BLUE_BITS 0x0D5A
-#define GL_ACCUM_ALPHA_BITS 0x0D5B
-#define GL_ACCUM_CLEAR_VALUE 0x0B80
-#define GL_ACCUM 0x0100
-#define GL_ADD 0x0104
-#define GL_LOAD 0x0101
-#define GL_MULT 0x0103
-#define GL_RETURN 0x0102
-
-/* Alpha testing */
-#define GL_ALPHA_TEST 0x0BC0
-#define GL_ALPHA_TEST_REF 0x0BC2
-#define GL_ALPHA_TEST_FUNC 0x0BC1
-
-/* Blending */
-#define GL_BLEND 0x0BE2
-#define GL_BLEND_SRC 0x0BE1
-#define GL_BLEND_DST 0x0BE0
-#define GL_ZERO 0x0
-#define GL_ONE 0x1
-#define GL_SRC_COLOR 0x0300
-#define GL_ONE_MINUS_SRC_COLOR 0x0301
-#define GL_SRC_ALPHA 0x0302
-#define GL_ONE_MINUS_SRC_ALPHA 0x0303
-#define GL_DST_ALPHA 0x0304
-#define GL_ONE_MINUS_DST_ALPHA 0x0305
-#define GL_DST_COLOR 0x0306
-#define GL_ONE_MINUS_DST_COLOR 0x0307
-#define GL_SRC_ALPHA_SATURATE 0x0308
-
-/* Render Mode */
-#define GL_FEEDBACK 0x1C01
-#define GL_RENDER 0x1C00
-#define GL_SELECT 0x1C02
-
-/* Feedback */
-#define GL_2D 0x0600
-#define GL_3D 0x0601
-#define GL_3D_COLOR 0x0602
-#define GL_3D_COLOR_TEXTURE 0x0603
-#define GL_4D_COLOR_TEXTURE 0x0604
-#define GL_POINT_TOKEN 0x0701
-#define GL_LINE_TOKEN 0x0702
-#define GL_LINE_RESET_TOKEN 0x0707
-#define GL_POLYGON_TOKEN 0x0703
-#define GL_BITMAP_TOKEN 0x0704
-#define GL_DRAW_PIXEL_TOKEN 0x0705
-#define GL_COPY_PIXEL_TOKEN 0x0706
-#define GL_PASS_THROUGH_TOKEN 0x0700
-#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0
-#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1
-#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2
-
-/* Selection */
-#define GL_SELECTION_BUFFER_POINTER 0x0DF3
-#define GL_SELECTION_BUFFER_SIZE 0x0DF4
-
-/* Fog */
-#define GL_FOG 0x0B60
-#define GL_FOG_MODE 0x0B65
-#define GL_FOG_DENSITY 0x0B62
-#define GL_FOG_COLOR 0x0B66
-#define GL_FOG_INDEX 0x0B61
-#define GL_FOG_START 0x0B63
-#define GL_FOG_END 0x0B64
-#define GL_LINEAR 0x2601
-#define GL_EXP 0x0800
-#define GL_EXP2 0x0801
-
-/* Logic Ops */
-#define GL_LOGIC_OP 0x0BF1
-#define GL_INDEX_LOGIC_OP 0x0BF1
-#define GL_COLOR_LOGIC_OP 0x0BF2
-#define GL_LOGIC_OP_MODE 0x0BF0
-#define GL_CLEAR 0x1500
-#define GL_SET 0x150F
-#define GL_COPY 0x1503
-#define GL_COPY_INVERTED 0x150C
-#define GL_NOOP 0x1505
-#define GL_INVERT 0x150A
-#define GL_AND 0x1501
-#define GL_NAND 0x150E
-#define GL_OR 0x1507
-#define GL_NOR 0x1508
-#define GL_XOR 0x1506
-#define GL_EQUIV 0x1509
-#define GL_AND_REVERSE 0x1502
-#define GL_AND_INVERTED 0x1504
-#define GL_OR_REVERSE 0x150B
-#define GL_OR_INVERTED 0x150D
-
-/* Stencil */
-#define GL_STENCIL_BITS 0x0D57
-#define GL_STENCIL_TEST 0x0B90
-#define GL_STENCIL_CLEAR_VALUE 0x0B91
-#define GL_STENCIL_FUNC 0x0B92
-#define GL_STENCIL_VALUE_MASK 0x0B93
-#define GL_STENCIL_FAIL 0x0B94
-#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
-#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
-#define GL_STENCIL_REF 0x0B97
-#define GL_STENCIL_WRITEMASK 0x0B98
-#define GL_STENCIL_INDEX 0x1901
-#define GL_KEEP 0x1E00
-#define GL_REPLACE 0x1E01
-#define GL_INCR 0x1E02
-#define GL_DECR 0x1E03
-
-/* Buffers, Pixel Drawing/Reading */
-#define GL_NONE 0x0
-#define GL_LEFT 0x0406
-#define GL_RIGHT 0x0407
-/*GL_FRONT 0x0404 */
-/*GL_BACK 0x0405 */
-/*GL_FRONT_AND_BACK 0x0408 */
-#define GL_FRONT_LEFT 0x0400
-#define GL_FRONT_RIGHT 0x0401
-#define GL_BACK_LEFT 0x0402
-#define GL_BACK_RIGHT 0x0403
-#define GL_AUX0 0x0409
-#define GL_AUX1 0x040A
-#define GL_AUX2 0x040B
-#define GL_AUX3 0x040C
-#define GL_COLOR_INDEX 0x1900
-#define GL_RED 0x1903
-#define GL_GREEN 0x1904
-#define GL_BLUE 0x1905
-#define GL_ALPHA 0x1906
-#define GL_LUMINANCE 0x1909
-#define GL_LUMINANCE_ALPHA 0x190A
-#define GL_ALPHA_BITS 0x0D55
-#define GL_RED_BITS 0x0D52
-#define GL_GREEN_BITS 0x0D53
-#define GL_BLUE_BITS 0x0D54
-#define GL_INDEX_BITS 0x0D51
-#define GL_SUBPIXEL_BITS 0x0D50
-#define GL_AUX_BUFFERS 0x0C00
-#define GL_READ_BUFFER 0x0C02
-#define GL_DRAW_BUFFER 0x0C01
-#define GL_DOUBLEBUFFER 0x0C32
-#define GL_STEREO 0x0C33
-#define GL_BITMAP 0x1A00
-#define GL_COLOR 0x1800
-#define GL_DEPTH 0x1801
-#define GL_STENCIL 0x1802
-#define GL_DITHER 0x0BD0
-#define GL_RGB 0x1907
-#define GL_RGBA 0x1908
-
-/* Implementation limits */
-#define GL_MAX_LIST_NESTING 0x0B31
-#define GL_MAX_EVAL_ORDER 0x0D30
-#define GL_MAX_LIGHTS 0x0D31
-#define GL_MAX_CLIP_PLANES 0x0D32
-#define GL_MAX_TEXTURE_SIZE 0x0D33
-#define GL_MAX_PIXEL_MAP_TABLE 0x0D34
-#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35
-#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36
-#define GL_MAX_NAME_STACK_DEPTH 0x0D37
-#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38
-#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39
-#define GL_MAX_VIEWPORT_DIMS 0x0D3A
-#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B
-
-/* Gets */
-#define GL_ATTRIB_STACK_DEPTH 0x0BB0
-#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1
-#define GL_COLOR_CLEAR_VALUE 0x0C22
-#define GL_COLOR_WRITEMASK 0x0C23
-#define GL_CURRENT_INDEX 0x0B01
-#define GL_CURRENT_COLOR 0x0B00
-#define GL_CURRENT_NORMAL 0x0B02
-#define GL_CURRENT_RASTER_COLOR 0x0B04
-#define GL_CURRENT_RASTER_DISTANCE 0x0B09
-#define GL_CURRENT_RASTER_INDEX 0x0B05
-#define GL_CURRENT_RASTER_POSITION 0x0B07
-#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06
-#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08
-#define GL_CURRENT_TEXTURE_COORDS 0x0B03
-#define GL_INDEX_CLEAR_VALUE 0x0C20
-#define GL_INDEX_MODE 0x0C30
-#define GL_INDEX_WRITEMASK 0x0C21
-#define GL_MODELVIEW_MATRIX 0x0BA6
-#define GL_MODELVIEW_STACK_DEPTH 0x0BA3
-#define GL_NAME_STACK_DEPTH 0x0D70
-#define GL_PROJECTION_MATRIX 0x0BA7
-#define GL_PROJECTION_STACK_DEPTH 0x0BA4
-#define GL_RENDER_MODE 0x0C40
-#define GL_RGBA_MODE 0x0C31
-#define GL_TEXTURE_MATRIX 0x0BA8
-#define GL_TEXTURE_STACK_DEPTH 0x0BA5
-#define GL_VIEWPORT 0x0BA2
-
-/* Evaluators */
-#define GL_AUTO_NORMAL 0x0D80
-#define GL_MAP1_COLOR_4 0x0D90
-#define GL_MAP1_INDEX 0x0D91
-#define GL_MAP1_NORMAL 0x0D92
-#define GL_MAP1_TEXTURE_COORD_1 0x0D93
-#define GL_MAP1_TEXTURE_COORD_2 0x0D94
-#define GL_MAP1_TEXTURE_COORD_3 0x0D95
-#define GL_MAP1_TEXTURE_COORD_4 0x0D96
-#define GL_MAP1_VERTEX_3 0x0D97
-#define GL_MAP1_VERTEX_4 0x0D98
-#define GL_MAP2_COLOR_4 0x0DB0
-#define GL_MAP2_INDEX 0x0DB1
-#define GL_MAP2_NORMAL 0x0DB2
-#define GL_MAP2_TEXTURE_COORD_1 0x0DB3
-#define GL_MAP2_TEXTURE_COORD_2 0x0DB4
-#define GL_MAP2_TEXTURE_COORD_3 0x0DB5
-#define GL_MAP2_TEXTURE_COORD_4 0x0DB6
-#define GL_MAP2_VERTEX_3 0x0DB7
-#define GL_MAP2_VERTEX_4 0x0DB8
-#define GL_MAP1_GRID_DOMAIN 0x0DD0
-#define GL_MAP1_GRID_SEGMENTS 0x0DD1
-#define GL_MAP2_GRID_DOMAIN 0x0DD2
-#define GL_MAP2_GRID_SEGMENTS 0x0DD3
-#define GL_COEFF 0x0A00
-#define GL_ORDER 0x0A01
-#define GL_DOMAIN 0x0A02
-
-/* Hints */
-#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50
-#define GL_POINT_SMOOTH_HINT 0x0C51
-#define GL_LINE_SMOOTH_HINT 0x0C52
-#define GL_POLYGON_SMOOTH_HINT 0x0C53
-#define GL_FOG_HINT 0x0C54
-#define GL_DONT_CARE 0x1100
-#define GL_FASTEST 0x1101
-#define GL_NICEST 0x1102
-
-/* Scissor box */
-#define GL_SCISSOR_BOX 0x0C10
-#define GL_SCISSOR_TEST 0x0C11
-
-/* Pixel Mode / Transfer */
-#define GL_MAP_COLOR 0x0D10
-#define GL_MAP_STENCIL 0x0D11
-#define GL_INDEX_SHIFT 0x0D12
-#define GL_INDEX_OFFSET 0x0D13
-#define GL_RED_SCALE 0x0D14
-#define GL_RED_BIAS 0x0D15
-#define GL_GREEN_SCALE 0x0D18
-#define GL_GREEN_BIAS 0x0D19
-#define GL_BLUE_SCALE 0x0D1A
-#define GL_BLUE_BIAS 0x0D1B
-#define GL_ALPHA_SCALE 0x0D1C
-#define GL_ALPHA_BIAS 0x0D1D
-#define GL_DEPTH_SCALE 0x0D1E
-#define GL_DEPTH_BIAS 0x0D1F
-#define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1
-#define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0
-#define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2
-#define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3
-#define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4
-#define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5
-#define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6
-#define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7
-#define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8
-#define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9
-#define GL_PIXEL_MAP_S_TO_S 0x0C71
-#define GL_PIXEL_MAP_I_TO_I 0x0C70
-#define GL_PIXEL_MAP_I_TO_R 0x0C72
-#define GL_PIXEL_MAP_I_TO_G 0x0C73
-#define GL_PIXEL_MAP_I_TO_B 0x0C74
-#define GL_PIXEL_MAP_I_TO_A 0x0C75
-#define GL_PIXEL_MAP_R_TO_R 0x0C76
-#define GL_PIXEL_MAP_G_TO_G 0x0C77
-#define GL_PIXEL_MAP_B_TO_B 0x0C78
-#define GL_PIXEL_MAP_A_TO_A 0x0C79
-#define GL_PACK_ALIGNMENT 0x0D05
-#define GL_PACK_LSB_FIRST 0x0D01
-#define GL_PACK_ROW_LENGTH 0x0D02
-#define GL_PACK_SKIP_PIXELS 0x0D04
-#define GL_PACK_SKIP_ROWS 0x0D03
-#define GL_PACK_SWAP_BYTES 0x0D00
-#define GL_UNPACK_ALIGNMENT 0x0CF5
-#define GL_UNPACK_LSB_FIRST 0x0CF1
-#define GL_UNPACK_ROW_LENGTH 0x0CF2
-#define GL_UNPACK_SKIP_PIXELS 0x0CF4
-#define GL_UNPACK_SKIP_ROWS 0x0CF3
-#define GL_UNPACK_SWAP_BYTES 0x0CF0
-#define GL_ZOOM_X 0x0D16
-#define GL_ZOOM_Y 0x0D17
-
-/* Texture mapping */
-#define GL_TEXTURE_ENV 0x2300
-#define GL_TEXTURE_ENV_MODE 0x2200
-#define GL_TEXTURE_1D 0x0DE0
-#define GL_TEXTURE_2D 0x0DE1
-#define GL_TEXTURE_WRAP_S 0x2802
-#define GL_TEXTURE_WRAP_T 0x2803
-#define GL_TEXTURE_MAG_FILTER 0x2800
-#define GL_TEXTURE_MIN_FILTER 0x2801
-#define GL_TEXTURE_ENV_COLOR 0x2201
-#define GL_TEXTURE_GEN_S 0x0C60
-#define GL_TEXTURE_GEN_T 0x0C61
-#define GL_TEXTURE_GEN_MODE 0x2500
-#define GL_TEXTURE_BORDER_COLOR 0x1004
-#define GL_TEXTURE_WIDTH 0x1000
-#define GL_TEXTURE_HEIGHT 0x1001
-#define GL_TEXTURE_BORDER 0x1005
-#define GL_TEXTURE_COMPONENTS 0x1003
-#define GL_TEXTURE_RED_SIZE 0x805C
-#define GL_TEXTURE_GREEN_SIZE 0x805D
-#define GL_TEXTURE_BLUE_SIZE 0x805E
-#define GL_TEXTURE_ALPHA_SIZE 0x805F
-#define GL_TEXTURE_LUMINANCE_SIZE 0x8060
-#define GL_TEXTURE_INTENSITY_SIZE 0x8061
-#define GL_NEAREST_MIPMAP_NEAREST 0x2700
-#define GL_NEAREST_MIPMAP_LINEAR 0x2702
-#define GL_LINEAR_MIPMAP_NEAREST 0x2701
-#define GL_LINEAR_MIPMAP_LINEAR 0x2703
-#define GL_OBJECT_LINEAR 0x2401
-#define GL_OBJECT_PLANE 0x2501
-#define GL_EYE_LINEAR 0x2400
-#define GL_EYE_PLANE 0x2502
-#define GL_SPHERE_MAP 0x2402
-#define GL_DECAL 0x2101
-#define GL_MODULATE 0x2100
-#define GL_NEAREST 0x2600
-#define GL_REPEAT 0x2901
-#define GL_CLAMP 0x2900
-#define GL_S 0x2000
-#define GL_T 0x2001
-#define GL_R 0x2002
-#define GL_Q 0x2003
-#define GL_TEXTURE_GEN_R 0x0C62
-#define GL_TEXTURE_GEN_Q 0x0C63
-
-/* Utility */
-#define GL_VENDOR 0x1F00
-#define GL_RENDERER 0x1F01
-#define GL_VERSION 0x1F02
-#define GL_EXTENSIONS 0x1F03
-
-/* Errors */
-#define GL_NO_ERROR 0x0
-#define GL_INVALID_ENUM 0x0500
-#define GL_INVALID_VALUE 0x0501
-#define GL_INVALID_OPERATION 0x0502
-#define GL_STACK_OVERFLOW 0x0503
-#define GL_STACK_UNDERFLOW 0x0504
-#define GL_OUT_OF_MEMORY 0x0505
-
-/* glPush/PopAttrib bits */
-#define GL_CURRENT_BIT 0x00000001
-#define GL_POINT_BIT 0x00000002
-#define GL_LINE_BIT 0x00000004
-#define GL_POLYGON_BIT 0x00000008
-#define GL_POLYGON_STIPPLE_BIT 0x00000010
-#define GL_PIXEL_MODE_BIT 0x00000020
-#define GL_LIGHTING_BIT 0x00000040
-#define GL_FOG_BIT 0x00000080
-#define GL_DEPTH_BUFFER_BIT 0x00000100
-#define GL_ACCUM_BUFFER_BIT 0x00000200
-#define GL_STENCIL_BUFFER_BIT 0x00000400
-#define GL_VIEWPORT_BIT 0x00000800
-#define GL_TRANSFORM_BIT 0x00001000
-#define GL_ENABLE_BIT 0x00002000
-#define GL_COLOR_BUFFER_BIT 0x00004000
-#define GL_HINT_BIT 0x00008000
-#define GL_EVAL_BIT 0x00010000
-#define GL_LIST_BIT 0x00020000
-#define GL_TEXTURE_BIT 0x00040000
-#define GL_SCISSOR_BIT 0x00080000
-#define GL_ALL_ATTRIB_BITS 0x000FFFFF
-
-
-/* OpenGL 1.1 */
-#define GL_PROXY_TEXTURE_1D 0x8063
-#define GL_PROXY_TEXTURE_2D 0x8064
-#define GL_TEXTURE_PRIORITY 0x8066
-#define GL_TEXTURE_RESIDENT 0x8067
-#define GL_TEXTURE_BINDING_1D 0x8068
-#define GL_TEXTURE_BINDING_2D 0x8069
-#define GL_TEXTURE_INTERNAL_FORMAT 0x1003
-#define GL_ALPHA4 0x803B
-#define GL_ALPHA8 0x803C
-#define GL_ALPHA12 0x803D
-#define GL_ALPHA16 0x803E
-#define GL_LUMINANCE4 0x803F
-#define GL_LUMINANCE8 0x8040
-#define GL_LUMINANCE12 0x8041
-#define GL_LUMINANCE16 0x8042
-#define GL_LUMINANCE4_ALPHA4 0x8043
-#define GL_LUMINANCE6_ALPHA2 0x8044
-#define GL_LUMINANCE8_ALPHA8 0x8045
-#define GL_LUMINANCE12_ALPHA4 0x8046
-#define GL_LUMINANCE12_ALPHA12 0x8047
-#define GL_LUMINANCE16_ALPHA16 0x8048
-#define GL_INTENSITY 0x8049
-#define GL_INTENSITY4 0x804A
-#define GL_INTENSITY8 0x804B
-#define GL_INTENSITY12 0x804C
-#define GL_INTENSITY16 0x804D
-#define GL_R3_G3_B2 0x2A10
-#define GL_RGB4 0x804F
-#define GL_RGB5 0x8050
-#define GL_RGB8 0x8051
-#define GL_RGB10 0x8052
-#define GL_RGB12 0x8053
-#define GL_RGB16 0x8054
-#define GL_RGBA2 0x8055
-#define GL_RGBA4 0x8056
-#define GL_RGB5_A1 0x8057
-#define GL_RGBA8 0x8058
-#define GL_RGB10_A2 0x8059
-#define GL_RGBA12 0x805A
-#define GL_RGBA16 0x805B
-#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001
-#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002
-#define GL_ALL_CLIENT_ATTRIB_BITS 0xFFFFFFFF
-#define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF
-
-
-
-/*
- * Miscellaneous
- */
-
-GLAPI void GLAPIENTRY glClearIndex( GLfloat c );
-
-GLAPI void GLAPIENTRY glClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha );
-
-GLAPI void GLAPIENTRY glClear( GLbitfield mask );
-
-GLAPI void GLAPIENTRY glIndexMask( GLuint mask );
-
-GLAPI void GLAPIENTRY glColorMask( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha );
-
-GLAPI void GLAPIENTRY glAlphaFunc( GLenum func, GLclampf ref );
-
-GLAPI void GLAPIENTRY glBlendFunc( GLenum sfactor, GLenum dfactor );
-
-GLAPI void GLAPIENTRY glLogicOp( GLenum opcode );
-
-GLAPI void GLAPIENTRY glCullFace( GLenum mode );
-
-GLAPI void GLAPIENTRY glFrontFace( GLenum mode );
-
-GLAPI void GLAPIENTRY glPointSize( GLfloat size );
-
-GLAPI void GLAPIENTRY glLineWidth( GLfloat width );
-
-GLAPI void GLAPIENTRY glLineStipple( GLint factor, GLushort pattern );
-
-GLAPI void GLAPIENTRY glPolygonMode( GLenum face, GLenum mode );
-
-GLAPI void GLAPIENTRY glPolygonOffset( GLfloat factor, GLfloat units );
-
-GLAPI void GLAPIENTRY glPolygonStipple( const GLubyte *mask );
-
-GLAPI void GLAPIENTRY glGetPolygonStipple( GLubyte *mask );
-
-GLAPI void GLAPIENTRY glEdgeFlag( GLboolean flag );
-
-GLAPI void GLAPIENTRY glEdgeFlagv( const GLboolean *flag );
-
-GLAPI void GLAPIENTRY glScissor( GLint x, GLint y, GLsizei width, GLsizei height);
-
-GLAPI void GLAPIENTRY glClipPlane( GLenum plane, const GLdouble *equation );
-
-GLAPI void GLAPIENTRY glGetClipPlane( GLenum plane, GLdouble *equation );
-
-GLAPI void GLAPIENTRY glDrawBuffer( GLenum mode );
-
-GLAPI void GLAPIENTRY glReadBuffer( GLenum mode );
-
-GLAPI void GLAPIENTRY glEnable( GLenum cap );
-
-GLAPI void GLAPIENTRY glDisable( GLenum cap );
-
-GLAPI GLboolean GLAPIENTRY glIsEnabled( GLenum cap );
-
-
-GLAPI void GLAPIENTRY glEnableClientState( GLenum cap ); /* 1.1 */
-
-GLAPI void GLAPIENTRY glDisableClientState( GLenum cap ); /* 1.1 */
-
-
-GLAPI void GLAPIENTRY glGetBooleanv( GLenum pname, GLboolean *params );
-
-GLAPI void GLAPIENTRY glGetDoublev( GLenum pname, GLdouble *params );
-
-GLAPI void GLAPIENTRY glGetFloatv( GLenum pname, GLfloat *params );
-
-GLAPI void GLAPIENTRY glGetIntegerv( GLenum pname, GLint *params );
-
-
-GLAPI void GLAPIENTRY glPushAttrib( GLbitfield mask );
-
-GLAPI void GLAPIENTRY glPopAttrib( void );
-
-
-GLAPI void GLAPIENTRY glPushClientAttrib( GLbitfield mask ); /* 1.1 */
-
-GLAPI void GLAPIENTRY glPopClientAttrib( void ); /* 1.1 */
-
-
-GLAPI GLint GLAPIENTRY glRenderMode( GLenum mode );
-
-GLAPI GLenum GLAPIENTRY glGetError( void );
-
-GLAPI const GLubyte * GLAPIENTRY glGetString( GLenum name );
-
-GLAPI void GLAPIENTRY glFinish( void );
-
-GLAPI void GLAPIENTRY glFlush( void );
-
-GLAPI void GLAPIENTRY glHint( GLenum target, GLenum mode );
-
-
-/*
- * Depth Buffer
- */
-
-GLAPI void GLAPIENTRY glClearDepth( GLclampd depth );
-
-GLAPI void GLAPIENTRY glDepthFunc( GLenum func );
-
-GLAPI void GLAPIENTRY glDepthMask( GLboolean flag );
-
-GLAPI void GLAPIENTRY glDepthRange( GLclampd near_val, GLclampd far_val );
-
-
-/*
- * Accumulation Buffer
- */
-
-GLAPI void GLAPIENTRY glClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha );
-
-GLAPI void GLAPIENTRY glAccum( GLenum op, GLfloat value );
-
-
-/*
- * Transformation
- */
-
-GLAPI void GLAPIENTRY glMatrixMode( GLenum mode );
-
-GLAPI void GLAPIENTRY glOrtho( GLdouble left, GLdouble right,
- GLdouble bottom, GLdouble top,
- GLdouble near_val, GLdouble far_val );
-
-GLAPI void GLAPIENTRY glFrustum( GLdouble left, GLdouble right,
- GLdouble bottom, GLdouble top,
- GLdouble near_val, GLdouble far_val );
-
-GLAPI void GLAPIENTRY glViewport( GLint x, GLint y,
- GLsizei width, GLsizei height );
-
-GLAPI void GLAPIENTRY glPushMatrix( void );
-
-GLAPI void GLAPIENTRY glPopMatrix( void );
-
-GLAPI void GLAPIENTRY glLoadIdentity( void );
-
-GLAPI void GLAPIENTRY glLoadMatrixd( const GLdouble *m );
-GLAPI void GLAPIENTRY glLoadMatrixf( const GLfloat *m );
-
-GLAPI void GLAPIENTRY glMultMatrixd( const GLdouble *m );
-GLAPI void GLAPIENTRY glMultMatrixf( const GLfloat *m );
-
-GLAPI void GLAPIENTRY glRotated( GLdouble angle,
- GLdouble x, GLdouble y, GLdouble z );
-GLAPI void GLAPIENTRY glRotatef( GLfloat angle,
- GLfloat x, GLfloat y, GLfloat z );
-
-GLAPI void GLAPIENTRY glScaled( GLdouble x, GLdouble y, GLdouble z );
-GLAPI void GLAPIENTRY glScalef( GLfloat x, GLfloat y, GLfloat z );
-
-GLAPI void GLAPIENTRY glTranslated( GLdouble x, GLdouble y, GLdouble z );
-GLAPI void GLAPIENTRY glTranslatef( GLfloat x, GLfloat y, GLfloat z );
-
-
-/*
- * Display Lists
- */
-
-GLAPI GLboolean GLAPIENTRY glIsList( GLuint list );
-
-GLAPI void GLAPIENTRY glDeleteLists( GLuint list, GLsizei range );
-
-GLAPI GLuint GLAPIENTRY glGenLists( GLsizei range );
-
-GLAPI void GLAPIENTRY glNewList( GLuint list, GLenum mode );
-
-GLAPI void GLAPIENTRY glEndList( void );
-
-GLAPI void GLAPIENTRY glCallList( GLuint list );
-
-GLAPI void GLAPIENTRY glCallLists( GLsizei n, GLenum type,
- const GLvoid *lists );
-
-GLAPI void GLAPIENTRY glListBase( GLuint base );
-
-
-/*
- * Drawing Functions
- */
-
-GLAPI void GLAPIENTRY glBegin( GLenum mode );
-
-GLAPI void GLAPIENTRY glEnd( void );
-
-
-GLAPI void GLAPIENTRY glVertex2d( GLdouble x, GLdouble y );
-GLAPI void GLAPIENTRY glVertex2f( GLfloat x, GLfloat y );
-GLAPI void GLAPIENTRY glVertex2i( GLint x, GLint y );
-GLAPI void GLAPIENTRY glVertex2s( GLshort x, GLshort y );
-
-GLAPI void GLAPIENTRY glVertex3d( GLdouble x, GLdouble y, GLdouble z );
-GLAPI void GLAPIENTRY glVertex3f( GLfloat x, GLfloat y, GLfloat z );
-GLAPI void GLAPIENTRY glVertex3i( GLint x, GLint y, GLint z );
-GLAPI void GLAPIENTRY glVertex3s( GLshort x, GLshort y, GLshort z );
-
-GLAPI void GLAPIENTRY glVertex4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w );
-GLAPI void GLAPIENTRY glVertex4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w );
-GLAPI void GLAPIENTRY glVertex4i( GLint x, GLint y, GLint z, GLint w );
-GLAPI void GLAPIENTRY glVertex4s( GLshort x, GLshort y, GLshort z, GLshort w );
-
-GLAPI void GLAPIENTRY glVertex2dv( const GLdouble *v );
-GLAPI void GLAPIENTRY glVertex2fv( const GLfloat *v );
-GLAPI void GLAPIENTRY glVertex2iv( const GLint *v );
-GLAPI void GLAPIENTRY glVertex2sv( const GLshort *v );
-
-GLAPI void GLAPIENTRY glVertex3dv( const GLdouble *v );
-GLAPI void GLAPIENTRY glVertex3fv( const GLfloat *v );
-GLAPI void GLAPIENTRY glVertex3iv( const GLint *v );
-GLAPI void GLAPIENTRY glVertex3sv( const GLshort *v );
-
-GLAPI void GLAPIENTRY glVertex4dv( const GLdouble *v );
-GLAPI void GLAPIENTRY glVertex4fv( const GLfloat *v );
-GLAPI void GLAPIENTRY glVertex4iv( const GLint *v );
-GLAPI void GLAPIENTRY glVertex4sv( const GLshort *v );
-
-
-GLAPI void GLAPIENTRY glNormal3b( GLbyte nx, GLbyte ny, GLbyte nz );
-GLAPI void GLAPIENTRY glNormal3d( GLdouble nx, GLdouble ny, GLdouble nz );
-GLAPI void GLAPIENTRY glNormal3f( GLfloat nx, GLfloat ny, GLfloat nz );
-GLAPI void GLAPIENTRY glNormal3i( GLint nx, GLint ny, GLint nz );
-GLAPI void GLAPIENTRY glNormal3s( GLshort nx, GLshort ny, GLshort nz );
-
-GLAPI void GLAPIENTRY glNormal3bv( const GLbyte *v );
-GLAPI void GLAPIENTRY glNormal3dv( const GLdouble *v );
-GLAPI void GLAPIENTRY glNormal3fv( const GLfloat *v );
-GLAPI void GLAPIENTRY glNormal3iv( const GLint *v );
-GLAPI void GLAPIENTRY glNormal3sv( const GLshort *v );
-
-
-GLAPI void GLAPIENTRY glIndexd( GLdouble c );
-GLAPI void GLAPIENTRY glIndexf( GLfloat c );
-GLAPI void GLAPIENTRY glIndexi( GLint c );
-GLAPI void GLAPIENTRY glIndexs( GLshort c );
-GLAPI void GLAPIENTRY glIndexub( GLubyte c ); /* 1.1 */
-
-GLAPI void GLAPIENTRY glIndexdv( const GLdouble *c );
-GLAPI void GLAPIENTRY glIndexfv( const GLfloat *c );
-GLAPI void GLAPIENTRY glIndexiv( const GLint *c );
-GLAPI void GLAPIENTRY glIndexsv( const GLshort *c );
-GLAPI void GLAPIENTRY glIndexubv( const GLubyte *c ); /* 1.1 */
-
-GLAPI void GLAPIENTRY glColor3b( GLbyte red, GLbyte green, GLbyte blue );
-GLAPI void GLAPIENTRY glColor3d( GLdouble red, GLdouble green, GLdouble blue );
-GLAPI void GLAPIENTRY glColor3f( GLfloat red, GLfloat green, GLfloat blue );
-GLAPI void GLAPIENTRY glColor3i( GLint red, GLint green, GLint blue );
-GLAPI void GLAPIENTRY glColor3s( GLshort red, GLshort green, GLshort blue );
-GLAPI void GLAPIENTRY glColor3ub( GLubyte red, GLubyte green, GLubyte blue );
-GLAPI void GLAPIENTRY glColor3ui( GLuint red, GLuint green, GLuint blue );
-GLAPI void GLAPIENTRY glColor3us( GLushort red, GLushort green, GLushort blue );
-
-GLAPI void GLAPIENTRY glColor4b( GLbyte red, GLbyte green,
- GLbyte blue, GLbyte alpha );
-GLAPI void GLAPIENTRY glColor4d( GLdouble red, GLdouble green,
- GLdouble blue, GLdouble alpha );
-GLAPI void GLAPIENTRY glColor4f( GLfloat red, GLfloat green,
- GLfloat blue, GLfloat alpha );
-GLAPI void GLAPIENTRY glColor4i( GLint red, GLint green,
- GLint blue, GLint alpha );
-GLAPI void GLAPIENTRY glColor4s( GLshort red, GLshort green,
- GLshort blue, GLshort alpha );
-GLAPI void GLAPIENTRY glColor4ub( GLubyte red, GLubyte green,
- GLubyte blue, GLubyte alpha );
-GLAPI void GLAPIENTRY glColor4ui( GLuint red, GLuint green,
- GLuint blue, GLuint alpha );
-GLAPI void GLAPIENTRY glColor4us( GLushort red, GLushort green,
- GLushort blue, GLushort alpha );
-
-
-GLAPI void GLAPIENTRY glColor3bv( const GLbyte *v );
-GLAPI void GLAPIENTRY glColor3dv( const GLdouble *v );
-GLAPI void GLAPIENTRY glColor3fv( const GLfloat *v );
-GLAPI void GLAPIENTRY glColor3iv( const GLint *v );
-GLAPI void GLAPIENTRY glColor3sv( const GLshort *v );
-GLAPI void GLAPIENTRY glColor3ubv( const GLubyte *v );
-GLAPI void GLAPIENTRY glColor3uiv( const GLuint *v );
-GLAPI void GLAPIENTRY glColor3usv( const GLushort *v );
-
-GLAPI void GLAPIENTRY glColor4bv( const GLbyte *v );
-GLAPI void GLAPIENTRY glColor4dv( const GLdouble *v );
-GLAPI void GLAPIENTRY glColor4fv( const GLfloat *v );
-GLAPI void GLAPIENTRY glColor4iv( const GLint *v );
-GLAPI void GLAPIENTRY glColor4sv( const GLshort *v );
-GLAPI void GLAPIENTRY glColor4ubv( const GLubyte *v );
-GLAPI void GLAPIENTRY glColor4uiv( const GLuint *v );
-GLAPI void GLAPIENTRY glColor4usv( const GLushort *v );
-
-
-GLAPI void GLAPIENTRY glTexCoord1d( GLdouble s );
-GLAPI void GLAPIENTRY glTexCoord1f( GLfloat s );
-GLAPI void GLAPIENTRY glTexCoord1i( GLint s );
-GLAPI void GLAPIENTRY glTexCoord1s( GLshort s );
-
-GLAPI void GLAPIENTRY glTexCoord2d( GLdouble s, GLdouble t );
-GLAPI void GLAPIENTRY glTexCoord2f( GLfloat s, GLfloat t );
-GLAPI void GLAPIENTRY glTexCoord2i( GLint s, GLint t );
-GLAPI void GLAPIENTRY glTexCoord2s( GLshort s, GLshort t );
-
-GLAPI void GLAPIENTRY glTexCoord3d( GLdouble s, GLdouble t, GLdouble r );
-GLAPI void GLAPIENTRY glTexCoord3f( GLfloat s, GLfloat t, GLfloat r );
-GLAPI void GLAPIENTRY glTexCoord3i( GLint s, GLint t, GLint r );
-GLAPI void GLAPIENTRY glTexCoord3s( GLshort s, GLshort t, GLshort r );
-
-GLAPI void GLAPIENTRY glTexCoord4d( GLdouble s, GLdouble t, GLdouble r, GLdouble q );
-GLAPI void GLAPIENTRY glTexCoord4f( GLfloat s, GLfloat t, GLfloat r, GLfloat q );
-GLAPI void GLAPIENTRY glTexCoord4i( GLint s, GLint t, GLint r, GLint q );
-GLAPI void GLAPIENTRY glTexCoord4s( GLshort s, GLshort t, GLshort r, GLshort q );
-
-GLAPI void GLAPIENTRY glTexCoord1dv( const GLdouble *v );
-GLAPI void GLAPIENTRY glTexCoord1fv( const GLfloat *v );
-GLAPI void GLAPIENTRY glTexCoord1iv( const GLint *v );
-GLAPI void GLAPIENTRY glTexCoord1sv( const GLshort *v );
-
-GLAPI void GLAPIENTRY glTexCoord2dv( const GLdouble *v );
-GLAPI void GLAPIENTRY glTexCoord2fv( const GLfloat *v );
-GLAPI void GLAPIENTRY glTexCoord2iv( const GLint *v );
-GLAPI void GLAPIENTRY glTexCoord2sv( const GLshort *v );
-
-GLAPI void GLAPIENTRY glTexCoord3dv( const GLdouble *v );
-GLAPI void GLAPIENTRY glTexCoord3fv( const GLfloat *v );
-GLAPI void GLAPIENTRY glTexCoord3iv( const GLint *v );
-GLAPI void GLAPIENTRY glTexCoord3sv( const GLshort *v );
-
-GLAPI void GLAPIENTRY glTexCoord4dv( const GLdouble *v );
-GLAPI void GLAPIENTRY glTexCoord4fv( const GLfloat *v );
-GLAPI void GLAPIENTRY glTexCoord4iv( const GLint *v );
-GLAPI void GLAPIENTRY glTexCoord4sv( const GLshort *v );
-
-
-GLAPI void GLAPIENTRY glRasterPos2d( GLdouble x, GLdouble y );
-GLAPI void GLAPIENTRY glRasterPos2f( GLfloat x, GLfloat y );
-GLAPI void GLAPIENTRY glRasterPos2i( GLint x, GLint y );
-GLAPI void GLAPIENTRY glRasterPos2s( GLshort x, GLshort y );
-
-GLAPI void GLAPIENTRY glRasterPos3d( GLdouble x, GLdouble y, GLdouble z );
-GLAPI void GLAPIENTRY glRasterPos3f( GLfloat x, GLfloat y, GLfloat z );
-GLAPI void GLAPIENTRY glRasterPos3i( GLint x, GLint y, GLint z );
-GLAPI void GLAPIENTRY glRasterPos3s( GLshort x, GLshort y, GLshort z );
-
-GLAPI void GLAPIENTRY glRasterPos4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w );
-GLAPI void GLAPIENTRY glRasterPos4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w );
-GLAPI void GLAPIENTRY glRasterPos4i( GLint x, GLint y, GLint z, GLint w );
-GLAPI void GLAPIENTRY glRasterPos4s( GLshort x, GLshort y, GLshort z, GLshort w );
-
-GLAPI void GLAPIENTRY glRasterPos2dv( const GLdouble *v );
-GLAPI void GLAPIENTRY glRasterPos2fv( const GLfloat *v );
-GLAPI void GLAPIENTRY glRasterPos2iv( const GLint *v );
-GLAPI void GLAPIENTRY glRasterPos2sv( const GLshort *v );
-
-GLAPI void GLAPIENTRY glRasterPos3dv( const GLdouble *v );
-GLAPI void GLAPIENTRY glRasterPos3fv( const GLfloat *v );
-GLAPI void GLAPIENTRY glRasterPos3iv( const GLint *v );
-GLAPI void GLAPIENTRY glRasterPos3sv( const GLshort *v );
-
-GLAPI void GLAPIENTRY glRasterPos4dv( const GLdouble *v );
-GLAPI void GLAPIENTRY glRasterPos4fv( const GLfloat *v );
-GLAPI void GLAPIENTRY glRasterPos4iv( const GLint *v );
-GLAPI void GLAPIENTRY glRasterPos4sv( const GLshort *v );
-
-
-GLAPI void GLAPIENTRY glRectd( GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2 );
-GLAPI void GLAPIENTRY glRectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 );
-GLAPI void GLAPIENTRY glRecti( GLint x1, GLint y1, GLint x2, GLint y2 );
-GLAPI void GLAPIENTRY glRects( GLshort x1, GLshort y1, GLshort x2, GLshort y2 );
-
-
-GLAPI void GLAPIENTRY glRectdv( const GLdouble *v1, const GLdouble *v2 );
-GLAPI void GLAPIENTRY glRectfv( const GLfloat *v1, const GLfloat *v2 );
-GLAPI void GLAPIENTRY glRectiv( const GLint *v1, const GLint *v2 );
-GLAPI void GLAPIENTRY glRectsv( const GLshort *v1, const GLshort *v2 );
-
-
-/*
- * Vertex Arrays (1.1)
- */
-
-GLAPI void GLAPIENTRY glVertexPointer( GLint size, GLenum type,
- GLsizei stride, const GLvoid *ptr );
-
-GLAPI void GLAPIENTRY glNormalPointer( GLenum type, GLsizei stride,
- const GLvoid *ptr );
-
-GLAPI void GLAPIENTRY glColorPointer( GLint size, GLenum type,
- GLsizei stride, const GLvoid *ptr );
-
-GLAPI void GLAPIENTRY glIndexPointer( GLenum type, GLsizei stride,
- const GLvoid *ptr );
-
-GLAPI void GLAPIENTRY glTexCoordPointer( GLint size, GLenum type,
- GLsizei stride, const GLvoid *ptr );
-
-GLAPI void GLAPIENTRY glEdgeFlagPointer( GLsizei stride, const GLvoid *ptr );
-
-GLAPI void GLAPIENTRY glGetPointerv( GLenum pname, GLvoid **params );
-
-GLAPI void GLAPIENTRY glArrayElement( GLint i );
-
-GLAPI void GLAPIENTRY glDrawArrays( GLenum mode, GLint first, GLsizei count );
-
-GLAPI void GLAPIENTRY glDrawElements( GLenum mode, GLsizei count,
- GLenum type, const GLvoid *indices );
-
-GLAPI void GLAPIENTRY glInterleavedArrays( GLenum format, GLsizei stride,
- const GLvoid *pointer );
-
-/*
- * Lighting
- */
-
-GLAPI void GLAPIENTRY glShadeModel( GLenum mode );
-
-GLAPI void GLAPIENTRY glLightf( GLenum light, GLenum pname, GLfloat param );
-GLAPI void GLAPIENTRY glLighti( GLenum light, GLenum pname, GLint param );
-GLAPI void GLAPIENTRY glLightfv( GLenum light, GLenum pname,
- const GLfloat *params );
-GLAPI void GLAPIENTRY glLightiv( GLenum light, GLenum pname,
- const GLint *params );
-
-GLAPI void GLAPIENTRY glGetLightfv( GLenum light, GLenum pname,
- GLfloat *params );
-GLAPI void GLAPIENTRY glGetLightiv( GLenum light, GLenum pname,
- GLint *params );
-
-GLAPI void GLAPIENTRY glLightModelf( GLenum pname, GLfloat param );
-GLAPI void GLAPIENTRY glLightModeli( GLenum pname, GLint param );
-GLAPI void GLAPIENTRY glLightModelfv( GLenum pname, const GLfloat *params );
-GLAPI void GLAPIENTRY glLightModeliv( GLenum pname, const GLint *params );
-
-GLAPI void GLAPIENTRY glMaterialf( GLenum face, GLenum pname, GLfloat param );
-GLAPI void GLAPIENTRY glMateriali( GLenum face, GLenum pname, GLint param );
-GLAPI void GLAPIENTRY glMaterialfv( GLenum face, GLenum pname, const GLfloat *params );
-GLAPI void GLAPIENTRY glMaterialiv( GLenum face, GLenum pname, const GLint *params );
-
-GLAPI void GLAPIENTRY glGetMaterialfv( GLenum face, GLenum pname, GLfloat *params );
-GLAPI void GLAPIENTRY glGetMaterialiv( GLenum face, GLenum pname, GLint *params );
-
-GLAPI void GLAPIENTRY glColorMaterial( GLenum face, GLenum mode );
-
-
-/*
- * Raster functions
- */
-
-GLAPI void GLAPIENTRY glPixelZoom( GLfloat xfactor, GLfloat yfactor );
-
-GLAPI void GLAPIENTRY glPixelStoref( GLenum pname, GLfloat param );
-GLAPI void GLAPIENTRY glPixelStorei( GLenum pname, GLint param );
-
-GLAPI void GLAPIENTRY glPixelTransferf( GLenum pname, GLfloat param );
-GLAPI void GLAPIENTRY glPixelTransferi( GLenum pname, GLint param );
-
-GLAPI void GLAPIENTRY glPixelMapfv( GLenum map, GLsizei mapsize,
- const GLfloat *values );
-GLAPI void GLAPIENTRY glPixelMapuiv( GLenum map, GLsizei mapsize,
- const GLuint *values );
-GLAPI void GLAPIENTRY glPixelMapusv( GLenum map, GLsizei mapsize,
- const GLushort *values );
-
-GLAPI void GLAPIENTRY glGetPixelMapfv( GLenum map, GLfloat *values );
-GLAPI void GLAPIENTRY glGetPixelMapuiv( GLenum map, GLuint *values );
-GLAPI void GLAPIENTRY glGetPixelMapusv( GLenum map, GLushort *values );
-
-GLAPI void GLAPIENTRY glBitmap( GLsizei width, GLsizei height,
- GLfloat xorig, GLfloat yorig,
- GLfloat xmove, GLfloat ymove,
- const GLubyte *bitmap );
-
-GLAPI void GLAPIENTRY glReadPixels( GLint x, GLint y,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- GLvoid *pixels );
-
-GLAPI void GLAPIENTRY glDrawPixels( GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const GLvoid *pixels );
-
-GLAPI void GLAPIENTRY glCopyPixels( GLint x, GLint y,
- GLsizei width, GLsizei height,
- GLenum type );
-
-/*
- * Stenciling
- */
-
-GLAPI void GLAPIENTRY glStencilFunc( GLenum func, GLint ref, GLuint mask );
-
-GLAPI void GLAPIENTRY glStencilMask( GLuint mask );
-
-GLAPI void GLAPIENTRY glStencilOp( GLenum fail, GLenum zfail, GLenum zpass );
-
-GLAPI void GLAPIENTRY glClearStencil( GLint s );
-
-
-
-/*
- * Texture mapping
- */
-
-GLAPI void GLAPIENTRY glTexGend( GLenum coord, GLenum pname, GLdouble param );
-GLAPI void GLAPIENTRY glTexGenf( GLenum coord, GLenum pname, GLfloat param );
-GLAPI void GLAPIENTRY glTexGeni( GLenum coord, GLenum pname, GLint param );
-
-GLAPI void GLAPIENTRY glTexGendv( GLenum coord, GLenum pname, const GLdouble *params );
-GLAPI void GLAPIENTRY glTexGenfv( GLenum coord, GLenum pname, const GLfloat *params );
-GLAPI void GLAPIENTRY glTexGeniv( GLenum coord, GLenum pname, const GLint *params );
-
-GLAPI void GLAPIENTRY glGetTexGendv( GLenum coord, GLenum pname, GLdouble *params );
-GLAPI void GLAPIENTRY glGetTexGenfv( GLenum coord, GLenum pname, GLfloat *params );
-GLAPI void GLAPIENTRY glGetTexGeniv( GLenum coord, GLenum pname, GLint *params );
-
-
-GLAPI void GLAPIENTRY glTexEnvf( GLenum target, GLenum pname, GLfloat param );
-GLAPI void GLAPIENTRY glTexEnvi( GLenum target, GLenum pname, GLint param );
-
-GLAPI void GLAPIENTRY glTexEnvfv( GLenum target, GLenum pname, const GLfloat *params );
-GLAPI void GLAPIENTRY glTexEnviv( GLenum target, GLenum pname, const GLint *params );
-
-GLAPI void GLAPIENTRY glGetTexEnvfv( GLenum target, GLenum pname, GLfloat *params );
-GLAPI void GLAPIENTRY glGetTexEnviv( GLenum target, GLenum pname, GLint *params );
-
-
-GLAPI void GLAPIENTRY glTexParameterf( GLenum target, GLenum pname, GLfloat param );
-GLAPI void GLAPIENTRY glTexParameteri( GLenum target, GLenum pname, GLint param );
-
-GLAPI void GLAPIENTRY glTexParameterfv( GLenum target, GLenum pname,
- const GLfloat *params );
-GLAPI void GLAPIENTRY glTexParameteriv( GLenum target, GLenum pname,
- const GLint *params );
-
-GLAPI void GLAPIENTRY glGetTexParameterfv( GLenum target,
- GLenum pname, GLfloat *params);
-GLAPI void GLAPIENTRY glGetTexParameteriv( GLenum target,
- GLenum pname, GLint *params );
-
-GLAPI void GLAPIENTRY glGetTexLevelParameterfv( GLenum target, GLint level,
- GLenum pname, GLfloat *params );
-GLAPI void GLAPIENTRY glGetTexLevelParameteriv( GLenum target, GLint level,
- GLenum pname, GLint *params );
-
-
-GLAPI void GLAPIENTRY glTexImage1D( GLenum target, GLint level,
- GLint internalFormat,
- GLsizei width, GLint border,
- GLenum format, GLenum type,
- const GLvoid *pixels );
-
-GLAPI void GLAPIENTRY glTexImage2D( GLenum target, GLint level,
- GLint internalFormat,
- GLsizei width, GLsizei height,
- GLint border, GLenum format, GLenum type,
- const GLvoid *pixels );
-
-GLAPI void GLAPIENTRY glGetTexImage( GLenum target, GLint level,
- GLenum format, GLenum type,
- GLvoid *pixels );
-
-
-/* 1.1 functions */
-
-GLAPI void GLAPIENTRY glGenTextures( GLsizei n, GLuint *textures );
-
-GLAPI void GLAPIENTRY glDeleteTextures( GLsizei n, const GLuint *textures);
-
-GLAPI void GLAPIENTRY glBindTexture( GLenum target, GLuint texture );
-
-GLAPI void GLAPIENTRY glPrioritizeTextures( GLsizei n,
- const GLuint *textures,
- const GLclampf *priorities );
-
-GLAPI GLboolean GLAPIENTRY glAreTexturesResident( GLsizei n,
- const GLuint *textures,
- GLboolean *residences );
-
-GLAPI GLboolean GLAPIENTRY glIsTexture( GLuint texture );
-
-
-GLAPI void GLAPIENTRY glTexSubImage1D( GLenum target, GLint level,
- GLint xoffset,
- GLsizei width, GLenum format,
- GLenum type, const GLvoid *pixels );
-
-
-GLAPI void GLAPIENTRY glTexSubImage2D( GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const GLvoid *pixels );
-
-
-GLAPI void GLAPIENTRY glCopyTexImage1D( GLenum target, GLint level,
- GLenum internalformat,
- GLint x, GLint y,
- GLsizei width, GLint border );
-
-
-GLAPI void GLAPIENTRY glCopyTexImage2D( GLenum target, GLint level,
- GLenum internalformat,
- GLint x, GLint y,
- GLsizei width, GLsizei height,
- GLint border );
-
-
-GLAPI void GLAPIENTRY glCopyTexSubImage1D( GLenum target, GLint level,
- GLint xoffset, GLint x, GLint y,
- GLsizei width );
-
-
-GLAPI void GLAPIENTRY glCopyTexSubImage2D( GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLint x, GLint y,
- GLsizei width, GLsizei height );
-
-
-/*
- * Evaluators
- */
-
-GLAPI void GLAPIENTRY glMap1d( GLenum target, GLdouble u1, GLdouble u2,
- GLint stride,
- GLint order, const GLdouble *points );
-GLAPI void GLAPIENTRY glMap1f( GLenum target, GLfloat u1, GLfloat u2,
- GLint stride,
- GLint order, const GLfloat *points );
-
-GLAPI void GLAPIENTRY glMap2d( GLenum target,
- GLdouble u1, GLdouble u2, GLint ustride, GLint uorder,
- GLdouble v1, GLdouble v2, GLint vstride, GLint vorder,
- const GLdouble *points );
-GLAPI void GLAPIENTRY glMap2f( GLenum target,
- GLfloat u1, GLfloat u2, GLint ustride, GLint uorder,
- GLfloat v1, GLfloat v2, GLint vstride, GLint vorder,
- const GLfloat *points );
-
-GLAPI void GLAPIENTRY glGetMapdv( GLenum target, GLenum query, GLdouble *v );
-GLAPI void GLAPIENTRY glGetMapfv( GLenum target, GLenum query, GLfloat *v );
-GLAPI void GLAPIENTRY glGetMapiv( GLenum target, GLenum query, GLint *v );
-
-GLAPI void GLAPIENTRY glEvalCoord1d( GLdouble u );
-GLAPI void GLAPIENTRY glEvalCoord1f( GLfloat u );
-
-GLAPI void GLAPIENTRY glEvalCoord1dv( const GLdouble *u );
-GLAPI void GLAPIENTRY glEvalCoord1fv( const GLfloat *u );
-
-GLAPI void GLAPIENTRY glEvalCoord2d( GLdouble u, GLdouble v );
-GLAPI void GLAPIENTRY glEvalCoord2f( GLfloat u, GLfloat v );
-
-GLAPI void GLAPIENTRY glEvalCoord2dv( const GLdouble *u );
-GLAPI void GLAPIENTRY glEvalCoord2fv( const GLfloat *u );
-
-GLAPI void GLAPIENTRY glMapGrid1d( GLint un, GLdouble u1, GLdouble u2 );
-GLAPI void GLAPIENTRY glMapGrid1f( GLint un, GLfloat u1, GLfloat u2 );
-
-GLAPI void GLAPIENTRY glMapGrid2d( GLint un, GLdouble u1, GLdouble u2,
- GLint vn, GLdouble v1, GLdouble v2 );
-GLAPI void GLAPIENTRY glMapGrid2f( GLint un, GLfloat u1, GLfloat u2,
- GLint vn, GLfloat v1, GLfloat v2 );
-
-GLAPI void GLAPIENTRY glEvalPoint1( GLint i );
-
-GLAPI void GLAPIENTRY glEvalPoint2( GLint i, GLint j );
-
-GLAPI void GLAPIENTRY glEvalMesh1( GLenum mode, GLint i1, GLint i2 );
-
-GLAPI void GLAPIENTRY glEvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 );
-
-
-/*
- * Fog
- */
-
-GLAPI void GLAPIENTRY glFogf( GLenum pname, GLfloat param );
-
-GLAPI void GLAPIENTRY glFogi( GLenum pname, GLint param );
-
-GLAPI void GLAPIENTRY glFogfv( GLenum pname, const GLfloat *params );
-
-GLAPI void GLAPIENTRY glFogiv( GLenum pname, const GLint *params );
-
-
-/*
- * Selection and Feedback
- */
-
-GLAPI void GLAPIENTRY glFeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer );
-
-GLAPI void GLAPIENTRY glPassThrough( GLfloat token );
-
-GLAPI void GLAPIENTRY glSelectBuffer( GLsizei size, GLuint *buffer );
-
-GLAPI void GLAPIENTRY glInitNames( void );
-
-GLAPI void GLAPIENTRY glLoadName( GLuint name );
-
-GLAPI void GLAPIENTRY glPushName( GLuint name );
-
-GLAPI void GLAPIENTRY glPopName( void );
-
-
-
-/*
- * OpenGL 1.2
- */
-
-#define GL_RESCALE_NORMAL 0x803A
-#define GL_CLAMP_TO_EDGE 0x812F
-#define GL_MAX_ELEMENTS_VERTICES 0x80E8
-#define GL_MAX_ELEMENTS_INDICES 0x80E9
-#define GL_BGR 0x80E0
-#define GL_BGRA 0x80E1
-#define GL_UNSIGNED_BYTE_3_3_2 0x8032
-#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362
-#define GL_UNSIGNED_SHORT_5_6_5 0x8363
-#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364
-#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
-#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365
-#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
-#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366
-#define GL_UNSIGNED_INT_8_8_8_8 0x8035
-#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367
-#define GL_UNSIGNED_INT_10_10_10_2 0x8036
-#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
-#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8
-#define GL_SINGLE_COLOR 0x81F9
-#define GL_SEPARATE_SPECULAR_COLOR 0x81FA
-#define GL_TEXTURE_MIN_LOD 0x813A
-#define GL_TEXTURE_MAX_LOD 0x813B
-#define GL_TEXTURE_BASE_LEVEL 0x813C
-#define GL_TEXTURE_MAX_LEVEL 0x813D
-#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12
-#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13
-#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22
-#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23
-#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
-#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
-#define GL_PACK_SKIP_IMAGES 0x806B
-#define GL_PACK_IMAGE_HEIGHT 0x806C
-#define GL_UNPACK_SKIP_IMAGES 0x806D
-#define GL_UNPACK_IMAGE_HEIGHT 0x806E
-#define GL_TEXTURE_3D 0x806F
-#define GL_PROXY_TEXTURE_3D 0x8070
-#define GL_TEXTURE_DEPTH 0x8071
-#define GL_TEXTURE_WRAP_R 0x8072
-#define GL_MAX_3D_TEXTURE_SIZE 0x8073
-#define GL_TEXTURE_BINDING_3D 0x806A
-
-GLAPI void GLAPIENTRY glDrawRangeElements( GLenum mode, GLuint start,
- GLuint end, GLsizei count, GLenum type, const GLvoid *indices );
-
-GLAPI void GLAPIENTRY glTexImage3D( GLenum target, GLint level,
- GLint internalFormat,
- GLsizei width, GLsizei height,
- GLsizei depth, GLint border,
- GLenum format, GLenum type,
- const GLvoid *pixels );
-
-GLAPI void GLAPIENTRY glTexSubImage3D( GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLint zoffset, GLsizei width,
- GLsizei height, GLsizei depth,
- GLenum format,
- GLenum type, const GLvoid *pixels);
-
-GLAPI void GLAPIENTRY glCopyTexSubImage3D( GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLint zoffset, GLint x,
- GLint y, GLsizei width,
- GLsizei height );
-
-typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
-typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-
-
-/*
- * GL_ARB_imaging
- */
-
-#define GL_CONSTANT_COLOR 0x8001
-#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
-#define GL_CONSTANT_ALPHA 0x8003
-#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
-#define GL_COLOR_TABLE 0x80D0
-#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1
-#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2
-#define GL_PROXY_COLOR_TABLE 0x80D3
-#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4
-#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5
-#define GL_COLOR_TABLE_SCALE 0x80D6
-#define GL_COLOR_TABLE_BIAS 0x80D7
-#define GL_COLOR_TABLE_FORMAT 0x80D8
-#define GL_COLOR_TABLE_WIDTH 0x80D9
-#define GL_COLOR_TABLE_RED_SIZE 0x80DA
-#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB
-#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC
-#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD
-#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE
-#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF
-#define GL_CONVOLUTION_1D 0x8010
-#define GL_CONVOLUTION_2D 0x8011
-#define GL_SEPARABLE_2D 0x8012
-#define GL_CONVOLUTION_BORDER_MODE 0x8013
-#define GL_CONVOLUTION_FILTER_SCALE 0x8014
-#define GL_CONVOLUTION_FILTER_BIAS 0x8015
-#define GL_REDUCE 0x8016
-#define GL_CONVOLUTION_FORMAT 0x8017
-#define GL_CONVOLUTION_WIDTH 0x8018
-#define GL_CONVOLUTION_HEIGHT 0x8019
-#define GL_MAX_CONVOLUTION_WIDTH 0x801A
-#define GL_MAX_CONVOLUTION_HEIGHT 0x801B
-#define GL_POST_CONVOLUTION_RED_SCALE 0x801C
-#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D
-#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E
-#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F
-#define GL_POST_CONVOLUTION_RED_BIAS 0x8020
-#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021
-#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022
-#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023
-#define GL_CONSTANT_BORDER 0x8151
-#define GL_REPLICATE_BORDER 0x8153
-#define GL_CONVOLUTION_BORDER_COLOR 0x8154
-#define GL_COLOR_MATRIX 0x80B1
-#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2
-#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3
-#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4
-#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5
-#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6
-#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7
-#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8
-#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9
-#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA
-#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB
-#define GL_HISTOGRAM 0x8024
-#define GL_PROXY_HISTOGRAM 0x8025
-#define GL_HISTOGRAM_WIDTH 0x8026
-#define GL_HISTOGRAM_FORMAT 0x8027
-#define GL_HISTOGRAM_RED_SIZE 0x8028
-#define GL_HISTOGRAM_GREEN_SIZE 0x8029
-#define GL_HISTOGRAM_BLUE_SIZE 0x802A
-#define GL_HISTOGRAM_ALPHA_SIZE 0x802B
-#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C
-#define GL_HISTOGRAM_SINK 0x802D
-#define GL_MINMAX 0x802E
-#define GL_MINMAX_FORMAT 0x802F
-#define GL_MINMAX_SINK 0x8030
-#define GL_TABLE_TOO_LARGE 0x8031
-#define GL_BLEND_EQUATION 0x8009
-#define GL_MIN 0x8007
-#define GL_MAX 0x8008
-#define GL_FUNC_ADD 0x8006
-#define GL_FUNC_SUBTRACT 0x800A
-#define GL_FUNC_REVERSE_SUBTRACT 0x800B
-#define GL_BLEND_COLOR 0x8005
-
-
-GLAPI void GLAPIENTRY glColorTable( GLenum target, GLenum internalformat,
- GLsizei width, GLenum format,
- GLenum type, const GLvoid *table );
-
-GLAPI void GLAPIENTRY glColorSubTable( GLenum target,
- GLsizei start, GLsizei count,
- GLenum format, GLenum type,
- const GLvoid *data );
-
-GLAPI void GLAPIENTRY glColorTableParameteriv(GLenum target, GLenum pname,
- const GLint *params);
-
-GLAPI void GLAPIENTRY glColorTableParameterfv(GLenum target, GLenum pname,
- const GLfloat *params);
-
-GLAPI void GLAPIENTRY glCopyColorSubTable( GLenum target, GLsizei start,
- GLint x, GLint y, GLsizei width );
-
-GLAPI void GLAPIENTRY glCopyColorTable( GLenum target, GLenum internalformat,
- GLint x, GLint y, GLsizei width );
-
-GLAPI void GLAPIENTRY glGetColorTable( GLenum target, GLenum format,
- GLenum type, GLvoid *table );
-
-GLAPI void GLAPIENTRY glGetColorTableParameterfv( GLenum target, GLenum pname,
- GLfloat *params );
-
-GLAPI void GLAPIENTRY glGetColorTableParameteriv( GLenum target, GLenum pname,
- GLint *params );
-
-GLAPI void GLAPIENTRY glBlendEquation( GLenum mode );
-
-GLAPI void GLAPIENTRY glBlendColor( GLclampf red, GLclampf green,
- GLclampf blue, GLclampf alpha );
-
-GLAPI void GLAPIENTRY glHistogram( GLenum target, GLsizei width,
- GLenum internalformat, GLboolean sink );
-
-GLAPI void GLAPIENTRY glResetHistogram( GLenum target );
-
-GLAPI void GLAPIENTRY glGetHistogram( GLenum target, GLboolean reset,
- GLenum format, GLenum type,
- GLvoid *values );
-
-GLAPI void GLAPIENTRY glGetHistogramParameterfv( GLenum target, GLenum pname,
- GLfloat *params );
-
-GLAPI void GLAPIENTRY glGetHistogramParameteriv( GLenum target, GLenum pname,
- GLint *params );
-
-GLAPI void GLAPIENTRY glMinmax( GLenum target, GLenum internalformat,
- GLboolean sink );
-
-GLAPI void GLAPIENTRY glResetMinmax( GLenum target );
-
-GLAPI void GLAPIENTRY glGetMinmax( GLenum target, GLboolean reset,
- GLenum format, GLenum types,
- GLvoid *values );
-
-GLAPI void GLAPIENTRY glGetMinmaxParameterfv( GLenum target, GLenum pname,
- GLfloat *params );
-
-GLAPI void GLAPIENTRY glGetMinmaxParameteriv( GLenum target, GLenum pname,
- GLint *params );
-
-GLAPI void GLAPIENTRY glConvolutionFilter1D( GLenum target,
- GLenum internalformat, GLsizei width, GLenum format, GLenum type,
- const GLvoid *image );
-
-GLAPI void GLAPIENTRY glConvolutionFilter2D( GLenum target,
- GLenum internalformat, GLsizei width, GLsizei height, GLenum format,
- GLenum type, const GLvoid *image );
-
-GLAPI void GLAPIENTRY glConvolutionParameterf( GLenum target, GLenum pname,
- GLfloat params );
-
-GLAPI void GLAPIENTRY glConvolutionParameterfv( GLenum target, GLenum pname,
- const GLfloat *params );
-
-GLAPI void GLAPIENTRY glConvolutionParameteri( GLenum target, GLenum pname,
- GLint params );
-
-GLAPI void GLAPIENTRY glConvolutionParameteriv( GLenum target, GLenum pname,
- const GLint *params );
-
-GLAPI void GLAPIENTRY glCopyConvolutionFilter1D( GLenum target,
- GLenum internalformat, GLint x, GLint y, GLsizei width );
-
-GLAPI void GLAPIENTRY glCopyConvolutionFilter2D( GLenum target,
- GLenum internalformat, GLint x, GLint y, GLsizei width,
- GLsizei height);
-
-GLAPI void GLAPIENTRY glGetConvolutionFilter( GLenum target, GLenum format,
- GLenum type, GLvoid *image );
-
-GLAPI void GLAPIENTRY glGetConvolutionParameterfv( GLenum target, GLenum pname,
- GLfloat *params );
-
-GLAPI void GLAPIENTRY glGetConvolutionParameteriv( GLenum target, GLenum pname,
- GLint *params );
-
-GLAPI void GLAPIENTRY glSeparableFilter2D( GLenum target,
- GLenum internalformat, GLsizei width, GLsizei height, GLenum format,
- GLenum type, const GLvoid *row, const GLvoid *column );
-
-GLAPI void GLAPIENTRY glGetSeparableFilter( GLenum target, GLenum format,
- GLenum type, GLvoid *row, GLvoid *column, GLvoid *span );
-
-typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
-typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);
-typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
-typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
-typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image);
-typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
-typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
-typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
-typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
-typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
-typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink);
-typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target);
-
-
-
-/*
- * OpenGL 1.3
- */
-
-/* multitexture */
-#define GL_TEXTURE0 0x84C0
-#define GL_TEXTURE1 0x84C1
-#define GL_TEXTURE2 0x84C2
-#define GL_TEXTURE3 0x84C3
-#define GL_TEXTURE4 0x84C4
-#define GL_TEXTURE5 0x84C5
-#define GL_TEXTURE6 0x84C6
-#define GL_TEXTURE7 0x84C7
-#define GL_TEXTURE8 0x84C8
-#define GL_TEXTURE9 0x84C9
-#define GL_TEXTURE10 0x84CA
-#define GL_TEXTURE11 0x84CB
-#define GL_TEXTURE12 0x84CC
-#define GL_TEXTURE13 0x84CD
-#define GL_TEXTURE14 0x84CE
-#define GL_TEXTURE15 0x84CF
-#define GL_TEXTURE16 0x84D0
-#define GL_TEXTURE17 0x84D1
-#define GL_TEXTURE18 0x84D2
-#define GL_TEXTURE19 0x84D3
-#define GL_TEXTURE20 0x84D4
-#define GL_TEXTURE21 0x84D5
-#define GL_TEXTURE22 0x84D6
-#define GL_TEXTURE23 0x84D7
-#define GL_TEXTURE24 0x84D8
-#define GL_TEXTURE25 0x84D9
-#define GL_TEXTURE26 0x84DA
-#define GL_TEXTURE27 0x84DB
-#define GL_TEXTURE28 0x84DC
-#define GL_TEXTURE29 0x84DD
-#define GL_TEXTURE30 0x84DE
-#define GL_TEXTURE31 0x84DF
-#define GL_ACTIVE_TEXTURE 0x84E0
-#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1
-#define GL_MAX_TEXTURE_UNITS 0x84E2
-/* texture_cube_map */
-#define GL_NORMAL_MAP 0x8511
-#define GL_REFLECTION_MAP 0x8512
-#define GL_TEXTURE_CUBE_MAP 0x8513
-#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
-#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B
-#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
-/* texture_compression */
-#define GL_COMPRESSED_ALPHA 0x84E9
-#define GL_COMPRESSED_LUMINANCE 0x84EA
-#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB
-#define GL_COMPRESSED_INTENSITY 0x84EC
-#define GL_COMPRESSED_RGB 0x84ED
-#define GL_COMPRESSED_RGBA 0x84EE
-#define GL_TEXTURE_COMPRESSION_HINT 0x84EF
-#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0
-#define GL_TEXTURE_COMPRESSED 0x86A1
-#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
-#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
-/* multisample */
-#define GL_MULTISAMPLE 0x809D
-#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
-#define GL_SAMPLE_ALPHA_TO_ONE 0x809F
-#define GL_SAMPLE_COVERAGE 0x80A0
-#define GL_SAMPLE_BUFFERS 0x80A8
-#define GL_SAMPLES 0x80A9
-#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
-#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
-#define GL_MULTISAMPLE_BIT 0x20000000
-/* transpose_matrix */
-#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3
-#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4
-#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5
-#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6
-/* texture_env_combine */
-#define GL_COMBINE 0x8570
-#define GL_COMBINE_RGB 0x8571
-#define GL_COMBINE_ALPHA 0x8572
-#define GL_SOURCE0_RGB 0x8580
-#define GL_SOURCE1_RGB 0x8581
-#define GL_SOURCE2_RGB 0x8582
-#define GL_SOURCE0_ALPHA 0x8588
-#define GL_SOURCE1_ALPHA 0x8589
-#define GL_SOURCE2_ALPHA 0x858A
-#define GL_OPERAND0_RGB 0x8590
-#define GL_OPERAND1_RGB 0x8591
-#define GL_OPERAND2_RGB 0x8592
-#define GL_OPERAND0_ALPHA 0x8598
-#define GL_OPERAND1_ALPHA 0x8599
-#define GL_OPERAND2_ALPHA 0x859A
-#define GL_RGB_SCALE 0x8573
-#define GL_ADD_SIGNED 0x8574
-#define GL_INTERPOLATE 0x8575
-#define GL_SUBTRACT 0x84E7
-#define GL_CONSTANT 0x8576
-#define GL_PRIMARY_COLOR 0x8577
-#define GL_PREVIOUS 0x8578
-/* texture_env_dot3 */
-#define GL_DOT3_RGB 0x86AE
-#define GL_DOT3_RGBA 0x86AF
-/* texture_border_clamp */
-#define GL_CLAMP_TO_BORDER 0x812D
-
-GLAPI void GLAPIENTRY glActiveTexture( GLenum texture );
-
-GLAPI void GLAPIENTRY glClientActiveTexture( GLenum texture );
-
-GLAPI void GLAPIENTRY glCompressedTexImage1D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data );
-
-GLAPI void GLAPIENTRY glCompressedTexImage2D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data );
-
-GLAPI void GLAPIENTRY glCompressedTexImage3D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data );
-
-GLAPI void GLAPIENTRY glCompressedTexSubImage1D( GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data );
-
-GLAPI void GLAPIENTRY glCompressedTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data );
-
-GLAPI void GLAPIENTRY glCompressedTexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data );
-
-GLAPI void GLAPIENTRY glGetCompressedTexImage( GLenum target, GLint lod, GLvoid *img );
-
-GLAPI void GLAPIENTRY glMultiTexCoord1d( GLenum target, GLdouble s );
-
-GLAPI void GLAPIENTRY glMultiTexCoord1dv( GLenum target, const GLdouble *v );
-
-GLAPI void GLAPIENTRY glMultiTexCoord1f( GLenum target, GLfloat s );
-
-GLAPI void GLAPIENTRY glMultiTexCoord1fv( GLenum target, const GLfloat *v );
-
-GLAPI void GLAPIENTRY glMultiTexCoord1i( GLenum target, GLint s );
-
-GLAPI void GLAPIENTRY glMultiTexCoord1iv( GLenum target, const GLint *v );
-
-GLAPI void GLAPIENTRY glMultiTexCoord1s( GLenum target, GLshort s );
-
-GLAPI void GLAPIENTRY glMultiTexCoord1sv( GLenum target, const GLshort *v );
-
-GLAPI void GLAPIENTRY glMultiTexCoord2d( GLenum target, GLdouble s, GLdouble t );
-
-GLAPI void GLAPIENTRY glMultiTexCoord2dv( GLenum target, const GLdouble *v );
-
-GLAPI void GLAPIENTRY glMultiTexCoord2f( GLenum target, GLfloat s, GLfloat t );
-
-GLAPI void GLAPIENTRY glMultiTexCoord2fv( GLenum target, const GLfloat *v );
-
-GLAPI void GLAPIENTRY glMultiTexCoord2i( GLenum target, GLint s, GLint t );
-
-GLAPI void GLAPIENTRY glMultiTexCoord2iv( GLenum target, const GLint *v );
-
-GLAPI void GLAPIENTRY glMultiTexCoord2s( GLenum target, GLshort s, GLshort t );
-
-GLAPI void GLAPIENTRY glMultiTexCoord2sv( GLenum target, const GLshort *v );
-
-GLAPI void GLAPIENTRY glMultiTexCoord3d( GLenum target, GLdouble s, GLdouble t, GLdouble r );
-
-GLAPI void GLAPIENTRY glMultiTexCoord3dv( GLenum target, const GLdouble *v );
-
-GLAPI void GLAPIENTRY glMultiTexCoord3f( GLenum target, GLfloat s, GLfloat t, GLfloat r );
-
-GLAPI void GLAPIENTRY glMultiTexCoord3fv( GLenum target, const GLfloat *v );
-
-GLAPI void GLAPIENTRY glMultiTexCoord3i( GLenum target, GLint s, GLint t, GLint r );
-
-GLAPI void GLAPIENTRY glMultiTexCoord3iv( GLenum target, const GLint *v );
-
-GLAPI void GLAPIENTRY glMultiTexCoord3s( GLenum target, GLshort s, GLshort t, GLshort r );
-
-GLAPI void GLAPIENTRY glMultiTexCoord3sv( GLenum target, const GLshort *v );
-
-GLAPI void GLAPIENTRY glMultiTexCoord4d( GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q );
-
-GLAPI void GLAPIENTRY glMultiTexCoord4dv( GLenum target, const GLdouble *v );
-
-GLAPI void GLAPIENTRY glMultiTexCoord4f( GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q );
-
-GLAPI void GLAPIENTRY glMultiTexCoord4fv( GLenum target, const GLfloat *v );
-
-GLAPI void GLAPIENTRY glMultiTexCoord4i( GLenum target, GLint s, GLint t, GLint r, GLint q );
-
-GLAPI void GLAPIENTRY glMultiTexCoord4iv( GLenum target, const GLint *v );
-
-GLAPI void GLAPIENTRY glMultiTexCoord4s( GLenum target, GLshort s, GLshort t, GLshort r, GLshort q );
-
-GLAPI void GLAPIENTRY glMultiTexCoord4sv( GLenum target, const GLshort *v );
-
-
-GLAPI void GLAPIENTRY glLoadTransposeMatrixd( const GLdouble m[16] );
-
-GLAPI void GLAPIENTRY glLoadTransposeMatrixf( const GLfloat m[16] );
-
-GLAPI void GLAPIENTRY glMultTransposeMatrixd( const GLdouble m[16] );
-
-GLAPI void GLAPIENTRY glMultTransposeMatrixf( const GLfloat m[16] );
-
-GLAPI void GLAPIENTRY glSampleCoverage( GLclampf value, GLboolean invert );
-
-typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture);
-typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m);
-typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m);
-typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m);
-typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m);
-typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, void *img);
-
-
-/*
- * GL_ARB_multitexture (ARB extension 1 and OpenGL 1.2.1)
- */
-#ifndef GL_ARB_multitexture
-#define GL_ARB_multitexture 1
-
-#define GL_TEXTURE0_ARB 0x84C0
-#define GL_TEXTURE1_ARB 0x84C1
-#define GL_TEXTURE2_ARB 0x84C2
-#define GL_TEXTURE3_ARB 0x84C3
-#define GL_TEXTURE4_ARB 0x84C4
-#define GL_TEXTURE5_ARB 0x84C5
-#define GL_TEXTURE6_ARB 0x84C6
-#define GL_TEXTURE7_ARB 0x84C7
-#define GL_TEXTURE8_ARB 0x84C8
-#define GL_TEXTURE9_ARB 0x84C9
-#define GL_TEXTURE10_ARB 0x84CA
-#define GL_TEXTURE11_ARB 0x84CB
-#define GL_TEXTURE12_ARB 0x84CC
-#define GL_TEXTURE13_ARB 0x84CD
-#define GL_TEXTURE14_ARB 0x84CE
-#define GL_TEXTURE15_ARB 0x84CF
-#define GL_TEXTURE16_ARB 0x84D0
-#define GL_TEXTURE17_ARB 0x84D1
-#define GL_TEXTURE18_ARB 0x84D2
-#define GL_TEXTURE19_ARB 0x84D3
-#define GL_TEXTURE20_ARB 0x84D4
-#define GL_TEXTURE21_ARB 0x84D5
-#define GL_TEXTURE22_ARB 0x84D6
-#define GL_TEXTURE23_ARB 0x84D7
-#define GL_TEXTURE24_ARB 0x84D8
-#define GL_TEXTURE25_ARB 0x84D9
-#define GL_TEXTURE26_ARB 0x84DA
-#define GL_TEXTURE27_ARB 0x84DB
-#define GL_TEXTURE28_ARB 0x84DC
-#define GL_TEXTURE29_ARB 0x84DD
-#define GL_TEXTURE30_ARB 0x84DE
-#define GL_TEXTURE31_ARB 0x84DF
-#define GL_ACTIVE_TEXTURE_ARB 0x84E0
-#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1
-#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2
-
-GLAPI void GLAPIENTRY glActiveTextureARB(GLenum texture);
-GLAPI void GLAPIENTRY glClientActiveTextureARB(GLenum texture);
-GLAPI void GLAPIENTRY glMultiTexCoord1dARB(GLenum target, GLdouble s);
-GLAPI void GLAPIENTRY glMultiTexCoord1dvARB(GLenum target, const GLdouble *v);
-GLAPI void GLAPIENTRY glMultiTexCoord1fARB(GLenum target, GLfloat s);
-GLAPI void GLAPIENTRY glMultiTexCoord1fvARB(GLenum target, const GLfloat *v);
-GLAPI void GLAPIENTRY glMultiTexCoord1iARB(GLenum target, GLint s);
-GLAPI void GLAPIENTRY glMultiTexCoord1ivARB(GLenum target, const GLint *v);
-GLAPI void GLAPIENTRY glMultiTexCoord1sARB(GLenum target, GLshort s);
-GLAPI void GLAPIENTRY glMultiTexCoord1svARB(GLenum target, const GLshort *v);
-GLAPI void GLAPIENTRY glMultiTexCoord2dARB(GLenum target, GLdouble s, GLdouble t);
-GLAPI void GLAPIENTRY glMultiTexCoord2dvARB(GLenum target, const GLdouble *v);
-GLAPI void GLAPIENTRY glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t);
-GLAPI void GLAPIENTRY glMultiTexCoord2fvARB(GLenum target, const GLfloat *v);
-GLAPI void GLAPIENTRY glMultiTexCoord2iARB(GLenum target, GLint s, GLint t);
-GLAPI void GLAPIENTRY glMultiTexCoord2ivARB(GLenum target, const GLint *v);
-GLAPI void GLAPIENTRY glMultiTexCoord2sARB(GLenum target, GLshort s, GLshort t);
-GLAPI void GLAPIENTRY glMultiTexCoord2svARB(GLenum target, const GLshort *v);
-GLAPI void GLAPIENTRY glMultiTexCoord3dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r);
-GLAPI void GLAPIENTRY glMultiTexCoord3dvARB(GLenum target, const GLdouble *v);
-GLAPI void GLAPIENTRY glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r);
-GLAPI void GLAPIENTRY glMultiTexCoord3fvARB(GLenum target, const GLfloat *v);
-GLAPI void GLAPIENTRY glMultiTexCoord3iARB(GLenum target, GLint s, GLint t, GLint r);
-GLAPI void GLAPIENTRY glMultiTexCoord3ivARB(GLenum target, const GLint *v);
-GLAPI void GLAPIENTRY glMultiTexCoord3sARB(GLenum target, GLshort s, GLshort t, GLshort r);
-GLAPI void GLAPIENTRY glMultiTexCoord3svARB(GLenum target, const GLshort *v);
-GLAPI void GLAPIENTRY glMultiTexCoord4dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
-GLAPI void GLAPIENTRY glMultiTexCoord4dvARB(GLenum target, const GLdouble *v);
-GLAPI void GLAPIENTRY glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
-GLAPI void GLAPIENTRY glMultiTexCoord4fvARB(GLenum target, const GLfloat *v);
-GLAPI void GLAPIENTRY glMultiTexCoord4iARB(GLenum target, GLint s, GLint t, GLint r, GLint q);
-GLAPI void GLAPIENTRY glMultiTexCoord4ivARB(GLenum target, const GLint *v);
-GLAPI void GLAPIENTRY glMultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
-GLAPI void GLAPIENTRY glMultiTexCoord4svARB(GLenum target, const GLshort *v);
-
-typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture);
-typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v);
-
-#endif /* GL_ARB_multitexture */
-
-
-
-/*
- * Define this token if you want "old-style" header file behaviour (extensions
- * defined in gl.h). Otherwise, extensions will be included from glext.h.
- */
-#if defined(GL_GLEXT_LEGACY)
-
-/* All extensions that used to be here are now found in glext.h */
-
-#else /* GL_GLEXT_LEGACY */
-
-#include <mesa_glext.h>
-
-#endif /* GL_GLEXT_LEGACY */
-
-
-
-#if GL_ARB_shader_objects
-
-#ifndef GL_MESA_shader_debug
-#define GL_MESA_shader_debug 1
-
-#define GL_DEBUG_OBJECT_MESA 0x8759
-#define GL_DEBUG_PRINT_MESA 0x875A
-#define GL_DEBUG_ASSERT_MESA 0x875B
-
-GLAPI GLhandleARB APIENTRY glCreateDebugObjectMESA (void);
-GLAPI void APIENTRY glClearDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType);
-GLAPI void APIENTRY glGetDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType, GLsizei maxLength,
- GLsizei *length, GLcharARB *debugLog);
-GLAPI GLsizei APIENTRY glGetDebugLogLengthMESA (GLhandleARB obj, GLenum logType, GLenum shaderType);
-
-#endif /* GL_MESA_shader_debug */
-
-#endif /* GL_ARB_shader_objects */
-
-
-/*
- * ???. GL_MESA_packed_depth_stencil
- * XXX obsolete
- */
-#ifndef GL_MESA_packed_depth_stencil
-#define GL_MESA_packed_depth_stencil 1
-
-#define GL_DEPTH_STENCIL_MESA 0x8750
-#define GL_UNSIGNED_INT_24_8_MESA 0x8751
-#define GL_UNSIGNED_INT_8_24_REV_MESA 0x8752
-#define GL_UNSIGNED_SHORT_15_1_MESA 0x8753
-#define GL_UNSIGNED_SHORT_1_15_REV_MESA 0x8754
-
-#endif /* GL_MESA_packed_depth_stencil */
-
-
-#ifndef GL_MESA_program_debug
-#define GL_MESA_program_debug 1
-
-#define GL_FRAGMENT_PROGRAM_POSITION_MESA 0x8bb0
-#define GL_FRAGMENT_PROGRAM_CALLBACK_MESA 0x8bb1
-#define GL_FRAGMENT_PROGRAM_CALLBACK_FUNC_MESA 0x8bb2
-#define GL_FRAGMENT_PROGRAM_CALLBACK_DATA_MESA 0x8bb3
-#define GL_VERTEX_PROGRAM_POSITION_MESA 0x8bb4
-#define GL_VERTEX_PROGRAM_CALLBACK_MESA 0x8bb5
-#define GL_VERTEX_PROGRAM_CALLBACK_FUNC_MESA 0x8bb6
-#define GL_VERTEX_PROGRAM_CALLBACK_DATA_MESA 0x8bb7
-
-typedef void (*GLprogramcallbackMESA)(GLenum target, GLvoid *data);
-
-GLAPI void GLAPIENTRY glProgramCallbackMESA(GLenum target, GLprogramcallbackMESA callback, GLvoid *data);
-
-GLAPI void GLAPIENTRY glGetProgramRegisterfvMESA(GLenum target, GLsizei len, const GLubyte *name, GLfloat *v);
-
-#endif /* GL_MESA_program_debug */
-
-
-#ifndef GL_ATI_blend_equation_separate
-#define GL_ATI_blend_equation_separate 1
-
-#define GL_ALPHA_BLEND_EQUATION_ATI 0x883D
-
-GLAPI void GLAPIENTRY glBlendEquationSeparateATI( GLenum modeRGB, GLenum modeA );
-typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEATIPROC) (GLenum modeRGB, GLenum modeA);
-
-#endif /* GL_ATI_blend_equation_separate */
-
-
-
-/**
- ** NOTE!!!!! If you add new functions to this file, or update
- ** glext.h be sure to regenerate the gl_mangle.h file. See comments
- ** in that file for details.
- **/
-
-
-
-/**********************************************************************
- * Begin system-specific stuff
- */
-#if defined(PRAGMA_EXPORT_SUPPORTED)
-#pragma export off
-#endif
-
-#if defined(macintosh) && PRAGMA_IMPORT_SUPPORTED
-#pragma import off
-#endif
-/*
- * End system-specific stuff
- **********************************************************************/
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __gl_h_ */
+++ /dev/null
-#ifndef __glext_h_
-#define __glext_h_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
-** Copyright (c) 2007 The Khronos Group Inc.
-**
-** Permission is hereby granted, free of charge, to any person obtaining a
-** copy of this software and/or associated documentation files (the
-** "Materials"), to deal in the Materials without restriction, including
-** without limitation the rights to use, copy, modify, merge, publish,
-** distribute, sublicense, and/or sell copies of the Materials, and to
-** permit persons to whom the Materials are furnished to do so, subject to
-** the following conditions:
-**
-** The above copyright notice and this permission notice shall be included
-** in all copies or substantial portions of the Materials.
-**
-** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
-*/
-
-#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
-#define WIN32_LEAN_AND_MEAN 1
-#include <windows.h>
-#endif
-
-#ifndef APIENTRY
-#define APIENTRY
-#endif
-#ifndef APIENTRYP
-#define APIENTRYP APIENTRY *
-#endif
-#ifndef GLAPI
-#define GLAPI extern
-#endif
-
-/*************************************************************/
-
-/* Header file version number, required by OpenGL ABI for Linux */
-/* glext.h last updated 2007/02/12 */
-/* Current version at http://www.opengl.org/registry/ */
-#define GL_GLEXT_VERSION 39
-
-#ifndef GL_VERSION_1_2
-#define GL_UNSIGNED_BYTE_3_3_2 0x8032
-#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
-#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
-#define GL_UNSIGNED_INT_8_8_8_8 0x8035
-#define GL_UNSIGNED_INT_10_10_10_2 0x8036
-#define GL_RESCALE_NORMAL 0x803A
-#define GL_TEXTURE_BINDING_3D 0x806A
-#define GL_PACK_SKIP_IMAGES 0x806B
-#define GL_PACK_IMAGE_HEIGHT 0x806C
-#define GL_UNPACK_SKIP_IMAGES 0x806D
-#define GL_UNPACK_IMAGE_HEIGHT 0x806E
-#define GL_TEXTURE_3D 0x806F
-#define GL_PROXY_TEXTURE_3D 0x8070
-#define GL_TEXTURE_DEPTH 0x8071
-#define GL_TEXTURE_WRAP_R 0x8072
-#define GL_MAX_3D_TEXTURE_SIZE 0x8073
-#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362
-#define GL_UNSIGNED_SHORT_5_6_5 0x8363
-#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364
-#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365
-#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366
-#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367
-#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
-#define GL_BGR 0x80E0
-#define GL_BGRA 0x80E1
-#define GL_MAX_ELEMENTS_VERTICES 0x80E8
-#define GL_MAX_ELEMENTS_INDICES 0x80E9
-#define GL_CLAMP_TO_EDGE 0x812F
-#define GL_TEXTURE_MIN_LOD 0x813A
-#define GL_TEXTURE_MAX_LOD 0x813B
-#define GL_TEXTURE_BASE_LEVEL 0x813C
-#define GL_TEXTURE_MAX_LEVEL 0x813D
-#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8
-#define GL_SINGLE_COLOR 0x81F9
-#define GL_SEPARATE_SPECULAR_COLOR 0x81FA
-#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12
-#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13
-#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22
-#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23
-#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
-#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
-#endif
-
-#ifndef GL_ARB_imaging
-#define GL_CONSTANT_COLOR 0x8001
-#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
-#define GL_CONSTANT_ALPHA 0x8003
-#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
-#define GL_BLEND_COLOR 0x8005
-#define GL_FUNC_ADD 0x8006
-#define GL_MIN 0x8007
-#define GL_MAX 0x8008
-#define GL_BLEND_EQUATION 0x8009
-#define GL_FUNC_SUBTRACT 0x800A
-#define GL_FUNC_REVERSE_SUBTRACT 0x800B
-#define GL_CONVOLUTION_1D 0x8010
-#define GL_CONVOLUTION_2D 0x8011
-#define GL_SEPARABLE_2D 0x8012
-#define GL_CONVOLUTION_BORDER_MODE 0x8013
-#define GL_CONVOLUTION_FILTER_SCALE 0x8014
-#define GL_CONVOLUTION_FILTER_BIAS 0x8015
-#define GL_REDUCE 0x8016
-#define GL_CONVOLUTION_FORMAT 0x8017
-#define GL_CONVOLUTION_WIDTH 0x8018
-#define GL_CONVOLUTION_HEIGHT 0x8019
-#define GL_MAX_CONVOLUTION_WIDTH 0x801A
-#define GL_MAX_CONVOLUTION_HEIGHT 0x801B
-#define GL_POST_CONVOLUTION_RED_SCALE 0x801C
-#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D
-#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E
-#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F
-#define GL_POST_CONVOLUTION_RED_BIAS 0x8020
-#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021
-#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022
-#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023
-#define GL_HISTOGRAM 0x8024
-#define GL_PROXY_HISTOGRAM 0x8025
-#define GL_HISTOGRAM_WIDTH 0x8026
-#define GL_HISTOGRAM_FORMAT 0x8027
-#define GL_HISTOGRAM_RED_SIZE 0x8028
-#define GL_HISTOGRAM_GREEN_SIZE 0x8029
-#define GL_HISTOGRAM_BLUE_SIZE 0x802A
-#define GL_HISTOGRAM_ALPHA_SIZE 0x802B
-#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C
-#define GL_HISTOGRAM_SINK 0x802D
-#define GL_MINMAX 0x802E
-#define GL_MINMAX_FORMAT 0x802F
-#define GL_MINMAX_SINK 0x8030
-#define GL_TABLE_TOO_LARGE 0x8031
-#define GL_COLOR_MATRIX 0x80B1
-#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2
-#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3
-#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4
-#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5
-#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6
-#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7
-#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8
-#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9
-#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA
-#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB
-#define GL_COLOR_TABLE 0x80D0
-#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1
-#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2
-#define GL_PROXY_COLOR_TABLE 0x80D3
-#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4
-#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5
-#define GL_COLOR_TABLE_SCALE 0x80D6
-#define GL_COLOR_TABLE_BIAS 0x80D7
-#define GL_COLOR_TABLE_FORMAT 0x80D8
-#define GL_COLOR_TABLE_WIDTH 0x80D9
-#define GL_COLOR_TABLE_RED_SIZE 0x80DA
-#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB
-#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC
-#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD
-#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE
-#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF
-#define GL_CONSTANT_BORDER 0x8151
-#define GL_REPLICATE_BORDER 0x8153
-#define GL_CONVOLUTION_BORDER_COLOR 0x8154
-#endif
-
-#ifndef GL_VERSION_1_3
-#define GL_TEXTURE0 0x84C0
-#define GL_TEXTURE1 0x84C1
-#define GL_TEXTURE2 0x84C2
-#define GL_TEXTURE3 0x84C3
-#define GL_TEXTURE4 0x84C4
-#define GL_TEXTURE5 0x84C5
-#define GL_TEXTURE6 0x84C6
-#define GL_TEXTURE7 0x84C7
-#define GL_TEXTURE8 0x84C8
-#define GL_TEXTURE9 0x84C9
-#define GL_TEXTURE10 0x84CA
-#define GL_TEXTURE11 0x84CB
-#define GL_TEXTURE12 0x84CC
-#define GL_TEXTURE13 0x84CD
-#define GL_TEXTURE14 0x84CE
-#define GL_TEXTURE15 0x84CF
-#define GL_TEXTURE16 0x84D0
-#define GL_TEXTURE17 0x84D1
-#define GL_TEXTURE18 0x84D2
-#define GL_TEXTURE19 0x84D3
-#define GL_TEXTURE20 0x84D4
-#define GL_TEXTURE21 0x84D5
-#define GL_TEXTURE22 0x84D6
-#define GL_TEXTURE23 0x84D7
-#define GL_TEXTURE24 0x84D8
-#define GL_TEXTURE25 0x84D9
-#define GL_TEXTURE26 0x84DA
-#define GL_TEXTURE27 0x84DB
-#define GL_TEXTURE28 0x84DC
-#define GL_TEXTURE29 0x84DD
-#define GL_TEXTURE30 0x84DE
-#define GL_TEXTURE31 0x84DF
-#define GL_ACTIVE_TEXTURE 0x84E0
-#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1
-#define GL_MAX_TEXTURE_UNITS 0x84E2
-#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3
-#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4
-#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5
-#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6
-#define GL_MULTISAMPLE 0x809D
-#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
-#define GL_SAMPLE_ALPHA_TO_ONE 0x809F
-#define GL_SAMPLE_COVERAGE 0x80A0
-#define GL_SAMPLE_BUFFERS 0x80A8
-#define GL_SAMPLES 0x80A9
-#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
-#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
-#define GL_MULTISAMPLE_BIT 0x20000000
-#define GL_NORMAL_MAP 0x8511
-#define GL_REFLECTION_MAP 0x8512
-#define GL_TEXTURE_CUBE_MAP 0x8513
-#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
-#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B
-#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
-#define GL_COMPRESSED_ALPHA 0x84E9
-#define GL_COMPRESSED_LUMINANCE 0x84EA
-#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB
-#define GL_COMPRESSED_INTENSITY 0x84EC
-#define GL_COMPRESSED_RGB 0x84ED
-#define GL_COMPRESSED_RGBA 0x84EE
-#define GL_TEXTURE_COMPRESSION_HINT 0x84EF
-#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0
-#define GL_TEXTURE_COMPRESSED 0x86A1
-#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
-#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
-#define GL_CLAMP_TO_BORDER 0x812D
-#define GL_COMBINE 0x8570
-#define GL_COMBINE_RGB 0x8571
-#define GL_COMBINE_ALPHA 0x8572
-#define GL_SOURCE0_RGB 0x8580
-#define GL_SOURCE1_RGB 0x8581
-#define GL_SOURCE2_RGB 0x8582
-#define GL_SOURCE0_ALPHA 0x8588
-#define GL_SOURCE1_ALPHA 0x8589
-#define GL_SOURCE2_ALPHA 0x858A
-#define GL_OPERAND0_RGB 0x8590
-#define GL_OPERAND1_RGB 0x8591
-#define GL_OPERAND2_RGB 0x8592
-#define GL_OPERAND0_ALPHA 0x8598
-#define GL_OPERAND1_ALPHA 0x8599
-#define GL_OPERAND2_ALPHA 0x859A
-#define GL_RGB_SCALE 0x8573
-#define GL_ADD_SIGNED 0x8574
-#define GL_INTERPOLATE 0x8575
-#define GL_SUBTRACT 0x84E7
-#define GL_CONSTANT 0x8576
-#define GL_PRIMARY_COLOR 0x8577
-#define GL_PREVIOUS 0x8578
-#define GL_DOT3_RGB 0x86AE
-#define GL_DOT3_RGBA 0x86AF
-#endif
-
-#ifndef GL_VERSION_1_4
-#define GL_BLEND_DST_RGB 0x80C8
-#define GL_BLEND_SRC_RGB 0x80C9
-#define GL_BLEND_DST_ALPHA 0x80CA
-#define GL_BLEND_SRC_ALPHA 0x80CB
-#define GL_POINT_SIZE_MIN 0x8126
-#define GL_POINT_SIZE_MAX 0x8127
-#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128
-#define GL_POINT_DISTANCE_ATTENUATION 0x8129
-#define GL_GENERATE_MIPMAP 0x8191
-#define GL_GENERATE_MIPMAP_HINT 0x8192
-#define GL_DEPTH_COMPONENT16 0x81A5
-#define GL_DEPTH_COMPONENT24 0x81A6
-#define GL_DEPTH_COMPONENT32 0x81A7
-#define GL_MIRRORED_REPEAT 0x8370
-#define GL_FOG_COORDINATE_SOURCE 0x8450
-#define GL_FOG_COORDINATE 0x8451
-#define GL_FRAGMENT_DEPTH 0x8452
-#define GL_CURRENT_FOG_COORDINATE 0x8453
-#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454
-#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455
-#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456
-#define GL_FOG_COORDINATE_ARRAY 0x8457
-#define GL_COLOR_SUM 0x8458
-#define GL_CURRENT_SECONDARY_COLOR 0x8459
-#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A
-#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B
-#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C
-#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D
-#define GL_SECONDARY_COLOR_ARRAY 0x845E
-#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD
-#define GL_TEXTURE_FILTER_CONTROL 0x8500
-#define GL_TEXTURE_LOD_BIAS 0x8501
-#define GL_INCR_WRAP 0x8507
-#define GL_DECR_WRAP 0x8508
-#define GL_TEXTURE_DEPTH_SIZE 0x884A
-#define GL_DEPTH_TEXTURE_MODE 0x884B
-#define GL_TEXTURE_COMPARE_MODE 0x884C
-#define GL_TEXTURE_COMPARE_FUNC 0x884D
-#define GL_COMPARE_R_TO_TEXTURE 0x884E
-#endif
-
-#ifndef GL_VERSION_1_5
-#define GL_BUFFER_SIZE 0x8764
-#define GL_BUFFER_USAGE 0x8765
-#define GL_QUERY_COUNTER_BITS 0x8864
-#define GL_CURRENT_QUERY 0x8865
-#define GL_QUERY_RESULT 0x8866
-#define GL_QUERY_RESULT_AVAILABLE 0x8867
-#define GL_ARRAY_BUFFER 0x8892
-#define GL_ELEMENT_ARRAY_BUFFER 0x8893
-#define GL_ARRAY_BUFFER_BINDING 0x8894
-#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
-#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896
-#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897
-#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898
-#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899
-#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A
-#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B
-#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C
-#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D
-#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E
-#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
-#define GL_READ_ONLY 0x88B8
-#define GL_WRITE_ONLY 0x88B9
-#define GL_READ_WRITE 0x88BA
-#define GL_BUFFER_ACCESS 0x88BB
-#define GL_BUFFER_MAPPED 0x88BC
-#define GL_BUFFER_MAP_POINTER 0x88BD
-#define GL_STREAM_DRAW 0x88E0
-#define GL_STREAM_READ 0x88E1
-#define GL_STREAM_COPY 0x88E2
-#define GL_STATIC_DRAW 0x88E4
-#define GL_STATIC_READ 0x88E5
-#define GL_STATIC_COPY 0x88E6
-#define GL_DYNAMIC_DRAW 0x88E8
-#define GL_DYNAMIC_READ 0x88E9
-#define GL_DYNAMIC_COPY 0x88EA
-#define GL_SAMPLES_PASSED 0x8914
-#define GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE
-#define GL_FOG_COORD GL_FOG_COORDINATE
-#define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE
-#define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE
-#define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE
-#define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER
-#define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY
-#define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING
-#define GL_SRC0_RGB GL_SOURCE0_RGB
-#define GL_SRC1_RGB GL_SOURCE1_RGB
-#define GL_SRC2_RGB GL_SOURCE2_RGB
-#define GL_SRC0_ALPHA GL_SOURCE0_ALPHA
-#define GL_SRC1_ALPHA GL_SOURCE1_ALPHA
-#define GL_SRC2_ALPHA GL_SOURCE2_ALPHA
-#endif
-
-#ifndef GL_VERSION_2_0
-#define GL_BLEND_EQUATION_RGB GL_BLEND_EQUATION
-#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
-#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
-#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
-#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
-#define GL_CURRENT_VERTEX_ATTRIB 0x8626
-#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642
-#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643
-#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
-#define GL_STENCIL_BACK_FUNC 0x8800
-#define GL_STENCIL_BACK_FAIL 0x8801
-#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802
-#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803
-#define GL_MAX_DRAW_BUFFERS 0x8824
-#define GL_DRAW_BUFFER0 0x8825
-#define GL_DRAW_BUFFER1 0x8826
-#define GL_DRAW_BUFFER2 0x8827
-#define GL_DRAW_BUFFER3 0x8828
-#define GL_DRAW_BUFFER4 0x8829
-#define GL_DRAW_BUFFER5 0x882A
-#define GL_DRAW_BUFFER6 0x882B
-#define GL_DRAW_BUFFER7 0x882C
-#define GL_DRAW_BUFFER8 0x882D
-#define GL_DRAW_BUFFER9 0x882E
-#define GL_DRAW_BUFFER10 0x882F
-#define GL_DRAW_BUFFER11 0x8830
-#define GL_DRAW_BUFFER12 0x8831
-#define GL_DRAW_BUFFER13 0x8832
-#define GL_DRAW_BUFFER14 0x8833
-#define GL_DRAW_BUFFER15 0x8834
-#define GL_BLEND_EQUATION_ALPHA 0x883D
-#define GL_POINT_SPRITE 0x8861
-#define GL_COORD_REPLACE 0x8862
-#define GL_MAX_VERTEX_ATTRIBS 0x8869
-#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
-#define GL_MAX_TEXTURE_COORDS 0x8871
-#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
-#define GL_FRAGMENT_SHADER 0x8B30
-#define GL_VERTEX_SHADER 0x8B31
-#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49
-#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A
-#define GL_MAX_VARYING_FLOATS 0x8B4B
-#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
-#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
-#define GL_SHADER_TYPE 0x8B4F
-#define GL_FLOAT_VEC2 0x8B50
-#define GL_FLOAT_VEC3 0x8B51
-#define GL_FLOAT_VEC4 0x8B52
-#define GL_INT_VEC2 0x8B53
-#define GL_INT_VEC3 0x8B54
-#define GL_INT_VEC4 0x8B55
-#define GL_BOOL 0x8B56
-#define GL_BOOL_VEC2 0x8B57
-#define GL_BOOL_VEC3 0x8B58
-#define GL_BOOL_VEC4 0x8B59
-#define GL_FLOAT_MAT2 0x8B5A
-#define GL_FLOAT_MAT3 0x8B5B
-#define GL_FLOAT_MAT4 0x8B5C
-#define GL_SAMPLER_1D 0x8B5D
-#define GL_SAMPLER_2D 0x8B5E
-#define GL_SAMPLER_3D 0x8B5F
-#define GL_SAMPLER_CUBE 0x8B60
-#define GL_SAMPLER_1D_SHADOW 0x8B61
-#define GL_SAMPLER_2D_SHADOW 0x8B62
-#define GL_DELETE_STATUS 0x8B80
-#define GL_COMPILE_STATUS 0x8B81
-#define GL_LINK_STATUS 0x8B82
-#define GL_VALIDATE_STATUS 0x8B83
-#define GL_INFO_LOG_LENGTH 0x8B84
-#define GL_ATTACHED_SHADERS 0x8B85
-#define GL_ACTIVE_UNIFORMS 0x8B86
-#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
-#define GL_SHADER_SOURCE_LENGTH 0x8B88
-#define GL_ACTIVE_ATTRIBUTES 0x8B89
-#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
-#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B
-#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
-#define GL_CURRENT_PROGRAM 0x8B8D
-#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0
-#define GL_LOWER_LEFT 0x8CA1
-#define GL_UPPER_LEFT 0x8CA2
-#define GL_STENCIL_BACK_REF 0x8CA3
-#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
-#define GL_STENCIL_BACK_WRITEMASK 0x8CA5
-#endif
-
-#ifndef GL_VERSION_2_1
-#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F
-#define GL_PIXEL_PACK_BUFFER 0x88EB
-#define GL_PIXEL_UNPACK_BUFFER 0x88EC
-#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED
-#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF
-#define GL_FLOAT_MAT2x3 0x8B65
-#define GL_FLOAT_MAT2x4 0x8B66
-#define GL_FLOAT_MAT3x2 0x8B67
-#define GL_FLOAT_MAT3x4 0x8B68
-#define GL_FLOAT_MAT4x2 0x8B69
-#define GL_FLOAT_MAT4x3 0x8B6A
-#define GL_SRGB 0x8C40
-#define GL_SRGB8 0x8C41
-#define GL_SRGB_ALPHA 0x8C42
-#define GL_SRGB8_ALPHA8 0x8C43
-#define GL_SLUMINANCE_ALPHA 0x8C44
-#define GL_SLUMINANCE8_ALPHA8 0x8C45
-#define GL_SLUMINANCE 0x8C46
-#define GL_SLUMINANCE8 0x8C47
-#define GL_COMPRESSED_SRGB 0x8C48
-#define GL_COMPRESSED_SRGB_ALPHA 0x8C49
-#define GL_COMPRESSED_SLUMINANCE 0x8C4A
-#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B
-#endif
-
-#ifndef GL_ARB_multitexture
-#define GL_TEXTURE0_ARB 0x84C0
-#define GL_TEXTURE1_ARB 0x84C1
-#define GL_TEXTURE2_ARB 0x84C2
-#define GL_TEXTURE3_ARB 0x84C3
-#define GL_TEXTURE4_ARB 0x84C4
-#define GL_TEXTURE5_ARB 0x84C5
-#define GL_TEXTURE6_ARB 0x84C6
-#define GL_TEXTURE7_ARB 0x84C7
-#define GL_TEXTURE8_ARB 0x84C8
-#define GL_TEXTURE9_ARB 0x84C9
-#define GL_TEXTURE10_ARB 0x84CA
-#define GL_TEXTURE11_ARB 0x84CB
-#define GL_TEXTURE12_ARB 0x84CC
-#define GL_TEXTURE13_ARB 0x84CD
-#define GL_TEXTURE14_ARB 0x84CE
-#define GL_TEXTURE15_ARB 0x84CF
-#define GL_TEXTURE16_ARB 0x84D0
-#define GL_TEXTURE17_ARB 0x84D1
-#define GL_TEXTURE18_ARB 0x84D2
-#define GL_TEXTURE19_ARB 0x84D3
-#define GL_TEXTURE20_ARB 0x84D4
-#define GL_TEXTURE21_ARB 0x84D5
-#define GL_TEXTURE22_ARB 0x84D6
-#define GL_TEXTURE23_ARB 0x84D7
-#define GL_TEXTURE24_ARB 0x84D8
-#define GL_TEXTURE25_ARB 0x84D9
-#define GL_TEXTURE26_ARB 0x84DA
-#define GL_TEXTURE27_ARB 0x84DB
-#define GL_TEXTURE28_ARB 0x84DC
-#define GL_TEXTURE29_ARB 0x84DD
-#define GL_TEXTURE30_ARB 0x84DE
-#define GL_TEXTURE31_ARB 0x84DF
-#define GL_ACTIVE_TEXTURE_ARB 0x84E0
-#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1
-#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2
-#endif
-
-#ifndef GL_ARB_transpose_matrix
-#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3
-#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4
-#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5
-#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6
-#endif
-
-#ifndef GL_ARB_multisample
-#define GL_MULTISAMPLE_ARB 0x809D
-#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E
-#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F
-#define GL_SAMPLE_COVERAGE_ARB 0x80A0
-#define GL_SAMPLE_BUFFERS_ARB 0x80A8
-#define GL_SAMPLES_ARB 0x80A9
-#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA
-#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB
-#define GL_MULTISAMPLE_BIT_ARB 0x20000000
-#endif
-
-#ifndef GL_ARB_texture_env_add
-#endif
-
-#ifndef GL_ARB_texture_cube_map
-#define GL_NORMAL_MAP_ARB 0x8511
-#define GL_REFLECTION_MAP_ARB 0x8512
-#define GL_TEXTURE_CUBE_MAP_ARB 0x8513
-#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A
-#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B
-#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C
-#endif
-
-#ifndef GL_ARB_texture_compression
-#define GL_COMPRESSED_ALPHA_ARB 0x84E9
-#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA
-#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB
-#define GL_COMPRESSED_INTENSITY_ARB 0x84EC
-#define GL_COMPRESSED_RGB_ARB 0x84ED
-#define GL_COMPRESSED_RGBA_ARB 0x84EE
-#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF
-#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0
-#define GL_TEXTURE_COMPRESSED_ARB 0x86A1
-#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2
-#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3
-#endif
-
-#ifndef GL_ARB_texture_border_clamp
-#define GL_CLAMP_TO_BORDER_ARB 0x812D
-#endif
-
-#ifndef GL_ARB_point_parameters
-#define GL_POINT_SIZE_MIN_ARB 0x8126
-#define GL_POINT_SIZE_MAX_ARB 0x8127
-#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128
-#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129
-#endif
-
-#ifndef GL_ARB_vertex_blend
-#define GL_MAX_VERTEX_UNITS_ARB 0x86A4
-#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5
-#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6
-#define GL_VERTEX_BLEND_ARB 0x86A7
-#define GL_CURRENT_WEIGHT_ARB 0x86A8
-#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9
-#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA
-#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB
-#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC
-#define GL_WEIGHT_ARRAY_ARB 0x86AD
-#define GL_MODELVIEW0_ARB 0x1700
-#define GL_MODELVIEW1_ARB 0x850A
-#define GL_MODELVIEW2_ARB 0x8722
-#define GL_MODELVIEW3_ARB 0x8723
-#define GL_MODELVIEW4_ARB 0x8724
-#define GL_MODELVIEW5_ARB 0x8725
-#define GL_MODELVIEW6_ARB 0x8726
-#define GL_MODELVIEW7_ARB 0x8727
-#define GL_MODELVIEW8_ARB 0x8728
-#define GL_MODELVIEW9_ARB 0x8729
-#define GL_MODELVIEW10_ARB 0x872A
-#define GL_MODELVIEW11_ARB 0x872B
-#define GL_MODELVIEW12_ARB 0x872C
-#define GL_MODELVIEW13_ARB 0x872D
-#define GL_MODELVIEW14_ARB 0x872E
-#define GL_MODELVIEW15_ARB 0x872F
-#define GL_MODELVIEW16_ARB 0x8730
-#define GL_MODELVIEW17_ARB 0x8731
-#define GL_MODELVIEW18_ARB 0x8732
-#define GL_MODELVIEW19_ARB 0x8733
-#define GL_MODELVIEW20_ARB 0x8734
-#define GL_MODELVIEW21_ARB 0x8735
-#define GL_MODELVIEW22_ARB 0x8736
-#define GL_MODELVIEW23_ARB 0x8737
-#define GL_MODELVIEW24_ARB 0x8738
-#define GL_MODELVIEW25_ARB 0x8739
-#define GL_MODELVIEW26_ARB 0x873A
-#define GL_MODELVIEW27_ARB 0x873B
-#define GL_MODELVIEW28_ARB 0x873C
-#define GL_MODELVIEW29_ARB 0x873D
-#define GL_MODELVIEW30_ARB 0x873E
-#define GL_MODELVIEW31_ARB 0x873F
-#endif
-
-#ifndef GL_ARB_matrix_palette
-#define GL_MATRIX_PALETTE_ARB 0x8840
-#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841
-#define GL_MAX_PALETTE_MATRICES_ARB 0x8842
-#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843
-#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844
-#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845
-#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846
-#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847
-#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848
-#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849
-#endif
-
-#ifndef GL_ARB_texture_env_combine
-#define GL_COMBINE_ARB 0x8570
-#define GL_COMBINE_RGB_ARB 0x8571
-#define GL_COMBINE_ALPHA_ARB 0x8572
-#define GL_SOURCE0_RGB_ARB 0x8580
-#define GL_SOURCE1_RGB_ARB 0x8581
-#define GL_SOURCE2_RGB_ARB 0x8582
-#define GL_SOURCE0_ALPHA_ARB 0x8588
-#define GL_SOURCE1_ALPHA_ARB 0x8589
-#define GL_SOURCE2_ALPHA_ARB 0x858A
-#define GL_OPERAND0_RGB_ARB 0x8590
-#define GL_OPERAND1_RGB_ARB 0x8591
-#define GL_OPERAND2_RGB_ARB 0x8592
-#define GL_OPERAND0_ALPHA_ARB 0x8598
-#define GL_OPERAND1_ALPHA_ARB 0x8599
-#define GL_OPERAND2_ALPHA_ARB 0x859A
-#define GL_RGB_SCALE_ARB 0x8573
-#define GL_ADD_SIGNED_ARB 0x8574
-#define GL_INTERPOLATE_ARB 0x8575
-#define GL_SUBTRACT_ARB 0x84E7
-#define GL_CONSTANT_ARB 0x8576
-#define GL_PRIMARY_COLOR_ARB 0x8577
-#define GL_PREVIOUS_ARB 0x8578
-#endif
-
-#ifndef GL_ARB_texture_env_crossbar
-#endif
-
-#ifndef GL_ARB_texture_env_dot3
-#define GL_DOT3_RGB_ARB 0x86AE
-#define GL_DOT3_RGBA_ARB 0x86AF
-#endif
-
-#ifndef GL_ARB_texture_mirrored_repeat
-#define GL_MIRRORED_REPEAT_ARB 0x8370
-#endif
-
-#ifndef GL_ARB_depth_texture
-#define GL_DEPTH_COMPONENT16_ARB 0x81A5
-#define GL_DEPTH_COMPONENT24_ARB 0x81A6
-#define GL_DEPTH_COMPONENT32_ARB 0x81A7
-#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A
-#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B
-#endif
-
-#ifndef GL_ARB_shadow
-#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C
-#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D
-#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E
-#endif
-
-#ifndef GL_ARB_shadow_ambient
-#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF
-#endif
-
-#ifndef GL_ARB_window_pos
-#endif
-
-#ifndef GL_ARB_vertex_program
-#define GL_COLOR_SUM_ARB 0x8458
-#define GL_VERTEX_PROGRAM_ARB 0x8620
-#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622
-#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623
-#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624
-#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625
-#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626
-#define GL_PROGRAM_LENGTH_ARB 0x8627
-#define GL_PROGRAM_STRING_ARB 0x8628
-#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E
-#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F
-#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640
-#define GL_CURRENT_MATRIX_ARB 0x8641
-#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642
-#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643
-#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645
-#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B
-#define GL_PROGRAM_BINDING_ARB 0x8677
-#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869
-#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A
-#define GL_PROGRAM_ERROR_STRING_ARB 0x8874
-#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875
-#define GL_PROGRAM_FORMAT_ARB 0x8876
-#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0
-#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1
-#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2
-#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3
-#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4
-#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5
-#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6
-#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7
-#define GL_PROGRAM_PARAMETERS_ARB 0x88A8
-#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9
-#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA
-#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB
-#define GL_PROGRAM_ATTRIBS_ARB 0x88AC
-#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD
-#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE
-#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF
-#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0
-#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1
-#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2
-#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3
-#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4
-#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5
-#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6
-#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7
-#define GL_MATRIX0_ARB 0x88C0
-#define GL_MATRIX1_ARB 0x88C1
-#define GL_MATRIX2_ARB 0x88C2
-#define GL_MATRIX3_ARB 0x88C3
-#define GL_MATRIX4_ARB 0x88C4
-#define GL_MATRIX5_ARB 0x88C5
-#define GL_MATRIX6_ARB 0x88C6
-#define GL_MATRIX7_ARB 0x88C7
-#define GL_MATRIX8_ARB 0x88C8
-#define GL_MATRIX9_ARB 0x88C9
-#define GL_MATRIX10_ARB 0x88CA
-#define GL_MATRIX11_ARB 0x88CB
-#define GL_MATRIX12_ARB 0x88CC
-#define GL_MATRIX13_ARB 0x88CD
-#define GL_MATRIX14_ARB 0x88CE
-#define GL_MATRIX15_ARB 0x88CF
-#define GL_MATRIX16_ARB 0x88D0
-#define GL_MATRIX17_ARB 0x88D1
-#define GL_MATRIX18_ARB 0x88D2
-#define GL_MATRIX19_ARB 0x88D3
-#define GL_MATRIX20_ARB 0x88D4
-#define GL_MATRIX21_ARB 0x88D5
-#define GL_MATRIX22_ARB 0x88D6
-#define GL_MATRIX23_ARB 0x88D7
-#define GL_MATRIX24_ARB 0x88D8
-#define GL_MATRIX25_ARB 0x88D9
-#define GL_MATRIX26_ARB 0x88DA
-#define GL_MATRIX27_ARB 0x88DB
-#define GL_MATRIX28_ARB 0x88DC
-#define GL_MATRIX29_ARB 0x88DD
-#define GL_MATRIX30_ARB 0x88DE
-#define GL_MATRIX31_ARB 0x88DF
-#endif
-
-#ifndef GL_ARB_fragment_program
-#define GL_FRAGMENT_PROGRAM_ARB 0x8804
-#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805
-#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806
-#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807
-#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808
-#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809
-#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A
-#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B
-#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C
-#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D
-#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E
-#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F
-#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810
-#define GL_MAX_TEXTURE_COORDS_ARB 0x8871
-#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872
-#endif
-
-#ifndef GL_ARB_vertex_buffer_object
-#define GL_BUFFER_SIZE_ARB 0x8764
-#define GL_BUFFER_USAGE_ARB 0x8765
-#define GL_ARRAY_BUFFER_ARB 0x8892
-#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893
-#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894
-#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895
-#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896
-#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897
-#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898
-#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899
-#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A
-#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B
-#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C
-#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D
-#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E
-#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F
-#define GL_READ_ONLY_ARB 0x88B8
-#define GL_WRITE_ONLY_ARB 0x88B9
-#define GL_READ_WRITE_ARB 0x88BA
-#define GL_BUFFER_ACCESS_ARB 0x88BB
-#define GL_BUFFER_MAPPED_ARB 0x88BC
-#define GL_BUFFER_MAP_POINTER_ARB 0x88BD
-#define GL_STREAM_DRAW_ARB 0x88E0
-#define GL_STREAM_READ_ARB 0x88E1
-#define GL_STREAM_COPY_ARB 0x88E2
-#define GL_STATIC_DRAW_ARB 0x88E4
-#define GL_STATIC_READ_ARB 0x88E5
-#define GL_STATIC_COPY_ARB 0x88E6
-#define GL_DYNAMIC_DRAW_ARB 0x88E8
-#define GL_DYNAMIC_READ_ARB 0x88E9
-#define GL_DYNAMIC_COPY_ARB 0x88EA
-#endif
-
-#ifndef GL_ARB_occlusion_query
-#define GL_QUERY_COUNTER_BITS_ARB 0x8864
-#define GL_CURRENT_QUERY_ARB 0x8865
-#define GL_QUERY_RESULT_ARB 0x8866
-#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867
-#define GL_SAMPLES_PASSED_ARB 0x8914
-#endif
-
-#ifndef GL_ARB_shader_objects
-#define GL_PROGRAM_OBJECT_ARB 0x8B40
-#define GL_SHADER_OBJECT_ARB 0x8B48
-#define GL_OBJECT_TYPE_ARB 0x8B4E
-#define GL_OBJECT_SUBTYPE_ARB 0x8B4F
-#define GL_FLOAT_VEC2_ARB 0x8B50
-#define GL_FLOAT_VEC3_ARB 0x8B51
-#define GL_FLOAT_VEC4_ARB 0x8B52
-#define GL_INT_VEC2_ARB 0x8B53
-#define GL_INT_VEC3_ARB 0x8B54
-#define GL_INT_VEC4_ARB 0x8B55
-#define GL_BOOL_ARB 0x8B56
-#define GL_BOOL_VEC2_ARB 0x8B57
-#define GL_BOOL_VEC3_ARB 0x8B58
-#define GL_BOOL_VEC4_ARB 0x8B59
-#define GL_FLOAT_MAT2_ARB 0x8B5A
-#define GL_FLOAT_MAT3_ARB 0x8B5B
-#define GL_FLOAT_MAT4_ARB 0x8B5C
-#define GL_SAMPLER_1D_ARB 0x8B5D
-#define GL_SAMPLER_2D_ARB 0x8B5E
-#define GL_SAMPLER_3D_ARB 0x8B5F
-#define GL_SAMPLER_CUBE_ARB 0x8B60
-#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61
-#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62
-#define GL_SAMPLER_2D_RECT_ARB 0x8B63
-#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64
-#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80
-#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81
-#define GL_OBJECT_LINK_STATUS_ARB 0x8B82
-#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83
-#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84
-#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85
-#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86
-#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87
-#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88
-#endif
-
-#ifndef GL_ARB_vertex_shader
-#define GL_VERTEX_SHADER_ARB 0x8B31
-#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A
-#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B
-#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C
-#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D
-#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89
-#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A
-#endif
-
-#ifndef GL_ARB_fragment_shader
-#define GL_FRAGMENT_SHADER_ARB 0x8B30
-#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49
-#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B
-#endif
-
-#ifndef GL_ARB_shading_language_100
-#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C
-#endif
-
-#ifndef GL_ARB_texture_non_power_of_two
-#endif
-
-#ifndef GL_ARB_point_sprite
-#define GL_POINT_SPRITE_ARB 0x8861
-#define GL_COORD_REPLACE_ARB 0x8862
-#endif
-
-#ifndef GL_ARB_fragment_program_shadow
-#endif
-
-#ifndef GL_ARB_draw_buffers
-#define GL_MAX_DRAW_BUFFERS_ARB 0x8824
-#define GL_DRAW_BUFFER0_ARB 0x8825
-#define GL_DRAW_BUFFER1_ARB 0x8826
-#define GL_DRAW_BUFFER2_ARB 0x8827
-#define GL_DRAW_BUFFER3_ARB 0x8828
-#define GL_DRAW_BUFFER4_ARB 0x8829
-#define GL_DRAW_BUFFER5_ARB 0x882A
-#define GL_DRAW_BUFFER6_ARB 0x882B
-#define GL_DRAW_BUFFER7_ARB 0x882C
-#define GL_DRAW_BUFFER8_ARB 0x882D
-#define GL_DRAW_BUFFER9_ARB 0x882E
-#define GL_DRAW_BUFFER10_ARB 0x882F
-#define GL_DRAW_BUFFER11_ARB 0x8830
-#define GL_DRAW_BUFFER12_ARB 0x8831
-#define GL_DRAW_BUFFER13_ARB 0x8832
-#define GL_DRAW_BUFFER14_ARB 0x8833
-#define GL_DRAW_BUFFER15_ARB 0x8834
-#endif
-
-#ifndef GL_ARB_texture_rectangle
-#define GL_TEXTURE_RECTANGLE_ARB 0x84F5
-#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6
-#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7
-#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8
-#endif
-
-#ifndef GL_ARB_color_buffer_float
-#define GL_RGBA_FLOAT_MODE_ARB 0x8820
-#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A
-#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B
-#define GL_CLAMP_READ_COLOR_ARB 0x891C
-#define GL_FIXED_ONLY_ARB 0x891D
-#endif
-
-#ifndef GL_ARB_half_float_pixel
-#define GL_HALF_FLOAT_ARB 0x140B
-#endif
-
-#ifndef GL_ARB_texture_float
-#define GL_TEXTURE_RED_TYPE_ARB 0x8C10
-#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11
-#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12
-#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13
-#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14
-#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15
-#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16
-#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17
-#define GL_RGBA32F_ARB 0x8814
-#define GL_RGB32F_ARB 0x8815
-#define GL_ALPHA32F_ARB 0x8816
-#define GL_INTENSITY32F_ARB 0x8817
-#define GL_LUMINANCE32F_ARB 0x8818
-#define GL_LUMINANCE_ALPHA32F_ARB 0x8819
-#define GL_RGBA16F_ARB 0x881A
-#define GL_RGB16F_ARB 0x881B
-#define GL_ALPHA16F_ARB 0x881C
-#define GL_INTENSITY16F_ARB 0x881D
-#define GL_LUMINANCE16F_ARB 0x881E
-#define GL_LUMINANCE_ALPHA16F_ARB 0x881F
-#endif
-
-#ifndef GL_ARB_pixel_buffer_object
-#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB
-#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC
-#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED
-#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF
-#endif
-
-#ifndef GL_EXT_abgr
-#define GL_ABGR_EXT 0x8000
-#endif
-
-#ifndef GL_EXT_blend_color
-#define GL_CONSTANT_COLOR_EXT 0x8001
-#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002
-#define GL_CONSTANT_ALPHA_EXT 0x8003
-#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004
-#define GL_BLEND_COLOR_EXT 0x8005
-#endif
-
-#ifndef GL_EXT_polygon_offset
-#define GL_POLYGON_OFFSET_EXT 0x8037
-#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038
-#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039
-#endif
-
-#ifndef GL_EXT_texture
-#define GL_ALPHA4_EXT 0x803B
-#define GL_ALPHA8_EXT 0x803C
-#define GL_ALPHA12_EXT 0x803D
-#define GL_ALPHA16_EXT 0x803E
-#define GL_LUMINANCE4_EXT 0x803F
-#define GL_LUMINANCE8_EXT 0x8040
-#define GL_LUMINANCE12_EXT 0x8041
-#define GL_LUMINANCE16_EXT 0x8042
-#define GL_LUMINANCE4_ALPHA4_EXT 0x8043
-#define GL_LUMINANCE6_ALPHA2_EXT 0x8044
-#define GL_LUMINANCE8_ALPHA8_EXT 0x8045
-#define GL_LUMINANCE12_ALPHA4_EXT 0x8046
-#define GL_LUMINANCE12_ALPHA12_EXT 0x8047
-#define GL_LUMINANCE16_ALPHA16_EXT 0x8048
-#define GL_INTENSITY_EXT 0x8049
-#define GL_INTENSITY4_EXT 0x804A
-#define GL_INTENSITY8_EXT 0x804B
-#define GL_INTENSITY12_EXT 0x804C
-#define GL_INTENSITY16_EXT 0x804D
-#define GL_RGB2_EXT 0x804E
-#define GL_RGB4_EXT 0x804F
-#define GL_RGB5_EXT 0x8050
-#define GL_RGB8_EXT 0x8051
-#define GL_RGB10_EXT 0x8052
-#define GL_RGB12_EXT 0x8053
-#define GL_RGB16_EXT 0x8054
-#define GL_RGBA2_EXT 0x8055
-#define GL_RGBA4_EXT 0x8056
-#define GL_RGB5_A1_EXT 0x8057
-#define GL_RGBA8_EXT 0x8058
-#define GL_RGB10_A2_EXT 0x8059
-#define GL_RGBA12_EXT 0x805A
-#define GL_RGBA16_EXT 0x805B
-#define GL_TEXTURE_RED_SIZE_EXT 0x805C
-#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D
-#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E
-#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F
-#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060
-#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061
-#define GL_REPLACE_EXT 0x8062
-#define GL_PROXY_TEXTURE_1D_EXT 0x8063
-#define GL_PROXY_TEXTURE_2D_EXT 0x8064
-#define GL_TEXTURE_TOO_LARGE_EXT 0x8065
-#endif
-
-#ifndef GL_EXT_texture3D
-#define GL_PACK_SKIP_IMAGES_EXT 0x806B
-#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C
-#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D
-#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E
-#define GL_TEXTURE_3D_EXT 0x806F
-#define GL_PROXY_TEXTURE_3D_EXT 0x8070
-#define GL_TEXTURE_DEPTH_EXT 0x8071
-#define GL_TEXTURE_WRAP_R_EXT 0x8072
-#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073
-#endif
-
-#ifndef GL_SGIS_texture_filter4
-#define GL_FILTER4_SGIS 0x8146
-#define GL_TEXTURE_FILTER4_SIZE_SGIS 0x8147
-#endif
-
-#ifndef GL_EXT_subtexture
-#endif
-
-#ifndef GL_EXT_copy_texture
-#endif
-
-#ifndef GL_EXT_histogram
-#define GL_HISTOGRAM_EXT 0x8024
-#define GL_PROXY_HISTOGRAM_EXT 0x8025
-#define GL_HISTOGRAM_WIDTH_EXT 0x8026
-#define GL_HISTOGRAM_FORMAT_EXT 0x8027
-#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028
-#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029
-#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A
-#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B
-#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C
-#define GL_HISTOGRAM_SINK_EXT 0x802D
-#define GL_MINMAX_EXT 0x802E
-#define GL_MINMAX_FORMAT_EXT 0x802F
-#define GL_MINMAX_SINK_EXT 0x8030
-#define GL_TABLE_TOO_LARGE_EXT 0x8031
-#endif
-
-#ifndef GL_EXT_convolution
-#define GL_CONVOLUTION_1D_EXT 0x8010
-#define GL_CONVOLUTION_2D_EXT 0x8011
-#define GL_SEPARABLE_2D_EXT 0x8012
-#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013
-#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014
-#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015
-#define GL_REDUCE_EXT 0x8016
-#define GL_CONVOLUTION_FORMAT_EXT 0x8017
-#define GL_CONVOLUTION_WIDTH_EXT 0x8018
-#define GL_CONVOLUTION_HEIGHT_EXT 0x8019
-#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A
-#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B
-#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C
-#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D
-#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E
-#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F
-#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020
-#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021
-#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022
-#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023
-#endif
-
-#ifndef GL_SGI_color_matrix
-#define GL_COLOR_MATRIX_SGI 0x80B1
-#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2
-#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3
-#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4
-#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5
-#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6
-#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7
-#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8
-#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9
-#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA
-#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB
-#endif
-
-#ifndef GL_SGI_color_table
-#define GL_COLOR_TABLE_SGI 0x80D0
-#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1
-#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2
-#define GL_PROXY_COLOR_TABLE_SGI 0x80D3
-#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4
-#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5
-#define GL_COLOR_TABLE_SCALE_SGI 0x80D6
-#define GL_COLOR_TABLE_BIAS_SGI 0x80D7
-#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8
-#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9
-#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA
-#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB
-#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC
-#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD
-#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE
-#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF
-#endif
-
-#ifndef GL_SGIS_pixel_texture
-#define GL_PIXEL_TEXTURE_SGIS 0x8353
-#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354
-#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355
-#define GL_PIXEL_GROUP_COLOR_SGIS 0x8356
-#endif
-
-#ifndef GL_SGIX_pixel_texture
-#define GL_PIXEL_TEX_GEN_SGIX 0x8139
-#define GL_PIXEL_TEX_GEN_MODE_SGIX 0x832B
-#endif
-
-#ifndef GL_SGIS_texture4D
-#define GL_PACK_SKIP_VOLUMES_SGIS 0x8130
-#define GL_PACK_IMAGE_DEPTH_SGIS 0x8131
-#define GL_UNPACK_SKIP_VOLUMES_SGIS 0x8132
-#define GL_UNPACK_IMAGE_DEPTH_SGIS 0x8133
-#define GL_TEXTURE_4D_SGIS 0x8134
-#define GL_PROXY_TEXTURE_4D_SGIS 0x8135
-#define GL_TEXTURE_4DSIZE_SGIS 0x8136
-#define GL_TEXTURE_WRAP_Q_SGIS 0x8137
-#define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138
-#define GL_TEXTURE_4D_BINDING_SGIS 0x814F
-#endif
-
-#ifndef GL_SGI_texture_color_table
-#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC
-#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD
-#endif
-
-#ifndef GL_EXT_cmyka
-#define GL_CMYK_EXT 0x800C
-#define GL_CMYKA_EXT 0x800D
-#define GL_PACK_CMYK_HINT_EXT 0x800E
-#define GL_UNPACK_CMYK_HINT_EXT 0x800F
-#endif
-
-#ifndef GL_EXT_texture_object
-#define GL_TEXTURE_PRIORITY_EXT 0x8066
-#define GL_TEXTURE_RESIDENT_EXT 0x8067
-#define GL_TEXTURE_1D_BINDING_EXT 0x8068
-#define GL_TEXTURE_2D_BINDING_EXT 0x8069
-#define GL_TEXTURE_3D_BINDING_EXT 0x806A
-#endif
-
-#ifndef GL_SGIS_detail_texture
-#define GL_DETAIL_TEXTURE_2D_SGIS 0x8095
-#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096
-#define GL_LINEAR_DETAIL_SGIS 0x8097
-#define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098
-#define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099
-#define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A
-#define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B
-#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C
-#endif
-
-#ifndef GL_SGIS_sharpen_texture
-#define GL_LINEAR_SHARPEN_SGIS 0x80AD
-#define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE
-#define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF
-#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0
-#endif
-
-#ifndef GL_EXT_packed_pixels
-#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032
-#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033
-#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034
-#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035
-#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036
-#endif
-
-#ifndef GL_SGIS_texture_lod
-#define GL_TEXTURE_MIN_LOD_SGIS 0x813A
-#define GL_TEXTURE_MAX_LOD_SGIS 0x813B
-#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C
-#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D
-#endif
-
-#ifndef GL_SGIS_multisample
-#define GL_MULTISAMPLE_SGIS 0x809D
-#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E
-#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F
-#define GL_SAMPLE_MASK_SGIS 0x80A0
-#define GL_1PASS_SGIS 0x80A1
-#define GL_2PASS_0_SGIS 0x80A2
-#define GL_2PASS_1_SGIS 0x80A3
-#define GL_4PASS_0_SGIS 0x80A4
-#define GL_4PASS_1_SGIS 0x80A5
-#define GL_4PASS_2_SGIS 0x80A6
-#define GL_4PASS_3_SGIS 0x80A7
-#define GL_SAMPLE_BUFFERS_SGIS 0x80A8
-#define GL_SAMPLES_SGIS 0x80A9
-#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA
-#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB
-#define GL_SAMPLE_PATTERN_SGIS 0x80AC
-#endif
-
-#ifndef GL_EXT_rescale_normal
-#define GL_RESCALE_NORMAL_EXT 0x803A
-#endif
-
-#ifndef GL_EXT_vertex_array
-#define GL_VERTEX_ARRAY_EXT 0x8074
-#define GL_NORMAL_ARRAY_EXT 0x8075
-#define GL_COLOR_ARRAY_EXT 0x8076
-#define GL_INDEX_ARRAY_EXT 0x8077
-#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078
-#define GL_EDGE_FLAG_ARRAY_EXT 0x8079
-#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A
-#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B
-#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C
-#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D
-#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E
-#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F
-#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080
-#define GL_COLOR_ARRAY_SIZE_EXT 0x8081
-#define GL_COLOR_ARRAY_TYPE_EXT 0x8082
-#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083
-#define GL_COLOR_ARRAY_COUNT_EXT 0x8084
-#define GL_INDEX_ARRAY_TYPE_EXT 0x8085
-#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086
-#define GL_INDEX_ARRAY_COUNT_EXT 0x8087
-#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088
-#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089
-#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A
-#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B
-#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C
-#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D
-#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E
-#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F
-#define GL_COLOR_ARRAY_POINTER_EXT 0x8090
-#define GL_INDEX_ARRAY_POINTER_EXT 0x8091
-#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092
-#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093
-#endif
-
-#ifndef GL_EXT_misc_attribute
-#endif
-
-#ifndef GL_SGIS_generate_mipmap
-#define GL_GENERATE_MIPMAP_SGIS 0x8191
-#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192
-#endif
-
-#ifndef GL_SGIX_clipmap
-#define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170
-#define GL_TEXTURE_CLIPMAP_CENTER_SGIX 0x8171
-#define GL_TEXTURE_CLIPMAP_FRAME_SGIX 0x8172
-#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX 0x8173
-#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174
-#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175
-#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX 0x8176
-#define GL_MAX_CLIPMAP_DEPTH_SGIX 0x8177
-#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178
-#define GL_NEAREST_CLIPMAP_NEAREST_SGIX 0x844D
-#define GL_NEAREST_CLIPMAP_LINEAR_SGIX 0x844E
-#define GL_LINEAR_CLIPMAP_NEAREST_SGIX 0x844F
-#endif
-
-#ifndef GL_SGIX_shadow
-#define GL_TEXTURE_COMPARE_SGIX 0x819A
-#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B
-#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C
-#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D
-#endif
-
-#ifndef GL_SGIS_texture_edge_clamp
-#define GL_CLAMP_TO_EDGE_SGIS 0x812F
-#endif
-
-#ifndef GL_SGIS_texture_border_clamp
-#define GL_CLAMP_TO_BORDER_SGIS 0x812D
-#endif
-
-#ifndef GL_EXT_blend_minmax
-#define GL_FUNC_ADD_EXT 0x8006
-#define GL_MIN_EXT 0x8007
-#define GL_MAX_EXT 0x8008
-#define GL_BLEND_EQUATION_EXT 0x8009
-#endif
-
-#ifndef GL_EXT_blend_subtract
-#define GL_FUNC_SUBTRACT_EXT 0x800A
-#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B
-#endif
-
-#ifndef GL_EXT_blend_logic_op
-#endif
-
-#ifndef GL_SGIX_interlace
-#define GL_INTERLACE_SGIX 0x8094
-#endif
-
-#ifndef GL_SGIX_pixel_tiles
-#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E
-#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F
-#define GL_PIXEL_TILE_WIDTH_SGIX 0x8140
-#define GL_PIXEL_TILE_HEIGHT_SGIX 0x8141
-#define GL_PIXEL_TILE_GRID_WIDTH_SGIX 0x8142
-#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX 0x8143
-#define GL_PIXEL_TILE_GRID_DEPTH_SGIX 0x8144
-#define GL_PIXEL_TILE_CACHE_SIZE_SGIX 0x8145
-#endif
-
-#ifndef GL_SGIS_texture_select
-#define GL_DUAL_ALPHA4_SGIS 0x8110
-#define GL_DUAL_ALPHA8_SGIS 0x8111
-#define GL_DUAL_ALPHA12_SGIS 0x8112
-#define GL_DUAL_ALPHA16_SGIS 0x8113
-#define GL_DUAL_LUMINANCE4_SGIS 0x8114
-#define GL_DUAL_LUMINANCE8_SGIS 0x8115
-#define GL_DUAL_LUMINANCE12_SGIS 0x8116
-#define GL_DUAL_LUMINANCE16_SGIS 0x8117
-#define GL_DUAL_INTENSITY4_SGIS 0x8118
-#define GL_DUAL_INTENSITY8_SGIS 0x8119
-#define GL_DUAL_INTENSITY12_SGIS 0x811A
-#define GL_DUAL_INTENSITY16_SGIS 0x811B
-#define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C
-#define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D
-#define GL_QUAD_ALPHA4_SGIS 0x811E
-#define GL_QUAD_ALPHA8_SGIS 0x811F
-#define GL_QUAD_LUMINANCE4_SGIS 0x8120
-#define GL_QUAD_LUMINANCE8_SGIS 0x8121
-#define GL_QUAD_INTENSITY4_SGIS 0x8122
-#define GL_QUAD_INTENSITY8_SGIS 0x8123
-#define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124
-#define GL_QUAD_TEXTURE_SELECT_SGIS 0x8125
-#endif
-
-#ifndef GL_SGIX_sprite
-#define GL_SPRITE_SGIX 0x8148
-#define GL_SPRITE_MODE_SGIX 0x8149
-#define GL_SPRITE_AXIS_SGIX 0x814A
-#define GL_SPRITE_TRANSLATION_SGIX 0x814B
-#define GL_SPRITE_AXIAL_SGIX 0x814C
-#define GL_SPRITE_OBJECT_ALIGNED_SGIX 0x814D
-#define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E
-#endif
-
-#ifndef GL_SGIX_texture_multi_buffer
-#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E
-#endif
-
-#ifndef GL_EXT_point_parameters
-#define GL_POINT_SIZE_MIN_EXT 0x8126
-#define GL_POINT_SIZE_MAX_EXT 0x8127
-#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128
-#define GL_DISTANCE_ATTENUATION_EXT 0x8129
-#endif
-
-#ifndef GL_SGIS_point_parameters
-#define GL_POINT_SIZE_MIN_SGIS 0x8126
-#define GL_POINT_SIZE_MAX_SGIS 0x8127
-#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128
-#define GL_DISTANCE_ATTENUATION_SGIS 0x8129
-#endif
-
-#ifndef GL_SGIX_instruments
-#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180
-#define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181
-#endif
-
-#ifndef GL_SGIX_texture_scale_bias
-#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179
-#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A
-#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B
-#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C
-#endif
-
-#ifndef GL_SGIX_framezoom
-#define GL_FRAMEZOOM_SGIX 0x818B
-#define GL_FRAMEZOOM_FACTOR_SGIX 0x818C
-#define GL_MAX_FRAMEZOOM_FACTOR_SGIX 0x818D
-#endif
-
-#ifndef GL_SGIX_tag_sample_buffer
-#endif
-
-#ifndef GL_FfdMaskSGIX
-#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x00000001
-#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x00000002
-#endif
-
-#ifndef GL_SGIX_polynomial_ffd
-#define GL_GEOMETRY_DEFORMATION_SGIX 0x8194
-#define GL_TEXTURE_DEFORMATION_SGIX 0x8195
-#define GL_DEFORMATIONS_MASK_SGIX 0x8196
-#define GL_MAX_DEFORMATION_ORDER_SGIX 0x8197
-#endif
-
-#ifndef GL_SGIX_reference_plane
-#define GL_REFERENCE_PLANE_SGIX 0x817D
-#define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E
-#endif
-
-#ifndef GL_SGIX_flush_raster
-#endif
-
-#ifndef GL_SGIX_depth_texture
-#define GL_DEPTH_COMPONENT16_SGIX 0x81A5
-#define GL_DEPTH_COMPONENT24_SGIX 0x81A6
-#define GL_DEPTH_COMPONENT32_SGIX 0x81A7
-#endif
-
-#ifndef GL_SGIS_fog_function
-#define GL_FOG_FUNC_SGIS 0x812A
-#define GL_FOG_FUNC_POINTS_SGIS 0x812B
-#define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C
-#endif
-
-#ifndef GL_SGIX_fog_offset
-#define GL_FOG_OFFSET_SGIX 0x8198
-#define GL_FOG_OFFSET_VALUE_SGIX 0x8199
-#endif
-
-#ifndef GL_HP_image_transform
-#define GL_IMAGE_SCALE_X_HP 0x8155
-#define GL_IMAGE_SCALE_Y_HP 0x8156
-#define GL_IMAGE_TRANSLATE_X_HP 0x8157
-#define GL_IMAGE_TRANSLATE_Y_HP 0x8158
-#define GL_IMAGE_ROTATE_ANGLE_HP 0x8159
-#define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A
-#define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B
-#define GL_IMAGE_MAG_FILTER_HP 0x815C
-#define GL_IMAGE_MIN_FILTER_HP 0x815D
-#define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E
-#define GL_CUBIC_HP 0x815F
-#define GL_AVERAGE_HP 0x8160
-#define GL_IMAGE_TRANSFORM_2D_HP 0x8161
-#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162
-#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163
-#endif
-
-#ifndef GL_HP_convolution_border_modes
-#define GL_IGNORE_BORDER_HP 0x8150
-#define GL_CONSTANT_BORDER_HP 0x8151
-#define GL_REPLICATE_BORDER_HP 0x8153
-#define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154
-#endif
-
-#ifndef GL_INGR_palette_buffer
-#endif
-
-#ifndef GL_SGIX_texture_add_env
-#define GL_TEXTURE_ENV_BIAS_SGIX 0x80BE
-#endif
-
-#ifndef GL_EXT_color_subtable
-#endif
-
-#ifndef GL_PGI_vertex_hints
-#define GL_VERTEX_DATA_HINT_PGI 0x1A22A
-#define GL_VERTEX_CONSISTENT_HINT_PGI 0x1A22B
-#define GL_MATERIAL_SIDE_HINT_PGI 0x1A22C
-#define GL_MAX_VERTEX_HINT_PGI 0x1A22D
-#define GL_COLOR3_BIT_PGI 0x00010000
-#define GL_COLOR4_BIT_PGI 0x00020000
-#define GL_EDGEFLAG_BIT_PGI 0x00040000
-#define GL_INDEX_BIT_PGI 0x00080000
-#define GL_MAT_AMBIENT_BIT_PGI 0x00100000
-#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000
-#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000
-#define GL_MAT_EMISSION_BIT_PGI 0x00800000
-#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000
-#define GL_MAT_SHININESS_BIT_PGI 0x02000000
-#define GL_MAT_SPECULAR_BIT_PGI 0x04000000
-#define GL_NORMAL_BIT_PGI 0x08000000
-#define GL_TEXCOORD1_BIT_PGI 0x10000000
-#define GL_TEXCOORD2_BIT_PGI 0x20000000
-#define GL_TEXCOORD3_BIT_PGI 0x40000000
-#define GL_TEXCOORD4_BIT_PGI 0x80000000
-#define GL_VERTEX23_BIT_PGI 0x00000004
-#define GL_VERTEX4_BIT_PGI 0x00000008
-#endif
-
-#ifndef GL_PGI_misc_hints
-#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 0x1A1F8
-#define GL_CONSERVE_MEMORY_HINT_PGI 0x1A1FD
-#define GL_RECLAIM_MEMORY_HINT_PGI 0x1A1FE
-#define GL_NATIVE_GRAPHICS_HANDLE_PGI 0x1A202
-#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203
-#define GL_NATIVE_GRAPHICS_END_HINT_PGI 0x1A204
-#define GL_ALWAYS_FAST_HINT_PGI 0x1A20C
-#define GL_ALWAYS_SOFT_HINT_PGI 0x1A20D
-#define GL_ALLOW_DRAW_OBJ_HINT_PGI 0x1A20E
-#define GL_ALLOW_DRAW_WIN_HINT_PGI 0x1A20F
-#define GL_ALLOW_DRAW_FRG_HINT_PGI 0x1A210
-#define GL_ALLOW_DRAW_MEM_HINT_PGI 0x1A211
-#define GL_STRICT_DEPTHFUNC_HINT_PGI 0x1A216
-#define GL_STRICT_LIGHTING_HINT_PGI 0x1A217
-#define GL_STRICT_SCISSOR_HINT_PGI 0x1A218
-#define GL_FULL_STIPPLE_HINT_PGI 0x1A219
-#define GL_CLIP_NEAR_HINT_PGI 0x1A220
-#define GL_CLIP_FAR_HINT_PGI 0x1A221
-#define GL_WIDE_LINE_HINT_PGI 0x1A222
-#define GL_BACK_NORMALS_HINT_PGI 0x1A223
-#endif
-
-#ifndef GL_EXT_paletted_texture
-#define GL_COLOR_INDEX1_EXT 0x80E2
-#define GL_COLOR_INDEX2_EXT 0x80E3
-#define GL_COLOR_INDEX4_EXT 0x80E4
-#define GL_COLOR_INDEX8_EXT 0x80E5
-#define GL_COLOR_INDEX12_EXT 0x80E6
-#define GL_COLOR_INDEX16_EXT 0x80E7
-#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED
-#endif
-
-#ifndef GL_EXT_clip_volume_hint
-#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0
-#endif
-
-#ifndef GL_SGIX_list_priority
-#define GL_LIST_PRIORITY_SGIX 0x8182
-#endif
-
-#ifndef GL_SGIX_ir_instrument1
-#define GL_IR_INSTRUMENT1_SGIX 0x817F
-#endif
-
-#ifndef GL_SGIX_calligraphic_fragment
-#define GL_CALLIGRAPHIC_FRAGMENT_SGIX 0x8183
-#endif
-
-#ifndef GL_SGIX_texture_lod_bias
-#define GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E
-#define GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F
-#define GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190
-#endif
-
-#ifndef GL_SGIX_shadow_ambient
-#define GL_SHADOW_AMBIENT_SGIX 0x80BF
-#endif
-
-#ifndef GL_EXT_index_texture
-#endif
-
-#ifndef GL_EXT_index_material
-#define GL_INDEX_MATERIAL_EXT 0x81B8
-#define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9
-#define GL_INDEX_MATERIAL_FACE_EXT 0x81BA
-#endif
-
-#ifndef GL_EXT_index_func
-#define GL_INDEX_TEST_EXT 0x81B5
-#define GL_INDEX_TEST_FUNC_EXT 0x81B6
-#define GL_INDEX_TEST_REF_EXT 0x81B7
-#endif
-
-#ifndef GL_EXT_index_array_formats
-#define GL_IUI_V2F_EXT 0x81AD
-#define GL_IUI_V3F_EXT 0x81AE
-#define GL_IUI_N3F_V2F_EXT 0x81AF
-#define GL_IUI_N3F_V3F_EXT 0x81B0
-#define GL_T2F_IUI_V2F_EXT 0x81B1
-#define GL_T2F_IUI_V3F_EXT 0x81B2
-#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3
-#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4
-#endif
-
-#ifndef GL_EXT_compiled_vertex_array
-#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8
-#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9
-#endif
-
-#ifndef GL_EXT_cull_vertex
-#define GL_CULL_VERTEX_EXT 0x81AA
-#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB
-#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC
-#endif
-
-#ifndef GL_SGIX_ycrcb
-#define GL_YCRCB_422_SGIX 0x81BB
-#define GL_YCRCB_444_SGIX 0x81BC
-#endif
-
-#ifndef GL_SGIX_fragment_lighting
-#define GL_FRAGMENT_LIGHTING_SGIX 0x8400
-#define GL_FRAGMENT_COLOR_MATERIAL_SGIX 0x8401
-#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402
-#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403
-#define GL_MAX_FRAGMENT_LIGHTS_SGIX 0x8404
-#define GL_MAX_ACTIVE_LIGHTS_SGIX 0x8405
-#define GL_CURRENT_RASTER_NORMAL_SGIX 0x8406
-#define GL_LIGHT_ENV_MODE_SGIX 0x8407
-#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408
-#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409
-#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A
-#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B
-#define GL_FRAGMENT_LIGHT0_SGIX 0x840C
-#define GL_FRAGMENT_LIGHT1_SGIX 0x840D
-#define GL_FRAGMENT_LIGHT2_SGIX 0x840E
-#define GL_FRAGMENT_LIGHT3_SGIX 0x840F
-#define GL_FRAGMENT_LIGHT4_SGIX 0x8410
-#define GL_FRAGMENT_LIGHT5_SGIX 0x8411
-#define GL_FRAGMENT_LIGHT6_SGIX 0x8412
-#define GL_FRAGMENT_LIGHT7_SGIX 0x8413
-#endif
-
-#ifndef GL_IBM_rasterpos_clip
-#define GL_RASTER_POSITION_UNCLIPPED_IBM 0x19262
-#endif
-
-#ifndef GL_HP_texture_lighting
-#define GL_TEXTURE_LIGHTING_MODE_HP 0x8167
-#define GL_TEXTURE_POST_SPECULAR_HP 0x8168
-#define GL_TEXTURE_PRE_SPECULAR_HP 0x8169
-#endif
-
-#ifndef GL_EXT_draw_range_elements
-#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8
-#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9
-#endif
-
-#ifndef GL_WIN_phong_shading
-#define GL_PHONG_WIN 0x80EA
-#define GL_PHONG_HINT_WIN 0x80EB
-#endif
-
-#ifndef GL_WIN_specular_fog
-#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC
-#endif
-
-#ifndef GL_EXT_light_texture
-#define GL_FRAGMENT_MATERIAL_EXT 0x8349
-#define GL_FRAGMENT_NORMAL_EXT 0x834A
-#define GL_FRAGMENT_COLOR_EXT 0x834C
-#define GL_ATTENUATION_EXT 0x834D
-#define GL_SHADOW_ATTENUATION_EXT 0x834E
-#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F
-#define GL_TEXTURE_LIGHT_EXT 0x8350
-#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351
-#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352
-/* reuse GL_FRAGMENT_DEPTH_EXT */
-#endif
-
-#ifndef GL_SGIX_blend_alpha_minmax
-#define GL_ALPHA_MIN_SGIX 0x8320
-#define GL_ALPHA_MAX_SGIX 0x8321
-#endif
-
-#ifndef GL_SGIX_impact_pixel_texture
-#define GL_PIXEL_TEX_GEN_Q_CEILING_SGIX 0x8184
-#define GL_PIXEL_TEX_GEN_Q_ROUND_SGIX 0x8185
-#define GL_PIXEL_TEX_GEN_Q_FLOOR_SGIX 0x8186
-#define GL_PIXEL_TEX_GEN_ALPHA_REPLACE_SGIX 0x8187
-#define GL_PIXEL_TEX_GEN_ALPHA_NO_REPLACE_SGIX 0x8188
-#define GL_PIXEL_TEX_GEN_ALPHA_LS_SGIX 0x8189
-#define GL_PIXEL_TEX_GEN_ALPHA_MS_SGIX 0x818A
-#endif
-
-#ifndef GL_EXT_bgra
-#define GL_BGR_EXT 0x80E0
-#define GL_BGRA_EXT 0x80E1
-#endif
-
-#ifndef GL_SGIX_async
-#define GL_ASYNC_MARKER_SGIX 0x8329
-#endif
-
-#ifndef GL_SGIX_async_pixel
-#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C
-#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D
-#define GL_ASYNC_READ_PIXELS_SGIX 0x835E
-#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F
-#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360
-#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361
-#endif
-
-#ifndef GL_SGIX_async_histogram
-#define GL_ASYNC_HISTOGRAM_SGIX 0x832C
-#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D
-#endif
-
-#ifndef GL_INTEL_texture_scissor
-#endif
-
-#ifndef GL_INTEL_parallel_arrays
-#define GL_PARALLEL_ARRAYS_INTEL 0x83F4
-#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5
-#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6
-#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7
-#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8
-#endif
-
-#ifndef GL_HP_occlusion_test
-#define GL_OCCLUSION_TEST_HP 0x8165
-#define GL_OCCLUSION_TEST_RESULT_HP 0x8166
-#endif
-
-#ifndef GL_EXT_pixel_transform
-#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330
-#define GL_PIXEL_MAG_FILTER_EXT 0x8331
-#define GL_PIXEL_MIN_FILTER_EXT 0x8332
-#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333
-#define GL_CUBIC_EXT 0x8334
-#define GL_AVERAGE_EXT 0x8335
-#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336
-#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337
-#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338
-#endif
-
-#ifndef GL_EXT_pixel_transform_color_table
-#endif
-
-#ifndef GL_EXT_shared_texture_palette
-#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB
-#endif
-
-#ifndef GL_EXT_separate_specular_color
-#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8
-#define GL_SINGLE_COLOR_EXT 0x81F9
-#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA
-#endif
-
-#ifndef GL_EXT_secondary_color
-#define GL_COLOR_SUM_EXT 0x8458
-#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459
-#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A
-#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B
-#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C
-#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D
-#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E
-#endif
-
-#ifndef GL_EXT_texture_perturb_normal
-#define GL_PERTURB_EXT 0x85AE
-#define GL_TEXTURE_NORMAL_EXT 0x85AF
-#endif
-
-#ifndef GL_EXT_multi_draw_arrays
-#endif
-
-#ifndef GL_EXT_fog_coord
-#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450
-#define GL_FOG_COORDINATE_EXT 0x8451
-#define GL_FRAGMENT_DEPTH_EXT 0x8452
-#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453
-#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454
-#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455
-#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456
-#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457
-#endif
-
-#ifndef GL_REND_screen_coordinates
-#define GL_SCREEN_COORDINATES_REND 0x8490
-#define GL_INVERTED_SCREEN_W_REND 0x8491
-#endif
-
-#ifndef GL_EXT_coordinate_frame
-#define GL_TANGENT_ARRAY_EXT 0x8439
-#define GL_BINORMAL_ARRAY_EXT 0x843A
-#define GL_CURRENT_TANGENT_EXT 0x843B
-#define GL_CURRENT_BINORMAL_EXT 0x843C
-#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E
-#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F
-#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440
-#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441
-#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442
-#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443
-#define GL_MAP1_TANGENT_EXT 0x8444
-#define GL_MAP2_TANGENT_EXT 0x8445
-#define GL_MAP1_BINORMAL_EXT 0x8446
-#define GL_MAP2_BINORMAL_EXT 0x8447
-#endif
-
-#ifndef GL_EXT_texture_env_combine
-#define GL_COMBINE_EXT 0x8570
-#define GL_COMBINE_RGB_EXT 0x8571
-#define GL_COMBINE_ALPHA_EXT 0x8572
-#define GL_RGB_SCALE_EXT 0x8573
-#define GL_ADD_SIGNED_EXT 0x8574
-#define GL_INTERPOLATE_EXT 0x8575
-#define GL_CONSTANT_EXT 0x8576
-#define GL_PRIMARY_COLOR_EXT 0x8577
-#define GL_PREVIOUS_EXT 0x8578
-#define GL_SOURCE0_RGB_EXT 0x8580
-#define GL_SOURCE1_RGB_EXT 0x8581
-#define GL_SOURCE2_RGB_EXT 0x8582
-#define GL_SOURCE0_ALPHA_EXT 0x8588
-#define GL_SOURCE1_ALPHA_EXT 0x8589
-#define GL_SOURCE2_ALPHA_EXT 0x858A
-#define GL_OPERAND0_RGB_EXT 0x8590
-#define GL_OPERAND1_RGB_EXT 0x8591
-#define GL_OPERAND2_RGB_EXT 0x8592
-#define GL_OPERAND0_ALPHA_EXT 0x8598
-#define GL_OPERAND1_ALPHA_EXT 0x8599
-#define GL_OPERAND2_ALPHA_EXT 0x859A
-#endif
-
-#ifndef GL_APPLE_specular_vector
-#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0
-#endif
-
-#ifndef GL_APPLE_transform_hint
-#define GL_TRANSFORM_HINT_APPLE 0x85B1
-#endif
-
-#ifndef GL_SGIX_fog_scale
-#define GL_FOG_SCALE_SGIX 0x81FC
-#define GL_FOG_SCALE_VALUE_SGIX 0x81FD
-#endif
-
-#ifndef GL_SUNX_constant_data
-#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5
-#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6
-#endif
-
-#ifndef GL_SUN_global_alpha
-#define GL_GLOBAL_ALPHA_SUN 0x81D9
-#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA
-#endif
-
-#ifndef GL_SUN_triangle_list
-#define GL_RESTART_SUN 0x0001
-#define GL_REPLACE_MIDDLE_SUN 0x0002
-#define GL_REPLACE_OLDEST_SUN 0x0003
-#define GL_TRIANGLE_LIST_SUN 0x81D7
-#define GL_REPLACEMENT_CODE_SUN 0x81D8
-#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0
-#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1
-#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2
-#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3
-#define GL_R1UI_V3F_SUN 0x85C4
-#define GL_R1UI_C4UB_V3F_SUN 0x85C5
-#define GL_R1UI_C3F_V3F_SUN 0x85C6
-#define GL_R1UI_N3F_V3F_SUN 0x85C7
-#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8
-#define GL_R1UI_T2F_V3F_SUN 0x85C9
-#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA
-#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB
-#endif
-
-#ifndef GL_SUN_vertex
-#endif
-
-#ifndef GL_EXT_blend_func_separate
-#define GL_BLEND_DST_RGB_EXT 0x80C8
-#define GL_BLEND_SRC_RGB_EXT 0x80C9
-#define GL_BLEND_DST_ALPHA_EXT 0x80CA
-#define GL_BLEND_SRC_ALPHA_EXT 0x80CB
-#endif
-
-#ifndef GL_INGR_color_clamp
-#define GL_RED_MIN_CLAMP_INGR 0x8560
-#define GL_GREEN_MIN_CLAMP_INGR 0x8561
-#define GL_BLUE_MIN_CLAMP_INGR 0x8562
-#define GL_ALPHA_MIN_CLAMP_INGR 0x8563
-#define GL_RED_MAX_CLAMP_INGR 0x8564
-#define GL_GREEN_MAX_CLAMP_INGR 0x8565
-#define GL_BLUE_MAX_CLAMP_INGR 0x8566
-#define GL_ALPHA_MAX_CLAMP_INGR 0x8567
-#endif
-
-#ifndef GL_INGR_interlace_read
-#define GL_INTERLACE_READ_INGR 0x8568
-#endif
-
-#ifndef GL_EXT_stencil_wrap
-#define GL_INCR_WRAP_EXT 0x8507
-#define GL_DECR_WRAP_EXT 0x8508
-#endif
-
-#ifndef GL_EXT_422_pixels
-#define GL_422_EXT 0x80CC
-#define GL_422_REV_EXT 0x80CD
-#define GL_422_AVERAGE_EXT 0x80CE
-#define GL_422_REV_AVERAGE_EXT 0x80CF
-#endif
-
-#ifndef GL_NV_texgen_reflection
-#define GL_NORMAL_MAP_NV 0x8511
-#define GL_REFLECTION_MAP_NV 0x8512
-#endif
-
-#ifndef GL_EXT_texture_cube_map
-#define GL_NORMAL_MAP_EXT 0x8511
-#define GL_REFLECTION_MAP_EXT 0x8512
-#define GL_TEXTURE_CUBE_MAP_EXT 0x8513
-#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A
-#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B
-#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C
-#endif
-
-#ifndef GL_SUN_convolution_border_modes
-#define GL_WRAP_BORDER_SUN 0x81D4
-#endif
-
-#ifndef GL_EXT_texture_env_add
-#endif
-
-#ifndef GL_EXT_texture_lod_bias
-#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD
-#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500
-#define GL_TEXTURE_LOD_BIAS_EXT 0x8501
-#endif
-
-#ifndef GL_EXT_texture_filter_anisotropic
-#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
-#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
-#endif
-
-#ifndef GL_EXT_vertex_weighting
-#define GL_MODELVIEW0_STACK_DEPTH_EXT GL_MODELVIEW_STACK_DEPTH
-#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502
-#define GL_MODELVIEW0_MATRIX_EXT GL_MODELVIEW_MATRIX
-#define GL_MODELVIEW1_MATRIX_EXT 0x8506
-#define GL_VERTEX_WEIGHTING_EXT 0x8509
-#define GL_MODELVIEW0_EXT GL_MODELVIEW
-#define GL_MODELVIEW1_EXT 0x850A
-#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B
-#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C
-#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D
-#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E
-#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F
-#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510
-#endif
-
-#ifndef GL_NV_light_max_exponent
-#define GL_MAX_SHININESS_NV 0x8504
-#define GL_MAX_SPOT_EXPONENT_NV 0x8505
-#endif
-
-#ifndef GL_NV_vertex_array_range
-#define GL_VERTEX_ARRAY_RANGE_NV 0x851D
-#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E
-#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F
-#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520
-#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521
-#endif
-
-#ifndef GL_NV_register_combiners
-#define GL_REGISTER_COMBINERS_NV 0x8522
-#define GL_VARIABLE_A_NV 0x8523
-#define GL_VARIABLE_B_NV 0x8524
-#define GL_VARIABLE_C_NV 0x8525
-#define GL_VARIABLE_D_NV 0x8526
-#define GL_VARIABLE_E_NV 0x8527
-#define GL_VARIABLE_F_NV 0x8528
-#define GL_VARIABLE_G_NV 0x8529
-#define GL_CONSTANT_COLOR0_NV 0x852A
-#define GL_CONSTANT_COLOR1_NV 0x852B
-#define GL_PRIMARY_COLOR_NV 0x852C
-#define GL_SECONDARY_COLOR_NV 0x852D
-#define GL_SPARE0_NV 0x852E
-#define GL_SPARE1_NV 0x852F
-#define GL_DISCARD_NV 0x8530
-#define GL_E_TIMES_F_NV 0x8531
-#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532
-#define GL_UNSIGNED_IDENTITY_NV 0x8536
-#define GL_UNSIGNED_INVERT_NV 0x8537
-#define GL_EXPAND_NORMAL_NV 0x8538
-#define GL_EXPAND_NEGATE_NV 0x8539
-#define GL_HALF_BIAS_NORMAL_NV 0x853A
-#define GL_HALF_BIAS_NEGATE_NV 0x853B
-#define GL_SIGNED_IDENTITY_NV 0x853C
-#define GL_SIGNED_NEGATE_NV 0x853D
-#define GL_SCALE_BY_TWO_NV 0x853E
-#define GL_SCALE_BY_FOUR_NV 0x853F
-#define GL_SCALE_BY_ONE_HALF_NV 0x8540
-#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541
-#define GL_COMBINER_INPUT_NV 0x8542
-#define GL_COMBINER_MAPPING_NV 0x8543
-#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544
-#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545
-#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546
-#define GL_COMBINER_MUX_SUM_NV 0x8547
-#define GL_COMBINER_SCALE_NV 0x8548
-#define GL_COMBINER_BIAS_NV 0x8549
-#define GL_COMBINER_AB_OUTPUT_NV 0x854A
-#define GL_COMBINER_CD_OUTPUT_NV 0x854B
-#define GL_COMBINER_SUM_OUTPUT_NV 0x854C
-#define GL_MAX_GENERAL_COMBINERS_NV 0x854D
-#define GL_NUM_GENERAL_COMBINERS_NV 0x854E
-#define GL_COLOR_SUM_CLAMP_NV 0x854F
-#define GL_COMBINER0_NV 0x8550
-#define GL_COMBINER1_NV 0x8551
-#define GL_COMBINER2_NV 0x8552
-#define GL_COMBINER3_NV 0x8553
-#define GL_COMBINER4_NV 0x8554
-#define GL_COMBINER5_NV 0x8555
-#define GL_COMBINER6_NV 0x8556
-#define GL_COMBINER7_NV 0x8557
-/* reuse GL_TEXTURE0_ARB */
-/* reuse GL_TEXTURE1_ARB */
-/* reuse GL_ZERO */
-/* reuse GL_NONE */
-/* reuse GL_FOG */
-#endif
-
-#ifndef GL_NV_fog_distance
-#define GL_FOG_DISTANCE_MODE_NV 0x855A
-#define GL_EYE_RADIAL_NV 0x855B
-#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C
-/* reuse GL_EYE_PLANE */
-#endif
-
-#ifndef GL_NV_texgen_emboss
-#define GL_EMBOSS_LIGHT_NV 0x855D
-#define GL_EMBOSS_CONSTANT_NV 0x855E
-#define GL_EMBOSS_MAP_NV 0x855F
-#endif
-
-#ifndef GL_NV_blend_square
-#endif
-
-#ifndef GL_NV_texture_env_combine4
-#define GL_COMBINE4_NV 0x8503
-#define GL_SOURCE3_RGB_NV 0x8583
-#define GL_SOURCE3_ALPHA_NV 0x858B
-#define GL_OPERAND3_RGB_NV 0x8593
-#define GL_OPERAND3_ALPHA_NV 0x859B
-#endif
-
-#ifndef GL_MESA_resize_buffers
-#endif
-
-#ifndef GL_MESA_window_pos
-#endif
-
-#ifndef GL_EXT_texture_compression_s3tc
-#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
-#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
-#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2
-#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3
-#endif
-
-#ifndef GL_IBM_cull_vertex
-#define GL_CULL_VERTEX_IBM 103050
-#endif
-
-#ifndef GL_IBM_multimode_draw_arrays
-#endif
-
-#ifndef GL_IBM_vertex_array_lists
-#define GL_VERTEX_ARRAY_LIST_IBM 103070
-#define GL_NORMAL_ARRAY_LIST_IBM 103071
-#define GL_COLOR_ARRAY_LIST_IBM 103072
-#define GL_INDEX_ARRAY_LIST_IBM 103073
-#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074
-#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075
-#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076
-#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077
-#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080
-#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081
-#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082
-#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083
-#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084
-#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085
-#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086
-#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087
-#endif
-
-#ifndef GL_SGIX_subsample
-#define GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0
-#define GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1
-#define GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2
-#define GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3
-#define GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4
-#endif
-
-#ifndef GL_SGIX_ycrcb_subsample
-#endif
-
-#ifndef GL_SGIX_ycrcba
-#define GL_YCRCB_SGIX 0x8318
-#define GL_YCRCBA_SGIX 0x8319
-#endif
-
-#ifndef GL_SGI_depth_pass_instrument
-#define GL_DEPTH_PASS_INSTRUMENT_SGIX 0x8310
-#define GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX 0x8311
-#define GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX 0x8312
-#endif
-
-#ifndef GL_3DFX_texture_compression_FXT1
-#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0
-#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1
-#endif
-
-#ifndef GL_3DFX_multisample
-#define GL_MULTISAMPLE_3DFX 0x86B2
-#define GL_SAMPLE_BUFFERS_3DFX 0x86B3
-#define GL_SAMPLES_3DFX 0x86B4
-#define GL_MULTISAMPLE_BIT_3DFX 0x20000000
-#endif
-
-#ifndef GL_3DFX_tbuffer
-#endif
-
-#ifndef GL_EXT_multisample
-#define GL_MULTISAMPLE_EXT 0x809D
-#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E
-#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F
-#define GL_SAMPLE_MASK_EXT 0x80A0
-#define GL_1PASS_EXT 0x80A1
-#define GL_2PASS_0_EXT 0x80A2
-#define GL_2PASS_1_EXT 0x80A3
-#define GL_4PASS_0_EXT 0x80A4
-#define GL_4PASS_1_EXT 0x80A5
-#define GL_4PASS_2_EXT 0x80A6
-#define GL_4PASS_3_EXT 0x80A7
-#define GL_SAMPLE_BUFFERS_EXT 0x80A8
-#define GL_SAMPLES_EXT 0x80A9
-#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA
-#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB
-#define GL_SAMPLE_PATTERN_EXT 0x80AC
-#define GL_MULTISAMPLE_BIT_EXT 0x20000000
-#endif
-
-#ifndef GL_SGIX_vertex_preclip
-#define GL_VERTEX_PRECLIP_SGIX 0x83EE
-#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF
-#endif
-
-#ifndef GL_SGIX_convolution_accuracy
-#define GL_CONVOLUTION_HINT_SGIX 0x8316
-#endif
-
-#ifndef GL_SGIX_resample
-#define GL_PACK_RESAMPLE_SGIX 0x842C
-#define GL_UNPACK_RESAMPLE_SGIX 0x842D
-#define GL_RESAMPLE_REPLICATE_SGIX 0x842E
-#define GL_RESAMPLE_ZERO_FILL_SGIX 0x842F
-#define GL_RESAMPLE_DECIMATE_SGIX 0x8430
-#endif
-
-#ifndef GL_SGIS_point_line_texgen
-#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0
-#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1
-#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2
-#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3
-#define GL_EYE_POINT_SGIS 0x81F4
-#define GL_OBJECT_POINT_SGIS 0x81F5
-#define GL_EYE_LINE_SGIS 0x81F6
-#define GL_OBJECT_LINE_SGIS 0x81F7
-#endif
-
-#ifndef GL_SGIS_texture_color_mask
-#define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF
-#endif
-
-#ifndef GL_EXT_texture_env_dot3
-#define GL_DOT3_RGB_EXT 0x8740
-#define GL_DOT3_RGBA_EXT 0x8741
-#endif
-
-#ifndef GL_ATI_texture_mirror_once
-#define GL_MIRROR_CLAMP_ATI 0x8742
-#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743
-#endif
-
-#ifndef GL_NV_fence
-#define GL_ALL_COMPLETED_NV 0x84F2
-#define GL_FENCE_STATUS_NV 0x84F3
-#define GL_FENCE_CONDITION_NV 0x84F4
-#endif
-
-#ifndef GL_IBM_texture_mirrored_repeat
-#define GL_MIRRORED_REPEAT_IBM 0x8370
-#endif
-
-#ifndef GL_NV_evaluators
-#define GL_EVAL_2D_NV 0x86C0
-#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1
-#define GL_MAP_TESSELLATION_NV 0x86C2
-#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3
-#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4
-#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5
-#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6
-#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7
-#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8
-#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9
-#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA
-#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB
-#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC
-#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD
-#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE
-#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF
-#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0
-#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1
-#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2
-#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3
-#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4
-#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5
-#define GL_MAX_MAP_TESSELLATION_NV 0x86D6
-#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7
-#endif
-
-#ifndef GL_NV_packed_depth_stencil
-#define GL_DEPTH_STENCIL_NV 0x84F9
-#define GL_UNSIGNED_INT_24_8_NV 0x84FA
-#endif
-
-#ifndef GL_NV_register_combiners2
-#define GL_PER_STAGE_CONSTANTS_NV 0x8535
-#endif
-
-#ifndef GL_NV_texture_compression_vtc
-#endif
-
-#ifndef GL_NV_texture_rectangle
-#define GL_TEXTURE_RECTANGLE_NV 0x84F5
-#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6
-#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7
-#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8
-#endif
-
-#ifndef GL_NV_texture_shader
-#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C
-#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D
-#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E
-#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9
-#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA
-#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB
-#define GL_DSDT_MAG_INTENSITY_NV 0x86DC
-#define GL_SHADER_CONSISTENT_NV 0x86DD
-#define GL_TEXTURE_SHADER_NV 0x86DE
-#define GL_SHADER_OPERATION_NV 0x86DF
-#define GL_CULL_MODES_NV 0x86E0
-#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1
-#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2
-#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3
-#define GL_OFFSET_TEXTURE_2D_MATRIX_NV GL_OFFSET_TEXTURE_MATRIX_NV
-#define GL_OFFSET_TEXTURE_2D_SCALE_NV GL_OFFSET_TEXTURE_SCALE_NV
-#define GL_OFFSET_TEXTURE_2D_BIAS_NV GL_OFFSET_TEXTURE_BIAS_NV
-#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4
-#define GL_CONST_EYE_NV 0x86E5
-#define GL_PASS_THROUGH_NV 0x86E6
-#define GL_CULL_FRAGMENT_NV 0x86E7
-#define GL_OFFSET_TEXTURE_2D_NV 0x86E8
-#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9
-#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA
-#define GL_DOT_PRODUCT_NV 0x86EC
-#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED
-#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE
-#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0
-#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1
-#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2
-#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3
-#define GL_HILO_NV 0x86F4
-#define GL_DSDT_NV 0x86F5
-#define GL_DSDT_MAG_NV 0x86F6
-#define GL_DSDT_MAG_VIB_NV 0x86F7
-#define GL_HILO16_NV 0x86F8
-#define GL_SIGNED_HILO_NV 0x86F9
-#define GL_SIGNED_HILO16_NV 0x86FA
-#define GL_SIGNED_RGBA_NV 0x86FB
-#define GL_SIGNED_RGBA8_NV 0x86FC
-#define GL_SIGNED_RGB_NV 0x86FE
-#define GL_SIGNED_RGB8_NV 0x86FF
-#define GL_SIGNED_LUMINANCE_NV 0x8701
-#define GL_SIGNED_LUMINANCE8_NV 0x8702
-#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703
-#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704
-#define GL_SIGNED_ALPHA_NV 0x8705
-#define GL_SIGNED_ALPHA8_NV 0x8706
-#define GL_SIGNED_INTENSITY_NV 0x8707
-#define GL_SIGNED_INTENSITY8_NV 0x8708
-#define GL_DSDT8_NV 0x8709
-#define GL_DSDT8_MAG8_NV 0x870A
-#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B
-#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C
-#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D
-#define GL_HI_SCALE_NV 0x870E
-#define GL_LO_SCALE_NV 0x870F
-#define GL_DS_SCALE_NV 0x8710
-#define GL_DT_SCALE_NV 0x8711
-#define GL_MAGNITUDE_SCALE_NV 0x8712
-#define GL_VIBRANCE_SCALE_NV 0x8713
-#define GL_HI_BIAS_NV 0x8714
-#define GL_LO_BIAS_NV 0x8715
-#define GL_DS_BIAS_NV 0x8716
-#define GL_DT_BIAS_NV 0x8717
-#define GL_MAGNITUDE_BIAS_NV 0x8718
-#define GL_VIBRANCE_BIAS_NV 0x8719
-#define GL_TEXTURE_BORDER_VALUES_NV 0x871A
-#define GL_TEXTURE_HI_SIZE_NV 0x871B
-#define GL_TEXTURE_LO_SIZE_NV 0x871C
-#define GL_TEXTURE_DS_SIZE_NV 0x871D
-#define GL_TEXTURE_DT_SIZE_NV 0x871E
-#define GL_TEXTURE_MAG_SIZE_NV 0x871F
-#endif
-
-#ifndef GL_NV_texture_shader2
-#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF
-#endif
-
-#ifndef GL_NV_vertex_array_range2
-#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533
-#endif
-
-#ifndef GL_NV_vertex_program
-#define GL_VERTEX_PROGRAM_NV 0x8620
-#define GL_VERTEX_STATE_PROGRAM_NV 0x8621
-#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623
-#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624
-#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625
-#define GL_CURRENT_ATTRIB_NV 0x8626
-#define GL_PROGRAM_LENGTH_NV 0x8627
-#define GL_PROGRAM_STRING_NV 0x8628
-#define GL_MODELVIEW_PROJECTION_NV 0x8629
-#define GL_IDENTITY_NV 0x862A
-#define GL_INVERSE_NV 0x862B
-#define GL_TRANSPOSE_NV 0x862C
-#define GL_INVERSE_TRANSPOSE_NV 0x862D
-#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E
-#define GL_MAX_TRACK_MATRICES_NV 0x862F
-#define GL_MATRIX0_NV 0x8630
-#define GL_MATRIX1_NV 0x8631
-#define GL_MATRIX2_NV 0x8632
-#define GL_MATRIX3_NV 0x8633
-#define GL_MATRIX4_NV 0x8634
-#define GL_MATRIX5_NV 0x8635
-#define GL_MATRIX6_NV 0x8636
-#define GL_MATRIX7_NV 0x8637
-#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640
-#define GL_CURRENT_MATRIX_NV 0x8641
-#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642
-#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643
-#define GL_PROGRAM_PARAMETER_NV 0x8644
-#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645
-#define GL_PROGRAM_TARGET_NV 0x8646
-#define GL_PROGRAM_RESIDENT_NV 0x8647
-#define GL_TRACK_MATRIX_NV 0x8648
-#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649
-#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A
-#define GL_PROGRAM_ERROR_POSITION_NV 0x864B
-#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650
-#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651
-#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652
-#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653
-#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654
-#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655
-#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656
-#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657
-#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658
-#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659
-#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A
-#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B
-#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C
-#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D
-#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E
-#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F
-#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660
-#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661
-#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662
-#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663
-#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664
-#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665
-#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666
-#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667
-#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668
-#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669
-#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A
-#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B
-#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C
-#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D
-#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E
-#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F
-#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670
-#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671
-#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672
-#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673
-#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674
-#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675
-#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676
-#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677
-#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678
-#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679
-#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A
-#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B
-#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C
-#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D
-#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E
-#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F
-#endif
-
-#ifndef GL_SGIX_texture_coordinate_clamp
-#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369
-#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A
-#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B
-#endif
-
-#ifndef GL_SGIX_scalebias_hint
-#define GL_SCALEBIAS_HINT_SGIX 0x8322
-#endif
-
-#ifndef GL_OML_interlace
-#define GL_INTERLACE_OML 0x8980
-#define GL_INTERLACE_READ_OML 0x8981
-#endif
-
-#ifndef GL_OML_subsample
-#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982
-#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983
-#endif
-
-#ifndef GL_OML_resample
-#define GL_PACK_RESAMPLE_OML 0x8984
-#define GL_UNPACK_RESAMPLE_OML 0x8985
-#define GL_RESAMPLE_REPLICATE_OML 0x8986
-#define GL_RESAMPLE_ZERO_FILL_OML 0x8987
-#define GL_RESAMPLE_AVERAGE_OML 0x8988
-#define GL_RESAMPLE_DECIMATE_OML 0x8989
-#endif
-
-#ifndef GL_NV_copy_depth_to_color
-#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E
-#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F
-#endif
-
-#ifndef GL_ATI_envmap_bumpmap
-#define GL_BUMP_ROT_MATRIX_ATI 0x8775
-#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776
-#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777
-#define GL_BUMP_TEX_UNITS_ATI 0x8778
-#define GL_DUDV_ATI 0x8779
-#define GL_DU8DV8_ATI 0x877A
-#define GL_BUMP_ENVMAP_ATI 0x877B
-#define GL_BUMP_TARGET_ATI 0x877C
-#endif
-
-#ifndef GL_ATI_fragment_shader
-#define GL_FRAGMENT_SHADER_ATI 0x8920
-#define GL_REG_0_ATI 0x8921
-#define GL_REG_1_ATI 0x8922
-#define GL_REG_2_ATI 0x8923
-#define GL_REG_3_ATI 0x8924
-#define GL_REG_4_ATI 0x8925
-#define GL_REG_5_ATI 0x8926
-#define GL_REG_6_ATI 0x8927
-#define GL_REG_7_ATI 0x8928
-#define GL_REG_8_ATI 0x8929
-#define GL_REG_9_ATI 0x892A
-#define GL_REG_10_ATI 0x892B
-#define GL_REG_11_ATI 0x892C
-#define GL_REG_12_ATI 0x892D
-#define GL_REG_13_ATI 0x892E
-#define GL_REG_14_ATI 0x892F
-#define GL_REG_15_ATI 0x8930
-#define GL_REG_16_ATI 0x8931
-#define GL_REG_17_ATI 0x8932
-#define GL_REG_18_ATI 0x8933
-#define GL_REG_19_ATI 0x8934
-#define GL_REG_20_ATI 0x8935
-#define GL_REG_21_ATI 0x8936
-#define GL_REG_22_ATI 0x8937
-#define GL_REG_23_ATI 0x8938
-#define GL_REG_24_ATI 0x8939
-#define GL_REG_25_ATI 0x893A
-#define GL_REG_26_ATI 0x893B
-#define GL_REG_27_ATI 0x893C
-#define GL_REG_28_ATI 0x893D
-#define GL_REG_29_ATI 0x893E
-#define GL_REG_30_ATI 0x893F
-#define GL_REG_31_ATI 0x8940
-#define GL_CON_0_ATI 0x8941
-#define GL_CON_1_ATI 0x8942
-#define GL_CON_2_ATI 0x8943
-#define GL_CON_3_ATI 0x8944
-#define GL_CON_4_ATI 0x8945
-#define GL_CON_5_ATI 0x8946
-#define GL_CON_6_ATI 0x8947
-#define GL_CON_7_ATI 0x8948
-#define GL_CON_8_ATI 0x8949
-#define GL_CON_9_ATI 0x894A
-#define GL_CON_10_ATI 0x894B
-#define GL_CON_11_ATI 0x894C
-#define GL_CON_12_ATI 0x894D
-#define GL_CON_13_ATI 0x894E
-#define GL_CON_14_ATI 0x894F
-#define GL_CON_15_ATI 0x8950
-#define GL_CON_16_ATI 0x8951
-#define GL_CON_17_ATI 0x8952
-#define GL_CON_18_ATI 0x8953
-#define GL_CON_19_ATI 0x8954
-#define GL_CON_20_ATI 0x8955
-#define GL_CON_21_ATI 0x8956
-#define GL_CON_22_ATI 0x8957
-#define GL_CON_23_ATI 0x8958
-#define GL_CON_24_ATI 0x8959
-#define GL_CON_25_ATI 0x895A
-#define GL_CON_26_ATI 0x895B
-#define GL_CON_27_ATI 0x895C
-#define GL_CON_28_ATI 0x895D
-#define GL_CON_29_ATI 0x895E
-#define GL_CON_30_ATI 0x895F
-#define GL_CON_31_ATI 0x8960
-#define GL_MOV_ATI 0x8961
-#define GL_ADD_ATI 0x8963
-#define GL_MUL_ATI 0x8964
-#define GL_SUB_ATI 0x8965
-#define GL_DOT3_ATI 0x8966
-#define GL_DOT4_ATI 0x8967
-#define GL_MAD_ATI 0x8968
-#define GL_LERP_ATI 0x8969
-#define GL_CND_ATI 0x896A
-#define GL_CND0_ATI 0x896B
-#define GL_DOT2_ADD_ATI 0x896C
-#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D
-#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E
-#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F
-#define GL_NUM_PASSES_ATI 0x8970
-#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971
-#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972
-#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973
-#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974
-#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975
-#define GL_SWIZZLE_STR_ATI 0x8976
-#define GL_SWIZZLE_STQ_ATI 0x8977
-#define GL_SWIZZLE_STR_DR_ATI 0x8978
-#define GL_SWIZZLE_STQ_DQ_ATI 0x8979
-#define GL_SWIZZLE_STRQ_ATI 0x897A
-#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B
-#define GL_RED_BIT_ATI 0x00000001
-#define GL_GREEN_BIT_ATI 0x00000002
-#define GL_BLUE_BIT_ATI 0x00000004
-#define GL_2X_BIT_ATI 0x00000001
-#define GL_4X_BIT_ATI 0x00000002
-#define GL_8X_BIT_ATI 0x00000004
-#define GL_HALF_BIT_ATI 0x00000008
-#define GL_QUARTER_BIT_ATI 0x00000010
-#define GL_EIGHTH_BIT_ATI 0x00000020
-#define GL_SATURATE_BIT_ATI 0x00000040
-#define GL_COMP_BIT_ATI 0x00000002
-#define GL_NEGATE_BIT_ATI 0x00000004
-#define GL_BIAS_BIT_ATI 0x00000008
-#endif
-
-#ifndef GL_ATI_pn_triangles
-#define GL_PN_TRIANGLES_ATI 0x87F0
-#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1
-#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2
-#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3
-#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4
-#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5
-#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6
-#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7
-#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8
-#endif
-
-#ifndef GL_ATI_vertex_array_object
-#define GL_STATIC_ATI 0x8760
-#define GL_DYNAMIC_ATI 0x8761
-#define GL_PRESERVE_ATI 0x8762
-#define GL_DISCARD_ATI 0x8763
-#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764
-#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765
-#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766
-#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767
-#endif
-
-#ifndef GL_EXT_vertex_shader
-#define GL_VERTEX_SHADER_EXT 0x8780
-#define GL_VERTEX_SHADER_BINDING_EXT 0x8781
-#define GL_OP_INDEX_EXT 0x8782
-#define GL_OP_NEGATE_EXT 0x8783
-#define GL_OP_DOT3_EXT 0x8784
-#define GL_OP_DOT4_EXT 0x8785
-#define GL_OP_MUL_EXT 0x8786
-#define GL_OP_ADD_EXT 0x8787
-#define GL_OP_MADD_EXT 0x8788
-#define GL_OP_FRAC_EXT 0x8789
-#define GL_OP_MAX_EXT 0x878A
-#define GL_OP_MIN_EXT 0x878B
-#define GL_OP_SET_GE_EXT 0x878C
-#define GL_OP_SET_LT_EXT 0x878D
-#define GL_OP_CLAMP_EXT 0x878E
-#define GL_OP_FLOOR_EXT 0x878F
-#define GL_OP_ROUND_EXT 0x8790
-#define GL_OP_EXP_BASE_2_EXT 0x8791
-#define GL_OP_LOG_BASE_2_EXT 0x8792
-#define GL_OP_POWER_EXT 0x8793
-#define GL_OP_RECIP_EXT 0x8794
-#define GL_OP_RECIP_SQRT_EXT 0x8795
-#define GL_OP_SUB_EXT 0x8796
-#define GL_OP_CROSS_PRODUCT_EXT 0x8797
-#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798
-#define GL_OP_MOV_EXT 0x8799
-#define GL_OUTPUT_VERTEX_EXT 0x879A
-#define GL_OUTPUT_COLOR0_EXT 0x879B
-#define GL_OUTPUT_COLOR1_EXT 0x879C
-#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D
-#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E
-#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F
-#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0
-#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1
-#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2
-#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3
-#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4
-#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5
-#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6
-#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7
-#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8
-#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9
-#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA
-#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB
-#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC
-#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD
-#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE
-#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF
-#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0
-#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1
-#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2
-#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3
-#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4
-#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5
-#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6
-#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7
-#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8
-#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9
-#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA
-#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB
-#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC
-#define GL_OUTPUT_FOG_EXT 0x87BD
-#define GL_SCALAR_EXT 0x87BE
-#define GL_VECTOR_EXT 0x87BF
-#define GL_MATRIX_EXT 0x87C0
-#define GL_VARIANT_EXT 0x87C1
-#define GL_INVARIANT_EXT 0x87C2
-#define GL_LOCAL_CONSTANT_EXT 0x87C3
-#define GL_LOCAL_EXT 0x87C4
-#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5
-#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6
-#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7
-#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8
-#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9
-#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA
-#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB
-#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CC
-#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CD
-#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE
-#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF
-#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0
-#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1
-#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2
-#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3
-#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4
-#define GL_X_EXT 0x87D5
-#define GL_Y_EXT 0x87D6
-#define GL_Z_EXT 0x87D7
-#define GL_W_EXT 0x87D8
-#define GL_NEGATIVE_X_EXT 0x87D9
-#define GL_NEGATIVE_Y_EXT 0x87DA
-#define GL_NEGATIVE_Z_EXT 0x87DB
-#define GL_NEGATIVE_W_EXT 0x87DC
-#define GL_ZERO_EXT 0x87DD
-#define GL_ONE_EXT 0x87DE
-#define GL_NEGATIVE_ONE_EXT 0x87DF
-#define GL_NORMALIZED_RANGE_EXT 0x87E0
-#define GL_FULL_RANGE_EXT 0x87E1
-#define GL_CURRENT_VERTEX_EXT 0x87E2
-#define GL_MVP_MATRIX_EXT 0x87E3
-#define GL_VARIANT_VALUE_EXT 0x87E4
-#define GL_VARIANT_DATATYPE_EXT 0x87E5
-#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6
-#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7
-#define GL_VARIANT_ARRAY_EXT 0x87E8
-#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9
-#define GL_INVARIANT_VALUE_EXT 0x87EA
-#define GL_INVARIANT_DATATYPE_EXT 0x87EB
-#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC
-#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED
-#endif
-
-#ifndef GL_ATI_vertex_streams
-#define GL_MAX_VERTEX_STREAMS_ATI 0x876B
-#define GL_VERTEX_STREAM0_ATI 0x876C
-#define GL_VERTEX_STREAM1_ATI 0x876D
-#define GL_VERTEX_STREAM2_ATI 0x876E
-#define GL_VERTEX_STREAM3_ATI 0x876F
-#define GL_VERTEX_STREAM4_ATI 0x8770
-#define GL_VERTEX_STREAM5_ATI 0x8771
-#define GL_VERTEX_STREAM6_ATI 0x8772
-#define GL_VERTEX_STREAM7_ATI 0x8773
-#define GL_VERTEX_SOURCE_ATI 0x8774
-#endif
-
-#ifndef GL_ATI_element_array
-#define GL_ELEMENT_ARRAY_ATI 0x8768
-#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769
-#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A
-#endif
-
-#ifndef GL_SUN_mesh_array
-#define GL_QUAD_MESH_SUN 0x8614
-#define GL_TRIANGLE_MESH_SUN 0x8615
-#endif
-
-#ifndef GL_SUN_slice_accum
-#define GL_SLICE_ACCUM_SUN 0x85CC
-#endif
-
-#ifndef GL_NV_multisample_filter_hint
-#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534
-#endif
-
-#ifndef GL_NV_depth_clamp
-#define GL_DEPTH_CLAMP_NV 0x864F
-#endif
-
-#ifndef GL_NV_occlusion_query
-#define GL_PIXEL_COUNTER_BITS_NV 0x8864
-#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865
-#define GL_PIXEL_COUNT_NV 0x8866
-#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867
-#endif
-
-#ifndef GL_NV_point_sprite
-#define GL_POINT_SPRITE_NV 0x8861
-#define GL_COORD_REPLACE_NV 0x8862
-#define GL_POINT_SPRITE_R_MODE_NV 0x8863
-#endif
-
-#ifndef GL_NV_texture_shader3
-#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850
-#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851
-#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852
-#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853
-#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854
-#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855
-#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856
-#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857
-#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858
-#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859
-#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A
-#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B
-#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C
-#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D
-#define GL_HILO8_NV 0x885E
-#define GL_SIGNED_HILO8_NV 0x885F
-#define GL_FORCE_BLUE_TO_ONE_NV 0x8860
-#endif
-
-#ifndef GL_NV_vertex_program1_1
-#endif
-
-#ifndef GL_EXT_shadow_funcs
-#endif
-
-#ifndef GL_EXT_stencil_two_side
-#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910
-#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911
-#endif
-
-#ifndef GL_ATI_text_fragment_shader
-#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200
-#endif
-
-#ifndef GL_APPLE_client_storage
-#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2
-#endif
-
-#ifndef GL_APPLE_element_array
-#define GL_ELEMENT_ARRAY_APPLE 0x8768
-#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8769
-#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x876A
-#endif
-
-#ifndef GL_APPLE_fence
-#define GL_DRAW_PIXELS_APPLE 0x8A0A
-#define GL_FENCE_APPLE 0x8A0B
-#endif
-
-#ifndef GL_APPLE_vertex_array_object
-#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5
-#endif
-
-#ifndef GL_APPLE_vertex_array_range
-#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D
-#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E
-#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F
-#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521
-#define GL_STORAGE_CACHED_APPLE 0x85BE
-#define GL_STORAGE_SHARED_APPLE 0x85BF
-#endif
-
-#ifndef GL_APPLE_ycbcr_422
-#define GL_YCBCR_422_APPLE 0x85B9
-#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA
-#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB
-#endif
-
-#ifndef GL_S3_s3tc
-#define GL_RGB_S3TC 0x83A0
-#define GL_RGB4_S3TC 0x83A1
-#define GL_RGBA_S3TC 0x83A2
-#define GL_RGBA4_S3TC 0x83A3
-#endif
-
-#ifndef GL_ATI_draw_buffers
-#define GL_MAX_DRAW_BUFFERS_ATI 0x8824
-#define GL_DRAW_BUFFER0_ATI 0x8825
-#define GL_DRAW_BUFFER1_ATI 0x8826
-#define GL_DRAW_BUFFER2_ATI 0x8827
-#define GL_DRAW_BUFFER3_ATI 0x8828
-#define GL_DRAW_BUFFER4_ATI 0x8829
-#define GL_DRAW_BUFFER5_ATI 0x882A
-#define GL_DRAW_BUFFER6_ATI 0x882B
-#define GL_DRAW_BUFFER7_ATI 0x882C
-#define GL_DRAW_BUFFER8_ATI 0x882D
-#define GL_DRAW_BUFFER9_ATI 0x882E
-#define GL_DRAW_BUFFER10_ATI 0x882F
-#define GL_DRAW_BUFFER11_ATI 0x8830
-#define GL_DRAW_BUFFER12_ATI 0x8831
-#define GL_DRAW_BUFFER13_ATI 0x8832
-#define GL_DRAW_BUFFER14_ATI 0x8833
-#define GL_DRAW_BUFFER15_ATI 0x8834
-#endif
-
-#ifndef GL_ATI_pixel_format_float
-#define GL_TYPE_RGBA_FLOAT_ATI 0x8820
-#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835
-#endif
-
-#ifndef GL_ATI_texture_env_combine3
-#define GL_MODULATE_ADD_ATI 0x8744
-#define GL_MODULATE_SIGNED_ADD_ATI 0x8745
-#define GL_MODULATE_SUBTRACT_ATI 0x8746
-#endif
-
-#ifndef GL_ATI_texture_float
-#define GL_RGBA_FLOAT32_ATI 0x8814
-#define GL_RGB_FLOAT32_ATI 0x8815
-#define GL_ALPHA_FLOAT32_ATI 0x8816
-#define GL_INTENSITY_FLOAT32_ATI 0x8817
-#define GL_LUMINANCE_FLOAT32_ATI 0x8818
-#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819
-#define GL_RGBA_FLOAT16_ATI 0x881A
-#define GL_RGB_FLOAT16_ATI 0x881B
-#define GL_ALPHA_FLOAT16_ATI 0x881C
-#define GL_INTENSITY_FLOAT16_ATI 0x881D
-#define GL_LUMINANCE_FLOAT16_ATI 0x881E
-#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F
-#endif
-
-#ifndef GL_NV_float_buffer
-#define GL_FLOAT_R_NV 0x8880
-#define GL_FLOAT_RG_NV 0x8881
-#define GL_FLOAT_RGB_NV 0x8882
-#define GL_FLOAT_RGBA_NV 0x8883
-#define GL_FLOAT_R16_NV 0x8884
-#define GL_FLOAT_R32_NV 0x8885
-#define GL_FLOAT_RG16_NV 0x8886
-#define GL_FLOAT_RG32_NV 0x8887
-#define GL_FLOAT_RGB16_NV 0x8888
-#define GL_FLOAT_RGB32_NV 0x8889
-#define GL_FLOAT_RGBA16_NV 0x888A
-#define GL_FLOAT_RGBA32_NV 0x888B
-#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C
-#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D
-#define GL_FLOAT_RGBA_MODE_NV 0x888E
-#endif
-
-#ifndef GL_NV_fragment_program
-#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868
-#define GL_FRAGMENT_PROGRAM_NV 0x8870
-#define GL_MAX_TEXTURE_COORDS_NV 0x8871
-#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872
-#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873
-#define GL_PROGRAM_ERROR_STRING_NV 0x8874
-#endif
-
-#ifndef GL_NV_half_float
-#define GL_HALF_FLOAT_NV 0x140B
-#endif
-
-#ifndef GL_NV_pixel_data_range
-#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878
-#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879
-#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A
-#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B
-#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C
-#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D
-#endif
-
-#ifndef GL_NV_primitive_restart
-#define GL_PRIMITIVE_RESTART_NV 0x8558
-#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559
-#endif
-
-#ifndef GL_NV_texture_expand_normal
-#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F
-#endif
-
-#ifndef GL_NV_vertex_program2
-#endif
-
-#ifndef GL_ATI_map_object_buffer
-#endif
-
-#ifndef GL_ATI_separate_stencil
-#define GL_STENCIL_BACK_FUNC_ATI 0x8800
-#define GL_STENCIL_BACK_FAIL_ATI 0x8801
-#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802
-#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803
-#endif
-
-#ifndef GL_ATI_vertex_attrib_array_object
-#endif
-
-#ifndef GL_OES_read_format
-#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A
-#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B
-#endif
-
-#ifndef GL_EXT_depth_bounds_test
-#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890
-#define GL_DEPTH_BOUNDS_EXT 0x8891
-#endif
-
-#ifndef GL_EXT_texture_mirror_clamp
-#define GL_MIRROR_CLAMP_EXT 0x8742
-#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743
-#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912
-#endif
-
-#ifndef GL_EXT_blend_equation_separate
-#define GL_BLEND_EQUATION_RGB_EXT GL_BLEND_EQUATION
-#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D
-#endif
-
-#ifndef GL_MESA_pack_invert
-#define GL_PACK_INVERT_MESA 0x8758
-#endif
-
-#ifndef GL_MESA_ycbcr_texture
-#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA
-#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB
-#define GL_YCBCR_MESA 0x8757
-#endif
-
-#ifndef GL_EXT_pixel_buffer_object
-#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB
-#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC
-#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED
-#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF
-#endif
-
-#ifndef GL_NV_fragment_program_option
-#endif
-
-#ifndef GL_NV_fragment_program2
-#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4
-#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5
-#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6
-#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7
-#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8
-#endif
-
-#ifndef GL_NV_vertex_program2_option
-/* reuse GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */
-/* reuse GL_MAX_PROGRAM_CALL_DEPTH_NV */
-#endif
-
-#ifndef GL_NV_vertex_program3
-/* reuse GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */
-#endif
-
-#ifndef GL_EXT_framebuffer_object
-#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506
-#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8
-#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6
-#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4
-#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5
-#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6
-#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7
-#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9
-#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA
-#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB
-#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC
-#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD
-#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF
-#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0
-#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1
-#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2
-#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3
-#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4
-#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5
-#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6
-#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7
-#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8
-#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9
-#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA
-#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB
-#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC
-#define GL_COLOR_ATTACHMENT13_EXT 0x8CED
-#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE
-#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF
-#define GL_DEPTH_ATTACHMENT_EXT 0x8D00
-#define GL_STENCIL_ATTACHMENT_EXT 0x8D20
-#define GL_FRAMEBUFFER_EXT 0x8D40
-#define GL_RENDERBUFFER_EXT 0x8D41
-#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42
-#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43
-#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44
-#define GL_STENCIL_INDEX1_EXT 0x8D46
-#define GL_STENCIL_INDEX4_EXT 0x8D47
-#define GL_STENCIL_INDEX8_EXT 0x8D48
-#define GL_STENCIL_INDEX16_EXT 0x8D49
-#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50
-#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51
-#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52
-#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53
-#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54
-#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55
-#endif
-
-#ifndef GL_GREMEDY_string_marker
-#endif
-
-#ifndef GL_EXT_packed_depth_stencil
-#define GL_DEPTH_STENCIL_EXT 0x84F9
-#define GL_UNSIGNED_INT_24_8_EXT 0x84FA
-#define GL_DEPTH24_STENCIL8_EXT 0x88F0
-#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1
-#endif
-
-#ifndef GL_EXT_stencil_clear_tag
-#define GL_STENCIL_TAG_BITS_EXT 0x88F2
-#define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3
-#endif
-
-#ifndef GL_EXT_texture_sRGB
-#define GL_SRGB_EXT 0x8C40
-#define GL_SRGB8_EXT 0x8C41
-#define GL_SRGB_ALPHA_EXT 0x8C42
-#define GL_SRGB8_ALPHA8_EXT 0x8C43
-#define GL_SLUMINANCE_ALPHA_EXT 0x8C44
-#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45
-#define GL_SLUMINANCE_EXT 0x8C46
-#define GL_SLUMINANCE8_EXT 0x8C47
-#define GL_COMPRESSED_SRGB_EXT 0x8C48
-#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49
-#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A
-#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B
-#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C
-#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D
-#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E
-#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F
-#endif
-
-#ifndef GL_EXT_framebuffer_blit
-#define GL_READ_FRAMEBUFFER_EXT 0x8CA8
-#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9
-#define GL_READ_FRAMEBUFFER_BINDING_EXT GL_FRAMEBUFFER_BINDING_EXT
-#define GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CAA
-#endif
-
-#ifndef GL_EXT_framebuffer_multisample
-#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB
-#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56
-#define GL_MAX_SAMPLES_EXT 0x8D57
-#endif
-
-#ifndef GL_MESAX_texture_stack
-#define GL_TEXTURE_1D_STACK_MESAX 0x8759
-#define GL_TEXTURE_2D_STACK_MESAX 0x875A
-#define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B
-#define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C
-#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D
-#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E
-#endif
-
-#ifndef GL_EXT_timer_query
-#define GL_TIME_ELAPSED_EXT 0x88BF
-#endif
-
-#ifndef GL_EXT_gpu_program_parameters
-#endif
-
-#ifndef GL_APPLE_flush_buffer_range
-#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12
-#define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13
-#endif
-
-#ifndef GL_NV_gpu_program4
-#define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904
-#define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905
-#define GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906
-#define GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907
-#define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908
-#define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909
-#define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5
-#define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6
-#endif
-
-#ifndef GL_NV_geometry_program4
-#define GL_LINES_ADJACENCY_EXT 0x000A
-#define GL_LINE_STRIP_ADJACENCY_EXT 0x000B
-#define GL_TRIANGLES_ADJACENCY_EXT 0x000C
-#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0x000D
-#define GL_GEOMETRY_PROGRAM_NV 0x8C26
-#define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27
-#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28
-#define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA
-#define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB
-#define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC
-#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29
-#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7
-#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8
-#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4
-#define GL_PROGRAM_POINT_SIZE_EXT 0x8642
-#endif
-
-#ifndef GL_EXT_geometry_shader4
-#define GL_GEOMETRY_SHADER_EXT 0x8DD9
-/* reuse GL_GEOMETRY_VERTICES_OUT_EXT */
-/* reuse GL_GEOMETRY_INPUT_TYPE_EXT */
-/* reuse GL_GEOMETRY_OUTPUT_TYPE_EXT */
-/* reuse GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT */
-#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD
-#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE
-#define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B
-#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF
-#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0
-#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1
-/* reuse GL_LINES_ADJACENCY_EXT */
-/* reuse GL_LINE_STRIP_ADJACENCY_EXT */
-/* reuse GL_TRIANGLES_ADJACENCY_EXT */
-/* reuse GL_TRIANGLE_STRIP_ADJACENCY_EXT */
-/* reuse GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT */
-/* reuse GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */
-/* reuse GL_PROGRAM_POINT_SIZE_EXT */
-#endif
-
-#ifndef GL_NV_vertex_program4
-#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD
-#endif
-
-#ifndef GL_EXT_gpu_shader4
-#define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0
-#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1
-#define GL_SAMPLER_BUFFER_EXT 0x8DC2
-#define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3
-#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4
-#define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5
-#define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6
-#define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7
-#define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8
-#define GL_INT_SAMPLER_1D_EXT 0x8DC9
-#define GL_INT_SAMPLER_2D_EXT 0x8DCA
-#define GL_INT_SAMPLER_3D_EXT 0x8DCB
-#define GL_INT_SAMPLER_CUBE_EXT 0x8DCC
-#define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD
-#define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE
-#define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF
-#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0
-#define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1
-#define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2
-#define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3
-#define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4
-#define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5
-#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6
-#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7
-#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8
-#endif
-
-#ifndef GL_EXT_draw_instanced
-#endif
-
-#ifndef GL_EXT_packed_float
-#define GL_R11F_G11F_B10F_EXT 0x8C3A
-#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B
-#define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C
-#endif
-
-#ifndef GL_EXT_texture_array
-#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18
-#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19
-#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A
-#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B
-#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C
-#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D
-#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF
-#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */
-#endif
-
-#ifndef GL_EXT_texture_buffer_object
-#define GL_TEXTURE_BUFFER_EXT 0x8C2A
-#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B
-#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C
-#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D
-#define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E
-#endif
-
-#ifndef GL_EXT_texture_compression_latc
-#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70
-#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71
-#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72
-#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73
-#endif
-
-#ifndef GL_EXT_texture_compression_rgtc
-#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB
-#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC
-#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD
-#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE
-#endif
-
-#ifndef GL_EXT_texture_shared_exponent
-#define GL_RGB9_E5_EXT 0x8C3D
-#define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E
-#define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F
-#endif
-
-#ifndef GL_NV_depth_buffer_float
-#define GL_DEPTH_COMPONENT32F_NV 0x8DAB
-#define GL_DEPTH32F_STENCIL8_NV 0x8DAC
-#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD
-#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF
-#endif
-
-#ifndef GL_NV_fragment_program4
-#endif
-
-#ifndef GL_NV_framebuffer_multisample_coverage
-#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB
-#define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10
-#define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11
-#define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12
-#endif
-
-#ifndef GL_EXT_framebuffer_sRGB
-#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9
-#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA
-#endif
-
-#ifndef GL_NV_geometry_shader4
-#endif
-
-#ifndef GL_NV_parameter_buffer_object
-#define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0
-#define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1
-#define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2
-#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3
-#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4
-#endif
-
-#ifndef GL_EXT_draw_buffers2
-#endif
-
-#ifndef GL_NV_transform_feedback
-#define GL_BACK_PRIMARY_COLOR_NV 0x8C77
-#define GL_BACK_SECONDARY_COLOR_NV 0x8C78
-#define GL_TEXTURE_COORD_NV 0x8C79
-#define GL_CLIP_DISTANCE_NV 0x8C7A
-#define GL_VERTEX_ID_NV 0x8C7B
-#define GL_PRIMITIVE_ID_NV 0x8C7C
-#define GL_GENERIC_ATTRIB_NV 0x8C7D
-#define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E
-#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F
-#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80
-#define GL_ACTIVE_VARYINGS_NV 0x8C81
-#define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82
-#define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83
-#define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84
-#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85
-#define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86
-#define GL_PRIMITIVES_GENERATED_NV 0x8C87
-#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88
-#define GL_RASTERIZER_DISCARD_NV 0x8C89
-#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_ATTRIBS_NV 0x8C8A
-#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B
-#define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C
-#define GL_SEPARATE_ATTRIBS_NV 0x8C8D
-#define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E
-#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F
-#endif
-
-#ifndef GL_EXT_bindable_uniform
-#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2
-#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3
-#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4
-#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED
-#define GL_UNIFORM_BUFFER_EXT 0x8DEE
-#define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF
-#endif
-
-#ifndef GL_EXT_texture_integer
-#define GL_RGBA32UI_EXT 0x8D70
-#define GL_RGB32UI_EXT 0x8D71
-#define GL_ALPHA32UI_EXT 0x8D72
-#define GL_INTENSITY32UI_EXT 0x8D73
-#define GL_LUMINANCE32UI_EXT 0x8D74
-#define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75
-#define GL_RGBA16UI_EXT 0x8D76
-#define GL_RGB16UI_EXT 0x8D77
-#define GL_ALPHA16UI_EXT 0x8D78
-#define GL_INTENSITY16UI_EXT 0x8D79
-#define GL_LUMINANCE16UI_EXT 0x8D7A
-#define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B
-#define GL_RGBA8UI_EXT 0x8D7C
-#define GL_RGB8UI_EXT 0x8D7D
-#define GL_ALPHA8UI_EXT 0x8D7E
-#define GL_INTENSITY8UI_EXT 0x8D7F
-#define GL_LUMINANCE8UI_EXT 0x8D80
-#define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81
-#define GL_RGBA32I_EXT 0x8D82
-#define GL_RGB32I_EXT 0x8D83
-#define GL_ALPHA32I_EXT 0x8D84
-#define GL_INTENSITY32I_EXT 0x8D85
-#define GL_LUMINANCE32I_EXT 0x8D86
-#define GL_LUMINANCE_ALPHA32I_EXT 0x8D87
-#define GL_RGBA16I_EXT 0x8D88
-#define GL_RGB16I_EXT 0x8D89
-#define GL_ALPHA16I_EXT 0x8D8A
-#define GL_INTENSITY16I_EXT 0x8D8B
-#define GL_LUMINANCE16I_EXT 0x8D8C
-#define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D
-#define GL_RGBA8I_EXT 0x8D8E
-#define GL_RGB8I_EXT 0x8D8F
-#define GL_ALPHA8I_EXT 0x8D90
-#define GL_INTENSITY8I_EXT 0x8D91
-#define GL_LUMINANCE8I_EXT 0x8D92
-#define GL_LUMINANCE_ALPHA8I_EXT 0x8D93
-#define GL_RED_INTEGER_EXT 0x8D94
-#define GL_GREEN_INTEGER_EXT 0x8D95
-#define GL_BLUE_INTEGER_EXT 0x8D96
-#define GL_ALPHA_INTEGER_EXT 0x8D97
-#define GL_RGB_INTEGER_EXT 0x8D98
-#define GL_RGBA_INTEGER_EXT 0x8D99
-#define GL_BGR_INTEGER_EXT 0x8D9A
-#define GL_BGRA_INTEGER_EXT 0x8D9B
-#define GL_LUMINANCE_INTEGER_EXT 0x8D9C
-#define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D
-#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E
-#endif
-
-
-/*************************************************************/
-
-#include <stddef.h>
-#ifndef GL_VERSION_2_0
-/* GL type for program/shader text */
-typedef char GLchar; /* native character */
-#endif
-
-#ifndef GL_VERSION_1_5
-/* GL types for handling large vertex buffer objects */
-typedef ptrdiff_t GLintptr;
-typedef ptrdiff_t GLsizeiptr;
-#endif
-
-#ifndef GL_ARB_vertex_buffer_object
-/* GL types for handling large vertex buffer objects */
-typedef ptrdiff_t GLintptrARB;
-typedef ptrdiff_t GLsizeiptrARB;
-#endif
-
-#ifndef GL_ARB_shader_objects
-/* GL types for handling shader object handles and program/shader text */
-typedef char GLcharARB; /* native character */
-typedef unsigned int GLhandleARB; /* shader object handle */
-#endif
-
-/* GL types for "half" precision (s10e5) float data in host memory */
-#ifndef GL_ARB_half_float_pixel
-typedef unsigned short GLhalfARB;
-#endif
-
-#ifndef GL_NV_half_float
-typedef unsigned short GLhalfNV;
-#endif
-
-#ifndef GLEXT_64_TYPES_DEFINED
-/* This code block is duplicated in glext.h, so must be protected */
-#define GLEXT_64_TYPES_DEFINED
-/* Define int32_t, int64_t, and uint64_t types for UST/MSC */
-/* (as used in the GL_EXT_timer_query extension). */
-#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
-#include <inttypes.h>
-#elif defined(__sun__)
-#include <inttypes.h>
-#if defined(__STDC__)
-#if defined(__arch64__)
-typedef long int int64_t;
-typedef unsigned long int uint64_t;
-#else
-typedef long long int int64_t;
-typedef unsigned long long int uint64_t;
-#endif /* __arch64__ */
-#endif /* __STDC__ */
-#elif defined( __VMS )
-#include <inttypes.h>
-#elif defined(__SCO__) || defined(__USLC__)
-#include <stdint.h>
-#elif defined(__UNIXOS2__) || defined(__SOL64__)
-typedef long int int32_t;
-typedef long long int int64_t;
-typedef unsigned long long int uint64_t;
-#elif defined(_WIN32) && defined(__GNUC__)
-#include <stdint.h>
-#elif defined(_WIN32)
-typedef __int32 int32_t;
-typedef __int64 int64_t;
-typedef unsigned __int64 uint64_t;
-#else
-#include <inttypes.h> /* Fallback option */
-#endif
-#endif
-
-#ifndef GL_EXT_timer_query
-typedef int64_t GLint64EXT;
-typedef uint64_t GLuint64EXT;
-#endif
-
-#ifndef GL_VERSION_1_2
-#define GL_VERSION_1_2 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendColor (GLclampf, GLclampf, GLclampf, GLclampf);
-GLAPI void APIENTRY glBlendEquation (GLenum);
-GLAPI void APIENTRY glDrawRangeElements (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *);
-GLAPI void APIENTRY glColorTable (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glColorTableParameterfv (GLenum, GLenum, const GLfloat *);
-GLAPI void APIENTRY glColorTableParameteriv (GLenum, GLenum, const GLint *);
-GLAPI void APIENTRY glCopyColorTable (GLenum, GLenum, GLint, GLint, GLsizei);
-GLAPI void APIENTRY glGetColorTable (GLenum, GLenum, GLenum, GLvoid *);
-GLAPI void APIENTRY glGetColorTableParameterfv (GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetColorTableParameteriv (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glColorSubTable (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glCopyColorSubTable (GLenum, GLsizei, GLint, GLint, GLsizei);
-GLAPI void APIENTRY glConvolutionFilter1D (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glConvolutionFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glConvolutionParameterf (GLenum, GLenum, GLfloat);
-GLAPI void APIENTRY glConvolutionParameterfv (GLenum, GLenum, const GLfloat *);
-GLAPI void APIENTRY glConvolutionParameteri (GLenum, GLenum, GLint);
-GLAPI void APIENTRY glConvolutionParameteriv (GLenum, GLenum, const GLint *);
-GLAPI void APIENTRY glCopyConvolutionFilter1D (GLenum, GLenum, GLint, GLint, GLsizei);
-GLAPI void APIENTRY glCopyConvolutionFilter2D (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei);
-GLAPI void APIENTRY glGetConvolutionFilter (GLenum, GLenum, GLenum, GLvoid *);
-GLAPI void APIENTRY glGetConvolutionParameterfv (GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetConvolutionParameteriv (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetSeparableFilter (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *);
-GLAPI void APIENTRY glSeparableFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *);
-GLAPI void APIENTRY glGetHistogram (GLenum, GLboolean, GLenum, GLenum, GLvoid *);
-GLAPI void APIENTRY glGetHistogramParameterfv (GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetHistogramParameteriv (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetMinmax (GLenum, GLboolean, GLenum, GLenum, GLvoid *);
-GLAPI void APIENTRY glGetMinmaxParameterfv (GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetMinmaxParameteriv (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glHistogram (GLenum, GLsizei, GLenum, GLboolean);
-GLAPI void APIENTRY glMinmax (GLenum, GLenum, GLboolean);
-GLAPI void APIENTRY glResetHistogram (GLenum);
-GLAPI void APIENTRY glResetMinmax (GLenum);
-GLAPI void APIENTRY glTexImage3D (GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glCopyTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
-typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);
-typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
-typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
-typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
-typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image);
-typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
-typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
-typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
-typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
-typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
-typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink);
-typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-#endif
-
-#ifndef GL_VERSION_1_3
-#define GL_VERSION_1_3 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glActiveTexture (GLenum);
-GLAPI void APIENTRY glClientActiveTexture (GLenum);
-GLAPI void APIENTRY glMultiTexCoord1d (GLenum, GLdouble);
-GLAPI void APIENTRY glMultiTexCoord1dv (GLenum, const GLdouble *);
-GLAPI void APIENTRY glMultiTexCoord1f (GLenum, GLfloat);
-GLAPI void APIENTRY glMultiTexCoord1fv (GLenum, const GLfloat *);
-GLAPI void APIENTRY glMultiTexCoord1i (GLenum, GLint);
-GLAPI void APIENTRY glMultiTexCoord1iv (GLenum, const GLint *);
-GLAPI void APIENTRY glMultiTexCoord1s (GLenum, GLshort);
-GLAPI void APIENTRY glMultiTexCoord1sv (GLenum, const GLshort *);
-GLAPI void APIENTRY glMultiTexCoord2d (GLenum, GLdouble, GLdouble);
-GLAPI void APIENTRY glMultiTexCoord2dv (GLenum, const GLdouble *);
-GLAPI void APIENTRY glMultiTexCoord2f (GLenum, GLfloat, GLfloat);
-GLAPI void APIENTRY glMultiTexCoord2fv (GLenum, const GLfloat *);
-GLAPI void APIENTRY glMultiTexCoord2i (GLenum, GLint, GLint);
-GLAPI void APIENTRY glMultiTexCoord2iv (GLenum, const GLint *);
-GLAPI void APIENTRY glMultiTexCoord2s (GLenum, GLshort, GLshort);
-GLAPI void APIENTRY glMultiTexCoord2sv (GLenum, const GLshort *);
-GLAPI void APIENTRY glMultiTexCoord3d (GLenum, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glMultiTexCoord3dv (GLenum, const GLdouble *);
-GLAPI void APIENTRY glMultiTexCoord3f (GLenum, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glMultiTexCoord3fv (GLenum, const GLfloat *);
-GLAPI void APIENTRY glMultiTexCoord3i (GLenum, GLint, GLint, GLint);
-GLAPI void APIENTRY glMultiTexCoord3iv (GLenum, const GLint *);
-GLAPI void APIENTRY glMultiTexCoord3s (GLenum, GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glMultiTexCoord3sv (GLenum, const GLshort *);
-GLAPI void APIENTRY glMultiTexCoord4d (GLenum, GLdouble, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glMultiTexCoord4dv (GLenum, const GLdouble *);
-GLAPI void APIENTRY glMultiTexCoord4f (GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glMultiTexCoord4fv (GLenum, const GLfloat *);
-GLAPI void APIENTRY glMultiTexCoord4i (GLenum, GLint, GLint, GLint, GLint);
-GLAPI void APIENTRY glMultiTexCoord4iv (GLenum, const GLint *);
-GLAPI void APIENTRY glMultiTexCoord4s (GLenum, GLshort, GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glMultiTexCoord4sv (GLenum, const GLshort *);
-GLAPI void APIENTRY glLoadTransposeMatrixf (const GLfloat *);
-GLAPI void APIENTRY glLoadTransposeMatrixd (const GLdouble *);
-GLAPI void APIENTRY glMultTransposeMatrixf (const GLfloat *);
-GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *);
-GLAPI void APIENTRY glSampleCoverage (GLclampf, GLboolean);
-GLAPI void APIENTRY glCompressedTexImage3D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glCompressedTexImage2D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glCompressedTexImage1D (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glGetCompressedTexImage (GLenum, GLint, GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture);
-typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m);
-typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m);
-typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m);
-typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m);
-typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img);
-#endif
-
-#ifndef GL_VERSION_1_4
-#define GL_VERSION_1_4 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendFuncSeparate (GLenum, GLenum, GLenum, GLenum);
-GLAPI void APIENTRY glFogCoordf (GLfloat);
-GLAPI void APIENTRY glFogCoordfv (const GLfloat *);
-GLAPI void APIENTRY glFogCoordd (GLdouble);
-GLAPI void APIENTRY glFogCoorddv (const GLdouble *);
-GLAPI void APIENTRY glFogCoordPointer (GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glMultiDrawArrays (GLenum, GLint *, GLsizei *, GLsizei);
-GLAPI void APIENTRY glMultiDrawElements (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei);
-GLAPI void APIENTRY glPointParameterf (GLenum, GLfloat);
-GLAPI void APIENTRY glPointParameterfv (GLenum, const GLfloat *);
-GLAPI void APIENTRY glPointParameteri (GLenum, GLint);
-GLAPI void APIENTRY glPointParameteriv (GLenum, const GLint *);
-GLAPI void APIENTRY glSecondaryColor3b (GLbyte, GLbyte, GLbyte);
-GLAPI void APIENTRY glSecondaryColor3bv (const GLbyte *);
-GLAPI void APIENTRY glSecondaryColor3d (GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glSecondaryColor3dv (const GLdouble *);
-GLAPI void APIENTRY glSecondaryColor3f (GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glSecondaryColor3fv (const GLfloat *);
-GLAPI void APIENTRY glSecondaryColor3i (GLint, GLint, GLint);
-GLAPI void APIENTRY glSecondaryColor3iv (const GLint *);
-GLAPI void APIENTRY glSecondaryColor3s (GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glSecondaryColor3sv (const GLshort *);
-GLAPI void APIENTRY glSecondaryColor3ub (GLubyte, GLubyte, GLubyte);
-GLAPI void APIENTRY glSecondaryColor3ubv (const GLubyte *);
-GLAPI void APIENTRY glSecondaryColor3ui (GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glSecondaryColor3uiv (const GLuint *);
-GLAPI void APIENTRY glSecondaryColor3us (GLushort, GLushort, GLushort);
-GLAPI void APIENTRY glSecondaryColor3usv (const GLushort *);
-GLAPI void APIENTRY glSecondaryColorPointer (GLint, GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glWindowPos2d (GLdouble, GLdouble);
-GLAPI void APIENTRY glWindowPos2dv (const GLdouble *);
-GLAPI void APIENTRY glWindowPos2f (GLfloat, GLfloat);
-GLAPI void APIENTRY glWindowPos2fv (const GLfloat *);
-GLAPI void APIENTRY glWindowPos2i (GLint, GLint);
-GLAPI void APIENTRY glWindowPos2iv (const GLint *);
-GLAPI void APIENTRY glWindowPos2s (GLshort, GLshort);
-GLAPI void APIENTRY glWindowPos2sv (const GLshort *);
-GLAPI void APIENTRY glWindowPos3d (GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glWindowPos3dv (const GLdouble *);
-GLAPI void APIENTRY glWindowPos3f (GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glWindowPos3fv (const GLfloat *);
-GLAPI void APIENTRY glWindowPos3i (GLint, GLint, GLint);
-GLAPI void APIENTRY glWindowPos3iv (const GLint *);
-GLAPI void APIENTRY glWindowPos3s (GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glWindowPos3sv (const GLshort *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-typedef void (APIENTRYP PFNGLFOGCOORDFPROC) (GLfloat coord);
-typedef void (APIENTRYP PFNGLFOGCOORDFVPROC) (const GLfloat *coord);
-typedef void (APIENTRYP PFNGLFOGCOORDDPROC) (GLdouble coord);
-typedef void (APIENTRYP PFNGLFOGCOORDDVPROC) (const GLdouble *coord);
-typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
-typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2DVPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2FVPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2IPROC) (GLint x, GLint y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2IVPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2SVPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3DVPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3FVPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3IVPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3SVPROC) (const GLshort *v);
-#endif
-
-#ifndef GL_VERSION_1_5
-#define GL_VERSION_1_5 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGenQueries (GLsizei, GLuint *);
-GLAPI void APIENTRY glDeleteQueries (GLsizei, const GLuint *);
-GLAPI GLboolean APIENTRY glIsQuery (GLuint);
-GLAPI void APIENTRY glBeginQuery (GLenum, GLuint);
-GLAPI void APIENTRY glEndQuery (GLenum);
-GLAPI void APIENTRY glGetQueryiv (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetQueryObjectiv (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetQueryObjectuiv (GLuint, GLenum, GLuint *);
-GLAPI void APIENTRY glBindBuffer (GLenum, GLuint);
-GLAPI void APIENTRY glDeleteBuffers (GLsizei, const GLuint *);
-GLAPI void APIENTRY glGenBuffers (GLsizei, GLuint *);
-GLAPI GLboolean APIENTRY glIsBuffer (GLuint);
-GLAPI void APIENTRY glBufferData (GLenum, GLsizeiptr, const GLvoid *, GLenum);
-GLAPI void APIENTRY glBufferSubData (GLenum, GLintptr, GLsizeiptr, const GLvoid *);
-GLAPI void APIENTRY glGetBufferSubData (GLenum, GLintptr, GLsizeiptr, GLvoid *);
-GLAPI GLvoid* APIENTRY glMapBuffer (GLenum, GLenum);
-GLAPI GLboolean APIENTRY glUnmapBuffer (GLenum);
-GLAPI void APIENTRY glGetBufferParameteriv (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetBufferPointerv (GLenum, GLenum, GLvoid* *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids);
-typedef void (APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids);
-typedef GLboolean (APIENTRYP PFNGLISQUERYPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLBEGINQUERYPROC) (GLenum target, GLuint id);
-typedef void (APIENTRYP PFNGLENDQUERYPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint *params);
-typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer);
-typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers);
-typedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers);
-typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer);
-typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage);
-typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data);
-typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data);
-typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERPROC) (GLenum target, GLenum access);
-typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid* *params);
-#endif
-
-#ifndef GL_VERSION_2_0
-#define GL_VERSION_2_0 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendEquationSeparate (GLenum, GLenum);
-GLAPI void APIENTRY glDrawBuffers (GLsizei, const GLenum *);
-GLAPI void APIENTRY glStencilOpSeparate (GLenum, GLenum, GLenum, GLenum);
-GLAPI void APIENTRY glStencilFuncSeparate (GLenum, GLenum, GLint, GLuint);
-GLAPI void APIENTRY glStencilMaskSeparate (GLenum, GLuint);
-GLAPI void APIENTRY glAttachShader (GLuint, GLuint);
-GLAPI void APIENTRY glBindAttribLocation (GLuint, GLuint, const GLchar *);
-GLAPI void APIENTRY glCompileShader (GLuint);
-GLAPI GLuint APIENTRY glCreateProgram (void);
-GLAPI GLuint APIENTRY glCreateShader (GLenum);
-GLAPI void APIENTRY glDeleteProgram (GLuint);
-GLAPI void APIENTRY glDeleteShader (GLuint);
-GLAPI void APIENTRY glDetachShader (GLuint, GLuint);
-GLAPI void APIENTRY glDisableVertexAttribArray (GLuint);
-GLAPI void APIENTRY glEnableVertexAttribArray (GLuint);
-GLAPI void APIENTRY glGetActiveAttrib (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *);
-GLAPI void APIENTRY glGetActiveUniform (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *);
-GLAPI void APIENTRY glGetAttachedShaders (GLuint, GLsizei, GLsizei *, GLuint *);
-GLAPI GLint APIENTRY glGetAttribLocation (GLuint, const GLchar *);
-GLAPI void APIENTRY glGetProgramiv (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetProgramInfoLog (GLuint, GLsizei, GLsizei *, GLchar *);
-GLAPI void APIENTRY glGetShaderiv (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetShaderInfoLog (GLuint, GLsizei, GLsizei *, GLchar *);
-GLAPI void APIENTRY glGetShaderSource (GLuint, GLsizei, GLsizei *, GLchar *);
-GLAPI GLint APIENTRY glGetUniformLocation (GLuint, const GLchar *);
-GLAPI void APIENTRY glGetUniformfv (GLuint, GLint, GLfloat *);
-GLAPI void APIENTRY glGetUniformiv (GLuint, GLint, GLint *);
-GLAPI void APIENTRY glGetVertexAttribdv (GLuint, GLenum, GLdouble *);
-GLAPI void APIENTRY glGetVertexAttribfv (GLuint, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetVertexAttribiv (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint, GLenum, GLvoid* *);
-GLAPI GLboolean APIENTRY glIsProgram (GLuint);
-GLAPI GLboolean APIENTRY glIsShader (GLuint);
-GLAPI void APIENTRY glLinkProgram (GLuint);
-GLAPI void APIENTRY glShaderSource (GLuint, GLsizei, const GLchar* *, const GLint *);
-GLAPI void APIENTRY glUseProgram (GLuint);
-GLAPI void APIENTRY glUniform1f (GLint, GLfloat);
-GLAPI void APIENTRY glUniform2f (GLint, GLfloat, GLfloat);
-GLAPI void APIENTRY glUniform3f (GLint, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glUniform4f (GLint, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glUniform1i (GLint, GLint);
-GLAPI void APIENTRY glUniform2i (GLint, GLint, GLint);
-GLAPI void APIENTRY glUniform3i (GLint, GLint, GLint, GLint);
-GLAPI void APIENTRY glUniform4i (GLint, GLint, GLint, GLint, GLint);
-GLAPI void APIENTRY glUniform1fv (GLint, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glUniform2fv (GLint, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glUniform3fv (GLint, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glUniform4fv (GLint, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glUniform1iv (GLint, GLsizei, const GLint *);
-GLAPI void APIENTRY glUniform2iv (GLint, GLsizei, const GLint *);
-GLAPI void APIENTRY glUniform3iv (GLint, GLsizei, const GLint *);
-GLAPI void APIENTRY glUniform4iv (GLint, GLsizei, const GLint *);
-GLAPI void APIENTRY glUniformMatrix2fv (GLint, GLsizei, GLboolean, const GLfloat *);
-GLAPI void APIENTRY glUniformMatrix3fv (GLint, GLsizei, GLboolean, const GLfloat *);
-GLAPI void APIENTRY glUniformMatrix4fv (GLint, GLsizei, GLboolean, const GLfloat *);
-GLAPI void APIENTRY glValidateProgram (GLuint);
-GLAPI void APIENTRY glVertexAttrib1d (GLuint, GLdouble);
-GLAPI void APIENTRY glVertexAttrib1dv (GLuint, const GLdouble *);
-GLAPI void APIENTRY glVertexAttrib1f (GLuint, GLfloat);
-GLAPI void APIENTRY glVertexAttrib1fv (GLuint, const GLfloat *);
-GLAPI void APIENTRY glVertexAttrib1s (GLuint, GLshort);
-GLAPI void APIENTRY glVertexAttrib1sv (GLuint, const GLshort *);
-GLAPI void APIENTRY glVertexAttrib2d (GLuint, GLdouble, GLdouble);
-GLAPI void APIENTRY glVertexAttrib2dv (GLuint, const GLdouble *);
-GLAPI void APIENTRY glVertexAttrib2f (GLuint, GLfloat, GLfloat);
-GLAPI void APIENTRY glVertexAttrib2fv (GLuint, const GLfloat *);
-GLAPI void APIENTRY glVertexAttrib2s (GLuint, GLshort, GLshort);
-GLAPI void APIENTRY glVertexAttrib2sv (GLuint, const GLshort *);
-GLAPI void APIENTRY glVertexAttrib3d (GLuint, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glVertexAttrib3dv (GLuint, const GLdouble *);
-GLAPI void APIENTRY glVertexAttrib3f (GLuint, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glVertexAttrib3fv (GLuint, const GLfloat *);
-GLAPI void APIENTRY glVertexAttrib3s (GLuint, GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glVertexAttrib3sv (GLuint, const GLshort *);
-GLAPI void APIENTRY glVertexAttrib4Nbv (GLuint, const GLbyte *);
-GLAPI void APIENTRY glVertexAttrib4Niv (GLuint, const GLint *);
-GLAPI void APIENTRY glVertexAttrib4Nsv (GLuint, const GLshort *);
-GLAPI void APIENTRY glVertexAttrib4Nub (GLuint, GLubyte, GLubyte, GLubyte, GLubyte);
-GLAPI void APIENTRY glVertexAttrib4Nubv (GLuint, const GLubyte *);
-GLAPI void APIENTRY glVertexAttrib4Nuiv (GLuint, const GLuint *);
-GLAPI void APIENTRY glVertexAttrib4Nusv (GLuint, const GLushort *);
-GLAPI void APIENTRY glVertexAttrib4bv (GLuint, const GLbyte *);
-GLAPI void APIENTRY glVertexAttrib4d (GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glVertexAttrib4dv (GLuint, const GLdouble *);
-GLAPI void APIENTRY glVertexAttrib4f (GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glVertexAttrib4fv (GLuint, const GLfloat *);
-GLAPI void APIENTRY glVertexAttrib4iv (GLuint, const GLint *);
-GLAPI void APIENTRY glVertexAttrib4s (GLuint, GLshort, GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glVertexAttrib4sv (GLuint, const GLshort *);
-GLAPI void APIENTRY glVertexAttrib4ubv (GLuint, const GLubyte *);
-GLAPI void APIENTRY glVertexAttrib4uiv (GLuint, const GLuint *);
-GLAPI void APIENTRY glVertexAttrib4usv (GLuint, const GLushort *);
-GLAPI void APIENTRY glVertexAttribPointer (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha);
-typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs);
-typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
-typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
-typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask);
-typedef void (APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader);
-typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name);
-typedef void (APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader);
-typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC) (void);
-typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC) (GLenum type);
-typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program);
-typedef void (APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader);
-typedef void (APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader);
-typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index);
-typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index);
-typedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
-typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
-typedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj);
-typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name);
-typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-typedef void (APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-typedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
-typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name);
-typedef void (APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, GLvoid* *pointer);
-typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC) (GLuint program);
-typedef GLboolean (APIENTRYP PFNGLISSHADERPROC) (GLuint shader);
-typedef void (APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program);
-typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar* *string, const GLint *length);
-typedef void (APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program);
-typedef void (APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0);
-typedef void (APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1);
-typedef void (APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-typedef void (APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-typedef void (APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0);
-typedef void (APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1);
-typedef void (APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2);
-typedef void (APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-typedef void (APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
-#endif
-
-#ifndef GL_VERSION_2_1
-#define GL_VERSION_2_1 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glUniformMatrix2x3fv (GLint, GLsizei, GLboolean, const GLfloat *);
-GLAPI void APIENTRY glUniformMatrix3x2fv (GLint, GLsizei, GLboolean, const GLfloat *);
-GLAPI void APIENTRY glUniformMatrix2x4fv (GLint, GLsizei, GLboolean, const GLfloat *);
-GLAPI void APIENTRY glUniformMatrix4x2fv (GLint, GLsizei, GLboolean, const GLfloat *);
-GLAPI void APIENTRY glUniformMatrix3x4fv (GLint, GLsizei, GLboolean, const GLfloat *);
-GLAPI void APIENTRY glUniformMatrix4x3fv (GLint, GLsizei, GLboolean, const GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-#endif
-
-#ifndef GL_ARB_multitexture
-#define GL_ARB_multitexture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glActiveTextureARB (GLenum);
-GLAPI void APIENTRY glClientActiveTextureARB (GLenum);
-GLAPI void APIENTRY glMultiTexCoord1dARB (GLenum, GLdouble);
-GLAPI void APIENTRY glMultiTexCoord1dvARB (GLenum, const GLdouble *);
-GLAPI void APIENTRY glMultiTexCoord1fARB (GLenum, GLfloat);
-GLAPI void APIENTRY glMultiTexCoord1fvARB (GLenum, const GLfloat *);
-GLAPI void APIENTRY glMultiTexCoord1iARB (GLenum, GLint);
-GLAPI void APIENTRY glMultiTexCoord1ivARB (GLenum, const GLint *);
-GLAPI void APIENTRY glMultiTexCoord1sARB (GLenum, GLshort);
-GLAPI void APIENTRY glMultiTexCoord1svARB (GLenum, const GLshort *);
-GLAPI void APIENTRY glMultiTexCoord2dARB (GLenum, GLdouble, GLdouble);
-GLAPI void APIENTRY glMultiTexCoord2dvARB (GLenum, const GLdouble *);
-GLAPI void APIENTRY glMultiTexCoord2fARB (GLenum, GLfloat, GLfloat);
-GLAPI void APIENTRY glMultiTexCoord2fvARB (GLenum, const GLfloat *);
-GLAPI void APIENTRY glMultiTexCoord2iARB (GLenum, GLint, GLint);
-GLAPI void APIENTRY glMultiTexCoord2ivARB (GLenum, const GLint *);
-GLAPI void APIENTRY glMultiTexCoord2sARB (GLenum, GLshort, GLshort);
-GLAPI void APIENTRY glMultiTexCoord2svARB (GLenum, const GLshort *);
-GLAPI void APIENTRY glMultiTexCoord3dARB (GLenum, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glMultiTexCoord3dvARB (GLenum, const GLdouble *);
-GLAPI void APIENTRY glMultiTexCoord3fARB (GLenum, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glMultiTexCoord3fvARB (GLenum, const GLfloat *);
-GLAPI void APIENTRY glMultiTexCoord3iARB (GLenum, GLint, GLint, GLint);
-GLAPI void APIENTRY glMultiTexCoord3ivARB (GLenum, const GLint *);
-GLAPI void APIENTRY glMultiTexCoord3sARB (GLenum, GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glMultiTexCoord3svARB (GLenum, const GLshort *);
-GLAPI void APIENTRY glMultiTexCoord4dARB (GLenum, GLdouble, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glMultiTexCoord4dvARB (GLenum, const GLdouble *);
-GLAPI void APIENTRY glMultiTexCoord4fARB (GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glMultiTexCoord4fvARB (GLenum, const GLfloat *);
-GLAPI void APIENTRY glMultiTexCoord4iARB (GLenum, GLint, GLint, GLint, GLint);
-GLAPI void APIENTRY glMultiTexCoord4ivARB (GLenum, const GLint *);
-GLAPI void APIENTRY glMultiTexCoord4sARB (GLenum, GLshort, GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glMultiTexCoord4svARB (GLenum, const GLshort *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture);
-typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v);
-#endif
-
-#ifndef GL_ARB_transpose_matrix
-#define GL_ARB_transpose_matrix 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *);
-GLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *);
-GLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat *);
-GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m);
-typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m);
-typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat *m);
-typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m);
-#endif
-
-#ifndef GL_ARB_multisample
-#define GL_ARB_multisample 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glSampleCoverageARB (GLclampf, GLboolean);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert);
-#endif
-
-#ifndef GL_ARB_texture_env_add
-#define GL_ARB_texture_env_add 1
-#endif
-
-#ifndef GL_ARB_texture_cube_map
-#define GL_ARB_texture_cube_map 1
-#endif
-
-#ifndef GL_ARB_texture_compression
-#define GL_ARB_texture_compression 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum, GLint, GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, GLvoid *img);
-#endif
-
-#ifndef GL_ARB_texture_border_clamp
-#define GL_ARB_texture_border_clamp 1
-#endif
-
-#ifndef GL_ARB_point_parameters
-#define GL_ARB_point_parameters 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPointParameterfARB (GLenum, GLfloat);
-GLAPI void APIENTRY glPointParameterfvARB (GLenum, const GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params);
-#endif
-
-#ifndef GL_ARB_vertex_blend
-#define GL_ARB_vertex_blend 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glWeightbvARB (GLint, const GLbyte *);
-GLAPI void APIENTRY glWeightsvARB (GLint, const GLshort *);
-GLAPI void APIENTRY glWeightivARB (GLint, const GLint *);
-GLAPI void APIENTRY glWeightfvARB (GLint, const GLfloat *);
-GLAPI void APIENTRY glWeightdvARB (GLint, const GLdouble *);
-GLAPI void APIENTRY glWeightubvARB (GLint, const GLubyte *);
-GLAPI void APIENTRY glWeightusvARB (GLint, const GLushort *);
-GLAPI void APIENTRY glWeightuivARB (GLint, const GLuint *);
-GLAPI void APIENTRY glWeightPointerARB (GLint, GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glVertexBlendARB (GLint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLWEIGHTBVARBPROC) (GLint size, const GLbyte *weights);
-typedef void (APIENTRYP PFNGLWEIGHTSVARBPROC) (GLint size, const GLshort *weights);
-typedef void (APIENTRYP PFNGLWEIGHTIVARBPROC) (GLint size, const GLint *weights);
-typedef void (APIENTRYP PFNGLWEIGHTFVARBPROC) (GLint size, const GLfloat *weights);
-typedef void (APIENTRYP PFNGLWEIGHTDVARBPROC) (GLint size, const GLdouble *weights);
-typedef void (APIENTRYP PFNGLWEIGHTUBVARBPROC) (GLint size, const GLubyte *weights);
-typedef void (APIENTRYP PFNGLWEIGHTUSVARBPROC) (GLint size, const GLushort *weights);
-typedef void (APIENTRYP PFNGLWEIGHTUIVARBPROC) (GLint size, const GLuint *weights);
-typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC) (GLint count);
-#endif
-
-#ifndef GL_ARB_matrix_palette
-#define GL_ARB_matrix_palette 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glCurrentPaletteMatrixARB (GLint);
-GLAPI void APIENTRY glMatrixIndexubvARB (GLint, const GLubyte *);
-GLAPI void APIENTRY glMatrixIndexusvARB (GLint, const GLushort *);
-GLAPI void APIENTRY glMatrixIndexuivARB (GLint, const GLuint *);
-GLAPI void APIENTRY glMatrixIndexPointerARB (GLint, GLenum, GLsizei, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index);
-typedef void (APIENTRYP PFNGLMATRIXINDEXUBVARBPROC) (GLint size, const GLubyte *indices);
-typedef void (APIENTRYP PFNGLMATRIXINDEXUSVARBPROC) (GLint size, const GLushort *indices);
-typedef void (APIENTRYP PFNGLMATRIXINDEXUIVARBPROC) (GLint size, const GLuint *indices);
-typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-#endif
-
-#ifndef GL_ARB_texture_env_combine
-#define GL_ARB_texture_env_combine 1
-#endif
-
-#ifndef GL_ARB_texture_env_crossbar
-#define GL_ARB_texture_env_crossbar 1
-#endif
-
-#ifndef GL_ARB_texture_env_dot3
-#define GL_ARB_texture_env_dot3 1
-#endif
-
-#ifndef GL_ARB_texture_mirrored_repeat
-#define GL_ARB_texture_mirrored_repeat 1
-#endif
-
-#ifndef GL_ARB_depth_texture
-#define GL_ARB_depth_texture 1
-#endif
-
-#ifndef GL_ARB_shadow
-#define GL_ARB_shadow 1
-#endif
-
-#ifndef GL_ARB_shadow_ambient
-#define GL_ARB_shadow_ambient 1
-#endif
-
-#ifndef GL_ARB_window_pos
-#define GL_ARB_window_pos 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glWindowPos2dARB (GLdouble, GLdouble);
-GLAPI void APIENTRY glWindowPos2dvARB (const GLdouble *);
-GLAPI void APIENTRY glWindowPos2fARB (GLfloat, GLfloat);
-GLAPI void APIENTRY glWindowPos2fvARB (const GLfloat *);
-GLAPI void APIENTRY glWindowPos2iARB (GLint, GLint);
-GLAPI void APIENTRY glWindowPos2ivARB (const GLint *);
-GLAPI void APIENTRY glWindowPos2sARB (GLshort, GLshort);
-GLAPI void APIENTRY glWindowPos2svARB (const GLshort *);
-GLAPI void APIENTRY glWindowPos3dARB (GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glWindowPos3dvARB (const GLdouble *);
-GLAPI void APIENTRY glWindowPos3fARB (GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glWindowPos3fvARB (const GLfloat *);
-GLAPI void APIENTRY glWindowPos3iARB (GLint, GLint, GLint);
-GLAPI void APIENTRY glWindowPos3ivARB (const GLint *);
-GLAPI void APIENTRY glWindowPos3sARB (GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glWindowPos3svARB (const GLshort *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2DVARBPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2FVARBPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2IVARBPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2SVARBPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3DVARBPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3FVARBPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3IVARBPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3SVARBPROC) (const GLshort *v);
-#endif
-
-#ifndef GL_ARB_vertex_program
-#define GL_ARB_vertex_program 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexAttrib1dARB (GLuint, GLdouble);
-GLAPI void APIENTRY glVertexAttrib1dvARB (GLuint, const GLdouble *);
-GLAPI void APIENTRY glVertexAttrib1fARB (GLuint, GLfloat);
-GLAPI void APIENTRY glVertexAttrib1fvARB (GLuint, const GLfloat *);
-GLAPI void APIENTRY glVertexAttrib1sARB (GLuint, GLshort);
-GLAPI void APIENTRY glVertexAttrib1svARB (GLuint, const GLshort *);
-GLAPI void APIENTRY glVertexAttrib2dARB (GLuint, GLdouble, GLdouble);
-GLAPI void APIENTRY glVertexAttrib2dvARB (GLuint, const GLdouble *);
-GLAPI void APIENTRY glVertexAttrib2fARB (GLuint, GLfloat, GLfloat);
-GLAPI void APIENTRY glVertexAttrib2fvARB (GLuint, const GLfloat *);
-GLAPI void APIENTRY glVertexAttrib2sARB (GLuint, GLshort, GLshort);
-GLAPI void APIENTRY glVertexAttrib2svARB (GLuint, const GLshort *);
-GLAPI void APIENTRY glVertexAttrib3dARB (GLuint, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glVertexAttrib3dvARB (GLuint, const GLdouble *);
-GLAPI void APIENTRY glVertexAttrib3fARB (GLuint, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glVertexAttrib3fvARB (GLuint, const GLfloat *);
-GLAPI void APIENTRY glVertexAttrib3sARB (GLuint, GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glVertexAttrib3svARB (GLuint, const GLshort *);
-GLAPI void APIENTRY glVertexAttrib4NbvARB (GLuint, const GLbyte *);
-GLAPI void APIENTRY glVertexAttrib4NivARB (GLuint, const GLint *);
-GLAPI void APIENTRY glVertexAttrib4NsvARB (GLuint, const GLshort *);
-GLAPI void APIENTRY glVertexAttrib4NubARB (GLuint, GLubyte, GLubyte, GLubyte, GLubyte);
-GLAPI void APIENTRY glVertexAttrib4NubvARB (GLuint, const GLubyte *);
-GLAPI void APIENTRY glVertexAttrib4NuivARB (GLuint, const GLuint *);
-GLAPI void APIENTRY glVertexAttrib4NusvARB (GLuint, const GLushort *);
-GLAPI void APIENTRY glVertexAttrib4bvARB (GLuint, const GLbyte *);
-GLAPI void APIENTRY glVertexAttrib4dARB (GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glVertexAttrib4dvARB (GLuint, const GLdouble *);
-GLAPI void APIENTRY glVertexAttrib4fARB (GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glVertexAttrib4fvARB (GLuint, const GLfloat *);
-GLAPI void APIENTRY glVertexAttrib4ivARB (GLuint, const GLint *);
-GLAPI void APIENTRY glVertexAttrib4sARB (GLuint, GLshort, GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glVertexAttrib4svARB (GLuint, const GLshort *);
-GLAPI void APIENTRY glVertexAttrib4ubvARB (GLuint, const GLubyte *);
-GLAPI void APIENTRY glVertexAttrib4uivARB (GLuint, const GLuint *);
-GLAPI void APIENTRY glVertexAttrib4usvARB (GLuint, const GLushort *);
-GLAPI void APIENTRY glVertexAttribPointerARB (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glEnableVertexAttribArrayARB (GLuint);
-GLAPI void APIENTRY glDisableVertexAttribArrayARB (GLuint);
-GLAPI void APIENTRY glProgramStringARB (GLenum, GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glBindProgramARB (GLenum, GLuint);
-GLAPI void APIENTRY glDeleteProgramsARB (GLsizei, const GLuint *);
-GLAPI void APIENTRY glGenProgramsARB (GLsizei, GLuint *);
-GLAPI void APIENTRY glProgramEnvParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glProgramEnvParameter4dvARB (GLenum, GLuint, const GLdouble *);
-GLAPI void APIENTRY glProgramEnvParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glProgramEnvParameter4fvARB (GLenum, GLuint, const GLfloat *);
-GLAPI void APIENTRY glProgramLocalParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glProgramLocalParameter4dvARB (GLenum, GLuint, const GLdouble *);
-GLAPI void APIENTRY glProgramLocalParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glProgramLocalParameter4fvARB (GLenum, GLuint, const GLfloat *);
-GLAPI void APIENTRY glGetProgramEnvParameterdvARB (GLenum, GLuint, GLdouble *);
-GLAPI void APIENTRY glGetProgramEnvParameterfvARB (GLenum, GLuint, GLfloat *);
-GLAPI void APIENTRY glGetProgramLocalParameterdvARB (GLenum, GLuint, GLdouble *);
-GLAPI void APIENTRY glGetProgramLocalParameterfvARB (GLenum, GLuint, GLfloat *);
-GLAPI void APIENTRY glGetProgramivARB (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetProgramStringARB (GLenum, GLenum, GLvoid *);
-GLAPI void APIENTRY glGetVertexAttribdvARB (GLuint, GLenum, GLdouble *);
-GLAPI void APIENTRY glGetVertexAttribfvARB (GLuint, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetVertexAttribivARB (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetVertexAttribPointervARB (GLuint, GLenum, GLvoid* *);
-GLAPI GLboolean APIENTRY glIsProgramARB (GLuint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index);
-typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index);
-typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const GLvoid *string);
-typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program);
-typedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint *programs);
-typedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint *programs);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, GLvoid *string);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid* *pointer);
-typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program);
-#endif
-
-#ifndef GL_ARB_fragment_program
-#define GL_ARB_fragment_program 1
-/* All ARB_fragment_program entry points are shared with ARB_vertex_program. */
-#endif
-
-#ifndef GL_ARB_vertex_buffer_object
-#define GL_ARB_vertex_buffer_object 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBindBufferARB (GLenum, GLuint);
-GLAPI void APIENTRY glDeleteBuffersARB (GLsizei, const GLuint *);
-GLAPI void APIENTRY glGenBuffersARB (GLsizei, GLuint *);
-GLAPI GLboolean APIENTRY glIsBufferARB (GLuint);
-GLAPI void APIENTRY glBufferDataARB (GLenum, GLsizeiptrARB, const GLvoid *, GLenum);
-GLAPI void APIENTRY glBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, const GLvoid *);
-GLAPI void APIENTRY glGetBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, GLvoid *);
-GLAPI GLvoid* APIENTRY glMapBufferARB (GLenum, GLenum);
-GLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum);
-GLAPI void APIENTRY glGetBufferParameterivARB (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetBufferPointervARB (GLenum, GLenum, GLvoid* *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer);
-typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers);
-typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers);
-typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC) (GLuint buffer);
-typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage);
-typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data);
-typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data);
-typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access);
-typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid* *params);
-#endif
-
-#ifndef GL_ARB_occlusion_query
-#define GL_ARB_occlusion_query 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGenQueriesARB (GLsizei, GLuint *);
-GLAPI void APIENTRY glDeleteQueriesARB (GLsizei, const GLuint *);
-GLAPI GLboolean APIENTRY glIsQueryARB (GLuint);
-GLAPI void APIENTRY glBeginQueryARB (GLenum, GLuint);
-GLAPI void APIENTRY glEndQueryARB (GLenum);
-GLAPI void APIENTRY glGetQueryivARB (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetQueryObjectivARB (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetQueryObjectuivARB (GLuint, GLenum, GLuint *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint *ids);
-typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint *ids);
-typedef GLboolean (APIENTRYP PFNGLISQUERYARBPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id);
-typedef void (APIENTRYP PFNGLENDQUERYARBPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint *params);
-#endif
-
-#ifndef GL_ARB_shader_objects
-#define GL_ARB_shader_objects 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDeleteObjectARB (GLhandleARB);
-GLAPI GLhandleARB APIENTRY glGetHandleARB (GLenum);
-GLAPI void APIENTRY glDetachObjectARB (GLhandleARB, GLhandleARB);
-GLAPI GLhandleARB APIENTRY glCreateShaderObjectARB (GLenum);
-GLAPI void APIENTRY glShaderSourceARB (GLhandleARB, GLsizei, const GLcharARB* *, const GLint *);
-GLAPI void APIENTRY glCompileShaderARB (GLhandleARB);
-GLAPI GLhandleARB APIENTRY glCreateProgramObjectARB (void);
-GLAPI void APIENTRY glAttachObjectARB (GLhandleARB, GLhandleARB);
-GLAPI void APIENTRY glLinkProgramARB (GLhandleARB);
-GLAPI void APIENTRY glUseProgramObjectARB (GLhandleARB);
-GLAPI void APIENTRY glValidateProgramARB (GLhandleARB);
-GLAPI void APIENTRY glUniform1fARB (GLint, GLfloat);
-GLAPI void APIENTRY glUniform2fARB (GLint, GLfloat, GLfloat);
-GLAPI void APIENTRY glUniform3fARB (GLint, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glUniform4fARB (GLint, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glUniform1iARB (GLint, GLint);
-GLAPI void APIENTRY glUniform2iARB (GLint, GLint, GLint);
-GLAPI void APIENTRY glUniform3iARB (GLint, GLint, GLint, GLint);
-GLAPI void APIENTRY glUniform4iARB (GLint, GLint, GLint, GLint, GLint);
-GLAPI void APIENTRY glUniform1fvARB (GLint, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glUniform2fvARB (GLint, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glUniform3fvARB (GLint, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glUniform4fvARB (GLint, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glUniform1ivARB (GLint, GLsizei, const GLint *);
-GLAPI void APIENTRY glUniform2ivARB (GLint, GLsizei, const GLint *);
-GLAPI void APIENTRY glUniform3ivARB (GLint, GLsizei, const GLint *);
-GLAPI void APIENTRY glUniform4ivARB (GLint, GLsizei, const GLint *);
-GLAPI void APIENTRY glUniformMatrix2fvARB (GLint, GLsizei, GLboolean, const GLfloat *);
-GLAPI void APIENTRY glUniformMatrix3fvARB (GLint, GLsizei, GLboolean, const GLfloat *);
-GLAPI void APIENTRY glUniformMatrix4fvARB (GLint, GLsizei, GLboolean, const GLfloat *);
-GLAPI void APIENTRY glGetObjectParameterfvARB (GLhandleARB, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetObjectParameterivARB (GLhandleARB, GLenum, GLint *);
-GLAPI void APIENTRY glGetInfoLogARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *);
-GLAPI void APIENTRY glGetAttachedObjectsARB (GLhandleARB, GLsizei, GLsizei *, GLhandleARB *);
-GLAPI GLint APIENTRY glGetUniformLocationARB (GLhandleARB, const GLcharARB *);
-GLAPI void APIENTRY glGetActiveUniformARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *);
-GLAPI void APIENTRY glGetUniformfvARB (GLhandleARB, GLint, GLfloat *);
-GLAPI void APIENTRY glGetUniformivARB (GLhandleARB, GLint, GLint *);
-GLAPI void APIENTRY glGetShaderSourceARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj);
-typedef GLhandleARB (APIENTRYP PFNGLGETHANDLEARBPROC) (GLenum pname);
-typedef void (APIENTRYP PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj);
-typedef GLhandleARB (APIENTRYP PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType);
-typedef void (APIENTRYP PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB* *string, const GLint *length);
-typedef void (APIENTRYP PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj);
-typedef GLhandleARB (APIENTRYP PFNGLCREATEPROGRAMOBJECTARBPROC) (void);
-typedef void (APIENTRYP PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj);
-typedef void (APIENTRYP PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj);
-typedef void (APIENTRYP PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj);
-typedef void (APIENTRYP PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj);
-typedef void (APIENTRYP PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0);
-typedef void (APIENTRYP PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1);
-typedef void (APIENTRYP PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-typedef void (APIENTRYP PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-typedef void (APIENTRYP PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0);
-typedef void (APIENTRYP PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1);
-typedef void (APIENTRYP PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2);
-typedef void (APIENTRYP PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-typedef void (APIENTRYP PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog);
-typedef void (APIENTRYP PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj);
-typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name);
-typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
-typedef void (APIENTRYP PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint *params);
-typedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source);
-#endif
-
-#ifndef GL_ARB_vertex_shader
-#define GL_ARB_vertex_shader 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBindAttribLocationARB (GLhandleARB, GLuint, const GLcharARB *);
-GLAPI void APIENTRY glGetActiveAttribARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *);
-GLAPI GLint APIENTRY glGetAttribLocationARB (GLhandleARB, const GLcharARB *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB *name);
-typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
-typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name);
-#endif
-
-#ifndef GL_ARB_fragment_shader
-#define GL_ARB_fragment_shader 1
-#endif
-
-#ifndef GL_ARB_shading_language_100
-#define GL_ARB_shading_language_100 1
-#endif
-
-#ifndef GL_ARB_texture_non_power_of_two
-#define GL_ARB_texture_non_power_of_two 1
-#endif
-
-#ifndef GL_ARB_point_sprite
-#define GL_ARB_point_sprite 1
-#endif
-
-#ifndef GL_ARB_fragment_program_shadow
-#define GL_ARB_fragment_program_shadow 1
-#endif
-
-#ifndef GL_ARB_draw_buffers
-#define GL_ARB_draw_buffers 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawBuffersARB (GLsizei, const GLenum *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum *bufs);
-#endif
-
-#ifndef GL_ARB_texture_rectangle
-#define GL_ARB_texture_rectangle 1
-#endif
-
-#ifndef GL_ARB_color_buffer_float
-#define GL_ARB_color_buffer_float 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glClampColorARB (GLenum, GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp);
-#endif
-
-#ifndef GL_ARB_half_float_pixel
-#define GL_ARB_half_float_pixel 1
-#endif
-
-#ifndef GL_ARB_texture_float
-#define GL_ARB_texture_float 1
-#endif
-
-#ifndef GL_ARB_pixel_buffer_object
-#define GL_ARB_pixel_buffer_object 1
-#endif
-
-#ifndef GL_EXT_abgr
-#define GL_EXT_abgr 1
-#endif
-
-#ifndef GL_EXT_blend_color
-#define GL_EXT_blend_color 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendColorEXT (GLclampf, GLclampf, GLclampf, GLclampf);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
-#endif
-
-#ifndef GL_EXT_polygon_offset
-#define GL_EXT_polygon_offset 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPolygonOffsetEXT (GLfloat, GLfloat);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias);
-#endif
-
-#ifndef GL_EXT_texture
-#define GL_EXT_texture 1
-#endif
-
-#ifndef GL_EXT_texture3D
-#define GL_EXT_texture3D 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTexImage3DEXT (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
-#endif
-
-#ifndef GL_SGIS_texture_filter4
-#define GL_SGIS_texture_filter4 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGetTexFilterFuncSGIS (GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glTexFilterFuncSGIS (GLenum, GLenum, GLsizei, const GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights);
-typedef void (APIENTRYP PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights);
-#endif
-
-#ifndef GL_EXT_subtexture
-#define GL_EXT_subtexture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTexSubImage1DEXT (GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
-#endif
-
-#ifndef GL_EXT_copy_texture
-#define GL_EXT_copy_texture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glCopyTexImage1DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint);
-GLAPI void APIENTRY glCopyTexImage2DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint);
-GLAPI void APIENTRY glCopyTexSubImage1DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei);
-GLAPI void APIENTRY glCopyTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
-GLAPI void APIENTRY glCopyTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
-typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-#endif
-
-#ifndef GL_EXT_histogram
-#define GL_EXT_histogram 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGetHistogramEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *);
-GLAPI void APIENTRY glGetHistogramParameterfvEXT (GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetHistogramParameterivEXT (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetMinmaxEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *);
-GLAPI void APIENTRY glGetMinmaxParameterfvEXT (GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetMinmaxParameterivEXT (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glHistogramEXT (GLenum, GLsizei, GLenum, GLboolean);
-GLAPI void APIENTRY glMinmaxEXT (GLenum, GLenum, GLboolean);
-GLAPI void APIENTRY glResetHistogramEXT (GLenum);
-GLAPI void APIENTRY glResetMinmaxEXT (GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
-typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
-typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
-typedef void (APIENTRYP PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink);
-typedef void (APIENTRYP PFNGLRESETHISTOGRAMEXTPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLRESETMINMAXEXTPROC) (GLenum target);
-#endif
-
-#ifndef GL_EXT_convolution
-#define GL_EXT_convolution 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glConvolutionParameterfEXT (GLenum, GLenum, GLfloat);
-GLAPI void APIENTRY glConvolutionParameterfvEXT (GLenum, GLenum, const GLfloat *);
-GLAPI void APIENTRY glConvolutionParameteriEXT (GLenum, GLenum, GLint);
-GLAPI void APIENTRY glConvolutionParameterivEXT (GLenum, GLenum, const GLint *);
-GLAPI void APIENTRY glCopyConvolutionFilter1DEXT (GLenum, GLenum, GLint, GLint, GLsizei);
-GLAPI void APIENTRY glCopyConvolutionFilter2DEXT (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei);
-GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum, GLenum, GLenum, GLvoid *);
-GLAPI void APIENTRY glGetConvolutionParameterfvEXT (GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *);
-GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
-typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image);
-typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
-typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
-#endif
-
-#ifndef GL_SGI_color_matrix
-#define GL_SGI_color_matrix 1
-#endif
-
-#ifndef GL_SGI_color_table
-#define GL_SGI_color_table 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glColorTableSGI (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glColorTableParameterfvSGI (GLenum, GLenum, const GLfloat *);
-GLAPI void APIENTRY glColorTableParameterivSGI (GLenum, GLenum, const GLint *);
-GLAPI void APIENTRY glCopyColorTableSGI (GLenum, GLenum, GLint, GLint, GLsizei);
-GLAPI void APIENTRY glGetColorTableSGI (GLenum, GLenum, GLenum, GLvoid *);
-GLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum, GLenum, GLint *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
-typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRYP PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params);
-#endif
-
-#ifndef GL_SGIX_pixel_texture
-#define GL_SGIX_pixel_texture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPixelTexGenSGIX (GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC) (GLenum mode);
-#endif
-
-#ifndef GL_SGIS_pixel_texture
-#define GL_SGIS_pixel_texture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPixelTexGenParameteriSGIS (GLenum, GLint);
-GLAPI void APIENTRY glPixelTexGenParameterivSGIS (GLenum, const GLint *);
-GLAPI void APIENTRY glPixelTexGenParameterfSGIS (GLenum, GLfloat);
-GLAPI void APIENTRY glPixelTexGenParameterfvSGIS (GLenum, const GLfloat *);
-GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum, GLint *);
-GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum, GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat *params);
-#endif
-
-#ifndef GL_SGIS_texture4D
-#define GL_SGIS_texture4D 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTexImage4DSGIS (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glTexSubImage4DSGIS (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels);
-#endif
-
-#ifndef GL_SGI_texture_color_table
-#define GL_SGI_texture_color_table 1
-#endif
-
-#ifndef GL_EXT_cmyka
-#define GL_EXT_cmyka 1
-#endif
-
-#ifndef GL_EXT_texture_object
-#define GL_EXT_texture_object 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLboolean APIENTRY glAreTexturesResidentEXT (GLsizei, const GLuint *, GLboolean *);
-GLAPI void APIENTRY glBindTextureEXT (GLenum, GLuint);
-GLAPI void APIENTRY glDeleteTexturesEXT (GLsizei, const GLuint *);
-GLAPI void APIENTRY glGenTexturesEXT (GLsizei, GLuint *);
-GLAPI GLboolean APIENTRY glIsTextureEXT (GLuint);
-GLAPI void APIENTRY glPrioritizeTexturesEXT (GLsizei, const GLuint *, const GLclampf *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences);
-typedef void (APIENTRYP PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture);
-typedef void (APIENTRYP PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures);
-typedef void (APIENTRYP PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures);
-typedef GLboolean (APIENTRYP PFNGLISTEXTUREEXTPROC) (GLuint texture);
-typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities);
-#endif
-
-#ifndef GL_SGIS_detail_texture
-#define GL_SGIS_detail_texture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDetailTexFuncSGIS (GLenum, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum, GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points);
-typedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points);
-#endif
-
-#ifndef GL_SGIS_sharpen_texture
-#define GL_SGIS_sharpen_texture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glSharpenTexFuncSGIS (GLenum, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum, GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points);
-typedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points);
-#endif
-
-#ifndef GL_EXT_packed_pixels
-#define GL_EXT_packed_pixels 1
-#endif
-
-#ifndef GL_SGIS_texture_lod
-#define GL_SGIS_texture_lod 1
-#endif
-
-#ifndef GL_SGIS_multisample
-#define GL_SGIS_multisample 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glSampleMaskSGIS (GLclampf, GLboolean);
-GLAPI void APIENTRY glSamplePatternSGIS (GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert);
-typedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern);
-#endif
-
-#ifndef GL_EXT_rescale_normal
-#define GL_EXT_rescale_normal 1
-#endif
-
-#ifndef GL_EXT_vertex_array
-#define GL_EXT_vertex_array 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glArrayElementEXT (GLint);
-GLAPI void APIENTRY glColorPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glDrawArraysEXT (GLenum, GLint, GLsizei);
-GLAPI void APIENTRY glEdgeFlagPointerEXT (GLsizei, GLsizei, const GLboolean *);
-GLAPI void APIENTRY glGetPointervEXT (GLenum, GLvoid* *);
-GLAPI void APIENTRY glIndexPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glNormalPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glTexCoordPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glVertexPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLARRAYELEMENTEXTPROC) (GLint i);
-typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count);
-typedef void (APIENTRYP PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean *pointer);
-typedef void (APIENTRYP PFNGLGETPOINTERVEXTPROC) (GLenum pname, GLvoid* *params);
-typedef void (APIENTRYP PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-#endif
-
-#ifndef GL_EXT_misc_attribute
-#define GL_EXT_misc_attribute 1
-#endif
-
-#ifndef GL_SGIS_generate_mipmap
-#define GL_SGIS_generate_mipmap 1
-#endif
-
-#ifndef GL_SGIX_clipmap
-#define GL_SGIX_clipmap 1
-#endif
-
-#ifndef GL_SGIX_shadow
-#define GL_SGIX_shadow 1
-#endif
-
-#ifndef GL_SGIS_texture_edge_clamp
-#define GL_SGIS_texture_edge_clamp 1
-#endif
-
-#ifndef GL_SGIS_texture_border_clamp
-#define GL_SGIS_texture_border_clamp 1
-#endif
-
-#ifndef GL_EXT_blend_minmax
-#define GL_EXT_blend_minmax 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendEquationEXT (GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC) (GLenum mode);
-#endif
-
-#ifndef GL_EXT_blend_subtract
-#define GL_EXT_blend_subtract 1
-#endif
-
-#ifndef GL_EXT_blend_logic_op
-#define GL_EXT_blend_logic_op 1
-#endif
-
-#ifndef GL_SGIX_interlace
-#define GL_SGIX_interlace 1
-#endif
-
-#ifndef GL_SGIX_pixel_tiles
-#define GL_SGIX_pixel_tiles 1
-#endif
-
-#ifndef GL_SGIX_texture_select
-#define GL_SGIX_texture_select 1
-#endif
-
-#ifndef GL_SGIX_sprite
-#define GL_SGIX_sprite 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glSpriteParameterfSGIX (GLenum, GLfloat);
-GLAPI void APIENTRY glSpriteParameterfvSGIX (GLenum, const GLfloat *);
-GLAPI void APIENTRY glSpriteParameteriSGIX (GLenum, GLint);
-GLAPI void APIENTRY glSpriteParameterivSGIX (GLenum, const GLint *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *params);
-#endif
-
-#ifndef GL_SGIX_texture_multi_buffer
-#define GL_SGIX_texture_multi_buffer 1
-#endif
-
-#ifndef GL_EXT_point_parameters
-#define GL_EXT_point_parameters 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPointParameterfEXT (GLenum, GLfloat);
-GLAPI void APIENTRY glPointParameterfvEXT (GLenum, const GLfloat *);
-/* ERO Begin */
-GLAPI void APIENTRY glPointParameteriEXT (GLenum, GLint);
-GLAPI void APIENTRY glPointParameterivEXT (GLenum, const GLint *);
-/* ERO end */
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params);
-#endif
-
-#ifndef GL_SGIS_point_parameters
-#define GL_SGIS_point_parameters 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPointParameterfSGIS (GLenum, GLfloat);
-GLAPI void APIENTRY glPointParameterfvSGIS (GLenum, const GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params);
-#endif
-
-#ifndef GL_SGIX_instruments
-#define GL_SGIX_instruments 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLint APIENTRY glGetInstrumentsSGIX (void);
-GLAPI void APIENTRY glInstrumentsBufferSGIX (GLsizei, GLint *);
-GLAPI GLint APIENTRY glPollInstrumentsSGIX (GLint *);
-GLAPI void APIENTRY glReadInstrumentsSGIX (GLint);
-GLAPI void APIENTRY glStartInstrumentsSGIX (void);
-GLAPI void APIENTRY glStopInstrumentsSGIX (GLint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLint (APIENTRYP PFNGLGETINSTRUMENTSSGIXPROC) (void);
-typedef void (APIENTRYP PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer);
-typedef GLint (APIENTRYP PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *marker_p);
-typedef void (APIENTRYP PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker);
-typedef void (APIENTRYP PFNGLSTARTINSTRUMENTSSGIXPROC) (void);
-typedef void (APIENTRYP PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker);
-#endif
-
-#ifndef GL_SGIX_texture_scale_bias
-#define GL_SGIX_texture_scale_bias 1
-#endif
-
-#ifndef GL_SGIX_framezoom
-#define GL_SGIX_framezoom 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFrameZoomSGIX (GLint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLFRAMEZOOMSGIXPROC) (GLint factor);
-#endif
-
-#ifndef GL_SGIX_tag_sample_buffer
-#define GL_SGIX_tag_sample_buffer 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTagSampleBufferSGIX (void);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTAGSAMPLEBUFFERSGIXPROC) (void);
-#endif
-
-#ifndef GL_SGIX_polynomial_ffd
-#define GL_SGIX_polynomial_ffd 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDeformationMap3dSGIX (GLenum, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, const GLdouble *);
-GLAPI void APIENTRY glDeformationMap3fSGIX (GLenum, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, const GLfloat *);
-GLAPI void APIENTRY glDeformSGIX (GLbitfield);
-GLAPI void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points);
-typedef void (APIENTRYP PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points);
-typedef void (APIENTRYP PFNGLDEFORMSGIXPROC) (GLbitfield mask);
-typedef void (APIENTRYP PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask);
-#endif
-
-#ifndef GL_SGIX_reference_plane
-#define GL_SGIX_reference_plane 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation);
-#endif
-
-#ifndef GL_SGIX_flush_raster
-#define GL_SGIX_flush_raster 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFlushRasterSGIX (void);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLFLUSHRASTERSGIXPROC) (void);
-#endif
-
-#ifndef GL_SGIX_depth_texture
-#define GL_SGIX_depth_texture 1
-#endif
-
-#ifndef GL_SGIS_fog_function
-#define GL_SGIS_fog_function 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFogFuncSGIS (GLsizei, const GLfloat *);
-GLAPI void APIENTRY glGetFogFuncSGIS (GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points);
-typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC) (GLfloat *points);
-#endif
-
-#ifndef GL_SGIX_fog_offset
-#define GL_SGIX_fog_offset 1
-#endif
-
-#ifndef GL_HP_image_transform
-#define GL_HP_image_transform 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glImageTransformParameteriHP (GLenum, GLenum, GLint);
-GLAPI void APIENTRY glImageTransformParameterfHP (GLenum, GLenum, GLfloat);
-GLAPI void APIENTRY glImageTransformParameterivHP (GLenum, GLenum, const GLint *);
-GLAPI void APIENTRY glImageTransformParameterfvHP (GLenum, GLenum, const GLfloat *);
-GLAPI void APIENTRY glGetImageTransformParameterivHP (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum, GLenum, GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, GLfloat *params);
-#endif
-
-#ifndef GL_HP_convolution_border_modes
-#define GL_HP_convolution_border_modes 1
-#endif
-
-#ifndef GL_SGIX_texture_add_env
-#define GL_SGIX_texture_add_env 1
-#endif
-
-#ifndef GL_EXT_color_subtable
-#define GL_EXT_color_subtable 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glColorSubTableEXT (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum, GLsizei, GLint, GLint, GLsizei);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
-#endif
-
-#ifndef GL_PGI_vertex_hints
-#define GL_PGI_vertex_hints 1
-#endif
-
-#ifndef GL_PGI_misc_hints
-#define GL_PGI_misc_hints 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glHintPGI (GLenum, GLint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLHINTPGIPROC) (GLenum target, GLint mode);
-#endif
-
-#ifndef GL_EXT_paletted_texture
-#define GL_EXT_paletted_texture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glColorTableEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glGetColorTableEXT (GLenum, GLenum, GLenum, GLvoid *);
-GLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum, GLenum, GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
-#endif
-
-#ifndef GL_EXT_clip_volume_hint
-#define GL_EXT_clip_volume_hint 1
-#endif
-
-#ifndef GL_SGIX_list_priority
-#define GL_SGIX_list_priority 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGetListParameterfvSGIX (GLuint, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetListParameterivSGIX (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glListParameterfSGIX (GLuint, GLenum, GLfloat);
-GLAPI void APIENTRY glListParameterfvSGIX (GLuint, GLenum, const GLfloat *);
-GLAPI void APIENTRY glListParameteriSGIX (GLuint, GLenum, GLint);
-GLAPI void APIENTRY glListParameterivSGIX (GLuint, GLenum, const GLint *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint *params);
-#endif
-
-#ifndef GL_SGIX_ir_instrument1
-#define GL_SGIX_ir_instrument1 1
-#endif
-
-#ifndef GL_SGIX_calligraphic_fragment
-#define GL_SGIX_calligraphic_fragment 1
-#endif
-
-#ifndef GL_SGIX_texture_lod_bias
-#define GL_SGIX_texture_lod_bias 1
-#endif
-
-#ifndef GL_SGIX_shadow_ambient
-#define GL_SGIX_shadow_ambient 1
-#endif
-
-#ifndef GL_EXT_index_texture
-#define GL_EXT_index_texture 1
-#endif
-
-#ifndef GL_EXT_index_material
-#define GL_EXT_index_material 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glIndexMaterialEXT (GLenum, GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode);
-#endif
-
-#ifndef GL_EXT_index_func
-#define GL_EXT_index_func 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glIndexFuncEXT (GLenum, GLclampf);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref);
-#endif
-
-#ifndef GL_EXT_index_array_formats
-#define GL_EXT_index_array_formats 1
-#endif
-
-#ifndef GL_EXT_compiled_vertex_array
-#define GL_EXT_compiled_vertex_array 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glLockArraysEXT (GLint, GLsizei);
-GLAPI void APIENTRY glUnlockArraysEXT (void);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count);
-typedef void (APIENTRYP PFNGLUNLOCKARRAYSEXTPROC) (void);
-#endif
-
-#ifndef GL_EXT_cull_vertex
-#define GL_EXT_cull_vertex 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glCullParameterdvEXT (GLenum, GLdouble *);
-GLAPI void APIENTRY glCullParameterfvEXT (GLenum, GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params);
-typedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params);
-#endif
-
-#ifndef GL_SGIX_ycrcb
-#define GL_SGIX_ycrcb 1
-#endif
-
-#ifndef GL_SGIX_fragment_lighting
-#define GL_SGIX_fragment_lighting 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFragmentColorMaterialSGIX (GLenum, GLenum);
-GLAPI void APIENTRY glFragmentLightfSGIX (GLenum, GLenum, GLfloat);
-GLAPI void APIENTRY glFragmentLightfvSGIX (GLenum, GLenum, const GLfloat *);
-GLAPI void APIENTRY glFragmentLightiSGIX (GLenum, GLenum, GLint);
-GLAPI void APIENTRY glFragmentLightivSGIX (GLenum, GLenum, const GLint *);
-GLAPI void APIENTRY glFragmentLightModelfSGIX (GLenum, GLfloat);
-GLAPI void APIENTRY glFragmentLightModelfvSGIX (GLenum, const GLfloat *);
-GLAPI void APIENTRY glFragmentLightModeliSGIX (GLenum, GLint);
-GLAPI void APIENTRY glFragmentLightModelivSGIX (GLenum, const GLint *);
-GLAPI void APIENTRY glFragmentMaterialfSGIX (GLenum, GLenum, GLfloat);
-GLAPI void APIENTRY glFragmentMaterialfvSGIX (GLenum, GLenum, const GLfloat *);
-GLAPI void APIENTRY glFragmentMaterialiSGIX (GLenum, GLenum, GLint);
-GLAPI void APIENTRY glFragmentMaterialivSGIX (GLenum, GLenum, const GLint *);
-GLAPI void APIENTRY glGetFragmentLightfvSGIX (GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetFragmentLightivSGIX (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetFragmentMaterialfvSGIX (GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetFragmentMaterialivSGIX (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glLightEnviSGIX (GLenum, GLint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param);
-#endif
-
-#ifndef GL_IBM_rasterpos_clip
-#define GL_IBM_rasterpos_clip 1
-#endif
-
-#ifndef GL_HP_texture_lighting
-#define GL_HP_texture_lighting 1
-#endif
-
-#ifndef GL_EXT_draw_range_elements
-#define GL_EXT_draw_range_elements 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
-#endif
-
-#ifndef GL_WIN_phong_shading
-#define GL_WIN_phong_shading 1
-#endif
-
-#ifndef GL_WIN_specular_fog
-#define GL_WIN_specular_fog 1
-#endif
-
-#ifndef GL_EXT_light_texture
-#define GL_EXT_light_texture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glApplyTextureEXT (GLenum);
-GLAPI void APIENTRY glTextureLightEXT (GLenum);
-GLAPI void APIENTRY glTextureMaterialEXT (GLenum, GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode);
-typedef void (APIENTRYP PFNGLTEXTURELIGHTEXTPROC) (GLenum pname);
-typedef void (APIENTRYP PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode);
-#endif
-
-#ifndef GL_SGIX_blend_alpha_minmax
-#define GL_SGIX_blend_alpha_minmax 1
-#endif
-
-#ifndef GL_EXT_bgra
-#define GL_EXT_bgra 1
-#endif
-
-#ifndef GL_SGIX_async
-#define GL_SGIX_async 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glAsyncMarkerSGIX (GLuint);
-GLAPI GLint APIENTRY glFinishAsyncSGIX (GLuint *);
-GLAPI GLint APIENTRY glPollAsyncSGIX (GLuint *);
-GLAPI GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei);
-GLAPI void APIENTRY glDeleteAsyncMarkersSGIX (GLuint, GLsizei);
-GLAPI GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLASYNCMARKERSGIXPROC) (GLuint marker);
-typedef GLint (APIENTRYP PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp);
-typedef GLint (APIENTRYP PFNGLPOLLASYNCSGIXPROC) (GLuint *markerp);
-typedef GLuint (APIENTRYP PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range);
-typedef void (APIENTRYP PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range);
-typedef GLboolean (APIENTRYP PFNGLISASYNCMARKERSGIXPROC) (GLuint marker);
-#endif
-
-#ifndef GL_SGIX_async_pixel
-#define GL_SGIX_async_pixel 1
-#endif
-
-#ifndef GL_SGIX_async_histogram
-#define GL_SGIX_async_histogram 1
-#endif
-
-#ifndef GL_INTEL_parallel_arrays
-#define GL_INTEL_parallel_arrays 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexPointervINTEL (GLint, GLenum, const GLvoid* *);
-GLAPI void APIENTRY glNormalPointervINTEL (GLenum, const GLvoid* *);
-GLAPI void APIENTRY glColorPointervINTEL (GLint, GLenum, const GLvoid* *);
-GLAPI void APIENTRY glTexCoordPointervINTEL (GLint, GLenum, const GLvoid* *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);
-typedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const GLvoid* *pointer);
-typedef void (APIENTRYP PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);
-typedef void (APIENTRYP PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);
-#endif
-
-#ifndef GL_HP_occlusion_test
-#define GL_HP_occlusion_test 1
-#endif
-
-#ifndef GL_EXT_pixel_transform
-#define GL_EXT_pixel_transform 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPixelTransformParameteriEXT (GLenum, GLenum, GLint);
-GLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum, GLenum, GLfloat);
-GLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum, GLenum, const GLint *);
-GLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum, GLenum, const GLfloat *);
-/* ERO Begin */
-GLAPI void APIENTRY glGetPixelTransformParameterivEXT (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetPixelTransformParameterfvEXT (GLenum, GLenum, GLfloat *);
-/* ERO End */
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params);
-/* ERO Begin */
-typedef void (APIENTRYP PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
-/* ERO End */
-#endif
-
-#ifndef GL_EXT_pixel_transform_color_table
-#define GL_EXT_pixel_transform_color_table 1
-#endif
-
-#ifndef GL_EXT_shared_texture_palette
-#define GL_EXT_shared_texture_palette 1
-#endif
-
-#ifndef GL_EXT_separate_specular_color
-#define GL_EXT_separate_specular_color 1
-#endif
-
-#ifndef GL_EXT_secondary_color
-#define GL_EXT_secondary_color 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte, GLbyte, GLbyte);
-GLAPI void APIENTRY glSecondaryColor3bvEXT (const GLbyte *);
-GLAPI void APIENTRY glSecondaryColor3dEXT (GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glSecondaryColor3dvEXT (const GLdouble *);
-GLAPI void APIENTRY glSecondaryColor3fEXT (GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glSecondaryColor3fvEXT (const GLfloat *);
-GLAPI void APIENTRY glSecondaryColor3iEXT (GLint, GLint, GLint);
-GLAPI void APIENTRY glSecondaryColor3ivEXT (const GLint *);
-GLAPI void APIENTRY glSecondaryColor3sEXT (GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glSecondaryColor3svEXT (const GLshort *);
-GLAPI void APIENTRY glSecondaryColor3ubEXT (GLubyte, GLubyte, GLubyte);
-GLAPI void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *);
-GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *);
-GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort, GLushort, GLushort);
-GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *);
-GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint, GLenum, GLsizei, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-#endif
-
-#ifndef GL_EXT_texture_perturb_normal
-#define GL_EXT_texture_perturb_normal 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTextureNormalEXT (GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC) (GLenum mode);
-#endif
-
-#ifndef GL_EXT_multi_draw_arrays
-#define GL_EXT_multi_draw_arrays 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum, GLint *, GLsizei *, GLsizei);
-GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
-typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
-#endif
-
-#ifndef GL_EXT_fog_coord
-#define GL_EXT_fog_coord 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFogCoordfEXT (GLfloat);
-GLAPI void APIENTRY glFogCoordfvEXT (const GLfloat *);
-GLAPI void APIENTRY glFogCoorddEXT (GLdouble);
-GLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *);
-GLAPI void APIENTRY glFogCoordPointerEXT (GLenum, GLsizei, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC) (GLfloat coord);
-typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord);
-typedef void (APIENTRYP PFNGLFOGCOORDDEXTPROC) (GLdouble coord);
-typedef void (APIENTRYP PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord);
-typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
-#endif
-
-#ifndef GL_REND_screen_coordinates
-#define GL_REND_screen_coordinates 1
-#endif
-
-#ifndef GL_EXT_coordinate_frame
-#define GL_EXT_coordinate_frame 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTangent3bEXT (GLbyte, GLbyte, GLbyte);
-GLAPI void APIENTRY glTangent3bvEXT (const GLbyte *);
-GLAPI void APIENTRY glTangent3dEXT (GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glTangent3dvEXT (const GLdouble *);
-GLAPI void APIENTRY glTangent3fEXT (GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glTangent3fvEXT (const GLfloat *);
-GLAPI void APIENTRY glTangent3iEXT (GLint, GLint, GLint);
-GLAPI void APIENTRY glTangent3ivEXT (const GLint *);
-GLAPI void APIENTRY glTangent3sEXT (GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glTangent3svEXT (const GLshort *);
-GLAPI void APIENTRY glBinormal3bEXT (GLbyte, GLbyte, GLbyte);
-GLAPI void APIENTRY glBinormal3bvEXT (const GLbyte *);
-GLAPI void APIENTRY glBinormal3dEXT (GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glBinormal3dvEXT (const GLdouble *);
-GLAPI void APIENTRY glBinormal3fEXT (GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glBinormal3fvEXT (const GLfloat *);
-GLAPI void APIENTRY glBinormal3iEXT (GLint, GLint, GLint);
-GLAPI void APIENTRY glBinormal3ivEXT (const GLint *);
-GLAPI void APIENTRY glBinormal3sEXT (GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glBinormal3svEXT (const GLshort *);
-GLAPI void APIENTRY glTangentPointerEXT (GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glBinormalPointerEXT (GLenum, GLsizei, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz);
-typedef void (APIENTRYP PFNGLTANGENT3BVEXTPROC) (const GLbyte *v);
-typedef void (APIENTRYP PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz);
-typedef void (APIENTRYP PFNGLTANGENT3DVEXTPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz);
-typedef void (APIENTRYP PFNGLTANGENT3FVEXTPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz);
-typedef void (APIENTRYP PFNGLTANGENT3IVEXTPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz);
-typedef void (APIENTRYP PFNGLTANGENT3SVEXTPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz);
-typedef void (APIENTRYP PFNGLBINORMAL3BVEXTPROC) (const GLbyte *v);
-typedef void (APIENTRYP PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz);
-typedef void (APIENTRYP PFNGLBINORMAL3DVEXTPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz);
-typedef void (APIENTRYP PFNGLBINORMAL3FVEXTPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz);
-typedef void (APIENTRYP PFNGLBINORMAL3IVEXTPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz);
-typedef void (APIENTRYP PFNGLBINORMAL3SVEXTPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
-#endif
-
-#ifndef GL_EXT_texture_env_combine
-#define GL_EXT_texture_env_combine 1
-#endif
-
-#ifndef GL_APPLE_specular_vector
-#define GL_APPLE_specular_vector 1
-#endif
-
-#ifndef GL_APPLE_transform_hint
-#define GL_APPLE_transform_hint 1
-#endif
-
-#ifndef GL_SGIX_fog_scale
-#define GL_SGIX_fog_scale 1
-#endif
-
-#ifndef GL_SUNX_constant_data
-#define GL_SUNX_constant_data 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFinishTextureSUNX (void);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLFINISHTEXTURESUNXPROC) (void);
-#endif
-
-#ifndef GL_SUN_global_alpha
-#define GL_SUN_global_alpha 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGlobalAlphaFactorbSUN (GLbyte);
-GLAPI void APIENTRY glGlobalAlphaFactorsSUN (GLshort);
-GLAPI void APIENTRY glGlobalAlphaFactoriSUN (GLint);
-GLAPI void APIENTRY glGlobalAlphaFactorfSUN (GLfloat);
-GLAPI void APIENTRY glGlobalAlphaFactordSUN (GLdouble);
-GLAPI void APIENTRY glGlobalAlphaFactorubSUN (GLubyte);
-GLAPI void APIENTRY glGlobalAlphaFactorusSUN (GLushort);
-GLAPI void APIENTRY glGlobalAlphaFactoruiSUN (GLuint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor);
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor);
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor);
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor);
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor);
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor);
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor);
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor);
-#endif
-
-#ifndef GL_SUN_triangle_list
-#define GL_SUN_triangle_list 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glReplacementCodeuiSUN (GLuint);
-GLAPI void APIENTRY glReplacementCodeusSUN (GLushort);
-GLAPI void APIENTRY glReplacementCodeubSUN (GLubyte);
-GLAPI void APIENTRY glReplacementCodeuivSUN (const GLuint *);
-GLAPI void APIENTRY glReplacementCodeusvSUN (const GLushort *);
-GLAPI void APIENTRY glReplacementCodeubvSUN (const GLubyte *);
-GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum, GLsizei, const GLvoid* *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint *code);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort *code);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte *code);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const GLvoid* *pointer);
-#endif
-
-#ifndef GL_SUN_vertex
-#define GL_SUN_vertex 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glColor4ubVertex2fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat);
-GLAPI void APIENTRY glColor4ubVertex2fvSUN (const GLubyte *, const GLfloat *);
-GLAPI void APIENTRY glColor4ubVertex3fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glColor4ubVertex3fvSUN (const GLubyte *, const GLfloat *);
-GLAPI void APIENTRY glColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glColor3fVertex3fvSUN (const GLfloat *, const GLfloat *);
-GLAPI void APIENTRY glNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *);
-GLAPI void APIENTRY glColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *);
-GLAPI void APIENTRY glTexCoord2fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glTexCoord2fVertex3fvSUN (const GLfloat *, const GLfloat *);
-GLAPI void APIENTRY glTexCoord4fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glTexCoord4fVertex4fvSUN (const GLfloat *, const GLfloat *);
-GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fSUN (GLfloat, GLfloat, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fvSUN (const GLfloat *, const GLubyte *, const GLfloat *);
-GLAPI void APIENTRY glTexCoord2fColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glTexCoord2fColor3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *);
-GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *);
-GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *);
-GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *);
-GLAPI void APIENTRY glReplacementCodeuiVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLuint *, const GLfloat *);
-GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLuint, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLuint *, const GLubyte *, const GLfloat *);
-GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *);
-GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *);
-GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *);
-GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *);
-GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *);
-GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v);
-typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte *c, const GLfloat *v);
-typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *v);
-typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *v);
-typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *v);
-typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat *tc, const GLubyte *c, const GLfloat *v);
-typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *v);
-typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint *rc, const GLubyte *c, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-#endif
-
-#ifndef GL_EXT_blend_func_separate
-#define GL_EXT_blend_func_separate 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum, GLenum, GLenum, GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-#endif
-
-#ifndef GL_INGR_blend_func_separate
-#define GL_INGR_blend_func_separate 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum, GLenum, GLenum, GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-#endif
-
-#ifndef GL_INGR_color_clamp
-#define GL_INGR_color_clamp 1
-#endif
-
-#ifndef GL_INGR_interlace_read
-#define GL_INGR_interlace_read 1
-#endif
-
-#ifndef GL_EXT_stencil_wrap
-#define GL_EXT_stencil_wrap 1
-#endif
-
-#ifndef GL_EXT_422_pixels
-#define GL_EXT_422_pixels 1
-#endif
-
-#ifndef GL_NV_texgen_reflection
-#define GL_NV_texgen_reflection 1
-#endif
-
-#ifndef GL_SUN_convolution_border_modes
-#define GL_SUN_convolution_border_modes 1
-#endif
-
-#ifndef GL_EXT_texture_env_add
-#define GL_EXT_texture_env_add 1
-#endif
-
-#ifndef GL_EXT_texture_lod_bias
-#define GL_EXT_texture_lod_bias 1
-#endif
-
-#ifndef GL_EXT_texture_filter_anisotropic
-#define GL_EXT_texture_filter_anisotropic 1
-#endif
-
-#ifndef GL_EXT_vertex_weighting
-#define GL_EXT_vertex_weighting 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexWeightfEXT (GLfloat);
-GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *);
-GLAPI void APIENTRY glVertexWeightPointerEXT (GLsizei, GLenum, GLsizei, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight);
-typedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight);
-typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer);
-#endif
-
-#ifndef GL_NV_light_max_exponent
-#define GL_NV_light_max_exponent 1
-#endif
-
-#ifndef GL_NV_vertex_array_range
-#define GL_NV_vertex_array_range 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFlushVertexArrayRangeNV (void);
-GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void);
-typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const GLvoid *pointer);
-#endif
-
-#ifndef GL_NV_register_combiners
-#define GL_NV_register_combiners 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glCombinerParameterfvNV (GLenum, const GLfloat *);
-GLAPI void APIENTRY glCombinerParameterfNV (GLenum, GLfloat);
-GLAPI void APIENTRY glCombinerParameterivNV (GLenum, const GLint *);
-GLAPI void APIENTRY glCombinerParameteriNV (GLenum, GLint);
-GLAPI void APIENTRY glCombinerInputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum);
-GLAPI void APIENTRY glCombinerOutputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLboolean, GLboolean, GLboolean);
-GLAPI void APIENTRY glFinalCombinerInputNV (GLenum, GLenum, GLenum, GLenum);
-GLAPI void APIENTRY glGetCombinerInputParameterfvNV (GLenum, GLenum, GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetCombinerInputParameterivNV (GLenum, GLenum, GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetCombinerOutputParameterfvNV (GLenum, GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetCombinerOutputParameterivNV (GLenum, GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum, GLenum, GLint *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
-typedef void (APIENTRYP PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum);
-typedef void (APIENTRYP PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
-typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint *params);
-#endif
-
-#ifndef GL_NV_fog_distance
-#define GL_NV_fog_distance 1
-#endif
-
-#ifndef GL_NV_texgen_emboss
-#define GL_NV_texgen_emboss 1
-#endif
-
-#ifndef GL_NV_blend_square
-#define GL_NV_blend_square 1
-#endif
-
-#ifndef GL_NV_texture_env_combine4
-#define GL_NV_texture_env_combine4 1
-#endif
-
-#ifndef GL_MESA_resize_buffers
-#define GL_MESA_resize_buffers 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glResizeBuffersMESA (void);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLRESIZEBUFFERSMESAPROC) (void);
-#endif
-
-#ifndef GL_MESA_window_pos
-#define GL_MESA_window_pos 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glWindowPos2dMESA (GLdouble, GLdouble);
-GLAPI void APIENTRY glWindowPos2dvMESA (const GLdouble *);
-GLAPI void APIENTRY glWindowPos2fMESA (GLfloat, GLfloat);
-GLAPI void APIENTRY glWindowPos2fvMESA (const GLfloat *);
-GLAPI void APIENTRY glWindowPos2iMESA (GLint, GLint);
-GLAPI void APIENTRY glWindowPos2ivMESA (const GLint *);
-GLAPI void APIENTRY glWindowPos2sMESA (GLshort, GLshort);
-GLAPI void APIENTRY glWindowPos2svMESA (const GLshort *);
-GLAPI void APIENTRY glWindowPos3dMESA (GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glWindowPos3dvMESA (const GLdouble *);
-GLAPI void APIENTRY glWindowPos3fMESA (GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glWindowPos3fvMESA (const GLfloat *);
-GLAPI void APIENTRY glWindowPos3iMESA (GLint, GLint, GLint);
-GLAPI void APIENTRY glWindowPos3ivMESA (const GLint *);
-GLAPI void APIENTRY glWindowPos3sMESA (GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glWindowPos3svMESA (const GLshort *);
-GLAPI void APIENTRY glWindowPos4dMESA (GLdouble, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glWindowPos4dvMESA (const GLdouble *);
-GLAPI void APIENTRY glWindowPos4fMESA (GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glWindowPos4fvMESA (const GLfloat *);
-GLAPI void APIENTRY glWindowPos4iMESA (GLint, GLint, GLint, GLint);
-GLAPI void APIENTRY glWindowPos4ivMESA (const GLint *);
-GLAPI void APIENTRY glWindowPos4sMESA (GLshort, GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glWindowPos4svMESA (const GLshort *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2IVMESAPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2SVMESAPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3IVMESAPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3SVMESAPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w);
-typedef void (APIENTRYP PFNGLWINDOWPOS4IVMESAPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w);
-typedef void (APIENTRYP PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v);
-#endif
-
-#ifndef GL_IBM_cull_vertex
-#define GL_IBM_cull_vertex 1
-#endif
-
-#ifndef GL_IBM_multimode_draw_arrays
-#define GL_IBM_multimode_draw_arrays 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glMultiModeDrawArraysIBM (const GLenum *, const GLint *, const GLsizei *, GLsizei, GLint);
-GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *, const GLsizei *, GLenum, const GLvoid* const *, GLsizei, GLint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride);
-typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, GLint modestride);
-#endif
-
-#ifndef GL_IBM_vertex_array_lists
-#define GL_IBM_vertex_array_lists 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint);
-GLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint);
-GLAPI void APIENTRY glEdgeFlagPointerListIBM (GLint, const GLboolean* *, GLint);
-GLAPI void APIENTRY glFogCoordPointerListIBM (GLenum, GLint, const GLvoid* *, GLint);
-GLAPI void APIENTRY glIndexPointerListIBM (GLenum, GLint, const GLvoid* *, GLint);
-GLAPI void APIENTRY glNormalPointerListIBM (GLenum, GLint, const GLvoid* *, GLint);
-GLAPI void APIENTRY glTexCoordPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint);
-GLAPI void APIENTRY glVertexPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-typedef void (APIENTRYP PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean* *pointer, GLint ptrstride);
-typedef void (APIENTRYP PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-typedef void (APIENTRYP PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-typedef void (APIENTRYP PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-typedef void (APIENTRYP PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-typedef void (APIENTRYP PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-#endif
-
-#ifndef GL_SGIX_subsample
-#define GL_SGIX_subsample 1
-#endif
-
-#ifndef GL_SGIX_ycrcba
-#define GL_SGIX_ycrcba 1
-#endif
-
-#ifndef GL_SGIX_ycrcb_subsample
-#define GL_SGIX_ycrcb_subsample 1
-#endif
-
-#ifndef GL_SGIX_depth_pass_instrument
-#define GL_SGIX_depth_pass_instrument 1
-#endif
-
-#ifndef GL_3DFX_texture_compression_FXT1
-#define GL_3DFX_texture_compression_FXT1 1
-#endif
-
-#ifndef GL_3DFX_multisample
-#define GL_3DFX_multisample 1
-#endif
-
-#ifndef GL_3DFX_tbuffer
-#define GL_3DFX_tbuffer 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTbufferMask3DFX (GLuint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC) (GLuint mask);
-#endif
-
-#ifndef GL_EXT_multisample
-#define GL_EXT_multisample 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glSampleMaskEXT (GLclampf, GLboolean);
-GLAPI void APIENTRY glSamplePatternEXT (GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert);
-typedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern);
-#endif
-
-#ifndef GL_SGIX_vertex_preclip
-#define GL_SGIX_vertex_preclip 1
-#endif
-
-#ifndef GL_SGIX_convolution_accuracy
-#define GL_SGIX_convolution_accuracy 1
-#endif
-
-#ifndef GL_SGIX_resample
-#define GL_SGIX_resample 1
-#endif
-
-#ifndef GL_SGIS_point_line_texgen
-#define GL_SGIS_point_line_texgen 1
-#endif
-
-#ifndef GL_SGIS_texture_color_mask
-#define GL_SGIS_texture_color_mask 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTextureColorMaskSGIS (GLboolean, GLboolean, GLboolean, GLboolean);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
-#endif
-
-#ifndef GL_SGIX_igloo_interface
-#define GL_SGIX_igloo_interface 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid *params);
-#endif
-
-#ifndef GL_EXT_texture_env_dot3
-#define GL_EXT_texture_env_dot3 1
-#endif
-
-#ifndef GL_ATI_texture_mirror_once
-#define GL_ATI_texture_mirror_once 1
-#endif
-
-#ifndef GL_NV_fence
-#define GL_NV_fence 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDeleteFencesNV (GLsizei, const GLuint *);
-GLAPI void APIENTRY glGenFencesNV (GLsizei, GLuint *);
-GLAPI GLboolean APIENTRY glIsFenceNV (GLuint);
-GLAPI GLboolean APIENTRY glTestFenceNV (GLuint);
-GLAPI void APIENTRY glGetFenceivNV (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glFinishFenceNV (GLuint);
-GLAPI void APIENTRY glSetFenceNV (GLuint, GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences);
-typedef void (APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences);
-typedef GLboolean (APIENTRYP PFNGLISFENCENVPROC) (GLuint fence);
-typedef GLboolean (APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence);
-typedef void (APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence);
-typedef void (APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition);
-#endif
-
-#ifndef GL_NV_evaluators
-#define GL_NV_evaluators 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLint, GLint, GLboolean, const GLvoid *);
-GLAPI void APIENTRY glMapParameterivNV (GLenum, GLenum, const GLint *);
-GLAPI void APIENTRY glMapParameterfvNV (GLenum, GLenum, const GLfloat *);
-GLAPI void APIENTRY glGetMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLboolean, GLvoid *);
-GLAPI void APIENTRY glGetMapParameterivNV (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetMapParameterfvNV (GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetMapAttribParameterivNV (GLenum, GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetMapAttribParameterfvNV (GLenum, GLuint, GLenum, GLfloat *);
-GLAPI void APIENTRY glEvalMapsNV (GLenum, GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points);
-typedef void (APIENTRYP PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points);
-typedef void (APIENTRYP PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode);
-#endif
-
-#ifndef GL_NV_packed_depth_stencil
-#define GL_NV_packed_depth_stencil 1
-#endif
-
-#ifndef GL_NV_register_combiners2
-#define GL_NV_register_combiners2 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glCombinerStageParameterfvNV (GLenum, GLenum, const GLfloat *);
-GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum, GLenum, GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat *params);
-#endif
-
-#ifndef GL_NV_texture_compression_vtc
-#define GL_NV_texture_compression_vtc 1
-#endif
-
-#ifndef GL_NV_texture_rectangle
-#define GL_NV_texture_rectangle 1
-#endif
-
-#ifndef GL_NV_texture_shader
-#define GL_NV_texture_shader 1
-#endif
-
-#ifndef GL_NV_texture_shader2
-#define GL_NV_texture_shader2 1
-#endif
-
-#ifndef GL_NV_vertex_array_range2
-#define GL_NV_vertex_array_range2 1
-#endif
-
-#ifndef GL_NV_vertex_program
-#define GL_NV_vertex_program 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei, const GLuint *, GLboolean *);
-GLAPI void APIENTRY glBindProgramNV (GLenum, GLuint);
-GLAPI void APIENTRY glDeleteProgramsNV (GLsizei, const GLuint *);
-GLAPI void APIENTRY glExecuteProgramNV (GLenum, GLuint, const GLfloat *);
-GLAPI void APIENTRY glGenProgramsNV (GLsizei, GLuint *);
-GLAPI void APIENTRY glGetProgramParameterdvNV (GLenum, GLuint, GLenum, GLdouble *);
-GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum, GLuint, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetProgramivNV (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetProgramStringNV (GLuint, GLenum, GLubyte *);
-GLAPI void APIENTRY glGetTrackMatrixivNV (GLenum, GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetVertexAttribdvNV (GLuint, GLenum, GLdouble *);
-GLAPI void APIENTRY glGetVertexAttribfvNV (GLuint, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetVertexAttribivNV (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint, GLenum, GLvoid* *);
-GLAPI GLboolean APIENTRY glIsProgramNV (GLuint);
-GLAPI void APIENTRY glLoadProgramNV (GLenum, GLuint, GLsizei, const GLubyte *);
-GLAPI void APIENTRY glProgramParameter4dNV (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glProgramParameter4dvNV (GLenum, GLuint, const GLdouble *);
-GLAPI void APIENTRY glProgramParameter4fNV (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glProgramParameter4fvNV (GLenum, GLuint, const GLfloat *);
-GLAPI void APIENTRY glProgramParameters4dvNV (GLenum, GLuint, GLuint, const GLdouble *);
-GLAPI void APIENTRY glProgramParameters4fvNV (GLenum, GLuint, GLuint, const GLfloat *);
-GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei, const GLuint *);
-GLAPI void APIENTRY glTrackMatrixNV (GLenum, GLuint, GLenum, GLenum);
-GLAPI void APIENTRY glVertexAttribPointerNV (GLuint, GLint, GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glVertexAttrib1dNV (GLuint, GLdouble);
-GLAPI void APIENTRY glVertexAttrib1dvNV (GLuint, const GLdouble *);
-GLAPI void APIENTRY glVertexAttrib1fNV (GLuint, GLfloat);
-GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint, const GLfloat *);
-GLAPI void APIENTRY glVertexAttrib1sNV (GLuint, GLshort);
-GLAPI void APIENTRY glVertexAttrib1svNV (GLuint, const GLshort *);
-GLAPI void APIENTRY glVertexAttrib2dNV (GLuint, GLdouble, GLdouble);
-GLAPI void APIENTRY glVertexAttrib2dvNV (GLuint, const GLdouble *);
-GLAPI void APIENTRY glVertexAttrib2fNV (GLuint, GLfloat, GLfloat);
-GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint, const GLfloat *);
-GLAPI void APIENTRY glVertexAttrib2sNV (GLuint, GLshort, GLshort);
-GLAPI void APIENTRY glVertexAttrib2svNV (GLuint, const GLshort *);
-GLAPI void APIENTRY glVertexAttrib3dNV (GLuint, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glVertexAttrib3dvNV (GLuint, const GLdouble *);
-GLAPI void APIENTRY glVertexAttrib3fNV (GLuint, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint, const GLfloat *);
-GLAPI void APIENTRY glVertexAttrib3sNV (GLuint, GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glVertexAttrib3svNV (GLuint, const GLshort *);
-GLAPI void APIENTRY glVertexAttrib4dNV (GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glVertexAttrib4dvNV (GLuint, const GLdouble *);
-GLAPI void APIENTRY glVertexAttrib4fNV (GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint, const GLfloat *);
-GLAPI void APIENTRY glVertexAttrib4sNV (GLuint, GLshort, GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glVertexAttrib4svNV (GLuint, const GLshort *);
-GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint, GLubyte, GLubyte, GLubyte, GLubyte);
-GLAPI void APIENTRY glVertexAttrib4ubvNV (GLuint, const GLubyte *);
-GLAPI void APIENTRY glVertexAttribs1dvNV (GLuint, GLsizei, const GLdouble *);
-GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glVertexAttribs1svNV (GLuint, GLsizei, const GLshort *);
-GLAPI void APIENTRY glVertexAttribs2dvNV (GLuint, GLsizei, const GLdouble *);
-GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glVertexAttribs2svNV (GLuint, GLsizei, const GLshort *);
-GLAPI void APIENTRY glVertexAttribs3dvNV (GLuint, GLsizei, const GLdouble *);
-GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glVertexAttribs3svNV (GLuint, GLsizei, const GLshort *);
-GLAPI void APIENTRY glVertexAttribs4dvNV (GLuint, GLsizei, const GLdouble *);
-GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glVertexAttribs4svNV (GLuint, GLsizei, const GLshort *);
-GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint, GLsizei, const GLubyte *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences);
-typedef void (APIENTRYP PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id);
-typedef void (APIENTRYP PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *programs);
-typedef void (APIENTRYP PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat *params);
-typedef void (APIENTRYP PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs);
-typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte *program);
-typedef void (APIENTRYP PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid* *pointer);
-typedef GLboolean (APIENTRYP PFNGLISPROGRAMNVPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program);
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLuint count, const GLdouble *v);
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLuint count, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs);
-typedef void (APIENTRYP PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte *v);
-#endif
-
-#ifndef GL_SGIX_texture_coordinate_clamp
-#define GL_SGIX_texture_coordinate_clamp 1
-#endif
-
-#ifndef GL_SGIX_scalebias_hint
-#define GL_SGIX_scalebias_hint 1
-#endif
-
-#ifndef GL_OML_interlace
-#define GL_OML_interlace 1
-#endif
-
-#ifndef GL_OML_subsample
-#define GL_OML_subsample 1
-#endif
-
-#ifndef GL_OML_resample
-#define GL_OML_resample 1
-#endif
-
-#ifndef GL_NV_copy_depth_to_color
-#define GL_NV_copy_depth_to_color 1
-#endif
-
-#ifndef GL_ATI_envmap_bumpmap
-#define GL_ATI_envmap_bumpmap 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTexBumpParameterivATI (GLenum, const GLint *);
-GLAPI void APIENTRY glTexBumpParameterfvATI (GLenum, const GLfloat *);
-GLAPI void APIENTRY glGetTexBumpParameterivATI (GLenum, GLint *);
-GLAPI void APIENTRY glGetTexBumpParameterfvATI (GLenum, GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, const GLint *param);
-typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, const GLfloat *param);
-typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param);
-typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param);
-#endif
-
-#ifndef GL_ATI_fragment_shader
-#define GL_ATI_fragment_shader 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLuint APIENTRY glGenFragmentShadersATI (GLuint);
-GLAPI void APIENTRY glBindFragmentShaderATI (GLuint);
-GLAPI void APIENTRY glDeleteFragmentShaderATI (GLuint);
-GLAPI void APIENTRY glBeginFragmentShaderATI (void);
-GLAPI void APIENTRY glEndFragmentShaderATI (void);
-GLAPI void APIENTRY glPassTexCoordATI (GLuint, GLuint, GLenum);
-GLAPI void APIENTRY glSampleMapATI (GLuint, GLuint, GLenum);
-GLAPI void APIENTRY glColorFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glColorFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glColorFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glAlphaFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glAlphaFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glAlphaFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glSetFragmentShaderConstantATI (GLuint, const GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range);
-typedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLBEGINFRAGMENTSHADERATIPROC) (void);
-typedef void (APIENTRYP PFNGLENDFRAGMENTSHADERATIPROC) (void);
-typedef void (APIENTRYP PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle);
-typedef void (APIENTRYP PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle);
-typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
-typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
-typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
-typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
-typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
-typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
-typedef void (APIENTRYP PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat *value);
-#endif
-
-#ifndef GL_ATI_pn_triangles
-#define GL_ATI_pn_triangles 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPNTrianglesiATI (GLenum, GLint);
-GLAPI void APIENTRY glPNTrianglesfATI (GLenum, GLfloat);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param);
-#endif
-
-#ifndef GL_ATI_vertex_array_object
-#define GL_ATI_vertex_array_object 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLuint APIENTRY glNewObjectBufferATI (GLsizei, const GLvoid *, GLenum);
-GLAPI GLboolean APIENTRY glIsObjectBufferATI (GLuint);
-GLAPI void APIENTRY glUpdateObjectBufferATI (GLuint, GLuint, GLsizei, const GLvoid *, GLenum);
-GLAPI void APIENTRY glGetObjectBufferfvATI (GLuint, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetObjectBufferivATI (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glFreeObjectBufferATI (GLuint);
-/* ERO Begin */
-GLAPI void APIENTRY glDeleteObjectBufferATI (GLuint);
-/* ERO End */
-GLAPI void APIENTRY glArrayObjectATI (GLenum, GLint, GLenum, GLsizei, GLuint, GLuint);
-GLAPI void APIENTRY glGetArrayObjectfvATI (GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetArrayObjectivATI (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glVariantArrayObjectATI (GLuint, GLenum, GLsizei, GLuint, GLuint);
-GLAPI void APIENTRY glGetVariantArrayObjectfvATI (GLuint, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetVariantArrayObjectivATI (GLuint, GLenum, GLint *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const GLvoid *pointer, GLenum usage);
-typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer);
-typedef void (APIENTRYP PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve);
-typedef void (APIENTRYP PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer);
-typedef void (APIENTRYP PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
-typedef void (APIENTRYP PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
-typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint *params);
-#endif
-
-#ifndef GL_EXT_vertex_shader
-#define GL_EXT_vertex_shader 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBeginVertexShaderEXT (void);
-GLAPI void APIENTRY glEndVertexShaderEXT (void);
-GLAPI void APIENTRY glBindVertexShaderEXT (GLuint);
-GLAPI GLuint APIENTRY glGenVertexShadersEXT (GLuint);
-GLAPI void APIENTRY glDeleteVertexShaderEXT (GLuint);
-GLAPI void APIENTRY glShaderOp1EXT (GLenum, GLuint, GLuint);
-GLAPI void APIENTRY glShaderOp2EXT (GLenum, GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glShaderOp3EXT (GLenum, GLuint, GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glSwizzleEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum);
-GLAPI void APIENTRY glWriteMaskEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum);
-GLAPI void APIENTRY glInsertComponentEXT (GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glExtractComponentEXT (GLuint, GLuint, GLuint);
-GLAPI GLuint APIENTRY glGenSymbolsEXT (GLenum, GLenum, GLenum, GLuint);
-GLAPI void APIENTRY glSetInvariantEXT (GLuint, GLenum, const GLvoid *);
-GLAPI void APIENTRY glSetLocalConstantEXT (GLuint, GLenum, const GLvoid *);
-GLAPI void APIENTRY glVariantbvEXT (GLuint, const GLbyte *);
-GLAPI void APIENTRY glVariantsvEXT (GLuint, const GLshort *);
-GLAPI void APIENTRY glVariantivEXT (GLuint, const GLint *);
-GLAPI void APIENTRY glVariantfvEXT (GLuint, const GLfloat *);
-GLAPI void APIENTRY glVariantdvEXT (GLuint, const GLdouble *);
-GLAPI void APIENTRY glVariantubvEXT (GLuint, const GLubyte *);
-GLAPI void APIENTRY glVariantusvEXT (GLuint, const GLushort *);
-GLAPI void APIENTRY glVariantuivEXT (GLuint, const GLuint *);
-GLAPI void APIENTRY glVariantPointerEXT (GLuint, GLenum, GLuint, const GLvoid *);
-GLAPI void APIENTRY glEnableVariantClientStateEXT (GLuint);
-GLAPI void APIENTRY glDisableVariantClientStateEXT (GLuint);
-GLAPI GLuint APIENTRY glBindLightParameterEXT (GLenum, GLenum);
-GLAPI GLuint APIENTRY glBindMaterialParameterEXT (GLenum, GLenum);
-GLAPI GLuint APIENTRY glBindTexGenParameterEXT (GLenum, GLenum, GLenum);
-GLAPI GLuint APIENTRY glBindTextureUnitParameterEXT (GLenum, GLenum);
-GLAPI GLuint APIENTRY glBindParameterEXT (GLenum);
-GLAPI GLboolean APIENTRY glIsVariantEnabledEXT (GLuint, GLenum);
-GLAPI void APIENTRY glGetVariantBooleanvEXT (GLuint, GLenum, GLboolean *);
-GLAPI void APIENTRY glGetVariantIntegervEXT (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetVariantFloatvEXT (GLuint, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetVariantPointervEXT (GLuint, GLenum, GLvoid* *);
-GLAPI void APIENTRY glGetInvariantBooleanvEXT (GLuint, GLenum, GLboolean *);
-GLAPI void APIENTRY glGetInvariantIntegervEXT (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetInvariantFloatvEXT (GLuint, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetLocalConstantBooleanvEXT (GLuint, GLenum, GLboolean *);
-GLAPI void APIENTRY glGetLocalConstantIntegervEXT (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetLocalConstantFloatvEXT (GLuint, GLenum, GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC) (void);
-typedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC) (void);
-typedef void (APIENTRYP PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id);
-typedef GLuint (APIENTRYP PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range);
-typedef void (APIENTRYP PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1);
-typedef void (APIENTRYP PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2);
-typedef void (APIENTRYP PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3);
-typedef void (APIENTRYP PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
-typedef void (APIENTRYP PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
-typedef void (APIENTRYP PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num);
-typedef void (APIENTRYP PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num);
-typedef GLuint (APIENTRYP PFNGLGENSYMBOLSEXTPROC) (GLenum datatype, GLenum storagetype, GLenum range, GLuint components);
-typedef void (APIENTRYP PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr);
-typedef void (APIENTRYP PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr);
-typedef void (APIENTRYP PFNGLVARIANTBVEXTPROC) (GLuint id, const GLbyte *addr);
-typedef void (APIENTRYP PFNGLVARIANTSVEXTPROC) (GLuint id, const GLshort *addr);
-typedef void (APIENTRYP PFNGLVARIANTIVEXTPROC) (GLuint id, const GLint *addr);
-typedef void (APIENTRYP PFNGLVARIANTFVEXTPROC) (GLuint id, const GLfloat *addr);
-typedef void (APIENTRYP PFNGLVARIANTDVEXTPROC) (GLuint id, const GLdouble *addr);
-typedef void (APIENTRYP PFNGLVARIANTUBVEXTPROC) (GLuint id, const GLubyte *addr);
-typedef void (APIENTRYP PFNGLVARIANTUSVEXTPROC) (GLuint id, const GLushort *addr);
-typedef void (APIENTRYP PFNGLVARIANTUIVEXTPROC) (GLuint id, const GLuint *addr);
-typedef void (APIENTRYP PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, const GLvoid *addr);
-typedef void (APIENTRYP PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id);
-typedef GLuint (APIENTRYP PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value);
-typedef GLuint (APIENTRYP PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value);
-typedef GLuint (APIENTRYP PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value);
-typedef GLuint (APIENTRYP PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value);
-typedef GLuint (APIENTRYP PFNGLBINDPARAMETEREXTPROC) (GLenum value);
-typedef GLboolean (APIENTRYP PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap);
-typedef void (APIENTRYP PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
-typedef void (APIENTRYP PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
-typedef void (APIENTRYP PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
-typedef void (APIENTRYP PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid* *data);
-typedef void (APIENTRYP PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
-typedef void (APIENTRYP PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
-typedef void (APIENTRYP PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
-typedef void (APIENTRYP PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
-typedef void (APIENTRYP PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
-typedef void (APIENTRYP PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
-#endif
-
-#ifndef GL_ATI_vertex_streams
-#define GL_ATI_vertex_streams 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexStream1sATI (GLenum, GLshort);
-GLAPI void APIENTRY glVertexStream1svATI (GLenum, const GLshort *);
-GLAPI void APIENTRY glVertexStream1iATI (GLenum, GLint);
-GLAPI void APIENTRY glVertexStream1ivATI (GLenum, const GLint *);
-GLAPI void APIENTRY glVertexStream1fATI (GLenum, GLfloat);
-GLAPI void APIENTRY glVertexStream1fvATI (GLenum, const GLfloat *);
-GLAPI void APIENTRY glVertexStream1dATI (GLenum, GLdouble);
-GLAPI void APIENTRY glVertexStream1dvATI (GLenum, const GLdouble *);
-GLAPI void APIENTRY glVertexStream2sATI (GLenum, GLshort, GLshort);
-GLAPI void APIENTRY glVertexStream2svATI (GLenum, const GLshort *);
-GLAPI void APIENTRY glVertexStream2iATI (GLenum, GLint, GLint);
-GLAPI void APIENTRY glVertexStream2ivATI (GLenum, const GLint *);
-GLAPI void APIENTRY glVertexStream2fATI (GLenum, GLfloat, GLfloat);
-GLAPI void APIENTRY glVertexStream2fvATI (GLenum, const GLfloat *);
-GLAPI void APIENTRY glVertexStream2dATI (GLenum, GLdouble, GLdouble);
-GLAPI void APIENTRY glVertexStream2dvATI (GLenum, const GLdouble *);
-GLAPI void APIENTRY glVertexStream3sATI (GLenum, GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glVertexStream3svATI (GLenum, const GLshort *);
-GLAPI void APIENTRY glVertexStream3iATI (GLenum, GLint, GLint, GLint);
-GLAPI void APIENTRY glVertexStream3ivATI (GLenum, const GLint *);
-GLAPI void APIENTRY glVertexStream3fATI (GLenum, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glVertexStream3fvATI (GLenum, const GLfloat *);
-GLAPI void APIENTRY glVertexStream3dATI (GLenum, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glVertexStream3dvATI (GLenum, const GLdouble *);
-GLAPI void APIENTRY glVertexStream4sATI (GLenum, GLshort, GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glVertexStream4svATI (GLenum, const GLshort *);
-GLAPI void APIENTRY glVertexStream4iATI (GLenum, GLint, GLint, GLint, GLint);
-GLAPI void APIENTRY glVertexStream4ivATI (GLenum, const GLint *);
-GLAPI void APIENTRY glVertexStream4fATI (GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glVertexStream4fvATI (GLenum, const GLfloat *);
-GLAPI void APIENTRY glVertexStream4dATI (GLenum, GLdouble, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glVertexStream4dvATI (GLenum, const GLdouble *);
-GLAPI void APIENTRY glNormalStream3bATI (GLenum, GLbyte, GLbyte, GLbyte);
-GLAPI void APIENTRY glNormalStream3bvATI (GLenum, const GLbyte *);
-GLAPI void APIENTRY glNormalStream3sATI (GLenum, GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glNormalStream3svATI (GLenum, const GLshort *);
-GLAPI void APIENTRY glNormalStream3iATI (GLenum, GLint, GLint, GLint);
-GLAPI void APIENTRY glNormalStream3ivATI (GLenum, const GLint *);
-GLAPI void APIENTRY glNormalStream3fATI (GLenum, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glNormalStream3fvATI (GLenum, const GLfloat *);
-GLAPI void APIENTRY glNormalStream3dATI (GLenum, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glNormalStream3dvATI (GLenum, const GLdouble *);
-GLAPI void APIENTRY glClientActiveVertexStreamATI (GLenum);
-GLAPI void APIENTRY glVertexBlendEnviATI (GLenum, GLint);
-GLAPI void APIENTRY glVertexBlendEnvfATI (GLenum, GLfloat);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort nx, GLshort ny, GLshort nz);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint nx, GLint ny, GLint nz);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords);
-typedef void (APIENTRYP PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream);
-typedef void (APIENTRYP PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param);
-#endif
-
-#ifndef GL_ATI_element_array
-#define GL_ATI_element_array 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glElementPointerATI (GLenum, const GLvoid *);
-GLAPI void APIENTRY glDrawElementArrayATI (GLenum, GLsizei);
-GLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum, GLuint, GLuint, GLsizei);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC) (GLenum type, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count);
-typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count);
-#endif
-
-#ifndef GL_SUN_mesh_array
-#define GL_SUN_mesh_array 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawMeshArraysSUN (GLenum, GLint, GLsizei, GLsizei);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, GLsizei count, GLsizei width);
-#endif
-
-#ifndef GL_SUN_slice_accum
-#define GL_SUN_slice_accum 1
-#endif
-
-#ifndef GL_NV_multisample_filter_hint
-#define GL_NV_multisample_filter_hint 1
-#endif
-
-#ifndef GL_NV_depth_clamp
-#define GL_NV_depth_clamp 1
-#endif
-
-#ifndef GL_NV_occlusion_query
-#define GL_NV_occlusion_query 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGenOcclusionQueriesNV (GLsizei, GLuint *);
-GLAPI void APIENTRY glDeleteOcclusionQueriesNV (GLsizei, const GLuint *);
-GLAPI GLboolean APIENTRY glIsOcclusionQueryNV (GLuint);
-GLAPI void APIENTRY glBeginOcclusionQueryNV (GLuint);
-GLAPI void APIENTRY glEndOcclusionQueryNV (void);
-GLAPI void APIENTRY glGetOcclusionQueryivNV (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetOcclusionQueryuivNV (GLuint, GLenum, GLuint *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids);
-typedef void (APIENTRYP PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids);
-typedef GLboolean (APIENTRYP PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLENDOCCLUSIONQUERYNVPROC) (void);
-typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint *params);
-#endif
-
-#ifndef GL_NV_point_sprite
-#define GL_NV_point_sprite 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPointParameteriNV (GLenum, GLint);
-GLAPI void APIENTRY glPointParameterivNV (GLenum, const GLint *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint *params);
-#endif
-
-#ifndef GL_NV_texture_shader3
-#define GL_NV_texture_shader3 1
-#endif
-
-#ifndef GL_NV_vertex_program1_1
-#define GL_NV_vertex_program1_1 1
-#endif
-
-#ifndef GL_EXT_shadow_funcs
-#define GL_EXT_shadow_funcs 1
-#endif
-
-#ifndef GL_EXT_stencil_two_side
-#define GL_EXT_stencil_two_side 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face);
-#endif
-
-#ifndef GL_ATI_text_fragment_shader
-#define GL_ATI_text_fragment_shader 1
-#endif
-
-#ifndef GL_APPLE_client_storage
-#define GL_APPLE_client_storage 1
-#endif
-
-#ifndef GL_APPLE_element_array
-#define GL_APPLE_element_array 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glElementPointerAPPLE (GLenum, const GLvoid *);
-GLAPI void APIENTRY glDrawElementArrayAPPLE (GLenum, GLint, GLsizei);
-GLAPI void APIENTRY glDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, GLint, GLsizei);
-GLAPI void APIENTRY glMultiDrawElementArrayAPPLE (GLenum, const GLint *, const GLsizei *, GLsizei);
-GLAPI void APIENTRY glMultiDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, const GLint *, const GLsizei *, GLsizei);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count);
-typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count);
-typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
-typedef void (APIENTRYP PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount);
-#endif
-
-#ifndef GL_APPLE_fence
-#define GL_APPLE_fence 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGenFencesAPPLE (GLsizei, GLuint *);
-GLAPI void APIENTRY glDeleteFencesAPPLE (GLsizei, const GLuint *);
-GLAPI void APIENTRY glSetFenceAPPLE (GLuint);
-GLAPI GLboolean APIENTRY glIsFenceAPPLE (GLuint);
-GLAPI GLboolean APIENTRY glTestFenceAPPLE (GLuint);
-GLAPI void APIENTRY glFinishFenceAPPLE (GLuint);
-GLAPI GLboolean APIENTRY glTestObjectAPPLE (GLenum, GLuint);
-GLAPI void APIENTRY glFinishObjectAPPLE (GLenum, GLint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint *fences);
-typedef void (APIENTRYP PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint *fences);
-typedef void (APIENTRYP PFNGLSETFENCEAPPLEPROC) (GLuint fence);
-typedef GLboolean (APIENTRYP PFNGLISFENCEAPPLEPROC) (GLuint fence);
-typedef GLboolean (APIENTRYP PFNGLTESTFENCEAPPLEPROC) (GLuint fence);
-typedef void (APIENTRYP PFNGLFINISHFENCEAPPLEPROC) (GLuint fence);
-typedef GLboolean (APIENTRYP PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name);
-typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name);
-#endif
-
-#ifndef GL_APPLE_vertex_array_object
-#define GL_APPLE_vertex_array_object 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint);
-GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei, const GLuint *);
-GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei, GLuint *);
-GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array);
-typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays);
-typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, GLuint *arrays);
-typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array);
-#endif
-
-#ifndef GL_APPLE_vertex_array_range
-#define GL_APPLE_vertex_array_range 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexArrayRangeAPPLE (GLsizei, GLvoid *);
-GLAPI void APIENTRY glFlushVertexArrayRangeAPPLE (GLsizei, GLvoid *);
-GLAPI void APIENTRY glVertexArrayParameteriAPPLE (GLenum, GLint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer);
-typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer);
-typedef void (APIENTRYP PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param);
-#endif
-
-#ifndef GL_APPLE_ycbcr_422
-#define GL_APPLE_ycbcr_422 1
-#endif
-
-#ifndef GL_S3_s3tc
-#define GL_S3_s3tc 1
-#endif
-
-#ifndef GL_ATI_draw_buffers
-#define GL_ATI_draw_buffers 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawBuffersATI (GLsizei, const GLenum *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum *bufs);
-#endif
-
-#ifndef GL_ATI_pixel_format_float
-#define GL_ATI_pixel_format_float 1
-/* This is really a WGL extension, but defines some associated GL enums.
- * ATI does not export "GL_ATI_pixel_format_float" in the GL_EXTENSIONS string.
- */
-#endif
-
-#ifndef GL_ATI_texture_env_combine3
-#define GL_ATI_texture_env_combine3 1
-#endif
-
-#ifndef GL_ATI_texture_float
-#define GL_ATI_texture_float 1
-#endif
-
-#ifndef GL_NV_float_buffer
-#define GL_NV_float_buffer 1
-#endif
-
-#ifndef GL_NV_fragment_program
-#define GL_NV_fragment_program 1
-/* Some NV_fragment_program entry points are shared with ARB_vertex_program. */
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glProgramNamedParameter4fNV (GLuint, GLsizei, const GLubyte *, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glProgramNamedParameter4dNV (GLuint, GLsizei, const GLubyte *, GLdouble, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glProgramNamedParameter4fvNV (GLuint, GLsizei, const GLubyte *, const GLfloat *);
-GLAPI void APIENTRY glProgramNamedParameter4dvNV (GLuint, GLsizei, const GLubyte *, const GLdouble *);
-GLAPI void APIENTRY glGetProgramNamedParameterfvNV (GLuint, GLsizei, const GLubyte *, GLfloat *);
-GLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint, GLsizei, const GLubyte *, GLdouble *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v);
-typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v);
-typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params);
-#endif
-
-#ifndef GL_NV_half_float
-#define GL_NV_half_float 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertex2hNV (GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glVertex2hvNV (const GLhalfNV *);
-GLAPI void APIENTRY glVertex3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glVertex3hvNV (const GLhalfNV *);
-GLAPI void APIENTRY glVertex4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glVertex4hvNV (const GLhalfNV *);
-GLAPI void APIENTRY glNormal3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glNormal3hvNV (const GLhalfNV *);
-GLAPI void APIENTRY glColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glColor3hvNV (const GLhalfNV *);
-GLAPI void APIENTRY glColor4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glColor4hvNV (const GLhalfNV *);
-GLAPI void APIENTRY glTexCoord1hNV (GLhalfNV);
-GLAPI void APIENTRY glTexCoord1hvNV (const GLhalfNV *);
-GLAPI void APIENTRY glTexCoord2hNV (GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glTexCoord2hvNV (const GLhalfNV *);
-GLAPI void APIENTRY glTexCoord3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glTexCoord3hvNV (const GLhalfNV *);
-GLAPI void APIENTRY glTexCoord4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glTexCoord4hvNV (const GLhalfNV *);
-GLAPI void APIENTRY glMultiTexCoord1hNV (GLenum, GLhalfNV);
-GLAPI void APIENTRY glMultiTexCoord1hvNV (GLenum, const GLhalfNV *);
-GLAPI void APIENTRY glMultiTexCoord2hNV (GLenum, GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glMultiTexCoord2hvNV (GLenum, const GLhalfNV *);
-GLAPI void APIENTRY glMultiTexCoord3hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glMultiTexCoord3hvNV (GLenum, const GLhalfNV *);
-GLAPI void APIENTRY glMultiTexCoord4hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glMultiTexCoord4hvNV (GLenum, const GLhalfNV *);
-GLAPI void APIENTRY glFogCoordhNV (GLhalfNV);
-GLAPI void APIENTRY glFogCoordhvNV (const GLhalfNV *);
-GLAPI void APIENTRY glSecondaryColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glSecondaryColor3hvNV (const GLhalfNV *);
-GLAPI void APIENTRY glVertexWeighthNV (GLhalfNV);
-GLAPI void APIENTRY glVertexWeighthvNV (const GLhalfNV *);
-GLAPI void APIENTRY glVertexAttrib1hNV (GLuint, GLhalfNV);
-GLAPI void APIENTRY glVertexAttrib1hvNV (GLuint, const GLhalfNV *);
-GLAPI void APIENTRY glVertexAttrib2hNV (GLuint, GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glVertexAttrib2hvNV (GLuint, const GLhalfNV *);
-GLAPI void APIENTRY glVertexAttrib3hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glVertexAttrib3hvNV (GLuint, const GLhalfNV *);
-GLAPI void APIENTRY glVertexAttrib4hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glVertexAttrib4hvNV (GLuint, const GLhalfNV *);
-GLAPI void APIENTRY glVertexAttribs1hvNV (GLuint, GLsizei, const GLhalfNV *);
-GLAPI void APIENTRY glVertexAttribs2hvNV (GLuint, GLsizei, const GLhalfNV *);
-GLAPI void APIENTRY glVertexAttribs3hvNV (GLuint, GLsizei, const GLhalfNV *);
-GLAPI void APIENTRY glVertexAttribs4hvNV (GLuint, GLsizei, const GLhalfNV *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEX2HNVPROC) (GLhalfNV x, GLhalfNV y);
-typedef void (APIENTRYP PFNGLVERTEX2HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEX3HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z);
-typedef void (APIENTRYP PFNGLVERTEX3HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEX4HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);
-typedef void (APIENTRYP PFNGLVERTEX4HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLNORMAL3HNVPROC) (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz);
-typedef void (APIENTRYP PFNGLNORMAL3HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
-typedef void (APIENTRYP PFNGLCOLOR3HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLCOLOR4HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha);
-typedef void (APIENTRYP PFNGLCOLOR4HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLTEXCOORD1HNVPROC) (GLhalfNV s);
-typedef void (APIENTRYP PFNGLTEXCOORD1HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLTEXCOORD2HNVPROC) (GLhalfNV s, GLhalfNV t);
-typedef void (APIENTRYP PFNGLTEXCOORD2HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLTEXCOORD3HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r);
-typedef void (APIENTRYP PFNGLTEXCOORD3HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLTEXCOORD4HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);
-typedef void (APIENTRYP PFNGLTEXCOORD4HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalfNV s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLFOGCOORDHNVPROC) (GLhalfNV fog);
-typedef void (APIENTRYP PFNGLFOGCOORDHVNVPROC) (const GLhalfNV *fog);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXWEIGHTHNVPROC) (GLhalfNV weight);
-typedef void (APIENTRYP PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalfNV *weight);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalfNV x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
-#endif
-
-#ifndef GL_NV_pixel_data_range
-#define GL_NV_pixel_data_range 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPixelDataRangeNV (GLenum, GLsizei, GLvoid *);
-GLAPI void APIENTRY glFlushPixelDataRangeNV (GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, GLvoid *pointer);
-typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target);
-#endif
-
-#ifndef GL_NV_primitive_restart
-#define GL_NV_primitive_restart 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPrimitiveRestartNV (void);
-GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPRIMITIVERESTARTNVPROC) (void);
-typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index);
-#endif
-
-#ifndef GL_NV_texture_expand_normal
-#define GL_NV_texture_expand_normal 1
-#endif
-
-#ifndef GL_NV_vertex_program2
-#define GL_NV_vertex_program2 1
-#endif
-
-#ifndef GL_ATI_map_object_buffer
-#define GL_ATI_map_object_buffer 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLvoid* APIENTRY glMapObjectBufferATI (GLuint);
-GLAPI void APIENTRY glUnmapObjectBufferATI (GLuint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLvoid* (APIENTRYP PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer);
-typedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer);
-#endif
-
-#ifndef GL_ATI_separate_stencil
-#define GL_ATI_separate_stencil 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glStencilOpSeparateATI (GLenum, GLenum, GLenum, GLenum);
-GLAPI void APIENTRY glStencilFuncSeparateATI (GLenum, GLenum, GLint, GLuint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
-typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
-#endif
-
-#ifndef GL_ATI_vertex_attrib_array_object
-#define GL_ATI_vertex_attrib_array_object 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexAttribArrayObjectATI (GLuint, GLint, GLenum, GLboolean, GLsizei, GLuint, GLuint);
-GLAPI void APIENTRY glGetVertexAttribArrayObjectfvATI (GLuint, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetVertexAttribArrayObjectivATI (GLuint, GLenum, GLint *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint *params);
-#endif
-
-#ifndef GL_OES_read_format
-#define GL_OES_read_format 1
-#endif
-
-#ifndef GL_EXT_depth_bounds_test
-#define GL_EXT_depth_bounds_test 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDepthBoundsEXT (GLclampd, GLclampd);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax);
-#endif
-
-#ifndef GL_EXT_texture_mirror_clamp
-#define GL_EXT_texture_mirror_clamp 1
-#endif
-
-#ifndef GL_EXT_blend_equation_separate
-#define GL_EXT_blend_equation_separate 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendEquationSeparateEXT (GLenum, GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha);
-#endif
-
-#ifndef GL_MESA_pack_invert
-#define GL_MESA_pack_invert 1
-#endif
-
-#ifndef GL_MESA_ycbcr_texture
-#define GL_MESA_ycbcr_texture 1
-#endif
-
-#ifndef GL_EXT_pixel_buffer_object
-#define GL_EXT_pixel_buffer_object 1
-#endif
-
-#ifndef GL_NV_fragment_program_option
-#define GL_NV_fragment_program_option 1
-#endif
-
-#ifndef GL_NV_fragment_program2
-#define GL_NV_fragment_program2 1
-#endif
-
-#ifndef GL_NV_vertex_program2_option
-#define GL_NV_vertex_program2_option 1
-#endif
-
-#ifndef GL_NV_vertex_program3
-#define GL_NV_vertex_program3 1
-#endif
-
-#ifndef GL_EXT_framebuffer_object
-#define GL_EXT_framebuffer_object 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLboolean APIENTRY glIsRenderbufferEXT (GLuint);
-GLAPI void APIENTRY glBindRenderbufferEXT (GLenum, GLuint);
-GLAPI void APIENTRY glDeleteRenderbuffersEXT (GLsizei, const GLuint *);
-GLAPI void APIENTRY glGenRenderbuffersEXT (GLsizei, GLuint *);
-GLAPI void APIENTRY glRenderbufferStorageEXT (GLenum, GLenum, GLsizei, GLsizei);
-GLAPI void APIENTRY glGetRenderbufferParameterivEXT (GLenum, GLenum, GLint *);
-GLAPI GLboolean APIENTRY glIsFramebufferEXT (GLuint);
-GLAPI void APIENTRY glBindFramebufferEXT (GLenum, GLuint);
-GLAPI void APIENTRY glDeleteFramebuffersEXT (GLsizei, const GLuint *);
-GLAPI void APIENTRY glGenFramebuffersEXT (GLsizei, GLuint *);
-GLAPI GLenum APIENTRY glCheckFramebufferStatusEXT (GLenum);
-GLAPI void APIENTRY glFramebufferTexture1DEXT (GLenum, GLenum, GLenum, GLuint, GLint);
-GLAPI void APIENTRY glFramebufferTexture2DEXT (GLenum, GLenum, GLenum, GLuint, GLint);
-GLAPI void APIENTRY glFramebufferTexture2D (GLenum, GLenum, GLenum, GLuint, GLint);
-GLAPI void APIENTRY glFramebufferTexture3DEXT (GLenum, GLenum, GLenum, GLuint, GLint, GLint);
-GLAPI void APIENTRY glFramebufferRenderbufferEXT (GLenum, GLenum, GLenum, GLuint);
-GLAPI void APIENTRY glGetFramebufferAttachmentParameterivEXT (GLenum, GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGenerateMipmapEXT (GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer);
-typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer);
-typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers);
-typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers);
-typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
-typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer);
-typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer);
-typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers);
-typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers);
-typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target);
-#endif
-
-#ifndef GL_GREMEDY_string_marker
-#define GL_GREMEDY_string_marker 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid *string);
-#endif
-
-#ifndef GL_EXT_packed_depth_stencil
-#define GL_EXT_packed_depth_stencil 1
-#endif
-
-#ifndef GL_EXT_stencil_clear_tag
-#define GL_EXT_stencil_clear_tag 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glStencilClearTagEXT (GLsizei, GLuint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLSTENCILCLEARTAGEXTPROC) (GLsizei stencilTagBits, GLuint stencilClearTag);
-#endif
-
-#ifndef GL_EXT_texture_sRGB
-#define GL_EXT_texture_sRGB 1
-#endif
-
-#ifndef GL_EXT_framebuffer_blit
-#define GL_EXT_framebuffer_blit 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlitFramebufferEXT (GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-#endif
-
-#ifndef GL_EXT_framebuffer_multisample
-#define GL_EXT_framebuffer_multisample 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glRenderbufferStorageMultisampleEXT (GLenum, GLsizei, GLenum, GLsizei, GLsizei);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-#endif
-
-#ifndef GL_MESAX_texture_stack
-#define GL_MESAX_texture_stack 1
-#endif
-
-#ifndef GL_EXT_timer_query
-#define GL_EXT_timer_query 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGetQueryObjecti64vEXT (GLuint, GLenum, GLint64EXT *);
-GLAPI void APIENTRY glGetQueryObjectui64vEXT (GLuint, GLenum, GLuint64EXT *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT *params);
-typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT *params);
-#endif
-
-#ifndef GL_EXT_gpu_program_parameters
-#define GL_EXT_gpu_program_parameters 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glProgramEnvParameters4fvEXT (GLenum, GLuint, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glProgramLocalParameters4fvEXT (GLenum, GLuint, GLsizei, const GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params);
-#endif
-
-#ifndef GL_APPLE_flush_buffer_range
-#define GL_APPLE_flush_buffer_range 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBufferParameteriAPPLE (GLenum, GLenum, GLint);
-GLAPI void APIENTRY glFlushMappedBufferRangeAPPLE (GLenum, GLintptr, GLsizeiptr);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size);
-#endif
-
-#ifndef GL_NV_gpu_program4
-#define GL_NV_gpu_program4 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glProgramLocalParameterI4iNV (GLenum, GLuint, GLint, GLint, GLint, GLint);
-GLAPI void APIENTRY glProgramLocalParameterI4ivNV (GLenum, GLuint, const GLint *);
-GLAPI void APIENTRY glProgramLocalParametersI4ivNV (GLenum, GLuint, GLsizei, const GLint *);
-GLAPI void APIENTRY glProgramLocalParameterI4uiNV (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glProgramLocalParameterI4uivNV (GLenum, GLuint, const GLuint *);
-GLAPI void APIENTRY glProgramLocalParametersI4uivNV (GLenum, GLuint, GLsizei, const GLuint *);
-GLAPI void APIENTRY glProgramEnvParameterI4iNV (GLenum, GLuint, GLint, GLint, GLint, GLint);
-GLAPI void APIENTRY glProgramEnvParameterI4ivNV (GLenum, GLuint, const GLint *);
-GLAPI void APIENTRY glProgramEnvParametersI4ivNV (GLenum, GLuint, GLsizei, const GLint *);
-GLAPI void APIENTRY glProgramEnvParameterI4uiNV (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glProgramEnvParameterI4uivNV (GLenum, GLuint, const GLuint *);
-GLAPI void APIENTRY glProgramEnvParametersI4uivNV (GLenum, GLuint, GLsizei, const GLuint *);
-GLAPI void APIENTRY glGetProgramLocalParameterIivNV (GLenum, GLuint, GLint *);
-GLAPI void APIENTRY glGetProgramLocalParameterIuivNV (GLenum, GLuint, GLuint *);
-GLAPI void APIENTRY glGetProgramEnvParameterIivNV (GLenum, GLuint, GLint *);
-GLAPI void APIENTRY glGetProgramEnvParameterIuivNV (GLenum, GLuint, GLuint *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params);
-#endif
-
-#ifndef GL_NV_geometry_program4
-#define GL_NV_geometry_program4 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glProgramVertexLimitNV (GLenum, GLint);
-GLAPI void APIENTRY glFramebufferTextureEXT (GLenum, GLenum, GLuint, GLint);
-GLAPI void APIENTRY glFramebufferTextureLayerEXT (GLenum, GLenum, GLuint, GLint, GLint);
-GLAPI void APIENTRY glFramebufferTextureFaceEXT (GLenum, GLenum, GLuint, GLint, GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
-#endif
-
-#ifndef GL_EXT_geometry_shader4
-#define GL_EXT_geometry_shader4 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glProgramParameteriEXT (GLuint, GLenum, GLint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value);
-#endif
-
-#ifndef GL_NV_vertex_program4
-#define GL_NV_vertex_program4 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexAttribI1iEXT (GLuint, GLint);
-GLAPI void APIENTRY glVertexAttribI2iEXT (GLuint, GLint, GLint);
-GLAPI void APIENTRY glVertexAttribI3iEXT (GLuint, GLint, GLint, GLint);
-GLAPI void APIENTRY glVertexAttribI4iEXT (GLuint, GLint, GLint, GLint, GLint);
-GLAPI void APIENTRY glVertexAttribI1uiEXT (GLuint, GLuint);
-GLAPI void APIENTRY glVertexAttribI2uiEXT (GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glVertexAttribI3uiEXT (GLuint, GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glVertexAttribI4uiEXT (GLuint, GLuint, GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glVertexAttribI1ivEXT (GLuint, const GLint *);
-GLAPI void APIENTRY glVertexAttribI2ivEXT (GLuint, const GLint *);
-GLAPI void APIENTRY glVertexAttribI3ivEXT (GLuint, const GLint *);
-GLAPI void APIENTRY glVertexAttribI4ivEXT (GLuint, const GLint *);
-GLAPI void APIENTRY glVertexAttribI1uivEXT (GLuint, const GLuint *);
-GLAPI void APIENTRY glVertexAttribI2uivEXT (GLuint, const GLuint *);
-GLAPI void APIENTRY glVertexAttribI3uivEXT (GLuint, const GLuint *);
-GLAPI void APIENTRY glVertexAttribI4uivEXT (GLuint, const GLuint *);
-GLAPI void APIENTRY glVertexAttribI4bvEXT (GLuint, const GLbyte *);
-GLAPI void APIENTRY glVertexAttribI4svEXT (GLuint, const GLshort *);
-GLAPI void APIENTRY glVertexAttribI4ubvEXT (GLuint, const GLubyte *);
-GLAPI void APIENTRY glVertexAttribI4usvEXT (GLuint, const GLushort *);
-GLAPI void APIENTRY glVertexAttribIPointerEXT (GLuint, GLint, GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glGetVertexAttribIivEXT (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetVertexAttribIuivEXT (GLuint, GLenum, GLuint *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint *params);
-#endif
-
-#ifndef GL_EXT_gpu_shader4
-#define GL_EXT_gpu_shader4 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGetUniformuivEXT (GLuint, GLint, GLuint *);
-GLAPI void APIENTRY glBindFragDataLocationEXT (GLuint, GLuint, const GLchar *);
-GLAPI GLint APIENTRY glGetFragDataLocationEXT (GLuint, const GLchar *);
-GLAPI void APIENTRY glUniform1uiEXT (GLint, GLuint);
-GLAPI void APIENTRY glUniform2uiEXT (GLint, GLuint, GLuint);
-GLAPI void APIENTRY glUniform3uiEXT (GLint, GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glUniform4uiEXT (GLint, GLuint, GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glUniform1uivEXT (GLint, GLsizei, const GLuint *);
-GLAPI void APIENTRY glUniform2uivEXT (GLint, GLsizei, const GLuint *);
-GLAPI void APIENTRY glUniform3uivEXT (GLint, GLsizei, const GLuint *);
-GLAPI void APIENTRY glUniform4uivEXT (GLint, GLsizei, const GLuint *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint *params);
-typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name);
-typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONEXTPROC) (GLuint program, const GLchar *name);
-typedef void (APIENTRYP PFNGLUNIFORM1UIEXTPROC) (GLint location, GLuint v0);
-typedef void (APIENTRYP PFNGLUNIFORM2UIEXTPROC) (GLint location, GLuint v0, GLuint v1);
-typedef void (APIENTRYP PFNGLUNIFORM3UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2);
-typedef void (APIENTRYP PFNGLUNIFORM4UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-typedef void (APIENTRYP PFNGLUNIFORM1UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLUNIFORM2UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLUNIFORM3UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
-#endif
-
-#ifndef GL_EXT_draw_instanced
-#define GL_EXT_draw_instanced 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawArraysInstancedEXT (GLenum, GLint, GLsizei, GLsizei);
-GLAPI void APIENTRY glDrawElementsInstancedEXT (GLenum, GLsizei, GLenum, const GLvoid *, GLsizei);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount);
-typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
-#endif
-
-#ifndef GL_EXT_packed_float
-#define GL_EXT_packed_float 1
-#endif
-
-#ifndef GL_EXT_texture_array
-#define GL_EXT_texture_array 1
-#endif
-
-#ifndef GL_EXT_texture_buffer_object
-#define GL_EXT_texture_buffer_object 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTexBufferEXT (GLenum, GLenum, GLuint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer);
-#endif
-
-#ifndef GL_EXT_texture_compression_latc
-#define GL_EXT_texture_compression_latc 1
-#endif
-
-#ifndef GL_EXT_texture_compression_rgtc
-#define GL_EXT_texture_compression_rgtc 1
-#endif
-
-#ifndef GL_EXT_texture_shared_exponent
-#define GL_EXT_texture_shared_exponent 1
-#endif
-
-#ifndef GL_NV_depth_buffer_float
-#define GL_NV_depth_buffer_float 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDepthRangedNV (GLdouble, GLdouble);
-GLAPI void APIENTRY glClearDepthdNV (GLdouble);
-GLAPI void APIENTRY glDepthBoundsdNV (GLdouble, GLdouble);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar);
-typedef void (APIENTRYP PFNGLCLEARDEPTHDNVPROC) (GLdouble depth);
-typedef void (APIENTRYP PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax);
-#endif
-
-#ifndef GL_NV_fragment_program4
-#define GL_NV_fragment_program4 1
-#endif
-
-#ifndef GL_NV_framebuffer_multisample_coverage
-#define GL_NV_framebuffer_multisample_coverage 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glRenderbufferStorageMultisampleCoverageNV (GLenum, GLsizei, GLsizei, GLenum, GLsizei, GLsizei);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);
-#endif
-
-#ifndef GL_EXT_framebuffer_sRGB
-#define GL_EXT_framebuffer_sRGB 1
-#endif
-
-#ifndef GL_NV_geometry_shader4
-#define GL_NV_geometry_shader4 1
-#endif
-
-#ifndef GL_NV_parameter_buffer_object
-#define GL_NV_parameter_buffer_object 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glProgramBufferParametersfvNV (GLenum, GLuint, GLuint, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glProgramBufferParametersIivNV (GLenum, GLuint, GLuint, GLsizei, const GLint *);
-GLAPI void APIENTRY glProgramBufferParametersIuivNV (GLenum, GLuint, GLuint, GLsizei, const GLuint *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params);
-typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params);
-typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params);
-#endif
-
-#ifndef GL_EXT_draw_buffers2
-#define GL_EXT_draw_buffers2 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glColorMaskIndexedEXT (GLuint, GLboolean, GLboolean, GLboolean, GLboolean);
-GLAPI void APIENTRY glGetBooleanIndexedvEXT (GLenum, GLuint, GLboolean *);
-GLAPI void APIENTRY glGetIntegerIndexedvEXT (GLenum, GLuint, GLint *);
-GLAPI void APIENTRY glEnableIndexedEXT (GLenum, GLuint);
-GLAPI void APIENTRY glDisableIndexedEXT (GLenum, GLuint);
-GLAPI GLboolean APIENTRY glIsEnabledIndexedEXT (GLenum, GLuint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
-typedef void (APIENTRYP PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum target, GLuint index, GLboolean *data);
-typedef void (APIENTRYP PFNGLGETINTEGERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLint *data);
-typedef void (APIENTRYP PFNGLENABLEINDEXEDEXTPROC) (GLenum target, GLuint index);
-typedef void (APIENTRYP PFNGLDISABLEINDEXEDEXTPROC) (GLenum target, GLuint index);
-typedef GLboolean (APIENTRYP PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GLuint index);
-#endif
-
-#ifndef GL_NV_transform_feedback
-#define GL_NV_transform_feedback 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBeginTransformFeedbackNV (GLenum);
-GLAPI void APIENTRY glEndTransformFeedbackNV (void);
-GLAPI void APIENTRY glTransformFeedbackAttribsNV (GLuint, const GLint *, GLenum);
-GLAPI void APIENTRY glBindBufferRangeNV (GLenum, GLuint, GLuint, GLintptr, GLsizeiptr);
-GLAPI void APIENTRY glBindBufferOffsetNV (GLenum, GLuint, GLuint, GLintptr);
-GLAPI void APIENTRY glBindBufferBaseNV (GLenum, GLuint, GLuint);
-GLAPI void APIENTRY glTransformFeedbackVaryingsNV (GLuint, GLsizei, const GLint *, GLenum);
-GLAPI void APIENTRY glActiveVaryingNV (GLuint, const GLchar *);
-GLAPI GLint APIENTRY glGetVaryingLocationNV (GLuint, const GLchar *);
-GLAPI void APIENTRY glGetActiveVaryingNV (GLuint, GLuint, GLsizei, GLsizei *, GLsizei *, GLenum *, GLchar *);
-GLAPI void APIENTRY glGetTransformFeedbackVaryingNV (GLuint, GLuint, GLint *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode);
-typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKNVPROC) (void);
-typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLuint count, const GLint *attribs, GLenum bufferMode);
-typedef void (APIENTRYP PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
-typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset);
-typedef void (APIENTRYP PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer);
-typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode);
-typedef void (APIENTRYP PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar *name);
-typedef GLint (APIENTRYP PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar *name);
-typedef void (APIENTRYP PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
-typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint *location);
-#endif
-
-#ifndef GL_EXT_bindable_uniform
-#define GL_EXT_bindable_uniform 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glUniformBufferEXT (GLuint, GLint, GLuint);
-GLAPI GLint APIENTRY glGetUniformBufferSizeEXT (GLuint, GLint);
-GLAPI GLintptr APIENTRY glGetUniformOffsetEXT (GLuint, GLint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer);
-typedef GLint (APIENTRYP PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location);
-typedef GLintptr (APIENTRYP PFNGLGETUNIFORMOFFSETEXTPROC) (GLuint program, GLint location);
-#endif
-
-#ifndef GL_EXT_texture_integer
-#define GL_EXT_texture_integer 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTexParameterIivEXT (GLenum, GLenum, const GLint *);
-GLAPI void APIENTRY glTexParameterIuivEXT (GLenum, GLenum, const GLuint *);
-GLAPI void APIENTRY glGetTexParameterIivEXT (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetTexParameterIuivEXT (GLenum, GLenum, GLuint *);
-GLAPI void APIENTRY glClearColorIiEXT (GLint, GLint, GLint, GLint);
-GLAPI void APIENTRY glClearColorIuiEXT (GLuint, GLuint, GLuint, GLuint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params);
-typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params);
-typedef void (APIENTRYP PFNGLCLEARCOLORIIEXTPROC) (GLint red, GLint green, GLint blue, GLint alpha);
-typedef void (APIENTRYP PFNGLCLEARCOLORIUIEXTPROC) (GLuint red, GLuint green, GLuint blue, GLuint alpha);
-#endif
-
-/* ERO */
-GLAPI void GLAPIENTRY fake_gluBuild2DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *data);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
+++ /dev/null
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: This software was created using the
-** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
-** not been independently verified as being compliant with the OpenGL(R)
-** version 1.2.1 Specification.
-*/
-
-#ifndef __glu_h__
-#define __glu_h__
-
-#if defined(USE_MGL_NAMESPACE)
-#include "glu_mangle.h"
-#endif
-
-//#include <GL/gl.h>
-#include "mesa_gl.h"
-
-#ifndef GLAPIENTRY
-#define GLAPIENTRY
-#endif
-
-#ifndef GLAPIENTRYP
-#define GLAPIENTRYP GLAPIENTRY *
-#endif
-
-#ifdef GLAPI
-#undef GLAPI
-#endif
-
-# if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GLU32)
-# define GLAPI __declspec(dllexport)
-# elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
-# define GLAPI __declspec(dllimport)
-# else /* for use with static link lib build of Win32 edition only */
-# define GLAPI extern
-# endif /* _STATIC_MESA support */
-
-
-#ifndef GLAPI
-#define GLAPI
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*************************************************************/
-
-/* Extensions */
-#define GLU_EXT_object_space_tess 1
-#define GLU_EXT_nurbs_tessellator 1
-
-/* Boolean */
-#define GLU_FALSE 0
-#define GLU_TRUE 1
-
-/* Version */
-#define GLU_VERSION_1_1 1
-#define GLU_VERSION_1_2 1
-#define GLU_VERSION_1_3 1
-
-/* StringName */
-#define GLU_VERSION 100800
-#define GLU_EXTENSIONS 100801
-
-/* ErrorCode */
-#define GLU_INVALID_ENUM 100900
-#define GLU_INVALID_VALUE 100901
-#define GLU_OUT_OF_MEMORY 100902
-#define GLU_INCOMPATIBLE_GL_VERSION 100903
-#define GLU_INVALID_OPERATION 100904
-
-/* NurbsDisplay */
-/* GLU_FILL */
-#define GLU_OUTLINE_POLYGON 100240
-#define GLU_OUTLINE_PATCH 100241
-
-/* NurbsCallback */
-#define GLU_NURBS_ERROR 100103
-#define GLU_ERROR 100103
-#define GLU_NURBS_BEGIN 100164
-#define GLU_NURBS_BEGIN_EXT 100164
-#define GLU_NURBS_VERTEX 100165
-#define GLU_NURBS_VERTEX_EXT 100165
-#define GLU_NURBS_NORMAL 100166
-#define GLU_NURBS_NORMAL_EXT 100166
-#define GLU_NURBS_COLOR 100167
-#define GLU_NURBS_COLOR_EXT 100167
-#define GLU_NURBS_TEXTURE_COORD 100168
-#define GLU_NURBS_TEX_COORD_EXT 100168
-#define GLU_NURBS_END 100169
-#define GLU_NURBS_END_EXT 100169
-#define GLU_NURBS_BEGIN_DATA 100170
-#define GLU_NURBS_BEGIN_DATA_EXT 100170
-#define GLU_NURBS_VERTEX_DATA 100171
-#define GLU_NURBS_VERTEX_DATA_EXT 100171
-#define GLU_NURBS_NORMAL_DATA 100172
-#define GLU_NURBS_NORMAL_DATA_EXT 100172
-#define GLU_NURBS_COLOR_DATA 100173
-#define GLU_NURBS_COLOR_DATA_EXT 100173
-#define GLU_NURBS_TEXTURE_COORD_DATA 100174
-#define GLU_NURBS_TEX_COORD_DATA_EXT 100174
-#define GLU_NURBS_END_DATA 100175
-#define GLU_NURBS_END_DATA_EXT 100175
-
-/* NurbsError */
-#define GLU_NURBS_ERROR1 100251
-#define GLU_NURBS_ERROR2 100252
-#define GLU_NURBS_ERROR3 100253
-#define GLU_NURBS_ERROR4 100254
-#define GLU_NURBS_ERROR5 100255
-#define GLU_NURBS_ERROR6 100256
-#define GLU_NURBS_ERROR7 100257
-#define GLU_NURBS_ERROR8 100258
-#define GLU_NURBS_ERROR9 100259
-#define GLU_NURBS_ERROR10 100260
-#define GLU_NURBS_ERROR11 100261
-#define GLU_NURBS_ERROR12 100262
-#define GLU_NURBS_ERROR13 100263
-#define GLU_NURBS_ERROR14 100264
-#define GLU_NURBS_ERROR15 100265
-#define GLU_NURBS_ERROR16 100266
-#define GLU_NURBS_ERROR17 100267
-#define GLU_NURBS_ERROR18 100268
-#define GLU_NURBS_ERROR19 100269
-#define GLU_NURBS_ERROR20 100270
-#define GLU_NURBS_ERROR21 100271
-#define GLU_NURBS_ERROR22 100272
-#define GLU_NURBS_ERROR23 100273
-#define GLU_NURBS_ERROR24 100274
-#define GLU_NURBS_ERROR25 100275
-#define GLU_NURBS_ERROR26 100276
-#define GLU_NURBS_ERROR27 100277
-#define GLU_NURBS_ERROR28 100278
-#define GLU_NURBS_ERROR29 100279
-#define GLU_NURBS_ERROR30 100280
-#define GLU_NURBS_ERROR31 100281
-#define GLU_NURBS_ERROR32 100282
-#define GLU_NURBS_ERROR33 100283
-#define GLU_NURBS_ERROR34 100284
-#define GLU_NURBS_ERROR35 100285
-#define GLU_NURBS_ERROR36 100286
-#define GLU_NURBS_ERROR37 100287
-
-/* NurbsProperty */
-#define GLU_AUTO_LOAD_MATRIX 100200
-#define GLU_CULLING 100201
-#define GLU_SAMPLING_TOLERANCE 100203
-#define GLU_DISPLAY_MODE 100204
-#define GLU_PARAMETRIC_TOLERANCE 100202
-#define GLU_SAMPLING_METHOD 100205
-#define GLU_U_STEP 100206
-#define GLU_V_STEP 100207
-#define GLU_NURBS_MODE 100160
-#define GLU_NURBS_MODE_EXT 100160
-#define GLU_NURBS_TESSELLATOR 100161
-#define GLU_NURBS_TESSELLATOR_EXT 100161
-#define GLU_NURBS_RENDERER 100162
-#define GLU_NURBS_RENDERER_EXT 100162
-
-/* NurbsSampling */
-#define GLU_OBJECT_PARAMETRIC_ERROR 100208
-#define GLU_OBJECT_PARAMETRIC_ERROR_EXT 100208
-#define GLU_OBJECT_PATH_LENGTH 100209
-#define GLU_OBJECT_PATH_LENGTH_EXT 100209
-#define GLU_PATH_LENGTH 100215
-#define GLU_PARAMETRIC_ERROR 100216
-#define GLU_DOMAIN_DISTANCE 100217
-
-/* NurbsTrim */
-#define GLU_MAP1_TRIM_2 100210
-#define GLU_MAP1_TRIM_3 100211
-
-/* QuadricDrawStyle */
-#define GLU_POINT 100010
-#define GLU_LINE 100011
-#define GLU_FILL 100012
-#define GLU_SILHOUETTE 100013
-
-/* QuadricCallback */
-/* GLU_ERROR */
-
-/* QuadricNormal */
-#define GLU_SMOOTH 100000
-#define GLU_FLAT 100001
-#define GLU_NONE 100002
-
-/* QuadricOrientation */
-#define GLU_OUTSIDE 100020
-#define GLU_INSIDE 100021
-
-/* TessCallback */
-#define GLU_TESS_BEGIN 100100
-#define GLU_BEGIN 100100
-#define GLU_TESS_VERTEX 100101
-#define GLU_VERTEX 100101
-#define GLU_TESS_END 100102
-#define GLU_END 100102
-#define GLU_TESS_ERROR 100103
-#define GLU_TESS_EDGE_FLAG 100104
-#define GLU_EDGE_FLAG 100104
-#define GLU_TESS_COMBINE 100105
-#define GLU_TESS_BEGIN_DATA 100106
-#define GLU_TESS_VERTEX_DATA 100107
-#define GLU_TESS_END_DATA 100108
-#define GLU_TESS_ERROR_DATA 100109
-#define GLU_TESS_EDGE_FLAG_DATA 100110
-#define GLU_TESS_COMBINE_DATA 100111
-
-/* TessContour */
-#define GLU_CW 100120
-#define GLU_CCW 100121
-#define GLU_INTERIOR 100122
-#define GLU_EXTERIOR 100123
-#define GLU_UNKNOWN 100124
-
-/* TessProperty */
-#define GLU_TESS_WINDING_RULE 100140
-#define GLU_TESS_BOUNDARY_ONLY 100141
-#define GLU_TESS_TOLERANCE 100142
-
-/* TessError */
-#define GLU_TESS_ERROR1 100151
-#define GLU_TESS_ERROR2 100152
-#define GLU_TESS_ERROR3 100153
-#define GLU_TESS_ERROR4 100154
-#define GLU_TESS_ERROR5 100155
-#define GLU_TESS_ERROR6 100156
-#define GLU_TESS_ERROR7 100157
-#define GLU_TESS_ERROR8 100158
-#define GLU_TESS_MISSING_BEGIN_POLYGON 100151
-#define GLU_TESS_MISSING_BEGIN_CONTOUR 100152
-#define GLU_TESS_MISSING_END_POLYGON 100153
-#define GLU_TESS_MISSING_END_CONTOUR 100154
-#define GLU_TESS_COORD_TOO_LARGE 100155
-#define GLU_TESS_NEED_COMBINE_CALLBACK 100156
-
-/* TessWinding */
-#define GLU_TESS_WINDING_ODD 100130
-#define GLU_TESS_WINDING_NONZERO 100131
-#define GLU_TESS_WINDING_POSITIVE 100132
-#define GLU_TESS_WINDING_NEGATIVE 100133
-#define GLU_TESS_WINDING_ABS_GEQ_TWO 100134
-
-/*************************************************************/
-
-
-#ifdef __cplusplus
-class GLUnurbs;
-class GLUquadric;
-class GLUtesselator;
-#else
-typedef struct GLUnurbs GLUnurbs;
-typedef struct GLUquadric GLUquadric;
-typedef struct GLUtesselator GLUtesselator;
-#endif
-
-typedef GLUnurbs GLUnurbsObj;
-typedef GLUquadric GLUquadricObj;
-typedef GLUtesselator GLUtesselatorObj;
-typedef GLUtesselator GLUtriangulatorObj;
-
-#define GLU_TESS_MAX_COORD 1.0e150
-
-/* Internal convenience typedefs */
-typedef void (GLAPIENTRYP _GLUfuncptr)(void);
-
-GLAPI void GLAPIENTRY gluBeginCurve (GLUnurbs* nurb);
-GLAPI void GLAPIENTRY gluBeginPolygon (GLUtesselator* tess);
-GLAPI void GLAPIENTRY gluBeginSurface (GLUnurbs* nurb);
-GLAPI void GLAPIENTRY gluBeginTrim (GLUnurbs* nurb);
-GLAPI GLint GLAPIENTRY gluBuild1DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
-GLAPI GLint GLAPIENTRY gluBuild1DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, const void *data);
-GLAPI GLint GLAPIENTRY gluBuild2DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
-GLAPI GLint GLAPIENTRY gluBuild2DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *data);
-GLAPI GLint GLAPIENTRY gluBuild3DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
-GLAPI GLint GLAPIENTRY gluBuild3DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data);
-GLAPI GLboolean GLAPIENTRY gluCheckExtension (const GLubyte *extName, const GLubyte *extString);
-GLAPI void GLAPIENTRY gluCylinder (GLUquadric* quad, GLdouble base, GLdouble top, GLdouble height, GLint slices, GLint stacks);
-GLAPI void GLAPIENTRY gluDeleteNurbsRenderer (GLUnurbs* nurb);
-GLAPI void GLAPIENTRY gluDeleteQuadric (GLUquadric* quad);
-GLAPI void GLAPIENTRY gluDeleteTess (GLUtesselator* tess);
-GLAPI void GLAPIENTRY gluDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops);
-GLAPI void GLAPIENTRY gluEndCurve (GLUnurbs* nurb);
-GLAPI void GLAPIENTRY gluEndPolygon (GLUtesselator* tess);
-GLAPI void GLAPIENTRY gluEndSurface (GLUnurbs* nurb);
-GLAPI void GLAPIENTRY gluEndTrim (GLUnurbs* nurb);
-GLAPI const GLubyte * GLAPIENTRY gluErrorString (GLenum error);
-GLAPI void GLAPIENTRY gluGetNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat* data);
-GLAPI const GLubyte * GLAPIENTRY gluGetString (GLenum name);
-GLAPI void GLAPIENTRY gluGetTessProperty (GLUtesselator* tess, GLenum which, GLdouble* data);
-GLAPI void GLAPIENTRY gluLoadSamplingMatrices (GLUnurbs* nurb, const GLfloat *model, const GLfloat *perspective, const GLint *view);
-GLAPI void GLAPIENTRY gluLookAt (GLdouble eyeX, GLdouble eyeY, GLdouble eyeZ, GLdouble centerX, GLdouble centerY, GLdouble centerZ, GLdouble upX, GLdouble upY, GLdouble upZ);
-GLAPI GLUnurbs* GLAPIENTRY gluNewNurbsRenderer (void);
-GLAPI GLUquadric* GLAPIENTRY gluNewQuadric (void);
-GLAPI GLUtesselator* GLAPIENTRY gluNewTess (void);
-GLAPI void GLAPIENTRY gluNextContour (GLUtesselator* tess, GLenum type);
-GLAPI void GLAPIENTRY gluNurbsCallback (GLUnurbs* nurb, GLenum which, _GLUfuncptr CallBackFunc);
-GLAPI void GLAPIENTRY gluNurbsCallbackData (GLUnurbs* nurb, GLvoid* userData);
-GLAPI void GLAPIENTRY gluNurbsCallbackDataEXT (GLUnurbs* nurb, GLvoid* userData);
-GLAPI void GLAPIENTRY gluNurbsCurve (GLUnurbs* nurb, GLint knotCount, GLfloat *knots, GLint stride, GLfloat *control, GLint order, GLenum type);
-GLAPI void GLAPIENTRY gluNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat value);
-GLAPI void GLAPIENTRY gluNurbsSurface (GLUnurbs* nurb, GLint sKnotCount, GLfloat* sKnots, GLint tKnotCount, GLfloat* tKnots, GLint sStride, GLint tStride, GLfloat* control, GLint sOrder, GLint tOrder, GLenum type);
-GLAPI void GLAPIENTRY gluOrtho2D (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top);
-GLAPI void GLAPIENTRY gluPartialDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops, GLdouble start, GLdouble sweep);
-GLAPI void GLAPIENTRY gluPerspective (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar);
-GLAPI void GLAPIENTRY gluPickMatrix (GLdouble x, GLdouble y, GLdouble delX, GLdouble delY, GLint *viewport);
-GLAPI GLint GLAPIENTRY gluProject (GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* winX, GLdouble* winY, GLdouble* winZ);
-GLAPI void GLAPIENTRY gluPwlCurve (GLUnurbs* nurb, GLint count, GLfloat* data, GLint stride, GLenum type);
-GLAPI void GLAPIENTRY gluQuadricCallback (GLUquadric* quad, GLenum which, _GLUfuncptr CallBackFunc);
-GLAPI void GLAPIENTRY gluQuadricDrawStyle (GLUquadric* quad, GLenum draw);
-GLAPI void GLAPIENTRY gluQuadricNormals (GLUquadric* quad, GLenum normal);
-GLAPI void GLAPIENTRY gluQuadricOrientation (GLUquadric* quad, GLenum orientation);
-GLAPI void GLAPIENTRY gluQuadricTexture (GLUquadric* quad, GLboolean texture);
-GLAPI GLint GLAPIENTRY gluScaleImage (GLenum format, GLsizei wIn, GLsizei hIn, GLenum typeIn, const void *dataIn, GLsizei wOut, GLsizei hOut, GLenum typeOut, GLvoid* dataOut);
-GLAPI void GLAPIENTRY gluSphere (GLUquadric* quad, GLdouble radius, GLint slices, GLint stacks);
-GLAPI void GLAPIENTRY gluTessBeginContour (GLUtesselator* tess);
-GLAPI void GLAPIENTRY gluTessBeginPolygon (GLUtesselator* tess, GLvoid* data);
-GLAPI void GLAPIENTRY gluTessCallback (GLUtesselator* tess, GLenum which, _GLUfuncptr CallBackFunc);
-GLAPI void GLAPIENTRY gluTessEndContour (GLUtesselator* tess);
-GLAPI void GLAPIENTRY gluTessEndPolygon (GLUtesselator* tess);
-GLAPI void GLAPIENTRY gluTessNormal (GLUtesselator* tess, GLdouble valueX, GLdouble valueY, GLdouble valueZ);
-GLAPI void GLAPIENTRY gluTessProperty (GLUtesselator* tess, GLenum which, GLdouble data);
-GLAPI void GLAPIENTRY gluTessVertex (GLUtesselator* tess, GLdouble *location, GLvoid* data);
-GLAPI GLint GLAPIENTRY gluUnProject (GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* objX, GLdouble* objY, GLdouble* objZ);
-GLAPI GLint GLAPIENTRY gluUnProject4 (GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble nearVal, GLdouble farVal, GLdouble* objX, GLdouble* objY, GLdouble* objZ, GLdouble* objW);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __glu_h__ */
+++ /dev/null
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.4
- * Copyright (C) 1995-2000 Brian Paul
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include "mesa_glu.h"
-#include "mesa_mipmap.h"
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
-#include <assert.h>
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#endif
-
-
-/*
- * Compute ceiling of integer quotient of A divided by B:
- */
-#define CEILING(A, B) ((A) % (B) == 0 ? (A) / (B) : (A) / (B) + 1)
-
-
-
-#ifdef EPSILON
-#undef EPSILON
-#endif
-#define EPSILON 0.001
-
-
-/* To work around optimizer bug in MSVC4.1 */
-#if defined(__WIN32__) && !defined(OPENSTEP)
-void dummy(GLuint j, GLuint k)
-{
-}
-#else
-#define dummy(J, K)
-#endif
-
-
-static GLint GLAPIENTRY mesa_gluScaleImage(GLenum format,
- GLsizei widthin, GLsizei heightin,
- GLenum typein, const void *datain,
- GLsizei widthout, GLsizei heightout,
- GLenum typeout, void *dataout)
-{
- GLint components, i, j, k;
- GLfloat *tempin, *tempout;
- GLfloat sx, sy;
- GLint unpackrowlength, unpackalignment, unpackskiprows, unpackskippixels;
- GLint packrowlength, packalignment, packskiprows, packskippixels;
- GLint sizein, sizeout;
- GLint rowstride, rowlen;
-
- /* Determine number of components per pixel */
- switch (format) {
- case GL_COLOR_INDEX:
- case GL_STENCIL_INDEX:
- case GL_DEPTH_COMPONENT:
- case GL_RED:
- case GL_GREEN:
- case GL_BLUE:
- case GL_ALPHA:
- case GL_LUMINANCE:
- components = 1;
- break;
- case GL_LUMINANCE_ALPHA:
- components = 2;
- break;
- case GL_RGB:
- case GL_BGR:
- components = 3;
- break;
- case GL_RGBA:
- case GL_BGRA:
-#ifdef GL_EXT_abgr
- case GL_ABGR_EXT:
-#endif
- components = 4;
- break;
- default:
- return GLU_INVALID_ENUM;
- }
-
- /* Determine bytes per input datum */
- switch (typein) {
- case GL_UNSIGNED_BYTE:
- sizein = sizeof(GLubyte);
- break;
- case GL_BYTE:
- sizein = sizeof(GLbyte);
- break;
- case GL_UNSIGNED_SHORT:
- sizein = sizeof(GLushort);
- break;
- case GL_SHORT:
- sizein = sizeof(GLshort);
- break;
- case GL_UNSIGNED_INT:
- sizein = sizeof(GLuint);
- break;
- case GL_INT:
- sizein = sizeof(GLint);
- break;
- case GL_FLOAT:
- sizein = sizeof(GLfloat);
- break;
- case GL_BITMAP:
- /* not implemented yet */
- default:
- return GL_INVALID_ENUM;
- }
-
- /* Determine bytes per output datum */
- switch (typeout) {
- case GL_UNSIGNED_BYTE:
- sizeout = sizeof(GLubyte);
- break;
- case GL_BYTE:
- sizeout = sizeof(GLbyte);
- break;
- case GL_UNSIGNED_SHORT:
- sizeout = sizeof(GLushort);
- break;
- case GL_SHORT:
- sizeout = sizeof(GLshort);
- break;
- case GL_UNSIGNED_INT:
- sizeout = sizeof(GLuint);
- break;
- case GL_INT:
- sizeout = sizeof(GLint);
- break;
- case GL_FLOAT:
- sizeout = sizeof(GLfloat);
- break;
- case GL_BITMAP:
- /* not implemented yet */
- default:
- return GL_INVALID_ENUM;
- }
-
- /* Get glPixelStore state */
- glGetIntegerv(GL_UNPACK_ROW_LENGTH, &unpackrowlength);
- glGetIntegerv(GL_UNPACK_ALIGNMENT, &unpackalignment);
- glGetIntegerv(GL_UNPACK_SKIP_ROWS, &unpackskiprows);
- glGetIntegerv(GL_UNPACK_SKIP_PIXELS, &unpackskippixels);
- glGetIntegerv(GL_PACK_ROW_LENGTH, &packrowlength);
- glGetIntegerv(GL_PACK_ALIGNMENT, &packalignment);
- glGetIntegerv(GL_PACK_SKIP_ROWS, &packskiprows);
- glGetIntegerv(GL_PACK_SKIP_PIXELS, &packskippixels);
-
- /* Allocate storage for intermediate images */
- tempin = (GLfloat *)malloc(widthin * heightin * components *
- sizeof(GLfloat));
- if (!tempin) {
- return GLU_OUT_OF_MEMORY;
- }
- tempout = (GLfloat *)malloc(widthout * heightout * components *
- sizeof(GLfloat));
- if (!tempout) {
- free(tempin);
- return GLU_OUT_OF_MEMORY;
- }
-
-
- /*
- * Unpack the pixel data and convert to floating point
- */
-
- if (unpackrowlength > 0) {
- rowlen = unpackrowlength;
- } else {
- rowlen = widthin;
- }
- if (sizein >= unpackalignment) {
- rowstride = components * rowlen;
- } else {
- rowstride = unpackalignment / sizein * CEILING(components *
- rowlen * sizein,
- unpackalignment);
- }
-
- switch (typein) {
- case GL_UNSIGNED_BYTE:
- k = 0;
- for (i = 0; i < heightin; i++) {
- GLubyte *ubptr = (GLubyte *)datain + i * rowstride
- + unpackskiprows * rowstride
- + unpackskippixels * components;
- for (j = 0; j < widthin * components; j++) {
- dummy(j, k);
- tempin[k++] = (GLfloat)*ubptr++;
- }
- }
- break;
- case GL_BYTE:
- k = 0;
- for (i = 0; i < heightin; i++) {
- GLbyte *bptr = (GLbyte *)datain + i * rowstride
- + unpackskiprows * rowstride
- + unpackskippixels * components;
- for (j = 0; j < widthin * components; j++) {
- dummy(j, k);
- tempin[k++] = (GLfloat)*bptr++;
- }
- }
- break;
- case GL_UNSIGNED_SHORT:
- k = 0;
- for (i = 0; i < heightin; i++) {
- GLushort *usptr = (GLushort *)datain + i * rowstride
- + unpackskiprows * rowstride
- + unpackskippixels * components;
- for (j = 0; j < widthin * components; j++) {
- dummy(j, k);
- tempin[k++] = (GLfloat)*usptr++;
- }
- }
- break;
- case GL_SHORT:
- k = 0;
- for (i = 0; i < heightin; i++) {
- GLshort *sptr = (GLshort *)datain + i * rowstride
- + unpackskiprows * rowstride
- + unpackskippixels * components;
- for (j = 0; j < widthin * components; j++) {
- dummy(j, k);
- tempin[k++] = (GLfloat)*sptr++;
- }
- }
- break;
- case GL_UNSIGNED_INT:
- k = 0;
- for (i = 0; i < heightin; i++) {
- GLuint *uiptr = (GLuint *)datain + i * rowstride
- + unpackskiprows * rowstride
- + unpackskippixels * components;
- for (j = 0; j < widthin * components; j++) {
- dummy(j, k);
- tempin[k++] = (GLfloat)*uiptr++;
- }
- }
- break;
- case GL_INT:
- k = 0;
- for (i = 0; i < heightin; i++) {
- GLint *iptr = (GLint *)datain + i * rowstride
- + unpackskiprows * rowstride
- + unpackskippixels * components;
- for (j = 0; j < widthin * components; j++) {
- dummy(j, k);
- tempin[k++] = (GLfloat)*iptr++;
- }
- }
- break;
- case GL_FLOAT:
- k = 0;
- for (i = 0; i < heightin; i++) {
- GLfloat *fptr = (GLfloat *)datain + i * rowstride
- + unpackskiprows * rowstride
- + unpackskippixels * components;
- for (j = 0; j < widthin * components; j++) {
- dummy(j, k);
- tempin[k++] = *fptr++;
- }
- }
- break;
- default:
- return GLU_INVALID_ENUM;
- }
-
- /*
- * Scale the image!
- */
-
- if (widthout > 1) {
- sx = (GLfloat) (widthin - 1) / (GLfloat) (widthout - 1);
- } else {
- sx = (GLfloat) (widthin - 1);
- }
- if (heightout > 1) {
- sy = (GLfloat) (heightin - 1) / (GLfloat) (heightout - 1);
- } else {
- sy = (GLfloat) (heightin - 1);
- }
-
-/*#define POINT_SAMPLE*/
-#ifdef POINT_SAMPLE
- for (i = 0; i < heightout; i++) {
- GLint ii = i * sy;
- for (j = 0; j < widthout; j++) {
- GLint jj = j * sx;
-
- GLfloat *src = tempin + (ii * widthin + jj) * components;
- GLfloat *dst = tempout + (i * widthout + j) * components;
-
- for (k = 0; k < components; k++) {
- *dst++ = *src++;
- }
- }
- }
-#else
- if (sx < 1.0 && sy < 1.0) {
- /* magnify both width and height: use weighted sample of 4 pixels */
- GLint i0, i1, j0, j1;
- GLfloat alpha, beta;
- GLfloat *src00, *src01, *src10, *src11;
- GLfloat s1, s2;
- GLfloat *dst;
-
- for (i = 0; i < heightout; i++) {
- i0 = i * sy;
- i1 = i0 + 1;
- if (i1 >= heightin) {
- i1 = heightin - 1;
- }
- /* i1 = (i+1) * sy - EPSILON; */
- alpha = i * sy - i0;
- for (j = 0; j < widthout; j++) {
- j0 = j * sx;
- j1 = j0 + 1;
- if (j1 >= widthin) {
- j1 = widthin - 1;
- }
- /* j1 = (j+1) * sx - EPSILON; */
- beta = j * sx - j0;
-
- /* compute weighted average of pixels
- in rect (i0, j0) - (i1, j1) */
- src00 = tempin + (i0 * widthin + j0) * components;
- src01 = tempin + (i0 * widthin + j1) * components;
- src10 = tempin + (i1 * widthin + j0) * components;
- src11 = tempin + (i1 * widthin + j1) * components;
-
- dst = tempout + (i * widthout + j) * components;
-
- for (k = 0; k < components; k++) {
- s1 = *src00++ * (1.0 - beta) + *src01++ * beta;
- s2 = *src10++ * (1.0 - beta) + *src11++ * beta;
- *dst++ = s1 * (1.0 - alpha) + s2 * alpha;
- }
- }
- }
- } else {
- /* shrink width and/or height: use an unweighted box filter */
- GLint i0, i1;
- GLint j0, j1;
- GLint ii, jj;
- GLfloat sum, *dst;
-
- for (i = 0; i < heightout; i++) {
- i0 = i * sy;
- i1 = i0 + 1;
- if (i1 >= heightin) {
- i1 = heightin - 1;
- }
- /* i1 = (i+1) * sy - EPSILON; */
- for (j = 0; j < widthout; j++) {
- j0 = j * sx;
- j1 = j0 + 1;
- if (j1 >= widthin) {
- j1 = widthin - 1;
- }
- /* j1 = (j+1) * sx - EPSILON; */
-
- dst = tempout + (i * widthout + j) * components;
-
- /* compute average of pixels
- in the rectangle (i0, j0) - (i1, j1) */
- for (k = 0; k < components; k++) {
- sum = 0.0;
- for (ii = i0; ii <= i1; ii++) {
- for (jj = j0; jj <= j1; jj++) {
- sum += *(tempin + (ii * widthin + jj) *
- components + k);
- }
- }
- sum /= (j1 - j0 + 1) * (i1 - i0 + 1);
- *dst++ = sum;
- }
- }
- }
- }
-#endif
-
-
- /*
- * Return output image
- */
-
- if (packrowlength > 0) {
- rowlen = packrowlength;
- } else {
- rowlen = widthout;
- }
- if (sizeout >= packalignment) {
- rowstride = components * rowlen;
- } else {
- rowstride = packalignment / sizeout * CEILING(components * rowlen *
- sizeout, packalignment);
- }
-
- switch (typeout) {
- case GL_UNSIGNED_BYTE:
- k = 0;
- for (i = 0; i < heightout; i++) {
- GLubyte *ubptr = (GLubyte *)dataout + i * rowstride
- + packskiprows * rowstride
- + packskippixels * components;
- for (j = 0; j < widthout * components; j++) {
- dummy(j, k + i);
- *ubptr++ = (GLubyte)tempout[k++];
- }
- }
- break;
- case GL_BYTE:
- k = 0;
- for (i = 0; i < heightout; i++) {
- GLbyte *bptr = (GLbyte *)dataout + i * rowstride
- + packskiprows * rowstride
- + packskippixels * components;
- for (j = 0; j < widthout * components; j++) {
- dummy(j, k + i);
- *bptr++ = (GLbyte)tempout[k++];
- }
- }
- break;
- case GL_UNSIGNED_SHORT:
- k = 0;
- for (i = 0; i < heightout; i++) {
- GLushort *usptr = (GLushort *)dataout + i * rowstride
- + packskiprows * rowstride
- + packskippixels * components;
- for (j = 0; j < widthout * components; j++) {
- dummy(j, k + i);
- *usptr++ = (GLushort)tempout[k++];
- }
- }
- break;
- case GL_SHORT:
- k = 0;
- for (i = 0; i < heightout; i++) {
- GLshort *sptr = (GLshort *)dataout + i * rowstride
- + packskiprows * rowstride
- + packskippixels * components;
- for (j = 0; j < widthout * components; j++) {
- dummy(j, k + i);
- *sptr++ = (GLshort)tempout[k++];
- }
- }
- break;
- case GL_UNSIGNED_INT:
- k = 0;
- for (i = 0; i < heightout; i++) {
- GLuint *uiptr = (GLuint *)dataout + i * rowstride
- + packskiprows * rowstride
- + packskippixels * components;
- for (j = 0; j < widthout * components; j++) {
- dummy(j, k + i);
- *uiptr++ = (GLuint)tempout[k++];
- }
- }
- break;
- case GL_INT:
- k = 0;
- for (i = 0; i < heightout; i++) {
- GLint *iptr = (GLint *)dataout + i * rowstride
- + packskiprows * rowstride
- + packskippixels * components;
- for (j = 0; j < widthout * components; j++) {
- dummy(j, k + i);
- *iptr++ = (GLint)tempout[k++];
- }
- }
- break;
- case GL_FLOAT:
- k = 0;
- for (i = 0; i < heightout; i++) {
- GLfloat *fptr = (GLfloat *)dataout + i * rowstride
- + packskiprows * rowstride + packskippixels
- * components;
- for (j = 0; j < widthout * components; j++) {
- dummy(j, k + i);
- *fptr++ = tempout[k++];
- }
- }
- break;
- default:
- return GLU_INVALID_ENUM;
- }
-
-
- /* free temporary image storage */
- free(tempin);
- free(tempout);
-
- return 0;
-}
-
-
-
-/*
- * Return the largest k such that 2^k <= n.
- */
-static GLint ilog2(GLint n)
-{
- GLint k;
-
- if (n <= 0) {
- return 0;
- }
- for (k = 0; n >>= 1; k++) {
- ;
- }
- return k;
-}
-
-
-
-/*
- * Find the value nearest to n which is also a power of two.
- */
-static GLint round2(GLint n)
-{
- GLint m;
-
- for (m = 1; m < n; m *= 2) {
- ;
- }
-
- /* m>=n */
- if (m - n <= n - m / 2) {
- return m;
- } else {
- return m / 2;
- }
-}
-
-
-/*
- * Given an pixel format and datatype, return the number of bytes to
- * store one pixel.
- */
-static GLint bytes_per_pixel(GLenum format, GLenum type)
-{
- GLint n, m;
-
- switch (format) {
- case GL_COLOR_INDEX:
- case GL_STENCIL_INDEX:
- case GL_DEPTH_COMPONENT:
- case GL_RED:
- case GL_GREEN:
- case GL_BLUE:
- case GL_ALPHA:
- case GL_LUMINANCE:
- n = 1;
- break;
- case GL_LUMINANCE_ALPHA:
- n = 2;
- break;
- case GL_RGB:
- case GL_BGR:
- n = 3;
- break;
- case GL_RGBA:
- case GL_BGRA:
-#ifdef GL_EXT_abgr
- case GL_ABGR_EXT:
-#endif
- n = 4;
- break;
- default:
- n = 0;
- }
-
- switch (type) {
- case GL_UNSIGNED_BYTE:
- m = sizeof(GLubyte);
- break;
- case GL_BYTE:
- m = sizeof(GLbyte);
- break;
- case GL_BITMAP:
- m = 1;
- break;
- case GL_UNSIGNED_SHORT:
- m = sizeof(GLushort);
- break;
- case GL_SHORT:
- m = sizeof(GLshort);
- break;
- case GL_UNSIGNED_INT:
- m = sizeof(GLuint);
- break;
- case GL_INT:
- m = sizeof(GLint);
- break;
- case GL_FLOAT:
- m = sizeof(GLfloat);
- break;
- default:
- m = 0;
- }
-
- return n * m;
-}
-
-
-
-/*
- * WARNING: This function isn't finished and has never been tested!!!!
- */
-GLint GLAPIENTRY mesa_gluBuild1DMipmaps(GLenum target, GLint components,
- GLsizei width, GLenum format,
- GLenum type, const void *data)
-{
- GLubyte *texture;
- GLint levels, max_levels;
- GLint new_width, max_width;
- GLint i, j, k, l;
-
- if (width < 1) {
- return GLU_INVALID_VALUE;
- }
-
- glGetIntegerv(GL_MAX_TEXTURE_SIZE, &max_width);
- max_levels = ilog2(max_width) + 1;
-
- /* Compute how many mipmap images to make */
- levels = ilog2(width) + 1;
- if (levels > max_levels) {
- levels = max_levels;
- }
-
- new_width = 1 << (levels - 1);
-
- texture = (GLubyte *)malloc(new_width * components);
- if (!texture) {
- return GLU_OUT_OF_MEMORY;
- }
-
- if (width != new_width) {
- /* initial rescaling */
- switch (type) {
- case GL_UNSIGNED_BYTE:
- {
- GLubyte *ub_data = (GLubyte *)data;
- for (i = 0; i < new_width; i++) {
- j = i * width / new_width;
- for (k = 0; k < components; k++) {
- texture[i * components + k] =
- ub_data[j * components + k];
- }
- }
- }
- break;
- default:
- /* Not implemented */
- free(texture);
- return GLU_ERROR;
- }
- }
-
- /* generate and load mipmap images */
- for (l = 0; l < levels; l++) {
- glTexImage1D(GL_TEXTURE_1D, l, components, new_width, 0,
- format, GL_UNSIGNED_BYTE, texture);
-
- /* Scale image down to 1/2 size */
- new_width = new_width / 2;
- for (i = 0; i < new_width; i++) {
- for (k = 0; k < components; k++) {
- GLint sample1, sample2;
- sample1 = (GLint)texture[i * 2 * components + k];
- sample2 = (GLint)texture[(i * 2 + 1) * components + k];
- texture[i * components + k] =
- (GLubyte)((sample1 + sample2) / 2);
- }
- }
- }
-
- free(texture);
-
- return 0;
-}
-
-
-
-GLint GLAPIENTRY mesa_gluBuild2DMipmaps(GLenum target, GLint components,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const void *data)
-{
- GLint w, h, maxsize;
- void *image, *newimage;
- GLint neww, newh, level, bpp;
- int error;
- GLboolean done;
- GLint retval = 0;
- GLint unpackrowlength, unpackalignment, unpackskiprows, unpackskippixels;
- GLint packrowlength, packalignment, packskiprows, packskippixels;
-
- if (width < 1 || height < 1) {
- return GLU_INVALID_VALUE;
- }
-
- glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxsize);
-
- w = round2(width);
- if (w > maxsize) {
- w = maxsize;
- }
- h = round2(height);
- if (h > maxsize) {
- h = maxsize;
- }
-
- bpp = bytes_per_pixel(format, type);
- if (bpp == 0) {
- /* probably a bad format or type enum */
- return GLU_INVALID_ENUM;
- }
-
- /* Get current glPixelStore values */
- glGetIntegerv(GL_UNPACK_ROW_LENGTH, &unpackrowlength);
- glGetIntegerv(GL_UNPACK_ALIGNMENT, &unpackalignment);
- glGetIntegerv(GL_UNPACK_SKIP_ROWS, &unpackskiprows);
- glGetIntegerv(GL_UNPACK_SKIP_PIXELS, &unpackskippixels);
- glGetIntegerv(GL_PACK_ROW_LENGTH, &packrowlength);
- glGetIntegerv(GL_PACK_ALIGNMENT, &packalignment);
- glGetIntegerv(GL_PACK_SKIP_ROWS, &packskiprows);
- glGetIntegerv(GL_PACK_SKIP_PIXELS, &packskippixels);
-
- /* set pixel packing */
- glPixelStorei(GL_PACK_ROW_LENGTH, 0);
- glPixelStorei(GL_PACK_ALIGNMENT, 1);
- glPixelStorei(GL_PACK_SKIP_ROWS, 0);
- glPixelStorei(GL_PACK_SKIP_PIXELS, 0);
-
- done = GL_FALSE;
-
- if (w != width || h != height) {
- /* must rescale image to get "top" mipmap texture image */
- image = malloc((w + 4) * h * bpp);
- if (!image) {
- return GLU_OUT_OF_MEMORY;
- }
- error = mesa_gluScaleImage(format, width, height, type, data,
- w, h, type, image);
- if (error) {
- retval = error;
- done = GL_TRUE;
- }
- } else {
- image = (void *) data;
- }
-
- level = 0;
- while (!done) {
- if (image != data) {
- /* set pixel unpacking */
- glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
- }
-
- glTexImage2D(target, level, components, w, h, 0, format, type, image);
-
- if (w == 1 && h == 1) {
- break;
- }
-
- neww = (w < 2) ? 1 : w / 2;
- newh = (h < 2) ? 1 : h / 2;
- newimage = malloc((neww + 4) * newh * bpp);
- if (!newimage) {
- return GLU_OUT_OF_MEMORY;
- }
-
- error = mesa_gluScaleImage(format, w, h, type, image,
- neww, newh, type, newimage);
- if (error) {
- retval = error;
- done = GL_TRUE;
- }
-
- if (image != data) {
- free(image);
- }
- image = newimage;
-
- w = neww;
- h = newh;
- level++;
- }
-
- if (image != data) {
- free(image);
- }
-
- /* Restore original glPixelStore state */
- glPixelStorei(GL_UNPACK_ROW_LENGTH, unpackrowlength);
- glPixelStorei(GL_UNPACK_ALIGNMENT, unpackalignment);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, unpackskiprows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, unpackskippixels);
- glPixelStorei(GL_PACK_ROW_LENGTH, packrowlength);
- glPixelStorei(GL_PACK_ALIGNMENT, packalignment);
- glPixelStorei(GL_PACK_SKIP_ROWS, packskiprows);
- glPixelStorei(GL_PACK_SKIP_PIXELS, packskippixels);
-
- return retval;
-}
+++ /dev/null
-/*
- * Mesa 3-D graphics library
- * Version: 3.4
- * Copyright (C) 1995-2000 Brian Paul
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-extern GLint GLAPIENTRY
-mesa_gluBuild1DMipmaps(GLenum target, GLint components,
- GLsizei width, GLenum format,
- GLenum type, const void *data);
-
-extern GLint GLAPIENTRY
-mesa_gluBuild2DMipmaps(GLenum target, GLint components,
- GLsizei width, GLsizei height, GLenum format,
- GLenum type, const void *data);
+++ /dev/null
-/*
- * i386 helpers
- *
- * Copyright (c) 2003 Fabrice Bellard
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, see <http://www.gnu.org/licenses/>.
- */
-
-#include <math.h>
-#include "cpu.h"
-#include "dyngen-exec.h"
-#include "host-utils.h"
-#include "ioport.h"
-#include "qemu-log.h"
-#include "cpu-defs.h"
-#include "helper.h"
-
-#if !defined(CONFIG_USER_ONLY)
-#include "softmmu_exec.h"
-#endif /* !defined(CONFIG_USER_ONLY) */
-
-//#define DEBUG_PCALL
-
-#ifdef DEBUG_PCALL
-# define LOG_PCALL(...) qemu_log_mask(CPU_LOG_PCALL, ## __VA_ARGS__)
-# define LOG_PCALL_STATE(env) \
- log_cpu_state_mask(CPU_LOG_PCALL, (env), X86_DUMP_CCOP)
-#else
-# define LOG_PCALL(...) do { } while (0)
-# define LOG_PCALL_STATE(env) do { } while (0)
-#endif
-
-/* n must be a constant to be efficient */
-static inline target_long lshift(target_long x, int n)
-{
- if (n >= 0) {
- return x << n;
- } else {
- return x >> (-n);
- }
-}
-
-#define FPU_RC_MASK 0xc00
-#define FPU_RC_NEAR 0x000
-#define FPU_RC_DOWN 0x400
-#define FPU_RC_UP 0x800
-#define FPU_RC_CHOP 0xc00
-
-#define MAXTAN 9223372036854775808.0
-
-/* the following deal with x86 long double-precision numbers */
-#define MAXEXPD 0x7fff
-#define EXPBIAS 16383
-#define EXPD(fp) (fp.l.upper & 0x7fff)
-#define SIGND(fp) ((fp.l.upper) & 0x8000)
-#define MANTD(fp) (fp.l.lower)
-#define BIASEXPONENT(fp) fp.l.upper = (fp.l.upper & ~(0x7fff)) | EXPBIAS
-
-static inline void fpush(void)
-{
- env->fpstt = (env->fpstt - 1) & 7;
- env->fptags[env->fpstt] = 0; /* validate stack entry */
-}
-
-static inline void fpop(void)
-{
- env->fptags[env->fpstt] = 1; /* invvalidate stack entry */
- env->fpstt = (env->fpstt + 1) & 7;
-}
-
-static inline floatx80 helper_fldt(target_ulong ptr)
-{
- CPU_LDoubleU temp;
-
- temp.l.lower = ldq(ptr);
- temp.l.upper = lduw(ptr + 8);
- return temp.d;
-}
-
-static inline void helper_fstt(floatx80 f, target_ulong ptr)
-{
- CPU_LDoubleU temp;
-
- temp.d = f;
- stq(ptr, temp.l.lower);
- stw(ptr + 8, temp.l.upper);
-}
-
-#define FPUS_IE (1 << 0)
-#define FPUS_DE (1 << 1)
-#define FPUS_ZE (1 << 2)
-#define FPUS_OE (1 << 3)
-#define FPUS_UE (1 << 4)
-#define FPUS_PE (1 << 5)
-#define FPUS_SF (1 << 6)
-#define FPUS_SE (1 << 7)
-#define FPUS_B (1 << 15)
-
-#define FPUC_EM 0x3f
-
-static inline uint32_t compute_eflags(void)
-{
- return env->eflags | helper_cc_compute_all(CC_OP) | (DF & DF_MASK);
-}
-
-/* NOTE: CC_OP must be modified manually to CC_OP_EFLAGS */
-static inline void load_eflags(int eflags, int update_mask)
-{
- CC_SRC = eflags & (CC_O | CC_S | CC_Z | CC_A | CC_P | CC_C);
- DF = 1 - (2 * ((eflags >> 10) & 1));
- env->eflags = (env->eflags & ~update_mask) |
- (eflags & update_mask) | 0x2;
-}
-
-/* load efer and update the corresponding hflags. XXX: do consistency
- checks with cpuid bits ? */
-static inline void cpu_load_efer(CPUX86State *env, uint64_t val)
-{
- env->efer = val;
- env->hflags &= ~(HF_LMA_MASK | HF_SVME_MASK);
- if (env->efer & MSR_EFER_LMA) {
- env->hflags |= HF_LMA_MASK;
- }
- if (env->efer & MSR_EFER_SVME) {
- env->hflags |= HF_SVME_MASK;
- }
-}
-
-#if 0
-#define raise_exception_err(a, b)\
-do {\
- qemu_log("raise_exception line=%d\n", __LINE__);\
- (raise_exception_err)(a, b);\
-} while (0)
-#endif
-
-static void QEMU_NORETURN raise_exception_err(int exception_index,
- int error_code);
-
-static const uint8_t parity_table[256] = {
- CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
- 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
- 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
- CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
- 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
- CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
- CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
- 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
- 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
- CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
- CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
- 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
- CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
- 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
- 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
- CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
- 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
- CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
- CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
- 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
- CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
- 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
- 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
- CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
- CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
- 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
- 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
- CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
- 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
- CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
- CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
- 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
-};
-
-/* modulo 17 table */
-static const uint8_t rclw_table[32] = {
- 0, 1, 2, 3, 4, 5, 6, 7,
- 8, 9,10,11,12,13,14,15,
- 16, 0, 1, 2, 3, 4, 5, 6,
- 7, 8, 9,10,11,12,13,14,
-};
-
-/* modulo 9 table */
-static const uint8_t rclb_table[32] = {
- 0, 1, 2, 3, 4, 5, 6, 7,
- 8, 0, 1, 2, 3, 4, 5, 6,
- 7, 8, 0, 1, 2, 3, 4, 5,
- 6, 7, 8, 0, 1, 2, 3, 4,
-};
-
-#define floatx80_lg2 make_floatx80( 0x3ffd, 0x9a209a84fbcff799LL )
-#define floatx80_l2e make_floatx80( 0x3fff, 0xb8aa3b295c17f0bcLL )
-#define floatx80_l2t make_floatx80( 0x4000, 0xd49a784bcd1b8afeLL )
-
-/* broken thread support */
-
-static spinlock_t global_cpu_lock = SPIN_LOCK_UNLOCKED;
-
-void helper_lock(void)
-{
- spin_lock(&global_cpu_lock);
-}
-
-void helper_unlock(void)
-{
- spin_unlock(&global_cpu_lock);
-}
-
-void helper_write_eflags(target_ulong t0, uint32_t update_mask)
-{
- load_eflags(t0, update_mask);
-}
-
-target_ulong helper_read_eflags(void)
-{
- uint32_t eflags;
- eflags = helper_cc_compute_all(CC_OP);
- eflags |= (DF & DF_MASK);
- eflags |= env->eflags & ~(VM_MASK | RF_MASK);
- return eflags;
-}
-
-/* return non zero if error */
-static inline int load_segment(uint32_t *e1_ptr, uint32_t *e2_ptr,
- int selector)
-{
- SegmentCache *dt;
- int index;
- target_ulong ptr;
-
- if (selector & 0x4)
- dt = &env->ldt;
- else
- dt = &env->gdt;
- index = selector & ~7;
- if ((index + 7) > dt->limit)
- return -1;
- ptr = dt->base + index;
- *e1_ptr = ldl_kernel(ptr);
- *e2_ptr = ldl_kernel(ptr + 4);
- return 0;
-}
-
-static inline unsigned int get_seg_limit(uint32_t e1, uint32_t e2)
-{
- unsigned int limit;
- limit = (e1 & 0xffff) | (e2 & 0x000f0000);
- if (e2 & DESC_G_MASK)
- limit = (limit << 12) | 0xfff;
- return limit;
-}
-
-static inline uint32_t get_seg_base(uint32_t e1, uint32_t e2)
-{
- return ((e1 >> 16) | ((e2 & 0xff) << 16) | (e2 & 0xff000000));
-}
-
-static inline void load_seg_cache_raw_dt(SegmentCache *sc, uint32_t e1, uint32_t e2)
-{
- sc->base = get_seg_base(e1, e2);
- sc->limit = get_seg_limit(e1, e2);
- sc->flags = e2;
-}
-
-/* init the segment cache in vm86 mode. */
-static inline void load_seg_vm(int seg, int selector)
-{
- selector &= 0xffff;
- cpu_x86_load_seg_cache(env, seg, selector,
- (selector << 4), 0xffff, 0);
-}
-
-static inline void get_ss_esp_from_tss(uint32_t *ss_ptr,
- uint32_t *esp_ptr, int dpl)
-{
- int type, index, shift;
-
-#if 0
- {
- int i;
- printf("TR: base=%p limit=%x\n", env->tr.base, env->tr.limit);
- for(i=0;i<env->tr.limit;i++) {
- printf("%02x ", env->tr.base[i]);
- if ((i & 7) == 7) printf("\n");
- }
- printf("\n");
- }
-#endif
-
- if (!(env->tr.flags & DESC_P_MASK))
- cpu_abort(env, "invalid tss");
- type = (env->tr.flags >> DESC_TYPE_SHIFT) & 0xf;
- if ((type & 7) != 1)
- cpu_abort(env, "invalid tss type");
- shift = type >> 3;
- index = (dpl * 4 + 2) << shift;
- if (index + (4 << shift) - 1 > env->tr.limit)
- raise_exception_err(EXCP0A_TSS, env->tr.selector & 0xfffc);
- if (shift == 0) {
- *esp_ptr = lduw_kernel(env->tr.base + index);
- *ss_ptr = lduw_kernel(env->tr.base + index + 2);
- } else {
- *esp_ptr = ldl_kernel(env->tr.base + index);
- *ss_ptr = lduw_kernel(env->tr.base + index + 4);
- }
-}
-
-/* XXX: merge with load_seg() */
-static void tss_load_seg(int seg_reg, int selector)
-{
- uint32_t e1, e2;
- int rpl, dpl, cpl;
-
- if ((selector & 0xfffc) != 0) {
- if (load_segment(&e1, &e2, selector) != 0)
- raise_exception_err(EXCP0A_TSS, selector & 0xfffc);
- if (!(e2 & DESC_S_MASK))
- raise_exception_err(EXCP0A_TSS, selector & 0xfffc);
- rpl = selector & 3;
- dpl = (e2 >> DESC_DPL_SHIFT) & 3;
- cpl = env->hflags & HF_CPL_MASK;
- if (seg_reg == R_CS) {
- if (!(e2 & DESC_CS_MASK))
- raise_exception_err(EXCP0A_TSS, selector & 0xfffc);
- /* XXX: is it correct ? */
- if (dpl != rpl)
- raise_exception_err(EXCP0A_TSS, selector & 0xfffc);
- if ((e2 & DESC_C_MASK) && dpl > rpl)
- raise_exception_err(EXCP0A_TSS, selector & 0xfffc);
- } else if (seg_reg == R_SS) {
- /* SS must be writable data */
- if ((e2 & DESC_CS_MASK) || !(e2 & DESC_W_MASK))
- raise_exception_err(EXCP0A_TSS, selector & 0xfffc);
- if (dpl != cpl || dpl != rpl)
- raise_exception_err(EXCP0A_TSS, selector & 0xfffc);
- } else {
- /* not readable code */
- if ((e2 & DESC_CS_MASK) && !(e2 & DESC_R_MASK))
- raise_exception_err(EXCP0A_TSS, selector & 0xfffc);
- /* if data or non conforming code, checks the rights */
- if (((e2 >> DESC_TYPE_SHIFT) & 0xf) < 12) {
- if (dpl < cpl || dpl < rpl)
- raise_exception_err(EXCP0A_TSS, selector & 0xfffc);
- }
- }
- if (!(e2 & DESC_P_MASK))
- raise_exception_err(EXCP0B_NOSEG, selector & 0xfffc);
- cpu_x86_load_seg_cache(env, seg_reg, selector,
- get_seg_base(e1, e2),
- get_seg_limit(e1, e2),
- e2);
- } else {
- if (seg_reg == R_SS || seg_reg == R_CS)
- raise_exception_err(EXCP0A_TSS, selector & 0xfffc);
- }
-}
-
-#define SWITCH_TSS_JMP 0
-#define SWITCH_TSS_IRET 1
-#define SWITCH_TSS_CALL 2
-
-/* XXX: restore CPU state in registers (PowerPC case) */
-static void switch_tss(int tss_selector,
- uint32_t e1, uint32_t e2, int source,
- uint32_t next_eip)
-{
- int tss_limit, tss_limit_max, type, old_tss_limit_max, old_type, v1, v2, i;
- target_ulong tss_base;
- uint32_t new_regs[8], new_segs[6];
- uint32_t new_eflags, new_eip, new_cr3, new_ldt, new_trap;
- uint32_t old_eflags, eflags_mask;
- SegmentCache *dt;
- int index;
- target_ulong ptr;
-
- type = (e2 >> DESC_TYPE_SHIFT) & 0xf;
- LOG_PCALL("switch_tss: sel=0x%04x type=%d src=%d\n", tss_selector, type, source);
-
- /* if task gate, we read the TSS segment and we load it */
- if (type == 5) {
- if (!(e2 & DESC_P_MASK))
- raise_exception_err(EXCP0B_NOSEG, tss_selector & 0xfffc);
- tss_selector = e1 >> 16;
- if (tss_selector & 4)
- raise_exception_err(EXCP0A_TSS, tss_selector & 0xfffc);
- if (load_segment(&e1, &e2, tss_selector) != 0)
- raise_exception_err(EXCP0D_GPF, tss_selector & 0xfffc);
- if (e2 & DESC_S_MASK)
- raise_exception_err(EXCP0D_GPF, tss_selector & 0xfffc);
- type = (e2 >> DESC_TYPE_SHIFT) & 0xf;
- if ((type & 7) != 1)
- raise_exception_err(EXCP0D_GPF, tss_selector & 0xfffc);
- }
-
- if (!(e2 & DESC_P_MASK))
- raise_exception_err(EXCP0B_NOSEG, tss_selector & 0xfffc);
-
- if (type & 8)
- tss_limit_max = 103;
- else
- tss_limit_max = 43;
- tss_limit = get_seg_limit(e1, e2);
- tss_base = get_seg_base(e1, e2);
- if ((tss_selector & 4) != 0 ||
- tss_limit < tss_limit_max)
- raise_exception_err(EXCP0A_TSS, tss_selector & 0xfffc);
- old_type = (env->tr.flags >> DESC_TYPE_SHIFT) & 0xf;
- if (old_type & 8)
- old_tss_limit_max = 103;
- else
- old_tss_limit_max = 43;
-
- /* read all the registers from the new TSS */
- if (type & 8) {
- /* 32 bit */
- new_cr3 = ldl_kernel(tss_base + 0x1c);
- new_eip = ldl_kernel(tss_base + 0x20);
- new_eflags = ldl_kernel(tss_base + 0x24);
- for(i = 0; i < 8; i++)
- new_regs[i] = ldl_kernel(tss_base + (0x28 + i * 4));
- for(i = 0; i < 6; i++)
- new_segs[i] = lduw_kernel(tss_base + (0x48 + i * 4));
- new_ldt = lduw_kernel(tss_base + 0x60);
- new_trap = ldl_kernel(tss_base + 0x64);
- } else {
- /* 16 bit */
- new_cr3 = 0;
- new_eip = lduw_kernel(tss_base + 0x0e);
- new_eflags = lduw_kernel(tss_base + 0x10);
- for(i = 0; i < 8; i++)
- new_regs[i] = lduw_kernel(tss_base + (0x12 + i * 2)) | 0xffff0000;
- for(i = 0; i < 4; i++)
- new_segs[i] = lduw_kernel(tss_base + (0x22 + i * 4));
- new_ldt = lduw_kernel(tss_base + 0x2a);
- new_segs[R_FS] = 0;
- new_segs[R_GS] = 0;
- new_trap = 0;
- }
- /* XXX: avoid a compiler warning, see
- http://support.amd.com/us/Processor_TechDocs/24593.pdf
- chapters 12.2.5 and 13.2.4 on how to implement TSS Trap bit */
- (void)new_trap;
-
- /* NOTE: we must avoid memory exceptions during the task switch,
- so we make dummy accesses before */
- /* XXX: it can still fail in some cases, so a bigger hack is
- necessary to valid the TLB after having done the accesses */
-
- v1 = ldub_kernel(env->tr.base);
- v2 = ldub_kernel(env->tr.base + old_tss_limit_max);
- stb_kernel(env->tr.base, v1);
- stb_kernel(env->tr.base + old_tss_limit_max, v2);
-
- /* clear busy bit (it is restartable) */
- if (source == SWITCH_TSS_JMP || source == SWITCH_TSS_IRET) {
- target_ulong ptr;
- uint32_t e2;
- ptr = env->gdt.base + (env->tr.selector & ~7);
- e2 = ldl_kernel(ptr + 4);
- e2 &= ~DESC_TSS_BUSY_MASK;
- stl_kernel(ptr + 4, e2);
- }
- old_eflags = compute_eflags();
- if (source == SWITCH_TSS_IRET)
- old_eflags &= ~NT_MASK;
-
- /* save the current state in the old TSS */
- if (type & 8) {
- /* 32 bit */
- stl_kernel(env->tr.base + 0x20, next_eip);
- stl_kernel(env->tr.base + 0x24, old_eflags);
- stl_kernel(env->tr.base + (0x28 + 0 * 4), EAX);
- stl_kernel(env->tr.base + (0x28 + 1 * 4), ECX);
- stl_kernel(env->tr.base + (0x28 + 2 * 4), EDX);
- stl_kernel(env->tr.base + (0x28 + 3 * 4), EBX);
- stl_kernel(env->tr.base + (0x28 + 4 * 4), ESP);
- stl_kernel(env->tr.base + (0x28 + 5 * 4), EBP);
- stl_kernel(env->tr.base + (0x28 + 6 * 4), ESI);
- stl_kernel(env->tr.base + (0x28 + 7 * 4), EDI);
- for(i = 0; i < 6; i++)
- stw_kernel(env->tr.base + (0x48 + i * 4), env->segs[i].selector);
- } else {
- /* 16 bit */
- stw_kernel(env->tr.base + 0x0e, next_eip);
- stw_kernel(env->tr.base + 0x10, old_eflags);
- stw_kernel(env->tr.base + (0x12 + 0 * 2), EAX);
- stw_kernel(env->tr.base + (0x12 + 1 * 2), ECX);
- stw_kernel(env->tr.base + (0x12 + 2 * 2), EDX);
- stw_kernel(env->tr.base + (0x12 + 3 * 2), EBX);
- stw_kernel(env->tr.base + (0x12 + 4 * 2), ESP);
- stw_kernel(env->tr.base + (0x12 + 5 * 2), EBP);
- stw_kernel(env->tr.base + (0x12 + 6 * 2), ESI);
- stw_kernel(env->tr.base + (0x12 + 7 * 2), EDI);
- for(i = 0; i < 4; i++)
- stw_kernel(env->tr.base + (0x22 + i * 4), env->segs[i].selector);
- }
-
- /* now if an exception occurs, it will occurs in the next task
- context */
-
- if (source == SWITCH_TSS_CALL) {
- stw_kernel(tss_base, env->tr.selector);
- new_eflags |= NT_MASK;
- }
-
- /* set busy bit */
- if (source == SWITCH_TSS_JMP || source == SWITCH_TSS_CALL) {
- target_ulong ptr;
- uint32_t e2;
- ptr = env->gdt.base + (tss_selector & ~7);
- e2 = ldl_kernel(ptr + 4);
- e2 |= DESC_TSS_BUSY_MASK;
- stl_kernel(ptr + 4, e2);
- }
-
- /* set the new CPU state */
- /* from this point, any exception which occurs can give problems */
- env->cr[0] |= CR0_TS_MASK;
- env->hflags |= HF_TS_MASK;
- env->tr.selector = tss_selector;
- env->tr.base = tss_base;
- env->tr.limit = tss_limit;
- env->tr.flags = e2 & ~DESC_TSS_BUSY_MASK;
-
- if ((type & 8) && (env->cr[0] & CR0_PG_MASK)) {
- cpu_x86_update_cr3(env, new_cr3);
- }
-
- /* load all registers without an exception, then reload them with
- possible exception */
- env->eip = new_eip;
- eflags_mask = TF_MASK | AC_MASK | ID_MASK |
- IF_MASK | IOPL_MASK | VM_MASK | RF_MASK | NT_MASK;
- if (!(type & 8))
- eflags_mask &= 0xffff;
- load_eflags(new_eflags, eflags_mask);
- /* XXX: what to do in 16 bit case ? */
- EAX = new_regs[0];
- ECX = new_regs[1];
- EDX = new_regs[2];
- EBX = new_regs[3];
- ESP = new_regs[4];
- EBP = new_regs[5];
- ESI = new_regs[6];
- EDI = new_regs[7];
- if (new_eflags & VM_MASK) {
- for(i = 0; i < 6; i++)
- load_seg_vm(i, new_segs[i]);
- /* in vm86, CPL is always 3 */
- cpu_x86_set_cpl(env, 3);
- } else {
- /* CPL is set the RPL of CS */
- cpu_x86_set_cpl(env, new_segs[R_CS] & 3);
- /* first just selectors as the rest may trigger exceptions */
- for(i = 0; i < 6; i++)
- cpu_x86_load_seg_cache(env, i, new_segs[i], 0, 0, 0);
- }
-
- env->ldt.selector = new_ldt & ~4;
- env->ldt.base = 0;
- env->ldt.limit = 0;
- env->ldt.flags = 0;
-
- /* load the LDT */
- if (new_ldt & 4)
- raise_exception_err(EXCP0A_TSS, new_ldt & 0xfffc);
-
- if ((new_ldt & 0xfffc) != 0) {
- dt = &env->gdt;
- index = new_ldt & ~7;
- if ((index + 7) > dt->limit)
- raise_exception_err(EXCP0A_TSS, new_ldt & 0xfffc);
- ptr = dt->base + index;
- e1 = ldl_kernel(ptr);
- e2 = ldl_kernel(ptr + 4);
- if ((e2 & DESC_S_MASK) || ((e2 >> DESC_TYPE_SHIFT) & 0xf) != 2)
- raise_exception_err(EXCP0A_TSS, new_ldt & 0xfffc);
- if (!(e2 & DESC_P_MASK))
- raise_exception_err(EXCP0A_TSS, new_ldt & 0xfffc);
- load_seg_cache_raw_dt(&env->ldt, e1, e2);
- }
-
- /* load the segments */
- if (!(new_eflags & VM_MASK)) {
- tss_load_seg(R_CS, new_segs[R_CS]);
- tss_load_seg(R_SS, new_segs[R_SS]);
- tss_load_seg(R_ES, new_segs[R_ES]);
- tss_load_seg(R_DS, new_segs[R_DS]);
- tss_load_seg(R_FS, new_segs[R_FS]);
- tss_load_seg(R_GS, new_segs[R_GS]);
- }
-
- /* check that EIP is in the CS segment limits */
- if (new_eip > env->segs[R_CS].limit) {
- /* XXX: different exception if CALL ? */
- raise_exception_err(EXCP0D_GPF, 0);
- }
-
-#ifndef CONFIG_USER_ONLY
- /* reset local breakpoints */
- if (env->dr[7] & 0x55) {
- for (i = 0; i < 4; i++) {
- if (hw_breakpoint_enabled(env->dr[7], i) == 0x1)
- hw_breakpoint_remove(env, i);
- }
- env->dr[7] &= ~0x55;
- }
-#endif
-}
-
-/* check if Port I/O is allowed in TSS */
-static inline void check_io(int addr, int size)
-{
- int io_offset, val, mask;
-
- /* TSS must be a valid 32 bit one */
- if (!(env->tr.flags & DESC_P_MASK) ||
- ((env->tr.flags >> DESC_TYPE_SHIFT) & 0xf) != 9 ||
- env->tr.limit < 103)
- goto fail;
- io_offset = lduw_kernel(env->tr.base + 0x66);
- io_offset += (addr >> 3);
- /* Note: the check needs two bytes */
- if ((io_offset + 1) > env->tr.limit)
- goto fail;
- val = lduw_kernel(env->tr.base + io_offset);
- val >>= (addr & 7);
- mask = (1 << size) - 1;
- /* all bits must be zero to allow the I/O */
- if ((val & mask) != 0) {
- fail:
- raise_exception_err(EXCP0D_GPF, 0);
- }
-}
-
-void helper_check_iob(uint32_t t0)
-{
- check_io(t0, 1);
-}
-
-void helper_check_iow(uint32_t t0)
-{
- check_io(t0, 2);
-}
-
-void helper_check_iol(uint32_t t0)
-{
- check_io(t0, 4);
-}
-
-void helper_outb(uint32_t port, uint32_t data)
-{
- cpu_outb(port, data & 0xff);
-}
-
-target_ulong helper_inb(uint32_t port)
-{
- return cpu_inb(port);
-}
-
-void helper_outw(uint32_t port, uint32_t data)
-{
- cpu_outw(port, data & 0xffff);
-}
-
-target_ulong helper_inw(uint32_t port)
-{
- return cpu_inw(port);
-}
-
-void helper_outl(uint32_t port, uint32_t data)
-{
- cpu_outl(port, data);
-}
-
-target_ulong helper_inl(uint32_t port)
-{
- return cpu_inl(port);
-}
-
-static inline unsigned int get_sp_mask(unsigned int e2)
-{
- if (e2 & DESC_B_MASK)
- return 0xffffffff;
- else
- return 0xffff;
-}
-
-static int exeption_has_error_code(int intno)
-{
- switch(intno) {
- case 8:
- case 10:
- case 11:
- case 12:
- case 13:
- case 14:
- case 17:
- return 1;
- }
- return 0;
-}
-
-#ifdef TARGET_X86_64
-#define SET_ESP(val, sp_mask)\
-do {\
- if ((sp_mask) == 0xffff)\
- ESP = (ESP & ~0xffff) | ((val) & 0xffff);\
- else if ((sp_mask) == 0xffffffffLL)\
- ESP = (uint32_t)(val);\
- else\
- ESP = (val);\
-} while (0)
-#else
-#define SET_ESP(val, sp_mask) ESP = (ESP & ~(sp_mask)) | ((val) & (sp_mask))
-#endif
-
-/* in 64-bit machines, this can overflow. So this segment addition macro
- * can be used to trim the value to 32-bit whenever needed */
-#define SEG_ADDL(ssp, sp, sp_mask) ((uint32_t)((ssp) + (sp & (sp_mask))))
-
-/* XXX: add a is_user flag to have proper security support */
-#define PUSHW(ssp, sp, sp_mask, val)\
-{\
- sp -= 2;\
- stw_kernel((ssp) + (sp & (sp_mask)), (val));\
-}
-
-#define PUSHL(ssp, sp, sp_mask, val)\
-{\
- sp -= 4;\
- stl_kernel(SEG_ADDL(ssp, sp, sp_mask), (uint32_t)(val));\
-}
-
-#define POPW(ssp, sp, sp_mask, val)\
-{\
- val = lduw_kernel((ssp) + (sp & (sp_mask)));\
- sp += 2;\
-}
-
-#define POPL(ssp, sp, sp_mask, val)\
-{\
- val = (uint32_t)ldl_kernel(SEG_ADDL(ssp, sp, sp_mask));\
- sp += 4;\
-}
-
-/* protected mode interrupt */
-static void do_interrupt_protected(int intno, int is_int, int error_code,
- unsigned int next_eip, int is_hw)
-{
- SegmentCache *dt;
- target_ulong ptr, ssp;
- int type, dpl, selector, ss_dpl, cpl;
- int has_error_code, new_stack, shift;
- uint32_t e1, e2, offset, ss = 0, esp, ss_e1 = 0, ss_e2 = 0;
- uint32_t old_eip, sp_mask;
-
- has_error_code = 0;
- if (!is_int && !is_hw)
- has_error_code = exeption_has_error_code(intno);
- if (is_int)
- old_eip = next_eip;
- else
- old_eip = env->eip;
-
- dt = &env->idt;
- if (intno * 8 + 7 > dt->limit)
- raise_exception_err(EXCP0D_GPF, intno * 8 + 2);
- ptr = dt->base + intno * 8;
- e1 = ldl_kernel(ptr);
- e2 = ldl_kernel(ptr + 4);
- /* check gate type */
- type = (e2 >> DESC_TYPE_SHIFT) & 0x1f;
- switch(type) {
- case 5: /* task gate */
- /* must do that check here to return the correct error code */
- if (!(e2 & DESC_P_MASK))
- raise_exception_err(EXCP0B_NOSEG, intno * 8 + 2);
- switch_tss(intno * 8, e1, e2, SWITCH_TSS_CALL, old_eip);
- if (has_error_code) {
- int type;
- uint32_t mask;
- /* push the error code */
- type = (env->tr.flags >> DESC_TYPE_SHIFT) & 0xf;
- shift = type >> 3;
- if (env->segs[R_SS].flags & DESC_B_MASK)
- mask = 0xffffffff;
- else
- mask = 0xffff;
- esp = (ESP - (2 << shift)) & mask;
- ssp = env->segs[R_SS].base + esp;
- if (shift)
- stl_kernel(ssp, error_code);
- else
- stw_kernel(ssp, error_code);
- SET_ESP(esp, mask);
- }
- return;
- case 6: /* 286 interrupt gate */
- case 7: /* 286 trap gate */
- case 14: /* 386 interrupt gate */
- case 15: /* 386 trap gate */
- break;
- default:
- raise_exception_err(EXCP0D_GPF, intno * 8 + 2);
- break;
- }
- dpl = (e2 >> DESC_DPL_SHIFT) & 3;
- cpl = env->hflags & HF_CPL_MASK;
- /* check privilege if software int */
- if (is_int && dpl < cpl)
- raise_exception_err(EXCP0D_GPF, intno * 8 + 2);
- /* check valid bit */
- if (!(e2 & DESC_P_MASK))
- raise_exception_err(EXCP0B_NOSEG, intno * 8 + 2);
- selector = e1 >> 16;
- offset = (e2 & 0xffff0000) | (e1 & 0x0000ffff);
- if ((selector & 0xfffc) == 0)
- raise_exception_err(EXCP0D_GPF, 0);
-
- if (load_segment(&e1, &e2, selector) != 0)
- raise_exception_err(EXCP0D_GPF, selector & 0xfffc);
- if (!(e2 & DESC_S_MASK) || !(e2 & (DESC_CS_MASK)))
- raise_exception_err(EXCP0D_GPF, selector & 0xfffc);
- dpl = (e2 >> DESC_DPL_SHIFT) & 3;
- if (dpl > cpl)
- raise_exception_err(EXCP0D_GPF, selector & 0xfffc);
- if (!(e2 & DESC_P_MASK))
- raise_exception_err(EXCP0B_NOSEG, selector & 0xfffc);
- if (!(e2 & DESC_C_MASK) && dpl < cpl) {
- /* to inner privilege */
- get_ss_esp_from_tss(&ss, &esp, dpl);
- if ((ss & 0xfffc) == 0)
- raise_exception_err(EXCP0A_TSS, ss & 0xfffc);
- if ((ss & 3) != dpl)
- raise_exception_err(EXCP0A_TSS, ss & 0xfffc);
- if (load_segment(&ss_e1, &ss_e2, ss) != 0)
- raise_exception_err(EXCP0A_TSS, ss & 0xfffc);
- ss_dpl = (ss_e2 >> DESC_DPL_SHIFT) & 3;
- if (ss_dpl != dpl)
- raise_exception_err(EXCP0A_TSS, ss & 0xfffc);
- if (!(ss_e2 & DESC_S_MASK) ||
- (ss_e2 & DESC_CS_MASK) ||
- !(ss_e2 & DESC_W_MASK))
- raise_exception_err(EXCP0A_TSS, ss & 0xfffc);
- if (!(ss_e2 & DESC_P_MASK))
- raise_exception_err(EXCP0A_TSS, ss & 0xfffc);
- new_stack = 1;
- sp_mask = get_sp_mask(ss_e2);
- ssp = get_seg_base(ss_e1, ss_e2);
- } else if ((e2 & DESC_C_MASK) || dpl == cpl) {
- /* to same privilege */
- if (env->eflags & VM_MASK)
- raise_exception_err(EXCP0D_GPF, selector & 0xfffc);
- new_stack = 0;
- sp_mask = get_sp_mask(env->segs[R_SS].flags);
- ssp = env->segs[R_SS].base;
- esp = ESP;
- dpl = cpl;
- } else {
- raise_exception_err(EXCP0D_GPF, selector & 0xfffc);
- new_stack = 0; /* avoid warning */
- sp_mask = 0; /* avoid warning */
- ssp = 0; /* avoid warning */
- esp = 0; /* avoid warning */
- }
-
- shift = type >> 3;
-
-#if 0
- /* XXX: check that enough room is available */
- push_size = 6 + (new_stack << 2) + (has_error_code << 1);
- if (env->eflags & VM_MASK)
- push_size += 8;
- push_size <<= shift;
-#endif
- if (shift == 1) {
- if (new_stack) {
- if (env->eflags & VM_MASK) {
- PUSHL(ssp, esp, sp_mask, env->segs[R_GS].selector);
- PUSHL(ssp, esp, sp_mask, env->segs[R_FS].selector);
- PUSHL(ssp, esp, sp_mask, env->segs[R_DS].selector);
- PUSHL(ssp, esp, sp_mask, env->segs[R_ES].selector);
- }
- PUSHL(ssp, esp, sp_mask, env->segs[R_SS].selector);
- PUSHL(ssp, esp, sp_mask, ESP);
- }
- PUSHL(ssp, esp, sp_mask, compute_eflags());
- PUSHL(ssp, esp, sp_mask, env->segs[R_CS].selector);
- PUSHL(ssp, esp, sp_mask, old_eip);
- if (has_error_code) {
- PUSHL(ssp, esp, sp_mask, error_code);
- }
- } else {
- if (new_stack) {
- if (env->eflags & VM_MASK) {
- PUSHW(ssp, esp, sp_mask, env->segs[R_GS].selector);
- PUSHW(ssp, esp, sp_mask, env->segs[R_FS].selector);
- PUSHW(ssp, esp, sp_mask, env->segs[R_DS].selector);
- PUSHW(ssp, esp, sp_mask, env->segs[R_ES].selector);
- }
- PUSHW(ssp, esp, sp_mask, env->segs[R_SS].selector);
- PUSHW(ssp, esp, sp_mask, ESP);
- }
- PUSHW(ssp, esp, sp_mask, compute_eflags());
- PUSHW(ssp, esp, sp_mask, env->segs[R_CS].selector);
- PUSHW(ssp, esp, sp_mask, old_eip);
- if (has_error_code) {
- PUSHW(ssp, esp, sp_mask, error_code);
- }
- }
-
- if (new_stack) {
- if (env->eflags & VM_MASK) {
- cpu_x86_load_seg_cache(env, R_ES, 0, 0, 0, 0);
- cpu_x86_load_seg_cache(env, R_DS, 0, 0, 0, 0);
- cpu_x86_load_seg_cache(env, R_FS, 0, 0, 0, 0);
- cpu_x86_load_seg_cache(env, R_GS, 0, 0, 0, 0);
- }
- ss = (ss & ~3) | dpl;
- cpu_x86_load_seg_cache(env, R_SS, ss,
- ssp, get_seg_limit(ss_e1, ss_e2), ss_e2);
- }
- SET_ESP(esp, sp_mask);
-
- selector = (selector & ~3) | dpl;
- cpu_x86_load_seg_cache(env, R_CS, selector,
- get_seg_base(e1, e2),
- get_seg_limit(e1, e2),
- e2);
- cpu_x86_set_cpl(env, dpl);
- env->eip = offset;
-
- /* interrupt gate clear IF mask */
- if ((type & 1) == 0) {
- env->eflags &= ~IF_MASK;
- }
- env->eflags &= ~(TF_MASK | VM_MASK | RF_MASK | NT_MASK);
-}
-
-#ifdef TARGET_X86_64
-
-#define PUSHQ(sp, val)\
-{\
- sp -= 8;\
- stq_kernel(sp, (val));\
-}
-
-#define POPQ(sp, val)\
-{\
- val = ldq_kernel(sp);\
- sp += 8;\
-}
-
-static inline target_ulong get_rsp_from_tss(int level)
-{
- int index;
-
-#if 0
- printf("TR: base=" TARGET_FMT_lx " limit=%x\n",
- env->tr.base, env->tr.limit);
-#endif
-
- if (!(env->tr.flags & DESC_P_MASK))
- cpu_abort(env, "invalid tss");
- index = 8 * level + 4;
- if ((index + 7) > env->tr.limit)
- raise_exception_err(EXCP0A_TSS, env->tr.selector & 0xfffc);
- return ldq_kernel(env->tr.base + index);
-}
-
-/* 64 bit interrupt */
-static void do_interrupt64(int intno, int is_int, int error_code,
- target_ulong next_eip, int is_hw)
-{
- SegmentCache *dt;
- target_ulong ptr;
- int type, dpl, selector, cpl, ist;
- int has_error_code, new_stack;
- uint32_t e1, e2, e3, ss;
- target_ulong old_eip, esp, offset;
-
- has_error_code = 0;
- if (!is_int && !is_hw)
- has_error_code = exeption_has_error_code(intno);
- if (is_int)
- old_eip = next_eip;
- else
- old_eip = env->eip;
-
- dt = &env->idt;
- if (intno * 16 + 15 > dt->limit)
- raise_exception_err(EXCP0D_GPF, intno * 16 + 2);
- ptr = dt->base + intno * 16;
- e1 = ldl_kernel(ptr);
- e2 = ldl_kernel(ptr + 4);
- e3 = ldl_kernel(ptr + 8);
- /* check gate type */
- type = (e2 >> DESC_TYPE_SHIFT) & 0x1f;
- switch(type) {
- case 14: /* 386 interrupt gate */
- case 15: /* 386 trap gate */
- break;
- default:
- raise_exception_err(EXCP0D_GPF, intno * 16 + 2);
- break;
- }
- dpl = (e2 >> DESC_DPL_SHIFT) & 3;
- cpl = env->hflags & HF_CPL_MASK;
- /* check privilege if software int */
- if (is_int && dpl < cpl)
- raise_exception_err(EXCP0D_GPF, intno * 16 + 2);
- /* check valid bit */
- if (!(e2 & DESC_P_MASK))
- raise_exception_err(EXCP0B_NOSEG, intno * 16 + 2);
- selector = e1 >> 16;
- offset = ((target_ulong)e3 << 32) | (e2 & 0xffff0000) | (e1 & 0x0000ffff);
- ist = e2 & 7;
- if ((selector & 0xfffc) == 0)
- raise_exception_err(EXCP0D_GPF, 0);
-
- if (load_segment(&e1, &e2, selector) != 0)
- raise_exception_err(EXCP0D_GPF, selector & 0xfffc);
- if (!(e2 & DESC_S_MASK) || !(e2 & (DESC_CS_MASK)))
- raise_exception_err(EXCP0D_GPF, selector & 0xfffc);
- dpl = (e2 >> DESC_DPL_SHIFT) & 3;
- if (dpl > cpl)
- raise_exception_err(EXCP0D_GPF, selector & 0xfffc);
- if (!(e2 & DESC_P_MASK))
- raise_exception_err(EXCP0B_NOSEG, selector & 0xfffc);
- if (!(e2 & DESC_L_MASK) || (e2 & DESC_B_MASK))
- raise_exception_err(EXCP0D_GPF, selector & 0xfffc);
- if ((!(e2 & DESC_C_MASK) && dpl < cpl) || ist != 0) {
- /* to inner privilege */
- if (ist != 0)
- esp = get_rsp_from_tss(ist + 3);
- else
- esp = get_rsp_from_tss(dpl);
- esp &= ~0xfLL; /* align stack */
- ss = 0;
- new_stack = 1;
- } else if ((e2 & DESC_C_MASK) || dpl == cpl) {
- /* to same privilege */
- if (env->eflags & VM_MASK)
- raise_exception_err(EXCP0D_GPF, selector & 0xfffc);
- new_stack = 0;
- if (ist != 0)
- esp = get_rsp_from_tss(ist + 3);
- else
- esp = ESP;
- esp &= ~0xfLL; /* align stack */
- dpl = cpl;
- } else {
- raise_exception_err(EXCP0D_GPF, selector & 0xfffc);
- new_stack = 0; /* avoid warning */
- esp = 0; /* avoid warning */
- }
-
- PUSHQ(esp, env->segs[R_SS].selector);
- PUSHQ(esp, ESP);
- PUSHQ(esp, compute_eflags());
- PUSHQ(esp, env->segs[R_CS].selector);
- PUSHQ(esp, old_eip);
- if (has_error_code) {
- PUSHQ(esp, error_code);
- }
-
- if (new_stack) {
- ss = 0 | dpl;
- cpu_x86_load_seg_cache(env, R_SS, ss, 0, 0, 0);
- }
- ESP = esp;
-
- selector = (selector & ~3) | dpl;
- cpu_x86_load_seg_cache(env, R_CS, selector,
- get_seg_base(e1, e2),
- get_seg_limit(e1, e2),
- e2);
- cpu_x86_set_cpl(env, dpl);
- env->eip = offset;
-
- /* interrupt gate clear IF mask */
- if ((type & 1) == 0) {
- env->eflags &= ~IF_MASK;
- }
- env->eflags &= ~(TF_MASK | VM_MASK | RF_MASK | NT_MASK);
-}
-#endif
-
-#ifdef TARGET_X86_64
-#if defined(CONFIG_USER_ONLY)
-void helper_syscall(int next_eip_addend)
-{
- env->exception_index = EXCP_SYSCALL;
- env->exception_next_eip = env->eip + next_eip_addend;
- cpu_loop_exit(env);
-}
-#else
-void helper_syscall(int next_eip_addend)
-{
- int selector;
-
- if (!(env->efer & MSR_EFER_SCE)) {
- raise_exception_err(EXCP06_ILLOP, 0);
- }
- selector = (env->star >> 32) & 0xffff;
- if (env->hflags & HF_LMA_MASK) {
- int code64;
-
- ECX = env->eip + next_eip_addend;
- env->regs[11] = compute_eflags();
-
- code64 = env->hflags & HF_CS64_MASK;
-
- cpu_x86_set_cpl(env, 0);
- cpu_x86_load_seg_cache(env, R_CS, selector & 0xfffc,
- 0, 0xffffffff,
- DESC_G_MASK | DESC_P_MASK |
- DESC_S_MASK |
- DESC_CS_MASK | DESC_R_MASK | DESC_A_MASK | DESC_L_MASK);
- cpu_x86_load_seg_cache(env, R_SS, (selector + 8) & 0xfffc,
- 0, 0xffffffff,
- DESC_G_MASK | DESC_B_MASK | DESC_P_MASK |
- DESC_S_MASK |
- DESC_W_MASK | DESC_A_MASK);
- env->eflags &= ~env->fmask;
- load_eflags(env->eflags, 0);
- if (code64)
- env->eip = env->lstar;
- else
- env->eip = env->cstar;
- } else {
- ECX = (uint32_t)(env->eip + next_eip_addend);
-
- cpu_x86_set_cpl(env, 0);
- cpu_x86_load_seg_cache(env, R_CS, selector & 0xfffc,
- 0, 0xffffffff,
- DESC_G_MASK | DESC_B_MASK | DESC_P_MASK |
- DESC_S_MASK |
- DESC_CS_MASK | DESC_R_MASK | DESC_A_MASK);
- cpu_x86_load_seg_cache(env, R_SS, (selector + 8) & 0xfffc,
- 0, 0xffffffff,
- DESC_G_MASK | DESC_B_MASK | DESC_P_MASK |
- DESC_S_MASK |
- DESC_W_MASK | DESC_A_MASK);
- env->eflags &= ~(IF_MASK | RF_MASK | VM_MASK);
- env->eip = (uint32_t)env->star;
- }
-}
-#endif
-#endif
-
-#ifdef TARGET_X86_64
-void helper_sysret(int dflag)
-{
- int cpl, selector;
-
- if (!(env->efer & MSR_EFER_SCE)) {
- raise_exception_err(EXCP06_ILLOP, 0);
- }
- cpl = env->hflags & HF_CPL_MASK;
- if (!(env->cr[0] & CR0_PE_MASK) || cpl != 0) {
- raise_exception_err(EXCP0D_GPF, 0);
- }
- selector = (env->star >> 48) & 0xffff;
- if (env->hflags & HF_LMA_MASK) {
- if (dflag == 2) {
- cpu_x86_load_seg_cache(env, R_CS, (selector + 16) | 3,
- 0, 0xffffffff,
- DESC_G_MASK | DESC_P_MASK |
- DESC_S_MASK | (3 << DESC_DPL_SHIFT) |
- DESC_CS_MASK | DESC_R_MASK | DESC_A_MASK |
- DESC_L_MASK);
- env->eip = ECX;
- } else {
- cpu_x86_load_seg_cache(env, R_CS, selector | 3,
- 0, 0xffffffff,
- DESC_G_MASK | DESC_B_MASK | DESC_P_MASK |
- DESC_S_MASK | (3 << DESC_DPL_SHIFT) |
- DESC_CS_MASK | DESC_R_MASK | DESC_A_MASK);
- env->eip = (uint32_t)ECX;
- }
- cpu_x86_load_seg_cache(env, R_SS, selector + 8,
- 0, 0xffffffff,
- DESC_G_MASK | DESC_B_MASK | DESC_P_MASK |
- DESC_S_MASK | (3 << DESC_DPL_SHIFT) |
- DESC_W_MASK | DESC_A_MASK);
- load_eflags((uint32_t)(env->regs[11]), TF_MASK | AC_MASK | ID_MASK |
- IF_MASK | IOPL_MASK | VM_MASK | RF_MASK | NT_MASK);
- cpu_x86_set_cpl(env, 3);
- } else {
- cpu_x86_load_seg_cache(env, R_CS, selector | 3,
- 0, 0xffffffff,
- DESC_G_MASK | DESC_B_MASK | DESC_P_MASK |
- DESC_S_MASK | (3 << DESC_DPL_SHIFT) |
- DESC_CS_MASK | DESC_R_MASK | DESC_A_MASK);
- env->eip = (uint32_t)ECX;
- cpu_x86_load_seg_cache(env, R_SS, selector + 8,
- 0, 0xffffffff,
- DESC_G_MASK | DESC_B_MASK | DESC_P_MASK |
- DESC_S_MASK | (3 << DESC_DPL_SHIFT) |
- DESC_W_MASK | DESC_A_MASK);
- env->eflags |= IF_MASK;
- cpu_x86_set_cpl(env, 3);
- }
-}
-#endif
-
-/* real mode interrupt */
-static void do_interrupt_real(int intno, int is_int, int error_code,
- unsigned int next_eip)
-{
- SegmentCache *dt;
- target_ulong ptr, ssp;
- int selector;
- uint32_t offset, esp;
- uint32_t old_cs, old_eip;
-
- /* real mode (simpler !) */
- dt = &env->idt;
- if (intno * 4 + 3 > dt->limit)
- raise_exception_err(EXCP0D_GPF, intno * 8 + 2);
- ptr = dt->base + intno * 4;
- offset = lduw_kernel(ptr);
- selector = lduw_kernel(ptr + 2);
- esp = ESP;
- ssp = env->segs[R_SS].base;
- if (is_int)
- old_eip = next_eip;
- else
- old_eip = env->eip;
- old_cs = env->segs[R_CS].selector;
- /* XXX: use SS segment size ? */
- PUSHW(ssp, esp, 0xffff, compute_eflags());
- PUSHW(ssp, esp, 0xffff, old_cs);
- PUSHW(ssp, esp, 0xffff, old_eip);
-
- /* update processor state */
- ESP = (ESP & ~0xffff) | (esp & 0xffff);
- env->eip = offset;
- env->segs[R_CS].selector = selector;
- env->segs[R_CS].base = (selector << 4);
- env->eflags &= ~(IF_MASK | TF_MASK | AC_MASK | RF_MASK);
-}
-
-#if defined(CONFIG_USER_ONLY)
-/* fake user mode interrupt */
-static void do_interrupt_user(int intno, int is_int, int error_code,
- target_ulong next_eip)
-{
- SegmentCache *dt;
- target_ulong ptr;
- int dpl, cpl, shift;
- uint32_t e2;
-
- dt = &env->idt;
- if (env->hflags & HF_LMA_MASK) {
- shift = 4;
- } else {
- shift = 3;
- }
- ptr = dt->base + (intno << shift);
- e2 = ldl_kernel(ptr + 4);
-
- dpl = (e2 >> DESC_DPL_SHIFT) & 3;
- cpl = env->hflags & HF_CPL_MASK;
- /* check privilege if software int */
- if (is_int && dpl < cpl)
- raise_exception_err(EXCP0D_GPF, (intno << shift) + 2);
-
- /* Since we emulate only user space, we cannot do more than
- exiting the emulation with the suitable exception and error
- code */
- if (is_int)
- EIP = next_eip;
-}
-
-#else
-
-static void handle_even_inj(int intno, int is_int, int error_code,
- int is_hw, int rm)
-{
- uint32_t event_inj = ldl_phys(env->vm_vmcb + offsetof(struct vmcb, control.event_inj));
- if (!(event_inj & SVM_EVTINJ_VALID)) {
- int type;
- if (is_int)
- type = SVM_EVTINJ_TYPE_SOFT;
- else
- type = SVM_EVTINJ_TYPE_EXEPT;
- event_inj = intno | type | SVM_EVTINJ_VALID;
- if (!rm && exeption_has_error_code(intno)) {
- event_inj |= SVM_EVTINJ_VALID_ERR;
- stl_phys(env->vm_vmcb + offsetof(struct vmcb, control.event_inj_err), error_code);
- }
- stl_phys(env->vm_vmcb + offsetof(struct vmcb, control.event_inj), event_inj);
- }
-}
-#endif
-
-/*
- * Begin execution of an interruption. is_int is TRUE if coming from
- * the int instruction. next_eip is the EIP value AFTER the interrupt
- * instruction. It is only relevant if is_int is TRUE.
- */
-static void do_interrupt_all(int intno, int is_int, int error_code,
- target_ulong next_eip, int is_hw)
-{
- if (qemu_loglevel_mask(CPU_LOG_INT)) {
- if ((env->cr[0] & CR0_PE_MASK)) {
- static int count;
- qemu_log("%6d: v=%02x e=%04x i=%d cpl=%d IP=%04x:" TARGET_FMT_lx " pc=" TARGET_FMT_lx " SP=%04x:" TARGET_FMT_lx,
- count, intno, error_code, is_int,
- env->hflags & HF_CPL_MASK,
- env->segs[R_CS].selector, EIP,
- (int)env->segs[R_CS].base + EIP,
- env->segs[R_SS].selector, ESP);
- if (intno == 0x0e) {
- qemu_log(" CR2=" TARGET_FMT_lx, env->cr[2]);
- } else {
- qemu_log(" EAX=" TARGET_FMT_lx, EAX);
- }
- qemu_log("\n");
- log_cpu_state(env, X86_DUMP_CCOP);
-#if 0
- {
- int i;
- target_ulong ptr;
- qemu_log(" code=");
- ptr = env->segs[R_CS].base + env->eip;
- for(i = 0; i < 16; i++) {
- qemu_log(" %02x", ldub(ptr + i));
- }
- qemu_log("\n");
- }
-#endif
- count++;
- }
- }
- if (env->cr[0] & CR0_PE_MASK) {
-#if !defined(CONFIG_USER_ONLY)
- if (env->hflags & HF_SVMI_MASK)
- handle_even_inj(intno, is_int, error_code, is_hw, 0);
-#endif
-#ifdef TARGET_X86_64
- if (env->hflags & HF_LMA_MASK) {
- do_interrupt64(intno, is_int, error_code, next_eip, is_hw);
- } else
-#endif
- {
- do_interrupt_protected(intno, is_int, error_code, next_eip, is_hw);
- }
- } else {
-#if !defined(CONFIG_USER_ONLY)
- if (env->hflags & HF_SVMI_MASK)
- handle_even_inj(intno, is_int, error_code, is_hw, 1);
-#endif
- do_interrupt_real(intno, is_int, error_code, next_eip);
- }
-
-#if !defined(CONFIG_USER_ONLY)
- if (env->hflags & HF_SVMI_MASK) {
- uint32_t event_inj = ldl_phys(env->vm_vmcb + offsetof(struct vmcb, control.event_inj));
- stl_phys(env->vm_vmcb + offsetof(struct vmcb, control.event_inj), event_inj & ~SVM_EVTINJ_VALID);
- }
-#endif
-}
-
-void do_interrupt(CPUX86State *env1)
-{
- CPUX86State *saved_env;
-
- saved_env = env;
- env = env1;
-#if defined(CONFIG_USER_ONLY)
- /* if user mode only, we simulate a fake exception
- which will be handled outside the cpu execution
- loop */
- do_interrupt_user(env->exception_index,
- env->exception_is_int,
- env->error_code,
- env->exception_next_eip);
- /* successfully delivered */
- env->old_exception = -1;
-#else
- /* simulate a real cpu exception. On i386, it can
- trigger new exceptions, but we do not handle
- double or triple faults yet. */
- do_interrupt_all(env->exception_index,
- env->exception_is_int,
- env->error_code,
- env->exception_next_eip, 0);
- /* successfully delivered */
- env->old_exception = -1;
-#endif
- env = saved_env;
-}
-
-void do_interrupt_x86_hardirq(CPUX86State *env1, int intno, int is_hw)
-{
- CPUX86State *saved_env;
-
- saved_env = env;
- env = env1;
- do_interrupt_all(intno, 0, 0, 0, is_hw);
- env = saved_env;
-}
-
-/* This should come from sysemu.h - if we could include it here... */
-void qemu_system_reset_request(void);
-
-/*
- * Check nested exceptions and change to double or triple fault if
- * needed. It should only be called, if this is not an interrupt.
- * Returns the new exception number.
- */
-static int check_exception(int intno, int *error_code)
-{
- int first_contributory = env->old_exception == 0 ||
- (env->old_exception >= 10 &&
- env->old_exception <= 13);
- int second_contributory = intno == 0 ||
- (intno >= 10 && intno <= 13);
-
- qemu_log_mask(CPU_LOG_INT, "check_exception old: 0x%x new 0x%x\n",
- env->old_exception, intno);
-
-#if !defined(CONFIG_USER_ONLY)
- if (env->old_exception == EXCP08_DBLE) {
- if (env->hflags & HF_SVMI_MASK)
- helper_vmexit(SVM_EXIT_SHUTDOWN, 0); /* does not return */
-
- qemu_log_mask(CPU_LOG_RESET, "Triple fault\n");
-
- qemu_system_reset_request();
- return EXCP_HLT;
- }
-#endif
-
- if ((first_contributory && second_contributory)
- || (env->old_exception == EXCP0E_PAGE &&
- (second_contributory || (intno == EXCP0E_PAGE)))) {
- intno = EXCP08_DBLE;
- *error_code = 0;
- }
-
- if (second_contributory || (intno == EXCP0E_PAGE) ||
- (intno == EXCP08_DBLE))
- env->old_exception = intno;
-
- return intno;
-}
-
-/*
- * Signal an interruption. It is executed in the main CPU loop.
- * is_int is TRUE if coming from the int instruction. next_eip is the
- * EIP value AFTER the interrupt instruction. It is only relevant if
- * is_int is TRUE.
- */
-static void QEMU_NORETURN raise_interrupt(int intno, int is_int, int error_code,
- int next_eip_addend)
-{
- if (!is_int) {
- helper_svm_check_intercept_param(SVM_EXIT_EXCP_BASE + intno, error_code);
- intno = check_exception(intno, &error_code);
- } else {
- helper_svm_check_intercept_param(SVM_EXIT_SWINT, 0);
- }
-
- env->exception_index = intno;
- env->error_code = error_code;
- env->exception_is_int = is_int;
- env->exception_next_eip = env->eip + next_eip_addend;
- cpu_loop_exit(env);
-}
-
-/* shortcuts to generate exceptions */
-
-static void QEMU_NORETURN raise_exception_err(int exception_index,
- int error_code)
-{
- raise_interrupt(exception_index, 0, error_code, 0);
-}
-
-void raise_exception_err_env(CPUX86State *nenv, int exception_index,
- int error_code)
-{
- env = nenv;
- raise_interrupt(exception_index, 0, error_code, 0);
-}
-
-static void QEMU_NORETURN raise_exception(int exception_index)
-{
- raise_interrupt(exception_index, 0, 0, 0);
-}
-
-void raise_exception_env(int exception_index, CPUX86State *nenv)
-{
- env = nenv;
- raise_exception(exception_index);
-}
-/* SMM support */
-
-#if defined(CONFIG_USER_ONLY)
-
-void do_smm_enter(CPUX86State *env1)
-{
-}
-
-void helper_rsm(void)
-{
-}
-
-#else
-
-#ifdef TARGET_X86_64
-#define SMM_REVISION_ID 0x00020064
-#else
-#define SMM_REVISION_ID 0x00020000
-#endif
-
-void do_smm_enter(CPUX86State *env1)
-{
- target_ulong sm_state;
- SegmentCache *dt;
- int i, offset;
- CPUX86State *saved_env;
-
- saved_env = env;
- env = env1;
-
- qemu_log_mask(CPU_LOG_INT, "SMM: enter\n");
- log_cpu_state_mask(CPU_LOG_INT, env, X86_DUMP_CCOP);
-
- env->hflags |= HF_SMM_MASK;
- cpu_smm_update(env);
-
- sm_state = env->smbase + 0x8000;
-
-#ifdef TARGET_X86_64
- for(i = 0; i < 6; i++) {
- dt = &env->segs[i];
- offset = 0x7e00 + i * 16;
- stw_phys(sm_state + offset, dt->selector);
- stw_phys(sm_state + offset + 2, (dt->flags >> 8) & 0xf0ff);
- stl_phys(sm_state + offset + 4, dt->limit);
- stq_phys(sm_state + offset + 8, dt->base);
- }
-
- stq_phys(sm_state + 0x7e68, env->gdt.base);
- stl_phys(sm_state + 0x7e64, env->gdt.limit);
-
- stw_phys(sm_state + 0x7e70, env->ldt.selector);
- stq_phys(sm_state + 0x7e78, env->ldt.base);
- stl_phys(sm_state + 0x7e74, env->ldt.limit);
- stw_phys(sm_state + 0x7e72, (env->ldt.flags >> 8) & 0xf0ff);
-
- stq_phys(sm_state + 0x7e88, env->idt.base);
- stl_phys(sm_state + 0x7e84, env->idt.limit);
-
- stw_phys(sm_state + 0x7e90, env->tr.selector);
- stq_phys(sm_state + 0x7e98, env->tr.base);
- stl_phys(sm_state + 0x7e94, env->tr.limit);
- stw_phys(sm_state + 0x7e92, (env->tr.flags >> 8) & 0xf0ff);
-
- stq_phys(sm_state + 0x7ed0, env->efer);
-
- stq_phys(sm_state + 0x7ff8, EAX);
- stq_phys(sm_state + 0x7ff0, ECX);
- stq_phys(sm_state + 0x7fe8, EDX);
- stq_phys(sm_state + 0x7fe0, EBX);
- stq_phys(sm_state + 0x7fd8, ESP);
- stq_phys(sm_state + 0x7fd0, EBP);
- stq_phys(sm_state + 0x7fc8, ESI);
- stq_phys(sm_state + 0x7fc0, EDI);
- for(i = 8; i < 16; i++)
- stq_phys(sm_state + 0x7ff8 - i * 8, env->regs[i]);
- stq_phys(sm_state + 0x7f78, env->eip);
- stl_phys(sm_state + 0x7f70, compute_eflags());
- stl_phys(sm_state + 0x7f68, env->dr[6]);
- stl_phys(sm_state + 0x7f60, env->dr[7]);
-
- stl_phys(sm_state + 0x7f48, env->cr[4]);
- stl_phys(sm_state + 0x7f50, env->cr[3]);
- stl_phys(sm_state + 0x7f58, env->cr[0]);
-
- stl_phys(sm_state + 0x7efc, SMM_REVISION_ID);
- stl_phys(sm_state + 0x7f00, env->smbase);
-#else
- stl_phys(sm_state + 0x7ffc, env->cr[0]);
- stl_phys(sm_state + 0x7ff8, env->cr[3]);
- stl_phys(sm_state + 0x7ff4, compute_eflags());
- stl_phys(sm_state + 0x7ff0, env->eip);
- stl_phys(sm_state + 0x7fec, EDI);
- stl_phys(sm_state + 0x7fe8, ESI);
- stl_phys(sm_state + 0x7fe4, EBP);
- stl_phys(sm_state + 0x7fe0, ESP);
- stl_phys(sm_state + 0x7fdc, EBX);
- stl_phys(sm_state + 0x7fd8, EDX);
- stl_phys(sm_state + 0x7fd4, ECX);
- stl_phys(sm_state + 0x7fd0, EAX);
- stl_phys(sm_state + 0x7fcc, env->dr[6]);
- stl_phys(sm_state + 0x7fc8, env->dr[7]);
-
- stl_phys(sm_state + 0x7fc4, env->tr.selector);
- stl_phys(sm_state + 0x7f64, env->tr.base);
- stl_phys(sm_state + 0x7f60, env->tr.limit);
- stl_phys(sm_state + 0x7f5c, (env->tr.flags >> 8) & 0xf0ff);
-
- stl_phys(sm_state + 0x7fc0, env->ldt.selector);
- stl_phys(sm_state + 0x7f80, env->ldt.base);
- stl_phys(sm_state + 0x7f7c, env->ldt.limit);
- stl_phys(sm_state + 0x7f78, (env->ldt.flags >> 8) & 0xf0ff);
-
- stl_phys(sm_state + 0x7f74, env->gdt.base);
- stl_phys(sm_state + 0x7f70, env->gdt.limit);
-
- stl_phys(sm_state + 0x7f58, env->idt.base);
- stl_phys(sm_state + 0x7f54, env->idt.limit);
-
- for(i = 0; i < 6; i++) {
- dt = &env->segs[i];
- if (i < 3)
- offset = 0x7f84 + i * 12;
- else
- offset = 0x7f2c + (i - 3) * 12;
- stl_phys(sm_state + 0x7fa8 + i * 4, dt->selector);
- stl_phys(sm_state + offset + 8, dt->base);
- stl_phys(sm_state + offset + 4, dt->limit);
- stl_phys(sm_state + offset, (dt->flags >> 8) & 0xf0ff);
- }
- stl_phys(sm_state + 0x7f14, env->cr[4]);
-
- stl_phys(sm_state + 0x7efc, SMM_REVISION_ID);
- stl_phys(sm_state + 0x7ef8, env->smbase);
-#endif
- /* init SMM cpu state */
-
-#ifdef TARGET_X86_64
- cpu_load_efer(env, 0);
-#endif
- load_eflags(0, ~(CC_O | CC_S | CC_Z | CC_A | CC_P | CC_C | DF_MASK));
- env->eip = 0x00008000;
- cpu_x86_load_seg_cache(env, R_CS, (env->smbase >> 4) & 0xffff, env->smbase,
- 0xffffffff, 0);
- cpu_x86_load_seg_cache(env, R_DS, 0, 0, 0xffffffff, 0);
- cpu_x86_load_seg_cache(env, R_ES, 0, 0, 0xffffffff, 0);
- cpu_x86_load_seg_cache(env, R_SS, 0, 0, 0xffffffff, 0);
- cpu_x86_load_seg_cache(env, R_FS, 0, 0, 0xffffffff, 0);
- cpu_x86_load_seg_cache(env, R_GS, 0, 0, 0xffffffff, 0);
-
- cpu_x86_update_cr0(env,
- env->cr[0] & ~(CR0_PE_MASK | CR0_EM_MASK | CR0_TS_MASK | CR0_PG_MASK));
- cpu_x86_update_cr4(env, 0);
- env->dr[7] = 0x00000400;
- CC_OP = CC_OP_EFLAGS;
- env = saved_env;
-}
-
-void helper_rsm(void)
-{
- target_ulong sm_state;
- int i, offset;
- uint32_t val;
-
- sm_state = env->smbase + 0x8000;
-#ifdef TARGET_X86_64
- cpu_load_efer(env, ldq_phys(sm_state + 0x7ed0));
-
- for(i = 0; i < 6; i++) {
- offset = 0x7e00 + i * 16;
- cpu_x86_load_seg_cache(env, i,
- lduw_phys(sm_state + offset),
- ldq_phys(sm_state + offset + 8),
- ldl_phys(sm_state + offset + 4),
- (lduw_phys(sm_state + offset + 2) & 0xf0ff) << 8);
- }
-
- env->gdt.base = ldq_phys(sm_state + 0x7e68);
- env->gdt.limit = ldl_phys(sm_state + 0x7e64);
-
- env->ldt.selector = lduw_phys(sm_state + 0x7e70);
- env->ldt.base = ldq_phys(sm_state + 0x7e78);
- env->ldt.limit = ldl_phys(sm_state + 0x7e74);
- env->ldt.flags = (lduw_phys(sm_state + 0x7e72) & 0xf0ff) << 8;
-
- env->idt.base = ldq_phys(sm_state + 0x7e88);
- env->idt.limit = ldl_phys(sm_state + 0x7e84);
-
- env->tr.selector = lduw_phys(sm_state + 0x7e90);
- env->tr.base = ldq_phys(sm_state + 0x7e98);
- env->tr.limit = ldl_phys(sm_state + 0x7e94);
- env->tr.flags = (lduw_phys(sm_state + 0x7e92) & 0xf0ff) << 8;
-
- EAX = ldq_phys(sm_state + 0x7ff8);
- ECX = ldq_phys(sm_state + 0x7ff0);
- EDX = ldq_phys(sm_state + 0x7fe8);
- EBX = ldq_phys(sm_state + 0x7fe0);
- ESP = ldq_phys(sm_state + 0x7fd8);
- EBP = ldq_phys(sm_state + 0x7fd0);
- ESI = ldq_phys(sm_state + 0x7fc8);
- EDI = ldq_phys(sm_state + 0x7fc0);
- for(i = 8; i < 16; i++)
- env->regs[i] = ldq_phys(sm_state + 0x7ff8 - i * 8);
- env->eip = ldq_phys(sm_state + 0x7f78);
- load_eflags(ldl_phys(sm_state + 0x7f70),
- ~(CC_O | CC_S | CC_Z | CC_A | CC_P | CC_C | DF_MASK));
- env->dr[6] = ldl_phys(sm_state + 0x7f68);
- env->dr[7] = ldl_phys(sm_state + 0x7f60);
-
- cpu_x86_update_cr4(env, ldl_phys(sm_state + 0x7f48));
- cpu_x86_update_cr3(env, ldl_phys(sm_state + 0x7f50));
- cpu_x86_update_cr0(env, ldl_phys(sm_state + 0x7f58));
-
- val = ldl_phys(sm_state + 0x7efc); /* revision ID */
- if (val & 0x20000) {
- env->smbase = ldl_phys(sm_state + 0x7f00) & ~0x7fff;
- }
-#else
- cpu_x86_update_cr0(env, ldl_phys(sm_state + 0x7ffc));
- cpu_x86_update_cr3(env, ldl_phys(sm_state + 0x7ff8));
- load_eflags(ldl_phys(sm_state + 0x7ff4),
- ~(CC_O | CC_S | CC_Z | CC_A | CC_P | CC_C | DF_MASK));
- env->eip = ldl_phys(sm_state + 0x7ff0);
- EDI = ldl_phys(sm_state + 0x7fec);
- ESI = ldl_phys(sm_state + 0x7fe8);
- EBP = ldl_phys(sm_state + 0x7fe4);
- ESP = ldl_phys(sm_state + 0x7fe0);
- EBX = ldl_phys(sm_state + 0x7fdc);
- EDX = ldl_phys(sm_state + 0x7fd8);
- ECX = ldl_phys(sm_state + 0x7fd4);
- EAX = ldl_phys(sm_state + 0x7fd0);
- env->dr[6] = ldl_phys(sm_state + 0x7fcc);
- env->dr[7] = ldl_phys(sm_state + 0x7fc8);
-
- env->tr.selector = ldl_phys(sm_state + 0x7fc4) & 0xffff;
- env->tr.base = ldl_phys(sm_state + 0x7f64);
- env->tr.limit = ldl_phys(sm_state + 0x7f60);
- env->tr.flags = (ldl_phys(sm_state + 0x7f5c) & 0xf0ff) << 8;
-
- env->ldt.selector = ldl_phys(sm_state + 0x7fc0) & 0xffff;
- env->ldt.base = ldl_phys(sm_state + 0x7f80);
- env->ldt.limit = ldl_phys(sm_state + 0x7f7c);
- env->ldt.flags = (ldl_phys(sm_state + 0x7f78) & 0xf0ff) << 8;
-
- env->gdt.base = ldl_phys(sm_state + 0x7f74);
- env->gdt.limit = ldl_phys(sm_state + 0x7f70);
-
- env->idt.base = ldl_phys(sm_state + 0x7f58);
- env->idt.limit = ldl_phys(sm_state + 0x7f54);
-
- for(i = 0; i < 6; i++) {
- if (i < 3)
- offset = 0x7f84 + i * 12;
- else
- offset = 0x7f2c + (i - 3) * 12;
- cpu_x86_load_seg_cache(env, i,
- ldl_phys(sm_state + 0x7fa8 + i * 4) & 0xffff,
- ldl_phys(sm_state + offset + 8),
- ldl_phys(sm_state + offset + 4),
- (ldl_phys(sm_state + offset) & 0xf0ff) << 8);
- }
- cpu_x86_update_cr4(env, ldl_phys(sm_state + 0x7f14));
-
- val = ldl_phys(sm_state + 0x7efc); /* revision ID */
- if (val & 0x20000) {
- env->smbase = ldl_phys(sm_state + 0x7ef8) & ~0x7fff;
- }
-#endif
- CC_OP = CC_OP_EFLAGS;
- env->hflags &= ~HF_SMM_MASK;
- cpu_smm_update(env);
-
- qemu_log_mask(CPU_LOG_INT, "SMM: after RSM\n");
- log_cpu_state_mask(CPU_LOG_INT, env, X86_DUMP_CCOP);
-}
-
-#endif /* !CONFIG_USER_ONLY */
-
-
-/* division, flags are undefined */
-
-void helper_divb_AL(target_ulong t0)
-{
- unsigned int num, den, q, r;
-
- num = (EAX & 0xffff);
- den = (t0 & 0xff);
- if (den == 0) {
- raise_exception(EXCP00_DIVZ);
- }
- q = (num / den);
- if (q > 0xff)
- raise_exception(EXCP00_DIVZ);
- q &= 0xff;
- r = (num % den) & 0xff;
- EAX = (EAX & ~0xffff) | (r << 8) | q;
-}
-
-void helper_idivb_AL(target_ulong t0)
-{
- int num, den, q, r;
-
- num = (int16_t)EAX;
- den = (int8_t)t0;
- if (den == 0) {
- raise_exception(EXCP00_DIVZ);
- }
- q = (num / den);
- if (q != (int8_t)q)
- raise_exception(EXCP00_DIVZ);
- q &= 0xff;
- r = (num % den) & 0xff;
- EAX = (EAX & ~0xffff) | (r << 8) | q;
-}
-
-void helper_divw_AX(target_ulong t0)
-{
- unsigned int num, den, q, r;
-
- num = (EAX & 0xffff) | ((EDX & 0xffff) << 16);
- den = (t0 & 0xffff);
- if (den == 0) {
- raise_exception(EXCP00_DIVZ);
- }
- q = (num / den);
- if (q > 0xffff)
- raise_exception(EXCP00_DIVZ);
- q &= 0xffff;
- r = (num % den) & 0xffff;
- EAX = (EAX & ~0xffff) | q;
- EDX = (EDX & ~0xffff) | r;
-}
-
-void helper_idivw_AX(target_ulong t0)
-{
- int num, den, q, r;
-
- num = (EAX & 0xffff) | ((EDX & 0xffff) << 16);
- den = (int16_t)t0;
- if (den == 0) {
- raise_exception(EXCP00_DIVZ);
- }
- q = (num / den);
- if (q != (int16_t)q)
- raise_exception(EXCP00_DIVZ);
- q &= 0xffff;
- r = (num % den) & 0xffff;
- EAX = (EAX & ~0xffff) | q;
- EDX = (EDX & ~0xffff) | r;
-}
-
-void helper_divl_EAX(target_ulong t0)
-{
- unsigned int den, r;
- uint64_t num, q;
-
- num = ((uint32_t)EAX) | ((uint64_t)((uint32_t)EDX) << 32);
- den = t0;
- if (den == 0) {
- raise_exception(EXCP00_DIVZ);
- }
- q = (num / den);
- r = (num % den);
- if (q > 0xffffffff)
- raise_exception(EXCP00_DIVZ);
- EAX = (uint32_t)q;
- EDX = (uint32_t)r;
-}
-
-void helper_idivl_EAX(target_ulong t0)
-{
- int den, r;
- int64_t num, q;
-
- num = ((uint32_t)EAX) | ((uint64_t)((uint32_t)EDX) << 32);
- den = t0;
- if (den == 0) {
- raise_exception(EXCP00_DIVZ);
- }
- q = (num / den);
- r = (num % den);
- if (q != (int32_t)q)
- raise_exception(EXCP00_DIVZ);
- EAX = (uint32_t)q;
- EDX = (uint32_t)r;
-}
-
-/* bcd */
-
-/* XXX: exception */
-void helper_aam(int base)
-{
- int al, ah;
- al = EAX & 0xff;
- ah = al / base;
- al = al % base;
- EAX = (EAX & ~0xffff) | al | (ah << 8);
- CC_DST = al;
-}
-
-void helper_aad(int base)
-{
- int al, ah;
- al = EAX & 0xff;
- ah = (EAX >> 8) & 0xff;
- al = ((ah * base) + al) & 0xff;
- EAX = (EAX & ~0xffff) | al;
- CC_DST = al;
-}
-
-void helper_aaa(void)
-{
- int icarry;
- int al, ah, af;
- int eflags;
-
- eflags = helper_cc_compute_all(CC_OP);
- af = eflags & CC_A;
- al = EAX & 0xff;
- ah = (EAX >> 8) & 0xff;
-
- icarry = (al > 0xf9);
- if (((al & 0x0f) > 9 ) || af) {
- al = (al + 6) & 0x0f;
- ah = (ah + 1 + icarry) & 0xff;
- eflags |= CC_C | CC_A;
- } else {
- eflags &= ~(CC_C | CC_A);
- al &= 0x0f;
- }
- EAX = (EAX & ~0xffff) | al | (ah << 8);
- CC_SRC = eflags;
-}
-
-void helper_aas(void)
-{
- int icarry;
- int al, ah, af;
- int eflags;
-
- eflags = helper_cc_compute_all(CC_OP);
- af = eflags & CC_A;
- al = EAX & 0xff;
- ah = (EAX >> 8) & 0xff;
-
- icarry = (al < 6);
- if (((al & 0x0f) > 9 ) || af) {
- al = (al - 6) & 0x0f;
- ah = (ah - 1 - icarry) & 0xff;
- eflags |= CC_C | CC_A;
- } else {
- eflags &= ~(CC_C | CC_A);
- al &= 0x0f;
- }
- EAX = (EAX & ~0xffff) | al | (ah << 8);
- CC_SRC = eflags;
-}
-
-void helper_daa(void)
-{
- int old_al, al, af, cf;
- int eflags;
-
- eflags = helper_cc_compute_all(CC_OP);
- cf = eflags & CC_C;
- af = eflags & CC_A;
- old_al = al = EAX & 0xff;
-
- eflags = 0;
- if (((al & 0x0f) > 9 ) || af) {
- al = (al + 6) & 0xff;
- eflags |= CC_A;
- }
- if ((old_al > 0x99) || cf) {
- al = (al + 0x60) & 0xff;
- eflags |= CC_C;
- }
- EAX = (EAX & ~0xff) | al;
- /* well, speed is not an issue here, so we compute the flags by hand */
- eflags |= (al == 0) << 6; /* zf */
- eflags |= parity_table[al]; /* pf */
- eflags |= (al & 0x80); /* sf */
- CC_SRC = eflags;
-}
-
-void helper_das(void)
-{
- int al, al1, af, cf;
- int eflags;
-
- eflags = helper_cc_compute_all(CC_OP);
- cf = eflags & CC_C;
- af = eflags & CC_A;
- al = EAX & 0xff;
-
- eflags = 0;
- al1 = al;
- if (((al & 0x0f) > 9 ) || af) {
- eflags |= CC_A;
- if (al < 6 || cf)
- eflags |= CC_C;
- al = (al - 6) & 0xff;
- }
- if ((al1 > 0x99) || cf) {
- al = (al - 0x60) & 0xff;
- eflags |= CC_C;
- }
- EAX = (EAX & ~0xff) | al;
- /* well, speed is not an issue here, so we compute the flags by hand */
- eflags |= (al == 0) << 6; /* zf */
- eflags |= parity_table[al]; /* pf */
- eflags |= (al & 0x80); /* sf */
- CC_SRC = eflags;
-}
-
-void helper_into(int next_eip_addend)
-{
- int eflags;
- eflags = helper_cc_compute_all(CC_OP);
- if (eflags & CC_O) {
- raise_interrupt(EXCP04_INTO, 1, 0, next_eip_addend);
- }
-}
-
-void helper_cmpxchg8b(target_ulong a0)
-{
- uint64_t d;
- int eflags;
-
- eflags = helper_cc_compute_all(CC_OP);
- d = ldq(a0);
- if (d == (((uint64_t)EDX << 32) | (uint32_t)EAX)) {
- stq(a0, ((uint64_t)ECX << 32) | (uint32_t)EBX);
- eflags |= CC_Z;
- } else {
- /* always do the store */
- stq(a0, d);
- EDX = (uint32_t)(d >> 32);
- EAX = (uint32_t)d;
- eflags &= ~CC_Z;
- }
- CC_SRC = eflags;
-}
-
-#ifdef TARGET_X86_64
-void helper_cmpxchg16b(target_ulong a0)
-{
- uint64_t d0, d1;
- int eflags;
-
- if ((a0 & 0xf) != 0)
- raise_exception(EXCP0D_GPF);
- eflags = helper_cc_compute_all(CC_OP);
- d0 = ldq(a0);
- d1 = ldq(a0 + 8);
- if (d0 == EAX && d1 == EDX) {
- stq(a0, EBX);
- stq(a0 + 8, ECX);
- eflags |= CC_Z;
- } else {
- /* always do the store */
- stq(a0, d0);
- stq(a0 + 8, d1);
- EDX = d1;
- EAX = d0;
- eflags &= ~CC_Z;
- }
- CC_SRC = eflags;
-}
-#endif
-
-void helper_single_step(void)
-{
-#ifndef CONFIG_USER_ONLY
- check_hw_breakpoints(env, 1);
- env->dr[6] |= DR6_BS;
-#endif
- raise_exception(EXCP01_DB);
-}
-
-void helper_cpuid(void)
-{
- uint32_t eax, ebx, ecx, edx;
-
- helper_svm_check_intercept_param(SVM_EXIT_CPUID, 0);
-
- cpu_x86_cpuid(env, (uint32_t)EAX, (uint32_t)ECX, &eax, &ebx, &ecx, &edx);
- EAX = eax;
- EBX = ebx;
- ECX = ecx;
- EDX = edx;
-}
-
-void helper_enter_level(int level, int data32, target_ulong t1)
-{
- target_ulong ssp;
- uint32_t esp_mask, esp, ebp;
-
- esp_mask = get_sp_mask(env->segs[R_SS].flags);
- ssp = env->segs[R_SS].base;
- ebp = EBP;
- esp = ESP;
- if (data32) {
- /* 32 bit */
- esp -= 4;
- while (--level) {
- esp -= 4;
- ebp -= 4;
- stl(ssp + (esp & esp_mask), ldl(ssp + (ebp & esp_mask)));
- }
- esp -= 4;
- stl(ssp + (esp & esp_mask), t1);
- } else {
- /* 16 bit */
- esp -= 2;
- while (--level) {
- esp -= 2;
- ebp -= 2;
- stw(ssp + (esp & esp_mask), lduw(ssp + (ebp & esp_mask)));
- }
- esp -= 2;
- stw(ssp + (esp & esp_mask), t1);
- }
-}
-
-#ifdef TARGET_X86_64
-void helper_enter64_level(int level, int data64, target_ulong t1)
-{
- target_ulong esp, ebp;
- ebp = EBP;
- esp = ESP;
-
- if (data64) {
- /* 64 bit */
- esp -= 8;
- while (--level) {
- esp -= 8;
- ebp -= 8;
- stq(esp, ldq(ebp));
- }
- esp -= 8;
- stq(esp, t1);
- } else {
- /* 16 bit */
- esp -= 2;
- while (--level) {
- esp -= 2;
- ebp -= 2;
- stw(esp, lduw(ebp));
- }
- esp -= 2;
- stw(esp, t1);
- }
-}
-#endif
-
-void helper_lldt(int selector)
-{
- SegmentCache *dt;
- uint32_t e1, e2;
- int index, entry_limit;
- target_ulong ptr;
-
- selector &= 0xffff;
- if ((selector & 0xfffc) == 0) {
- /* XXX: NULL selector case: invalid LDT */
- env->ldt.base = 0;
- env->ldt.limit = 0;
- } else {
- if (selector & 0x4)
- raise_exception_err(EXCP0D_GPF, selector & 0xfffc);
- dt = &env->gdt;
- index = selector & ~7;
-#ifdef TARGET_X86_64
- if (env->hflags & HF_LMA_MASK)
- entry_limit = 15;
- else
-#endif
- entry_limit = 7;
- if ((index + entry_limit) > dt->limit)
- raise_exception_err(EXCP0D_GPF, selector & 0xfffc);
- ptr = dt->base + index;
- e1 = ldl_kernel(ptr);
- e2 = ldl_kernel(ptr + 4);
- if ((e2 & DESC_S_MASK) || ((e2 >> DESC_TYPE_SHIFT) & 0xf) != 2)
- raise_exception_err(EXCP0D_GPF, selector & 0xfffc);
- if (!(e2 & DESC_P_MASK))
- raise_exception_err(EXCP0B_NOSEG, selector & 0xfffc);
-#ifdef TARGET_X86_64
- if (env->hflags & HF_LMA_MASK) {
- uint32_t e3;
- e3 = ldl_kernel(ptr + 8);
- load_seg_cache_raw_dt(&env->ldt, e1, e2);
- env->ldt.base |= (target_ulong)e3 << 32;
- } else
-#endif
- {
- load_seg_cache_raw_dt(&env->ldt, e1, e2);
- }
- }
- env->ldt.selector = selector;
-}
-
-void helper_ltr(int selector)
-{
- SegmentCache *dt;
- uint32_t e1, e2;
- int index, type, entry_limit;
- target_ulong ptr;
-
- selector &= 0xffff;
- if ((selector & 0xfffc) == 0) {
- /* NULL selector case: invalid TR */
- env->tr.base = 0;
- env->tr.limit = 0;
- env->tr.flags = 0;
- } else {
- if (selector & 0x4)
- raise_exception_err(EXCP0D_GPF, selector & 0xfffc);
- dt = &env->gdt;
- index = selector & ~7;
-#ifdef TARGET_X86_64
- if (env->hflags & HF_LMA_MASK)
- entry_limit = 15;
- else
-#endif
- entry_limit = 7;
- if ((index + entry_limit) > dt->limit)
- raise_exception_err(EXCP0D_GPF, selector & 0xfffc);
- ptr = dt->base + index;
- e1 = ldl_kernel(ptr);
- e2 = ldl_kernel(ptr + 4);
- type = (e2 >> DESC_TYPE_SHIFT) & 0xf;
- if ((e2 & DESC_S_MASK) ||
- (type != 1 && type != 9))
- raise_exception_err(EXCP0D_GPF, selector & 0xfffc);
- if (!(e2 & DESC_P_MASK))
- raise_exception_err(EXCP0B_NOSEG, selector & 0xfffc);
-#ifdef TARGET_X86_64
- if (env->hflags & HF_LMA_MASK) {
- uint32_t e3, e4;
- e3 = ldl_kernel(ptr + 8);
- e4 = ldl_kernel(ptr + 12);
- if ((e4 >> DESC_TYPE_SHIFT) & 0xf)
- raise_exception_err(EXCP0D_GPF, selector & 0xfffc);
- load_seg_cache_raw_dt(&env->tr, e1, e2);
- env->tr.base |= (target_ulong)e3 << 32;
- } else
-#endif
- {
- load_seg_cache_raw_dt(&env->tr, e1, e2);
- }
- e2 |= DESC_TSS_BUSY_MASK;
- stl_kernel(ptr + 4, e2);
- }
- env->tr.selector = selector;
-}
-
-/* only works if protected mode and not VM86. seg_reg must be != R_CS */
-void helper_load_seg(int seg_reg, int selector)
-{
- uint32_t e1, e2;
- int cpl, dpl, rpl;
- SegmentCache *dt;
- int index;
- target_ulong ptr;
-
- selector &= 0xffff;
- cpl = env->hflags & HF_CPL_MASK;
- if ((selector & 0xfffc) == 0) {
- /* null selector case */
- if (seg_reg == R_SS
-#ifdef TARGET_X86_64
- && (!(env->hflags & HF_CS64_MASK) || cpl == 3)
-#endif
- )
- raise_exception_err(EXCP0D_GPF, 0);
- cpu_x86_load_seg_cache(env, seg_reg, selector, 0, 0, 0);
- } else {
-
- if (selector & 0x4)
- dt = &env->ldt;
- else
- dt = &env->gdt;
- index = selector & ~7;
- if ((index + 7) > dt->limit)
- raise_exception_err(EXCP0D_GPF, selector & 0xfffc);
- ptr = dt->base + index;
- e1 = ldl_kernel(ptr);
- e2 = ldl_kernel(ptr + 4);
-
- if (!(e2 & DESC_S_MASK))
- raise_exception_err(EXCP0D_GPF, selector & 0xfffc);
- rpl = selector & 3;
- dpl = (e2 >> DESC_DPL_SHIFT) & 3;
- if (seg_reg == R_SS) {
- /* must be writable segment */
- if ((e2 & DESC_CS_MASK) || !(e2 & DESC_W_MASK))
- raise_exception_err(EXCP0D_GPF, selector & 0xfffc);
- if (rpl != cpl || dpl != cpl)
- raise_exception_err(EXCP0D_GPF, selector & 0xfffc);
- } else {
- /* must be readable segment */
- if ((e2 & (DESC_CS_MASK | DESC_R_MASK)) == DESC_CS_MASK)
- raise_exception_err(EXCP0D_GPF, selector & 0xfffc);
-
- if (!(e2 & DESC_CS_MASK) || !(e2 & DESC_C_MASK)) {
- /* if not conforming code, test rights */
- if (dpl < cpl || dpl < rpl)
- raise_exception_err(EXCP0D_GPF, selector & 0xfffc);
- }
- }
-
- if (!(e2 & DESC_P_MASK)) {
- if (seg_reg == R_SS)
- raise_exception_err(EXCP0C_STACK, selector & 0xfffc);
- else
- raise_exception_err(EXCP0B_NOSEG, selector & 0xfffc);
- }
-
- /* set the access bit if not already set */
- if (!(e2 & DESC_A_MASK)) {
- e2 |= DESC_A_MASK;
- stl_kernel(ptr + 4, e2);
- }
-
- cpu_x86_load_seg_cache(env, seg_reg, selector,
- get_seg_base(e1, e2),
- get_seg_limit(e1, e2),
- e2);
-#if 0
- qemu_log("load_seg: sel=0x%04x base=0x%08lx limit=0x%08lx flags=%08x\n",
- selector, (unsigned long)sc->base, sc->limit, sc->flags);
-#endif
- }
-}
-
-/* protected mode jump */
-void helper_ljmp_protected(int new_cs, target_ulong new_eip,
- int next_eip_addend)
-{
- int gate_cs, type;
- uint32_t e1, e2, cpl, dpl, rpl, limit;
- target_ulong next_eip;
-
- if ((new_cs & 0xfffc) == 0)
- raise_exception_err(EXCP0D_GPF, 0);
- if (load_segment(&e1, &e2, new_cs) != 0)
- raise_exception_err(EXCP0D_GPF, new_cs & 0xfffc);
- cpl = env->hflags & HF_CPL_MASK;
- if (e2 & DESC_S_MASK) {
- if (!(e2 & DESC_CS_MASK))
- raise_exception_err(EXCP0D_GPF, new_cs & 0xfffc);
- dpl = (e2 >> DESC_DPL_SHIFT) & 3;
- if (e2 & DESC_C_MASK) {
- /* conforming code segment */
- if (dpl > cpl)
- raise_exception_err(EXCP0D_GPF, new_cs & 0xfffc);
- } else {
- /* non conforming code segment */
- rpl = new_cs & 3;
- if (rpl > cpl)
- raise_exception_err(EXCP0D_GPF, new_cs & 0xfffc);
- if (dpl != cpl)
- raise_exception_err(EXCP0D_GPF, new_cs & 0xfffc);
- }
- if (!(e2 & DESC_P_MASK))
- raise_exception_err(EXCP0B_NOSEG, new_cs & 0xfffc);
- limit = get_seg_limit(e1, e2);
- if (new_eip > limit &&
- !(env->hflags & HF_LMA_MASK) && !(e2 & DESC_L_MASK))
- raise_exception_err(EXCP0D_GPF, new_cs & 0xfffc);
- cpu_x86_load_seg_cache(env, R_CS, (new_cs & 0xfffc) | cpl,
- get_seg_base(e1, e2), limit, e2);
- EIP = new_eip;
- } else {
- /* jump to call or task gate */
- dpl = (e2 >> DESC_DPL_SHIFT) & 3;
- rpl = new_cs & 3;
- cpl = env->hflags & HF_CPL_MASK;
- type = (e2 >> DESC_TYPE_SHIFT) & 0xf;
- switch(type) {
- case 1: /* 286 TSS */
- case 9: /* 386 TSS */
- case 5: /* task gate */
- if (dpl < cpl || dpl < rpl)
- raise_exception_err(EXCP0D_GPF, new_cs & 0xfffc);
- next_eip = env->eip + next_eip_addend;
- switch_tss(new_cs, e1, e2, SWITCH_TSS_JMP, next_eip);
- CC_OP = CC_OP_EFLAGS;
- break;
- case 4: /* 286 call gate */
- case 12: /* 386 call gate */
- if ((dpl < cpl) || (dpl < rpl))
- raise_exception_err(EXCP0D_GPF, new_cs & 0xfffc);
- if (!(e2 & DESC_P_MASK))
- raise_exception_err(EXCP0B_NOSEG, new_cs & 0xfffc);
- gate_cs = e1 >> 16;
- new_eip = (e1 & 0xffff);
- if (type == 12)
- new_eip |= (e2 & 0xffff0000);
- if (load_segment(&e1, &e2, gate_cs) != 0)
- raise_exception_err(EXCP0D_GPF, gate_cs & 0xfffc);
- dpl = (e2 >> DESC_DPL_SHIFT) & 3;
- /* must be code segment */
- if (((e2 & (DESC_S_MASK | DESC_CS_MASK)) !=
- (DESC_S_MASK | DESC_CS_MASK)))
- raise_exception_err(EXCP0D_GPF, gate_cs & 0xfffc);
- if (((e2 & DESC_C_MASK) && (dpl > cpl)) ||
- (!(e2 & DESC_C_MASK) && (dpl != cpl)))
- raise_exception_err(EXCP0D_GPF, gate_cs & 0xfffc);
- if (!(e2 & DESC_P_MASK))
- raise_exception_err(EXCP0D_GPF, gate_cs & 0xfffc);
- limit = get_seg_limit(e1, e2);
- if (new_eip > limit)
- raise_exception_err(EXCP0D_GPF, 0);
- cpu_x86_load_seg_cache(env, R_CS, (gate_cs & 0xfffc) | cpl,
- get_seg_base(e1, e2), limit, e2);
- EIP = new_eip;
- break;
- default:
- raise_exception_err(EXCP0D_GPF, new_cs & 0xfffc);
- break;
- }
- }
-}
-
-/* real mode call */
-void helper_lcall_real(int new_cs, target_ulong new_eip1,
- int shift, int next_eip)
-{
- int new_eip;
- uint32_t esp, esp_mask;
- target_ulong ssp;
-
- new_eip = new_eip1;
- esp = ESP;
- esp_mask = get_sp_mask(env->segs[R_SS].flags);
- ssp = env->segs[R_SS].base;
- if (shift) {
- PUSHL(ssp, esp, esp_mask, env->segs[R_CS].selector);
- PUSHL(ssp, esp, esp_mask, next_eip);
- } else {
- PUSHW(ssp, esp, esp_mask, env->segs[R_CS].selector);
- PUSHW(ssp, esp, esp_mask, next_eip);
- }
-
- SET_ESP(esp, esp_mask);
- env->eip = new_eip;
- env->segs[R_CS].selector = new_cs;
- env->segs[R_CS].base = (new_cs << 4);
-}
-
-/* protected mode call */
-void helper_lcall_protected(int new_cs, target_ulong new_eip,
- int shift, int next_eip_addend)
-{
- int new_stack, i;
- uint32_t e1, e2, cpl, dpl, rpl, selector, offset, param_count;
- uint32_t ss = 0, ss_e1 = 0, ss_e2 = 0, sp, type, ss_dpl, sp_mask;
- uint32_t val, limit, old_sp_mask;
- target_ulong ssp, old_ssp, next_eip;
-
- next_eip = env->eip + next_eip_addend;
- LOG_PCALL("lcall %04x:%08x s=%d\n", new_cs, (uint32_t)new_eip, shift);
- LOG_PCALL_STATE(env);
- if ((new_cs & 0xfffc) == 0)
- raise_exception_err(EXCP0D_GPF, 0);
- if (load_segment(&e1, &e2, new_cs) != 0)
- raise_exception_err(EXCP0D_GPF, new_cs & 0xfffc);
- cpl = env->hflags & HF_CPL_MASK;
- LOG_PCALL("desc=%08x:%08x\n", e1, e2);
- if (e2 & DESC_S_MASK) {
- if (!(e2 & DESC_CS_MASK))
- raise_exception_err(EXCP0D_GPF, new_cs & 0xfffc);
- dpl = (e2 >> DESC_DPL_SHIFT) & 3;
- if (e2 & DESC_C_MASK) {
- /* conforming code segment */
- if (dpl > cpl)
- raise_exception_err(EXCP0D_GPF, new_cs & 0xfffc);
- } else {
- /* non conforming code segment */
- rpl = new_cs & 3;
- if (rpl > cpl)
- raise_exception_err(EXCP0D_GPF, new_cs & 0xfffc);
- if (dpl != cpl)
- raise_exception_err(EXCP0D_GPF, new_cs & 0xfffc);
- }
- if (!(e2 & DESC_P_MASK))
- raise_exception_err(EXCP0B_NOSEG, new_cs & 0xfffc);
-
-#ifdef TARGET_X86_64
- /* XXX: check 16/32 bit cases in long mode */
- if (shift == 2) {
- target_ulong rsp;
- /* 64 bit case */
- rsp = ESP;
- PUSHQ(rsp, env->segs[R_CS].selector);
- PUSHQ(rsp, next_eip);
- /* from this point, not restartable */
- ESP = rsp;
- cpu_x86_load_seg_cache(env, R_CS, (new_cs & 0xfffc) | cpl,
- get_seg_base(e1, e2),
- get_seg_limit(e1, e2), e2);
- EIP = new_eip;
- } else
-#endif
- {
- sp = ESP;
- sp_mask = get_sp_mask(env->segs[R_SS].flags);
- ssp = env->segs[R_SS].base;
- if (shift) {
- PUSHL(ssp, sp, sp_mask, env->segs[R_CS].selector);
- PUSHL(ssp, sp, sp_mask, next_eip);
- } else {
- PUSHW(ssp, sp, sp_mask, env->segs[R_CS].selector);
- PUSHW(ssp, sp, sp_mask, next_eip);
- }
-
- limit = get_seg_limit(e1, e2);
- if (new_eip > limit)
- raise_exception_err(EXCP0D_GPF, new_cs & 0xfffc);
- /* from this point, not restartable */
- SET_ESP(sp, sp_mask);
- cpu_x86_load_seg_cache(env, R_CS, (new_cs & 0xfffc) | cpl,
- get_seg_base(e1, e2), limit, e2);
- EIP = new_eip;
- }
- } else {
- /* check gate type */
- type = (e2 >> DESC_TYPE_SHIFT) & 0x1f;
- dpl = (e2 >> DESC_DPL_SHIFT) & 3;
- rpl = new_cs & 3;
- switch(type) {
- case 1: /* available 286 TSS */
- case 9: /* available 386 TSS */
- case 5: /* task gate */
- if (dpl < cpl || dpl < rpl)
- raise_exception_err(EXCP0D_GPF, new_cs & 0xfffc);
- switch_tss(new_cs, e1, e2, SWITCH_TSS_CALL, next_eip);
- CC_OP = CC_OP_EFLAGS;
- return;
- case 4: /* 286 call gate */
- case 12: /* 386 call gate */
- break;
- default:
- raise_exception_err(EXCP0D_GPF, new_cs & 0xfffc);
- break;
- }
- shift = type >> 3;
-
- if (dpl < cpl || dpl < rpl)
- raise_exception_err(EXCP0D_GPF, new_cs & 0xfffc);
- /* check valid bit */
- if (!(e2 & DESC_P_MASK))
- raise_exception_err(EXCP0B_NOSEG, new_cs & 0xfffc);
- selector = e1 >> 16;
- offset = (e2 & 0xffff0000) | (e1 & 0x0000ffff);
- param_count = e2 & 0x1f;
- if ((selector & 0xfffc) == 0)
- raise_exception_err(EXCP0D_GPF, 0);
-
- if (load_segment(&e1, &e2, selector) != 0)
- raise_exception_err(EXCP0D_GPF, selector & 0xfffc);
- if (!(e2 & DESC_S_MASK) || !(e2 & (DESC_CS_MASK)))
- raise_exception_err(EXCP0D_GPF, selector & 0xfffc);
- dpl = (e2 >> DESC_DPL_SHIFT) & 3;
- if (dpl > cpl)
- raise_exception_err(EXCP0D_GPF, selector & 0xfffc);
- if (!(e2 & DESC_P_MASK))
- raise_exception_err(EXCP0B_NOSEG, selector & 0xfffc);
-
- if (!(e2 & DESC_C_MASK) && dpl < cpl) {
- /* to inner privilege */
- get_ss_esp_from_tss(&ss, &sp, dpl);
- LOG_PCALL("new ss:esp=%04x:%08x param_count=%d ESP=" TARGET_FMT_lx "\n",
- ss, sp, param_count, ESP);
- if ((ss & 0xfffc) == 0)
- raise_exception_err(EXCP0A_TSS, ss & 0xfffc);
- if ((ss & 3) != dpl)
- raise_exception_err(EXCP0A_TSS, ss & 0xfffc);
- if (load_segment(&ss_e1, &ss_e2, ss) != 0)
- raise_exception_err(EXCP0A_TSS, ss & 0xfffc);
- ss_dpl = (ss_e2 >> DESC_DPL_SHIFT) & 3;
- if (ss_dpl != dpl)
- raise_exception_err(EXCP0A_TSS, ss & 0xfffc);
- if (!(ss_e2 & DESC_S_MASK) ||
- (ss_e2 & DESC_CS_MASK) ||
- !(ss_e2 & DESC_W_MASK))
- raise_exception_err(EXCP0A_TSS, ss & 0xfffc);
- if (!(ss_e2 & DESC_P_MASK))
- raise_exception_err(EXCP0A_TSS, ss & 0xfffc);
-
- // push_size = ((param_count * 2) + 8) << shift;
-
- old_sp_mask = get_sp_mask(env->segs[R_SS].flags);
- old_ssp = env->segs[R_SS].base;
-
- sp_mask = get_sp_mask(ss_e2);
- ssp = get_seg_base(ss_e1, ss_e2);
- if (shift) {
- PUSHL(ssp, sp, sp_mask, env->segs[R_SS].selector);
- PUSHL(ssp, sp, sp_mask, ESP);
- for(i = param_count - 1; i >= 0; i--) {
- val = ldl_kernel(old_ssp + ((ESP + i * 4) & old_sp_mask));
- PUSHL(ssp, sp, sp_mask, val);
- }
- } else {
- PUSHW(ssp, sp, sp_mask, env->segs[R_SS].selector);
- PUSHW(ssp, sp, sp_mask, ESP);
- for(i = param_count - 1; i >= 0; i--) {
- val = lduw_kernel(old_ssp + ((ESP + i * 2) & old_sp_mask));
- PUSHW(ssp, sp, sp_mask, val);
- }
- }
- new_stack = 1;
- } else {
- /* to same privilege */
- sp = ESP;
- sp_mask = get_sp_mask(env->segs[R_SS].flags);
- ssp = env->segs[R_SS].base;
- // push_size = (4 << shift);
- new_stack = 0;
- }
-
- if (shift) {
- PUSHL(ssp, sp, sp_mask, env->segs[R_CS].selector);
- PUSHL(ssp, sp, sp_mask, next_eip);
- } else {
- PUSHW(ssp, sp, sp_mask, env->segs[R_CS].selector);
- PUSHW(ssp, sp, sp_mask, next_eip);
- }
-
- /* from this point, not restartable */
-
- if (new_stack) {
- ss = (ss & ~3) | dpl;
- cpu_x86_load_seg_cache(env, R_SS, ss,
- ssp,
- get_seg_limit(ss_e1, ss_e2),
- ss_e2);
- }
-
- selector = (selector & ~3) | dpl;
- cpu_x86_load_seg_cache(env, R_CS, selector,
- get_seg_base(e1, e2),
- get_seg_limit(e1, e2),
- e2);
- cpu_x86_set_cpl(env, dpl);
- SET_ESP(sp, sp_mask);
- EIP = offset;
- }
-}
-
-/* real and vm86 mode iret */
-void helper_iret_real(int shift)
-{
- uint32_t sp, new_cs, new_eip, new_eflags, sp_mask;
- target_ulong ssp;
- int eflags_mask;
-
- sp_mask = 0xffff; /* XXXX: use SS segment size ? */
- sp = ESP;
- ssp = env->segs[R_SS].base;
- if (shift == 1) {
- /* 32 bits */
- POPL(ssp, sp, sp_mask, new_eip);
- POPL(ssp, sp, sp_mask, new_cs);
- new_cs &= 0xffff;
- POPL(ssp, sp, sp_mask, new_eflags);
- } else {
- /* 16 bits */
- POPW(ssp, sp, sp_mask, new_eip);
- POPW(ssp, sp, sp_mask, new_cs);
- POPW(ssp, sp, sp_mask, new_eflags);
- }
- ESP = (ESP & ~sp_mask) | (sp & sp_mask);
- env->segs[R_CS].selector = new_cs;
- env->segs[R_CS].base = (new_cs << 4);
- env->eip = new_eip;
- if (env->eflags & VM_MASK)
- eflags_mask = TF_MASK | AC_MASK | ID_MASK | IF_MASK | RF_MASK | NT_MASK;
- else
- eflags_mask = TF_MASK | AC_MASK | ID_MASK | IF_MASK | IOPL_MASK | RF_MASK | NT_MASK;
- if (shift == 0)
- eflags_mask &= 0xffff;
- load_eflags(new_eflags, eflags_mask);
- env->hflags2 &= ~HF2_NMI_MASK;
-}
-
-static inline void validate_seg(int seg_reg, int cpl)
-{
- int dpl;
- uint32_t e2;
-
- /* XXX: on x86_64, we do not want to nullify FS and GS because
- they may still contain a valid base. I would be interested to
- know how a real x86_64 CPU behaves */
- if ((seg_reg == R_FS || seg_reg == R_GS) &&
- (env->segs[seg_reg].selector & 0xfffc) == 0)
- return;
-
- e2 = env->segs[seg_reg].flags;
- dpl = (e2 >> DESC_DPL_SHIFT) & 3;
- if (!(e2 & DESC_CS_MASK) || !(e2 & DESC_C_MASK)) {
- /* data or non conforming code segment */
- if (dpl < cpl) {
- cpu_x86_load_seg_cache(env, seg_reg, 0, 0, 0, 0);
- }
- }
-}
-
-/* protected mode iret */
-static inline void helper_ret_protected(int shift, int is_iret, int addend)
-{
- uint32_t new_cs, new_eflags, new_ss;
- uint32_t new_es, new_ds, new_fs, new_gs;
- uint32_t e1, e2, ss_e1, ss_e2;
- int cpl, dpl, rpl, eflags_mask, iopl;
- target_ulong ssp, sp, new_eip, new_esp, sp_mask;
-
-#ifdef TARGET_X86_64
- if (shift == 2)
- sp_mask = -1;
- else
-#endif
- sp_mask = get_sp_mask(env->segs[R_SS].flags);
- sp = ESP;
- ssp = env->segs[R_SS].base;
- new_eflags = 0; /* avoid warning */
-#ifdef TARGET_X86_64
- if (shift == 2) {
- POPQ(sp, new_eip);
- POPQ(sp, new_cs);
- new_cs &= 0xffff;
- if (is_iret) {
- POPQ(sp, new_eflags);
- }
- } else
-#endif
- if (shift == 1) {
- /* 32 bits */
- POPL(ssp, sp, sp_mask, new_eip);
- POPL(ssp, sp, sp_mask, new_cs);
- new_cs &= 0xffff;
- if (is_iret) {
- POPL(ssp, sp, sp_mask, new_eflags);
- if (new_eflags & VM_MASK)
- goto return_to_vm86;
- }
- } else {
- /* 16 bits */
- POPW(ssp, sp, sp_mask, new_eip);
- POPW(ssp, sp, sp_mask, new_cs);
- if (is_iret)
- POPW(ssp, sp, sp_mask, new_eflags);
- }
- LOG_PCALL("lret new %04x:" TARGET_FMT_lx " s=%d addend=0x%x\n",
- new_cs, new_eip, shift, addend);
- LOG_PCALL_STATE(env);
- if ((new_cs & 0xfffc) == 0)
- raise_exception_err(EXCP0D_GPF, new_cs & 0xfffc);
- if (load_segment(&e1, &e2, new_cs) != 0)
- raise_exception_err(EXCP0D_GPF, new_cs & 0xfffc);
- if (!(e2 & DESC_S_MASK) ||
- !(e2 & DESC_CS_MASK))
- raise_exception_err(EXCP0D_GPF, new_cs & 0xfffc);
- cpl = env->hflags & HF_CPL_MASK;
- rpl = new_cs & 3;
- if (rpl < cpl)
- raise_exception_err(EXCP0D_GPF, new_cs & 0xfffc);
- dpl = (e2 >> DESC_DPL_SHIFT) & 3;
- if (e2 & DESC_C_MASK) {
- if (dpl > rpl)
- raise_exception_err(EXCP0D_GPF, new_cs & 0xfffc);
- } else {
- if (dpl != rpl)
- raise_exception_err(EXCP0D_GPF, new_cs & 0xfffc);
- }
- if (!(e2 & DESC_P_MASK))
- raise_exception_err(EXCP0B_NOSEG, new_cs & 0xfffc);
-
- sp += addend;
- if (rpl == cpl && (!(env->hflags & HF_CS64_MASK) ||
- ((env->hflags & HF_CS64_MASK) && !is_iret))) {
- /* return to same privilege level */
- cpu_x86_load_seg_cache(env, R_CS, new_cs,
- get_seg_base(e1, e2),
- get_seg_limit(e1, e2),
- e2);
- } else {
- /* return to different privilege level */
-#ifdef TARGET_X86_64
- if (shift == 2) {
- POPQ(sp, new_esp);
- POPQ(sp, new_ss);
- new_ss &= 0xffff;
- } else
-#endif
- if (shift == 1) {
- /* 32 bits */
- POPL(ssp, sp, sp_mask, new_esp);
- POPL(ssp, sp, sp_mask, new_ss);
- new_ss &= 0xffff;
- } else {
- /* 16 bits */
- POPW(ssp, sp, sp_mask, new_esp);
- POPW(ssp, sp, sp_mask, new_ss);
- }
- LOG_PCALL("new ss:esp=%04x:" TARGET_FMT_lx "\n",
- new_ss, new_esp);
- if ((new_ss & 0xfffc) == 0) {
-#ifdef TARGET_X86_64
- /* NULL ss is allowed in long mode if cpl != 3*/
- /* XXX: test CS64 ? */
- if ((env->hflags & HF_LMA_MASK) && rpl != 3) {
- cpu_x86_load_seg_cache(env, R_SS, new_ss,
- 0, 0xffffffff,
- DESC_G_MASK | DESC_B_MASK | DESC_P_MASK |
- DESC_S_MASK | (rpl << DESC_DPL_SHIFT) |
- DESC_W_MASK | DESC_A_MASK);
- ss_e2 = DESC_B_MASK; /* XXX: should not be needed ? */
- } else
-#endif
- {
- raise_exception_err(EXCP0D_GPF, 0);
- }
- } else {
- if ((new_ss & 3) != rpl)
- raise_exception_err(EXCP0D_GPF, new_ss & 0xfffc);
- if (load_segment(&ss_e1, &ss_e2, new_ss) != 0)
- raise_exception_err(EXCP0D_GPF, new_ss & 0xfffc);
- if (!(ss_e2 & DESC_S_MASK) ||
- (ss_e2 & DESC_CS_MASK) ||
- !(ss_e2 & DESC_W_MASK))
- raise_exception_err(EXCP0D_GPF, new_ss & 0xfffc);
- dpl = (ss_e2 >> DESC_DPL_SHIFT) & 3;
- if (dpl != rpl)
- raise_exception_err(EXCP0D_GPF, new_ss & 0xfffc);
- if (!(ss_e2 & DESC_P_MASK))
- raise_exception_err(EXCP0B_NOSEG, new_ss & 0xfffc);
- cpu_x86_load_seg_cache(env, R_SS, new_ss,
- get_seg_base(ss_e1, ss_e2),
- get_seg_limit(ss_e1, ss_e2),
- ss_e2);
- }
-
- cpu_x86_load_seg_cache(env, R_CS, new_cs,
- get_seg_base(e1, e2),
- get_seg_limit(e1, e2),
- e2);
- cpu_x86_set_cpl(env, rpl);
- sp = new_esp;
-#ifdef TARGET_X86_64
- if (env->hflags & HF_CS64_MASK)
- sp_mask = -1;
- else
-#endif
- sp_mask = get_sp_mask(ss_e2);
-
- /* validate data segments */
- validate_seg(R_ES, rpl);
- validate_seg(R_DS, rpl);
- validate_seg(R_FS, rpl);
- validate_seg(R_GS, rpl);
-
- sp += addend;
- }
- SET_ESP(sp, sp_mask);
- env->eip = new_eip;
- if (is_iret) {
- /* NOTE: 'cpl' is the _old_ CPL */
- eflags_mask = TF_MASK | AC_MASK | ID_MASK | RF_MASK | NT_MASK;
- if (cpl == 0)
- eflags_mask |= IOPL_MASK;
- iopl = (env->eflags >> IOPL_SHIFT) & 3;
- if (cpl <= iopl)
- eflags_mask |= IF_MASK;
- if (shift == 0)
- eflags_mask &= 0xffff;
- load_eflags(new_eflags, eflags_mask);
- }
- return;
-
- return_to_vm86:
- POPL(ssp, sp, sp_mask, new_esp);
- POPL(ssp, sp, sp_mask, new_ss);
- POPL(ssp, sp, sp_mask, new_es);
- POPL(ssp, sp, sp_mask, new_ds);
- POPL(ssp, sp, sp_mask, new_fs);
- POPL(ssp, sp, sp_mask, new_gs);
-
- /* modify processor state */
- load_eflags(new_eflags, TF_MASK | AC_MASK | ID_MASK |
- IF_MASK | IOPL_MASK | VM_MASK | NT_MASK | VIF_MASK | VIP_MASK);
- load_seg_vm(R_CS, new_cs & 0xffff);
- cpu_x86_set_cpl(env, 3);
- load_seg_vm(R_SS, new_ss & 0xffff);
- load_seg_vm(R_ES, new_es & 0xffff);
- load_seg_vm(R_DS, new_ds & 0xffff);
- load_seg_vm(R_FS, new_fs & 0xffff);
- load_seg_vm(R_GS, new_gs & 0xffff);
-
- env->eip = new_eip & 0xffff;
- ESP = new_esp;
-}
-
-void helper_iret_protected(int shift, int next_eip)
-{
- int tss_selector, type;
- uint32_t e1, e2;
-
- /* specific case for TSS */
- if (env->eflags & NT_MASK) {
-#ifdef TARGET_X86_64
- if (env->hflags & HF_LMA_MASK)
- raise_exception_err(EXCP0D_GPF, 0);
-#endif
- tss_selector = lduw_kernel(env->tr.base + 0);
- if (tss_selector & 4)
- raise_exception_err(EXCP0A_TSS, tss_selector & 0xfffc);
- if (load_segment(&e1, &e2, tss_selector) != 0)
- raise_exception_err(EXCP0A_TSS, tss_selector & 0xfffc);
- type = (e2 >> DESC_TYPE_SHIFT) & 0x17;
- /* NOTE: we check both segment and busy TSS */
- if (type != 3)
- raise_exception_err(EXCP0A_TSS, tss_selector & 0xfffc);
- switch_tss(tss_selector, e1, e2, SWITCH_TSS_IRET, next_eip);
- } else {
- helper_ret_protected(shift, 1, 0);
- }
- env->hflags2 &= ~HF2_NMI_MASK;
-}
-
-void helper_lret_protected(int shift, int addend)
-{
- helper_ret_protected(shift, 0, addend);
-}
-
-void helper_sysenter(void)
-{
- if (env->sysenter_cs == 0) {
- raise_exception_err(EXCP0D_GPF, 0);
- }
- env->eflags &= ~(VM_MASK | IF_MASK | RF_MASK);
- cpu_x86_set_cpl(env, 0);
-
-#ifdef TARGET_X86_64
- if (env->hflags & HF_LMA_MASK) {
- cpu_x86_load_seg_cache(env, R_CS, env->sysenter_cs & 0xfffc,
- 0, 0xffffffff,
- DESC_G_MASK | DESC_B_MASK | DESC_P_MASK |
- DESC_S_MASK |
- DESC_CS_MASK | DESC_R_MASK | DESC_A_MASK | DESC_L_MASK);
- } else
-#endif
- {
- cpu_x86_load_seg_cache(env, R_CS, env->sysenter_cs & 0xfffc,
- 0, 0xffffffff,
- DESC_G_MASK | DESC_B_MASK | DESC_P_MASK |
- DESC_S_MASK |
- DESC_CS_MASK | DESC_R_MASK | DESC_A_MASK);
- }
- cpu_x86_load_seg_cache(env, R_SS, (env->sysenter_cs + 8) & 0xfffc,
- 0, 0xffffffff,
- DESC_G_MASK | DESC_B_MASK | DESC_P_MASK |
- DESC_S_MASK |
- DESC_W_MASK | DESC_A_MASK);
- ESP = env->sysenter_esp;
- EIP = env->sysenter_eip;
-}
-
-void helper_sysexit(int dflag)
-{
- int cpl;
-
- cpl = env->hflags & HF_CPL_MASK;
- if (env->sysenter_cs == 0 || cpl != 0) {
- raise_exception_err(EXCP0D_GPF, 0);
- }
- cpu_x86_set_cpl(env, 3);
-#ifdef TARGET_X86_64
- if (dflag == 2) {
- cpu_x86_load_seg_cache(env, R_CS, ((env->sysenter_cs + 32) & 0xfffc) | 3,
- 0, 0xffffffff,
- DESC_G_MASK | DESC_B_MASK | DESC_P_MASK |
- DESC_S_MASK | (3 << DESC_DPL_SHIFT) |
- DESC_CS_MASK | DESC_R_MASK | DESC_A_MASK | DESC_L_MASK);
- cpu_x86_load_seg_cache(env, R_SS, ((env->sysenter_cs + 40) & 0xfffc) | 3,
- 0, 0xffffffff,
- DESC_G_MASK | DESC_B_MASK | DESC_P_MASK |
- DESC_S_MASK | (3 << DESC_DPL_SHIFT) |
- DESC_W_MASK | DESC_A_MASK);
- } else
-#endif
- {
- cpu_x86_load_seg_cache(env, R_CS, ((env->sysenter_cs + 16) & 0xfffc) | 3,
- 0, 0xffffffff,
- DESC_G_MASK | DESC_B_MASK | DESC_P_MASK |
- DESC_S_MASK | (3 << DESC_DPL_SHIFT) |
- DESC_CS_MASK | DESC_R_MASK | DESC_A_MASK);
- cpu_x86_load_seg_cache(env, R_SS, ((env->sysenter_cs + 24) & 0xfffc) | 3,
- 0, 0xffffffff,
- DESC_G_MASK | DESC_B_MASK | DESC_P_MASK |
- DESC_S_MASK | (3 << DESC_DPL_SHIFT) |
- DESC_W_MASK | DESC_A_MASK);
- }
- ESP = ECX;
- EIP = EDX;
-}
-
-#if defined(CONFIG_USER_ONLY)
-target_ulong helper_read_crN(int reg)
-{
- return 0;
-}
-
-void helper_write_crN(int reg, target_ulong t0)
-{
-}
-
-void helper_movl_drN_T0(int reg, target_ulong t0)
-{
-}
-#else
-target_ulong helper_read_crN(int reg)
-{
- target_ulong val;
-
- helper_svm_check_intercept_param(SVM_EXIT_READ_CR0 + reg, 0);
- switch(reg) {
- default:
- val = env->cr[reg];
- break;
- case 8:
- if (!(env->hflags2 & HF2_VINTR_MASK)) {
- val = cpu_get_apic_tpr(env->apic_state);
- } else {
- val = env->v_tpr;
- }
- break;
- }
- return val;
-}
-
-void helper_write_crN(int reg, target_ulong t0)
-{
- helper_svm_check_intercept_param(SVM_EXIT_WRITE_CR0 + reg, 0);
- switch(reg) {
- case 0:
- cpu_x86_update_cr0(env, t0);
- break;
- case 3:
- cpu_x86_update_cr3(env, t0);
- break;
- case 4:
- cpu_x86_update_cr4(env, t0);
- break;
- case 8:
- if (!(env->hflags2 & HF2_VINTR_MASK)) {
- cpu_set_apic_tpr(env->apic_state, t0);
- }
- env->v_tpr = t0 & 0x0f;
- break;
- default:
- env->cr[reg] = t0;
- break;
- }
-}
-
-void helper_movl_drN_T0(int reg, target_ulong t0)
-{
- int i;
-
- if (reg < 4) {
- hw_breakpoint_remove(env, reg);
- env->dr[reg] = t0;
- hw_breakpoint_insert(env, reg);
- } else if (reg == 7) {
- for (i = 0; i < 4; i++)
- hw_breakpoint_remove(env, i);
- env->dr[7] = t0;
- for (i = 0; i < 4; i++)
- hw_breakpoint_insert(env, i);
- } else
- env->dr[reg] = t0;
-}
-#endif
-
-void helper_lmsw(target_ulong t0)
-{
- /* only 4 lower bits of CR0 are modified. PE cannot be set to zero
- if already set to one. */
- t0 = (env->cr[0] & ~0xe) | (t0 & 0xf);
- helper_write_crN(0, t0);
-}
-
-void helper_clts(void)
-{
- env->cr[0] &= ~CR0_TS_MASK;
- env->hflags &= ~HF_TS_MASK;
-}
-
-void helper_invlpg(target_ulong addr)
-{
- helper_svm_check_intercept_param(SVM_EXIT_INVLPG, 0);
- tlb_flush_page(env, addr);
-}
-
-void helper_rdtsc(void)
-{
- uint64_t val;
-
- if ((env->cr[4] & CR4_TSD_MASK) && ((env->hflags & HF_CPL_MASK) != 0)) {
- raise_exception(EXCP0D_GPF);
- }
- helper_svm_check_intercept_param(SVM_EXIT_RDTSC, 0);
-
- val = cpu_get_tsc(env) + env->tsc_offset;
- EAX = (uint32_t)(val);
- EDX = (uint32_t)(val >> 32);
-}
-
-void helper_rdtscp(void)
-{
- helper_rdtsc();
- ECX = (uint32_t)(env->tsc_aux);
-}
-
-void helper_rdpmc(void)
-{
- if ((env->cr[4] & CR4_PCE_MASK) && ((env->hflags & HF_CPL_MASK) != 0)) {
- raise_exception(EXCP0D_GPF);
- }
- helper_svm_check_intercept_param(SVM_EXIT_RDPMC, 0);
-
- /* currently unimplemented */
- raise_exception_err(EXCP06_ILLOP, 0);
-}
-
-#if defined(CONFIG_USER_ONLY)
-void helper_wrmsr(void)
-{
-}
-
-void helper_rdmsr(void)
-{
-}
-#else
-void helper_wrmsr(void)
-{
- uint64_t val;
-
- helper_svm_check_intercept_param(SVM_EXIT_MSR, 1);
-
- val = ((uint32_t)EAX) | ((uint64_t)((uint32_t)EDX) << 32);
-
- switch((uint32_t)ECX) {
- case MSR_IA32_SYSENTER_CS:
- env->sysenter_cs = val & 0xffff;
- break;
- case MSR_IA32_SYSENTER_ESP:
- env->sysenter_esp = val;
- break;
- case MSR_IA32_SYSENTER_EIP:
- env->sysenter_eip = val;
- break;
- case MSR_IA32_APICBASE:
- cpu_set_apic_base(env->apic_state, val);
- break;
- case MSR_EFER:
- {
- uint64_t update_mask;
- update_mask = 0;
- if (env->cpuid_ext2_features & CPUID_EXT2_SYSCALL)
- update_mask |= MSR_EFER_SCE;
- if (env->cpuid_ext2_features & CPUID_EXT2_LM)
- update_mask |= MSR_EFER_LME;
- if (env->cpuid_ext2_features & CPUID_EXT2_FFXSR)
- update_mask |= MSR_EFER_FFXSR;
- if (env->cpuid_ext2_features & CPUID_EXT2_NX)
- update_mask |= MSR_EFER_NXE;
- if (env->cpuid_ext3_features & CPUID_EXT3_SVM)
- update_mask |= MSR_EFER_SVME;
- if (env->cpuid_ext2_features & CPUID_EXT2_FFXSR)
- update_mask |= MSR_EFER_FFXSR;
- cpu_load_efer(env, (env->efer & ~update_mask) |
- (val & update_mask));
- }
- break;
- case MSR_STAR:
- env->star = val;
- break;
- case MSR_PAT:
- env->pat = val;
- break;
- case MSR_VM_HSAVE_PA:
- env->vm_hsave = val;
- break;
-#ifdef TARGET_X86_64
- case MSR_LSTAR:
- env->lstar = val;
- break;
- case MSR_CSTAR:
- env->cstar = val;
- break;
- case MSR_FMASK:
- env->fmask = val;
- break;
- case MSR_FSBASE:
- env->segs[R_FS].base = val;
- break;
- case MSR_GSBASE:
- env->segs[R_GS].base = val;
- break;
- case MSR_KERNELGSBASE:
- env->kernelgsbase = val;
- break;
-#endif
- case MSR_MTRRphysBase(0):
- case MSR_MTRRphysBase(1):
- case MSR_MTRRphysBase(2):
- case MSR_MTRRphysBase(3):
- case MSR_MTRRphysBase(4):
- case MSR_MTRRphysBase(5):
- case MSR_MTRRphysBase(6):
- case MSR_MTRRphysBase(7):
- env->mtrr_var[((uint32_t)ECX - MSR_MTRRphysBase(0)) / 2].base = val;
- break;
- case MSR_MTRRphysMask(0):
- case MSR_MTRRphysMask(1):
- case MSR_MTRRphysMask(2):
- case MSR_MTRRphysMask(3):
- case MSR_MTRRphysMask(4):
- case MSR_MTRRphysMask(5):
- case MSR_MTRRphysMask(6):
- case MSR_MTRRphysMask(7):
- env->mtrr_var[((uint32_t)ECX - MSR_MTRRphysMask(0)) / 2].mask = val;
- break;
- case MSR_MTRRfix64K_00000:
- env->mtrr_fixed[(uint32_t)ECX - MSR_MTRRfix64K_00000] = val;
- break;
- case MSR_MTRRfix16K_80000:
- case MSR_MTRRfix16K_A0000:
- env->mtrr_fixed[(uint32_t)ECX - MSR_MTRRfix16K_80000 + 1] = val;
- break;
- case MSR_MTRRfix4K_C0000:
- case MSR_MTRRfix4K_C8000:
- case MSR_MTRRfix4K_D0000:
- case MSR_MTRRfix4K_D8000:
- case MSR_MTRRfix4K_E0000:
- case MSR_MTRRfix4K_E8000:
- case MSR_MTRRfix4K_F0000:
- case MSR_MTRRfix4K_F8000:
- env->mtrr_fixed[(uint32_t)ECX - MSR_MTRRfix4K_C0000 + 3] = val;
- break;
- case MSR_MTRRdefType:
- env->mtrr_deftype = val;
- break;
- case MSR_MCG_STATUS:
- env->mcg_status = val;
- break;
- case MSR_MCG_CTL:
- if ((env->mcg_cap & MCG_CTL_P)
- && (val == 0 || val == ~(uint64_t)0))
- env->mcg_ctl = val;
- break;
- case MSR_TSC_AUX:
- env->tsc_aux = val;
- break;
- case MSR_IA32_MISC_ENABLE:
- env->msr_ia32_misc_enable = val;
- break;
- default:
- if ((uint32_t)ECX >= MSR_MC0_CTL
- && (uint32_t)ECX < MSR_MC0_CTL + (4 * env->mcg_cap & 0xff)) {
- uint32_t offset = (uint32_t)ECX - MSR_MC0_CTL;
- if ((offset & 0x3) != 0
- || (val == 0 || val == ~(uint64_t)0))
- env->mce_banks[offset] = val;
- break;
- }
- /* XXX: exception ? */
- break;
- }
-}
-
-void helper_rdmsr(void)
-{
- uint64_t val;
-
- helper_svm_check_intercept_param(SVM_EXIT_MSR, 0);
-
- switch((uint32_t)ECX) {
- case MSR_IA32_SYSENTER_CS:
- val = env->sysenter_cs;
- break;
- case MSR_IA32_SYSENTER_ESP:
- val = env->sysenter_esp;
- break;
- case MSR_IA32_SYSENTER_EIP:
- val = env->sysenter_eip;
- break;
- case MSR_IA32_APICBASE:
- val = cpu_get_apic_base(env->apic_state);
- break;
- case MSR_EFER:
- val = env->efer;
- break;
- case MSR_STAR:
- val = env->star;
- break;
- case MSR_PAT:
- val = env->pat;
- break;
- case MSR_VM_HSAVE_PA:
- val = env->vm_hsave;
- break;
- case MSR_IA32_PERF_STATUS:
- /* tsc_increment_by_tick */
- val = 1000ULL;
- /* CPU multiplier */
- val |= (((uint64_t)4ULL) << 40);
- break;
-#ifdef TARGET_X86_64
- case MSR_LSTAR:
- val = env->lstar;
- break;
- case MSR_CSTAR:
- val = env->cstar;
- break;
- case MSR_FMASK:
- val = env->fmask;
- break;
- case MSR_FSBASE:
- val = env->segs[R_FS].base;
- break;
- case MSR_GSBASE:
- val = env->segs[R_GS].base;
- break;
- case MSR_KERNELGSBASE:
- val = env->kernelgsbase;
- break;
- case MSR_TSC_AUX:
- val = env->tsc_aux;
- break;
-#endif
- case MSR_MTRRphysBase(0):
- case MSR_MTRRphysBase(1):
- case MSR_MTRRphysBase(2):
- case MSR_MTRRphysBase(3):
- case MSR_MTRRphysBase(4):
- case MSR_MTRRphysBase(5):
- case MSR_MTRRphysBase(6):
- case MSR_MTRRphysBase(7):
- val = env->mtrr_var[((uint32_t)ECX - MSR_MTRRphysBase(0)) / 2].base;
- break;
- case MSR_MTRRphysMask(0):
- case MSR_MTRRphysMask(1):
- case MSR_MTRRphysMask(2):
- case MSR_MTRRphysMask(3):
- case MSR_MTRRphysMask(4):
- case MSR_MTRRphysMask(5):
- case MSR_MTRRphysMask(6):
- case MSR_MTRRphysMask(7):
- val = env->mtrr_var[((uint32_t)ECX - MSR_MTRRphysMask(0)) / 2].mask;
- break;
- case MSR_MTRRfix64K_00000:
- val = env->mtrr_fixed[0];
- break;
- case MSR_MTRRfix16K_80000:
- case MSR_MTRRfix16K_A0000:
- val = env->mtrr_fixed[(uint32_t)ECX - MSR_MTRRfix16K_80000 + 1];
- break;
- case MSR_MTRRfix4K_C0000:
- case MSR_MTRRfix4K_C8000:
- case MSR_MTRRfix4K_D0000:
- case MSR_MTRRfix4K_D8000:
- case MSR_MTRRfix4K_E0000:
- case MSR_MTRRfix4K_E8000:
- case MSR_MTRRfix4K_F0000:
- case MSR_MTRRfix4K_F8000:
- val = env->mtrr_fixed[(uint32_t)ECX - MSR_MTRRfix4K_C0000 + 3];
- break;
- case MSR_MTRRdefType:
- val = env->mtrr_deftype;
- break;
- case MSR_MTRRcap:
- if (env->cpuid_features & CPUID_MTRR)
- val = MSR_MTRRcap_VCNT | MSR_MTRRcap_FIXRANGE_SUPPORT | MSR_MTRRcap_WC_SUPPORTED;
- else
- /* XXX: exception ? */
- val = 0;
- break;
- case MSR_MCG_CAP:
- val = env->mcg_cap;
- break;
- case MSR_MCG_CTL:
- if (env->mcg_cap & MCG_CTL_P)
- val = env->mcg_ctl;
- else
- val = 0;
- break;
- case MSR_MCG_STATUS:
- val = env->mcg_status;
- break;
- case MSR_IA32_MISC_ENABLE:
- val = env->msr_ia32_misc_enable;
- break;
- default:
- if ((uint32_t)ECX >= MSR_MC0_CTL
- && (uint32_t)ECX < MSR_MC0_CTL + (4 * env->mcg_cap & 0xff)) {
- uint32_t offset = (uint32_t)ECX - MSR_MC0_CTL;
- val = env->mce_banks[offset];
- break;
- }
- /* XXX: exception ? */
- val = 0;
- break;
- }
- EAX = (uint32_t)(val);
- EDX = (uint32_t)(val >> 32);
-}
-#endif
-
-target_ulong helper_lsl(target_ulong selector1)
-{
- unsigned int limit;
- uint32_t e1, e2, eflags, selector;
- int rpl, dpl, cpl, type;
-
- selector = selector1 & 0xffff;
- eflags = helper_cc_compute_all(CC_OP);
- if ((selector & 0xfffc) == 0)
- goto fail;
- if (load_segment(&e1, &e2, selector) != 0)
- goto fail;
- rpl = selector & 3;
- dpl = (e2 >> DESC_DPL_SHIFT) & 3;
- cpl = env->hflags & HF_CPL_MASK;
- if (e2 & DESC_S_MASK) {
- if ((e2 & DESC_CS_MASK) && (e2 & DESC_C_MASK)) {
- /* conforming */
- } else {
- if (dpl < cpl || dpl < rpl)
- goto fail;
- }
- } else {
- type = (e2 >> DESC_TYPE_SHIFT) & 0xf;
- switch(type) {
- case 1:
- case 2:
- case 3:
- case 9:
- case 11:
- break;
- default:
- goto fail;
- }
- if (dpl < cpl || dpl < rpl) {
- fail:
- CC_SRC = eflags & ~CC_Z;
- return 0;
- }
- }
- limit = get_seg_limit(e1, e2);
- CC_SRC = eflags | CC_Z;
- return limit;
-}
-
-target_ulong helper_lar(target_ulong selector1)
-{
- uint32_t e1, e2, eflags, selector;
- int rpl, dpl, cpl, type;
-
- selector = selector1 & 0xffff;
- eflags = helper_cc_compute_all(CC_OP);
- if ((selector & 0xfffc) == 0)
- goto fail;
- if (load_segment(&e1, &e2, selector) != 0)
- goto fail;
- rpl = selector & 3;
- dpl = (e2 >> DESC_DPL_SHIFT) & 3;
- cpl = env->hflags & HF_CPL_MASK;
- if (e2 & DESC_S_MASK) {
- if ((e2 & DESC_CS_MASK) && (e2 & DESC_C_MASK)) {
- /* conforming */
- } else {
- if (dpl < cpl || dpl < rpl)
- goto fail;
- }
- } else {
- type = (e2 >> DESC_TYPE_SHIFT) & 0xf;
- switch(type) {
- case 1:
- case 2:
- case 3:
- case 4:
- case 5:
- case 9:
- case 11:
- case 12:
- break;
- default:
- goto fail;
- }
- if (dpl < cpl || dpl < rpl) {
- fail:
- CC_SRC = eflags & ~CC_Z;
- return 0;
- }
- }
- CC_SRC = eflags | CC_Z;
- return e2 & 0x00f0ff00;
-}
-
-void helper_verr(target_ulong selector1)
-{
- uint32_t e1, e2, eflags, selector;
- int rpl, dpl, cpl;
-
- selector = selector1 & 0xffff;
- eflags = helper_cc_compute_all(CC_OP);
- if ((selector & 0xfffc) == 0)
- goto fail;
- if (load_segment(&e1, &e2, selector) != 0)
- goto fail;
- if (!(e2 & DESC_S_MASK))
- goto fail;
- rpl = selector & 3;
- dpl = (e2 >> DESC_DPL_SHIFT) & 3;
- cpl = env->hflags & HF_CPL_MASK;
- if (e2 & DESC_CS_MASK) {
- if (!(e2 & DESC_R_MASK))
- goto fail;
- if (!(e2 & DESC_C_MASK)) {
- if (dpl < cpl || dpl < rpl)
- goto fail;
- }
- } else {
- if (dpl < cpl || dpl < rpl) {
- fail:
- CC_SRC = eflags & ~CC_Z;
- return;
- }
- }
- CC_SRC = eflags | CC_Z;
-}
-
-void helper_verw(target_ulong selector1)
-{
- uint32_t e1, e2, eflags, selector;
- int rpl, dpl, cpl;
-
- selector = selector1 & 0xffff;
- eflags = helper_cc_compute_all(CC_OP);
- if ((selector & 0xfffc) == 0)
- goto fail;
- if (load_segment(&e1, &e2, selector) != 0)
- goto fail;
- if (!(e2 & DESC_S_MASK))
- goto fail;
- rpl = selector & 3;
- dpl = (e2 >> DESC_DPL_SHIFT) & 3;
- cpl = env->hflags & HF_CPL_MASK;
- if (e2 & DESC_CS_MASK) {
- goto fail;
- } else {
- if (dpl < cpl || dpl < rpl)
- goto fail;
- if (!(e2 & DESC_W_MASK)) {
- fail:
- CC_SRC = eflags & ~CC_Z;
- return;
- }
- }
- CC_SRC = eflags | CC_Z;
-}
-
-/* x87 FPU helpers */
-
-static inline double floatx80_to_double(floatx80 a)
-{
- union {
- float64 f64;
- double d;
- } u;
-
- u.f64 = floatx80_to_float64(a, &env->fp_status);
- return u.d;
-}
-
-static inline floatx80 double_to_floatx80(double a)
-{
- union {
- float64 f64;
- double d;
- } u;
-
- u.d = a;
- return float64_to_floatx80(u.f64, &env->fp_status);
-}
-
-static void fpu_set_exception(int mask)
-{
- env->fpus |= mask;
- if (env->fpus & (~env->fpuc & FPUC_EM))
- env->fpus |= FPUS_SE | FPUS_B;
-}
-
-static inline floatx80 helper_fdiv(floatx80 a, floatx80 b)
-{
- if (floatx80_is_zero(b)) {
- fpu_set_exception(FPUS_ZE);
- }
- return floatx80_div(a, b, &env->fp_status);
-}
-
-static void fpu_raise_exception(void)
-{
- if (env->cr[0] & CR0_NE_MASK) {
- raise_exception(EXCP10_COPR);
- }
-#if !defined(CONFIG_USER_ONLY)
- else {
- cpu_set_ferr(env);
- }
-#endif
-}
-
-void helper_flds_FT0(uint32_t val)
-{
- union {
- float32 f;
- uint32_t i;
- } u;
- u.i = val;
- FT0 = float32_to_floatx80(u.f, &env->fp_status);
-}
-
-void helper_fldl_FT0(uint64_t val)
-{
- union {
- float64 f;
- uint64_t i;
- } u;
- u.i = val;
- FT0 = float64_to_floatx80(u.f, &env->fp_status);
-}
-
-void helper_fildl_FT0(int32_t val)
-{
- FT0 = int32_to_floatx80(val, &env->fp_status);
-}
-
-void helper_flds_ST0(uint32_t val)
-{
- int new_fpstt;
- union {
- float32 f;
- uint32_t i;
- } u;
- new_fpstt = (env->fpstt - 1) & 7;
- u.i = val;
- env->fpregs[new_fpstt].d = float32_to_floatx80(u.f, &env->fp_status);
- env->fpstt = new_fpstt;
- env->fptags[new_fpstt] = 0; /* validate stack entry */
-}
-
-void helper_fldl_ST0(uint64_t val)
-{
- int new_fpstt;
- union {
- float64 f;
- uint64_t i;
- } u;
- new_fpstt = (env->fpstt - 1) & 7;
- u.i = val;
- env->fpregs[new_fpstt].d = float64_to_floatx80(u.f, &env->fp_status);
- env->fpstt = new_fpstt;
- env->fptags[new_fpstt] = 0; /* validate stack entry */
-}
-
-void helper_fildl_ST0(int32_t val)
-{
- int new_fpstt;
- new_fpstt = (env->fpstt - 1) & 7;
- env->fpregs[new_fpstt].d = int32_to_floatx80(val, &env->fp_status);
- env->fpstt = new_fpstt;
- env->fptags[new_fpstt] = 0; /* validate stack entry */
-}
-
-void helper_fildll_ST0(int64_t val)
-{
- int new_fpstt;
- new_fpstt = (env->fpstt - 1) & 7;
- env->fpregs[new_fpstt].d = int64_to_floatx80(val, &env->fp_status);
- env->fpstt = new_fpstt;
- env->fptags[new_fpstt] = 0; /* validate stack entry */
-}
-
-uint32_t helper_fsts_ST0(void)
-{
- union {
- float32 f;
- uint32_t i;
- } u;
- u.f = floatx80_to_float32(ST0, &env->fp_status);
- return u.i;
-}
-
-uint64_t helper_fstl_ST0(void)
-{
- union {
- float64 f;
- uint64_t i;
- } u;
- u.f = floatx80_to_float64(ST0, &env->fp_status);
- return u.i;
-}
-
-int32_t helper_fist_ST0(void)
-{
- int32_t val;
- val = floatx80_to_int32(ST0, &env->fp_status);
- if (val != (int16_t)val)
- val = -32768;
- return val;
-}
-
-int32_t helper_fistl_ST0(void)
-{
- int32_t val;
- val = floatx80_to_int32(ST0, &env->fp_status);
- return val;
-}
-
-int64_t helper_fistll_ST0(void)
-{
- int64_t val;
- val = floatx80_to_int64(ST0, &env->fp_status);
- return val;
-}
-
-int32_t helper_fistt_ST0(void)
-{
- int32_t val;
- val = floatx80_to_int32_round_to_zero(ST0, &env->fp_status);
- if (val != (int16_t)val)
- val = -32768;
- return val;
-}
-
-int32_t helper_fisttl_ST0(void)
-{
- int32_t val;
- val = floatx80_to_int32_round_to_zero(ST0, &env->fp_status);
- return val;
-}
-
-int64_t helper_fisttll_ST0(void)
-{
- int64_t val;
- val = floatx80_to_int64_round_to_zero(ST0, &env->fp_status);
- return val;
-}
-
-void helper_fldt_ST0(target_ulong ptr)
-{
- int new_fpstt;
- new_fpstt = (env->fpstt - 1) & 7;
- env->fpregs[new_fpstt].d = helper_fldt(ptr);
- env->fpstt = new_fpstt;
- env->fptags[new_fpstt] = 0; /* validate stack entry */
-}
-
-void helper_fstt_ST0(target_ulong ptr)
-{
- helper_fstt(ST0, ptr);
-}
-
-void helper_fpush(void)
-{
- fpush();
-}
-
-void helper_fpop(void)
-{
- fpop();
-}
-
-void helper_fdecstp(void)
-{
- env->fpstt = (env->fpstt - 1) & 7;
- env->fpus &= (~0x4700);
-}
-
-void helper_fincstp(void)
-{
- env->fpstt = (env->fpstt + 1) & 7;
- env->fpus &= (~0x4700);
-}
-
-/* FPU move */
-
-void helper_ffree_STN(int st_index)
-{
- env->fptags[(env->fpstt + st_index) & 7] = 1;
-}
-
-void helper_fmov_ST0_FT0(void)
-{
- ST0 = FT0;
-}
-
-void helper_fmov_FT0_STN(int st_index)
-{
- FT0 = ST(st_index);
-}
-
-void helper_fmov_ST0_STN(int st_index)
-{
- ST0 = ST(st_index);
-}
-
-void helper_fmov_STN_ST0(int st_index)
-{
- ST(st_index) = ST0;
-}
-
-void helper_fxchg_ST0_STN(int st_index)
-{
- floatx80 tmp;
- tmp = ST(st_index);
- ST(st_index) = ST0;
- ST0 = tmp;
-}
-
-/* FPU operations */
-
-static const int fcom_ccval[4] = {0x0100, 0x4000, 0x0000, 0x4500};
-
-void helper_fcom_ST0_FT0(void)
-{
- int ret;
-
- ret = floatx80_compare(ST0, FT0, &env->fp_status);
- env->fpus = (env->fpus & ~0x4500) | fcom_ccval[ret + 1];
-}
-
-void helper_fucom_ST0_FT0(void)
-{
- int ret;
-
- ret = floatx80_compare_quiet(ST0, FT0, &env->fp_status);
- env->fpus = (env->fpus & ~0x4500) | fcom_ccval[ret+ 1];
-}
-
-static const int fcomi_ccval[4] = {CC_C, CC_Z, 0, CC_Z | CC_P | CC_C};
-
-void helper_fcomi_ST0_FT0(void)
-{
- int eflags;
- int ret;
-
- ret = floatx80_compare(ST0, FT0, &env->fp_status);
- eflags = helper_cc_compute_all(CC_OP);
- eflags = (eflags & ~(CC_Z | CC_P | CC_C)) | fcomi_ccval[ret + 1];
- CC_SRC = eflags;
-}
-
-void helper_fucomi_ST0_FT0(void)
-{
- int eflags;
- int ret;
-
- ret = floatx80_compare_quiet(ST0, FT0, &env->fp_status);
- eflags = helper_cc_compute_all(CC_OP);
- eflags = (eflags & ~(CC_Z | CC_P | CC_C)) | fcomi_ccval[ret + 1];
- CC_SRC = eflags;
-}
-
-void helper_fadd_ST0_FT0(void)
-{
- ST0 = floatx80_add(ST0, FT0, &env->fp_status);
-}
-
-void helper_fmul_ST0_FT0(void)
-{
- ST0 = floatx80_mul(ST0, FT0, &env->fp_status);
-}
-
-void helper_fsub_ST0_FT0(void)
-{
- ST0 = floatx80_sub(ST0, FT0, &env->fp_status);
-}
-
-void helper_fsubr_ST0_FT0(void)
-{
- ST0 = floatx80_sub(FT0, ST0, &env->fp_status);
-}
-
-void helper_fdiv_ST0_FT0(void)
-{
- ST0 = helper_fdiv(ST0, FT0);
-}
-
-void helper_fdivr_ST0_FT0(void)
-{
- ST0 = helper_fdiv(FT0, ST0);
-}
-
-/* fp operations between STN and ST0 */
-
-void helper_fadd_STN_ST0(int st_index)
-{
- ST(st_index) = floatx80_add(ST(st_index), ST0, &env->fp_status);
-}
-
-void helper_fmul_STN_ST0(int st_index)
-{
- ST(st_index) = floatx80_mul(ST(st_index), ST0, &env->fp_status);
-}
-
-void helper_fsub_STN_ST0(int st_index)
-{
- ST(st_index) = floatx80_sub(ST(st_index), ST0, &env->fp_status);
-}
-
-void helper_fsubr_STN_ST0(int st_index)
-{
- ST(st_index) = floatx80_sub(ST0, ST(st_index), &env->fp_status);
-}
-
-void helper_fdiv_STN_ST0(int st_index)
-{
- floatx80 *p;
- p = &ST(st_index);
- *p = helper_fdiv(*p, ST0);
-}
-
-void helper_fdivr_STN_ST0(int st_index)
-{
- floatx80 *p;
- p = &ST(st_index);
- *p = helper_fdiv(ST0, *p);
-}
-
-/* misc FPU operations */
-void helper_fchs_ST0(void)
-{
- ST0 = floatx80_chs(ST0);
-}
-
-void helper_fabs_ST0(void)
-{
- ST0 = floatx80_abs(ST0);
-}
-
-void helper_fld1_ST0(void)
-{
- ST0 = floatx80_one;
-}
-
-void helper_fldl2t_ST0(void)
-{
- ST0 = floatx80_l2t;
-}
-
-void helper_fldl2e_ST0(void)
-{
- ST0 = floatx80_l2e;
-}
-
-void helper_fldpi_ST0(void)
-{
- ST0 = floatx80_pi;
-}
-
-void helper_fldlg2_ST0(void)
-{
- ST0 = floatx80_lg2;
-}
-
-void helper_fldln2_ST0(void)
-{
- ST0 = floatx80_ln2;
-}
-
-void helper_fldz_ST0(void)
-{
- ST0 = floatx80_zero;
-}
-
-void helper_fldz_FT0(void)
-{
- FT0 = floatx80_zero;
-}
-
-uint32_t helper_fnstsw(void)
-{
- return (env->fpus & ~0x3800) | (env->fpstt & 0x7) << 11;
-}
-
-uint32_t helper_fnstcw(void)
-{
- return env->fpuc;
-}
-
-static void update_fp_status(void)
-{
- int rnd_type;
-
- /* set rounding mode */
- switch(env->fpuc & FPU_RC_MASK) {
- default:
- case FPU_RC_NEAR:
- rnd_type = float_round_nearest_even;
- break;
- case FPU_RC_DOWN:
- rnd_type = float_round_down;
- break;
- case FPU_RC_UP:
- rnd_type = float_round_up;
- break;
- case FPU_RC_CHOP:
- rnd_type = float_round_to_zero;
- break;
- }
- set_float_rounding_mode(rnd_type, &env->fp_status);
- switch((env->fpuc >> 8) & 3) {
- case 0:
- rnd_type = 32;
- break;
- case 2:
- rnd_type = 64;
- break;
- case 3:
- default:
- rnd_type = 80;
- break;
- }
- set_floatx80_rounding_precision(rnd_type, &env->fp_status);
-}
-
-void helper_fldcw(uint32_t val)
-{
- env->fpuc = val;
- update_fp_status();
-}
-
-void helper_fclex(void)
-{
- env->fpus &= 0x7f00;
-}
-
-void helper_fwait(void)
-{
- if (env->fpus & FPUS_SE)
- fpu_raise_exception();
-}
-
-void helper_fninit(void)
-{
- env->fpus = 0;
- env->fpstt = 0;
- env->fpuc = 0x37f;
- env->fptags[0] = 1;
- env->fptags[1] = 1;
- env->fptags[2] = 1;
- env->fptags[3] = 1;
- env->fptags[4] = 1;
- env->fptags[5] = 1;
- env->fptags[6] = 1;
- env->fptags[7] = 1;
-}
-
-/* BCD ops */
-
-void helper_fbld_ST0(target_ulong ptr)
-{
- floatx80 tmp;
- uint64_t val;
- unsigned int v;
- int i;
-
- val = 0;
- for(i = 8; i >= 0; i--) {
- v = ldub(ptr + i);
- val = (val * 100) + ((v >> 4) * 10) + (v & 0xf);
- }
- tmp = int64_to_floatx80(val, &env->fp_status);
- if (ldub(ptr + 9) & 0x80) {
- floatx80_chs(tmp);
- }
- fpush();
- ST0 = tmp;
-}
-
-void helper_fbst_ST0(target_ulong ptr)
-{
- int v;
- target_ulong mem_ref, mem_end;
- int64_t val;
-
- val = floatx80_to_int64(ST0, &env->fp_status);
- mem_ref = ptr;
- mem_end = mem_ref + 9;
- if (val < 0) {
- stb(mem_end, 0x80);
- val = -val;
- } else {
- stb(mem_end, 0x00);
- }
- while (mem_ref < mem_end) {
- if (val == 0)
- break;
- v = val % 100;
- val = val / 100;
- v = ((v / 10) << 4) | (v % 10);
- stb(mem_ref++, v);
- }
- while (mem_ref < mem_end) {
- stb(mem_ref++, 0);
- }
-}
-
-void helper_f2xm1(void)
-{
- double val = floatx80_to_double(ST0);
- val = pow(2.0, val) - 1.0;
- ST0 = double_to_floatx80(val);
-}
-
-void helper_fyl2x(void)
-{
- double fptemp = floatx80_to_double(ST0);
-
- if (fptemp>0.0){
- fptemp = log(fptemp)/log(2.0); /* log2(ST) */
- fptemp *= floatx80_to_double(ST1);
- ST1 = double_to_floatx80(fptemp);
- fpop();
- } else {
- env->fpus &= (~0x4700);
- env->fpus |= 0x400;
- }
-}
-
-void helper_fptan(void)
-{
- double fptemp = floatx80_to_double(ST0);
-
- if((fptemp > MAXTAN)||(fptemp < -MAXTAN)) {
- env->fpus |= 0x400;
- } else {
- fptemp = tan(fptemp);
- ST0 = double_to_floatx80(fptemp);
- fpush();
- ST0 = floatx80_one;
- env->fpus &= (~0x400); /* C2 <-- 0 */
- /* the above code is for |arg| < 2**52 only */
- }
-}
-
-void helper_fpatan(void)
-{
- double fptemp, fpsrcop;
-
- fpsrcop = floatx80_to_double(ST1);
- fptemp = floatx80_to_double(ST0);
- ST1 = double_to_floatx80(atan2(fpsrcop, fptemp));
- fpop();
-}
-
-void helper_fxtract(void)
-{
- CPU_LDoubleU temp;
-
- temp.d = ST0;
-
- if (floatx80_is_zero(ST0)) {
- /* Easy way to generate -inf and raising division by 0 exception */
- ST0 = floatx80_div(floatx80_chs(floatx80_one), floatx80_zero, &env->fp_status);
- fpush();
- ST0 = temp.d;
- } else {
- int expdif;
-
- expdif = EXPD(temp) - EXPBIAS;
- /*DP exponent bias*/
- ST0 = int32_to_floatx80(expdif, &env->fp_status);
- fpush();
- BIASEXPONENT(temp);
- ST0 = temp.d;
- }
-}
-
-void helper_fprem1(void)
-{
- double st0, st1, dblq, fpsrcop, fptemp;
- CPU_LDoubleU fpsrcop1, fptemp1;
- int expdif;
- signed long long int q;
-
- st0 = floatx80_to_double(ST0);
- st1 = floatx80_to_double(ST1);
-
- if (isinf(st0) || isnan(st0) || isnan(st1) || (st1 == 0.0)) {
- ST0 = double_to_floatx80(0.0 / 0.0); /* NaN */
- env->fpus &= (~0x4700); /* (C3,C2,C1,C0) <-- 0000 */
- return;
- }
-
- fpsrcop = st0;
- fptemp = st1;
- fpsrcop1.d = ST0;
- fptemp1.d = ST1;
- expdif = EXPD(fpsrcop1) - EXPD(fptemp1);
-
- if (expdif < 0) {
- /* optimisation? taken from the AMD docs */
- env->fpus &= (~0x4700); /* (C3,C2,C1,C0) <-- 0000 */
- /* ST0 is unchanged */
- return;
- }
-
- if (expdif < 53) {
- dblq = fpsrcop / fptemp;
- /* round dblq towards nearest integer */
- dblq = rint(dblq);
- st0 = fpsrcop - fptemp * dblq;
-
- /* convert dblq to q by truncating towards zero */
- if (dblq < 0.0)
- q = (signed long long int)(-dblq);
- else
- q = (signed long long int)dblq;
-
- env->fpus &= (~0x4700); /* (C3,C2,C1,C0) <-- 0000 */
- /* (C0,C3,C1) <-- (q2,q1,q0) */
- env->fpus |= (q & 0x4) << (8 - 2); /* (C0) <-- q2 */
- env->fpus |= (q & 0x2) << (14 - 1); /* (C3) <-- q1 */
- env->fpus |= (q & 0x1) << (9 - 0); /* (C1) <-- q0 */
- } else {
- env->fpus |= 0x400; /* C2 <-- 1 */
- fptemp = pow(2.0, expdif - 50);
- fpsrcop = (st0 / st1) / fptemp;
- /* fpsrcop = integer obtained by chopping */
- fpsrcop = (fpsrcop < 0.0) ?
- -(floor(fabs(fpsrcop))) : floor(fpsrcop);
- st0 -= (st1 * fpsrcop * fptemp);
- }
- ST0 = double_to_floatx80(st0);
-}
-
-void helper_fprem(void)
-{
- double st0, st1, dblq, fpsrcop, fptemp;
- CPU_LDoubleU fpsrcop1, fptemp1;
- int expdif;
- signed long long int q;
-
- st0 = floatx80_to_double(ST0);
- st1 = floatx80_to_double(ST1);
-
- if (isinf(st0) || isnan(st0) || isnan(st1) || (st1 == 0.0)) {
- ST0 = double_to_floatx80(0.0 / 0.0); /* NaN */
- env->fpus &= (~0x4700); /* (C3,C2,C1,C0) <-- 0000 */
- return;
- }
-
- fpsrcop = st0;
- fptemp = st1;
- fpsrcop1.d = ST0;
- fptemp1.d = ST1;
- expdif = EXPD(fpsrcop1) - EXPD(fptemp1);
-
- if (expdif < 0) {
- /* optimisation? taken from the AMD docs */
- env->fpus &= (~0x4700); /* (C3,C2,C1,C0) <-- 0000 */
- /* ST0 is unchanged */
- return;
- }
-
- if ( expdif < 53 ) {
- dblq = fpsrcop/*ST0*/ / fptemp/*ST1*/;
- /* round dblq towards zero */
- dblq = (dblq < 0.0) ? ceil(dblq) : floor(dblq);
- st0 = fpsrcop/*ST0*/ - fptemp * dblq;
-
- /* convert dblq to q by truncating towards zero */
- if (dblq < 0.0)
- q = (signed long long int)(-dblq);
- else
- q = (signed long long int)dblq;
-
- env->fpus &= (~0x4700); /* (C3,C2,C1,C0) <-- 0000 */
- /* (C0,C3,C1) <-- (q2,q1,q0) */
- env->fpus |= (q & 0x4) << (8 - 2); /* (C0) <-- q2 */
- env->fpus |= (q & 0x2) << (14 - 1); /* (C3) <-- q1 */
- env->fpus |= (q & 0x1) << (9 - 0); /* (C1) <-- q0 */
- } else {
- int N = 32 + (expdif % 32); /* as per AMD docs */
- env->fpus |= 0x400; /* C2 <-- 1 */
- fptemp = pow(2.0, (double)(expdif - N));
- fpsrcop = (st0 / st1) / fptemp;
- /* fpsrcop = integer obtained by chopping */
- fpsrcop = (fpsrcop < 0.0) ?
- -(floor(fabs(fpsrcop))) : floor(fpsrcop);
- st0 -= (st1 * fpsrcop * fptemp);
- }
- ST0 = double_to_floatx80(st0);
-}
-
-void helper_fyl2xp1(void)
-{
- double fptemp = floatx80_to_double(ST0);
-
- if ((fptemp+1.0)>0.0) {
- fptemp = log(fptemp+1.0) / log(2.0); /* log2(ST+1.0) */
- fptemp *= floatx80_to_double(ST1);
- ST1 = double_to_floatx80(fptemp);
- fpop();
- } else {
- env->fpus &= (~0x4700);
- env->fpus |= 0x400;
- }
-}
-
-void helper_fsqrt(void)
-{
- if (floatx80_is_neg(ST0)) {
- env->fpus &= (~0x4700); /* (C3,C2,C1,C0) <-- 0000 */
- env->fpus |= 0x400;
- }
- ST0 = floatx80_sqrt(ST0, &env->fp_status);
-}
-
-void helper_fsincos(void)
-{
- double fptemp = floatx80_to_double(ST0);
-
- if ((fptemp > MAXTAN)||(fptemp < -MAXTAN)) {
- env->fpus |= 0x400;
- } else {
- ST0 = double_to_floatx80(sin(fptemp));
- fpush();
- ST0 = double_to_floatx80(cos(fptemp));
- env->fpus &= (~0x400); /* C2 <-- 0 */
- /* the above code is for |arg| < 2**63 only */
- }
-}
-
-void helper_frndint(void)
-{
- ST0 = floatx80_round_to_int(ST0, &env->fp_status);
-}
-
-void helper_fscale(void)
-{
- if (floatx80_is_any_nan(ST1)) {
- ST0 = ST1;
- } else {
- int n = floatx80_to_int32_round_to_zero(ST1, &env->fp_status);
- ST0 = floatx80_scalbn(ST0, n, &env->fp_status);
- }
-}
-
-void helper_fsin(void)
-{
- double fptemp = floatx80_to_double(ST0);
-
- if ((fptemp > MAXTAN)||(fptemp < -MAXTAN)) {
- env->fpus |= 0x400;
- } else {
- ST0 = double_to_floatx80(sin(fptemp));
- env->fpus &= (~0x400); /* C2 <-- 0 */
- /* the above code is for |arg| < 2**53 only */
- }
-}
-
-void helper_fcos(void)
-{
- double fptemp = floatx80_to_double(ST0);
-
- if((fptemp > MAXTAN)||(fptemp < -MAXTAN)) {
- env->fpus |= 0x400;
- } else {
- ST0 = double_to_floatx80(cos(fptemp));
- env->fpus &= (~0x400); /* C2 <-- 0 */
- /* the above code is for |arg5 < 2**63 only */
- }
-}
-
-void helper_fxam_ST0(void)
-{
- CPU_LDoubleU temp;
- int expdif;
-
- temp.d = ST0;
-
- env->fpus &= (~0x4700); /* (C3,C2,C1,C0) <-- 0000 */
- if (SIGND(temp))
- env->fpus |= 0x200; /* C1 <-- 1 */
-
- /* XXX: test fptags too */
- expdif = EXPD(temp);
- if (expdif == MAXEXPD) {
- if (MANTD(temp) == 0x8000000000000000ULL)
- env->fpus |= 0x500 /*Infinity*/;
- else
- env->fpus |= 0x100 /*NaN*/;
- } else if (expdif == 0) {
- if (MANTD(temp) == 0)
- env->fpus |= 0x4000 /*Zero*/;
- else
- env->fpus |= 0x4400 /*Denormal*/;
- } else {
- env->fpus |= 0x400;
- }
-}
-
-void helper_fstenv(target_ulong ptr, int data32)
-{
- int fpus, fptag, exp, i;
- uint64_t mant;
- CPU_LDoubleU tmp;
-
- fpus = (env->fpus & ~0x3800) | (env->fpstt & 0x7) << 11;
- fptag = 0;
- for (i=7; i>=0; i--) {
- fptag <<= 2;
- if (env->fptags[i]) {
- fptag |= 3;
- } else {
- tmp.d = env->fpregs[i].d;
- exp = EXPD(tmp);
- mant = MANTD(tmp);
- if (exp == 0 && mant == 0) {
- /* zero */
- fptag |= 1;
- } else if (exp == 0 || exp == MAXEXPD
- || (mant & (1LL << 63)) == 0
- ) {
- /* NaNs, infinity, denormal */
- fptag |= 2;
- }
- }
- }
- if (data32) {
- /* 32 bit */
- stl(ptr, env->fpuc);
- stl(ptr + 4, fpus);
- stl(ptr + 8, fptag);
- stl(ptr + 12, 0); /* fpip */
- stl(ptr + 16, 0); /* fpcs */
- stl(ptr + 20, 0); /* fpoo */
- stl(ptr + 24, 0); /* fpos */
- } else {
- /* 16 bit */
- stw(ptr, env->fpuc);
- stw(ptr + 2, fpus);
- stw(ptr + 4, fptag);
- stw(ptr + 6, 0);
- stw(ptr + 8, 0);
- stw(ptr + 10, 0);
- stw(ptr + 12, 0);
- }
-}
-
-void helper_fldenv(target_ulong ptr, int data32)
-{
- int i, fpus, fptag;
-
- if (data32) {
- env->fpuc = lduw(ptr);
- fpus = lduw(ptr + 4);
- fptag = lduw(ptr + 8);
- }
- else {
- env->fpuc = lduw(ptr);
- fpus = lduw(ptr + 2);
- fptag = lduw(ptr + 4);
- }
- env->fpstt = (fpus >> 11) & 7;
- env->fpus = fpus & ~0x3800;
- for(i = 0;i < 8; i++) {
- env->fptags[i] = ((fptag & 3) == 3);
- fptag >>= 2;
- }
-}
-
-void helper_fsave(target_ulong ptr, int data32)
-{
- floatx80 tmp;
- int i;
-
- helper_fstenv(ptr, data32);
-
- ptr += (14 << data32);
- for(i = 0;i < 8; i++) {
- tmp = ST(i);
- helper_fstt(tmp, ptr);
- ptr += 10;
- }
-
- /* fninit */
- env->fpus = 0;
- env->fpstt = 0;
- env->fpuc = 0x37f;
- env->fptags[0] = 1;
- env->fptags[1] = 1;
- env->fptags[2] = 1;
- env->fptags[3] = 1;
- env->fptags[4] = 1;
- env->fptags[5] = 1;
- env->fptags[6] = 1;
- env->fptags[7] = 1;
-}
-
-void helper_frstor(target_ulong ptr, int data32)
-{
- floatx80 tmp;
- int i;
-
- helper_fldenv(ptr, data32);
- ptr += (14 << data32);
-
- for(i = 0;i < 8; i++) {
- tmp = helper_fldt(ptr);
- ST(i) = tmp;
- ptr += 10;
- }
-}
-
-
-#if defined(CONFIG_USER_ONLY)
-void cpu_x86_load_seg(CPUX86State *s, int seg_reg, int selector)
-{
- CPUX86State *saved_env;
-
- saved_env = env;
- env = s;
- if (!(env->cr[0] & CR0_PE_MASK) || (env->eflags & VM_MASK)) {
- selector &= 0xffff;
- cpu_x86_load_seg_cache(env, seg_reg, selector,
- (selector << 4), 0xffff, 0);
- } else {
- helper_load_seg(seg_reg, selector);
- }
- env = saved_env;
-}
-
-void cpu_x86_fsave(CPUX86State *s, target_ulong ptr, int data32)
-{
- CPUX86State *saved_env;
-
- saved_env = env;
- env = s;
-
- helper_fsave(ptr, data32);
-
- env = saved_env;
-}
-
-void cpu_x86_frstor(CPUX86State *s, target_ulong ptr, int data32)
-{
- CPUX86State *saved_env;
-
- saved_env = env;
- env = s;
-
- helper_frstor(ptr, data32);
-
- env = saved_env;
-}
-#endif
-
-void helper_fxsave(target_ulong ptr, int data64)
-{
- int fpus, fptag, i, nb_xmm_regs;
- floatx80 tmp;
- target_ulong addr;
-
- /* The operand must be 16 byte aligned */
- if (ptr & 0xf) {
- raise_exception(EXCP0D_GPF);
- }
-
- fpus = (env->fpus & ~0x3800) | (env->fpstt & 0x7) << 11;
- fptag = 0;
- for(i = 0; i < 8; i++) {
- fptag |= (env->fptags[i] << i);
- }
- stw(ptr, env->fpuc);
- stw(ptr + 2, fpus);
- stw(ptr + 4, fptag ^ 0xff);
-#ifdef TARGET_X86_64
- if (data64) {
- stq(ptr + 0x08, 0); /* rip */
- stq(ptr + 0x10, 0); /* rdp */
- } else
-#endif
- {
- stl(ptr + 0x08, 0); /* eip */
- stl(ptr + 0x0c, 0); /* sel */
- stl(ptr + 0x10, 0); /* dp */
- stl(ptr + 0x14, 0); /* sel */
- }
-
- addr = ptr + 0x20;
- for(i = 0;i < 8; i++) {
- tmp = ST(i);
- helper_fstt(tmp, addr);
- addr += 16;
- }
-
- if (env->cr[4] & CR4_OSFXSR_MASK) {
- /* XXX: finish it */
- stl(ptr + 0x18, env->mxcsr); /* mxcsr */
- stl(ptr + 0x1c, 0x0000ffff); /* mxcsr_mask */
- if (env->hflags & HF_CS64_MASK)
- nb_xmm_regs = 16;
- else
- nb_xmm_regs = 8;
- addr = ptr + 0xa0;
- /* Fast FXSAVE leaves out the XMM registers */
- if (!(env->efer & MSR_EFER_FFXSR)
- || (env->hflags & HF_CPL_MASK)
- || !(env->hflags & HF_LMA_MASK)) {
- for(i = 0; i < nb_xmm_regs; i++) {
- stq(addr, env->xmm_regs[i].XMM_Q(0));
- stq(addr + 8, env->xmm_regs[i].XMM_Q(1));
- addr += 16;
- }
- }
- }
-}
-
-void helper_fxrstor(target_ulong ptr, int data64)
-{
- int i, fpus, fptag, nb_xmm_regs;
- floatx80 tmp;
- target_ulong addr;
-
- /* The operand must be 16 byte aligned */
- if (ptr & 0xf) {
- raise_exception(EXCP0D_GPF);
- }
-
- env->fpuc = lduw(ptr);
- fpus = lduw(ptr + 2);
- fptag = lduw(ptr + 4);
- env->fpstt = (fpus >> 11) & 7;
- env->fpus = fpus & ~0x3800;
- fptag ^= 0xff;
- for(i = 0;i < 8; i++) {
- env->fptags[i] = ((fptag >> i) & 1);
- }
-
- addr = ptr + 0x20;
- for(i = 0;i < 8; i++) {
- tmp = helper_fldt(addr);
- ST(i) = tmp;
- addr += 16;
- }
-
- if (env->cr[4] & CR4_OSFXSR_MASK) {
- /* XXX: finish it */
- env->mxcsr = ldl(ptr + 0x18);
- //ldl(ptr + 0x1c);
- if (env->hflags & HF_CS64_MASK)
- nb_xmm_regs = 16;
- else
- nb_xmm_regs = 8;
- addr = ptr + 0xa0;
- /* Fast FXRESTORE leaves out the XMM registers */
- if (!(env->efer & MSR_EFER_FFXSR)
- || (env->hflags & HF_CPL_MASK)
- || !(env->hflags & HF_LMA_MASK)) {
- for(i = 0; i < nb_xmm_regs; i++) {
- env->xmm_regs[i].XMM_Q(0) = ldq(addr);
- env->xmm_regs[i].XMM_Q(1) = ldq(addr + 8);
- addr += 16;
- }
- }
- }
-}
-
-void cpu_get_fp80(uint64_t *pmant, uint16_t *pexp, floatx80 f)
-{
- CPU_LDoubleU temp;
-
- temp.d = f;
- *pmant = temp.l.lower;
- *pexp = temp.l.upper;
-}
-
-floatx80 cpu_set_fp80(uint64_t mant, uint16_t upper)
-{
- CPU_LDoubleU temp;
-
- temp.l.upper = upper;
- temp.l.lower = mant;
- return temp.d;
-}
-
-#ifdef TARGET_X86_64
-
-//#define DEBUG_MULDIV
-
-static void add128(uint64_t *plow, uint64_t *phigh, uint64_t a, uint64_t b)
-{
- *plow += a;
- /* carry test */
- if (*plow < a)
- (*phigh)++;
- *phigh += b;
-}
-
-static void neg128(uint64_t *plow, uint64_t *phigh)
-{
- *plow = ~ *plow;
- *phigh = ~ *phigh;
- add128(plow, phigh, 1, 0);
-}
-
-/* return TRUE if overflow */
-static int div64(uint64_t *plow, uint64_t *phigh, uint64_t b)
-{
- uint64_t q, r, a1, a0;
- int i, qb, ab;
-
- a0 = *plow;
- a1 = *phigh;
- if (a1 == 0) {
- q = a0 / b;
- r = a0 % b;
- *plow = q;
- *phigh = r;
- } else {
- if (a1 >= b)
- return 1;
- /* XXX: use a better algorithm */
- for(i = 0; i < 64; i++) {
- ab = a1 >> 63;
- a1 = (a1 << 1) | (a0 >> 63);
- if (ab || a1 >= b) {
- a1 -= b;
- qb = 1;
- } else {
- qb = 0;
- }
- a0 = (a0 << 1) | qb;
- }
-#if defined(DEBUG_MULDIV)
- printf("div: 0x%016" PRIx64 "%016" PRIx64 " / 0x%016" PRIx64 ": q=0x%016" PRIx64 " r=0x%016" PRIx64 "\n",
- *phigh, *plow, b, a0, a1);
-#endif
- *plow = a0;
- *phigh = a1;
- }
- return 0;
-}
-
-/* return TRUE if overflow */
-static int idiv64(uint64_t *plow, uint64_t *phigh, int64_t b)
-{
- int sa, sb;
- sa = ((int64_t)*phigh < 0);
- if (sa)
- neg128(plow, phigh);
- sb = (b < 0);
- if (sb)
- b = -b;
- if (div64(plow, phigh, b) != 0)
- return 1;
- if (sa ^ sb) {
- if (*plow > (1ULL << 63))
- return 1;
- *plow = - *plow;
- } else {
- if (*plow >= (1ULL << 63))
- return 1;
- }
- if (sa)
- *phigh = - *phigh;
- return 0;
-}
-
-void helper_mulq_EAX_T0(target_ulong t0)
-{
- uint64_t r0, r1;
-
- mulu64(&r0, &r1, EAX, t0);
- EAX = r0;
- EDX = r1;
- CC_DST = r0;
- CC_SRC = r1;
-}
-
-void helper_imulq_EAX_T0(target_ulong t0)
-{
- uint64_t r0, r1;
-
- muls64(&r0, &r1, EAX, t0);
- EAX = r0;
- EDX = r1;
- CC_DST = r0;
- CC_SRC = ((int64_t)r1 != ((int64_t)r0 >> 63));
-}
-
-target_ulong helper_imulq_T0_T1(target_ulong t0, target_ulong t1)
-{
- uint64_t r0, r1;
-
- muls64(&r0, &r1, t0, t1);
- CC_DST = r0;
- CC_SRC = ((int64_t)r1 != ((int64_t)r0 >> 63));
- return r0;
-}
-
-void helper_divq_EAX(target_ulong t0)
-{
- uint64_t r0, r1;
- if (t0 == 0) {
- raise_exception(EXCP00_DIVZ);
- }
- r0 = EAX;
- r1 = EDX;
- if (div64(&r0, &r1, t0))
- raise_exception(EXCP00_DIVZ);
- EAX = r0;
- EDX = r1;
-}
-
-void helper_idivq_EAX(target_ulong t0)
-{
- uint64_t r0, r1;
- if (t0 == 0) {
- raise_exception(EXCP00_DIVZ);
- }
- r0 = EAX;
- r1 = EDX;
- if (idiv64(&r0, &r1, t0))
- raise_exception(EXCP00_DIVZ);
- EAX = r0;
- EDX = r1;
-}
-#endif
-
-static void do_hlt(void)
-{
- env->hflags &= ~HF_INHIBIT_IRQ_MASK; /* needed if sti is just before */
- env->halted = 1;
- env->exception_index = EXCP_HLT;
- cpu_loop_exit(env);
-}
-
-void helper_hlt(int next_eip_addend)
-{
- helper_svm_check_intercept_param(SVM_EXIT_HLT, 0);
- EIP += next_eip_addend;
-
- do_hlt();
-}
-
-void helper_monitor(target_ulong ptr)
-{
- if ((uint32_t)ECX != 0)
- raise_exception(EXCP0D_GPF);
- /* XXX: store address ? */
- helper_svm_check_intercept_param(SVM_EXIT_MONITOR, 0);
-}
-
-void helper_mwait(int next_eip_addend)
-{
- if ((uint32_t)ECX != 0)
- raise_exception(EXCP0D_GPF);
- helper_svm_check_intercept_param(SVM_EXIT_MWAIT, 0);
- EIP += next_eip_addend;
-
- /* XXX: not complete but not completely erroneous */
- if (env->cpu_index != 0 || env->next_cpu != NULL) {
- /* more than one CPU: do not sleep because another CPU may
- wake this one */
- } else {
- do_hlt();
- }
-}
-
-void helper_debug(void)
-{
- env->exception_index = EXCP_DEBUG;
- cpu_loop_exit(env);
-}
-
-void helper_reset_rf(void)
-{
- env->eflags &= ~RF_MASK;
-}
-
-void helper_raise_interrupt(int intno, int next_eip_addend)
-{
- raise_interrupt(intno, 1, 0, next_eip_addend);
-}
-
-void helper_raise_exception(int exception_index)
-{
- raise_exception(exception_index);
-}
-
-void helper_cli(void)
-{
- env->eflags &= ~IF_MASK;
-}
-
-void helper_sti(void)
-{
- env->eflags |= IF_MASK;
-}
-
-#if 0
-/* vm86plus instructions */
-void helper_cli_vm(void)
-{
- env->eflags &= ~VIF_MASK;
-}
-
-void helper_sti_vm(void)
-{
- env->eflags |= VIF_MASK;
- if (env->eflags & VIP_MASK) {
- raise_exception(EXCP0D_GPF);
- }
-}
-#endif
-
-void helper_set_inhibit_irq(void)
-{
- env->hflags |= HF_INHIBIT_IRQ_MASK;
-}
-
-void helper_reset_inhibit_irq(void)
-{
- env->hflags &= ~HF_INHIBIT_IRQ_MASK;
-}
-
-void helper_boundw(target_ulong a0, int v)
-{
- int low, high;
- low = ldsw(a0);
- high = ldsw(a0 + 2);
- v = (int16_t)v;
- if (v < low || v > high) {
- raise_exception(EXCP05_BOUND);
- }
-}
-
-void helper_boundl(target_ulong a0, int v)
-{
- int low, high;
- low = ldl(a0);
- high = ldl(a0 + 4);
- if (v < low || v > high) {
- raise_exception(EXCP05_BOUND);
- }
-}
-
-#if !defined(CONFIG_USER_ONLY)
-
-#define MMUSUFFIX _mmu
-
-#define SHIFT 0
-#include "softmmu_template.h"
-
-#define SHIFT 1
-#include "softmmu_template.h"
-
-#define SHIFT 2
-#include "softmmu_template.h"
-
-#define SHIFT 3
-#include "softmmu_template.h"
-
-#endif
-
-#if !defined(CONFIG_USER_ONLY)
-/* try to fill the TLB and return an exception if error. If retaddr is
- NULL, it means that the function was called in C code (i.e. not
- from generated code or from helper.c) */
-/* XXX: fix it to restore all registers */
-void tlb_fill(CPUX86State *env1, target_ulong addr, int is_write, int mmu_idx,
- uintptr_t retaddr)
-{
- TranslationBlock *tb;
- int ret;
- CPUX86State *saved_env;
-
- saved_env = env;
- env = env1;
-
- ret = cpu_x86_handle_mmu_fault(env, addr, is_write, mmu_idx);
- if (ret) {
- if (retaddr) {
- /* now we have a real cpu fault */
- tb = tb_find_pc(retaddr);
- if (tb) {
- /* the PC is inside the translated code. It means that we have
- a virtual CPU fault */
- cpu_restore_state(tb, env, retaddr);
- }
- }
- raise_exception_err(env->exception_index, env->error_code);
- }
- env = saved_env;
-}
-#endif
-
-/* Secure Virtual Machine helpers */
-
-#if defined(CONFIG_USER_ONLY)
-
-void helper_vmrun(int aflag, int next_eip_addend)
-{
-}
-void helper_vmmcall(void)
-{
-}
-void helper_vmload(int aflag)
-{
-}
-void helper_vmsave(int aflag)
-{
-}
-void helper_stgi(void)
-{
-}
-void helper_clgi(void)
-{
-}
-void helper_skinit(void)
-{
-}
-void helper_invlpga(int aflag)
-{
-}
-void helper_vmexit(uint32_t exit_code, uint64_t exit_info_1)
-{
-}
-void helper_svm_check_intercept_param(uint32_t type, uint64_t param)
-{
-}
-
-void svm_check_intercept(CPUX86State *env1, uint32_t type)
-{
-}
-
-void helper_svm_check_io(uint32_t port, uint32_t param,
- uint32_t next_eip_addend)
-{
-}
-#else
-
-static inline void svm_save_seg(target_phys_addr_t addr,
- const SegmentCache *sc)
-{
- stw_phys(addr + offsetof(struct vmcb_seg, selector),
- sc->selector);
- stq_phys(addr + offsetof(struct vmcb_seg, base),
- sc->base);
- stl_phys(addr + offsetof(struct vmcb_seg, limit),
- sc->limit);
- stw_phys(addr + offsetof(struct vmcb_seg, attrib),
- ((sc->flags >> 8) & 0xff) | ((sc->flags >> 12) & 0x0f00));
-}
-
-static inline void svm_load_seg(target_phys_addr_t addr, SegmentCache *sc)
-{
- unsigned int flags;
-
- sc->selector = lduw_phys(addr + offsetof(struct vmcb_seg, selector));
- sc->base = ldq_phys(addr + offsetof(struct vmcb_seg, base));
- sc->limit = ldl_phys(addr + offsetof(struct vmcb_seg, limit));
- flags = lduw_phys(addr + offsetof(struct vmcb_seg, attrib));
- sc->flags = ((flags & 0xff) << 8) | ((flags & 0x0f00) << 12);
-}
-
-static inline void svm_load_seg_cache(target_phys_addr_t addr,
- CPUX86State *env, int seg_reg)
-{
- SegmentCache sc1, *sc = &sc1;
- svm_load_seg(addr, sc);
- cpu_x86_load_seg_cache(env, seg_reg, sc->selector,
- sc->base, sc->limit, sc->flags);
-}
-
-void helper_vmrun(int aflag, int next_eip_addend)
-{
- target_ulong addr;
- uint32_t event_inj;
- uint32_t int_ctl;
-
- helper_svm_check_intercept_param(SVM_EXIT_VMRUN, 0);
-
- if (aflag == 2)
- addr = EAX;
- else
- addr = (uint32_t)EAX;
-
- qemu_log_mask(CPU_LOG_TB_IN_ASM, "vmrun! " TARGET_FMT_lx "\n", addr);
-
- env->vm_vmcb = addr;
-
- /* save the current CPU state in the hsave page */
- stq_phys(env->vm_hsave + offsetof(struct vmcb, save.gdtr.base), env->gdt.base);
- stl_phys(env->vm_hsave + offsetof(struct vmcb, save.gdtr.limit), env->gdt.limit);
-
- stq_phys(env->vm_hsave + offsetof(struct vmcb, save.idtr.base), env->idt.base);
- stl_phys(env->vm_hsave + offsetof(struct vmcb, save.idtr.limit), env->idt.limit);
-
- stq_phys(env->vm_hsave + offsetof(struct vmcb, save.cr0), env->cr[0]);
- stq_phys(env->vm_hsave + offsetof(struct vmcb, save.cr2), env->cr[2]);
- stq_phys(env->vm_hsave + offsetof(struct vmcb, save.cr3), env->cr[3]);
- stq_phys(env->vm_hsave + offsetof(struct vmcb, save.cr4), env->cr[4]);
- stq_phys(env->vm_hsave + offsetof(struct vmcb, save.dr6), env->dr[6]);
- stq_phys(env->vm_hsave + offsetof(struct vmcb, save.dr7), env->dr[7]);
-
- stq_phys(env->vm_hsave + offsetof(struct vmcb, save.efer), env->efer);
- stq_phys(env->vm_hsave + offsetof(struct vmcb, save.rflags), compute_eflags());
-
- svm_save_seg(env->vm_hsave + offsetof(struct vmcb, save.es),
- &env->segs[R_ES]);
- svm_save_seg(env->vm_hsave + offsetof(struct vmcb, save.cs),
- &env->segs[R_CS]);
- svm_save_seg(env->vm_hsave + offsetof(struct vmcb, save.ss),
- &env->segs[R_SS]);
- svm_save_seg(env->vm_hsave + offsetof(struct vmcb, save.ds),
- &env->segs[R_DS]);
-
- stq_phys(env->vm_hsave + offsetof(struct vmcb, save.rip),
- EIP + next_eip_addend);
- stq_phys(env->vm_hsave + offsetof(struct vmcb, save.rsp), ESP);
- stq_phys(env->vm_hsave + offsetof(struct vmcb, save.rax), EAX);
-
- /* load the interception bitmaps so we do not need to access the
- vmcb in svm mode */
- env->intercept = ldq_phys(env->vm_vmcb + offsetof(struct vmcb, control.intercept));
- env->intercept_cr_read = lduw_phys(env->vm_vmcb + offsetof(struct vmcb, control.intercept_cr_read));
- env->intercept_cr_write = lduw_phys(env->vm_vmcb + offsetof(struct vmcb, control.intercept_cr_write));
- env->intercept_dr_read = lduw_phys(env->vm_vmcb + offsetof(struct vmcb, control.intercept_dr_read));
- env->intercept_dr_write = lduw_phys(env->vm_vmcb + offsetof(struct vmcb, control.intercept_dr_write));
- env->intercept_exceptions = ldl_phys(env->vm_vmcb + offsetof(struct vmcb, control.intercept_exceptions));
-
- /* enable intercepts */
- env->hflags |= HF_SVMI_MASK;
-
- env->tsc_offset = ldq_phys(env->vm_vmcb + offsetof(struct vmcb, control.tsc_offset));
-
- env->gdt.base = ldq_phys(env->vm_vmcb + offsetof(struct vmcb, save.gdtr.base));
- env->gdt.limit = ldl_phys(env->vm_vmcb + offsetof(struct vmcb, save.gdtr.limit));
-
- env->idt.base = ldq_phys(env->vm_vmcb + offsetof(struct vmcb, save.idtr.base));
- env->idt.limit = ldl_phys(env->vm_vmcb + offsetof(struct vmcb, save.idtr.limit));
-
- /* clear exit_info_2 so we behave like the real hardware */
- stq_phys(env->vm_vmcb + offsetof(struct vmcb, control.exit_info_2), 0);
-
- cpu_x86_update_cr0(env, ldq_phys(env->vm_vmcb + offsetof(struct vmcb, save.cr0)));
- cpu_x86_update_cr4(env, ldq_phys(env->vm_vmcb + offsetof(struct vmcb, save.cr4)));
- cpu_x86_update_cr3(env, ldq_phys(env->vm_vmcb + offsetof(struct vmcb, save.cr3)));
- env->cr[2] = ldq_phys(env->vm_vmcb + offsetof(struct vmcb, save.cr2));
- int_ctl = ldl_phys(env->vm_vmcb + offsetof(struct vmcb, control.int_ctl));
- env->hflags2 &= ~(HF2_HIF_MASK | HF2_VINTR_MASK);
- if (int_ctl & V_INTR_MASKING_MASK) {
- env->v_tpr = int_ctl & V_TPR_MASK;
- env->hflags2 |= HF2_VINTR_MASK;
- if (env->eflags & IF_MASK)
- env->hflags2 |= HF2_HIF_MASK;
- }
-
- cpu_load_efer(env,
- ldq_phys(env->vm_vmcb + offsetof(struct vmcb, save.efer)));
- env->eflags = 0;
- load_eflags(ldq_phys(env->vm_vmcb + offsetof(struct vmcb, save.rflags)),
- ~(CC_O | CC_S | CC_Z | CC_A | CC_P | CC_C | DF_MASK));
- CC_OP = CC_OP_EFLAGS;
-
- svm_load_seg_cache(env->vm_vmcb + offsetof(struct vmcb, save.es),
- env, R_ES);
- svm_load_seg_cache(env->vm_vmcb + offsetof(struct vmcb, save.cs),
- env, R_CS);
- svm_load_seg_cache(env->vm_vmcb + offsetof(struct vmcb, save.ss),
- env, R_SS);
- svm_load_seg_cache(env->vm_vmcb + offsetof(struct vmcb, save.ds),
- env, R_DS);
-
- EIP = ldq_phys(env->vm_vmcb + offsetof(struct vmcb, save.rip));
- env->eip = EIP;
- ESP = ldq_phys(env->vm_vmcb + offsetof(struct vmcb, save.rsp));
- EAX = ldq_phys(env->vm_vmcb + offsetof(struct vmcb, save.rax));
- env->dr[7] = ldq_phys(env->vm_vmcb + offsetof(struct vmcb, save.dr7));
- env->dr[6] = ldq_phys(env->vm_vmcb + offsetof(struct vmcb, save.dr6));
- cpu_x86_set_cpl(env, ldub_phys(env->vm_vmcb + offsetof(struct vmcb, save.cpl)));
-
- /* FIXME: guest state consistency checks */
-
- switch(ldub_phys(env->vm_vmcb + offsetof(struct vmcb, control.tlb_ctl))) {
- case TLB_CONTROL_DO_NOTHING:
- break;
- case TLB_CONTROL_FLUSH_ALL_ASID:
- /* FIXME: this is not 100% correct but should work for now */
- tlb_flush(env, 1);
- break;
- }
-
- env->hflags2 |= HF2_GIF_MASK;
-
- if (int_ctl & V_IRQ_MASK) {
- env->interrupt_request |= CPU_INTERRUPT_VIRQ;
- }
-
- /* maybe we need to inject an event */
- event_inj = ldl_phys(env->vm_vmcb + offsetof(struct vmcb, control.event_inj));
- if (event_inj & SVM_EVTINJ_VALID) {
- uint8_t vector = event_inj & SVM_EVTINJ_VEC_MASK;
- uint16_t valid_err = event_inj & SVM_EVTINJ_VALID_ERR;
- uint32_t event_inj_err = ldl_phys(env->vm_vmcb + offsetof(struct vmcb, control.event_inj_err));
-
- qemu_log_mask(CPU_LOG_TB_IN_ASM, "Injecting(%#hx): ", valid_err);
- /* FIXME: need to implement valid_err */
- switch (event_inj & SVM_EVTINJ_TYPE_MASK) {
- case SVM_EVTINJ_TYPE_INTR:
- env->exception_index = vector;
- env->error_code = event_inj_err;
- env->exception_is_int = 0;
- env->exception_next_eip = -1;
- qemu_log_mask(CPU_LOG_TB_IN_ASM, "INTR");
- /* XXX: is it always correct ? */
- do_interrupt_all(vector, 0, 0, 0, 1);
- break;
- case SVM_EVTINJ_TYPE_NMI:
- env->exception_index = EXCP02_NMI;
- env->error_code = event_inj_err;
- env->exception_is_int = 0;
- env->exception_next_eip = EIP;
- qemu_log_mask(CPU_LOG_TB_IN_ASM, "NMI");
- cpu_loop_exit(env);
- break;
- case SVM_EVTINJ_TYPE_EXEPT:
- env->exception_index = vector;
- env->error_code = event_inj_err;
- env->exception_is_int = 0;
- env->exception_next_eip = -1;
- qemu_log_mask(CPU_LOG_TB_IN_ASM, "EXEPT");
- cpu_loop_exit(env);
- break;
- case SVM_EVTINJ_TYPE_SOFT:
- env->exception_index = vector;
- env->error_code = event_inj_err;
- env->exception_is_int = 1;
- env->exception_next_eip = EIP;
- qemu_log_mask(CPU_LOG_TB_IN_ASM, "SOFT");
- cpu_loop_exit(env);
- break;
- }
- qemu_log_mask(CPU_LOG_TB_IN_ASM, " %#x %#x\n", env->exception_index, env->error_code);
- }
-}
-
-void helper_vmmcall(void)
-{
- helper_svm_check_intercept_param(SVM_EXIT_VMMCALL, 0);
- raise_exception(EXCP06_ILLOP);
-}
-
-void helper_vmload(int aflag)
-{
- target_ulong addr;
- helper_svm_check_intercept_param(SVM_EXIT_VMLOAD, 0);
-
- if (aflag == 2)
- addr = EAX;
- else
- addr = (uint32_t)EAX;
-
- qemu_log_mask(CPU_LOG_TB_IN_ASM, "vmload! " TARGET_FMT_lx "\nFS: %016" PRIx64 " | " TARGET_FMT_lx "\n",
- addr, ldq_phys(addr + offsetof(struct vmcb, save.fs.base)),
- env->segs[R_FS].base);
-
- svm_load_seg_cache(addr + offsetof(struct vmcb, save.fs),
- env, R_FS);
- svm_load_seg_cache(addr + offsetof(struct vmcb, save.gs),
- env, R_GS);
- svm_load_seg(addr + offsetof(struct vmcb, save.tr),
- &env->tr);
- svm_load_seg(addr + offsetof(struct vmcb, save.ldtr),
- &env->ldt);
-
-#ifdef TARGET_X86_64
- env->kernelgsbase = ldq_phys(addr + offsetof(struct vmcb, save.kernel_gs_base));
- env->lstar = ldq_phys(addr + offsetof(struct vmcb, save.lstar));
- env->cstar = ldq_phys(addr + offsetof(struct vmcb, save.cstar));
- env->fmask = ldq_phys(addr + offsetof(struct vmcb, save.sfmask));
-#endif
- env->star = ldq_phys(addr + offsetof(struct vmcb, save.star));
- env->sysenter_cs = ldq_phys(addr + offsetof(struct vmcb, save.sysenter_cs));
- env->sysenter_esp = ldq_phys(addr + offsetof(struct vmcb, save.sysenter_esp));
- env->sysenter_eip = ldq_phys(addr + offsetof(struct vmcb, save.sysenter_eip));
-}
-
-void helper_vmsave(int aflag)
-{
- target_ulong addr;
- helper_svm_check_intercept_param(SVM_EXIT_VMSAVE, 0);
-
- if (aflag == 2)
- addr = EAX;
- else
- addr = (uint32_t)EAX;
-
- qemu_log_mask(CPU_LOG_TB_IN_ASM, "vmsave! " TARGET_FMT_lx "\nFS: %016" PRIx64 " | " TARGET_FMT_lx "\n",
- addr, ldq_phys(addr + offsetof(struct vmcb, save.fs.base)),
- env->segs[R_FS].base);
-
- svm_save_seg(addr + offsetof(struct vmcb, save.fs),
- &env->segs[R_FS]);
- svm_save_seg(addr + offsetof(struct vmcb, save.gs),
- &env->segs[R_GS]);
- svm_save_seg(addr + offsetof(struct vmcb, save.tr),
- &env->tr);
- svm_save_seg(addr + offsetof(struct vmcb, save.ldtr),
- &env->ldt);
-
-#ifdef TARGET_X86_64
- stq_phys(addr + offsetof(struct vmcb, save.kernel_gs_base), env->kernelgsbase);
- stq_phys(addr + offsetof(struct vmcb, save.lstar), env->lstar);
- stq_phys(addr + offsetof(struct vmcb, save.cstar), env->cstar);
- stq_phys(addr + offsetof(struct vmcb, save.sfmask), env->fmask);
-#endif
- stq_phys(addr + offsetof(struct vmcb, save.star), env->star);
- stq_phys(addr + offsetof(struct vmcb, save.sysenter_cs), env->sysenter_cs);
- stq_phys(addr + offsetof(struct vmcb, save.sysenter_esp), env->sysenter_esp);
- stq_phys(addr + offsetof(struct vmcb, save.sysenter_eip), env->sysenter_eip);
-}
-
-void helper_stgi(void)
-{
- helper_svm_check_intercept_param(SVM_EXIT_STGI, 0);
- env->hflags2 |= HF2_GIF_MASK;
-}
-
-void helper_clgi(void)
-{
- helper_svm_check_intercept_param(SVM_EXIT_CLGI, 0);
- env->hflags2 &= ~HF2_GIF_MASK;
-}
-
-void helper_skinit(void)
-{
- helper_svm_check_intercept_param(SVM_EXIT_SKINIT, 0);
- /* XXX: not implemented */
- raise_exception(EXCP06_ILLOP);
-}
-
-void helper_invlpga(int aflag)
-{
- target_ulong addr;
- helper_svm_check_intercept_param(SVM_EXIT_INVLPGA, 0);
-
- if (aflag == 2)
- addr = EAX;
- else
- addr = (uint32_t)EAX;
-
- /* XXX: could use the ASID to see if it is needed to do the
- flush */
- tlb_flush_page(env, addr);
-}
-
-void helper_svm_check_intercept_param(uint32_t type, uint64_t param)
-{
- if (likely(!(env->hflags & HF_SVMI_MASK)))
- return;
- switch(type) {
- case SVM_EXIT_READ_CR0 ... SVM_EXIT_READ_CR0 + 8:
- if (env->intercept_cr_read & (1 << (type - SVM_EXIT_READ_CR0))) {
- helper_vmexit(type, param);
- }
- break;
- case SVM_EXIT_WRITE_CR0 ... SVM_EXIT_WRITE_CR0 + 8:
- if (env->intercept_cr_write & (1 << (type - SVM_EXIT_WRITE_CR0))) {
- helper_vmexit(type, param);
- }
- break;
- case SVM_EXIT_READ_DR0 ... SVM_EXIT_READ_DR0 + 7:
- if (env->intercept_dr_read & (1 << (type - SVM_EXIT_READ_DR0))) {
- helper_vmexit(type, param);
- }
- break;
- case SVM_EXIT_WRITE_DR0 ... SVM_EXIT_WRITE_DR0 + 7:
- if (env->intercept_dr_write & (1 << (type - SVM_EXIT_WRITE_DR0))) {
- helper_vmexit(type, param);
- }
- break;
- case SVM_EXIT_EXCP_BASE ... SVM_EXIT_EXCP_BASE + 31:
- if (env->intercept_exceptions & (1 << (type - SVM_EXIT_EXCP_BASE))) {
- helper_vmexit(type, param);
- }
- break;
- case SVM_EXIT_MSR:
- if (env->intercept & (1ULL << (SVM_EXIT_MSR - SVM_EXIT_INTR))) {
- /* FIXME: this should be read in at vmrun (faster this way?) */
- uint64_t addr = ldq_phys(env->vm_vmcb + offsetof(struct vmcb, control.msrpm_base_pa));
- uint32_t t0, t1;
- switch((uint32_t)ECX) {
- case 0 ... 0x1fff:
- t0 = (ECX * 2) % 8;
- t1 = (ECX * 2) / 8;
- break;
- case 0xc0000000 ... 0xc0001fff:
- t0 = (8192 + ECX - 0xc0000000) * 2;
- t1 = (t0 / 8);
- t0 %= 8;
- break;
- case 0xc0010000 ... 0xc0011fff:
- t0 = (16384 + ECX - 0xc0010000) * 2;
- t1 = (t0 / 8);
- t0 %= 8;
- break;
- default:
- helper_vmexit(type, param);
- t0 = 0;
- t1 = 0;
- break;
- }
- if (ldub_phys(addr + t1) & ((1 << param) << t0))
- helper_vmexit(type, param);
- }
- break;
- default:
- if (env->intercept & (1ULL << (type - SVM_EXIT_INTR))) {
- helper_vmexit(type, param);
- }
- break;
- }
-}
-
-void svm_check_intercept(CPUX86State *env1, uint32_t type)
-{
- CPUX86State *saved_env;
-
- saved_env = env;
- env = env1;
- helper_svm_check_intercept_param(type, 0);
- env = saved_env;
-}
-
-void helper_svm_check_io(uint32_t port, uint32_t param,
- uint32_t next_eip_addend)
-{
- if (env->intercept & (1ULL << (SVM_EXIT_IOIO - SVM_EXIT_INTR))) {
- /* FIXME: this should be read in at vmrun (faster this way?) */
- uint64_t addr = ldq_phys(env->vm_vmcb + offsetof(struct vmcb, control.iopm_base_pa));
- uint16_t mask = (1 << ((param >> 4) & 7)) - 1;
- if(lduw_phys(addr + port / 8) & (mask << (port & 7))) {
- /* next EIP */
- stq_phys(env->vm_vmcb + offsetof(struct vmcb, control.exit_info_2),
- env->eip + next_eip_addend);
- helper_vmexit(SVM_EXIT_IOIO, param | (port << 16));
- }
- }
-}
-
-/* Note: currently only 32 bits of exit_code are used */
-void helper_vmexit(uint32_t exit_code, uint64_t exit_info_1)
-{
- uint32_t int_ctl;
-
- qemu_log_mask(CPU_LOG_TB_IN_ASM, "vmexit(%08x, %016" PRIx64 ", %016" PRIx64 ", " TARGET_FMT_lx ")!\n",
- exit_code, exit_info_1,
- ldq_phys(env->vm_vmcb + offsetof(struct vmcb, control.exit_info_2)),
- EIP);
-
- if(env->hflags & HF_INHIBIT_IRQ_MASK) {
- stl_phys(env->vm_vmcb + offsetof(struct vmcb, control.int_state), SVM_INTERRUPT_SHADOW_MASK);
- env->hflags &= ~HF_INHIBIT_IRQ_MASK;
- } else {
- stl_phys(env->vm_vmcb + offsetof(struct vmcb, control.int_state), 0);
- }
-
- /* Save the VM state in the vmcb */
- svm_save_seg(env->vm_vmcb + offsetof(struct vmcb, save.es),
- &env->segs[R_ES]);
- svm_save_seg(env->vm_vmcb + offsetof(struct vmcb, save.cs),
- &env->segs[R_CS]);
- svm_save_seg(env->vm_vmcb + offsetof(struct vmcb, save.ss),
- &env->segs[R_SS]);
- svm_save_seg(env->vm_vmcb + offsetof(struct vmcb, save.ds),
- &env->segs[R_DS]);
-
- stq_phys(env->vm_vmcb + offsetof(struct vmcb, save.gdtr.base), env->gdt.base);
- stl_phys(env->vm_vmcb + offsetof(struct vmcb, save.gdtr.limit), env->gdt.limit);
-
- stq_phys(env->vm_vmcb + offsetof(struct vmcb, save.idtr.base), env->idt.base);
- stl_phys(env->vm_vmcb + offsetof(struct vmcb, save.idtr.limit), env->idt.limit);
-
- stq_phys(env->vm_vmcb + offsetof(struct vmcb, save.efer), env->efer);
- stq_phys(env->vm_vmcb + offsetof(struct vmcb, save.cr0), env->cr[0]);
- stq_phys(env->vm_vmcb + offsetof(struct vmcb, save.cr2), env->cr[2]);
- stq_phys(env->vm_vmcb + offsetof(struct vmcb, save.cr3), env->cr[3]);
- stq_phys(env->vm_vmcb + offsetof(struct vmcb, save.cr4), env->cr[4]);
-
- int_ctl = ldl_phys(env->vm_vmcb + offsetof(struct vmcb, control.int_ctl));
- int_ctl &= ~(V_TPR_MASK | V_IRQ_MASK);
- int_ctl |= env->v_tpr & V_TPR_MASK;
- if (env->interrupt_request & CPU_INTERRUPT_VIRQ)
- int_ctl |= V_IRQ_MASK;
- stl_phys(env->vm_vmcb + offsetof(struct vmcb, control.int_ctl), int_ctl);
-
- stq_phys(env->vm_vmcb + offsetof(struct vmcb, save.rflags), compute_eflags());
- stq_phys(env->vm_vmcb + offsetof(struct vmcb, save.rip), env->eip);
- stq_phys(env->vm_vmcb + offsetof(struct vmcb, save.rsp), ESP);
- stq_phys(env->vm_vmcb + offsetof(struct vmcb, save.rax), EAX);
- stq_phys(env->vm_vmcb + offsetof(struct vmcb, save.dr7), env->dr[7]);
- stq_phys(env->vm_vmcb + offsetof(struct vmcb, save.dr6), env->dr[6]);
- stb_phys(env->vm_vmcb + offsetof(struct vmcb, save.cpl), env->hflags & HF_CPL_MASK);
-
- /* Reload the host state from vm_hsave */
- env->hflags2 &= ~(HF2_HIF_MASK | HF2_VINTR_MASK);
- env->hflags &= ~HF_SVMI_MASK;
- env->intercept = 0;
- env->intercept_exceptions = 0;
- env->interrupt_request &= ~CPU_INTERRUPT_VIRQ;
- env->tsc_offset = 0;
-
- env->gdt.base = ldq_phys(env->vm_hsave + offsetof(struct vmcb, save.gdtr.base));
- env->gdt.limit = ldl_phys(env->vm_hsave + offsetof(struct vmcb, save.gdtr.limit));
-
- env->idt.base = ldq_phys(env->vm_hsave + offsetof(struct vmcb, save.idtr.base));
- env->idt.limit = ldl_phys(env->vm_hsave + offsetof(struct vmcb, save.idtr.limit));
-
- cpu_x86_update_cr0(env, ldq_phys(env->vm_hsave + offsetof(struct vmcb, save.cr0)) | CR0_PE_MASK);
- cpu_x86_update_cr4(env, ldq_phys(env->vm_hsave + offsetof(struct vmcb, save.cr4)));
- cpu_x86_update_cr3(env, ldq_phys(env->vm_hsave + offsetof(struct vmcb, save.cr3)));
- /* we need to set the efer after the crs so the hidden flags get
- set properly */
- cpu_load_efer(env,
- ldq_phys(env->vm_hsave + offsetof(struct vmcb, save.efer)));
- env->eflags = 0;
- load_eflags(ldq_phys(env->vm_hsave + offsetof(struct vmcb, save.rflags)),
- ~(CC_O | CC_S | CC_Z | CC_A | CC_P | CC_C | DF_MASK));
- CC_OP = CC_OP_EFLAGS;
-
- svm_load_seg_cache(env->vm_hsave + offsetof(struct vmcb, save.es),
- env, R_ES);
- svm_load_seg_cache(env->vm_hsave + offsetof(struct vmcb, save.cs),
- env, R_CS);
- svm_load_seg_cache(env->vm_hsave + offsetof(struct vmcb, save.ss),
- env, R_SS);
- svm_load_seg_cache(env->vm_hsave + offsetof(struct vmcb, save.ds),
- env, R_DS);
-
- EIP = ldq_phys(env->vm_hsave + offsetof(struct vmcb, save.rip));
- ESP = ldq_phys(env->vm_hsave + offsetof(struct vmcb, save.rsp));
- EAX = ldq_phys(env->vm_hsave + offsetof(struct vmcb, save.rax));
-
- env->dr[6] = ldq_phys(env->vm_hsave + offsetof(struct vmcb, save.dr6));
- env->dr[7] = ldq_phys(env->vm_hsave + offsetof(struct vmcb, save.dr7));
-
- /* other setups */
- cpu_x86_set_cpl(env, 0);
- stq_phys(env->vm_vmcb + offsetof(struct vmcb, control.exit_code), exit_code);
- stq_phys(env->vm_vmcb + offsetof(struct vmcb, control.exit_info_1), exit_info_1);
-
- stl_phys(env->vm_vmcb + offsetof(struct vmcb, control.exit_int_info),
- ldl_phys(env->vm_vmcb + offsetof(struct vmcb, control.event_inj)));
- stl_phys(env->vm_vmcb + offsetof(struct vmcb, control.exit_int_info_err),
- ldl_phys(env->vm_vmcb + offsetof(struct vmcb, control.event_inj_err)));
- stl_phys(env->vm_vmcb + offsetof(struct vmcb, control.event_inj), 0);
-
- env->hflags2 &= ~HF2_GIF_MASK;
- /* FIXME: Resets the current ASID register to zero (host ASID). */
-
- /* Clears the V_IRQ and V_INTR_MASKING bits inside the processor. */
-
- /* Clears the TSC_OFFSET inside the processor. */
-
- /* If the host is in PAE mode, the processor reloads the host's PDPEs
- from the page table indicated the host's CR3. If the PDPEs contain
- illegal state, the processor causes a shutdown. */
-
- /* Forces CR0.PE = 1, RFLAGS.VM = 0. */
- env->cr[0] |= CR0_PE_MASK;
- env->eflags &= ~VM_MASK;
-
- /* Disables all breakpoints in the host DR7 register. */
-
- /* Checks the reloaded host state for consistency. */
-
- /* If the host's rIP reloaded by #VMEXIT is outside the limit of the
- host's code segment or non-canonical (in the case of long mode), a
- #GP fault is delivered inside the host.) */
-
- /* remove any pending exception */
- env->exception_index = -1;
- env->error_code = 0;
- env->old_exception = -1;
-
- cpu_loop_exit(env);
-}
-
-#endif
-
-/* MMX/SSE */
-/* XXX: optimize by storing fptt and fptags in the static cpu state */
-
-#define SSE_DAZ 0x0040
-#define SSE_RC_MASK 0x6000
-#define SSE_RC_NEAR 0x0000
-#define SSE_RC_DOWN 0x2000
-#define SSE_RC_UP 0x4000
-#define SSE_RC_CHOP 0x6000
-#define SSE_FZ 0x8000
-
-static void update_sse_status(void)
-{
- int rnd_type;
-
- /* set rounding mode */
- switch(env->mxcsr & SSE_RC_MASK) {
- default:
- case SSE_RC_NEAR:
- rnd_type = float_round_nearest_even;
- break;
- case SSE_RC_DOWN:
- rnd_type = float_round_down;
- break;
- case SSE_RC_UP:
- rnd_type = float_round_up;
- break;
- case SSE_RC_CHOP:
- rnd_type = float_round_to_zero;
- break;
- }
- set_float_rounding_mode(rnd_type, &env->sse_status);
-
- /* set denormals are zero */
- set_flush_inputs_to_zero((env->mxcsr & SSE_DAZ) ? 1 : 0, &env->sse_status);
-
- /* set flush to zero */
- set_flush_to_zero((env->mxcsr & SSE_FZ) ? 1 : 0, &env->fp_status);
-}
-
-void helper_ldmxcsr(uint32_t val)
-{
- env->mxcsr = val;
- update_sse_status();
-}
-
-void helper_enter_mmx(void)
-{
- env->fpstt = 0;
- *(uint32_t *)(env->fptags) = 0;
- *(uint32_t *)(env->fptags + 4) = 0;
-}
-
-void helper_emms(void)
-{
- /* set to empty state */
- *(uint32_t *)(env->fptags) = 0x01010101;
- *(uint32_t *)(env->fptags + 4) = 0x01010101;
-}
-
-/* XXX: suppress */
-void helper_movq(void *d, void *s)
-{
- *(uint64_t *)d = *(uint64_t *)s;
-}
-
-#define SHIFT 0
-#include "ops_sse.h"
-
-#define SHIFT 1
-#include "ops_sse.h"
-
-#define SHIFT 0
-#include "helper_template.h"
-#undef SHIFT
-
-#define SHIFT 1
-#include "helper_template.h"
-#undef SHIFT
-
-#define SHIFT 2
-#include "helper_template.h"
-#undef SHIFT
-
-#ifdef TARGET_X86_64
-
-#define SHIFT 3
-#include "helper_template.h"
-#undef SHIFT
-
-#endif
-
-/* bit operations */
-target_ulong helper_bsf(target_ulong t0)
-{
- int count;
- target_ulong res;
-
- res = t0;
- count = 0;
- while ((res & 1) == 0) {
- count++;
- res >>= 1;
- }
- return count;
-}
-
-target_ulong helper_lzcnt(target_ulong t0, int wordsize)
-{
- int count;
- target_ulong res, mask;
-
- if (wordsize > 0 && t0 == 0) {
- return wordsize;
- }
- res = t0;
- count = TARGET_LONG_BITS - 1;
- mask = (target_ulong)1 << (TARGET_LONG_BITS - 1);
- while ((res & mask) == 0) {
- count--;
- res <<= 1;
- }
- if (wordsize > 0) {
- return wordsize - 1 - count;
- }
- return count;
-}
-
-target_ulong helper_bsr(target_ulong t0)
-{
- return helper_lzcnt(t0, 0);
-}
-
-static int compute_all_eflags(void)
-{
- return CC_SRC;
-}
-
-static int compute_c_eflags(void)
-{
- return CC_SRC & CC_C;
-}
-
-uint32_t helper_cc_compute_all(int op)
-{
- switch (op) {
- default: /* should never happen */ return 0;
-
- case CC_OP_EFLAGS: return compute_all_eflags();
-
- case CC_OP_MULB: return compute_all_mulb();
- case CC_OP_MULW: return compute_all_mulw();
- case CC_OP_MULL: return compute_all_mull();
-
- case CC_OP_ADDB: return compute_all_addb();
- case CC_OP_ADDW: return compute_all_addw();
- case CC_OP_ADDL: return compute_all_addl();
-
- case CC_OP_ADCB: return compute_all_adcb();
- case CC_OP_ADCW: return compute_all_adcw();
- case CC_OP_ADCL: return compute_all_adcl();
-
- case CC_OP_SUBB: return compute_all_subb();
- case CC_OP_SUBW: return compute_all_subw();
- case CC_OP_SUBL: return compute_all_subl();
-
- case CC_OP_SBBB: return compute_all_sbbb();
- case CC_OP_SBBW: return compute_all_sbbw();
- case CC_OP_SBBL: return compute_all_sbbl();
-
- case CC_OP_LOGICB: return compute_all_logicb();
- case CC_OP_LOGICW: return compute_all_logicw();
- case CC_OP_LOGICL: return compute_all_logicl();
-
- case CC_OP_INCB: return compute_all_incb();
- case CC_OP_INCW: return compute_all_incw();
- case CC_OP_INCL: return compute_all_incl();
-
- case CC_OP_DECB: return compute_all_decb();
- case CC_OP_DECW: return compute_all_decw();
- case CC_OP_DECL: return compute_all_decl();
-
- case CC_OP_SHLB: return compute_all_shlb();
- case CC_OP_SHLW: return compute_all_shlw();
- case CC_OP_SHLL: return compute_all_shll();
-
- case CC_OP_SARB: return compute_all_sarb();
- case CC_OP_SARW: return compute_all_sarw();
- case CC_OP_SARL: return compute_all_sarl();
-
-#ifdef TARGET_X86_64
- case CC_OP_MULQ: return compute_all_mulq();
-
- case CC_OP_ADDQ: return compute_all_addq();
-
- case CC_OP_ADCQ: return compute_all_adcq();
-
- case CC_OP_SUBQ: return compute_all_subq();
-
- case CC_OP_SBBQ: return compute_all_sbbq();
-
- case CC_OP_LOGICQ: return compute_all_logicq();
-
- case CC_OP_INCQ: return compute_all_incq();
-
- case CC_OP_DECQ: return compute_all_decq();
-
- case CC_OP_SHLQ: return compute_all_shlq();
-
- case CC_OP_SARQ: return compute_all_sarq();
-#endif
- }
-}
-
-uint32_t cpu_cc_compute_all(CPUX86State *env1, int op)
-{
- CPUX86State *saved_env;
- uint32_t ret;
-
- saved_env = env;
- env = env1;
- ret = helper_cc_compute_all(op);
- env = saved_env;
- return ret;
-}
-
-uint32_t helper_cc_compute_c(int op)
-{
- switch (op) {
- default: /* should never happen */ return 0;
-
- case CC_OP_EFLAGS: return compute_c_eflags();
-
- case CC_OP_MULB: return compute_c_mull();
- case CC_OP_MULW: return compute_c_mull();
- case CC_OP_MULL: return compute_c_mull();
-
- case CC_OP_ADDB: return compute_c_addb();
- case CC_OP_ADDW: return compute_c_addw();
- case CC_OP_ADDL: return compute_c_addl();
-
- case CC_OP_ADCB: return compute_c_adcb();
- case CC_OP_ADCW: return compute_c_adcw();
- case CC_OP_ADCL: return compute_c_adcl();
-
- case CC_OP_SUBB: return compute_c_subb();
- case CC_OP_SUBW: return compute_c_subw();
- case CC_OP_SUBL: return compute_c_subl();
-
- case CC_OP_SBBB: return compute_c_sbbb();
- case CC_OP_SBBW: return compute_c_sbbw();
- case CC_OP_SBBL: return compute_c_sbbl();
-
- case CC_OP_LOGICB: return compute_c_logicb();
- case CC_OP_LOGICW: return compute_c_logicw();
- case CC_OP_LOGICL: return compute_c_logicl();
-
- case CC_OP_INCB: return compute_c_incl();
- case CC_OP_INCW: return compute_c_incl();
- case CC_OP_INCL: return compute_c_incl();
-
- case CC_OP_DECB: return compute_c_incl();
- case CC_OP_DECW: return compute_c_incl();
- case CC_OP_DECL: return compute_c_incl();
-
- case CC_OP_SHLB: return compute_c_shlb();
- case CC_OP_SHLW: return compute_c_shlw();
- case CC_OP_SHLL: return compute_c_shll();
-
- case CC_OP_SARB: return compute_c_sarl();
- case CC_OP_SARW: return compute_c_sarl();
- case CC_OP_SARL: return compute_c_sarl();
-
-#ifdef TARGET_X86_64
- case CC_OP_MULQ: return compute_c_mull();
-
- case CC_OP_ADDQ: return compute_c_addq();
-
- case CC_OP_ADCQ: return compute_c_adcq();
-
- case CC_OP_SUBQ: return compute_c_subq();
-
- case CC_OP_SBBQ: return compute_c_sbbq();
-
- case CC_OP_LOGICQ: return compute_c_logicq();
-
- case CC_OP_INCQ: return compute_c_incl();
-
- case CC_OP_DECQ: return compute_c_incl();
-
- case CC_OP_SHLQ: return compute_c_shlq();
-
- case CC_OP_SARQ: return compute_c_sarl();
-#endif
- }
-}
+++ /dev/null
-/*
- * Host-side implementation of GL/GLX API
- *
- * Copyright (c) 2006,2007 Even Rouault
- *
- * modified by:
- * Gordon Williams <gordon.williams@collabora.co.uk>
- * Ian Molton <ian.molton@collabora.co.uk>
- *
- * 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
- * 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 <stdlib.h>
-#include <assert.h>
-#include <string.h>
-#include <stdint.h>
-#include <sys/types.h> /* for pid_t */
-
-#include "qemu-common.h"
-
-/* GW: dyngen-exec.h defines its own version of stuff that is in stdio.h -
- only it misses things and is mildly different to stdio \o/. Hence
- don't include stdio and make our own defines. */
-
-/*
-#ifdef DEBUG_GL
-#ifdef _WIN32
-#define DEBUGF(...) printf(__VA_ARGS__)
-#else
-#define DEBUGF(...) fprintf(stderr, __VA_ARGS__)
-#endif
-#else
-#define DEBUGF(...) while(0) {printf(__VA_ARGS__); }
-#endif
-*/
-#include "tizen/src/debug_ch.h"
-MULTI_DEBUG_CHANNEL(qemu, opengl);
-#define DEBUGF TRACE
-
-#define GL_GLEXT_PROTOTYPES
-#define GLX_GLXEXT_PROTOTYPES
-#include <mesa_gl.h>
-
-#include "opengl_func.h"
-#include "mesa_mipmap.h"
-#include "opengl_process.h"
-#include "range_alloc.h"
-#include "gloffscreen.h"
-
-
-/** Misc X11/GLX defines - we don't want to include the whole files for these
- * as we need them on Windows too */
-typedef int Bool;
-const Bool True = 1;
-const Bool False;
-typedef struct __GLXFBConfigRec GLXFBConfig;
-struct __GLXFBConfigRec {
- int formatFlags;
-};
-
-#define GLX_VENDOR 1
-#define GLX_VERSION 2
-#define GLX_EXTENSIONS 3
-
-/* We'll say the XVisual Id is actually just an index into here */
-const GLXFBConfig FBCONFIGS[] = {
- {GLO_FF_ALPHA|GLO_FF_BITS_32},
- {GLO_FF_ALPHA|GLO_FF_BITS_32|GLO_FF_DEPTH_24},
- {GLO_FF_ALPHA|GLO_FF_BITS_32|GLO_FF_DEPTH_24|GLO_FF_STENCIL_8},
-/*
- {GLO_FF_BITS_32},
- {GLO_FF_BITS_32|GLO_FF_DEPTH_24},
- {GLO_FF_BITS_32|GLO_FF_DEPTH_24|GLO_FF_STENCIL_8},
-
- {GLO_FF_BITS_24},
- {GLO_FF_BITS_24|GLO_FF_DEPTH_24},
- {GLO_FF_BITS_24|GLO_FF_DEPTH_24|GLO_FF_STENCIL_8},
-*/
-/*
- {GLO_FF_BITS_16},
- {GLO_FF_BITS_16|GLO_FF_DEPTH_24},
- {GLO_FF_BITS_16|GLO_FF_DEPTH_24|GLO_FF_STENCIL_8},*/
-};
-
-#define FAKE_GL_VENDOR "QEMU"
-#define FAKE_GL_RENDERER "VMGL Passthrough"
-#define FAKE_GL_VERSION "1.4"
-#define FAKE_GL_MAJOR 1
-
-
-#define FAKE_GLX_VENDOR "QEMU"
-#define FAKE_GLX_VERSION_STRING "1.2"
-#define FAKE_GLX_VERSION_MAJOR 1
-#define FAKE_GLX_VERSION_MINOR 2
-
-/*#define glGetError() 0*/
-
-#ifdef WIN32
-# define CCONV _stdcall /* DLL entry points are WINAPI */
-#else
-# define CCONV
-#endif
-
-#define GET_EXT_PTR(type, funcname, args_decl) \
- static int detect_##funcname; \
- static type CCONV (*ptr_func_##funcname)args_decl; \
- if (detect_##funcname == 0) { \
- detect_##funcname = 1; \
- ptr_func_##funcname = \
- (type CCONV (*)args_decl)glo_getprocaddress( \
- (const char *)#funcname); \
- assert(ptr_func_##funcname); \
- }
-
-#define GET_EXT_PTR_NO_FAIL(type, funcname, args_decl) \
- static int detect_##funcname; \
- static type CCONV (*ptr_func_##funcname)args_decl; \
- if (detect_##funcname == 0) { \
- detect_##funcname = 1; \
- ptr_func_##funcname = \
- (type CCONV (*)args_decl)glo_getprocaddress( \
- (const char *)#funcname); \
- }
-
-#ifndef WIN32
-#include <dlfcn.h>
-#endif
-
-static void *get_glu_ptr(const char *name)
-{
- static void *handle = (void *) -1;
-
- if (handle == (void *) -1) {
-#ifndef WIN32
- handle = dlopen("libGLU.so", RTLD_LAZY);
- if (!handle) {
- DEBUGF("can't load libGLU.so : %s\n", dlerror());
- }
-#else
- handle = (void *)LoadLibrary("glu32.dll");
- if (!handle) {
- DEBUGF("can't load glu32.dll\n");
- }
-#endif
- }
- if (handle) {
-#ifndef WIN32
- return dlsym(handle, name);
-#else
- return GetProcAddress(handle, name);
-#endif
- }
- return NULL;
-}
-
-#define GET_GLU_PTR(type, funcname, args_decl) \
- static int detect_##funcname; \
- static type CCONV (*ptr_func_##funcname)args_decl; \
- if (detect_##funcname == 0) { \
- detect_##funcname = 1; \
- ptr_func_##funcname = \
- (type CCONV (*)args_decl)get_glu_ptr(#funcname); \
- }
-
-int display_function_call;
-extern int kill_process;
-
-typedef struct {
- void *key;
- void *value;
-} Assoc;
-
-#define MAX_HANDLED_PROCESS 100
-#define MAX_ASSOC_SIZE 100
-
-#define MAX_FBCONFIG 32
-
-#define MAX_PENDING_DRAWABLE 8
-
-#define MAX(a, b) (((a) > (b)) ? (a) : (b))
-#define DIM(X) (sizeof(X) / sizeof(X[0]))
-
-typedef struct {
- GLbitfield mask;
- int activeTextureIndex;
-} ClientState;
-
-#define MAX_CLIENT_STATE_STACK_SIZE 16
-
-typedef uint32_t ClientGLXDrawable;
-
-typedef struct GLState GLState;
-
-enum {
- SURFACE_WINDOW,
- SURFACE_PIXMAP,
- SURFACE_PBUFFER,
-};
-
-enum {
- SURFACE_PENDING, /* Created with light-weight context */
- SURFACE_ACTIVE, /* Ready after MakeCurrent */
-};
-
-typedef struct QGloSurface {
- GLState *glstate;
- GloSurface *surface;
- ClientGLXDrawable client_drawable;
- int type; /* window, pixmap or pbuffer */
- int ready;
- int status;
- int ref;
- QTAILQ_ENTRY(QGloSurface) next;
-} QGloSurface;
-
-#define MAX_PIXMAP_TEXTURE 32
-typedef struct PixmapTexture {
- unsigned int used;
- unsigned int texture;
- ClientGLXDrawable drawable;
-} PixmapTexture;
-
-struct GLState {
- int ref;
- int fake_ctxt;
- int fake_shareList;
-
- GloContext *context; /* context (owned by this) */
- QGloSurface *current_qsurface; /* current rendering surface/drawable */
- QTAILQ_HEAD(, QGloSurface) qsurfaces; /* list of surfaces/drawables for */
- /* this context */
-
- void *vertexPointer;
- void *normalPointer;
- void *colorPointer;
- void *secondaryColorPointer;
- void *indexPointer;
- void *texCoordPointer[NB_MAX_TEXTURES];
- void *edgeFlagPointer;
- void *vertexAttribPointer[MY_GL_MAX_VERTEX_ATTRIBS_ARB];
- void *vertexAttribPointerNV[MY_GL_MAX_VERTEX_ATTRIBS_NV];
- void *weightPointer;
- void *matrixIndexPointer;
- void *fogCoordPointer;
- void *variantPointerEXT[MY_GL_MAX_VARIANT_POINTER_EXT];
- void *interleavedArrays;
- void *elementPointerATI;
-
- int vertexPointerSize;
- int normalPointerSize;
- int colorPointerSize;
- int secondaryColorPointerSize;
- int indexPointerSize;
- int texCoordPointerSize[NB_MAX_TEXTURES];
- int edgeFlagPointerSize;
- int vertexAttribPointerSize[MY_GL_MAX_VERTEX_ATTRIBS_ARB];
- int vertexAttribPointerNVSize[MY_GL_MAX_VERTEX_ATTRIBS_NV];
- int weightPointerSize;
- int matrixIndexPointerSize;
- int fogCoordPointerSize;
- int variantPointerEXTSize[MY_GL_MAX_VARIANT_POINTER_EXT];
- int interleavedArraysSize;
- int elementPointerATISize;
-
- int selectBufferSize;
- void *selectBufferPtr;
- int feedbackBufferSize;
- void *feedbackBufferPtr;
-
- ClientState clientStateStack[MAX_CLIENT_STATE_STACK_SIZE];
- int clientStateSp;
- int activeTextureIndex;
-
- unsigned int ownTabTextures[32768];
- unsigned int *tabTextures;
- /* The mapping between the texture and pixmap used as texture */
- PixmapTexture pixmapTextures[MAX_PIXMAP_TEXTURE];
- unsigned int bindTexture2D;
- RangeAllocator ownTextureAllocator;
- RangeAllocator *textureAllocator;
-
- unsigned int ownTabBuffers[32768];
- unsigned int *tabBuffers;
- RangeAllocator ownBufferAllocator;
- RangeAllocator *bufferAllocator;
-
- unsigned int ownTabLists[32768];
- unsigned int *tabLists;
- RangeAllocator ownListAllocator;
- RangeAllocator *listAllocator;
-
-};
-
-typedef struct {
- ProcessStruct p;
-
- int next_available_context_number;
-
- int nb_states;
- GLState default_state;
- GLState **glstates;
- GLState *current_state;
-
- /* Pending drawables that will be used as texture */
- ClientGLXDrawable pending_drawables[MAX_PENDING_DRAWABLE];
-
- /* Created Pixmap surfaces, will link to context in MakeCurrent */
- QGloSurface **pending_qsurfaces;
- int nb_qsurf;
-
- /* Number of FB configs sets allocated on behalf of this process */
- int nfbconfig;
-
- /* Array of FB configs sets */
- const GLXFBConfig *fbconfigs[MAX_FBCONFIG];
-
- /* Number of FB configs per set */
- int fbconfigs_max[MAX_FBCONFIG];
-
- /* Total number of FB configs allocated on behalf of this process */
- int nfbconfig_total;
-
- int primitive;
- int bufsize;
- int bufstart;
- arg_t *cmdbuf;
-} ProcessState;
-
-static ProcessState processes[MAX_HANDLED_PROCESS];
-
-static char *strip_extensions(const char *avail, const char *ext[])
-{
- char *pos, *supported, *srcp;
-
- supported = (char *)g_malloc(strlen(avail) + 2);
-
- pos = supported;
- while (*ext) {
- srcp = (char *)avail;
- while ((srcp = strstr(srcp, *ext))) {
- int len = strlen(*ext);
- if (*(srcp + len) == ' ' || *(srcp + len) == '\0') {
- strcpy(pos, *ext);
- pos += len;
- if (*(srcp + len) == ' ') {
- *pos = ' ';
- pos++;
- }
- break;
- }
- srcp += len;
- }
- ext++;
- }
- *pos = ' ';
- *pos = '\0';
-
- return supported;
-}
-
-extern void vmgl_context_switch(ProcessStruct *p,
- int switch_gl_context);
-extern ProcessStruct *vmgl_get_process(pid_t pid);
-extern void gl_disconnect(ProcessState *process);
-extern int do_function_call(ProcessState *process,
- int func_number,
- unsigned long *args,
- char *ret_string);
-
-static const char *glx_ext_supported[] = {
- "GLX_ARB_multisample",
- 0
-};
-
-static char *supported_glx_extensions(void)
-{
- static char *supported;
-
- if (!supported) {
- supported = strip_extensions(glo_glXQueryExtensionsString(),
- glx_ext_supported);
- }
-
- return supported;
-}
-
-static const char *gl_ext_supported[] = {
-/* Mandatory OpenGL 1.4 Extensions */
- "GL_ARB_depth_texture",
- "GL_ARB_multisample",
- "GL_ARB_multitexture",
- "GL_ARB_point_parameters",
- "GL_ARB_shadow",
- "GL_ARB_texture_border_clamp",
- "GL_ARB_texture_compression",
- "GL_ARB_texture_cube_map",
- "GL_ARB_texture_env_add",
- "GL_ARB_texture_env_combine",
- "GL_ARB_texture_env_crossbar",
- "GL_ARB_texture_env_dot3",
- "GL_ARB_texture_mirrored_repeat",
- "GL_ARB_transpose_matrix",
- "GL_ARB_window_pos",
- "GL_EXT_bgra",
- "GL_EXT_blend_color",
- "GL_EXT_blend_func_separate",
- "GL_EXT_blend_logic_op",
- "GL_EXT_blend_minmax",
- "GL_EXT_blend_subtract",
- "GL_EXT_copy_texture",
- "GL_EXT_draw_range_elements",
- "GL_EXT_fog_coord",
- "GL_EXT_multi_draw_arrays",
- "GL_EXT_packed_pixels",
- "GL_EXT_point_parameters",
- "GL_EXT_polygon_offset",
- "GL_EXT_rescale_normal",
- "GL_EXT_secondary_color",
- "GL_EXT_separate_specular_color",
- "GL_EXT_stencil_wrap",
- "GL_EXT_subtexture",
- "GL_EXT_texture",
- "GL_EXT_texture3D",
- "GL_EXT_texture_edge_clamp",
- "GL_EXT_texture_env_add",
- "GL_EXT_texture_env_combine",
- "GL_EXT_texture_lod",
- "GL_EXT_texture_lod_bias",
- "GL_EXT_texture_object",
- "GL_APPLE_packed_pixels",
- "GL_NV_blend_square",
- "GL_SGIS_generate_mipmap",
- "GL_SGIS_texture_border_clamp",
- "GL_SGIS_texture_edge_clamp",
- "GL_SGIS_texture_lod",
-/* Optional extensions. If you get problems try disabling the below. */
- "GL_EXT_compiled_vertex_array",
- "GL_ARB_copy_buffer",
- "GL_ARB_depth_clamp",
- "GL_ARB_draw_buffers ",
- "GL_ARB_draw_elements_base_vertex",
- "GL_ARB_fragment_program",
- "GL_ARB_fragment_program_shadow",
- "GL_ARB_fragment_shader",
- "GL_ARB_framebuffer_object",
- "GL_ARB_half_float_pixel",
- "GL_ARB_map_buffer_range",
- "GL_ARB_occlusion_query",
- "GL_ARB_pixel_buffer_object",
- "GL_ARB_point_sprite",
- "GL_ARB_provoking_vertex",
- "GL_ARB_seamless_cube_map",
- "GL_ARB_shader_objects",
- "GL_ARB_shading_language_100",
- "GL_ARB_shading_language_120",
- "GL_ARB_sync",
- "GL_ARB_texture_non_power_of_two",
- "GL_ARB_texture_rectangle",
- "GL_ARB_vertex_array_bgra",
- "GL_ARB_vertex_array_object",
- "GL_ARB_vertex_buffer_object",
- "GL_ARB_vertex_program",
- "GL_ARB_vertex_shader,"
- "GL_EXT_abgr",
- "GL_EXT_blend_equation_separate",
- "GL_EXT_cull_vertex",
- "GL_EXT_framebuffer_blit",
- "GL_EXT_framebuffer_object",
- "GL_EXT_gpu_program_parameters",
- "GL_EXT_packed_depth_stencil",
- "GL_EXT_pixel_buffer_object",
- "GL_EXT_provoking_vertex",
- "GL_EXT_shadow_funcs",
- "GL_EXT_stencil_two_side",
- "GL_EXT_texture_cube_map",
- "GL_EXT_texture_env_dot3",
- "GL_EXT_texture_filter_anisotropic",
- "GL_EXT_texture_rectangle",
- "GL_EXT_texture_sRGB",
- "GL_EXT_texture_swizzle",
- "GL_EXT_vertex_array",
- "GL_EXT_vertex_array_bgra",
- "GL_3DFX_texture_compression_FXT1",
- "GL_APPLE_client_storage",
- "GL_APPLE_vertex_array_object",
- "GL_ATI_blend_equation_separate",
- "GL_ATI_envmap_bumpmap",
- "GL_ATI_texture_env_combine3",
- "GL_ATI_separate_stencil",
- "GL_IBM_multimode_draw_arrays",
- "GL_IBM_rasterpos_clip",
- "GL_IBM_texture_mirrored_repeat",
- "GL_INGR_blend_func_separate",
- "GL_MESA_pack_invert",
- "GL_MESA_texture_signed_rgba",
- "GL_MESA_ycbcr_texture",
- "GL_MESA_window_pos",
- "GL_NV_depth_clamp",
- "GL_NV_light_max_exponent",
- "GL_NV_packed_depth_stencil",
- "GL_NV_texture_env_combine4",
- "GL_NV_texture_rectangle",
- "GL_NV_texgen_reflection",
- "GL_NV_vertex_program",
- "GL_NV_vertex_program1_1",
- "GL_OES_read_format",
- "GL_SUN_multi_draw_arrays",
- 0
-};
-
-static char *compute_gl_extensions(void)
-{
- static char *supported;
-
- if (!supported) {
- supported = strip_extensions((const char *)glGetString(GL_EXTENSIONS),
- gl_ext_supported);
- }
-
- return supported;
-}
-
-static inline QGloSurface *get_qsurface_from_client_drawable(GLState *state,
- ClientGLXDrawable client_drawable)
-{
- QGloSurface *qsurface;
-
- if (state->current_qsurface &&
- state->current_qsurface->client_drawable == client_drawable) {
- return state->current_qsurface;
- }
-
- QTAILQ_FOREACH(qsurface, &state->qsurfaces, next) {
- if (qsurface->client_drawable == client_drawable) {
- return qsurface;
- }
- }
-
- return NULL;
-}
-
-/* This must always be called only on surfaces
- belonging to the current context */
-static inline void render_surface(QGloSurface *qsurface,
- int bpp, int stride, char *buffer)
-{
- int w, h;
- if (!qsurface->ready) {
- return;
- }
-
- glo_surface_get_size(qsurface->surface, &w, &h);
-
- glo_surface_getcontents(qsurface->surface, stride, bpp, buffer);
-}
-
-static void qsurface_pixmap_ref(QGloSurface *qsurface)
-{
- if (!qsurface) {
- DEBUGF("%s %p\n", __func__, qsurface);
- return;
- }
-
- if (qsurface->type != SURFACE_PIXMAP) {
- DEBUGF("%s %p is not a pixmap\n", __func__, qsurface);
- return;
- }
-
- qsurface->ref++;
- DEBUGF("%s %p references increased to %d\n",
- __func__, qsurface, qsurface->ref);
-}
-
-static void qsurface_pixmap_unref(QGloSurface *qsurface)
-{
- if (!qsurface) {
- DEBUGF("%s %p\n", __func__, qsurface);
- return;
- }
-
- if (qsurface->type != SURFACE_PIXMAP) {
- DEBUGF("%s %p is not a pixmap\n", __func__, qsurface);
- return;
- }
-
- qsurface->ref--;
- DEBUGF("%s %p references decreased to %d\n",
- __func__, qsurface, qsurface->ref);
-
- if (qsurface->ref == 0) {
- glo_surface_destroy(qsurface->surface);
- g_free(qsurface);
- DEBUGF("%s freed: %p\n", __func__, qsurface);
- }
-}
-
-static void state_set_current_surface(GLState *state, QGloSurface *qsurface)
-{
- if (state->current_qsurface != NULL) {
- qsurface_pixmap_unref(state->current_qsurface);
- }
-
- if (qsurface != NULL) {
- qsurface_pixmap_ref(qsurface);
- }
-
- state->current_qsurface = qsurface;
-}
-
-/* This must always be called only on surfaces
- belonging to the current context */
-static inline void resize_surface(ProcessState *process,
- QGloSurface *qsurface,
- int w,
- int h)
-{
- GLState *glstate = qsurface->glstate;
- GloSurface *old_surface = qsurface->surface;
- GloSurface *surface;
-
- DEBUGF("resize_start\n");
-
- glo_surface_destroy(old_surface);
-
- surface = glo_surface_create(w, h, glstate->context);
- qsurface->surface = surface;
-
- /* Client doesnt know surface is new - need to MakeCurrent */
- if (process->current_state == qsurface->glstate) {
- glo_surface_makecurrent(qsurface->surface);
- /* set the viewport while the window size is changed. It is needed
- especially for the case that glViewport is not explicitly called
- in program. In this case, the viewport is set to incorrectly
- in the first MakeCurrent when the window size is not known.
- It will not impact normal GL programs with glViewport set as
- programmers want. */
- glViewport(0, 0, w, h);
- } else {
- DEBUGF("Error: Surface is not current! %p %p\n",
- process->current_state,
- process->current_state->current_qsurface);
- exit(1);
- }
-
- glstate->current_qsurface->ready = 1;
- DEBUGF("resize_done\n");
-}
-
-
-static void init_process_tab(void)
-{
- memset(processes, 0, sizeof(processes));
-}
-
-#define ARG_TO_CHAR(x) (char)(long)(x)
-#define ARG_TO_UNSIGNED_CHAR(x) (unsigned char)(long)(x)
-#define ARG_TO_SHORT(x) (short)(long)(x)
-#define ARG_TO_UNSIGNED_SHORT(x) (unsigned short)(long)(x)
-#define ARG_TO_INT(x) (int)(long)(x)
-#define ARG_TO_UNSIGNED_INT(x) (unsigned int)(long)(x)
-#define ARG_TO_FLOAT(x) (*(float *)&(x))
-#define ARG_TO_DOUBLE(x) (*(double *)(x))
-
-#include "server_stub.c"
-
-static inline ClientGLXDrawable to_drawable(arg_t arg)
-{
-#ifdef TARGET_X86_64
- if (arg > (unsigned long) -1) {
- DEBUGF("GLXDrawable too big for this implementation\n");
- exit(-1);
- }
-#endif
- return (ClientGLXDrawable)arg;
-}
-
-/* ---- */
-
-/* Bind a qsurface to a context (GLState) */
-static void bind_qsurface(GLState *state,
- QGloSurface *qsurface)
-{
- DEBUGF("%s qsurface %p qsurface->glstate %p new state %p\n",
- __func__, qsurface, qsurface->glstate, state);
- qsurface->glstate = state;
-
- if (qsurface->type == SURFACE_WINDOW) {
- QTAILQ_INSERT_HEAD(&state->qsurfaces, qsurface, next);
- }
-
- state_set_current_surface(state, qsurface);
-}
-
-/* Unbind a qsurface from a context (GLState) */
-static void unbind_qsurface(GLState *state,
- QGloSurface *qsurface)
-{
- if (!state || !qsurface) {
- DEBUGF("%s invalid parameter, state %p, qsurface %p\n",
- __func__, state, qsurface);
- return;
- }
-
- DEBUGF("%s qsurface %p qsurface->glstate %p old state %p\n",
- __func__, qsurface, qsurface->glstate, state);
- qsurface->glstate = NULL;
-
- if (qsurface->type == SURFACE_WINDOW) {
- QTAILQ_REMOVE(&state->qsurfaces, qsurface, next);
- }
-
- if (state->current_qsurface == qsurface) {
- state_set_current_surface(state, NULL);
- }
-}
-
-/* Find the qsurface with required drawable in all pixmap/pbuffer surfaces */
-static QGloSurface *find_qsurface_from_client_drawable(ProcessState *process,
- ClientGLXDrawable client_drawable)
-{
- int i;
- QGloSurface *qsurface;
-
- for (i = 0; i < process->nb_qsurf; i++) {
- qsurface = process->pending_qsurfaces[i];
- if (qsurface && qsurface->client_drawable == client_drawable) {
- return qsurface;
- }
- }
-
- return NULL;
-}
-
-/* Make the appropriate qsurface current for a given client_drawable */
-static int set_current_qsurface(GLState *state,
- ClientGLXDrawable client_drawable)
-{
- QGloSurface *qsurface;
-
- if (state->current_qsurface
- && state->current_qsurface->client_drawable == client_drawable) {
- return 1;
- }
-
- QTAILQ_FOREACH(qsurface, &state->qsurfaces, next) {
- if (qsurface->client_drawable == client_drawable) {
- state_set_current_surface(state, qsurface);
- qsurface->glstate = state;
- return 1;
- }
- }
-
- state_set_current_surface(state, NULL);
-
- return 0;
-}
-
-/* */
-static int keep_drawable(ProcessState *process, ClientGLXDrawable drawable)
-{
- int i;
- for (i = 0; i < MAX_PENDING_DRAWABLE; i++) {
- if (process->pending_drawables[i] == 0) {
- process->pending_drawables[i] = drawable;
- return 1;
- }
- }
- return 0;
-}
-
-static int link_drawable(ProcessState *process, ClientGLXDrawable drawable)
-{
- int i;
- for (i = 0; i < MAX_PENDING_DRAWABLE; i++) {
- if (process->pending_drawables[i] == drawable) {
- process->pending_drawables[i] = 0;
- return 1;
- }
- }
- return 0;
-}
-
-/* Need to create pixmap/pbuffer surface when guest do so, as guest may use it
- * before MakeCurrent. As no context available at this point, do the following:
- * 1. Create one light-weight context just for surface creation.
- * 2. Store this qsurface, and link it with right context when MakeCurrent
- */
-static void keep_qsurface(ProcessState *process, QGloSurface *qsurface)
-{
- process->pending_qsurfaces =
- g_realloc(process->pending_qsurfaces,
- (process->nb_qsurf + 1) * sizeof(QGloSurface *));
-
- process->pending_qsurfaces[process->nb_qsurf] = qsurface;
-
- process->nb_qsurf++;
-}
-
-static int link_qsurface(ProcessState *process,
- GLState *glstate,
- ClientGLXDrawable client_drawable)
-{
- int i;
- QGloSurface *qsurface;
- for (i = 0; i < process->nb_qsurf; i++) {
- qsurface = process->pending_qsurfaces[i];
- if (qsurface && qsurface->client_drawable == client_drawable) {
- /* XXX:Current limitation is that each surface is binded to one
- * context, and not accessible from another context. It's hard for
- * glEGLImageTargetTexture2DOES implementation, in which we need
- * find a pixmap surface from another context that is not owner of
- * this pixmap. So do not move this pending pixmap surface into
- * current context. In future need decople of surface and context.
- * */
-#if 0
- memmove(&process->pending_qsurfaces[i],
- &process->pending_qsurfaces[i+1],
- (process->nb_qsurf - i - 1) * sizeof(QGloSurface *));
-#endif
-
- if (qsurface->type != SURFACE_PIXMAP) {
- DEBUGF("%s Forcing non pixmap qsurface->ref to 1"
- " (type %d, ref %d)\n",
- __func__, qsurface->type, qsurface->ref);
- qsurface->ref = 1;
- }
- if (qsurface->status == SURFACE_PENDING) {
- glo_surface_update_context(qsurface->surface,
- glstate->context, 1);
- qsurface->status = SURFACE_ACTIVE;
- } else {
- unbind_qsurface(qsurface->glstate, qsurface);
- glo_surface_update_context(qsurface->surface,
- glstate->context, 0);
- }
-
- bind_qsurface(glstate, qsurface);
- return 1;
- }
- }
-
- return 0;
-}
-
-/* Pixmap and Pbuffer can be used as texture via glEGLImageTargetTexture2DOES
- * and glXBindTexImage, so need keep the mapping between them to add proper
- * action when bind the texture again
- */
-static void del_pixmap_texture_mapping(GLState *state,
- unsigned int texture)
-{
- int i;
- for (i = 0; i < MAX_PIXMAP_TEXTURE; i++) {
- if (state->pixmapTextures[i].used &&
- state->pixmapTextures[i].texture == texture) {
- state->pixmapTextures[i].used = 0;
- state->pixmapTextures[i].texture = 0;
- state->pixmapTextures[i].drawable = 0;
- return;
- }
- }
-}
-
-static void remove_pixmap_texture_mapping(GLState *state,
- ClientGLXDrawable drawable)
-{
- int i;
- for (i = 0; i < MAX_PIXMAP_TEXTURE; i++) {
- if (state->pixmapTextures[i].used &&
- state->pixmapTextures[i].drawable == drawable) {
- state->pixmapTextures[i].used = 0;
- state->pixmapTextures[i].texture = 0;
- state->pixmapTextures[i].drawable = 0;
- return;
- }
- }
-}
-
-static int add_pixmap_texture_mapping(GLState *state,
- unsigned int texture, ClientGLXDrawable drawable)
-{
- int i;
- for (i = 0; i < MAX_PIXMAP_TEXTURE; i++) {
- if (state->pixmapTextures[i].texture == texture ||
- !state->pixmapTextures[i].used) {
- state->pixmapTextures[i].used = 1;
- state->pixmapTextures[i].texture = texture;
- state->pixmapTextures[i].drawable = drawable;
- return 1;
- }
- }
-
- return 0;
-}
-
-static ClientGLXDrawable find_pixmap_texture(GLState *state,
- unsigned int texture)
-{
- int i;
- for (i = 0; i < MAX_PIXMAP_TEXTURE; i++) {
- if (state->pixmapTextures[i].used &&
- state->pixmapTextures[i].texture == texture) {
- return state->pixmapTextures[i].drawable;
- }
- }
-
- return 0;
-}
-
-static int get_server_texture(ProcessState *process,
- unsigned int client_texture)
-{
- unsigned int server_texture = 0;
-
- if (client_texture < 32768) {
- server_texture = process->current_state->tabTextures[client_texture];
- } else {
- DEBUGF("invalid texture name %d\n", client_texture);
- }
- return server_texture;
-}
-
-static int get_server_buffer(ProcessState *process,
- unsigned int client_buffer)
-{
- unsigned int server_buffer = 0;
-
- if (client_buffer < 32768) {
- server_buffer = process->current_state->tabBuffers[client_buffer];
- } else {
- DEBUGF("invalid buffer name %d\n", client_buffer);
- }
- return server_buffer;
-}
-
-
-static int get_server_list(ProcessState *process, unsigned int client_list)
-{
- unsigned int server_list = 0;
-
- if (client_list < 32768) {
- server_list = process->current_state->tabLists[client_list];
- } else {
- DEBUGF("invalid list name %d\n", client_list);
- }
- return server_list;
-}
-
-static const GLXFBConfig *get_fbconfig(ProcessState *process,
- int client_fbconfig)
-{
- int i;
-
- /* The client_fbconfig returned to upper layers is 1 + the index of the
- * fb config in the set that contains it, + the number of fb configs
- * store in previously allocated sets. */
- int nbtotal = 0;
-
- /* For each set */
- for (i = 0; i < process->nfbconfig; i++) {
- /* If the fb config is stored within this set, return it */
- if (client_fbconfig <= nbtotal + process->fbconfigs_max[i]) {
- return &process->fbconfigs[i][client_fbconfig - 1 - nbtotal];
- }
- /* Otherwise proceed to next set */
- nbtotal += process->fbconfigs_max[i];
- }
- return 0;
-}
-
-static int glXChooseVisualFunc(const int *attrib_list)
-{
- if (attrib_list == NULL) {
- return 0;
- }
-
- int formatFlags = glo_flags_get_from_glx(attrib_list, True);
- int i;
- int bestConfig = 0;
- int bestScore = -1;
-
- for (i = 0; i < DIM(FBCONFIGS); i++) {
- int score = glo_flags_score(formatFlags, FBCONFIGS[i].formatFlags);
- if (bestScore < 0 || score <= bestScore) {
- bestScore = score;
- bestConfig = i;
- }
- }
-
- if (bestScore > 0) {
- DEBUGF("Got format flags %d but we couldn't find "
- "an exactly matching config, chose %d\n",
- formatFlags, bestConfig);
- }
-
- return bestConfig;
-}
-
-static int glXGetConfigFunc(int visualid, int attrib, int *value)
-{
- const GLXFBConfig *config = &FBCONFIGS[0]; /* default */
- int v;
-
- if (visualid >= 0 && visualid < DIM(FBCONFIGS)) {
- config = &FBCONFIGS[visualid];
- } else {
- DEBUGF("Unknown visual ID %d\n", visualid);
- }
-
- v = glo_get_glx_from_flags(config->formatFlags, attrib);
- if (value) {
- *value = v;
- }
- return 0;
-}
-
-static const GLXFBConfig *glXGetFBConfigsFunc(int screen, int *nelements)
-{
- *nelements = DIM(FBCONFIGS);
- return &FBCONFIGS[0];
-}
-
-static int glXGetFBConfigAttribFunc(const GLXFBConfig *fbconfig,
- int attrib, int *value)
-{
- /* TODO other enums -
- * see http://www.opengl.org/sdk/docs/man/xhtml/glXGetFBConfigAttrib.xml
- */
-
- int v = glo_get_glx_from_flags(fbconfig->formatFlags, attrib);
- if (value) {
- *value = v;
- }
- return 0;
-}
-
-static const GLXFBConfig *glXChooseFBConfigFunc(int screen,
- const int *attrib_list,
- int *nelements)
-{
- if (attrib_list != NULL) {
- int formatFlags = glo_flags_get_from_glx(attrib_list, False);
- int i;
- int bestConfig = 0;
- int bestScore = -1;
-
- for (i = 0; i < DIM(FBCONFIGS); i++) {
- int score = glo_flags_score(formatFlags, FBCONFIGS[i].formatFlags);
- if (bestScore < 0 || score <= bestScore) {
- bestScore = score;
- bestConfig = i;
- }
- }
-
- if (bestScore > 0) {
- DEBUGF("Got format flags %d but we couldn't find "
- "an exactly matching config, chose %d\n",
- formatFlags, bestConfig);
- }
-
- if (nelements) {
- *nelements = 1;
- }
-
- return &FBCONFIGS[bestConfig];
- }
-
- if (nelements) {
- *nelements = 0;
- }
-
- return 0;
-}
-
-static void do_glClientActiveTextureARB(int texture)
-{
- GET_EXT_PTR_NO_FAIL(void, glClientActiveTextureARB, (int));
-
- if (ptr_func_glClientActiveTextureARB) {
- ptr_func_glClientActiveTextureARB(texture);
- }
-}
-
-static void destroy_gl_state(GLState *state)
-{
- int i;
-
- QGloSurface *qsurface, *tmp;
-
- DEBUGF("%s state %p\n", __func__, state);
-
- QTAILQ_FOREACH_SAFE(qsurface, &state->qsurfaces, next, tmp) {
- glo_surface_destroy(qsurface->surface);
- QTAILQ_REMOVE(&state->qsurfaces, qsurface, next);
- g_free(qsurface);
- }
-
- if (state->context) {
- glo_context_destroy(state->context);
- }
-
- if (state->vertexPointer) {
- g_free(state->vertexPointer);
- }
- if (state->normalPointer) {
- g_free(state->normalPointer);
- }
- if (state->indexPointer) {
- g_free(state->indexPointer);
- }
- if (state->colorPointer) {
- g_free(state->colorPointer);
- }
- if (state->secondaryColorPointer) {
- g_free(state->secondaryColorPointer);
- }
- for (i = 0; i < NB_MAX_TEXTURES; i++) {
- if (state->texCoordPointer[i]) {
- g_free(state->texCoordPointer[i]);
- }
- }
- for (i = 0; i < MY_GL_MAX_VERTEX_ATTRIBS_ARB; i++) {
- if (state->vertexAttribPointer[i]) {
- g_free(state->vertexAttribPointer[i]);
- }
- }
- for (i = 0; i < MY_GL_MAX_VERTEX_ATTRIBS_NV; i++) {
- if (state->vertexAttribPointerNV[i]) {
- g_free(state->vertexAttribPointerNV[i]);
- }
- }
- if (state->weightPointer) {
- g_free(state->weightPointer);
- }
- if (state->matrixIndexPointer) {
- g_free(state->matrixIndexPointer);
- }
- if (state->fogCoordPointer) {
- g_free(state->fogCoordPointer);
- }
- for (i = 0; i < MY_GL_MAX_VARIANT_POINTER_EXT; i++) {
- if (state->variantPointerEXT[i]) {
- g_free(state->variantPointerEXT[i]);
- }
- }
- if (state->interleavedArrays) {
- g_free(state->interleavedArrays);
- }
- if (state->elementPointerATI) {
- g_free(state->elementPointerATI);
- }
-}
-
-static void init_gl_state(GLState *state)
-{
- state->textureAllocator = &state->ownTextureAllocator;
- state->tabTextures = state->ownTabTextures;
- state->bufferAllocator = &state->ownBufferAllocator;
- state->tabBuffers = state->ownTabBuffers;
- state->listAllocator = &state->ownListAllocator;
- state->tabLists = state->ownTabLists;
-}
-
-/*
- * Translate the nth element of list from type to GLuint.
- */
-static GLuint translate_id(GLsizei n, GLenum type, const GLvoid *list)
-{
- GLbyte *bptr;
- GLubyte *ubptr;
- GLshort *sptr;
- GLushort *usptr;
- GLint *iptr;
- GLuint *uiptr;
- GLfloat *fptr;
-
- switch (type) {
- case GL_BYTE:
- bptr = (GLbyte *)list;
- return (GLuint) *(bptr + n);
- case GL_UNSIGNED_BYTE:
- ubptr = (GLubyte *)list;
- return (GLuint) *(ubptr + n);
- case GL_SHORT:
- sptr = (GLshort *)list;
- return (GLuint) *(sptr + n);
- case GL_UNSIGNED_SHORT:
- usptr = (GLushort *)list;
- return (GLuint) *(usptr + n);
- case GL_INT:
- iptr = (GLint *)list;
- return (GLuint) *(iptr + n);
- case GL_UNSIGNED_INT:
- uiptr = (GLuint *)list;
- return (GLuint) *(uiptr + n);
- case GL_FLOAT:
- fptr = (GLfloat *)list;
- return (GLuint) *(fptr + n);
- case GL_2_BYTES:
- ubptr = ((GLubyte *)list) + 2 * n;
- return (GLuint) (*ubptr << 8) + (GLuint) *(ubptr + 1);
- case GL_3_BYTES:
- ubptr = ((GLubyte *)list) + 3 * n;
- return (GLuint) (*ubptr << 16) + (GLuint) (*(ubptr + 1) << 8) +
- (GLuint) *(ubptr + 2);
- case GL_4_BYTES:
- ubptr = ((GLubyte *)list) + 4 * n;
- return (GLuint) (*ubptr << 24) + (GLuint) (*(ubptr + 1) << 16) +
- (GLuint) (*(ubptr + 2) << 8) + (GLuint) *(ubptr + 3);
- default:
- return 0;
- }
-}
-
-static GLState *_create_context(ProcessState *process, int fake_ctxt)
-{
- GLState *state = g_try_malloc0(sizeof(GLState));
-
- if (state) {
- state->ref = 1;
- state->fake_ctxt = fake_ctxt;
- init_gl_state(state);
-
- /* FIXMEIM - realloc? really? */
- process->glstates = g_realloc(process->glstates,
- (process->nb_states + 1) * sizeof(GLState *));
-
- process->glstates[process->nb_states] = state;
-
- process->nb_states++;
- }
-
- DEBUGF("state %p fake_ctxt %08x process->nb_states %d\n",
- state, fake_ctxt, process->nb_states);
- return state;
-}
-
-static void set_context_sharelist(ProcessState *process,
- GLState *state,
- int fake_shareList)
-{
- state->fake_shareList = fake_shareList;
-
- if (fake_shareList) {
- int i;
-
- for (i = 0; i < process->nb_states; i++) {
- if (process->glstates[i]->fake_ctxt == fake_shareList) {
- process->glstates[i]->ref++;
- state->textureAllocator =
- process->glstates[i]->textureAllocator;
- state->tabTextures = process->glstates[i]->tabTextures;
- state->bufferAllocator =
- process->glstates[i]->bufferAllocator;
- state->tabBuffers = process->glstates[i]->tabBuffers;
- state->listAllocator = process->glstates[i]->listAllocator;
- state->tabLists = process->glstates[i]->tabLists;
- break;
- }
- }
- }
-}
-
-static GLState *get_glstate_for_fake_ctxt(ProcessState *process,
- int fake_ctxt)
-{
- int i;
- for (i = 0; i < process->nb_states; i++) {
- if (process->glstates[i]->fake_ctxt == fake_ctxt) {
- return process->glstates[i];
- }
- }
-
- return 0;
-}
-
-void gl_disconnect(ProcessState *process)
-{
- int i;
- for (i = 0; i < process->nb_states; i++) {
- destroy_gl_state(process->glstates[i]);
- g_free(process->glstates[i]);
- }
- destroy_gl_state(&process->default_state);
- g_free(process->glstates);
-
- if (process->cmdbuf) {
- g_free(process->cmdbuf);
- }
-
- for (i = 0; &processes[i] != process; i++) {
- /* do nothing */
- ;
- }
-
- memmove(&processes[i], &processes[i + 1],
- (MAX_HANDLED_PROCESS - 1 - i) * sizeof(ProcessState));
-}
-
-static const int beginend_allowed[GL_N_CALLS] = {
-#undef MAGIC_MACRO
-#define MAGIC_MACRO(name) [name##_func] = 1,
-#include "gl_beginend.h"
-};
-
-ProcessStruct *vmgl_get_process(pid_t pid)
-{
- ProcessState *process = NULL;
- static int first;
- int i;
-
- if (!first) {
- first = 1;
- init_process_tab();
- }
-
- /* Lookup a process stuct. If there isnt one associated with this pid
- * then we create one.
- * process->current_state contains info on which of the guests contexts is
- * current.
- */
- for (i = 0; i < MAX_HANDLED_PROCESS; i++) {
- if (processes[i].p.process_id == pid) {
- process = &processes[i];
- break;
- } else if (processes[i].p.process_id == 0) {
- process = &processes[i];
- memset(process, 0, sizeof(ProcessState));
- process->p.process_id = pid;
- init_gl_state(&process->default_state);
- process->current_state = &process->default_state;
- break;
- }
- }
-
- if (process == NULL) {
- DEBUGF("Too many processes !\n");
- exit(-1);
- }
-
- return (ProcessStruct *)process; /* Cast is ok due to struct defn. */
-}
-
-void vmgl_context_switch(ProcessStruct *p, int switch_gl_context)
-{
- ProcessState *process = (ProcessState *)p;
- if (switch_gl_context) {
- if (process->current_state->current_qsurface) {
- glo_surface_makecurrent(process->current_state->
- current_qsurface->surface);
- } else {
- glo_surface_makecurrent(0); /* should never happen */
- }
- }
-}
-
-static char *opengl_strtok(const char *s, int *n,
- char const **saveptr, char *prevbuf)
-{
- const char *start;
- char *ret;
- char *p;
- int retlen;
- static const char *delim = " \t\n\r/";
-
- if (prevbuf) {
- free(prevbuf);
- }
-
- if (s) {
- *saveptr = s;
- } else {
- if (!(*saveptr) || !(*n)) {
- return NULL;
- }
- s = *saveptr;
- }
-
- for (; *n && strchr(delim, *s); s++, (*n)--) {
- if (*s == '/' && *n > 1) {
- if (s[1] == '/') {
- do {
- s++, (*n)--;
- } while (*n > 1 && s[1] != '\n' && s[1] != '\r');
- } else if (s[1] == '*') {
- do {
- s++, (*n)--;
- } while (*n > 2 && (s[1] != '*' || s[2] != '/'));
- s++, (*n)--;
- s++, (*n)--;
- if (*n == 0) {
- break;
- }
- } else {
- break;
- }
- }
- }
-
- start = s;
- for (; *n && *s && !strchr(delim, *s); s++, (*n)--) {
- /* do nothing */
- ;
- }
-
- if (*n > 0) {
- s++, (*n)--;
- }
-
- *saveptr = s;
-
- retlen = s - start;
- ret = malloc(retlen + 1);
- p = ret;
-
- if (retlen == 0) {
- *p = 0;
- return ret;
- }
-
- while (retlen > 0) {
- if (*start == '/' && retlen > 1) {
- if (start[1] == '/') {
- do {
- start++, retlen--;
- } while (retlen > 1 && start[1] != '\n' && start[1] != '\r');
- start++, retlen--;
- continue;
- } else if (start[1] == '*') {
- do {
- start++, retlen--;
- } while (retlen > 2 && (start[1] != '*' || start[2] != '/'));
- start += 3, retlen -= 3;
- continue;
- }
- }
- *(p++) = *(start++), retlen--;
- }
-
- *p = 0;
- return ret;
-}
-
-static char *do_eglShaderPatch(const char *source, int length, int *patched_len)
-{
- const char *saveptr = NULL;
- char *sp;
- char *p = NULL;
-
- if (!length) {
- length = strlen(source);
- }
-
- *patched_len = 0;
- int patched_size = length;
- char *patched = malloc(patched_size + 1);
-
- if (!patched) {
- return NULL;
- }
-
- p = opengl_strtok(source, &length, &saveptr, NULL);
- for (; p; p = opengl_strtok(0, &length, &saveptr, p)) {
- if (!strncmp(p, "lowp", 4) ||
- !strncmp(p, "mediump", 7) ||
- !strncmp(p, "highp", 5)) {
- continue;
- } else if (!strncmp(p, "precision", 9)) {
- while ((p = opengl_strtok(0, &length, &saveptr, p)) &&
- !strchr(p, ';')) {
- /* do nothing */
- ;
- }
- } else {
- const char *p2;
- if (!strncmp(p, "gl_MaxVertexUniformVectors", 26)) {
- p2 = "(gl_MaxVertexUniformComponents / 4)";
- } else if (!strncmp(p, "gl_MaxFragmentUniformVectors", 28)) {
- p2 = "(gl_MaxFragmentUniformComponents / 4)";
- } else if (!strncmp(p, "gl_MaxVaryingVectors", 20)) {
- p2 = "(gl_MaxVaryingFloats / 4)";
- } else {
- p2 = p;
- }
-
- int new_len = strlen(p2);
- if (*patched_len + new_len > patched_size) {
- patched_size *= 2;
- patched = realloc(patched, patched_size + 1);
-
- if (!patched) {
- if (p) {
- free(p);
- }
- return NULL;
- }
- }
-
- memcpy(patched + *patched_len, p2, new_len);
- *patched_len += new_len;
- }
- }
-
- patched[*patched_len] = 0;
- /* check that we don't leave dummy preprocessor lines */
- for (sp = patched; *sp;) {
- for (; *sp == ' ' || *sp == '\t'; sp++) {
- /* do nothing */
- ;
- }
- if (!strncmp(sp, "#define", 7)) {
- for (p = sp + 7; *p == ' ' || *p == '\t'; p++) {
- /* do nothing */
- ;
- }
- if (*p == '\n' || *p == '\r' || *p == '/') {
- memset(sp, 0x20, 7);
- }
- }
- for (; *sp && *sp != '\n' && *sp != '\r'; sp++) {
- /* do nothing */
- ;
- }
- for (; *sp == '\n' || *sp == '\r'; sp++) {
- /* do nothing */
- ;
- }
- }
- return patched;
-}
-
-static int
-shadersrc_gles_to_gl(GLsizei count, const char **string,
- char **s, const GLint *length, GLint *l)
-{
- int i;
-
- for (i = 0; i < count; ++i) {
- GLint len;
- if (length) {
- len = length[i];
- if (len < 0) {
- len = string[i] ? strlen(string[i]) : 0;
- }
- } else {
- len = string[i] ? strlen(string[i]) : 0;
- }
-
- if (string[i]) {
- s[i] = do_eglShaderPatch(string[i], len, &l[i]);
- if (!s[i]) {
- while (i) {
- free(s[--i]);
- }
-
- free(l);
- free(s);
- return -1;
- }
- } else {
- s[i] = NULL;
- l[i] = 0;
- }
- }
-
- return 0;
-}
-
-#ifdef __APPLE__
-/* XXX:This is work around fix Mac host GL driver's bug that cause webapp
- * screen crash. When one context use textures from other sharing context, some
- * textures are not initialized or shared successfully. So use glGetTexImage to
- * read texture back right after glTexSubImage2D, thus guarantee a
- * synchronization.
- */
-static void mac_dump_texture(void)
-{
- int w, h;
- unsigned char *buf;
-
- /* only handle target=GL_TEXTURE_2D, level=0,
- format=GL_RGBA, type=GL_UNSIGNED_BYTE */
- glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &w);
- glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, &h);
-
- if (w == 0 && h == 0) {
- return;
- }
-
- buf = g_malloc((w*4) * h); /* XXX:need allignment? */
-
- glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE, buf);
-
- g_free(buf);
-}
-#endif
-
-static int record_fbconfig_set(ProcessState *process,
- const GLXFBConfig *fbconfigs,
- int nconfigs)
-{
- int i;
- int id;
- int previous_entries = 0;
-
- if (!fbconfigs) {
- return 0;
- }
-
- /* Check if we already have a similar set in our tables */
- for (i = 0; i < process->nfbconfig; i++) {
- if (process->fbconfigs_max[i] == nconfigs &&
- !memcmp(fbconfigs, process->fbconfigs[i],
- sizeof(GLXFBConfig) * nconfigs)) {
- /* No need to store this set as it's identical to another one */
- /* XFree(fbconfigs); */
-
- /* Return the identifier of the previously allocated
- set matching the query */
- id = previous_entries + 1;
- return id;
- } else {
- previous_entries += process->fbconfigs_max[i];
- }
- }
-
- /* Check if we have room for a new set */
- if (process->nfbconfig >= MAX_FBCONFIG) {
- fprintf(stderr,
- "[%s]:%d Too many FB configs allocated for this process\n",
- __func__, __LINE__);
- /* XFree(fbconfigs); */
- return 0;
- }
-
- /* Store new set -
- this block should be released using XFree on process exit */
- process->fbconfigs[process->nfbconfig] = fbconfigs;
- process->fbconfigs_max[process->nfbconfig] = nconfigs;
- process->nfbconfig++;
- process->nfbconfig_total += nconfigs;
-
- id = previous_entries + 1;
- return id;
-}
-
-
-int do_function_call(ProcessState *process, int func_number,
- unsigned long *args, char *ret_string)
-{
- union gl_ret_type ret;
-
- Signature *signature = (Signature *) tab_opengl_calls[func_number];
- int ret_type = signature->ret_type;
-
- ret.s = NULL;
-
- if (display_function_call) {
- DEBUGF("[%d]> %s\n", process->p.process_id,
- tab_opengl_calls_name[func_number]);
- }
- TRACE("[%d]> %s\n", process->p.process_id,
- tab_opengl_calls_name[func_number]);
-
- switch (func_number) {
- case -1:
- break;
- case _resize_surface_func:
- {
- ClientGLXDrawable client_drawable = to_drawable(args[0]);
- QGloSurface *qsurface = get_qsurface_from_client_drawable(
- process->current_state,
- client_drawable);
-
- /* We have to assume the current context here since we assume that
- a drawable must belong to a specific context */
- if (qsurface) {
- resize_surface(process, qsurface, (int)args[1], (int)args[2]);
- } else {
- DEBUGF("%s Failed to find surface for client_drawable(%p),"
- "process(%p),current_state(%p),current_surface(%p)\n",
- "_resize_surface_func", client_drawable, process,
- process->current_state,
- process->current_state->current_qsurface);
- }
- break;
- }
- case _render_surface_func:
- {
- ClientGLXDrawable client_drawable = to_drawable(args[0]);
- QGloSurface *qsurface = get_qsurface_from_client_drawable(
- process->current_state,
- client_drawable);
- int bpp = (int)args[1];
- int stride = (int)args[2];
- char *render_buffer = (char *)args[3];
-
- /* We have to assume the current context here since we assume that
- a drawable must belong to a specific context */
- if (qsurface) {
- render_surface(qsurface, bpp, stride, render_buffer);
- }
- break;
- }
- case glXWaitGL_func:
- {
- glFinish(); /* glXWaitGL(); */
- ret.i = 0;
- break;
- }
- case glXWaitX_func:
- {
- /* FIXME GW Maybe we should just do this on the server? */
- /* glXWaitX(); */
- ret.i = 0;
- break;
- }
- case glXChooseVisual_func:
- {
- ret.i = glXChooseVisualFunc((int *)&args[2]);
- break;
- }
- case glXQueryExtensionsString_func:
- {
- /* glXQueryExtensionsString(dpy, 0); */
- ret.s = supported_glx_extensions();
- break;
- }
-
- case glXQueryServerString_func:
- {
- switch (args[2]) {
- case GLX_VENDOR:
- ret.s = FAKE_GLX_VENDOR;
- break;
- case GLX_VERSION:
- ret.s = FAKE_GLX_VERSION_STRING;
- break;
- case GLX_EXTENSIONS:
- ret.s = supported_glx_extensions();
- break;
- default:
- ret.s = 0;
- break;
- }
- break;
- }
- case glXGetClientString_func:
- {
- switch (args[1]) {
- case GLX_VENDOR:
- ret.s = FAKE_GLX_VENDOR;
- break;
- case GLX_VERSION:
- ret.s = FAKE_GLX_VERSION_STRING;
- break;
- case GLX_EXTENSIONS:
- ret.s = "GLX_ARB_get_proc_address ";
- break;
- default:
- ret.s = 0;
- break;
- }
- break;
- }
- case glXGetScreenDriver_func:
- {
- /* FIXME GW What is this? not documented anywhere!! */
- /*GET_EXT_PTR(const char *, glXGetScreenDriver, (Display *, int));
- ret.s = ptr_func_glXGetScreenDriver(dpy, 0); */
- ret.s = "";
- break;
- }
- case glXGetDriverConfig_func:
- {
- /* FIXME GW What is this? not documented anywhere!! */
- /*GET_EXT_PTR(const char *, glXGetDriverConfig, (const char *));
- ret.s = ptr_func_glXGetDriverConfig((const char *) args[0]); */
- ret.s = "";
- break;
- }
- case glXCreateContext_func:
- {
- int visualid = (int) args[1];
- int fake_shareList = (int) args[2];
-
- if (display_function_call) {
- DEBUGF("visualid=%d, fake_shareList=%d\n", visualid,
- fake_shareList);
- }
-
- GLState *shareListState = get_glstate_for_fake_ctxt(process,
- fake_shareList);
-
- ret.i = 0;
-
- /* Work out format flags from visual id */
- int formatFlags = GLO_FF_DEFAULT;
- if (visualid >= 0 && visualid < DIM(FBCONFIGS)) {
- formatFlags = FBCONFIGS[visualid].formatFlags;
- }
-
- GloContext *context = glo_context_create(formatFlags,
- (GloContext *)shareListState ?
- shareListState->context : 0);
- if (context) {
- GLState *state = _create_context(process,
- ++process->next_available_context_number);
- if (state) {
- state->context = context;
- set_context_sharelist(process, state, fake_shareList);
- ret.i = state->fake_ctxt;
- } else {
- DEBUGF("Failed to allocate state context"
- " for format %08x\n", formatFlags);
- glo_context_destroy(context);
- }
- } else {
- DEBUGF("Failed to create context "
- "for format %08x\n", formatFlags);
- }
- break;
- }
- case glXCreateNewContext_func:
- {
- int client_fbconfig = args[1];
-
- ret.i = 0;
- const GLXFBConfig *fbconfig = get_fbconfig(process,
- client_fbconfig);
-
- if (fbconfig) {
- int fake_shareList = args[3];
- GLState *shareListState = get_glstate_for_fake_ctxt(process,
- fake_shareList);
- /* FIXME GW get from fbconfig */
- GloContext *context = glo_context_create(fbconfig->formatFlags,
- (GloContext *)shareListState ?
- shareListState->context : 0);
- if (context) {
- GLState *state =
- _create_context(process,
- ++process->next_available_context_number);
- if (state) {
- state->context = context;
- set_context_sharelist(process, state, fake_shareList);
- ret.i = state->fake_ctxt;
- } else {
- DEBUGF("Failed to allocate state context"
- " for format %08x", fbconfig->formatFlags);
- glo_context_destroy(context);
- }
- } else {
- DEBUGF("Failed to create context"
- " for format %08x", fbconfig->formatFlags);
- }
- }
- break;
- }
- case glXCopyContext_func:
- {
- DEBUGF("glXCopyContext not supported (does anything use it?)\n");
- break;
- }
- case glXDestroyContext_func:
- {
- int fake_ctxt = (int)args[1];
-
- if (display_function_call) {
- DEBUGF("fake_ctxt=%d\n", fake_ctxt);
- }
-
- int i;
- for (i = 0; i < process->nb_states; i++) {
- if (process->glstates[i]->fake_ctxt == fake_ctxt) {
- /*XXX: DestroyContext should not switch current context,
- * or else guest still try to access it
- * and cause qemu segfalt.
- * But not sure if any corner case, so comment it
- * for now and will remove it completely in future.
- * this was our GLState...
- * process->current_state = &process->default_state;
- */
- int fake_shareList = process->glstates[i]->fake_shareList;
- process->glstates[i]->ref--;
- if (process->glstates[i]->ref == 0) {
- DEBUGF("destroy_gl_state fake_ctxt = %d\n",
- process->glstates[i]->fake_ctxt);
- destroy_gl_state(process->glstates[i]);
- g_free(process->glstates[i]);
- memmove(&process->glstates[i],
- &process->glstates[i + 1],
- (process->nb_states - i - 1) *
- sizeof(GLState *));
- process->nb_states--;
- }
-
- if (fake_shareList) {
- for (i = 0; i < process->nb_states; i++) {
- if (process->glstates[i]->fake_ctxt ==
- fake_shareList) {
- process->glstates[i]->ref--;
- if (process->glstates[i]->ref == 0) {
- DEBUGF("destroy_gl_state fake_sharelist"
- " fake_ctxt = %d\n",
- process->glstates[i]->fake_ctxt);
- destroy_gl_state(process->glstates[i]);
- g_free(process->glstates[i]);
- memmove(&process->glstates[i],
- &process->glstates[i + 1],
- (process->nb_states - i - 1) *
- sizeof(GLState *));
- process->nb_states--;
- }
- break;
- }
- }
- }
- break;
- }
- }
- break;
- }
- case glXQueryVersion_func:
- {
- int *major = (int *)args[1];
- int *minor = (int *)args[2];
- /* ret.i = glXQueryVersion(dpy, (int *)args[1], (int *)args[2]); */
- if (major) {
- *major = FAKE_GLX_VERSION_MAJOR;
- }
- if (minor) {
- *minor = FAKE_GLX_VERSION_MINOR;
- }
- ret.i = True;
- break;
- }
- case glGetString_func:
- {
- switch (args[0]) {
- case GL_VENDOR:
- ret.s = FAKE_GL_VENDOR;
- break;
- case GL_RENDERER:
- ret.s = FAKE_GL_RENDERER;
- break;
- case GL_VERSION:
- ret.s = FAKE_GL_VERSION;
- break;
- case GL_EXTENSIONS:
- ret.s = compute_gl_extensions();
- break;
- case GL_SHADING_LANGUAGE_VERSION:
- if (FAKE_GL_MAJOR < 2) {
- ret.s = "";
- break;
- }
- /* Fall through. */
- default:
- ret.s = (char *)glGetString(args[0]);
- break;
- }
- break;
- }
- case glXMakeCurrent_func:
- {
- ClientGLXDrawable client_drawable = to_drawable(args[1]);
- int fake_ctxt = (int)args[2];
- GLState *glstate = NULL;
-
- DEBUGF("Makecurrent: fake_ctx=%d client_drawable=%08x\n",
- fake_ctxt, client_drawable);
-
- if (client_drawable == 0 && fake_ctxt == 0) {
- /* Release context */
- if (process->current_state->current_qsurface) {
- if (process->current_state->current_qsurface->type !=
- SURFACE_PIXMAP) {
- process->current_state->current_qsurface->ref--;
- } else {
- unbind_qsurface(process->current_state,
- process->current_state->current_qsurface);
- }
- }
- process->current_state = &process->default_state;
-
- DEBUGF(" --release\n");
- glo_surface_makecurrent(0);
- } else { /* Lookup GLState struct for this context */
- glstate = get_glstate_for_fake_ctxt(process, fake_ctxt);
- if (!glstate) {
- DEBUGF(" --invalid fake_ctxt (%d)!\n", fake_ctxt);
- } else {
- if (!set_current_qsurface(glstate, client_drawable) &&
- !link_qsurface(process, glstate, client_drawable)) {
- /* If there is no surface, create one. */
- QGloSurface *qsurface = calloc(1, sizeof(QGloSurface));
- qsurface->surface = glo_surface_create(4, 4,
- glstate->context);
- qsurface->client_drawable = client_drawable;
- qsurface->ref = 1;
- qsurface->type = SURFACE_WINDOW;
- qsurface->status = SURFACE_ACTIVE;
-
- bind_qsurface(glstate, qsurface);
- DEBUGF(" --Client drawable not found, "
- "create new surface: %p %16lx\n",
- qsurface, (unsigned long int)client_drawable);
- } else {
- DEBUGF(" --Client drawable found, using surface: "
- "%p %16lx\n", glstate->current_qsurface,
- (unsigned long int)client_drawable);
- }
-#if 0
- /*Test old surface contents */
- int reset_texture = 0;
- GLState *old_glstate = NULL;
- /* Switch from pixmap */
- if (process->current_state->current_qsurface &&
- SURFACE_PIXMAP == process->current_state->
- current_qsurface->type) {
- glo_surface_updatecontents(
- process->current_state->
- current_qsurface->surface);
- reset_texture = 1;
- old_glstate = process->current_state;
- }
- fprintf(stderr,
- "MakeCurrent: drawable=0x%x,qsurface=%p.\n",
- client_drawable, glstate->current_qsurface);
-
-#endif
- /* Switch in pixmap surface */
- if (glstate->current_qsurface && SURFACE_PIXMAP ==
- glstate->current_qsurface->type) {
- /* Release it if the surface is used
- as texture target */
- glo_surface_release_texture(
- glstate->current_qsurface->surface);
- }
-
- process->current_state = glstate;
-
- ret.i = glo_surface_makecurrent(
- glstate->current_qsurface ?
- glstate->current_qsurface->surface
- : NULL);
-/* if (reset_texture) {
- glo_surface_as_texture(
- process->current_state->context,
- old_glstate->current_qsurface->surface);
- } */
- }
- }
- break;
- }
- case glXSwapBuffers_func:
- {
- /* Does nothing - window data is copied via render_surface() */
- break;
- }
- case glXIsDirect_func:
- {
- /* int fake_ctxt = (int) args[1]; */
-
- /* Does this go direct and skip the X server? We'll just say
- yes for now. */
- ret.c = True;
- break;
- }
- case glXGetConfig_func:
- {
- int visualid = args[1];
- ret.i = glXGetConfigFunc(visualid, args[2], (int *)args[3]);
- break;
- }
- case glXGetConfig_extended_func:
- {
- int visualid = args[1];
- int n = args[2];
- int i;
- int *attribs = (int *)args[3];
- int *values = (int *)args[4];
- int *res = (int *)args[5];
-
- for (i = 0; i < n; i++) {
- res[i] = glXGetConfigFunc(visualid, attribs[i], &values[i]);
- }
- break;
- }
- case glXUseXFont_func:
- {
- /* implementation is client-side only :-) */
- break;
- }
- case glXQueryExtension_func:
- {
- int *errorBase = (int *)args[1];
- int *eventBase = (int *)args[2];
- if (errorBase) {
- *errorBase = 0; /* FIXME GW */
- }
- if (eventBase) {
- *eventBase = 0; /* FIXME GW */
- }
- ret.i = True;
- break;
- }
- case glXChooseFBConfig_func:
- {
- /* Retrieve array of FB configs matching our contraints */
- const GLXFBConfig *fbconfigs = glXChooseFBConfigFunc(args[1],
- (int *)args[2], (int *)args[3]);
-
- /* Record this in our tables and return a client-side identifier
- for the first entry in the array */
- ret.i = record_fbconfig_set(process, fbconfigs, *(int *)args[3]);
-
- /* Zero indicates failure */
- if (ret.i == 0) {
- *(int *)args[3] = 0;
- }
- break;
- }
- case glXGetFBConfigs_func:
- {
- /* Retrieve array of available FB configs */
- const GLXFBConfig *fbconfigs = glXGetFBConfigsFunc(args[1],
- (int *)args[2]);
-
- /* Record this in our tables and return a client-side identifier
- for the first entry in the array */
- ret.i = record_fbconfig_set(process, fbconfigs, *(int *)args[2]);
-
- /* Zero indicates failure */
- if (ret.i == 0) {
- *(int *)args[2] = 0;
- }
- break;
- }
- case glXGetFBConfigAttrib_func:
- {
- int client_fbconfig = args[1];
-
- ret.i = 0;
- const GLXFBConfig *fbconfig = get_fbconfig(process,
- client_fbconfig);
-
- if (fbconfig) {
- ret.i =
- glXGetFBConfigAttribFunc(fbconfig, args[2],
- (int *)args[3]);
- }
- break;
- }
- case glXGetFBConfigAttrib_extended_func:
- {
- int client_fbconfig = args[1];
- int n = args[2];
- int i;
- int *attribs = (int *)args[3];
- int *values = (int *)args[4];
- int *res = (int *)args[5];
- const GLXFBConfig *fbconfig = get_fbconfig(process,
- client_fbconfig);
-
- for (i = 0; i < n; i++) {
- if (fbconfig) {
- res[i] =
- glXGetFBConfigAttribFunc(fbconfig,
- attribs[i], &values[i]);
- } else {
- res[i] = 0;
- }
- }
- break;
- }
- case glXQueryContext_func:
- {
- DEBUGF("glXQueryContext not implemented\n");
- ret.i = 0;
-#if 0 /* GW */
- GET_EXT_PTR(int, glXQueryContext,
- (Display *, GLXContext, int, int *));
- int fake_ctxt = (int) args[1];
-
- if (display_function_call) {
- DEBUGF("fake_ctx=%i\n", fake_ctxt);
- }
- GLXContext ctxt =
- get_association_fakecontext_glxcontext(process, fake_ctxt);
- if (ctxt == NULL) {
- DEBUGF("invalid fake_ctxt (%i) !\n", fake_ctxt);
- ret.i = 0;
- } else {
- ret.i =
- ptr_func_glXQueryContext(dpy, ctxt, args[2],
- (int *)args[3]);
- }
-#endif
- break;
- }
- case glXQueryDrawable_func:
- {
- /* TODO GW one of:
- GLX_WIDTH, GLX_HEIGHT, GLX_PRESERVED_CONTENTS,
- GLX_LARGEST_PBUFFER, GLX_FBCONFIG_ID */
- DEBUGF("FIXME: glXQueryDrawable not implemented\n");
- ret.i = 0;
-#if 0 /* GW */
- GET_EXT_PTR(void, glXQueryDrawable,
- (Display *, GLXDrawable, int, int *));
- ClientGLXDrawable client_drawable = to_drawable(args[1]);
- GLXDrawable drawable =
- get_association_clientdrawable_serverdrawable(
- glstate, client_drawable);
-
- if (display_function_call) {
- DEBUGF("client_drawable=%p\n", client_drawable);
- }
-
- if (!drawable) {
- DEBUGF("invalid client_drawable (%p) !\n", client_drawable);
- } else {
- ptr_func_glXQueryDrawable(dpy, drawable,
- args[2], (int *)args[3]);
- }
-#endif
- break;
- }
- case glXGetVisualFromFBConfig_func:
- {
- int client_fbconfig = args[1];
-
- ret.i = 0;
- const GLXFBConfig *fbconfig = get_fbconfig(process,
- client_fbconfig);
-
- if (fbconfig) {
- /* we tread visualid as the index into the fbconfigs array */
- ret.i = &FBCONFIGS[0] - fbconfig;
- if (display_function_call) {
- DEBUGF("visualid = %d\n", ret.i);
- }
- }
- break;
- }
- case glXSwapIntervalSGI_func:
- {
- /*GET_EXT_PTR(int, glXSwapIntervalSGI, (int));
- ret.i = ptr_func_glXSwapIntervalSGI(args[0]);*/
- ret.i = 0;
- break;
- }
-
- case glXGetProcAddress_fake_func:
- {
- /* if (display_function_call)
- DEBUGF( "glXGetProcAddress %s ", (char *) args[0]);
- ret.i = glo_getprocaddress((const char *) args[0]) != NULL;
- DEBUGF( " == %08x\n", ret.i); */
- ret.i = 0;
- break;
- }
- case glXGetProcAddress_global_fake_func:
- {
- int nbElts = args[0];
- char *huge_buffer = (char *)args[1];
- char *result = (char *)args[2];
- int i;
-
- for (i = 0; i < nbElts; i++) {
- int len = strlen(huge_buffer);
- /* DEBUGF("glXGetProcAddress_global %s\n",
- (char *)huge_buffer); */
- result[i] =
- glo_getprocaddress((const char *)huge_buffer) != NULL;
- huge_buffer += len + 1;
- }
- break;
- }
- case glXCreatePixmap_func:
- {
- int client_fbconfig = args[1];
-
- ret.i = 0;
- const GLXFBConfig *fbconfig = get_fbconfig(process,
- client_fbconfig);
-
- if (fbconfig) {
- /* Create a light-weight context just for creating surface */
- GloContext *context = __glo_context_create(
- fbconfig->formatFlags);
- if (context) {
- /* glXPixmap same as input Pixmap */
- ClientGLXDrawable client_drawable = to_drawable(args[2]);
-
- QGloSurface *qsurface = calloc(1, sizeof(QGloSurface));
- if (qsurface) {
- /* get the width and height */
- int width, height;
- glo_geometry_get_from_glx((int *)args[3],
- &width, &height);
-
- DEBUGF("glXCreatePixmap: %dX%d.\n", width, height);
- qsurface->surface = glo_surface_create(width,
- height, context);
- if (qsurface->surface) {
- qsurface->client_drawable = client_drawable;
- qsurface->type = SURFACE_PIXMAP;
- qsurface->status = SURFACE_PENDING;
- qsurface_pixmap_ref(qsurface);
-
- /* Keep this surface,
- will link it with context in MakeCurrent */
- keep_qsurface(process, qsurface);
-
- /* If this pixmap is linked
- as texture previously */
- if (link_drawable(process, client_drawable)) {
- glo_surface_as_texture(
- process->current_state->context,
- qsurface->surface, qsurface->type);
- }
-
- ret.i = (int)client_drawable;
- } else {
- free(qsurface);
- glo_context_destroy(context);
- }
- } else {
- glo_context_destroy(context);
- }
- }
- }
- break;
- }
- case glXDestroyPixmap_func:
- {
- /* glXPixmap same as input Pixmap */
- ClientGLXDrawable client_drawable = to_drawable(args[1]);
- QGloSurface *qsurface =
- find_qsurface_from_client_drawable(process,
- client_drawable);
- qsurface_pixmap_unref(qsurface);
- break;
- }
- case glEGLImageTargetTexture2DOES_fake_func:
- {
- int target = args[0];
- ClientGLXDrawable client_drawable = to_drawable(args[1]);
- QGloSurface *qsurface =
- find_qsurface_from_client_drawable(process,
- client_drawable);
-
- /* Only support GL_TEXTURE_2D according to spec */
- if (target == GL_TEXTURE_2D) {
- add_pixmap_texture_mapping(process->current_state,
- process->current_state->bindTexture2D,
- client_drawable);
- }
-
- if (!qsurface) {
- if (!keep_drawable(process, client_drawable)) {
- DEBUGF("No space to store drawable for ImageTargetTexture."
- " Need call CreatePixmapSurface to free them.\n");
- break;
- }
- } else {
- glo_surface_as_texture(process->current_state->context,
- qsurface->surface, qsurface->type);
- }
-
- break;
- }
- case glXBindTexImageARB_fake_func:
- {
- ClientGLXDrawable client_drawable = to_drawable(args[1]);
- QGloSurface *qsurface =
- find_qsurface_from_client_drawable(process,
- client_drawable);
- ret.i = 0;
-
- if (qsurface) {
- add_pixmap_texture_mapping(process->current_state,
- process->current_state->bindTexture2D,
- client_drawable);
- glo_surface_as_texture(process->current_state->context,
- qsurface->surface, qsurface->type);
- ret.i = 1;
- } else {
- DEBUGF("Not found pbuffer surface for BindTexImage!\n");
- }
-
- break;
- }
- case glXReleaseTexImageARB_fake_func:
- {
- ClientGLXDrawable client_drawable = to_drawable(args[1]);
- QGloSurface *qsurface =
- find_qsurface_from_client_drawable(process,
- client_drawable);
-
- if (qsurface) {
- remove_pixmap_texture_mapping(process->current_state,
- client_drawable);
- glo_surface_release_texture(qsurface->surface);
- }
-
- break;
- }
- case glXCreatePbuffer_func:
- {
- int client_fbconfig = args[1];
-
- ret.i = 0;
- const GLXFBConfig *fbconfig = get_fbconfig(process,
- client_fbconfig);
-
- if (fbconfig) {
- /* Create a light-weight context just for creating surface */
- GloContext *context =
- __glo_context_create(fbconfig->formatFlags);
- if (context) {
- QGloSurface *qsurface = calloc(1, sizeof(QGloSurface));
- if (qsurface) {
- /* get the width and height */
- int width, height;
- glo_geometry_get_from_glx((int *)args[2],
- &width, &height);
-
- DEBUGF("glXCreatePbuffer: %dX%d.\n", width, height);
- qsurface->surface = glo_surface_create(width,
- height,
- context);
- if (qsurface->surface) {
- /* Use GloSurface handler
- as no input client_drawable,
- and keep only low 32bit of handler
- on x86_64 host. */
- qsurface->client_drawable =
- (ClientGLXDrawable)(long)qsurface->surface;
- qsurface->type = SURFACE_PBUFFER;
- qsurface->status = SURFACE_PENDING;
- /* qsurface->ref = 1; */
-
- /* Keep this surface,
- will link it with context in MakeCurrent */
- keep_qsurface(process, qsurface);
-
- ret.i = qsurface->client_drawable;
- } else {
- free(qsurface);
- glo_context_destroy(context);
- }
- } else {
- glo_context_destroy(context);
- }
- }
- }
- break;
- }
- case glXDestroyPbuffer_func:
- {
- ClientGLXDrawable client_drawable = to_drawable(args[1]);
- QGloSurface *qsurface =
- find_qsurface_from_client_drawable(process,
- client_drawable);
- if (qsurface &&
- qsurface != process->current_state->current_qsurface &&
- qsurface->glstate == NULL &&
- qsurface->type == SURFACE_PBUFFER) {
- glo_surface_destroy(qsurface->surface);
- g_free(qsurface);
- }
- break;
- }
-/* Begin of texture stuff */
- case glBindTexture_func:
- case glBindTextureEXT_func:
- {
- int target = args[0];
- unsigned int client_texture = args[1];
- unsigned int server_texture;
-
- if (((int)client_texture) < 0) {
- fprintf(stderr,
- "glBindTexture got invalid texture ID, do nothing!\n");
- break;
- }
-
- if (client_texture == 0) {
- glBindTexture(target, 0);
- } else {
- alloc_value(process->current_state->textureAllocator,
- client_texture);
- server_texture =
- process->current_state->tabTextures[client_texture];
- if (server_texture == 0) {
- glGenTextures(1, &server_texture);
- process->current_state->tabTextures[client_texture] =
- server_texture;
- }
- glBindTexture(target, server_texture);
- }
-
- if (target == GL_TEXTURE_2D) {
- QGloSurface *qsurface = NULL;
- ClientGLXDrawable drawable =
- find_pixmap_texture(process->current_state,
- client_texture);
-
- if (drawable) {
- qsurface = find_qsurface_from_client_drawable(process,
- drawable);
-
- if (qsurface) {
- glo_surface_as_texture(process->current_state->context,
- qsurface->surface,
- qsurface->type);
- /* fprintf(stderr,
- "bindtexture: drawable=0x%x,qsurface=%p.\n",
- drawable, qsurface);*/
- }
- }
- process->current_state->bindTexture2D = client_texture;
- }
- break;
- }
- case glGenTextures_fake_func:
- {
- /* GET_EXT_PTR(void, glGenTextures,
- (GLsizei n, GLuint *textures)); */
- int i;
- int n = args[0];
- unsigned int *clientTabTextures = g_malloc(n * sizeof(int));
- unsigned int *serverTabTextures = g_malloc(n * sizeof(int));
-
- alloc_range(process->current_state->textureAllocator, n,
- clientTabTextures);
-
- /* ptr_func_glGenTextures(n, serverTabTextures); */
- glGenTextures(n, serverTabTextures);
- for (i = 0; i < n; i++) {
- process->current_state->tabTextures[clientTabTextures[i]] =
- serverTabTextures[i];
- }
-
- g_free(clientTabTextures);
- g_free(serverTabTextures);
- break;
- }
- case glDeleteTextures_func:
- {
- /* GET_EXT_PTR(void, glDeleteTextures,
- (GLsizei n, const GLuint *textures)); */
- int i;
- int n = args[0];
- unsigned int *clientTabTextures = (unsigned int *)args[1];
-
- delete_range(process->current_state->textureAllocator, n,
- clientTabTextures);
-
- unsigned int *serverTabTextures = g_malloc(n * sizeof(int));
-
- for (i = 0; i < n; i++) {
- serverTabTextures[i] =
- get_server_texture(process, clientTabTextures[i]);
- }
- /* ptr_func_glDeleteTextures(n, serverTabTextures); */
- glDeleteTextures(n, serverTabTextures);
- for (i = 0; i < n; i++) {
- process->current_state->tabTextures[clientTabTextures[i]] = 0;
- }
- g_free(serverTabTextures);
-
- for (i = 0; i < n; i++) {
- del_pixmap_texture_mapping(process->current_state,
- clientTabTextures[i]);
- }
- break;
- }
- case glPrioritizeTextures_func:
- {
- GET_EXT_PTR(void, glPrioritizeTextures,
- (GLsizei n, const GLuint *textures,
- const GLclampf *priorities));
-
- int i;
- int n = args[0];
- unsigned int *textures = (unsigned int *)args[1];
-
- for (i = 0; i < n; i++) {
- textures[i] = get_server_texture(process, textures[i]);
- }
- ptr_func_glPrioritizeTextures(n, textures,
- (const GLclampf *)args[2]);
- break;
- }
- case glAreTexturesResident_func:
- {
- GET_EXT_PTR(void, glAreTexturesResident,
- (GLsizei n, const GLuint *textures,
- GLboolean *residences));
- int i;
- int n = args[0];
- unsigned int *textures = (unsigned int *)args[1];
-
- for (i = 0; i < n; i++) {
- textures[i] = get_server_texture(process, textures[i]);
- }
- ptr_func_glAreTexturesResident(n, textures,
- (GLboolean *)args[2]);
- break;
- }
- case glIsTexture_func:
- case glIsTextureEXT_func:
- {
- /* GET_EXT_PTR(GLboolean, glIsTexture, (GLuint texture)); */
- unsigned int client_texture = args[0];
- unsigned int server_texture =
- get_server_texture(process, client_texture);
- if (server_texture) {
- /* ret.c = ptr_func_glIsTexture(server_texture); */
- ret.c = glIsTexture(server_texture);
- } else {
- ret.c = 0;
- }
- break;
- }
- case glFramebufferTexture1DEXT_func:
- {
- GET_EXT_PTR(void, glFramebufferTexture1DEXT,
- (int, int, int, int, int));
- unsigned int client_texture = args[3];
- unsigned int server_texture =
- get_server_texture(process, client_texture);
- if (server_texture) {
- ptr_func_glFramebufferTexture1DEXT(args[0], args[1], args[2],
- server_texture, args[4]);
- }
- break;
- }
- case glFramebufferTexture2D_func:
- /* DEBUGF("wooooot!\n"); */
- case glFramebufferTexture2DEXT_func:
- {
- GET_EXT_PTR(void, glFramebufferTexture2DEXT,
- (int, int, int, int, int));
- unsigned int client_texture = args[3];
- unsigned int server_texture =
- get_server_texture(process, client_texture);
- if (server_texture) {
- ptr_func_glFramebufferTexture2DEXT(args[0], args[1], args[2],
- server_texture, args[4]);
- }
- break;
- }
-
- case glFramebufferTexture3DEXT_func:
- {
- GET_EXT_PTR(void, glFramebufferTexture3DEXT,
- (int, int, int, int, int, int));
- unsigned int client_texture = args[3];
- unsigned int server_texture =
- get_server_texture(process, client_texture);
- if (server_texture) {
- ptr_func_glFramebufferTexture3DEXT(args[0], args[1], args[2],
- server_texture, args[4],
- args[5]);
- }
- break;
- }
-/* End of texture stuff */
-
-/* Begin of list stuff */
- case glIsList_func:
- {
- unsigned int client_list = args[0];
- unsigned int server_list = get_server_list(process, client_list);
-
- if (server_list) {
- ret.c = glIsList(server_list);
- } else {
- ret.c = 0;
- }
- break;
- }
-
- case glDeleteLists_func:
- {
- int i;
- unsigned int first_client = args[0];
- int n = args[1];
-
- unsigned int first_server =
- get_server_list(process, first_client);
- for (i = 0; i < n; i++) {
- if (get_server_list(process, first_client + i) !=
- first_server + i) {
- break;
- }
- }
- if (i == n) {
- glDeleteLists(first_server, n);
- } else {
- for (i = 0; i < n; i++) {
- glDeleteLists(get_server_list(process, first_client + i),
- 1);
- }
- }
-
- for (i = 0; i < n; i++) {
- process->current_state->tabLists[first_client + i] = 0;
- }
- delete_consecutive_values(process->current_state->listAllocator,
- first_client, n);
- break;
- }
- case glGenLists_fake_func:
- {
- int i;
- int n = args[0];
- unsigned int server_first = glGenLists(n);
-
- if (server_first) {
- unsigned int client_first =
- alloc_range(process->current_state->listAllocator, n,
- NULL);
- for (i = 0; i < n; i++) {
- process->current_state->tabLists[client_first + i] =
- server_first + i;
- }
- }
- break;
- }
- case glNewList_func:
- {
- unsigned int client_list = args[0];
- int mode = args[1];
-
- alloc_value(process->current_state->listAllocator, client_list);
- unsigned int server_list = get_server_list(process, client_list);
-
- if (server_list == 0) {
- server_list = glGenLists(1);
- process->current_state->tabLists[client_list] = server_list;
- }
- glNewList(server_list, mode);
- break;
- }
- case glCallList_func:
- {
- unsigned int client_list = args[0];
- unsigned int server_list = get_server_list(process, client_list);
-
- glCallList(server_list);
- break;
- }
- case glCallLists_func:
- {
- int i;
- int n = args[0];
- int type = args[1];
- const GLvoid *lists = (const GLvoid *)args[2];
- int *new_lists = g_malloc(sizeof(int) * n);
-
- for (i = 0; i < n; i++) {
- new_lists[i] =
- get_server_list(process, translate_id(i, type, lists));
- }
- glCallLists(n, GL_UNSIGNED_INT, new_lists);
- g_free(new_lists);
- break;
- }
-/* End of list stuff */
-
-/* Begin of buffer stuff */
- case glBindBufferARB_func:
- {
- GET_EXT_PTR(void, glBindBufferARB, (int, int));
- int target = args[0];
- unsigned int client_buffer = args[1];
- unsigned int server_buffer;
-
- if (client_buffer == 0) {
- ptr_func_glBindBufferARB(target, 0);
- } else {
- server_buffer = get_server_buffer(process, client_buffer);
- ptr_func_glBindBufferARB(target, server_buffer);
- }
- break;
- }
- case glGenBuffersARB_fake_func:
- {
- GET_EXT_PTR(void, glGenBuffersARB, (int, unsigned int *));
- int i;
- int n = args[0];
- unsigned int *clientTabBuffers = g_malloc(n * sizeof(int));
- unsigned int *serverTabBuffers = g_malloc(n * sizeof(int));
-
- alloc_range(process->current_state->bufferAllocator, n,
- clientTabBuffers);
-
- ptr_func_glGenBuffersARB(n, serverTabBuffers);
- for (i = 0; i < n; i++) {
- process->current_state->tabBuffers[clientTabBuffers[i]] =
- serverTabBuffers[i];
- }
-
- g_free(clientTabBuffers);
- g_free(serverTabBuffers);
- break;
- }
- case glDeleteBuffersARB_func:
- {
- GET_EXT_PTR(void, glDeleteBuffersARB, (int, int *));
- int i;
- int n = args[0];
- unsigned int *clientTabBuffers = (unsigned int *)args[1];
-
- delete_range(process->current_state->bufferAllocator, n,
- clientTabBuffers);
-
- int *serverTabBuffers = g_malloc(n * sizeof(int));
-
- for (i = 0; i < n; i++) {
- serverTabBuffers[i] =
- get_server_buffer(process, clientTabBuffers[i]);
- }
- ptr_func_glDeleteBuffersARB(n, serverTabBuffers);
- for (i = 0; i < n; i++) {
- process->current_state->tabBuffers[clientTabBuffers[i]] = 0;
- }
- g_free(serverTabBuffers);
- break;
- }
- case glIsBufferARB_func:
- {
- GET_EXT_PTR(int, glIsBufferARB, (int));
- unsigned int client_buffer = args[0];
- unsigned int server_buffer =
- get_server_buffer(process, client_buffer);
- if (server_buffer) {
- ret.i = ptr_func_glIsBufferARB(server_buffer);
- } else {
- ret.i = 0;
- }
- break;
- }
-/* End of buffer stuff */
- case glShaderSourceARB_fake_func:
- {
- GET_EXT_PTR(void, glShaderSourceARB, (int, int, char **, void *));
- int size = args[1];
- int i;
- int acc_length = 0;
- GLcharARB **tab_prog = g_malloc(size * sizeof(GLcharARB *));
- int *tab_length = (int *)args[3];
-
- for (i = 0; i < size; i++) {
- tab_prog[i] = ((GLcharARB *)args[2]) + acc_length;
- acc_length += tab_length[i];
- }
- ptr_func_glShaderSourceARB(args[0], args[1], tab_prog,
- tab_length);
- g_free(tab_prog);
- break;
- }
- case glShaderSource_fake_func:
- {
- GET_EXT_PTR(void, glShaderSource, (int, int, char **, void *));
- int size = args[1];
- int i;
- int acc_length = 0;
- GLcharARB **tab_prog = g_malloc(size * sizeof(GLcharARB *));
- int *tab_length = (int *)args[3];
-
- char **tab_prog_new;
- GLint *tab_length_new;
-
- tab_prog_new = malloc(args[1] * sizeof(char *));
- tab_length_new = malloc(args[1] * sizeof(GLint));
-
- memset(tab_prog_new, 0, args[1] * sizeof(char *));
- memset(tab_length_new, 0, args[1] * sizeof(GLint));
-
-
- for (i = 0; i < size; i++) {
- tab_prog[i] = ((GLcharARB *) args[2]) + acc_length;
- acc_length += tab_length[i];
- }
-
- if (shadersrc_gles_to_gl(args[1],
- (const char **)tab_prog,
- tab_prog_new,
- tab_length,
- tab_length_new) < 0) {
- g_free(tab_prog);
- break;
- }
-
- ptr_func_glShaderSource(args[0], args[1],
- tab_prog_new, tab_length_new);
-
- for (i = 0; i < args[1]; i++) {
- free(tab_prog_new[i]);
- }
-
- free(tab_prog_new);
- free(tab_length_new);
-
- g_free(tab_prog);
-
- break;
- }
- case glVertexPointer_fake_func:
- {
- int offset = args[0];
- int size = args[1];
- int type = args[2];
- int stride = args[3];
- int bytes_size = args[4];
-
- process->current_state->vertexPointerSize =
- MAX(process->current_state->vertexPointerSize,
- offset + bytes_size);
- process->current_state->vertexPointer =
- g_realloc(process->current_state->vertexPointer,
- process->current_state->vertexPointerSize);
- memcpy(process->current_state->vertexPointer + offset,
- (void *)args[5], bytes_size);
- /* DEBUGF("glVertexPointer_fake_func size=%d, type=%d,
- * stride=%d, byte_size=%d\n", size, type, stride, bytes_size); */
- glVertexPointer(size, type, stride,
- process->current_state->vertexPointer);
- break;
- }
- case glNormalPointer_fake_func:
- {
- int offset = args[0];
- int type = args[1];
- int stride = args[2];
- int bytes_size = args[3];
-
- process->current_state->normalPointerSize =
- MAX(process->current_state->normalPointerSize,
- offset + bytes_size);
- process->current_state->normalPointer =
- g_realloc(process->current_state->normalPointer,
- process->current_state->normalPointerSize);
- memcpy(process->current_state->normalPointer + offset,
- (void *)args[4], bytes_size);
- /* DEBUGF("glNormalPointer_fake_func type=%d, stride=%d,
- byte_size=%d\n", type, stride, bytes_size); */
- glNormalPointer(type, stride,
- process->current_state->normalPointer);
- break;
- }
- case glIndexPointer_fake_func:
- {
- int offset = args[0];
- int type = args[1];
- int stride = args[2];
- int bytes_size = args[3];
-
- process->current_state->indexPointerSize =
- MAX(process->current_state->indexPointerSize,
- offset + bytes_size);
- process->current_state->indexPointer =
- g_realloc(process->current_state->indexPointer,
- process->current_state->indexPointerSize);
- memcpy(process->current_state->indexPointer + offset,
- (void *)args[4], bytes_size);
- /* DEBUGF("glIndexPointer_fake_func type=%d, stride=%d,
- byte_size=%d\n", type, stride, bytes_size); */
- glIndexPointer(type, stride,
- process->current_state->indexPointer);
- break;
- }
- case glEdgeFlagPointer_fake_func:
- {
- int offset = args[0];
- int stride = args[1];
- int bytes_size = args[2];
-
- process->current_state->edgeFlagPointerSize =
- MAX(process->current_state->edgeFlagPointerSize,
- offset + bytes_size);
- process->current_state->edgeFlagPointer =
- g_realloc(process->current_state->edgeFlagPointer,
- process->current_state->edgeFlagPointerSize);
- memcpy(process->current_state->edgeFlagPointer + offset,
- (void *)args[3], bytes_size);
- /* DEBUGF("glEdgeFlagPointer_fake_func stride=%d, bytes_size=%d\n",
- stride, bytes_size); */
- glEdgeFlagPointer(stride,
- process->current_state->edgeFlagPointer);
- break;
- }
- case glVertexAttribPointerARB_fake_func:
- {
- GET_EXT_PTR(void, glVertexAttribPointerARB,
- (int, int, int, int, int, void *));
- int offset = args[0];
- int index = args[1];
- int size = args[2];
- int type = args[3];
- int normalized = args[4];
- int stride = args[5];
- int bytes_size = args[6];
-
- process->current_state->vertexAttribPointerSize[index] =
- MAX(process->current_state->vertexAttribPointerSize[index],
- offset + bytes_size);
- process->current_state->vertexAttribPointer[index] =
- g_realloc(process->current_state->vertexAttribPointer[index],
- process->current_state->
- vertexAttribPointerSize[index]);
- memcpy(process->current_state->vertexAttribPointer[index] +
- offset, (void *)args[7], bytes_size);
- ptr_func_glVertexAttribPointerARB(index, size, type, normalized,
- stride,
- process->current_state->
- vertexAttribPointer[index]);
- break;
- }
- case glVertexAttribPointerNV_fake_func:
- {
- GET_EXT_PTR(void, glVertexAttribPointerNV,
- (int, int, int, int, void *));
- int offset = args[0];
- int index = args[1];
- int size = args[2];
- int type = args[3];
- int stride = args[4];
- int bytes_size = args[5];
-
- process->current_state->vertexAttribPointerNVSize[index] =
- MAX(process->current_state->vertexAttribPointerNVSize[index],
- offset + bytes_size);
- process->current_state->vertexAttribPointerNV[index] =
- g_realloc(process->current_state->vertexAttribPointerNV[index],
- process->current_state->
- vertexAttribPointerNVSize[index]);
- memcpy(process->current_state->vertexAttribPointerNV[index] +
- offset, (void *)args[6], bytes_size);
- ptr_func_glVertexAttribPointerNV(index, size, type, stride,
- process->current_state->
- vertexAttribPointerNV[index]);
- break;
- }
- case glColorPointer_fake_func:
- {
- int offset = args[0];
- int size = args[1];
- int type = args[2];
- int stride = args[3];
- int bytes_size = args[4];
-
- process->current_state->colorPointerSize =
- MAX(process->current_state->colorPointerSize,
- offset + bytes_size);
- process->current_state->colorPointer =
- g_realloc(process->current_state->colorPointer,
- process->current_state->colorPointerSize);
- memcpy(process->current_state->colorPointer + offset,
- (void *)args[5], bytes_size);
- /* DEBUGF("glColorPointer_fake_func bytes_size = %d\n",
- bytes_size); */
- glColorPointer(size, type, stride,
- process->current_state->colorPointer);
-
- break;
- }
- case glSecondaryColorPointer_fake_func:
- {
- GET_EXT_PTR(void, glSecondaryColorPointer,
- (int, int, int, void *));
- int offset = args[0];
- int size = args[1];
- int type = args[2];
- int stride = args[3];
- int bytes_size = args[4];
-
- process->current_state->secondaryColorPointerSize =
- MAX(process->current_state->secondaryColorPointerSize,
- offset + bytes_size);
- process->current_state->secondaryColorPointer =
- g_realloc(process->current_state->secondaryColorPointer,
- process->current_state->secondaryColorPointerSize);
- memcpy(process->current_state->secondaryColorPointer + offset,
- (void *)args[5], bytes_size);
- /* DEBUGF("glSecondaryColorPointer_fake_func bytes_size = %d\n",
- bytes_size); */
- ptr_func_glSecondaryColorPointer(size, type, stride,
- process->current_state->
- secondaryColorPointer);
-
- break;
- }
- case glPushClientAttrib_func:
- {
- int mask = args[0];
-
- if (process->current_state->clientStateSp <
- MAX_CLIENT_STATE_STACK_SIZE) {
- process->current_state->clientStateStack[process->
- current_state->
- clientStateSp].mask =
- mask;
- if (mask & GL_CLIENT_VERTEX_ARRAY_BIT) {
- process->current_state->clientStateStack[process->
- current_state->
- clientStateSp].
- activeTextureIndex =
- process->current_state->activeTextureIndex;
- }
- process->current_state->clientStateSp++;
- }
- glPushClientAttrib(mask);
- break;
- }
- case glPopClientAttrib_func:
- {
- if (process->current_state->clientStateSp > 0) {
- process->current_state->clientStateSp--;
- if (process->current_state->
- clientStateStack[process->current_state->clientStateSp].
- mask & GL_CLIENT_VERTEX_ARRAY_BIT) {
- process->current_state->activeTextureIndex =
- process->current_state->clientStateStack[process->
- current_state->
- clientStateSp].
- activeTextureIndex;
- }
- }
- glPopClientAttrib();
- break;
- }
- case glClientActiveTexture_func:
- case glClientActiveTextureARB_func:
- {
- int activeTexture = args[0];
-
- process->current_state->activeTextureIndex =
- activeTexture - GL_TEXTURE0_ARB;
- do_glClientActiveTextureARB(activeTexture);
- break;
- }
- case glTexCoordPointer_fake_func:
- {
- int offset = args[0];
- int index = args[1];
- int size = args[2];
- int type = args[3];
- int stride = args[4];
- int bytes_size = args[5];
-
- process->current_state->texCoordPointerSize[index] =
- MAX(process->current_state->texCoordPointerSize[index],
- offset + bytes_size);
- process->current_state->texCoordPointer[index] =
- g_realloc(process->current_state->texCoordPointer[index],
- process->current_state->texCoordPointerSize[index]);
- memcpy(process->current_state->texCoordPointer[index] + offset,
- (void *)args[6], bytes_size);
- /* DEBUGF("glTexCoordPointer_fake_func size=%d, type=%d,"
- " stride=%d, byte_size=%d\n",
- size, type, stride, bytes_size); */
- do_glClientActiveTextureARB(GL_TEXTURE0_ARB + index);
- glTexCoordPointer(size, type, stride,
- process->current_state->texCoordPointer[index]);
- do_glClientActiveTextureARB(GL_TEXTURE0_ARB +
- process->current_state->
- activeTextureIndex);
- break;
- }
- case glWeightPointerARB_fake_func:
- {
- GET_EXT_PTR(void, glWeightPointerARB, (int, int, int, void *));
- int offset = args[0];
- int size = args[1];
- int type = args[2];
- int stride = args[3];
- int bytes_size = args[4];
-
- process->current_state->weightPointerSize =
- MAX(process->current_state->weightPointerSize,
- offset + bytes_size);
- process->current_state->weightPointer =
- g_realloc(process->current_state->weightPointer,
- process->current_state->weightPointerSize);
- memcpy(process->current_state->weightPointer + offset,
- (void *)args[5], bytes_size);
- /* DEBUGF("glWeightPointerARB_fake_func size=%d,
- * type=%d, stride=%d, byte_size=%d\n", size, type, stride,
- * bytes_size); */
- ptr_func_glWeightPointerARB(size, type, stride,
- process->current_state->
- weightPointer);
- break;
- }
- case glMatrixIndexPointerARB_fake_func:
- {
- GET_EXT_PTR(void, glMatrixIndexPointerARB,
- (int, int, int, void *));
- int offset = args[0];
- int size = args[1];
- int type = args[2];
- int stride = args[3];
- int bytes_size = args[4];
-
- process->current_state->matrixIndexPointerSize =
- MAX(process->current_state->matrixIndexPointerSize,
- offset + bytes_size);
- process->current_state->matrixIndexPointer =
- g_realloc(process->current_state->matrixIndexPointer,
- process->current_state->matrixIndexPointerSize);
- memcpy(process->current_state->matrixIndexPointer + offset,
- (void *)args[5], bytes_size);
- /* DEBUGF("glMatrixIndexPointerARB_fake_func size=%d,
- * type=%d, stride=%d, byte_size=%d\n", size, type, stride,
- * bytes_size); */
- ptr_func_glMatrixIndexPointerARB(size, type, stride,
- process->current_state->
- matrixIndexPointer);
- break;
- }
- case glFogCoordPointer_fake_func:
- {
- GET_EXT_PTR(void, glFogCoordPointer, (int, int, void *));
- int offset = args[0];
- int type = args[1];
- int stride = args[2];
- int bytes_size = args[3];
-
- process->current_state->fogCoordPointerSize =
- MAX(process->current_state->fogCoordPointerSize,
- offset + bytes_size);
- process->current_state->fogCoordPointer =
- g_realloc(process->current_state->fogCoordPointer,
- process->current_state->fogCoordPointerSize);
- memcpy(process->current_state->fogCoordPointer + offset,
- (void *)args[4], bytes_size);
- /* DEBUGF("glFogCoordPointer_fake_func type=%d,
- stride=%d, byte_size=%d\n", type, stride, bytes_size); */
- ptr_func_glFogCoordPointer(type, stride,
- process->current_state->
- fogCoordPointer);
- break;
- }
- case glVariantPointerEXT_fake_func:
- {
- GET_EXT_PTR(void, glVariantPointerEXT, (int, int, int, void *));
- int offset = args[0];
- int id = args[1];
- int type = args[2];
- int stride = args[3];
- int bytes_size = args[4];
-
- process->current_state->variantPointerEXTSize[id] =
- MAX(process->current_state->variantPointerEXTSize[id],
- offset + bytes_size);
- process->current_state->variantPointerEXT[id] =
- g_realloc(process->current_state->variantPointerEXT[id],
- process->current_state->variantPointerEXTSize[id]);
- memcpy(process->current_state->variantPointerEXT[id] + offset,
- (void *)args[5], bytes_size);
- /* DEBUGF("glVariantPointerEXT_fake_func[%d] type=%d,
- stride=%d, byte_size=%d\n", id, type, stride, bytes_size); */
- ptr_func_glVariantPointerEXT(id, type, stride,
- process->current_state->
- variantPointerEXT[id]);
- break;
- }
- case glInterleavedArrays_fake_func:
- {
- GET_EXT_PTR(void, glInterleavedArrays, (int, int, void *));
- int offset = args[0];
- int format = args[1];
- int stride = args[2];
- int bytes_size = args[3];
-
- process->current_state->interleavedArraysSize =
- MAX(process->current_state->interleavedArraysSize,
- offset + bytes_size);
- process->current_state->interleavedArrays =
- g_realloc(process->current_state->interleavedArrays,
- process->current_state->interleavedArraysSize);
- memcpy(process->current_state->interleavedArrays + offset,
- (void *)args[4], bytes_size);
- /* DEBUGF("glInterleavedArrays_fake_func format=%d,
- stride=%d, byte_size=%d\n", format, stride, bytes_size); */
- ptr_func_glInterleavedArrays(format, stride,
- process->current_state->
- interleavedArrays);
- break;
- }
- case glElementPointerATI_fake_func:
- {
- GET_EXT_PTR(void, glElementPointerATI, (int, void *));
- int type = args[0];
- int bytes_size = args[1];
-
- process->current_state->elementPointerATISize = bytes_size;
- process->current_state->elementPointerATI =
- g_realloc(process->current_state->elementPointerATI,
- process->current_state->elementPointerATISize);
- memcpy(process->current_state->elementPointerATI,
- (void *)args[2], bytes_size);
- /* DEBUGF("glElementPointerATI_fake_func type=%d,
- byte_size=%d\n", type, bytes_size); */
- ptr_func_glElementPointerATI(type,
- process->current_state->
- elementPointerATI);
- break;
- }
- case glTexCoordPointer01_fake_func:
- {
- int size = args[0];
- int type = args[1];
- int stride = args[2];
- int bytes_size = args[3];
-
- process->current_state->texCoordPointerSize[0] = bytes_size;
- process->current_state->texCoordPointer[0] =
- g_realloc(process->current_state->texCoordPointer[0],
- bytes_size);
- memcpy(process->current_state->texCoordPointer[0],
- (void *)args[4], bytes_size);
- /* DEBUGF("glTexCoordPointer01_fake_func size=%d,
- * type=%d, stride=%d, byte_size=%d\n", size, type, stride,
- * bytes_size); */
- do_glClientActiveTextureARB(GL_TEXTURE0_ARB + 0);
- glTexCoordPointer(size, type, stride,
- process->current_state->texCoordPointer[0]);
- do_glClientActiveTextureARB(GL_TEXTURE0_ARB + 1);
- glTexCoordPointer(size, type, stride,
- process->current_state->texCoordPointer[0]);
- do_glClientActiveTextureARB(GL_TEXTURE0_ARB +
- process->current_state->
- activeTextureIndex);
- break;
- }
- case glTexCoordPointer012_fake_func:
- {
- int size = args[0];
- int type = args[1];
- int stride = args[2];
- int bytes_size = args[3];
-
- process->current_state->texCoordPointerSize[0] = bytes_size;
- process->current_state->texCoordPointer[0] =
- g_realloc(process->current_state->texCoordPointer[0],
- bytes_size);
- memcpy(process->current_state->texCoordPointer[0],
- (void *)args[4], bytes_size);
- /* DEBUGF("glTexCoordPointer012_fake_func size=%d,
- * type=%d, stride=%d, byte_size=%d\n", size, type, stride,
- * bytes_size); */
- do_glClientActiveTextureARB(GL_TEXTURE0_ARB + 0);
- glTexCoordPointer(size, type, stride,
- process->current_state->texCoordPointer[0]);
- do_glClientActiveTextureARB(GL_TEXTURE0_ARB + 1);
- glTexCoordPointer(size, type, stride,
- process->current_state->texCoordPointer[0]);
- do_glClientActiveTextureARB(GL_TEXTURE0_ARB + 2);
- glTexCoordPointer(size, type, stride,
- process->current_state->texCoordPointer[0]);
- do_glClientActiveTextureARB(GL_TEXTURE0_ARB +
- process->current_state->
- activeTextureIndex);
- break;
- }
- case glVertexAndNormalPointer_fake_func:
- {
- int vertexPointerSize = args[0];
- int vertexPointerType = args[1];
- int vertexPointerStride = args[2];
- int normalPointerType = args[3];
- int normalPointerStride = args[4];
- int bytes_size = args[5];
- void *ptr = (void *)args[6];
-
- process->current_state->vertexPointerSize = bytes_size;
- process->current_state->vertexPointer =
- g_realloc(process->current_state->vertexPointer, bytes_size);
- memcpy(process->current_state->vertexPointer, ptr, bytes_size);
- glVertexPointer(vertexPointerSize, vertexPointerType,
- vertexPointerStride,
- process->current_state->vertexPointer);
- glNormalPointer(normalPointerType, normalPointerStride,
- process->current_state->vertexPointer);
- break;
- }
- case glVertexNormalPointerInterlaced_fake_func:
- {
- int i = 0;
- int offset = args[i++];
- int vertexPointerSize = args[i++];
- int vertexPointerType = args[i++];
- int stride = args[i++];
- int normalPointerOffset = args[i++];
- int normalPointerType = args[i++];
- int bytes_size = args[i++];
- void *ptr = (void *)args[i++];
-
- process->current_state->vertexPointerSize =
- MAX(process->current_state->vertexPointerSize,
- offset + bytes_size);
- process->current_state->vertexPointer =
- g_realloc(process->current_state->vertexPointer,
- process->current_state->vertexPointerSize);
- memcpy(process->current_state->vertexPointer + offset, ptr,
- bytes_size);
- glVertexPointer(vertexPointerSize, vertexPointerType, stride,
- process->current_state->vertexPointer);
- glNormalPointer(normalPointerType, stride,
- process->current_state->vertexPointer +
- normalPointerOffset);
- break;
- }
- case glTuxRacerDrawElements_fake_func:
- {
- int mode = args[0];
- int count = args[1];
- int isColorEnabled = args[2];
- void *ptr = (void *)args[3];
- int stride =
- 6 * sizeof(float) +
- ((isColorEnabled) ? 4 * sizeof(unsigned char) : 0);
- glVertexPointer(3, GL_FLOAT, stride, ptr);
- glNormalPointer(GL_FLOAT, stride, ptr + 3 * sizeof(float));
- if (isColorEnabled) {
- glColorPointer(4, GL_UNSIGNED_BYTE, stride,
- ptr + 6 * sizeof(float));
- }
- glDrawArrays(mode, 0, count);
-
-#ifdef __APPLE__
- {
- int prev_fbo;
- glGetIntegerv(GL_FRAMEBUFFER_BINDING_EXT, &prev_fbo);
- if (prev_fbo != 0) {
- glFlush();
- }
- }
-#endif
- break;
- }
- case glVertexNormalColorPointerInterlaced_fake_func:
- {
- int i = 0;
- int offset = args[i++];
- int vertexPointerSize = args[i++];
- int vertexPointerType = args[i++];
- int stride = args[i++];
- int normalPointerOffset = args[i++];
- int normalPointerType = args[i++];
- int colorPointerOffset = args[i++];
- int colorPointerSize = args[i++];
- int colorPointerType = args[i++];
- int bytes_size = args[i++];
- void *ptr = (void *)args[i++];
-
- process->current_state->vertexPointerSize =
- MAX(process->current_state->vertexPointerSize,
- offset + bytes_size);
- process->current_state->vertexPointer =
- g_realloc(process->current_state->vertexPointer,
- process->current_state->vertexPointerSize);
- memcpy(process->current_state->vertexPointer + offset, ptr,
- bytes_size);
- glVertexPointer(vertexPointerSize, vertexPointerType, stride,
- process->current_state->vertexPointer);
- glNormalPointer(normalPointerType, stride,
- process->current_state->vertexPointer +
- normalPointerOffset);
- glColorPointer(colorPointerSize, colorPointerType, stride,
- process->current_state->vertexPointer +
- colorPointerOffset);
- break;
- }
- case glVertexColorTexCoord0PointerInterlaced_fake_func:
- {
- int i = 0;
- int offset = args[i++];
- int vertexPointerSize = args[i++];
- int vertexPointerType = args[i++];
- int stride = args[i++];
- int colorPointerOffset = args[i++];
- int colorPointerSize = args[i++];
- int colorPointerType = args[i++];
- int texCoord0PointerOffset = args[i++];
- int texCoord0PointerSize = args[i++];
- int texCoord0PointerType = args[i++];
- int bytes_size = args[i++];
- void *ptr = (void *)args[i++];
-
- process->current_state->vertexPointerSize =
- MAX(process->current_state->vertexPointerSize,
- offset + bytes_size);
- process->current_state->vertexPointer =
- g_realloc(process->current_state->vertexPointer,
- process->current_state->vertexPointerSize);
- memcpy(process->current_state->vertexPointer + offset, ptr,
- bytes_size);
- glVertexPointer(vertexPointerSize, vertexPointerType, stride,
- process->current_state->vertexPointer);
- glColorPointer(colorPointerSize, colorPointerType, stride,
- process->current_state->vertexPointer +
- colorPointerOffset);
- do_glClientActiveTextureARB(GL_TEXTURE0_ARB + 0);
- glTexCoordPointer(texCoord0PointerSize, texCoord0PointerType,
- stride,
- process->current_state->vertexPointer +
- texCoord0PointerOffset);
- do_glClientActiveTextureARB(GL_TEXTURE0_ARB +
- process->current_state->
- activeTextureIndex);
- break;
- }
- case glVertexNormalTexCoord0PointerInterlaced_fake_func:
- {
- int i = 0;
- int offset = args[i++];
- int vertexPointerSize = args[i++];
- int vertexPointerType = args[i++];
- int stride = args[i++];
- int normalPointerOffset = args[i++];
- int normalPointerType = args[i++];
- int texCoord0PointerOffset = args[i++];
- int texCoord0PointerSize = args[i++];
- int texCoord0PointerType = args[i++];
- int bytes_size = args[i++];
- void *ptr = (void *)args[i++];
-
- process->current_state->vertexPointerSize =
- MAX(process->current_state->vertexPointerSize,
- offset + bytes_size);
- process->current_state->vertexPointer =
- g_realloc(process->current_state->vertexPointer,
- process->current_state->vertexPointerSize);
- memcpy(process->current_state->vertexPointer + offset, ptr,
- bytes_size);
- glVertexPointer(vertexPointerSize, vertexPointerType, stride,
- process->current_state->vertexPointer);
- glNormalPointer(normalPointerType, stride,
- process->current_state->vertexPointer +
- normalPointerOffset);
- do_glClientActiveTextureARB(GL_TEXTURE0_ARB + 0);
- glTexCoordPointer(texCoord0PointerSize, texCoord0PointerType,
- stride,
- process->current_state->vertexPointer +
- texCoord0PointerOffset);
- do_glClientActiveTextureARB(GL_TEXTURE0_ARB +
- process->current_state->
- activeTextureIndex);
- break;
- }
- case glVertexNormalTexCoord01PointerInterlaced_fake_func:
- {
- int i = 0;
- int offset = args[i++];
- int vertexPointerSize = args[i++];
- int vertexPointerType = args[i++];
- int stride = args[i++];
- int normalPointerOffset = args[i++];
- int normalPointerType = args[i++];
- int texCoord0PointerOffset = args[i++];
- int texCoord0PointerSize = args[i++];
- int texCoord0PointerType = args[i++];
- int texCoord1PointerOffset = args[i++];
- int texCoord1PointerSize = args[i++];
- int texCoord1PointerType = args[i++];
- int bytes_size = args[i++];
- void *ptr = (void *)args[i++];
-
- process->current_state->vertexPointerSize =
- MAX(process->current_state->vertexPointerSize,
- offset + bytes_size);
- process->current_state->vertexPointer =
- g_realloc(process->current_state->vertexPointer,
- process->current_state->vertexPointerSize);
- memcpy(process->current_state->vertexPointer + offset, ptr,
- bytes_size);
- glVertexPointer(vertexPointerSize, vertexPointerType, stride,
- process->current_state->vertexPointer);
- glNormalPointer(normalPointerType, stride,
- process->current_state->vertexPointer +
- normalPointerOffset);
- do_glClientActiveTextureARB(GL_TEXTURE0_ARB + 0);
- glTexCoordPointer(texCoord0PointerSize, texCoord0PointerType,
- stride,
- process->current_state->vertexPointer +
- texCoord0PointerOffset);
- do_glClientActiveTextureARB(GL_TEXTURE0_ARB + 1);
- glTexCoordPointer(texCoord1PointerSize, texCoord1PointerType,
- stride,
- process->current_state->vertexPointer +
- texCoord1PointerOffset);
- do_glClientActiveTextureARB(GL_TEXTURE0_ARB +
- process->current_state->
- activeTextureIndex);
- break;
- }
- case glVertexNormalTexCoord012PointerInterlaced_fake_func:
- {
- int i = 0;
- int offset = args[i++];
- int vertexPointerSize = args[i++];
- int vertexPointerType = args[i++];
- int stride = args[i++];
- int normalPointerOffset = args[i++];
- int normalPointerType = args[i++];
- int texCoord0PointerOffset = args[i++];
- int texCoord0PointerSize = args[i++];
- int texCoord0PointerType = args[i++];
- int texCoord1PointerOffset = args[i++];
- int texCoord1PointerSize = args[i++];
- int texCoord1PointerType = args[i++];
- int texCoord2PointerOffset = args[i++];
- int texCoord2PointerSize = args[i++];
- int texCoord2PointerType = args[i++];
- int bytes_size = args[i++];
- void *ptr = (void *)args[i++];
-
- process->current_state->vertexPointerSize =
- MAX(process->current_state->vertexPointerSize,
- offset + bytes_size);
- process->current_state->vertexPointer =
- g_realloc(process->current_state->vertexPointer,
- process->current_state->vertexPointerSize);
- memcpy(process->current_state->vertexPointer + offset, ptr,
- bytes_size);
- glVertexPointer(vertexPointerSize, vertexPointerType, stride,
- process->current_state->vertexPointer);
- glNormalPointer(normalPointerType, stride,
- process->current_state->vertexPointer +
- normalPointerOffset);
- do_glClientActiveTextureARB(GL_TEXTURE0_ARB + 0);
- glTexCoordPointer(texCoord0PointerSize, texCoord0PointerType,
- stride,
- process->current_state->vertexPointer +
- texCoord0PointerOffset);
- do_glClientActiveTextureARB(GL_TEXTURE0_ARB + 1);
- glTexCoordPointer(texCoord1PointerSize, texCoord1PointerType,
- stride,
- process->current_state->vertexPointer +
- texCoord1PointerOffset);
- do_glClientActiveTextureARB(GL_TEXTURE0_ARB + 2);
- glTexCoordPointer(texCoord2PointerSize, texCoord2PointerType,
- stride,
- process->current_state->vertexPointer +
- texCoord2PointerOffset);
- do_glClientActiveTextureARB(GL_TEXTURE0_ARB +
- process->current_state->
- activeTextureIndex);
- break;
- }
- case glVertexNormalColorTexCoord0PointerInterlaced_fake_func:
- {
- int i = 0;
- int offset = args[i++];
- int vertexPointerSize = args[i++];
- int vertexPointerType = args[i++];
- int stride = args[i++];
- int normalPointerOffset = args[i++];
- int normalPointerType = args[i++];
- int colorPointerOffset = args[i++];
- int colorPointerSize = args[i++];
- int colorPointerType = args[i++];
- int texCoord0PointerOffset = args[i++];
- int texCoord0PointerSize = args[i++];
- int texCoord0PointerType = args[i++];
- int bytes_size = args[i++];
- void *ptr = (void *)args[i++];
-
- process->current_state->vertexPointerSize =
- MAX(process->current_state->vertexPointerSize,
- offset + bytes_size);
- process->current_state->vertexPointer =
- g_realloc(process->current_state->vertexPointer,
- process->current_state->vertexPointerSize);
- memcpy(process->current_state->vertexPointer + offset, ptr,
- bytes_size);
- glVertexPointer(vertexPointerSize, vertexPointerType, stride,
- process->current_state->vertexPointer);
- glNormalPointer(normalPointerType, stride,
- process->current_state->vertexPointer +
- normalPointerOffset);
- glColorPointer(colorPointerSize, colorPointerType, stride,
- process->current_state->vertexPointer +
- colorPointerOffset);
- do_glClientActiveTextureARB(GL_TEXTURE0_ARB + 0);
- glTexCoordPointer(texCoord0PointerSize, texCoord0PointerType,
- stride,
- process->current_state->vertexPointer +
- texCoord0PointerOffset);
- do_glClientActiveTextureARB(GL_TEXTURE0_ARB +
- process->current_state->
- activeTextureIndex);
- break;
- }
- case glVertexNormalColorTexCoord01PointerInterlaced_fake_func:
- {
- int i = 0;
- int offset = args[i++];
- int vertexPointerSize = args[i++];
- int vertexPointerType = args[i++];
- int stride = args[i++];
- int normalPointerOffset = args[i++];
- int normalPointerType = args[i++];
- int colorPointerOffset = args[i++];
- int colorPointerSize = args[i++];
- int colorPointerType = args[i++];
- int texCoord0PointerOffset = args[i++];
- int texCoord0PointerSize = args[i++];
- int texCoord0PointerType = args[i++];
- int texCoord1PointerOffset = args[i++];
- int texCoord1PointerSize = args[i++];
- int texCoord1PointerType = args[i++];
- int bytes_size = args[i++];
- void *ptr = (void *)args[i++];
-
- process->current_state->vertexPointerSize =
- MAX(process->current_state->vertexPointerSize,
- offset + bytes_size);
- process->current_state->vertexPointer =
- g_realloc(process->current_state->vertexPointer,
- process->current_state->vertexPointerSize);
- memcpy(process->current_state->vertexPointer + offset, ptr,
- bytes_size);
- glVertexPointer(vertexPointerSize, vertexPointerType, stride,
- process->current_state->vertexPointer);
- glNormalPointer(normalPointerType, stride,
- process->current_state->vertexPointer +
- normalPointerOffset);
- glColorPointer(colorPointerSize, colorPointerType, stride,
- process->current_state->vertexPointer +
- colorPointerOffset);
- do_glClientActiveTextureARB(GL_TEXTURE0_ARB + 0);
- glTexCoordPointer(texCoord0PointerSize, texCoord0PointerType,
- stride,
- process->current_state->vertexPointer +
- texCoord0PointerOffset);
- do_glClientActiveTextureARB(GL_TEXTURE0_ARB + 1);
- glTexCoordPointer(texCoord1PointerSize, texCoord1PointerType,
- stride,
- process->current_state->vertexPointer +
- texCoord1PointerOffset);
- do_glClientActiveTextureARB(GL_TEXTURE0_ARB +
- process->current_state->
- activeTextureIndex);
- break;
- }
- case glVertexNormalColorTexCoord012PointerInterlaced_fake_func:
- {
- int i = 0;
- int offset = args[i++];
- int vertexPointerSize = args[i++];
- int vertexPointerType = args[i++];
- int stride = args[i++];
- int normalPointerOffset = args[i++];
- int normalPointerType = args[i++];
- int colorPointerOffset = args[i++];
- int colorPointerSize = args[i++];
- int colorPointerType = args[i++];
- int texCoord0PointerOffset = args[i++];
- int texCoord0PointerSize = args[i++];
- int texCoord0PointerType = args[i++];
- int texCoord1PointerOffset = args[i++];
- int texCoord1PointerSize = args[i++];
- int texCoord1PointerType = args[i++];
- int texCoord2PointerOffset = args[i++];
- int texCoord2PointerSize = args[i++];
- int texCoord2PointerType = args[i++];
- int bytes_size = args[i++];
- void *ptr = (void *)args[i++];
-
- process->current_state->vertexPointerSize =
- MAX(process->current_state->vertexPointerSize,
- offset + bytes_size);
- process->current_state->vertexPointer =
- g_realloc(process->current_state->vertexPointer,
- process->current_state->vertexPointerSize);
- memcpy(process->current_state->vertexPointer + offset, ptr,
- bytes_size);
- glVertexPointer(vertexPointerSize, vertexPointerType, stride,
- process->current_state->vertexPointer);
- glNormalPointer(normalPointerType, stride,
- process->current_state->vertexPointer +
- normalPointerOffset);
- glColorPointer(colorPointerSize, colorPointerType, stride,
- process->current_state->vertexPointer +
- colorPointerOffset);
- do_glClientActiveTextureARB(GL_TEXTURE0_ARB + 0);
- glTexCoordPointer(texCoord0PointerSize, texCoord0PointerType,
- stride,
- process->current_state->vertexPointer +
- texCoord0PointerOffset);
- do_glClientActiveTextureARB(GL_TEXTURE0_ARB + 1);
- glTexCoordPointer(texCoord1PointerSize, texCoord1PointerType,
- stride,
- process->current_state->vertexPointer +
- texCoord1PointerOffset);
- do_glClientActiveTextureARB(GL_TEXTURE0_ARB + 2);
- glTexCoordPointer(texCoord2PointerSize, texCoord2PointerType,
- stride,
- process->current_state->vertexPointer +
- texCoord2PointerOffset);
- do_glClientActiveTextureARB(GL_TEXTURE0_ARB +
- process->current_state->
- activeTextureIndex);
- break;
- }
- case _glVertexPointer_buffer_func:
- {
- glVertexPointer(args[0], args[1], args[2], (void *)args[3]);
- break;
- }
- case _glNormalPointer_buffer_func:
- {
- glNormalPointer(args[0], args[1], (void *)args[2]);
- break;
- }
- case _glColorPointer_buffer_func:
- {
- glColorPointer(args[0], args[1], args[2], (void *)args[3]);
- break;
- }
- case _glSecondaryColorPointer_buffer_func:
- {
- GET_EXT_PTR(void, glSecondaryColorPointer,
- (int, int, int, void *));
- ptr_func_glSecondaryColorPointer(args[0], args[1], args[2],
- (void *)args[3]);
- break;
- }
- case _glIndexPointer_buffer_func:
- {
- glIndexPointer(args[0], args[1], (void *)args[2]);
- break;
- }
- case _glTexCoordPointer_buffer_func:
- {
- glTexCoordPointer(args[0], args[1], args[2], (void *)args[3]);
- break;
- }
- case _glEdgeFlagPointer_buffer_func:
- {
- glEdgeFlagPointer(args[0], (void *)args[1]);
- break;
- }
- case _glVertexAttribPointerARB_buffer_func:
- {
- GET_EXT_PTR(void, glVertexAttribPointerARB,
- (int, int, int, int, int, void *));
- ptr_func_glVertexAttribPointerARB(args[0], args[1], args[2],
- args[3], args[4],
- (void *)args[5]);
- break;
- }
- case _glWeightPointerARB_buffer_func:
- {
- GET_EXT_PTR(void, glWeightPointerARB, (int, int, int, void *));
-
- ptr_func_glWeightPointerARB(args[0], args[1], args[2],
- (void *)args[3]);
- break;
- }
- case _glMatrixIndexPointerARB_buffer_func:
- {
- GET_EXT_PTR(void, glMatrixIndexPointerARB,
- (int, int, int, void *));
- ptr_func_glMatrixIndexPointerARB(args[0], args[1], args[2],
- (void *)args[3]);
- break;
- }
- case _glFogCoordPointer_buffer_func:
- {
- GET_EXT_PTR(void, glFogCoordPointer, (int, int, void *));
-
- ptr_func_glFogCoordPointer(args[0], args[1], (void *)args[2]);
- break;
- }
- case _glVariantPointerEXT_buffer_func:
- {
- GET_EXT_PTR(void, glVariantPointerEXT, (int, int, int, void *));
-
- ptr_func_glVariantPointerEXT(args[0], args[1], args[2],
- (void *)args[3]);
- break;
- }
- case _glDrawElements_buffer_func:
- {
- glDrawElements(args[0], args[1], args[2], (void *)args[3]);
-
-#ifdef __APPLE__
- {
- int prev_fbo;
- glGetIntegerv(GL_FRAMEBUFFER_BINDING_EXT, &prev_fbo);
- if (prev_fbo != 0) {
- glFlush();
- }
- }
-#endif
-
- break;
- }
-#ifndef _WIN32
- case _glDrawRangeElements_buffer_func:
- {
- glDrawRangeElements(args[0], args[1], args[2], args[3], args[4],
- (void *)args[5]);
- break;
- }
-#endif
- case _glMultiDrawElements_buffer_func:
- {
- GET_EXT_PTR(void, glMultiDrawElements,
- (int, int *, int, void **, int));
- ptr_func_glMultiDrawElements(args[0], (int *)args[1], args[2],
- (void **)args[3], args[4]);
-#ifdef __APPLE__
- {
- int prev_fbo;
- glGetIntegerv(GL_FRAMEBUFFER_BINDING_EXT, &prev_fbo);
- if (prev_fbo != 0) {
- glFlush();
- }
- }
-#endif
- break;
- }
-#ifdef __APPLE__
- case glDrawArrays_func:
- {
- int prev_fbo;
- glDrawArrays(ARG_TO_UNSIGNED_INT(args[0]), ARG_TO_INT(args[1]),
- ARG_TO_INT(args[2]));
- glGetIntegerv(GL_FRAMEBUFFER_BINDING_EXT, &prev_fbo);
- if (prev_fbo != 0) {
- glFlush();
- }
- break;
- }
- case glDrawElements_func:
- {
- int prev_fbo;
- glDrawElements(ARG_TO_UNSIGNED_INT(args[0]),
- ARG_TO_INT(args[1]),
- ARG_TO_UNSIGNED_INT(args[2]),
- (const void *)(args[3]));
- glGetIntegerv(GL_FRAMEBUFFER_BINDING_EXT, &prev_fbo);
- if (prev_fbo != 0) {
- glFlush();
- }
- break;
- }
-#endif
- case _glGetError_fake_func:
- {
- break;
- }
- case glGetIntegerv_func:
- {
- glGetIntegerv(args[0], (int *)args[1]);
- break;
- }
- case _glReadPixels_pbo_func:
- {
- glReadPixels(ARG_TO_INT(args[0]), ARG_TO_INT(args[1]),
- ARG_TO_INT(args[2]), ARG_TO_INT(args[3]),
- ARG_TO_UNSIGNED_INT(args[4]),
- ARG_TO_UNSIGNED_INT(args[5]), (void *)(args[6]));
- break;
- }
- case _glDrawPixels_pbo_func:
- {
- glDrawPixels(ARG_TO_INT(args[0]), ARG_TO_INT(args[1]),
- ARG_TO_UNSIGNED_INT(args[2]),
- ARG_TO_UNSIGNED_INT(args[3]),
- (const void *)(args[4]));
- break;
- }
- case _glMapBufferARB_fake_func:
- {
- GET_EXT_PTR(GLvoid *, glMapBufferARB, (GLenum, GLenum));
- GET_EXT_PTR(GLboolean, glUnmapBufferARB, (GLenum));
- int target = args[0];
- int size = args[1];
- void *dst_ptr = (void *)args[2];
- void *src_ptr = ptr_func_glMapBufferARB(target, GL_READ_ONLY);
-
- if (src_ptr) {
- memcpy(dst_ptr, src_ptr, size);
- ret.i = ptr_func_glUnmapBufferARB(target);
- } else {
- ret.i = 0;
- }
- break;
- }
- case fake_gluBuild2DMipmaps_func:
- {
- GET_GLU_PTR(GLint, gluBuild2DMipmaps,
- (GLenum arg_0, GLint arg_1, GLsizei arg_2,
- GLsizei arg_3, GLenum arg_4, GLenum arg_5,
- const GLvoid *arg_6));
- if (ptr_func_gluBuild2DMipmaps == NULL) {
- ptr_func_gluBuild2DMipmaps = mesa_gluBuild2DMipmaps;
- }
- ptr_func_gluBuild2DMipmaps(ARG_TO_UNSIGNED_INT(args[0]),
- ARG_TO_INT(args[1]),
- ARG_TO_INT(args[2]),
- ARG_TO_INT(args[3]),
- ARG_TO_UNSIGNED_INT(args[4]),
- ARG_TO_UNSIGNED_INT(args[5]),
- (const void *)(args[6]));
- break;
- }
- case _glSelectBuffer_fake_func:
- {
- process->current_state->selectBufferSize = args[0] * 4;
- process->current_state->selectBufferPtr =
- g_realloc(process->current_state->selectBufferPtr,
- process->current_state->selectBufferSize);
- glSelectBuffer(args[0], process->current_state->selectBufferPtr);
- break;
- }
- case _glGetSelectBuffer_fake_func:
- {
- void *ptr = (void *)args[0];
-
- memcpy(ptr, process->current_state->selectBufferPtr,
- process->current_state->selectBufferSize);
- break;
- }
- case _glFeedbackBuffer_fake_func:
- {
- process->current_state->feedbackBufferSize = args[0] * 4;
- process->current_state->feedbackBufferPtr =
- g_realloc(process->current_state->feedbackBufferPtr,
- process->current_state->feedbackBufferSize);
- glFeedbackBuffer((GLsizei)args[0], (GLenum)args[1],
- process->current_state->feedbackBufferPtr);
- break;
- }
- case _glGetFeedbackBuffer_fake_func:
- {
- void *ptr = (void *)args[0];
-
- memcpy(ptr, process->current_state->feedbackBufferPtr,
- process->current_state->feedbackBufferSize);
- break;
- }
- /*
- * case glEnableClientState_func: { if (display_function_call)
- * DEBUGF( "cap : %s\n", nameArrays[args[0] -
- * GL_VERTEX_ARRAY]); glEnableClientState(args[0]); break; }
- *
- * case glDisableClientState_func: { if (display_function_call)
- * DEBUGF( "cap : %s\n", nameArrays[args[0] -
- * GL_VERTEX_ARRAY]); glDisableClientState(args[0]); break; }
- *
- * case glClientActiveTexture_func: case
- * glClientActiveTextureARB_func: { if (display_function_call)
- * DEBUGF( "client activeTexture %d\n", args[0] -
- * GL_TEXTURE0_ARB); glClientActiveTextureARB(args[0]); break; }
- *
- * case glActiveTextureARB_func: { if (display_function_call)
- * DEBUGF( "server activeTexture %d\n", args[0] -
- * GL_TEXTURE0_ARB); glActiveTextureARB(args[0]); break; }
- *
- * case glLockArraysEXT_func: break;
- *
- * case glUnlockArraysEXT_func: break;
- *
- * case glArrayElement_func: { glArrayElement(args[0]); break; }
- *
- * case glDrawArrays_func: { glDrawArrays(args[0],args[1],args[2]);
- * break; }
- *
- * case glDrawElements_func: {
- * glDrawElements(args[0],args[1],args[2],(void*)args[3]); break; }
- *
- * case glDrawRangeElements_func: {
- * glDrawRangeElements(args[0],args[1],args[2],
- args[3],args[4],(void *)args[5]);
- * break; } */
- case glGetError_func:
- {
- ret.i = glGetError();
- break;
- }
- case glNewObjectBufferATI_func:
- {
- GET_EXT_PTR(int, glNewObjectBufferATI, (int, void *, int));
-
- ret.i = ptr_func_glNewObjectBufferATI(args[0],
- (void *)args[1], args[2]);
- break;
- }
- case glClear_func:
- glClear((GLbitfield)args[0]);
- break;
-#if 0
- /* HACK workaround for an unexplainable issue */
- if (args[0] & GL_COLOR_BUFFER_BIT) {
- glClear(GL_COLOR_BUFFER_BIT);
- }
- if (args[0] & GL_STENCIL_BUFFER_BIT) {
- glClear(GL_STENCIL_BUFFER_BIT);
- }
- if (args[0] & GL_DEPTH_BUFFER_BIT) {
- glClear(GL_DEPTH_BUFFER_BIT);
- }
- if (args[0] & GL_ACCUM_BUFFER_BIT) {
- glClear(GL_ACCUM_BUFFER_BIT);
- }
- break;
-#endif
-
-#ifdef _WIN32
- /* workaround for bug T_SDK-128. If GL_UNPACK_ROW_LENGTH==0, GL driver
- * should calculate it for glTexSubImage2D according to width parameter and
- * GL_UNPACK_ALIGNMENT. But on windows, some vender's driver like nvidia,
- * don't follow it. So we need do it for the driver, and probably remove
- * this hack in future if driver get fixed.
- */
- case glTexSubImage2D_func:
- {
- int origin_row_length, alignment, width;
-
- if (args[6] == GL_ALPHA) {
- width = args[4];
- glGetIntegerv(GL_UNPACK_ALIGNMENT, &alignment);
- glGetIntegerv(GL_UNPACK_ROW_LENGTH, &origin_row_length);
-
- if (width % alignment != 0) {
- width = (width / alignment + 1) * alignment;
- }
-
- glPixelStorei(GL_UNPACK_ROW_LENGTH, width);
- }
-
- glTexSubImage2D(ARG_TO_UNSIGNED_INT(args[0]), ARG_TO_INT(args[1]),
- ARG_TO_INT(args[2]), ARG_TO_INT(args[3]),
- ARG_TO_INT(args[4]), ARG_TO_INT(args[5]),
- ARG_TO_UNSIGNED_INT(args[6]),
- ARG_TO_UNSIGNED_INT(args[7]), (const void *)(args[8]));
-
- if (args[6] == GL_ALPHA) {
- glPixelStorei(GL_UNPACK_ROW_LENGTH, origin_row_length);
- }
-
- break;
- }
-#endif
-
-#ifdef __APPLE__
- case glTexSubImage2D_func:
- {
-
- glTexSubImage2D(ARG_TO_UNSIGNED_INT(args[0]), ARG_TO_INT(args[1]),
- ARG_TO_INT(args[2]), ARG_TO_INT(args[3]),
- ARG_TO_INT(args[4]), ARG_TO_INT(args[5]),
- ARG_TO_UNSIGNED_INT(args[6]), ARG_TO_UNSIGNED_INT(args[7]),
- (const void *)(args[8]));
-
- if (ARG_TO_UNSIGNED_INT(args[0]) == GL_TEXTURE_2D &&
- ARG_TO_INT(args[1]) == 0 &&
- ARG_TO_UNSIGNED_INT(args[6]) == GL_RGBA &&
- ARG_TO_UNSIGNED_INT(args[7]) == GL_UNSIGNED_BYTE) {
- mac_dump_texture();
- } else {
- fprintf(stderr, "!!! Probable screen crash, no work around "
- "as glTexSubImage2d parameters do not match!\n");
- }
-
- break;
- }
-#endif
- default:
- execute_func(func_number, (void **)args, &ret);
- break;
- }
-
- switch (ret_type) {
- case TYPE_NONE:
- case TYPE_CHAR:
- case TYPE_UNSIGNED_CHAR:
- case TYPE_INT:
- case TYPE_UNSIGNED_INT:
- break;
-
- case TYPE_CONST_CHAR:
- {
- strncpy(ret_string, (ret.s) ? ret.s : "", 32768);
- break;
- }
-
- default:
- DEBUGF("unexpected ret type : %d\n", ret_type);
- exit(-1);
- break;
- }
-
- if (display_function_call) {
- DEBUGF("[%d]< %s\n", process->p.process_id,
- tab_opengl_calls_name[func_number]);
- }
-
- return ret.i;
-}
+++ /dev/null
-/*
- * Copyright (c) 2006,2007 Even Rouault
- *
- * Modified by:
- * Gordon Williams <gordon.williams@collabora.co.uk>
- * Ian Molton <ian.molton@collabora.co.uk>
- *
- * 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
- * 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 <sys/types.h>
-
-extern void gl_disconnect(ProcessStruct *process);
-extern ProcessStruct *vmgl_get_process(pid_t pid);
-extern void vmgl_context_switch(ProcessStruct *process, int switch_gl_context);
-extern int do_function_call(ProcessStruct *process, int func_number,
- unsigned long *args, char *ret_string);
+++ /dev/null
-/*
- * Copyright (c) 2006,2007 Even Rouault
- *
- * Parts written by:
- * Gordon Williams <gordon.williams@collabora.co.uk>
- * Ian Molton <ian.molton@collabora.co.uk>
- *
- * 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
- * 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 INCLUDE_OPENGL_FUNC_H
-#define INCLUDE_OPENGL_FUNC_H
-
-#include "mesa_gl.h"
-#include "mesa_glext.h"
-#include "exec/hwaddr.h"
-
-#ifdef TARGET_X86_64
-#define TARGET_LONG_BITS 64
-#else
-#define TARGET_LONG_BITS 32
-#endif
-
-//#define NEED_CPU_H
-//#include "exec.h" // For arg_t typedef
-//#undef NEED_CPU_H
-//#include "targphys.h"
-
-/* Argument list are internally of a type that can hold a target pointer
- * or a host pointer. */
-//typedef target_phys_addr_t arg_t;
-typedef hwaddr arg_t;
-
-enum {
- TYPE_NONE,
- TYPE_CHAR,
- TYPE_UNSIGNED_CHAR,
- TYPE_SHORT,
- TYPE_UNSIGNED_SHORT,
- TYPE_INT,
- TYPE_UNSIGNED_INT,
- TYPE_FLOAT,
- TYPE_DOUBLE,
- TYPE_1CHAR,
- TYPE_2CHAR,
- TYPE_3CHAR,
- TYPE_4CHAR,
- TYPE_128UCHAR,
- TYPE_1SHORT,
- TYPE_2SHORT,
- TYPE_3SHORT,
- TYPE_4SHORT,
- TYPE_1INT,
- TYPE_2INT,
- TYPE_3INT,
- TYPE_4INT,
- TYPE_1FLOAT,
- TYPE_2FLOAT,
- TYPE_3FLOAT,
- TYPE_4FLOAT,
- TYPE_16FLOAT,
- TYPE_1DOUBLE,
- TYPE_2DOUBLE,
- TYPE_3DOUBLE,
- TYPE_4DOUBLE,
- TYPE_16DOUBLE,
- TYPE_OUT_1INT,
- TYPE_OUT_1FLOAT,
- TYPE_OUT_4CHAR,
- TYPE_OUT_4INT,
- TYPE_OUT_4FLOAT,
- TYPE_OUT_4DOUBLE,
- TYPE_OUT_128UCHAR,
- TYPE_CONST_CHAR,
- TYPE_ARRAY_CHAR,
- TYPE_ARRAY_SHORT,
- TYPE_ARRAY_INT,
- TYPE_ARRAY_FLOAT,
- TYPE_ARRAY_DOUBLE,
- TYPE_IN_IGNORED_POINTER,
- TYPE_OUT_ARRAY_CHAR,
- TYPE_OUT_ARRAY_SHORT,
- TYPE_OUT_ARRAY_INT,
- TYPE_OUT_ARRAY_FLOAT,
- TYPE_OUT_ARRAY_DOUBLE,
- TYPE_NULL_TERMINATED_STRING,
-
- TYPE_ARRAY_CHAR_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS,
- TYPE_ARRAY_SHORT_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS,
- TYPE_ARRAY_INT_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS,
- TYPE_ARRAY_FLOAT_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS,
- TYPE_ARRAY_DOUBLE_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS,
- TYPE_OUT_ARRAY_CHAR_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS,
- TYPE_OUT_ARRAY_SHORT_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS,
- TYPE_OUT_ARRAY_INT_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS,
- TYPE_OUT_ARRAY_FLOAT_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS,
- TYPE_OUT_ARRAY_DOUBLE_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS,
- /* .... */
- TYPE_LAST,
- /* .... */
- TYPE_1UCHAR = TYPE_CHAR,
- TYPE_1USHORT = TYPE_1SHORT,
- TYPE_1UINT = TYPE_1INT,
- TYPE_OUT_1UINT = TYPE_OUT_1INT,
- TYPE_OUT_4UCHAR = TYPE_OUT_4CHAR,
- TYPE_ARRAY_VOID = TYPE_ARRAY_CHAR,
- TYPE_ARRAY_SIGNED_CHAR = TYPE_ARRAY_CHAR,
- TYPE_ARRAY_UNSIGNED_CHAR = TYPE_ARRAY_CHAR,
- TYPE_ARRAY_UNSIGNED_SHORT = TYPE_ARRAY_SHORT,
- TYPE_ARRAY_UNSIGNED_INT = TYPE_ARRAY_INT,
- TYPE_OUT_ARRAY_VOID = TYPE_OUT_ARRAY_CHAR,
- TYPE_OUT_ARRAY_SIGNED_CHAR = TYPE_OUT_ARRAY_CHAR,
- TYPE_OUT_ARRAY_UNSIGNED_CHAR = TYPE_OUT_ARRAY_CHAR,
- TYPE_OUT_ARRAY_UNSIGNED_SHORT = TYPE_OUT_ARRAY_SHORT,
- TYPE_OUT_ARRAY_UNSIGNED_INT = TYPE_OUT_ARRAY_INT,
- TYPE_ARRAY_VOID_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS =
- TYPE_ARRAY_CHAR_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS,
- TYPE_ARRAY_SIGNED_CHAR_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS =
- TYPE_ARRAY_CHAR_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS,
- TYPE_ARRAY_UNSIGNED_CHAR_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS =
- TYPE_ARRAY_CHAR_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS,
- TYPE_ARRAY_UNSIGNED_SHORT_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS =
- TYPE_ARRAY_SHORT_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS,
- TYPE_ARRAY_UNSIGNED_INT_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS =
- TYPE_ARRAY_INT_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS,
- TYPE_OUT_ARRAY_VOID_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS =
- TYPE_OUT_ARRAY_CHAR_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS,
- TYPE_OUT_ARRAY_SIGNED_CHAR_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS =
- TYPE_OUT_ARRAY_CHAR_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS,
- TYPE_OUT_ARRAY_UNSIGNED_CHAR_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS =
- TYPE_OUT_ARRAY_CHAR_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS,
- TYPE_OUT_ARRAY_UNSIGNED_SHORT_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS =
- TYPE_OUT_ARRAY_SHORT_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS,
- TYPE_OUT_ARRAY_UNSIGNED_INT_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS =
- TYPE_OUT_ARRAY_INT_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS,
-};
-
-#define CASE_IN_LENGTH_DEPENDING_ON_PREVIOUS_ARGS \
- case TYPE_ARRAY_CHAR_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS: \
- case TYPE_ARRAY_SHORT_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS: \
- case TYPE_ARRAY_INT_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS: \
- case TYPE_ARRAY_FLOAT_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS: \
- case TYPE_ARRAY_DOUBLE_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS
-
-#define CASE_OUT_LENGTH_DEPENDING_ON_PREVIOUS_ARGS \
- case TYPE_OUT_ARRAY_CHAR_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS: \
- case TYPE_OUT_ARRAY_SHORT_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS: \
- case TYPE_OUT_ARRAY_INT_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS: \
- case TYPE_OUT_ARRAY_FLOAT_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS: \
- case TYPE_OUT_ARRAY_DOUBLE_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS
-
-#define CASE_IN_UNKNOWN_SIZE_POINTERS \
- case TYPE_ARRAY_CHAR: \
- case TYPE_ARRAY_SHORT: \
- case TYPE_ARRAY_INT: \
- case TYPE_ARRAY_FLOAT: \
- case TYPE_ARRAY_DOUBLE
-
-#define CASE_IN_KNOWN_SIZE_POINTERS \
- case TYPE_1CHAR:\
- case TYPE_2CHAR:\
- case TYPE_3CHAR:\
- case TYPE_4CHAR:\
- case TYPE_128UCHAR:\
- case TYPE_1SHORT:\
- case TYPE_2SHORT:\
- case TYPE_3SHORT:\
- case TYPE_4SHORT:\
- case TYPE_1INT:\
- case TYPE_2INT:\
- case TYPE_3INT:\
- case TYPE_4INT:\
- case TYPE_1FLOAT:\
- case TYPE_2FLOAT:\
- case TYPE_3FLOAT:\
- case TYPE_4FLOAT:\
- case TYPE_16FLOAT:\
- case TYPE_1DOUBLE:\
- case TYPE_2DOUBLE:\
- case TYPE_3DOUBLE:\
- case TYPE_4DOUBLE:\
- case TYPE_16DOUBLE
-
-#define CASE_OUT_UNKNOWN_SIZE_POINTERS \
- case TYPE_OUT_ARRAY_CHAR: \
- case TYPE_OUT_ARRAY_SHORT: \
- case TYPE_OUT_ARRAY_INT: \
- case TYPE_OUT_ARRAY_FLOAT: \
- case TYPE_OUT_ARRAY_DOUBLE
-
-#define CASE_OUT_KNOWN_SIZE_POINTERS \
- case TYPE_OUT_1INT: \
- case TYPE_OUT_1FLOAT: \
- case TYPE_OUT_4CHAR: \
- case TYPE_OUT_4INT: \
- case TYPE_OUT_4FLOAT: \
- case TYPE_OUT_4DOUBLE: \
- case TYPE_OUT_128UCHAR \
-
-#define CASE_IN_POINTERS CASE_IN_UNKNOWN_SIZE_POINTERS: CASE_IN_KNOWN_SIZE_POINTERS: CASE_IN_LENGTH_DEPENDING_ON_PREVIOUS_ARGS
-#define CASE_OUT_POINTERS CASE_OUT_UNKNOWN_SIZE_POINTERS: CASE_OUT_KNOWN_SIZE_POINTERS: CASE_OUT_LENGTH_DEPENDING_ON_PREVIOUS_ARGS
-
-#define CASE_POINTERS CASE_IN_POINTERS: CASE_OUT_POINTERS
-#define CASE_KNOWN_SIZE_POINTERS CASE_IN_KNOWN_SIZE_POINTERS: CASE_OUT_KNOWN_SIZE_POINTERS
-
-
-#define IS_ARRAY_CHAR(type) (type == TYPE_ARRAY_CHAR || type == TYPE_1CHAR || type == TYPE_2CHAR || type == TYPE_3CHAR || type == TYPE_4CHAR || type == TYPE_ARRAY_CHAR_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS)
-#define IS_ARRAY_SHORT(type) (type == TYPE_ARRAY_SHORT || type == TYPE_1SHORT || type == TYPE_2SHORT || type == TYPE_3SHORT || type == TYPE_4SHORT || type == TYPE_ARRAY_SHORT_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS)
-#define IS_ARRAY_INT(type) (type == TYPE_ARRAY_INT || type == TYPE_1INT || type == TYPE_2INT || type == TYPE_3INT || type == TYPE_4INT || type == TYPE_ARRAY_INT_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS)
-#define IS_ARRAY_FLOAT(type) (type == TYPE_ARRAY_FLOAT || type == TYPE_1FLOAT || type == TYPE_2FLOAT || type == TYPE_3FLOAT || type == TYPE_4FLOAT || type == TYPE_16FLOAT || type == TYPE_ARRAY_FLOAT_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS)
-#define IS_ARRAY_DOUBLE(type) (type == TYPE_ARRAY_DOUBLE || type == TYPE_1DOUBLE || type == TYPE_2DOUBLE || type == TYPE_3DOUBLE || type == TYPE_4DOUBLE || type == TYPE_16DOUBLE || type == TYPE_ARRAY_DOUBLE_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS)
-
-#define NB_MAX_TEXTURES 16
-#define MY_GL_MAX_VERTEX_ATTRIBS_ARB 16
-#define MY_GL_MAX_VERTEX_ATTRIBS_NV 16
-#define MY_GL_MAX_VARIANT_POINTER_EXT 16
-
-typedef struct {
- int ret_type;
- int has_out_parameters;
- int nb_args;
- int args_type[0];
-} Signature;
-
-static const int _init32_signature[] =
- { TYPE_NONE, 1, 3, TYPE_INT, TYPE_INT, TYPE_OUT_1INT };
-static const int _init64_signature[] =
- { TYPE_NONE, 1, 3, TYPE_INT, TYPE_INT, TYPE_OUT_1INT };
-
-static const int _resize_surface_signature[] =
- {TYPE_NONE, 0, 3, TYPE_INT, TYPE_INT, TYPE_INT};
-
-static const int _render_surface_signature[] =
- {TYPE_NONE, 1, 4, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_OUT_ARRAY_CHAR};
-
-/* XVisualInfo* glXChooseVisual( Display *dpy, int screen, int *attribList ) */
-static const int glXChooseVisual_signature[] =
- { TYPE_INT, 0, 3, TYPE_IN_IGNORED_POINTER, TYPE_INT, TYPE_ARRAY_INT };
-
-/*GLXContext glXCreateContext( Display *dpy, XVisualInfo *vis,
- GLXContext shareList, Bool direct )*/
-static const int glXCreateContext_signature[] =
- { TYPE_INT, 0, 4, TYPE_IN_IGNORED_POINTER, TYPE_INT, TYPE_INT, TYPE_INT };
-
-static const int glXCopyContext_signature[] =
- { TYPE_NONE, 0, 4, TYPE_IN_IGNORED_POINTER, TYPE_INT, TYPE_INT,
-TYPE_INT };
-
-/* void glXDestroyContext( Display *dpy, GLXContext ctx ) */
-static const int glXDestroyContext_signature[] =
- { TYPE_NONE, 0, 2, TYPE_IN_IGNORED_POINTER, TYPE_INT };
-
-/* Bool glXMakeCurrent( Display *dpy, GLXDrawable drawable, GLXContext ctx) */
-/* making it asynchronous */
-static const int glXMakeCurrent_signature[] =
- { TYPE_NONE, 0, 3, TYPE_IN_IGNORED_POINTER, TYPE_INT, TYPE_INT };
-
-/*int glXGetConfig( Display *dpy, XVisualInfo *visual,
- int attrib, int *value )*/
-static const int glXGetConfig_signature[] =
- { TYPE_INT, 1, 4, TYPE_IN_IGNORED_POINTER, TYPE_INT, TYPE_INT,
-TYPE_OUT_1INT };
-
-/* "glXGetConfig_extended"(dpy, visual_id, int n, int* attribs, int* values, int* rets) */
-static const int glXGetConfig_extended_signature[] =
- { TYPE_NONE, 1, 6, TYPE_IN_IGNORED_POINTER, TYPE_INT, TYPE_INT,
-TYPE_ARRAY_INT, TYPE_OUT_ARRAY_INT, TYPE_OUT_ARRAY_INT };
-
-/* void glXSwapBuffers( Display *dpy, GLXDrawable drawable ); */
-static const int glXSwapBuffers_signature[] =
- { TYPE_NONE, 0, 2, TYPE_IN_IGNORED_POINTER, TYPE_INT };
-
-/* Bool glXQueryVersion( Display *dpy, int *maj, int *min ) */
-static const int glXQueryVersion_signature[] =
- { TYPE_INT, 1, 3, TYPE_IN_IGNORED_POINTER, TYPE_OUT_1INT, TYPE_OUT_1INT };
-
-/* Bool glXQueryExtension( Display *dpy, int *errorBase, int *eventBase ) */
-static const int glXQueryExtension_signature[] =
- { TYPE_INT, 1, 3, TYPE_IN_IGNORED_POINTER, TYPE_OUT_1INT, TYPE_OUT_1INT };
-
-static const int glXWaitGL_signature[] = { TYPE_INT, 0, 0 };
-static const int glXWaitX_signature[] = { TYPE_INT, 0, 0 };
-
-/* GLX 1.1 and later */
-
-/* const char *glXGetClientString( Display *dpy, int name ) */
-static const int glXGetClientString_signature[] =
- { TYPE_CONST_CHAR, 0, 2, TYPE_IN_IGNORED_POINTER, TYPE_INT };
-
-/*const char *glXQueryExtensionsString( Display *dpy, int screen ) */
-static const int glXQueryExtensionsString_signature[] =
- { TYPE_CONST_CHAR, 0, 2, TYPE_IN_IGNORED_POINTER, TYPE_INT };
-
-/* const char *glXQueryServerString( Display *dpy, int screen, int name ) */
-static const int glXQueryServerString_signature[] =
- { TYPE_CONST_CHAR, 0, 3, TYPE_IN_IGNORED_POINTER, TYPE_INT, TYPE_INT };
-
-
-static const int glXGetProcAddress_fake_signature[] =
- { TYPE_INT, 0, 1, TYPE_NULL_TERMINATED_STRING };
-
-static const int glXGetProcAddress_global_fake_signature[] =
- { TYPE_NONE, 1, 3, TYPE_INT, TYPE_ARRAY_CHAR, TYPE_OUT_ARRAY_CHAR };
-
-
-/* GLX 1.3 and later */
-
-/*
-GLXFBConfig *glXChooseFBConfig( Display *dpy, int screen,
- const int *attribList, int *nitems ); */
-static const int glXChooseFBConfig_signature[] =
- { TYPE_INT, 1, 4, TYPE_IN_IGNORED_POINTER, TYPE_INT, TYPE_ARRAY_INT,
-TYPE_OUT_1INT };
-
-static const int glXChooseFBConfigSGIX_signature[] =
- { TYPE_INT, 1, 4, TYPE_IN_IGNORED_POINTER, TYPE_INT, TYPE_ARRAY_INT,
-TYPE_OUT_1INT };
-
-static const int glXGetFBConfigs_signature[] =
- { TYPE_INT, 1, 3, TYPE_IN_IGNORED_POINTER, TYPE_INT, TYPE_OUT_1INT };
-
-/* "glXGetFBConfigAttrib_extended"(dpy, fbconfig, int n, int* attribs, int* values, int* rets) */
-static const int glXGetFBConfigAttrib_extended_signature[] =
- { TYPE_NONE, 1, 6, TYPE_IN_IGNORED_POINTER, TYPE_INT, TYPE_INT,
-TYPE_ARRAY_INT, TYPE_OUT_ARRAY_INT, TYPE_OUT_ARRAY_INT };
-
-
-/* GLXPbuffer glXCreatePbuffer( Display *dpy, GLXFBConfig config,
- const int *attribList ) */
-static const int glXCreatePbuffer_signature[] =
- { TYPE_INT, 0, 3, TYPE_IN_IGNORED_POINTER, TYPE_INT, TYPE_ARRAY_INT };
-
-static const int glXCreateGLXPbufferSGIX_signature[] =
- { TYPE_INT, 0, 5, TYPE_IN_IGNORED_POINTER, TYPE_INT, TYPE_INT, TYPE_INT,
-TYPE_ARRAY_INT };
-
-static const int glXDestroyPbuffer_signature[] =
- { TYPE_NONE, 0, 2, TYPE_IN_IGNORED_POINTER, TYPE_INT };
-
-static const int glXDestroyGLXPbufferSGIX_signature[] =
- { TYPE_NONE, 0, 2, TYPE_IN_IGNORED_POINTER, TYPE_INT };
-
-/* GLXContext glXCreateNewContext(Display * dpy
- GLXFBConfig config
- int renderType
- GLXContext ShareList
- Bool Direct) */
-static const int glXCreateNewContext_signature[] =
- { TYPE_INT, 0, 5, TYPE_IN_IGNORED_POINTER, TYPE_INT, TYPE_INT, TYPE_INT,
-TYPE_INT };
-
-static const int glXCreateContextWithConfigSGIX_signature[] =
- { TYPE_INT, 0, 5, TYPE_IN_IGNORED_POINTER, TYPE_INT, TYPE_INT, TYPE_INT,
-TYPE_INT };
-
-/*XVisualInfo *glXGetVisualFromFBConfig( Display *dpy, GLXFBConfig config ) */
-static const int glXGetVisualFromFBConfig_signature[] =
- { TYPE_INT, 0, 2, TYPE_IN_IGNORED_POINTER, TYPE_INT };
-
-/*int glXGetFBConfigAttrib(Display *dpy, GLXFBConfig config, int attribute, int *value)*/
-static const int glXGetFBConfigAttrib_signature[] =
- { TYPE_INT, 1, 4, TYPE_IN_IGNORED_POINTER, TYPE_INT, TYPE_INT,
-TYPE_OUT_1INT };
-
-static const int glXGetFBConfigAttribSGIX_signature[] =
- { TYPE_INT, 1, 4, TYPE_IN_IGNORED_POINTER, TYPE_INT, TYPE_INT,
-TYPE_OUT_1INT };
-
-static const int glXQueryContext_signature[] =
- { TYPE_INT, 1, 4, TYPE_IN_IGNORED_POINTER, TYPE_INT, TYPE_INT,
-TYPE_OUT_1INT };
-
-static const int glXQueryGLXPbufferSGIX_signature[] =
- { TYPE_INT, 1, 4, TYPE_IN_IGNORED_POINTER, TYPE_INT, TYPE_INT,
-TYPE_OUT_1INT };
-
-static const int glXQueryDrawable_signature[] =
- { TYPE_NONE, 1, 4, TYPE_IN_IGNORED_POINTER, TYPE_INT, TYPE_INT,
-TYPE_OUT_1INT };
-
-/* void glXUseXFont( Font font, int first, int count, int list ) */
-static const int glXUseXFont_signature[] =
- { TYPE_NONE, 0, 4, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT };
-
-/* Bool glXIsDirect( Display *dpy, GLXContext ctx ) */
-static const int glXIsDirect_signature[] =
- { TYPE_CHAR, 0, 2, TYPE_IN_IGNORED_POINTER, TYPE_INT };
-
-static const int glXGetScreenDriver_signature[] =
- { TYPE_CONST_CHAR, 0, 2, TYPE_IN_IGNORED_POINTER, TYPE_INT };
-
-static const int glXGetDriverConfig_signature[] =
- { TYPE_CONST_CHAR, 0, 1, TYPE_NULL_TERMINATED_STRING };
-
-
-static const int glXWaitVideoSyncSGI_signature[] =
- { TYPE_INT, 1, 3, TYPE_INT, TYPE_INT, TYPE_OUT_1INT };
-
-static const int glXGetVideoSyncSGI_signature[] =
- { TYPE_INT, 1, 1, TYPE_OUT_1INT };
-
-static const int glXSwapIntervalSGI_signature[] =
- { TYPE_INT, 0, 1, TYPE_INT };
-
-static const int glXCreatePixmap_signature[] =
- { TYPE_INT, 0, 4, TYPE_IN_IGNORED_POINTER, TYPE_INT, TYPE_INT, TYPE_ARRAY_INT };
-
-static const int glXDestroyPixmap_signature[] =
- { TYPE_NONE, 0, 2, TYPE_IN_IGNORED_POINTER, TYPE_INT };
-
-static const int glXBindTexImageATI_signature[] =
- { TYPE_NONE, 0, 3, TYPE_IN_IGNORED_POINTER, TYPE_INT, TYPE_INT };
-static const int glXReleaseTexImageATI_signature[] =
- { TYPE_NONE, 0, 3, TYPE_IN_IGNORED_POINTER, TYPE_INT, TYPE_INT };
-static const int glXBindTexImageARB_fake_signature[] =
- { TYPE_INT, 0, 3, TYPE_IN_IGNORED_POINTER, TYPE_INT, TYPE_INT };
-static const int glXReleaseTexImageARB_fake_signature[] =
- { TYPE_INT, 0, 3, TYPE_IN_IGNORED_POINTER, TYPE_INT, TYPE_INT };
-
-static const int glEGLImageTargetTexture2DOES_fake_signature[] =
- { TYPE_NONE, 0, 2, TYPE_UNSIGNED_INT, TYPE_INT };
-
-/* const GLubyte * glGetString( GLenum name ) */
-static const int glGetString_signature[] =
- { TYPE_CONST_CHAR, 0, 1, TYPE_INT };
-
-/* void glShaderSourceARB (GLhandleARB handle , GLsizei size, const GLcharARB* *p_tab_prog, const GLint * tab_length) */
-/* --> void glShaderSourceARB (GLhandleARB handle , GLsizei size, const GLcharARB* all_progs, const GLint * tab_length) */
-static const int glShaderSourceARB_fake_signature[] =
- { TYPE_NONE, 0, 4, TYPE_INT, TYPE_INT, TYPE_ARRAY_CHAR, TYPE_ARRAY_INT };
-static const int glShaderSource_fake_signature[] =
- { TYPE_NONE, 0, 4, TYPE_INT, TYPE_INT, TYPE_ARRAY_CHAR, TYPE_ARRAY_INT };
-
-static const int glVertexPointer_fake_signature[] =
- { TYPE_NONE, 0, 6, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT,
-TYPE_ARRAY_CHAR };
-static const int glNormalPointer_fake_signature[] =
- { TYPE_NONE, 0, 5, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT,
-TYPE_ARRAY_CHAR };
-static const int glColorPointer_fake_signature[] =
- { TYPE_NONE, 0, 6, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT,
-TYPE_ARRAY_CHAR };
-static const int glSecondaryColorPointer_fake_signature[] =
- { TYPE_NONE, 0, 6, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT,
-TYPE_ARRAY_CHAR };
-static const int glIndexPointer_fake_signature[] =
- { TYPE_NONE, 0, 5, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT,
-TYPE_ARRAY_CHAR };
-static const int glTexCoordPointer_fake_signature[] =
- { TYPE_NONE, 0, 7, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT,
-TYPE_INT, TYPE_ARRAY_CHAR };
-static const int glEdgeFlagPointer_fake_signature[] =
- { TYPE_NONE, 0, 4, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_ARRAY_CHAR };
-static const int glVertexAttribPointerARB_fake_signature[] =
- { TYPE_NONE, 0, 8, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT,
-TYPE_INT, TYPE_INT, TYPE_ARRAY_CHAR };
-static const int glVertexAttribPointerNV_fake_signature[] =
- { TYPE_NONE, 0, 7, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT,
-TYPE_INT, TYPE_ARRAY_CHAR };
-static const int glWeightPointerARB_fake_signature[] =
- { TYPE_NONE, 0, 6, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT,
-TYPE_ARRAY_CHAR };
-static const int glMatrixIndexPointerARB_fake_signature[] =
- { TYPE_NONE, 0, 6, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT,
-TYPE_ARRAY_CHAR };
-static const int glFogCoordPointer_fake_signature[] =
- { TYPE_NONE, 0, 5, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT,
-TYPE_ARRAY_CHAR };
-static const int glInterleavedArrays_fake_signature[] =
- { TYPE_NONE, 0, 5, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT,
-TYPE_ARRAY_CHAR };
-static const int glElementPointerATI_fake_signature[] =
- { TYPE_NONE, 0, 3, TYPE_INT, TYPE_INT, TYPE_ARRAY_CHAR };
-static const int glVariantPointerEXT_fake_signature[] =
- { TYPE_NONE, 0, 6, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT,
-TYPE_ARRAY_CHAR };
-static const int glTuxRacerDrawElements_fake_signature[] =
- { TYPE_NONE, 0, 4, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_ARRAY_CHAR };
-static const int glVertexAndNormalPointer_fake_signature[] =
- { TYPE_NONE, 0, 7, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT,
-TYPE_INT, TYPE_ARRAY_CHAR };
-static const int glTexCoordPointer01_fake_signature[] =
- { TYPE_NONE, 0, 5, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT,
-TYPE_ARRAY_CHAR };
-static const int glTexCoordPointer012_fake_signature[] =
- { TYPE_NONE, 0, 5, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT,
-TYPE_ARRAY_CHAR };
-static const int glVertexNormalPointerInterlaced_fake_signature[] =
- { TYPE_NONE, 0, 8, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT,
-TYPE_INT, TYPE_INT, TYPE_ARRAY_CHAR };
-static const int glVertexNormalColorPointerInterlaced_fake_signature[] =
- { TYPE_NONE, 0, 11, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT,
-TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_ARRAY_CHAR };
-static const int glVertexColorTexCoord0PointerInterlaced_fake_signature[] =
- { TYPE_NONE, 0, 12, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT,
-TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_ARRAY_CHAR };
-static const int glVertexNormalTexCoord0PointerInterlaced_fake_signature[] =
- { TYPE_NONE, 0, 11, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT,
-TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_ARRAY_CHAR };
-static const int glVertexNormalTexCoord01PointerInterlaced_fake_signature[] =
- { TYPE_NONE, 0, 14, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT,
-TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_ARRAY_CHAR };
-static const int glVertexNormalTexCoord012PointerInterlaced_fake_signature[] =
- { TYPE_NONE, 0, 17, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT,
-TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_ARRAY_CHAR };
-static const int
- glVertexNormalColorTexCoord0PointerInterlaced_fake_signature[] =
- { TYPE_NONE, 0, 14, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT,
-TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT,
-TYPE_ARRAY_CHAR };
-static const int
- glVertexNormalColorTexCoord01PointerInterlaced_fake_signature[] =
- { TYPE_NONE, 0, 17, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT,
-TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT,
-TYPE_INT, TYPE_INT, TYPE_INT, TYPE_ARRAY_CHAR };
-static const int
- glVertexNormalColorTexCoord012PointerInterlaced_fake_signature[] =
- { TYPE_NONE, 0, 20, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT,
-TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT,
-TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_ARRAY_CHAR };
-
-static const int glGenTextures_fake_signature[] =
- { TYPE_NONE, 0, 1, TYPE_INT };
-static const int glGenBuffersARB_fake_signature[] =
- { TYPE_NONE, 0, 1, TYPE_INT };
-static const int glGenLists_fake_signature[] = { TYPE_NONE, 0, 1, TYPE_INT };
-
-static const int _glDrawElements_buffer_signature[] =
- { TYPE_NONE, 0, 4, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT };
-static const int _glDrawRangeElements_buffer_signature[] =
- { TYPE_NONE, 0, 6, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT,
-TYPE_INT };
-static const int _glMultiDrawElements_buffer_signature[] =
- { TYPE_NONE, 0, 5, TYPE_INT, TYPE_ARRAY_INT, TYPE_INT, TYPE_ARRAY_INT,
-TYPE_INT };
-
-static const int _glVertexPointer_buffer_signature[] =
- { TYPE_NONE, 0, 4, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT };
-static const int _glNormalPointer_buffer_signature[] =
- { TYPE_NONE, 0, 3, TYPE_INT, TYPE_INT, TYPE_INT };
-static const int _glColorPointer_buffer_signature[] =
- { TYPE_NONE, 0, 4, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT };
-static const int _glSecondaryColorPointer_buffer_signature[] =
- { TYPE_NONE, 0, 4, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT };
-static const int _glIndexPointer_buffer_signature[] =
- { TYPE_NONE, 0, 3, TYPE_INT, TYPE_INT, TYPE_INT };
-static const int _glTexCoordPointer_buffer_signature[] =
- { TYPE_NONE, 0, 4, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT };
-static const int _glEdgeFlagPointer_buffer_signature[] =
- { TYPE_NONE, 0, 2, TYPE_INT, TYPE_INT };
-static const int _glVertexAttribPointerARB_buffer_signature[] =
- { TYPE_NONE, 0, 6, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT,
-TYPE_INT };
-static const int _glWeightPointerARB_buffer_signature[] =
- { TYPE_NONE, 0, 4, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT };
-static const int _glMatrixIndexPointerARB_buffer_signature[] =
- { TYPE_NONE, 0, 4, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT };
-static const int _glFogCoordPointer_buffer_signature[] =
- { TYPE_NONE, 0, 3, TYPE_INT, TYPE_INT, TYPE_INT };
-static const int _glVariantPointerEXT_buffer_signature[] =
- { TYPE_NONE, 0, 4, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT };
-
-static const int _glReadPixels_pbo_signature[] =
- { TYPE_INT, 0, 7, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT,
-TYPE_INT, TYPE_INT };
-static const int _glDrawPixels_pbo_signature[] =
- { TYPE_NONE, 0, 5, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT };
-static const int _glMapBufferARB_fake_signature[] =
- { TYPE_INT, 1, 3, TYPE_INT, TYPE_INT, TYPE_OUT_ARRAY_CHAR };
-
-static const int _glSelectBuffer_fake_signature[] =
- { TYPE_NONE, 0, 1, TYPE_INT };
-static const int _glGetSelectBuffer_fake_signature[] =
- { TYPE_NONE, 1, 1, TYPE_ARRAY_CHAR };
-static const int _glFeedbackBuffer_fake_signature[] =
- { TYPE_NONE, 0, 2, TYPE_INT, TYPE_INT };
-static const int _glGetFeedbackBuffer_fake_signature[] =
- { TYPE_NONE, 1, 1, TYPE_ARRAY_CHAR };
-
-static const int _glGetError_fake_signature[] = { TYPE_NONE, 0, 0 };
-
-#include "gl_func.h"
-
-#define IS_NULL_POINTER_OK_FOR_FUNC(func_number) \
- (func_number == glBitmap_func || \
- func_number == glTexImage1D_func || \
- func_number == glTexImage2D_func || \
- func_number == glTexImage3D_func || \
- func_number == glBufferDataARB_func || \
- func_number == glNewObjectBufferATI_func)
-
-#endif // INCLUDE_OPENGL_FUNC_H
-
+++ /dev/null
-/*
- * Copyright (c) 2010 Intel Corporation
- * Written by:
- * Ian Molton <ian.molton@collabora.co.uk>
- *
- * 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
- * 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 __OPENGL_PROCESS_H
-#define __OPENGL_PROCESS_H
-
-typedef struct {
- int process_id;
- int wordsize;
- int rq_l, rrq_l;
- int sum; // Debugging only
- char *rq, *rq_p;
- char *rrq, *rrq_p;
-} ProcessStruct;
-
-#endif
+++ /dev/null
-/*
- * Parse gl.h et glx.h to auto-generate source code
- *
- * Copyright (c) 2006,2007 Even Rouault
- *
- * 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
- * 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.
- */
-
-/* gcc -g parse_gl_h.c -o parse_gl_h && ./parse_gl_h */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-#define GL_INCLUDE_PATH "../tizen/src/hw/"
-
-
-int isExtByName(const char *name)
-{
- return (strstr(name, "ARB") != NULL) ||
- (strstr(name, "IBM") != NULL) ||
- (strstr(name, "EXT") != NULL) ||
- (strstr(name, "ATI") != NULL) ||
- (strstr(name, "NV") != NULL) ||
- (strstr(name, "MESA") != NULL) ||
- (strstr(name, "APPLE") != NULL) ||
- (strstr(name, "SUN") != NULL) ||
- (strstr(name, "SGI") != NULL);
-}
-
-char *get_arg_type(char *s)
-{
- while (*s == ' ' || *s == '\t') {
- s++;
- }
- char *n = s;
- char *c = strstr(n, "const");
- if (c) {
- n += 6;
- }
-
- char *t = strstr(n, " ");
- if (t) {
- if (t[1] == '*') {
- t += 2;
- }
- t[0] = 0;
- char *ori = t;
- t = strstr(t+1, "[");
- if (t) {
- memmove(ori, t, strlen(t));
- strstr(ori, "]")[1] = 0;
- }
- }
- return strdup(s);
-}
-
-typedef struct {
- char *type;
- char *name;
- int nargs;
- char **args;
- int ok;
- int just_for_server_side;
- int has_out_parameters;
- int isExt;
-} FuncDesc;
-
-int isExt(FuncDesc *func)
-{
- return func->isExt;
-}
-
-char *get_type_string(char *type)
-{
- if (strstr(type, "[16]")) {
- if (strstr(type, "float")) {
- return "TYPE_16FLOAT";
- } else if (strstr(type, "double")) {
- return "TYPE_16DOUBLE";
- } else {
- printf("inconnu %s\n", type);
- exit(-1);
- }
- } else if (strstr(type, "[128]") && strstr(type, "GLubyte")) {
- return strstr(type, "const") ? "TYPE_128UCHAR" : "TYPE_OUT_128UCHAR";
- } else if (strstr(type, "const GLvoid *")) {
- return "TYPE_ARRAY_VOID";
- } else if (strstr(type, "const GLchar *") ||
- strstr(type, "const GLcharARB *")) {
- return "TYPE_NULL_TERMINATED_STRING";
- } else if (strstr(type, "const GLbyte *")) {
- return "TYPE_ARRAY_SIGNED_CHAR";
- } else if (strstr(type, "const GLubyte *")) {
- return "TYPE_ARRAY_UNSIGNED_CHAR";
- } else if (strstr(type, "const GLshort *")) {
- return "TYPE_ARRAY_SHORT";
- } else if (strstr(type, "const GLushort *") ||
- strstr(type, "const GLhalfNV *")) {
- return "TYPE_ARRAY_UNSIGNED_SHORT";
- } else if (strstr(type, "const GLint *")) {
- return "TYPE_ARRAY_INT";
- } else if (strstr(type, "const GLuint *") ||
- strstr(type, "const GLenum *")) {
- return "TYPE_ARRAY_UNSIGNED_INT";
- } else if (strstr(type, "const GLfloat *") ||
- strstr(type, "const GLclampf *")) {
- return "TYPE_ARRAY_FLOAT";
- } else if (strstr(type, "const GLdouble *")) {
- return "TYPE_ARRAY_DOUBLE";
- } else if (strstr(type, "GLvoid *")) {
- return "TYPE_OUT_ARRAY_VOID";
- } else if (strstr(type, "GLboolean *") ||
- strstr(type, "GLubyte *")) {
- return "TYPE_OUT_ARRAY_UNSIGNED_CHAR";
- } else if (strstr(type, "GLcharARB *") ||
- strstr(type, "GLchar *")) {
- return "TYPE_OUT_ARRAY_CHAR";
- } else if (strstr(type, "GLshort *")) {
- return "TYPE_OUT_ARRAY_SHORT";
- } else if (strstr(type, "GLushort *")) {
- return "TYPE_OUT_ARRAY_UNSIGNED_SHORT";
- } else if (strstr(type, "GLint *") ||
- strstr(type, "GLsizei *")) {
- return "TYPE_OUT_ARRAY_INT";
- } else if (strstr(type, "GLuint *") ||
- strstr(type, "GLenum *") ||
- strstr(type, "GLhandleARB *")) {
- return "TYPE_OUT_ARRAY_UNSIGNED_INT";
- } else if (strstr(type, "GLfloat *")) {
- return "TYPE_OUT_ARRAY_FLOAT";
- } else if (strstr(type, "GLdouble *")) {
- return "TYPE_OUT_ARRAY_DOUBLE";
- } else if (strcmp(type, "void") == 0) {
- return "TYPE_NONE";
- } else if (strcmp(type, "GLbyte") == 0) {
- return "TYPE_CHAR";
- } else if (strcmp(type, "GLubyte") == 0 ||
- strcmp(type, "GLboolean") == 0) {
- return "TYPE_UNSIGNED_CHAR";
- } else if (strcmp(type, "GLshort") == 0) {
- return "TYPE_SHORT";
- } else if (strcmp(type, "GLushort") == 0 ||
- strcmp(type, "GLhalfNV") == 0) {
- return "TYPE_UNSIGNED_SHORT";
- } else if (strcmp(type, "GLint") == 0 ||
- strcmp(type, "GLsizei") == 0 ||
- strcmp(type, "GLintptr") == 0 ||
- strcmp(type, "GLsizeiptr") == 0 ||
- strcmp(type, "GLintptrARB") == 0 ||
- strcmp(type, "GLsizeiptrARB") == 0) {
- return "TYPE_INT";
- } else if (strcmp(type, "GLenum") == 0 ||
- strcmp(type, "GLuint") == 0 ||
- strcmp(type, "GLhandleARB") == 0 ||
- strcmp(type, "GLbitfield") == 0) {
- return "TYPE_UNSIGNED_INT";
- } else if (strcmp(type, "GLfloat") == 0 ||
- strcmp(type, "GLclampf") == 0) {
- return "TYPE_FLOAT";
- } else if (strcmp(type, "GLdouble") == 0 ||
- strcmp(type, "GLclampd") == 0) {
- return "TYPE_DOUBLE";
- } else {
- printf("inconnu %s\n", type);
- exit(-1);
- }
-}
-
-typedef struct {
- char *letter;
- char *signature_type_name;
- char *gl_c_type_name;
- char *c_type_name;
-} ForIsKnownArgVector;
-
-#define N_ELEMENTS(x) (sizeof(x)/sizeof(x[0]))
-#define N_FIELDS_IN_ARG_VECTOR 4
-
-
-typedef struct {
- char *func_name;
- char *signature_type_name;
-} KnownLastArgFunc;
-
-static KnownLastArgFunc knownLastArgFuncs[] = {
-{"glFogCoordfv", "TYPE_1FLOAT"},
-{"glFogCoorddv", "TYPE_1DOUBLE"},
-{"glFogCoordfvEXT", "TYPE_1FLOAT"},
-{"glFogCoorddvEXT", "TYPE_1DOUBLE"},
-{"glFogCoordhvNV", "TYPE_1USHORT"},
-
-{"glGetFenceivNV", "TYPE_OUT_1INT"},
-
-{"glGetTexLevelParameteriv", "TYPE_OUT_1INT" },
-{"glGetTexLevelParameterfv", "TYPE_OUT_1FLOAT" },
-
-{"glGetRenderbufferParameterivEXT", "TYPE_OUT_1INT"},
-{"glGetFramebufferAttachmentParameterivEXT", "TYPE_OUT_1INT"},
-{"glGetFinalCombinerInputParameterivNV", "TYPE_OUT_1INT"},
-{"glGetCombinerOutputParameterivNV", "TYPE_OUT_1INT"},
-{"glGetCombinerInputParameterivNV", "TYPE_OUT_1INT"},
-{"glGetOcclusionQueryivNV", "TYPE_OUT_1INT"},
-{"glGetOcclusionQueryuivNV", "TYPE_OUT_1UINT"},
-{"glGetObjectParameterivARB", "TYPE_OUT_1INT"},
-{"glGetQueryivARB", "TYPE_OUT_1INT"},
-{"glGetQueryiv", "TYPE_OUT_1INT"},
-{"glGetQueryObjectivARB", "TYPE_OUT_1INT"},
-{"glGetQueryObjectiv", "TYPE_OUT_1INT"},
-{"glGetQueryObjectuivARB", "TYPE_OUT_1UINT"},
-{"glGetQueryObjectuiv", "TYPE_OUT_1UINT"},
-{"glGetProgramivARB", "TYPE_OUT_1INT"},
-{"glGetProgramiv", "TYPE_OUT_1INT"},
-{"glGetProgramivNV", "TYPE_OUT_1INT"},
-{"glGetShaderiv", "TYPE_OUT_1INT"},
-
-{"glCombinerParameterfvNV", "TYPE_1FLOAT"},
-{"glCombinerParameterivNV", "TYPE_1INT"},
-
-{"glGetFinalCombinerInputParameterfvNV", "TYPE_OUT_1FLOAT"},
-{"glGetCombinerOutputParameterfvNV", "TYPE_OUT_1FLOAT"},
-{"glGetCombinerInputParameterfvNV", "TYPE_OUT_1FLOAT"},
-{"glGetObjectParameterfvARB", "TYPE_OUT_1FLOAT"},
-
-{"glCombinerStageParameterfvNV", "TYPE_4FLOAT"},
-{"glGetCombinerStageParameterfvNV", "TYPE_OUT_4FLOAT"},
-
-{"glTexBumpParameterivATI", "TYPE_1INT"},
-{"glTexBumpParameterfvATI", "TYPE_1FLOAT"},
-{"glGetTexBumpParameterivATI", "TYPE_OUT_1INT"},
-{"glGetTexBumpParameterfvATI", "TYPE_OUT_1FLOAT"},
-
-{"glGetProgramLocalParameterfvARB", "TYPE_OUT_4FLOAT"},
-{"glGetProgramLocalParameterdvARB", "TYPE_OUT_4DOUBLE"},
-{"glGetProgramEnvParameterfvARB", "TYPE_OUT_4FLOAT"},
-{"glGetProgramEnvParameterdvARB", "TYPE_OUT_4DOUBLE"},
-{"glGetProgramLocalParameterIivNV", "TYPE_OUT_1INT"},
-{"glGetProgramLocalParameterIuivNV", "TYPE_OUT_1UINT"},
-{"glGetProgramEnvParameterIivNV", "TYPE_OUT_1INT"},
-{"glGetProgramEnvParameterIuivNV", "TYPE_OUT_1UINT"},
-
-{"glGetProgramParameterfvNV", "TYPE_OUT_4FLOAT"},
-{"glGetProgramParameterdvNV", "TYPE_OUT_4DOUBLE"},
-{"glGetProgramNamedParameterfvNV", "TYPE_OUT_4FLOAT"},
-{"glGetProgramNamedParameterdvNV", "TYPE_OUT_4DOUBLE"},
-
-{"glCullParameterfvEXT", "TYPE_4FLOAT"},
-{"glCullParameterdvEXT", "TYPE_4DOUBLE"},
-
-{"glGetTrackMatrixivNV", "TYPE_OUT_1INT"},
-{"glExecuteProgramNV", "TYPE_4FLOAT"},
-
-{"glEdgeFlagv", "TYPE_1UCHAR"},
-
-{"glClipPlane", "TYPE_4DOUBLE"},
-{"glGetClipPlane", "TYPE_OUT_4DOUBLE"},
-
-{"glSetFragmentShaderConstantATI", "TYPE_4FLOAT"},
-
-{"glGetObjectBufferfvATI", "TYPE_OUT_1FLOAT"},
-{"glGetObjectBufferivATI", "TYPE_OUT_1INT"},
-{"glGetArrayObjectfvATI", "TYPE_OUT_1FLOAT"},
-{"glGetArrayObjectivATI", "TYPE_OUT_1INT"},
-{"glGetVariantArrayObjectfvATI", "TYPE_OUT_1FLOAT"},
-{"glGetVariantArrayObjectivATI", "TYPE_OUT_1INT"},
-{"glGetVertexAttribArrayObjectfvATI", "TYPE_OUT_1FLOAT"},
-{"glGetVertexAttribArrayObjectivATI", "TYPE_OUT_1INT"},
-
-{"glPixelTransformParameterivEXT", "TYPE_1INT"},
-{"glPixelTransformParameterfvEXT", "TYPE_1FLOAT"},
-{"glGetPixelTransformParameterivEXT", "TYPE_OUT_1INT"},
-{"glGetPixelTransformParameterfvEXT", "TYPE_OUT_1FLOAT"},
-
-{"glColorTableParameterfv", "TYPE_4FLOAT"},
-{"glColorTableParameteriv", "TYPE_4INT"},
-{"glGetColorTableParameterfv", "TYPE_OUT_4FLOAT"},
-{"glGetColorTableParameteriv", "TYPE_OUT_4INT"},
-{"glColorTableParameterfvEXT", "TYPE_4FLOAT"},
-{"glColorTableParameterivEXT", "TYPE_4INT"},
-{"glGetColorTableParameterfvEXT", "TYPE_OUT_4FLOAT"},
-{"glGetColorTableParameterivEXT", "TYPE_OUT_4INT"},
-
-{"glGetMinmaxParameterfv", "TYPE_OUT_1FLOAT"},
-{"glGetMinmaxParameteriv", "TYPE_OUT_1INT"},
-{"glGetHistogramParameterfv", "TYPE_OUT_1FLOAT"},
-{"glGetHistogramParameteriv", "TYPE_OUT_1INT"},
-{"glGetMinmaxParameterfvEXT", "TYPE_OUT_1FLOAT"},
-{"glGetMinmaxParameterivEXT", "TYPE_OUT_1INT"},
-{"glGetHistogramParameterfvEXT", "TYPE_OUT_1FLOAT"},
-{"glGetHistogramParameterivEXT", "TYPE_OUT_1INT"},
-
-/* Not sure at all for the 2 followingo ones ! */
-{"glGetBooleanIndexedvEXT", "TYPE_OUT_4UCHAR"},
-{"glGetIntegerIndexedvEXT", "TYPE_OUT_4INT"},
-
-{"glReferencePlaneSGIX", "TYPE_4DOUBLE"},
-
-{"glGetTransformFeedbackVaryingNV", "TYPE_OUT_1INT"},
-
-};
-
-int is_known_arg_vector(FuncDesc *desc,
- char **p_signature_type_name,
- char **p_c_type_name)
-{
- static ForIsKnownArgVector my_tab[] = {
- { "b", "CHAR", "GLbyte", "signed char" },
- { "Boolean", "CHAR", "GLboolean", "unsigned char" },
- { "s", "SHORT", "GLshort", "short" },
- { "i", "INT", "GLint", "int" },
- { "Integer", "INT", "GLint", "int" },
- { "ub", "CHAR", "GLubyte", "unsigned char" },
- { "h", "SHORT", "GLhalf", "unsigned short" },
- { "us", "SHORT", "GLushort", "unsigned short" },
- { "ui", "INT", "GLuint", "unsigned int" },
- { "Nb", "CHAR", "GLbyte", "signed char" },
- { "Ns", "SHORT", "GLshort", "short" },
- { "Ni", "INT", "GLint", "int" },
- { "Nub", "CHAR", "GLubyte", "unsigned char" },
- { "Nus", "SHORT", "GLushort", "unsigned short" },
- { "Nui", "INT", "GLuint", "unsigned int" },
-
- { "f", "FLOAT", "GLfloat", "float" },
- { "Float", "FLOAT", "GLfloat", "float" },
- { "d", "DOUBLE", "GLdouble", "double" },
- };
-
- if (desc->nargs == 0) {
- return 0;
- }
-
- int i , j;
-
- if (strstr(desc->name, "glVertexAttribs") ||
- strstr(desc->name, "glProgramParameters") ||
- strstr(desc->name, "glProgramEnvParameters") ||
- strstr(desc->name, "glProgramLocalParameters") ||
- (strstr(desc->name, "glUniform") && (strstr(desc->name, "iv") ||
- strstr(desc->name, "fv")))) {
- return 0;
- }
-
- static char signatures[N_ELEMENTS(my_tab)][N_FIELDS_IN_ARG_VECTOR][20] = {0};
- char signature[10];
-
- for (i = 0; i < N_ELEMENTS(knownLastArgFuncs); i++) {
- if (strcmp(desc->name, knownLastArgFuncs[i].func_name) == 0) {
- if (p_signature_type_name) {
- *p_signature_type_name = knownLastArgFuncs[i].signature_type_name;
- }
- if (p_c_type_name) {
- if (strstr(knownLastArgFuncs[i].signature_type_name, "FLOAT")) {
- *p_c_type_name = "float";
- } else if (strstr(knownLastArgFuncs[i].signature_type_name, "DOUBLE")) {
- *p_c_type_name = "double";
- } else if (strstr(knownLastArgFuncs[i].signature_type_name, "UINT")) {
- *p_c_type_name = "unsigned int";
- } else if (strstr(knownLastArgFuncs[i].signature_type_name, "INT")) {
- *p_c_type_name = "int";
- } else if (strstr(knownLastArgFuncs[i].signature_type_name, "USHORT")) {
- *p_c_type_name = "unsigned short";
- } else if (strstr(knownLastArgFuncs[i].signature_type_name, "SHORT")) {
- *p_c_type_name = "short";
- } else if (strstr(knownLastArgFuncs[i].signature_type_name, "UCHAR")) {
- *p_c_type_name = "unsigned char";
- } else if (strstr(knownLastArgFuncs[i].signature_type_name, "CHAR")) {
- *p_c_type_name = "char";
- } else {
- assert(0);
- }
- }
- return 1;
- }
- }
-
- for (i = 0; i < N_ELEMENTS(my_tab); i++) {
- for (j = 1; j <= N_FIELDS_IN_ARG_VECTOR; j++) {
- if (strstr(desc->name, "glIndex") && strstr(desc->name, "v")) {
- sprintf(signature, "%sv", my_tab[i].letter);
- } else {
- sprintf(signature, "%d%sv", j, my_tab[i].letter);
- }
- if (strstr(desc->name, signature) &&
- strstr(desc->args[desc->nargs - 1], my_tab[i].gl_c_type_name) &&
- strstr(desc->args[desc->nargs - 1], "*")) {
- if (p_signature_type_name) {
- if (signatures[i][j-1][0] == 0) {
- sprintf(signatures[i][j-1], "TYPE_%d%s",
- j, my_tab[i].signature_type_name);
- }
- *p_signature_type_name = signatures[i][j-1];
- }
- if (p_c_type_name) {
- *p_c_type_name = my_tab[i].c_type_name;
- }
- return 1;
- }
- }
- }
- return 0;
-}
-
-static void print_server_side_argument(FILE *server_stub, int j, char *glType)
-{
- const char *symbolic_type = get_type_string(glType);
- if (strcmp(symbolic_type, "TYPE_CHAR") == 0) {
- fprintf(server_stub, "ARG_TO_CHAR(args[%d])", j);
- } else if (strcmp(symbolic_type, "TYPE_UNSIGNED_CHAR") == 0) {
- fprintf(server_stub, "ARG_TO_UNSIGNED_CHAR(args[%d])", j);
- } else if (strcmp(symbolic_type, "TYPE_SHORT") == 0) {
- fprintf(server_stub, "ARG_TO_SHORT(args[%d])", j);
- } else if (strcmp(symbolic_type, "TYPE_UNSIGNED_SHORT") == 0) {
- fprintf(server_stub, "ARG_TO_UNSIGNED_SHORT(args[%d])", j);
- } else if (strcmp(symbolic_type, "TYPE_INT") == 0) {
- fprintf(server_stub, "ARG_TO_INT(args[%d])", j);
- } else if (strcmp(symbolic_type, "TYPE_UNSIGNED_INT") == 0) {
- fprintf(server_stub, "ARG_TO_UNSIGNED_INT(args[%d])", j);
- } else if (strcmp(symbolic_type, "TYPE_FLOAT") == 0) {
- fprintf(server_stub, "ARG_TO_FLOAT(args[%d])", j);
- } else if (strcmp(symbolic_type, "TYPE_16FLOAT") == 0) {
- fprintf(server_stub, "(const float*)(args[%d])", j);
- } else if (strcmp(symbolic_type, "TYPE_DOUBLE") == 0) {
- fprintf(server_stub, "ARG_TO_DOUBLE(args[%d])", j);
- } else if (strcmp(symbolic_type, "TYPE_16DOUBLE") == 0) {
- fprintf(server_stub, "(const double*)(args[%d])", j);
- } else if (strcmp(symbolic_type, "TYPE_OUT_128UCHAR") == 0) {
- fprintf(server_stub, "(unsigned char*)(args[%d])", j);
- } else if (strcmp(symbolic_type, "TYPE_128UCHAR") == 0) {
- fprintf(server_stub, "(const unsigned char*)(args[%d])", j);
- } else if (strcmp(symbolic_type, "TYPE_NULL_TERMINATED_STRING") == 0) {
- fprintf(server_stub, "(const char*)(args[%d])", j);
- } else if (strcmp(symbolic_type, "TYPE_ARRAY_SHORT") == 0) {
- fprintf(server_stub, "(const short*)(args[%d])", j);
- } else if (strcmp(symbolic_type, "TYPE_ARRAY_UNSIGNED_SHORT") == 0) {
- fprintf(server_stub, "(const unsigned short*)(args[%d])", j);
- } else if (strcmp(symbolic_type, "TYPE_ARRAY_INT") == 0) {
- fprintf(server_stub, "(const int*)(args[%d])", j);
- } else if (strcmp(symbolic_type, "TYPE_ARRAY_UNSIGNED_INT") == 0) {
- fprintf(server_stub, "(const unsigned int*)(args[%d])", j);
- } else if (strcmp(symbolic_type, "TYPE_ARRAY_FLOAT") == 0) {
- fprintf(server_stub, "(const float*)(args[%d])", j);
- } else if (strcmp(symbolic_type, "TYPE_ARRAY_DOUBLE") == 0) {
- fprintf(server_stub, "(const double*)(args[%d])", j);
- } else if (strcmp(symbolic_type, "TYPE_ARRAY_CHAR") == 0) {
- fprintf(server_stub, "(const char*)(args[%d])", j);
- } else if (strcmp(symbolic_type, "TYPE_ARRAY_SIGNED_CHAR") == 0) {
- fprintf(server_stub, "(const signed char*)(args[%d])", j);
- } else if (strcmp(symbolic_type, "TYPE_ARRAY_VOID") == 0) {
- fprintf(server_stub, "(const void*)(args[%d])", j);
- } else if (strcmp(symbolic_type, "TYPE_ARRAY_UNSIGNED_CHAR") == 0) {
- fprintf(server_stub, "(const unsigned char*)(args[%d])", j);
- } else if (strcmp(symbolic_type, "TYPE_OUT_ARRAY_SHORT") == 0) {
- fprintf(server_stub, "(short*)(args[%d])", j);
- } else if (strcmp(symbolic_type, "TYPE_OUT_ARRAY_UNSIGNED_SHORT") == 0) {
- fprintf(server_stub, "(unsigned short*)(args[%d])", j);
- } else if (strcmp(symbolic_type, "TYPE_OUT_ARRAY_INT") == 0) {
- fprintf(server_stub, "(int*)(args[%d])", j);
- } else if (strcmp(symbolic_type, "TYPE_OUT_ARRAY_UNSIGNED_INT") == 0) {
- fprintf(server_stub, "(unsigned int*)(args[%d])", j);
- } else if (strcmp(symbolic_type, "TYPE_OUT_ARRAY_FLOAT") == 0) {
- fprintf(server_stub, "(float*)(args[%d])", j);
- } else if (strcmp(symbolic_type, "TYPE_OUT_ARRAY_DOUBLE") == 0) {
- fprintf(server_stub, "(double*)(args[%d])", j);
- } else if (strcmp(symbolic_type, "TYPE_OUT_ARRAY_VOID") == 0) {
- fprintf(server_stub, "(void*)(args[%d])", j);
- } else if (strcmp(symbolic_type, "TYPE_OUT_ARRAY_CHAR") == 0) {
- fprintf(server_stub, "(char*)(args[%d])", j);
- } else if (strcmp(symbolic_type, "TYPE_OUT_ARRAY_UNSIGNED_CHAR") == 0) {
- fprintf(server_stub, "(unsigned char*)(args[%d])", j);
- } else {
- fprintf(stderr, "Unknown : %s\n", symbolic_type);
- assert(0);
- }
-}
-
-static const char *func_dealt_by_hand[500] = { NULL };
-
-
-static const char *ignore_func[] = {
- "glGetPointerv",
- "glRectdv",
- "glRectfv",
- "glRectiv",
- "glRectsv",
- "glMultiDrawArrays",
- "glMultiDrawArraysEXT",
- "glMultiDrawElements",
- "glMultiDrawElementsEXT",
- "glUnmapBuffer",
- "glUnmapBufferARB",
- "glLoadTransposeMatrixf",
- "glLoadTransposeMatrixd",
- "glMultTransposeMatrixf",
- "glMultTransposeMatrixd",
- "glLoadTransposeMatrixfARB",
- "glLoadTransposeMatrixdARB",
- "glMultTransposeMatrixfARB",
- "glMultTransposeMatrixdARB",
-
- "glPixelDataRangeNV",
- "glFlushPixelDataRangeNV",
- "glVertexArrayRangeNV",
- "glFlushVertexArrayRangeNV",
- "glVertexWeightfEXT",
-
- "glGetBufferPointerv",
- "glGetBufferPointervARB",
- "glGetVertexAttribPointerv",
- "glGetVertexAttribPointervARB",
- "glVertexAttribPointer",
- "glVertexAttribPointerARB",
- "glGetVariantPointervEXT",
- NULL,
-};
-
-void get_func_dealt_by_hand()
-{
- FILE *f = fopen(GL_INCLUDE_PATH"gl_func_perso.h", "r");
- char buffer[256];
- int i = 0;
- char *c;
- while (fgets(buffer, 256, f)) {
- if (strstr(buffer, "MAGIC_MACRO(")) {
- func_dealt_by_hand[i] = strdup(strstr(buffer, "MAGIC_MACRO(") +
- strlen("MAGIC_MACRO("));
- *strstr(func_dealt_by_hand[i], ")") = 0;
- c = strstr(func_dealt_by_hand[i], "_");
- if (c && c != func_dealt_by_hand[i]) {
- *c = 0;
- }
- i++;
- }
- }
- fclose(f);
-
- int j = 0;
- while (ignore_func[j]) {
- func_dealt_by_hand[i] = ignore_func[j];
- i++;
- j++;
- }
-}
-
-static const char *just_for_server_side_list[] = {
- "glEnableClientState",
- "glDisableClientState",
- "glPushClientAttrib",
- "glPopClientAttrib",
- "glPixelStorei",
- "glPixelStoref",
- "glClientActiveTexture",
- "glClientActiveTextureARB",
- "glEnableVertexAttribArray",
- "glEnableVertexAttribArrayARB",
- "glDisableVertexAttribArray",
- "glDisableVertexAttribArrayARB",
- "glDrawElementArrayATI",
- "glDrawRangeElementArrayATI",
- "glGenSymbolsEXT",
- "glFreeObjectBufferATI",
- "glUnmapObjectBufferATI",
- "glLockArraysEXT",
- "glUnlockArraysEXT",
- "glDepthFunc",
- "glFogf",
- "glFogi",
- "glClipPlane",
- "glGetClipPlane",
-
-/* begin of openquartz optimization */
-#if 1
- "glMatrixMode",
- "glOrtho",
- "glFrustum",
- "glPushMatrix",
- "glPopMatrix",
- "glLoadIdentity",
- "glLoadMatrixd",
- "glLoadMatrixf",
- "glMultMatrixd",
- "glMultMatrixf",
- "glRotated",
- "glRotatef",
- "glScaled",
- "glScalef",
- "glTranslated",
- "glTranslatef",
-#endif
-/* end of openquartz optimization */
-
- "glGetError",
- "glActiveTextureARB",
-
- "glViewport",
- "glScissor",
-
- "glBindBufferARB",
- "glDeleteBuffersARB",
- "glGenBuffersARB",
- "glBufferDataARB",
- "glBufferSubDataARB",
- "glGetBufferSubDataARB",
- "glGetBufferParameterivARB",
- "glBindBuffer",
- "glDeleteBuffers",
- "glGenBuffers",
- "glBufferData",
- "glBufferSubData",
- "glGetBufferSubData",
- "glGetBufferParameteriv",
-
- "glPushAttrib",
- "glPopAttrib",
- "glEnable",
- "glDisable",
- "glIsEnabled",
- "glBindTexture",
- "glBindTextureEXT",
- "glFogfv",
- "glFogiv",
- "glBitmap",
- "glGetTexImage",
- "glReadPixels",
- "glDrawPixels",
- "glSelectBuffer",
- "glFeedbackBuffer",
-
- "glTexImage1D",
- "glTexImage2D",
- "glTexImage3D",
- "glTexSubImage1D",
- "glTexSubImage2D",
- "glTexSubImage3D",
-
- "glTexImage3DEXT",
- "glTexSubImage1DEXT",
- "glTexSubImage2DEXT",
- "glTexSubImage3DEXT",
-
- "glGetCompressedTexImage",
- "glCompressedTexImage1D",
- "glCompressedTexImage2D",
- "glCompressedTexImage3D",
- "glCompressedTexSubImage1D",
- "glCompressedTexSubImage2D",
- "glCompressedTexSubImage3D",
-
- "glGetCompressedTexImageARB",
- "glCompressedTexImage1DARB",
- "glCompressedTexImage2DARB",
- "glCompressedTexImage3DARB",
- "glCompressedTexSubImage1DARB",
- "glCompressedTexSubImage2DARB",
- "glCompressedTexSubImage3DARB",
-
- "glCallLists",
- "glNewList",
- "glDeleteLists",
- "glGenLists",
-
- "glGenTextures",
- "glDeleteTextures",
- "glDeleteTexturesEXT",
- "glMap1f",
- "glMap1d",
- "glMap2f",
- "glMap2d",
- "glGetMapdv",
- "glGetMapfv",
- "glGetMapiv",
- "glGetBooleanv",
- "glGetIntegerv",
- "glGetFloatv",
- "glGetDoublev",
-
- "glGetPixelMapfv",
- "glGetPixelMapuiv",
- "glGetPixelMapusv",
- "glGetProgramStringARB",
- "glGetProgramStringNV",
- "glArrayElement",
- "glDrawArrays",
- "glDrawElements",
- "glDrawRangeElements",
- "glDrawRangeElementsEXT",
- "glGetProgramInfoLog",
- "glGetTexLevelParameteriv",
- "glGetInfoLogARB",
- "glGetShaderInfoLog",
- "glGetAttachedObjectsARB",
- "glGetAttachedShaders",
- "glGetActiveUniformARB",
- "glGetActiveUniform",
- "glGetUniformLocationARB",
- "glGetUniformLocation",
- "glGetUniformfvARB",
- "glGetUniformfv",
- "glGetUniformivARB",
- "glGetUniformiv",
- "glGetUniformuivEXT",
- "glGetShaderSourceARB",
- "glGetShaderSource",
- "glGetActiveAttribARB",
- "glGetActiveAttrib",
- "glGetAttribLocationARB",
- "glGetAttribLocation",
-
- "glNewObjectBufferATI",
- "glUpdateObjectBufferATI",
-
- "glSetLocalConstantEXT",
- "glSetInvariantEXT",
- "glVariantbvEXT",
- "glVariantsvEXT",
- "glVariantivEXT",
- "glVariantfvEXT",
- "glVariantdvEXT",
- "glVariantubvEXT",
- "glVariantusvEXT",
- "glVariantuivEXT",
- "glGetVariantBooleanvEXT",
- "glGetVariantIntegervEXT",
- "glGetVariantFloatvEXT",
- "glGetInvariantBooleanvEXT",
- "glGetInvariantIntegervEXT",
- "glGetInvariantFloatvEXT",
- "glGetLocalConstantBooleanvEXT",
- "glGetLocalConstantIntegervEXT",
- "glGetLocalConstantFloatvEXT",
-
- "glMatrixIndexubvARB",
- "glMatrixIndexusvARB",
- "glMatrixIndexuivARB",
-
- "glColorTable",
- "glColorSubTable",
- "glGetColorTable",
- "glConvolutionFilter1D",
- "glConvolutionFilter2D",
- "glGetConvolutionFilter",
- "glSeparableFilter2D",
- "glGetSeparableFilter",
- "glGetHistogram",
- "glGetMinmax",
- "glColorTableEXT",
- "glColorSubTableEXT",
- "glGetColorTableEXT",
- "glConvolutionFilter1DEXT",
- "glConvolutionFilter2DEXT",
- "glGetConvolutionFilterEXT",
- "glSeparableFilter2DEXT",
- "glGetSeparableFilterEXT",
- "glGetHistogramEXT",
- "glGetMinmaxEXT",
-
- "glGetTexParameterfv",
-
- "glGetVertexAttribivARB",
- "glGetVertexAttribfvARB",
- "glGetVertexAttribdvARB",
- "glGetVertexAttribiv",
- "glGetVertexAttribfv",
- "glGetVertexAttribdv",
-
- "glGetDetailTexFuncSGIS",
- "glGetSharpenTexFuncSGIS",
-
- "fake_gluBuild2DMipmaps",
-
- "glRenderMode",
-
- "glEnableVariantClientStateEXT",
- "glDisableVariantClientStateEXT",
-
- "glGetActiveVaryingNV",
-
- NULL,
-};
-
-static int just_for_server_side_func(char *funcname)
-{
- int i;
- for (i = 0; just_for_server_side_list[i]; i++) {
- if (strcmp(just_for_server_side_list[i], funcname) == 0) {
- return 1;
- }
- }
- return 0;
-}
-
-int parse(FILE *f, FuncDesc *funcDesc, int funcDescCount, int ignoreEXT)
-{
- char buffer[256];
- while (fgets(buffer, 256, f)) {
-
- if (strncmp(buffer, "GLAPI", 5) == 0 &&
- strstr(buffer, "APIENTRY") &&
- strstr(buffer, "(")) {
- int i = 0;
- int skip = 0;
- if (func_dealt_by_hand[0] == 0) {
- get_func_dealt_by_hand();
- }
- while (func_dealt_by_hand[i]) {
- if (strstr(buffer, func_dealt_by_hand[i])) {
- skip = 1;
- break;
- }
- i++;
- }
- if (skip) {
- continue;
- }
-
- char **args = malloc(15 * sizeof(char *));
- int narg = 0;
- char *type = buffer + 6;
- char *n = strstr(type, "GLAPIENTRY") ?
- strstr(type, "GLAPIENTRY") : strstr(type, "APIENTRY");
- int skip_length = strstr(type, "GLAPIENTRY") ? 11 : 9;
- n[-1] = 0;
- type = strdup(type);
- n += skip_length;
- char *fonc = n;
- n = strstr(n, "(");
- if (n[-1] == ' ') {
- n[-1] = 0;
- }
- n[0] = 0;
- fonc = strdup(fonc);
- /*if (strstr(fonc, "glLockArraysEXT") ||
- strstr(fonc, "glUnlockArraysEXT")) {
- } else*/
-
- if (ignoreEXT == 1 && isExtByName(fonc)) {
- free(type);
- free(fonc);
- free(args);
- continue;
- }
- n++;
- while (1) {
- char *virg = strstr(n, ",");
- if (virg) {
- args[narg] = n;
- virg[0] = 0;
- args[narg] = get_arg_type(args[narg]);
- narg++;
- n = virg+1;
- } else {
- break;
- }
- }
- while (strstr(n, ")") == 0) {
- fgets(buffer, 256, f);
- n = buffer;
- while (1) {
- char *virg = strstr(n, ",");
- if (virg) {
- args[narg] = n;
- virg[0] = 0;
- args[narg] = get_arg_type(args[narg]);
- narg++;
- n = virg+1;
- } else {
- break;
- }
- }
- }
- char *par = strstr(n, ")");
- args[narg] = n;
- par[0] = 0;
- args[narg] = get_arg_type(args[narg]);
- narg++;
-
-
- /*printf("%s %s (", type, fonc);
- for (i = 0; i < narg; i++) {
- printf("%s,", args[i]);
- }
- printf(")\n");*/
-
- for (i = 0; i < funcDescCount; i++) {
- if (strcmp(funcDesc[i].name, fonc) == 0) {
- if (ignoreEXT == 0) {
- funcDesc[i].isExt = 1;
- }
- break;
- }
- }
- if (i == funcDescCount) {
- funcDesc[funcDescCount].type = type;
- funcDesc[funcDescCount].name = fonc;
- funcDesc[funcDescCount].nargs = narg;
- funcDesc[funcDescCount].args = args;
- funcDesc[funcDescCount].isExt = ignoreEXT == 0;
- funcDescCount++;
- } else {
- free(fonc);
- free(args);
- free(type);
- }
- /*
- for (i = 0; i < narg; i++) {
- free(args[i]);
- }
- free(fonc);
- free(type);*/
- }
- }
- return funcDescCount;
-}
-
-typedef struct {
- char *str;
- int i;
-} StringIntStruct;
-
-StringIntStruct argDependingOnPreviousArgTab[] = {
- { "glLoadProgramNV", 3},
- { "ProgramNamedParameter", 2},
- { "glDeleteBuffers", 1},
- { "glDrawBuffers", 1},
- { "glGenPrograms", 1},
- { "glDeletePrograms", 1},
- { "glGenQueries", 1},
- { "glDeleteQueries", 1},
- { "glGenFencesNV", 1},
- { "glDeleteFencesNV", 1},
- { "glGenOcclusionQueriesNV", 1},
- { "glDeleteOcclusionQueriesNV", 1},
- { "glRequestResidentProgramsNV", 1},
- { "glDeleteTextures", 1},
- { "glGenFramebuffersEXT", 1},
- { "glDeleteFramebuffersEXT", 1},
- { "glGenRenderbuffersEXT", 1},
- { "glDeleteRenderbuffersEXT", 1},
- { "glUniform1fv", 2},
- { "glUniform2fv", 2},
- { "glUniform3fv", 2},
- { "glUniform4fv", 2},
- { "glUniform1iv", 2},
- { "glUniform2iv", 2},
- { "glUniform3iv", 2},
- { "glUniform4iv", 2},
- { "glUniform1uivEXT", 2},
- { "glUniform2uivEXT", 2},
- { "glUniform3uivEXT", 2},
- { "glUniform4uivEXT", 2},
- { "glProgramParameters4fvNV", 3},
- { "glProgramParameters4dvNV", 3},
- { "glProgramLocalParameters4fvEXT", 3},
- { "glProgramLocalParametersI4ivNV", 3},
- { "glProgramLocalParametersI4uivNV", 3},
- { "glProgramEnvParameters4fvEXT", 3},
- { "glProgramEnvParametersI4ivNV", 3},
- { "glProgramEnvParametersI4uivNV", 3},
- { "glAreProgramsResidentNV", 1} ,
- { "glAreProgramsResidentNV", 2} ,
- { "glAreTexturesResident", 1} ,
- { "glAreTexturesResident", 2} ,
- { "glPrioritizeTextures", 1} ,
- { "glPrioritizeTextures", 2} ,
- { "glProgramStringARB", 3} ,
-
- { "glVertexAttribs", 2},
-
- { "glUniformMatrix", 3 },
-
- { "glGetVertexAttribfv", 2},
- { "glGetVertexAttribiv", 2},
- { "glGetVertexAttribdv", 2},
- { "glGetVertexAttribIivEXT", 2},
- { "glGetVertexAttribIuivEXT", 2},
-
- { "glPointParameterfv", 1},
- { "glPointParameteriv", 1},
-
- { "glWeightbvARB", 1},
- { "glWeightsvARB", 1},
- { "glWeightivARB", 1},
- { "glWeightfvARB", 1},
- { "glWeightdvARB", 1},
- { "glWeightubvARB", 1},
- { "glWeightusvARB", 1},
- { "glWeightuivARB", 1},
-
- { "glTexEnvfv", 2},
- { "glTexEnviv", 2},
- { "glGetTexEnvfv", 2},
- { "glGetTexEnviv", 2},
- { "glTexGendv", 2},
- { "glTexGenfv", 2},
- { "glTexGeniv", 2},
- { "glGetTexGendv", 2},
- { "glGetTexGenfv", 2},
- { "glGetTexGeniv", 2},
-
- { "glLightfv", 2},
- { "glLightiv", 2},
- { "glGetLightfv", 2},
- { "glGetLightiv", 2},
- { "glFragmentLightfvSGIX", 2},
- { "glFragmentLightivSGIX", 2},
- { "glGetFragmentLightfvSGIX", 2},
- { "glGetFragmentLightivSGIX", 2},
-
-
- { "glLightModelfv", 1},
- { "glLightModeliv", 1},
- { "glFragmentLightModelfvSGIX", 1},
- { "glFragmentLightModelivSGIX", 1},
-
- { "glMaterialfv", 2},
- { "glMaterialiv", 2},
- { "glGetMaterialfv", 2},
- { "glGetMaterialiv", 2},
- { "glFragmentMaterialfvSGIX", 2},
- { "glFragmentMaterialivSGIX", 2},
- { "glGetFragmentMaterialfvSGIX", 2},
- { "glGetFragmentMaterialivSGIX", 2},
-
- { "glFogiv", 1},
- { "glFogfv", 1},
-
- { "glTexParameterfv", 2},
- { "glTexParameteriv", 2},
- { "glGetTexParameterfv", 2},
- { "glGetTexParameteriv", 2},
-
- { "glTexParameterIivEXT", 2},
- { "glTexParameterIuivEXT", 2},
- { "glGetTexParameterIivEXT", 2},
- { "glGetTexParameterIuivEXT", 2},
-
- { "glPixelMapfv", 2},
- { "glPixelMapuiv", 2},
- { "glPixelMapusv", 2},
-
- { "glDetailTexFuncSGIS", 2 },
- { "glSharpenTexFuncSGIS", 2 },
-
- { "glSpriteParameterfvSGIX", 1 },
- { "glSpriteParameterivSGIX", 1 },
-
- { "ConvolutionParameter", 2},
-
- { "glProgramBufferParametersfvNV", 4},
- { "glProgramBufferParametersIivNV", 4},
- { "glProgramBufferParametersIuivNV", 4},
-
- { "glTransformFeedbackAttribsNV", 1},
- { "glTransformFeedbackVaryingsNV", 2},
-};
-
-int is_arg_of_length_depending_on_previous_args(FuncDesc *funcDesc, int j)
-{
- int i;
- if (strstr(funcDesc->args[j], "*") == NULL) {
- return 0;
- }
- for (i = 0; i < N_ELEMENTS(argDependingOnPreviousArgTab); i++) {
- if (strstr(funcDesc->name, argDependingOnPreviousArgTab[i].str) &&
- j == argDependingOnPreviousArgTab[i].i) {
- return 1;
- }
- }
- return 0;
-}
-
-static void fprintf_prototype_args(FILE *f, FuncDesc *funcDesc)
-{
- int j;
- for (j = 0; j < funcDesc->nargs; j++) {
- if (j != 0) {
- fprintf(f, ", ");
- }
- if (strstr(funcDesc->args[j], "[16]")) {
- if (strstr(funcDesc->args[j], "float")) {
- fprintf(f, "const GLfloat arg_%d[16]", j);
- } else if (strstr(funcDesc->args[j], "double")) {
- fprintf(f, "const GLdouble arg_%d[16]", j);
- } else {
- exit(-1);
- }
- } else if (strstr(funcDesc->args[j], "[128]") &&
- strstr(funcDesc->args[j], "GLubyte")) {
- fprintf(f, (strstr(funcDesc->args[j], "const")) ?
- "const GLubyte* arg_%d" : "GLubyte* arg_%d", j);
- } else {
- fprintf(f, "%s arg_%d", funcDesc->args[j], j);
- }
- }
- if (j == 0) {
- fprintf(f, "void");
- }
-}
-
-int main(int argc, char *argv[])
-{
- FuncDesc funcDesc[3000];
- int funcDescCount = 0;
- FILE *f;
-
- printf("***** path : %s\n", GL_INCLUDE_PATH"mesa_gl.h");
- f = fopen(GL_INCLUDE_PATH"mesa_gl.h", "r");
- assert(f);
- /*if (!f) {
- f = fopen("/usr/include/GL/gl.h", "r");
- }*/
- funcDescCount = parse(f, funcDesc, 0, 1);
- fclose(f);
-
- f = fopen(GL_INCLUDE_PATH"mesa_glext.h", "r");
- assert(f);
- /*if (!f) {
- f = fopen("/usr/include/GL/glext.h", "r");
- }*/
- funcDescCount = parse(f, funcDesc, funcDescCount, 0);
- fclose(f);
-
- FILE *header = fopen("gl_func.h", "w");
- FILE *client_stub = fopen("client_stub.c", "w");
- FILE *server_stub = fopen("server_stub.c", "w");
-
- fprintf(header,
- "/* This is a generated file by parse_gl_h.c - DO NOT EDIT ! */\n\n");
- fprintf(header, "union gl_ret_type {\n"
- "const char *s;\n"
- "int i;\n"
- "char c;\n"
- "};\n");
-
- fprintf(header, "#define COMPOSE(x,y) x##y\n");
- fprintf(header, "#define MAGIC_MACRO(x) COMPOSE(x,_func)\n");
- fprintf(header, "enum {\n"
- "#include \"gl_func_perso.h\"\n");
-
- fprintf(client_stub,
- "/* This is a generated file by parse_gl_h.c - DO NOT EDIT ! */\n\n");
-
- fprintf(server_stub,
- "/* This is a generated file by parse_gl_h.c - DO NOT EDIT ! */\n\n");
-
- int i;
- for (i = 0; i < funcDescCount; i++) {
- funcDesc[i].ok = 0;
- char *name = funcDesc[i].name;
- char *type = funcDesc[i].type;
- if ((strcmp(type, "void") == 0 || strcmp(type, "GLboolean") == 0 ||
- strcmp(type, "GLuint") == 0 || strcmp(type, "GLint") == 0 ||
- strcmp(type, "GLenum") == 0) || strcmp(type, "GLhandleARB") == 0 ||
- strcmp(type, "GLhalf") == 0 || strcmp(type, "GLhalfNV") == 0) {
- int pointer_of_unknown_size = 0;
- int j;
-
- if (funcDesc[i].nargs == 1 && strcmp(funcDesc[i].args[0], "void") == 0) {
- funcDesc[i].nargs = 0;
- }
- for (j = 0; j < funcDesc[i].nargs-1; j++) {
- if (!is_arg_of_length_depending_on_previous_args(
- &funcDesc[i], j) &&
- strstr(funcDesc[i].args[j], "const GLchar") == NULL &&
- strstr(funcDesc[i].args[j], "[16]") == NULL) {
- pointer_of_unknown_size |= strstr(funcDesc[i].args[j], "*") != NULL;
- pointer_of_unknown_size |= strstr(funcDesc[i].args[j], "[") != NULL;
- }
- }
-
- if (pointer_of_unknown_size == 0) {
- char *signature_type_name;
- if (is_known_arg_vector(&funcDesc[i], &signature_type_name, NULL)) {
- if (strstr(signature_type_name, "TYPE_OUT")) {
- funcDesc[i].has_out_parameters = 1;
- }
- } else {
- if (funcDesc[i].nargs-1 >= 0) {
- j = funcDesc[i].nargs-1;
- if (!is_arg_of_length_depending_on_previous_args(&funcDesc[i], j) &&
- strstr(funcDesc[i].args[j], "const GLchar") == NULL &&
- strstr(funcDesc[i].args[j], "[16]") == NULL) {
- pointer_of_unknown_size |=
- strstr(funcDesc[i].args[j], "*") != NULL;
- pointer_of_unknown_size |=
- strstr(funcDesc[i].args[j], "[") != NULL;
- }
- }
- }
- }
- if (pointer_of_unknown_size && funcDesc[i].nargs == 1) {
- if (strstr(funcDesc[i].name, "Matrixf") ||
- strstr(funcDesc[i].name, "Matrixd")) {
- free(funcDesc[i].args[0]);
- if (strstr(funcDesc[i].name, "Matrixf")) {
- funcDesc[i].args[0] = strdup("GLfloat m[16]");
- } else {
- funcDesc[i].args[0] = strdup("GLdouble m[16]");
- }
- pointer_of_unknown_size = 0;
- } else if (strcmp(funcDesc[i].name, "glPolygonStipple") == 0) {
- free(funcDesc[i].args[0]);
- funcDesc[i].args[0] = strdup("const GLubyte mask[128]");
- pointer_of_unknown_size = 0;
- } else if (strcmp(funcDesc[i].name, "glGetPolygonStipple") == 0) {
- free(funcDesc[i].args[0]);
- funcDesc[i].args[0] = strdup("GLubyte mask[128]");
- funcDesc[i].has_out_parameters = 1;
- pointer_of_unknown_size = 0;
- }
- }
- if (just_for_server_side_func(name) || pointer_of_unknown_size == 0) {
- fprintf(header, " %s_func,\n", funcDesc[i].name);
- funcDesc[i].ok = 1;
- if (just_for_server_side_func(name)) {
- funcDesc[i].just_for_server_side = 1;
- }
- for (j = 0; j < funcDesc[i].nargs; j++) {
- if (strstr(get_type_string(funcDesc[i].args[j]), "OUT")) {
- funcDesc[i].has_out_parameters = 1;
- }
- }
- } else {
- fprintf(stderr, "not handled either manually or automatically : %s\n",
- funcDesc[i].name);
- }
- }
- }
-
- fprintf(header, " GL_N_CALLS\n};\n");
-
-
- fprintf(server_stub, "static void execute_func(int func_number, void **args,"
- " union gl_ret_type *pret)\n");
- fprintf(server_stub, "{\n");
- fprintf(server_stub, " switch(func_number)\n");
- fprintf(server_stub, " {\n");
-
-
- for (i = 0; i < funcDescCount; i++) {
- if (funcDesc[i].ok) {
- fprintf(header, "static const int %s_signature[] = { %s, %d, ",
- funcDesc[i].name,
- get_type_string(funcDesc[i].type),
- funcDesc[i].has_out_parameters);
- fprintf(header, "%d", funcDesc[i].nargs);
- int j;
- char *signature_type_name;
- int n_args_to_check =
- is_known_arg_vector(&funcDesc[i], &signature_type_name, NULL) ?
- funcDesc[i].nargs - 1 : funcDesc[i].nargs;
-
- for (j = 0; j < n_args_to_check; j++) {
- if (is_arg_of_length_depending_on_previous_args(&funcDesc[i], j)) {
- fprintf(header, ", %s_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS",
- get_type_string(funcDesc[i].args[j]));
- } else {
- fprintf(header, ", %s", get_type_string(funcDesc[i].args[j]));
- }
- }
-
- if (is_known_arg_vector(&funcDesc[i], &signature_type_name, NULL)) {
- fprintf(header, ", %s", signature_type_name);
- }
- fprintf(header, "};\n");
-
-
- if (funcDesc[i].just_for_server_side == 0) {
- if (isExt(&funcDesc[i])) {
- fprintf(client_stub, "GLAPI %s APIENTRY EXT_FUNC(%s) (",
- funcDesc[i].type, funcDesc[i].name);
- } else {
- fprintf(client_stub, "GLAPI %s APIENTRY %s(",
- funcDesc[i].type, funcDesc[i].name);
- }
- fprintf_prototype_args(client_stub, &funcDesc[i]);
- fprintf(client_stub, ")\n");
- fprintf(client_stub, "{\n");
- if (strcmp(funcDesc[i].type, "void") != 0) {
- fprintf(client_stub, " %s ret;\n", funcDesc[i].type);
- if (isExt(&funcDesc[i])) {
- fprintf(client_stub, " CHECK_PROC_WITH_RET(%s);\n",
- funcDesc[i].name);
- }
- } else {
- if (isExt(&funcDesc[i])) {
- fprintf(client_stub, " CHECK_PROC(%s);\n", funcDesc[i].name);
- }
- }
-
- /*
- fprintf(client_stub, " do_opengl_call(%s_func, %s",
- funcDesc[i].name,
- (strcmp(funcDesc[i].type, "void") == 0) ? "NULL" : "&ret");
- for (j = 0; j < funcDesc[i].nargs; j++) {
- fprintf(client_stub, ", arg_%d", j);
- }
- fprintf(client_stub, ");\n");
- */
-
- if (funcDesc[i].nargs) {
- fprintf(client_stub, " long args[] = { ");
- for (j = 0; j < funcDesc[i].nargs; j++) {
- if (j > 0) {
- fprintf(client_stub, ", ");
- }
- if (strstr(funcDesc[i].args[j], "*")) {
- fprintf(client_stub, "POINTER_TO_ARG(arg_%d)", j);
- } else {
- const char *symbolic_type = get_type_string(funcDesc[i].args[j]);
- if (strcmp(symbolic_type, "TYPE_CHAR") == 0) {
- fprintf(client_stub, "CHAR_TO_ARG");
- } else if (strcmp(symbolic_type, "TYPE_UNSIGNED_CHAR") == 0) {
- fprintf(client_stub, "UNSIGNED_CHAR_TO_ARG");
- } else if (strcmp(symbolic_type, "TYPE_SHORT") == 0) {
- fprintf(client_stub, "SHORT_TO_ARG");
- } else if (strcmp(symbolic_type, "TYPE_UNSIGNED_SHORT") == 0) {
- fprintf(client_stub, "UNSIGNED_SHORT_TO_ARG");
- } else if (strcmp(symbolic_type, "TYPE_INT") == 0) {
- fprintf(client_stub, "INT_TO_ARG");
- } else if (strcmp(symbolic_type, "TYPE_UNSIGNED_INT") == 0) {
- fprintf(client_stub, "UNSIGNED_INT_TO_ARG");
- } else if (strcmp(symbolic_type, "TYPE_FLOAT") == 0) {
- fprintf(client_stub, "FLOAT_TO_ARG");
- } else if (strcmp(symbolic_type, "TYPE_16FLOAT") == 0) {
- fprintf(client_stub, "POINTER_TO_ARG");
- } else if (strcmp(symbolic_type, "TYPE_DOUBLE") == 0) {
- fprintf(client_stub, "DOUBLE_TO_ARG");
- } else if (strcmp(symbolic_type, "TYPE_16DOUBLE") == 0) {
- fprintf(client_stub, "POINTER_TO_ARG");
- } else if (strcmp(symbolic_type, "TYPE_128UCHAR") == 0 ||
- strcmp(symbolic_type, "TYPE_OUT_128UCHAR") == 0) {
- fprintf(client_stub, "POINTER_TO_ARG");
- } else {
- fprintf(stderr, "Unknown : %s\n", symbolic_type);
- assert(0);
- }
- fprintf(client_stub, "(arg_%d)", j);
- }
- }
- fprintf(client_stub, "};\n");
- }
-
- fprintf(client_stub, " do_opengl_call(%s_func, %s, %s, NULL);\n",
- funcDesc[i].name,
- (strcmp(funcDesc[i].type, "void") == 0) ? "NULL" : "&ret",
- (funcDesc[i].nargs) ? "args" : "NULL");
-
- if (strcmp(funcDesc[i].type, "void") != 0) {
- fprintf(client_stub, " return ret;\n");
- }
- fprintf(client_stub, "}\n\n");
- }
-
- fprintf(server_stub, " case %s_func:\n", funcDesc[i].name);
- fprintf(server_stub, " {\n");
-
- if (isExt(&funcDesc[i])) {
- fprintf(server_stub, " GET_EXT_PTR(%s, %s, (",
- funcDesc[i].type, funcDesc[i].name);
- fprintf_prototype_args(server_stub, &funcDesc[i]);
- fprintf(server_stub, "));\n");
- }
-
- fprintf(server_stub, " ");
-
- if (strcmp(funcDesc[i].type, "void") == 0) {
- ;
- } else if (strcmp(get_type_string(funcDesc[i].type), "TYPE_INT") == 0 ||
- strcmp(get_type_string(funcDesc[i].type),
- "TYPE_UNSIGNED_INT") == 0) {
- fprintf(server_stub, "pret->i = ");
- } else if (strcmp(get_type_string(funcDesc[i].type), "TYPE_CHAR") == 0 ||
- strcmp(get_type_string(funcDesc[i].type),
- "TYPE_UNSIGNED_CHAR") == 0) {
- fprintf(server_stub, "pret->c = ");
- } else {
- fprintf(stderr, "unknown ret type = %s\n",
- get_type_string(funcDesc[i].type));
- exit(-1);
- }
- /* if (strstr(funcDesc[i].name, "EXT")) {
- char *dup = strdup(funcDesc[i].name);
- *strstr(dup, "EXT") = 0;
- fprintf(server_stub, "%s(", dup);
- free(dup);
- } else */
- {
- if (isExt(&funcDesc[i])) {
- fprintf(server_stub, "ptr_func_%s(", funcDesc[i].name);
- } else {
- fprintf(server_stub, "%s(", funcDesc[i].name);
- }
- }
- char *c_type_name;
- if (is_known_arg_vector(&funcDesc[i], NULL, &c_type_name)) {
- for (j = 0; j < funcDesc[i].nargs - 1; j++) {
- if (j != 0) {
- fprintf(server_stub, ", ");
- }
- print_server_side_argument(server_stub, j, funcDesc[i].args[j]);
- }
- if (j != 0) {
- fprintf(server_stub, ", ");
- }
- if (strstr(funcDesc[i].args[funcDesc[i].nargs - 1], "const")) {
- fprintf(server_stub, "(const %s*)args[%d]", c_type_name, j);
- } else {
- fprintf(server_stub, "(%s*)args[%d]", c_type_name, j);
- }
- } else {
- for (j = 0; j < funcDesc[i].nargs; j++) {
- if (j != 0) {
- fprintf(server_stub, ", ");
- }
- print_server_side_argument(server_stub, j, funcDesc[i].args[j]);
- }
- }
- fprintf(server_stub, ");\n");
-
- fprintf(server_stub, " break;\n");
- fprintf(server_stub, " }\n");
- }
- }
-
- fprintf(server_stub, " default:\n");
- fprintf(server_stub, " DEBUGF(\"unknown=%%d\", func_number);\n");
- fprintf(server_stub, " break;\n");
- fprintf(server_stub, " }\n");
- fprintf(server_stub, "}\n");
-
- fprintf(header, "#undef MAGIC_MACRO\n");
- fprintf(header, "#define MAGIC_MACRO(x) COMPOSE(x,_signature)\n");
- fprintf(header, "static const int* tab_opengl_calls[GL_N_CALLS] =\n");
- fprintf(header, "{\n");
- fprintf(header, "#include \"gl_func_perso.h\"\n");
- for (i = 0; i < funcDescCount; i++) {
- if (funcDesc[i].ok) {
- fprintf(header, " %s_signature,\n", funcDesc[i].name);
- }
- }
- fprintf(header, "};\n\n");
-
- fprintf(header, "#undef MAGIC_MACRO\n");
- fprintf(header, "#define MAGIC_MACRO(x) #x\n");
- fprintf(header, "static const char* tab_opengl_calls_name[GL_N_CALLS] =\n");
- fprintf(header, "{\n");
- fprintf(header, "#include \"gl_func_perso.h\"\n");
- for (i = 0; i < funcDescCount; i++) {
- if (funcDesc[i].ok) {
- fprintf(header, " \"%s\",\n", funcDesc[i].name);
- }
- }
- fprintf(header, "};\n\n");
-
- fclose(header);
- fclose(server_stub);
- fclose(client_stub);
-
- return 0;
-}
+++ /dev/null
-/*
- * Copyright (c) 2007 Even Rouault
- *
- * Modified by Ian Molton 2010
- *
- * 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
- * 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 _OPENGL_UTILS
-#define _OPENGL_UTILS
-
-typedef struct {
- unsigned int *values;
- int nbValues;
-} RangeAllocator;
-
-/*
-static void print_range(RangeAllocator* range)
-{
- int i;
- printf("%s", "table : ");
- for(i=0;i<range->nbValues;i++)
- {
- printf("%d ", range->values[i]);
- }
- printf("\n");
-}
-*/
-
-static inline void alloc_value(RangeAllocator *range, unsigned int value)
-{
- if (value == 0)
- return;
- if (range->nbValues >= 1) {
- int lower = 0;
- int upper = range->nbValues - 1;
-
- while (1) {
- int mid = (lower + upper) / 2;
-
- if (range->values[mid] > value)
- upper = mid;
- else if (range->values[mid] < value)
- lower = mid;
- else
- break;
- if (upper - lower <= 1) {
- if (value < range->values[lower]) {
- range->values =
- realloc(range->values,
- (range->nbValues + 1) * sizeof(int));
- memmove(&range->values[lower + 1], &range->values[lower],
- (range->nbValues - lower) * sizeof(int));
- range->values[lower] = value;
- range->nbValues++;
- } else if (value == range->values[lower]) {
- } else if (value < range->values[upper]) {
- range->values =
- realloc(range->values,
- (range->nbValues + 1) * sizeof(int));
- memmove(&range->values[upper + 1], &range->values[upper],
- (range->nbValues - upper) * sizeof(int));
- range->values[upper] = value;
- range->nbValues++;
- } else if (value == range->values[upper]) {
- } else {
- upper++;
-
- range->values =
- realloc(range->values,
- (range->nbValues + 1) * sizeof(int));
- memmove(&range->values[upper + 1], &range->values[upper],
- (range->nbValues - upper) * sizeof(int));
- range->values[upper] = value;
- range->nbValues++;
- }
- break;
- }
- }
- } else {
- range->values = g_malloc(sizeof(int));
- range->values[0] = value;
- range->nbValues = 1;
- }
-}
-
-/* return first value */
-static inline unsigned int alloc_range(RangeAllocator *range, int n,
- unsigned int *values)
-{
- int i, j;
-
- if (range->nbValues == 0) {
- range->nbValues = n;
- range->values = g_malloc(n * sizeof(int));
- for (i = 0; i < n; i++) {
- range->values[i] = i + 1;
- if (values)
- values[i] = range->values[i];
- }
- return 1;
- } else {
- int lastValue = 1;
-
- for (i = 0; i < range->nbValues; i++) {
- if ((int) range->values[i] - (int) lastValue - 1 >= n) {
- range->values =
- realloc(range->values,
- (range->nbValues + n) * sizeof(int));
- memmove(&range->values[i + n], &range->values[i],
- (range->nbValues - i) * sizeof(int));
- for (j = 0; j < n; j++) {
- range->values[i + j] = lastValue + 1 + j;
- if (values)
- values[j] = range->values[i + j];
- }
- range->nbValues += n;
- break;
- } else
- lastValue = range->values[i];
- }
- if (i == range->nbValues) {
- range->values =
- realloc(range->values, (range->nbValues + n) * sizeof(int));
- for (j = 0; j < n; j++) {
- range->values[i + j] = lastValue + 1 + j;
- if (values)
- values[j] = range->values[i + j];
- }
- range->nbValues += n;
- }
- return lastValue + 1;
- }
-}
-
-static inline void delete_value(RangeAllocator *range, unsigned int value)
-{
- if (value == 0)
- return;
- if (range->nbValues >= 1) {
- int lower = 0;
- int upper = range->nbValues - 1;
-
- while (1) {
- int mid = (lower + upper) / 2;
-
- if (range->values[mid] > value)
- upper = mid;
- else if (range->values[mid] < value)
- lower = mid;
- else {
- lower = upper = mid;
- }
- if (upper - lower <= 1) {
- if (value == range->values[lower]) {
- memmove(&range->values[lower], &range->values[lower + 1],
- (range->nbValues - lower - 1) * sizeof(int));
- range->nbValues--;
- } else if (value == range->values[upper]) {
- memmove(&range->values[upper], &range->values[upper + 1],
- (range->nbValues - upper - 1) * sizeof(int));
- range->nbValues--;
- }
- break;
- }
- }
- }
-}
-
-static inline void delete_range(RangeAllocator *range, int n,
- const unsigned int *values)
-{
- int i;
-
- for (i = 0; i < n; i++) {
- delete_value(range, values[i]);
- }
-}
-
-static inline void delete_consecutive_values(RangeAllocator *range,
- unsigned int first, int n)
-{
- int i;
-
- for (i = 0; i < n; i++) {
- delete_value(range, first + i);
- }
-}
-
-#endif
+++ /dev/null
-/*
- * Virtio GL stub functions
- *
- * Copyright (c) 2012 Samsung Electronics Co., Ltd.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "hw/virtio/virtio.h"
-
-VirtIODevice *virtio_gl_init(DeviceState *dev)
-{
- return NULL;
-}
-
+++ /dev/null
-/*
- * Virtio GL Device
- *
- * Copyright (c) 2010 Intel Corporation
- * Written by:
- * Ian Molton <ian.molton@collabora.co.uk>
- *
- * 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
- * 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 "virtio-gl.h"
-
-static void virtio_gl_handle(VirtIODevice *vdev, VirtQueue *vq)
-{
- VirtQueueElement elem;
- int nkill = 1;
-
- TRACE("virtio_gl_handle called.\n");
-
- while (virtqueue_pop(vq, &elem)) {
- struct d_hdr *hdr = (struct d_hdr *)elem.out_sg[0].iov_base;
- ProcessStruct *process;
- int i, remain;
- int ret = 0;
-
- if (!elem.out_num) {
- ERR("Bad packet\n");
- virtqueue_push(vq, &elem, ret);
- virtio_notify(vdev, vq);
- return;
- }
-
- process = vmgl_get_process(hdr->pid);
-
- if (hdr->rq_l) {
- if (hdr->rrq_l) {
- if (process->rq) { /* Usually only the quit packet... */
- free(process->rq);
- free(process->rrq);
- }
- process->rq = process->rq_p = g_malloc(hdr->rq_l);
- process->rrq = process->rrq_p = g_malloc(hdr->rrq_l);
- process->rq_l = hdr->rq_l - SIZE_OUT_HEADER;
- process->rrq_l = hdr->rrq_l;
-#ifdef DEBUG_GLIO
- process->sum = hdr->sum;
-#endif
- }
-
- i = 0;
- remain = process->rq_l - (process->rq_p - process->rq);
- while (remain && i < elem.out_num) {
- char *src = (char *)elem.out_sg[i].iov_base;
- int ilen = elem.out_sg[i].iov_len;
- int len = remain;
-
- if (i == 0) {
- src += SIZE_OUT_HEADER;
- ilen -= SIZE_OUT_HEADER;
- }
-
- if (len > ilen) {
- len = ilen;
- }
-
- memcpy(process->rq_p, src, len);
- process->rq_p += len;
- remain -= len;
- i++;
- }
-
- if (process->rq_p >= process->rq + process->rq_l) {
-#ifdef DEBUG_GLIO
- int sum = 0;
- for (i = 0; i < process->rq_l; i++) {
- sum += process->rq[i];
- }
- if (sum != process->sum) {
- ERR("Checksum fail\n");
- }
-#endif
-
- *(int *)process->rrq = nkill = decode_call_int(process,
- process->rq, /* command_buffer */
- process->rq_l, /* cmd buffer length */
- process->rrq + SIZE_IN_HEADER); /* return buffer */
-
- g_free(process->rq);
- process->rq = NULL;
-
-#ifdef DEBUG_GLIO
- sum = 0;
- for (i = SIZE_IN_BUFFER; i < process->rrq_l; i++) {
- sum += process->rrq[i];
- }
- *(int *)(process->rrq + sizeof(int)) = sum;
-#endif
-
- }
- }
-
- if (hdr->rrq_l && process->rq == NULL) {
- i = 0;
- remain = process->rrq_l - (process->rrq_p - process->rrq);
- while (remain && i < elem.in_num) {
- char *dst = elem.in_sg[i].iov_base;
- int len = remain;
- int ilen = elem.in_sg[i].iov_len;
-
- if (len > ilen) {
- len = ilen;
- }
-
- memcpy(dst, process->rrq_p, len);
- process->rrq_p += len;
- remain -= len;
- ret += len;
- i++;
- }
-
- if (remain <= 0) {
- g_free(process->rrq);
- if (!nkill) {
- gl_disconnect(process);
- }
- }
- }
-
- virtqueue_push(vq, &elem, ret);
- virtio_notify(vdev, vq);
- }
-}
-
-static uint32_t virtio_gl_get_features(VirtIODevice *vdev, uint32_t f)
-{
- return 0;
-}
-
-/*
-static void virtio_gl_save(QEMUFile *f, void *opaque)
-{
- VirtIOGL *s = opaque;
-
- virtio_save(&s->vdev, f);
-}
-
-static int virtio_gl_load(QEMUFile *f, void *opaque, int version_id)
-{
- VirtIOGL *s = opaque;
-
- if (version_id != 1) {
- return -EINVAL;
- }
-
- virtio_load(&s->vdev, f);
- return 0;
-}
-*/
-
-static void virtio_gl_device_realize(DeviceState *dev, Error **errp)
-{
- VirtIODevice *vdev = VIRTIO_DEVICE(dev);
- VirtIOGL *s = VIRTIO_GL(vdev);
- /* DeviceState *qdev = DEVICE(vdev); */
- if (s == NULL) {
- ERR("Failed to initialize virtio gl device.\n");
- return;
- }
-
- virtio_init(vdev, TYPE_VIRTIO_GL, VIRTIO_ID_GL, 0);
-
- /*
- register_savevm(qdev, TYPE_VIRTIO_GL, -1, 1,
- virtio_gl_save, virtio_gl_load, s);
- */
- s->vq = virtio_add_queue(vdev, 128, virtio_gl_handle);
-}
-
-static void virtio_gl_device_unrealize(DeviceState *dev, Error **errp)
-{
- VirtIODevice *vdev = VIRTIO_DEVICE(dev);
-
- INFO("destroy virtio-gl device\n");
-
- virtio_cleanup(vdev);
-}
-
-static void virtio_gl_class_init(ObjectClass *klass, void *data)
-{
- VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass);
- vdc->unrealize = virtio_gl_device_unrealize;
- vdc->realize = virtio_gl_device_realize;
- vdc->get_features = virtio_gl_get_features;
-}
-
-static const TypeInfo virtio_gl_info = {
- .name = TYPE_VIRTIO_GL,
- .parent = TYPE_VIRTIO_DEVICE,
- .instance_size = sizeof(VirtIOGL),
- .class_init = virtio_gl_class_init,
-};
-
-static void virtio_register_types(void)
-{
- type_register_static(&virtio_gl_info);
-}
-
-type_init(virtio_register_types)
-
+++ /dev/null
-#ifndef VIRTIO_GL_H_
-#define VIRTIO_GL_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "hw/hw.h"
-#include "maru_device_ids.h"
-#include "hw/virtio/virtio.h"
-#include "exec/hwaddr.h"
-
-#include "opengl_process.h"
-#include "opengl_exec.h"
-#include <sys/time.h>
-
-#include "tizen/src/debug_ch.h"
-MULTI_DEBUG_CHANNEL(qemu, virtio-gl);
-
-#define TYPE_VIRTIO_GL "virtio-gl"
-#define VIRTIO_GL(obj) \
- OBJECT_CHECK(VirtIOGL, (obj), TYPE_VIRTIO_GL)
-
-typedef hwaddr arg_t;
-int decode_call_int(ProcessStruct *p, char *in_args, int args_len, char *r_buffer);
-
-/* Uncomment to enable debugging - WARNING!!! changes ABI! */
-//#define DEBUG_GLIO
-
-typedef struct VirtIOGL
-{
- VirtIODevice vdev;
- VirtQueue *vq;
-} VirtIOGL;
-
-struct d_hdr
-{
- int pid;
- int rq_l;
- int rrq_l;
-#ifdef DEBUG_GLIO
- int sum;
-#endif
-};
-
-#define SIZE_OUT_HEADER sizeof(struct d_hdr)
-
-#ifdef DEBUG_GLIO
-#define SIZE_IN_HEADER (4*2)
-#else
-#define SIZE_IN_HEADER 4
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* VIRTIO_GL_H_ */
private final static String QEMU_PARAMETER_KVM = "-enable-kvm";
private final static String QEMU_PARAMETER_HAX = "-enable-hax";
private final static String QEMU_PARAMETER_VIRTFS = "-virtfs";
- private final static String QEMU_PARAMETER_VIRTGL = "-enable-gl";
private final static String QEMU_PARAMETER_YAGL = "-enable-yagl";
private final static String QEMU_PARAMETER_RAM = "-m";
private final static String QEMU_PARAMETER_DRIVE = "-drive";
{
isCpuVirtual = true;
}
- else if (QEMU_PARAMETER_VIRTGL.equals(arg) ||
- QEMU_PARAMETER_YAGL.equals(arg))
+ else if (QEMU_PARAMETER_YAGL.equals(arg))
{
isGpuVirtual = true;
}
#ifdef CONFIG_MARU
int skin_disabled = 0;
-//virtio-gl
-extern int enable_gl;
extern int enable_yagl;
extern int enable_spice;
const char *yagl_backend = NULL;
olist = qemu_find_opts("machine");
qemu_opts_parse(olist, "accel=kvm", 0);
break;
- case QEMU_OPTION_enable_gl:
-#if defined(CONFIG_MARU) && defined(CONFIG_GL_BACKEND)
- enable_gl = 1;
-#else
- fprintf(stderr, "Virtio GL support is disabled, ignoring -enable-gl\n");
-#endif
- break;
case QEMU_OPTION_enable_yagl:
#if defined(CONFIG_YAGL)
enable_yagl = 1;
}
#if defined(CONFIG_MARU)
- if (enable_gl && enable_yagl) {
- fprintf (stderr, "Error: only one openGL passthrough device can be used at one time!\n");
- exit(1);
- }
-
if (enable_vigs) {
if (!vigs_backend) {
vigs_backend = g_strdup("gl");