diff options
author | HyungKyu Song <hk76.song@samsung.com> | 2013-02-16 00:41:45 +0900 |
---|---|---|
committer | HyungKyu Song <hk76.song@samsung.com> | 2013-02-16 00:41:45 +0900 |
commit | 65db3453b2d83c113f9f7a939e386353ce348866 (patch) | |
tree | 93daea8d0cfed389b9f89b82d3a7bf739d8ebb58 | |
parent | 90dff65a3ccb36853763486671163ca81274b677 (diff) | |
download | simulator-opengl-submit/tizen_2.0/20130215.192024.tar.gz simulator-opengl-submit/tizen_2.0/20130215.192024.tar.bz2 simulator-opengl-submit/tizen_2.0/20130215.192024.zip |
Tizen 2.0 Releasesubmit/tizen_2.0/20130215.192024tizen_2.0
192 files changed, 76737 insertions, 0 deletions
@@ -0,0 +1,12 @@ +YeongKyoon Lee <yeongkyoon.lee@samsung.com> +DaiYoung Kim <daiyoung777.kim@samsung.com> +SeokYeon Hwang <syeon.hwang@samsung.com> +SangJin Kim <sangjin3.kim@samsung.com> +KiTae Kim <kt920.kim@samsung.com> +JinHyung Jo <jinhyung.jo@samsung.com> +SungMin Ha <sungmin82.ha@samsung.com> +MunKyu Im <munkyu.im@samsung.com> +JiHye Kim <jihye1128.kim@samsung.com> +GiWoong Kim <giwoong.kim@samsung.com> +SooYoung Ha <yoosah.ha@samsnung.com> +HyunGoo Kang <hyungoo1.kang@samsung.com> diff --git a/LICENSE.MIT b/LICENSE.MIT new file mode 100644 index 0000000..54ea32e --- /dev/null +++ b/LICENSE.MIT @@ -0,0 +1,19 @@ +Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. 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 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. diff --git a/Makefile b/Makefile new file mode 100755 index 0000000..998cde2 --- /dev/null +++ b/Makefile @@ -0,0 +1,42 @@ +#!/bin/make + +default: + (rm -rf ./lib/host-gl) + (mkdir -p ./lib/host-gl) + (cd egl_1_4; make) + (cd es_1_1; make) + (cd es_2_0; make) + (cd libGL; make install) + +all: default + +install: + (mkdir -p ./lib/host-gl) + (cd egl_1_4; make -f makefile-dynamic install) + (cd es_1_1; make -f makefile-static install) + (cd es_1_1; make -f makefile-dynamic install) + (cd es_2_0; make -f makefile-static install) + (cd es_2_0; make -f makefile-dynamic install) + (cd libGL; make install) + +clean: + (rm -rf ./lib/host-gl) + (cd egl_1_4; make clean) + (cd es_1_1; make -f makefile-static clean) + (cd es_1_1; make -f makefile-dynamic clean) + (cd es_2_0; make -f makefile-static clean) + (cd es_2_0; make -f makefile-dynamic clean) + (cd libGL; make clean) + +clobber: + (mkdir -p ./lib/host-gl) + (cd egl_1_4; make clobber) + (cd es_1_1; make -f makefile-static clobber) + (cd es_1_1; make -f makefile-dynamic clobber) + (cd es_2_0; make -f makefile-static clobber) + (cd es_2_0; make -f makefile-dynamic clobber) + +wc: + (cd egl_1_4; make wc) + (cd es_1_1; make -f makefile-dynamic wc) + (cd es_2_0; make -f makefile-dynamic wc) @@ -0,0 +1,8 @@ +Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved. +Except as noted, this software is licensed under MIT License. +Please, see the LICENSE.MIT file for MIT License terms and conditions. + + +Several source codes may have its original copyright owner and/or +be licensed under other than GLP License, Version 2. +Please, see copyright and license comments section in the header of each file. diff --git a/README.txt b/README.txt new file mode 100755 index 0000000..47fa000 --- /dev/null +++ b/README.txt @@ -0,0 +1 @@ +dpkg-buildpackage -sa -rfakeroot diff --git a/backrules b/backrules new file mode 100755 index 0000000..6e9a923 --- /dev/null +++ b/backrules @@ -0,0 +1,104 @@ +#!/usr/bin/make -f + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +CFLAGS ?= -Wall -g +LDFLAGS ?= +PREFIX ?= /usr +DESTDIR=$(CURDIR)/debian/tmp$(PREFIX) +DATADIR ?= /opt + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + +#LDFLAGS += -Wl,--rpath=$(PREFIX)/lib -Wl,--as-needed + +configure: configure-stamp +configure-stamp: + dh_testdir + # Add here commands to configure the package. + touch configure-stamp + + +build: build-stamp + +build-stamp: configure-stamp + dh_testdir + + # Add here commands to compile the package. + #$(MAKE) + + touch $@ + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + + # Add here commands to clean up after the build process. + #-$(MAKE) clean + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/tmp. + mkdir -p $(CURDIR)/debian/tmp + mkdir -p $(CURDIR)/debian/tmp/usr/include + mkdir -p $(CURDIR)/debian/tmp/usr/lib + cp -afRl lib/* $(CURDIR)/debian/tmp/usr/lib/. + #cp -afRl include/* $(CURDIR)/debian/tmp/usr/include/. + cp -a include/EGL $(DESTDIR)/include/. + cp -a include/GLES $(DESTDIR)/include/. + cp -a include/GLES2 $(DESTDIR)/include/. + cp -a include/GL $(DESTDIR)/include/. + + #cp -fRl lib/* $(CURDIR)/debian/tmp/usr/lib + #cp -fRl include/* $(CURDIR)/debian/tmp/usr/include + #$(MAKE) DESTDIR=$(CURDIR)/debian/tmp install + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_installexamples + dh_install --sourcedir=debian/tmp +# dh_installmenu +# dh_installdebconf +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_python +# dh_installinit +# dh_installcron +# dh_installinfo + dh_installman + dh_link + dh_strip + dh_compress + dh_fixperms +# dh_perl + dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..cf8b645 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,300 @@ +simulator-opengl (0.2.2) unstable; urgency=low + + * Fix the rotation bug. + * Git: 112.106.1.251:sdk/simulator-opengl + * Tag: simulator-opengl_0.2.2 + + -- Sangjin Kim <sangjin3.kim@samsung.com> Sat, 12 Jan 2013 10:36:27 +0900 + +simulator-opengl (0.2.1) unstable; urgency=low + + * Fix the context return value bug. + * Git: 112.106.1.251:sdk/simulator-opengl + * Tag: simulator-opengl_0.2.1 + + -- Sangjin Kim <sangjin3.kim@samsung.com> Fri, 04 Jan 2013 16:40:42 +0900 + +simulator-opengl (0.2.0) unstable; urgency=low + + * Initial submit for Tizen:2.0:Main project. + * Git: 112.106.1.251:sdk/simulator-opengl + * Tag: simulator-opengl_0.2.0 + + -- Sangjin Kim <sangjin3.kim@samsung.com> Wed, 12 Dec 2012 14:03:12 +0900 + +simulator-opengl (0.1.40) unstable; urgency=low + + * Obs build error fix. + * Git: 112.106.1.251:sdk/simulator-opengl + * Tag: simulator-opengl_0.1.40 + + -- Sangjin Kim <sangjin3.kim@samsung.com> Mon, 10 Dec 2012 11:53:23 +0900 + +simulator-opengl (0.1.39) unstable; urgency=low + + * Obs build error fix. + * Git: 112.106.1.251:sdk/simulator-opengl + * Tag: simulator-opengl_0.1.39 + + -- Sangjin Kim <sangjin3.kim@samsung.com> Tue, 27 Nov 2012 16:30:20 +0900 + +simulator-opengl (0.1.38) unstable; urgency=low + + * eglQueryContext() bug fix + * Git: 112.106.1.251:sdk/simulator-opengl + * Tag: simulator-opengl_0.1.38 + + -- Sangjin Kim <sangjin3.kim@samsung.com> Thu, 22 Nov 2012 17:06:37 +0900 + +simulator-opengl (0.1.37) unstable; urgency=low + + * pkgconfig name is changed. + * Git: 112.106.1.251:sdk/simulator-opengl + * Tag: simulator-opengl_0.1.37 + + -- Sangjin Kim <sangjin3.kim@samsung.com> Tue, 13 Nov 2012 11:04:30 +0900 + +simulator-opengl (0.1.36) unstable; urgency=low + + * Make sure the unique of the eglImage to avoid conflicts. + * Git: 112.106.1.251:sdk/simulator-opengl + * Tag: simulator-opengl_0.1.36 + + -- Sangjin Kim <sangjin3.kim@samsung.com> Tue, 30 Oct 2012 16:37:51 +0900 + +simulator-opengl (0.1.35) unstable; urgency=low + + * Fixed the intel_hangonman emulator crash problem. + * Git: 112.106.1.251:sdk/simulator-opengl + * Tag: simulator-opengl_0.1.35 + + -- Sangjin3.kim <sangjin3.kim@samsung.com> Tue, 09 Oct 2012 17:46:55 +0900 + +simulator-opengl (0.1.34) unstable; urgency=low + + * pixmap detection check. + * Git: 112.106.1.251:sdk/simulator-opengl + * Tag: simulator-opengl_0.1.34 + + -- Sangjin3.kim <sangjin3.kim@samsung.com> Fri, 07 Sep 2012 18:15:52 +0900 + +simulator-opengl (0.1.33) unstable; urgency=low + + * WebProcess crash bug fix. + * Git: 112.106.1.251:sdk/simulator-opengl + * Tag: simulator-opengl_0.1.33 + + -- Sangjin Kim <sangjin3.kim@samsung.com> Fri, 07 Sep 2012 16:34:37 +0900 + +simulator-opengl (0.1.32) unstable; urgency=low + + * eglBindAPI bug fix. + * Git: 112.106.1.251:sdk/simulator-opengl + * Tag: simulator-opengl_0.1.32 + + -- Sangjin Kim <sangjin3.kim@samsung.com> Tue, 04 Sep 2012 15:41:48 +0900 + +simulator-opengl (0.1.31) unstable; urgency=low + + * pixmap, EGLImageKHR, glEGLImageTargetTexture2DOES extension modified. + * Git: 112.106.1.251:sdk/simulator-opengl + * Tag: simulator-opengl_0.1.31 + + -- Sangjin Kim <sangjin3.kim@samsung.com> Fri, 31 Aug 2012 10:40:53 +0900 + +simulator-opengl (0.1.28) unstable; urgency=low + + * pixmap, EGLImageKHR, glEGLImageTargetTexture2DOES extension add. + * Git: 165.213.149.219:sdk/simulator-opengl + * Tag: simulator-opengl_0.1.28 + + -- Sangjin Kim <sangjin3.kim@samsung.com> Tue, 21 Aug 2012 18:19:12 +0900 + +simulator-opengl (0.1.25) unstable; urgency=low + + * Coregl support. + * Git: 165.213.149.219:slp/sdk/simulator-opengl + * Tag: simulator-opengl_0.1.25 + + -- Sangjin Kim <sangjin3.kim@samsung.com> Tue, 31 Jul 2012 16:07:02 +0900 + +simulator-opengl (0.1.24) unstable; urgency=low + + * Link to libGL library in pkgconfig file is removed. + * Git: 165.213.149.219:slp/sdk/simulator-opengl + * Tag: simulator-opengl_0.1.24 + + -- Sangjin Kim <sangjin3.kim@samsung.com> Sat, 07 Jul 2012 23:42:07 +0900 + +simulator-opengl (0.1.23) unstable; urgency=low + + * Version upgraded for UniformLocation bug fix. + * Git: 165.213.149.219:slp/sdk/simulator-opengl + * Tag: simulator-opengl_0.1.23 + + -- Jinhyung Jo <jinhyung.jo@samsung.com> Fri, 06 Jul 2012 20:49:33 +0900 + +simulator-opengl (0.1.22) unstable; urgency=low + + * Version upgraded for eglDestroyContext bug fix. + * Git: 165.213.149.219:slp/sdk/simulator-opengl + * Tag: simulator-opengl_0.1.22 + + -- Sangjin Kim <sangjin3.kim@samsung.com> Mon, 02 Jul 2012 17:19:12 +0900 + +simulator-opengl (0.1.21) unstable; urgency=low + + * spec file changed. + * Git: 165.213.149.219:slp/sdk/simulator-opengl + * Tag: simulator-opengl_0.1.21 + + -- Sangjin Kim <sangjin3.kim@samsung.com> Mon, 21 May 2012 14:11:03 +0900 + +simulator-opengl (0.1.20) unstable; urgency=low + + * sw mesa gles support. + * Git: 165.213.149.219:slp/sdk/simulator-opengl + * Tag: simulator-opengl_0.1.20 + + -- Sangjin Kim <sangjin3.kim@samsung.com> Thu, 17 May 2012 18:46:58 +0900 + +simulator-opengl (0.1.19) unstable; urgency=low + + * udev rule file deleted. Makefile, include path cleaned. + * Git: 165.213.149.219:slp/sdk/simulator-opengl + * Tag: simulator-opengl_0.1.19 + + -- Sangjin Kim <sangjin3.kim@samsung.com> Tue, 03 Apr 2012 16:33:27 +0900 + +simulator-opengl (0.1.17) unstable; urgency=low + + * Some bug patched. + * Git: 165.213.149.219:slp/sdk/simulator-opengl + * Tag: simulator-opengl_0.1.17 + + -- Sangjin Kim <sangjin3.kim@samsung.com> Fri, 23 Mar 2012 10:40:59 +0900 + +simulator-opengl (0.1.16) unstable; urgency=low + + * spec file modified. + * Git: 165.213.149.219:slp/sdk/simulator-opengl + * Tag: simulator-opengl_0.1.16 + + -- Sangjin Kim <sangjin3.kim@samsung.com> Tue, 20 Mar 2012 15:51:21 +0900 + +simulator-opengl (0.1.15) unstable; urgency=low + + * Runtime dependency added to spec file + * Git: 165.213.149.219:slp/sdk/simulator-opengl + * Tag: simulator-opengl_0.1.15 + + -- Sangjin Kim <sangjin3.kim@samsung.com> Tue, 20 Mar 2012 13:29:48 +0900 + +simulator-opengl (0.1-14) unstable; urgency=low + + * spec file add. + * Git: 165.213.149.219:slp/sdk/simulator-opengl + * Tag: simulator-opengl_0.1-14 + + -- Sangjin Kim <sangjin3.kim@samsung.com> Mon, 19 Mar 2012 16:18:11 +0900 + +simulator-opengl (0.1-13) unstable; urgency=low + + * Package internal reference changed. + * Git: 165.213.149.219:slp/sdk/simulator-opengl + * Tag: simulator-opengl_0.1-13 + + -- Sangjin Kim <sangjin3.kim@samsung.com> Sat, 17 Mar 2012 14:37:21 +0900 + +simulator-opengl (0.1-12) unstable; urgency=low + + * changelog whitespace error fix. + * Git: 165.213.149.219:slp/sdk/simulator-opengl + * Tag: simulator-opengl_0.1-12 + + -- Sangjin Kim <sangjin3.kim@samsung.com> Thu, 15 Mar 2012 16:18:29 +0900 + +simulator-opengl (0.1-11) unstable; urgency=low + + * Build error fixed. + * Git: 165.213.149.219:slp/sdk/simulator-opengl + * Tag: simulator-opengl_0.1-11 + + -- Sangjin Kim <sangjin3.kim@samsung.com> Thu, 15 Mar 2012 15:42:43 +0900 + +simulator-opengl (0.1-10) unstable; urgency=low + + * Build error fixed. + * Git: 165.213.149.219:slp/sdk/simulator-opengl + * Tag: simulator-opengl_0.1-10 + + -- Sangjin Kim <sangjin3.kim@samsung.com> Thu, 15 Mar 2012 15:24:25 +0900 + +simulator-opengl (0.1-9) unstable; urgency=low + + * New gles acceleration implementation adopted. (meego latest + virtio) + * Git: 165.213.149.219:slp/sdk/simulator-opengl + * Tag: simulator-opengl_0.1-9 + + -- Sangjin Kim <sangjin3.kim@samsung.com> Thu, 15 Mar 2012 14:38:53 +0900 + +simulator-opengl (0.1-8) unstable; urgency=low + + * libGL sourcode added for new gles implementation. + * Git: 165.213.149.219:slp/sdk/simulator-opengl + * Tag: simulator-opengl_0.1-8 + + -- Sangjin Kim <sangjin3.kim@samsung.com> Thu, 15 Mar 2012 11:58:56 +0900 + +simulator-opengl (0.1-7) unstable; urgency=low + + * License changed(LGPL->MIT), segfault fixed, dependency added. + * Git: 165.213.149.219:slp/sdk/simulator-opengl + * Tag: simulator-opengl_0.1-7 + + -- Sooyoung Ha <yoosah.ha@samsung.com> Fri, 06 Jan 2012 18:28:36 +0900 + +simulator-opengl (0.1-6) unstable; urgency=low + + * apply new x86 based opengl source. + * Git: 165.213.180.234:slp/sdk/simulator-opengl + * Tag: simulator-opengl_0.1-6 + + -- Sooyoung Ha <yoosah.ha@samsung.com> Wed, 07 Dec 2011 22:12:01 +0900 + +simulator-opengl (0.1-5) unstable; urgency=low + + * Git: 165.213.180.234:/git/slp2.0/slp2.0-tools/simulator-opengl + * Tag: simulator-opengl_0.1-5 + * Added a package : libxfixes-dev + + -- Sunghyun Kwon <sh0701.kwon@samsung.com> Tue, 09 Nov 2010 19:52:53 +0900 + +simulator-opengl (0.1-4) unstable; urgency=low + + * Git: 165.213.180.234:/git/slp2.0/slp2.0-tools/simulator-opengl + * Tag: simulator-opengl_0.1-4 + * Set a XB-Public-Package in control + + -- Mike McCormack <mj.mccormack@samsung.com> Fri, 09 Jul 2010 15:09:46 +0900 + +simulator-opengl (0.1-3) unstable; urgency=low + + * Git: 165.213.180.234:/git/slp2.0/slp2.0-tools/simulator-opengl + * Tag: simulator-opengl_0.1-3 + + -- Mike McCormack <mj.mccormack@samsung.com> Fri, 02 Apr 2010 21:29:54 +0900 + +simulator-opengl (0.1-2) unstable; urgency=low + + * lGL and simulator-opengl-dev + * Git: 165.213.180.234:/git/slp2.0/slp2.0-tools/simulator-opengl + * Tag: simulator-opengl_0.1-2 + + -- Park Jun-sik <okdear.park@samsung.com> Thu, 14 Jan 2010 15:34:03 +0900 + +simulator-opengl (0.1-1) unstable; urgency=low + + * Initial Release. + + -- Park Jun-sik <okdear.park@samsung.com> Thu, 12 Nov 2009 21:48:18 +0900 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..7ed6ff8 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +5 diff --git a/debian/configure-stamp b/debian/configure-stamp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/debian/configure-stamp diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..138db50 --- /dev/null +++ b/debian/control @@ -0,0 +1,25 @@ +Source: simulator-opengl +Section: devel +Priority: optional +Maintainer: SangJin Kim <sangjin3.kim@samsung.com> +Uploaders: SangJin Kim <sangjin3.kim@samsung.com>, DongKyun Yun <dk77.yun@samsung.com>, Sooyoung Ha <yoosah.ha@samsung.com> +Build-Depends: debhelper (>= 5), libxfixes-dev, libx11-dev, libxext-dev, libx11-xcb-dev +Standards-Version: 0.1 + +Package: simulator-opengl-dev +Section : libdevel +Architecture: i386 +Depends: ${misc:Depends}, simulator-opengl (= ${binary:Version}), libx11-dev, libx11-xcb-dev, libxext-dev +Description: OpenGLES library development files for simulator + +Package: simulator-opengl +Section : libs +Architecture: i386 +Depends: ${shlibs:Depends}, ${misc:Depends}, libx11-6, libx11-xcb1, libxext6 +Description: OpenGLES library for simulator + +Package: simulator-opengl-dbg +Section : debug +Architecture: i386 +Depends: ${shlibs:Depends}, ${misc:Depends}, simulator-opengl (= ${binary:Version}), libx11-6, libx11-xcb1, libxext6 +Description: OpenGLES debugging library for simulator diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..b6e00ec --- /dev/null +++ b/debian/copyright @@ -0,0 +1,19 @@ +Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. 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 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. diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..b2dba93 --- /dev/null +++ b/debian/rules @@ -0,0 +1,120 @@ +#!/usr/bin/make -f + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +CFLAGS ?= -Wall -g +LDFLAGS ?= +PREFIX ?= /usr +DESTDIR=$(CURDIR)/debian/tmp$(PREFIX) +DATADIR ?= /opt + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + +#LDFLAGS += -Wl,--rpath=$(PREFIX)/lib -Wl,--as-needed + +configure: configure-stamp +configure-stamp: + dh_testdir + # Add here commands to configure the package. + #touch configure-stamp + + +build: build-stamp + +build-stamp: configure-stamp + dh_testdir + + # Add here commands to compile the package. + $(MAKE) + + touch $@ + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + + # Add here commands to clean up after the build process. + $(MAKE) clean + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/tmp. + mkdir -p $(CURDIR)/debian/tmp + mkdir -p $(CURDIR)/debian/tmp/usr/include + mkdir -p $(CURDIR)/debian/tmp/usr/lib + mkdir -p $(DESTDIR)/bin + mkdir -p $(DESTDIR)/include + mkdir -p $(DESTDIR)/lib + mkdir -p $(DESTDIR)/lib/pkgconfig + + # simulator-opengl + cp -aRl lib/* $(DESTDIR)/lib/. + + # simulator-opengl-dev + cp -a include/EGL $(DESTDIR)/include/. + cp -a include/GL $(DESTDIR)/include/. + cp -a include/GLES $(DESTDIR)/include/. + cp -a include/GLES2 $(DESTDIR)/include/. + cp -a include/KHR $(DESTDIR)/include/. + + +# cp -afRl lib/* $(CURDIR)/debian/tmp/usr/lib/. + #cp -afRl include/* $(CURDIR)/debian/tmp/usr/include/. +# cp -a include/EGL $(DESTDIR)/include/. +# cp -a include/GLES $(DESTDIR)/include/. +# cp -a include/GLES2 $(DESTDIR)/include/. +# cp -a include/GL $(DESTDIR)/include/. + + #cp -fRl lib/* $(CURDIR)/debian/tmp/usr/lib + #cp -fRl include/* $(CURDIR)/debian/tmp/usr/include + #$(MAKE) DESTDIR=$(CURDIR)/debian/tmp install + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_installexamples + dh_install --sourcedir=debian/tmp +# dh_installmenu +# dh_installdebconf +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_python +# dh_installinit +# dh_installcron +# dh_installinfo + dh_installman + dh_link + dh_strip + dh_compress + dh_fixperms +# dh_perl + dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure diff --git a/debian/simulator-opengl-dev.install b/debian/simulator-opengl-dev.install new file mode 100644 index 0000000..0ff1103 --- /dev/null +++ b/debian/simulator-opengl-dev.install @@ -0,0 +1,2 @@ +usr/lib/pkgconfig +usr/include/* diff --git a/debian/simulator-opengl.install b/debian/simulator-opengl.install new file mode 100644 index 0000000..c0c8d5f --- /dev/null +++ b/debian/simulator-opengl.install @@ -0,0 +1,2 @@ +usr/lib/*.so* +usr/lib/host-gl diff --git a/egl_1_4/31Error.c b/egl_1_4/31Error.c new file mode 100755 index 0000000..5fadeba --- /dev/null +++ b/egl_1_4/31Error.c @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "implement.h" +#include <stdarg.h> + + +EGLint EGLAPIENTRY eglGetError(void) { + EGLint iErrorCode = EGLINTER(global).iLastError; + EGLINTER(global).iLastError = EGL_SUCCESS; + return iErrorCode; +} + +void EGLAPIENTRY EGLINTER(SetError)(EGLint iError) { + if (EGLINTER(global).iLastError == EGL_SUCCESS) { + EGLINTER(global).iLastError = iError; + } +} + diff --git a/egl_1_4/32GetDisplay.c b/egl_1_4/32GetDisplay.c new file mode 100755 index 0000000..fda853d --- /dev/null +++ b/egl_1_4/32GetDisplay.c @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "implement.h" +#include <dlfcn.h> + + +EGLDisplay EGLAPIENTRY eglGetDisplay(EGLNativeDisplayType native) { + EGLBoolean bInvokedWithDefault = EGL_FALSE; + if (EGLINTER(global).dlGL == NULL) { + if ((EGLINTER(global).dlGL = dlopen(GL_SO_FILENAME, RTLD_NOW | RTLD_GLOBAL)) == NULL) { + EGLINTER(SetError)(EGL_BAD_ACCESS); + return; + } + EGLINTER(ResetFnptrs)(&(EGLINTER(global))); + EGLINTER(BindFnptrs)(&(EGLINTER(global))); +#if defined(PROVIDING_RUNTIME_BINDING) + EGLINTER(ResetGLFnptrs)(&(EGLINTER(global))); +#endif + } + if (native == EGL_DEFAULT_DISPLAY) { + native = XOpenDisplay(NULL); + if (native == NULL) { + return EGL_NO_DISPLAY; + } + bInvokedWithDefault = EGL_TRUE; + } + EGLDisplay unique = (EGLDisplay)(native); + struct DisplayExtra* pDisplay = EGLINTER(LookUpDisplay)(unique); + if (pDisplay == NULL) { + pDisplay = EGLINTER(InsertDisplay)(unique); + if (pDisplay == NULL) { + return EGL_NO_DISPLAY; + } + pDisplay->native = native; + pDisplay->bInitialized = EGL_FALSE; + pDisplay->bInvokedWithDefault = bInvokedWithDefault; + pDisplay->pConfigBuffer = NULL; + pDisplay->nConfigExtra = 0; + pDisplay->pConfigExtra = NULL; + pDisplay->pConfigAnswer = NULL; + } else { + + } + return pDisplay->unique; +} diff --git a/egl_1_4/32Initialize.c b/egl_1_4/32Initialize.c new file mode 100755 index 0000000..00a23d9 --- /dev/null +++ b/egl_1_4/32Initialize.c @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "implement.h" +#include <dlfcn.h> + + +EGLBoolean EGLAPIENTRY eglInitialize(EGLDisplay dpy, EGLint* major, EGLint* minor) { + if (EGLINTER(global).dlGL == NULL) { + if ((EGLINTER(global).dlGL = dlopen(GL_SO_FILENAME, RTLD_NOW | RTLD_GLOBAL)) == NULL) { + EGLINTER(SetError)(EGL_BAD_ACCESS); + return; + } + EGLINTER(ResetFnptrs)(&(EGLINTER(global))); + EGLINTER(BindFnptrs)(&(EGLINTER(global))); +#if defined(PROVIDING_RUNTIME_BINDING) + EGLINTER(ResetGLFnptrs)(&(EGLINTER(global))); +#endif + } + struct DisplayExtra* pDisplay = EGLINTER(LookUpDisplay)(dpy); + if (pDisplay == NULL) { + EGLINTER(SetError)(EGL_BAD_DISPLAY); + return EGL_FALSE; + } + if (pDisplay->bInitialized == EGL_FALSE) { + int nConfig = EGLINTER(PrepareConfig)(pDisplay); + if (nConfig <= 0) { + EGLINTER(SetError)(EGL_NOT_INITIALIZED); + return EGL_FALSE; + } + + pDisplay->bInitialized = EGL_TRUE; + } + if (major != NULL) *major = HAZEL_EGL_MAJOR; + if (minor != NULL) *minor = HAZEL_EGL_MINOR; + return EGL_TRUE; +} diff --git a/egl_1_4/32Terminate.c b/egl_1_4/32Terminate.c new file mode 100755 index 0000000..1ec3957 --- /dev/null +++ b/egl_1_4/32Terminate.c @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "implement.h" + + +EGLBoolean EGLAPIENTRY eglTerminate(EGLDisplay dpy) { + struct DisplayExtra* pDisplay = EGLINTER(LookUpDisplay)(dpy); + if (pDisplay == NULL) { + EGLINTER(SetError)(EGL_BAD_DISPLAY); + return EGL_FALSE; + } + if (pDisplay->pConfigBuffer != NULL) { + XFree(pDisplay->pConfigBuffer); + pDisplay->pConfigBuffer = NULL; + } + if (pDisplay->pConfigExtra != NULL) { + free(pDisplay->pConfigExtra); + free(pDisplay->pConfigAnswer); + pDisplay->nConfigExtra = 0; + pDisplay->pConfigExtra = NULL; + pDisplay->pConfigAnswer = NULL; + } + pDisplay->bInitialized = EGL_FALSE; + return EGL_TRUE; +} + + diff --git a/egl_1_4/33QueryString.c b/egl_1_4/33QueryString.c new file mode 100755 index 0000000..68c85fd --- /dev/null +++ b/egl_1_4/33QueryString.c @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "implement.h" + + +const char* EGLAPIENTRY eglQueryString(EGLDisplay dpy, EGLint name) { + struct DisplayExtra* pDisplay; + static char buf[256]; + pDisplay = EGLINTER(LookUpDisplay)(dpy); + if (pDisplay == NULL) { + EGLINTER(SetError)(EGL_BAD_DISPLAY); + return NULL; + } + if (pDisplay->bInitialized == EGL_FALSE) { + EGLINTER(SetError)(EGL_NOT_INITIALIZED); + return NULL; + } + switch (name) { + case EGL_CLIENT_APIS: +#if defined(PROVIDING_RUNTIME_BINDING) + return "OpenGL_ES OpenGL"; +#else + return "OpenGL_ES"; +#endif + break; + case EGL_VENDOR: +#if defined(PROVIDING_RUNTIME_BINDING) + return HAZEL_EGL_VENDOR " dynamic (compiled on " __DATE__ " " __TIME__ ")"; +#else + return HAZEL_EGL_VENDOR "(compiled on " __DATE__ " " __TIME__ ")"; +#endif + break; + case EGL_VERSION: + sprintf(buf, "%d.%d (on GLX %s %s)", HAZEL_EGL_MAJOR, HAZEL_EGL_MINOR, + FNPTR(GetClientString)(pDisplay->native, GLX_VENDOR), + FNPTR(GetClientString)(pDisplay->native, GLX_VERSION)); + return buf; + break; + case EGL_EXTENSIONS: + return "EGL_KHR_image"; + break; + default: + EGLINTER(SetError)(EGL_BAD_PARAMETER); + return NULL; + } +} + + diff --git a/egl_1_4/34ChooseConfig.c b/egl_1_4/34ChooseConfig.c new file mode 100755 index 0000000..d9a6719 --- /dev/null +++ b/egl_1_4/34ChooseConfig.c @@ -0,0 +1,176 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "implement.h" + + +struct ConfigExtra configExtraDefault = { + EGL_DONT_CARE, (GLXFBConfig)EGL_DONT_CARE, + 0, 0, 0, 0, 0, 0, 0, + EGL_DONT_CARE, EGL_DONT_CARE, EGL_RGB_BUFFER, EGL_DONT_CARE, + EGL_DONT_CARE, 0, 0, + 0, 0, 0, + EGL_DONT_CARE, EGL_DONT_CARE, + EGL_DONT_CARE, EGL_DONT_CARE, EGL_DONT_CARE, + EGL_DONT_CARE, + 0, 0, 0, EGL_WINDOW_BIT, + EGL_NONE, EGL_DONT_CARE, EGL_DONT_CARE, EGL_DONT_CARE, +}; + +EGLBoolean EGLAPIENTRY eglChooseConfig(EGLDisplay dpy, const EGLint* attrib_list, + EGLConfig* configs, EGLint config_size, EGLint* num_config) { + struct DisplayExtra* pDisplay; + struct ConfigExtra configValue; + pDisplay = EGLINTER(LookUpDisplay)(dpy); + if (pDisplay == NULL) { + EGLINTER(SetError)(EGL_BAD_DISPLAY); + return EGL_FALSE; + } + if (pDisplay->bInitialized == EGL_FALSE) { + EGLINTER(SetError)(EGL_NOT_INITIALIZED); + return EGL_FALSE; + } + if (num_config == NULL) { + EGLINTER(SetError)(EGL_BAD_PARAMETER); + return EGL_FALSE; + } + memcpy(&configValue, &configExtraDefault, sizeof(struct ConfigExtra)); + while (attrib_list && *attrib_list != EGL_NONE) { + switch (*attrib_list++) { + case EGL_CONFIG_ID: configValue.unique = *attrib_list++; break; + case EGL_BUFFER_SIZE: configValue.bufferSize = *attrib_list++; break; + case EGL_RED_SIZE: configValue.redSize = *attrib_list++; break; + case EGL_GREEN_SIZE: configValue.greenSize = *attrib_list++; break; + case EGL_BLUE_SIZE: configValue.blueSize = *attrib_list++; break; + case EGL_LUMINANCE_SIZE: configValue.luminanceSize = *attrib_list++; break; + case EGL_ALPHA_SIZE: configValue.alphaSize = *attrib_list++; break; + case EGL_ALPHA_MASK_SIZE: configValue.alphaMaskSize = *attrib_list++; break; + case EGL_BIND_TO_TEXTURE_RGB: configValue.bindToTexRGB = *attrib_list++; break; + case EGL_BIND_TO_TEXTURE_RGBA: configValue.bindToTexRGBA = *attrib_list++; break; + case EGL_COLOR_BUFFER_TYPE: configValue.colorBufferType = *attrib_list++; break; + case EGL_CONFIG_CAVEAT: configValue.configCaveat = *attrib_list++; break; + case EGL_CONFORMANT: configValue.conformant = *attrib_list++; break; + case EGL_DEPTH_SIZE: configValue.depthSize = *attrib_list++; break; + case EGL_LEVEL: configValue.level = *attrib_list++; break; + case EGL_MAX_PBUFFER_WIDTH: attrib_list++; break; + case EGL_MAX_PBUFFER_HEIGHT: attrib_list++; break; + case EGL_MAX_PBUFFER_PIXELS: attrib_list++; break; + case EGL_MAX_SWAP_INTERVAL: configValue.maxSwapInterval = *attrib_list++; break; + case EGL_MIN_SWAP_INTERVAL: configValue.minSwapInterval = *attrib_list++; break; + case EGL_NATIVE_RENDERABLE: configValue.nativeRenderable = *attrib_list++; break; + case EGL_NATIVE_VISUAL_ID: attrib_list++; break; + case EGL_NATIVE_VISUAL_TYPE: configValue.nativeVisualType = *attrib_list++; break; + case EGL_RENDERABLE_TYPE: configValue.renderableType = *attrib_list++; break; + case EGL_SAMPLE_BUFFERS: configValue.sampleBuffers = *attrib_list++; break; + case EGL_SAMPLES: configValue.samples = *attrib_list++; break; + case EGL_STENCIL_SIZE: configValue.stencilSize = *attrib_list++; break; + case EGL_SURFACE_TYPE: configValue.surfaceType = *attrib_list++; break; + case EGL_TRANSPARENT_TYPE: configValue.transparentType = *attrib_list++; break; + case EGL_TRANSPARENT_RED_VALUE: configValue.transparentRedValue = *attrib_list++; break; + case EGL_TRANSPARENT_GREEN_VALUE: configValue.transparentGreenValue = *attrib_list++; break; + case EGL_TRANSPARENT_BLUE_VALUE: configValue.transparentBlueValue = *attrib_list++; break; + case EGL_MATCH_NATIVE_PIXMAP: assert(0); break; + default: + EGLINTER(SetError)(EGL_BAD_ATTRIBUTE); + return EGL_FALSE; + } + } + struct ConfigExtra* pUnit = pDisplay->pConfigExtra; + int nCount = pDisplay->nConfigExtra; + int i; + if (configValue.unique != EGL_DONT_CARE) { + while (nCount--) { + if (pUnit->unique == configValue.unique) { + *num_config = 1; + if (configs != NULL && config_size > 0) { + configs[0] = (EGLConfig)pUnit; + } + return EGL_TRUE; + } + pUnit++; + } + *num_config = 0; + return EGL_TRUE; + } + int nAnswer = 0; + EGLConfig* pAnswer = pDisplay->pConfigAnswer; + for (; nCount--; pUnit++) { + if (pUnit->bufferSize < configValue.bufferSize) continue; + if (pUnit->redSize < configValue.redSize) continue; + if (pUnit->greenSize < configValue.greenSize) continue; + if (pUnit->blueSize < configValue.blueSize) continue; + if (pUnit->luminanceSize < configValue.luminanceSize) continue; + if (pUnit->alphaSize < configValue.alphaSize) continue; + if (pUnit->alphaMaskSize < configValue.alphaMaskSize) continue; + if (configValue.bindToTexRGB != EGL_DONT_CARE + && pUnit->bindToTexRGB != configValue.bindToTexRGB) continue; + if (configValue.bindToTexRGBA != EGL_DONT_CARE + && pUnit->bindToTexRGBA != configValue.bindToTexRGBA) continue; + if (pUnit->colorBufferType != configValue.colorBufferType) continue; + if (configValue.configCaveat != EGL_DONT_CARE + && pUnit->configCaveat != configValue.configCaveat) continue; + if (configValue.conformant != EGL_DONT_CARE + && (pUnit->conformant & configValue.conformant) == 0) continue; + if (pUnit->depthSize < configValue.depthSize) continue; + if (pUnit->level != configValue.level) continue; + if (configValue.maxSwapInterval != EGL_DONT_CARE + && pUnit->maxSwapInterval != configValue.maxSwapInterval) continue; + if (configValue.minSwapInterval != EGL_DONT_CARE + && pUnit->minSwapInterval != configValue.minSwapInterval) continue; + if (configValue.nativeRenderable != EGL_DONT_CARE + && pUnit->nativeRenderable != configValue.nativeRenderable) continue; + if (configValue.renderableType != EGL_DONT_CARE + && (pUnit->renderableType & configValue.renderableType) == 0) continue; + if (pUnit->sampleBuffers < configValue.sampleBuffers) continue; + if (pUnit->samples < configValue.samples) continue; + if (pUnit->stencilSize < configValue.stencilSize) continue; + if (pUnit->surfaceType & configValue.surfaceType == 0) continue; + if (pUnit->transparentType != configValue.transparentType) continue; + if (pUnit->transparentType != EGL_NONE + && pUnit->transparentRedValue != configValue.transparentRedValue) continue; + if (pUnit->transparentType != EGL_NONE + && pUnit->transparentGreenValue != configValue.transparentGreenValue) continue; + if (pUnit->transparentType != EGL_NONE + && pUnit->transparentBlueValue != configValue.transparentBlueValue) continue; + *pAnswer++ = pUnit; + nAnswer++; + } + int num = nAnswer; + if (configs == NULL) { + *num_config = num; + } else { + if (config_size < num) num = config_size; + if (num < 0) num = 0; + *num_config = num; + memcpy(configs, pDisplay->pConfigAnswer, num * sizeof(EGLConfig)); + } + return EGL_TRUE; +} diff --git a/egl_1_4/34GetConfigAttrib.c b/egl_1_4/34GetConfigAttrib.c new file mode 100755 index 0000000..37269e8 --- /dev/null +++ b/egl_1_4/34GetConfigAttrib.c @@ -0,0 +1,117 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "implement.h" +#include <dlfcn.h> + +struct ConfigExtra* EGLINTER(LookUpConfig)(struct DisplayExtra* pDisplay, EGLConfig config) { + + struct ConfigExtra* pConfig = (struct ConfigExtra*)config; + struct ConfigExtra* pUnit = pDisplay->pConfigExtra; + int nCount = pDisplay->nConfigExtra; + while (nCount--) { + if (pConfig == pUnit) { + return pConfig; + } + pUnit++; + } + return NULL; +} + +EGLBoolean EGLAPIENTRY eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config, + EGLint attribute, EGLint *value) { + struct DisplayExtra* pDisplay = EGLINTER(LookUpDisplay)(dpy); + if (pDisplay == NULL) { + EGLINTER(SetError)(EGL_BAD_DISPLAY); + return EGL_FALSE; + } + if (pDisplay->bInitialized == EGL_FALSE) { + EGLINTER(SetError)(EGL_NOT_INITIALIZED); + return EGL_FALSE; + } + struct ConfigExtra* pConfig = EGLINTER(LookUpConfig)(pDisplay, config); + if (pConfig == NULL) { + EGLINTER(SetError)(EGL_BAD_CONFIG); + return EGL_FALSE; + } + EGLint answer; + switch (attribute) { + case EGL_CONFIG_ID: answer = pConfig->unique; break; + case EGL_BUFFER_SIZE: answer = pConfig->bufferSize; break; + case EGL_RED_SIZE: answer = pConfig->redSize; break; + case EGL_GREEN_SIZE: answer = pConfig->greenSize; break; + case EGL_BLUE_SIZE: answer = pConfig->blueSize; break; + case EGL_LUMINANCE_SIZE: answer = pConfig->luminanceSize; break; + case EGL_ALPHA_SIZE: answer = pConfig->alphaSize; break; + case EGL_ALPHA_MASK_SIZE: answer = pConfig->alphaMaskSize; break; + case EGL_BIND_TO_TEXTURE_RGB: answer = pConfig->bindToTexRGB; break; + case EGL_BIND_TO_TEXTURE_RGBA: answer = pConfig->bindToTexRGBA; break; + case EGL_COLOR_BUFFER_TYPE: answer = pConfig->colorBufferType; break; + case EGL_CONFIG_CAVEAT: answer = pConfig->configCaveat; break; + case EGL_CONFORMANT: answer = pConfig->conformant; break; + case EGL_DEPTH_SIZE: answer = pConfig->depthSize; break; + case EGL_LEVEL: answer = pConfig->level; break; + case EGL_MAX_PBUFFER_WIDTH: answer = pConfig->maxPbufferWidth; break; + case EGL_MAX_PBUFFER_HEIGHT: answer = pConfig->maxPbufferHeight; break; + case EGL_MAX_PBUFFER_PIXELS: answer = pConfig->maxPbufferPixels; break; + case EGL_MAX_SWAP_INTERVAL: answer = pConfig->maxSwapInterval; break; + case EGL_MIN_SWAP_INTERVAL: answer = pConfig->minSwapInterval; break; + case EGL_NATIVE_RENDERABLE: answer = pConfig->nativeRenderable; break; + case EGL_NATIVE_VISUAL_ID: + { + XVisualInfo *vi; + XVisualInfo* (*fpGetVisualFromFBConfig)(Display*, GLXFBConfig) = NULL; + void* dl = dlopen("libGL.so", RTLD_NOW); + assert(dl != 0); + *(void**)(&fpGetVisualFromFBConfig) = dlsym(dl, "glXGetVisualFromFBConfig"); + assert(fpGetVisualFromFBConfig != NULL); + + vi = (*fpGetVisualFromFBConfig) (pDisplay->native, pConfig->native); + answer = vi->visualid; + break; + } + case EGL_NATIVE_VISUAL_TYPE: answer = pConfig->nativeVisualType; break; + case EGL_RENDERABLE_TYPE: answer = pConfig->renderableType; break; + case EGL_SAMPLE_BUFFERS: answer = pConfig->sampleBuffers; break; + case EGL_SAMPLES: answer = pConfig->samples; break; + case EGL_STENCIL_SIZE: answer = pConfig->stencilSize; break; + case EGL_SURFACE_TYPE: answer = pConfig->surfaceType; break; + case EGL_TRANSPARENT_TYPE: answer = pConfig->transparentType; break; + case EGL_TRANSPARENT_RED_VALUE: answer = pConfig->transparentRedValue; break; + case EGL_TRANSPARENT_GREEN_VALUE: answer = pConfig->transparentGreenValue; break; + case EGL_TRANSPARENT_BLUE_VALUE: answer = pConfig->transparentBlueValue; break; + default: + EGLINTER(SetError)(EGL_BAD_ATTRIBUTE); + return EGL_FALSE; + } + if (value != NULL) *value = answer; + return EGL_TRUE; +} diff --git a/egl_1_4/34GetConfigs.c b/egl_1_4/34GetConfigs.c new file mode 100755 index 0000000..19222f1 --- /dev/null +++ b/egl_1_4/34GetConfigs.c @@ -0,0 +1,197 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "implement.h" + + +void EGLINTER(ConvertConfig)(struct DisplayExtra* pDisplay, + struct ConfigExtra* ptr, GLXFBConfig config) { + ptr->unique = EGLINTER(global).iConfigID++; + ptr->native = config; + int drawableType; + FNPTR(GetFBConfigAttrib)(pDisplay->native, config, GLX_DRAWABLE_TYPE, &drawableType); + ptr->surfaceType = 0; + if (drawableType & GLX_PBUFFER_BIT != 0) ptr->surfaceType |= EGL_PBUFFER_BIT; + if (drawableType & GLX_PIXMAP_BIT != 0) ptr->surfaceType |= EGL_PIXMAP_BIT; + if (drawableType & GLX_WINDOW_BIT != 0) ptr->surfaceType |= EGL_WINDOW_BIT; + ptr->bindToTexRGB = (ptr->surfaceType & EGL_PBUFFER_BIT != 0) ? EGL_TRUE : EGL_FALSE; + ptr->bindToTexRGBA = (ptr->surfaceType & EGL_PBUFFER_BIT != 0) ? EGL_TRUE : EGL_FALSE; + int configCaveat; + FNPTR(GetFBConfigAttrib)(pDisplay->native, config, GLX_CONFIG_CAVEAT, &configCaveat); + switch (configCaveat) { + case GLX_NONE: ptr->configCaveat = EGL_NONE; break; + case GLX_SLOW_CONFIG: ptr->configCaveat = EGL_SLOW_CONFIG; break; + case GLX_NON_CONFORMANT_CONFIG: ptr->configCaveat = EGL_NON_CONFORMANT_CONFIG; break; + default: assert(0); break; + } + int renderable; + FNPTR(GetFBConfigAttrib)(pDisplay->native, config, GLX_X_RENDERABLE, &renderable); + ptr->nativeRenderable = (renderable == True) ? EGL_TRUE : EGL_FALSE; + int transparentType; + FNPTR(GetFBConfigAttrib)(pDisplay->native, config, GLX_TRANSPARENT_TYPE, &transparentType); + ptr->transparentType = (transparentType == GLX_TRANSPARENT_RGB) ? EGL_TRANSPARENT_RGB : EGL_NONE; + FNPTR(GetFBConfigAttrib)(pDisplay->native, config, GLX_BUFFER_SIZE, &ptr->bufferSize); + FNPTR(GetFBConfigAttrib)(pDisplay->native, config, GLX_RED_SIZE, &ptr->redSize); + FNPTR(GetFBConfigAttrib)(pDisplay->native, config, GLX_GREEN_SIZE, &ptr->greenSize); + FNPTR(GetFBConfigAttrib)(pDisplay->native, config, GLX_BLUE_SIZE, &ptr->blueSize); + FNPTR(GetFBConfigAttrib)(pDisplay->native, config, GLX_ALPHA_SIZE, &ptr->alphaSize); + FNPTR(GetFBConfigAttrib)(pDisplay->native, config, GLX_DEPTH_SIZE, &ptr->depthSize); + FNPTR(GetFBConfigAttrib)(pDisplay->native, config, GLX_LEVEL, &ptr->level); + FNPTR(GetFBConfigAttrib)(pDisplay->native, config, GLX_MAX_PBUFFER_WIDTH, &ptr->maxPbufferWidth); + FNPTR(GetFBConfigAttrib)(pDisplay->native, config, GLX_MAX_PBUFFER_HEIGHT, &ptr->maxPbufferHeight); + FNPTR(GetFBConfigAttrib)(pDisplay->native, config, GLX_MAX_PBUFFER_PIXELS, &ptr->maxPbufferPixels); + FNPTR(GetFBConfigAttrib)(pDisplay->native, config, GLX_VISUAL_ID, (int*)&ptr->nativeVisualID); + FNPTR(GetFBConfigAttrib)(pDisplay->native, config, GLX_X_VISUAL_TYPE, (int*)&ptr->nativeVisualType); + FNPTR(GetFBConfigAttrib)(pDisplay->native, config, GLX_SAMPLE_BUFFERS, &ptr->sampleBuffers); + FNPTR(GetFBConfigAttrib)(pDisplay->native, config, GLX_SAMPLES, &ptr->samples); + FNPTR(GetFBConfigAttrib)(pDisplay->native, config, GLX_STENCIL_SIZE, &ptr->stencilSize); + FNPTR(GetFBConfigAttrib)(pDisplay->native, config, GLX_TRANSPARENT_RED_VALUE, &ptr->transparentRedValue); + FNPTR(GetFBConfigAttrib)(pDisplay->native, config, GLX_TRANSPARENT_GREEN_VALUE, &ptr->transparentGreenValue); + FNPTR(GetFBConfigAttrib)(pDisplay->native, config, GLX_TRANSPARENT_BLUE_VALUE, &ptr->transparentBlueValue); + ptr->luminanceSize = 0; + ptr->alphaMaskSize = 0; + ptr->colorBufferType = EGL_RGB_BUFFER; + ptr->conformant = EGL_OPENGL_ES_BIT | EGL_OPENGL_ES2_BIT; + ptr->maxSwapInterval = 1000; + ptr->minSwapInterval = 0; + ptr->renderableType = EGL_OPENGL_ES_BIT | EGL_OPENGL_ES2_BIT; +} + +int EGLAPIENTRY EGLINTER(PrepareConfig)(struct DisplayExtra* pDisplay) { + assert(pDisplay != NULL); + static int attribs_for_none[] = { + GLX_TRANSPARENT_TYPE, GLX_NONE, + GLX_DOUBLEBUFFER, True, + GLX_STEREO, False, + GLX_AUX_BUFFERS, 0, + GLX_ACCUM_RED_SIZE, 0, + GLX_ACCUM_GREEN_SIZE, 0, + GLX_ACCUM_BLUE_SIZE, 0, + GLX_ACCUM_ALPHA_SIZE, 0, + GLX_RENDER_TYPE, GLX_RGBA_BIT, + None, + }; + static int attribs_for_rgb[] = { + GLX_TRANSPARENT_TYPE, GLX_TRANSPARENT_RGB, + GLX_DOUBLEBUFFER, True, + GLX_STEREO, False, + GLX_AUX_BUFFERS, 0, + GLX_ACCUM_RED_SIZE, 0, + GLX_ACCUM_GREEN_SIZE, 0, + GLX_ACCUM_BLUE_SIZE, 0, + GLX_ACCUM_ALPHA_SIZE, 0, + GLX_RENDER_TYPE, GLX_RGBA_BIT, + None, + }; + struct ConfigExtra* pArea; + struct ConfigExtra* pUnit; + int nBytes; + int nTotalConfig = 0; + int nConfig; + int i; + pDisplay->pConfigBuffer = FNPTR(ChooseFBConfig)(pDisplay->native, + DefaultScreen(pDisplay->native), attribs_for_none, &nConfig); + if (nConfig > 0) { + nBytes = (pDisplay->nConfigExtra + nConfig) * sizeof(struct ConfigExtra); + if ((pArea = (struct ConfigExtra*)realloc(pDisplay->pConfigExtra, nBytes)) == NULL) { + EGLINTER(SetError)(EGL_BAD_ALLOC); + return 0; + } + pUnit = pArea + pDisplay->nConfigExtra; + pDisplay->nConfigExtra += nConfig; + pDisplay->pConfigExtra = pArea; + for (i = 0; i < nConfig; i++) { + EGLINTER(ConvertConfig)(pDisplay, pUnit, pDisplay->pConfigBuffer[i]); + pUnit++; + } + } + nTotalConfig = nConfig; + XFree(pDisplay->pConfigBuffer); + pDisplay->pConfigBuffer = NULL; + pDisplay->pConfigBuffer = FNPTR(ChooseFBConfig)(pDisplay->native, + DefaultScreen(pDisplay->native), attribs_for_rgb, &nConfig); + if (nConfig > 0) { + nBytes = (pDisplay->nConfigExtra + nConfig) * sizeof(struct ConfigExtra); + if ((pArea = (struct ConfigExtra*)realloc(pDisplay->pConfigExtra, nBytes)) == NULL) { + EGLINTER(SetError)(EGL_BAD_ALLOC); + return 0; + } + pUnit = pArea + pDisplay->nConfigExtra; + pDisplay->nConfigExtra += nConfig; + pDisplay->pConfigExtra = pArea; + for (i = 0; i < nConfig; i++) { + EGLINTER(ConvertConfig)(pDisplay, pUnit, pDisplay->pConfigBuffer[i]); + pUnit++; + } + } + nTotalConfig += nConfig; + XFree(pDisplay->pConfigBuffer); + pDisplay->pConfigBuffer = NULL; + nBytes = pDisplay->nConfigExtra * sizeof(EGLConfig); + EGLConfig* pAnswerArea; + if ((pAnswerArea = (EGLConfig*)realloc(pDisplay->pConfigAnswer, nBytes)) == NULL) { + EGLINTER(SetError)(EGL_BAD_ALLOC); + return 0; + } + pDisplay->pConfigAnswer = pAnswerArea; + //assert(nTotalConfig > 0); + return nTotalConfig; +} + +EGLBoolean EGLAPIENTRY eglGetConfigs(EGLDisplay dpy, EGLConfig *configs, + EGLint config_size, EGLint *num_config) { + int i; + struct DisplayExtra* pDisplay = EGLINTER(LookUpDisplay)(dpy); + if (pDisplay == NULL) { + EGLINTER(SetError)(EGL_BAD_DISPLAY); + return EGL_FALSE; + } + if (pDisplay->bInitialized == EGL_FALSE) { + EGLINTER(SetError)(EGL_NOT_INITIALIZED); + return EGL_FALSE; + } + if (num_config == NULL) { + EGLINTER(SetError)(EGL_BAD_PARAMETER); + return EGL_FALSE; + } + int num = pDisplay->nConfigExtra; + if (configs == NULL) { + *num_config = num; + } else { + if (config_size < num) num = config_size; + if (num < 0) num = 0; + *num_config = num; + for (i = 0; i < num; i++) { + configs[i] = (EGLConfig)(pDisplay->pConfigExtra + i); + } + } + return EGL_TRUE; +} diff --git a/egl_1_4/35CreatePbufferFromClientBuffer.c b/egl_1_4/35CreatePbufferFromClientBuffer.c new file mode 100755 index 0000000..01c3fd1 --- /dev/null +++ b/egl_1_4/35CreatePbufferFromClientBuffer.c @@ -0,0 +1,122 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "implement.h" + + +EGLSurface EGLAPIENTRY eglCreatePbufferFromClientBuffer(EGLDisplay dpy, + EGLenum buftype, EGLClientBuffer buffer, + EGLConfig config, const EGLint *attrib_list) { + struct DisplayExtra* pDisplay = EGLINTER(LookUpDisplay)(dpy); + if (pDisplay == NULL) { + EGLINTER(SetError)(EGL_BAD_DISPLAY); + return EGL_NO_SURFACE; + } + if (pDisplay->bInitialized == EGL_FALSE) { + EGLINTER(SetError)(EGL_NOT_INITIALIZED); + return EGL_NO_SURFACE; + } + struct ConfigExtra* pConfig = EGLINTER(LookUpConfig)(pDisplay, config); + if (pConfig == NULL) { + EGLINTER(SetError)(EGL_BAD_CONFIG); + return EGL_NO_SURFACE; + } + if (pConfig->surfaceType & EGL_PBUFFER_BIT == 0) { + EGLINTER(SetError)(EGL_BAD_MATCH); + return EGL_NO_SURFACE; + } + if (buftype != EGL_OPENVG_IMAGE) { + EGLINTER(SetError)(EGL_BAD_PARAMETER); + return EGL_NO_SURFACE; + } + struct SurfaceExtra surfaceValue; + memcpy(&surfaceValue, &surfaceExtraDefault, sizeof(struct SurfaceExtra)); + surfaceValue.renderBuffer = EGL_BACK_BUFFER; + int buf[32]; + int* ptr = &buf[0]; + while (attrib_list && *attrib_list != EGL_NONE) { + switch (*attrib_list++) { + case EGL_WIDTH: + *ptr++ = GLX_WIDTH; + *ptr++ = *attrib_list++; + break; + case EGL_HEIGHT: + *ptr++ = GLX_HEIGHT; + *ptr++ = *attrib_list++; + break; + case EGL_TEXTURE_FORMAT: + if (*attrib_list == EGL_NO_TEXTURE || *attrib_list == EGL_TEXTURE_RGB + || *attrib_list == EGL_TEXTURE_RGBA) { + surfaceValue.textureFormat = *attrib_list++; + } else { + EGLINTER(SetError)(EGL_BAD_PARAMETER); + return EGL_NO_SURFACE; + } + break; + case EGL_TEXTURE_TARGET: + if (*attrib_list == EGL_NO_TEXTURE || *attrib_list == EGL_TEXTURE_2D) { + surfaceValue.textureFormat = *attrib_list++; + } else { + EGLINTER(SetError)(EGL_BAD_PARAMETER); + return EGL_NO_SURFACE; + } + break; + case EGL_MIPMAP_TEXTURE: + surfaceValue.mipmapTexture = (*attrib_list++ == EGL_FALSE) ? EGL_FALSE : EGL_TRUE; + break; + case EGL_VG_ALPHA_FORMAT: + if (*attrib_list == EGL_VG_ALPHA_FORMAT_NONPRE + || *attrib_list == EGL_VG_ALPHA_FORMAT_PRE) { + surfaceValue.vgAlphaFormat = *attrib_list++; + } else { + EGLINTER(SetError)(EGL_BAD_PARAMETER); + return EGL_NO_SURFACE; + } + break; + case EGL_VG_COLORSPACE: + if (*attrib_list == EGL_VG_COLORSPACE_sRGB + || *attrib_list == EGL_VG_COLORSPACE_LINEAR) { + surfaceValue.vgColorSpace = *attrib_list++; + } else { + EGLINTER(SetError)(EGL_BAD_PARAMETER); + return EGL_NO_SURFACE; + } + break; + default: + EGLINTER(SetError)(EGL_BAD_ATTRIBUTE); + return EGL_NO_SURFACE; + } + } + *ptr = None; + + EGLINTER(SetError)(EGL_BAD_SURFACE); + return EGL_NO_SURFACE; +} diff --git a/egl_1_4/35CreatePbufferSurface.c b/egl_1_4/35CreatePbufferSurface.c new file mode 100755 index 0000000..7771c0a --- /dev/null +++ b/egl_1_4/35CreatePbufferSurface.c @@ -0,0 +1,139 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "implement.h" + + +EGLSurface EGLAPIENTRY eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config, + const EGLint *attrib_list) { + struct DisplayExtra* pDisplay = EGLINTER(LookUpDisplay)(dpy); + if (pDisplay == NULL) { + EGLINTER(SetError)(EGL_BAD_DISPLAY); + return EGL_NO_SURFACE; + } + if (pDisplay->bInitialized == EGL_FALSE) { + EGLINTER(SetError)(EGL_NOT_INITIALIZED); + return EGL_NO_SURFACE; + } + struct ConfigExtra* pConfig = EGLINTER(LookUpConfig)(pDisplay, config); + if (pConfig == NULL) { + EGLINTER(SetError)(EGL_BAD_CONFIG); + return EGL_NO_SURFACE; + } + if (pConfig->surfaceType & EGL_PBUFFER_BIT == 0) { + EGLINTER(SetError)(EGL_BAD_MATCH); + return EGL_NO_SURFACE; + } + struct SurfaceExtra surfaceValue; + memcpy(&surfaceValue, &surfaceExtraDefault, sizeof(struct SurfaceExtra)); + surfaceValue.renderBuffer = EGL_BACK_BUFFER; + int buf[32]; + int* ptr = &buf[0]; + while (attrib_list && *attrib_list != EGL_NONE) { + switch (*attrib_list++) { + case EGL_WIDTH: + *ptr++ = GLX_WIDTH; + *ptr++ = *attrib_list++; + break; + case EGL_HEIGHT: + *ptr++ = GLX_HEIGHT; + *ptr++ = *attrib_list++; + break; + case EGL_LARGEST_PBUFFER: + *ptr++ = GLX_LARGEST_PBUFFER; + *ptr++ = (*attrib_list++ == EGL_FALSE) ? False : True; + break; + case EGL_TEXTURE_FORMAT: + if (*attrib_list == EGL_NO_TEXTURE || *attrib_list == EGL_TEXTURE_RGB + || *attrib_list == EGL_TEXTURE_RGBA) { + surfaceValue.textureFormat = *attrib_list++; + } else { + EGLINTER(SetError)(EGL_BAD_PARAMETER); + return EGL_NO_SURFACE; + } + break; + case EGL_TEXTURE_TARGET: + if (*attrib_list == EGL_NO_TEXTURE || *attrib_list == EGL_TEXTURE_2D) { + surfaceValue.textureFormat = *attrib_list++; + } else { + EGLINTER(SetError)(EGL_BAD_PARAMETER); + return EGL_NO_SURFACE; + } + break; + case EGL_MIPMAP_TEXTURE: + surfaceValue.mipmapTexture = (*attrib_list++ == EGL_FALSE) ? EGL_FALSE : EGL_TRUE; + break; + case EGL_VG_ALPHA_FORMAT: + if (*attrib_list == EGL_VG_ALPHA_FORMAT_NONPRE + || *attrib_list == EGL_VG_ALPHA_FORMAT_PRE) { + surfaceValue.vgAlphaFormat = *attrib_list++; + } else { + EGLINTER(SetError)(EGL_BAD_PARAMETER); + return EGL_NO_SURFACE; + } + break; + case EGL_VG_COLORSPACE: + if (*attrib_list == EGL_VG_COLORSPACE_sRGB + || *attrib_list == EGL_VG_COLORSPACE_LINEAR) { + surfaceValue.vgColorSpace = *attrib_list++; + } else { + EGLINTER(SetError)(EGL_BAD_PARAMETER); + return EGL_NO_SURFACE; + } + break; + default: + EGLINTER(SetError)(EGL_BAD_ATTRIBUTE); + return EGL_NO_SURFACE; + } + } + *ptr = None; + GLXPbuffer native = FNPTR(CreatePbuffer)(pDisplay->native, pConfig->native, buf); + EGLSurface unique = (EGLSurface)(native); + struct SurfaceExtra* pSurface = EGLINTER(LookUpSurface)(unique); + if (pSurface == NULL) { + pSurface = EGLINTER(InsertSurface)(unique); + if (pSurface == NULL) { + EGLINTER(SetError)(EGL_BAD_ALLOC); + return EGL_NO_SURFACE; + } + memcpy(pSurface, &surfaceValue, sizeof(struct SurfaceExtra)); + pSurface->unique = unique; + pSurface->native = native; + pSurface->display = dpy; + pSurface->config = config; + pSurface->type = EGL_PBUFFER_BIT; + } else { + + EGLINTER(SetError)(EGL_BAD_MATCH); + return EGL_NO_SURFACE; + } + return (EGLSurface)(pSurface->native); +} diff --git a/egl_1_4/35CreatePixmapSurface.c b/egl_1_4/35CreatePixmapSurface.c new file mode 100755 index 0000000..915d7b1 --- /dev/null +++ b/egl_1_4/35CreatePixmapSurface.c @@ -0,0 +1,128 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "implement.h" + + +EGLSurface EGLAPIENTRY eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config, + EGLNativePixmapType pixmap, const EGLint *attrib_list) { + struct DisplayExtra* pDisplay = EGLINTER(LookUpDisplay)(dpy); + if (pDisplay == NULL) { + EGLINTER(SetError)(EGL_BAD_DISPLAY); + return EGL_NO_SURFACE; + } + if (pDisplay->bInitialized == EGL_FALSE) { + EGLINTER(SetError)(EGL_NOT_INITIALIZED); + return EGL_NO_SURFACE; + } + struct ConfigExtra* pConfig = EGLINTER(LookUpConfig)(pDisplay, config); + if (pConfig == NULL) { + EGLINTER(SetError)(EGL_BAD_CONFIG); + return EGL_NO_SURFACE; + } + if (pConfig->surfaceType & EGL_PIXMAP_BIT == 0) { + EGLINTER(SetError)(EGL_BAD_MATCH); + return EGL_NO_SURFACE; + } + + + struct SurfaceExtra surfaceValue; + memcpy(&surfaceValue, &surfaceExtraDefault, sizeof(struct SurfaceExtra)); + surfaceValue.renderBuffer = EGL_SINGLE_BUFFER; + while (attrib_list && *attrib_list != EGL_NONE) { + switch (*attrib_list++) { + case EGL_VG_COLORSPACE: + if (*attrib_list == EGL_VG_COLORSPACE_sRGB + || *attrib_list == EGL_VG_COLORSPACE_LINEAR) { + surfaceValue.vgColorSpace = *attrib_list++; + } else { + EGLINTER(SetError)(EGL_BAD_PARAMETER); + return EGL_NO_SURFACE; + } + break; + case EGL_VG_ALPHA_FORMAT: + if (*attrib_list == EGL_VG_ALPHA_FORMAT_NONPRE + || *attrib_list == EGL_VG_ALPHA_FORMAT_PRE) { + surfaceValue.vgAlphaFormat = *attrib_list++; + } else { + EGLINTER(SetError)(EGL_BAD_PARAMETER); + return EGL_NO_SURFACE; + } + break; + default: + EGLINTER(SetError)(EGL_BAD_ATTRIBUTE); + return EGL_NO_SURFACE; + } + } + + Window root; + unsigned dummy, width, height; + if (XGetGeometry(pDisplay->native, (Pixmap)pixmap, &root, + &dummy, &dummy, &width, &height, + &dummy, &dummy) == 0) { + fprintf (stderr, "XGetGeometry failed.\n"); + EGLINTER(SetError)(EGL_BAD_NATIVE_PIXMAP); + return EGL_FALSE; + } + + /* Need pass the width & height, so put them in attrib_list although it + * should be NULL in normal */ + int buf[8]; + int* ptr = &buf[0]; + *ptr++ = GLX_WIDTH; + *ptr++ = width; + *ptr++ = GLX_HEIGHT; + *ptr++ = height; + *ptr++ = None; + + GLXPixmap native = FNPTR(CreatePixmap)(pDisplay->native, pConfig->native, pixmap, buf); + EGLSurface unique = (EGLSurface)(native); + struct SurfaceExtra* pSurface = EGLINTER(LookUpSurface)(unique); + if (pSurface == NULL) { + pSurface = EGLINTER(InsertSurface)(unique); + if (pSurface == NULL) { + EGLINTER(SetError)(EGL_BAD_ALLOC); + return EGL_NO_SURFACE; + } + memcpy(pSurface, &surfaceValue, sizeof(struct SurfaceExtra)); + pSurface->unique = unique; + pSurface->native = native; + pSurface->lowWinPix = pixmap; + pSurface->display = dpy; + pSurface->config = config; + pSurface->type = EGL_PIXMAP_BIT; + } else { + + EGLINTER(SetError)(EGL_BAD_MATCH); + return EGL_NO_SURFACE; + } + return (EGLSurface)(pSurface->native); +} diff --git a/egl_1_4/35CreateWindowSurface.c b/egl_1_4/35CreateWindowSurface.c new file mode 100755 index 0000000..60f9cce --- /dev/null +++ b/egl_1_4/35CreateWindowSurface.c @@ -0,0 +1,127 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "implement.h" + + +struct SurfaceExtra surfaceExtraDefault = { + NULL, (GLXDrawable)NULL, (Drawable)NULL, + NULL, NULL, + 0, + EGL_NO_TEXTURE, EGL_NO_TEXTURE, EGL_FALSE, 0, + EGL_BACK_BUFFER, + EGL_VG_ALPHA_FORMAT_PRE, EGL_VG_COLORSPACE_LINEAR, + EGL_BUFFER_DESTROYED, EGL_MULTISAMPLE_RESOLVE_DEFAULT, +}; + + +EGLSurface EGLAPIENTRY eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, + EGLNativeWindowType win, const EGLint *attrib_list) { + struct DisplayExtra* pDisplay = EGLINTER(LookUpDisplay)(dpy); + if (pDisplay == NULL) { + EGLINTER(SetError)(EGL_BAD_DISPLAY); + return EGL_NO_SURFACE; + } + if (pDisplay->bInitialized == EGL_FALSE) { + EGLINTER(SetError)(EGL_NOT_INITIALIZED); + return EGL_NO_SURFACE; + } + struct ConfigExtra* pConfig = EGLINTER(LookUpConfig)(pDisplay, config); + if (pConfig == NULL) { + EGLINTER(SetError)(EGL_BAD_CONFIG); + return EGL_NO_SURFACE; + } + if ((pConfig->surfaceType & EGL_WINDOW_BIT) == 0) { + EGLINTER(SetError)(EGL_BAD_MATCH); + return EGL_NO_SURFACE; + } + + + struct SurfaceExtra surfaceValue; + memcpy(&surfaceValue, &surfaceExtraDefault, sizeof(struct SurfaceExtra)); + while (attrib_list && *attrib_list != EGL_NONE) { + switch (*attrib_list++) { + case EGL_RENDER_BUFFER: + if (*attrib_list == EGL_BACK_BUFFER) { + surfaceValue.renderBuffer = *attrib_list++; + } else if (*attrib_list == EGL_SINGLE_BUFFER) { + /* + EGLINTER(SetError)(EGL_BAD_MATCH); + return EGL_NO_SURFACE; + */ + } else { + EGLINTER(SetError)(EGL_BAD_PARAMETER); + return EGL_NO_SURFACE; + } + case EGL_VG_COLORSPACE: + if (*attrib_list == EGL_VG_COLORSPACE_sRGB || *attrib_list == EGL_VG_COLORSPACE_LINEAR) { + surfaceValue.vgColorSpace = *attrib_list++; + } else { + EGLINTER(SetError)(EGL_BAD_PARAMETER); + return EGL_NO_SURFACE; + } + break; + case EGL_VG_ALPHA_FORMAT: + if (*attrib_list == EGL_VG_ALPHA_FORMAT_NONPRE || *attrib_list == EGL_VG_ALPHA_FORMAT_PRE) { + surfaceValue.vgAlphaFormat = *attrib_list++; + } else { + EGLINTER(SetError)(EGL_BAD_PARAMETER); + return EGL_NO_SURFACE; + } + break; + default: + EGLINTER(SetError)(EGL_BAD_ATTRIBUTE); + return EGL_NO_SURFACE; + } + } + GLXWindow native = FNPTR(CreateWindow)(pDisplay->native, pConfig->native, win, NULL); + EGLSurface unique = (EGLSurface)(native); + struct SurfaceExtra* pSurface = EGLINTER(LookUpSurface)(unique); + if (pSurface == NULL) { + pSurface = EGLINTER(InsertSurface)(unique); + if (pSurface == NULL) { + EGLINTER(SetError)(EGL_BAD_ALLOC); + return EGL_NO_SURFACE; + } + memcpy(pSurface, &surfaceValue, sizeof(struct SurfaceExtra)); + pSurface->unique = unique; + pSurface->native = native; + pSurface->lowWinPix = win; + pSurface->display = dpy; + pSurface->config = config; + pSurface->type = EGL_WINDOW_BIT; + } else { + + EGLINTER(SetError)(EGL_BAD_MATCH); + return EGL_NO_SURFACE; + } + return (EGLSurface)(pSurface->native); +} diff --git a/egl_1_4/35DestroySurface.c b/egl_1_4/35DestroySurface.c new file mode 100755 index 0000000..5bae4f2 --- /dev/null +++ b/egl_1_4/35DestroySurface.c @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "implement.h" + + +EGLBoolean EGLAPIENTRY eglDestroySurface(EGLDisplay dpy, EGLSurface surface) { + struct DisplayExtra* pDisplay = EGLINTER(LookUpDisplay)(dpy); + if (pDisplay == NULL) { + EGLINTER(SetError)(EGL_BAD_DISPLAY); + return EGL_FALSE; + } + if (pDisplay->bInitialized == EGL_FALSE) { + EGLINTER(SetError)(EGL_NOT_INITIALIZED); + return EGL_FALSE; + } + struct SurfaceExtra* pSurface = EGLINTER(LookUpSurface)(surface); + if (pSurface == NULL) { + EGLINTER(SetError)(EGL_BAD_SURFACE); + return EGL_FALSE; + } + if (pSurface->display != pDisplay->unique) { + EGLINTER(SetError)(EGL_BAD_SURFACE); + return EGL_FALSE; + } + + FNPTR(DestroyWindow)(pDisplay->native, pSurface->native); + EGLINTER(DeleteSurface)(surface); + return EGL_TRUE; +} diff --git a/egl_1_4/36BindTexImage.c b/egl_1_4/36BindTexImage.c new file mode 100755 index 0000000..c6fd366 --- /dev/null +++ b/egl_1_4/36BindTexImage.c @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "implement.h" + + +EGLBoolean EGLAPIENTRY eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer) { + struct DisplayExtra* pDisplay = EGLINTER(LookUpDisplay)(dpy); + if (pDisplay == NULL) { + EGLINTER(SetError)(EGL_BAD_DISPLAY); + return EGL_FALSE; + } + if (pDisplay->bInitialized == EGL_FALSE) { + EGLINTER(SetError)(EGL_NOT_INITIALIZED); + return EGL_FALSE; + } + struct SurfaceExtra* pSurface = EGLINTER(LookUpSurface)(surface); + if (pSurface == NULL) { + EGLINTER(SetError)(EGL_BAD_SURFACE); + return EGL_FALSE; + } + /* TODO */ + /* TODO */ + FNPTR(BindTexImageARB)(pDisplay->native, pSurface->native, buffer ); + return EGL_TRUE; +} diff --git a/egl_1_4/36QuerySurface.c b/egl_1_4/36QuerySurface.c new file mode 100755 index 0000000..05e1101 --- /dev/null +++ b/egl_1_4/36QuerySurface.c @@ -0,0 +1,133 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "implement.h" + + +EGLBoolean EGLAPIENTRY eglQuerySurface(EGLDisplay dpy, EGLSurface surface, + EGLint attribute, EGLint *value) { + struct DisplayExtra* pDisplay = EGLINTER(LookUpDisplay)(dpy); + if (pDisplay == NULL) { + EGLINTER(SetError)(EGL_BAD_DISPLAY); + return EGL_FALSE; + } + if (pDisplay->bInitialized == EGL_FALSE) { + EGLINTER(SetError)(EGL_NOT_INITIALIZED); + return EGL_FALSE; + } + struct SurfaceExtra* pSurface = EGLINTER(LookUpSurface)(surface); + if (pSurface == NULL) { + EGLINTER(SetError)(EGL_BAD_SURFACE); + return EGL_FALSE; + } + if (pSurface->display != pDisplay->unique) { + EGLINTER(SetError)(EGL_BAD_SURFACE); + return EGL_FALSE; + } + EGLint answer; + switch (attribute) { + case EGL_CONFIG_ID: + answer = ((struct ConfigExtra*)(pSurface->config))->unique; + break; + case EGL_HEIGHT: + FNPTR(QueryDrawable)(pDisplay->native, pSurface->native, GLX_HEIGHT, + (unsigned int*)&answer); + break; + case EGL_WIDTH: + FNPTR(QueryDrawable)(pDisplay->native, pSurface->native, GLX_WIDTH, + (unsigned int*)&answer); + break; + case EGL_LARGEST_PBUFFER: + FNPTR(QueryDrawable)(pDisplay->native, pSurface->native, GLX_LARGEST_PBUFFER, + (unsigned int*)&answer); + break; + case EGL_TEXTURE_FORMAT: + answer = pSurface->textureFormat; + break; + case EGL_TEXTURE_TARGET: + answer = pSurface->textureTarget; + break; + case EGL_MIPMAP_TEXTURE: + answer = pSurface->mipmapTexture; + break; + case EGL_MIPMAP_LEVEL: + answer = pSurface->mipmapLevel; + break; + case EGL_RENDER_BUFFER: + answer = pSurface->renderBuffer; + break; + case EGL_VG_COLORSPACE: + answer = pSurface->vgColorSpace; + break; + case EGL_VG_ALPHA_FORMAT: + answer = pSurface->vgAlphaFormat; + break; + case EGL_HORIZONTAL_RESOLUTION: + if (pSurface->type == EGL_WINDOW_BIT) { + answer = EGL_DISPLAY_SCALING * 1000 + * DisplayWidth(pDisplay->native, DefaultScreen(pDisplay->native)) + / DisplayWidthMM(pDisplay->native, DefaultScreen(pDisplay->native)); + } else { + answer = EGL_UNKNOWN; + } + break; + case EGL_VERTICAL_RESOLUTION: + if (pSurface->type == EGL_WINDOW_BIT) { + answer = EGL_DISPLAY_SCALING * 1000 + * DisplayHeight(pDisplay->native, DefaultScreen(pDisplay->native)) + / DisplayHeightMM(pDisplay->native, DefaultScreen(pDisplay->native)); + } else { + answer = EGL_UNKNOWN; + } + break; + case EGL_PIXEL_ASPECT_RATIO: + if (pSurface->type == EGL_WINDOW_BIT) { + answer = EGL_DISPLAY_SCALING + * DisplayWidthMM(pDisplay->native, DefaultScreen(pDisplay->native)) + / DisplayHeightMM(pDisplay->native, DefaultScreen(pDisplay->native)); + } else { + answer = EGL_UNKNOWN; + } + break; + case EGL_SWAP_BEHAVIOR: + answer = pSurface->swapBehavior; + break; + case EGL_MULTISAMPLE_RESOLVE: + answer = pSurface->multisampleResolve; + break; + default: + EGLINTER(SetError)(EGL_BAD_ATTRIBUTE); + return EGL_FALSE; + break; + } + if (value != NULL) *value = answer; + return EGL_TRUE; +} diff --git a/egl_1_4/36ReleaseTexImage.c b/egl_1_4/36ReleaseTexImage.c new file mode 100755 index 0000000..50fd983 --- /dev/null +++ b/egl_1_4/36ReleaseTexImage.c @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "implement.h" + + +EGLBoolean EGLAPIENTRY eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer) { + struct DisplayExtra* pDisplay = EGLINTER(LookUpDisplay)(dpy); + if (pDisplay == NULL) { + EGLINTER(SetError)(EGL_BAD_DISPLAY); + return EGL_FALSE; + } + if (pDisplay->bInitialized == EGL_FALSE) { + EGLINTER(SetError)(EGL_NOT_INITIALIZED); + return EGL_FALSE; + } + struct SurfaceExtra* pSurface = EGLINTER(LookUpSurface)(surface); + if (pSurface == NULL) { + EGLINTER(SetError)(EGL_BAD_SURFACE); + return EGL_FALSE; + } + /* TODO */ + /* TODO */ + FNPTR(ReleaseTexImageARB)(pDisplay->native, pSurface->native, buffer); + return EGL_TRUE; +} diff --git a/egl_1_4/36SurfaceAttrib.c b/egl_1_4/36SurfaceAttrib.c new file mode 100755 index 0000000..c46915e --- /dev/null +++ b/egl_1_4/36SurfaceAttrib.c @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "implement.h" + + +EGLBoolean EGLAPIENTRY eglSurfaceAttrib(EGLDisplay dpy, EGLSurface surface, + EGLint attribute, EGLint value) { + struct DisplayExtra* pDisplay = EGLINTER(LookUpDisplay)(dpy); + if (pDisplay == NULL) { + EGLINTER(SetError)(EGL_BAD_DISPLAY); + return EGL_FALSE; + } + if (pDisplay->bInitialized == EGL_FALSE) { + EGLINTER(SetError)(EGL_NOT_INITIALIZED); + return EGL_FALSE; + } + struct SurfaceExtra* pSurface = EGLINTER(LookUpSurface)(surface); + if (pSurface == NULL) { + EGLINTER(SetError)(EGL_BAD_SURFACE); + return EGL_FALSE; + } + if (pSurface->display != pDisplay->unique) { + EGLINTER(SetError)(EGL_BAD_SURFACE); + return EGL_FALSE; + } + switch (attribute) { + case EGL_MIPMAP_LEVEL: + pSurface->mipmapLevel = value; + break; + case EGL_SWAP_BEHAVIOR: + if (value == EGL_BUFFER_PRESERVED || value == EGL_BUFFER_DESTROYED) { + pSurface->swapBehavior = value; + } else { + EGLINTER(SetError)(EGL_BAD_PARAMETER); + return EGL_FALSE; + } + break; + case EGL_MULTISAMPLE_RESOLVE: + if (value == EGL_MULTISAMPLE_RESOLVE_DEFAULT || value == EGL_MULTISAMPLE_RESOLVE_BOX) { + pSurface->multisampleResolve = value; + } else { + EGLINTER(SetError)(EGL_BAD_PARAMETER); + return EGL_FALSE; + } + break; + default: + EGLINTER(SetError)(EGL_BAD_ATTRIBUTE); + return EGL_FALSE; + break; + } + return EGL_TRUE; +} diff --git a/egl_1_4/37BindAPI.c b/egl_1_4/37BindAPI.c new file mode 100755 index 0000000..0fede7a --- /dev/null +++ b/egl_1_4/37BindAPI.c @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "implement.h" + + +EGLBoolean EGLAPIENTRY eglBindAPI(EGLenum api) { + switch (api) { +#if defined(PROVIDING_RUNTIME_BINDING) + case EGL_OPENGL_API: + case EGL_OPENGL_ES_API: + case EGL_OPENVG_API: + EGLINTER(global).currentAPI = api; + return EGL_TRUE; +#else + case EGL_OPENGL_ES_API: + EGLINTER(global).currentAPI = api; + return EGL_TRUE; + case EGL_OPENGL_API: + case EGL_OPENVG_API: +#endif + default: + EGLINTER(SetError)(EGL_BAD_PARAMETER); + return EGL_FALSE; + } +} + diff --git a/egl_1_4/37CreateContext.c b/egl_1_4/37CreateContext.c new file mode 100755 index 0000000..95afd38 --- /dev/null +++ b/egl_1_4/37CreateContext.c @@ -0,0 +1,175 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "implement.h" +#include <dlfcn.h> + + +EGLContext EGLAPIENTRY eglCreateContext(EGLDisplay dpy, EGLConfig config, + EGLContext share_context, const EGLint *attrib_list) { + void* (*fpVGCreateContext)(void*) = NULL;//jcpark +#if defined(PROVIDING_RUNTIME_BINDING) + void* (*fpCreateContext)(void) = NULL; +#endif + EGLint apiVersion = 1; + struct DisplayExtra* pDisplay = EGLINTER(LookUpDisplay)(dpy); + if (pDisplay == NULL) { + EGLINTER(SetError)(EGL_BAD_DISPLAY); + return EGL_NO_CONTEXT; + } + if (pDisplay->bInitialized == EGL_FALSE) { + EGLINTER(SetError)(EGL_NOT_INITIALIZED); + return EGL_NO_CONTEXT; + } + struct ConfigExtra* pConfig = EGLINTER(LookUpConfig)(pDisplay, config); + if (pConfig == NULL) { + EGLINTER(SetError)(EGL_BAD_CONFIG); + return EGL_NO_CONTEXT; + } + struct ContextExtra* pShare = NULL; + if (share_context != EGL_NO_CONTEXT) { + pShare = EGLINTER(LookUpContext)(share_context); + if (pShare == NULL) { + EGLINTER(SetError)(EGL_BAD_CONTEXT); + return EGL_NO_CONTEXT; + } + } + while ((attrib_list != NULL) && (*attrib_list != EGL_NONE)) { + switch (*attrib_list) { + case EGL_CONTEXT_CLIENT_VERSION: + if (EGLINTER(global).currentAPI != EGL_OPENGL_ES_API) { + EGLINTER(SetError)(EGL_BAD_ATTRIBUTE); + return; + } + apiVersion = *(attrib_list + 1); + switch (apiVersion) { + default: + EGLINTER(SetError)(EGL_BAD_ATTRIBUTE); + return; + case 1: + if ((pConfig->renderableType & EGL_OPENGL_ES_BIT) == 0) { + EGLINTER(SetError)(EGL_BAD_ATTRIBUTE); + return; + } + break; + case 2: + if ((pConfig->renderableType & EGL_OPENGL_ES2_BIT) == 0) { + EGLINTER(SetError)(EGL_BAD_ATTRIBUTE); + return; + } + break; + } + attrib_list++; + break; + default: + EGLINTER(SetError)(EGL_BAD_ATTRIBUTE); + return EGL_NO_CONTEXT; + } + attrib_list++; + } + GLXContext native = FNPTR(CreateNewContext)(pDisplay->native, pConfig->native, + GLX_RGBA_TYPE, (pShare == NULL) ? NULL : pShare->native, True); + EGLContext unique = (EGLContext)(native); + struct ContextExtra* pContext = EGLINTER(LookUpContext)(unique); + if (pContext == NULL) { + pContext = EGLINTER(InsertContext)(unique); + if (pContext == NULL) { + EGLINTER(SetError)(EGL_BAD_ALLOC); + return EGL_NO_CONTEXT; + } + pContext->native = native; + pContext->display = dpy; + pContext->config = config; + pContext->renderBuffer = EGL_NONE; + pContext->apiKind = EGLINTER(global).currentAPI; + pContext->apiVersion = apiVersion; + pContext->deleted = EGL_FALSE; + switch (pContext->apiKind) { + default: + case EGL_OPENGL_API: + pContext->apiContext = NULL; + break; +#if defined(PROVIDING_RUNTIME_BINDING) + case EGL_OPENGL_ES_API: + if (pContext->apiVersion == 2) { + if (EGLINTER(global).dlES2 == NULL) { + if ((EGLINTER(global).dlES2 = dlopen(GL_ES2_SO_FILENAME, RTLD_NOW | RTLD_GLOBAL)) + == NULL) { + EGLINTER(SetError)(EGL_BAD_ACCESS); + return; + } + } + fpCreateContext = dlsym(EGLINTER(global).dlES2, EGLCROSS_PREFIX "CreateContext"); + if (fpCreateContext != NULL) { + pContext->apiContext = (*fpCreateContext)(); + } + } else { + if (EGLINTER(global).dlES1 == NULL) { + if ((EGLINTER(global).dlES1 = dlopen(GL_ES1_SO_FILENAME, RTLD_NOW | RTLD_GLOBAL)) + == NULL) { + EGLINTER(SetError)(EGL_BAD_ACCESS); + return; + } + } + fpCreateContext = dlsym(EGLINTER(global).dlES1, EGLCROSS_PREFIX "CreateContext"); + if (fpCreateContext != NULL) { + pContext->apiContext = (*fpCreateContext)(); + } + } + break; +#else + case EGL_OPENGL_ES_API: + pContext->apiContext = EGLCROSS(CreateContext)(); + break; +#endif + case EGL_OPENVG_API: + /* TODO: OpenVG may need some action here */ //jcpark + if (EGLINTER(global).dlVG == NULL) { + if ((EGLINTER(global).dlVG = dlopen(VG_SO_FILENAME, RTLD_NOW | RTLD_GLOBAL)) + == NULL) { + EGLINTER(SetError)(EGL_BAD_ACCESS); + return; + } + } + fpVGCreateContext = dlsym(EGLINTER(global).dlVG, "vg4egl_CreateContext"); + if (fpVGCreateContext != NULL) { + pContext->apiContext = (*fpVGCreateContext)(NULL); + } + break; + } + } else { + + EGLINTER(SetError)(EGL_BAD_CONTEXT); + return EGL_NO_CONTEXT; + } + + return (EGLContext)(pContext->native); +} diff --git a/egl_1_4/37DestroyContext.c b/egl_1_4/37DestroyContext.c new file mode 100755 index 0000000..c3fb146 --- /dev/null +++ b/egl_1_4/37DestroyContext.c @@ -0,0 +1,139 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "implement.h" +#include <dlfcn.h> + + +EGLBoolean EGLAPIENTRY eglDestroyContext(EGLDisplay dpy, EGLContext ctx) { +void (*fpVGReleaseContext)(void*) = NULL;//jcpark +#if defined(PROVIDING_RUNTIME_BINDING) + void (*fpReleaseContext)(void*) = NULL; +#endif + struct DisplayExtra* pDisplay = EGLINTER(LookUpDisplay)(dpy); + if (pDisplay == NULL) { + EGLINTER(SetError)(EGL_BAD_DISPLAY); + return EGL_FALSE; + } + if (pDisplay->bInitialized == EGL_FALSE) { + EGLINTER(SetError)(EGL_NOT_INITIALIZED); + return EGL_FALSE; + } + + + struct ContextExtra* pContext = EGLINTER(LookUpContext)(ctx); + if (pContext == NULL) { + EGLINTER(SetError)(EGL_BAD_CONTEXT); + return EGL_FALSE; + } +// switch (pContext->apiKind) { +// default: +// case EGL_OPENGL_API: +// assert(pContext->apiContext == NULL); +// break; +//#if defined(PROVIDING_RUNTIME_BINDING) +// case EGL_OPENGL_ES_API: +// if (pContext->apiVersion == 2) { +// if (EGLINTER(global).dlES2 == NULL) { +// if ((EGLINTER(global).dlES2 = dlopen(GL_ES2_SO_FILENAME, RTLD_NOW | RTLD_GLOBAL)) +// == NULL) { +// EGLINTER(SetError)(EGL_BAD_ACCESS); +// return; +// } +// } +// fpReleaseContext = dlsym(EGLINTER(global).dlES2, EGLCROSS_PREFIX "ReleaseContext"); +// if (fpReleaseContext != NULL) { +// (*fpReleaseContext)(pContext->apiContext); +// pContext->apiContext = NULL; +// } +// } else { +// if (EGLINTER(global).dlES1 == NULL) { +// if ((EGLINTER(global).dlES1 = dlopen(GL_ES1_SO_FILENAME, RTLD_NOW | RTLD_GLOBAL)) +// == NULL) { +// EGLINTER(SetError)(EGL_BAD_ACCESS); +// return; +// } +// } +// fpReleaseContext = dlsym(EGLINTER(global).dlES1, EGLCROSS_PREFIX "ReleaseContext"); +// if (fpReleaseContext != NULL) { +// (*fpReleaseContext)(pContext->apiContext); +// pContext->apiContext = NULL; +// } +// } +// break; +//#else +// case EGL_OPENGL_ES_API: +// if (pContext->apiContext != NULL) { +// EGLCROSS(ReleaseContext)(pContext->apiContext); +// } +// break; +//#endif +// case EGL_OPENVG_API: +// /* TODO: OpenVG may need some action here */ +// +// if (EGLINTER(global).dlVG == NULL) { printf("==jcpark vg4egl_DestroyContext 2\n"); +// if ((EGLINTER(global).dlVG = dlopen(VG_SO_FILENAME, RTLD_NOW | RTLD_GLOBAL)) +// == NULL) { printf("==jcpark vg4egl_DestroyContext 3\n"); +// EGLINTER(SetError)(EGL_BAD_ACCESS); +// return; +// } +// } +// fpVGReleaseContext = dlsym(EGLINTER(global).dlVG, "vg4egl_DestroyContext"); +// if (fpVGReleaseContext != NULL) { +// (*fpVGReleaseContext)(pContext->apiContext); +// pContext->apiContext = NULL; +// printf("==jcpark== vg4egl_DestroyContext working\n"); +// } +// +// break; +// } +// FNPTR(DestroyContext)(pDisplay->native, pContext->native); +// EGLINTER(DeleteContext)(ctx); +// +// return EGL_TRUE; + /* Do not delete context that is current, but mark it and deleted it + * when change current in eglMakeCurrent + * TODO: Add refcount to track context, so can delete it when refcount + * reach 0 in eglDestroyContext/eglMakeCurrent + */ + struct ContextExtra* pPrevious = NULL; + GLXContext nativePrevious = FNPTR(GetCurrentContext)(); + if (nativePrevious != NULL) { + EGLContext uniquePrevious = (EGLContext)(nativePrevious); + pPrevious = EGLINTER(LookUpContext)(uniquePrevious); + } + if (pContext == pPrevious) { + pContext->deleted = EGL_TRUE; + return EGL_TRUE; + } + + return EGLINTER(FreeContext)(pContext); +} diff --git a/egl_1_4/37GetCurrentContext.c b/egl_1_4/37GetCurrentContext.c new file mode 100755 index 0000000..1137908 --- /dev/null +++ b/egl_1_4/37GetCurrentContext.c @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "implement.h" + + +EGLContext EGLAPIENTRY eglGetCurrentContext(void) { + return _eglGetCurrentContext(); +} + +EGLContext _eglGetCurrentContext(void) { + if (!FNPTR(GetCurrentContext)) + return EGL_NO_CONTEXT; + + GLXContext native = FNPTR(GetCurrentContext)(); + if (native == NULL) { + return EGL_NO_CONTEXT; + } + if (EGLINTER(global).currentAPI == EGL_NONE) { + return EGL_NO_CONTEXT; + } + EGLContext unique = (EGLContext)(native); + if (EGLINTER(LookUpContext)(unique) == NULL) { + return EGL_NO_CONTEXT; + } + return unique; +} diff --git a/egl_1_4/37GetCurrentDisplay.c b/egl_1_4/37GetCurrentDisplay.c new file mode 100755 index 0000000..db81a70 --- /dev/null +++ b/egl_1_4/37GetCurrentDisplay.c @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "implement.h" + + +EGLDisplay EGLAPIENTRY eglGetCurrentDisplay(void) { + EGLNativeDisplayType native = FNPTR(GetCurrentDisplay)(); + if (native == NULL) { + return EGL_NO_DISPLAY; + } + EGLDisplay unique = (EGLDisplay)(native); + if (EGLINTER(LookUpDisplay)(unique) == NULL) { + return EGL_NO_DISPLAY; + } + return unique; +} diff --git a/egl_1_4/37GetCurrentSurface.c b/egl_1_4/37GetCurrentSurface.c new file mode 100755 index 0000000..70593bb --- /dev/null +++ b/egl_1_4/37GetCurrentSurface.c @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "implement.h" + + +EGLSurface EGLAPIENTRY eglGetCurrentSurface(EGLint readdraw) { + GLXDrawable native; + switch (readdraw) { + case EGL_READ: + native = FNPTR(GetCurrentReadDrawable)(); + break; + case EGL_DRAW: + native = FNPTR(GetCurrentDrawable)(); + break; + default: + EGLINTER(SetError)(EGL_BAD_PARAMETER); + return EGL_NO_SURFACE; + break; + } + if (native == None) { + return EGL_NO_SURFACE; + } + EGLSurface unique = (EGLSurface)(native); + if (EGLINTER(LookUpSurface)(unique) == NULL) { + return EGL_NO_SURFACE; + } + return unique; +} diff --git a/egl_1_4/37MakeCurrent.c b/egl_1_4/37MakeCurrent.c new file mode 100755 index 0000000..bb18f1f --- /dev/null +++ b/egl_1_4/37MakeCurrent.c @@ -0,0 +1,285 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "implement.h" +#include <dlfcn.h> + + +EGLBoolean EGLAPIENTRY eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, + EGLSurface read, EGLContext ctx) { + void* (*fpVGMakeCurrent)(void*) = NULL;//jcpark + Bool(*fpVGSetSurfaceSize)(EGLint,EGLint) = NULL;//jcpark + Bool(*fpVGSetDrawSurface)(void*) = NULL;//jcpark + +#if defined(PROVIDING_RUNTIME_BINDING) + void (*fpMakeCurrent)(void*) = NULL; +#endif + struct DisplayExtra* pDisplay = EGLINTER(LookUpDisplay)(dpy); + if (pDisplay == NULL) { + EGLINTER(SetError)(EGL_BAD_DISPLAY); + return EGL_FALSE; + } + if (pDisplay->bInitialized == EGL_FALSE) { + EGLINTER(SetError)(EGL_NOT_INITIALIZED); + return EGL_FALSE; + } + struct SurfaceExtra* pDraw = NULL; + if (draw != EGL_NO_SURFACE) { + pDraw = EGLINTER(LookUpSurface)(draw); + if (pDraw == NULL) { + EGLINTER(SetError)(EGL_BAD_SURFACE); + return EGL_FALSE; + } + } + struct SurfaceExtra* pRead = NULL; + if (read == draw) { + pRead = pDraw; + } else if (read != EGL_NO_SURFACE) { + pRead = EGLINTER(LookUpSurface)(read); + if (pRead == NULL) { + EGLINTER(SetError)(EGL_BAD_SURFACE); + return EGL_FALSE; + } + } + struct ContextExtra* pContext = NULL; + if (ctx != EGL_NO_CONTEXT) { + if (draw == EGL_NO_SURFACE || read == EGL_NO_SURFACE) { + EGLINTER(SetError)(EGL_BAD_MATCH); + return EGL_FALSE; + } + pContext = EGLINTER(LookUpContext)(ctx); + if (pContext == NULL) { + EGLINTER(SetError)(EGL_BAD_CONTEXT); + return EGL_FALSE; + } + } else { + if (draw != EGL_NO_SURFACE || read != EGL_NO_SURFACE) { + EGLINTER(SetError)(EGL_BAD_MATCH); + return EGL_FALSE; + } + } + struct ContextExtra* pPrevious = NULL; + GLXContext nativePrevious = FNPTR(GetCurrentContext)(); + if (nativePrevious != NULL) { + EGLContext uniquePrevious = (EGLContext)(nativePrevious); + pPrevious = EGLINTER(LookUpContext)(uniquePrevious); + } + + if (pPrevious != NULL) { + switch (pPrevious->apiKind) { + default: + case EGL_OPENGL_API: + break; +#if defined(PROVIDING_RUNTIME_BINDING) + case EGL_OPENGL_ES_API: + if (pPrevious->apiVersion == 2) { + if (EGLINTER(global).dlES2 == NULL) { + if ((EGLINTER(global).dlES2 = dlopen(GL_ES2_SO_FILENAME, RTLD_NOW | RTLD_GLOBAL)) + == NULL) { + EGLINTER(SetError)(EGL_BAD_ACCESS); + return; + } + } + fpMakeCurrent = dlsym(EGLINTER(global).dlES2, EGLCROSS_PREFIX "MakeCurrent"); +// if (fpMakeCurrent != NULL) { +// (*fpMakeCurrent)(NULL); +// } + } else { + if (EGLINTER(global).dlES1 == NULL) { + if ((EGLINTER(global).dlES1 = dlopen(GL_ES1_SO_FILENAME, RTLD_NOW | RTLD_GLOBAL)) + == NULL) { + EGLINTER(SetError)(EGL_BAD_ACCESS); + return; + } + } + fpMakeCurrent = dlsym(EGLINTER(global).dlES1, EGLCROSS_PREFIX "MakeCurrent"); +// if (fpMakeCurrent != NULL) { +// (*fpMakeCurrent)(NULL); +// } + } + break; +#else + case EGL_OPENGL_ES_API: + EGLCROSS(MakeCurrent)(NULL); + break; +#endif + case EGL_OPENVG_API: + + /* TODO: OpenVG may need some action here */ //jcpark + + if (EGLINTER(global).dlVG == NULL) { + if ((EGLINTER(global).dlVG = dlopen(VG_SO_FILENAME, RTLD_NOW | RTLD_GLOBAL)) + == NULL) { + EGLINTER(SetError)(EGL_BAD_ACCESS); + return; + } + } + fpVGMakeCurrent = dlsym(EGLINTER(global).dlVG, "vg4egl_SetContext"); + if (fpVGMakeCurrent != NULL) { + (*fpVGMakeCurrent)(pContext->apiContext); + } + else + { + printf("No symbol found for vg4egl_SetContext\n"); + } + fpVGSetSurfaceSize = dlsym(EGLINTER(global).dlVG, "vg4egl_SetSurfaceSize"); + if (fpVGSetSurfaceSize!= NULL) { + fpVGSetSurfaceSize(320,320); + } + else + { + printf("No symbol found for vg4egl_SetSurfaceSize\n"); + } + + + fpVGSetDrawSurface = dlsym(EGLINTER(global).dlVG, " vg4egl_SetDrawSurface"); + if (fpVGSetDrawSurface!= NULL) { + fpVGSetDrawSurface(pContext->apiContext); + } + else + { + printf("No symbol found for vg4egl_SetDrawSurface\n"); + } + + break; + } + } + Bool check = FNPTR(MakeContextCurrent)(pDisplay->native, + (pDraw == NULL) ? None : pDraw->native, + (pRead == NULL) ? None : pRead->native, + (pContext == NULL) ? NULL : pContext->native); + if (check == False) { + EGLINTER(SetError)(EGL_BAD_ALLOC); + return EGL_FALSE; + } + if (pContext != NULL) { + pContext->renderBuffer = pDraw->renderBuffer; + } +#if defined(PROVIDING_RUNTIME_BINDING) + if (pContext != NULL) { + switch (pContext->apiKind) { + default: + EGLINTER(ResetGLFnptrs)(&(EGLINTER(global))); + break; + case EGL_OPENGL_API: + EGLINTER(BindGLFnptrs)(&(EGLINTER(global))); + break; + case EGL_OPENGL_ES_API: + if (pContext->apiVersion == 2) { + if (EGLINTER(global).dlES2 == NULL) { + if ((EGLINTER(global).dlES2 = dlopen(GL_ES2_SO_FILENAME, RTLD_NOW | RTLD_GLOBAL)) + == NULL) { + EGLINTER(SetError)(EGL_BAD_ACCESS); + return; + } + } + fpMakeCurrent = dlsym(EGLINTER(global).dlES2, EGLCROSS_PREFIX "MakeCurrent"); + if (fpMakeCurrent != NULL) { + (*fpMakeCurrent)(pContext->apiContext); + } + EGLINTER(BindES2Fnptrs)(&(EGLINTER(global))); + } else { + if (EGLINTER(global).dlES1 == NULL) { + if ((EGLINTER(global).dlES1 = dlopen(GL_ES1_SO_FILENAME, RTLD_NOW | RTLD_GLOBAL)) + == NULL) { + EGLINTER(SetError)(EGL_BAD_ACCESS); + return; + } + } + fpMakeCurrent = dlsym(EGLINTER(global).dlES1, EGLCROSS_PREFIX "MakeCurrent"); + if (fpMakeCurrent != NULL) { + (*fpMakeCurrent)(pContext->apiContext); + } + EGLINTER(BindES1Fnptrs)(&(EGLINTER(global))); + } + break; + case EGL_OPENVG_API: + /* TODO: OpenVG may need some action here */ //jcpark + if (EGLINTER(global).dlVG == NULL) { + if ((EGLINTER(global).dlVG = dlopen(VG_SO_FILENAME, RTLD_NOW | RTLD_GLOBAL)) + == NULL) { + EGLINTER(SetError)(EGL_BAD_ACCESS); + return; + } + } + fpMakeCurrent = dlsym(EGLINTER(global).dlVG, "vg4egl_SetContext"); + if (fpMakeCurrent != NULL) { + (*fpMakeCurrent)(pContext->apiContext); + } + + fpVGSetSurfaceSize = dlsym(EGLINTER(global).dlVG, "vg4egl_SetSurfaceSize"); + if (fpVGSetSurfaceSize!= NULL) { + fpVGSetSurfaceSize(320,320); + } + else + { + printf("No symbol found for vg4egl_SetSurfaceSize\n"); + } + + fpVGSetDrawSurface = dlsym(EGLINTER(global).dlVG, "vg4egl_SetDrawSurface"); + if (fpVGSetDrawSurface!= NULL) { + fpVGSetDrawSurface(pContext->apiContext); + } + else + { + printf("No symbol found for vg4egl_SetDrawSurface\n");//jcpark + } + + EGLINTER(BindES1Fnptrs)(&(EGLINTER(global))); + + break; + } + } else { + EGLINTER(ResetGLFnptrs)(&(EGLINTER(global))); + } +#else + if (pContext != NULL) { + switch (pContext->apiKind) { + default: + case EGL_OPENGL_API: + break; + case EGL_OPENGL_ES_API: + EGLCROSS(MakeCurrent)(pContext->apiContext); + break; + case EGL_OPENVG_API: + /* TODO: OpenVG may need some action here */ + //jcpark I don't know what to do here! + + break; + } + } +#endif + /* Delete previous "current" if it was deleted */ + if (pPrevious != NULL && pPrevious->deleted && pPrevious != pContext) + EGLINTER(FreeContext)(pPrevious); + + return EGL_TRUE; +} diff --git a/egl_1_4/37QueryAPI.c b/egl_1_4/37QueryAPI.c new file mode 100755 index 0000000..ad6d67e --- /dev/null +++ b/egl_1_4/37QueryAPI.c @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "implement.h" + +EGLenum EGLAPIENTRY eglQueryAPI(void) { + register EGLenum eAnswer; + eAnswer = EGLINTER(global).currentAPI; + return eAnswer; +} + diff --git a/egl_1_4/37QueryContext.c b/egl_1_4/37QueryContext.c new file mode 100755 index 0000000..6df346b --- /dev/null +++ b/egl_1_4/37QueryContext.c @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "implement.h" + + +EGLBoolean EGLAPIENTRY eglQueryContext(EGLDisplay dpy, EGLContext ctx, + EGLint attribute, EGLint *value) { + struct DisplayExtra* pDisplay = EGLINTER(LookUpDisplay)(dpy); + if (pDisplay == NULL) { + EGLINTER(SetError)(EGL_BAD_DISPLAY); + return EGL_FALSE; + } + if (pDisplay->bInitialized == EGL_FALSE) { + EGLINTER(SetError)(EGL_NOT_INITIALIZED); + return EGL_FALSE; + } + struct ContextExtra* pContext = EGLINTER(LookUpContext)(ctx); + if (pContext == NULL) { + EGLINTER(SetError)(EGL_BAD_CONTEXT); + return EGL_FALSE; + } + EGLint answer; + switch (attribute) { + case EGL_CONFIG_ID: answer = ((struct ConfigExtra*)(pContext->config))->unique; break; + case EGL_CONTEXT_CLIENT_TYPE: answer = EGL_OPENGL_ES_API; break; + case EGL_CONTEXT_CLIENT_VERSION: answer = pContext->apiVersion; break; + case EGL_RENDER_BUFFER: answer = pContext->renderBuffer; break; + default: + EGLINTER(SetError)(EGL_BAD_ATTRIBUTE); + return EGL_FALSE; + } + if (value != NULL) *value = answer; + return EGL_TRUE; +} diff --git a/egl_1_4/38WaitClient.c b/egl_1_4/38WaitClient.c new file mode 100755 index 0000000..22435e8 --- /dev/null +++ b/egl_1_4/38WaitClient.c @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "implement.h" + + +EGLBoolean EGLAPIENTRY eglWaitClient(void) { + register EGLenum api; + api = eglQueryAPI(); + switch (api) { + case EGL_OPENGL_API: + case EGL_OPENGL_ES_API: + FNPTR(WaitGL)(); + break; + default: + break; + } + return EGL_TRUE; +} diff --git a/egl_1_4/38WaitGL.c b/egl_1_4/38WaitGL.c new file mode 100755 index 0000000..1a31545 --- /dev/null +++ b/egl_1_4/38WaitGL.c @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "implement.h" + + +EGLBoolean EGLAPIENTRY eglWaitGL(void) { + EGLenum api = eglQueryAPI(); + switch (api) { + case EGL_OPENGL_API: + case EGL_OPENGL_ES_API: + FNPTR(WaitGL)(); + break; + default: + break; + } + return EGL_TRUE; +} diff --git a/egl_1_4/38WaitNative.c b/egl_1_4/38WaitNative.c new file mode 100755 index 0000000..03a1b8d --- /dev/null +++ b/egl_1_4/38WaitNative.c @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "implement.h" + + +EGLBoolean EGLAPIENTRY eglWaitNative(EGLint engine) { + if (engine != EGL_CORE_NATIVE_ENGINE) { + EGLINTER(SetError)(EGL_BAD_PARAMETER); + return EGL_FALSE; + } + FNPTR(WaitX)(); + return EGL_TRUE; +} diff --git a/egl_1_4/39CopyBuffers.c b/egl_1_4/39CopyBuffers.c new file mode 100755 index 0000000..14891f5 --- /dev/null +++ b/egl_1_4/39CopyBuffers.c @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "implement.h" + + +EGLBoolean EGLAPIENTRY eglCopyBuffers(EGLDisplay dpy, EGLSurface surface, + EGLNativePixmapType target) { + struct DisplayExtra* pDisplay = EGLINTER(LookUpDisplay)(dpy); + if (pDisplay == NULL) { + EGLINTER(SetError)(EGL_BAD_DISPLAY); + return EGL_FALSE; + } + if (pDisplay->bInitialized == EGL_FALSE) { + EGLINTER(SetError)(EGL_NOT_INITIALIZED); + return EGL_FALSE; + } + struct SurfaceExtra* pSurface = EGLINTER(LookUpSurface)(surface); + if (pSurface == NULL) { + EGLINTER(SetError)(EGL_BAD_SURFACE); + return EGL_FALSE; + } + + /* SwapBuffers copy pixmap from host buffer to drawable as no + * glxCopyBuffers available */ + FNPTR(SwapBuffers)(pDisplay->native, pSurface->native); + + if (!target) + return EGL_TRUE; + + Window root; + int x, y; + unsigned int width, height, border, depth; + if (XGetGeometry(pDisplay->native, (Drawable)target, &root, + &x, &y, &width, &height, &border, &depth) == 0) { + EGLINTER(SetError)(EGL_BAD_NATIVE_PIXMAP); + return EGL_FALSE; + } + + if (XCopyArea(pDisplay->native, pSurface->lowWinPix, target, + DefaultGC(pDisplay->native, DefaultScreen(pDisplay->native)), + 0, 0, width, height, 0, 0) == 0) { + EGLINTER(SetError)(EGL_BAD_NATIVE_PIXMAP); + return EGL_FALSE; + } + return EGL_TRUE; +} + diff --git a/egl_1_4/39SwapBuffers.c b/egl_1_4/39SwapBuffers.c new file mode 100755 index 0000000..9b31cab --- /dev/null +++ b/egl_1_4/39SwapBuffers.c @@ -0,0 +1,134 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "implement.h" +#include <dlfcn.h>//jcpark + + +EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surface) { + struct DisplayExtra* pDisplay = EGLINTER(LookUpDisplay)(dpy); + if (pDisplay == NULL) { + EGLINTER(SetError)(EGL_BAD_DISPLAY); + return EGL_FALSE; + } + if (pDisplay->bInitialized == EGL_FALSE) { + EGLINTER(SetError)(EGL_NOT_INITIALIZED); + return EGL_FALSE; + } + struct SurfaceExtra* pSurface = EGLINTER(LookUpSurface)(surface); + if (pSurface == NULL) { + EGLINTER(SetError)(EGL_BAD_SURFACE); + return EGL_FALSE; + } + /* TODO */ + + /* TODO: OpenVG may need some action here */ //jcpark + struct ContextExtra* pPrevious = NULL; + GLXContext pContext = FNPTR(GetCurrentContext)(); + + if (pContext != NULL) { + EGLContext uniquePrevious = (EGLContext)(pContext); + pPrevious = EGLINTER(LookUpContext)(uniquePrevious); + } + + + void (*fpvgReadPixels)(void * , int, int, int, int, int, int)=NULL ;//jcpark + + unsigned char* buffer; + unsigned char* tmpbuf; + + int delta; + + //temp + int width = 320; + int height = 320; + int bpp = 4; + int i; + int unitsize; + switch( pPrevious->apiKind) + { + case EGL_OPENVG_API: + buffer = malloc( sizeof(unsigned char)*width * height * bpp ); + + + if (EGLINTER(global).dlVG == NULL) { + if ((EGLINTER(global).dlVG = dlopen(VG_SO_FILENAME, RTLD_NOW | RTLD_GLOBAL)) + == NULL) { + EGLINTER(SetError)(EGL_BAD_ACCESS); + return; + } + } + + fpvgReadPixels = dlsym(EGLINTER(global).dlVG, "vgReadPixels"); + if (fpvgReadPixels != NULL) { + fpvgReadPixels( buffer, width*bpp, VG_lRGBA_8888, 0, 0, width, height ); // VG �� ���� �Լ��� ���� + //RGBA -> ABGR + tmpbuf = malloc( sizeof(unsigned char)*width * height * bpp ); + unitsize = sizeof(unsigned char); + // tmpbuf - dest buffer - source + for(i=0;i<width*height;i++) + { + /* R */ *(tmpbuf+unitsize*0+i*bpp )=( *(buffer+unitsize*3+i*bpp) )& 0xFF; + /* G */ *(tmpbuf+unitsize*1+i*bpp )=( *(buffer+unitsize*2+i*bpp) )& 0xFF; + /* B */ *(tmpbuf+unitsize*2+i*bpp )=( *(buffer+unitsize*1+i*bpp) )& 0xFF; + /* A */ *(tmpbuf+unitsize*3+i*bpp )=( *(buffer+unitsize*0+i*bpp) )& 0xFF; + + } + + XVisualInfo* (*fpDrawPixels)( GLsizei width, GLsizei height, + GLenum format, GLenum type, + const GLvoid *pixels ) = NULL; + void* dl = dlopen("libGL.so", RTLD_NOW); + assert(dl != 0); + *(void**)(&fpDrawPixels) = dlsym(dl, "glDrawPixels"); + assert(fpDrawPixels != NULL); + + (*fpDrawPixels) ( width, height, GL_RGBA, GL_UNSIGNED_BYTE, tmpbuf); + +// glDrawPixels( width, height, GL_RGBA, GL_UNSIGNED_BYTE, tmpbuf); // GLES �� ���� �Լ��� ���� + + } + + //pContext->apiContext = NULL; + free( buffer ); + free( tmpbuf ); + + break; + + default: + + break; + + } + + FNPTR(SwapBuffers)(pDisplay->native, pSurface->native); + return EGL_TRUE; +} diff --git a/egl_1_4/39SwapInterval.c b/egl_1_4/39SwapInterval.c new file mode 100755 index 0000000..82825aa --- /dev/null +++ b/egl_1_4/39SwapInterval.c @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "implement.h" + + +EGLBoolean EGLAPIENTRY eglSwapInterval(EGLDisplay dpy, EGLint interval) { + struct DisplayExtra* pDisplay = EGLINTER(LookUpDisplay)(dpy); + if (pDisplay == NULL) { + EGLINTER(SetError)(EGL_BAD_DISPLAY); + return EGL_FALSE; + } + if (pDisplay->bInitialized == EGL_FALSE) { + EGLINTER(SetError)(EGL_NOT_INITIALIZED); + return EGL_FALSE; + } + if (eglGetCurrentContext() == EGL_NO_CONTEXT) { + EGLINTER(SetError)(EGL_BAD_CONTEXT); + return EGL_FALSE; + } + if (eglGetCurrentSurface(EGL_DRAW) == EGL_NO_SURFACE) { + EGLINTER(SetError)(EGL_BAD_SURFACE); + return EGL_FALSE; + } + FNPTR(SwapIntervalSGI)(interval); + return EGL_TRUE; +} diff --git a/egl_1_4/3AGetProcAddress.c b/egl_1_4/3AGetProcAddress.c new file mode 100755 index 0000000..80dec6c --- /dev/null +++ b/egl_1_4/3AGetProcAddress.c @@ -0,0 +1,103 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "implement.h" +#include <dlfcn.h> + + +__eglMustCastToProperFunctionPointerType EGLAPIENTRY eglGetProcAddress(const char *procname) { + void* fpAnswer = NULL; + if (procname == NULL) return NULL; + if (procname[0] == '\0') return NULL; + if (EGLINTER(global).dlEGL == NULL) { + if ((EGLINTER(global).dlEGL = dlopen(EGL_SO_FILENAME, RTLD_NOW | RTLD_GLOBAL)) == NULL) { + return NULL; + } + } + if ((fpAnswer = dlsym(EGLINTER(global).dlEGL, procname)) != NULL) { + return fpAnswer; + } + + void** ptrDLL = NULL; + char* sofilename; + char* libname; + + EGLContext eglContext = _eglGetCurrentContext(); + if (eglContext != EGL_NO_CONTEXT) { + struct ContextExtra* pContext = EGLINTER(LookUpContext)(eglContext); + assert(pContext != NULL); + switch (pContext->apiKind) { + case EGL_OPENGL_API: + ptrDLL = &(EGLINTER(global).dlGL); + sofilename = GL_SO_FILENAME; + libname = "GL"; + break; + case EGL_OPENGL_ES_API: + if (pContext->apiVersion == 2) { + ptrDLL = &(EGLINTER(global).dlES2); + sofilename = GL_ES2_SO_FILENAME; + libname = "ES2"; + } else { + ptrDLL = &(EGLINTER(global).dlES1); + sofilename = GL_ES1_SO_FILENAME; + libname = "ES1"; + } + break; + default: + return NULL; + break; + } + if (*ptrDLL == NULL) { + if ((*ptrDLL = dlopen(sofilename, RTLD_NOW | RTLD_GLOBAL)) == NULL) { + return NULL; + } + } + if ((fpAnswer = dlsym(*ptrDLL, procname)) != NULL) { + return fpAnswer; + } + } +#if 1 + else { + ptrDLL = &(EGLINTER(global).dlES2); + sofilename = GL_ES2_SO_FILENAME; + libname = "ES2"; + if (*ptrDLL == NULL) { + if ((*ptrDLL = dlopen(sofilename, RTLD_NOW | RTLD_GLOBAL)) == NULL) { + return NULL; + } + } + if ((fpAnswer = dlsym(*ptrDLL, procname)) != NULL) { + return fpAnswer; + } + } +#endif + return NULL; +} diff --git a/egl_1_4/3BReleaseThread.c b/egl_1_4/3BReleaseThread.c new file mode 100755 index 0000000..537de26 --- /dev/null +++ b/egl_1_4/3BReleaseThread.c @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "implement.h" + + +EGLBoolean EGLAPIENTRY eglReleaseThread(void) { + EGLDisplay dpy = eglGetCurrentDisplay(); + eglMakeCurrent(dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); + eglBindAPI(EGL_OPENGL_ES_API); + return EGL_TRUE; +} diff --git a/egl_1_4/41LockSurfaceKHR.c b/egl_1_4/41LockSurfaceKHR.c new file mode 100755 index 0000000..b1bc905 --- /dev/null +++ b/egl_1_4/41LockSurfaceKHR.c @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Edwin Zhai <edwin.zhai@intel.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * Yeongkyoon Lee <yeongkyoon.lee@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - Intel Corporation + * - S-Core Co., Ltd + * + */ + + /* + * 41LockSurfaceKHR.c + */ +#include "implement.h" + +EGLAPI EGLBoolean EGLAPIENTRY eglLockSurfaceKHR (EGLDisplay display, EGLSurface surface, const EGLint *attrib_list) +{ + return EGL_FALSE; +} + diff --git a/egl_1_4/41UnlockSurfaceKHR.c b/egl_1_4/41UnlockSurfaceKHR.c new file mode 100755 index 0000000..87880d7 --- /dev/null +++ b/egl_1_4/41UnlockSurfaceKHR.c @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Edwin Zhai <edwin.zhai@intel.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * Yeongkyoon Lee <yeongkyoon.lee@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - Intel Corporation + * - S-Core Co., Ltd + * + */ + + /* + * 41UnlockSurfaceKHR.c + */ +#include "implement.h" + +EGLAPI EGLBoolean EGLAPIENTRY eglUnlockSurfaceKHR (EGLDisplay display, EGLSurface surface) +{ + return EGL_FALSE; +} diff --git a/egl_1_4/42CreateImageKHR.c b/egl_1_4/42CreateImageKHR.c new file mode 100755 index 0000000..aa03ed9 --- /dev/null +++ b/egl_1_4/42CreateImageKHR.c @@ -0,0 +1,97 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Edwin Zhai <edwin.zhai@intel.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * Yeongkyoon Lee <yeongkyoon.lee@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - Intel Corporation + * - S-Core Co., Ltd + * + */ + + /* + * 42CreateImageKHR.c + */ +#include "implement.h" + +EGLAPI EGLImageKHR EGLAPIENTRY eglCreateImageKHR (EGLDisplay dpy, + EGLContext ctx, EGLenum target, + EGLClientBuffer buffer, + const EGLint *attrib_list) { +#if 1 + fprintf (stderr, "EGLImage: eglCreateImageKHR () was called!\n"); + fprintf (stderr, "======== ctx = %s\n",ctx == EGL_NO_CONTEXT ? "EGL_NO_CONTEXT" : "POINTER"); + if (target == EGL_NATIVE_PIXMAP_KHR) { + fprintf (stderr, "======== target = %s\n", "EGL_NATIVE_PIXMAP_KHR"); + } else { + fprintf (stderr, "======== target = %x\n", (unsigned int)target); + } + fprintf (stderr, "======== buffer = 0x%x\n", (unsigned int)buffer); +#endif + struct DisplayExtra* pDisplay = EGLINTER(LookUpDisplay)(dpy); + if (pDisplay == NULL) { + EGLINTER(SetError)(EGL_BAD_DISPLAY); + return EGL_NO_IMAGE_KHR; + } + if (pDisplay->bInitialized == EGL_FALSE) { + EGLINTER(SetError)(EGL_NOT_INITIALIZED); + return EGL_NO_IMAGE_KHR; + } + + if (ctx != EGL_NO_CONTEXT) { + EGLINTER(SetError)(EGL_BAD_CONTEXT); + return EGL_NO_IMAGE_KHR; + } + if (target != EGL_NATIVE_PIXMAP_KHR) { + fprintf (stderr, "EGLImage: Not yet supported target! (%x)\n", (unsigned int)target); + return EGL_NO_IMAGE_KHR; + } + // assert (!EGLINTER(LookUpEGLImage)(unique)); + + GLint unique = EGLINTER(global).nImageExtra + 1; + + /* Make sure the unique not used by others */ + while (EGLINTER(LookUpEGLImage)(unique)) + { + unique++; + } + + struct ImageExtra *pArea = EGLINTER(InsertEGLImage)((EGLImageKHR)unique); + // get the pixmap information here + Window root; + unsigned dummy; + if (XGetGeometry(pDisplay->native, (Pixmap)buffer, &root, + &dummy, &dummy, &pArea->width, &pArea->height, + &dummy, &pArea->depth) == 0) { + fprintf (stderr, "ZLV: Failed here???\n"); + EGLINTER(SetError)(EGL_BAD_NATIVE_PIXMAP); + return EGL_NO_IMAGE_KHR; + } + pArea->unique = (EGLImageKHR) unique; + pArea->dpy = pDisplay->native; + pArea->pixmap = (Pixmap) buffer; + + return (EGLImageKHR) unique; +} diff --git a/egl_1_4/42DestroyImageKHR.c b/egl_1_4/42DestroyImageKHR.c new file mode 100755 index 0000000..89ed197 --- /dev/null +++ b/egl_1_4/42DestroyImageKHR.c @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Edwin Zhai <edwin.zhai@intel.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * Yeongkyoon Lee <yeongkyoon.lee@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - Intel Corporation + * - S-Core Co., Ltd + * + */ + + /* + * 42DestroyImageKHR.c + */ +#include "implement.h" + +EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImageKHR (EGLDisplay dpy, EGLImageKHR image) +{ + fprintf (stderr, "EGLImage: eglDestroyImageKHR () was called!\n"); + // assert (EGLINTER(LookUpEGLImage)(image)); + + EGLINTER(DeleteEGLImage)(image); + return EGL_TRUE; +} + diff --git a/egl_1_4/binding.inl b/egl_1_4/binding.inl new file mode 100755 index 0000000..443343a --- /dev/null +++ b/egl_1_4/binding.inl @@ -0,0 +1,860 @@ + +GLboolean glIsBuffer(GLuint buffer) { + return FNPTR(IsBuffer)(buffer); +} + +GLboolean glIsEnabled(GLenum cap) { + return FNPTR(IsEnabled)(cap); +} + +GLboolean glIsFramebuffer(GLuint framebuffer) { + return FNPTR(IsFramebuffer)(framebuffer); +} + +GLboolean glIsProgram(GLuint program) { + return FNPTR(IsProgram)(program); +} + +GLboolean glIsRenderbuffer(GLuint renderbuffer) { + return FNPTR(IsRenderbuffer)(renderbuffer); +} + +GLboolean glIsShader(GLuint shader) { + return FNPTR(IsShader)(shader); +} + +GLboolean glIsTexture(GLuint texture) { + return FNPTR(IsTexture)(texture); +} + +GLenum glCheckFramebufferStatus(GLenum target) { + return FNPTR(CheckFramebufferStatus)(target); +} + +GLenum glGetError(void) { + return FNPTR(GetError)(); +} + +GLint glGetAttribLocation(GLuint program, const char* name) { + return FNPTR(GetAttribLocation)(program, name); +} + +GLint glGetUniformLocation(GLuint program, const char* name) { + return FNPTR(GetUniformLocation)(program, name); +} + +GLuint glCreateProgram(void) { + return FNPTR(CreateProgram)(); +} + +GLuint glCreateShader(GLenum type) { + return FNPTR(CreateShader)(type); +} + +const GLubyte* glGetString(GLenum name) { + return FNPTR(GetString)(name); +} + +void glActiveTexture(GLenum texture) { + FNPTR(ActiveTexture)(texture); +} + +void glAlphaFunc(GLenum func, GLclampf ref) { + FNPTR(AlphaFunc)(func, ref); +} + +void glAttachShader(GLuint program, GLuint shader) { + FNPTR(AttachShader)(program, shader); +} + +void glBindAttribLocation(GLuint program, GLuint index, const char* name) { + FNPTR(BindAttribLocation)(program, index, name); +} + +void glBindBuffer(GLenum target, GLuint buffer) { + FNPTR(BindBuffer)(target, buffer); +} + +void glBindFramebuffer(GLenum target, GLuint framebuffer) { + FNPTR(BindFramebuffer)(target, framebuffer); +} + +void glBindRenderbuffer(GLenum target, GLuint renderbuffer) { + FNPTR(BindRenderbuffer)(target, renderbuffer); +} + +void glBindTexture(GLenum target, GLuint texture) { + FNPTR(BindTexture)(target, texture); +} + +void glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) { + FNPTR(BlendColor)(red, green, blue, alpha); +} + +void glBlendEquation(GLenum mode) { + FNPTR(BlendEquation)(mode); +} + +void glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha) { + FNPTR(BlendEquationSeparate)(modeRGB, modeAlpha); +} + +void glBlendFunc(GLenum sfactor, GLenum dfactor) { + FNPTR(BlendFunc)(sfactor, dfactor); +} + +void glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) { + FNPTR(BlendFuncSeparate)(srcRGB, dstRGB, srcAlpha, dstAlpha); +} + +void glBufferData(GLenum target, GLsizeiptr size, const void* data, GLenum usage) { + FNPTR(BufferData)(target, size, data, usage); +} + +void glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const void* data) { + FNPTR(BufferSubData)(target, offset, size, data); +} + +void glClear(GLbitfield mask) { + FNPTR(Clear)(mask); +} + +void glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) { + FNPTR(ClearColor)(red, green, blue, alpha); +} + +void glClearColorx(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha) { + FNPTR(ClearColorx)(red, green, blue, alpha); +} + +void glClearDepthf(GLclampf depth) { + FNPTR(ClearDepthf)(depth); +} + +void glClearStencil(GLint s) { + FNPTR(ClearStencil)(s); +} + +void glClientActiveTexture(GLenum texture) { + FNPTR(ClientActiveTexture)(texture); +} + +void glColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) { + FNPTR(Color4f)(red, green, blue, alpha); +} + +void glColor4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha) { + FNPTR(Color4ub)(red, green, blue, alpha); +} + +void glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) { + FNPTR(ColorMask)(red, green, blue, alpha); +} + +void glColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid* pointer) { + FNPTR(ColorPointer)(size, type, stride, pointer); +} + +void glCompileShader(GLuint shader) { + FNPTR(CompileShader)(shader); +} + +void glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data) { + FNPTR(CompressedTexImage2D)(target, level, internalformat, width, height, border, imageSize, data); +} + +void glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data) { + FNPTR(CompressedTexSubImage2D)(target, level, xoffset, yoffset, width, height, format, imageSize, data); +} + +void glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) { + FNPTR(CopyTexImage2D)(target, level, internalformat, x, y, width, height, border); +} + +void glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) { + FNPTR(CopyTexSubImage2D)(target, level, xoffset, yoffset, x, y, width, height); +} + +void glCullFace(GLenum mode) { + FNPTR(CullFace)(mode); +} + +void glDeleteBuffers(GLsizei n, const GLuint* buffers) { + FNPTR(DeleteBuffers)(n, buffers); +} + +void glDeleteFramebuffers(GLsizei n, const GLuint* framebuffers) { + FNPTR(DeleteFramebuffers)(n, framebuffers); +} + +void glDeleteProgram(GLuint program) { + FNPTR(DeleteProgram)(program); +} + +void glDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers) { + FNPTR(DeleteRenderbuffers)(n, renderbuffers); +} + +void glDeleteShader(GLuint shader) { + FNPTR(DeleteShader)(shader); +} + +void glDeleteTextures(GLsizei n, const GLuint* textures) { + FNPTR(DeleteTextures)(n, textures); +} + +void glDepthFunc(GLenum func) { + FNPTR(DepthFunc)(func); +} + +void glDepthMask(GLboolean flag) { + FNPTR(DepthMask)(flag); +} + +void glDepthRangef(GLclampf zNear, GLclampf zFar) { + FNPTR(DepthRangef)(zNear, zFar); +} + +void glDetachShader(GLuint program, GLuint shader) { + FNPTR(DetachShader)(program, shader); +} + +void glDisable(GLenum cap) { + FNPTR(Disable)(cap); +} + +void glDisableClientState(GLenum array) { + FNPTR(DisableClientState)(array); +} + +void glDisableVertexAttribArray(GLuint index) { + FNPTR(DisableVertexAttribArray)(index); +} + +void glDrawArrays(GLenum mode, GLint first, GLsizei count) { + FNPTR(DrawArrays)(mode, first, count); +} + +void glDrawElements(GLenum mode, GLsizei count, GLenum type, const void* indices) { + FNPTR(DrawElements)(mode, count, type, indices); +} + +void glEnable(GLenum cap) { + FNPTR(Enable)(cap); +} + +void glEnableClientState(GLenum array) { + FNPTR(EnableClientState)(array); +} + +void glEnableVertexAttribArray(GLuint index) { + FNPTR(EnableVertexAttribArray)(index); +} + +void glFinish(void) { + FNPTR(Finish)(); +} + +void glFlush(void) { + FNPTR(Flush)(); +} + +void glFogf(GLenum pname, GLfloat param) { + FNPTR(Fogf)(pname, param); +} + +void glFogfv(GLenum pname, const GLfloat* params) { + FNPTR(Fogfv)(pname, params); +} + +void glFogi(GLenum pname, GLint param) { + FNPTR(Fogi)(pname, param); +} + +void glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) { + FNPTR(FramebufferRenderbuffer)(target, attachment, renderbuffertarget, renderbuffer); +} + +void glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) { + FNPTR(FramebufferTexture2D)(target, attachment, textarget, texture, level); +} + +void glFrontFace(GLenum mode) { + FNPTR(FrontFace)(mode); +} + +void glGenBuffers(GLsizei n, GLuint* buffers) { + FNPTR(GenBuffers)(n, buffers); +} + +void glGenFramebuffers(GLsizei n, GLuint* framebuffers) { + FNPTR(GenFramebuffers)(n, framebuffers); +} + +void glGenRenderbuffers(GLsizei n, GLuint* renderbuffers) { + FNPTR(GenRenderbuffers)(n, renderbuffers); +} + +void glGenTextures(GLsizei n, GLuint* textures) { + FNPTR(GenTextures)(n, textures); +} + +void glGenerateMipmap(GLenum target) { + FNPTR(GenerateMipmap)(target); +} + +void glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name) { + FNPTR(GetActiveAttrib)(program, index, bufsize, length, size, type, name); +} + +void glGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name) { + FNPTR(GetActiveUniform)(program, index, bufsize, length, size, type, name); +} + + +void glGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders) { + FNPTR(GetAttachedShaders)(program, maxcount, count, shaders); +} + + +void glGetBooleanv(GLenum pname, GLboolean* params) { + FNPTR(GetBooleanv)(pname, params); +} + + +void glGetBufferParameteriv(GLenum target, GLenum pname, GLint* params) { + FNPTR(GetBufferParameteriv)(target, pname, params); +} + + +void glGetFloatv(GLenum pname, GLfloat* params) { + FNPTR(GetFloatv)(pname, params); +} + + +void glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params) { + FNPTR(GetFramebufferAttachmentParameteriv)(target, attachment, pname, params); +} + + +void glGetIntegerv(GLenum pname, GLint* params) { + FNPTR(GetIntegerv)(pname, params); +} + + +void glGetLightfv(GLenum light, GLenum pname, GLfloat* params) { + FNPTR(GetLightfv)(light, pname, params); +} + + +void glGetMaterialfv(GLenum face, GLenum pname, GLfloat* params) { + FNPTR(GetMaterialfv)(face, pname, params); +} + + +void glGetPointerv(GLenum pname, void** params) { + FNPTR(GetPointerv)(pname, params); +} + + +void glGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog) { + FNPTR(GetProgramInfoLog)(program, bufsize, length, infolog); +} + + +void glGetProgramiv(GLuint program, GLenum pname, GLint* params) { + FNPTR(GetProgramiv)(program, pname, params); +} + + +void glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params) { + FNPTR(GetRenderbufferParameteriv)(target, pname, params); +} + + +void glGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog) { + FNPTR(GetShaderInfoLog)(shader, bufsize, length, infolog); +} + + +void glGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, char* source) { + FNPTR(GetShaderSource)(shader, bufsize, length, source); +} + + +void glGetShaderiv(GLuint shader, GLenum pname, GLint* params) { + FNPTR(GetShaderiv)(shader, pname, params); +} + + +void glGetTexEnvfv(GLenum env, GLenum pname, GLfloat* params) { + FNPTR(GetTexEnvfv)(env, pname, params); +} + + +void glGetTexEnviv(GLenum env, GLenum pname, GLint* params) { + FNPTR(GetTexEnviv)(env, pname, params); +} + + +void glGetTexParameterfv(GLenum target, GLenum pname, GLfloat* params) { + FNPTR(GetTexParameterfv)(target, pname, params); +} + + +void glGetTexParameteriv(GLenum target, GLenum pname, GLint* params) { + FNPTR(GetTexParameteriv)(target, pname, params); +} + + +void glGetUniformfv(GLuint program, GLint location, GLfloat* params) { + FNPTR(GetUniformfv)(program, location, params); +} + + +void glGetUniformiv(GLuint program, GLint location, GLint* params) { + FNPTR(GetUniformiv)(program, location, params); +} + + +void glGetVertexAttribPointerv(GLuint index, GLenum pname, void** pointer) { + FNPTR(GetVertexAttribPointerv)(index, pname, pointer); +} + + +void glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params) { + FNPTR(GetVertexAttribfv)(index, pname, params); +} + + +void glGetVertexAttribiv(GLuint index, GLenum pname, GLint* params) { + FNPTR(GetVertexAttribiv)(index, pname, params); +} + + +void glHint(GLenum target, GLenum mode) { + FNPTR(Hint)(target, mode); +} + + +void glLightModelf(GLenum pname, GLfloat param) { + FNPTR(LightModelf)(pname, param); +} + + +void glLightModelfv(GLenum pname, const GLfloat* params) { + FNPTR(LightModelfv)(pname, params); +} + + +void glLightf(GLenum light, GLenum pname, GLfloat param) { + FNPTR(Lightf)(light, pname, param); +} + + +void glLightfv(GLenum light, GLenum pname, const GLfloat* params) { + FNPTR(Lightfv)(light, pname, params); +} + + +void glLineWidth(GLfloat width) { + FNPTR(LineWidth)(width); +} + + +void glLinkProgram(GLuint program) { + FNPTR(LinkProgram)(program); +} + + +void glLoadIdentity(void) { + FNPTR(LoadIdentity)(); +} + + +void glLoadMatrixf(const GLfloat* m) { + FNPTR(LoadMatrixf)(m); +} + + +void glLogicOp(GLenum opcode) { + FNPTR(LogicOp)(opcode); +} + + +void glMaterialf(GLenum face, GLenum pname, GLfloat param) { + FNPTR(Materialf)(face, pname, param); +} + + +void glMaterialfv(GLenum face, GLenum pname, const GLfloat* params) { + FNPTR(Materialfv)(face, pname, params); +} + + +void glMatrixMode(GLenum mode) { + FNPTR(MatrixMode)(mode); +} + + +void glMultMatrixf(const GLfloat* m) { + FNPTR(MultMatrixf)(m); +} + + +void glMultiTexCoord4f(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q) { + FNPTR(MultiTexCoord4f)(target, s, t, r, q); +} + + +void glNormal3f(GLfloat nx, GLfloat ny, GLfloat nz) { + FNPTR(Normal3f)(nx, ny, nz); +} + + +void glNormalPointer(GLenum type, GLsizei stride, const GLvoid* pointer) { + FNPTR(NormalPointer)(type, stride, pointer); +} + +void glOrtho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near, GLdouble far) { + FNPTR(Ortho)(left, right, bottom, top, near, far); +} + +void glOrthof(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat near, GLfloat far) { + FNPTR(Orthof)(left, right, bottom, top, near, far); +} + +void glOrthox(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed near, GLfixed far) { + FNPTR(Orthox)(left, right, bottom, top, near, far); +} + + +void glPixelStorei(GLenum pname, GLint param) { + FNPTR(PixelStorei)(pname, param); +} + + +void glPointParameterf(GLenum pname, GLfloat param) { + FNPTR(PointParameterf)(pname, param); +} + + +void glPointParameterfv(GLenum pname, const GLfloat* params) { + FNPTR(PointParameterfv)(pname, params); +} + + +void glPointSize(GLfloat size) { + FNPTR(PointSize)(size); +} + + +void glPolygonOffset(GLfloat factor, GLfloat units) { + FNPTR(PolygonOffset)(factor, units); +} + + +void glPopMatrix(void) { + FNPTR(PopMatrix)(); +} + + +void glPushMatrix(void) { + FNPTR(PushMatrix)(); +} + + +void glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels) { + FNPTR(ReadPixels)(x, y, width, height, format, type, pixels); +} + + +void glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) { + FNPTR(RenderbufferStorage)(target, internalformat, width, height); +} + + +void glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z) { + FNPTR(Rotatef)(angle, x, y, z); +} + +void glRotatex(GLfixed angle, GLfixed x, GLfixed y, GLfixed z) { + FNPTR(Rotatex)(angle, x, y, z); +} + +void glSampleCoverage(GLclampf value, GLboolean invert) { + FNPTR(SampleCoverage)(value, invert); +} + + +void glScalef(GLfloat x, GLfloat y, GLfloat z) { + FNPTR(Scalef)(x, y, z); +} + + +void glScissor(GLint x, GLint y, GLsizei width, GLsizei height) { + FNPTR(Scissor)(x, y, width, height); +} + + +void glShadeModel(GLenum mode) { + FNPTR(ShadeModel)(mode); +} + + +void glShaderSource(GLuint shader, GLsizei count, const char** string, const GLint* length) { + FNPTR(ShaderSource)(shader, count, string, length); +} + + +void glStencilFunc(GLenum func, GLint ref, GLuint mask) { + FNPTR(StencilFunc)(func, ref, mask); +} + + +void glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask) { + FNPTR(StencilFuncSeparate)(face, func, ref, mask); +} + + +void glStencilMask(GLuint mask) { + FNPTR(StencilMask)(mask); +} + + +void glStencilMaskSeparate(GLenum face, GLuint mask) { + FNPTR(StencilMaskSeparate)(face, mask); +} + + +void glStencilOp(GLenum fail, GLenum zfail, GLenum zpass) { + FNPTR(StencilOp)(fail, zfail, zpass); +} + + +void glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass) { + FNPTR(StencilOpSeparate)(face, fail, zfail, zpass); +} + + +void glTexCoordPointer(GLint size, GLenum type, GLsizei stride, const GLvoid* pointer) { + FNPTR(TexCoordPointer)(size, type, stride, pointer); +} + + +void glTexEnvf(GLenum target, GLenum pname, GLfloat param) { + FNPTR(TexEnvf)(target, pname, param); +} + + +void glTexEnvfv(GLenum target, GLenum pname, const GLfloat* params) { + FNPTR(TexEnvfv)(target, pname, params); +} + + +void glTexEnvi(GLenum target, GLenum pname, GLint param) { + FNPTR(TexEnvi)(target, pname, param); +} + + +void glTexEnviv(GLenum target, GLenum pname, const GLint* params) { + FNPTR(TexEnviv)(target, pname, params); +} + + +void glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels) { + FNPTR(TexImage2D)(target, level, internalformat, width, height, border, format, type, pixels); +} + + +void glTexParameterf(GLenum target, GLenum pname, GLfloat param) { + FNPTR(TexParameterf)(target, pname, param); +} + + +void glTexParameterfv(GLenum target, GLenum pname, const GLfloat* params) { + FNPTR(TexParameterfv)(target, pname, params); +} + + +void glTexParameteri(GLenum target, GLenum pname, GLint param) { + FNPTR(TexParameteri)(target, pname, param); +} + + +void glTexParameteriv(GLenum target, GLenum pname, const GLint* params) { + FNPTR(TexParameteriv)(target, pname, params); +} + + +void glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels) { + FNPTR(TexSubImage2D)(target, level, xoffset, yoffset, width, height, format, type, pixels); +} + + +void glTranslatef(GLfloat x, GLfloat y, GLfloat z) { + FNPTR(Translatef)(x, y, z); +} + +void glTranslatex(GLfixed x, GLfixed y, GLfixed z) { + FNPTR(Translatex)(x, y, z); +} + +void glUniform1f(GLint location, GLfloat x) { + FNPTR(Uniform1f)(location, x); +} + + +void glUniform1fv(GLint location, GLsizei count, const GLfloat* v) { + FNPTR(Uniform1fv)(location, count, v); +} + + +void glUniform1i(GLint location, GLint x) { + FNPTR(Uniform1i)(location, x); +} + + +void glUniform1iv(GLint location, GLsizei count, const GLint* v) { + FNPTR(Uniform1iv)(location, count, v); +} + + +void glUniform2f(GLint location, GLfloat x, GLfloat y) { + FNPTR(Uniform2f)(location, x, y); +} + + +void glUniform2fv(GLint location, GLsizei count, const GLfloat* v) { + FNPTR(Uniform2fv)(location, count, v); +} + + +void glUniform2i(GLint location, GLint x, GLint y) { + FNPTR(Uniform2i)(location, x, y); +} + + +void glUniform2iv(GLint location, GLsizei count, const GLint* v) { + FNPTR(Uniform2iv)(location, count, v); +} + + +void glUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z) { + FNPTR(Uniform3f)(location, x, y, z); +} + + +void glUniform3fv(GLint location, GLsizei count, const GLfloat* v) { + FNPTR(Uniform3fv)(location, count, v); +} + + +void glUniform3i(GLint location, GLint x, GLint y, GLint z) { + FNPTR(Uniform3i)(location, x, y, z); +} + + +void glUniform3iv(GLint location, GLsizei count, const GLint* v) { + FNPTR(Uniform3iv)(location, count, v); +} + + +void glUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) { + FNPTR(Uniform4f)(location, x, y, z, w); +} + + +void glUniform4fv(GLint location, GLsizei count, const GLfloat* v) { + FNPTR(Uniform4fv)(location, count, v); +} + + +void glUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w) { + FNPTR(Uniform4i)(location, x, y, z, w); +} + + +void glUniform4iv(GLint location, GLsizei count, const GLint* v) { + FNPTR(Uniform4iv)(location, count, v); +} + + +void glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) { + FNPTR(UniformMatrix2fv)(location, count, transpose, value); +} + + +void glUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) { + FNPTR(UniformMatrix3fv)(location, count, transpose, value); +} + + +void glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) { + FNPTR(UniformMatrix4fv)(location, count, transpose, value); +} + + +void glUseProgram(GLuint program) { + FNPTR(UseProgram)(program); +} + + +void glValidateProgram(GLuint program) { + FNPTR(ValidateProgram)(program); +} + + +void glVertexAttrib1f(GLuint indx, GLfloat x) { + FNPTR(VertexAttrib1f)(indx, x); +} + + +void glVertexAttrib1fv(GLuint indx, const GLfloat* values) { + FNPTR(VertexAttrib1fv)(indx, values); +} + + +void glVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y) { + FNPTR(VertexAttrib2f)(indx, x, y); +} + + +void glVertexAttrib2fv(GLuint indx, const GLfloat* values) { + FNPTR(VertexAttrib2fv)(indx, values); +} + + +void glVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z) { + FNPTR(VertexAttrib3f)(indx, x, y, z); +} + + +void glVertexAttrib3fv(GLuint indx, const GLfloat* values) { + FNPTR(VertexAttrib3fv)(indx, values); +} + + +void glVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w) { + FNPTR(VertexAttrib4f)(indx, x, y, z, w); +} + + +void glVertexAttrib4fv(GLuint indx, const GLfloat* values) { + FNPTR(VertexAttrib4fv)(indx, values); +} + + +void glVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr) { + FNPTR(VertexAttribPointer)(indx, size, type, normalized, stride, ptr); +} + + +void glVertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid* pointer) { + FNPTR(VertexPointer)(size, type, stride, pointer); +} + + +void glViewport(GLint x, GLint y, GLsizei width, GLsizei height) { + FNPTR(Viewport)(x, y, width, height); +} diff --git a/egl_1_4/glfunclist.inl b/egl_1_4/glfunclist.inl new file mode 100755 index 0000000..2bd73e8 --- /dev/null +++ b/egl_1_4/glfunclist.inl @@ -0,0 +1,191 @@ + ACTION( IsBuffer ); + ACTION( IsEnabled ); + ACTION( IsFramebuffer ); + ACTION( IsProgram ); + ACTION( IsRenderbuffer ); + ACTION( IsShader ); + ACTION( IsTexture ); + ACTION( CheckFramebufferStatus ); + ACTION( GetError ); + ACTION( GetAttribLocation ); + ACTION( GetUniformLocation ); + ACTION( CreateProgram ); + ACTION( CreateShader ); + ACTION( GetString ); + ACTION( ActiveTexture ); + ACTION( AlphaFunc ); + ACTION( AttachShader ); + ACTION( BindAttribLocation ); + ACTION( BindBuffer ); + ACTION( BindFramebuffer ); + ACTION( BindRenderbuffer ); + ACTION( BindTexture ); + ACTION( BlendColor ); + ACTION( BlendEquation ); + ACTION( BlendEquationSeparate ); + ACTION( BlendFunc ); + ACTION( BlendFuncSeparate ); + ACTION( BufferData ); + ACTION( BufferSubData ); + ACTION( Clear ); + ACTION( ClearColor ); + ACTION( ClearColorx ); + ACTION( ClearDepthf ); + ACTION( ClearStencil ); + ACTION( ClientActiveTexture ); + ACTION( Color4f ); + ACTION( Color4ub ); + ACTION( ColorMask ); + ACTION( ColorPointer ); + ACTION( CompileShader ); + ACTION( CompressedTexImage2D ); + ACTION( CompressedTexSubImage2D ); + ACTION( CopyTexImage2D ); + ACTION( CopyTexSubImage2D ); + ACTION( CullFace ); + ACTION( DeleteBuffers ); + ACTION( DeleteFramebuffers ); + ACTION( DeleteProgram ); + ACTION( DeleteRenderbuffers ); + ACTION( DeleteShader ); + ACTION( DeleteTextures ); + ACTION( DepthFunc ); + ACTION( DepthMask ); + ACTION( DepthRangef ); + ACTION( DetachShader ); + ACTION( Disable ); + ACTION( DisableClientState ); + ACTION( DisableVertexAttribArray ); + ACTION( DrawArrays ); + ACTION( DrawElements ); + ACTION( Enable ); + ACTION( EnableClientState ); + ACTION( EnableVertexAttribArray ); + ACTION( Finish ); + ACTION( Flush ); + ACTION( Fogf ); + ACTION( Fogfv ); + ACTION( Fogi ); + ACTION( FramebufferRenderbuffer ); + ACTION( FramebufferTexture2D ); + ACTION( FrontFace ); + ACTION( GenBuffers ); + ACTION( GenFramebuffers ); + ACTION( GenRenderbuffers ); + ACTION( GenTextures ); + ACTION( GenerateMipmap ); + ACTION( GetActiveAttrib ); + ACTION( GetActiveUniform ); + ACTION( GetAttachedShaders ); + ACTION( GetBooleanv ); + ACTION( GetBufferParameteriv ); + ACTION( GetBufferSubData ); + ACTION( GetFloatv ); + ACTION( GetFramebufferAttachmentParameteriv ); + ACTION( GetIntegerv ); + ACTION( GetLightfv ); + ACTION( GetMaterialfv ); + ACTION( GetPointerv ); + ACTION( GetProgramInfoLog ); + ACTION( GetProgramiv ); + ACTION( GetRenderbufferParameteriv ); + ACTION( GetShaderInfoLog ); + ACTION( GetShaderSource ); + ACTION( GetShaderiv ); + ACTION( GetTexEnvfv ); + ACTION( GetTexEnviv ); + ACTION( GetTexLevelParameteriv ); + ACTION( GetTexParameterfv ); + ACTION( GetTexParameteriv ); + ACTION( GetUniformfv ); + ACTION( GetUniformiv ); + ACTION( GetVertexAttribPointerv ); + ACTION( GetVertexAttribfv ); + ACTION( GetVertexAttribiv ); + ACTION( Hint ); + ACTION( LightModelf ); + ACTION( LightModelfv ); + ACTION( Lightf ); + ACTION( Lightfv ); + ACTION( LineWidth ); + ACTION( LinkProgram ); + ACTION( LoadIdentity ); + ACTION( LoadMatrixf ); + ACTION( LogicOp ); + ACTION( Materialf ); + ACTION( Materialfv ); + ACTION( MatrixMode ); + ACTION( MultMatrixf ); + ACTION( MultiTexCoord4f ); + ACTION( Normal3f ); + ACTION( NormalPointer ); + ACTION( Ortho ); + ACTION( Orthof ); + ACTION( Orthox ); + ACTION( PixelStorei ); + ACTION( PointParameterf ); + ACTION( PointParameterfv ); + ACTION( PointSize ); + ACTION( PolygonOffset ); + ACTION( PopMatrix ); + ACTION( PushMatrix ); + ACTION( ReadPixels ); + ACTION( RenderbufferStorage ); + ACTION( Rotatef ); + ACTION( Rotatex ); + ACTION( SampleCoverage ); + ACTION( Scalef ); + ACTION( Scissor ); + ACTION( ShadeModel ); + ACTION( ShaderSource ); + ACTION( StencilFunc ); + ACTION( StencilFuncSeparate ); + ACTION( StencilMask ); + ACTION( StencilMaskSeparate ); + ACTION( StencilOp ); + ACTION( StencilOpSeparate ); + ACTION( TexCoordPointer ); + ACTION( TexEnvf ); + ACTION( TexEnvfv ); + ACTION( TexEnvi ); + ACTION( TexEnviv ); + ACTION( TexImage2D ); + ACTION( TexParameterf ); + ACTION( TexParameterfv ); + ACTION( TexParameteri ); + ACTION( TexParameteriv ); + ACTION( TexSubImage2D ); + ACTION( Translatef ); + ACTION( Translatex ); + ACTION( Uniform1f ); + ACTION( Uniform1fv ); + ACTION( Uniform1i ); + ACTION( Uniform1iv ); + ACTION( Uniform2f ); + ACTION( Uniform2fv ); + ACTION( Uniform2i ); + ACTION( Uniform2iv ); + ACTION( Uniform3f ); + ACTION( Uniform3fv ); + ACTION( Uniform3i ); + ACTION( Uniform3iv ); + ACTION( Uniform4f ); + ACTION( Uniform4fv ); + ACTION( Uniform4i ); + ACTION( Uniform4iv ); + ACTION( UniformMatrix2fv ); + ACTION( UniformMatrix3fv ); + ACTION( UniformMatrix4fv ); + ACTION( UseProgram ); + ACTION( ValidateProgram ); + ACTION( VertexAttrib1f ); + ACTION( VertexAttrib1fv ); + ACTION( VertexAttrib2f ); + ACTION( VertexAttrib2fv ); + ACTION( VertexAttrib3f ); + ACTION( VertexAttrib3fv ); + ACTION( VertexAttrib4f ); + ACTION( VertexAttrib4fv ); + ACTION( VertexAttribPointer ); + ACTION( VertexPointer ); + ACTION( Viewport ); diff --git a/egl_1_4/global.c b/egl_1_4/global.c new file mode 100755 index 0000000..f5192aa --- /dev/null +++ b/egl_1_4/global.c @@ -0,0 +1,467 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "implement.h" +#include <dlfcn.h> + + +struct GlobalStruct EGLINTER(global) = { + EGL_SUCCESS, + 1, + EGL_OPENGL_ES_API, + NULL, NULL, NULL, NULL, + 0, NULL, + 0, NULL, + 0, NULL, + 0, NULL, +}; + +void EGLAPIENTRY EGLINTER(NotBound)(void) { + fprintf(stderr, "EGL internal error: you are calling not-bound function\n"); +} + +void EGLAPIENTRY EGLINTER(ResetFnptrs)(struct GlobalStruct* ptr) { +#define ACTION(name) do { \ + *(void**)(&ptr->fp##name) = (void*)(&(EGLINTER(NotBound))); \ + } while (0) + ACTION( QueryVersion ); + ACTION( GetClientString ); + ACTION( QueryServerString ); + ACTION( ChooseFBConfig ); + ACTION( GetFBConfigAttrib ); + ACTION( CreatePbuffer ); + ACTION( CreatePixmap ); + ACTION( CreateWindow ); + ACTION( DestroyPbuffer ); + ACTION( DestroyPixmap ); + ACTION( DestroyWindow ); + ACTION( GetProcAddress ); + ACTION( QueryDrawable ); + ACTION( CreateNewContext ); + ACTION( DestroyContext ); + ACTION( GetCurrentContext ); + ACTION( GetCurrentDisplay ); + ACTION( GetCurrentReadDrawable ); + ACTION( GetCurrentDrawable ); + ACTION( MakeContextCurrent ); + ACTION( WaitGL ); + ACTION( WaitX ); + ACTION( SwapBuffers ); + ACTION( BindTexImageARB ); + ACTION( ReleaseTexImageARB ); + ACTION( SwapIntervalSGI ); +#undef ACTION +} + +void EGLAPIENTRY EGLINTER(BindFnptrs)(struct GlobalStruct* ptr) { + void* fnptr; + assert(ptr->dlGL != NULL); +#define ACTION(name) do { \ + fnptr = dlsym(ptr->dlGL, "glX" #name ); \ + if (fnptr != NULL) *(void**)(&ptr->fp##name) = fnptr; \ + } while (0) + ACTION( QueryVersion ); + ACTION( GetClientString ); + ACTION( QueryServerString ); + ACTION( ChooseFBConfig ); + ACTION( GetFBConfigAttrib ); + ACTION( CreatePbuffer ); + ACTION( CreatePixmap ); + ACTION( CreateWindow ); + ACTION( DestroyPbuffer ); + ACTION( DestroyPixmap ); + ACTION( DestroyWindow ); + ACTION( GetProcAddress ); + ACTION( QueryDrawable ); + ACTION( CreateNewContext ); + ACTION( DestroyContext ); + ACTION( GetCurrentContext ); + ACTION( GetCurrentDisplay ); + ACTION( GetCurrentReadDrawable ); + ACTION( GetCurrentDrawable ); + ACTION( MakeContextCurrent ); + ACTION( WaitGL ); + ACTION( WaitX ); + ACTION( SwapBuffers ); + ACTION( BindTexImageARB ); + ACTION( ReleaseTexImageARB ); + ACTION( SwapIntervalSGI ); +#undef ACTION +} + +struct DisplayExtra* EGLAPIENTRY EGLINTER(LookUpDisplay)(EGLDisplay unique) { + struct DisplayExtra* pUnit = EGLINTER(global).pDisplayExtra; + int nCount = EGLINTER(global).nDisplayExtra; + if (pUnit == NULL) return NULL; + if (unique == NULL) return NULL; + while (nCount--) { + if (pUnit->unique == unique) { + return pUnit; + } + pUnit++; + } + return NULL; +} + +struct DisplayExtra* EGLAPIENTRY EGLINTER(InsertDisplay)(EGLDisplay unique) { + struct DisplayExtra* pArea; + struct DisplayExtra* pUnit; + int nBytes = (EGLINTER(global).nDisplayExtra + 1) * sizeof(struct DisplayExtra); + if (unique == NULL) return NULL; + if ((pArea = (struct DisplayExtra*)realloc(EGLINTER(global).pDisplayExtra, nBytes)) == NULL) { + EGLINTER(SetError)(EGL_BAD_ALLOC); + return NULL; + } + pUnit = pArea + EGLINTER(global).nDisplayExtra; + memset(pUnit, 0, sizeof(struct DisplayExtra)); + pUnit->unique = unique; + EGLINTER(global).pDisplayExtra = pArea; + EGLINTER(global).nDisplayExtra++; + return pUnit; +} + +void EGLAPIENTRY EGLINTER(DeleteDisplay)(EGLDisplay unique) { + struct DisplayExtra* pUnit = EGLINTER(global).pDisplayExtra; + int nCount = EGLINTER(global).nDisplayExtra; + if (pUnit == NULL) return; + if (unique == NULL) return; + while (nCount--) { + if (pUnit->unique == unique) { + memmove(pUnit, pUnit + 1, nCount * sizeof(struct DisplayExtra)); + EGLINTER(global).nDisplayExtra--; + EGLINTER(global).pDisplayExtra + = (struct DisplayExtra*)realloc(EGLINTER(global).pDisplayExtra, + EGLINTER(global).nDisplayExtra * sizeof(struct DisplayExtra)); + return; + } + pUnit++; + } +} + +struct SurfaceExtra* EGLAPIENTRY EGLINTER(LookUpSurface)(EGLSurface unique) { + struct SurfaceExtra* pUnit = EGLINTER(global).pSurfaceExtra; + int nCount = EGLINTER(global).nSurfaceExtra; + if (pUnit == NULL) return NULL; + if (unique == NULL) return NULL; + while (nCount--) { + if (pUnit->unique == unique) { + return pUnit; + } + pUnit++; + } + return NULL; +} + +struct SurfaceExtra* EGLAPIENTRY EGLINTER(InsertSurface)(EGLSurface unique) { + struct SurfaceExtra* pArea; + struct SurfaceExtra* pUnit; + int nBytes = (EGLINTER(global).nSurfaceExtra + 1) * sizeof(struct SurfaceExtra); + if (unique == NULL) return NULL; + if ((pArea = (struct SurfaceExtra*)realloc(EGLINTER(global).pSurfaceExtra, nBytes)) == NULL) { + EGLINTER(SetError)(EGL_BAD_ALLOC); + return NULL; + } + pUnit = pArea + EGLINTER(global).nSurfaceExtra; + memset(pUnit, 0, sizeof(struct SurfaceExtra)); + pUnit->unique = unique; + EGLINTER(global).pSurfaceExtra = pArea; + EGLINTER(global).nSurfaceExtra++; + return pUnit; +} + +void EGLAPIENTRY EGLINTER(DeleteSurface)(EGLSurface unique) { + struct SurfaceExtra* pUnit = EGLINTER(global).pSurfaceExtra; + int nCount = EGLINTER(global).nSurfaceExtra; + if (pUnit == NULL) return; + if (unique == NULL) return; + while (nCount--) { + if (pUnit->unique == unique) { + memmove(pUnit, pUnit + 1, nCount * sizeof(struct SurfaceExtra)); + EGLINTER(global).nSurfaceExtra--; + EGLINTER(global).pSurfaceExtra + = (struct SurfaceExtra*)realloc(EGLINTER(global).pSurfaceExtra, + EGLINTER(global).nSurfaceExtra * sizeof(struct SurfaceExtra)); + return; + } + pUnit++; + } +} + +struct ContextExtra* EGLAPIENTRY EGLINTER(LookUpContext)(EGLContext unique) { + struct ContextExtra* pUnit = EGLINTER(global).pContextExtra; + int nCount = EGLINTER(global).nContextExtra; + if (pUnit == NULL) return NULL; + if (unique == NULL) return NULL; + while (nCount--) { + if (pUnit->unique == unique) { + return pUnit; + } + pUnit++; + } + return NULL; +} + +struct ContextExtra* EGLAPIENTRY EGLINTER(InsertContext)(EGLContext unique) { + struct ContextExtra* pArea; + struct ContextExtra* pUnit; + int nBytes = (EGLINTER(global).nContextExtra + 1) * sizeof(struct ContextExtra); + if (unique == NULL) return NULL; + if ((pArea = (struct ContextExtra*)realloc(EGLINTER(global).pContextExtra, nBytes)) == NULL) { + EGLINTER(SetError)(EGL_BAD_ALLOC); + return NULL; + } + pUnit = pArea + EGLINTER(global).nContextExtra; + memset(pUnit, 0, sizeof(struct ContextExtra)); + pUnit->unique = unique; + EGLINTER(global).pContextExtra = pArea; + EGLINTER(global).nContextExtra++; + return pUnit; +} + +void EGLAPIENTRY EGLINTER(DeleteContext)(EGLContext unique) { + struct ContextExtra* pUnit = EGLINTER(global).pContextExtra; + int nCount = EGLINTER(global).nContextExtra; + if (pUnit == NULL) return; + if (unique == NULL) return; + while (nCount--) { + if (pUnit->unique == unique) { + memmove(pUnit, pUnit + 1, nCount * sizeof(struct ContextExtra)); + EGLINTER(global).nContextExtra--; + EGLINTER(global).pContextExtra + = (struct ContextExtra*)realloc(EGLINTER(global).pContextExtra, + EGLINTER(global).nContextExtra * sizeof(struct ContextExtra)); + return; + } + pUnit++; + } +} + +EGLBoolean EGLAPIENTRY EGLINTER(FreeContext)(struct ContextExtra *pContext) { +void (*fpVGReleaseContext)(void*) = NULL;//jcpark +#if defined(PROVIDING_RUNTIME_BINDING) + void (*fpReleaseContext)(void*) = NULL; +#endif + + switch (pContext->apiKind) { + default: + case EGL_OPENGL_API: + assert(pContext->apiContext == NULL); + break; +#if defined(PROVIDING_RUNTIME_BINDING) + case EGL_OPENGL_ES_API: + if (pContext->apiVersion == 2) { + if (EGLINTER(global).dlES2 == NULL) { + if ((EGLINTER(global).dlES2 = dlopen(GL_ES2_SO_FILENAME, RTLD_NOW | RTLD_GLOBAL)) + == NULL) { + EGLINTER(SetError)(EGL_BAD_ACCESS); + return EGL_FALSE; + } + } + fpReleaseContext = dlsym(EGLINTER(global).dlES2, EGLCROSS_PREFIX "ReleaseContext"); + if (fpReleaseContext != NULL) { + (*fpReleaseContext)(pContext->apiContext); + pContext->apiContext = NULL; + } + } else { + if (EGLINTER(global).dlES1 == NULL) { + if ((EGLINTER(global).dlES1 = dlopen(GL_ES1_SO_FILENAME, RTLD_NOW | RTLD_GLOBAL)) + == NULL) { + EGLINTER(SetError)(EGL_BAD_ACCESS); + return EGL_FALSE; + } + } + fpReleaseContext = dlsym(EGLINTER(global).dlES1, EGLCROSS_PREFIX "ReleaseContext"); + if (fpReleaseContext != NULL) { + (*fpReleaseContext)(pContext->apiContext); + pContext->apiContext = NULL; + } + } + break; +#else + case EGL_OPENGL_ES_API: + if (pContext->apiContext != NULL) { + EGLCROSS(ReleaseContext)(pContext->apiContext); + } + break; +#endif + case EGL_OPENVG_API: + /* TODO: OpenVG may need some action here */ + + if (EGLINTER(global).dlVG == NULL) { printf("==jcpark vg4egl_DestroyContext 2\n"); + if ((EGLINTER(global).dlVG = dlopen(VG_SO_FILENAME, RTLD_NOW | RTLD_GLOBAL)) + == NULL) { printf("==jcpark vg4egl_DestroyContext 3\n"); + EGLINTER(SetError)(EGL_BAD_ACCESS); + return EGL_FALSE; + } + } + fpVGReleaseContext = dlsym(EGLINTER(global).dlVG, "vg4egl_DestroyContext"); + if (fpVGReleaseContext != NULL) { + (*fpVGReleaseContext)(pContext->apiContext); + pContext->apiContext = NULL; + printf("==jcpark== vg4egl_DestroyContext working\n"); + } + + break; + } + + struct DisplayExtra* pDisplay = EGLINTER(LookUpDisplay)(pContext->display); + if (pDisplay == NULL) + return EGL_FALSE; + FNPTR(DestroyContext)(pDisplay->native, pContext->native); + + EGLINTER(DeleteContext)(pContext->unique); + + return EGL_TRUE; +} + +struct ImageExtra* EGLAPIENTRY EGLINTER(LookUpEGLImage)(EGLImageKHR unique) { + struct ImageExtra* pUnit = EGLINTER(global).pImageExtra; + int nCount = EGLINTER(global).nImageExtra; + if (pUnit == NULL) return NULL; + if (unique == NULL) return NULL; + while (nCount--) { + if (pUnit->unique == unique) { + return pUnit; + } + pUnit++; + } + return NULL; +} +struct ImageExtra* EGLAPIENTRY EGLINTER(InsertEGLImage)(EGLImageKHR unique) { + struct ImageExtra* pArea; + struct ImageExtra* pUnit; + int nBytes = (EGLINTER(global).nImageExtra + 1) * sizeof(struct ImageExtra); + if (unique == NULL) return NULL; + if ((pArea = (struct ImageExtra*)realloc(EGLINTER(global).pImageExtra, nBytes)) == NULL) { + EGLINTER(SetError)(EGL_BAD_ALLOC); + return NULL; + } + pUnit = pArea + EGLINTER(global).nImageExtra; + memset(pUnit, 0, sizeof(struct ImageExtra)); + pUnit->unique = unique; + EGLINTER(global).pImageExtra = pArea; + EGLINTER(global).nImageExtra++; + return pUnit; +} +void EGLAPIENTRY EGLINTER(DeleteEGLImage)(EGLImageKHR unique) { + struct ImageExtra* pUnit = EGLINTER(global).pImageExtra; + int nCount = EGLINTER(global).nImageExtra; + if (pUnit == NULL) return; + if (unique == NULL) return; + while (nCount--) { + if (pUnit->unique == unique) { + memmove(pUnit, pUnit + 1, nCount * sizeof(struct ImageExtra)); + EGLINTER(global).nImageExtra--; + EGLINTER(global).pImageExtra + = (struct ImageExtra*)realloc(EGLINTER(global).pImageExtra, + EGLINTER(global).nImageExtra * sizeof(struct ImageExtra)); + return; + } + pUnit++; + } +} +int EGLAPIENTRY EGLCROSS(GetEGLImagePixmapInfo)(EGLImageKHR img, + EGLNativeDisplayType *dpy, + Pixmap *pixmap, + int *width, int *height, int *depth) { + struct ImageExtra *pArea = EGLINTER(LookUpEGLImage)(img); + if (pArea == NULL) { + return -1; + } + *width = pArea->width; + *height = pArea->height; + *depth = pArea->depth; + *dpy = pArea->dpy; + *pixmap = pArea->pixmap; + return 0; +} + +#if defined(PROVIDING_RUNTIME_BINDING) + +void EGLAPIENTRY EGLINTER(ResetGLFnptrs)(struct GlobalStruct* ptr) { +#define ACTION(name) do { \ + *(void**)(&ptr->fp##name) = (void*)(&(EGLINTER(NotBound))); \ + } while (0) +#include "glfunclist.inl" +#undef ACTION +} + +void EGLAPIENTRY EGLINTER(BindGLFnptrs)(struct GlobalStruct* ptr) { + if (EGLINTER(global).dlGL == NULL) { + if ((EGLINTER(global).dlGL = dlopen(GL_SO_FILENAME, RTLD_NOW | RTLD_GLOBAL)) == NULL) { + EGLINTER(SetError)(EGL_BAD_ACCESS); + return; + } + } + void* dl = EGLINTER(global).dlGL; +#define ACTION(name) do { \ + *(void**)(&ptr->fp##name) = dlsym(dl, "gl" #name); \ + if (ptr->fp##name == NULL) *(void**)(&ptr->fp##name) = (void*)(&(EGLINTER(NotBound))); \ + } while (0) +#include "glfunclist.inl" +#undef ACTION +} + +void EGLAPIENTRY EGLINTER(BindES1Fnptrs)(struct GlobalStruct* ptr) { + if (EGLINTER(global).dlES1 == NULL) { + if ((EGLINTER(global).dlES1 = dlopen(GL_ES1_SO_FILENAME, RTLD_NOW | RTLD_GLOBAL)) == NULL) { + EGLINTER(SetError)(EGL_BAD_ACCESS); + return; + } + } + void* dl = EGLINTER(global).dlES1; +#define ACTION(name) do { \ + *(void**)(&ptr->fp##name) = dlsym(dl, "gl" #name); \ + if (ptr->fp##name == NULL) *(void**)(&ptr->fp##name) = (void*)(&(EGLINTER(NotBound))); \ + } while (0) +#include "glfunclist.inl" +#undef ACTION +} + +void EGLAPIENTRY EGLINTER(BindES2Fnptrs)(struct GlobalStruct* ptr) { + if (EGLINTER(global).dlES2 == NULL) { + if ((EGLINTER(global).dlES2 = dlopen(GL_ES2_SO_FILENAME, RTLD_NOW | RTLD_GLOBAL)) == NULL) { + EGLINTER(SetError)(EGL_BAD_ACCESS); + return; + } + } + void* dl = EGLINTER(global).dlES2; +#define ACTION(name) do { \ + *(void**)(&ptr->fp##name) = dlsym(dl, "gl" #name); \ + if (ptr->fp##name == NULL) *(void**)(&ptr->fp##name) = (void*)(&(EGLINTER(NotBound))); \ + } while (0) +#include "glfunclist.inl" +#undef ACTION +} + +#include "binding.inl" + +#endif diff --git a/egl_1_4/implement.h b/egl_1_4/implement.h new file mode 100755 index 0000000..33b9184 --- /dev/null +++ b/egl_1_4/implement.h @@ -0,0 +1,512 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#ifndef _EGL_IMPLEMENT_H_ +#define _EGL_IMPLEMENT_H_ + +#include <EGL/egl.h> +#include <EGL/eglext.h> +#include <GL/glx.h> +#include <GL/glxext.h> +#include <assert.h> +#include <stdio.h> +#include <string.h> +#include <malloc.h> + + +#define HAZEL_EGL_VENDOR "Hazel" +#define HAZEL_EGL_MAJOR 1 +#define HAZEL_EGL_MINOR 4 + +#ifdef __cplusplus +extern "C" { +#endif + + +typedef int GLfixed; +typedef int GLclampx; + +#define EGLPREFIX "egl" +#define EGLEXTER(name) egl##name +#define EGLINTER(name) _hazel_egl_##name + + +struct ConfigExtra { + EGLint unique; + GLXFBConfig native; + EGLint bufferSize; + EGLint redSize; + EGLint greenSize; + EGLint blueSize; + EGLint luminanceSize; + EGLint alphaSize; + EGLint alphaMaskSize; + EGLBoolean bindToTexRGB; + EGLBoolean bindToTexRGBA; + EGLenum colorBufferType; + EGLenum configCaveat; + EGLenum conformant; + EGLint depthSize; + EGLint level; + EGLint maxPbufferWidth; + EGLint maxPbufferHeight; + EGLint maxPbufferPixels; + EGLint maxSwapInterval; + EGLint minSwapInterval; + EGLBoolean nativeRenderable; + XID nativeVisualID; + EGLenum nativeVisualType; + EGLenum renderableType; + EGLint sampleBuffers; + EGLint samples; + EGLint stencilSize; + EGLenum surfaceType; + EGLenum transparentType; + EGLint transparentRedValue; + EGLint transparentGreenValue; + EGLint transparentBlueValue; +}; + +struct DisplayExtra { + EGLDisplay unique; + EGLNativeDisplayType native; + EGLBoolean bInitialized; + EGLBoolean bInvokedWithDefault; + GLXFBConfig* pConfigBuffer; + EGLint nConfigExtra; + struct ConfigExtra* pConfigExtra; + EGLConfig* pConfigAnswer; +}; + +struct SurfaceExtra { + EGLSurface unique; + GLXDrawable native; + Drawable lowWinPix; + EGLDisplay display; + EGLConfig config; + EGLenum type; + + + EGLenum textureFormat; + EGLenum textureTarget; + EGLBoolean mipmapTexture; + EGLint mipmapLevel; + EGLenum renderBuffer; + EGLenum vgColorSpace; + EGLenum vgAlphaFormat; + + EGLenum swapBehavior; + EGLenum multisampleResolve; +}; + +struct ContextExtra { + EGLContext unique; + GLXContext native; + EGLDisplay display; + EGLConfig config; + EGLenum renderBuffer; + EGLenum apiKind; + EGLint apiVersion; + void* apiContext; + EGLBoolean deleted; +}; + +struct ImageExtra { + EGLImageKHR unique; + int width; + int height; + int depth; + EGLNativeDisplayType dpy; + Pixmap pixmap; +}; +//#define EGL_SO_FILENAME "libEGL.so" +//#define GL_ES2_SO_FILENAME "libGLESv2.so" +//#define GL_ES1_SO_FILENAME "libGLESv1_CM.so" +//#define GL_SO_FILENAME "libGL.so" +#define VG_SO_FILENAME "libOpenVG.so" //jcpark +#define EGL_SO_FILENAME "/usr/lib/host-gl/libEGL.so.1.0" +#define GL_ES2_SO_FILENAME "/usr/lib/host-gl/libGLESv2.so.1.0" +#define GL_ES1_SO_FILENAME "/usr/lib/host-gl/libGLESv1_CM.so.1.0" +#define GL_SO_FILENAME "/usr/lib/host-gl/libGL.so.1.2" + +struct GlobalStruct { + EGLint iLastError; + EGLint iConfigID; + EGLenum currentAPI; + void* dlEGL; + void* dlGL; + void* dlES1; + void* dlES2; + void* dlVG;//jcpark + EGLint nDisplayExtra; + struct DisplayExtra* pDisplayExtra; + EGLint nSurfaceExtra; + struct SurfaceExtra* pSurfaceExtra; + EGLint nContextExtra; + struct ContextExtra* pContextExtra; + EGLint nImageExtra; + struct ImageExtra* pImageExtra; + Bool (*fpQueryVersion)(Display*, int*, int*); + const char* (*fpGetClientString)(Display*, int); + const char* (*fpQueryServerString)(Display*, int, int); + GLXFBConfig* (*fpChooseFBConfig)(Display*, int, const int*, int*); + int (*fpGetFBConfigAttrib)(Display*, GLXFBConfig, int, int*); + GLXPbuffer (*fpCreatePbuffer)(Display*, GLXFBConfig, const int*); + GLXPixmap (*fpCreatePixmap)(Display*, GLXFBConfig, Pixmap, const int*); + GLXWindow (*fpCreateWindow)(Display*, GLXFBConfig, Window, const int*); + void (*fpDestroyPbuffer)(Display*, GLXPbuffer); + void (*fpDestroyPixmap)(Display*, GLXPixmap); + void (*fpDestroyWindow)(Display*, GLXWindow); + __GLXextFuncPtr (*fpGetProcAddress)(const GLubyte*); + void (*fpQueryDrawable)(Display*, GLXDrawable, int, unsigned int*); + GLXContext (*fpCreateNewContext)(Display*, GLXFBConfig, int, GLXContext, Bool); + void (*fpDestroyContext)(Display*, GLXContext); + GLXContext (*fpGetCurrentContext)(void); + Display* (*fpGetCurrentDisplay)(void); + GLXDrawable (*fpGetCurrentReadDrawable)(void); + GLXDrawable (*fpGetCurrentDrawable)(void); + Bool (*fpMakeContextCurrent)(Display*, GLXDrawable, GLXDrawable, GLXContext); + void (*fpWaitGL)(void); + void (*fpWaitX)(void); + void (*fpSwapBuffers)(Display*, GLXDrawable); + void (*fpBindTexImageARB)(Display*, GLXDrawable, int ); + void (*fpReleaseTexImageARB)(Display*, GLXDrawable, int); + int (*fpSwapIntervalSGI)(int); +#if defined(PROVIDING_RUNTIME_BINDING) + GLboolean (*fpIsBuffer)(GLuint); + GLboolean (*fpIsEnabled)(GLenum); + GLboolean (*fpIsFramebuffer)(GLuint); + GLboolean (*fpIsProgram)(GLuint); + GLboolean (*fpIsRenderbuffer)(GLuint); + GLboolean (*fpIsShader)(GLuint); + GLboolean (*fpIsTexture)(GLuint); + GLenum (*fpCheckFramebufferStatus)(GLenum); + GLenum (*fpGetError)(void); + GLint (*fpGetAttribLocation)(GLuint, const GLchar*); + GLint (*fpGetUniformLocation)(GLuint, const GLchar*); + GLuint (*fpCreateProgram)(void); + GLuint (*fpCreateShader)(GLenum); + const GLubyte* (*fpGetString)(GLenum); + void (*fpActiveTexture)(GLenum); + void (*fpAlphaFunc)(GLenum, GLclampf); + void (*fpAttachShader)(GLuint, GLuint); + void (*fpBindAttribLocation)(GLuint, GLuint, const GLchar*); + void (*fpBindBuffer)(GLenum, GLuint); + void (*fpBindFramebuffer)(GLenum, GLuint); + void (*fpBindRenderbuffer)(GLenum, GLuint); + void (*fpBindTexture)(GLenum, GLuint); + void (*fpBlendColor)(GLclampf, GLclampf, GLclampf, GLclampf); + void (*fpBlendEquation)(GLenum); + void (*fpBlendEquationSeparate)(GLenum, GLenum); + void (*fpBlendFunc)(GLenum, GLenum); + void (*fpBlendFuncSeparate)(GLenum, GLenum, GLenum, GLenum); + void (*fpBufferData)(GLenum, GLsizeiptr, const GLvoid*, GLenum); + void (*fpBufferSubData)(GLenum, GLintptr, GLsizeiptr, const GLvoid*); + void (*fpClear)(GLbitfield); + void (*fpClearColor)(GLclampf, GLclampf, GLclampf, GLclampf); + void (*fpClearColorx)(GLclampx, GLclampx, GLclampx, GLclampx); + void (*fpClearDepthf)(GLclampd); + void (*fpClearStencil)(GLint); + void (*fpClientActiveTexture)(GLenum); + void (*fpClipPlane)(GLenum, const GLdouble*); + void (*fpColor4f)(GLfloat, GLfloat, GLfloat, GLfloat); + void (*fpColor4ub)(GLubyte, GLubyte, GLubyte, GLubyte); + void (*fpColorMask)(GLboolean, GLboolean, GLboolean, GLboolean); + void (*fpColorPointer)(GLint, GLenum, GLsizei, const GLvoid*); + void (*fpCompileShader)(GLuint); + void (*fpCompressedTexImage2D)(GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid*); + void (*fpCompressedTexSubImage2D)(GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid*); + void (*fpCopyTexImage2D)(GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint); + void (*fpCopyTexSubImage2D)(GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); + void (*fpCullFace)(GLenum); + void (*fpDeleteBuffers)(GLsizei, const GLuint*); + void (*fpDeleteFramebuffers)(GLsizei, const GLuint*); + void (*fpDeleteProgram)(GLuint); + void (*fpDeleteRenderbuffers)(GLsizei, const GLuint*); + void (*fpDeleteShader)(GLuint); + void (*fpDeleteTextures)(GLsizei, const GLuint*); + void (*fpDepthFunc)(GLenum); + void (*fpDepthMask)(GLboolean); + void (*fpDepthRangef)(GLclampf, GLclampf); + void (*fpDetachShader)(GLuint, GLuint); + void (*fpDisable)(GLenum); + void (*fpDisableClientState)(GLenum); + void (*fpDisableVertexAttribArray)(GLuint); + void (*fpDrawArrays)(GLenum, GLint, GLsizei); + void (*fpDrawElements)(GLenum, GLsizei, GLenum, const void*); + void (*fpEnable)(GLenum); + void (*fpEnableClientState)(GLenum); + void (*fpEnableVertexAttribArray)(GLuint); + void (*fpFinish)(void); + void (*fpFlush)(void); + void (*fpFogf)(GLenum, GLfloat); + void (*fpFogfv)(GLenum, const GLfloat*); + void (*fpFogi)(GLenum, GLint); + void (*fpFramebufferRenderbuffer)(GLenum, GLenum, GLenum, GLuint); + void (*fpFramebufferTexture2D)(GLenum, GLenum, GLenum, GLuint, GLint); + void (*fpFrontFace)(GLenum); + void (*fpGenBuffers)(GLsizei, GLuint*); + void (*fpGenFramebuffers)(GLsizei, GLuint*); + void (*fpGenRenderbuffers)(GLsizei, GLuint*); + void (*fpGenTextures)(GLsizei, GLuint*); + void (*fpGenerateMipmap)(GLenum); + void (*fpGetActiveAttrib)(GLuint, GLuint, GLsizei, GLsizei*, GLint*, GLenum*, GLchar*); + void (*fpGetActiveUniform)(GLuint, GLuint, GLsizei, GLsizei*, GLint*, GLenum*, GLchar*); + void (*fpGetAttachedShaders)(GLuint, GLsizei, GLsizei*, GLuint*); + void (*fpGetBooleanv)(GLenum, GLboolean*); + void (*fpGetBufferParameteriv)(GLenum, GLenum, GLint*); + void (*fpGetBufferSubData)(GLenum, GLintptr, GLsizeiptr, const GLvoid* data); + void (*fpGetClipPlane)(GLenum, GLdouble*); + void (*fpGetFloatv)(GLenum, GLfloat*); + void (*fpGetFramebufferAttachmentParameteriv)(GLenum, GLenum, GLenum, GLint*); + void (*fpGetIntegerv)(GLenum, GLint*); + void (*fpGetLightfv)(GLenum, GLenum, GLfloat*); + void (*fpGetMaterialfv)(GLenum, GLenum, GLfloat*); + void (*fpGetPointerv)(GLenum, GLvoid**); + void (*fpGetProgramInfoLog)(GLuint, GLsizei, GLsizei*, GLchar*); + void (*fpGetProgramiv)(GLuint, GLenum, GLint*); + void (*fpGetRenderbufferParameteriv)(GLenum, GLenum, GLint*); + void (*fpGetShaderInfoLog)(GLuint, GLsizei, GLsizei*, GLchar*); + void (*fpGetShaderSource)(GLuint, GLsizei, GLsizei*, GLchar*); + void (*fpGetShaderiv)(GLuint, GLenum, GLint*); + void (*fpGetTexEnvfv)(GLenum, GLenum, GLfloat*); + void (*fpGetTexEnviv)(GLenum, GLenum, GLint*); + void (*fpGetTexLevelParameteriv)(GLenum, GLint, GLenum, GLint*); + void (*fpGetTexParameterfv)(GLenum, GLenum, GLfloat*); + void (*fpGetTexParameteriv)(GLenum, GLenum, GLint*); + void (*fpGetUniformfv)(GLuint, GLint, GLfloat*); + void (*fpGetUniformiv)(GLuint, GLint, GLint*); + void (*fpGetVertexAttribPointerv)(GLuint, GLenum, void**); + void (*fpGetVertexAttribfv)(GLuint, GLenum, GLfloat*); + void (*fpGetVertexAttribiv)(GLuint, GLenum, GLint*); + void (*fpHint)(GLenum, GLenum); + void (*fpLightModelf)(GLenum, GLfloat); + void (*fpLightModelfv)(GLenum, const GLfloat*); + void (*fpLightf)(GLenum, GLenum, GLfloat); + void (*fpLightfv)(GLenum, GLenum, const GLfloat*); + void (*fpLineWidth)(GLfloat); + void (*fpLinkProgram)(GLuint); + void (*fpLoadIdentity)(void); + void (*fpLoadMatrixf)(const GLfloat*); + void (*fpLogicOp)(GLenum); + void (*fpMaterialf)(GLenum, GLenum, GLfloat); + void (*fpMaterialfv)(GLenum, GLenum, const GLfloat*); + void (*fpMatrixMode)(GLenum); + void (*fpMultMatrixf)(const GLfloat*); + void (*fpMultiTexCoord4f)(GLenum, GLfloat, GLfloat, GLfloat, GLfloat); + void (*fpNormal3f)(GLfloat, GLfloat, GLfloat); + void (*fpNormalPointer)(GLenum, GLsizei, const GLvoid*); + void (*fpOrtho)(GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble); + void (*fpOrthof)(GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); + void (*fpOrthox)(GLfixed, GLfixed, GLfixed, GLfixed, GLfixed, GLfixed); + void (*fpPixelStorei)(GLenum, GLint); + void (*fpPointParameterf)(GLenum, GLfloat); + void (*fpPointParameterfv)(GLenum, const GLfloat*); + void (*fpPointSize)(GLfloat); + void (*fpPolygonOffset)(GLfloat, GLfloat); + void (*fpPopMatrix)(void); + void (*fpPushMatrix)(void); + void (*fpReadPixels)(GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLvoid*); + void (*fpRenderbufferStorage)(GLenum, GLenum, GLsizei, GLsizei); + void (*fpRotatef)(GLfloat, GLfloat, GLfloat, GLfloat); + void (*fpRotatex)(GLfixed, GLfixed, GLfixed, GLfixed); + void (*fpSampleCoverage)(GLclampf, GLboolean); + void (*fpScalef)(GLfloat, GLfloat, GLfloat); + void (*fpScissor)(GLint, GLint, GLsizei, GLsizei); + void (*fpShadeModel)(GLenum); + void (*fpShaderSource)(GLuint, GLsizei, const GLchar**, const GLint*); + void (*fpStencilFunc)(GLenum, GLint, GLuint); + void (*fpStencilFuncSeparate)(GLenum, GLenum, GLint, GLuint); + void (*fpStencilMask)(GLuint); + void (*fpStencilMaskSeparate)(GLenum, GLuint); + void (*fpStencilOp)(GLenum, GLenum, GLenum); + void (*fpStencilOpSeparate)(GLenum, GLenum, GLenum, GLenum); + void (*fpTexCoordPointer)(GLint, GLenum, GLsizei, const GLvoid*); + void (*fpTexEnvf)(GLenum, GLenum, GLfloat); + void (*fpTexEnvfv)(GLenum, GLenum, const GLfloat*); + void (*fpTexEnvi)(GLenum, GLenum, GLint); + void (*fpTexEnviv)(GLenum, GLenum, const GLint*); + void (*fpTexImage2D)(GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid*); + void (*fpTexParameterf)(GLenum, GLenum, GLfloat); + void (*fpTexParameterfv)(GLenum, GLenum, const GLfloat*); + void (*fpTexParameteri)(GLenum, GLenum, GLint); + void (*fpTexParameteriv)(GLenum, GLenum, const GLint*); + void (*fpTexSubImage2D)(GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid*); + void (*fpTranslatef)(GLfloat, GLfloat, GLfloat); + void (*fpTranslatex)(GLfixed, GLfixed, GLfixed); + void (*fpUniform1f)(GLint, GLfloat); + void (*fpUniform1fv)(GLint, GLsizei, const GLfloat*); + void (*fpUniform1i)(GLint, GLint); + void (*fpUniform1iv)(GLint, GLsizei, const GLint*); + void (*fpUniform2f)(GLint, GLfloat, GLfloat); + void (*fpUniform2fv)(GLint, GLsizei, const GLfloat*); + void (*fpUniform2i)(GLint, GLint, GLint); + void (*fpUniform2iv)(GLint, GLsizei, const GLint*); + void (*fpUniform3f)(GLint, GLfloat, GLfloat, GLfloat); + void (*fpUniform3fv)(GLint, GLsizei, const GLfloat*); + void (*fpUniform3i)(GLint, GLint, GLint, GLint); + void (*fpUniform3iv)(GLint, GLsizei, const GLint*); + void (*fpUniform4f)(GLint, GLfloat, GLfloat, GLfloat, GLfloat); + void (*fpUniform4fv)(GLint, GLsizei, const GLfloat*); + void (*fpUniform4i)(GLint, GLint, GLint, GLint, GLint); + void (*fpUniform4iv)(GLint, GLsizei, const GLint*); + void (*fpUniformMatrix2fv)(GLint, GLsizei, GLboolean, const GLfloat*); + void (*fpUniformMatrix3fv)(GLint, GLsizei, GLboolean, const GLfloat*); + void (*fpUniformMatrix4fv)(GLint, GLsizei, GLboolean, const GLfloat*); + void (*fpUseProgram)(GLuint); + void (*fpValidateProgram)(GLuint); + void (*fpVertexAttrib1f)(GLuint, GLfloat); + void (*fpVertexAttrib1fv)(GLuint, const GLfloat*); + void (*fpVertexAttrib2f)(GLuint, GLfloat, GLfloat); + void (*fpVertexAttrib2fv)(GLuint, const GLfloat*); + void (*fpVertexAttrib3f)(GLuint, GLfloat, GLfloat, GLfloat); + void (*fpVertexAttrib3fv)(GLuint, const GLfloat*); + void (*fpVertexAttrib4f)(GLuint, GLfloat, GLfloat, GLfloat, GLfloat); + void (*fpVertexAttrib4fv)(GLuint, const GLfloat*); + void (*fpVertexAttribPointer)(GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid*); + void (*fpVertexPointer)(GLint, GLenum, GLsizei, const GLvoid*); + void (*fpViewport)(GLint, GLint, GLsizei, GLsizei); +#endif +}; + +extern struct GlobalStruct EGLINTER(global); + +#define FNPTR(name) (EGLINTER(global).fp##name) + +extern struct SurfaceExtra surfaceExtraDefault; + +EGLAPI void EGLAPIENTRY EGLINTER(NotBound)(void); + +EGLAPI void EGLAPIENTRY EGLINTER(SetError)(EGLint iError); + + +EGLAPI void EGLAPIENTRY EGLINTER(ResetFnptrs)(struct GlobalStruct* ptr); +EGLAPI void EGLAPIENTRY EGLINTER(BindFnptrs)(struct GlobalStruct* ptr); + +EGLAPI int EGLAPIENTRY EGLINTER(PrepareConfig)(struct DisplayExtra* pDisplay); +EGLAPI struct ConfigExtra* EGLINTER(LookUpConfig)(struct DisplayExtra* pDisplay, EGLConfig config); + +EGLAPI struct DisplayExtra* EGLAPIENTRY EGLINTER(LookUpDisplay)(EGLDisplay unique); +EGLAPI struct DisplayExtra* EGLAPIENTRY EGLINTER(InsertDisplay)(EGLDisplay unique); +EGLAPI void EGLAPIENTRY EGLINTER(DeleteDisplay)(EGLDisplay unique); + +EGLAPI struct SurfaceExtra* EGLAPIENTRY EGLINTER(LookUpSurface)(EGLSurface unique); +EGLAPI struct SurfaceExtra* EGLAPIENTRY EGLINTER(InsertSurface)(EGLSurface unique); +EGLAPI void EGLAPIENTRY EGLINTER(DeleteSurface)(EGLSurface unique); +EGLAPI EGLBoolean EGLAPIENTRY EGLINTER(FreeContext)(struct ContextExtra *pContext); + +EGLAPI struct ContextExtra* EGLAPIENTRY EGLINTER(LookUpContext)(EGLContext unique); +EGLAPI struct ContextExtra* EGLAPIENTRY EGLINTER(InsertContext)(EGLContext unique); +EGLAPI void EGLAPIENTRY EGLINTER(DeleteContext)(EGLContext unique); + +EGLAPI struct ImageExtra* EGLAPIENTRY EGLINTER(LookUpEGLImage)(EGLImageKHR unique); +EGLAPI struct ImageExtra* EGLAPIENTRY EGLINTER(InsertEGLImage)(EGLImageKHR unique); +EGLAPI void EGLAPIENTRY EGLINTER(DeleteEGLImage)(EGLImageKHR unique); + +#define EGLCROSS(name) __hazel_cross__##name +#define EGLCROSS_PREFIX "__hazel_cross__" + +EGLAPI void* EGLAPIENTRY EGLCROSS(CreateContext)(void); +EGLAPI void EGLAPIENTRY EGLCROSS(MakeCurrent)(void*); +EGLAPI void EGLAPIENTRY EGLCROSS(ReleaseContext)(void*); +EGLAPI int EGLAPIENTRY EGLCROSS(GetEGLImagePixmapInfo)(EGLImageKHR img, + EGLNativeDisplayType *dpy, + Pixmap *pixmap, + int *width, int *height, int *depth); + +#if defined(PROVIDING_RUNTIME_BINDING) + +EGLAPI void EGLAPIENTRY EGLINTER(ResetGLFnptrs)(struct GlobalStruct* ptr); +EGLAPI void EGLAPIENTRY EGLINTER(BindGLFnptrs)(struct GlobalStruct* ptr); +EGLAPI void EGLAPIENTRY EGLINTER(BindES1Fnptrs)(struct GlobalStruct* ptr); +EGLAPI void EGLAPIENTRY EGLINTER(BindES2Fnptrs)(struct GlobalStruct* ptr); + +#endif + + +// VG variables //jcpark +typedef enum { + /* RGB{A,X} channel ordering */ + VG_sRGBX_8888 = 0, + VG_sRGBA_8888 = 1, + VG_sRGBA_8888_PRE = 2, + VG_sRGB_565 = 3, + VG_sRGBA_5551 = 4, + VG_sRGBA_4444 = 5, + VG_sL_8 = 6, + VG_lRGBX_8888 = 7, + VG_lRGBA_8888 = 8, + VG_lRGBA_8888_PRE = 9, + VG_lL_8 = 10, + VG_A_8 = 11, + VG_BW_1 = 12, + VG_A_1 = 13, + VG_A_4 = 14, + + /* {A,X}RGB channel ordering */ + VG_sXRGB_8888 = 0 | (1 << 6), + VG_sARGB_8888 = 1 | (1 << 6), + VG_sARGB_8888_PRE = 2 | (1 << 6), + VG_sARGB_1555 = 4 | (1 << 6), + VG_sARGB_4444 = 5 | (1 << 6), + VG_lXRGB_8888 = 7 | (1 << 6), + VG_lARGB_8888 = 8 | (1 << 6), + VG_lARGB_8888_PRE = 9 | (1 << 6), + + /* BGR{A,X} channel ordering */ + VG_sBGRX_8888 = 0 | (1 << 7), + VG_sBGRA_8888 = 1 | (1 << 7), + VG_sBGRA_8888_PRE = 2 | (1 << 7), + VG_sBGR_565 = 3 | (1 << 7), + VG_sBGRA_5551 = 4 | (1 << 7), + VG_sBGRA_4444 = 5 | (1 << 7), + VG_lBGRX_8888 = 7 | (1 << 7), + VG_lBGRA_8888 = 8 | (1 << 7), + VG_lBGRA_8888_PRE = 9 | (1 << 7), + + /* {A,X}BGR channel ordering */ + VG_sXBGR_8888 = 0 | (1 << 6) | (1 << 7), + VG_sABGR_8888 = 1 | (1 << 6) | (1 << 7), + VG_sABGR_8888_PRE = 2 | (1 << 6) | (1 << 7), + VG_sABGR_1555 = 4 | (1 << 6) | (1 << 7), + VG_sABGR_4444 = 5 | (1 << 6) | (1 << 7), + VG_lXBGR_8888 = 7 | (1 << 6) | (1 << 7), + VG_lABGR_8888 = 8 | (1 << 6) | (1 << 7), + VG_lABGR_8888_PRE = 9 | (1 << 6) | (1 << 7) +} VGImageFormat; + +extern EGLContext _eglGetCurrentContext(void); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/egl_1_4/makefile b/egl_1_4/makefile new file mode 100755 index 0000000..9d05ac4 --- /dev/null +++ b/egl_1_4/makefile @@ -0,0 +1,17 @@ +#!make + +default: + make -f makefile-dynamic clean + make -f makefile-dynamic install + +install: + make -f makefile-dynamic install + +clean: + make -f makefile-dynamic clean + +clobber: + make -f makefile-dynamic clobber + +wc: + make -f makefile-dynamic wc diff --git a/egl_1_4/makefile-dynamic b/egl_1_4/makefile-dynamic new file mode 100755 index 0000000..e3c8bef --- /dev/null +++ b/egl_1_4/makefile-dynamic @@ -0,0 +1,84 @@ +#!/bin/make + + +CFLAGS = -I. -I../include -fPIC -DPROVIDING_RUNTIME_BINDING -Werror-implicit-function-declaration -O3 -g +ARFLAGS = rucv + + +#LIB = libEGLbind.a + +LIBBASE = libEGL.so +LIBVER = 1.0 +LIB = $(LIBBASE).$(LIBVER) + +END = +SRCS = \ + 31Error.c \ + 32GetDisplay.c \ + 32Initialize.c \ + 32Terminate.c \ + 33QueryString.c \ + 34GetConfigs.c \ + 34ChooseConfig.c \ + 34GetConfigAttrib.c \ + 35CreateWindowSurface.c \ + 35CreatePbufferSurface.c \ + 35CreatePbufferFromClientBuffer.c \ + 35CreatePixmapSurface.c \ + 35DestroySurface.c \ + 36SurfaceAttrib.c \ + 36QuerySurface.c \ + 36BindTexImage.c \ + 36ReleaseTexImage.c \ + 37BindAPI.c \ + 37QueryAPI.c \ + 37CreateContext.c \ + 37DestroyContext.c \ + 37MakeCurrent.c \ + 37GetCurrentContext.c \ + 37GetCurrentSurface.c \ + 37GetCurrentDisplay.c \ + 37QueryContext.c \ + 38WaitClient.c \ + 38WaitGL.c \ + 38WaitNative.c \ + 39SwapBuffers.c \ + 39CopyBuffers.c \ + 39SwapInterval.c \ + 3AGetProcAddress.c \ + 3BReleaseThread.c \ + 41LockSurfaceKHR.c \ + 41UnlockSurfaceKHR.c \ + 42CreateImageKHR.c \ + 42DestroyImageKHR.c \ + global.c \ + $(END) +OBJS = $(SRCS:.c=.o) + +default: __touch__ $(LIB) + +__touch__: + touch 33QueryString.c + +$(LIB): $(OBJS) + $(CC) -shared -Wl,-soname,$(LIBBASE).1 -I../include -o $@ $(OBJS) -I../include -ldl -lX11 +# $(AR) $(ARFLAGS) $@ $(OBJS) + + +install: $(LIB) + cp $(LIB) ../lib/host-gl/ + + +# supports + +clean: + $(RM) $(RMFLAGS) $(OBJS) + +clobber: clean + $(RM) $(RMFLAGS) $(LIB) core a.out + +wc: + wc $(SRCS) *.inl *.h + +#$(OBJS): EGL/egl.h EGL/eglext.h EGL/eglplatform.h +global.o: binding.inl diff --git a/egl_1_4/makefile-single b/egl_1_4/makefile-single new file mode 100755 index 0000000..3b880bf --- /dev/null +++ b/egl_1_4/makefile-single @@ -0,0 +1,84 @@ +#!/bin/make + + +CFLAGS = -I. -I../include -fPIC -Werror-implicit-function-declaration -O0 -g3 +ARFLAGS = rucv + + +#LIB = libEGL.a + +LIBBASE = libEGL.so +LIBVER = 1.0 +LIB = $(LIBBASE).$(LIBVER) + +END = +SRCS = \ + 31Error.c \ + 32GetDisplay.c \ + 32Initialize.c \ + 32Terminate.c \ + 33QueryString.c \ + 34GetConfigs.c \ + 34ChooseConfig.c \ + 34GetConfigAttrib.c \ + 35CreateWindowSurface.c \ + 35CreatePbufferSurface.c \ + 35CreatePbufferFromClientBuffer.c \ + 35CreatePixmapSurface.c \ + 35DestroySurface.c \ + 36SurfaceAttrib.c \ + 36QuerySurface.c \ + 36BindTexImage.c \ + 36ReleaseTexImage.c \ + 37BindAPI.c \ + 37QueryAPI.c \ + 37CreateContext.c \ + 37DestroyContext.c \ + 37MakeCurrent.c \ + 37GetCurrentContext.c \ + 37GetCurrentSurface.c \ + 37GetCurrentDisplay.c \ + 37QueryContext.c \ + 38WaitClient.c \ + 38WaitGL.c \ + 38WaitNative.c \ + 39SwapBuffers.c \ + 39CopyBuffers.c \ + 39SwapInterval.c \ + 3AGetProcAddress.c \ + 3BReleaseThread.c \ + 41LockSurfaceKHR.c \ + 41UnlockSurfaceKHR.c \ + 42CreateImageKHR.c \ + 42DestroyImageKHR.c \ + global.c \ + $(END) +OBJS = $(SRCS:.c=.o) + + +default: __touch__ $(LIB) + +__touch__: + touch 33QueryString.c + +$(LIB): $(OBJS) + $(CC) -shared -Wl,-soname,$(LIBBASE).1 -o $@ $(OBJS) + +# $(AR) $(ARFLAGS) $@ $(OBJS) + +install: $(LIB) + cp $(LIB) ../lib + + +# supports + +clean: + $(RM) $(RMFLAGS) $(OBJS) + +clobber: clean + $(RM) $(RMFLAGS) $(LIB) core a.out + +wc: + wc $(SRCS) *.inl *.h + +$(OBJS): EGL/egl.h EGL/eglext.h EGL/eglplatform.h diff --git a/es_1_1/25Error.c b/es_1_1/25Error.c new file mode 100755 index 0000000..b541cf0 --- /dev/null +++ b/es_1_1/25Error.c @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "gl_imp.h" +#include <string.h> +#include <stdarg.h> + + +GLenum GL_APIENTRY EXTFN(GetError)(void) { + GLenum eResult = FNPTR(GetError)(); + if (CCV(curErrCode) != GL_NO_ERROR) { + eResult = CCV(curErrCode); + CCV(curErrCode) = GL_NO_ERROR; + } + return eResult; +} + + +void GL_APIENTRY INTFN(SetError)(GLenum eError) { + if (CCV(curErrCode) == GL_NO_ERROR) { + CCV(curErrCode) = eError; + } +} + diff --git a/es_1_1/25enable.c b/es_1_1/25enable.c new file mode 100755 index 0000000..2b1dab6 --- /dev/null +++ b/es_1_1/25enable.c @@ -0,0 +1,290 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "./gl_imp.h" +#include <GLES/glext.h> + +#ifdef ALEXGL_PROVIDE_1_1 +GL_API GLboolean GL_APIENTRY EXTFN(IsEnabled)(GLenum cap) { + switch (cap) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return GL_FALSE; +#if defined(PROVIDING_OES_point_size_array) + case GL_POINT_SIZE_ARRAY_OES: return CCV(pointSizeArrayOES); break; +#endif + + case GL_VERTEX_ARRAY: + case GL_NORMAL_ARRAY: + case GL_COLOR_ARRAY: + case GL_TEXTURE_COORD_ARRAY: + case GL_NORMALIZE: + case GL_RESCALE_NORMAL: + case GL_CLIP_PLANE0 + 0: + case GL_CLIP_PLANE0 + 1: + case GL_CLIP_PLANE0 + 2: + case GL_CLIP_PLANE0 + 3: + case GL_CLIP_PLANE0 + 4: + case GL_CLIP_PLANE0 + 5: + case GL_CLIP_PLANE0 + 6: + case GL_CLIP_PLANE0 + 7: + case GL_CLIP_PLANE0 + 8: + case GL_CLIP_PLANE0 + 9: + case GL_CLIP_PLANE0 + 10: + case GL_CLIP_PLANE0 + 11: + case GL_CLIP_PLANE0 + 12: + case GL_CLIP_PLANE0 + 13: + case GL_CLIP_PLANE0 + 14: + case GL_CLIP_PLANE0 + 15: + case GL_CLIP_PLANE0 + 16: + case GL_CLIP_PLANE0 + 17: + case GL_CLIP_PLANE0 + 18: + case GL_CLIP_PLANE0 + 19: + case GL_CLIP_PLANE0 + 20: + case GL_CLIP_PLANE0 + 21: + case GL_CLIP_PLANE0 + 22: + case GL_CLIP_PLANE0 + 23: + case GL_CLIP_PLANE0 + 24: + case GL_CLIP_PLANE0 + 25: + case GL_CLIP_PLANE0 + 26: + case GL_CLIP_PLANE0 + 27: + case GL_CLIP_PLANE0 + 28: + case GL_CLIP_PLANE0 + 29: + case GL_CLIP_PLANE0 + 30: + case GL_CLIP_PLANE0 + 31: + case GL_FOG: + case GL_LIGHTING: + case GL_COLOR_MATERIAL: + case GL_LIGHT0 + 0: + case GL_LIGHT0 + 1: + case GL_LIGHT0 + 2: + case GL_LIGHT0 + 3: + case GL_LIGHT0 + 4: + case GL_LIGHT0 + 5: + case GL_LIGHT0 + 6: + case GL_LIGHT0 + 7: + case GL_LIGHT0 + 8: + case GL_LIGHT0 + 9: + case GL_LIGHT0 + 10: + case GL_LIGHT0 + 11: + case GL_LIGHT0 + 12: + case GL_LIGHT0 + 13: + case GL_LIGHT0 + 14: + case GL_LIGHT0 + 15: + case GL_LIGHT0 + 16: + case GL_LIGHT0 + 17: + case GL_LIGHT0 + 18: + case GL_LIGHT0 + 19: + case GL_LIGHT0 + 20: + case GL_LIGHT0 + 21: + case GL_LIGHT0 + 22: + case GL_LIGHT0 + 23: + case GL_LIGHT0 + 24: + case GL_LIGHT0 + 25: + case GL_LIGHT0 + 26: + case GL_LIGHT0 + 27: + case GL_LIGHT0 + 28: + case GL_LIGHT0 + 29: + case GL_LIGHT0 + 30: + case GL_LIGHT0 + 31: + case GL_POINT_SMOOTH: + case GL_LINE_SMOOTH: + case GL_CULL_FACE: + case GL_POLYGON_OFFSET_FILL: +#if defined(PROVIDING_OES_point_sprite) + case GL_POINT_SPRITE_OES: +#endif + case GL_MULTISAMPLE: + case GL_SAMPLE_ALPHA_TO_COVERAGE: + case GL_SAMPLE_ALPHA_TO_ONE: + case GL_SAMPLE_COVERAGE: + case GL_TEXTURE_2D: + case GL_SCISSOR_TEST: + case GL_ALPHA_TEST: + case GL_STENCIL_TEST: + case GL_DEPTH_TEST: + case GL_BLEND: + case GL_DITHER: + case GL_COLOR_LOGIC_OP: +#if defined(PROVIDING_OES_texture_cube_map) + case GL_TEXTURE_GEN_STR_OES: +#endif + return FNPTR(IsEnabled)(cap); + break; + } +} +#endif + +GL_API void GL_APIENTRY INTFN(SetClientState)(GLenum array, GLboolean val) { + switch (array) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; +#ifdef ALEXGL_PROVIDE_1_1 +#if defined(PROVIDING_OES_point_size_array) + case GL_POINT_SIZE_ARRAY_OES: CCV(pointSizeArrayOES) = val; return; +#endif +#endif + case GL_VERTEX_ARRAY: CCV(vertexArray) = val; break; + case GL_NORMAL_ARRAY: CCV(normalArray) = val; break; + case GL_COLOR_ARRAY: CCV(colorArray) = val; break; + case GL_TEXTURE_COORD_ARRAY: CCV(texCoordArray)[CCV(clientActiveTexture)] = val; break; + } + if (val == GL_TRUE) FNPTR(EnableClientState)(array); + else FNPTR(DisableClientState)(array); +} + +GL_API void GL_APIENTRY INTFN(SetServerState)(GLenum cap, GLboolean val) { + switch (cap) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + + case GL_TEXTURE_2D: CCV(texture2D)[CCV(activeTexture)] = val; break; + case GL_NORMALIZE: + case GL_RESCALE_NORMAL: +#ifdef ALEXGL_PROVIDE_1_1 + case GL_CLIP_PLANE0 + 0: + case GL_CLIP_PLANE0 + 1: + case GL_CLIP_PLANE0 + 2: + case GL_CLIP_PLANE0 + 3: + case GL_CLIP_PLANE0 + 4: + case GL_CLIP_PLANE0 + 5: + case GL_CLIP_PLANE0 + 6: + case GL_CLIP_PLANE0 + 7: + case GL_CLIP_PLANE0 + 8: + case GL_CLIP_PLANE0 + 9: + case GL_CLIP_PLANE0 + 10: + case GL_CLIP_PLANE0 + 11: + case GL_CLIP_PLANE0 + 12: + case GL_CLIP_PLANE0 + 13: + case GL_CLIP_PLANE0 + 14: + case GL_CLIP_PLANE0 + 15: + case GL_CLIP_PLANE0 + 16: + case GL_CLIP_PLANE0 + 17: + case GL_CLIP_PLANE0 + 18: + case GL_CLIP_PLANE0 + 19: + case GL_CLIP_PLANE0 + 20: + case GL_CLIP_PLANE0 + 21: + case GL_CLIP_PLANE0 + 22: + case GL_CLIP_PLANE0 + 23: + case GL_CLIP_PLANE0 + 24: + case GL_CLIP_PLANE0 + 25: + case GL_CLIP_PLANE0 + 26: + case GL_CLIP_PLANE0 + 27: + case GL_CLIP_PLANE0 + 28: + case GL_CLIP_PLANE0 + 29: + case GL_CLIP_PLANE0 + 30: + case GL_CLIP_PLANE0 + 31: +#endif + case GL_FOG: + case GL_LIGHTING: + case GL_COLOR_MATERIAL: + case GL_LIGHT0 + 0: + case GL_LIGHT0 + 1: + case GL_LIGHT0 + 2: + case GL_LIGHT0 + 3: + case GL_LIGHT0 + 4: + case GL_LIGHT0 + 5: + case GL_LIGHT0 + 6: + case GL_LIGHT0 + 7: + case GL_LIGHT0 + 8: + case GL_LIGHT0 + 9: + case GL_LIGHT0 + 10: + case GL_LIGHT0 + 11: + case GL_LIGHT0 + 12: + case GL_LIGHT0 + 13: + case GL_LIGHT0 + 14: + case GL_LIGHT0 + 15: + case GL_LIGHT0 + 16: + case GL_LIGHT0 + 17: + case GL_LIGHT0 + 18: + case GL_LIGHT0 + 19: + case GL_LIGHT0 + 20: + case GL_LIGHT0 + 21: + case GL_LIGHT0 + 22: + case GL_LIGHT0 + 23: + case GL_LIGHT0 + 24: + case GL_LIGHT0 + 25: + case GL_LIGHT0 + 26: + case GL_LIGHT0 + 27: + case GL_LIGHT0 + 28: + case GL_LIGHT0 + 29: + case GL_LIGHT0 + 30: + case GL_LIGHT0 + 31: + case GL_POINT_SMOOTH: + case GL_LINE_SMOOTH: + case GL_CULL_FACE: + case GL_POLYGON_OFFSET_FILL: + case GL_MULTISAMPLE: + case GL_SAMPLE_ALPHA_TO_COVERAGE: + case GL_SAMPLE_ALPHA_TO_ONE: + case GL_SAMPLE_COVERAGE: + case GL_SCISSOR_TEST: + case GL_ALPHA_TEST: + case GL_STENCIL_TEST: + case GL_DEPTH_TEST: + case GL_BLEND: + case GL_DITHER: + case GL_COLOR_LOGIC_OP: +#if defined(PROVIDING_OES_point_sprite) + case GL_POINT_SPRITE_OES: +#endif +#if defined(PROVIDING_OES_texture_cube_map) + case GL_TEXTURE_GEN_STR_OES: +#endif + break; + } + if (val == GL_TRUE) FNPTR(Enable)(cap); + else { + FNPTR(Disable)(cap); + if (cap == GL_COLOR_MATERIAL) { + FNPTR(Materialfv)(GL_FRONT_AND_BACK, GL_AMBIENT, CCV(ambientMaterial)); + FNPTR(Materialfv)(GL_FRONT_AND_BACK, GL_DIFFUSE, CCV(diffuseMaterial)); + } + } +} + +GL_API void GL_APIENTRY EXTFN(EnableClientState)(GLenum array) { + INTFN(SetClientState)(array, GL_TRUE); +} + +GL_API void GL_APIENTRY EXTFN(DisableClientState)(GLenum array) { + INTFN(SetClientState)(array, GL_FALSE); +} + +GL_API void GL_APIENTRY EXTFN(Enable)(GLenum cap) { + INTFN(SetServerState)(cap, GL_TRUE); +} + +GL_API void GL_APIENTRY EXTFN(Disable)(GLenum cap) { + INTFN(SetServerState)(cap, GL_FALSE); +} diff --git a/es_1_1/27state.c b/es_1_1/27state.c new file mode 100755 index 0000000..9b8c6cf --- /dev/null +++ b/es_1_1/27state.c @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include <stdlib.h> +#include "gl_imp.h" + +#ifdef ALEXGL_PROVIDE_COMMON +GL_API void GL_APIENTRY EXTFN(Color4f)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) { + FNPTR(Color4f)(red, green, blue, alpha); +} +#endif + +GL_API void GL_APIENTRY EXTFN(Color4x)(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha) { + FNPTR(Color4f)(x2f(red), x2f(green), x2f(blue), x2f(alpha)); +} + +#ifdef ALEXGL_PROVIDE_1_1 +GL_API void GL_APIENTRY EXTFN(Color4ub)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha) { + FNPTR(Color4ub)(red, green, blue, alpha); +} +#endif + +#ifdef ALEXGL_PROVIDE_COMMON +GL_API void GL_APIENTRY EXTFN(Normal3f)(GLfloat nx, GLfloat ny, GLfloat nz) { + FNPTR(Normal3f)(nx, ny, nz); +} +#endif + +GL_API void GL_APIENTRY EXTFN(Normal3x)(GLfixed nx, GLfixed ny, GLfixed nz) { + FNPTR(Normal3f)(x2f(nx), x2f(ny), x2f(nz)); +} + +#ifdef ALEXGL_PROVIDE_COMMON +GL_API void GL_APIENTRY EXTFN(MultiTexCoord4f)(GLenum target, + GLfloat s, GLfloat t, GLfloat r, GLfloat q) { + FNPTR(MultiTexCoord4f)(target, s, t, r, q); +} +#endif + +GL_API void GL_APIENTRY EXTFN(MultiTexCoord4x)(GLenum target, + GLfixed s, GLfixed t, GLfixed r, GLfixed q) { + FNPTR(MultiTexCoord4f)(target, x2f(s), x2f(t), x2f(r), x2f(q)); +} diff --git a/es_1_1/28array.c b/es_1_1/28array.c new file mode 100755 index 0000000..11ea2c4 --- /dev/null +++ b/es_1_1/28array.c @@ -0,0 +1,286 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "gl_imp.h" + +GL_API int GL_APIENTRY INTFN(GetTightStride)(GLint size, GLenum type) { + switch (type) { + case GL_BYTE: + case GL_UNSIGNED_BYTE: + return size; + case GL_SHORT: + case GL_UNSIGNED_SHORT: + return size * 2; + case GL_FLOAT: + case GL_FIXED: + return size * 4; + } + assert(0); + return 0; +} + +GL_API void GL_APIENTRY INTFN(Fetch)(GLvoid* src, GLreal* dst, GLint size, GLenum type) { + switch (type) { + case GL_BYTE: bv2rv((GLbyte*)src, dst, size); break; + case GL_SHORT: sv2rv((GLshort*)src, dst, size); break; + case GL_FLOAT: fv2rv((GLfloat*)src, dst, size); break; + case GL_FIXED: xv2rv((GLfixed*)src, dst, size); break; + default: assert(0); break; + } +} + +GL_API void GL_APIENTRY INTFN(FetchClamp)(GLvoid* src, GLreal* dst, GLint size, GLenum type) { + switch (type) { + case GL_BYTE: bv2clamprv((GLbyte*)src, dst, size); break; + case GL_UNSIGNED_BYTE: ubv2clamprv((GLbyte*)src, dst, size); break; + case GL_SHORT: sv2clamprv((GLshort*)src, dst, size); break; + case GL_FLOAT: fv2clamprv((GLfloat*)src, dst, size); break; + case GL_FIXED: xv2clamprv((GLfixed*)src, dst, size); break; + default: assert(0); break; + } +} + + +GL_API void GL_APIENTRY EXTFN(ClientActiveTexture)(GLenum texture) { + GLint tex; + FNPTR(ClientActiveTexture)(texture); + FNPTR(GetIntegerv)(GL_CLIENT_ACTIVE_TEXTURE, &tex); + CCV(clientActiveTexture) = tex - GL_TEXTURE0; +} + +GL_API void GL_APIENTRY EXTFN(VertexPointer)(GLint size, + GLenum type, GLsizei stride, const GLvoid* pointer) { + GLenum code; + if (CCV(curErrCode) == GL_NO_ERROR && (code = FNPTR(GetError)()) != GL_NO_ERROR) { + CCV(curErrCode) = code; + } + switch (type) { + case GL_SHORT: +#ifdef ALEXGL_PROVIDE_COMMON + case GL_FLOAT: +#endif + FNPTR(VertexPointer)(size, type, stride, pointer); + break; +#if defined(PROVIDING_OES_byte_coordinates) + case GL_BYTE: +#endif + case GL_FIXED: + FNPTR(VertexPointer)(size, GL_INT, stride, pointer); + break; + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + } + if ((code = FNPTR(GetError)()) != GL_NO_ERROR) { + if (CCV(curErrCode) == GL_NO_ERROR) CCV(curErrCode) = code; + return; + } + CCV(vertexArraySize) = size; + CCV(vertexArrayType) = type; + CCV(vertexArrayStride) = (stride == 0) ? INTFN(GetTightStride)(size, type) : stride; + CCV(vertexArrayPointer) = (GLvoid*)pointer; +#if ALEXGL_PROVIDE_1_1 + GLint bind; + FNPTR(GetIntegerv)(GL_ARRAY_BUFFER_BINDING, &bind); + CCV(vertexArrayBufferBinding) = bind; +#endif +} + +GL_API void GL_APIENTRY EXTFN(NormalPointer)(GLenum type, GLsizei stride, const GLvoid* pointer) { + GLenum code; + if (CCV(curErrCode) == GL_NO_ERROR && (code = FNPTR(GetError)()) != GL_NO_ERROR) { + CCV(curErrCode) = code; + } + switch (type) { + case GL_BYTE: + case GL_SHORT: +#ifdef ALEXGL_PROVIDE_COMMON + case GL_FLOAT: +#endif + FNPTR(NormalPointer)(type, stride, pointer); + break; + case GL_FIXED: + FNPTR(NormalPointer)(GL_INT, stride, pointer); + break; + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + } + if ((code = FNPTR(GetError)()) != GL_NO_ERROR) { + if (CCV(curErrCode) == GL_NO_ERROR) CCV(curErrCode) = code; + return; + } + CCV(normalArrayType) = type; + CCV(normalArrayStride) = (stride == 0) ? INTFN(GetTightStride)(3, type) : stride; + CCV(normalArrayPointer) = (GLvoid*)pointer; +#if ALEXGL_PROVIDE_1_1 + GLint bind; + FNPTR(GetIntegerv)(GL_ARRAY_BUFFER_BINDING, &bind); + CCV(normalArrayBufferBinding) = bind; +#endif +} + +GL_API void GL_APIENTRY EXTFN(ColorPointer)(GLint size, + GLenum type, GLsizei stride, const GLvoid* pointer) { + GLenum code; + if (size != 4) { + INTFN(SetError)(GL_INVALID_VALUE); + return ; + } + if (CCV(curErrCode) == GL_NO_ERROR && (code = FNPTR(GetError)()) != GL_NO_ERROR) { + CCV(curErrCode) = code; + } + switch (type) { + case GL_UNSIGNED_BYTE: +#ifdef ALEXGL_PROVIDE_COMMON + case GL_FLOAT: +#endif + FNPTR(ColorPointer)(size, type, stride, pointer); + break; + case GL_FIXED: + FNPTR(ColorPointer)(size, GL_FLOAT, stride, pointer); + break; + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + } + if ((code = FNPTR(GetError)()) != GL_NO_ERROR) { + if (CCV(curErrCode) == GL_NO_ERROR) CCV(curErrCode) = code; + return; + } + CCV(colorArrayType) = type; + CCV(colorArrayStride) = (stride == 0) ? INTFN(GetTightStride)(size, type) : stride; + CCV(colorArrayPointer) = (GLvoid*)pointer; +#if ALEXGL_PROVIDE_1_1 + GLint bind; + FNPTR(GetIntegerv)(GL_ARRAY_BUFFER_BINDING, &bind); + CCV(colorArrayBufferBinding) = bind; +#endif +} + +GL_API void GL_APIENTRY EXTFN(TexCoordPointer)(GLint size, + GLenum type, GLsizei stride, const GLvoid* pointer) { + register GLuint index; + GLenum code; + if (size < 2 || 4 < size) { + INTFN(SetError)(GL_INVALID_VALUE); + return ; + } + if (CCV(curErrCode) == GL_NO_ERROR && (code = FNPTR(GetError)()) != GL_NO_ERROR) { + CCV(curErrCode) = code; + } + switch (type) { + case GL_SHORT: +#ifdef ALEXGL_PROVIDE_COMMON + case GL_FLOAT: +#endif + FNPTR(TexCoordPointer)(size, type, stride, pointer); + break; +#if defined(PROVIDING_OES_byte_coordinates) + case GL_BYTE: +#endif + case GL_FIXED: + FNPTR(TexCoordPointer)(size, GL_INT, stride, pointer); + break; + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + } + if ((code = FNPTR(GetError)()) != GL_NO_ERROR) { + if (CCV(curErrCode) == GL_NO_ERROR) CCV(curErrCode) = code; + return; + } + index = CCV(clientActiveTexture); + assert(0 <= index && index < ALEXGL_MAX_TEXTURE_UNITS); + CCV(texCoordArraySize[index]) = size; + CCV(texCoordArrayType[index]) = type; + CCV(texCoordArrayStride[index]) = (stride == 0) ? INTFN(GetTightStride)(size, type) : stride; + CCV(texCoordArrayPointer[index]) = (GLvoid*)pointer; +#if ALEXGL_PROVIDE_1_1 + GLint bind; + FNPTR(GetIntegerv)(GL_ARRAY_BUFFER_BINDING, &bind); + CCV(texCoordArrayBufferBinding[index]) = bind; +#endif +} + +#if defined(PROVIDING_OES_point_size_array) +GL_API void GL_APIENTRY EXTFN(PointSizePointerOES)(GLenum type, + GLsizei stride, const GLvoid* pointer) { +#ifdef ALEXGL_PROVIDE_COMMON + if (type != GL_FIXED && type != GL_FLOAT) { +#else + if (type != GL_FIXED) { +#endif + INTFN(SetError)(GL_INVALID_ENUM); + return ; + } + if (stride < 0) { + INTFN(SetError)(GL_INVALID_VALUE); + return ; + } + CCV(pointSizeArrayTypeOES) = type; + CCV(pointSizeArrayStrideOES) = (stride == 0) ? INTFN(GetTightStride)(1, type) : stride; + CCV(pointSizeArrayStrideOESGiven) = stride; + CCV(pointSizeArrayPointerOES) = (GLvoid*)pointer; +#if ALEXGL_PROVIDE_1_1 + GLint bind; + FNPTR(GetIntegerv)(GL_ARRAY_BUFFER_BINDING, &bind); + CCV(pointSizeArrayBufferBindingOES) = bind; +#endif +} +#endif + +#ifdef ALEXGL_PROVIDE_1_1 +GL_API void GL_APIENTRY EXTFN(GetPointerv)(GLenum pname, void** params) { + switch (pname) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_VERTEX_ARRAY_POINTER: + *params = (void*)(CCV(vertexArrayPointer)); + break; + case GL_NORMAL_ARRAY_POINTER: + *params = (void*)(CCV(normalArrayPointer)); + break; + case GL_COLOR_ARRAY_POINTER: + *params = (void*)(CCV(colorArrayPointer)); + break; + case GL_TEXTURE_COORD_ARRAY_POINTER: + *params = (void*)(CCV(texCoordArrayPointer[CCV(clientActiveTexture)])); + break; +#if defined(PROVIDING_OES_point_size_array) + case GL_POINT_SIZE_ARRAY_POINTER_OES: + *params = (void*)(CCV(pointSizeArrayPointerOES)); + break; +#endif + } +} +#endif diff --git a/es_1_1/29buffer.c b/es_1_1/29buffer.c new file mode 100755 index 0000000..d8b6a4a --- /dev/null +++ b/es_1_1/29buffer.c @@ -0,0 +1,150 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "gl_imp.h" +#include <malloc.h> +#include <string.h> + +#if ! defined(GL_BUFFER_ACCESS) +#define GL_BUFFER_ACCESS 0x88BB +#endif +#if ! defined(GL_WRITE_ONLY) +#define GL_WRITE_ONLY 0x88B9 +#endif + +static void INTFN(ResizeBuffer)(int n) { + if (CCV(nBuffer) <= n) { + int newSize = CCV(nBuffer); + while (newSize <= n) { newSize *= 2; } + CCV(pBufferStatus) = realloc(CCV(pBufferStatus), newSize * sizeof(GLint)); + memset(CCV(pBufferStatus) + CCV(nBuffer), 0, (newSize - CCV(nBuffer)) * sizeof(GLint)); + CCV(nBuffer) = newSize; + } +} + +#if ALEXGL_INTERNAL_VERSION >= 110 +GL_API void GL_APIENTRY EXTFN(GenBuffers)(GLsizei n, GLuint* buffers) { + int max; + int i; + FNPTR(GenBuffers)(n, buffers); + max = 0; + for (i = 0; buffers != NULL && i < n; i++) { + if (buffers[i] > max) max = buffers[i]; + } + INTFN(ResizeBuffer)(max); + for (i = 0; buffers != NULL && i < n; i++) { + CCV(pBufferStatus)[buffers[i]] = ALEXGL_BUFFER_GENERATED; + } +} +#endif + +#if ALEXGL_INTERNAL_VERSION >= 110 +GL_API void GL_APIENTRY EXTFN(BindBuffer)(GLenum target, GLuint buffer) { + if (target != GL_ARRAY_BUFFER && target != GL_ELEMENT_ARRAY_BUFFER) { + INTFN(SetError)(GL_INVALID_ENUM); + return; + } + FNPTR(BindBuffer)(target, buffer); + INTFN(ResizeBuffer)(buffer); + CCV(pBufferStatus)[buffer] = ALEXGL_BUFFER_BOUND; +} +#endif + +#if ALEXGL_INTERNAL_VERSION >= 110 +GL_API void GL_APIENTRY EXTFN(DeleteBuffers)(GLsizei n, const GLuint* buffers) { + int max; + int i; + FNPTR(DeleteBuffers)(n, buffers); + max = 0; + for (i = 0; buffers != NULL && i < n; i++) { + if (buffers[i] > max) max = buffers[i]; + } + INTFN(ResizeBuffer)(max); + for (i = 0; buffers != NULL && i < n; i++) { + CCV(pBufferStatus)[buffers[i]] = ALEXGL_BUFFER_NULL; + } +} +#endif + +#if ALEXGL_INTERNAL_VERSION >= 110 +GL_API GLboolean GL_APIENTRY EXTFN(IsBuffer)(GLuint buffer) { + register GLboolean bAnswer; + bAnswer = FNPTR(IsBuffer)(buffer); + INTFN(ResizeBuffer)(buffer); + if (bAnswer == GL_TRUE && CCV(pBufferStatus)[buffer] != ALEXGL_BUFFER_BOUND) { + bAnswer = GL_FALSE; + } + return (bAnswer == GL_FALSE) ? GL_FALSE : GL_TRUE; +} +#endif + +#if ALEXGL_INTERNAL_VERSION >= 110 +GL_API void GL_APIENTRY EXTFN(GetBufferParameteriv)(GLenum target, GLenum pname, GLint* params) { + if (target != GL_ARRAY_BUFFER && target != GL_ELEMENT_ARRAY_BUFFER) { + INTFN(SetError)(GL_INVALID_ENUM); + return; + } + if (pname != GL_BUFFER_SIZE && pname != GL_BUFFER_USAGE && pname != GL_BUFFER_ACCESS) { + INTFN(SetError)(GL_INVALID_ENUM); + return; + } + FNPTR(GetBufferParameteriv)(target, pname, params); + if (pname == GL_BUFFER_ACCESS && *params == GL_READ_WRITE) { + *params = GL_WRITE_ONLY; + } +} +#endif + +#if ALEXGL_INTERNAL_VERSION >= 110 +GL_API void GL_APIENTRY EXTFN(BufferData)(GLenum target, + GLsizeiptr size, const GLvoid* data, GLenum usage) { + if (target != GL_ARRAY_BUFFER && target != GL_ELEMENT_ARRAY_BUFFER) { + INTFN(SetError)(GL_INVALID_ENUM); + return; + } + if (usage != GL_STATIC_DRAW && usage != GL_DYNAMIC_DRAW) { + INTFN(SetError)(GL_INVALID_ENUM); + return; + } + FNPTR(BufferData)(target, size, data, usage); +} +#endif + +#if ALEXGL_INTERNAL_VERSION >= 110 +GL_API void GL_APIENTRY EXTFN(BufferSubData)(GLenum target, + GLintptr offset, GLsizeiptr size, const GLvoid* data) { + if (target != GL_ARRAY_BUFFER && target != GL_ELEMENT_ARRAY_BUFFER) { + INTFN(SetError)(GL_INVALID_ENUM); + return; + } + FNPTR(BufferSubData)(target, offset, size, data); +} +#endif diff --git a/es_1_1/2Axform.c b/es_1_1/2Axform.c new file mode 100755 index 0000000..c8d1afd --- /dev/null +++ b/es_1_1/2Axform.c @@ -0,0 +1,147 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "gl_imp.h" + +GL_API void GL_APIENTRY EXTFN(ActiveTexture)(GLenum texture) { + GLint tex; + FNPTR(ActiveTexture)(texture); + FNPTR(GetIntegerv)(GL_ACTIVE_TEXTURE, &tex); + CCV(activeTexture) = tex - GL_TEXTURE0; +} + +#ifdef ALEXGL_PROVIDE_COMMON +GL_API void GL_APIENTRY EXTFN(DepthRangef)(GLclampf zNear, GLclampf zFar) { + FNPTR(DepthRange)(f2d(zNear), f2d(zFar)); +} +#endif + +GL_API void GL_APIENTRY EXTFN(DepthRangex)(GLclampx zNear, GLclampx zFar) { + FNPTR(DepthRange)(x2d(zNear), x2d(zFar)); +} + +GL_API void GL_APIENTRY EXTFN(Viewport)(GLint x, GLint y, GLsizei width, GLsizei height) { + FNPTR(Viewport)(x, y, width, height); +} + +GL_API void GL_APIENTRY EXTFN(MatrixMode)(GLenum mode) { + FNPTR(MatrixMode)(mode); +} + +#ifdef ALEXGL_PROVIDE_COMMON +GL_API void GL_APIENTRY EXTFN(LoadMatrixf)(const GLfloat* m) { + FNPTR(LoadMatrixf)(m); +} +#endif + +GL_API void GL_APIENTRY EXTFN(LoadMatrixx)(const GLfixed* m) { + GLfloat f[16]; + xv2fv(m, f, 16); + FNPTR(LoadMatrixf)(f); +} + +#ifdef ALEXGL_PROVIDE_COMMON +GL_API void GL_APIENTRY EXTFN(MultMatrixf)(const GLfloat* m) { + FNPTR(MultMatrixf)(m); +} +#endif + +GL_API void GL_APIENTRY EXTFN(MultMatrixx)(const GLfixed* m) { + GLfloat f[16]; + xv2fv(m, f, 16); + FNPTR(MultMatrixf)(f); +} + +GL_API void GL_APIENTRY EXTFN(LoadIdentity)(void) { + FNPTR(LoadIdentity)(); +} + +#ifdef ALEXGL_PROVIDE_COMMON +GL_API void GL_APIENTRY EXTFN(Rotatef)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z) { + FNPTR(Rotatef)(angle, x, y, z); +} +#endif + +GL_API void GL_APIENTRY EXTFN(Rotatex)(GLfixed angle, GLfixed x, GLfixed y, GLfixed z) { + FNPTR(Rotatef)(x2f(angle), x2f(x), x2f(y), x2f(z)); +} + +#ifdef ALEXGL_PROVIDE_COMMON +GL_API void GL_APIENTRY EXTFN(Translatef)(GLfloat x, GLfloat y, GLfloat z) { + FNPTR(Translatef)(x, y, z); +} +#endif + +GL_API void GL_APIENTRY EXTFN(Translatex)(GLfixed x, GLfixed y, GLfixed z) { + FNPTR(Translatef)(x2f(x), x2f(y), x2f(z)); +} + +#ifdef ALEXGL_PROVIDE_COMMON +GL_API void GL_APIENTRY EXTFN(Scalef)(GLfloat x, GLfloat y, GLfloat z) { + FNPTR(Scalef)(x, y, z); +} +#endif + +GL_API void GL_APIENTRY EXTFN(Scalex)(GLfixed x, GLfixed y, GLfixed z) { + FNPTR(Scalef)(x2f(x), x2f(y), x2f(z)); +} + +#ifdef ALEXGL_PROVIDE_COMMON +GL_API void GL_APIENTRY EXTFN(Frustumf)(GLfloat left, GLfloat right, + GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar) { + FNPTR(Frustum)(f2d(left), f2d(right), f2d(bottom), f2d(top), f2d(zNear), f2d(zFar)); +} +#endif + +GL_API void GL_APIENTRY EXTFN(Frustumx)(GLfixed left, GLfixed right, + GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar) { + FNPTR(Frustum)(x2d(left), x2d(right), x2d(bottom), x2d(top), x2d(zNear), x2d(zFar)); +} + +#ifdef ALEXGL_PROVIDE_COMMON +GL_API void GL_APIENTRY EXTFN(Orthof)(GLfloat left, GLfloat right, + GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar) { + FNPTR(Ortho)(f2d(left), f2d(right), f2d(bottom), f2d(top), f2d(zNear), f2d(zFar)); +} +#endif + +GL_API void GL_APIENTRY EXTFN(Orthox)(GLfixed left, GLfixed right, + GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar) { + FNPTR(Ortho)(x2d(left), x2d(right), x2d(bottom), x2d(top), x2d(zNear), x2d(zFar)); +} + +GL_API void GL_APIENTRY EXTFN(PopMatrix)(void) { + FNPTR(PopMatrix)(); +} + +GL_API void GL_APIENTRY EXTFN(PushMatrix)(void) { + FNPTR(PushMatrix)(); +} diff --git a/es_1_1/2Bclip.c b/es_1_1/2Bclip.c new file mode 100755 index 0000000..c94e7da --- /dev/null +++ b/es_1_1/2Bclip.c @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "gl_imp.h" + +#ifdef ALEXGL_PROVIDE_COMMON +#ifdef ALEXGL_PROVIDE_1_1 +GL_API void GL_APIENTRY EXTFN(ClipPlanef)(GLenum plane, const GLfloat* equation) { + GLdouble d[4]; + fv2dv(equation, d, 4); + FNPTR(ClipPlane)(plane, d); +} +#endif +#endif + +#ifdef ALEXGL_PROVIDE_1_1 +GL_API void GL_APIENTRY EXTFN(ClipPlanex)(GLenum plane, const GLfixed* equation) { + GLdouble d[4]; + xv2dv(equation, d, 4); + FNPTR(ClipPlane)(plane, d); +} +#endif + +#ifdef ALEXGL_PROVIDE_COMMON +#ifdef ALEXGL_PROVIDE_1_1 +GL_API void GL_APIENTRY EXTFN(GetClipPlanef)(GLenum pname, GLfloat eqn[4]) { + GLdouble d[4]; + FNPTR(GetClipPlane)(pname, d); + dv2fv(d, eqn, 4); +} +#endif +#endif + +#ifdef ALEXGL_PROVIDE_1_1 +GL_API void GL_APIENTRY EXTFN(GetClipPlanex)(GLenum pname, GLfixed eqn[4]) { + GLdouble d[4]; + FNPTR(GetClipPlane)(pname, d); + dv2xv(d, eqn, 4); +} +#endif diff --git a/es_1_1/2Ccolor.c b/es_1_1/2Ccolor.c new file mode 100755 index 0000000..e4603b2 --- /dev/null +++ b/es_1_1/2Ccolor.c @@ -0,0 +1,285 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "gl_imp.h" + +#ifdef ALEXGL_PROVIDE_COMMON +void GL_APIENTRY EXTFN(Materialf)(GLenum face, GLenum pname, GLfloat param) { + switch (face) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_FRONT_AND_BACK: + break; + } + switch (pname) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_SHININESS: + break; + } + FNPTR(Materialf)(face, pname, param); +} +#endif + +void GL_APIENTRY EXTFN(Materialx)(GLenum face, GLenum pname, GLfixed param) { + register GLfloat fValue = x2f(param); + switch (face) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_FRONT_AND_BACK: + break; + } + switch (pname) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_SHININESS: + break; + } + FNPTR(Materialf)(face, pname, fValue); +} + +#ifdef ALEXGL_PROVIDE_COMMON +void GL_APIENTRY EXTFN(Materialfv)(GLenum face, GLenum pname, const GLfloat* params) { + switch (face) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_FRONT_AND_BACK: + break; + } + switch (pname) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_AMBIENT_AND_DIFFUSE: + fv2fv(params, CCV(ambientMaterial), 4); + fv2fv(params, CCV(diffuseMaterial), 4); + FNPTR(Materialfv)(face, pname, params); + break; + case GL_AMBIENT: + fv2fv(params, CCV(ambientMaterial), 4); + FNPTR(Materialfv)(face, pname, params); + break; + case GL_DIFFUSE: + fv2fv(params, CCV(diffuseMaterial), 4); + FNPTR(Materialfv)(face, pname, params); + break; + case GL_SPECULAR: + case GL_EMISSION: + case GL_SHININESS: + FNPTR(Materialfv)(face, pname, params); + break; + } +} +#endif + +void GL_APIENTRY EXTFN(Materialxv)(GLenum face, GLenum pname, const GLfixed* params) { + GLfloat f[4]; + switch (face) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_FRONT_AND_BACK: + break; + } + switch (pname) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_AMBIENT_AND_DIFFUSE: + xv2fv(params, CCV(ambientMaterial), 4); + xv2fv(params, CCV(diffuseMaterial), 4); + FNPTR(Materialfv)(face, pname, CCV(ambientMaterial)); + break; + case GL_AMBIENT: + xv2fv(params, CCV(ambientMaterial), 4); + FNPTR(Materialfv)(face, pname, CCV(ambientMaterial)); + break; + case GL_DIFFUSE: + xv2fv(params, CCV(diffuseMaterial), 4); + FNPTR(Materialfv)(face, pname, CCV(diffuseMaterial)); + break; + case GL_SPECULAR: + case GL_EMISSION: + xv2fv(params, f, 4); + FNPTR(Materialfv)(face, pname, f); + break; + case GL_SHININESS: + f[0] = x2f(params[0]); + FNPTR(Materialfv)(face, pname, f); + break; + } +} + +#ifdef ALEXGL_PROVIDE_COMMON +#ifdef ALEXGL_PROVIDE_1_1 +void GL_APIENTRY EXTFN(GetMaterialfv)(GLenum face, GLenum pname, GLfloat* params) { + switch (face) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_FRONT: + case GL_BACK: + break; + } + switch (pname) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_AMBIENT: + case GL_DIFFUSE: + case GL_SPECULAR: + case GL_EMISSION: + FNPTR(GetMaterialfv)(face, pname, params); + break; + case GL_SHININESS: + FNPTR(GetMaterialfv)(face, pname, params); + break; + } +} +#endif +#endif + +#ifdef ALEXGL_PROVIDE_1_1 +GL_API void GL_APIENTRY EXTFN(GetMaterialxv)(GLenum face, GLenum pname, GLfixed* params) { + GLfloat f[4]; + switch (face) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_FRONT: + case GL_BACK: + break; + } + switch (pname) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_AMBIENT: + case GL_DIFFUSE: + case GL_SPECULAR: + case GL_EMISSION: + FNPTR(GetMaterialfv)(face, pname, f); + fv2xv(f, params, 4); + break; + case GL_SHININESS: + FNPTR(GetMaterialfv)(face, pname, f); + params[0] = f2x(f[0]); + break; + } +} +#endif + + +#ifdef ALEXGL_PROVIDE_COMMON +GL_API void GL_APIENTRY EXTFN(Lightf)(GLenum light, GLenum pname, GLfloat param) { + FNPTR(Lightf)(light, pname, param); +} +#endif + +#ifdef ALEXGL_PROVIDE_COMMON +GL_API void GL_APIENTRY EXTFN(Lightfv)(GLenum light, GLenum pname, const GLfloat* params) { + FNPTR(Lightfv)(light, pname, params); +} +#endif + +GL_API void GL_APIENTRY EXTFN(Lightx)(GLenum light, GLenum pname, GLfixed param) { + FNPTR(Lightf)(light, pname, x2f(param)); +} + +GL_API void GL_APIENTRY EXTFN(Lightxv)(GLenum light, GLenum pname, const GLfixed* params) { + GLfloat f[4]; + xv2fv(params, f, 4); + FNPTR(Lightfv)(light, pname, f); +} + +#ifdef ALEXGL_PROVIDE_COMMON +#ifdef ALEXGL_PROVIDE_1_1 +GL_API void GL_APIENTRY EXTFN(GetLightfv)(GLenum light, GLenum pname, GLfloat* params) { + FNPTR(GetLightfv)(light, pname, params); +} +#endif +#endif + +#ifdef ALEXGL_PROVIDE_1_1 +GL_API void GL_APIENTRY EXTFN(GetLightxv)(GLenum light, GLenum pname, GLfixed* params) { + GLfloat f[4]; + FNPTR(GetLightfv)(light, pname, f); + fv2xv(f, params, 4); +} +#endif + +#ifdef ALEXGL_PROVIDE_COMMON +GL_API void GL_APIENTRY EXTFN(LightModelf)(GLenum pname, GLfloat param) { + if (pname != GL_LIGHT_MODEL_TWO_SIDE) { + INTFN(SetError)(GL_INVALID_ENUM); + return; + } + FNPTR(LightModelf)(pname, param); +} +#endif + +#ifdef ALEXGL_PROVIDE_COMMON +GL_API void GL_APIENTRY EXTFN(LightModelfv)(GLenum pname, const GLfloat* params) { + if (pname != GL_LIGHT_MODEL_TWO_SIDE && pname != GL_LIGHT_MODEL_AMBIENT) { + INTFN(SetError)(GL_INVALID_ENUM); + return; + } + FNPTR(LightModelfv)(pname, params); +} +#endif + +GL_API void GL_APIENTRY EXTFN(LightModelx)(GLenum pname, GLfixed param) { + if (pname != GL_LIGHT_MODEL_TWO_SIDE) { + INTFN(SetError)(GL_INVALID_ENUM); + return; + } + FNPTR(LightModelf)(pname, x2f(param)); +} + +GL_API void GL_APIENTRY EXTFN(LightModelxv)(GLenum pname, const GLfixed* params) { + if (pname != GL_LIGHT_MODEL_TWO_SIDE && pname != GL_LIGHT_MODEL_AMBIENT) { + INTFN(SetError)(GL_INVALID_ENUM); + return; + } + GLfloat f[4]; + xv2fv(params, f, 4); + FNPTR(LightModelfv)(pname, f); +} + +GL_API void GL_APIENTRY EXTFN(ShadeModel)(GLenum mode) { + FNPTR(ShadeModel)(mode); +} + diff --git a/es_1_1/2PdrawArray.c b/es_1_1/2PdrawArray.c new file mode 100755 index 0000000..84f4cd8 --- /dev/null +++ b/es_1_1/2PdrawArray.c @@ -0,0 +1,294 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "gl_imp.h" +#include <malloc.h> + +GL_API void GL_APIENTRY EXTFN(DrawArrays)(GLenum mode, GLint first, GLsizei count) { + if (GL_TRIANGLE_FAN < mode) { + INTFN(SetError)(GL_INVALID_ENUM); + return; + } + if (FNPTR(IsEnabled)(GL_VERTEX_ARRAY) == GL_FALSE) return; + if (count < 0) { + INTFN(SetError)(GL_INVALID_VALUE); + return; + } else if (count == 0) { + return; + } + GLint matrixMode; + FNPTR(GetIntegerv)(GL_MATRIX_MODE, &matrixMode); +#if ALEXGL_INTERNAL_VERSION >= 110 + GLint arrayBufferBinding; + FNPTR(GetIntegerv)(GL_ARRAY_BUFFER_BINDING, &arrayBufferBinding); +#endif + static GLbyte* pBufferArea = NULL; + static GLshort* pVertexArea = NULL; + int i, j; + GLfloat matrixModelview[16]; + if (CCV(vertexArrayType) == GL_BYTE) { + pVertexArea = realloc(pVertexArea, (first + count) * CCV(vertexArraySize) * sizeof(GLshort)); + if (pVertexArea == NULL) { + INTFN(SetError)(GL_OUT_OF_MEMORY); + return; + } + GLbyte* srcBase = 0; +#if ALEXGL_INTERNAL_VERSION >= 110 + if (CCV(vertexArrayBufferBinding) != 0) { + pBufferArea = realloc(pBufferArea, count * CCV(vertexArrayStride) * sizeof(GLbyte)); + if (pBufferArea == NULL) { + INTFN(SetError)(GL_OUT_OF_MEMORY); + return; + } + FNPTR(BindBuffer)(GL_ARRAY_BUFFER, CCV(vertexArrayBufferBinding)); + FNPTR(GetBufferSubData)(GL_ARRAY_BUFFER, + (GLintptr)((GLbyte*)(CCV(vertexArrayPointer)) + + first * CCV(vertexArrayStride)), + count * CCV(vertexArrayStride), pBufferArea); + srcBase = pBufferArea; + } + FNPTR(BindBuffer)(GL_ARRAY_BUFFER, 0); +#endif + if (srcBase == 0) { + srcBase = (GLbyte*)(CCV(vertexArrayPointer)) + + first * CCV(vertexArrayStride); + } + for (j = first; j < first + count; j++) { + int k = CCV(vertexArraySize); + GLshort* dst = &(pVertexArea[j * CCV(vertexArraySize)]); + GLbyte* src = srcBase; + while (k--) { + *dst++ = (GLshort)(*src++); + } + srcBase += CCV(vertexArrayStride); + } + FNPTR(VertexPointer)(CCV(vertexArraySize), GL_SHORT, 0, pVertexArea); + } else if (CCV(vertexArrayType) == GL_FIXED) { + FNPTR(GetFloatv)(GL_MODELVIEW_MATRIX, matrixModelview); + FNPTR(MatrixMode)(GL_MODELVIEW); + FNPTR(Scalef)(1 / 65536.0F, 1 / 65536.0F, 1 / 65536.0F); + } + static GLfloat* pNormalArea = NULL; + if (FNPTR(IsEnabled)(GL_NORMAL_ARRAY) == GL_TRUE) { + if (CCV(normalArrayType) == GL_FIXED + && FNPTR(IsEnabled)(GL_NORMALIZE) == GL_FALSE + && FNPTR(IsEnabled)(GL_RESCALE_NORMAL) == GL_FALSE) { + pNormalArea = realloc(pNormalArea, (first + count) * 3 * sizeof(GLfloat)); + if (pNormalArea == NULL) { + INTFN(SetError)(GL_OUT_OF_MEMORY); + return; + } + GLfixed* srcBase = 0; +#if ALEXGL_INTERNAL_VERSION >= 110 + if (CCV(normalArrayBufferBinding) != 0) { + pBufferArea = realloc(pBufferArea, count * CCV(normalArrayStride) * sizeof(GLbyte)); + if (pBufferArea == NULL) { + INTFN(SetError)(GL_OUT_OF_MEMORY); + return; + } + FNPTR(BindBuffer)(GL_ARRAY_BUFFER, CCV(normalArrayBufferBinding)); + FNPTR(GetBufferSubData)(GL_ARRAY_BUFFER, + (GLintptr)((GLbyte*)(CCV(normalArrayPointer)) + + first * CCV(normalArrayStride)), + count * CCV(normalArrayStride), pBufferArea); + srcBase = (GLfixed*)(pBufferArea); + } + FNPTR(BindBuffer)(GL_ARRAY_BUFFER, 0); +#endif + if (srcBase == 0) { + srcBase = (GLfixed*)( + (GLbyte*)(CCV(normalArrayPointer)) + + first * CCV(normalArrayStride)); + } + for (j = first; j < first + count; j++) { + int k = 3; + GLfloat* dst = &(pNormalArea[j * 3]); + GLfixed* src = srcBase; + while (k--) { + *dst++ = (*src++) / 65536.0F; + } + srcBase = (GLfixed*)((GLbyte*)(srcBase) + + CCV(normalArrayStride)); + } + FNPTR(NormalPointer)(GL_FLOAT, 0, pNormalArea); + } + } + static GLfloat* pColorArea = NULL; + if (FNPTR(IsEnabled)(GL_COLOR_ARRAY) == GL_TRUE) { + if (CCV(colorArrayType) == GL_FIXED) { + pColorArea = realloc(pColorArea, (first + count) * 4 * sizeof(GLfloat)); + if (pColorArea == NULL) { + INTFN(SetError)(GL_OUT_OF_MEMORY); + return; + } + GLfixed* srcBase = 0; +#if ALEXGL_INTERNAL_VERSION >= 110 + if (CCV(colorArrayBufferBinding) != 0) { + pBufferArea = realloc(pBufferArea, count * CCV(colorArrayStride) * sizeof(GLbyte)); + if (pBufferArea == NULL) { + INTFN(SetError)(GL_OUT_OF_MEMORY); + return; + } + FNPTR(BindBuffer)(GL_ARRAY_BUFFER, CCV(colorArrayBufferBinding)); + FNPTR(GetBufferSubData)(GL_ARRAY_BUFFER, + (GLintptr)((GLbyte*)(CCV(colorArrayPointer)) + + first * CCV(colorArrayStride)), + count * CCV(colorArrayStride), pBufferArea); + srcBase = (GLfixed*)(pBufferArea); + } + FNPTR(BindBuffer)(GL_ARRAY_BUFFER, 0); +#endif + if (srcBase == 0) { + srcBase = (GLfixed*)( + (GLbyte*)(CCV(colorArrayPointer)) + + first * CCV(colorArrayStride)); + } + for (j = first; j < first + count; j++) { + int k = 4; + GLfloat* dst = &(pColorArea[j * 4]); + GLfixed* src = srcBase; + while (k--) { + *dst++ = (*src++) / 65536.0F; + } + srcBase = (GLfixed*)((GLbyte*)(srcBase) + + CCV(colorArrayStride)); + } + FNPTR(ColorPointer)(4, GL_FLOAT, 0, pColorArea); + } + } + static GLshort* pTexCoordArea[ALEXGL_MAX_TEXTURE_UNITS] = { NULL, NULL, NULL, NULL }; + GLfloat matrixTexture[ALEXGL_MAX_TEXTURE_UNITS][16]; + for (i = 0; i < ALEXGL_MAX_TEXTURE_UNITS; i++) { + if (CCV(texture2D[i]) != GL_TRUE || CCV(texCoordArray[i]) != GL_TRUE) continue; + if (CCV(texCoordArrayType[i]) == GL_BYTE) { + pTexCoordArea[i] = realloc(pTexCoordArea[i], (first + count) * CCV(texCoordArraySize[i]) * sizeof(GLshort)); + if (pTexCoordArea[i] == NULL) { + INTFN(SetError)(GL_OUT_OF_MEMORY); + return; + } + GLbyte* srcBase = 0; +#if ALEXGL_INTERNAL_VERSION >= 110 + if (CCV(texCoordArrayBufferBinding[i]) != 0) { + pBufferArea = realloc(pBufferArea, count * CCV(texCoordArrayStride[i]) * sizeof(GLbyte)); + if (pBufferArea == NULL) { + INTFN(SetError)(GL_OUT_OF_MEMORY); + return; + } + FNPTR(BindBuffer)(GL_ARRAY_BUFFER, CCV(texCoordArrayBufferBinding[i])); + FNPTR(GetBufferSubData)(GL_ARRAY_BUFFER, + (GLintptr)( + (GLbyte*)(CCV(texCoordArrayPointer[i])) + + first * CCV(texCoordArrayStride[i])), + count * CCV(texCoordArrayStride[i]), pBufferArea); + srcBase = pBufferArea; + } + FNPTR(BindBuffer)(GL_ARRAY_BUFFER, 0); +#endif + if (srcBase == 0) { + srcBase = (GLbyte*)(CCV(texCoordArrayPointer[i])) + + first * CCV(texCoordArrayStride[i]); + } + for (j = first; j < first + count; j++) { + int k = CCV(texCoordArraySize[i]); + GLshort* dst = &(pTexCoordArea[i][j * CCV(texCoordArraySize[i])]); + GLbyte* src = srcBase; + while (k--) { + *dst++ = (GLshort)(*src++); + } + srcBase += CCV(texCoordArrayStride[i]); + } + FNPTR(ClientActiveTexture)(GL_TEXTURE0 + i); + FNPTR(TexCoordPointer)(CCV(texCoordArraySize[i]), GL_SHORT, 0, pTexCoordArea[i]); + } else if (CCV(texCoordArrayType[i]) == GL_FIXED) { + FNPTR(MatrixMode)(GL_TEXTURE); + FNPTR(ActiveTexture)(GL_TEXTURE0 + i); + FNPTR(GetFloatv)(GL_TEXTURE_MATRIX, matrixTexture[i]); + FNPTR(Scalef)(1 / 65536.0F, 1 / 65536.0F, 1 / 65536.0F); + } + } + if (mode == GL_POINTS && CCV(pointSizeArrayOES) == GL_TRUE) { + GLbyte* srcBase = 0; +#if ALEXGL_INTERNAL_VERSION >= 110 + if (CCV(pointSizeArrayBufferBindingOES) != 0) { + pBufferArea = realloc(pBufferArea, count * CCV(pointSizeArrayStrideOES) * sizeof(GLbyte)); + if (pBufferArea == NULL) { + INTFN(SetError)(GL_OUT_OF_MEMORY); + return; + } + FNPTR(BindBuffer)(GL_ARRAY_BUFFER, CCV(pointSizeArrayBufferBindingOES)); + FNPTR(GetBufferSubData)(GL_ARRAY_BUFFER, + (GLintptr)((GLbyte*)(CCV(pointSizeArrayPointerOES)) + + first * CCV(pointSizeArrayStrideOES)), + count * CCV(pointSizeArrayStrideOES), pBufferArea); + srcBase = pBufferArea; + } + FNPTR(BindBuffer)(GL_ARRAY_BUFFER, 0); +#endif + if (srcBase == 0) { + srcBase = (GLbyte*)(CCV(pointSizeArrayPointerOES)) + + first * CCV(pointSizeArrayStrideOES); + } + if (CCV(pointSizeArrayTypeOES) == GL_FLOAT) { + for (i = first; i < first + count; i++) { + FNPTR(PointSize)(*((GLfloat*)(srcBase))); + FNPTR(DrawArrays)(mode, i, 1); + srcBase += CCV(pointSizeArrayStrideOES); + } + } else { + for (i = first; i < first + count; i++) { + FNPTR(PointSize)(x2f(*((GLfixed*)(srcBase)))); + FNPTR(DrawArrays)(mode, i, 1); + srcBase += CCV(pointSizeArrayStrideOES); + } + } + } else { + FNPTR(DrawArrays)(mode, first, count); + } + if (CCV(vertexArrayType) == GL_FIXED) { + FNPTR(MatrixMode)(GL_MODELVIEW); + FNPTR(LoadMatrixf)(matrixModelview); + } + + FNPTR(MatrixMode)(GL_TEXTURE); + for (i = 0; i < ALEXGL_MAX_TEXTURE_UNITS; i++) { + if (CCV(texture2D[i]) != GL_TRUE || CCV(texCoordArray[i]) != GL_TRUE) continue; + if (CCV(texCoordArrayType[i]) == GL_FIXED) { + FNPTR(ActiveTexture)(GL_TEXTURE0 + i); + FNPTR(LoadMatrixf)(matrixTexture[i]); + } + } + FNPTR(MatrixMode)(matrixMode); + FNPTR(ActiveTexture)(GL_TEXTURE0 + CCV(activeTexture)); + FNPTR(ClientActiveTexture)(GL_TEXTURE0 + CCV(clientActiveTexture)); +#if ALEXGL_INTERNAL_VERSION >= 110 + FNPTR(BindBuffer)(GL_ARRAY_BUFFER, arrayBufferBinding); +#endif +} diff --git a/es_1_1/2QdrawElements.c b/es_1_1/2QdrawElements.c new file mode 100755 index 0000000..8fe81a2 --- /dev/null +++ b/es_1_1/2QdrawElements.c @@ -0,0 +1,398 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "gl_imp.h" +#include <malloc.h> +#if defined(PROVIDING_OES_element_index_uint) +#define GL_UNSIGNED_INT 0x1405 +#endif + +GL_API void GL_APIENTRY EXTFN(DrawElements)(GLenum mode, GLsizei count, GLenum type, + const GLvoid* indices) { + int i, j; + if (GL_TRIANGLE_FAN < mode) { + INTFN(SetError)(GL_INVALID_ENUM); + return; + } + switch (type) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_UNSIGNED_BYTE: + case GL_UNSIGNED_SHORT: +#if defined(PROVIDING_OES_element_index_uint) + case GL_UNSIGNED_INT: +#endif + break; + } + if (FNPTR(IsEnabled)(GL_VERTEX_ARRAY) == GL_FALSE) return; + if (count < 0) { + INTFN(SetError)(GL_INVALID_VALUE); + return; + } else if (count == 0) { + return; + } + GLint matrixMode; + FNPTR(GetIntegerv)(GL_MATRIX_MODE, &matrixMode); +#if ALEXGL_INTERNAL_VERSION >= 110 + GLint arrayBufferBinding; + GLint elementArrayBufferBinding; + FNPTR(GetIntegerv)(GL_ARRAY_BUFFER_BINDING, &arrayBufferBinding); + FNPTR(GetIntegerv)(GL_ELEMENT_ARRAY_BUFFER_BINDING, &elementArrayBufferBinding); +#endif + static GLbyte* pBufferArea = NULL; + int maxIndex = 0; + switch (type) { + case GL_UNSIGNED_BYTE: { + const GLubyte* ptr = 0; +#if ALEXGL_INTERNAL_VERSION >= 110 + static GLubyte* pElementArea = NULL; + if (elementArrayBufferBinding != 0) { + pElementArea = realloc(pElementArea, count * sizeof(GLubyte)); + if (pElementArea == NULL) { + INTFN(SetError)(GL_OUT_OF_MEMORY); + return; + } + FNPTR(GetBufferSubData)(GL_ELEMENT_ARRAY_BUFFER, (GLintptr)(indices), + count * sizeof(GLubyte), pElementArea); + ptr = pElementArea; + } +#endif + if (ptr == 0) { + ptr = (const GLubyte*)(indices); + } + for (i = 0; i < count; i++) { + if ((int)(ptr[i]) > maxIndex) maxIndex = (int)(ptr[i]); + } + } + break; + case GL_UNSIGNED_SHORT: { + const GLushort* ptr = 0; +#if ALEXGL_INTERNAL_VERSION >= 110 + static GLushort* pElementArea = NULL; + if (elementArrayBufferBinding != 0) { + pElementArea = realloc(pElementArea, count * sizeof(GLushort)); + if (pElementArea == NULL) { + INTFN(SetError)(GL_OUT_OF_MEMORY); + return; + } + FNPTR(GetBufferSubData)(GL_ELEMENT_ARRAY_BUFFER, (GLintptr)(indices), + count * sizeof(GLushort), pElementArea); + ptr = pElementArea; + } +#endif + if (ptr == 0) { + ptr = (const GLushort*)(indices); + } + for (i = 0; i < count; i++) { + if ((int)(ptr[i]) > maxIndex) maxIndex = (int)(ptr[i]); + } + } + break; +#if defined(PROVIDING_OES_element_index_uint) + case GL_UNSIGNED_INT: { + const GLuint* ptr = 0; +#if ALEXGL_INTERNAL_VERSION >= 110 + static GLuint* pElementArea = NULL; + if (elementArrayBufferBinding != 0) { + pElementArea = realloc(pElementArea, count * sizeof(GLuint)); + if (pElementArea == NULL) { + INTFN(SetError)(GL_OUT_OF_MEMORY); + return; + } + FNPTR(GetBufferSubData)(GL_ELEMENT_ARRAY_BUFFER, (GLintptr)(indices), + count * sizeof(GLuint), pElementArea); + ptr = pElementArea; + } +#endif + if (ptr == 0) { + ptr = (const GLuint*)(indices); + } + for (i = 0; i < count; i++) { + if ((int)(ptr[i]) > maxIndex) maxIndex = (int)(ptr[i]); + } + } + break; +#endif + } + static GLshort* pVertexArea = NULL; + GLfloat matrixModelview[16]; + if (CCV(vertexArrayType) == GL_BYTE) { + pVertexArea = realloc(pVertexArea, (maxIndex + 1) * CCV(vertexArraySize) * sizeof(GLushort)); + if (pVertexArea == NULL) { + INTFN(SetError)(GL_OUT_OF_MEMORY); + return; + } + GLbyte* srcBase = 0; +#if ALEXGL_INTERNAL_VERSION >= 110 + if (CCV(vertexArrayBufferBinding) != 0) { + pBufferArea = realloc(pBufferArea, (maxIndex + 1) * CCV(vertexArrayStride) * sizeof(GLubyte)); + if (pBufferArea == NULL) { + INTFN(SetError)(GL_OUT_OF_MEMORY); + return; + } + FNPTR(BindBuffer)(GL_ARRAY_BUFFER, CCV(vertexArrayBufferBinding)); + FNPTR(GetBufferSubData)(GL_ARRAY_BUFFER, + (GLintptr)((GLbyte*)(CCV(vertexArrayPointer))), + (maxIndex + 1) * CCV(vertexArrayStride), pBufferArea); + srcBase = pBufferArea; + } + FNPTR(BindBuffer)(GL_ARRAY_BUFFER, 0); +#endif + if (srcBase == 0) { + srcBase = (GLbyte*)(CCV(vertexArrayPointer)); + } + for (j = 0; j < maxIndex + 1; j++) { + int k = CCV(vertexArraySize); + GLshort* dst = &(pVertexArea[j * CCV(vertexArraySize)]); + GLbyte* src = srcBase; + while (k--) { + *dst++ = (GLshort)(*src++); + } + srcBase += CCV(vertexArrayStride); + } + FNPTR(VertexPointer)(CCV(vertexArraySize), GL_SHORT, 0, pVertexArea); + } else if (CCV(vertexArrayType) == GL_FIXED) { + FNPTR(GetFloatv)(GL_MODELVIEW_MATRIX, matrixModelview); + FNPTR(MatrixMode)(GL_MODELVIEW); + FNPTR(Scalef)(1 / 65536.0F, 1 / 65536.0F, 1 / 65536.0F); + } + static GLfloat* pNormalArea = NULL; + if (FNPTR(IsEnabled)(GL_NORMAL_ARRAY) == GL_TRUE) { + if (CCV(normalArrayType) == GL_FIXED) { + pNormalArea = realloc(pNormalArea, (maxIndex + 1) * 3 * sizeof(GLfloat)); + if (pNormalArea == NULL) { + INTFN(SetError)(GL_OUT_OF_MEMORY); + return; + } + GLfixed* srcBase = 0; +#if ALEXGL_INTERNAL_VERSION >= 110 + if (CCV(normalArrayBufferBinding) != 0) { + pBufferArea = realloc(pBufferArea, (maxIndex + 1) * CCV(normalArrayStride) * sizeof(GLubyte)); + if (pBufferArea == NULL) { + INTFN(SetError)(GL_OUT_OF_MEMORY); + return; + } + FNPTR(BindBuffer)(GL_ARRAY_BUFFER, CCV(normalArrayBufferBinding)); + FNPTR(GetBufferSubData)(GL_ARRAY_BUFFER, + (GLintptr)((GLbyte*)(CCV(normalArrayPointer))), + (maxIndex + 1) * CCV(normalArrayStride), pBufferArea); + srcBase = (GLfixed*)(pBufferArea); + } + FNPTR(BindBuffer)(GL_ARRAY_BUFFER, 0); +#endif + if (srcBase == 0) { + srcBase = (GLfixed*)( + (GLbyte*)(CCV(normalArrayPointer))); + } + for (j = 0; j < maxIndex + 1; j++) { + int k = 3; + GLfloat* dst = &(pNormalArea[j * 3]); + GLfixed* src = srcBase; + while (k--) { + *dst++ = (*src++) / 65536.0F; + } + srcBase = (GLfixed*)((GLbyte*)(srcBase) + + CCV(normalArrayStride)); + } + FNPTR(NormalPointer)(GL_FLOAT, 0, pNormalArea); + } + } + static GLfloat* pColorArea = NULL; + if (FNPTR(IsEnabled)(GL_COLOR_ARRAY) == GL_TRUE) { + if (CCV(colorArrayType) == GL_FIXED) { + pColorArea = realloc(pColorArea, (maxIndex + 1) * 4 * sizeof(GLfloat)); + GLfixed* srcBase = 0; +#if ALEXGL_INTERNAL_VERSION >= 110 + if (CCV(colorArrayBufferBinding) != 0) { + pBufferArea = realloc(pBufferArea, (maxIndex + 1) * CCV(colorArrayStride) * sizeof(GLubyte)); + if (pBufferArea == NULL) { + INTFN(SetError)(GL_OUT_OF_MEMORY); + return; + } + FNPTR(BindBuffer)(GL_ARRAY_BUFFER, CCV(colorArrayBufferBinding)); + FNPTR(GetBufferSubData)(GL_ARRAY_BUFFER, + (GLintptr)((GLbyte*)(CCV(colorArrayPointer))), + (maxIndex + 1) * CCV(colorArrayStride), pBufferArea); + srcBase = (GLfixed*)(pBufferArea); + } + FNPTR(BindBuffer)(GL_ARRAY_BUFFER, 0); +#endif + if (srcBase == 0) { + srcBase = (GLfixed*)( + (GLbyte*)(CCV(colorArrayPointer))); + } + for (j = 0; j < maxIndex + 1; j++) { + int k = 4; + GLfloat* dst = &(pColorArea[j * 4]); + GLfixed* src = srcBase; + while (k--) { + *dst++ = (*src++) / 65536.0F; + } + srcBase = (GLfixed*)((GLbyte*)(srcBase) + + CCV(colorArrayStride)); + } + FNPTR(ColorPointer)(4, GL_FLOAT, 0, pColorArea); + } + } + static GLshort* pTexCoordArea[ALEXGL_MAX_TEXTURE_UNITS] = { NULL, NULL, NULL, NULL }; + GLfloat matrixTexture[ALEXGL_MAX_TEXTURE_UNITS][16]; + for (i = 0; i < ALEXGL_MAX_TEXTURE_UNITS; i++) { + if (CCV(texture2D[i]) != GL_TRUE || CCV(texCoordArray[i]) != GL_TRUE) continue; + if (CCV(texCoordArrayType[i]) == GL_BYTE) { + pTexCoordArea[i] = realloc(pTexCoordArea[i], + (maxIndex + 1) * CCV(texCoordArraySize[i]) * sizeof(GLshort)); + if (pTexCoordArea[i] == NULL) { + INTFN(SetError)(GL_OUT_OF_MEMORY); + return; + } + GLbyte* srcBase = 0; +#if ALEXGL_INTERNAL_VERSION >= 110 + if (CCV(texCoordArrayBufferBinding[i]) != 0) { + pBufferArea = realloc(pBufferArea, (maxIndex + 1) * CCV(texCoordArrayStride[i]) * sizeof(GLubyte)); + if (pBufferArea == NULL) { + INTFN(SetError)(GL_OUT_OF_MEMORY); + return; + } + FNPTR(BindBuffer)(GL_ARRAY_BUFFER, CCV(texCoordArrayBufferBinding[i])); + FNPTR(GetBufferSubData)(GL_ARRAY_BUFFER, + (GLintptr)( + (GLbyte*)(CCV(texCoordArrayPointer[i]))), + (maxIndex + 1) * CCV(texCoordArrayStride[i]), pBufferArea); + srcBase = pBufferArea; + } + FNPTR(BindBuffer)(GL_ARRAY_BUFFER, 0); +#endif + if (srcBase == 0) { + srcBase = (GLbyte*)(CCV(texCoordArrayPointer[i])); + } + for (j = 0; j < maxIndex + 1; j++) { + int k = CCV(texCoordArraySize[i]); + GLshort* dst = &(pTexCoordArea[i][j * CCV(texCoordArraySize[i])]); + GLbyte* src = srcBase; + while (k--) { + *dst++ = (GLshort)(*src++); + } + srcBase += CCV(texCoordArrayStride[i]); + } + FNPTR(ClientActiveTexture)(GL_TEXTURE0 + i); + FNPTR(TexCoordPointer)(CCV(texCoordArraySize[i]), GL_SHORT, 0, pTexCoordArea[i]); + } else if (CCV(texCoordArrayType[i]) == GL_FIXED) { + FNPTR(MatrixMode)(GL_TEXTURE); + FNPTR(ActiveTexture)(GL_TEXTURE0 + i); + FNPTR(GetFloatv)(GL_TEXTURE_MATRIX, matrixTexture[i]); + FNPTR(Scalef)(1 / 65536.0F, 1 / 65536.0F, 1 / 65536.0F); + } + } + if (mode == GL_POINTS && CCV(pointSizeArrayOES) == GL_TRUE) { + GLbyte* srcBase = 0; +#if ALEXGL_INTERNAL_VERSION >= 110 + if (CCV(pointSizeArrayBufferBindingOES) != 0) { + pBufferArea = realloc(pBufferArea, (maxIndex + 1) * CCV(pointSizeArrayStrideOES) * sizeof(GLubyte)); + if (pBufferArea == NULL) { + INTFN(SetError)(GL_OUT_OF_MEMORY); + return; + } + FNPTR(BindBuffer)(GL_ARRAY_BUFFER, CCV(pointSizeArrayBufferBindingOES)); + FNPTR(GetBufferSubData)(GL_ARRAY_BUFFER, + (GLintptr)((GLbyte*)(CCV(pointSizeArrayPointerOES))), + (maxIndex + 1) * CCV(pointSizeArrayStrideOES), pBufferArea); + srcBase = pBufferArea; + } + FNPTR(BindBuffer)(GL_ARRAY_BUFFER, 0); +#endif + if (srcBase == 0) { + srcBase = (GLbyte*)(CCV(pointSizeArrayPointerOES)); + } + switch (type) { + case GL_UNSIGNED_BYTE: { + const GLubyte* ptr = (const GLubyte*)(indices); + for (i = 0; i < count; i++) { + if (CCV(pointSizeArrayTypeOES) == GL_FLOAT) { + FNPTR(PointSize)(*((GLfloat*)(srcBase) + ptr[i])); + } else { + FNPTR(PointSize)(x2f(*((GLfixed*)(srcBase) + ptr[i]))); + } + FNPTR(DrawElements)(mode, 1, type, (const GLvoid*)(ptr + i)); + } + } + break; + case GL_UNSIGNED_SHORT: { + const GLushort* ptr = (const GLushort*)(indices); + for (i = 0; i < count; i++) { + if (CCV(pointSizeArrayTypeOES) == GL_FLOAT) { + FNPTR(PointSize)(*((GLfloat*)(srcBase) + ptr[i])); + } else { + FNPTR(PointSize)(x2f(*((GLfixed*)(srcBase) + ptr[i]))); + } + FNPTR(DrawElements)(mode, 1, type, (const GLvoid*)(ptr + i)); + } + } + break; +#if defined(PROVIDING_OES_element_index_uint) + case GL_UNSIGNED_INT: { + const GLuint* ptr = (const GLuint*)(indices); + for (i = 0; i < count; i++) { + if (CCV(pointSizeArrayTypeOES) == GL_FLOAT) { + FNPTR(PointSize)(*((GLfloat*)(srcBase) + ptr[i])); + } else { + FNPTR(PointSize)(x2f(*((GLfixed*)(srcBase) + ptr[i]))); + } + FNPTR(DrawElements)(mode, 1, type, (const GLvoid*)(ptr + i)); + } + } + break; +#endif + } + } else { + FNPTR(DrawElements)(mode, count, type, indices); + } + if (CCV(vertexArrayType) == GL_FIXED) { + FNPTR(MatrixMode)(GL_MODELVIEW); + FNPTR(LoadMatrixf)(matrixModelview); + } + + FNPTR(MatrixMode)(GL_TEXTURE); + for (i = 0; i < ALEXGL_MAX_TEXTURE_UNITS; i++) { + if (CCV(texture2D[i]) != GL_TRUE || CCV(texCoordArray[i]) != GL_TRUE) continue; + if (CCV(texCoordArrayType[i]) == GL_FIXED) { + FNPTR(ActiveTexture)(GL_TEXTURE0 + i); + FNPTR(LoadMatrixf)(matrixTexture[i]); + } + } + FNPTR(MatrixMode)(matrixMode); + FNPTR(ActiveTexture)(GL_TEXTURE0 + CCV(activeTexture)); + FNPTR(ClientActiveTexture)(GL_TEXTURE0 + CCV(clientActiveTexture)); +#if ALEXGL_INTERNAL_VERSION >= 110 + FNPTR(BindBuffer)(GL_ARRAY_BUFFER, arrayBufferBinding); + FNPTR(BindBuffer)(GL_ELEMENT_ARRAY_BUFFER, elementArrayBufferBinding); +#endif +} diff --git a/es_1_1/33point.c b/es_1_1/33point.c new file mode 100755 index 0000000..e0b6bbd --- /dev/null +++ b/es_1_1/33point.c @@ -0,0 +1,110 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "gl_imp.h" + +#ifdef ALEXGL_PROVIDE_COMMON +GL_API void GL_APIENTRY EXTFN(PointSize)(GLfloat size) { + FNPTR(PointSize)(size); +} +#endif + +GL_API void GL_APIENTRY EXTFN(PointSizex)(GLfixed size) { + FNPTR(PointSize)(x2f(size)); +} + +#ifdef ALEXGL_PROVIDE_COMMON +#ifdef ALEXGL_PROVIDE_1_1 +GL_API void GL_APIENTRY EXTFN(PointParameterf)(GLenum pname, GLfloat param) { + switch (pname) { + case GL_POINT_SIZE_MIN: + case GL_POINT_SIZE_MAX: + case GL_POINT_FADE_THRESHOLD_SIZE: + FNPTR(PointParameterf)(pname, param); + break; + default: + INTFN(SetError)(GL_INVALID_ENUM); + break; + } +} +#endif +#endif + +#ifdef ALEXGL_PROVIDE_COMMON +#ifdef ALEXGL_PROVIDE_1_1 +GL_API void GL_APIENTRY EXTFN(PointParameterfv)(GLenum pname, const GLfloat* params) { + switch (pname) { + case GL_POINT_SIZE_MIN: + case GL_POINT_SIZE_MAX: + case GL_POINT_FADE_THRESHOLD_SIZE: + case GL_POINT_DISTANCE_ATTENUATION: + FNPTR(PointParameterfv)(pname, params); + break; + default: + INTFN(SetError)(GL_INVALID_ENUM); + break; + } +} +#endif +#endif + +#ifdef ALEXGL_PROVIDE_1_1 +GL_API void GL_APIENTRY EXTFN(PointParameterx)(GLenum pname, GLfixed param) { + switch (pname) { + case GL_POINT_SIZE_MIN: + case GL_POINT_SIZE_MAX: + case GL_POINT_FADE_THRESHOLD_SIZE: + FNPTR(PointParameterf)(pname, x2f(param)); + break; + default: + INTFN(SetError)(GL_INVALID_ENUM); + break; + } +} +#endif + +#ifdef ALEXGL_PROVIDE_1_1 +GL_API void GL_APIENTRY EXTFN(PointParameterxv)(GLenum pname, const GLfixed* params) { + GLfloat f[3]; + switch (pname) { + case GL_POINT_SIZE_MIN: + case GL_POINT_SIZE_MAX: + case GL_POINT_FADE_THRESHOLD_SIZE: + case GL_POINT_DISTANCE_ATTENUATION: + xv2fv(params, f, 3); + FNPTR(PointParameterfv)(pname, f); + break; + default: + INTFN(SetError)(GL_INVALID_ENUM); + break; + } +} +#endif diff --git a/es_1_1/34line.c b/es_1_1/34line.c new file mode 100755 index 0000000..7dca892 --- /dev/null +++ b/es_1_1/34line.c @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "gl_imp.h" + + +#ifdef ALEXGL_PROVIDE_COMMON +GL_API void GL_APIENTRY EXTFN(LineWidth)(GLfloat width) { + FNPTR(LineWidth)(width); +} +#endif + +GL_API void GL_APIENTRY EXTFN(LineWidthx)(GLfixed width) { + FNPTR(LineWidth)(x2f(width)); +} diff --git a/es_1_1/35polygon.c b/es_1_1/35polygon.c new file mode 100755 index 0000000..ebc299c --- /dev/null +++ b/es_1_1/35polygon.c @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "gl_imp.h" + + +GL_API void GL_APIENTRY EXTFN(CullFace)(GLenum mode) { + FNPTR(CullFace)(mode); +} + +GL_API void GL_APIENTRY EXTFN(FrontFace)(GLenum mode) { + FNPTR(FrontFace)(mode); +} + +#ifdef ALEXGL_PROVIDE_COMMON +GL_API void GL_APIENTRY EXTFN(PolygonOffset)(GLfloat factor, GLfloat units) { + FNPTR(PolygonOffset)(factor, units); +} +#endif + +GL_API void GL_APIENTRY EXTFN(PolygonOffsetx)(GLfixed factor, GLfixed units) { + FNPTR(PolygonOffset)(x2f(factor), x2f(units)); +} diff --git a/es_1_1/36pixel.c b/es_1_1/36pixel.c new file mode 100755 index 0000000..1e29dce --- /dev/null +++ b/es_1_1/36pixel.c @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "gl_imp.h" + + +GL_API void GL_APIENTRY EXTFN(PixelStorei)(GLenum pname, GLint param) { + if (pname != GL_PACK_ALIGNMENT && pname != GL_UNPACK_ALIGNMENT) { + INTFN(SetError)(GL_INVALID_ENUM); + return; + } + FNPTR(PixelStorei)(pname, param); +} diff --git a/es_1_1/37texture.c b/es_1_1/37texture.c new file mode 100755 index 0000000..9a3edea --- /dev/null +++ b/es_1_1/37texture.c @@ -0,0 +1,701 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "gl_imp.h" +#include <GLES/glext.h> + + +#if ! defined(GL_COORD_REPLACE) +#define GL_COORD_REPLACE GL_COORD_REPLACE_OES +#endif + + +static const GLint INTFN(mapFormat)[] = { + 0, + GL_LUMINANCE, + GL_LUMINANCE_ALPHA, + GL_RGB, + GL_RGBA +}; + +GL_API void GL_APIENTRY EXTFN(TexImage2D)(GLenum target, + GLint level, GLint internalformat, GLsizei width, GLsizei height, + GLint border, GLenum format, GLenum type, const GLvoid* pixels) { + int iMaxSize; + if (1 <= internalformat && internalformat <= 4) { + internalformat = INTFN(mapFormat)[internalformat]; + } + if (1 <= format && format <= 4) { + format = INTFN(mapFormat)[format]; + } + switch (target) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_TEXTURE_2D: + FNPTR(GetIntegerv)(GL_MAX_TEXTURE_SIZE, &iMaxSize); + break; +#if defined(PROVIDING_OES_texture_cube_map) + case GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES: + if (width != height) { + INTFN(SetError)(GL_INVALID_VALUE); + return; + } + FNPTR(GetIntegerv)(GL_MAX_CUBE_MAP_TEXTURE_SIZE_OES, &iMaxSize); + break; +#endif + } + if (width < 0 || iMaxSize < width || height < 0 || iMaxSize < height) { + INTFN(SetError)(GL_INVALID_VALUE); + return; + } + if (format < GL_ALPHA || GL_LUMINANCE_ALPHA < format + || (type != GL_UNSIGNED_BYTE && type != GL_UNSIGNED_SHORT_4_4_4_4 && + type != GL_UNSIGNED_SHORT_5_5_5_1 && type != GL_UNSIGNED_SHORT_5_6_5)) { + INTFN(SetError)(GL_INVALID_ENUM); + return; + } + if (internalformat < GL_ALPHA || GL_LUMINANCE_ALPHA < internalformat + || border != 0) { + INTFN(SetError)(GL_INVALID_VALUE); + return; + } + if (internalformat != (GLint)format) { + INTFN(SetError)(GL_INVALID_OPERATION); + return; + } + + FNPTR(TexImage2D)(target, level, internalformat, width, height, border, format, type, pixels); +} + +GL_API void GL_APIENTRY EXTFN(TexSubImage2D)(GLenum target, + GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, + GLenum format, GLenum type, const GLvoid* pixels) { + int iMaxSize; + if (1 <= format && format <= 4) { + format = INTFN(mapFormat)[format]; + } + switch (target) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_TEXTURE_2D: + FNPTR(GetIntegerv)(GL_MAX_TEXTURE_SIZE, &iMaxSize); + break; +#if defined(PROVIDING_OES_texture_cube_map) + case GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES: + if (width != height) { + INTFN(SetError)(GL_INVALID_VALUE); + return; + } + FNPTR(GetIntegerv)(GL_MAX_CUBE_MAP_TEXTURE_SIZE_OES, &iMaxSize); + break; +#endif + } + if (format < GL_ALPHA || GL_LUMINANCE_ALPHA < format + || (type != GL_UNSIGNED_BYTE && type != GL_UNSIGNED_SHORT_4_4_4_4 && + type != GL_UNSIGNED_SHORT_5_5_5_1 && type != GL_UNSIGNED_SHORT_5_6_5)) { + INTFN(SetError)(GL_INVALID_ENUM); + return; + } + FNPTR(TexSubImage2D)(target, level, xoffset, yoffset, width, height, format, type, pixels); +} + +GL_API void GL_APIENTRY EXTFN(CopyTexImage2D)(GLenum target, + GLint level, GLenum internalformat, + GLint x, GLint y, GLsizei width, GLsizei height, GLint border) { + int iMaxSize; + if (1 <= internalformat && internalformat <= 4) { + internalformat = INTFN(mapFormat)[internalformat]; + } + switch (target) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_TEXTURE_2D: + FNPTR(GetIntegerv)(GL_MAX_TEXTURE_SIZE, &iMaxSize); + break; +#if defined(PROVIDING_OES_texture_cube_map) + case GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES: + if (width != height) { + INTFN(SetError)(GL_INVALID_VALUE); + return; + } + FNPTR(GetIntegerv)(GL_MAX_CUBE_MAP_TEXTURE_SIZE_OES, &iMaxSize); + break; +#endif + } + if (internalformat < GL_ALPHA || GL_LUMINANCE_ALPHA < internalformat) { + INTFN(SetError)(GL_INVALID_ENUM); + return; + } + if (border != 0) { + INTFN(SetError)(GL_INVALID_VALUE); + return; + } + FNPTR(CopyTexImage2D)(target, level, internalformat, x, y, width, height, border); +} + +GL_API void GL_APIENTRY EXTFN(CopyTexSubImage2D)(GLenum target, + GLint level, GLint xoffset, GLint yoffset, + GLint x, GLint y, GLsizei width, GLsizei height) { + int iMaxSize; + switch (target) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_TEXTURE_2D: + FNPTR(GetIntegerv)(GL_MAX_TEXTURE_SIZE, &iMaxSize); + break; +#if defined(PROVIDING_OES_texture_cube_map) + case GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES: + if (width != height) { + INTFN(SetError)(GL_INVALID_VALUE); + return; + } + FNPTR(GetIntegerv)(GL_MAX_CUBE_MAP_TEXTURE_SIZE_OES, &iMaxSize); + break; +#endif + } + FNPTR(CopyTexSubImage2D)(target, level, xoffset, yoffset, x, y, width, height); +} + +#ifdef ALEXGL_PROVIDE_COMMON +GL_API void GL_APIENTRY EXTFN(TexParameterf)(GLenum target, GLenum pname, GLfloat param) { + GLint iparam = (int)(param); + GLfloat error = param - iparam; + if (error != 0.0F) { + INTFN(SetError)(GL_INVALID_ENUM); + return; + } + EXTFN(TexParameterx)(target, pname, iparam); +} +#endif + +GL_API void GL_APIENTRY EXTFN(TexParameterx)(GLenum target, GLenum pname, GLfixed param) { + switch (target) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_TEXTURE_2D: +#if defined(PROVIDING_OES_texture_cube_map) + case GL_TEXTURE_CUBE_MAP_OES: +#endif + break; + } + switch (pname) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_TEXTURE_MIN_FILTER: + switch (param) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_NEAREST: + case GL_LINEAR: + case GL_NEAREST_MIPMAP_NEAREST: + case GL_LINEAR_MIPMAP_NEAREST: + case GL_NEAREST_MIPMAP_LINEAR: + case GL_LINEAR_MIPMAP_LINEAR: + break; + } + break; + case GL_TEXTURE_MAG_FILTER: + switch (param) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_NEAREST: + case GL_LINEAR: + break; + } + break; + case GL_TEXTURE_WRAP_S: + case GL_TEXTURE_WRAP_T: + switch (param) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_CLAMP_TO_EDGE: + case GL_REPEAT: +#if defined(PROVIDING_OES_texture_mirrored_repeat) + case GL_MIRRORED_REPEAT_OES: +#endif + break; + } + break; + case GL_GENERATE_MIPMAP: + switch (param) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_TRUE: + case GL_FALSE: + break; + } + break; + } + FNPTR(TexParameteri)(target, pname, param); +} + +#ifdef ALEXGL_PROVIDE_1_1 +GL_API void GL_APIENTRY EXTFN(TexParameteri)(GLenum target, GLenum pname, GLint param) { + EXTFN(TexParameterx)(target, pname, param); +} +#endif + +#ifdef ALEXGL_PROVIDE_COMMON +#ifdef ALEXGL_PROVIDE_1_1 +GL_API void GL_APIENTRY EXTFN(TexParameterfv)(GLenum target, GLenum pname, const GLfloat* params) { + GLint iparam = (int)(*params); + GLfloat error = *params - iparam; + if (error != 0.0F) { + INTFN(SetError)(GL_INVALID_ENUM); + return; + } + EXTFN(TexParameterx)(target, pname, iparam); +} +#endif +#endif + +#ifdef ALEXGL_PROVIDE_1_1 +GL_API void GL_APIENTRY EXTFN(TexParameterxv)(GLenum target, GLenum pname, const GLfixed* params) { + EXTFN(TexParameterx)(target, pname, *params); +} +#endif + +#ifdef ALEXGL_PROVIDE_1_1 +GL_API void GL_APIENTRY EXTFN(TexParameteriv)(GLenum target, GLenum pname, const GLint* params) { + EXTFN(TexParameterx)(target, pname, *params); +} +#endif + +#ifdef ALEXGL_PROVIDE_COMMON +#ifdef ALEXGL_PROVIDE_1_1 +GL_API void GL_APIENTRY EXTFN(GetTexParameterfv)(GLenum target, GLenum pname, GLfloat* params) { + switch (target) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_TEXTURE_2D: +#if defined(PROVIDING_OES_texture_cube_map) + case GL_TEXTURE_CUBE_MAP_OES: +#endif + break; + } + switch (pname) { + case GL_TEXTURE_MIN_FILTER: + case GL_TEXTURE_MAG_FILTER: + case GL_TEXTURE_WRAP_S: + case GL_TEXTURE_WRAP_T: +#if ALEXGL_INTERNAL_VERSION >= 110 + case GL_GENERATE_MIPMAP: +#endif + FNPTR(GetTexParameterfv)(target, pname, params); + break; + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + } +} +#endif +#endif + +#ifdef ALEXGL_PROVIDE_1_1 +GL_API void GL_APIENTRY EXTFN(GetTexParameterxv)(GLenum target, GLenum pname, GLfixed* params) { + switch (target) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_TEXTURE_2D: +#if defined(PROVIDING_OES_texture_cube_map) + case GL_TEXTURE_CUBE_MAP_OES: +#endif + break; + } + switch (pname) { + case GL_TEXTURE_MIN_FILTER: + case GL_TEXTURE_MAG_FILTER: + case GL_TEXTURE_WRAP_S: + case GL_TEXTURE_WRAP_T: +#if ALEXGL_INTERNAL_VERSION >= 110 + case GL_GENERATE_MIPMAP: +#endif + FNPTR(GetTexParameteriv)(target, pname, params); + break; + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + } +} +#endif + +#ifdef ALEXGL_PROVIDE_1_1 +GL_API void GL_APIENTRY EXTFN(GetTexParameteriv)(GLenum target, GLenum pname, GLint* params) { + EXTFN(GetTexParameterxv)(target, pname, params); +} +#endif + +GL_API void GL_APIENTRY EXTFN(GenTextures)(GLsizei n, GLuint* textures) { + FNPTR(GenTextures)(n, textures); +} + +GL_API void GL_APIENTRY EXTFN(BindTexture)(GLenum target, GLuint texture) { + switch (target) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_TEXTURE_2D: +#if defined(PROVIDING_OES_texture_cube_map) + case GL_TEXTURE_CUBE_MAP_OES: +#endif + break; + } + FNPTR(BindTexture)(target, texture); +} + +GL_API void GL_APIENTRY EXTFN(DeleteTextures)(GLsizei n, const GLuint* textures) { + FNPTR(DeleteTextures)(n, textures); +} + +#ifdef ALEXGL_PROVIDE_1_1 +GL_API GLboolean GL_APIENTRY EXTFN(IsTexture)(GLuint texture) { + return FNPTR(IsTexture)(texture); +} +#endif + +#ifdef ALEXGL_PROVIDE_COMMON +GL_API void GL_APIENTRY EXTFN(TexEnvf)(GLenum target, GLenum pname, GLfloat param) { + if (target == GL_TEXTURE_ENV + && (pname == GL_RGB_SCALE || pname == GL_ALPHA_SCALE)) { + FNPTR(TexEnvf)(target, pname, param); + return; + } + GLint iparam = (int)(param); + GLfloat error = param - iparam; + if (error != 0.0F) { + INTFN(SetError)(GL_INVALID_ENUM); + return; + } + EXTFN(TexEnvi)(target, pname, iparam); +} +#endif + +GL_API void GL_APIENTRY EXTFN(TexEnvx)(GLenum target, GLenum pname, GLfixed param) { + if (target == GL_TEXTURE_ENV + && (pname == GL_RGB_SCALE || pname == GL_ALPHA_SCALE)) { + FNPTR(TexEnvf)(target, pname, x2f(param)); + return; + } + EXTFN(TexEnvi)(target, pname, param); +} + +#ifdef ALEXGL_PROVIDE_1_1 +GL_API void GL_APIENTRY EXTFN(TexEnvi)(GLenum target, GLenum pname, GLint param) { + switch (target) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_TEXTURE_ENV: + break; +#if defined(PROVIDING_OES_point_sprite) + case GL_POINT_SPRITE_OES: + switch (pname) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_COORD_REPLACE_OES: + FNPTR(TexEnvi)(target, GL_COORD_REPLACE, param); + return; + } + break; +#endif + } + switch (pname) { + case GL_TEXTURE_ENV_MODE: +#if ALEXGL_INTERNAL_VERSION >= 110 + if (param == GL_REPLACE || param == GL_MODULATE || param == GL_DECAL + || param == GL_BLEND || param == GL_ADD || param == GL_COMBINE) { +#else + if (param == GL_REPLACE || param == GL_MODULATE || param == GL_DECAL || param == GL_BLEND) { +#endif + FNPTR(TexEnvi)(target, pname, param); + return; + } + break; +#if ALEXGL_INTERNAL_VERSION >= 110 + case GL_COMBINE_RGB: + case GL_COMBINE_ALPHA: + case GL_OPERAND0_RGB: + case GL_OPERAND1_RGB: + case GL_OPERAND2_RGB: + case GL_OPERAND0_ALPHA: + case GL_OPERAND1_ALPHA: + case GL_OPERAND2_ALPHA: + case GL_RGB_SCALE: + case GL_ALPHA_SCALE: + FNPTR(TexEnvi)(target, pname, param); + return; + case GL_SRC0_RGB: + case GL_SRC1_RGB: + case GL_SRC2_RGB: + case GL_SRC0_ALPHA: + case GL_SRC1_ALPHA: + case GL_SRC2_ALPHA: + if (param == GL_TEXTURE || param == GL_CONSTANT || param == GL_PRIMARY_COLOR + || param == GL_PREVIOUS) { + FNPTR(TexEnvi)(target, pname, param); + return; + } +#if defined(PROVIDING_OES_texture_env_crossbar) + if (GL_TEXTURE0 <= param && param < GL_TEXTURE0 + ALEXGL_MAX_TEXTURE_UNITS) { + FNPTR(TexEnvi)(target, pname, param); + return; + } +#endif + break; +#endif + } + INTFN(SetError)(GL_INVALID_ENUM); +} +#endif + +#ifdef ALEXGL_PROVIDE_COMMON +GL_API void GL_APIENTRY EXTFN(TexEnvfv)(GLenum target, GLenum pname, const GLfloat* params) { + if (target == GL_TEXTURE_ENV && pname == GL_TEXTURE_ENV_COLOR) { + FNPTR(TexEnvfv)(target, pname, params); + return; + } + EXTFN(TexEnvf)(target, pname, *params); +} +#endif + +GL_API void GL_APIENTRY EXTFN(TexEnvxv)(GLenum target, GLenum pname, const GLfixed* params) { + if (target == GL_TEXTURE_ENV && pname == GL_TEXTURE_ENV_COLOR) { + GLfloat f[4]; + xv2fv(params, f, 4); + FNPTR(TexEnvfv)(target, pname, f); + return; + } + EXTFN(TexEnvx)(target, pname, *params); +} + +#ifdef ALEXGL_PROVIDE_1_1 +GL_API void GL_APIENTRY EXTFN(TexEnviv)(GLenum target, GLenum pname, const GLint* params) { + if (target == GL_TEXTURE_ENV && pname == GL_TEXTURE_ENV_COLOR) { + GLfloat f[4]; + f[0] = (GLfloat)(params[0]); + f[1] = (GLfloat)(params[1]); + f[2] = (GLfloat)(params[2]); + f[3] = (GLfloat)(params[3]); + FNPTR(TexEnvfv)(target, pname, f); + return; + } + EXTFN(TexEnvi)(target, pname, *params); +} +#endif + +#ifdef ALEXGL_PROVIDE_COMMON +#ifdef ALEXGL_PROVIDE_1_1 +GL_API void GL_APIENTRY EXTFN(GetTexEnvfv)(GLenum env, GLenum pname, GLfloat* params) { + switch (env) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_TEXTURE_ENV: + break; +#if defined(PROVIDING_OES_point_sprite) + case GL_POINT_SPRITE_OES: + switch (pname) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_COORD_REPLACE_OES: + FNPTR(GetTexEnvfv)(env, GL_COORD_REPLACE, params); + return; + } + break; +#endif + } + switch (pname) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_TEXTURE_ENV_MODE: + case GL_TEXTURE_ENV_COLOR: + case GL_COMBINE_RGB: + case GL_COMBINE_ALPHA: + case GL_SRC0_RGB: + case GL_SRC1_RGB: + case GL_SRC2_RGB: + case GL_SRC0_ALPHA: + case GL_SRC1_ALPHA: + case GL_SRC2_ALPHA: + case GL_OPERAND0_RGB: + case GL_OPERAND1_RGB: + case GL_OPERAND2_RGB: + case GL_OPERAND0_ALPHA: + case GL_OPERAND1_ALPHA: + case GL_OPERAND2_ALPHA: + case GL_RGB_SCALE: + case GL_ALPHA_SCALE: + FNPTR(GetTexEnvfv)(env, pname, params); + break; + } +} +#endif +#endif + +#ifdef ALEXGL_PROVIDE_1_1 +GL_API void GL_APIENTRY EXTFN(GetTexEnvxv)(GLenum env, GLenum pname, GLfixed* params) { + switch (env) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_TEXTURE_ENV: + break; +#if defined(PROVIDING_OES_point_sprite) + case GL_POINT_SPRITE_OES: + switch (pname) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_COORD_REPLACE_OES: + FNPTR(GetTexEnviv)(env, GL_COORD_REPLACE, params); + return; + } + break; +#endif + } + GLfloat f[4]; + switch (pname) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_TEXTURE_ENV_COLOR: + FNPTR(GetTexEnvfv)(env, pname, f); + fv2xv(f, params, 4); + break; + case GL_RGB_SCALE: + case GL_ALPHA_SCALE: + FNPTR(GetTexEnvfv)(env, pname, f); + fv2xv(f, params, 1); + break; + case GL_TEXTURE_ENV_MODE: + case GL_COMBINE_RGB: + case GL_COMBINE_ALPHA: + case GL_SRC0_RGB: + case GL_SRC1_RGB: + case GL_SRC2_RGB: + case GL_SRC0_ALPHA: + case GL_SRC1_ALPHA: + case GL_SRC2_ALPHA: + case GL_OPERAND0_RGB: + case GL_OPERAND1_RGB: + case GL_OPERAND2_RGB: + case GL_OPERAND0_ALPHA: + case GL_OPERAND1_ALPHA: + case GL_OPERAND2_ALPHA: + FNPTR(GetTexEnviv)(env, pname, params); + break; + } +} +#endif + +#ifdef ALEXGL_PROVIDE_1_1 +GL_API void GL_APIENTRY EXTFN(GetTexEnviv)(GLenum env, GLenum pname, GLint* params) { + switch (env) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_TEXTURE_ENV: + break; +#if defined(PROVIDING_OES_point_sprite) + case GL_POINT_SPRITE_OES: + switch (pname) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_COORD_REPLACE_OES: + FNPTR(GetTexEnviv)(env, GL_COORD_REPLACE, params); + return; + } + break; +#endif + } + switch (pname) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_TEXTURE_ENV_MODE: + case GL_TEXTURE_ENV_COLOR: + case GL_COMBINE_RGB: + case GL_COMBINE_ALPHA: + case GL_SRC0_RGB: + case GL_SRC1_RGB: + case GL_SRC2_RGB: + case GL_SRC0_ALPHA: + case GL_SRC1_ALPHA: + case GL_SRC2_ALPHA: + case GL_OPERAND0_RGB: + case GL_OPERAND1_RGB: + case GL_OPERAND2_RGB: + case GL_OPERAND0_ALPHA: + case GL_OPERAND1_ALPHA: + case GL_OPERAND2_ALPHA: + case GL_RGB_SCALE: + case GL_ALPHA_SCALE: + FNPTR(GetTexEnviv)(env, pname, params); + break; + } +} +#endif diff --git a/es_1_1/38fog.c b/es_1_1/38fog.c new file mode 100755 index 0000000..08b8ef5 --- /dev/null +++ b/es_1_1/38fog.c @@ -0,0 +1,115 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "gl_imp.h" + + +#ifdef ALEXGL_PROVIDE_COMMON +void GL_APIENTRY EXTFN(Fogf)(GLenum pname, GLfloat param) { + register GLint iValue; + switch (pname) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_FOG_MODE: + iValue = (int)(param); + switch (iValue) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_LINEAR: + case GL_EXP: + case GL_EXP2: + FNPTR(Fogi)(pname, iValue); + break; + } + break; + case GL_FOG_DENSITY: + case GL_FOG_START: + case GL_FOG_END: + FNPTR(Fogf)(pname, param); + break; + } +} +#endif + +void GL_APIENTRY EXTFN(Fogx)(GLenum pname, GLfixed param) { + register GLfloat fValue; + switch (pname) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_FOG_MODE: + switch (param) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_LINEAR: + case GL_EXP: + case GL_EXP2: + FNPTR(Fogi)(pname, param); + break; + } + break; + case GL_FOG_DENSITY: + case GL_FOG_START: + case GL_FOG_END: + fValue = x2f(param); + FNPTR(Fogf)(pname, fValue); + break; + } +} + +#ifdef ALEXGL_PROVIDE_COMMON +void GL_APIENTRY EXTFN(Fogfv)(GLenum pname, const GLfloat* params) { + switch (pname) { + default: + EXTFN(Fogf)(pname, params[0]); + break; + case GL_FOG_COLOR: + FNPTR(Fogfv)(pname, params); + break; + } +} +#endif + +void GL_APIENTRY EXTFN(Fogxv)(GLenum pname, const GLfixed* params) { + GLfloat f[4]; + switch (pname) { + default: + EXTFN(Fogx)(pname, params[0]); + break; + case GL_FOG_COLOR: + xv2fv(params, f, 4); + FNPTR(Fogfv)(pname, f); + break; + } +} diff --git a/es_1_1/3Btexpal.c b/es_1_1/3Btexpal.c new file mode 100755 index 0000000..a43eb97 --- /dev/null +++ b/es_1_1/3Btexpal.c @@ -0,0 +1,324 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "gl_imp.h" +#include <malloc.h> +#include <GLES/glext.h> + +GL_API void GL_APIENTRY INTFN(FetchRGBAtoRGBA)(const GLvoid* src, GLubyte* dst, GLint width) { + GLubyte* ptr = (GLubyte*)src; + while (width--) { + *dst++ = *ptr++; + *dst++ = *ptr++; + *dst++ = *ptr++; + *dst++ = *ptr++; + } +} + +GL_API void GL_APIENTRY INTFN(FetchRGBtoRGB)(const GLvoid* src, GLubyte* dst, GLint width) { + GLubyte* ptr = (GLubyte*)src; + while (width--) { + *dst++ = *ptr++; + *dst++ = *ptr++; + *dst++ = *ptr++; + } +} + +GL_API void GL_APIENTRY INTFN(Fetch4444toRGBA)(const GLvoid* src, GLubyte* dst, GLint width) { + const GLushort* ptr = (const GLushort*)src; + int i; + for (i = 0; i < width; i++) { + register GLushort value = *ptr++; + register GLubyte val; + val = (value >> 12); + *dst++ = ((val << 4) + val); + val = ((value >> 8) & 0x0F); + *dst++ = ((val << 4) + val); + val = ((value >> 4) & 0x0F); + *dst++ = ((val << 4) + val); + val = (value & 0x0F); + *dst++ = ((val << 4) + val); + } +} + +GL_API void GL_APIENTRY INTFN(Fetch5551toRGBA)(const GLvoid* src, GLubyte* dst, GLint width) { + const GLushort* ptr = (const GLushort*)src; + int i; + for (i = 0; i < width; i++) { + register GLushort value = *ptr++; + register GLubyte val; + val = (value >> 11); + *dst++ = (val << 3) + (val >> 2); + val = ((value >> 6) & 0x1F); + *dst++ = (val << 3) + (val >> 2); + val = ((value >> 1) & 0x1F); + *dst++ = (val << 3) + (val >> 2); + val = (value & 0x01); + *dst++ = 255 * val; + } +} + +GL_API void GL_APIENTRY INTFN(Fetch565toRGB)(const GLvoid* src, GLubyte* dst, GLint width) { + const GLushort* ptr = (const GLushort*)src; + int i; + for (i = 0; i < width; i++) { + register GLushort value = *ptr++; + register GLubyte val; + val = (value >> 11); + *dst++ = (val << 3) + (val >> 2); + val = ((value >> 5) & 0x3F); + *dst++ = (val << 2) + (val >> 4); + val = (value & 0x1F); + *dst++ = (val << 3) + (val >> 2); + } +} + + +GL_API void GL_APIENTRY EXTFN(CompressedTexImage2D)(GLenum target, + GLint level, GLenum internalformat, GLsizei width, GLsizei height, + GLint border, GLsizei imageSize, const GLvoid* data) { + int iMaxSize; + static GLubyte* pTexArea = NULL; + GLubyte palette[4*256]; + GLubyte* src; + GLubyte* dst; + GLubyte* pal; + GLenum baseformat; + int palCount, expectedSize; + int i, j, k; + switch (target) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_TEXTURE_2D: + FNPTR(GetIntegerv)(GL_MAX_TEXTURE_SIZE, &iMaxSize); + break; +#if defined(PROVIDING_OES_texture_cube_map) + case GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES: + if (width != height) { + INTFN(SetError)(GL_INVALID_VALUE); + return; + } + FNPTR(GetIntegerv)(GL_MAX_CUBE_MAP_TEXTURE_SIZE_OES, &iMaxSize); + break; +#endif + } + if (level > 0 || width < 0 || height < 0 || border != 0) { + INTFN(SetError)(GL_INVALID_VALUE); + return; + } + switch (internalformat) { + case GL_PALETTE4_RGB8_OES: + baseformat = GL_RGB; + expectedSize = (palCount = 16) * 3; + if (data != NULL) INTFN(FetchRGBtoRGB)(data, palette, 16); + break; + case GL_PALETTE4_RGBA8_OES: + baseformat = GL_RGBA; + expectedSize = (palCount = 16) * 4; + if (data != NULL) INTFN(FetchRGBAtoRGBA)(data, palette, 16); + break; + case GL_PALETTE4_R5_G6_B5_OES: + baseformat = GL_RGB; + expectedSize = (palCount = 16) * 2; + if (data != NULL) INTFN(Fetch565toRGB)(data, palette, 16); + break; + case GL_PALETTE4_RGBA4_OES: + baseformat = GL_RGBA; + expectedSize = (palCount = 16) * 2; + if (data != NULL) INTFN(Fetch4444toRGBA)(data, palette, 16); + break; + case GL_PALETTE4_RGB5_A1_OES: + baseformat = GL_RGBA; + expectedSize = (palCount = 16) * 2; + if (data != NULL) INTFN(Fetch5551toRGBA)(data, palette, 16); + break; + case GL_PALETTE8_RGB8_OES: + baseformat = GL_RGB; + expectedSize = (palCount = 256) * 3; + if (data != NULL) INTFN(FetchRGBtoRGB)(data, palette, 256); + break; + case GL_PALETTE8_RGBA8_OES: + baseformat = GL_RGBA; + expectedSize = (palCount = 256) * 4; + if (data != NULL) INTFN(FetchRGBAtoRGBA)(data, palette, 256); + break; + case GL_PALETTE8_R5_G6_B5_OES: + baseformat = GL_RGB; + expectedSize = (palCount = 256) * 2; + if (data != NULL) INTFN(Fetch565toRGB)(data, palette, 256); + break; + case GL_PALETTE8_RGBA4_OES: + baseformat = GL_RGBA; + expectedSize = (palCount = 256) * 2; + if (data != NULL) INTFN(Fetch4444toRGBA)(data, palette, 256); + break; + case GL_PALETTE8_RGB5_A1_OES: + baseformat = GL_RGBA; + expectedSize = (palCount = 256) * 2; + if (data != NULL) INTFN(Fetch5551toRGBA)(data, palette, 256); + break; + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + } + src = (GLubyte*)data + expectedSize; + expectedSize += (palCount == 16) ? ((width * height + 1) / 2) : (width * height); + if (imageSize != expectedSize) { + INTFN(SetError)(GL_INVALID_VALUE); + return; + } + if ((pTexArea = realloc(pTexArea, 4 * width * height)) == NULL) { + INTFN(SetError)(GL_OUT_OF_MEMORY); + return; + } + if (data == NULL) { + FNPTR(TexImage2D)(target, i, baseformat, width, height, 0, baseformat, + GL_UNSIGNED_BYTE, NULL); + return; + } + if (palCount == 256) { + k = width * height; + if (baseformat == GL_RGBA) { + for (i = 0; i <= -level; i++) { + dst = pTexArea; + for (j = 0; j < k; j++) { + pal = palette + (*src++) * 4; + *dst++ = *pal++; + *dst++ = *pal++; + *dst++ = *pal++; + *dst++ = *pal; + } + FNPTR(TexImage2D)(target, i, baseformat, width, height, 0, baseformat, + GL_UNSIGNED_BYTE, pTexArea); + k /= 4; + width /= 2; + height /= 2; + } + } else { + for (i = 0; i <= -level; i++) { + dst = pTexArea; + for (j = 0; j < k; j++) { + pal = palette + (*src++) * 3; + *dst++ = *pal++; + *dst++ = *pal++; + *dst++ = *pal; + } + FNPTR(TexImage2D)(target, i, baseformat, width, height, 0, baseformat, + GL_UNSIGNED_BYTE, pTexArea); + k /= 4; + width /= 2; + height /= 2; + } + } + } else { + k = width * height / 2; + if (baseformat == GL_RGBA) { + for (i = 0; i <= -level; i++) { + dst = pTexArea; + for (j = 0; j < k; j++) { + pal = palette + (*src >> 4) * 4; + *dst++ = *pal++; + *dst++ = *pal++; + *dst++ = *pal++; + *dst++ = *pal; + pal = palette + (*src++ & 0x0F) * 4; + *dst++ = *pal++; + *dst++ = *pal++; + *dst++ = *pal++; + *dst++ = *pal; + } + FNPTR(TexImage2D)(target, i, baseformat, width, height, 0, baseformat, + GL_UNSIGNED_BYTE, pTexArea); + k /= 4; + width /= 2; + height /= 2; + } + } else { + for (i = 0; i <= -level; i++) { + dst = pTexArea; + for (j = 0; j < k; j++) { + pal = palette + (*src >> 4) * 3; + *dst++ = *pal++; + *dst++ = *pal++; + *dst++ = *pal; + pal = palette + (*src++ & 0x0F) * 3; + *dst++ = *pal++; + *dst++ = *pal++; + *dst++ = *pal; + } + FNPTR(TexImage2D)(target, i, baseformat, width, height, 0, baseformat, + GL_UNSIGNED_BYTE, pTexArea); + k /= 4; + width /= 2; + height /= 2; + } + } + } +} + +GL_API void GL_APIENTRY EXTFN(CompressedTexSubImage2D)(GLenum target, + GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, + GLenum format, GLsizei imageSize, const GLvoid* data) { + int iMaxSize; + switch (target) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_TEXTURE_2D: + FNPTR(GetIntegerv)(GL_MAX_TEXTURE_SIZE, &iMaxSize); + break; +#if defined(PROVIDING_OES_texture_cube_map) + case GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES: + if (width != height) { + INTFN(SetError)(GL_INVALID_VALUE); + return; + } + FNPTR(GetIntegerv)(GL_MAX_CUBE_MAP_TEXTURE_SIZE_OES, &iMaxSize); + break; +#endif + } + if (level < 0 || width < 0 || height < 0 || xoffset < 0 || yoffset < 0) { + INTFN(SetError)(GL_INVALID_VALUE); + return; + } + INTFN(SetError)(GL_INVALID_OPERATION); +} diff --git a/es_1_1/41frag.c b/es_1_1/41frag.c new file mode 100755 index 0000000..740b0e8 --- /dev/null +++ b/es_1_1/41frag.c @@ -0,0 +1,143 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "gl_imp.h" +#if defined(PROVIDING_OES_stencil_wrap) +#include <GLES/glext.h> +#endif + + +GL_API void GL_APIENTRY EXTFN(Scissor)(GLint x, GLint y, GLsizei width, GLsizei height) { + FNPTR(Scissor)(x, y, width, height); +} + +#ifdef ALEXGL_PROVIDE_COMMON +GL_API void GL_APIENTRY EXTFN(SampleCoverage)(GLclampf value, GLboolean invert) { + FNPTR(SampleCoverage)(value, invert); +} +#endif + +GL_API void GL_APIENTRY EXTFN(SampleCoveragex)(GLclampx value, GLboolean invert) { + FNPTR(SampleCoverage)(x2f(value), invert); +} + +#ifdef ALEXGL_PROVIDE_COMMON +GL_API void GL_APIENTRY EXTFN(AlphaFunc)(GLenum func, GLclampf ref) { + FNPTR(AlphaFunc)(func, ref); +} +#endif + +GL_API void GL_APIENTRY EXTFN(AlphaFuncx)(GLenum func, GLclampx ref) { + FNPTR(AlphaFunc)(func, x2f(ref)); +} + +GL_API void GL_APIENTRY EXTFN(StencilFunc)(GLenum func, GLint ref, GLuint mask) { + FNPTR(StencilFunc)(func, ref, mask); +} + +GL_API void GL_APIENTRY EXTFN(StencilOp)(GLenum fail, GLenum zfail, GLenum zpass) { + switch (fail) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_ZERO: + case GL_KEEP: + case GL_REPLACE: + case GL_INCR: + case GL_DECR: + case GL_INVERT: +#if defined(PROVIDING_ES_2_0) || defined(PROVIDING_OES_stencil_wrap) + case GL_INCR_WRAP_OES: + case GL_DECR_WRAP_OES: +#endif + break; + } + switch (zfail) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_ZERO: + case GL_KEEP: + case GL_REPLACE: + case GL_INCR: + case GL_DECR: + case GL_INVERT: +#if defined(PROVIDING_ES_2_0) || defined(PROVIDING_OES_stencil_wrap) + case GL_INCR_WRAP_OES: + case GL_DECR_WRAP_OES: +#endif + break; + } + switch (zpass) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_ZERO: + case GL_KEEP: + case GL_REPLACE: + case GL_INCR: + case GL_DECR: + case GL_INVERT: +#if defined(PROVIDING_ES_2_0) || defined(PROVIDING_OES_stencil_wrap) + case GL_INCR_WRAP_OES: + case GL_DECR_WRAP_OES: +#endif + break; + } + FNPTR(StencilOp)(fail, zfail, zpass); +} + +GL_API void GL_APIENTRY EXTFN(DepthFunc)(GLenum func) { + FNPTR(DepthFunc)(func); +} + +GL_API void GL_APIENTRY EXTFN(BlendFunc)(GLenum sfactor, GLenum dfactor) { + if (sfactor != GL_ZERO && sfactor != GL_ONE + && sfactor != GL_DST_COLOR && sfactor != GL_ONE_MINUS_DST_COLOR + && sfactor != GL_SRC_ALPHA && sfactor != GL_ONE_MINUS_SRC_ALPHA + && sfactor != GL_DST_ALPHA && sfactor != GL_ONE_MINUS_DST_ALPHA + && sfactor != GL_SRC_ALPHA_SATURATE) { + INTFN(SetError)(GL_INVALID_ENUM); + return; + } + if (dfactor != GL_ZERO && dfactor != GL_ONE + && dfactor != GL_SRC_COLOR && dfactor != GL_ONE_MINUS_SRC_COLOR + && dfactor != GL_SRC_ALPHA && dfactor != GL_ONE_MINUS_SRC_ALPHA + && dfactor != GL_DST_ALPHA && dfactor != GL_ONE_MINUS_DST_ALPHA) { + INTFN(SetError)(GL_INVALID_ENUM); + return; + } + FNPTR(BlendFunc)(sfactor, dfactor); +} + +GL_API void GL_APIENTRY EXTFN(LogicOp)(GLenum opcode) { + FNPTR(LogicOp)(opcode); +} diff --git a/es_1_1/42frame.c b/es_1_1/42frame.c new file mode 100755 index 0000000..00071e1 --- /dev/null +++ b/es_1_1/42frame.c @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "gl_imp.h" + +GL_API void GL_APIENTRY EXTFN(ColorMask)(GLboolean red, + GLboolean green, GLboolean blue, GLboolean alpha) { + FNPTR(ColorMask)(red, green, blue, alpha); +} + +GL_API void GL_APIENTRY EXTFN(DepthMask)(GLboolean flag) { + FNPTR(DepthMask)(flag); +} + +GL_API void GL_APIENTRY EXTFN(StencilMask)(GLuint mask) { + FNPTR(StencilMask)(mask); +} + +GL_API void GL_APIENTRY EXTFN(Clear)(GLbitfield mask) { + FNPTR(Clear)(mask); +} + +#ifdef ALEXGL_PROVIDE_COMMON +GL_API void GL_APIENTRY EXTFN(ClearColor)(GLclampf red, + GLclampf green, GLclampf blue, GLclampf alpha) { + FNPTR(ClearColor)(red, green, blue, alpha); +} +#endif + +GL_API void GL_APIENTRY EXTFN(ClearColorx)(GLclampx red, + GLclampx green, GLclampx blue, GLclampx alpha) { + FNPTR(ClearColor)(x2f(red), x2f(green), x2f(blue), x2f(alpha)); +} + +#ifdef ALEXGL_PROVIDE_COMMON +GL_API void GL_APIENTRY EXTFN(ClearDepthf)(GLclampf depth) { + FNPTR(ClearDepth)(f2d(depth)); +} +#endif + +GL_API void GL_APIENTRY EXTFN(ClearDepthx)(GLclampx depth) { + FNPTR(ClearDepth)(x2d(depth)); +} + +GL_API void GL_APIENTRY EXTFN(ClearStencil)(GLint s) { + FNPTR(ClearStencil)(s); +} diff --git a/es_1_1/43read.c b/es_1_1/43read.c new file mode 100755 index 0000000..99fbf13 --- /dev/null +++ b/es_1_1/43read.c @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "gl_imp.h" + +GL_API void GL_APIENTRY EXTFN(ReadPixels)(GLint x, GLint y, + GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels) { + if (format == GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES) format = GL_RGBA; + if (format == GL_IMPLEMENTATION_COLOR_READ_TYPE_OES) format = GL_UNSIGNED_BYTE; + if (format != GL_RGBA + || type != GL_UNSIGNED_BYTE) { + INTFN(SetError)(GL_INVALID_ENUM); + return; + } + FNPTR(ReadPixels)(x, y, width, height, format, type, pixels); +} diff --git a/es_1_1/50flush.c b/es_1_1/50flush.c new file mode 100755 index 0000000..672e22e --- /dev/null +++ b/es_1_1/50flush.c @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "gl_imp.h" + + +GL_API void GL_APIENTRY EXTFN(Finish)(void) { + FNPTR(Finish)(); +} + +GL_API void GL_APIENTRY EXTFN(Flush)(void) { + FNPTR(Flush)(); +} + +GL_API void GL_APIENTRY EXTFN(Hint)(GLenum target, GLenum mode) { + switch (target) { + case GL_PERSPECTIVE_CORRECTION_HINT: + case GL_POINT_SMOOTH_HINT: + case GL_LINE_SMOOTH_HINT: + case GL_FOG_HINT: + case GL_GENERATE_MIPMAP_HINT: + FNPTR(Hint)(target, mode); + break; + default: + INTFN(SetError)(GL_INVALID_ENUM); + break; + } +} diff --git a/es_1_1/60get.c b/es_1_1/60get.c new file mode 100755 index 0000000..fba2f28 --- /dev/null +++ b/es_1_1/60get.c @@ -0,0 +1,213 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "gl_imp.h" +#include <GLES/glext.h> +#include <string.h> + + +#ifdef ALEXGL_PROVIDE_1_1 +GL_API void GL_APIENTRY EXTFN(GetBooleanv)(GLenum pname, GLboolean* params) { +#define clamprv2params clamprv2boolv +#define rv2params rv2boolv +#define enum2param enum2bool +#define i2param i2bool +#include "6ZgetCore.inl" +#undef clamprv2params +#undef rv2params +#undef enum2param +#undef i2param + FNPTR(GetBooleanv)(pname, params); +} +#endif + +GL_API void GL_APIENTRY EXTFN(GetIntegerv)(GLenum pname, GLint* params) { +#define clamprv2params clamprv2iv +#define rv2params rv2iv +#define enum2param enum2i +#define i2param i2i +#include "6ZgetCore.inl" +#undef clamprv2params +#undef rv2params +#undef enum2param +#undef i2param + GLfloat f[4]; + switch (pname) { + case GL_ALPHA_TEST_REF: + FNPTR(GetFloatv)(pname, f); + clampfv2iv(f, params, 1); + break; + default: + FNPTR(GetIntegerv)(pname, params); + break; + } +} + +#ifdef ALEXGL_PROVIDE_1_1 +GL_API void GL_APIENTRY EXTFN(GetFixedv)(GLenum pname, GLfixed* params) { +#define clamprv2params clamprv2xv +#define rv2params rv2xv +#define enum2param enum2x +#define i2param i2x +#include "6ZgetCore.inl" +#undef clamprv2params +#undef rv2params +#undef enum2param +#undef i2param + { + static GLfloat f[16]; + FNPTR(GetFloatv)(pname, f); + switch (pname) { + default: + fv2xv(f, params, 1); + break; + case GL_CURRENT_NORMAL: + fv2xv(f, params, 3); + break; + case GL_ALIASED_POINT_SIZE_RANGE: + case GL_ALIASED_LINE_WIDTH_RANGE: + case GL_DEPTH_RANGE: + case GL_MAX_VIEWPORT_DIMS: + case GL_SMOOTH_LINE_WIDTH_RANGE: + case GL_SMOOTH_POINT_SIZE_RANGE: + fv2xv(f, params, 2); + break; + case GL_CURRENT_COLOR: + case GL_CURRENT_TEXTURE_COORDS: + case GL_COLOR_CLEAR_VALUE: + case GL_COLOR_WRITEMASK: + case GL_FOG_COLOR: + case GL_LIGHT_MODEL_AMBIENT: + case GL_SCISSOR_BOX: + case GL_VIEWPORT: + fv2xv(f, params, 4); + break; + case GL_MODELVIEW_MATRIX: + case GL_PROJECTION_MATRIX: + case GL_TEXTURE_MATRIX: + fv2xv(f, params, 16); + break; +#if defined(PROVIDING_OES_matrix_get) + case GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES: + case GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES: + case GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES: + memcpy(params, f, 16 * sizeof(params[0])); + break; +#endif + } + } +} +#endif + +#ifdef ALEXGL_PROVIDE_COMMON +#ifdef ALEXGL_PROVIDE_1_1 +GL_API void GL_APIENTRY EXTFN(GetFloatv)(GLenum pname, GLfloat* params) { +#define clamprv2params clamprv2fv +#define rv2params rv2fv +#define enum2param enum2f +#define i2param i2f +#include "6ZgetCore.inl" +#undef clamprv2params +#undef rv2params +#undef enum2param +#undef i2param + FNPTR(GetFloatv)(pname, params); +} +#endif +#endif + +GL_API const GLubyte* GL_APIENTRY EXTFN(GetString)(GLenum name) { + switch (name) { + case GL_VENDOR: + return (GLubyte*)"Huone Inc."; + break; + case GL_RENDERER: +#if defined(__pic__) + return (GLubyte*)"AlexGL ES 1.1 dynamic on OpenGL (" __DATE__ " " __TIME__ ")"; +#else + return (GLubyte*)"AlexGL ES 1.1 on OpenGL (" __DATE__ " " __TIME__ ")"; +#endif + break; + case GL_VERSION: + return (GLubyte*)"OpenGL ES-CM 1.1"; + break; + case GL_EXTENSIONS: + return (GLubyte*) +#if defined(PROVIDING_OES_blend_func_separate) + "GL_OES_blend_func_separate " +#endif +#if defined(PROVIDING_OES_blend_subtract) + "GL_OES_blend_subtract " +#endif +#if defined(PROVIDING_OES_byte_coordinates) + "GL_OES_byte_coordinates " +#endif +#if defined(PROVIDING_OES_fixed_point) + "GL_OES_fixed_point " +#endif +#if defined(PROVIDING_OES_matrix_get) + "GL_OES_matrix_get " +#endif +#if defined(PROVIDING_OES_point_size_array) + "GL_OES_point_size_array " +#endif +#if defined(PROVIDING_OES_point_sprite) + "GL_OES_point_sprite " +#endif +#if defined(PROVIDING_OES_query_matrix) + "GL_OES_query_matrix " +#endif +#if defined(PROVIDING_OES_single_precision) + "GL_OES_single_precision " +#endif +#if defined(PROVIDING_OES_stencil_wrap) + "GL_OES_stencil_wrap " +#endif +#if defined(PROVIDING_OES_texture_cube_map) + "GL_OES_texture_cube_map " +#endif +#if defined(PROVIDING_OES_texture_env_crossbar) + "GL_OES_texture_env_crossbar " +#endif +#if defined(PROVIDING_OES_texture_mirrored_repeat) + "GL_OES_texture_mirrored_repeat " +#endif +#if defined(PROVIDING_OES_element_index_uint) + "GL_OES_element_index_uint " +#endif + ""; + break; + default: + return (GLubyte*)FNPTR(GetString)(name); + break; + } +} + diff --git a/es_1_1/6ZgetCore.inl b/es_1_1/6ZgetCore.inl new file mode 100755 index 0000000..afb1d3f --- /dev/null +++ b/es_1_1/6ZgetCore.inl @@ -0,0 +1,179 @@ + + +{ +#define break return + switch (pname) { + case GL_VERTEX_ARRAY_TYPE: + *params = enum2param(CCV(vertexArrayType)); + break; + case GL_NORMAL_ARRAY_TYPE: + *params = enum2param(CCV(normalArrayType)); + break; + case GL_COLOR_ARRAY_TYPE: + *params = enum2param(CCV(colorArrayType)); + break; + case GL_TEXTURE_COORD_ARRAY_TYPE: + *params = enum2param(CCV(texCoordArrayType)[CCV(clientActiveTexture)]); + break; +#ifdef ALEXGL_PROVIDE_1_1 +#if defined(PROVIDING_OES_point_size_array) + case GL_POINT_SIZE_ARRAY_TYPE_OES: + *params = enum2param(CCV(pointSizeArrayTypeOES)); + break; + case GL_POINT_SIZE_ARRAY_STRIDE_OES: + *params = i2param(CCV(pointSizeArrayStrideOESGiven)); + break; + case GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES: + *params = i2param(CCV(pointSizeArrayBufferBindingOES)); + break; +#endif + /* + ES1.1 manual에는 GL_ARRAY_BUFFER_BINDING과 GL_ELEMENT_ARRAY_BUFFER_BINDING이 빠져 있음. + GL1.5에는 들어 있음. 현재 구현에서는 지원하도록 했음. + */ +#endif + case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES: + *params = i2param(GL_RGBA); + break; + case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES: + *params = i2param(GL_UNSIGNED_BYTE); + break; + case GL_COMPRESSED_TEXTURE_FORMATS: + params[0] = i2param(GL_PALETTE4_RGB8_OES); + params[1] = i2param(GL_PALETTE4_RGBA8_OES); + params[2] = i2param(GL_PALETTE4_R5_G6_B5_OES); + params[3] = i2param(GL_PALETTE4_RGBA4_OES); + params[4] = i2param(GL_PALETTE4_RGB5_A1_OES); + params[5] = i2param(GL_PALETTE8_RGB8_OES); + params[6] = i2param(GL_PALETTE8_RGBA8_OES); + params[7] = i2param(GL_PALETTE8_R5_G6_B5_OES); + params[8] = i2param(GL_PALETTE8_RGBA4_OES); + params[9] = i2param(GL_PALETTE8_RGB5_A1_OES); + break; + case GL_NUM_COMPRESSED_TEXTURE_FORMATS: + *params = i2param(10); + break; +#undef break + case GL_MAX_ELEMENTS_INDICES: + case GL_MAX_ELEMENTS_VERTICES: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_CURRENT_COLOR: + case GL_CURRENT_TEXTURE_COORDS: + case GL_CURRENT_NORMAL: + case GL_CLIENT_ACTIVE_TEXTURE: + case GL_VERTEX_ARRAY_SIZE: + case GL_VERTEX_ARRAY_STRIDE: + case GL_NORMAL_ARRAY_STRIDE: + case GL_COLOR_ARRAY_SIZE: + case GL_COLOR_ARRAY_STRIDE: + case GL_TEXTURE_COORD_ARRAY_SIZE: + case GL_TEXTURE_COORD_ARRAY_STRIDE: + case GL_ARRAY_BUFFER_BINDING: + case GL_VERTEX_ARRAY_BUFFER_BINDING: + case GL_NORMAL_ARRAY_BUFFER_BINDING: + case GL_COLOR_ARRAY_BUFFER_BINDING: + case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING: + case GL_ELEMENT_ARRAY_BUFFER_BINDING: + + case GL_MAX_TEXTURE_UNITS: + case GL_ALIASED_POINT_SIZE_RANGE: + case GL_ALIASED_LINE_WIDTH_RANGE: + case GL_ALPHA_BITS: + case GL_ALPHA_TEST_FUNC: + case GL_ALPHA_TEST_REF: + case GL_BLEND_DST: + case GL_BLEND_SRC: + case GL_BLUE_BITS: + case GL_COLOR_CLEAR_VALUE: + case GL_COLOR_WRITEMASK: + case GL_CULL_FACE: + case GL_DEPTH_BITS: + case GL_DEPTH_CLEAR_VALUE: + case GL_DEPTH_FUNC: + case GL_DEPTH_RANGE: + case GL_DEPTH_WRITEMASK: + case GL_FOG_COLOR: + case GL_FOG_DENSITY: + case GL_FOG_END: + case GL_FOG_HINT: + case GL_FOG_MODE: + case GL_FOG_START: + case GL_FRONT_FACE: + case GL_GREEN_BITS: + case GL_LIGHT_MODEL_AMBIENT: + case GL_LIGHT_MODEL_TWO_SIDE: + case GL_LINE_SMOOTH_HINT: + case GL_LINE_WIDTH: + case GL_LOGIC_OP_MODE: + case GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES: + case GL_MATRIX_INDEX_ARRAY_SIZE_OES: + case GL_MATRIX_INDEX_ARRAY_STRIDE_OES: + case GL_MATRIX_INDEX_ARRAY_TYPE_OES: + case GL_MATRIX_MODE: + case GL_MAX_CLIP_PLANES: + case GL_MAX_LIGHTS: + case GL_MAX_MODELVIEW_STACK_DEPTH: + case GL_MAX_PALETTE_MATRICES_OES: + case GL_MAX_PROJECTION_STACK_DEPTH: + case GL_MAX_TEXTURE_SIZE: + case GL_MAX_TEXTURE_STACK_DEPTH: + case GL_MAX_VERTEX_UNITS_OES: + case GL_MAX_VIEWPORT_DIMS: + case GL_MODELVIEW_MATRIX: + case GL_MODELVIEW_STACK_DEPTH: + case GL_PACK_ALIGNMENT: + case GL_PERSPECTIVE_CORRECTION_HINT: + case GL_POINT_SIZE: + case GL_POINT_SMOOTH_HINT: + case GL_POLYGON_OFFSET_FACTOR: + case GL_POLYGON_OFFSET_UNITS: + case GL_PROJECTION_MATRIX: + case GL_PROJECTION_STACK_DEPTH: + case GL_RED_BITS: + case GL_SCISSOR_BOX: + case GL_SHADE_MODEL: + case GL_SMOOTH_LINE_WIDTH_RANGE: + case GL_SMOOTH_POINT_SIZE_RANGE: + case GL_STENCIL_BITS: + case GL_STENCIL_CLEAR_VALUE: + case GL_STENCIL_FAIL: + case GL_STENCIL_FUNC: + case GL_STENCIL_PASS_DEPTH_FAIL: + case GL_STENCIL_PASS_DEPTH_PASS: + case GL_STENCIL_REF: + case GL_STENCIL_VALUE_MASK: + case GL_STENCIL_WRITEMASK: + case GL_SUBPIXEL_BITS: + case GL_TEXTURE_BINDING_2D: + case GL_TEXTURE_MATRIX: + case GL_TEXTURE_STACK_DEPTH: + case GL_UNPACK_ALIGNMENT: + case GL_VIEWPORT: + case GL_WEIGHT_ARRAY_BUFFER_BINDING_OES: + case GL_WEIGHT_ARRAY_SIZE_OES: + case GL_WEIGHT_ARRAY_STRIDE_OES: + case GL_WEIGHT_ARRAY_TYPE_OES: +#if defined(PROVIDING_OES_blend_func_separate) + case GL_BLEND_DST_RGB_OES: + case GL_BLEND_SRC_RGB_OES: + case GL_BLEND_DST_ALPHA_OES: + case GL_BLEND_SRC_ALPHA_OES: +#endif +#if defined(PROVIDING_OES_blend_subtract) + case GL_BLEND_EQUATION_OES: +#endif +#if defined(PROVIDING_OES_matrix_get) + case GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES: + case GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES: + case GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES: +#endif +#if defined(PROVIDING_OES_texture_cube_map) + case GL_TEXTURE_CUBE_MAP_OES: + case GL_TEXTURE_GEN_STR_OES: + case GL_TEXTURE_BINDING_CUBE_MAP_OES: + case GL_MAX_CUBE_MAP_TEXTURE_SIZE_OES: +#endif + break; + } +} diff --git a/es_1_1/80ext.c b/es_1_1/80ext.c new file mode 100755 index 0000000..64c6f21 --- /dev/null +++ b/es_1_1/80ext.c @@ -0,0 +1,485 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "gl_imp.h" +#include <GLES/glext.h> +#include <math.h> + + +#if defined(PROVIDING_ES_2_0) || defined(PROVIDING_OES_blend_func_separate) +/* 2. GL_OES_blend_func_separate */ +/* based on GL_EXT_blend_func_separate, core of OpenGL 1.4 */ +/* BlendFuncSeparate() in the core of OpenGL ES 2.0 */ + +void GL_APIENTRY EXTFN(BlendFuncSeparateOES)(GLenum srcRGB, GLenum dstRGB, + GLenum srcAlpha, GLenum dstAlpha) { + switch (srcRGB) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_ZERO: + case GL_ONE: + case GL_SRC_COLOR: + case GL_ONE_MINUS_SRC_COLOR: + case GL_DST_COLOR: + case GL_ONE_MINUS_DST_COLOR: + case GL_SRC_ALPHA: + case GL_ONE_MINUS_SRC_ALPHA: + case GL_DST_ALPHA: + case GL_ONE_MINUS_DST_ALPHA: + case GL_SRC_ALPHA_SATURATE: + break; + } + switch (dstRGB) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_ZERO: + case GL_ONE: + case GL_SRC_COLOR: + case GL_ONE_MINUS_SRC_COLOR: + case GL_DST_COLOR: + case GL_ONE_MINUS_DST_COLOR: + case GL_SRC_ALPHA: + case GL_ONE_MINUS_SRC_ALPHA: + case GL_DST_ALPHA: + case GL_ONE_MINUS_DST_ALPHA: + break; + } + switch (srcAlpha) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_ZERO: + case GL_ONE: + case GL_SRC_COLOR: + case GL_ONE_MINUS_SRC_COLOR: + case GL_DST_COLOR: + case GL_ONE_MINUS_DST_COLOR: + case GL_SRC_ALPHA: + case GL_ONE_MINUS_SRC_ALPHA: + case GL_DST_ALPHA: + case GL_ONE_MINUS_DST_ALPHA: + case GL_SRC_ALPHA_SATURATE: + break; + } + switch (dstAlpha) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_ZERO: + case GL_ONE: + case GL_SRC_COLOR: + case GL_ONE_MINUS_SRC_COLOR: + case GL_DST_COLOR: + case GL_ONE_MINUS_DST_COLOR: + case GL_SRC_ALPHA: + case GL_ONE_MINUS_SRC_ALPHA: + case GL_DST_ALPHA: + case GL_ONE_MINUS_DST_ALPHA: + break; + } + FNPTR(BlendFuncSeparate)(srcRGB, dstRGB, srcAlpha, dstAlpha); +} + +#endif + + +#if defined(PROVIDING_ES_2_0) || defined(PROVIDING_OES_blend_subtract) +/* 2. GL_OES_blend_subtract */ +/* based on GL_EXT_blend_subtract, core of OpenGL 1.2 */ +/* BlendEquation() in the core of OpenGL ES 2.0 */ + +void GL_APIENTRY EXTFN(BlendEquationOES)(GLenum mode) { + switch (mode) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + return; + case GL_FUNC_ADD_OES: + case GL_FUNC_SUBTRACT_OES: + case GL_FUNC_REVERSE_SUBTRACT_OES: + break; + } + FNPTR(BlendEquation)(mode); +} + +#endif + + +#if defined(PROVIDING_OES_byte_coordinates) +void GL_APIENTRY EXTFN(MultiTexCoord4bOES)(GLenum target, + GLbyte s, GLbyte t, GLbyte r, GLbyte q) { + FNPTR(MultiTexCoord4f)(target, b2f(s), b2f(t), b2f(r), b2f(q)); +} +#endif + +#if defined(PROVIDING_OES_fixed_point) + +void GL_APIENTRY EXTFN(AlphaFuncxOES)(GLenum func, GLclampx ref) { + EXTFN(AlphaFuncx)(func, ref); +} + +void GL_APIENTRY EXTFN(ClearColorxOES)(GLclampx red, GLclampx green, + GLclampx blue, GLclampx alpha) { + EXTFN(ClearColorx)(red, green, blue, alpha); +} + +void GL_APIENTRY EXTFN(ClearDepthxOES)(GLclampx depth) { + EXTFN(ClearDepthx)(depth); +} + +void GL_APIENTRY EXTFN(ClipPlanexOES)(GLenum plane, const GLfixed* equation) { + EXTFN(ClipPlanex)(plane, equation); +} + +void GL_APIENTRY EXTFN(Color4xOES)(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha) { + EXTFN(Color4x)(red, green, blue, alpha); +} + +void GL_APIENTRY EXTFN(DepthRangexOES)(GLclampx zNear, GLclampx zFar) { + EXTFN(DepthRangex)(zNear, zFar); +} + +void GL_APIENTRY EXTFN(FogxOES)(GLenum pname, GLfixed param) { + EXTFN(Fogx)(pname, param); +} + +void GL_APIENTRY EXTFN(FogxvOES)(GLenum pname, const GLfixed* params) { + EXTFN(Fogxv)(pname, params); +} + +void GL_APIENTRY EXTFN(FrustumxOES)(GLfixed left, GLfixed right, + GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar) { + EXTFN(Frustumx)(left, right, bottom, top, zNear, zFar); +} + +void GL_APIENTRY EXTFN(GetClipPlanexOES)(GLenum pname, GLfixed eqn[4]) { + EXTFN(GetClipPlanex)(pname, eqn); +} + +void GL_APIENTRY EXTFN(GetFixedvOES)(GLenum pname, GLfixed* params) { + EXTFN(GetFixedv)(pname, params); +} + +void GL_APIENTRY EXTFN(GetLightxvOES)(GLenum light, GLenum pname, GLfixed* params) { + EXTFN(GetLightxv)(light, pname, params); +} + +void GL_APIENTRY EXTFN(GetMaterialxvOES)(GLenum face, GLenum pname, GLfixed* params) { + EXTFN(GetMaterialxv)(face, pname, params); +} + +void GL_APIENTRY EXTFN(GetTexEnvxvOES)(GLenum env, GLenum pname, GLfixed* params) { + EXTFN(GetTexEnvxv)(env, pname, params); +} + +void GL_APIENTRY EXTFN(GetTexParameterxvOES)(GLenum target, GLenum pname, GLfixed* params) { + EXTFN(GetTexParameterxv)(target, pname, params); +} + +void GL_APIENTRY EXTFN(LightModelxOES)(GLenum pname, GLfixed param) { + EXTFN(LightModelx)(pname, param); +} + +void GL_APIENTRY EXTFN(LightModelxvOES)(GLenum pname, const GLfixed* params) { + EXTFN(LightModelxv)(pname, params); +} + +void GL_APIENTRY EXTFN(LightxOES)(GLenum light, GLenum pname, GLfixed param) { + EXTFN(Lightx)(light, pname, param); +} + +void GL_APIENTRY EXTFN(LightxvOES)(GLenum light, GLenum pname, const GLfixed* params) { + EXTFN(Lightxv)(light, pname, params); +} + +void GL_APIENTRY EXTFN(LineWidthxOES)(GLfixed width) { + EXTFN(LineWidthx)(width); +} + +void GL_APIENTRY EXTFN(LoadMatrixxOES)(const GLfixed* m) { + EXTFN(LoadMatrixx)(m); +} + +void GL_APIENTRY EXTFN(MaterialxOES)(GLenum face, GLenum pname, GLfixed param) { + EXTFN(Materialx)(face, pname, param); +} + +void GL_APIENTRY EXTFN(MaterialxvOES)(GLenum face, GLenum pname, const GLfixed* params) { + EXTFN(Materialxv)(face, pname, params); +} + +void GL_APIENTRY EXTFN(MultMatrixxOES)(const GLfixed* m) { + EXTFN(MultMatrixx)(m); +} + +void GL_APIENTRY EXTFN(MultiTexCoord4xOES)(GLenum target, GLfixed s, GLfixed t, + GLfixed r, GLfixed q) { + EXTFN(MultiTexCoord4x)(target, s, t, r, q); +} + +void GL_APIENTRY EXTFN(Normal3xOES)(GLfixed nx, GLfixed ny, GLfixed nz) { + EXTFN(Normal3x)(nx, ny, nz); +} + +void GL_APIENTRY EXTFN(OrthoxOES)(GLfixed left, GLfixed right, + GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar) { + EXTFN(Orthox)(left, right, bottom, top, zNear, zFar); +} + +void GL_APIENTRY EXTFN(PointParameterxOES)(GLenum pname, GLfixed param) { + EXTFN(PointParameterx)(pname, param); +} + +void GL_APIENTRY EXTFN(PointParameterxvOES)(GLenum pname, const GLfixed* params) { + EXTFN(PointParameterxv)(pname, params); +} + +void GL_APIENTRY EXTFN(PointSizexOES)(GLfixed size) { + EXTFN(PointSizex)(size); +} + +void GL_APIENTRY EXTFN(PolygonOffsetxOES)(GLfixed factor, GLfixed units) { + EXTFN(PolygonOffsetx)(factor, units); +} + +void GL_APIENTRY EXTFN(RotatexOES)(GLfixed angle, GLfixed x, GLfixed y, GLfixed z) { + EXTFN(Rotatex)(angle, x, y, z); +} + +void GL_APIENTRY EXTFN(SampleCoveragexOES)(GLclampx value, GLboolean invert) { + EXTFN(SampleCoveragex)(value, invert); +} + +void GL_APIENTRY EXTFN(ScalexOES)(GLfixed x, GLfixed y, GLfixed z) { + EXTFN(Scalex)(x, y, z); +} + +void GL_APIENTRY EXTFN(TexEnvxOES)(GLenum target, GLenum pname, GLfixed param) { + EXTFN(TexEnvx)(target, pname, param); +} + +void GL_APIENTRY EXTFN(TexEnvxvOES)(GLenum target, GLenum pname, const GLfixed* params) { + EXTFN(TexEnvxv)(target, pname, params); +} + +void GL_APIENTRY EXTFN(TexParameterxOES)(GLenum target, GLenum pname, GLfixed param) { + EXTFN(TexParameterx)(target, pname, param); +} + +void GL_APIENTRY EXTFN(TexParameterxvOES)(GLenum target, GLenum pname, const GLfixed* params) { + EXTFN(TexParameterxv)(target, pname, params); +} + +void GL_APIENTRY EXTFN(TranslatexOES)(GLfixed x, GLfixed y, GLfixed z) { + EXTFN(Translatex)(x, y, z); +} + +#endif + +#if defined(PROVIDING_OES_query_matrix) +#if ! defined(PROVIDING_OES_fixed_point) +#error PROVIDING_OES_query_matrix requires PROVIDING_OES_fixed_point +#endif + +GLbitfield GL_APIENTRY EXTFN(QueryMatrixxOES)(GLfixed mantissa[16], GLint exponent[16]) { + GLfloat fMatrix[16]; + GLint eMatrixMode; + GLbitfield flag = 0x0000; + int i; + FNPTR(GetIntegerv)(GL_MATRIX_MODE, &eMatrixMode); + switch (eMatrixMode) { + case GL_MODELVIEW: FNPTR(GetFloatv)(GL_MODELVIEW_MATRIX, fMatrix); break; + case GL_PROJECTION: FNPTR(GetFloatv)(GL_PROJECTION_MATRIX, fMatrix); break; + case GL_TEXTURE: FNPTR(GetFloatv)(GL_TEXTURE_MATRIX, fMatrix); break; + default: + return 0xFFFF; + } + for (i = 0; i < 16; i++) { + if (finitef(fMatrix[i])) { + GLfloat man = frexpf(fMatrix[i], &exponent[i]); + mantissa[i] = f2x(man); + } else { + flag |= (0x0001 << i); + } + } + return flag; +} + +#endif + + +#if defined(PROVIDING_OES_single_precision) + +void GL_APIENTRY EXTFN(DepthRangefOES)(GLclampf zNear, GLclampf zFar) { + EXTFN(DepthRangef)(zNear, zFar); +} + +void GL_APIENTRY EXTFN(FrustumfOES)(GLfloat left, GLfloat right, + GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar) { + EXTFN(Frustumf)(left, right, bottom, top, zNear, zFar); +} + +void GL_APIENTRY EXTFN(OrthofOES)(GLfloat left, GLfloat right, + GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar) { + EXTFN(Orthof)(left, right, bottom, top, zNear, zFar); +} + +void GL_APIENTRY EXTFN(ClipPlanefOES)(GLenum plane, const GLfloat* equation) { + EXTFN(ClipPlanef)(plane, equation); +} + +void GL_APIENTRY EXTFN(GetClipPlanefOES)(GLenum pname, GLfloat eqn[4]) { + EXTFN(GetClipPlanef)(pname, eqn); +} + +void GL_APIENTRY EXTFN(ClearDepthfOES)(GLclampf depth) { + EXTFN(ClearDepthf)(depth); +} + +#endif + + +#if defined(PROVIDING_OES_texture_cube_map) +/* 20. GL_OES_texture_cube_map */ +/* based on ARB_texture_cube_map and core of OpenGL 1.1 */ + +void GL_APIENTRY EXTFN(TexGeniOES)(GLenum coord, GLenum pname, GLint param) { + switch (coord) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + break; + case GL_TEXTURE_GEN_STR_OES: + break; + } + switch (pname) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + break; + case GL_TEXTURE_GEN_MODE_OES: + break; + } + switch (param) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + break; + case GL_NORMAL_MAP_OES: + case GL_REFLECTION_MAP_OES: + break; + } + FNPTR(TexGeni)(coord, pname, param); +} + +void GL_APIENTRY EXTFN(TexGenfOES)(GLenum coord, GLenum pname, GLfloat param) { + EXTFN(TexGeniOES)(coord, pname, (int)(param)); +} + +void GL_APIENTRY EXTFN(TexGenxOES)(GLenum coord, GLenum pname, GLfixed param) { + EXTFN(TexGeniOES)(coord, pname, param); +} + +void GL_APIENTRY EXTFN(TexGenivOES)(GLenum coord, GLenum pname, const GLint *params) { + EXTFN(TexGeniOES)(coord, pname, *params); +} + +void GL_APIENTRY EXTFN(TexGenfvOES)(GLenum coord, GLenum pname, const GLfloat *params) { + EXTFN(TexGeniOES)(coord, pname, (int)(*params)); +} + +void GL_APIENTRY EXTFN(TexGenxvOES)(GLenum coord, GLenum pname, const GLfixed *params) { + EXTFN(TexGeniOES)(coord, pname, *params); +} + +void GL_APIENTRY EXTFN(GetTexGenivOES)(GLenum coord, GLenum pname, GLint *params) { + switch (coord) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + break; + case GL_TEXTURE_GEN_STR_OES: + break; + } + switch (pname) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + break; + case GL_TEXTURE_GEN_MODE_OES: + break; + } + FNPTR(GetTexGeniv)(coord, pname, params); +} + +void GL_APIENTRY EXTFN(GetTexGenxvOES)(GLenum coord, GLenum pname, GLfixed *params) { + EXTFN(GetTexGenivOES)(coord, pname, params); +} + +void GL_APIENTRY EXTFN(GetTexGenfvOES)(GLenum coord, GLenum pname, GLfloat *params) { + switch (coord) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + break; + case GL_TEXTURE_GEN_STR_OES: + break; + } + switch (pname) { + default: + INTFN(SetError)(GL_INVALID_ENUM); + break; + case GL_TEXTURE_GEN_MODE_OES: + break; + } + FNPTR(GetTexGenfv)(coord, pname, params); +} + + +#endif + + +/* ----------------------- */ + + +void GL_APIENTRY EXTFN(CurrentPaletteMatrixOES)(GLuint matrixpaletteindex) { + return; +} + +void GL_APIENTRY EXTFN(LoadPaletteFromModelViewMatrixOES)(void) { + return; +} + +void GL_APIENTRY EXTFN(MatrixIndexPointerOES)(GLint size, GLenum type, + GLsizei stride, const GLvoid* pointer) { + return; +} + +void GL_APIENTRY EXTFN(WeightPointerOES)(GLint size, GLenum type, + GLsizei stride, const GLvoid* pointer) { + return; +} + diff --git a/es_1_1/EGLImage.c b/es_1_1/EGLImage.c new file mode 100755 index 0000000..29b644c --- /dev/null +++ b/es_1_1/EGLImage.c @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Edwin Zhai <edwin.zhai@intel.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * Yeongkyoon Lee <yeongkyoon.lee@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - Intel Corporation + * - S-Core Co., Ltd + * + */ + + /* + * EGLImage.c + * + */ +#include "gl_imp.h" +#include <GLES/glext.h> + +GL_API void GL_APIENTRY EXTFN(EGLImageTargetTexture2DOES) (GLenum target, + GLeglImageOES image) { + +} diff --git a/es_1_1/funcaction.inl b/es_1_1/funcaction.inl new file mode 100755 index 0000000..4ecc24a --- /dev/null +++ b/es_1_1/funcaction.inl @@ -0,0 +1,108 @@ + ACTION( ActiveTexture ); + ACTION( AlphaFunc ); + ACTION( BindBuffer ); + ACTION( BindTexture ); + ACTION( BlendFunc ); + ACTION( BufferData ); + ACTION( BufferSubData ); + ACTION( Clear ); + ACTION( ClearColor ); + ACTION( ClearDepth ); + ACTION( ClearStencil ); + ACTION( ClientActiveTexture ); + ACTION( ClipPlane ); + ACTION( Color4f ); + ACTION( Color4ub ); + ACTION( ColorMask ); + ACTION( ColorPointer ); + ACTION( CopyTexImage2D ); + ACTION( CopyTexSubImage2D ); + ACTION( CullFace ); + ACTION( DeleteBuffers ); + ACTION( DeleteTextures ); + ACTION( DepthFunc ); + ACTION( DepthMask ); + ACTION( DepthRange ); + ACTION( Disable ); + ACTION( DisableClientState ); + ACTION( DrawArrays ); + ACTION( DrawElements ); + ACTION( Enable ); + ACTION( EnableClientState ); + ACTION( Finish ); + ACTION( Flush ); + ACTION( Fogf ); + ACTION( Fogfv ); + ACTION( Fogi ); + ACTION( FrontFace ); + ACTION( Frustum ); + ACTION( GenBuffers ); + ACTION( GenTextures ); + ACTION( GetBooleanv ); + ACTION( GetBufferParameteriv ); + ACTION( GetBufferSubData ); + ACTION( GetClipPlane ); + ACTION( GetError ); + ACTION( GetFloatv ); + ACTION( GetIntegerv ); + ACTION( GetLightfv ); + ACTION( GetMaterialfv ); + ACTION( GetString ); + ACTION( GetTexEnvfv ); + ACTION( GetTexEnviv ); + ACTION( GetTexParameterfv ); + ACTION( GetTexParameteriv ); + ACTION( Hint ); + ACTION( IsBuffer ); + ACTION( IsEnabled ); + ACTION( IsTexture ); + ACTION( LightModelf ); + ACTION( LightModelfv ); + ACTION( Lightf ); + ACTION( Lightfv ); + ACTION( LineWidth ); + ACTION( LoadIdentity ); + ACTION( LoadMatrixf ); + ACTION( LogicOp ); + ACTION( Materialf ); + ACTION( Materialfv ); + ACTION( MatrixMode ); + ACTION( MultMatrixf ); + ACTION( MultiTexCoord4f ); + ACTION( Normal3f ); + ACTION( NormalPointer ); + ACTION( Ortho ); + ACTION( PixelStorei ); + ACTION( PointParameterf ); + ACTION( PointParameterfv ); + ACTION( PointSize ); + ACTION( PolygonOffset ); + ACTION( PopMatrix ); + ACTION( PushMatrix ); + ACTION( ReadPixels ); + ACTION( Rotatef ); + ACTION( SampleCoverage ); + ACTION( Scalef ); + ACTION( Scissor ); + ACTION( ShadeModel ); + ACTION( StencilFunc ); + ACTION( StencilMask ); + ACTION( StencilOp ); + ACTION( TexCoordPointer ); + ACTION( TexEnvf ); + ACTION( TexEnvfv ); + ACTION( TexEnvi ); + ACTION( TexImage2D ); + ACTION( TexParameteri ); + ACTION( TexSubImage2D ); + ACTION( Translatef ); + ACTION( VertexPointer ); + ACTION( Viewport ); +#if defined(PROVIDING_OES_blend_func_separate) + ACTION( BlendFuncSeparate ); +#endif +#if defined(PROVIDING_OES_texture_cube_map) + ACTION( TexGeni ); + ACTION( GetTexGeniv ); + ACTION( GetTexGenfv ); +#endif diff --git a/es_1_1/gl_context.c b/es_1_1/gl_context.c new file mode 100755 index 0000000..e299c28 --- /dev/null +++ b/es_1_1/gl_context.c @@ -0,0 +1,155 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "gl_imp.h" +#include <string.h> +#include <dlfcn.h> +#include <malloc.h> +#include <GL/glx.h> + +static struct AGContext s_context = { + 0, +}; + +struct AGContext* INTFN(curContext) = NULL; + +void GL_APIENTRY INTFN(NotBound)(void) { + fprintf(stderr, "ES2 internal error: you are calling not-bound function\n"); +} + +void GL_APIENTRY INTFN(SetDefaultValues)(struct AGContext* ptr) { + int i; + memset(ptr, 0, sizeof(*ptr)); + + ptr->vertexArraySize = 4; + ptr->vertexArrayType = GL_FLOAT; + ptr->normalArrayType = GL_FLOAT; + ptr->colorArrayType = GL_FLOAT; + for (i = 0; i < ALEXGL_MAX_TEXTURE_UNITS; i++) { + ptr->texCoordArraySize[i] = 4; + ptr->texCoordArrayType[i] = GL_FLOAT; + } +#ifdef ALEXGL_PROVIDE_1_1 +#ifdef ALEXGL_PROVIDE_COMMON + ptr->pointSizeArrayTypeOES = GL_FLOAT; +#else + ptr->pointSizeArrayTypeOES = GL_FIXED; +#endif +#endif + + ptr->ambientMaterial[0] = 0.2F; + ptr->ambientMaterial[1] = 0.2F; + ptr->ambientMaterial[2] = 0.2F; + ptr->ambientMaterial[3] = 1.0F; + ptr->diffuseMaterial[0] = 0.8F; + ptr->diffuseMaterial[1] = 0.8F; + ptr->diffuseMaterial[2] = 0.8F; + ptr->diffuseMaterial[3] = 1.0F; +} + +void GL_APIENTRY INTFN(ResetFnptrs)(struct AGContext* ptr) { +#define ACTION(name) do { \ + *(void**)(&ptr->fp##name) = (void*)(&(INTFN(NotBound))); \ + } while (0) +#include "funcaction.inl" +#undef ACTION +} + +void GL_APIENTRY INTFN(BindFnptrs)(struct AGContext* ptr) { + void* dl; + if ((dl = dlopen("libGL.so", RTLD_NOW | RTLD_GLOBAL)) == 0) { + INTFN(SetError)(GL_INVALID_OPERATION); + return; + } +#define ACTION(name) do { \ + *(void**)(&ptr->fp##name) = dlsym(dl, "gl" #name ); \ + if (ptr->fp##name == NULL) { \ + *(void**)(&ptr->fp##name) = dlsym(dl, "gl" #name "EXT"); \ + assert(ptr->fp##name != NULL) ; \ + if (ptr->fp##name == NULL) { \ + *(void**)(&ptr->fp##name) = (void*)(&(INTFN(NotBound))); \ + } \ + } \ + } while (0) +#include "funcaction.inl" +#undef ACTION + dlclose(dl); +} + + +void* GL_APIENTRY EGLCROSS(CreateContext)(void) { + if (INTFN(curContext) = NULL) { + memset(&s_context, 0, sizeof(struct AGContext)); + INTFN(SetDefaultValues)(&s_context); + INTFN(curContext) = &s_context; + INTFN(ResetFnptrs)(&s_context); + } + struct AGContext* ptr = (struct AGContext*)malloc(sizeof(struct AGContext)); + if (ptr == NULL) { + INTFN(SetError)(GL_OUT_OF_MEMORY); + return ptr; + } + memset(ptr, 0, sizeof(struct AGContext)); + INTFN(SetDefaultValues)(ptr); + return ptr; +} + +void GL_APIENTRY EGLCROSS(MakeCurrent)(void* ptr) { + if (INTFN(curContext) = NULL) { + memset(&s_context, 0, sizeof(struct AGContext)); + INTFN(SetDefaultValues)(&s_context); + INTFN(curContext) = &s_context; + INTFN(ResetFnptrs)(&s_context); + } + if (ptr == NULL) { + INTFN(curContext) = &s_context; + return; + } + struct AGContext* pContext = (struct AGContext*)ptr; + INTFN(BindFnptrs)(pContext); + INTFN(curContext) = pContext; + if (pContext->nBuffer == 0) { + pContext->nBuffer = 128; + pContext->pBufferStatus = calloc(128, sizeof(GLint)); + } +} + +void GL_APIENTRY EGLCROSS(ReleaseContext)(void* ptr) { + if (ptr == NULL) return; + struct AGContext* pContext = (struct AGContext*)ptr; + if (pContext == &s_context) return; + if (pContext->pBufferStatus != NULL) free(pContext->pBufferStatus); + free(pContext); + if (pContext == INTFN(curContext)) { + INTFN(curContext) = &s_context; + } +} + diff --git a/es_1_1/gl_context.h b/es_1_1/gl_context.h new file mode 100755 index 0000000..604190a --- /dev/null +++ b/es_1_1/gl_context.h @@ -0,0 +1,243 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#ifndef _ALEXGL_CONTEXT_H_ +#define _ALEXGL_CONTEXT_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "gl_imp.h" + +#define ALEXGL_MAX_LIGHTS 8 +#define ALEXGL_MAX_CLIP_PLANES 6 +#define ALEXGL_MAX_TEXTURE_UNITS 4 + +#define ALEXGL_BUFFER_NULL 0 +#define ALEXGL_BUFFER_GENERATED 1 +#define ALEXGL_BUFFER_BOUND 2 + +struct AGContext { + GLint nBuffer; + GLint* pBufferStatus; + GLboolean vertexArray; + GLint vertexArraySize; + GLenum vertexArrayType; + GLsizei vertexArrayStride; + GLvoid* vertexArrayPointer; +#ifdef ALEXGL_PROVIDE_1_1 + GLuint vertexArrayBufferBinding; +#endif + GLboolean normalArray; + GLenum normalArrayType; + GLsizei normalArrayStride; + GLvoid* normalArrayPointer; +#ifdef ALEXGL_PROVIDE_1_1 + GLuint normalArrayBufferBinding; +#endif + GLboolean colorArray; + GLenum colorArrayType; + GLsizei colorArrayStride; + GLvoid* colorArrayPointer; +#ifdef ALEXGL_PROVIDE_1_1 + GLuint colorArrayBufferBinding; +#endif + GLuint activeTexture; + GLboolean texture2D[ALEXGL_MAX_TEXTURE_UNITS]; + GLuint clientActiveTexture; + GLboolean texCoordArray[ALEXGL_MAX_TEXTURE_UNITS]; + GLint texCoordArraySize[ALEXGL_MAX_TEXTURE_UNITS]; + GLenum texCoordArrayType[ALEXGL_MAX_TEXTURE_UNITS]; + GLsizei texCoordArrayStride[ALEXGL_MAX_TEXTURE_UNITS]; + GLvoid* texCoordArrayPointer[ALEXGL_MAX_TEXTURE_UNITS]; +#ifdef ALEXGL_PROVIDE_1_1 + GLuint texCoordArrayBufferBinding[ALEXGL_MAX_TEXTURE_UNITS]; +#endif +#ifdef ALEXGL_PROVIDE_1_1 + GLboolean pointSizeArrayOES; + GLenum pointSizeArrayTypeOES; + GLsizei pointSizeArrayStrideOES; + GLsizei pointSizeArrayStrideOESGiven; + GLvoid* pointSizeArrayPointerOES; + GLuint pointSizeArrayBufferBindingOES; +#endif + + + GLfloat ambientMaterial[4]; + GLfloat diffuseMaterial[4]; + + GLenum curErrCode; + void (*fpActiveTexture)(GLenum); /* 1.3 */ + void (*fpAlphaFunc)(GLenum, GLclampf); + void (*fpBindBuffer)(GLenum, GLuint); /* 1.5 */ + void (*fpBindTexture)(GLenum, GLuint); + void (*fpBlendFunc)(GLenum, GLenum); + void (*fpBufferData)(GLenum, GLsizeiptr, const GLvoid*, GLenum); /* 1.5 */ + void (*fpBufferSubData)(GLenum, GLintptr, GLsizeiptr, const GLvoid*); /* 1.5 */ + void (*fpClear)(GLbitfield); + void (*fpClearColor)(GLclampf, GLclampf, GLclampf, GLclampf); + void (*fpClearDepth)(GLclampd); + void (*fpClearStencil)(GLint); + void (*fpClientActiveTexture)(GLenum); /* 1.3 */ + void (*fpClipPlane)(GLenum, const GLdouble*); + void (*fpColor4f)(GLfloat, GLfloat, GLfloat, GLfloat); + void (*fpColor4ub)(GLubyte, GLubyte, GLubyte, GLubyte); + void (*fpColorMask)(GLboolean, GLboolean, GLboolean, GLboolean); + void (*fpColorPointer)(GLint, GLenum, GLsizei, const GLvoid*); + void (*fpCopyTexImage2D)(GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint); + void (*fpCopyTexSubImage2D)(GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); + void (*fpCullFace)(GLenum); + void (*fpDeleteBuffers)(GLsizei, const GLuint*); /* 1.5 */ + void (*fpDeleteTextures)(GLsizei, const GLuint*); + void (*fpDepthFunc)(GLenum); + void (*fpDepthMask)(GLboolean); + void (*fpDepthRange)(GLclampd, GLclampd); + void (*fpDisable)(GLenum); + void (*fpDisableClientState)(GLenum); + void (*fpDrawArrays)(GLenum, GLint, GLsizei); + void (*fpDrawElements)(GLenum, GLsizei, GLenum, const GLvoid*); + void (*fpEnable)(GLenum); + void (*fpEnableClientState)(GLenum); + void (*fpFinish)(void); + void (*fpFlush)(void); + void (*fpFogf)(GLenum, GLfloat); + void (*fpFogfv)(GLenum, const GLfloat*); + void (*fpFogi)(GLenum, GLint); + void (*fpFrontFace)(GLenum); + void (*fpFrustum)(GLdouble, GLdouble, GLdouble, GLdouble, GLdouble zNear, GLdouble zFar); + void (*fpGenBuffers)(GLsizei, GLuint*); /* 1.5 */ + void (*fpGenTextures)(GLsizei, GLuint*); + void (*fpGetBooleanv)(GLenum, GLboolean*); + void (*fpGetBufferParameteriv)(GLenum, GLenum, GLint*); /* 1.5 */ + void (*fpGetBufferSubData)(GLenum, GLintptr, GLsizeiptr, GLvoid*); /* 1.5 */ + void (*fpGetClipPlane)(GLenum, GLdouble*); + GLenum (*fpGetError)(void); + void (*fpGetFloatv)(GLenum, GLfloat*); + void (*fpGetIntegerv)(GLenum, GLint*); + void (*fpGetLightfv)(GLenum, GLenum, GLfloat*); + void (*fpGetMaterialfv)(GLenum, GLenum, GLfloat*); + const GLubyte* (*fpGetString)(GLenum); + void (*fpGetTexEnvfv)(GLenum, GLenum, GLfloat*); + void (*fpGetTexEnviv)(GLenum, GLenum, GLint*); + void (*fpGetTexParameterfv)(GLenum, GLenum, GLfloat*); + void (*fpGetTexParameteriv)(GLenum, GLenum, GLint*); + void (*fpHint)(GLenum, GLenum); + GLboolean (*fpIsBuffer)(GLuint); /* 1.5 */ + GLboolean (*fpIsEnabled)(GLenum); + GLboolean (*fpIsTexture)(GLuint); + void (*fpLightModelf)(GLenum, GLfloat); + void (*fpLightModelfv)(GLenum, const GLfloat*); + void (*fpLightf)(GLenum, GLenum, GLfloat); + void (*fpLightfv)(GLenum, GLenum, const GLfloat*); + void (*fpLineWidth)(GLfloat); + void (*fpLoadIdentity)(void); + void (*fpLoadMatrixf)(const GLfloat*); + void (*fpLogicOp)(GLenum); + void (*fpMaterialf)(GLenum, GLenum, GLfloat); + void (*fpMaterialfv)(GLenum, GLenum, const GLfloat*); + void (*fpMatrixMode)(GLenum); + void (*fpMultMatrixf)(const GLfloat*); + void (*fpMultiTexCoord4f)(GLenum, GLfloat, GLfloat, GLfloat, GLfloat); /* EXT */ + void (*fpNormal3f)(GLfloat, GLfloat, GLfloat); + void (*fpNormalPointer)(GLenum, GLsizei, const GLvoid*); + void (*fpOrtho)(GLdouble, GLdouble, GLdouble, GLdouble, GLdouble zNear, GLdouble zFar); + void (*fpPixelStorei)(GLenum, GLint); + void (*fpPointParameterf)(GLenum, GLfloat); /* EXT */ + void (*fpPointParameterfv)(GLenum, const GLfloat*); /* EXT */ + void (*fpPointSize)(GLfloat); + void (*fpPolygonOffset)(GLfloat, GLfloat); + void (*fpPopMatrix)(void); + void (*fpPushMatrix)(void); + void (*fpReadPixels)(GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLvoid*); + void (*fpRotatef)(GLfloat, GLfloat, GLfloat, GLfloat); + void (*fpSampleCoverage)(GLclampf, GLboolean); /* 1.3 */ + void (*fpScalef)(GLfloat, GLfloat, GLfloat); + void (*fpScissor)(GLint, GLint, GLsizei, GLsizei); + void (*fpShadeModel)(GLenum); + void (*fpStencilFunc)(GLenum, GLint, GLuint); + void (*fpStencilMask)(GLuint); + void (*fpStencilOp)(GLenum, GLenum, GLenum); + void (*fpTexCoordPointer)(GLint, GLenum, GLsizei, const GLvoid*); + void (*fpTexEnvf)(GLenum, GLenum, GLfloat); + void (*fpTexEnvfv)(GLenum, GLenum, const GLfloat*); + void (*fpTexEnvi)(GLenum, GLenum, GLint); + void (*fpTexImage2D)(GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid*); + void (*fpTexParameteri)(GLenum, GLenum, GLint); + void (*fpTexSubImage2D)(GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid*); + void (*fpTranslatef)(GLfloat, GLfloat, GLfloat); + void (*fpVertexPointer)(GLint, GLenum, GLsizei, const GLvoid*); + void (*fpViewport)(GLint, GLint, GLsizei, GLsizei); +#if defined(PROVIDING_OES_blend_func_separate) + void (*fpBlendFuncSeparate)(GLenum, GLenum, GLenum, GLenum); +#endif +#if defined(PROVIDING_OES_blend_subtract) + void (*fpBlendEquation)(GLenum); +#endif +#if defined(PROVIDING_OES_texture_cube_map) + void (*fpTexGeni)(GLenum, GLenum, GLint); + void (*fpGetTexGeniv)(GLenum, GLenum, GLint*); + void (*fpGetTexGenfv)(GLenum, GLenum, GLfloat*); +#endif +}; + + +extern struct AGContext* INTFN(curContext); + +#define CCV(name) (INTFN(curContext)->name) +#define FNPTR(name) (INTFN(curContext)->fp##name) + +GL_API void GL_APIENTRY INTFN(NotBound)(void); +GL_API void GL_APIENTRY INTFN(SetDefaultValues)(struct AGContext* pContext); +GL_API void GL_APIENTRY INTFN(ResetFnptrs)(struct AGContext* pContext); +GL_API void GL_APIENTRY INTFN(BindFnptrs)(struct AGContext* pContext); + +#define EGLCROSS(name) __hazel_cross__##name + +GL_API void* GL_APIENTRY EGLCROSS(CreateContext)(void); +GL_API void GL_APIENTRY EGLCROSS(MakeCurrent)(void*); +GL_API void GL_APIENTRY EGLCROSS(ReleaseContext)(void*); + + +/* +GL_API struct AGContext* GL_APIENTRY INTFN(AllocContext)(void); +GL_API void GL_APIENTRY INTFN(PrepareFuncPtr)(struct AGContext* ptr); + +GL_API void GL_APIENTRY __alexgl__CreateContextAction(void); +GL_API void GL_APIENTRY __alexgl__MakeCurrentAction(void); +*/ + +#ifdef __cplusplus +} +#endif + + +#endif diff --git a/es_1_1/gl_imp.h b/es_1_1/gl_imp.h new file mode 100755 index 0000000..79f7c6e --- /dev/null +++ b/es_1_1/gl_imp.h @@ -0,0 +1,123 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#ifndef _ALEXGL_GL_IMP_H_ +#define _ALEXGL_GL_IMP_H_ + +#include <stdio.h> +#include <stdarg.h> +#include <assert.h> + +#undef GL_SRC0_RGB +#undef GL_SRC1_RGB +#undef GL_SRC2_RGB +#undef GL_SRC0_ALPHA +#undef GL_SRC1_ALPHA +#undef GL_SRC2_ALPHA + +#define SIMUL +#define EXTFN(name) gl##name +#include "GLES/gl.h" + +#ifndef INTFN +#define INTFN(name) __alexgl__##name +#endif + +typedef double GLclampd; +typedef double GLdouble; +#define GL_INT 0x1404 +#define GL_READ_WRITE 0x88BA + +/* temporary defines for conformance test */ +#if ! defined(GL_BUFFER_ACCESS) +#define GL_BUFFER_ACCESS 0x88BB /* from original gl.h */ +#endif +#if ! defined(GL_WRITE_ONLY) +#define GL_WRITE_ONLY 0x88B9 /* from original gl.h */ +#endif +#if ! defined(GL_MAX_ELEMENTS_VERTICES) +#define GL_MAX_ELEMENTS_VERTICES 0x80E8 /* from original gl.h */ +#endif +#if ! defined(GL_MAX_ELEMENTS_INDICES) +#define GL_MAX_ELEMENTS_INDICES 0x80E9 /* from original gl.h */ +#endif + + +/********************************************************************************/ +/*** ENGINE OPTIONS *************************************************************/ +/********************************************************************************/ + +/* VERSION: 제공하려는 engine version: 다음 중 하나만 선택할 것 */ +#define ALEXGL_INTERNAL_VERSION 110 /* for GL ES ver. 1.1 */ +#define ALEXGL_PROVIDE_1_1 1 + +/* PROFILE: 제공하려는 profile: 다음 중 하나만 선택할 것 */ +#define ALEXGL_PROVIDE_COMMON 1 /* for common profile */ + +/* GETS: 정확한 get을 지원할 것인가, 하지 않을 것인가. */ +#define ALEXGL_ACCURATE_GET 1 /* for support accurate get functions */ + + +/* +#ifndef ALEXGL_PROVIDE_COMMON +#define ALEXGL_PROVIDE_COMMON 1 +#endif + +#ifndef ALEXGL_PROVIDE_1_1 +#define ALEXGL_PROVIDE_1_1 1 +#endif +*/ + +#include "gl_real.h" + +#define ADDR_ADD(a,b) (GLvoid*)((GLbyte*)(a) + (GLint)(b)) + +#include "gl_context.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define CHECK_ERROR (void)(0) + +GL_API void GL_APIENTRY INTFN(SetError)(GLenum eErrorCode); + +GL_API int GL_APIENTRY INTFN(GetTightStride)(GLint size, GLenum type); +GL_API void GL_APIENTRY INTFN(Fetch)(GLvoid* src, GLreal* dst, GLint size, GLenum type); +GL_API void GL_APIENTRY INTFN(FetchClamp)(GLvoid* src, GLreal* dst, GLint size, GLenum type); + +GL_API void GL_APIENTRY INTFN(ResizeArea)(void** ppArea, int* piCurSize, int iNewSize); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/es_1_1/gl_real.c b/es_1_1/gl_real.c new file mode 100755 index 0000000..fec8bde --- /dev/null +++ b/es_1_1/gl_real.c @@ -0,0 +1,191 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "gl_imp.h" + +void xv2xv(const GLfixed* src, GLfixed* dst, int n) { + while (n--) { + *dst++ = x2x(*src++); + } +} + +void xv2fv(const GLfixed* src, GLfloat* dst, int n) { + while (n--) { + *dst++ = x2f(*src++); + } +} + +void xv2dv(const GLfixed* src, GLdouble* dst, int n) { + while (n--) { + *dst++ = x2d(*src++); + } +} + +void fv2xv(const GLfloat* src, GLfixed* dst, int n) { + while (n--) { + *dst++ = f2x(*src++); + } +} + +void fv2fv(const GLfloat* src, GLfloat* dst, int n) { + while (n--) { + *dst++ = f2f(*src++); + } +} + +void fv2dv(const GLfloat* src, GLdouble* dst, int n) { + while (n--) { + *dst++ = f2d(*src++); + } +} + +void dv2xv(const GLdouble* src, GLfixed* dst, int n) { + while (n--) { + *dst++ = d2x(*src++); + } +} + +void dv2fv(const GLdouble* src, GLfloat* dst, int n) { + while (n--) { + *dst++ = d2f(*src++); + } +} + +void xv2boolv(const GLfixed* src, GLboolean* dst, int n) { + while (n--) { + *dst++ = x2bool(*src++); + } +} + +void fv2boolv(const GLfloat* src, GLboolean* dst, int n) { + while (n--) { + *dst++ = f2bool(*src++); + } +} + +void clampxv2boolv(const GLfixed* src, GLboolean* dst, int n) { + while (n--) { + *dst++ = clampx2bool(*src++); + } +} + +void clampfv2boolv(const GLfloat* src, GLboolean* dst, int n) { + while (n--) { + *dst++ = clampf2bool(*src++); + } +} + + + +void bv2xv(const GLbyte* src, GLfixed* dst, int n) { + while (n--) { + *dst++ = b2x(*src++); + } +} + +void bv2fv(const GLbyte* src, GLfloat* dst, int n) { + while (n--) { + *dst++ = b2f(*src++); + } +} + +void bv2clampxv(const GLbyte* src, GLfixed* dst, int n) { + while (n--) { + *dst++ = b2clampx(*src++); + } +} + +void bv2clampfv(const GLbyte* src, GLfloat* dst, int n) { + while (n--) { + *dst++ = b2clampf(*src++); + } +} + +void ubv2clampxv(const GLbyte* src, GLfixed* dst, int n) { + while (n--) { + *dst++ = ub2clampx(*src++); + } +} + +void ubv2clampfv(const GLbyte* src, GLfloat* dst, int n) { + while (n--) { + *dst++ = ub2clampf(*src++); + } +} + +void sv2xv(const GLshort* src, GLfixed* dst, int n) { + while (n--) { + *dst++ = s2x(*src++); + } +} + +void sv2fv(const GLshort* src, GLfloat* dst, int n) { + while (n--) { + *dst++ = s2f(*src++); + } +} + +void sv2clampxv(const GLshort* src, GLfixed* dst, int n) { + while (n--) { + *dst++ = s2clampx(*src++); + } +} + +void sv2clampfv(const GLshort* src, GLfloat* dst, int n) { + while (n--) { + *dst++ = s2clampf(*src++); + } +} + +void xv2iv(const GLfixed* src, GLint* dst, int n) { + while (n--) { + *dst++ = x2i(*src++); + } +} + +void fv2iv(const GLfloat* src, GLint* dst, int n) { + while (n--) { + *dst++ = f2i(*src++); + } +} + +void clampxv2iv(const GLfixed* src, GLint* dst, int n) { + while (n--) { + *dst++ = clampx2i(*src++); + } +} + +void clampfv2iv(const GLfloat* src, GLint* dst, int n) { + while (n--) { + *dst++ = clampf2i(*src++); + } +} + diff --git a/es_1_1/gl_real.h b/es_1_1/gl_real.h new file mode 100755 index 0000000..c9cc641 --- /dev/null +++ b/es_1_1/gl_real.h @@ -0,0 +1,219 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* +type conventions: +bool boolean +enum enumerated +b byte +ub unsinged byte +s short +us unsigned short +i int +ui unsigned int +x fixed +clampx clamped fixed [0,1] (for color and normal) +f float +clampf clamped float [0,1] (for color and normal) +d double (only for OpenGL emulation) +*/ + +#define __GL_X_FRAC_BITS 16 + +#define FIXED_ZERO 0 +#define FIXED_ONE (1 << __GL_X_FRAC_BITS) + +#define FLOAT_ZERO 0.0F +#define FLOAT_ONE 1.0F + +#if defined(ALEXGL_FIXED_CORE) +typedef GLfixed GLreal; +#define REAL_ZERO FIXED_ZERO +#define REAL_ONE FIXED_ONE +#else +typedef GLfloat GLreal; +#define REAL_ZERO FLOAT_ZERO +#define REAL_ONE FLOAT_ONE +#endif + +typedef GLreal GLrealVec3[3]; +typedef GLreal GLrealVec4[4]; +typedef GLreal GLrealMat4[16]; + +#define x2x(a) (a) +#define x2f(a) ((float)(a)/(1<<__GL_X_FRAC_BITS)) +#define x2d(a) ((double)(a)/(1<<__GL_X_FRAC_BITS)) +#define f2x(a) ((int)((a)*(1<<__GL_X_FRAC_BITS))) +#define f2f(a) ((float)(a)) +#define f2d(a) ((double)(a)) +#define d2x(a) ((int)((a)*(1<<__GL_X_FRAC_BITS))) +#define d2f(a) ((float)(a)) +void xv2xv(const GLfixed* src, GLfixed* dst, int n); +void xv2fv(const GLfixed* src, GLfloat* dst, int n); +void xv2dv(const GLfixed* src, GLdouble* dst, int n); +void fv2xv(const GLfloat* src, GLfixed* dst, int n); +void fv2fv(const GLfloat* src, GLfloat* dst, int n); +void fv2dv(const GLfloat* src, GLdouble* dst, int n); +void dv2xv(const GLdouble* src, GLfixed* dst, int n); +void dv2fv(const GLdouble* src, GLfloat* dst, int n); + +#if defined(ALEXGL_FIXED_CORE) +#define x2r(a) x2x(a) +#define f2r(a) f2x(a) +#define r2x(a) x2x(a) +#define r2f(a) x2f(a) +#define rv2xv(s,d,n) xv2xv(s,d,n) +#define rv2fv(s,d,n) xv2fv(s,d,n) +#define xv2rv(s,d,n) xv2xv(s,d,n) +#define fv2rv(s,d,n) fv2xv(s,d,n) +#define clamprv2xv(s,d,n) xv2xv(s,d,n) +#define clamprv2fv(s,d,n) xv2fv(s,d,n) +#define xv2clamprv(s,d,n) xv2xv(s,d,n) +#define fv2clamprv(s,d,n) fv2xv(s,d,n) +#else +#define x2r(a) x2f(a) +#define f2r(a) f2f(a) +#define r2x(a) f2x(a) +#define r2f(a) f2f(a) +#define rv2xv(s,d,n) fv2xv(s,d,n) +#define rv2fv(s,d,n) fv2fv(s,d,n) +#define xv2rv(s,d,n) xv2fv(s,d,n) +#define fv2rv(s,d,n) fv2fv(s,d,n) +#define clamprv2xv(s,d,n) fv2xv(s,d,n) +#define clamprv2fv(s,d,n) fv2fv(s,d,n) +#define xv2clamprv(s,d,n) xv2fv(s,d,n) +#define fv2clamprv(s,d,n) fv2fv(s,d,n) +#endif + +#define enum2bool(a) ((a) != 0) +#define i2bool(a) ((a) != 0) +#define x2bool(a) ((a) != 0) +#define f2bool(a) ((a) != 0.0F) +#define clampx2bool(a) ((a) != 0) +#define clampf2bool(a) ((a) != 0.0F) +void xv2boolv(const GLfixed* src, GLboolean* dst, int n); +void fv2boolv(const GLfloat* src, GLboolean* dst, int n); +void clampxv2boolv(const GLfixed* src, GLboolean* dst, int n); +void clampfv2boolv(const GLfloat* src, GLboolean* dst, int n); + +#if defined(ALEXGL_FIXED_CORE) +#define rv2boolv(s,d,n) xv2boolv(s,d,n) +#define clamprv2boolv(s,d,n) clampxv2boolv(s,d,n) +#else +#define rv2boolv(s,d,n) fv2boolv(s,d,n) +#define clamprv2boolv(s,d,n) clampfv2boolv(s,d,n) +#endif + +#define enum2i(a) (a) +#define enum2x(a) (a) +#define enum2f(a) ((float)(a)) + +#if defined(ALEXGL_FIXED_CORE) +#else +#endif + +#define b2x(a) ((a) << __GL_X_FRAC_BITS) +#define b2f(a) ((float)(a)) +#define b2clampx(a) ((((GLint)(a)*2+1)<<__GL_X_FRAC_BITS)/255) +#define b2clampf(a) (((float)(a)*2.0F+1.0F)/255.0F) +#define ub2clampx(a) (((GLuint)(a)<<__GL_X_FRAC_BITS)/255) +#define ub2clampf(a) ((float)(a)/255.0F) +void bv2xv(const GLbyte* src, GLfixed* dst, int n); +void bv2fv(const GLbyte* src, GLfloat* dst, int n); +void bv2clampxv(const GLbyte* src, GLfixed* dst, int n); +void bv2clampfv(const GLbyte* src, GLfloat* dst, int n); +void ubv2clampxv(const GLbyte* src, GLfixed* dst, int n); +void ubv2clampfv(const GLbyte* src, GLfloat* dst, int n); + +#if defined(ALEXGL_FIXED_CORE) +#define ub2clampr(a) ub2clampx(a) +#define bv2rv(s,d,n) bv2xv(s,d,n) +#define bv2clamprv(s,d,n) bv2clampxv(s,d,n) +#define ubv2clamprv(s,d,n) ubv2clampxv(s,d,n) +#else +#define ub2clampr(a) ub2clampf(a) +#define bv2rv(s,d,n) bv2fv(s,d,n) +#define bv2clamprv(s,d,n) bv2clampfv(s,d,n) +#define ubv2clamprv(s,d,n) ubv2clampfv(s,d,n) +#endif + +#define s2x(a) ((a) << __GL_X_FRAC_BITS) +#define s2f(a) ((float)(a)) +#define s2clampx(a) (GLfixed)((((long long)(a)*2+1)<<__GL_X_FRAC_BITS)/65535) +#define s2clampf(a) (((float)(a)*2.0F+1.0F)/65535.0F) +void sv2xv(const GLshort* src, GLfixed* dst, int n); +void sv2fv(const GLshort* src, GLfloat* dst, int n); +void sv2clampxv(const GLshort* src, GLfixed* dst, int n); +void sv2clampfv(const GLshort* src, GLfloat* dst, int n); + +#if defined(ALEXGL_FIXED_CORE) +#define sv2rv(s,d,n) sv2xv(s,d,n) +#define sv2clamprv(s,d,n) sv2clampxv(s,d,n) +#else +#define sv2rv(s,d,n) sv2fv(s,d,n) +#define sv2clamprv(s,d,n) sv2clampfv(s,d,n) +#endif + +#define i2i(a) (GLint)(a) +#define i2x(a) ((a)<<__GL_X_FRAC_BITS) +#define i2f(a) ((float)(a)) +#define x2i(a) (GLint)(((a) + (1 << (__GL_X_FRAC_BITS - 1))) >> __GL_X_FRAC_BITS) +#define f2i(a) (GLint)((a)+.5F) +#define clampx2i(a) (GLint)((0x7FFFFFFFFLL * (long long)(a)) >> __GL_X_FRAC_BITS) +#define clampf2i(a) (GLint)((65536.0F * 65536.0F * (a) - 1.0F) / 2.0F); +void xv2iv(const GLfixed* src, GLint* dst, int n); +void fv2iv(const GLfloat* src, GLint* dst, int n); +void clampxv2iv(const GLfixed* src, GLint* dst, int n); +void clampfv2iv(const GLfloat* src, GLint* dst, int n); + +#if defined(ALEXGL_FIXED_CORE) +#define rv2iv(s,d,n) xv2iv(s,d,n) +#define clamprv2iv(s,d,n) clampxv2iv(s,d,n) +#else +#define rv2iv(s,d,n) fv2iv(s,d,n) +#define clamprv2iv(s,d,n) clampfv2iv(s,d,n) +#endif + +/* print */ +extern int xprintf(const char* format, ...); +extern int xfprintf(FILE* file, const char* format, ...); +extern int xsprintf(const char* string, const char* format, ...); +extern int xvprintf(const char* format, va_list arg); +extern int xvfprintf(FILE* file, const char* format, va_list arg); +extern int xvsprintf(const char* string, const char* format, va_list arg); + +#ifdef __cplusplus +} +#endif diff --git a/es_1_1/makefile b/es_1_1/makefile new file mode 100755 index 0000000..c5baae4 --- /dev/null +++ b/es_1_1/makefile @@ -0,0 +1,22 @@ +#!make + +default: +# make -f makefile-static clean + make -f makefile-dynamic clean +# make -f makefile-static install +# make -f makefile-static clean + make -f makefile-dynamic install + +install: + make -f makefile-dynamic install + +clean: +# make -f makefile-static clean + make -f makefile-dynamic clean + +clobber: +# make -f makefile-static clobber + make -f makefile-dynamic clobber + +wc: + make -f makefile-dynamic wc diff --git a/es_1_1/makefile-dynamic b/es_1_1/makefile-dynamic new file mode 100755 index 0000000..de5adb6 --- /dev/null +++ b/es_1_1/makefile-dynamic @@ -0,0 +1,84 @@ +#!/bin/make + +CFLAGS = -I. -I../include -fPIC -Werror-implicit-function-declaration -O0 -g3 +ARFLAGS = rucv + +CFLAGS += -DPROVIDING_OES_blend_func_separate +CFLAGS += -DPROVIDING_OES_blend_subtract +CFLAGS += -DPROVIDING_OES_byte_coordinates # core: always on +CFLAGS += -DPROVIDING_OES_fixed_point # core: always on +CFLAGS += -DPROVIDING_OES_matrix_get # core: alwyas on +CFLAGS += -DPROVIDING_OES_point_size_array # required: OES_point_sprite required +CFLAGS += -DPROVIDING_OES_point_sprite # required: +CFLAGS += -DPROVIDING_OES_query_matrix # OES_fixed_point is required +CFLAGS += -DPROVIDING_OES_single_precision # core: always on +CFLAGS += -DPROVIDING_OES_stencil_wrap +CFLAGS += -DPROVIDING_OES_texture_cube_map +CFLAGS += -DPROVIDING_OES_texture_env_crossbar +CFLAGS += -DPROVIDING_OES_texture_mirrored_repeat +CFLAGS += -DPROVIDING_OES_element_index_uint + # never CFLAGS += -DPROVIDING_OES_texture_3D # only for ES 2.0 + # never CFLAGS += -DPROVIDING_OES_texture_npot # only for ES 2.0 + +LIBBASE = libGLESv1_CM.so +LIBVER = 1.0 +LIB = $(LIBBASE).$(LIBVER) + +END = +SRCS = \ + 25Error.c \ + 25enable.c \ + 27state.c \ + 28array.c \ + 29buffer.c \ + 2Axform.c \ + 2Bclip.c \ + 2Ccolor.c \ + 2PdrawArray.c \ + 2QdrawElements.c \ + 33point.c \ + 34line.c \ + 35polygon.c \ + 36pixel.c \ + 37texture.c \ + 38fog.c \ + 3Btexpal.c \ + 41frag.c \ + 42frame.c \ + 43read.c \ + 50flush.c \ + 60get.c \ + 80ext.c \ + gl_real.c \ + gl_context.c \ + EGLImage.c \ + $(END) +OBJS = $(SRCS:.c=.o) + + +default: __touch__ $(LIB) + + +__touch__: + touch 60get.c + +$(LIB): $(OBJS) + $(CC) -shared -Wl,-soname,$(LIBBASE).1 -o $@ $(OBJS) -ldl + +install: $(LIB) + cp $(LIB) ../lib/host-gl/ + +# supports + +clean: + $(RM) $(RMFLAGS) $(OBJS) + +clobber: clean + $(RM) $(RMFLAGS) $(LIB) core a.out + +wc: + wc $(SRCS) *.inl *.h + +#$(OBJS): GLES/gl.h gl_imp.h gl_context.h + +60get.o: 6ZgetCore.inl diff --git a/es_1_1/makefile-static b/es_1_1/makefile-static new file mode 100755 index 0000000..86a5bf9 --- /dev/null +++ b/es_1_1/makefile-static @@ -0,0 +1,70 @@ +#!/bin/make + +CFLAGS = -I. -I../include -Werror-implicit-function-declaration -O0 -g3 +ARFLAGS = rucv + +CFLAGS += -DPROVIDING_OES_fixed_point # core: always on +CFLAGS += -DPROVIDING_OES_point_size_array # required: OES_point_sprite required +CFLAGS += -DPROVIDING_OES_point_sprite # required: +CFLAGS += -DPROVIDING_OES_query_matrix # OES_fixed_point is required + +LIB = libGLESv1_CM.a + +END = +SRCS = \ + 25Error.c \ + 25enable.c \ + 27state.c \ + 28array.c \ + 29buffer.c \ + 2Axform.c \ + 2Bclip.c \ + 2Ccolor.c \ + 2PdrawArray.c \ + 2QdrawElements.c \ + 33point.c \ + 34line.c \ + 35polygon.c \ + 36pixel.c \ + 37texture.c \ + 38fog.c \ + 3Btexpal.c \ + 41frag.c \ + 42frame.c \ + 43read.c \ + 50flush.c \ + 60get.c \ + 80ext.c \ + gl_real.c \ + gl_context.c \ + EGLImage.c \ + $(END) +OBJS = $(SRCS:.c=.o) + + +default: __touch__ $(LIB) + + +__touch__: + touch 60get.c + +$(LIB): $(OBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) + +install: $(LIB) + cp $(LIB) ../lib + +# supports + +clean: + $(RM) $(RMFLAGS) $(OBJS) + +clobber: clean + $(RM) $(RMFLAGS) $(LIB) core a.out + +wc: + wc $(SRCS) *.inl *.h + +$(OBJS): GLES/gl.h gl_imp.h gl_context.h + +60get.c: 6ZgetCore.inl diff --git a/es_2_0/Buffer.c b/es_2_0/Buffer.c new file mode 100755 index 0000000..25d1fad --- /dev/null +++ b/es_2_0/Buffer.c @@ -0,0 +1,334 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. 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 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 "es2front.h" +#include "./GLES2/gl2ext.h" + + +void GL_APIENTRY ES2INTER(BufferObjectInit)(struct BufferObjectUnit* pUnit) { + pUnit->bGenerated = GL_FALSE; + pUnit->uSize = 0; + pUnit->eUsage = GL_STATIC_DRAW; + pUnit->pData = NULL; + pUnit->pConverted = NULL; + pUnit->uOffset = 0; +} + +void GL_APIENTRY ES2INTER(BufferObjectRelease)(struct BufferObjectUnit* pUnit) { + if (pUnit->pData != NULL) { + free(pUnit->pData); + } + if (pUnit->pConverted != NULL) { + free(pUnit->pConverted); + } + pUnit->bGenerated = GL_FALSE; + pUnit->uSize = 0; + pUnit->eUsage = GL_STATIC_DRAW; + pUnit->pData = NULL; + pUnit->pConverted = NULL; + pUnit->uOffset = 0; +} + +GLboolean GL_APIENTRY ES2INTER(BufferObjectAssure)(const char* funcname, GLint iMaxIndex) { + register struct BufferObjectUnit* ptr; + register GLint nAllocated; + register int i; + nAllocated = CCV(nBufferObjectAllocated); + if (iMaxIndex < nAllocated) return GL_TRUE; + while (iMaxIndex >= nAllocated) { + nAllocated *= 2; + } + ptr = realloc(CCV(pBufferObject), nAllocated * sizeof(struct BufferObjectUnit)); + if (ptr == NULL) { + SET_ERROR(GL_OUT_OF_MEMORY, "%s: cannot allocate %d bytes\n", + funcname, nAllocated * sizeof(struct BufferObjectUnit)); + return GL_FALSE; + } + for (i = CCV(nBufferObjectAllocated); i < nAllocated; i++) { + ES2INTER(BufferObjectInit)(&(ptr[i])); + } + CCV(pBufferObject) = ptr; + CCV(nBufferObjectAllocated) = nAllocated; + return GL_TRUE; +} + +void GL_APIENTRY ES2ENTRY(GenBuffers)(GLsizei n, GLuint* buffers) { +#define FUNC_NAME "GenBuffers" + register GLint iMaxIndex; + register int i; + if (n < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } else if (n == 0) { + return; + } + FNPTR(GenBuffers)(n, buffers); + iMaxIndex = buffers[0]; + for (i = 1; i < n; i++) { + if (iMaxIndex < buffers[i]) iMaxIndex = buffers[i]; + } + if (ES2INTER(BufferObjectAssure)(FUNC_NAME, iMaxIndex) == GL_FALSE) { + return; + } + for (i = 0; i < n; i++) { + int ind = buffers[i]; + CCV(pBufferObject)[ind].bGenerated = GL_TRUE; + } +#undef FUNC_NAME +} + +void GL_APIENTRY ES2ENTRY(DeleteBuffers)(GLsizei n, const GLuint* buffers) { + register int i, j; + if (n < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + for (i = 0; i < n; i++) { + register GLuint iBuffer = buffers[i]; + if (iBuffer != 0 + && iBuffer < CCV(nBufferObjectAllocated) + && CCV(pBufferObject)[iBuffer].bGenerated == GL_TRUE) { + for (j = 0; j < CCV(nMaxVertexAttribs); j++) { + if (CCV(pVertexAttrib[j].uBufferBinding) == iBuffer) { + CCV(pVertexAttrib[j].uBufferBinding) = 0; + } + } + if (CCV(uArrayBufferBinding) == iBuffer) { + CCV(uArrayBufferBinding) = 0; + } + if (CCV(uElementArrayBufferBinding) == iBuffer) { + CCV(uElementArrayBufferBinding) = 0; + } + ES2INTER(BufferObjectRelease)(&(CCV(pBufferObject)[iBuffer])); + } + } + FNPTR(DeleteBuffers)(n, buffers); +} + +GLboolean GL_APIENTRY ES2ENTRY(IsBuffer)(GLuint buffer) { + GLboolean bAnswer, bCheck; + bAnswer = FNPTR(IsBuffer)(buffer); + bCheck = (0 < buffer) && (buffer < CCV(nBufferObjectAllocated) + && CCV(pBufferObject)[buffer].bGenerated == GL_TRUE); + return bAnswer; +} + +void GL_APIENTRY ES2ENTRY(BindBuffer)(GLenum target, GLuint buffer) { + switch (target) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_ARRAY_BUFFER: + CCV(uArrayBufferBinding) = buffer; + FNPTR(BindBuffer)(target, buffer); + break; + case GL_ELEMENT_ARRAY_BUFFER: + CCV(uElementArrayBufferBinding) = buffer; + FNPTR(BindBuffer)(target, buffer); + break; + } +} + +void GL_APIENTRY ES2ENTRY(GetBufferParameteriv)(GLenum target, GLenum pname, GLint* params) { + register int iBuffer; + switch (target) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_ARRAY_BUFFER: + iBuffer = CCV(uArrayBufferBinding); + break; + case GL_ELEMENT_ARRAY_BUFFER: + iBuffer = CCV(uElementArrayBufferBinding); + break; + } + if (iBuffer == 0) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + switch (pname) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_BUFFER_SIZE: + if (iBuffer < CCV(nBufferObjectAllocated) + && CCV(pBufferObject)[iBuffer].bGenerated == GL_TRUE) { + params[0] = (GLint)(CCV(pBufferObject)[iBuffer].uSize); + } else { + params[0] = 0; + } + break; + case GL_BUFFER_USAGE: + if (iBuffer < CCV(nBufferObjectAllocated) + && CCV(pBufferObject)[iBuffer].bGenerated == GL_TRUE) { + params[0] = (GLint)(CCV(pBufferObject)[iBuffer].eUsage); + } else { + params[0] = (GLint)(GL_STATIC_DRAW); + } + break; + case GL_BUFFER_ACCESS_OES: + params[0] = GL_WRITE_ONLY_OES; + break; + case GL_BUFFER_MAPPED_OES: + params[0] = GL_FALSE; + break; + } +} + +void GL_APIENTRY ES2ENTRY(BufferData)(GLenum target, + GLsizeiptr size, const GLvoid* data, GLenum usage) { +#define FUNC_NAME "BufferData" + register struct BufferObjectUnit* pUnit; + int iBuffer; + GLvoid* pData; + GLintptr uOffset; + switch (target) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_ARRAY_BUFFER: + iBuffer = CCV(uArrayBufferBinding); + break; + case GL_ELEMENT_ARRAY_BUFFER: + iBuffer = CCV(uElementArrayBufferBinding); + break; + } + if (iBuffer == 0) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + if (size < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + switch (usage) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_STREAM_DRAW: + case GL_STATIC_DRAW: + case GL_DYNAMIC_DRAW: + break; + } + if (ES2INTER(BufferObjectAssure)(FUNC_NAME, iBuffer) == GL_FALSE) { + return; + } + if (CCV(pBufferObject[iBuffer].bGenerated) == GL_FALSE) { + CCV(pBufferObject)[iBuffer].bGenerated = GL_TRUE; + } + pUnit = &(CCV(pBufferObject[iBuffer])); + uOffset = ((size + 3) / 4) * 4; + pData = realloc(pUnit->pData, 2 * uOffset); + if (pData == NULL) { + ES2INTER(SetError)(GL_OUT_OF_MEMORY); + return; + } + pUnit->uSize = size; + pUnit->eUsage = usage; + pUnit->pData = pData; + if ((pUnit->pConverted = realloc(pUnit->pConverted, uOffset)) == NULL) { + ES2INTER(SetError)(GL_OUT_OF_MEMORY); + return; + } + pUnit->uOffset = uOffset; + if (data != NULL) { + GLfixed* pFixed = (GLfixed*)data; + GLfloat* pFloat = (GLfloat*)((GLubyte*)pData + uOffset); + int nCount = uOffset / sizeof(GLfixed); + while (nCount--) { + register GLfixed xValue = *pFixed++; + register GLfloat fValue = fixed_to_float(xValue); + *pFloat++ = fValue; + } + memcpy(pData, data, size); + FNPTR(BufferData)(target, pUnit->uOffset * 2, pUnit->pData, usage); + pFixed = (GLfixed*)data; + pFloat = (GLfloat*)(pUnit->pConverted); + nCount = uOffset / sizeof(GLfixed); + while (nCount--) { + register GLfixed xValue = *pFixed++; + register GLfloat fValue = fixed_to_float(xValue); + *pFloat++ = fValue; + } + } else { + memset(pData, 0, 2 * pUnit->uOffset); + memset(pUnit->pConverted, 0, pUnit->uOffset); + FNPTR(BufferData)(target, pUnit->uOffset * 2, NULL, usage); + } +#undef FUNC_NAME +} + +void GL_APIENTRY ES2ENTRY(BufferSubData)(GLenum target, + GLintptr offset, GLsizeiptr size, const GLvoid* data) { +#define FUNC_NAME "BufferSubData" + register struct BufferObjectUnit* pUnit; + int iBuffer; + GLfixed* pFixed; + GLfloat* pFloat; + int nCount; + switch (target) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_ARRAY_BUFFER: + iBuffer = CCV(uArrayBufferBinding); + break; + case GL_ELEMENT_ARRAY_BUFFER: + iBuffer = CCV(uElementArrayBufferBinding); + break; + } + if (iBuffer == 0) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + if (offset < 0 || size < 0 || offset + size > CCV(pBufferObject[iBuffer].uSize)) { + ES2INTER(SetError)(GL_INVALID_VALUE); + } + if (ES2INTER(BufferObjectAssure)(FUNC_NAME, iBuffer) == GL_FALSE) { + return; + } + if (CCV(pBufferObject[iBuffer].bGenerated) == GL_FALSE) { + CCV(pBufferObject)[iBuffer].bGenerated = GL_TRUE; + } + pUnit = &(CCV(pBufferObject[iBuffer])); + pFixed = (GLfixed*)((GLubyte*)(pUnit->pData) + offset); + memcpy(pFixed, data, size); + pFloat = (GLfloat*)((GLubyte*)(pFixed) + pUnit->uOffset); + nCount = size / sizeof(GLfixed); + while (nCount--) { + register GLfixed xValue = *pFixed++; + register GLfloat fValue = fixed_to_float(xValue); + *pFloat++ = fValue; + } + FNPTR(BufferSubData)(target, offset, size, data); + FNPTR(BufferSubData)(target, offset + pUnit->uOffset, size, + ((GLchar*)(pUnit->pData) + pUnit->uOffset + offset)); + pFixed = (GLfixed*)(data); + pFloat = (GLfloat*)((GLubyte*)(pUnit->pConverted) + offset); + nCount = size / sizeof(GLfixed); + while (nCount--) { + register GLfixed xValue = *pFixed++; + register GLfloat fValue = fixed_to_float(xValue); + *pFloat++ = fValue; + } +#undef FUNC_NAME +} diff --git a/es_2_0/Clear.c b/es_2_0/Clear.c new file mode 100755 index 0000000..affc18e --- /dev/null +++ b/es_2_0/Clear.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "es2front.h" + + +void GL_APIENTRY ES2ENTRY(Clear)(GLbitfield mask) { + if ((mask & ~(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT)) != 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + FNPTR(Clear)(mask); +} + +void GL_APIENTRY ES2ENTRY(ClearColor)(GLclampf red, + GLclampf green, GLclampf blue, GLclampf alpha) { + FNPTR(ClearColor)(red, green, blue, alpha); +} + +void GL_APIENTRY ES2ENTRY(ClearDepthf)(GLclampf depth) { + FNPTR(ClearDepth)((GLclampd)(depth)); +} + +void GL_APIENTRY ES2ENTRY(ClearStencil)(GLint s) { + FNPTR(ClearStencil)(s); +} + +void GL_APIENTRY ES2ENTRY(ColorMask)(GLboolean red, + GLboolean green, GLboolean blue, GLboolean alpha) { + FNPTR(ColorMask)(red, green, blue, alpha); +} + +void GL_APIENTRY ES2ENTRY(DepthMask)(GLboolean flag) { + FNPTR(DepthMask)(flag); +} + +void GL_APIENTRY ES2ENTRY(StencilMask)(GLuint mask) { + FNPTR(StencilMask)(mask); +} + +void GL_APIENTRY ES2ENTRY(StencilMaskSeparate)(GLenum face, GLuint mask) { + switch (face) { + default: + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + case GL_FRONT: + case GL_BACK: + case GL_FRONT_AND_BACK: + break; + } + FNPTR(StencilMaskSeparate)(face, mask); +} + + diff --git a/es_2_0/Compressed.c b/es_2_0/Compressed.c new file mode 100755 index 0000000..f2002eb --- /dev/null +++ b/es_2_0/Compressed.c @@ -0,0 +1,156 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "es2front.h" + + +#ifndef GL_TEXTURE_WIDTH +#define GL_TEXTURE_WIDTH 0x1000 +#endif + +#ifndef GL_TEXTURE_HEIGHT +#define GL_TEXTURE_HEIGHT 0x1001 +#endif + + +void GL_APIENTRY ES2ENTRY(CompressedTexImage2D)(GLenum target, + GLint level, GLenum internalformat, GLsizei width, GLsizei height, + GLint border, GLsizei imageSize, const void* data) { + GLint iCompressedTexFormats[64]; + GLint nCompressedTexFormats; + int iMaxSize; + int i; + switch (target) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_TEXTURE_2D: + FNPTR(GetIntegerv)(GL_MAX_TEXTURE_SIZE, &iMaxSize); + break; + case GL_TEXTURE_CUBE_MAP_POSITIVE_X: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: + if (width != height) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + FNPTR(GetIntegerv)(GL_MAX_CUBE_MAP_TEXTURE_SIZE, &iMaxSize); + break; + } + FNPTR(GetIntegerv)(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &nCompressedTexFormats); + FNPTR(GetIntegerv)(GL_COMPRESSED_TEXTURE_FORMATS, iCompressedTexFormats); + for (i = 0; i < nCompressedTexFormats; i++) { + if (iCompressedTexFormats[i] == internalformat) break; + } + if (i == nCompressedTexFormats) { + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + } + if (level < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } else if (ES2INTER(Log2)(iMaxSize) < level) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + if (width < 0 || iMaxSize < width || height < 0 || iMaxSize < height) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + if (border != 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + + FNPTR(CompressedTexImage2D)(target, level, internalformat, width, height, border, + imageSize, data); +} + +void GL_APIENTRY ES2ENTRY(CompressedTexSubImage2D)(GLenum target, + GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, + GLenum format, GLsizei imageSize, const GLvoid* data) { + GLint iCompressedTexFormats[64]; + GLint nCompressedTexFormats; + int iMaxSize; + int iWidth, iHeight; + int iInternalFormat; + int i; + switch (target) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_TEXTURE_2D: + FNPTR(GetIntegerv)(GL_MAX_TEXTURE_SIZE, &iMaxSize); + break; + case GL_TEXTURE_CUBE_MAP_POSITIVE_X: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: + if (width != height) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + FNPTR(GetIntegerv)(GL_MAX_CUBE_MAP_TEXTURE_SIZE, &iMaxSize); + break; + } + FNPTR(GetIntegerv)(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &nCompressedTexFormats); + FNPTR(GetIntegerv)(GL_COMPRESSED_TEXTURE_FORMATS, iCompressedTexFormats); + for (i = 0; i < nCompressedTexFormats; i++) { + if (iCompressedTexFormats[i] == format) break; + } + if (i == nCompressedTexFormats) { + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + } + if (level < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } else if (ES2INTER(Log2)(iMaxSize) < level) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + if (width < 0 || height < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + FNPTR(GetTexLevelParameteriv)(target, level, GL_TEXTURE_WIDTH, &iWidth); + FNPTR(GetTexLevelParameteriv)(target, level, GL_TEXTURE_HEIGHT, &iHeight); + if (xoffset < 0 || iWidth < (xoffset + width) || yoffset < 0 || iHeight < (yoffset + height)) { + ES2INTER(SetError)(GL_INVALID_VALUE); + } + FNPTR(CompressedTexSubImage2D)(target, level, xoffset, yoffset, width, height, format, + imageSize, data); +} diff --git a/es_2_0/DrawArray.c b/es_2_0/DrawArray.c new file mode 100755 index 0000000..171c573 --- /dev/null +++ b/es_2_0/DrawArray.c @@ -0,0 +1,132 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "es2front.h" + + +void GL_APIENTRY ES2ENTRY(DrawArrays)(GLenum mode, GLint first, GLsizei count) { + GLint iArrayBufferBinding; + GLvoid* pNewArea; + GLchar* pFixedBase; + GLfloat* pFloat; + int i, j; + GLboolean bSpecial = (CCV(pVertexAttrib[0].bEnabled) == GL_FALSE) + && (CCV(pVertexAttrib[1].bEnabled) == GL_TRUE); + if (mode < 0 || GL_TRIANGLE_FAN < mode) { + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + } + if (count < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } else if (count == 0) { + return; + } + + FNPTR(GetIntegerv)(GL_ARRAY_BUFFER_BINDING, &iArrayBufferBinding); + FNPTR(BindBuffer)(GL_ARRAY_BUFFER, 0); + for (i = 0; i < CCV(nMaxVertexAttribs); i++) { + register struct VertexAttribUnit* pVertexAttrib = &(CCV(pVertexAttrib[i])); + if (pVertexAttrib->bEnabled == GL_FALSE) continue; + if (i == 1 && bSpecial == GL_TRUE && pVertexAttrib->eType != GL_FIXED) { + FNPTR(BindBuffer)(GL_ARRAY_BUFFER, pVertexAttrib->uBufferBinding); + FNPTR(VertexAttribPointer)(0, pVertexAttrib->iSize, + pVertexAttrib->eType, pVertexAttrib->bNormalized, pVertexAttrib->uStride, + pVertexAttrib->pData); + FNPTR(BindBuffer)(GL_ARRAY_BUFFER, 0); + } + if (pVertexAttrib->eType != GL_FIXED) continue; + if (pVertexAttrib->uBufferBinding != 0) { + register GLuint uBuffer = pVertexAttrib->uBufferBinding; + register struct BufferObjectUnit* pBufferObject = &CCV(pBufferObject[uBuffer]); +#if defined(USE_CONVERTED) + register GLubyte* pConverted = (GLubyte*)(pBufferObject->pConverted) + + (GLsizei)(pVertexAttrib->pData); + FNPTR(BindBuffer)(GL_ARRAY_BUFFER, 0); + FNPTR(VertexAttribPointer)(i, pVertexAttrib->iSize, GL_FLOAT, + pVertexAttrib->bNormalized, pVertexAttrib->uStride, pConverted); + if (i == 1 && bSpecial == GL_TRUE) { + FNPTR(VertexAttribPointer)(0, pVertexAttrib->iSize, GL_FLOAT, + pVertexAttrib->bNormalized, pVertexAttrib->uStride, pConverted); + } +#else + register GLubyte* pConverted = (GLubyte*)pVertexAttrib->pData + pBufferObject->uOffset; + FNPTR(BindBuffer)(GL_ARRAY_BUFFER, uBuffer); + FNPTR(VertexAttribPointer)(i, pVertexAttrib->iSize, GL_FLOAT, + pVertexAttrib->bNormalized, pVertexAttrib->uStride, pConverted); + if (i == 1 && bSpecial == GL_TRUE) { + FNPTR(VertexAttribPointer)(0, pVertexAttrib->iSize, GL_FLOAT, + pVertexAttrib->bNormalized, pVertexAttrib->uStride, pConverted); + } + FNPTR(BindBuffer)(GL_ARRAY_BUFFER, 0); +#endif + } else { + pNewArea = realloc(pVertexAttrib->pConverted, + pVertexAttrib->iSize * count * sizeof(GLfixed)); + if (pNewArea == NULL) { + ES2INTER(SetError)(GL_OUT_OF_MEMORY); + FNPTR(BindBuffer)(GL_ARRAY_BUFFER, iArrayBufferBinding); + return; + } + pVertexAttrib->pConverted = pNewArea; + pFixedBase = (GLchar*)(pVertexAttrib->pData) + first * pVertexAttrib->uStride; + pFloat = (GLfloat*)(pNewArea); + for (j = first; j < first + count; j++) { + int k = pVertexAttrib->iSize; + GLfixed* pFixed = (GLfixed*)(pFixedBase); + while (k--) { + register GLfixed xValue = *pFixed++; + register GLfloat fValue = fixed_to_float(xValue); + *pFloat++ = fValue; + } + pFixedBase += pVertexAttrib->uStride; + } + FNPTR(VertexAttribPointer)(i, pVertexAttrib->iSize, GL_FLOAT, + pVertexAttrib->bNormalized, pVertexAttrib->iSize * sizeof(GLfixed), + (GLvoid*)((GLubyte*)(pVertexAttrib->pConverted) + - first * pVertexAttrib->uStride)); + if (i == 1 && bSpecial == GL_TRUE) { + FNPTR(VertexAttribPointer)(0, pVertexAttrib->iSize, GL_FLOAT, + pVertexAttrib->bNormalized, pVertexAttrib->iSize * sizeof(GLfixed), + (GLvoid*)((GLubyte*)(pVertexAttrib->pConverted) + - first * pVertexAttrib->uStride)); + } + } + } + if (bSpecial == GL_TRUE) { + FNPTR(EnableVertexAttribArray)(0); + } + FNPTR(BindBuffer)(GL_ARRAY_BUFFER, iArrayBufferBinding); + FNPTR(DrawArrays)(mode, first, count); + if (bSpecial == GL_TRUE) { + FNPTR(DisableVertexAttribArray)(0); + } +} diff --git a/es_2_0/DrawElement.c b/es_2_0/DrawElement.c new file mode 100755 index 0000000..13b7ade --- /dev/null +++ b/es_2_0/DrawElement.c @@ -0,0 +1,208 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "es2front.h" + + +void GL_APIENTRY ES2ENTRY(DrawElements)(GLenum mode, GLsizei count, GLenum type, + const void* indices) { + GLvoid* pNewArea; + GLchar* pFixedBase; + GLfloat* pFloat; + GLint iArrayBufferBinding; + GLint iElementArrayBufferBinding; + int iFirst, iLast; + int i, j; + GLboolean bSpecial = (CCV(pVertexAttrib[0].bEnabled) == GL_FALSE) + && (CCV(pVertexAttrib[1].bEnabled) == GL_TRUE); + if (mode < 0 || GL_TRIANGLE_FAN < mode) { + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + } + if (count < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } else if (count == 0) { + return; + } + switch (type) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_UNSIGNED_BYTE: + case GL_UNSIGNED_SHORT: +#if defined(PROVIDING_OES_element_index_uint) + case GL_UNSIGNED_INT: +#endif + break; + } + + FNPTR(GetIntegerv)(GL_ELEMENT_ARRAY_BUFFER_BINDING, &iElementArrayBufferBinding); + switch (type) { + case GL_UNSIGNED_BYTE: { + GLubyte* pSrc; + static GLubyte* pBufferArea = NULL; + if (iElementArrayBufferBinding != 0) { + pSrc = (GLubyte*)realloc(pBufferArea, count * sizeof(GLubyte)); + assert(pSrc != NULL); + pBufferArea = pSrc; + FNPTR(GetBufferSubData)(GL_ELEMENT_ARRAY_BUFFER, (GLintptr)indices, + count * sizeof(GLubyte), pSrc); + } else { + pSrc = (GLubyte*)(indices); + } + iFirst = iLast = pSrc[0]; + for (i = 1; i < count; i++) { + if (pSrc[i] > iLast) iLast = pSrc[i]; + else if (pSrc[i] < iFirst) iFirst = pSrc[i]; + } + } + break; + case GL_UNSIGNED_SHORT: { + GLushort* pSrc; + static GLushort* pBufferArea = NULL; + if (iElementArrayBufferBinding != 0) { + pSrc = (GLushort*)realloc(pBufferArea, count * sizeof(GLushort)); + assert(pSrc != NULL); + pBufferArea = pSrc; + FNPTR(GetBufferSubData)(GL_ELEMENT_ARRAY_BUFFER, (GLintptr)indices, + count * sizeof(GLushort), pSrc); + } else { + pSrc = (GLushort*)(indices); + } + iFirst = iLast = pSrc[0]; + for (i = 1; i < count; i++) { + if (pSrc[i] > iLast) iLast = pSrc[i]; + else if (pSrc[i] < iFirst) iFirst = pSrc[i]; + } + } + break; +#if defined(PROVIDING_OES_element_index_uint) + case GL_UNSIGNED_INT: { + GLuint* pSrc; + static GLuint* pBufferArea = NULL; + if (iElementArrayBufferBinding != 0) { + pSrc = (GLuint*)realloc(pBufferArea, count * sizeof(GLuint)); + assert(pSrc != NULL); + pBufferArea = pSrc; + FNPTR(GetBufferSubData)(GL_ELEMENT_ARRAY_BUFFER, (GLintptr)indices, + count * sizeof(GLuint), pSrc); + } else { + pSrc = (GLuint*)(indices); + } + iFirst = iLast = pSrc[0]; + for (i = 1; i < count; i++) { + if (pSrc[i] > iLast) iLast = pSrc[i]; + else if (pSrc[i] < iFirst) iFirst = pSrc[i]; + } + } + break; +#endif + } + FNPTR(GetIntegerv)(GL_ARRAY_BUFFER_BINDING, &iArrayBufferBinding); + FNPTR(BindBuffer)(GL_ARRAY_BUFFER, 0); + for (i = 0; i < CCV(nMaxVertexAttribs); i++) { + register struct VertexAttribUnit* pVertexAttrib = &(CCV(pVertexAttrib[i])); + if (pVertexAttrib->bEnabled == GL_FALSE) continue; + if (i == 1 && bSpecial == GL_TRUE && pVertexAttrib->eType != GL_FIXED) { + FNPTR(BindBuffer)(GL_ARRAY_BUFFER, pVertexAttrib->uBufferBinding); + FNPTR(VertexAttribPointer)(0, pVertexAttrib->iSize, + pVertexAttrib->eType, pVertexAttrib->bNormalized, pVertexAttrib->uStride, + pVertexAttrib->pData); + FNPTR(BindBuffer)(GL_ARRAY_BUFFER, 0); + } + if (pVertexAttrib->eType != GL_FIXED) continue; + if (pVertexAttrib->uBufferBinding != 0) { + register GLuint uBuffer = pVertexAttrib->uBufferBinding; + register struct BufferObjectUnit* pBufferObject = &CCV(pBufferObject[uBuffer]); +#if defined(USE_CONVERTED) + register GLubyte* pConverted = (GLubyte*)(pBufferObject->pConverted) + + (GLsizei)(pVertexAttrib->pData); + FNPTR(BindBuffer)(GL_ARRAY_BUFFER, 0); + FNPTR(VertexAttribPointer)(i, pVertexAttrib->iSize, GL_FLOAT, + pVertexAttrib->bNormalized, pVertexAttrib->uStride, pConverted); + if (i == 1 && bSpecial == GL_TRUE) { + FNPTR(VertexAttribPointer)(0, pVertexAttrib->iSize, GL_FLOAT, + pVertexAttrib->bNormalized, pVertexAttrib->uStride, pConverted); + } +#else + register GLubyte* pConverted = (GLubyte*)pVertexAttrib->pData + pBufferObject->uOffset; + FNPTR(BindBuffer)(GL_ARRAY_BUFFER, uBuffer); + FNPTR(VertexAttribPointer)(i, pVertexAttrib->iSize, GL_FLOAT, + pVertexAttrib->bNormalized, pVertexAttrib->uStride, pConverted); + if (i == 1 && bSpecial == GL_TRUE) { + FNPTR(VertexAttribPointer)(0, pVertexAttrib->iSize, GL_FLOAT, + pVertexAttrib->bNormalized, pVertexAttrib->uStride, pConverted); + } + FNPTR(BindBuffer)(GL_ARRAY_BUFFER, 0); +#endif + } else { + pNewArea = realloc(pVertexAttrib->pConverted, + pVertexAttrib->iSize * (iLast - iFirst + 1) * sizeof(GLfixed)); + if (pNewArea == NULL) { + ES2INTER(SetError)(GL_OUT_OF_MEMORY); + FNPTR(BindBuffer)(GL_ARRAY_BUFFER, iArrayBufferBinding); + return; + } + pVertexAttrib->pConverted = pNewArea; + pFixedBase = (GLchar*)(pVertexAttrib->pData) + iFirst * pVertexAttrib->uStride; + pFloat = (GLfloat*)(pNewArea); + for (j = iFirst; j < iLast + 1; j++) { + int k = pVertexAttrib->iSize; + GLfixed* pFixed = (GLfixed*)(pFixedBase); + while (k--) { + register GLfixed xValue = *pFixed++; + register GLfloat fValue = fixed_to_float(xValue); + *pFloat++ = fValue; + } + pFixedBase += pVertexAttrib->uStride; + } + FNPTR(VertexAttribPointer)(i, pVertexAttrib->iSize, GL_FLOAT, + pVertexAttrib->bNormalized, pVertexAttrib->iSize * sizeof(GLfixed), + (GLvoid*)((GLubyte*)(pVertexAttrib->pConverted) + - iFirst * pVertexAttrib->uStride)); + if (i == 1 && bSpecial == GL_TRUE) { + FNPTR(VertexAttribPointer)(0, pVertexAttrib->iSize, GL_FLOAT, + pVertexAttrib->bNormalized, pVertexAttrib->iSize * sizeof(GLfixed), + (GLvoid*)((GLubyte*)(pVertexAttrib->pConverted) + - iFirst * pVertexAttrib->uStride)); + } + } + } + if (bSpecial == GL_TRUE) { + FNPTR(EnableVertexAttribArray)(0); + } + FNPTR(BindBuffer)(GL_ARRAY_BUFFER, iArrayBufferBinding); + FNPTR(DrawElements)(mode, count, type, indices); + if (bSpecial == GL_TRUE) { + FNPTR(DisableVertexAttribArray)(0); + } +} diff --git a/es_2_0/EGLImage.c b/es_2_0/EGLImage.c new file mode 100755 index 0000000..07d0631 --- /dev/null +++ b/es_2_0/EGLImage.c @@ -0,0 +1,124 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Edwin Zhai <edwin.zhai@intel.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * Yeongkyoon Lee <yeongkyoon.lee@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - Intel Corporation + * - S-Core Co., Ltd + * + */ + + /* + * EGLImage.c + * + */ +#include "es2front.h" +#include <EGL/egl.h> +#include <GLES2/gl2ext.h> +#include <X11/Xlib.h> +#include <X11/Xutil.h> +#include <dlfcn.h> + +//#define EGL_SO_FILENAME "libEGL.so" +#define EGL_SO_FILENAME "/usr/lib/host-gl/libEGL.so.1.0" +#define EGLCROSS_PREFIX "__hazel_cross__" + +void* g_dlhandle_egl = NULL; + +void GL_APIENTRY ES2ENTRY(EGLImageTargetTexture2DOES) (GLenum target, + GLeglImageOES image) { + + int width, height, depth; + EGLNativeDisplayType dpy; + Pixmap pixmap; + XImage *img; + + int (*fpGetEGLImagePixmapInfo)(void *eglimg, + EGLNativeDisplayType *dpy, + Pixmap *pixmap, + int *width, int *height, int *depth) = NULL; + + if (g_dlhandle_egl == NULL) { + if ((g_dlhandle_egl = dlopen(EGL_SO_FILENAME, RTLD_NOW | RTLD_GLOBAL)) == NULL) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + } + + fpGetEGLImagePixmapInfo = dlsym(g_dlhandle_egl, EGLCROSS_PREFIX "GetEGLImagePixmapInfo"); + if (fpGetEGLImagePixmapInfo != NULL) { + (*fpGetEGLImagePixmapInfo)(image, &dpy, &pixmap, &width, &height, &depth); + } + + fprintf (stderr, "EGLImage: glEGLImageTargetTexture2DOES () was called!\n"); + fprintf (stderr, "======== target = 0x%x\n", (unsigned int)target); + fprintf (stderr, "======== image = 0x%x\n", (unsigned int)image); + fprintf (stderr, "======== width = 0x%x\n", (unsigned int)width); + fprintf (stderr, "======== height = 0x%x\n", (unsigned int)height); + fprintf (stderr, "======== depth = 0x%x\n", (unsigned int)depth); + + /* EGLImageTargetTexture2DOES support 2D rendering results in the + * xpixmap as texture, so firstly TexImage2D then trap into host, where + * the 2D & 3D rendering need to be combined as texture + */ + + img = XGetImage ((Display*)dpy, pixmap, 0, 0, width, height, AllPlanes, ZPixmap); + if (img == NULL) { + fprintf (stderr, "EGLImage: Failed to get pixmap image!\n"); + } + + /* 2D rendering from Xlib doesn't produce alpha channel. Make a + * option(default off) to add alpha as 0xff for each pixel with + * possible performance drop */ +//#define FILL_IN_ALPHA +#ifdef FILL_IN_ALPHA + /* Add alpha channel if needed, as Xlib rendering doesn't produce it */ + if ( img->bits_per_pixel == 32 ) + { + int x, y; + for ( y = 0; y < img->height; y++ ) + for ( x = 0; x < img->width; x++ ) + { + char* pixel = img->data + + y * img->bytes_per_line + + x * (img->bits_per_pixel / 8); + pixel[3] = 0xff; + } + } +#endif + +/* pixels in 2D rendering results is BGR format, which is not in the + * header of gles. XXX:Need generic method to detect the RBG format and + * alpha, like DefaultVisual */ +#ifndef GL_BGRA +#define GL_BGRA 0x80E1 +#endif + FNPTR(TexImage2D)(target, 0, GL_RGBA, width, height, 0, GL_BGRA, GL_UNSIGNED_BYTE, img->data); + + XDestroyImage (img); + + FNPTR(EGLImageTargetTexture2DOES)(target, pixmap); +} diff --git a/es_2_0/Enable.c b/es_2_0/Enable.c new file mode 100755 index 0000000..ddf83a5 --- /dev/null +++ b/es_2_0/Enable.c @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "es2front.h" + + +void GL_APIENTRY ES2ENTRY(Enable)(GLenum cap) { + switch (cap) { + case GL_BLEND: + case GL_CULL_FACE: + case GL_DEPTH_TEST: + case GL_DITHER: + case GL_POLYGON_OFFSET_FILL: + case GL_SAMPLE_ALPHA_TO_COVERAGE: + case GL_SAMPLE_COVERAGE: + case GL_SCISSOR_TEST: + case GL_STENCIL_TEST: + FNPTR(Enable)(cap); + break; + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + break; + } +} + + +void GL_APIENTRY ES2ENTRY(Disable)(GLenum cap) { + switch (cap) { + case GL_BLEND: + case GL_CULL_FACE: + case GL_DEPTH_TEST: + case GL_DITHER: + case GL_POLYGON_OFFSET_FILL: + case GL_SAMPLE_ALPHA_TO_COVERAGE: + case GL_SAMPLE_COVERAGE: + case GL_SCISSOR_TEST: + case GL_STENCIL_TEST: + FNPTR(Disable)(cap); + break; + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + break; + } +} + + +GLboolean GL_APIENTRY ES2ENTRY(IsEnabled)(GLenum cap) { + switch (cap) { + case GL_BLEND: + case GL_CULL_FACE: + case GL_DEPTH_TEST: + case GL_DITHER: + case GL_POLYGON_OFFSET_FILL: + case GL_SAMPLE_ALPHA_TO_COVERAGE: + case GL_SAMPLE_COVERAGE: + case GL_SCISSOR_TEST: + case GL_STENCIL_TEST: + return FNPTR(IsEnabled)(cap); + break; + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return 0; + break; + } +} diff --git a/es_2_0/Error.c b/es_2_0/Error.c new file mode 100755 index 0000000..3ac3874 --- /dev/null +++ b/es_2_0/Error.c @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "es2front.h" +#include <stdarg.h> + + +GLenum GL_APIENTRY ES2ENTRY(GetError)(void) { + register GLenum eResult = FNPTR(GetError)(); + if (CCV(eError) != GL_NO_ERROR) { + eResult = CCV(eError); + CCV(eError) = GL_NO_ERROR; + } + return eResult; +} + + + +void GL_APIENTRY ES2INTER(SetError)(GLenum eError) { + if (CCV(eError) == GL_NO_ERROR) { + CCV(eError) = eError; + } +} + diff --git a/es_2_0/EvalLex.inl b/es_2_0/EvalLex.inl new file mode 100755 index 0000000..5bf0a74 --- /dev/null +++ b/es_2_0/EvalLex.inl @@ -0,0 +1,1830 @@ + +#line 3 "EvalLex.inl" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define yy_create_buffer hazelEval_create_buffer +#define yy_delete_buffer hazelEval_delete_buffer +#define yy_flex_debug hazelEval_flex_debug +#define yy_init_buffer hazelEval_init_buffer +#define yy_flush_buffer hazelEval_flush_buffer +#define yy_load_buffer_state hazelEval_load_buffer_state +#define yy_switch_to_buffer hazelEval_switch_to_buffer +#define yyin hazelEvalin +#define yyleng hazelEvalleng +#define yylex hazelEvallex +#define yylineno hazelEvallineno +#define yyout hazelEvalout +#define yyrestart hazelEvalrestart +#define yytext hazelEvaltext +#define yywrap hazelEvalwrap +#define yyalloc hazelEvalalloc +#define yyrealloc hazelEvalrealloc +#define yyfree hazelEvalfree + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 5 +#define YY_FLEX_SUBMINOR_VERSION 35 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +#include <stdio.h> +#include <string.h> +#include <errno.h> +#include <stdlib.h> + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +#include <inttypes.h> +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; +#endif /* ! C99 */ + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#endif /* ! FLEXINT_H */ + +#ifdef __cplusplus + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +/* C99 requires __STDC__ to be defined as 1. */ +#if defined (__STDC__) + +#define YY_USE_CONST + +#endif /* defined (__STDC__) */ +#endif /* ! __cplusplus */ + +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst +#endif + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an unsigned + * integer for use as an array index. If the signed char is negative, + * we want to instead treat it as an 8-bit unsigned char, hence the + * double cast. + */ +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN (yy_start) = 1 + 2 * + +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START (((yy_start) - 1) / 2) +#define YYSTATE YY_START + +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) + +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE hazelEvalrestart(hazelEvalin ) + +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#define YY_BUF_SIZE 16384 +#endif + +/* The state buf must be large enough to hold one state per character in the main buffer. + */ +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +extern int hazelEvalleng; + +extern FILE *hazelEvalin, *hazelEvalout; + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + + #define YY_LESS_LINENO(n) + +/* Return all but the first "n" matched characters back to the input stream. */ +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up hazelEvaltext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = (yy_hold_char); \ + YY_RESTORE_YY_MORE_OFFSET \ + (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up hazelEvaltext again */ \ + } \ + while ( 0 ) + +#define unput(c) yyunput( c, (yytext_ptr) ) + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via hazelEvalrestart()), so that the user can continue scanning by + * just pointing hazelEvalin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +/* Stack of input buffers. */ +static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ +static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ +static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + * + * Returns the top of the stack, or NULL. + */ +#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ + ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ + : NULL) + +/* Same as previous macro, but useful when we know that the buffer stack is not + * NULL or when we need an lvalue. For internal use only. + */ +#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] + +/* yy_hold_char holds the character lost when hazelEvaltext is formed. */ +static char yy_hold_char; +static int yy_n_chars; /* number of characters read into yy_ch_buf */ +int hazelEvalleng; + +/* Points to current character in buffer. */ +static char *yy_c_buf_p = (char *) 0; +static int yy_init = 0; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ + +/* Flag which is used to allow hazelEvalwrap()'s to do buffer switches + * instead of setting up a fresh hazelEvalin. A bit of a hack ... + */ +static int yy_did_buffer_switch_on_eof; + +void hazelEvalrestart (FILE *input_file ); +void hazelEval_switch_to_buffer (YY_BUFFER_STATE new_buffer ); +YY_BUFFER_STATE hazelEval_create_buffer (FILE *file,int size ); +void hazelEval_delete_buffer (YY_BUFFER_STATE b ); +void hazelEval_flush_buffer (YY_BUFFER_STATE b ); +void hazelEvalpush_buffer_state (YY_BUFFER_STATE new_buffer ); +void hazelEvalpop_buffer_state (void ); + +static void hazelEvalensure_buffer_stack (void ); +static void hazelEval_load_buffer_state (void ); +static void hazelEval_init_buffer (YY_BUFFER_STATE b,FILE *file ); + +#define YY_FLUSH_BUFFER hazelEval_flush_buffer(YY_CURRENT_BUFFER ) + +YY_BUFFER_STATE hazelEval_scan_buffer (char *base,yy_size_t size ); +YY_BUFFER_STATE hazelEval_scan_string (yyconst char *yy_str ); +YY_BUFFER_STATE hazelEval_scan_bytes (yyconst char *bytes,int len ); + +void *hazelEvalalloc (yy_size_t ); +void *hazelEvalrealloc (void *,yy_size_t ); +void hazelEvalfree (void * ); + +#define yy_new_buffer hazelEval_create_buffer + +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ + hazelEvalensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + hazelEval_create_buffer(hazelEvalin,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } + +#define yy_set_bol(at_bol) \ + { \ + if ( ! YY_CURRENT_BUFFER ){\ + hazelEvalensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + hazelEval_create_buffer(hazelEvalin,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } + +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) + +typedef unsigned char YY_CHAR; + +FILE *hazelEvalin = (FILE *) 0, *hazelEvalout = (FILE *) 0; + +typedef int yy_state_type; + +extern int hazelEvallineno; + +int hazelEvallineno = 1; + +extern char *hazelEvaltext; +#define yytext_ptr hazelEvaltext + +static yy_state_type yy_get_previous_state (void ); +static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); +static int yy_get_next_buffer (void ); +static void yy_fatal_error (yyconst char msg[] ); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up hazelEvaltext. + */ +#define YY_DO_BEFORE_ACTION \ + (yytext_ptr) = yy_bp; \ + hazelEvalleng = (size_t) (yy_cp - yy_bp); \ + (yy_hold_char) = *yy_cp; \ + *yy_cp = '\0'; \ + (yy_c_buf_p) = yy_cp; + +#define YY_NUM_RULES 15 +#define YY_END_OF_BUFFER 16 +/* This struct is not used in this scanner, + but its presence is necessary. */ +struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static yyconst flex_int16_t yy_accept[32] = + { 0, + 0, 0, 16, 14, 13, 15, 14, 14, 3, 2, + 2, 14, 14, 14, 1, 14, 10, 11, 3, 0, + 2, 2, 5, 7, 9, 8, 6, 1, 12, 4, + 0 + } ; + +static yyconst flex_int32_t yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 4, 1, 1, 1, 1, 5, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 6, 7, 7, + 7, 7, 7, 7, 7, 8, 8, 1, 1, 9, + 10, 11, 1, 1, 12, 12, 12, 12, 12, 12, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 14, 13, 13, + 1, 1, 1, 1, 13, 1, 12, 12, 12, 12, + + 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 15, + 13, 13, 1, 16, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; + +static yyconst flex_int32_t yy_meta[17] = + { 0, + 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, + 1, 3, 4, 4, 4, 1 + } ; + +static yyconst flex_int16_t yy_base[36] = + { 0, + 0, 0, 40, 41, 41, 41, 29, 33, 11, 29, + 0, 10, 26, 11, 0, 19, 41, 41, 17, 0, + 26, 0, 41, 41, 41, 41, 41, 0, 41, 0, + 41, 31, 30, 25, 28 + } ; + +static yyconst flex_int16_t yy_def[36] = + { 0, + 31, 1, 31, 31, 31, 31, 31, 31, 31, 32, + 33, 31, 31, 31, 34, 31, 31, 31, 31, 35, + 32, 33, 31, 31, 31, 31, 31, 34, 31, 35, + 0, 31, 31, 31, 31 + } ; + +static yyconst flex_int16_t yy_nxt[58] = + { 0, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 15, 15, 15, 16, 19, 19, 23, 24, + 26, 27, 19, 19, 20, 20, 28, 28, 28, 30, + 30, 22, 21, 22, 29, 25, 22, 18, 17, 31, + 3, 31, 31, 31, 31, 31, 31, 31, 31, 31, + 31, 31, 31, 31, 31, 31, 31 + } ; + +static yyconst flex_int16_t yy_chk[58] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 9, 9, 12, 12, + 14, 14, 19, 19, 9, 9, 34, 34, 34, 35, + 35, 33, 32, 21, 16, 13, 10, 8, 7, 3, + 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, + 31, 31, 31, 31, 31, 31, 31 + } ; + +static yy_state_type yy_last_accepting_state; +static char *yy_last_accepting_cpos; + +extern int hazelEval_flex_debug; +int hazelEval_flex_debug = 0; + +/* The intent behind this definition is that it'll catch + * any uses of REJECT which flex missed. + */ +#define REJECT reject_used_but_not_detected +#define yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +char *hazelEvaltext; + +/* The generated EvalLex.c file must be included at the end of EvalYacc.c */ + +static char* pSrcPtr; + +void hazelEvalPrepare(char* ptr) { + pSrcPtr = ptr; +} + +static int hazelEvalwrap(void) { + return 1; +} + +/* +Gets input and stuffs it into "buf". +number of characters read, or YY_NULL, is returned in "result". +*/ +#undef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + { \ + if (*pSrcPtr == '\0') { \ + result = YY_NULL; \ + } else { \ + result = strlen(pSrcPtr); \ + strcpy(buf, pSrcPtr); \ + pSrcPtr += result; \ + } \ + } + +#define INITIAL 0 + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +static int yy_init_globals (void ); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int hazelEvallex_destroy (void ); + +int hazelEvalget_debug (void ); + +void hazelEvalset_debug (int debug_flag ); + +YY_EXTRA_TYPE hazelEvalget_extra (void ); + +void hazelEvalset_extra (YY_EXTRA_TYPE user_defined ); + +FILE *hazelEvalget_in (void ); + +void hazelEvalset_in (FILE * in_str ); + +FILE *hazelEvalget_out (void ); + +void hazelEvalset_out (FILE * out_str ); + +int hazelEvalget_leng (void ); + +char *hazelEvalget_text (void ); + +int hazelEvalget_lineno (void ); + +void hazelEvalset_lineno (int line_number ); + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int hazelEvalwrap (void ); +#else +extern int hazelEvalwrap (void ); +#endif +#endif + + static void yyunput (int c,char *buf_ptr ); + +#ifndef yytext_ptr +static void yy_flex_strncpy (char *,yyconst char *,int ); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (yyconst char * ); +#endif + +#ifndef YY_NO_INPUT + +#ifdef __cplusplus +static int yyinput (void ); +#else +static int input (void ); +#endif + +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#define YY_READ_BUF_SIZE 8192 +#endif + +/* Copy whatever the last rule matched to the standard output. */ +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO fwrite( hazelEvaltext, hazelEvalleng, 1, hazelEvalout ) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ + { \ + int c = '*'; \ + unsigned n; \ + for ( n = 0; n < max_size && \ + (c = getc( hazelEvalin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( hazelEvalin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else \ + { \ + errno=0; \ + while ( (result = fread(buf, 1, max_size, hazelEvalin))==0 && ferror(hazelEvalin)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(hazelEvalin); \ + } \ + }\ +\ + +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) +#endif + +/* end tables serialization structures and prototypes */ + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 + +extern int hazelEvallex (void); + +#define YY_DECL int hazelEvallex (void) +#endif /* !YY_DECL */ + +/* Code executed at the beginning of each rule, after hazelEvaltext and hazelEvalleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK break; +#endif + +#define YY_RULE_SETUP \ + YY_USER_ACTION + +/** The main scanner function which does all the work. + */ +YY_DECL +{ + register yy_state_type yy_current_state; + register char *yy_cp, *yy_bp; + register int yy_act; + + if ( !(yy_init) ) + { + (yy_init) = 1; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! (yy_start) ) + (yy_start) = 1; /* first start state */ + + if ( ! hazelEvalin ) + hazelEvalin = stdin; + + if ( ! hazelEvalout ) + hazelEvalout = stdout; + + if ( ! YY_CURRENT_BUFFER ) { + hazelEvalensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + hazelEval_create_buffer(hazelEvalin,YY_BUF_SIZE ); + } + + hazelEval_load_buffer_state( ); + } + + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = (yy_c_buf_p); + + /* Support of hazelEvaltext. */ + *yy_cp = (yy_hold_char); + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = (yy_start); +yy_match: + do + { + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 32 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + ++yy_cp; + } + while ( yy_base[yy_current_state] != 41 ); + +yy_find_action: + yy_act = yy_accept[yy_current_state]; + if ( yy_act == 0 ) + { /* have to back up */ + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + yy_act = yy_accept[yy_current_state]; + } + + YY_DO_BEFORE_ACTION; + +do_action: /* This label is used only to access EOF actions. */ + + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = (yy_hold_char); + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + goto yy_find_action; + +case 1: +YY_RULE_SETUP +{ + if (strcmp(hazelEvaltext, "defined") == 0) { + return DEFINED; + } else { + struct SymbolEntry* ptr = ES2INTER(MacroSearchMacro)(hazelEvaltext); + yylval = (int)(ptr); + return IDENTIFIER; + } +} + YY_BREAK +case 2: +YY_RULE_SETUP +{ yylval = (int)strtol(hazelEvaltext, NULL, 10); return NUMBER; } + YY_BREAK +case 3: +YY_RULE_SETUP +{ yylval = (int)strtol(hazelEvaltext, NULL, 8); return NUMBER; } + YY_BREAK +case 4: +YY_RULE_SETUP +{ yylval = (int)strtol(hazelEvaltext, NULL, 16); return NUMBER; } + YY_BREAK +case 5: +YY_RULE_SETUP +{ return LEFT_OP; } + YY_BREAK +case 6: +YY_RULE_SETUP +{ return RIGHT_OP; } + YY_BREAK +case 7: +YY_RULE_SETUP +{ return LE_OP; } + YY_BREAK +case 8: +YY_RULE_SETUP +{ return GE_OP; } + YY_BREAK +case 9: +YY_RULE_SETUP +{ return EQ_OP; } + YY_BREAK +case 10: +YY_RULE_SETUP +{ return NE_OP; } + YY_BREAK +case 11: +YY_RULE_SETUP +{ return AND_OP; } + YY_BREAK +case 12: +YY_RULE_SETUP +{ return OR_OP; } + YY_BREAK +case 13: +YY_RULE_SETUP +{ /* ignore it */ } + YY_BREAK +case 14: +YY_RULE_SETUP +{ return hazelEvaltext[0]; } + YY_BREAK +case 15: +YY_RULE_SETUP +ECHO; + YY_BREAK +case YY_STATE_EOF(INITIAL): + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = (yy_hold_char); + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed hazelEvalin at a new source and called + * hazelEvallex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = hazelEvalin; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++(yy_c_buf_p); + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = (yy_c_buf_p); + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_END_OF_FILE: + { + (yy_did_buffer_switch_on_eof) = 0; + + if ( hazelEvalwrap( ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * hazelEvaltext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = + (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + (yy_c_buf_p) = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ +} /* end of hazelEvallex */ + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ +static int yy_get_next_buffer (void) +{ + register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + register char *source = (yytext_ptr); + register int number_to_move, i; + int ret_val; + + if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; + + else + { + int num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER; + + int yy_c_buf_p_offset = + (int) ((yy_c_buf_p) - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + hazelEvalrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; + + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + (yy_n_chars), (size_t) num_to_read ); + + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + if ( (yy_n_chars) == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + hazelEvalrestart(hazelEvalin ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) hazelEvalrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + } + + (yy_n_chars) += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; + + (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + + return ret_val; +} + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + + static yy_state_type yy_get_previous_state (void) +{ + register yy_state_type yy_current_state; + register char *yy_cp; + + yy_current_state = (yy_start); + + for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) + { + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 32 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + } + + return yy_current_state; +} + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) +{ + register int yy_is_jam; + register char *yy_cp = (yy_c_buf_p); + + register YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 32 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_is_jam = (yy_current_state == 31); + + return yy_is_jam ? 0 : yy_current_state; +} + + static void yyunput (int c, register char * yy_bp ) +{ + register char *yy_cp; + + yy_cp = (yy_c_buf_p); + + /* undo effects of setting up hazelEvaltext */ + *yy_cp = (yy_hold_char); + + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + register int number_to_move = (yy_n_chars) + 2; + register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; + register char *source = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; + + while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + *--dest = *--source; + + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; + + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } + + *--yy_cp = (char) c; + + (yytext_ptr) = yy_bp; + (yy_hold_char) = *yy_cp; + (yy_c_buf_p) = yy_cp; +} + +#ifndef YY_NO_INPUT +#ifdef __cplusplus + static int yyinput (void) +#else + static int input (void) +#endif + +{ + int c; + + *(yy_c_buf_p) = (yy_hold_char); + + if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + /* This was really a NUL. */ + *(yy_c_buf_p) = '\0'; + + else + { /* need more input */ + int offset = (yy_c_buf_p) - (yytext_ptr); + ++(yy_c_buf_p); + + switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + hazelEvalrestart(hazelEvalin ); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( hazelEvalwrap( ) ) + return EOF; + + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(); +#else + return input(); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = (yytext_ptr) + offset; + break; + } + } + } + + c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ + *(yy_c_buf_p) = '\0'; /* preserve hazelEvaltext */ + (yy_hold_char) = *++(yy_c_buf_p); + + return c; +} +#endif /* ifndef YY_NO_INPUT */ + +/** Immediately switch to a different input stream. + * @param input_file A readable stream. + * + * @note This function does not reset the start condition to @c INITIAL . + */ + void hazelEvalrestart (FILE * input_file ) +{ + + if ( ! YY_CURRENT_BUFFER ){ + hazelEvalensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + hazelEval_create_buffer(hazelEvalin,YY_BUF_SIZE ); + } + + hazelEval_init_buffer(YY_CURRENT_BUFFER,input_file ); + hazelEval_load_buffer_state( ); +} + +/** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * + */ + void hazelEval_switch_to_buffer (YY_BUFFER_STATE new_buffer ) +{ + + /* TODO. We should be able to replace this entire function body + * with + * hazelEvalpop_buffer_state(); + * hazelEvalpush_buffer_state(new_buffer); + */ + hazelEvalensure_buffer_stack (); + if ( YY_CURRENT_BUFFER == new_buffer ) + return; + + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + hazelEval_load_buffer_state( ); + + /* We don't actually know whether we did this switch during + * EOF (hazelEvalwrap()) processing, but the only time this flag + * is looked at is after hazelEvalwrap() is called, so it's safe + * to go ahead and always set it. + */ + (yy_did_buffer_switch_on_eof) = 1; +} + +static void hazelEval_load_buffer_state (void) +{ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + hazelEvalin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + (yy_hold_char) = *(yy_c_buf_p); +} + +/** Allocate and initialize an input buffer state. + * @param file A readable stream. + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. + * + * @return the allocated buffer state. + */ + YY_BUFFER_STATE hazelEval_create_buffer (FILE * file, int size ) +{ + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) hazelEvalalloc(sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in hazelEval_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) hazelEvalalloc(b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in hazelEval_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + hazelEval_init_buffer(b,file ); + + return b; +} + +/** Destroy the buffer. + * @param b a buffer created with hazelEval_create_buffer() + * + */ + void hazelEval_delete_buffer (YY_BUFFER_STATE b ) +{ + + if ( ! b ) + return; + + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + hazelEvalfree((void *) b->yy_ch_buf ); + + hazelEvalfree((void *) b ); +} + +#ifndef __cplusplus +extern int isatty (int ); +#endif /* __cplusplus */ + +/* Initializes or reinitializes a buffer. + * This function is sometimes called more than once on the same buffer, + * such as during a hazelEvalrestart() or at EOF. + */ + static void hazelEval_init_buffer (YY_BUFFER_STATE b, FILE * file ) + +{ + int oerrno = errno; + + hazelEval_flush_buffer(b ); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + + /* If b is the current buffer, then hazelEval_init_buffer was _probably_ + * called from hazelEvalrestart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER){ + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } + + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; + + errno = oerrno; +} + +/** Discard all buffered characters. On the next scan, YY_INPUT will be called. + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. + * + */ + void hazelEval_flush_buffer (YY_BUFFER_STATE b ) +{ + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == YY_CURRENT_BUFFER ) + hazelEval_load_buffer_state( ); +} + +/** Pushes the new state onto the stack. The new state becomes + * the current state. This function will allocate the stack + * if necessary. + * @param new_buffer The new state. + * + */ +void hazelEvalpush_buffer_state (YY_BUFFER_STATE new_buffer ) +{ + if (new_buffer == NULL) + return; + + hazelEvalensure_buffer_stack(); + + /* This block is copied from hazelEval_switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + (yy_buffer_stack_top)++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from hazelEval_switch_to_buffer. */ + hazelEval_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; +} + +/** Removes and deletes the top of the stack, if present. + * The next element becomes the new top. + * + */ +void hazelEvalpop_buffer_state (void) +{ + if (!YY_CURRENT_BUFFER) + return; + + hazelEval_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + if ((yy_buffer_stack_top) > 0) + --(yy_buffer_stack_top); + + if (YY_CURRENT_BUFFER) { + hazelEval_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; + } +} + +/* Allocates the stack if it does not exist. + * Guarantees space for at least one push. + */ +static void hazelEvalensure_buffer_stack (void) +{ + int num_to_alloc; + + if (!(yy_buffer_stack)) { + + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. + */ + num_to_alloc = 1; + (yy_buffer_stack) = (struct yy_buffer_state**)hazelEvalalloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in hazelEvalensure_buffer_stack()" ); + + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + (yy_buffer_stack_max) = num_to_alloc; + (yy_buffer_stack_top) = 0; + return; + } + + if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ + + /* Increase the buffer to prepare for a possible push. */ + int grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = (yy_buffer_stack_max) + grow_size; + (yy_buffer_stack) = (struct yy_buffer_state**)hazelEvalrealloc + ((yy_buffer_stack), + num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in hazelEvalensure_buffer_stack()" ); + + /* zero only the new slots.*/ + memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); + (yy_buffer_stack_max) = num_to_alloc; + } +} + +/** Setup the input buffer state to scan directly from a user-specified character buffer. + * @param base the character buffer + * @param size the size in bytes of the character buffer + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE hazelEval_scan_buffer (char * base, yy_size_t size ) +{ + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; + + b = (YY_BUFFER_STATE) hazelEvalalloc(sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in hazelEval_scan_buffer()" ); + + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + hazelEval_switch_to_buffer(b ); + + return b; +} + +/** Setup the input buffer state to scan a string. The next call to hazelEvallex() will + * scan from a @e copy of @a str. + * @param yystr a NUL-terminated string to scan + * + * @return the newly allocated buffer state object. + * @note If you want to scan bytes that may contain NUL values, then use + * hazelEval_scan_bytes() instead. + */ +YY_BUFFER_STATE hazelEval_scan_string (yyconst char * yystr ) +{ + + return hazelEval_scan_bytes(yystr,strlen(yystr) ); +} + +/** Setup the input buffer state to scan the given bytes. The next call to hazelEvallex() will + * scan from a @e copy of @a bytes. + * @param bytes the byte buffer to scan + * @param len the number of bytes in the buffer pointed to by @a bytes. + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE hazelEval_scan_bytes (yyconst char * yybytes, int _yybytes_len ) +{ + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = _yybytes_len + 2; + buf = (char *) hazelEvalalloc(n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in hazelEval_scan_bytes()" ); + + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; + + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; + + b = hazelEval_scan_buffer(buf,n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in hazelEval_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; +} + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +static void yy_fatal_error (yyconst char* msg ) +{ + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); +} + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up hazelEvaltext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + hazelEvaltext[hazelEvalleng] = (yy_hold_char); \ + (yy_c_buf_p) = hazelEvaltext + yyless_macro_arg; \ + (yy_hold_char) = *(yy_c_buf_p); \ + *(yy_c_buf_p) = '\0'; \ + hazelEvalleng = yyless_macro_arg; \ + } \ + while ( 0 ) + +/* Accessor methods (get/set functions) to struct members. */ + +/** Get the current line number. + * + */ +int hazelEvalget_lineno (void) +{ + + return hazelEvallineno; +} + +/** Get the input stream. + * + */ +FILE *hazelEvalget_in (void) +{ + return hazelEvalin; +} + +/** Get the output stream. + * + */ +FILE *hazelEvalget_out (void) +{ + return hazelEvalout; +} + +/** Get the length of the current token. + * + */ +int hazelEvalget_leng (void) +{ + return hazelEvalleng; +} + +/** Get the current token. + * + */ + +char *hazelEvalget_text (void) +{ + return hazelEvaltext; +} + +/** Set the current line number. + * @param line_number + * + */ +void hazelEvalset_lineno (int line_number ) +{ + + hazelEvallineno = line_number; +} + +/** Set the input stream. This does not discard the current + * input buffer. + * @param in_str A readable stream. + * + * @see hazelEval_switch_to_buffer + */ +void hazelEvalset_in (FILE * in_str ) +{ + hazelEvalin = in_str ; +} + +void hazelEvalset_out (FILE * out_str ) +{ + hazelEvalout = out_str ; +} + +int hazelEvalget_debug (void) +{ + return hazelEval_flex_debug; +} + +void hazelEvalset_debug (int bdebug ) +{ + hazelEval_flex_debug = bdebug ; +} + +static int yy_init_globals (void) +{ + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from hazelEvallex_destroy(), so don't allocate here. + */ + + (yy_buffer_stack) = 0; + (yy_buffer_stack_top) = 0; + (yy_buffer_stack_max) = 0; + (yy_c_buf_p) = (char *) 0; + (yy_init) = 0; + (yy_start) = 0; + +/* Defined in main.c */ +#ifdef YY_STDINIT + hazelEvalin = stdin; + hazelEvalout = stdout; +#else + hazelEvalin = (FILE *) 0; + hazelEvalout = (FILE *) 0; +#endif + + /* For future reference: Set errno on error, since we are called by + * hazelEvallex_init() + */ + return 0; +} + +/* hazelEvallex_destroy is for both reentrant and non-reentrant scanners. */ +int hazelEvallex_destroy (void) +{ + + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER){ + hazelEval_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + hazelEvalpop_buffer_state(); + } + + /* Destroy the stack itself. */ + hazelEvalfree((yy_buffer_stack) ); + (yy_buffer_stack) = NULL; + + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * hazelEvallex() is called, initialization will occur. */ + yy_init_globals( ); + + return 0; +} + +/* + * Internal utility routines. + */ + +#ifndef yytext_ptr +static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) +{ + register int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; +} +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (yyconst char * s ) +{ + register int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; +} +#endif + +void *hazelEvalalloc (yy_size_t size ) +{ + return (void *) malloc( size ); +} + +void *hazelEvalrealloc (void * ptr, yy_size_t size ) +{ + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return (void *) realloc( (char *) ptr, size ); +} + +void hazelEvalfree (void * ptr ) +{ + free( (char *) ptr ); /* see hazelEvalrealloc() for (char *) cast */ +} + +#define YYTABLES_NAME "yytables" + diff --git a/es_2_0/EvalParse.c b/es_2_0/EvalParse.c new file mode 100755 index 0000000..a80c304 --- /dev/null +++ b/es_2_0/EvalParse.c @@ -0,0 +1,760 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#ifndef lint +static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; +#endif + +#include <stdlib.h> +#include <string.h> + +#define YYBYACC 1 +#define YYMAJOR 1 +#define YYMINOR 9 +#define YYPATCH 20070509 + +#define YYEMPTY (-1) +#define yyclearin (yychar = YYEMPTY) +#define yyerrok (yyerrflag = 0) +#define YYRECOVERING (yyerrflag != 0) + +extern int yyparse(void); + +static int yygrowstack(void); +#define yyparse hazelEvalparse +#define yylex hazelEvallex +#define yyerror hazelEvalerror +#define yychar hazelEvalchar +#define yyval hazelEvalval +#define yylval hazelEvallval +#define yydebug hazelEvaldebug +#define yynerrs hazelEvalnerrs +#define yyerrflag hazelEvalerrflag +#define yyss hazelEvalss +#define yyssp hazelEvalssp +#define yyvs hazelEvalvs +#define yyvsp hazelEvalvsp +#define yylhs hazelEvallhs +#define yylen hazelEvallen +#define yydefred hazelEvaldefred +#define yydgoto hazelEvaldgoto +#define yysindex hazelEvalsindex +#define yyrindex hazelEvalrindex +#define yygindex hazelEvalgindex +#define yytable hazelEvaltable +#define yycheck hazelEvalcheck +#define yyname hazelEvalname +#define yyrule hazelEvalrule +#define YYPREFIX "hazelEval" + +#include "es2front.h" + +extern int hazelEvallex(void); +extern int hazelEvallex_destroy(void); + +static int hazelNumEval = 0; +static int hazelEvalValueA = 0; +static int hazelEvalValueB = 0; + +int hazelEvalGetResult(int* pEvalA, int* pEvalB) { + if (hazelNumEval >= 1) *pEvalA = hazelEvalValueA; + if (hazelNumEval >= 2) *pEvalB = hazelEvalValueB; + return hazelNumEval; +} + +void hazelEvalTerminate(void) { + hazelEvallex_destroy(); +} + +int yyerror(char* s) { + /* just ignore the YACC error message */ + return 1; +} + +#define IDENTIFIER 257 +#define NUMBER 258 +#define DEFINED 259 +#define LEFT_OP 260 +#define RIGHT_OP 261 +#define LE_OP 262 +#define GE_OP 263 +#define EQ_OP 264 +#define NE_OP 265 +#define AND_OP 266 +#define OR_OP 267 +#define UPLUS 268 +#define UMINUS 269 +#define YYERRCODE 256 +short hazelEvallhs[] = { -1, + 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, +}; +short hazelEvallen[] = { 2, + 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 2, 4, 2, 2, 2, 2, 1, +}; +short hazelEvaldefred[] = { 0, + 28, 0, 0, 0, 0, 0, 0, 0, 0, 22, + 0, 24, 25, 26, 27, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 19, 20, 21, 23, 0, 0, +}; +short hazelEvaldgoto[] = { 8, + 9, +}; +short hazelEvalsindex[] = { -26, + 0, -27, -26, -26, -26, -26, -26, 0, 436, 0, + -255, 0, 0, 0, 0, 447, -26, -26, -26, -26, + -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, + -26, -26, -26, -26, 473, -38, -26, -26, 0, -22, + -22, -37, -37, 681, 681, 582, 541, 527, 630, 497, + -37, -37, 0, 0, 0, 0, 0, 0, -11, -11, +}; +short hazelEvalrindex[] = { 0, + 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 9, 0, 0, 0, 0, 79, + 102, 114, 157, 27, 393, 194, 204, 181, 403, 397, + 288, 351, 1, 12, 0, 0, 0, 0, 37, 51, +}; +short hazelEvalgindex[] = { 0, + 746, +}; +#define YYTABLESIZE 944 +short hazelEvaltable[] = { 34, + 17, 36, 58, 1, 32, 37, 6, 38, 2, 33, + 0, 18, 11, 7, 34, 0, 3, 0, 4, 32, + 37, 0, 38, 0, 33, 34, 9, 0, 0, 0, + 32, 0, 0, 17, 0, 33, 17, 24, 17, 0, + 17, 0, 24, 17, 18, 17, 0, 24, 25, 18, + 18, 18, 0, 25, 18, 0, 18, 0, 25, 9, + 17, 0, 17, 0, 9, 0, 9, 9, 0, 17, + 0, 18, 0, 18, 17, 0, 17, 17, 15, 17, + 0, 17, 0, 18, 0, 0, 0, 0, 18, 0, + 18, 18, 0, 18, 17, 18, 17, 0, 17, 5, + 0, 16, 0, 0, 0, 18, 0, 0, 0, 0, + 18, 15, 18, 13, 0, 0, 15, 0, 15, 15, + 9, 0, 0, 0, 17, 0, 17, 0, 0, 0, + 17, 0, 0, 0, 16, 18, 0, 18, 15, 16, + 15, 16, 16, 0, 18, 0, 13, 0, 0, 0, + 9, 13, 9, 13, 13, 0, 14, 0, 0, 0, + 17, 16, 17, 16, 0, 0, 0, 0, 0, 0, + 0, 0, 15, 13, 18, 13, 18, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, 0, 14, + 0, 0, 0, 5, 14, 16, 14, 14, 0, 0, + 0, 0, 15, 4, 15, 0, 0, 13, 0, 0, + 0, 0, 0, 6, 0, 0, 14, 0, 14, 0, + 6, 6, 17, 18, 0, 16, 5, 16, 0, 10, + 0, 1, 2, 5, 5, 0, 4, 13, 0, 13, + 0, 0, 0, 4, 4, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 0, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 0, + 14, 0, 14, 0, 9, 9, 0, 11, 0, 0, + 9, 9, 9, 9, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 6, 0, 6, 0, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 0, 5, + 11, 0, 0, 0, 0, 11, 0, 11, 11, 4, + 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 0, 11, 0, 11, + 12, 0, 0, 0, 0, 0, 0, 0, 0, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, + 0, 13, 13, 0, 0, 13, 13, 13, 13, 13, + 13, 11, 0, 12, 0, 0, 0, 0, 12, 0, + 12, 12, 10, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, + 12, 11, 12, 11, 14, 14, 0, 0, 14, 14, + 14, 14, 14, 14, 0, 10, 0, 0, 0, 8, + 10, 0, 10, 10, 8, 7, 8, 8, 6, 6, + 0, 0, 7, 7, 12, 0, 6, 6, 0, 0, + 0, 5, 5, 0, 0, 0, 0, 0, 0, 5, + 5, 4, 4, 0, 0, 0, 0, 0, 6, 0, + 4, 0, 34, 27, 12, 7, 12, 32, 30, 0, + 31, 0, 33, 34, 27, 0, 10, 39, 32, 37, + 8, 38, 0, 33, 0, 28, 7, 29, 0, 0, + 0, 0, 0, 0, 0, 0, 28, 0, 29, 34, + 27, 0, 0, 0, 32, 37, 10, 38, 10, 33, + 8, 0, 8, 0, 0, 0, 7, 0, 7, 26, + 0, 0, 28, 34, 29, 0, 0, 0, 32, 37, + 26, 38, 0, 33, 0, 11, 11, 0, 0, 11, + 11, 11, 11, 11, 11, 0, 28, 0, 29, 25, + 0, 5, 0, 34, 27, 0, 26, 0, 32, 37, + 25, 38, 0, 33, 0, 0, 0, 34, 27, 0, + 0, 0, 32, 37, 0, 38, 28, 33, 29, 0, + 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, + 28, 0, 29, 0, 0, 0, 0, 0, 12, 12, + 0, 0, 12, 12, 12, 12, 12, 12, 34, 27, + 26, 0, 0, 32, 37, 0, 38, 0, 33, 0, + 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, + 0, 28, 0, 29, 0, 0, 0, 0, 0, 0, + 10, 10, 0, 0, 8, 8, 10, 10, 10, 10, + 7, 7, 8, 8, 25, 0, 34, 27, 7, 7, + 0, 32, 37, 0, 38, 26, 33, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, + 0, 29, 0, 1, 2, 17, 18, 19, 20, 21, + 22, 23, 24, 0, 0, 25, 17, 18, 19, 20, + 21, 22, 23, 24, 0, 0, 0, 34, 0, 0, + 0, 0, 32, 37, 0, 38, 0, 33, 0, 0, + 0, 0, 17, 18, 19, 20, 21, 22, 23, 24, + 28, 0, 29, 0, 0, 0, 0, 0, 12, 13, + 14, 15, 16, 0, 35, 0, 17, 18, 19, 20, + 21, 22, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 0, 0, 59, 60, 0, 0, 17, 18, 19, 20, + 21, 22, 0, 0, 0, 0, 0, 0, 0, 0, + 17, 18, 19, 20, 21, 22, 23, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 17, 18, 19, 20, 21, 22, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, + 18, 19, 20, 21, 22, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 17, 18, 19, 20, +}; +short hazelEvalcheck[] = { 37, + 0, 257, 41, 0, 42, 43, 33, 45, 0, 47, + -1, 0, 40, 40, 37, -1, 43, -1, 45, 42, + 43, -1, 45, -1, 47, 37, 0, -1, -1, -1, + 42, -1, -1, 33, -1, 47, 0, 37, 38, -1, + 40, -1, 42, 43, 33, 45, -1, 47, 37, 38, + 0, 40, -1, 42, 43, -1, 45, -1, 47, 33, + 60, -1, 62, -1, 38, -1, 40, 41, -1, 33, + -1, 60, -1, 62, 38, -1, 40, 41, 0, 43, + -1, 45, -1, 33, -1, -1, -1, -1, 38, -1, + 40, 41, -1, 43, 94, 45, 60, -1, 62, 126, + -1, 0, -1, -1, -1, 94, -1, -1, -1, -1, + 60, 33, 62, 0, -1, -1, 38, -1, 40, 41, + 94, -1, -1, -1, 124, -1, 126, -1, -1, -1, + 94, -1, -1, -1, 33, 124, -1, 126, 60, 38, + 62, 40, 41, -1, 94, -1, 33, -1, -1, -1, + 124, 38, 126, 40, 41, -1, 0, -1, -1, -1, + 124, 60, 126, 62, -1, -1, -1, -1, -1, -1, + -1, -1, 94, 60, 124, 62, 126, -1, -1, -1, + 0, -1, -1, -1, -1, -1, -1, -1, -1, 33, + -1, -1, -1, 0, 38, 94, 40, 41, -1, -1, + -1, -1, 124, 0, 126, -1, -1, 94, -1, -1, + -1, -1, -1, 33, -1, -1, 60, -1, 62, -1, + 40, 41, 260, 261, -1, 124, 33, 126, -1, 257, + -1, 258, 259, 40, 41, -1, 33, 124, -1, 126, + -1, -1, -1, 40, 41, -1, -1, -1, -1, -1, + 94, -1, -1, -1, -1, -1, -1, -1, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, -1, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, -1, + 124, -1, 126, -1, 258, 259, -1, 0, -1, -1, + 264, 265, 266, 267, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 124, -1, 126, -1, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, -1, 126, + 33, -1, -1, -1, -1, 38, -1, 40, 41, 126, + -1, -1, -1, -1, -1, -1, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, -1, 60, -1, 62, + 0, -1, -1, -1, -1, -1, -1, -1, -1, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, -1, + -1, 258, 259, -1, -1, 262, 263, 264, 265, 266, + 267, 94, -1, 33, -1, -1, -1, -1, 38, -1, + 40, 41, 0, -1, -1, -1, 0, -1, -1, -1, + -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, + 60, 124, 62, 126, 258, 259, -1, -1, 262, 263, + 264, 265, 266, 267, -1, 33, -1, -1, -1, 33, + 38, -1, 40, 41, 38, 33, 40, 41, 258, 259, + -1, -1, 40, 41, 94, -1, 266, 267, -1, -1, + -1, 258, 259, -1, -1, -1, -1, -1, -1, 266, + 267, 258, 259, -1, -1, -1, -1, -1, 33, -1, + 267, -1, 37, 38, 124, 40, 126, 42, 43, -1, + 45, -1, 47, 37, 38, -1, 94, 41, 42, 43, + 94, 45, -1, 47, -1, 60, 94, 62, -1, -1, + -1, -1, -1, -1, -1, -1, 60, -1, 62, 37, + 38, -1, -1, -1, 42, 43, 124, 45, 126, 47, + 124, -1, 126, -1, -1, -1, 124, -1, 126, 94, + -1, -1, 60, 37, 62, -1, -1, -1, 42, 43, + 94, 45, -1, 47, -1, 258, 259, -1, -1, 262, + 263, 264, 265, 266, 267, -1, 60, -1, 62, 124, + -1, 126, -1, 37, 38, -1, 94, -1, 42, 43, + 124, 45, -1, 47, -1, -1, -1, 37, 38, -1, + -1, -1, 42, 43, -1, 45, 60, 47, 62, -1, + -1, -1, -1, -1, -1, -1, 124, -1, -1, -1, + 60, -1, 62, -1, -1, -1, -1, -1, 258, 259, + -1, -1, 262, 263, 264, 265, 266, 267, 37, 38, + 94, -1, -1, 42, 43, -1, 45, -1, 47, -1, + -1, -1, -1, -1, 94, -1, -1, -1, -1, -1, + -1, 60, -1, 62, -1, -1, -1, -1, -1, -1, + 258, 259, -1, -1, 258, 259, 264, 265, 266, 267, + 258, 259, 266, 267, 124, -1, 37, 38, 266, 267, + -1, 42, 43, -1, 45, 94, 47, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 60, + -1, 62, -1, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, -1, -1, 124, 260, 261, 262, 263, + 264, 265, 266, 267, -1, -1, -1, 37, -1, -1, + -1, -1, 42, 43, -1, 45, -1, 47, -1, -1, + -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, + 60, -1, 62, -1, -1, -1, -1, -1, 3, 4, + 5, 6, 7, -1, 9, -1, 260, 261, 262, 263, + 264, 265, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + -1, -1, 37, 38, -1, -1, 260, 261, 262, 263, + 264, 265, -1, -1, -1, -1, -1, -1, -1, -1, + 260, 261, 262, 263, 264, 265, 266, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 260, 261, 262, 263, 264, 265, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 260, + 261, 262, 263, 264, 265, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 260, 261, 262, 263, +}; +#define YYFINAL 8 +#ifndef YYDEBUG +#define YYDEBUG 0 +#endif +#define YYMAXTOKEN 269 +#if YYDEBUG +char *hazelEvalname[] = { +"end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +"'!'",0,0,0,"'%'","'&'",0,"'('","')'","'*'","'+'",0,"'-'",0,"'/'",0,0,0,0,0,0,0, +0,0,0,0,0,"'<'",0,"'>'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,"'^'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'|'",0, +"'~'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,"IDENTIFIER","NUMBER","DEFINED","LEFT_OP","RIGHT_OP", +"LE_OP","GE_OP","EQ_OP","NE_OP","AND_OP","OR_OP","UPLUS","UMINUS", +}; +char *hazelEvalrule[] = { +"$accept : goal", +"goal : expr", +"goal : expr expr", +"expr : '(' expr ')'", +"expr : expr OR_OP expr", +"expr : expr AND_OP expr", +"expr : expr '|' expr", +"expr : expr '^' expr", +"expr : expr '&' expr", +"expr : expr EQ_OP expr", +"expr : expr NE_OP expr", +"expr : expr '<' expr", +"expr : expr '>' expr", +"expr : expr LE_OP expr", +"expr : expr GE_OP expr", +"expr : expr LEFT_OP expr", +"expr : expr RIGHT_OP expr", +"expr : expr '+' expr", +"expr : expr '-' expr", +"expr : expr '*' expr", +"expr : expr '/' expr", +"expr : expr '%' expr", +"expr : DEFINED IDENTIFIER", +"expr : DEFINED '(' IDENTIFIER ')'", +"expr : '+' expr", +"expr : '-' expr", +"expr : '~' expr", +"expr : '!' expr", +"expr : NUMBER", +}; +#endif +#ifndef YYSTYPE +typedef int YYSTYPE; +#endif +#if YYDEBUG +#include <stdio.h> +#endif + +/* define the initial stack-sizes */ +#ifdef YYSTACKSIZE +#undef YYMAXDEPTH +#define YYMAXDEPTH YYSTACKSIZE +#else +#ifdef YYMAXDEPTH +#define YYSTACKSIZE YYMAXDEPTH +#else +#define YYSTACKSIZE 500 +#define YYMAXDEPTH 500 +#endif +#endif + +#define YYINITSTACKSIZE 500 + +int yydebug; +int yynerrs; +int yyerrflag; +int yychar; +short *yyssp; +YYSTYPE *yyvsp; +YYSTYPE yyval; +YYSTYPE yylval; + +/* variables for the parser stack */ +static short *yyss; +static short *yysslim; +static YYSTYPE *yyvs; +static int yystacksize; + +#include "EvalLex.inl" +/* allocate initial stack or double stack size, up to YYMAXDEPTH */ +static int yygrowstack(void) +{ + int newsize, i; + short *newss; + YYSTYPE *newvs; + + if ((newsize = yystacksize) == 0) + newsize = YYINITSTACKSIZE; + else if (newsize >= YYMAXDEPTH) + return -1; + else if ((newsize *= 2) > YYMAXDEPTH) + newsize = YYMAXDEPTH; + + i = yyssp - yyss; + newss = (yyss != 0) + ? (short *)realloc(yyss, newsize * sizeof(*newss)) + : (short *)malloc(newsize * sizeof(*newss)); + if (newss == 0) + return -1; + + yyss = newss; + yyssp = newss + i; + newvs = (yyvs != 0) + ? (YYSTYPE *)realloc(yyvs, newsize * sizeof(*newvs)) + : (YYSTYPE *)malloc(newsize * sizeof(*newvs)); + if (newvs == 0) + return -1; + + yyvs = newvs; + yyvsp = newvs + i; + yystacksize = newsize; + yysslim = yyss + newsize - 1; + return 0; +} + +#define YYABORT goto yyabort +#define YYREJECT goto yyabort +#define YYACCEPT goto yyaccept +#define YYERROR goto yyerrlab +int +yyparse(void) +{ + register int yym, yyn, yystate; +#if YYDEBUG + register const char *yys; + + if ((yys = getenv("YYDEBUG")) != 0) + { + yyn = *yys; + if (yyn >= '0' && yyn <= '9') + yydebug = yyn - '0'; + } +#endif + + yynerrs = 0; + yyerrflag = 0; + yychar = YYEMPTY; + + if (yyss == NULL && yygrowstack()) goto yyoverflow; + yyssp = yyss; + yyvsp = yyvs; + *yyssp = yystate = 0; + +yyloop: + if ((yyn = yydefred[yystate]) != 0) goto yyreduce; + if (yychar < 0) + { + if ((yychar = yylex()) < 0) yychar = 0; +#if YYDEBUG + if (yydebug) + { + yys = 0; + if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; + if (!yys) yys = "illegal-symbol"; + printf("%sdebug: state %d, reading %d (%s)\n", + YYPREFIX, yystate, yychar, yys); + } +#endif + } + if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && + yyn <= YYTABLESIZE && yycheck[yyn] == yychar) + { +#if YYDEBUG + if (yydebug) + printf("%sdebug: state %d, shifting to state %d\n", + YYPREFIX, yystate, yytable[yyn]); +#endif + if (yyssp >= yysslim && yygrowstack()) + { + goto yyoverflow; + } + *++yyssp = yystate = yytable[yyn]; + *++yyvsp = yylval; + yychar = YYEMPTY; + if (yyerrflag > 0) --yyerrflag; + goto yyloop; + } + if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && + yyn <= YYTABLESIZE && yycheck[yyn] == yychar) + { + yyn = yytable[yyn]; + goto yyreduce; + } + if (yyerrflag) goto yyinrecovery; + + yyerror("syntax error"); + +#ifdef lint + goto yyerrlab; +#endif + +yyerrlab: + ++yynerrs; + +yyinrecovery: + if (yyerrflag < 3) + { + yyerrflag = 3; + for (;;) + { + if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 && + yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) + { +#if YYDEBUG + if (yydebug) + printf("%sdebug: state %d, error recovery shifting\ + to state %d\n", YYPREFIX, *yyssp, yytable[yyn]); +#endif + if (yyssp >= yysslim && yygrowstack()) + { + goto yyoverflow; + } + *++yyssp = yystate = yytable[yyn]; + *++yyvsp = yylval; + goto yyloop; + } + else + { +#if YYDEBUG + if (yydebug) + printf("%sdebug: error recovery discarding state %d\n", + YYPREFIX, *yyssp); +#endif + if (yyssp <= yyss) goto yyabort; + --yyssp; + --yyvsp; + } + } + } + else + { + if (yychar == 0) goto yyabort; +#if YYDEBUG + if (yydebug) + { + yys = 0; + if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; + if (!yys) yys = "illegal-symbol"; + printf("%sdebug: state %d, error recovery discards token %d (%s)\n", + YYPREFIX, yystate, yychar, yys); + } +#endif + yychar = YYEMPTY; + goto yyloop; + } + +yyreduce: +#if YYDEBUG + if (yydebug) + printf("%sdebug: state %d, reducing by rule %d (%s)\n", + YYPREFIX, yystate, yyn, yyrule[yyn]); +#endif + yym = yylen[yyn]; + if (yym) + yyval = yyvsp[1-yym]; + else + memset(&yyval, 0, sizeof yyval); + switch (yyn) + { +case 1: +{ hazelNumEval = 1; hazelEvalValueA = yyvsp[0]; } +break; +case 2: +{ hazelNumEval = 2; hazelEvalValueA = yyvsp[-1]; hazelEvalValueB = yyvsp[0]; } +break; +case 3: +{ yyval = yyvsp[-1]; } +break; +case 4: +{ yyval = (yyvsp[-2] || yyvsp[0]); } +break; +case 5: +{ yyval = (yyvsp[-2] && yyvsp[0]); } +break; +case 6: +{ yyval = (yyvsp[-2] | yyvsp[0]); } +break; +case 7: +{ yyval = (yyvsp[-2] ^ yyvsp[0]); } +break; +case 8: +{ yyval = (yyvsp[-2] & yyvsp[0]); } +break; +case 9: +{ yyval = (yyvsp[-2] == yyvsp[0]); } +break; +case 10: +{ yyval = (yyvsp[-2] != yyvsp[0]); } +break; +case 11: +{ yyval = (yyvsp[-2] < yyvsp[0]); } +break; +case 12: +{ yyval = (yyvsp[-2] > yyvsp[0]); } +break; +case 13: +{ yyval = (yyvsp[-2] <= yyvsp[0]); } +break; +case 14: +{ yyval = (yyvsp[-2] >= yyvsp[0]); } +break; +case 15: +{ yyval = (yyvsp[-2] << yyvsp[0]); } +break; +case 16: +{ yyval = (yyvsp[-2] >> yyvsp[0]); } +break; +case 17: +{ yyval = (yyvsp[-2] + yyvsp[0]); } +break; +case 18: +{ yyval = (yyvsp[-2] - yyvsp[0]); } +break; +case 19: +{ yyval = (yyvsp[-2] * yyvsp[0]); } +break; +case 20: +{ yyval = (yyvsp[-2] / yyvsp[0]); } +break; +case 21: +{ yyval = (yyvsp[-2] % yyvsp[0]); } +break; +case 22: +{ yyval = (yyvsp[0] != (int)(NULL)); } +break; +case 23: +{ yyval = (yyvsp[-1] != (int)(NULL)); } +break; +case 24: +{ yyval = (yyvsp[0]); } +break; +case 25: +{ yyval = (- yyvsp[0]); } +break; +case 26: +{ yyval = (~ yyvsp[0]); } +break; +case 27: +{ yyval = (! yyvsp[0]); } +break; +case 28: +{ yyval = yyvsp[0]; } +break; + } + yyssp -= yym; + yystate = *yyssp; + yyvsp -= yym; + yym = yylhs[yyn]; + if (yystate == 0 && yym == 0) + { +#if YYDEBUG + if (yydebug) + printf("%sdebug: after reduction, shifting from state 0 to\ + state %d\n", YYPREFIX, YYFINAL); +#endif + yystate = YYFINAL; + *++yyssp = YYFINAL; + *++yyvsp = yyval; + if (yychar < 0) + { + if ((yychar = yylex()) < 0) yychar = 0; +#if YYDEBUG + if (yydebug) + { + yys = 0; + if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; + if (!yys) yys = "illegal-symbol"; + printf("%sdebug: state %d, reading %d (%s)\n", + YYPREFIX, YYFINAL, yychar, yys); + } +#endif + } + if (yychar == 0) goto yyaccept; + goto yyloop; + } + if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && + yyn <= YYTABLESIZE && yycheck[yyn] == yystate) + yystate = yytable[yyn]; + else + yystate = yydgoto[yym]; +#if YYDEBUG + if (yydebug) + printf("%sdebug: after reduction, shifting from state %d \ +to state %d\n", YYPREFIX, *yyssp, yystate); +#endif + if (yyssp >= yysslim && yygrowstack()) + { + goto yyoverflow; + } + *++yyssp = yystate; + *++yyvsp = yyval; + goto yyloop; + +yyoverflow: + yyerror("yacc stack overflow"); + +yyabort: + return (1); + +yyaccept: + return (0); +} diff --git a/es_2_0/Extend.c b/es_2_0/Extend.c new file mode 100755 index 0000000..56d119b --- /dev/null +++ b/es_2_0/Extend.c @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "es2front.h" + + +#if defined(PROVIDING_OES_blend_func_separate) +void GL_APIENTRY ES2ENTRY(BlendFuncSeparateOES)(GLenum srcRGB, GLenum dstRGB, + GLenum srcAlpha, GLenum dstAlpha) { + ES2ENTRY(BlendFuncSeparateOES)(srcRGB, dstRGB, srcAlpha, dstAlpha); +} +#endif + +#if defined(PROVIDING_OES_blend_subtract) +void GL_APIENTRY ES2ENTRY(BlendEquationOES)(GLenum mode) { + ES2ENTRY(BlendEquation)(mode); +} +#endif + + +#if defined(PROVIDING_OES_single_precision) + +void GL_APIENTRY ES2ENTRY(DepthRangefOES)(GLclampf zNear, GLclampf zFar) { + ES2ENTRY(DepthRangef)(zNear, zFar); +} + +void GL_APIENTRY ES2ENTRY(ClearDepthfOES)(GLclampf depth) { + ES2ENTRY(ClearDepthf)(depth); +} + +#endif + + diff --git a/es_2_0/Flush.c b/es_2_0/Flush.c new file mode 100755 index 0000000..db98fcf --- /dev/null +++ b/es_2_0/Flush.c @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "es2front.h" + + +void GL_APIENTRY ES2ENTRY(Flush)(void) { + FNPTR(Flush)(); +} + +void GL_APIENTRY ES2ENTRY(Finish)(void) { + FNPTR(Finish)(); +} + +void GL_APIENTRY ES2ENTRY(Hint)(GLenum target, GLenum mode) { + switch (target) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_GENERATE_MIPMAP_HINT: + switch (mode) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_FASTEST: + case GL_NICEST: + case GL_DONT_CARE: + break; + } + break; + } + FNPTR(Hint)(target, mode); +} diff --git a/es_2_0/Fragment.c b/es_2_0/Fragment.c new file mode 100755 index 0000000..37650d1 --- /dev/null +++ b/es_2_0/Fragment.c @@ -0,0 +1,419 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "es2front.h" + + +void GL_APIENTRY ES2ENTRY(Scissor)(GLint x, GLint y, GLsizei width, GLsizei height) { + if (width < 0 || height < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + FNPTR(Scissor)(x, y, width, height); +} + +void GL_APIENTRY ES2ENTRY(StencilFunc)(GLenum func, GLint ref, GLuint mask) { + switch (func) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_NEVER: + case GL_LESS: + case GL_LEQUAL: + case GL_GREATER: + case GL_GEQUAL: + case GL_EQUAL: + case GL_NOTEQUAL: + case GL_ALWAYS: + break; + } + FNPTR(StencilFunc)(func, ref, mask); +} + +void GL_APIENTRY ES2ENTRY(StencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask) { + switch (face) { + default: + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + case GL_FRONT: + case GL_BACK: + case GL_FRONT_AND_BACK: + break; + } + switch (func) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_NEVER: + case GL_LESS: + case GL_LEQUAL: + case GL_GREATER: + case GL_GEQUAL: + case GL_EQUAL: + case GL_NOTEQUAL: + case GL_ALWAYS: + break; + } + FNPTR(StencilFuncSeparate)(face, func, ref, mask); +} + +void GL_APIENTRY ES2ENTRY(StencilOp)(GLenum fail, GLenum zfail, GLenum zpass) { + switch (fail) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_ZERO: + case GL_KEEP: + case GL_REPLACE: + case GL_INCR: + case GL_INCR_WRAP: + case GL_DECR: + case GL_DECR_WRAP: + case GL_INVERT: + break; + } + switch (zfail) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_ZERO: + case GL_KEEP: + case GL_REPLACE: + case GL_INCR: + case GL_INCR_WRAP: + case GL_DECR: + case GL_DECR_WRAP: + case GL_INVERT: + break; + } + switch (zpass) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_ZERO: + case GL_KEEP: + case GL_REPLACE: + case GL_INCR: + case GL_INCR_WRAP: + case GL_DECR: + case GL_DECR_WRAP: + case GL_INVERT: + break; + } + FNPTR(StencilOp)(fail, zfail, zpass); +} + +void GL_APIENTRY ES2ENTRY(StencilOpSeparate)(GLenum face, GLenum fail, GLenum zfail, GLenum zpass) { + switch (face) { + default: + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + case GL_FRONT: + case GL_BACK: + case GL_FRONT_AND_BACK: + break; + } + switch (fail) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_ZERO: + case GL_KEEP: + case GL_REPLACE: + case GL_INCR: + case GL_INCR_WRAP: + case GL_DECR: + case GL_DECR_WRAP: + case GL_INVERT: + break; + } + switch (zfail) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_ZERO: + case GL_KEEP: + case GL_REPLACE: + case GL_INCR: + case GL_INCR_WRAP: + case GL_DECR: + case GL_DECR_WRAP: + case GL_INVERT: + break; + } + switch (zpass) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_ZERO: + case GL_KEEP: + case GL_REPLACE: + case GL_INCR: + case GL_INCR_WRAP: + case GL_DECR: + case GL_DECR_WRAP: + case GL_INVERT: + break; + } + FNPTR(StencilOpSeparate)(face, fail, zfail, zpass); +} + +void GL_APIENTRY ES2ENTRY(DepthFunc)(GLenum func) { + switch (func) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_NEVER: + case GL_LESS: + case GL_EQUAL: + case GL_LEQUAL: + case GL_GREATER: + case GL_NOTEQUAL: + case GL_GEQUAL: + case GL_ALWAYS: + break; + } + FNPTR(DepthFunc)(func); +} + +void GL_APIENTRY ES2ENTRY(BlendFunc)(GLenum sfactor, GLenum dfactor) { + switch (sfactor) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_ZERO: + case GL_ONE: + case GL_SRC_COLOR: + case GL_ONE_MINUS_SRC_COLOR: + case GL_DST_COLOR: + case GL_ONE_MINUS_DST_COLOR: + case GL_SRC_ALPHA: + case GL_ONE_MINUS_SRC_ALPHA: + case GL_DST_ALPHA: + case GL_ONE_MINUS_DST_ALPHA: + case GL_CONSTANT_COLOR: + case GL_ONE_MINUS_CONSTANT_COLOR: + case GL_CONSTANT_ALPHA: + case GL_ONE_MINUS_CONSTANT_ALPHA: + case GL_SRC_ALPHA_SATURATE: + break; + } + switch (dfactor) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_ZERO: + case GL_ONE: + case GL_SRC_COLOR: + case GL_ONE_MINUS_SRC_COLOR: + case GL_DST_COLOR: + case GL_ONE_MINUS_DST_COLOR: + case GL_SRC_ALPHA: + case GL_ONE_MINUS_SRC_ALPHA: + case GL_DST_ALPHA: + case GL_ONE_MINUS_DST_ALPHA: + case GL_CONSTANT_COLOR: + case GL_ONE_MINUS_CONSTANT_COLOR: + case GL_CONSTANT_ALPHA: + case GL_ONE_MINUS_CONSTANT_ALPHA: + break; + } + FNPTR(BlendFunc)(sfactor, dfactor); +} + +void GL_APIENTRY ES2ENTRY(BlendFuncSeparate)(GLenum srcRGB, GLenum dstRGB, + GLenum srcAlpha, GLenum dstAlpha) { + switch (srcRGB) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_ZERO: + case GL_ONE: + case GL_SRC_COLOR: + case GL_ONE_MINUS_SRC_COLOR: + case GL_DST_COLOR: + case GL_ONE_MINUS_DST_COLOR: + case GL_SRC_ALPHA: + case GL_ONE_MINUS_SRC_ALPHA: + case GL_DST_ALPHA: + case GL_ONE_MINUS_DST_ALPHA: + case GL_CONSTANT_COLOR: + case GL_ONE_MINUS_CONSTANT_COLOR: + case GL_CONSTANT_ALPHA: + case GL_ONE_MINUS_CONSTANT_ALPHA: + case GL_SRC_ALPHA_SATURATE: + break; + } + switch (dstRGB) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_ZERO: + case GL_ONE: + case GL_SRC_COLOR: + case GL_ONE_MINUS_SRC_COLOR: + case GL_DST_COLOR: + case GL_ONE_MINUS_DST_COLOR: + case GL_SRC_ALPHA: + case GL_ONE_MINUS_SRC_ALPHA: + case GL_DST_ALPHA: + case GL_ONE_MINUS_DST_ALPHA: + case GL_CONSTANT_COLOR: + case GL_ONE_MINUS_CONSTANT_COLOR: + case GL_CONSTANT_ALPHA: + case GL_ONE_MINUS_CONSTANT_ALPHA: + break; + } + switch (srcAlpha) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_ZERO: + case GL_ONE: + case GL_SRC_COLOR: + case GL_ONE_MINUS_SRC_COLOR: + case GL_DST_COLOR: + case GL_ONE_MINUS_DST_COLOR: + case GL_SRC_ALPHA: + case GL_ONE_MINUS_SRC_ALPHA: + case GL_DST_ALPHA: + case GL_ONE_MINUS_DST_ALPHA: + case GL_CONSTANT_COLOR: + case GL_ONE_MINUS_CONSTANT_COLOR: + case GL_CONSTANT_ALPHA: + case GL_ONE_MINUS_CONSTANT_ALPHA: + case GL_SRC_ALPHA_SATURATE: + break; + } + switch (dstAlpha) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_ZERO: + case GL_ONE: + case GL_SRC_COLOR: + case GL_ONE_MINUS_SRC_COLOR: + case GL_DST_COLOR: + case GL_ONE_MINUS_DST_COLOR: + case GL_SRC_ALPHA: + case GL_ONE_MINUS_SRC_ALPHA: + case GL_DST_ALPHA: + case GL_ONE_MINUS_DST_ALPHA: + case GL_CONSTANT_COLOR: + case GL_ONE_MINUS_CONSTANT_COLOR: + case GL_CONSTANT_ALPHA: + case GL_ONE_MINUS_CONSTANT_ALPHA: + break; + } + FNPTR(BlendFuncSeparate)(srcRGB, dstRGB, srcAlpha, dstAlpha); +} + +void GL_APIENTRY ES2ENTRY(BlendColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) { + FNPTR(BlendColor)(red, green, blue, alpha); +} + +void GL_APIENTRY ES2ENTRY(BlendEquation)(GLenum mode) { + switch (mode) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_FUNC_ADD: + case GL_FUNC_SUBTRACT: + case GL_FUNC_REVERSE_SUBTRACT: + break; + } + FNPTR(BlendEquation)(mode); +} + +void GL_APIENTRY ES2ENTRY(BlendEquationSeparate)(GLenum modeRGB, GLenum modeAlpha) { + switch (modeRGB) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_FUNC_ADD: + case GL_FUNC_SUBTRACT: + case GL_FUNC_REVERSE_SUBTRACT: + break; + } + switch (modeAlpha) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_FUNC_ADD: + case GL_FUNC_SUBTRACT: + case GL_FUNC_REVERSE_SUBTRACT: + break; + } + FNPTR(BlendEquationSeparate)(modeRGB, modeAlpha); +} + +void GL_APIENTRY ES2ENTRY(SampleCoverage)(GLclampf value, GLboolean invert) { + FNPTR(SampleCoverage)(value, invert); +} + +void GL_APIENTRY ES2ENTRY(ReadPixels)(GLint x, GLint y, + GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels) { + switch (format) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_ALPHA: + case GL_RGB: + case GL_RGBA: + break; + } + switch (type) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_UNSIGNED_BYTE: + break; + case GL_UNSIGNED_SHORT_5_6_5: + if (format != GL_RGB) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + break; + case GL_UNSIGNED_SHORT_4_4_4_4: + case GL_UNSIGNED_SHORT_5_5_5_1: + if (format != GL_RGBA) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + break; + } + if (width < 0 || height < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + + FNPTR(ReadPixels)(x, y, width, height, format, type, pixels); +} diff --git a/es_2_0/Framebuffer.c b/es_2_0/Framebuffer.c new file mode 100755 index 0000000..b18c41f --- /dev/null +++ b/es_2_0/Framebuffer.c @@ -0,0 +1,339 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "es2front.h" +#include <GLES2/gl2ext.h> + + +void GL_APIENTRY ES2ENTRY(GenFramebuffers)(GLsizei n, GLuint* framebuffers) { + if (n < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } else if (n == 0) { + return; + } + FNPTR(GenFramebuffers)(n, framebuffers); +} + +void GL_APIENTRY ES2ENTRY(GenRenderbuffers)(GLsizei n, GLuint* renderbuffers) { + if (n < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } else if (n == 0) { + return; + } + FNPTR(GenRenderbuffers)(n, renderbuffers); +} + +void GL_APIENTRY ES2ENTRY(DeleteFramebuffers)(GLsizei n, const GLuint* framebuffers) { + if (n < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + FNPTR(DeleteFramebuffers)(n, framebuffers); +} + +void GL_APIENTRY ES2ENTRY(DeleteRenderbuffers)(GLsizei n, const GLuint* renderbuffers) { + if (n < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + FNPTR(DeleteRenderbuffers)(n, renderbuffers); +} + +GLboolean GL_APIENTRY ES2ENTRY(IsFramebuffer)(GLuint framebuffer) { + register GLboolean bAnswer; + bAnswer = FNPTR(IsFramebuffer)(framebuffer); + return bAnswer; +} + +GLboolean GL_APIENTRY ES2ENTRY(IsRenderbuffer)(GLuint renderbuffer) { + register GLboolean bAnswer; + bAnswer = FNPTR(IsRenderbuffer)(renderbuffer); + return bAnswer; +} + +void GL_APIENTRY ES2ENTRY(BindFramebuffer)(GLenum target, GLuint framebuffer) { + if (target != GL_FRAMEBUFFER) { + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + } + FNPTR(BindFramebuffer)(target, framebuffer); +} + +void GL_APIENTRY ES2ENTRY(BindRenderbuffer)(GLenum target, GLuint renderbuffer) { + if (target != GL_RENDERBUFFER) { + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + } + FNPTR(BindRenderbuffer)(target, renderbuffer); +} + +void GL_APIENTRY ES2ENTRY(RenderbufferStorage)(GLenum target, + GLenum internalformat, GLsizei width, GLsizei height) { + int iMaxSize; + GLuint uRenderBuffer; + if (target != GL_RENDERBUFFER) { + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + } + switch (internalformat) { + default: + case GL_DEPTH_COMPONENT24_OES: + case GL_DEPTH_COMPONENT32_OES: + case GL_STENCIL_INDEX: + case GL_DEPTH_STENCIL_OES: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; +#if defined(PROVIDING_OES_rgb8_rgba8) + case GL_RGB8_OES: + case GL_RGBA8_OES: +#endif +#if defined(PROVIDING_OES_packed_depth_stencil) + case GL_DEPTH24_STENCIL8_OES: +#endif + case GL_RGBA4: + case GL_RGB5_A1: + case GL_DEPTH_COMPONENT16: + case GL_STENCIL_INDEX8: + break; + case GL_RGB565: + internalformat = GL_RGB5_A1; + break; + } + FNPTR(GetIntegerv)(GL_MAX_RENDERBUFFER_SIZE, &iMaxSize); + if (width < 0 || iMaxSize < width || height < 0 || iMaxSize < height) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + FNPTR(GetIntegerv)(GL_RENDERBUFFER_BINDING, &uRenderBuffer); + if (uRenderBuffer == 0) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + FNPTR(RenderbufferStorage)(target, internalformat, width, height); +} + +void GL_APIENTRY ES2ENTRY(GetRenderbufferParameteriv)(GLenum target, GLenum pname, GLint* params) { + GLuint uRenderBuffer; + if (target != GL_RENDERBUFFER) { + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + } + switch (pname) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_RENDERBUFFER_WIDTH: + case GL_RENDERBUFFER_HEIGHT: + case GL_RENDERBUFFER_INTERNAL_FORMAT: + case GL_RENDERBUFFER_RED_SIZE: + case GL_RENDERBUFFER_GREEN_SIZE: + case GL_RENDERBUFFER_BLUE_SIZE: + case GL_RENDERBUFFER_ALPHA_SIZE: + case GL_RENDERBUFFER_DEPTH_SIZE: + case GL_RENDERBUFFER_STENCIL_SIZE: + break; + } + FNPTR(GetIntegerv)(GL_RENDERBUFFER_BINDING, &uRenderBuffer); + if (uRenderBuffer == 0) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + FNPTR(GetRenderbufferParameteriv)(target, pname, params); +} + +void GL_APIENTRY ES2ENTRY(FramebufferRenderbuffer)(GLenum target, GLenum attachment, + GLenum renderbuffertarget, GLuint renderbuffer) { + GLuint uBuffer; + if (target != GL_FRAMEBUFFER) { + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + } + FNPTR(GetIntegerv)(GL_FRAMEBUFFER_BINDING, &uBuffer); + if (uBuffer == 0) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + if (renderbuffertarget != GL_RENDERBUFFER) { + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + } + if (renderbuffer != 0 && FNPTR(IsRenderbuffer)(renderbuffer) == GL_FALSE) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + switch (attachment) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_COLOR_ATTACHMENT0: + case GL_DEPTH_ATTACHMENT: + case GL_STENCIL_ATTACHMENT: + break; + } + FNPTR(FramebufferRenderbuffer)(target, attachment, renderbuffertarget, renderbuffer); +} + +void GL_APIENTRY ES2ENTRY(FramebufferTexture2D)(GLenum target, GLenum attachment, + GLenum textarget, GLuint texture, GLint level) { + GLuint uBuffer; + if (target != GL_FRAMEBUFFER) { + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + } + FNPTR(GetIntegerv)(GL_FRAMEBUFFER_BINDING, &uBuffer); + if (uBuffer == 0) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + switch (attachment) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_COLOR_ATTACHMENT0: + case GL_DEPTH_ATTACHMENT: + case GL_STENCIL_ATTACHMENT: + break; + } + if (texture == 0) { + FNPTR(FramebufferTexture2D)(target, attachment, textarget, texture, level); + return; + } + if (FNPTR(IsTexture)(texture) == GL_FALSE) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + if (level != 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } +// disable GenMipmap which caused driver crash on Ubuntu with Intel graphic card. +#if 0 + switch (textarget) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_TEXTURE_2D: + FNPTR(GenerateMipmap)(GL_TEXTURE_2D); + break; + case GL_TEXTURE_CUBE_MAP_POSITIVE_X: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: + FNPTR(GenerateMipmap)(GL_TEXTURE_CUBE_MAP); + break; + } +#endif + FNPTR(FramebufferTexture2D)(target, attachment, textarget, texture, level); +} + +void GL_APIENTRY ES2ENTRY(GetFramebufferAttachmentParameteriv)(GLenum target, + GLenum attachment, GLenum pname, GLint* params) { + GLuint uBuffer; + if (target != GL_FRAMEBUFFER) { + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + } + FNPTR(GetIntegerv)(GL_FRAMEBUFFER_BINDING, &uBuffer); + if (uBuffer == 0) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + switch (attachment) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_COLOR_ATTACHMENT0: + case GL_DEPTH_ATTACHMENT: + case GL_STENCIL_ATTACHMENT: + break; + } + switch (pname) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: + case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: + case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: + case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: + break; + } + FNPTR(GetFramebufferAttachmentParameteriv)(target, attachment, pname, params); +} + +#if ! defined(GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT) +#define GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT 0x8CD8 +#endif +#if ! defined(GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER) +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB +#endif +#if ! defined(GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER) +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC +#endif +#if ! defined(GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT) +#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA +#endif +#if ! defined(GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE) +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 +#endif + +GLenum GL_APIENTRY ES2ENTRY(CheckFramebufferStatus)(GLenum target) { + register GLenum eValue; + if (target != GL_FRAMEBUFFER) { + ES2INTER(SetError)(GL_INVALID_ENUM); + } + eValue = FNPTR(CheckFramebufferStatus)(target); + switch (eValue) { + default: + case GL_FRAMEBUFFER_COMPLETE: + case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT: + case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: + case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS: + case GL_FRAMEBUFFER_UNSUPPORTED: + break; + case GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT: + case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER: + case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER: + eValue = GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT; + break; + case GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT: + case GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: + eValue = GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS; + break; + case 0: + eValue = GL_FRAMEBUFFER_UNSUPPORTED; + break; + } + return (eValue == 0) ? GL_FRAMEBUFFER_UNSUPPORTED : eValue; +} diff --git a/es_2_0/Get.c b/es_2_0/Get.c new file mode 100755 index 0000000..bd2f2e8 --- /dev/null +++ b/es_2_0/Get.c @@ -0,0 +1,455 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "es2front.h" +#include <GLES2/gl2ext.h> + +#ifndef GL_MAX_FRAGMENT_UNIFORM_COMPONENTS +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 +#endif +#ifndef GL_MAX_VARYING_FLOATS +#define GL_MAX_VARYING_FLOATS 0x8B4B +#endif +#ifndef GL_MAX_VERTEX_UNIFORM_COMPONENTS +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A +#endif + +const GLubyte* GL_APIENTRY ES2ENTRY(GetString)(GLenum name) { + static char buf[128]; + switch (name) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return NULL; + break; + case GL_VENDOR: + return (GLubyte*)"Huone Inc."; + break; + case GL_RENDERER: +#if defined(__pic__) + return (GLubyte*)"AlexGL ES 2.0 dynamic on OpenGL(" __DATE__ " " __TIME__ ")"; +#else + return (GLubyte*)"AlexGL ES 2.0 on OpenGL(" __DATE__ " " __TIME__ ")"; +#endif + break; + case GL_VERSION: + sprintf(buf, "OpenGL ES 2.0 (on %s)", FNPTR(GetString)(GL_VERSION)); + return (GLubyte*)buf; + break; + case GL_SHADING_LANGUAGE_VERSION: + return (GLubyte*)FNPTR(GetString)(name); + break; + case GL_EXTENSIONS: + return (GLubyte*) +#if defined(PROVIDING_OES_blend_func_separate) + "GL_OES_blend_func_separate " +#endif +#if defined(PROVIDING_OES_blend_subtract) + "GL_OES_blend_subtract " +#endif +#if defined(PROVIDING_OES_fixed_point) + "GL_OES_fixed_point " +#endif +#if defined(PROVIDING_OES_single_precision) + "GL_OES_single_precision " +#endif +#if defined(PROVIDING_OES_stencil_wrap) + "GL_OES_stencil_wrap " +#endif +#if defined(PROVIDING_OES_texture_mirrored_repeat) + "GL_OES_texture_mirrored_repeat " +#endif +#if defined(PROVIDING_OES_element_index_uint) + "GL_OES_element_index_uint " +#endif +#if defined(PROVIDING_OES_texture_3D) + "GL_OES_texture_3D " +#endif +#if defined(PROVIDING_OES_texture_npot) + "GL_OES_texture_npot " +#endif +#if defined(PROVIDING_OES_rgb8_rgba8) + "GL_OES_rgb8_rgba8 " +#endif +#if defined(PROVIDING_OES_packed_depth_stencil) + "GL_OES_packed_depth_stencil " +#endif + ""; + break; + } +} + +void GL_APIENTRY ES2ENTRY(GetFloatv)(GLenum pname, GLfloat* params) { + switch (pname) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_ACTIVE_TEXTURE: + case GL_ALIASED_LINE_WIDTH_RANGE: + case GL_ALIASED_POINT_SIZE_RANGE: + case GL_ALPHA_BITS: + case GL_ARRAY_BUFFER_BINDING: + case GL_BLEND: + case GL_BLEND_COLOR: + case GL_BLEND_DST_ALPHA: + case GL_BLEND_DST_RGB: + case GL_BLEND_EQUATION_ALPHA: + case GL_BLEND_EQUATION_RGB: + case GL_BLEND_SRC_ALPHA: + case GL_BLEND_SRC_RGB: + case GL_BLUE_BITS: + case GL_COLOR_CLEAR_VALUE: + case GL_COLOR_WRITEMASK: + case GL_COMPRESSED_TEXTURE_FORMATS: + case GL_CULL_FACE: + case GL_CULL_FACE_MODE: + case GL_CURRENT_PROGRAM: + case GL_DEPTH_BITS: + case GL_DEPTH_CLEAR_VALUE: + case GL_DEPTH_FUNC: + case GL_DEPTH_RANGE: + case GL_DEPTH_TEST: + case GL_DEPTH_WRITEMASK: + case GL_DITHER: + case GL_ELEMENT_ARRAY_BUFFER_BINDING: + case GL_FRAMEBUFFER_BINDING: + case GL_FRONT_FACE: + case GL_GENERATE_MIPMAP_HINT: + case GL_GREEN_BITS: + case GL_LINE_WIDTH: + case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS: + case GL_MAX_CUBE_MAP_TEXTURE_SIZE: + case GL_MAX_RENDERBUFFER_SIZE: + case GL_MAX_TEXTURE_IMAGE_UNITS: + case GL_MAX_TEXTURE_SIZE: + case GL_MAX_VERTEX_ATTRIBS: + case GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS: + case GL_MAX_VIEWPORT_DIMS: + case GL_NUM_COMPRESSED_TEXTURE_FORMATS: + case GL_PACK_ALIGNMENT: + case GL_POLYGON_OFFSET_FACTOR: + case GL_POLYGON_OFFSET_FILL: + case GL_POLYGON_OFFSET_UNITS: + case GL_RED_BITS: + case GL_RENDERBUFFER_BINDING: + case GL_SAMPLE_BUFFERS: + case GL_SAMPLE_COVERAGE_INVERT: + case GL_SAMPLE_COVERAGE_VALUE: + case GL_SAMPLES: + case GL_SCISSOR_BOX: + case GL_SCISSOR_TEST: + case GL_STENCIL_BACK_FAIL: + case GL_STENCIL_BACK_FUNC: + case GL_STENCIL_BACK_PASS_DEPTH_FAIL: + case GL_STENCIL_BACK_PASS_DEPTH_PASS: + case GL_STENCIL_BACK_REF: + case GL_STENCIL_BACK_VALUE_MASK: + case GL_STENCIL_BACK_WRITEMASK: + case GL_STENCIL_BITS: + case GL_STENCIL_CLEAR_VALUE: + case GL_STENCIL_FAIL: + case GL_STENCIL_FUNC: + case GL_STENCIL_PASS_DEPTH_FAIL: + case GL_STENCIL_PASS_DEPTH_PASS: + case GL_STENCIL_REF: + case GL_STENCIL_TEST: + case GL_STENCIL_VALUE_MASK: + case GL_STENCIL_WRITEMASK: + case GL_SUBPIXEL_BITS: + case GL_TEXTURE_BINDING_2D: + case GL_TEXTURE_BINDING_CUBE_MAP: + case GL_UNPACK_ALIGNMENT: + case GL_VIEWPORT: +#if defined(PROVIDING_OES_texture_3D) + case GL_TEXTURE_BINDING_3D_OES: + case GL_MAX_3D_TEXTURE_SIZE_OES: +#endif + break; + case GL_MAX_FRAGMENT_UNIFORM_VECTORS: + FNPTR(GetFloatv)(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, params); + *params /= 4; + return; + case GL_MAX_VARYING_VECTORS: + FNPTR(GetFloatv)(GL_MAX_VARYING_FLOATS, params); + *params /= 4; + return; + case GL_MAX_VERTEX_UNIFORM_VECTORS: + FNPTR(GetFloatv)(GL_MAX_VERTEX_UNIFORM_COMPONENTS, params); + *params /= 4; + return; + case GL_IMPLEMENTATION_COLOR_READ_FORMAT: + *params = (GLfloat)GL_RGBA; + return; + case GL_IMPLEMENTATION_COLOR_READ_TYPE: + *params = (GLfloat)GL_UNSIGNED_BYTE; + return; + case GL_NUM_SHADER_BINARY_FORMATS: + *params = 0; + return; + case GL_SHADER_BINARY_FORMATS: + *params = 0; + return; + case GL_SHADER_COMPILER: + *params = (GLfloat)GL_TRUE; + return; + } + FNPTR(GetFloatv)(pname, params); +} + +void GL_APIENTRY ES2ENTRY(GetBooleanv)(GLenum pname, GLboolean* params) { + switch (pname) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_ACTIVE_TEXTURE: + case GL_ALIASED_LINE_WIDTH_RANGE: + case GL_ALIASED_POINT_SIZE_RANGE: + case GL_ALPHA_BITS: + case GL_ARRAY_BUFFER_BINDING: + case GL_BLEND: + case GL_BLEND_COLOR: + case GL_BLEND_DST_ALPHA: + case GL_BLEND_DST_RGB: + case GL_BLEND_EQUATION_ALPHA: + case GL_BLEND_EQUATION_RGB: + case GL_BLEND_SRC_ALPHA: + case GL_BLEND_SRC_RGB: + case GL_BLUE_BITS: + case GL_COLOR_CLEAR_VALUE: + case GL_COLOR_WRITEMASK: + case GL_COMPRESSED_TEXTURE_FORMATS: + case GL_CULL_FACE: + case GL_CULL_FACE_MODE: + case GL_CURRENT_PROGRAM: + case GL_DEPTH_BITS: + case GL_DEPTH_CLEAR_VALUE: + case GL_DEPTH_FUNC: + case GL_DEPTH_RANGE: + case GL_DEPTH_TEST: + case GL_DEPTH_WRITEMASK: + case GL_DITHER: + case GL_ELEMENT_ARRAY_BUFFER_BINDING: + case GL_FRAMEBUFFER_BINDING: + case GL_FRONT_FACE: + case GL_GENERATE_MIPMAP_HINT: + case GL_GREEN_BITS: + case GL_LINE_WIDTH: + case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS: + case GL_MAX_CUBE_MAP_TEXTURE_SIZE: + case GL_MAX_RENDERBUFFER_SIZE: + case GL_MAX_TEXTURE_IMAGE_UNITS: + case GL_MAX_TEXTURE_SIZE: + case GL_MAX_VERTEX_ATTRIBS: + case GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS: + case GL_MAX_VIEWPORT_DIMS: + case GL_NUM_COMPRESSED_TEXTURE_FORMATS: + case GL_PACK_ALIGNMENT: + case GL_POLYGON_OFFSET_FACTOR: + case GL_POLYGON_OFFSET_FILL: + case GL_POLYGON_OFFSET_UNITS: + case GL_RED_BITS: + case GL_RENDERBUFFER_BINDING: + case GL_SAMPLE_BUFFERS: + case GL_SAMPLE_COVERAGE_INVERT: + case GL_SAMPLE_COVERAGE_VALUE: + case GL_SAMPLES: + case GL_SCISSOR_BOX: + case GL_SCISSOR_TEST: + case GL_STENCIL_BACK_FAIL: + case GL_STENCIL_BACK_FUNC: + case GL_STENCIL_BACK_PASS_DEPTH_FAIL: + case GL_STENCIL_BACK_PASS_DEPTH_PASS: + case GL_STENCIL_BACK_REF: + case GL_STENCIL_BACK_VALUE_MASK: + case GL_STENCIL_BACK_WRITEMASK: + case GL_STENCIL_BITS: + case GL_STENCIL_CLEAR_VALUE: + case GL_STENCIL_FAIL: + case GL_STENCIL_FUNC: + case GL_STENCIL_PASS_DEPTH_FAIL: + case GL_STENCIL_PASS_DEPTH_PASS: + case GL_STENCIL_REF: + case GL_STENCIL_TEST: + case GL_STENCIL_VALUE_MASK: + case GL_STENCIL_WRITEMASK: + case GL_SUBPIXEL_BITS: + case GL_TEXTURE_BINDING_2D: + case GL_TEXTURE_BINDING_CUBE_MAP: + case GL_UNPACK_ALIGNMENT: + case GL_VIEWPORT: +#if defined(PROVIDING_OES_texture_3D) + case GL_TEXTURE_BINDING_3D_OES: + case GL_MAX_3D_TEXTURE_SIZE_OES: +#endif + break; + case GL_MAX_FRAGMENT_UNIFORM_VECTORS: + FNPTR(GetBooleanv)(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, params); + return; + case GL_MAX_VARYING_VECTORS: + FNPTR(GetBooleanv)(GL_MAX_VARYING_FLOATS, params); + return; + case GL_MAX_VERTEX_UNIFORM_VECTORS: + FNPTR(GetBooleanv)(GL_MAX_VERTEX_UNIFORM_COMPONENTS, params); + return; + case GL_IMPLEMENTATION_COLOR_READ_FORMAT: + *params = (GLboolean)GL_TRUE; + return; + case GL_IMPLEMENTATION_COLOR_READ_TYPE: + *params = (GLboolean)GL_TRUE; + return; + case GL_NUM_SHADER_BINARY_FORMATS: + *params = (GLboolean)0; + return; + case GL_SHADER_BINARY_FORMATS: + *params = (GLboolean)0; + return; + case GL_SHADER_COMPILER: + *params = (GLboolean)GL_TRUE; + return; + } + FNPTR(GetBooleanv)(pname, params); +} + +void GL_APIENTRY ES2ENTRY(GetIntegerv)(GLenum pname, GLint* params) { + switch (pname) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_ACTIVE_TEXTURE: + case GL_ALIASED_LINE_WIDTH_RANGE: + case GL_ALIASED_POINT_SIZE_RANGE: + case GL_ALPHA_BITS: + case GL_ARRAY_BUFFER_BINDING: + case GL_BLEND: + case GL_BLEND_COLOR: + case GL_BLEND_DST_ALPHA: + case GL_BLEND_DST_RGB: + case GL_BLEND_EQUATION_ALPHA: + case GL_BLEND_EQUATION_RGB: + case GL_BLEND_SRC_ALPHA: + case GL_BLEND_SRC_RGB: + case GL_BLUE_BITS: + case GL_COLOR_CLEAR_VALUE: + case GL_COLOR_WRITEMASK: + case GL_COMPRESSED_TEXTURE_FORMATS: + case GL_CULL_FACE: + case GL_CULL_FACE_MODE: + case GL_CURRENT_PROGRAM: + case GL_DEPTH_BITS: + case GL_DEPTH_CLEAR_VALUE: + case GL_DEPTH_FUNC: + case GL_DEPTH_RANGE: + case GL_DEPTH_TEST: + case GL_DEPTH_WRITEMASK: + case GL_DITHER: + case GL_ELEMENT_ARRAY_BUFFER_BINDING: + case GL_FRAMEBUFFER_BINDING: + case GL_FRONT_FACE: + case GL_GENERATE_MIPMAP_HINT: + case GL_GREEN_BITS: + case GL_LINE_WIDTH: + case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS: + case GL_MAX_CUBE_MAP_TEXTURE_SIZE: + case GL_MAX_RENDERBUFFER_SIZE: + case GL_MAX_TEXTURE_IMAGE_UNITS: + case GL_MAX_TEXTURE_SIZE: + case GL_MAX_VERTEX_ATTRIBS: + case GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS: + case GL_MAX_VIEWPORT_DIMS: + case GL_NUM_COMPRESSED_TEXTURE_FORMATS: + case GL_PACK_ALIGNMENT: + case GL_POLYGON_OFFSET_FACTOR: + case GL_POLYGON_OFFSET_FILL: + case GL_POLYGON_OFFSET_UNITS: + case GL_RED_BITS: + case GL_RENDERBUFFER_BINDING: + case GL_SAMPLE_BUFFERS: + case GL_SAMPLE_COVERAGE_INVERT: + case GL_SAMPLE_COVERAGE_VALUE: + case GL_SAMPLES: + case GL_SCISSOR_BOX: + case GL_SCISSOR_TEST: + case GL_STENCIL_BACK_FAIL: + case GL_STENCIL_BACK_FUNC: + case GL_STENCIL_BACK_PASS_DEPTH_FAIL: + case GL_STENCIL_BACK_PASS_DEPTH_PASS: + case GL_STENCIL_BACK_REF: + case GL_STENCIL_BACK_VALUE_MASK: + case GL_STENCIL_BACK_WRITEMASK: + case GL_STENCIL_BITS: + case GL_STENCIL_CLEAR_VALUE: + case GL_STENCIL_FAIL: + case GL_STENCIL_FUNC: + case GL_STENCIL_PASS_DEPTH_FAIL: + case GL_STENCIL_PASS_DEPTH_PASS: + case GL_STENCIL_REF: + case GL_STENCIL_TEST: + case GL_STENCIL_VALUE_MASK: + case GL_STENCIL_WRITEMASK: + case GL_SUBPIXEL_BITS: + case GL_TEXTURE_BINDING_2D: + case GL_TEXTURE_BINDING_CUBE_MAP: + case GL_UNPACK_ALIGNMENT: + case GL_VIEWPORT: +#if defined(PROVIDING_OES_texture_3D) + case GL_TEXTURE_BINDING_3D_OES: + case GL_MAX_3D_TEXTURE_SIZE_OES: +#endif + break; + case GL_MAX_FRAGMENT_UNIFORM_VECTORS: + FNPTR(GetIntegerv)(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, params); + *params /= 4; + return; + case GL_MAX_VARYING_VECTORS: + FNPTR(GetIntegerv)(GL_MAX_VARYING_FLOATS, params); + *params /= 4; + return; + case GL_MAX_VERTEX_UNIFORM_VECTORS: + FNPTR(GetIntegerv)(GL_MAX_VERTEX_UNIFORM_COMPONENTS, params); + *params /= 4; + return; + case GL_IMPLEMENTATION_COLOR_READ_FORMAT: + *params = GL_RGBA; + return; + case GL_IMPLEMENTATION_COLOR_READ_TYPE: + *params = GL_UNSIGNED_BYTE; + return; + case GL_NUM_SHADER_BINARY_FORMATS: + *params = 0; + return; + case GL_SHADER_BINARY_FORMATS: + *params = 0; + return; + case GL_SHADER_COMPILER: + *params = (GLint)GL_TRUE; + return; + } + FNPTR(GetIntegerv)(pname, params); +} diff --git a/es_2_0/Link.c b/es_2_0/Link.c new file mode 100755 index 0000000..e77b376 --- /dev/null +++ b/es_2_0/Link.c @@ -0,0 +1,163 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "es2front.h" + + +void GL_APIENTRY ES2ENTRY(GetActiveUniform)(GLuint program, + GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name) { + GLint nActiveUniforms; + if ((GLint)(program) <= 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } else if (FNPTR(IsProgram)(program) == GL_FALSE) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + FNPTR(GetProgramiv)(program, GL_ACTIVE_UNIFORMS, &nActiveUniforms); + if (index >= nActiveUniforms) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + if (bufsize < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + FNPTR(GetActiveUniform)(program, index, bufsize, length, size, type, name); + assert(*type == GL_FLOAT + || *type == GL_FLOAT_VEC2 + || *type == GL_FLOAT_VEC3 + || *type == GL_FLOAT_VEC4 + || *type == GL_INT + || *type == GL_INT_VEC2 + || *type == GL_INT_VEC3 + || *type == GL_INT_VEC4 + || *type == GL_BOOL + || *type == GL_BOOL_VEC2 + || *type == GL_BOOL_VEC3 + || *type == GL_BOOL_VEC4 + || *type == GL_FLOAT_MAT2 + || *type == GL_FLOAT_MAT3 + || *type == GL_FLOAT_MAT4 + || *type == GL_SAMPLER_2D + || *type == GL_SAMPLER_CUBE); +} + +GLint GL_APIENTRY ES2ENTRY(GetUniformLocation)(GLuint program, const char* name) { + GLint iAnswer; + GLint iLinkStatus; + if ((GLint)(program) <= 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return -1; + } else if (FNPTR(IsProgram)(program) == GL_FALSE) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return -1; + } + FNPTR(GetProgramiv)(program, GL_LINK_STATUS, &iLinkStatus); + if (iLinkStatus == GL_FALSE) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return -1; + } + iAnswer = FNPTR(GetUniformLocation)(program, name); + return iAnswer; +} + +void GL_APIENTRY ES2ENTRY(GetActiveAttrib)(GLuint program, + GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name) { + GLint nActiveAttribs; + if ((GLint)(program) <= 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } else if (FNPTR(IsProgram)(program) == GL_FALSE) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } +/* + FNPTR(GetProgramiv)(program, GL_ACTIVE_ATTRIBUTES, &nActiveAttribs); + if (index >= nActiveAttribs) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } +*/ + if (bufsize < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + FNPTR(GetActiveAttrib)(program, index, bufsize, length, size, type, name); +/* + assert(*type == GL_FLOAT + || *type == GL_FLOAT_VEC2 + || *type == GL_FLOAT_VEC3 + || *type == GL_FLOAT_VEC4 + || *type == GL_FLOAT_MAT2 + || *type == GL_FLOAT_MAT3 + || *type == GL_FLOAT_MAT4); +*/ +} + +int GL_APIENTRY ES2ENTRY(GetAttribLocation)(GLuint program, const char* name) { + GLint iAnswer; + GLint iLinkStatus; + if ((GLint)(program) <= 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return -1; + } else if (FNPTR(IsProgram)(program) == GL_FALSE) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return -1; + } + FNPTR(GetProgramiv)(program, GL_LINK_STATUS, &iLinkStatus); + if (iLinkStatus == GL_FALSE) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return -1; + } + iAnswer = FNPTR(GetAttribLocation)(program, name); + return iAnswer; +} + +void GL_APIENTRY ES2ENTRY(BindAttribLocation)(GLuint program, GLuint index, const char* name) { + if ((GLint)(program) <= 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } else if (FNPTR(IsProgram)(program) == GL_FALSE) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + if (CCV(nMaxVertexAttribs) <= index) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + + } + if (name[0] == 'g' && name[1] == 'l' && name[2] == '_') { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + FNPTR(BindAttribLocation)(program, index, name); +} diff --git a/es_2_0/ParseLex.inl b/es_2_0/ParseLex.inl new file mode 100755 index 0000000..9099b91 --- /dev/null +++ b/es_2_0/ParseLex.inl @@ -0,0 +1,2453 @@ + +#line 3 "ParseLex.inl" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define yy_create_buffer hazelParse_create_buffer +#define yy_delete_buffer hazelParse_delete_buffer +#define yy_flex_debug hazelParse_flex_debug +#define yy_init_buffer hazelParse_init_buffer +#define yy_flush_buffer hazelParse_flush_buffer +#define yy_load_buffer_state hazelParse_load_buffer_state +#define yy_switch_to_buffer hazelParse_switch_to_buffer +#define yyin hazelParsein +#define yyleng hazelParseleng +#define yylex hazelParselex +#define yylineno hazelParselineno +#define yyout hazelParseout +#define yyrestart hazelParserestart +#define yytext hazelParsetext +#define yywrap hazelParsewrap +#define yyalloc hazelParsealloc +#define yyrealloc hazelParserealloc +#define yyfree hazelParsefree + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 5 +#define YY_FLEX_SUBMINOR_VERSION 35 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +#include <stdio.h> +#include <string.h> +#include <errno.h> +#include <stdlib.h> + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +#include <inttypes.h> +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; +#endif /* ! C99 */ + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#endif /* ! FLEXINT_H */ + +#ifdef __cplusplus + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +/* C99 requires __STDC__ to be defined as 1. */ +#if defined (__STDC__) + +#define YY_USE_CONST + +#endif /* defined (__STDC__) */ +#endif /* ! __cplusplus */ + +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst +#endif + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an unsigned + * integer for use as an array index. If the signed char is negative, + * we want to instead treat it as an 8-bit unsigned char, hence the + * double cast. + */ +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN (yy_start) = 1 + 2 * + +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START (((yy_start) - 1) / 2) +#define YYSTATE YY_START + +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) + +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE hazelParserestart(hazelParsein ) + +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#define YY_BUF_SIZE 16384 +#endif + +/* The state buf must be large enough to hold one state per character in the main buffer. + */ +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +extern int hazelParseleng; + +extern FILE *hazelParsein, *hazelParseout; + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + + #define YY_LESS_LINENO(n) + +/* Return all but the first "n" matched characters back to the input stream. */ +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up hazelParsetext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = (yy_hold_char); \ + YY_RESTORE_YY_MORE_OFFSET \ + (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up hazelParsetext again */ \ + } \ + while ( 0 ) + +#define unput(c) yyunput( c, (yytext_ptr) ) + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via hazelParserestart()), so that the user can continue scanning by + * just pointing hazelParsein at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +/* Stack of input buffers. */ +static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ +static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ +static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + * + * Returns the top of the stack, or NULL. + */ +#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ + ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ + : NULL) + +/* Same as previous macro, but useful when we know that the buffer stack is not + * NULL or when we need an lvalue. For internal use only. + */ +#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] + +/* yy_hold_char holds the character lost when hazelParsetext is formed. */ +static char yy_hold_char; +static int yy_n_chars; /* number of characters read into yy_ch_buf */ +int hazelParseleng; + +/* Points to current character in buffer. */ +static char *yy_c_buf_p = (char *) 0; +static int yy_init = 0; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ + +/* Flag which is used to allow hazelParsewrap()'s to do buffer switches + * instead of setting up a fresh hazelParsein. A bit of a hack ... + */ +static int yy_did_buffer_switch_on_eof; + +void hazelParserestart (FILE *input_file ); +void hazelParse_switch_to_buffer (YY_BUFFER_STATE new_buffer ); +YY_BUFFER_STATE hazelParse_create_buffer (FILE *file,int size ); +void hazelParse_delete_buffer (YY_BUFFER_STATE b ); +void hazelParse_flush_buffer (YY_BUFFER_STATE b ); +void hazelParsepush_buffer_state (YY_BUFFER_STATE new_buffer ); +void hazelParsepop_buffer_state (void ); + +static void hazelParseensure_buffer_stack (void ); +static void hazelParse_load_buffer_state (void ); +static void hazelParse_init_buffer (YY_BUFFER_STATE b,FILE *file ); + +#define YY_FLUSH_BUFFER hazelParse_flush_buffer(YY_CURRENT_BUFFER ) + +YY_BUFFER_STATE hazelParse_scan_buffer (char *base,yy_size_t size ); +YY_BUFFER_STATE hazelParse_scan_string (yyconst char *yy_str ); +YY_BUFFER_STATE hazelParse_scan_bytes (yyconst char *bytes,int len ); + +void *hazelParsealloc (yy_size_t ); +void *hazelParserealloc (void *,yy_size_t ); +void hazelParsefree (void * ); + +#define yy_new_buffer hazelParse_create_buffer + +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ + hazelParseensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + hazelParse_create_buffer(hazelParsein,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } + +#define yy_set_bol(at_bol) \ + { \ + if ( ! YY_CURRENT_BUFFER ){\ + hazelParseensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + hazelParse_create_buffer(hazelParsein,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } + +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) + +typedef unsigned char YY_CHAR; + +FILE *hazelParsein = (FILE *) 0, *hazelParseout = (FILE *) 0; + +typedef int yy_state_type; + +extern int hazelParselineno; + +int hazelParselineno = 1; + +extern char *hazelParsetext; +#define yytext_ptr hazelParsetext + +static yy_state_type yy_get_previous_state (void ); +static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); +static int yy_get_next_buffer (void ); +static void yy_fatal_error (yyconst char msg[] ); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up hazelParsetext. + */ +#define YY_DO_BEFORE_ACTION \ + (yytext_ptr) = yy_bp; \ + hazelParseleng = (size_t) (yy_cp - yy_bp); \ + (yy_hold_char) = *yy_cp; \ + *yy_cp = '\0'; \ + (yy_c_buf_p) = yy_cp; + +#define YY_NUM_RULES 133 +#define YY_END_OF_BUFFER 134 +/* This struct is not used in this scanner, + but its presence is necessary. */ +struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static yyconst flex_int16_t yy_accept[428] = + { 0, + 0, 0, 134, 132, 127, 128, 126, 132, 122, 123, + 132, 132, 132, 132, 132, 94, 93, 93, 129, 132, + 132, 132, 92, 124, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 130, 125, 131, 121, 113, 111, + 102, 101, 112, 107, 100, 103, 118, 98, 104, 97, + 94, 0, 0, 0, 93, 93, 109, 110, 105, 106, + 117, 92, 119, 120, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 81, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 84, 73, + + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 114, 115, 0, + 96, 0, 0, 99, 95, 108, 116, 1, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 82, 92, 92, 92, + 92, 92, 92, 92, 92, 52, 92, 92, 92, 92, + 92, 92, 92, 92, 74, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 0, 98, + + 0, 0, 97, 92, 51, 92, 92, 46, 92, 92, + 92, 92, 92, 92, 92, 85, 4, 92, 92, 92, + 20, 92, 92, 9, 24, 92, 92, 92, 92, 92, + 92, 92, 92, 21, 76, 63, 64, 65, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 7, 90, 92, 92, 92, 92, + 92, 92, 54, 55, 56, 50, 92, 92, 0, 96, + 92, 79, 57, 58, 59, 2, 70, 92, 92, 92, + 92, 33, 34, 35, 92, 91, 25, 53, 36, 37, + 38, 78, 30, 31, 32, 92, 75, 28, 92, 92, + + 60, 61, 62, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 22, 92, 92, 92, 92, 92, 92, 92, + 92, 3, 92, 48, 92, 92, 83, 92, 92, 92, + 92, 23, 17, 12, 92, 92, 92, 92, 92, 29, + 8, 92, 15, 88, 92, 45, 16, 89, 27, 10, + 92, 92, 92, 92, 92, 92, 92, 92, 11, 87, + 92, 92, 92, 77, 92, 92, 92, 92, 92, 5, + 71, 92, 72, 92, 92, 80, 18, 92, 92, 92, + 13, 92, 92, 92, 92, 92, 6, 26, 14, 69, + 19, 68, 47, 86, 39, 66, 49, 92, 92, 92, + + 92, 92, 92, 92, 92, 92, 92, 67, 92, 92, + 92, 92, 92, 42, 92, 43, 92, 92, 92, 40, + 92, 41, 92, 92, 92, 44, 0 + } ; + +static yyconst flex_int32_t yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 4, 5, 1, 1, 1, 6, 7, 1, 1, + 1, 8, 9, 1, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 18, 18, 19, 19, 1, 20, 21, + 22, 23, 1, 1, 24, 24, 25, 26, 27, 24, + 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, + 28, 29, 30, 28, 28, 28, 28, 31, 28, 28, + 1, 1, 1, 32, 28, 1, 33, 34, 35, 36, + + 37, 38, 39, 40, 41, 28, 42, 43, 44, 45, + 46, 47, 28, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; + +static yyconst flex_int32_t yy_meta[61] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, + 3, 1, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 1, 1, 5, 5, 5, 6, 7, 7, 7, + 7, 1, 5, 5, 5, 5, 6, 5, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 1, 1, 1, 1 + } ; + +static yyconst flex_int16_t yy_base[439] = + { 0, + 0, 0, 553, 554, 554, 554, 554, 530, 529, 54, + 528, 53, 55, 53, 527, 67, 68, 62, 554, 42, + 526, 68, 0, 70, 47, 55, 67, 71, 66, 73, + 501, 85, 77, 500, 91, 94, 494, 97, 507, 101, + 95, 104, 122, 503, 554, 109, 554, 554, 554, 554, + 554, 554, 554, 554, 554, 554, 554, 109, 554, 120, + 102, 133, 129, 0, 147, 150, 520, 554, 554, 554, + 519, 0, 554, 554, 496, 489, 492, 500, 499, 486, + 501, 488, 494, 482, 479, 492, 479, 476, 476, 482, + 470, 129, 475, 485, 471, 477, 480, 481, 0, 126, + + 480, 118, 466, 479, 470, 472, 462, 476, 473, 475, + 458, 463, 460, 449, 131, 457, 462, 458, 460, 449, + 452, 139, 457, 449, 461, 140, 454, 554, 554, 176, + 155, 180, 180, 187, 0, 554, 554, 0, 446, 450, + 459, 456, 440, 440, 158, 455, 452, 452, 450, 447, + 439, 445, 432, 443, 429, 445, 0, 442, 430, 437, + 434, 438, 431, 420, 419, 432, 435, 432, 427, 418, + 194, 423, 426, 417, 414, 418, 424, 415, 406, 409, + 407, 417, 403, 401, 414, 400, 402, 399, 410, 409, + 174, 404, 399, 388, 198, 406, 408, 397, 208, 215, + + 207, 222, 229, 398, 0, 396, 234, 0, 388, 386, + 394, 383, 400, 389, 237, 0, 0, 383, 393, 393, + 0, 378, 240, 0, 0, 380, 243, 381, 375, 374, + 375, 374, 246, 0, 0, 0, 0, 0, 370, 371, + 376, 367, 380, 375, 374, 366, 370, 362, 365, 369, + 374, 360, 372, 363, 0, 0, 369, 358, 358, 363, + 362, 359, 0, 0, 0, 0, 349, 361, 251, 258, + 363, 0, 0, 0, 0, 0, 0, 351, 352, 346, + 356, 0, 0, 0, 347, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 354, 0, 0, 352, 348, + + 0, 0, 0, 344, 340, 345, 335, 348, 334, 347, + 336, 343, 0, 341, 343, 327, 329, 335, 341, 336, + 324, 0, 326, 0, 325, 328, 0, 317, 316, 316, + 329, 0, 331, 0, 330, 329, 314, 327, 314, 0, + 0, 317, 0, 0, 309, 0, 0, 0, 0, 0, + 306, 317, 310, 316, 313, 308, 300, 312, 0, 0, + 305, 312, 301, 0, 310, 307, 297, 264, 305, 0, + 0, 305, 0, 303, 302, 0, 0, 301, 287, 299, + 0, 290, 308, 307, 306, 280, 0, 0, 0, 0, + 0, 0, 0, 0, 300, 189, 300, 294, 287, 288, + + 282, 282, 276, 277, 271, 270, 261, 0, 256, 238, + 251, 236, 239, 254, 237, 0, 229, 241, 138, 0, + 132, 0, 57, 42, 21, 0, 554, 287, 291, 294, + 298, 301, 305, 310, 311, 316, 319, 322 + } ; + +static yyconst flex_int16_t yy_def[439] = + { 0, + 427, 1, 427, 427, 427, 427, 427, 427, 427, 427, + 427, 427, 427, 427, 427, 427, 428, 429, 427, 427, + 427, 427, 430, 427, 430, 430, 430, 430, 430, 430, + 430, 430, 430, 430, 430, 430, 430, 430, 430, 430, + 430, 430, 430, 430, 427, 427, 427, 427, 427, 427, + 427, 427, 427, 427, 427, 427, 427, 431, 427, 432, + 16, 433, 434, 435, 428, 429, 427, 427, 427, 427, + 427, 430, 427, 427, 430, 430, 430, 430, 430, 430, + 430, 430, 430, 430, 430, 430, 430, 430, 430, 430, + 430, 430, 430, 430, 430, 430, 430, 430, 430, 430, + + 430, 430, 430, 430, 430, 430, 430, 430, 430, 430, + 430, 430, 430, 430, 430, 430, 430, 430, 430, 430, + 430, 430, 430, 430, 430, 430, 430, 427, 427, 436, + 432, 437, 427, 427, 435, 427, 427, 430, 430, 430, + 430, 430, 430, 430, 430, 430, 430, 430, 430, 430, + 430, 430, 430, 430, 430, 430, 430, 430, 430, 430, + 430, 430, 430, 430, 430, 430, 430, 430, 430, 430, + 430, 430, 430, 430, 430, 430, 430, 430, 430, 430, + 430, 430, 430, 430, 430, 430, 430, 430, 430, 430, + 430, 430, 430, 430, 430, 430, 430, 430, 427, 427, + + 438, 427, 427, 430, 430, 430, 430, 430, 430, 430, + 430, 430, 430, 430, 430, 430, 430, 430, 430, 430, + 430, 430, 430, 430, 430, 430, 430, 430, 430, 430, + 430, 430, 430, 430, 430, 430, 430, 430, 430, 430, + 430, 430, 430, 430, 430, 430, 430, 430, 430, 430, + 430, 430, 430, 430, 430, 430, 430, 430, 430, 430, + 430, 430, 430, 430, 430, 430, 430, 430, 427, 427, + 430, 430, 430, 430, 430, 430, 430, 430, 430, 430, + 430, 430, 430, 430, 430, 430, 430, 430, 430, 430, + 430, 430, 430, 430, 430, 430, 430, 430, 430, 430, + + 430, 430, 430, 430, 430, 430, 430, 430, 430, 430, + 430, 430, 430, 430, 430, 430, 430, 430, 430, 430, + 430, 430, 430, 430, 430, 430, 430, 430, 430, 430, + 430, 430, 430, 430, 430, 430, 430, 430, 430, 430, + 430, 430, 430, 430, 430, 430, 430, 430, 430, 430, + 430, 430, 430, 430, 430, 430, 430, 430, 430, 430, + 430, 430, 430, 430, 430, 430, 430, 430, 430, 430, + 430, 430, 430, 430, 430, 430, 430, 430, 430, 430, + 430, 430, 430, 430, 430, 430, 430, 430, 430, 430, + 430, 430, 430, 430, 430, 430, 430, 430, 430, 430, + + 430, 430, 430, 430, 430, 430, 430, 430, 430, 430, + 430, 430, 430, 430, 430, 430, 430, 430, 430, 430, + 430, 430, 430, 430, 430, 430, 0, 427, 427, 427, + 427, 427, 427, 427, 427, 427, 427, 427 + } ; + +static yyconst flex_int16_t yy_nxt[615] = + { 0, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 17, 17, 17, 17, 18, 19, + 20, 21, 22, 23, 23, 23, 23, 23, 23, 23, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 23, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 23, 23, 23, 45, 46, 47, 48, + 51, 54, 67, 68, 56, 58, 58, 58, 58, 58, + 58, 58, 60, 426, 55, 52, 57, 60, 60, 61, + 61, 61, 61, 61, 61, 62, 66, 425, 63, 70, + 71, 73, 424, 63, 63, 75, 76, 64, 63, 80, + + 77, 74, 78, 63, 63, 90, 79, 83, 87, 81, + 88, 84, 82, 91, 99, 92, 85, 96, 93, 89, + 64, 100, 86, 103, 94, 97, 105, 104, 101, 108, + 128, 118, 427, 112, 119, 130, 98, 133, 133, 106, + 113, 114, 120, 60, 109, 130, 132, 110, 122, 121, + 115, 116, 123, 117, 124, 427, 132, 60, 125, 63, + 60, 155, 169, 183, 423, 66, 129, 126, 163, 63, + 170, 164, 165, 63, 156, 166, 63, 167, 184, 191, + 196, 201, 197, 63, 199, 199, 63, 192, 202, 202, + 422, 201, 134, 134, 134, 134, 134, 134, 134, 134, + + 134, 134, 134, 134, 134, 134, 210, 211, 236, 237, + 238, 258, 263, 264, 265, 269, 269, 400, 401, 259, + 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, + 200, 200, 200, 200, 203, 203, 203, 203, 203, 203, + 203, 203, 203, 203, 203, 203, 203, 203, 273, 274, + 275, 282, 283, 284, 289, 290, 291, 293, 294, 295, + 301, 302, 303, 270, 270, 270, 270, 270, 270, 270, + 270, 270, 270, 270, 270, 270, 270, 383, 384, 385, + 421, 420, 419, 418, 417, 416, 415, 414, 386, 65, + 65, 413, 65, 66, 66, 412, 66, 72, 72, 72, + + 72, 58, 411, 58, 131, 410, 131, 62, 62, 409, + 62, 134, 408, 134, 135, 135, 135, 200, 407, 200, + 203, 406, 203, 270, 405, 270, 404, 403, 402, 399, + 398, 397, 396, 395, 394, 393, 392, 391, 390, 389, + 388, 387, 382, 381, 380, 379, 378, 377, 376, 375, + 374, 373, 372, 371, 370, 369, 368, 367, 366, 365, + 364, 363, 362, 361, 360, 359, 358, 357, 356, 355, + 354, 353, 352, 351, 350, 349, 348, 347, 346, 345, + 344, 343, 342, 341, 340, 339, 338, 337, 336, 335, + 334, 333, 332, 331, 330, 329, 328, 327, 326, 325, + + 324, 323, 322, 321, 320, 319, 318, 317, 316, 315, + 314, 313, 312, 311, 310, 309, 308, 307, 306, 305, + 304, 300, 299, 298, 297, 296, 292, 288, 287, 286, + 285, 281, 280, 279, 278, 277, 276, 272, 271, 268, + 267, 266, 262, 261, 260, 257, 256, 255, 254, 253, + 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, + 242, 241, 240, 239, 235, 234, 233, 232, 231, 230, + 229, 228, 227, 226, 225, 224, 223, 222, 221, 220, + 219, 218, 217, 216, 215, 214, 213, 212, 209, 208, + 207, 206, 205, 204, 198, 195, 194, 193, 190, 189, + + 188, 187, 186, 185, 182, 181, 180, 179, 178, 177, + 176, 175, 174, 173, 172, 171, 168, 162, 161, 160, + 159, 158, 157, 154, 153, 152, 151, 150, 149, 148, + 147, 146, 145, 144, 143, 142, 141, 140, 139, 138, + 137, 136, 127, 111, 107, 102, 95, 69, 59, 53, + 50, 49, 427, 3, 427, 427, 427, 427, 427, 427, + 427, 427, 427, 427, 427, 427, 427, 427, 427, 427, + 427, 427, 427, 427, 427, 427, 427, 427, 427, 427, + 427, 427, 427, 427, 427, 427, 427, 427, 427, 427, + 427, 427, 427, 427, 427, 427, 427, 427, 427, 427, + + 427, 427, 427, 427, 427, 427, 427, 427, 427, 427, + 427, 427, 427, 427 + } ; + +static yyconst flex_int16_t yy_chk[615] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 10, 12, 20, 20, 13, 14, 14, 14, 14, 14, + 14, 14, 18, 425, 12, 10, 13, 16, 17, 16, + 16, 16, 16, 16, 16, 16, 17, 424, 18, 22, + 22, 24, 423, 16, 17, 25, 25, 16, 18, 27, + + 26, 24, 26, 16, 17, 30, 26, 28, 29, 27, + 29, 28, 27, 30, 33, 30, 28, 32, 30, 29, + 16, 33, 28, 35, 30, 32, 36, 35, 33, 38, + 46, 41, 61, 40, 41, 58, 32, 63, 63, 36, + 40, 40, 41, 62, 38, 58, 60, 38, 42, 41, + 40, 40, 42, 40, 43, 61, 60, 65, 43, 62, + 66, 92, 102, 115, 421, 65, 46, 43, 100, 62, + 102, 100, 100, 65, 92, 100, 66, 100, 115, 122, + 126, 131, 126, 65, 130, 130, 66, 122, 132, 132, + 419, 131, 133, 133, 133, 133, 133, 133, 133, 134, + + 134, 134, 134, 134, 134, 134, 145, 145, 171, 171, + 171, 191, 195, 195, 195, 201, 201, 396, 396, 191, + 199, 199, 199, 199, 199, 199, 199, 200, 200, 200, + 200, 200, 200, 200, 202, 202, 202, 202, 202, 202, + 202, 203, 203, 203, 203, 203, 203, 203, 207, 207, + 207, 215, 215, 215, 223, 223, 223, 227, 227, 227, + 233, 233, 233, 269, 269, 269, 269, 269, 269, 269, + 270, 270, 270, 270, 270, 270, 270, 368, 368, 368, + 418, 417, 415, 414, 413, 412, 411, 410, 368, 428, + 428, 409, 428, 429, 429, 407, 429, 430, 430, 430, + + 430, 431, 406, 431, 432, 405, 432, 433, 433, 404, + 433, 434, 403, 434, 435, 435, 435, 436, 402, 436, + 437, 401, 437, 438, 400, 438, 399, 398, 397, 395, + 386, 385, 384, 383, 382, 380, 379, 378, 375, 374, + 372, 369, 367, 366, 365, 363, 362, 361, 358, 357, + 356, 355, 354, 353, 352, 351, 345, 342, 339, 338, + 337, 336, 335, 333, 331, 330, 329, 328, 326, 325, + 323, 321, 320, 319, 318, 317, 316, 315, 314, 312, + 311, 310, 309, 308, 307, 306, 305, 304, 300, 299, + 296, 285, 281, 280, 279, 278, 271, 268, 267, 262, + + 261, 260, 259, 258, 257, 254, 253, 252, 251, 250, + 249, 248, 247, 246, 245, 244, 243, 242, 241, 240, + 239, 232, 231, 230, 229, 228, 226, 222, 220, 219, + 218, 214, 213, 212, 211, 210, 209, 206, 204, 198, + 197, 196, 194, 193, 192, 190, 189, 188, 187, 186, + 185, 184, 183, 182, 181, 180, 179, 178, 177, 176, + 175, 174, 173, 172, 170, 169, 168, 167, 166, 165, + 164, 163, 162, 161, 160, 159, 158, 156, 155, 154, + 153, 152, 151, 150, 149, 148, 147, 146, 144, 143, + 142, 141, 140, 139, 127, 125, 124, 123, 121, 120, + + 119, 118, 117, 116, 114, 113, 112, 111, 110, 109, + 108, 107, 106, 105, 104, 103, 101, 98, 97, 96, + 95, 94, 93, 91, 90, 89, 88, 87, 86, 85, + 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, + 71, 67, 44, 39, 37, 34, 31, 21, 15, 11, + 9, 8, 3, 427, 427, 427, 427, 427, 427, 427, + 427, 427, 427, 427, 427, 427, 427, 427, 427, 427, + 427, 427, 427, 427, 427, 427, 427, 427, 427, 427, + 427, 427, 427, 427, 427, 427, 427, 427, 427, 427, + 427, 427, 427, 427, 427, 427, 427, 427, 427, 427, + + 427, 427, 427, 427, 427, 427, 427, 427, 427, 427, + 427, 427, 427, 427 + } ; + +static yy_state_type yy_last_accepting_state; +static char *yy_last_accepting_cpos; + +extern int hazelParse_flex_debug; +int hazelParse_flex_debug = 0; + +/* The intent behind this definition is that it'll catch + * any uses of REJECT which flex missed. + */ +#define REJECT reject_used_but_not_detected +#define yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +char *hazelParsetext; + +/* The generated ParseLex.c file must be included at the end of ParseYacc.c */ + +extern int hazelEnableTexture3D; + +extern int iLine; + +static int hazelParsewrap(void) { + return 1; +} + +/* +Gets input and stuffs it into "buf". +number of characters read, or YY_NULL, is returned in "result". +*/ +#undef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + { \ + if (*pSrcPtr == '\0') { \ + result = YY_NULL; \ + } else { \ + result = strlen(pSrcPtr); \ + strcpy(buf, pSrcPtr); \ + pSrcPtr += result; \ + } \ + } + +#define SET_TOKEN(_str_) \ + do { \ + memset(&(yylval), 0, sizeof(yylval)); \ + yylval.token.name = malloc(strlen(_str_) + 1); \ + strcpy(yylval.token.name, _str_); \ + } while (0) + +#define INITIAL 0 + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +static int yy_init_globals (void ); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int hazelParselex_destroy (void ); + +int hazelParseget_debug (void ); + +void hazelParseset_debug (int debug_flag ); + +YY_EXTRA_TYPE hazelParseget_extra (void ); + +void hazelParseset_extra (YY_EXTRA_TYPE user_defined ); + +FILE *hazelParseget_in (void ); + +void hazelParseset_in (FILE * in_str ); + +FILE *hazelParseget_out (void ); + +void hazelParseset_out (FILE * out_str ); + +int hazelParseget_leng (void ); + +char *hazelParseget_text (void ); + +int hazelParseget_lineno (void ); + +void hazelParseset_lineno (int line_number ); + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int hazelParsewrap (void ); +#else +extern int hazelParsewrap (void ); +#endif +#endif + + static void yyunput (int c,char *buf_ptr ); + +#ifndef yytext_ptr +static void yy_flex_strncpy (char *,yyconst char *,int ); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (yyconst char * ); +#endif + +#ifndef YY_NO_INPUT + +#ifdef __cplusplus +static int yyinput (void ); +#else +static int input (void ); +#endif + +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#define YY_READ_BUF_SIZE 8192 +#endif + +/* Copy whatever the last rule matched to the standard output. */ +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO fwrite( hazelParsetext, hazelParseleng, 1, hazelParseout ) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ + { \ + int c = '*'; \ + unsigned n; \ + for ( n = 0; n < max_size && \ + (c = getc( hazelParsein )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( hazelParsein ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else \ + { \ + errno=0; \ + while ( (result = fread(buf, 1, max_size, hazelParsein))==0 && ferror(hazelParsein)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(hazelParsein); \ + } \ + }\ +\ + +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) +#endif + +/* end tables serialization structures and prototypes */ + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 + +extern int hazelParselex (void); + +#define YY_DECL int hazelParselex (void) +#endif /* !YY_DECL */ + +/* Code executed at the beginning of each rule, after hazelParsetext and hazelParseleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK break; +#endif + +#define YY_RULE_SETUP \ + YY_USER_ACTION + +/** The main scanner function which does all the work. + */ +YY_DECL +{ + register yy_state_type yy_current_state; + register char *yy_cp, *yy_bp; + register int yy_act; + + /* 3.7 reserved */ + + if ( !(yy_init) ) + { + (yy_init) = 1; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! (yy_start) ) + (yy_start) = 1; /* first start state */ + + if ( ! hazelParsein ) + hazelParsein = stdin; + + if ( ! hazelParseout ) + hazelParseout = stdout; + + if ( ! YY_CURRENT_BUFFER ) { + hazelParseensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + hazelParse_create_buffer(hazelParsein,YY_BUF_SIZE ); + } + + hazelParse_load_buffer_state( ); + } + + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = (yy_c_buf_p); + + /* Support of hazelParsetext. */ + *yy_cp = (yy_hold_char); + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = (yy_start); +yy_match: + do + { + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 428 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + ++yy_cp; + } + while ( yy_base[yy_current_state] != 554 ); + +yy_find_action: + yy_act = yy_accept[yy_current_state]; + if ( yy_act == 0 ) + { /* have to back up */ + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + yy_act = yy_accept[yy_current_state]; + } + + YY_DO_BEFORE_ACTION; + +do_action: /* This label is used only to access EOF actions. */ + + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = (yy_hold_char); + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + goto yy_find_action; + +case 1: +case 2: +case 3: +case 4: +case 5: +case 6: +case 7: +case 8: +case 9: +case 10: +case 11: +case 12: +case 13: +case 14: +case 15: +case 16: +case 17: +case 18: +case 19: +case 20: +case 21: +case 22: +case 23: +case 24: +case 25: +case 26: +case 27: +case 28: +case 29: +case 30: +case 31: +case 32: +case 33: +case 34: +case 35: +case 36: +case 37: +case 38: +case 39: +case 40: +case 41: +case 42: +case 43: +case 44: +case 45: +case 46: +case 47: +case 48: +YY_RULE_SETUP +{ + FOUND_RESERVED(hazelParsetext); + SET_TOKEN(hazelParsetext); + return '$'; +} + YY_BREAK +case 49: +YY_RULE_SETUP +{ + if (hazelEnableTexture3D == GL_TRUE) { + SET_TOKEN(hazelParsetext); yylval.token.type = T_SAMPLER3D; return SAMPLER3D; + } else { + FOUND_RESERVED(hazelParsetext); + SET_TOKEN(hazelParsetext); + return '$'; + } +} + YY_BREAK +/* 4.1 basic types */ +case 50: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); yylval.token.type = T_VOID; return VOID; } + YY_BREAK +case 51: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); yylval.token.type = T_BOOL; return BOOL; } + YY_BREAK +case 52: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); yylval.token.type = T_INT; return INT; } + YY_BREAK +case 53: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); yylval.token.type = T_FLOAT; return FLOAT; } + YY_BREAK +case 54: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); yylval.token.type = T_VEC2; return VEC2; } + YY_BREAK +case 55: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); yylval.token.type = T_VEC3; return VEC3; } + YY_BREAK +case 56: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); yylval.token.type = T_VEC4; return VEC4; } + YY_BREAK +case 57: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); yylval.token.type = T_BVEC2; return BVEC2; } + YY_BREAK +case 58: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); yylval.token.type = T_BVEC3; return BVEC3; } + YY_BREAK +case 59: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); yylval.token.type = T_BVEC4; return BVEC4; } + YY_BREAK +case 60: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); yylval.token.type = T_IVEC2; return IVEC2; } + YY_BREAK +case 61: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); yylval.token.type = T_IVEC3; return IVEC3; } + YY_BREAK +case 62: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); yylval.token.type = T_IVEC4; return IVEC4; } + YY_BREAK +case 63: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); yylval.token.type = T_MAT2; return MAT2; } + YY_BREAK +case 64: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); yylval.token.type = T_MAT3; return MAT3; } + YY_BREAK +case 65: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); yylval.token.type = T_MAT4; return MAT4; } + YY_BREAK +case 66: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); yylval.token.type = T_SAMPLER2D; return SAMPLER2D; } + YY_BREAK +case 67: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); yylval.token.type = T_SAMPLERCUBE; return SAMPLERCUBE; } + YY_BREAK +/* 3.7 keywords */ +case 68: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); yylval.token.type = S_INVARIANT; return INVARIANT; } + YY_BREAK +case 69: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); yylval.token.type = S_ATTRIBUTE; return ATTRIBUTE; } + YY_BREAK +case 70: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); yylval.token.type = S_CONST; return CONST; } + YY_BREAK +case 71: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); yylval.token.type = S_UNIFORM; return UNIFORM; } + YY_BREAK +case 72: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); yylval.token.type = S_VARYING; return VARYING; } + YY_BREAK +case 73: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); yylval.token.type = S_IN; return IN; } + YY_BREAK +case 74: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); yylval.token.type = S_OUT; return OUT; } + YY_BREAK +case 75: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); yylval.token.type = S_INOUT; return INOUT; } + YY_BREAK +case 76: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); yylval.token.type = S_LOWP; return LOW_PRECISION; } + YY_BREAK +case 77: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); yylval.token.type = S_MEDIUMP; return MEDIUM_PRECISION; } + YY_BREAK +case 78: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); yylval.token.type = S_HIGHP; return HIGH_PRECISION; } + YY_BREAK +case 79: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); return BREAK; } + YY_BREAK +case 80: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); return CONTINUE; } + YY_BREAK +case 81: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); return DO; } + YY_BREAK +case 82: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); return FOR; } + YY_BREAK +case 83: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); return WHILE; } + YY_BREAK +case 84: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); return IF; } + YY_BREAK +case 85: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); return ELSE; } + YY_BREAK +case 86: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); return PRECISION; } + YY_BREAK +case 87: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); return DISCARD; } + YY_BREAK +case 88: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); return RETURN; } + YY_BREAK +case 89: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); return STRUCT; } + YY_BREAK +/* 4.1.2 booleans */ +case 90: +YY_RULE_SETUP +{ + SET_TOKEN(hazelParsetext); + yylval.token.type = (T_BOOL | S_CONST); + yylval.token.ival = 1; + return BOOLCONSTANT; +} + YY_BREAK +case 91: +YY_RULE_SETUP +{ + SET_TOKEN(hazelParsetext); + yylval.token.type = (T_BOOL | S_CONST); + yylval.token.ival = 0; + return BOOLCONSTANT; +} + YY_BREAK +/* 3.8 identifiers */ +case 92: +YY_RULE_SETUP +{ + if (strstr(hazelParsetext, "__") != NULL) { + yyerror("identifiers containing two consecutive underscores(__) are reserved\n"); + SET_TOKEN(hazelParsetext); + return '$'; + } + SET_TOKEN(hazelParsetext); + return IDENTIFIER; +} + YY_BREAK +/* 4.1.3 integers */ +case 93: +case 94: +case 95: +YY_RULE_SETUP +{ + SET_TOKEN(hazelParsetext); + yylval.token.type = (T_INT | S_CONST); + yylval.token.ival = (int)strtol(hazelParsetext, NULL, 0); + return INTCONSTANT; +} + YY_BREAK +/* 4.1.4 floats */ +case 96: +case 97: +case 98: +case 99: +YY_RULE_SETUP +{ + SET_TOKEN(hazelParsetext); + yylval.token.type = (T_FLOAT | S_CONST); + yylval.token.fval = (float)strtod(hazelParsetext, NULL); + return FLOATCONSTANT; +} + YY_BREAK +/* operators */ +case 100: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); return ADD_ASSIGN; } + YY_BREAK +case 101: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); return AND_ASSIGN; /* reserved */ } + YY_BREAK +case 102: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); return AND_OP; } + YY_BREAK +case 103: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); return DEC_OP; } + YY_BREAK +case 104: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); return DIV_ASSIGN; } + YY_BREAK +case 105: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); return EQ_OP; } + YY_BREAK +case 106: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); return GE_OP; } + YY_BREAK +case 107: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); return INC_OP; } + YY_BREAK +case 108: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); return LEFT_ASSIGN; /* reserved */ } + YY_BREAK +case 109: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); return LEFT_OP; /* reserved */ } + YY_BREAK +case 110: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); return LE_OP; } + YY_BREAK +case 111: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); return MOD_ASSIGN; /* reserved */ } + YY_BREAK +case 112: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); return MUL_ASSIGN; } + YY_BREAK +case 113: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); return NE_OP; } + YY_BREAK +case 114: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); return OR_ASSIGN; /* reserved */ } + YY_BREAK +case 115: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); return OR_OP; } + YY_BREAK +case 116: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); return RIGHT_ASSIGN; /* reserved */ } + YY_BREAK +case 117: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); return RIGHT_OP; /* reserved */ } + YY_BREAK +case 118: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); return SUB_ASSIGN; } + YY_BREAK +case 119: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); return XOR_ASSIGN; /* reserved */ } + YY_BREAK +case 120: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); return XOR_OP; } + YY_BREAK +case 121: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); return hazelParsetext[0]; /* reserved */ } + YY_BREAK +case 122: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); return hazelParsetext[0]; /* reserved */ } + YY_BREAK +case 123: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); return hazelParsetext[0]; /* reserved */ } + YY_BREAK +case 124: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); return hazelParsetext[0]; /* reserved */ } + YY_BREAK +case 125: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); return hazelParsetext[0]; /* reserved */ } + YY_BREAK +/* extras */ +case 126: +YY_RULE_SETUP +{ /* ignore it */ } + YY_BREAK +case 127: +YY_RULE_SETUP +{ /* ignore it */ } + YY_BREAK +case 128: +/* rule 128 can match eol */ +YY_RULE_SETUP +{ iLine++; /* count new line */ } + YY_BREAK +case 129: +YY_RULE_SETUP +{ SET_TOKEN(";\n"); return hazelParsetext[0]; /* newline */ } + YY_BREAK +case 130: +YY_RULE_SETUP +{ SET_TOKEN("{\n"); return hazelParsetext[0]; /* newline */ } + YY_BREAK +case 131: +YY_RULE_SETUP +{ SET_TOKEN("}\n"); return hazelParsetext[0]; /* newline */ } + YY_BREAK +case 132: +YY_RULE_SETUP +{ SET_TOKEN(hazelParsetext); return hazelParsetext[0]; } + YY_BREAK +case 133: +YY_RULE_SETUP +ECHO; + YY_BREAK +case YY_STATE_EOF(INITIAL): + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = (yy_hold_char); + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed hazelParsein at a new source and called + * hazelParselex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = hazelParsein; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++(yy_c_buf_p); + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = (yy_c_buf_p); + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_END_OF_FILE: + { + (yy_did_buffer_switch_on_eof) = 0; + + if ( hazelParsewrap( ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * hazelParsetext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = + (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + (yy_c_buf_p) = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ +} /* end of hazelParselex */ + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ +static int yy_get_next_buffer (void) +{ + register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + register char *source = (yytext_ptr); + register int number_to_move, i; + int ret_val; + + if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; + + else + { + int num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER; + + int yy_c_buf_p_offset = + (int) ((yy_c_buf_p) - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + hazelParserealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; + + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + (yy_n_chars), (size_t) num_to_read ); + + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + if ( (yy_n_chars) == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + hazelParserestart(hazelParsein ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) hazelParserealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + } + + (yy_n_chars) += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; + + (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + + return ret_val; +} + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + + static yy_state_type yy_get_previous_state (void) +{ + register yy_state_type yy_current_state; + register char *yy_cp; + + yy_current_state = (yy_start); + + for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) + { + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 428 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + } + + return yy_current_state; +} + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) +{ + register int yy_is_jam; + register char *yy_cp = (yy_c_buf_p); + + register YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 428 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_is_jam = (yy_current_state == 427); + + return yy_is_jam ? 0 : yy_current_state; +} + + static void yyunput (int c, register char * yy_bp ) +{ + register char *yy_cp; + + yy_cp = (yy_c_buf_p); + + /* undo effects of setting up hazelParsetext */ + *yy_cp = (yy_hold_char); + + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + register int number_to_move = (yy_n_chars) + 2; + register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; + register char *source = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; + + while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + *--dest = *--source; + + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; + + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } + + *--yy_cp = (char) c; + + (yytext_ptr) = yy_bp; + (yy_hold_char) = *yy_cp; + (yy_c_buf_p) = yy_cp; +} + +#ifndef YY_NO_INPUT +#ifdef __cplusplus + static int yyinput (void) +#else + static int input (void) +#endif + +{ + int c; + + *(yy_c_buf_p) = (yy_hold_char); + + if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + /* This was really a NUL. */ + *(yy_c_buf_p) = '\0'; + + else + { /* need more input */ + int offset = (yy_c_buf_p) - (yytext_ptr); + ++(yy_c_buf_p); + + switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + hazelParserestart(hazelParsein ); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( hazelParsewrap( ) ) + return EOF; + + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(); +#else + return input(); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = (yytext_ptr) + offset; + break; + } + } + } + + c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ + *(yy_c_buf_p) = '\0'; /* preserve hazelParsetext */ + (yy_hold_char) = *++(yy_c_buf_p); + + return c; +} +#endif /* ifndef YY_NO_INPUT */ + +/** Immediately switch to a different input stream. + * @param input_file A readable stream. + * + * @note This function does not reset the start condition to @c INITIAL . + */ + void hazelParserestart (FILE * input_file ) +{ + + if ( ! YY_CURRENT_BUFFER ){ + hazelParseensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + hazelParse_create_buffer(hazelParsein,YY_BUF_SIZE ); + } + + hazelParse_init_buffer(YY_CURRENT_BUFFER,input_file ); + hazelParse_load_buffer_state( ); +} + +/** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * + */ + void hazelParse_switch_to_buffer (YY_BUFFER_STATE new_buffer ) +{ + + /* TODO. We should be able to replace this entire function body + * with + * hazelParsepop_buffer_state(); + * hazelParsepush_buffer_state(new_buffer); + */ + hazelParseensure_buffer_stack (); + if ( YY_CURRENT_BUFFER == new_buffer ) + return; + + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + hazelParse_load_buffer_state( ); + + /* We don't actually know whether we did this switch during + * EOF (hazelParsewrap()) processing, but the only time this flag + * is looked at is after hazelParsewrap() is called, so it's safe + * to go ahead and always set it. + */ + (yy_did_buffer_switch_on_eof) = 1; +} + +static void hazelParse_load_buffer_state (void) +{ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + hazelParsein = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + (yy_hold_char) = *(yy_c_buf_p); +} + +/** Allocate and initialize an input buffer state. + * @param file A readable stream. + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. + * + * @return the allocated buffer state. + */ + YY_BUFFER_STATE hazelParse_create_buffer (FILE * file, int size ) +{ + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) hazelParsealloc(sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in hazelParse_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) hazelParsealloc(b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in hazelParse_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + hazelParse_init_buffer(b,file ); + + return b; +} + +/** Destroy the buffer. + * @param b a buffer created with hazelParse_create_buffer() + * + */ + void hazelParse_delete_buffer (YY_BUFFER_STATE b ) +{ + + if ( ! b ) + return; + + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + hazelParsefree((void *) b->yy_ch_buf ); + + hazelParsefree((void *) b ); +} + +#ifndef __cplusplus +extern int isatty (int ); +#endif /* __cplusplus */ + +/* Initializes or reinitializes a buffer. + * This function is sometimes called more than once on the same buffer, + * such as during a hazelParserestart() or at EOF. + */ + static void hazelParse_init_buffer (YY_BUFFER_STATE b, FILE * file ) + +{ + int oerrno = errno; + + hazelParse_flush_buffer(b ); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + + /* If b is the current buffer, then hazelParse_init_buffer was _probably_ + * called from hazelParserestart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER){ + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } + + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; + + errno = oerrno; +} + +/** Discard all buffered characters. On the next scan, YY_INPUT will be called. + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. + * + */ + void hazelParse_flush_buffer (YY_BUFFER_STATE b ) +{ + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == YY_CURRENT_BUFFER ) + hazelParse_load_buffer_state( ); +} + +/** Pushes the new state onto the stack. The new state becomes + * the current state. This function will allocate the stack + * if necessary. + * @param new_buffer The new state. + * + */ +void hazelParsepush_buffer_state (YY_BUFFER_STATE new_buffer ) +{ + if (new_buffer == NULL) + return; + + hazelParseensure_buffer_stack(); + + /* This block is copied from hazelParse_switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + (yy_buffer_stack_top)++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from hazelParse_switch_to_buffer. */ + hazelParse_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; +} + +/** Removes and deletes the top of the stack, if present. + * The next element becomes the new top. + * + */ +void hazelParsepop_buffer_state (void) +{ + if (!YY_CURRENT_BUFFER) + return; + + hazelParse_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + if ((yy_buffer_stack_top) > 0) + --(yy_buffer_stack_top); + + if (YY_CURRENT_BUFFER) { + hazelParse_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; + } +} + +/* Allocates the stack if it does not exist. + * Guarantees space for at least one push. + */ +static void hazelParseensure_buffer_stack (void) +{ + int num_to_alloc; + + if (!(yy_buffer_stack)) { + + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. + */ + num_to_alloc = 1; + (yy_buffer_stack) = (struct yy_buffer_state**)hazelParsealloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in hazelParseensure_buffer_stack()" ); + + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + (yy_buffer_stack_max) = num_to_alloc; + (yy_buffer_stack_top) = 0; + return; + } + + if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ + + /* Increase the buffer to prepare for a possible push. */ + int grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = (yy_buffer_stack_max) + grow_size; + (yy_buffer_stack) = (struct yy_buffer_state**)hazelParserealloc + ((yy_buffer_stack), + num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in hazelParseensure_buffer_stack()" ); + + /* zero only the new slots.*/ + memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); + (yy_buffer_stack_max) = num_to_alloc; + } +} + +/** Setup the input buffer state to scan directly from a user-specified character buffer. + * @param base the character buffer + * @param size the size in bytes of the character buffer + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE hazelParse_scan_buffer (char * base, yy_size_t size ) +{ + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; + + b = (YY_BUFFER_STATE) hazelParsealloc(sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in hazelParse_scan_buffer()" ); + + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + hazelParse_switch_to_buffer(b ); + + return b; +} + +/** Setup the input buffer state to scan a string. The next call to hazelParselex() will + * scan from a @e copy of @a str. + * @param yystr a NUL-terminated string to scan + * + * @return the newly allocated buffer state object. + * @note If you want to scan bytes that may contain NUL values, then use + * hazelParse_scan_bytes() instead. + */ +YY_BUFFER_STATE hazelParse_scan_string (yyconst char * yystr ) +{ + + return hazelParse_scan_bytes(yystr,strlen(yystr) ); +} + +/** Setup the input buffer state to scan the given bytes. The next call to hazelParselex() will + * scan from a @e copy of @a bytes. + * @param bytes the byte buffer to scan + * @param len the number of bytes in the buffer pointed to by @a bytes. + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE hazelParse_scan_bytes (yyconst char * yybytes, int _yybytes_len ) +{ + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = _yybytes_len + 2; + buf = (char *) hazelParsealloc(n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in hazelParse_scan_bytes()" ); + + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; + + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; + + b = hazelParse_scan_buffer(buf,n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in hazelParse_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; +} + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +static void yy_fatal_error (yyconst char* msg ) +{ + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); +} + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up hazelParsetext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + hazelParsetext[hazelParseleng] = (yy_hold_char); \ + (yy_c_buf_p) = hazelParsetext + yyless_macro_arg; \ + (yy_hold_char) = *(yy_c_buf_p); \ + *(yy_c_buf_p) = '\0'; \ + hazelParseleng = yyless_macro_arg; \ + } \ + while ( 0 ) + +/* Accessor methods (get/set functions) to struct members. */ + +/** Get the current line number. + * + */ +int hazelParseget_lineno (void) +{ + + return hazelParselineno; +} + +/** Get the input stream. + * + */ +FILE *hazelParseget_in (void) +{ + return hazelParsein; +} + +/** Get the output stream. + * + */ +FILE *hazelParseget_out (void) +{ + return hazelParseout; +} + +/** Get the length of the current token. + * + */ +int hazelParseget_leng (void) +{ + return hazelParseleng; +} + +/** Get the current token. + * + */ + +char *hazelParseget_text (void) +{ + return hazelParsetext; +} + +/** Set the current line number. + * @param line_number + * + */ +void hazelParseset_lineno (int line_number ) +{ + + hazelParselineno = line_number; +} + +/** Set the input stream. This does not discard the current + * input buffer. + * @param in_str A readable stream. + * + * @see hazelParse_switch_to_buffer + */ +void hazelParseset_in (FILE * in_str ) +{ + hazelParsein = in_str ; +} + +void hazelParseset_out (FILE * out_str ) +{ + hazelParseout = out_str ; +} + +int hazelParseget_debug (void) +{ + return hazelParse_flex_debug; +} + +void hazelParseset_debug (int bdebug ) +{ + hazelParse_flex_debug = bdebug ; +} + +static int yy_init_globals (void) +{ + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from hazelParselex_destroy(), so don't allocate here. + */ + + (yy_buffer_stack) = 0; + (yy_buffer_stack_top) = 0; + (yy_buffer_stack_max) = 0; + (yy_c_buf_p) = (char *) 0; + (yy_init) = 0; + (yy_start) = 0; + +/* Defined in main.c */ +#ifdef YY_STDINIT + hazelParsein = stdin; + hazelParseout = stdout; +#else + hazelParsein = (FILE *) 0; + hazelParseout = (FILE *) 0; +#endif + + /* For future reference: Set errno on error, since we are called by + * hazelParselex_init() + */ + return 0; +} + +/* hazelParselex_destroy is for both reentrant and non-reentrant scanners. */ +int hazelParselex_destroy (void) +{ + + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER){ + hazelParse_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + hazelParsepop_buffer_state(); + } + + /* Destroy the stack itself. */ + hazelParsefree((yy_buffer_stack) ); + (yy_buffer_stack) = NULL; + + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * hazelParselex() is called, initialization will occur. */ + yy_init_globals( ); + + return 0; +} + +/* + * Internal utility routines. + */ + +#ifndef yytext_ptr +static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) +{ + register int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; +} +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (yyconst char * s ) +{ + register int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; +} +#endif + +void *hazelParsealloc (yy_size_t size ) +{ + return (void *) malloc( size ); +} + +void *hazelParserealloc (void * ptr, yy_size_t size ) +{ + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return (void *) realloc( (char *) ptr, size ); +} + +void hazelParsefree (void * ptr ) +{ + free( (char *) ptr ); /* see hazelParserealloc() for (char *) cast */ +} + +#define YYTABLES_NAME "yytables" + diff --git a/es_2_0/ParseParse.c b/es_2_0/ParseParse.c new file mode 100755 index 0000000..3178cb3 --- /dev/null +++ b/es_2_0/ParseParse.c @@ -0,0 +1,2008 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#ifndef lint +static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; +#endif + +#include <stdlib.h> +#include <string.h> + +#define YYBYACC 1 +#define YYMAJOR 1 +#define YYMINOR 9 +#define YYPATCH 20070509 + +#define YYEMPTY (-1) +#define yyclearin (yychar = YYEMPTY) +#define yyerrok (yyerrflag = 0) +#define YYRECOVERING (yyerrflag != 0) + +extern int yyparse(void); + +static int yygrowstack(void); +#define yyparse hazelParseparse +#define yylex hazelParselex +#define yyerror hazelParseerror +#define yychar hazelParsechar +#define yyval hazelParseval +#define yylval hazelParselval +#define yydebug hazelParsedebug +#define yynerrs hazelParsenerrs +#define yyerrflag hazelParseerrflag +#define yyss hazelParsess +#define yyssp hazelParsessp +#define yyvs hazelParsevs +#define yyvsp hazelParsevsp +#define yylhs hazelParselhs +#define yylen hazelParselen +#define yydefred hazelParsedefred +#define yydgoto hazelParsedgoto +#define yysindex hazelParsesindex +#define yyrindex hazelParserindex +#define yygindex hazelParsegindex +#define yytable hazelParsetable +#define yycheck hazelParsecheck +#define yyname hazelParsename +#define yyrule hazelParserule +#define YYPREFIX "hazelParse" + +#include "es2front.h" + +/* #define PROVIDING_FULLDEBUG*/ + +static struct ShaderObjectUnit* pUnit; +static GLenum eShaderType; +static char* pSrcPtr; +static char* pDstPtr; +static int iSemError; /* semantic error flag*/ +static int iLine; /* current line number: controlled by LEX*/ + +static struct TableEntry* ptrMainStack[100]; /* pointing to struct/func name*/ +static struct TableEntry* ptrFirstStack[100]; /* pointing 1st member/param*/ +static struct TableEntry* ptrLastStack[100]; /* pointing 1st member/param*/ +static int iStackTop = -1; + +void pushMain(struct TableEntry* ptr) { + assert(ptr != NULL); + assert(iStackTop < sizeof(ptrMainStack) / sizeof(ptrMainStack[0])); + iStackTop++; + ptrMainStack[iStackTop] = ptr; + ptrFirstStack[iStackTop] = NULL; + ptrLastStack[iStackTop] = NULL; +} + +void setFirst(struct TableEntry* ptr) { ptrFirstStack[iStackTop] = ptr; } +void setLast(struct TableEntry* ptr) { ptrLastStack[iStackTop] = ptr; } + +void popMain(void) { + ptrMainStack[iStackTop] = NULL; + ptrFirstStack[iStackTop] = NULL; + ptrLastStack[iStackTop] = NULL; + iStackTop--; + assert(iStackTop >= -1); +} + +struct TableEntry* getMain(void) { return ptrMainStack[iStackTop]; } +struct TableEntry* getFirst(void) { return ptrFirstStack[iStackTop]; } +struct TableEntry* getLast(void) { return ptrLastStack[iStackTop]; } + +extern int hazelParselex(void); +extern int hazelParselex_destroy(void); + +void hazelParseTerminate(void) { + hazelParselex_destroy(); +} + +int hazelParseGetError(void) { + return iSemError; +} + +void hazelERROR(char* kind, char* s) { + ES2INTER(ShaderObjectInfoLogAppend)(pUnit, + "ERROR (line %d): %s around '%s'\n", iLine, kind, s); + iSemError = 1; +} + +#define ERROR(k,s) \ + do { \ + hazelERROR(k, s); \ + iSemError = 1; \ + YYERROR; \ + } while (0) + +void UNSUPPORTED(char* s) { + ES2INTER(ShaderObjectInfoLogAppend)(pUnit, + "ERROR (line %d): '%s' is not supported\n", iLine, s); + iSemError = 1; +} + +void FOUND_RESERVED(char* s) { + ES2INTER(ShaderObjectInfoLogAppend)(pUnit, + "ERROR (line %d): cannot use reserved keyword '%s'\n", iLine, s); + iSemError = 1; +} + +void UNDEFINED(char* s) { + ES2INTER(ShaderObjectInfoLogAppend)(pUnit, + "ERROR (line %d): '%s' undefined\n", iLine, s); + iSemError = 1; +} + +void ALREADY_DEFINED(char* s) { + ES2INTER(ShaderObjectInfoLogAppend)(pUnit, + "ERROR (line %d): '%s' is already defined\n", iLine, s); + iSemError = 1; +} + +typedef union { + struct TableEntry token; +} YYSTYPE; + +#define FREE() \ + do { \ + int i; \ + for (i = -yym + 1; i <= 0; i++) { \ + assert(yyvsp[i].token.name != NULL); \ + free(yyvsp[i].token.name); \ + yyvsp[i].token.name == NULL; \ + } \ + } while (0) + +#define MERGE() \ + do { \ + int i; \ + int len = 0; \ + if (yym == 1) { \ + memcpy(&(yyval), &(yyvsp[0]), sizeof(yyval)); \ + } else if (yym > 1) { \ + memset(&(yyval), 0, sizeof(yyval)); \ + for (i = -yym + 1; i <= 0; i++) { \ + assert(yyvsp[i].token.name != NULL); \ + len += strlen(yyvsp[i].token.name) + 1; \ + } \ + yyval.token.name = malloc(len); \ + strcpy(yyval.token.name, yyvsp[-yym + 1].token.name); \ + for (i = -yym + 2; i <= 0; i++) { \ + strcat(yyval.token.name, " "); \ + strcat(yyval.token.name, yyvsp[i].token.name); \ + free(yyvsp[i].token.name); \ + yyvsp[i].token.name = NULL; \ + } \ + } \ + } while (0) + +#define VOID 257 +#define BOOL 258 +#define INT 259 +#define FLOAT 260 +#define VEC2 261 +#define VEC3 262 +#define VEC4 263 +#define BVEC2 264 +#define BVEC3 265 +#define BVEC4 266 +#define IVEC2 267 +#define IVEC3 268 +#define IVEC4 269 +#define MAT2 270 +#define MAT3 271 +#define MAT4 272 +#define SAMPLER2D 273 +#define SAMPLER3D 274 +#define SAMPLERCUBE 275 +#define ATTRIBUTE 276 +#define CONST 277 +#define UNIFORM 278 +#define VARYING 279 +#define BREAK 280 +#define CONTINUE 281 +#define DO 282 +#define FOR 283 +#define WHILE 284 +#define IF 285 +#define ELSE 286 +#define IN 287 +#define OUT 288 +#define INOUT 289 +#define LOW_PRECISION 290 +#define MEDIUM_PRECISION 291 +#define HIGH_PRECISION 292 +#define PRECISION 293 +#define INVARIANT 294 +#define DISCARD 295 +#define RETURN 296 +#define STRUCT 297 +#define BOOLCONSTANT 298 +#define IDENTIFIER 299 +#define INTCONSTANT 300 +#define FLOATCONSTANT 301 +#define ADD_ASSIGN 302 +#define SUB_ASSIGN 303 +#define MUL_ASSIGN 304 +#define DIV_ASSIGN 305 +#define MOD_ASSIGN 306 +#define LEFT_ASSIGN 307 +#define RIGHT_ASSIGN 308 +#define AND_ASSIGN 309 +#define XOR_ASSIGN 310 +#define OR_ASSIGN 311 +#define OR_OP 312 +#define XOR_OP 313 +#define AND_OP 314 +#define EQ_OP 315 +#define NE_OP 316 +#define LE_OP 317 +#define GE_OP 318 +#define LEFT_OP 319 +#define RIGHT_OP 320 +#define INC_OP 321 +#define DEC_OP 322 +#define UPLUS 323 +#define UMINUS 324 +#define YYERRCODE 256 +short hazelParselhs[] = { -1, + 0, 1, 1, 2, 2, 3, 7, 7, 7, 7, + 7, 9, 9, 9, 9, 9, 9, 11, 10, 12, + 12, 13, 13, 14, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 5, 17, 17, 18, 18, 19, 20, 20, 20, 20, + 24, 24, 23, 23, 23, 23, 25, 25, 28, 28, + 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, + 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, + 29, 29, 29, 29, 29, 30, 30, 15, 15, 31, + 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, + 8, 8, 27, 4, 4, 4, 32, 32, 32, 32, + 35, 35, 35, 35, 35, 37, 22, 22, 22, 22, + 22, 33, 33, 33, 38, 38, 38, 38, 38, 38, + 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, + 38, 38, 38, 38, 21, 21, 26, 26, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 39, + 40, 40, 41, 41, 42, 42, 42, 43, 43, 36, + 44, 45, 45, 47, 47, 47, 47, 47, 46, 46, + 53, 53, 6, 6, 52, 52, 48, 48, 49, 54, + 54, 55, 55, 50, 50, 50, 56, 56, 58, 58, + 57, 57, 51, 51, 51, 51, 51, +}; +short hazelParselen[] = { 2, + 1, 1, 2, 1, 1, 2, 1, 1, 1, 3, + 1, 1, 1, 2, 2, 4, 3, 1, 2, 1, + 1, 2, 3, 2, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 2, 1, 1, 2, 3, 3, 3, 2, 3, 2, + 2, 5, 1, 1, 1, 0, 1, 4, 1, 2, + 2, 2, 2, 2, 2, 1, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 1, 5, 1, 3, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 3, 1, 2, 2, 4, 1, 3, 6, 5, + 1, 2, 4, 5, 2, 1, 1, 1, 1, 1, + 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, + 3, 2, 2, 3, 1, 3, 6, 2, 5, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 1, 2, 3, 1, 2, 1, 2, 5, 3, + 1, 1, 4, 5, 7, 6, 1, 1, 1, 0, + 2, 3, 2, 2, 2, 3, 2, +}; +short hazelParsedefred[] = { 0, + 149, 152, 151, 150, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 120, + 117, 119, 118, 124, 123, 122, 0, 0, 0, 169, + 0, 0, 2, 4, 5, 0, 0, 0, 0, 0, + 0, 145, 0, 0, 147, 107, 168, 0, 0, 121, + 115, 0, 172, 3, 104, 0, 6, 41, 0, 53, + 54, 55, 0, 44, 0, 0, 0, 146, 0, 105, + 148, 0, 0, 0, 175, 0, 171, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 7, 8, 0, 0, 0, 0, 0, 0, + 0, 197, 193, 0, 181, 0, 12, 0, 0, 13, + 0, 0, 0, 101, 0, 0, 0, 88, 184, 195, + 182, 183, 185, 186, 187, 188, 0, 45, 0, 48, + 50, 0, 0, 46, 0, 0, 0, 170, 0, 0, + 173, 106, 214, 213, 191, 192, 0, 0, 0, 0, + 217, 27, 26, 25, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 0, 215, 0, 0, + 0, 0, 0, 0, 0, 0, 189, 0, 0, 198, + 14, 15, 0, 0, 19, 0, 22, 24, 90, 93, + 94, 91, 92, 95, 96, 97, 98, 99, 100, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 194, 196, 47, 49, 0, 0, 180, 113, 0, 66, + 103, 0, 0, 0, 174, 0, 0, 208, 207, 0, + 0, 0, 0, 0, 216, 10, 190, 102, 0, 0, + 17, 23, 89, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, + 68, 69, 0, 0, 0, 114, 110, 0, 0, 0, + 0, 209, 0, 0, 0, 0, 0, 16, 0, 0, + 58, 109, 179, 0, 0, 0, 0, 0, 204, 0, + 199, 87, 52, 177, 0, 206, 0, 203, 0, 205, + 200, +}; +short hazelParsedgoto[] = { 31, + 32, 33, 34, 115, 116, 155, 117, 118, 119, 120, + 260, 121, 122, 123, 124, 125, 37, 38, 39, 64, + 40, 41, 66, 140, 141, 42, 239, 126, 127, 128, + 210, 43, 44, 45, 46, 238, 0, 0, 47, 48, + 73, 74, 75, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 157, 311, 253, 250, 293, 294, +}; +short hazelParsesindex[] = { 2130, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, -73, -239, -121, 0, + 0, 2130, 0, 0, 0, -26, -27, -5, 206, -251, + 2045, 0, -17, 2216, 0, 0, 0, 2045, 2216, 0, + 0, -60, 0, 0, 0, -33, 0, 0, 206, 0, + 0, 0, -214, 0, 159, 2045, -6, 0, -228, 0, + 0, -185, 1960, 65, 0, 77, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 86, 87, 472, 126, 127, 132, 96, 848, + 0, 0, 0, 0, 1249, 1249, 1249, 1249, 1249, 1249, + 863, 0, 0, 35, 0, 129, 0, 90, -41, 0, + 151, 167, 863, 0, 164, 770, 160, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 130, 0, 2045, 0, + 0, -85, 863, 0, 863, -46, 122, 0, 95, -29, + 0, 0, 0, 0, 0, 0, -13, 741, 670, 863, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 98, -41, + -41, -41, -41, -41, -41, 71, 0, 309, 863, 0, + 0, 0, 863, -21, 0, 863, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 863, + 863, 863, 863, 863, 863, 863, 863, 863, 863, 863, + 863, 863, 863, 863, 863, 863, 863, 863, 863, 863, + 0, 0, 0, 0, 188, 863, 0, 0, 197, 0, + 0, 863, 863, 863, 0, 246, 299, 0, 0, 670, + 297, 52, 312, 112, 0, 0, 0, 0, 297, 274, + 0, 0, 0, 502, 44, 935, 1009, 148, 490, 4, + 4, -34, -34, -34, -34, 511, 511, 240, 240, 0, + 0, 0, 14, 863, 276, 0, 0, 286, 287, 863, + 863, 0, 344, 327, 355, 579, 472, 0, 863, 324, + 0, 0, 0, 345, 135, 579, 863, 863, 0, 155, + 0, 0, 0, 0, 378, 0, 297, 0, 472, 0, + 0, +}; +short hazelParserindex[] = { 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 442, 0, 0, 0, 0, 0, 403, 1916, 115, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 2173, 0, + 0, 0, 0, 0, 2173, 0, 157, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, -24, -23, -16, + 39, 67, 85, 156, 459, 484, 498, 583, 585, 588, + 593, 595, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1149, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1186, 0, + 0, 408, 409, 0, 0, 58, 15, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 139, 0, 0, 0, 162, 296, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1113, 0, 0, 1223, + 1260, 1314, 1351, 1548, 1636, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 168, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 306, 0, 0, 0, 397, + 78, 0, 0, 0, 0, 0, 0, 0, 364, 0, + 0, 0, 0, 448, 106, 69, 395, -40, 2072, 2009, + 2046, 1746, 1783, 1843, 1983, 1683, 1720, 1646, 1673, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 419, 0, 0, 400, + 0, 0, 0, 0, 0, 0, 420, 0, 0, 0, + 0, +}; +short hazelParsegindex[] = { 0, + 0, 430, 0, 29, 38, 433, 0, 984, 238, 0, + 0, 0, 0, 0, 1098, 0, 0, 0, 0, 411, + -128, 18, 406, 342, 347, -4, -103, 2049, 1697, -113, + 0, 0, 460, 99, 0, -220, 0, 0, 0, 0, + 0, 417, 0, 333, -112, 0, -28, 338, 0, 0, + 0, 383, -267, 0, 248, 0, 0, 0, +}; +#define YYTABLESIZE 2515 +short hazelParsetable[] = { 110, + 81, 53, 229, 81, 194, 236, 111, 227, 225, 105, + 226, 106, 228, 58, 242, 27, 26, 81, 81, 152, + 151, 287, 81, 25, 232, 112, 69, 150, 35, 310, + 252, 241, 55, 144, 152, 151, 68, 36, 59, 50, + 229, 70, 150, 72, 243, 227, 225, 67, 226, 193, + 228, 321, 81, 81, 143, 86, 65, 189, 86, 51, + 35, 142, 77, 219, 50, 220, 156, 110, 72, 36, + 146, 299, 86, 86, 111, 232, 65, 105, 28, 106, + 229, 216, 153, 81, 145, 227, 225, 318, 226, 114, + 228, 113, 109, 112, 66, 66, 56, 153, 66, 66, + 66, 66, 66, 219, 66, 220, 29, 86, 150, 83, + 154, 256, 83, 147, 189, 66, 66, 66, 202, 66, + 66, 252, 241, 151, 30, 154, 83, 83, 155, 241, + 241, 83, 285, 189, 142, 152, 202, 215, 150, 288, + 289, 189, 71, 155, 153, 154, 84, 76, 190, 84, + 66, 66, 297, 245, 161, 189, 255, 114, 111, 187, + 109, 83, 110, 84, 84, 158, 159, 214, 84, 111, + 241, 160, 105, 111, 106, 315, 241, 52, 189, 57, + 300, 66, 57, 309, 229, 216, 304, 55, 112, 227, + 225, 195, 226, 316, 228, 31, 229, 216, 84, 156, + 112, 227, 225, 198, 226, 108, 228, 219, 51, 220, + 196, 51, 244, 235, 156, 112, 24, 25, 26, 219, + 108, 220, 230, 1, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 17, + 18, 19, 20, 21, 22, 23, 93, 94, 95, 96, + 97, 98, 114, 215, 231, 109, 24, 25, 26, 27, + 28, 99, 100, 29, 101, 102, 103, 104, 156, 246, + 247, 81, 81, 81, 152, 151, 229, 261, 284, 191, + 192, 227, 150, 214, 223, 224, 228, 107, 108, 286, + 156, 1, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 17, 18, 19, + 20, 21, 22, 23, 93, 94, 95, 96, 97, 98, + 221, 222, 223, 224, 24, 25, 26, 27, 28, 99, + 100, 29, 101, 102, 103, 104, 290, 153, 291, 178, + 189, 110, 180, 181, 182, 183, 184, 185, 111, 176, + 295, 105, 296, 106, 178, 107, 108, 213, 217, 218, + 221, 222, 223, 224, 176, 154, 298, 112, 301, 66, + 66, 66, 66, 66, 66, 66, 66, 66, 302, 303, + 83, 83, 83, 155, 306, 307, 1, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 17, 18, 19, 20, 21, 22, 23, 93, + 94, 95, 96, 97, 98, 308, 313, 84, 84, 24, + 25, 26, 27, 28, 99, 100, 29, 101, 102, 103, + 104, 114, 201, 257, 109, 82, 320, 314, 82, 201, + 319, 1, 201, 42, 201, 60, 61, 62, 20, 21, + 107, 108, 82, 82, 156, 210, 18, 82, 201, 211, + 212, 54, 217, 218, 221, 222, 223, 224, 57, 138, + 139, 211, 212, 213, 217, 218, 221, 222, 223, 224, + 233, 20, 21, 22, 23, 234, 49, 82, 85, 149, + 248, 85, 60, 61, 62, 249, 188, 292, 32, 63, + 0, 0, 157, 0, 110, 85, 85, 0, 0, 0, + 85, 111, 0, 0, 105, 0, 106, 157, 82, 0, + 0, 0, 201, 33, 201, 201, 229, 158, 0, 0, + 112, 227, 225, 0, 226, 0, 228, 34, 229, 216, + 85, 159, 158, 227, 225, 0, 226, 229, 228, 219, + 0, 220, 227, 225, 0, 226, 159, 228, 0, 0, + 0, 219, 0, 220, 0, 1, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 17, 18, 19, 20, 21, 22, 23, 93, 94, + 95, 96, 97, 98, 56, 215, 0, 109, 24, 25, + 26, 27, 28, 99, 100, 29, 101, 102, 103, 104, + 0, 110, 0, 0, 0, 0, 0, 0, 111, 0, + 0, 105, 35, 106, 36, 214, 160, 37, 161, 107, + 108, 162, 38, 0, 39, 0, 163, 112, 164, 0, + 0, 160, 0, 161, 0, 0, 162, 0, 0, 0, + 0, 163, 0, 164, 0, 0, 201, 201, 201, 201, + 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, + 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, + 201, 201, 201, 201, 201, 0, 0, 0, 0, 201, + 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, + 201, 114, 110, 0, 109, 0, 82, 82, 82, 111, + 0, 0, 105, 0, 106, 0, 0, 0, 0, 0, + 201, 201, 0, 0, 0, 0, 0, 0, 1, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 17, 18, 19, 20, 21, 22, + 23, 93, 94, 95, 96, 97, 98, 157, 0, 85, + 0, 24, 25, 26, 27, 28, 99, 100, 29, 101, + 102, 103, 104, 110, 0, 0, 0, 0, 0, 0, + 111, 0, 158, 105, 0, 106, 0, 0, 0, 0, + 0, 0, 107, 108, 0, 109, 159, 0, 0, 112, + 0, 0, 0, 0, 217, 218, 221, 222, 223, 224, + 0, 0, 0, 0, 212, 213, 217, 218, 221, 222, + 223, 224, 0, 0, 0, 0, 0, 0, 0, 0, + 199, 0, 0, 0, 0, 1, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 17, 18, 19, 20, 21, 22, 23, 93, 94, + 95, 96, 97, 98, 0, 0, 109, 0, 24, 25, + 26, 27, 28, 99, 100, 29, 101, 102, 103, 104, + 110, 160, 0, 161, 0, 0, 162, 111, 0, 0, + 105, 163, 106, 164, 0, 110, 0, 0, 0, 107, + 108, 0, 111, 0, 0, 105, 178, 106, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 17, 18, 19, 20, 21, 22, 23, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, + 25, 26, 0, 63, 0, 0, 29, 101, 102, 103, + 104, 229, 216, 109, 0, 0, 227, 225, 0, 226, + 0, 228, 0, 0, 0, 0, 0, 0, 109, 0, + 107, 108, 0, 0, 219, 0, 220, 1, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 17, 18, 19, 20, 21, 22, 23, + 0, 0, 0, 0, 0, 0, 0, 0, 215, 0, + 24, 25, 26, 27, 28, 0, 0, 29, 101, 102, + 103, 104, 0, 0, 0, 229, 216, 0, 0, 0, + 227, 225, 0, 226, 0, 228, 0, 0, 214, 0, + 0, 107, 108, 0, 0, 0, 0, 0, 219, 0, + 220, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 0, 0, 179, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 186, 0, 0, 0, 0, 0, + 0, 0, 215, 0, 0, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 0, 0, 0, 0, 0, + 0, 0, 251, 254, 0, 101, 177, 103, 104, 11, + 11, 0, 40, 11, 11, 11, 11, 11, 11, 11, + 101, 177, 103, 104, 0, 0, 0, 0, 107, 108, + 11, 11, 11, 11, 11, 11, 259, 0, 0, 0, + 0, 0, 0, 107, 108, 11, 11, 0, 40, 11, + 11, 11, 11, 11, 11, 11, 0, 0, 0, 0, + 0, 0, 0, 11, 0, 11, 11, 11, 11, 11, + 11, 11, 0, 283, 0, 0, 0, 0, 0, 0, + 197, 0, 59, 59, 0, 0, 59, 59, 59, 59, + 59, 0, 59, 251, 0, 0, 11, 0, 0, 11, + 237, 0, 11, 59, 59, 59, 59, 59, 59, 217, + 218, 221, 222, 223, 224, 0, 0, 0, 0, 62, + 62, 0, 0, 62, 62, 62, 62, 62, 0, 62, + 0, 0, 11, 0, 305, 0, 0, 0, 59, 59, + 62, 62, 62, 62, 62, 62, 258, 0, 111, 0, + 317, 0, 0, 262, 0, 0, 63, 63, 0, 0, + 63, 63, 63, 63, 63, 0, 63, 263, 0, 59, + 0, 0, 0, 0, 0, 62, 62, 63, 63, 63, + 63, 63, 63, 217, 218, 221, 222, 223, 224, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 237, + 0, 0, 0, 0, 0, 0, 62, 0, 0, 0, + 60, 60, 63, 63, 60, 60, 60, 60, 60, 0, + 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 60, 60, 60, 60, 60, 60, 0, 0, 0, + 0, 0, 0, 63, 0, 0, 0, 61, 61, 0, + 0, 61, 61, 61, 61, 61, 312, 61, 0, 0, + 0, 0, 0, 0, 0, 237, 60, 60, 61, 61, + 61, 61, 61, 61, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 0, 0, 60, 0, 0, + 0, 0, 0, 61, 61, 0, 0, 169, 0, 0, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 0, 0, 0, 61, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 59, 59, 59, + 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, + 59, 59, 59, 59, 59, 59, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 0, 0, 0, 62, 62, 62, 62, 62, 62, + 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, + 62, 62, 62, 0, 0, 0, 101, 177, 103, 104, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 63, 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + 0, 0, 0, 0, 64, 64, 0, 0, 64, 64, + 64, 64, 64, 0, 64, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 64, 64, 64, 64, 64, + 64, 0, 0, 0, 0, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 0, 0, 0, 0, 0, 0, + 64, 64, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 61, 61, 61, 61, 61, 61, 61, 61, + 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, + 61, 64, 65, 65, 0, 0, 65, 65, 65, 65, + 65, 0, 65, 70, 0, 0, 70, 0, 70, 70, + 70, 0, 0, 65, 65, 65, 65, 65, 65, 0, + 0, 0, 0, 70, 70, 70, 0, 70, 70, 0, + 71, 0, 0, 71, 0, 71, 71, 71, 0, 0, + 72, 0, 0, 72, 0, 0, 72, 0, 65, 65, + 71, 71, 71, 0, 71, 71, 0, 0, 70, 70, + 72, 72, 72, 0, 72, 72, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 73, 0, 65, + 73, 0, 0, 73, 0, 71, 71, 0, 0, 70, + 0, 0, 0, 0, 0, 72, 72, 73, 73, 73, + 0, 73, 73, 74, 0, 0, 74, 0, 0, 74, + 0, 0, 0, 0, 0, 0, 71, 0, 0, 0, + 0, 0, 0, 74, 74, 74, 72, 74, 74, 0, + 0, 0, 73, 73, 0, 0, 0, 0, 0, 0, + 75, 0, 0, 75, 0, 0, 75, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 74, 74, + 75, 75, 75, 73, 75, 75, 0, 0, 0, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 0, 74, + 0, 0, 0, 0, 0, 75, 75, 0, 0, 0, + 76, 0, 0, 76, 0, 0, 76, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 76, 76, 76, 0, 76, 76, 75, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 76, 76, 65, 65, 65, + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, + 65, 65, 65, 65, 65, 65, 43, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 76, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 71, 71, 71, 71, 71, 71, + 71, 71, 71, 0, 72, 72, 72, 72, 72, 72, + 72, 72, 72, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 77, 0, 0, 77, 0, 0, 77, 0, 0, 0, + 0, 73, 73, 73, 73, 73, 73, 73, 73, 73, + 77, 77, 77, 0, 77, 77, 78, 0, 0, 78, + 0, 0, 78, 0, 0, 0, 0, 74, 74, 74, + 74, 74, 74, 74, 0, 0, 78, 78, 0, 0, + 0, 78, 0, 0, 0, 77, 77, 0, 0, 0, + 0, 0, 0, 79, 148, 0, 79, 0, 0, 79, + 0, 0, 0, 0, 75, 75, 75, 75, 75, 75, + 75, 78, 78, 79, 79, 0, 77, 0, 79, 80, + 0, 0, 80, 0, 0, 80, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, + 80, 0, 78, 0, 80, 0, 0, 0, 79, 79, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 76, 76, 76, 76, 76, 76, + 76, 0, 0, 0, 80, 80, 0, 0, 0, 79, + 0, 0, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 0, 0, 240, 0, 80, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 56, 56, 56, 0, 0, + 0, 0, 56, 0, 56, 0, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, + 25, 26, 0, 0, 0, 0, 29, 0, 30, 240, + 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, + 240, 240, 240, 240, 240, 240, 240, 240, 0, 0, + 0, 0, 0, 0, 240, 0, 0, 0, 0, 0, + 0, 240, 240, 0, 77, 77, 77, 77, 77, 77, + 77, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 78, 78, 78, 78, 78, 0, 0, 0, 0, 0, + 0, 0, 240, 0, 24, 25, 26, 0, 240, 0, + 0, 29, 0, 30, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 79, 79, 79, + 79, 79, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 80, 80, 80, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, + 25, 26, 27, 28, 0, 0, 29, 0, 30, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 56, 56, 56, 0, 0, 0, 0, 56, + 0, 56, 1, 2, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 29, 0, 30, +}; +short hazelParsecheck[] = { 33, + 41, 123, 37, 44, 46, 91, 40, 42, 43, 43, + 45, 45, 47, 41, 61, 40, 40, 58, 59, 44, + 44, 242, 63, 40, 137, 59, 44, 44, 0, 297, + 159, 145, 59, 40, 59, 59, 41, 0, 44, 279, + 37, 59, 59, 48, 91, 42, 43, 299, 45, 91, + 47, 319, 93, 94, 61, 41, 39, 44, 44, 299, + 32, 66, 123, 60, 279, 62, 95, 33, 73, 32, + 299, 58, 58, 59, 40, 188, 59, 43, 40, 45, + 37, 38, 44, 124, 91, 42, 43, 308, 45, 123, + 47, 125, 126, 59, 37, 38, 123, 59, 41, 42, + 43, 44, 45, 60, 47, 62, 40, 93, 44, 41, + 44, 41, 44, 299, 44, 58, 59, 60, 41, 62, + 63, 250, 236, 59, 40, 59, 58, 59, 44, 243, + 244, 63, 236, 44, 139, 59, 59, 94, 44, 243, + 244, 44, 44, 59, 59, 59, 41, 49, 59, 44, + 93, 94, 41, 59, 59, 44, 59, 123, 44, 125, + 126, 93, 33, 58, 59, 40, 40, 124, 63, 40, + 284, 40, 43, 59, 45, 41, 290, 299, 44, 41, + 284, 124, 44, 296, 37, 38, 290, 59, 59, 42, + 43, 41, 45, 306, 47, 40, 37, 38, 93, 44, + 44, 42, 43, 40, 45, 44, 47, 60, 41, 62, + 44, 44, 91, 299, 59, 59, 290, 291, 292, 60, + 59, 62, 63, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, + 284, 285, 123, 94, 125, 126, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 297, 299, + 284, 312, 313, 314, 299, 299, 37, 299, 91, 321, + 322, 42, 299, 124, 319, 320, 47, 321, 322, 93, + 319, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 317, 318, 319, 320, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 91, 299, 40, 44, + 44, 33, 105, 106, 107, 108, 109, 110, 40, 44, + 299, 43, 41, 45, 59, 321, 322, 314, 315, 316, + 317, 318, 319, 320, 59, 299, 93, 59, 93, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 93, 93, + 312, 313, 314, 299, 41, 59, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 61, 93, 312, 313, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 123, 33, 125, 126, 41, 59, 93, 44, 40, + 286, 0, 43, 41, 45, 287, 288, 289, 41, 41, + 321, 322, 58, 59, 299, 59, 93, 63, 59, 41, + 41, 32, 315, 316, 317, 318, 319, 320, 36, 59, + 65, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 139, 276, 277, 278, 279, 139, 27, 93, 41, 73, + 158, 44, 287, 288, 289, 158, 114, 250, 40, 294, + -1, -1, 44, -1, 33, 58, 59, -1, -1, -1, + 63, 40, -1, -1, 43, -1, 45, 59, 124, -1, + -1, -1, 123, 40, 125, 126, 37, 44, -1, -1, + 59, 42, 43, -1, 45, -1, 47, 40, 37, 38, + 93, 44, 59, 42, 43, -1, 45, 37, 47, 60, + -1, 62, 42, 43, -1, 45, 59, 47, -1, -1, + -1, 60, -1, 62, -1, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 123, 94, -1, 126, 290, 291, + 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + -1, 33, -1, -1, -1, -1, -1, -1, 40, -1, + -1, 43, 40, 45, 40, 124, 44, 40, 44, 321, + 322, 44, 40, -1, 40, -1, 44, 59, 44, -1, + -1, 59, -1, 59, -1, -1, 59, -1, -1, -1, + -1, 59, -1, 59, -1, -1, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, -1, -1, -1, -1, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 123, 33, -1, 126, -1, 312, 313, 314, 40, + -1, -1, 43, -1, 45, -1, -1, -1, -1, -1, + 321, 322, -1, -1, -1, -1, -1, -1, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 299, -1, 312, + -1, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 33, -1, -1, -1, -1, -1, -1, + 40, -1, 299, 43, -1, 45, -1, -1, -1, -1, + -1, -1, 321, 322, -1, 126, 299, -1, -1, 59, + -1, -1, -1, -1, 315, 316, 317, 318, 319, 320, + -1, -1, -1, -1, 313, 314, 315, 316, 317, 318, + 319, 320, -1, -1, -1, -1, -1, -1, -1, -1, + 61, -1, -1, -1, -1, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, -1, -1, 126, -1, 290, 291, + 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 33, 299, -1, 299, -1, -1, 299, 40, -1, -1, + 43, 299, 45, 299, -1, 33, -1, -1, -1, 321, + 322, -1, 40, -1, -1, 43, 59, 45, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 290, + 291, 292, -1, 294, -1, -1, 297, 298, 299, 300, + 301, 37, 38, 126, -1, -1, 42, 43, -1, 45, + -1, 47, -1, -1, -1, -1, -1, -1, 126, -1, + 321, 322, -1, -1, 60, -1, 62, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + -1, -1, -1, -1, -1, -1, -1, -1, 94, -1, + 290, 291, 292, 293, 294, -1, -1, 297, 298, 299, + 300, 301, -1, -1, -1, 37, 38, -1, -1, -1, + 42, 43, -1, 45, -1, 47, -1, -1, 124, -1, + -1, 321, 322, -1, -1, -1, -1, -1, 60, -1, + 62, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, -1, -1, 100, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 111, -1, -1, -1, -1, -1, + -1, -1, 94, -1, -1, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, + 268, 269, 270, 271, 272, -1, -1, -1, -1, -1, + -1, -1, 159, 160, -1, 298, 299, 300, 301, 37, + 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, + 298, 299, 300, 301, -1, -1, -1, -1, 321, 322, + 58, 59, 60, 61, 62, 63, 193, -1, -1, -1, + -1, -1, -1, 321, 322, 37, 38, -1, 40, 41, + 42, 43, 44, 45, 46, 47, -1, -1, -1, -1, + -1, -1, -1, 91, -1, 93, 94, 59, 60, 61, + 62, 63, -1, 230, -1, -1, -1, -1, -1, -1, + 123, -1, 37, 38, -1, -1, 41, 42, 43, 44, + 45, -1, 47, 250, -1, -1, 124, -1, -1, 91, + 143, -1, 94, 58, 59, 60, 61, 62, 63, 315, + 316, 317, 318, 319, 320, -1, -1, -1, -1, 37, + 38, -1, -1, 41, 42, 43, 44, 45, -1, 47, + -1, -1, 124, -1, 291, -1, -1, -1, 93, 94, + 58, 59, 60, 61, 62, 63, 189, -1, 40, -1, + 307, -1, -1, 196, -1, -1, 37, 38, -1, -1, + 41, 42, 43, 44, 45, -1, 47, 210, -1, 124, + -1, -1, -1, -1, -1, 93, 94, 58, 59, 60, + 61, 62, 63, 315, 316, 317, 318, 319, 320, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 242, + -1, -1, -1, -1, -1, -1, 124, -1, -1, -1, + 37, 38, 93, 94, 41, 42, 43, 44, 45, -1, + 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 58, 59, 60, 61, 62, 63, -1, -1, -1, + -1, -1, -1, 124, -1, -1, -1, 37, 38, -1, + -1, 41, 42, 43, 44, 45, 299, 47, -1, -1, + -1, -1, -1, -1, -1, 308, 93, 94, 58, 59, + 60, 61, 62, 63, 302, 303, 304, 305, 306, 307, + 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 322, -1, -1, 124, -1, -1, + -1, -1, -1, 93, 94, -1, -1, 299, -1, -1, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, + 322, -1, -1, -1, 124, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, + 272, -1, -1, -1, 302, 303, 304, 305, 306, 307, + 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, -1, -1, -1, 298, 299, 300, 301, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + -1, -1, -1, -1, 37, 38, -1, -1, 41, 42, + 43, 44, 45, -1, 47, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 58, 59, 60, 61, 62, + 63, -1, -1, -1, -1, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, 320, -1, -1, -1, -1, -1, -1, + 93, 94, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, + 320, 124, 37, 38, -1, -1, 41, 42, 43, 44, + 45, -1, 47, 38, -1, -1, 41, -1, 43, 44, + 45, -1, -1, 58, 59, 60, 61, 62, 63, -1, + -1, -1, -1, 58, 59, 60, -1, 62, 63, -1, + 38, -1, -1, 41, -1, 43, 44, 45, -1, -1, + 38, -1, -1, 41, -1, -1, 44, -1, 93, 94, + 58, 59, 60, -1, 62, 63, -1, -1, 93, 94, + 58, 59, 60, -1, 62, 63, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 38, -1, 124, + 41, -1, -1, 44, -1, 93, 94, -1, -1, 124, + -1, -1, -1, -1, -1, 93, 94, 58, 59, 60, + -1, 62, 63, 38, -1, -1, 41, -1, -1, 44, + -1, -1, -1, -1, -1, -1, 124, -1, -1, -1, + -1, -1, -1, 58, 59, 60, 124, 62, 63, -1, + -1, -1, 93, 94, -1, -1, -1, -1, -1, -1, + 38, -1, -1, 41, -1, -1, 44, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 93, 94, + 58, 59, 60, 124, 62, 63, -1, -1, -1, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, -1, 124, + -1, -1, -1, -1, -1, 93, 94, -1, -1, -1, + 38, -1, -1, 41, -1, -1, 44, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 58, 59, 60, -1, 62, 63, 124, 211, 212, 213, + 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 93, 94, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 41, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 124, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 312, 313, 314, 315, 316, 317, + 318, 319, 320, -1, 312, 313, 314, 315, 316, 317, + 318, 319, 320, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 38, -1, -1, 41, -1, -1, 44, -1, -1, -1, + -1, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 58, 59, 60, -1, 62, 63, 38, -1, -1, 41, + -1, -1, 44, -1, -1, -1, -1, 312, 313, 314, + 315, 316, 317, 318, -1, -1, 58, 59, -1, -1, + -1, 63, -1, -1, -1, 93, 94, -1, -1, -1, + -1, -1, -1, 38, 125, -1, 41, -1, -1, 44, + -1, -1, -1, -1, 312, 313, 314, 315, 316, 317, + 318, 93, 94, 58, 59, -1, 124, -1, 63, 38, + -1, -1, 41, -1, -1, 44, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 58, + 59, -1, 124, -1, 63, -1, -1, -1, 93, 94, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 312, 313, 314, 315, 316, 317, + 318, -1, -1, -1, 93, 94, -1, -1, -1, 124, + -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, -1, -1, 145, -1, 124, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 290, 291, 292, -1, -1, + -1, -1, 297, -1, 299, -1, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 290, + 291, 292, -1, -1, -1, -1, 297, -1, 299, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, -1, -1, + -1, -1, -1, -1, 236, -1, -1, -1, -1, -1, + -1, 243, 244, -1, 312, 313, 314, 315, 316, 317, + 318, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 312, 313, 314, 315, 316, -1, -1, -1, -1, -1, + -1, -1, 284, -1, 290, 291, 292, -1, 290, -1, + -1, 297, -1, 299, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 312, 313, 314, + 315, 316, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 312, 313, 314, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 290, + 291, 292, 293, 294, -1, -1, 297, -1, 299, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, + 268, 269, 270, 271, 272, 273, 274, 275, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 290, 291, 292, -1, -1, -1, -1, 297, + -1, 299, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 297, -1, 299, +}; +#define YYFINAL 31 +#ifndef YYDEBUG +#define YYDEBUG 0 +#endif +#define YYMAXTOKEN 324 +#if YYDEBUG +char *hazelParsename[] = { +"end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +"'!'",0,0,0,"'%'","'&'",0,"'('","')'","'*'","'+'","','","'-'","'.'","'/'",0,0,0, +0,0,0,0,0,0,0,"':'","';'","'<'","'='","'>'","'?'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,"'['",0,"']'","'^'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,"'{'","'|'","'}'","'~'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"VOID","BOOL", +"INT","FLOAT","VEC2","VEC3","VEC4","BVEC2","BVEC3","BVEC4","IVEC2","IVEC3", +"IVEC4","MAT2","MAT3","MAT4","SAMPLER2D","SAMPLER3D","SAMPLERCUBE","ATTRIBUTE", +"CONST","UNIFORM","VARYING","BREAK","CONTINUE","DO","FOR","WHILE","IF","ELSE", +"IN","OUT","INOUT","LOW_PRECISION","MEDIUM_PRECISION","HIGH_PRECISION", +"PRECISION","INVARIANT","DISCARD","RETURN","STRUCT","BOOLCONSTANT","IDENTIFIER", +"INTCONSTANT","FLOATCONSTANT","ADD_ASSIGN","SUB_ASSIGN","MUL_ASSIGN", +"DIV_ASSIGN","MOD_ASSIGN","LEFT_ASSIGN","RIGHT_ASSIGN","AND_ASSIGN", +"XOR_ASSIGN","OR_ASSIGN","OR_OP","XOR_OP","AND_OP","EQ_OP","NE_OP","LE_OP", +"GE_OP","LEFT_OP","RIGHT_OP","INC_OP","DEC_OP","UPLUS","UMINUS", +}; +char *hazelParserule[] = { +"$accept : goal", +"goal : translation_unit", +"translation_unit : external_declaration", +"translation_unit : translation_unit external_declaration", +"external_declaration : function_definition", +"external_declaration : declaration", +"function_definition : function_prototype compound_statement_no_new_scope", +"primary_expression : INTCONSTANT", +"primary_expression : FLOATCONSTANT", +"primary_expression : BOOLCONSTANT", +"primary_expression : '(' expression ')'", +"primary_expression : IDENTIFIER", +"postfix_expression : primary_expression", +"postfix_expression : function_call", +"postfix_expression : postfix_expression INC_OP", +"postfix_expression : postfix_expression DEC_OP", +"postfix_expression : postfix_expression '[' integer_expression ']'", +"postfix_expression : postfix_expression '.' IDENTIFIER", +"integer_expression : expression", +"function_call : function_call_body ')'", +"function_call_body : function_call_header_with_parameters", +"function_call_body : function_call_header", +"function_call_header_with_parameters : function_call_header assignment_expression", +"function_call_header_with_parameters : function_call_header_with_parameters ',' assignment_expression", +"function_call_header : function_identifier '('", +"function_identifier : FLOAT", +"function_identifier : INT", +"function_identifier : BOOL", +"function_identifier : VEC2", +"function_identifier : VEC3", +"function_identifier : VEC4", +"function_identifier : BVEC2", +"function_identifier : BVEC3", +"function_identifier : BVEC4", +"function_identifier : IVEC2", +"function_identifier : IVEC3", +"function_identifier : IVEC4", +"function_identifier : MAT2", +"function_identifier : MAT3", +"function_identifier : MAT4", +"function_identifier : IDENTIFIER", +"function_prototype : function_declarator ')'", +"function_declarator : function_header_with_parameters", +"function_declarator : function_header", +"function_header_with_parameters : function_header parameter_declaration", +"function_header_with_parameters : function_header_with_parameters ',' parameter_declaration", +"function_header : fully_specified_type IDENTIFIER '('", +"parameter_declaration : type_qualifier parameter_qualifier parameter_declarator", +"parameter_declaration : parameter_qualifier parameter_declarator", +"parameter_declaration : type_qualifier parameter_qualifier parameter_type_specifier", +"parameter_declaration : parameter_qualifier parameter_type_specifier", +"parameter_declarator : type_specifier IDENTIFIER", +"parameter_declarator : type_specifier IDENTIFIER '[' constant_expression ']'", +"parameter_qualifier : IN", +"parameter_qualifier : OUT", +"parameter_qualifier : INOUT", +"parameter_qualifier :", +"parameter_type_specifier : type_specifier", +"parameter_type_specifier : type_specifier '[' constant_expression ']'", +"unary_expression : postfix_expression", +"unary_expression : INC_OP postfix_expression", +"unary_expression : DEC_OP postfix_expression", +"unary_expression : '+' postfix_expression", +"unary_expression : '-' postfix_expression", +"unary_expression : '~' postfix_expression", +"unary_expression : '!' postfix_expression", +"regular_expression : unary_expression", +"regular_expression : regular_expression '*' regular_expression", +"regular_expression : regular_expression '/' regular_expression", +"regular_expression : regular_expression '%' regular_expression", +"regular_expression : regular_expression '+' regular_expression", +"regular_expression : regular_expression '-' regular_expression", +"regular_expression : regular_expression LEFT_OP regular_expression", +"regular_expression : regular_expression RIGHT_OP regular_expression", +"regular_expression : regular_expression '<' regular_expression", +"regular_expression : regular_expression '>' regular_expression", +"regular_expression : regular_expression LE_OP regular_expression", +"regular_expression : regular_expression GE_OP regular_expression", +"regular_expression : regular_expression EQ_OP regular_expression", +"regular_expression : regular_expression NE_OP regular_expression", +"regular_expression : regular_expression '&' regular_expression", +"regular_expression : regular_expression '^' regular_expression", +"regular_expression : regular_expression '|' regular_expression", +"regular_expression : regular_expression AND_OP regular_expression", +"regular_expression : regular_expression XOR_OP regular_expression", +"regular_expression : regular_expression OR_OP regular_expression", +"conditional_expression : regular_expression", +"conditional_expression : regular_expression '?' expression ':' assignment_expression", +"assignment_expression : conditional_expression", +"assignment_expression : unary_expression assignment_operator assignment_expression", +"assignment_operator : '='", +"assignment_operator : MUL_ASSIGN", +"assignment_operator : DIV_ASSIGN", +"assignment_operator : ADD_ASSIGN", +"assignment_operator : SUB_ASSIGN", +"assignment_operator : MOD_ASSIGN", +"assignment_operator : LEFT_ASSIGN", +"assignment_operator : RIGHT_ASSIGN", +"assignment_operator : AND_ASSIGN", +"assignment_operator : XOR_ASSIGN", +"assignment_operator : OR_ASSIGN", +"expression : assignment_expression", +"expression : expression ',' assignment_expression", +"constant_expression : conditional_expression", +"declaration : function_prototype ';'", +"declaration : init_declarator_list ';'", +"declaration : PRECISION precision_qualifier type_specifier_no_prec ';'", +"init_declarator_list : single_declaration", +"init_declarator_list : init_declarator_list ',' IDENTIFIER", +"init_declarator_list : init_declarator_list ',' IDENTIFIER '[' constant_expression ']'", +"init_declarator_list : init_declarator_list ',' IDENTIFIER '=' initializer", +"single_declaration : fully_specified_type", +"single_declaration : fully_specified_type IDENTIFIER", +"single_declaration : fully_specified_type IDENTIFIER '=' initializer", +"single_declaration : fully_specified_type IDENTIFIER '[' constant_expression ']'", +"single_declaration : INVARIANT IDENTIFIER", +"var_fully_specified_type : fully_specified_type", +"type_qualifier : CONST", +"type_qualifier : VARYING", +"type_qualifier : UNIFORM", +"type_qualifier : ATTRIBUTE", +"type_qualifier : INVARIANT VARYING", +"precision_qualifier : HIGH_PRECISION", +"precision_qualifier : MEDIUM_PRECISION", +"precision_qualifier : LOW_PRECISION", +"var_type_specifier : FLOAT", +"var_type_specifier : INT", +"var_type_specifier : BOOL", +"var_type_specifier : VEC2", +"var_type_specifier : VEC3", +"var_type_specifier : VEC4", +"var_type_specifier : BVEC2", +"var_type_specifier : BVEC3", +"var_type_specifier : BVEC4", +"var_type_specifier : IVEC2", +"var_type_specifier : IVEC3", +"var_type_specifier : IVEC4", +"var_type_specifier : MAT2", +"var_type_specifier : MAT3", +"var_type_specifier : MAT4", +"var_type_specifier : SAMPLER2D", +"var_type_specifier : SAMPLER3D", +"var_type_specifier : SAMPLERCUBE", +"var_type_specifier : struct_specifier", +"var_type_specifier : IDENTIFIER", +"fully_specified_type : type_specifier", +"fully_specified_type : type_qualifier type_specifier", +"type_specifier : type_specifier_no_prec", +"type_specifier : precision_qualifier type_specifier_no_prec", +"type_specifier_no_prec : VOID", +"type_specifier_no_prec : FLOAT", +"type_specifier_no_prec : INT", +"type_specifier_no_prec : BOOL", +"type_specifier_no_prec : VEC2", +"type_specifier_no_prec : VEC3", +"type_specifier_no_prec : VEC4", +"type_specifier_no_prec : BVEC2", +"type_specifier_no_prec : BVEC3", +"type_specifier_no_prec : BVEC4", +"type_specifier_no_prec : IVEC2", +"type_specifier_no_prec : IVEC3", +"type_specifier_no_prec : IVEC4", +"type_specifier_no_prec : MAT2", +"type_specifier_no_prec : MAT3", +"type_specifier_no_prec : MAT4", +"type_specifier_no_prec : SAMPLER2D", +"type_specifier_no_prec : SAMPLER3D", +"type_specifier_no_prec : SAMPLERCUBE", +"type_specifier_no_prec : struct_specifier", +"type_specifier_no_prec : IDENTIFIER", +"struct_specifier : struct_header struct_declaration_list '}'", +"struct_header : STRUCT IDENTIFIER '{'", +"struct_header : STRUCT '{'", +"struct_declaration_list : struct_declaration ';'", +"struct_declaration_list : struct_declaration_list struct_declaration ';'", +"struct_declaration : single_struct_declaration", +"struct_declaration : struct_declaration ',' IDENTIFIER", +"struct_declaration : struct_declaration ',' IDENTIFIER '[' constant_expression ']'", +"single_struct_declaration : type_specifier IDENTIFIER", +"single_struct_declaration : type_specifier IDENTIFIER '[' constant_expression ']'", +"initializer : assignment_expression", +"declaration_statement : declaration", +"statement_no_new_scope : compound_statement_with_scope", +"statement_no_new_scope : simple_statement", +"simple_statement : declaration_statement", +"simple_statement : expression_statement", +"simple_statement : selection_statement", +"simple_statement : iteration_statement", +"simple_statement : jump_statement", +"compound_statement_with_scope : '{' '}'", +"compound_statement_with_scope : '{' statement_list '}'", +"statement_with_scope : compound_statement_no_new_scope", +"statement_with_scope : simple_statement", +"compound_statement_no_new_scope : '{' '}'", +"compound_statement_no_new_scope : '{' statement_list '}'", +"statement_list : statement_no_new_scope", +"statement_list : statement_list statement_no_new_scope", +"expression_statement : ';'", +"expression_statement : expression ';'", +"selection_statement : IF '(' expression ')' selection_rest_statement", +"selection_rest_statement : statement_with_scope ELSE statement_with_scope", +"selection_rest_statement : statement_with_scope", +"condition : expression", +"condition : fully_specified_type IDENTIFIER '=' initializer", +"iteration_statement : WHILE '(' condition ')' statement_no_new_scope", +"iteration_statement : DO statement_with_scope WHILE '(' expression ')' ';'", +"iteration_statement : FOR '(' for_init_statement for_rest_statement ')' statement_no_new_scope", +"for_init_statement : expression_statement", +"for_init_statement : declaration_statement", +"conditionopt : condition", +"conditionopt :", +"for_rest_statement : conditionopt ';'", +"for_rest_statement : conditionopt ';' expression", +"jump_statement : CONTINUE ';'", +"jump_statement : BREAK ';'", +"jump_statement : RETURN ';'", +"jump_statement : RETURN expression ';'", +"jump_statement : DISCARD ';'", +}; +#endif +#if YYDEBUG +#include <stdio.h> +#endif + +/* define the initial stack-sizes */ +#ifdef YYSTACKSIZE +#undef YYMAXDEPTH +#define YYMAXDEPTH YYSTACKSIZE +#else +#ifdef YYMAXDEPTH +#define YYSTACKSIZE YYMAXDEPTH +#else +#define YYSTACKSIZE 500 +#define YYMAXDEPTH 500 +#endif +#endif + +#define YYINITSTACKSIZE 500 + +int yydebug; +int yynerrs; +int yyerrflag; +int yychar; +short *yyssp; +YYSTYPE *yyvsp; +YYSTYPE yyval; +YYSTYPE yylval; + +/* variables for the parser stack */ +static short *yyss; +static short *yysslim; +static YYSTYPE *yyvs; +static int yystacksize; + +void hazelParsePrepare(struct ShaderObjectUnit* ptr, char* src, char* dst) { + assert(ptr != NULL); + pUnit = ptr; + eShaderType = ptr->eShaderType; + pSrcPtr = src; + pDstPtr = dst; + *pDstPtr = '\0'; + iSemError = 0; + iLine = 1; + ES2INTER(SymbolInit)(ptr); + yyclearin; + yyerrok; +} + +int yyerror(char* s) { + ES2INTER(ShaderObjectInfoLogAppend)(pUnit, "ERROR (line %d): %s\n", iLine, s); + yyclearin; + return 1; +} + +#include "ParseLex.inl" +/* allocate initial stack or double stack size, up to YYMAXDEPTH */ +static int yygrowstack(void) +{ + int newsize, i; + short *newss; + YYSTYPE *newvs; + + if ((newsize = yystacksize) == 0) + newsize = YYINITSTACKSIZE; + else if (newsize >= YYMAXDEPTH) + return -1; + else if ((newsize *= 2) > YYMAXDEPTH) + newsize = YYMAXDEPTH; + + i = yyssp - yyss; + newss = (yyss != 0) + ? (short *)realloc(yyss, newsize * sizeof(*newss)) + : (short *)malloc(newsize * sizeof(*newss)); + if (newss == 0) + return -1; + + yyss = newss; + yyssp = newss + i; + newvs = (yyvs != 0) + ? (YYSTYPE *)realloc(yyvs, newsize * sizeof(*newvs)) + : (YYSTYPE *)malloc(newsize * sizeof(*newvs)); + if (newvs == 0) + return -1; + + yyvs = newvs; + yyvsp = newvs + i; + yystacksize = newsize; + yysslim = yyss + newsize - 1; + return 0; +} + +#define YYABORT goto yyabort +#define YYREJECT goto yyabort +#define YYACCEPT goto yyaccept +#define YYERROR goto yyerrlab +int +yyparse(void) +{ + register int yym, yyn, yystate; +#if YYDEBUG + register const char *yys; + + if ((yys = getenv("YYDEBUG")) != 0) + { + yyn = *yys; + if (yyn >= '0' && yyn <= '9') + yydebug = yyn - '0'; + } +#endif + + yynerrs = 0; + yyerrflag = 0; + yychar = YYEMPTY; + + if (yyss == NULL && yygrowstack()) goto yyoverflow; + yyssp = yyss; + yyvsp = yyvs; + *yyssp = yystate = 0; + +yyloop: + if ((yyn = yydefred[yystate]) != 0) goto yyreduce; + if (yychar < 0) + { + if ((yychar = yylex()) < 0) yychar = 0; +#if YYDEBUG + if (yydebug) + { + yys = 0; + if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; + if (!yys) yys = "illegal-symbol"; + printf("%sdebug: state %d, reading %d (%s)\n", + YYPREFIX, yystate, yychar, yys); + } +#endif + } + if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && + yyn <= YYTABLESIZE && yycheck[yyn] == yychar) + { +#if YYDEBUG + if (yydebug) + printf("%sdebug: state %d, shifting to state %d\n", + YYPREFIX, yystate, yytable[yyn]); +#endif + if (yyssp >= yysslim && yygrowstack()) + { + goto yyoverflow; + } + *++yyssp = yystate = yytable[yyn]; + *++yyvsp = yylval; + yychar = YYEMPTY; + if (yyerrflag > 0) --yyerrflag; + goto yyloop; + } + if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && + yyn <= YYTABLESIZE && yycheck[yyn] == yychar) + { + yyn = yytable[yyn]; + goto yyreduce; + } + if (yyerrflag) goto yyinrecovery; + + yyerror("syntax error"); + +#ifdef lint + goto yyerrlab; +#endif + +yyerrlab: + ++yynerrs; + +yyinrecovery: + if (yyerrflag < 3) + { + yyerrflag = 3; + for (;;) + { + if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 && + yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) + { +#if YYDEBUG + if (yydebug) + printf("%sdebug: state %d, error recovery shifting\ + to state %d\n", YYPREFIX, *yyssp, yytable[yyn]); +#endif + if (yyssp >= yysslim && yygrowstack()) + { + goto yyoverflow; + } + *++yyssp = yystate = yytable[yyn]; + *++yyvsp = yylval; + goto yyloop; + } + else + { +#if YYDEBUG + if (yydebug) + printf("%sdebug: error recovery discarding state %d\n", + YYPREFIX, *yyssp); +#endif + if (yyssp <= yyss) goto yyabort; + --yyssp; + --yyvsp; + } + } + } + else + { + if (yychar == 0) goto yyabort; +#if YYDEBUG + if (yydebug) + { + yys = 0; + if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; + if (!yys) yys = "illegal-symbol"; + printf("%sdebug: state %d, error recovery discards token %d (%s)\n", + YYPREFIX, yystate, yychar, yys); + } +#endif + yychar = YYEMPTY; + goto yyloop; + } + +yyreduce: +#if YYDEBUG + if (yydebug) + printf("%sdebug: state %d, reducing by rule %d (%s)\n", + YYPREFIX, yystate, yyn, yyrule[yyn]); +#endif + yym = yylen[yyn]; + if (yym) + yyval = yyvsp[1-yym]; + else + memset(&yyval, 0, sizeof yyval); + switch (yyn) + { +case 1: +{ + strcpy(pDstPtr, yyvsp[0].token.name); + free(yyvsp[0].token.name); + yyvsp[0].token.name = NULL; + } +break; +case 3: +{ MERGE(); } +break; +case 6: +{ + MERGE(); + } +break; +case 10: +{ + MERGE(); + yyval.token.type = yyvsp[-1].token.type; + } +break; +case 11: +{ /* referencing existing identifer*/ + if (strcmp(yyvsp[0].token.name, "gl_MaxFragmentUniformVectors") == 0) { + const char* subst = "(gl_MaxFragmentUniformComponents/4)"; + yyvsp[0].token.name = realloc(yyvsp[0].token.name, strlen(subst) + 1); + strcpy(yyvsp[0].token.name, subst); + } else if (strcmp(yyvsp[0].token.name, "gl_MaxVertexUniformVectors") == 0) { + const char* subst = "(gl_MaxVertexUniformComponents/4)"; + yyvsp[0].token.name = realloc(yyvsp[0].token.name, strlen(subst) + 1); + strcpy(yyvsp[0].token.name, subst); + } else if (strcmp(yyvsp[0].token.name, "gl_MaxVaryingVectors") == 0) { + const char* subst = "(gl_MaxVaryingFloats/4)"; + yyvsp[0].token.name = realloc(yyvsp[0].token.name, strlen(subst) + 1); + strcpy(yyvsp[0].token.name, subst); + } +/* + struct TableEntry* ptr = ES2INTER(SearchSymbol)(pUnit, $1.token.name, NULL); + if (ptr == NULL) { + UNDEFINED($1.token.name); + YYERROR; + } +*/ + MERGE(); +/* + $$.token.type = ptr->type; +*/ + } +break; +case 14: +{ MERGE(); } +break; +case 15: +{ MERGE(); } +break; +case 16: +{ MERGE(); } +break; +case 17: +{ /* FIELD_SELECTION xyzw, rgba, stpq: must be processed*/ +/* + $$.token.type = ES2INTER(ProcSwizzler)($1.token.type, $3.token.name); + if ($$.token.type == 0) { + yyerror("illegal swizzler"); + YYERROR; + } +*/ + MERGE(); + } +break; +case 19: +{ + MERGE(); + } +break; +case 22: +{ + MERGE(); + } +break; +case 23: +{ + MERGE(); + } +break; +case 24: +{ + MERGE(); + } +break; +case 41: +{ MERGE(); } +break; +case 44: +{ MERGE(); } +break; +case 45: +{ MERGE(); } +break; +case 46: +{ + MERGE(); + } +break; +case 47: +{ MERGE(); } +break; +case 48: +{ MERGE(); } +break; +case 49: +{ MERGE(); } +break; +case 50: +{ MERGE(); } +break; +case 51: +{ + MERGE(); + } +break; +case 52: +{ + MERGE(); + } +break; +case 56: +{ + memset(&(yyval.token), 0, sizeof(struct TableEntry)); + yyval.token.name = malloc(1); yyval.token.name[0] = '\0'; + yyval.token.type = S_IN; + } +break; +case 58: +{ MERGE(); } +break; +case 60: +{ MERGE(); yyval.token.type = yyvsp[-1].token.type; } +break; +case 61: +{ MERGE(); yyval.token.type = yyvsp[-1].token.type; } +break; +case 62: +{ MERGE(); yyval.token.type = yyvsp[-1].token.type; } +break; +case 63: +{ MERGE(); yyval.token.type = yyvsp[-1].token.type; } +break; +case 64: +{ FOUND_RESERVED("operator ~"); YYERROR; } +break; +case 65: +{ MERGE(); yyval.token.type = yyvsp[-1].token.type; } +break; +case 67: +{ MERGE(); } +break; +case 68: +{ MERGE(); } +break; +case 69: +{ FOUND_RESERVED("operator %%"); YYERROR; } +break; +case 70: +{ MERGE(); } +break; +case 71: +{ MERGE(); } +break; +case 72: +{ FOUND_RESERVED("operator <<"); YYERROR; } +break; +case 73: +{ FOUND_RESERVED("operator >>"); YYERROR; } +break; +case 74: +{ MERGE(); } +break; +case 75: +{ MERGE(); } +break; +case 76: +{ MERGE(); } +break; +case 77: +{ MERGE(); } +break; +case 78: +{ MERGE(); } +break; +case 79: +{ MERGE(); } +break; +case 80: +{ FOUND_RESERVED("operator &"); YYERROR; } +break; +case 81: +{ FOUND_RESERVED("operator ^"); YYERROR; } +break; +case 82: +{ FOUND_RESERVED("operator |"); YYERROR; } +break; +case 83: +{ MERGE(); } +break; +case 84: +{ MERGE(); } +break; +case 85: +{ MERGE(); } +break; +case 86: +{ MERGE(); } +break; +case 87: +{ MERGE(); } +break; +case 88: +{ MERGE(); } +break; +case 89: +{ MERGE(); } +break; +case 95: +{ FOUND_RESERVED("operator %%="); YYERROR; } +break; +case 96: +{ FOUND_RESERVED("operator <<="); YYERROR; } +break; +case 97: +{ FOUND_RESERVED("operator >>="); YYERROR; } +break; +case 98: +{ FOUND_RESERVED("operator &="); YYERROR; } +break; +case 99: +{ FOUND_RESERVED("operator ^="); YYERROR; } +break; +case 100: +{ FOUND_RESERVED("operator |="); YYERROR; } +break; +case 101: +{ MERGE(); } +break; +case 102: +{ MERGE(); } +break; +case 103: +{ MERGE(); } +break; +case 104: +{ + MERGE(); + } +break; +case 105: +{ MERGE(); } +break; +case 106: +{ + /* ignore the whole statement*/ + FREE(); + memset(&(yyval.token), 0, sizeof(struct TableEntry)); + yyval.token.name = malloc(1); yyval.token.name[0] = '\0'; + } +break; +case 108: +{ /* new identifier*/ + if ((yyvsp[-2].token.type & S_CONST) != 0) { + ERROR("const specifier", yyvsp[-2].token.name); /* const must be initialized*/ + } + if (strncmp(yyvsp[0].token.name, "gl_", 3) == 0) { + FOUND_RESERVED(yyvsp[-1].token.name); + YYERROR; + } + MERGE(); + } +break; +case 109: +{ + if ((yyvsp[-5].token.type & S_CONST) != 0) { + ERROR("const specifier", yyvsp[-5].token.name); + } + if ((yyvsp[-5].token.type & S_ATTRIBUTE) != 0) { + ERROR("attribute specifier", yyvsp[-5].token.name); + } + if (strncmp(yyvsp[-3].token.name, "gl_", 3) == 0) { + FOUND_RESERVED(yyvsp[-4].token.name); + YYERROR; + } + MERGE(); + } +break; +case 110: +{ + if ((yyvsp[-4].token.type & S_UNIFORM) != 0) { + ERROR("uniform specifier", yyvsp[-4].token.name); + } + if (strncmp(yyvsp[-2].token.name, "gl_", 3) == 0) { + FOUND_RESERVED(yyvsp[-3].token.name); + YYERROR; + } + MERGE(); + } +break; +case 112: +{ + switch (GET_TYPE(yyvsp[-1].token.type)) { + case T_BOOL: + case T_BVEC2: + case T_BVEC3: + case T_BVEC4: + case T_INT: + case T_IVEC2: + case T_IVEC3: + case T_IVEC4: + if ((yyvsp[-1].token.type & S_ATTRIBUTE) != 0) { + ERROR("attribute specifier", yyvsp[-1].token.name); + } + if ((yyvsp[-1].token.type & S_VARYING) != 0) { + ERROR("attribute specifier", yyvsp[-1].token.name); + } + break; + } + if ((yyvsp[-1].token.type & S_CONST) != 0) { + ERROR("const specifier", yyvsp[-1].token.name); + } + if (strncmp(yyvsp[0].token.name, "gl_", 3) == 0) { + FOUND_RESERVED(yyvsp[0].token.name); + YYERROR; + } + MERGE(); + yyval.token.type = yyvsp[-1].token.type; + } +break; +case 113: +{ + if ((yyvsp[-3].token.type & S_UNIFORM) != 0) { + ERROR("uniform specifier", yyvsp[-3].token.name); + } + if ((yyvsp[-3].token.type & S_VARYING) != 0) { + ERROR("attribute specifier", yyvsp[-3].token.name); + } + if (strncmp(yyvsp[-2].token.name, "gl_", 3) == 0) { + FOUND_RESERVED(yyvsp[-2].token.name); + YYERROR; + } + MERGE(); + yyval.token.type = yyvsp[-3].token.type; + } +break; +case 114: +{ + if ((yyvsp[-4].token.type & S_CONST) != 0) { + ERROR("const specifier", yyvsp[-4].token.name); + } + if ((yyvsp[-4].token.type & S_ATTRIBUTE) != 0) { + ERROR("attribute specifier", yyvsp[-4].token.name); + } + MERGE(); + yyval.token.type = yyvsp[-4].token.type; + } +break; +case 115: +{ + MERGE(); + yyval.token.type = yyvsp[-1].token.type; + } +break; +case 120: +{ /* Vertex only.*/ + if (eShaderType != GL_VERTEX_SHADER) { + UNSUPPORTED("'attribute' keyword out of vertex shaders"); + YYERROR; + } + MERGE(); + } +break; +case 121: +{ + MERGE(); + yyval.token.type = (yyvsp[-1].token.type | yyvsp[0].token.type); + } +break; +case 144: +{ /* TYPE_NAME*/ + MERGE(); + } +break; +case 146: +{ + MERGE(); + yyval.token.type = (yyvsp[-1].token.type | yyvsp[0].token.type); + } +break; +case 148: +{ + yyval = yyvsp[0]; + free(yyvsp[-1].token.name); + } +break; +case 169: +{ /* TYPE_NAME*/ + MERGE(); + } +break; +case 170: +{ + MERGE(); + } +break; +case 171: +{ /* new identifier*/ + MERGE(); + } +break; +case 172: +{ + MERGE(); + } +break; +case 173: +{ MERGE(); } +break; +case 174: +{ MERGE(); } +break; +case 176: +{ /* new identifier*/ + MERGE(); + } +break; +case 177: +{ /* new identifier*/ + MERGE(); + } +break; +case 178: +{ /* new identifier*/ + MERGE(); + } +break; +case 179: +{ /* new identifier*/ + MERGE(); + } +break; +case 189: +{ MERGE(); } +break; +case 190: +{ MERGE(); } +break; +case 193: +{ MERGE(); } +break; +case 194: +{ MERGE(); } +break; +case 196: +{ MERGE(); } +break; +case 198: +{ MERGE(); } +break; +case 199: +{ MERGE(); } +break; +case 200: +{ MERGE(); } +break; +case 203: +{ + MERGE(); + } +break; +case 204: +{ MERGE(); } +break; +case 205: +{ MERGE(); } +break; +case 206: +{ MERGE(); } +break; +case 210: +{ + memset(&(yyval.token), 0, sizeof(struct TableEntry)); + yyval.token.name = malloc(1); yyval.token.name[0] = '\0'; + } +break; +case 211: +{ MERGE(); } +break; +case 212: +{ MERGE(); } +break; +case 213: +{ MERGE(); } +break; +case 214: +{ MERGE(); } +break; +case 215: +{ MERGE(); } +break; +case 216: +{ MERGE(); } +break; +case 217: +{ /* Fragment shader only.*/ + if (eShaderType != GL_FRAGMENT_SHADER) { + UNSUPPORTED("'discard' keyword out of fragment shaders"); + YYERROR; + } else { + MERGE(); + } + } +break; + } + yyssp -= yym; + yystate = *yyssp; + yyvsp -= yym; + yym = yylhs[yyn]; + if (yystate == 0 && yym == 0) + { +#if YYDEBUG + if (yydebug) + printf("%sdebug: after reduction, shifting from state 0 to\ + state %d\n", YYPREFIX, YYFINAL); +#endif + yystate = YYFINAL; + *++yyssp = YYFINAL; + *++yyvsp = yyval; + if (yychar < 0) + { + if ((yychar = yylex()) < 0) yychar = 0; +#if YYDEBUG + if (yydebug) + { + yys = 0; + if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; + if (!yys) yys = "illegal-symbol"; + printf("%sdebug: state %d, reading %d (%s)\n", + YYPREFIX, YYFINAL, yychar, yys); + } +#endif + } + if (yychar == 0) goto yyaccept; + goto yyloop; + } + if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && + yyn <= YYTABLESIZE && yycheck[yyn] == yystate) + yystate = yytable[yyn]; + else + yystate = yydgoto[yym]; +#if YYDEBUG + if (yydebug) + printf("%sdebug: after reduction, shifting from state %d \ +to state %d\n", YYPREFIX, *yyssp, yystate); +#endif + if (yyssp >= yysslim && yygrowstack()) + { + goto yyoverflow; + } + *++yyssp = yystate; + *++yyvsp = yyval; + goto yyloop; + +yyoverflow: + yyerror("yacc stack overflow"); + +yyabort: + return (1); + +yyaccept: + return (0); +} diff --git a/es_2_0/PrepLex.c b/es_2_0/PrepLex.c new file mode 100755 index 0000000..76d8a2c --- /dev/null +++ b/es_2_0/PrepLex.c @@ -0,0 +1,2836 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#line 3 "PrepLex.c" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define yy_create_buffer hazelPrep_create_buffer +#define yy_delete_buffer hazelPrep_delete_buffer +#define yy_flex_debug hazelPrep_flex_debug +#define yy_init_buffer hazelPrep_init_buffer +#define yy_flush_buffer hazelPrep_flush_buffer +#define yy_load_buffer_state hazelPrep_load_buffer_state +#define yy_switch_to_buffer hazelPrep_switch_to_buffer +#define yyin hazelPrepin +#define yyleng hazelPrepleng +#define yylex hazelPreplex +#define yylineno hazelPreplineno +#define yyout hazelPrepout +#define yyrestart hazelPreprestart +#define yytext hazelPreptext +#define yywrap hazelPrepwrap +#define yyalloc hazelPrepalloc +#define yyrealloc hazelPreprealloc +#define yyfree hazelPrepfree + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 5 +#define YY_FLEX_SUBMINOR_VERSION 35 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +#include <stdio.h> +#include <string.h> +#include <errno.h> +#include <stdlib.h> + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +#include <inttypes.h> +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; +#endif /* ! C99 */ + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#endif /* ! FLEXINT_H */ + +#ifdef __cplusplus + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +/* C99 requires __STDC__ to be defined as 1. */ +#if defined (__STDC__) + +#define YY_USE_CONST + +#endif /* defined (__STDC__) */ +#endif /* ! __cplusplus */ + +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst +#endif + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an unsigned + * integer for use as an array index. If the signed char is negative, + * we want to instead treat it as an 8-bit unsigned char, hence the + * double cast. + */ +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN (yy_start) = 1 + 2 * + +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START (((yy_start) - 1) / 2) +#define YYSTATE YY_START + +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) + +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE hazelPreprestart(hazelPrepin ) + +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#define YY_BUF_SIZE 16384 +#endif + +/* The state buf must be large enough to hold one state per character in the main buffer. + */ +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +extern int hazelPrepleng; + +extern FILE *hazelPrepin, *hazelPrepout; + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + + #define YY_LESS_LINENO(n) + +/* Return all but the first "n" matched characters back to the input stream. */ +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up hazelPreptext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = (yy_hold_char); \ + YY_RESTORE_YY_MORE_OFFSET \ + (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up hazelPreptext again */ \ + } \ + while ( 0 ) + +#define unput(c) yyunput( c, (yytext_ptr) ) + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via hazelPreprestart()), so that the user can continue scanning by + * just pointing hazelPrepin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +/* Stack of input buffers. */ +static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ +static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ +static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + * + * Returns the top of the stack, or NULL. + */ +#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ + ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ + : NULL) + +/* Same as previous macro, but useful when we know that the buffer stack is not + * NULL or when we need an lvalue. For internal use only. + */ +#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] + +/* yy_hold_char holds the character lost when hazelPreptext is formed. */ +static char yy_hold_char; +static int yy_n_chars; /* number of characters read into yy_ch_buf */ +int hazelPrepleng; + +/* Points to current character in buffer. */ +static char *yy_c_buf_p = (char *) 0; +static int yy_init = 0; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ + +/* Flag which is used to allow hazelPrepwrap()'s to do buffer switches + * instead of setting up a fresh hazelPrepin. A bit of a hack ... + */ +static int yy_did_buffer_switch_on_eof; + +void hazelPreprestart (FILE *input_file ); +void hazelPrep_switch_to_buffer (YY_BUFFER_STATE new_buffer ); +YY_BUFFER_STATE hazelPrep_create_buffer (FILE *file,int size ); +void hazelPrep_delete_buffer (YY_BUFFER_STATE b ); +void hazelPrep_flush_buffer (YY_BUFFER_STATE b ); +void hazelPreppush_buffer_state (YY_BUFFER_STATE new_buffer ); +void hazelPreppop_buffer_state (void ); + +static void hazelPrepensure_buffer_stack (void ); +static void hazelPrep_load_buffer_state (void ); +static void hazelPrep_init_buffer (YY_BUFFER_STATE b,FILE *file ); + +#define YY_FLUSH_BUFFER hazelPrep_flush_buffer(YY_CURRENT_BUFFER ) + +YY_BUFFER_STATE hazelPrep_scan_buffer (char *base,yy_size_t size ); +YY_BUFFER_STATE hazelPrep_scan_string (yyconst char *yy_str ); +YY_BUFFER_STATE hazelPrep_scan_bytes (yyconst char *bytes,int len ); + +void *hazelPrepalloc (yy_size_t ); +void *hazelPreprealloc (void *,yy_size_t ); +void hazelPrepfree (void * ); + +#define yy_new_buffer hazelPrep_create_buffer + +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ + hazelPrepensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + hazelPrep_create_buffer(hazelPrepin,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } + +#define yy_set_bol(at_bol) \ + { \ + if ( ! YY_CURRENT_BUFFER ){\ + hazelPrepensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + hazelPrep_create_buffer(hazelPrepin,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } + +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) + +/* Begin user sect3 */ + +typedef unsigned char YY_CHAR; + +FILE *hazelPrepin = (FILE *) 0, *hazelPrepout = (FILE *) 0; + +typedef int yy_state_type; + +extern int hazelPreplineno; + +int hazelPreplineno = 1; + +extern char *hazelPreptext; +#define yytext_ptr hazelPreptext + +static yy_state_type yy_get_previous_state (void ); +static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); +static int yy_get_next_buffer (void ); +static void yy_fatal_error (yyconst char msg[] ); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up hazelPreptext. + */ +#define YY_DO_BEFORE_ACTION \ + (yytext_ptr) = yy_bp; \ + hazelPrepleng = (size_t) (yy_cp - yy_bp); \ + (yy_hold_char) = *yy_cp; \ + *yy_cp = '\0'; \ + (yy_c_buf_p) = yy_cp; + +#define YY_NUM_RULES 30 +#define YY_END_OF_BUFFER 31 +/* This struct is not used in this scanner, + but its presence is necessary. */ +struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static yyconst flex_int16_t yy_accept[310] = + { 0, + 0, 0, 31, 29, 28, 29, 29, 29, 0, 0, + 26, 0, 0, 27, 0, 0, 0, 24, 0, 0, + 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 5, 0, 6, 0, 0, 0, 0, 0, + 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 7, 0, 0, 12, 0, 0, 0, 3, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, + 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 11, 0, 0, 0, 23, + 0, 0, 0, 10, 0, 0, 0, 0, 2, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, + 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, + 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, + 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, + 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 17, 0, 18, + + 0, 0, 0, 0, 16, 0, 0, 16, 0 + } ; + +static yyconst flex_int32_t yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 1, 1, 4, 1, 1, 1, 1, 5, + 6, 1, 1, 1, 1, 1, 1, 7, 8, 9, + 9, 9, 9, 9, 9, 9, 9, 10, 1, 1, + 1, 1, 1, 1, 11, 11, 11, 12, 11, 11, + 13, 11, 11, 11, 11, 14, 11, 11, 11, 11, + 11, 11, 15, 16, 11, 11, 11, 11, 11, 11, + 1, 1, 1, 1, 11, 1, 17, 18, 11, 19, + + 20, 21, 22, 11, 23, 11, 11, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 11, 37, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; + +static yyconst flex_int32_t yy_meta[38] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1 + } ; + +static yyconst flex_int16_t yy_base[345] = + { 0, + 858, 0, 860, 862, 862, 3, 5, 8, 10, 856, + 862, 12, 14, 862, 41, 17, 74, 862, 19, 107, + 27, 22, 32, 44, 35, 855, 862, 20, 54, 30, + 49, 23, 47, 46, 65, 56, 80, 86, 89, 143, + 93, 98, 101, 109, 60, 82, 103, 111, 120, 169, + 114, 115, 123, 121, 127, 133, 156, 154, 158, 161, + 125, 163, 862, 180, 165, 184, 187, 190, 194, 175, + 191, 51, 188, 196, 135, 854, 198, 200, 202, 199, + 204, 177, 211, 237, 213, 224, 226, 228, 230, 853, + 232, 246, 248, 268, 250, 255, 257, 258, 284, 260, + + 243, 214, 274, 262, 276, 300, 288, 278, 289, 295, + 305, 314, 862, 316, 862, 318, 320, 322, 353, 324, + 326, 328, 862, 330, 332, 334, 340, 852, 336, 851, + 311, 363, 290, 850, 203, 338, 343, 346, 348, 849, + 369, 372, 862, 374, 848, 862, 376, 399, 409, 862, + 419, 378, 847, 380, 382, 429, 424, 384, 385, 450, + 460, 387, 441, 470, 455, 482, 492, 389, 488, 862, + 515, 391, 442, 846, 393, 525, 506, 395, 862, 535, + 545, 279, 439, 440, 404, 862, 555, 438, 502, 862, + 486, 845, 844, 862, 843, 565, 444, 446, 862, 575, + + 122, 569, 510, 579, 520, 842, 531, 587, 862, 349, + 233, 521, 595, 841, 862, 604, 614, 540, 561, 549, + 560, 619, 819, 638, 818, 597, 623, 550, 609, 862, + 673, 708, 718, 488, 607, 614, 660, 630, 862, 647, + 632, 648, 651, 862, 818, 632, 643, 638, 641, 684, + 670, 699, 704, 581, 674, 681, 580, 672, 713, 817, + 708, 715, 719, 685, 743, 721, 693, 816, 748, 706, + 730, 729, 731, 753, 760, 741, 737, 743, 765, 862, + 752, 754, 747, 753, 779, 862, 763, 764, 767, 765, + 814, 789, 791, 772, 777, 775, 799, 862, 801, 862, + + 786, 805, 790, 813, 862, 815, 817, 862, 862, 835, + 834, 833, 832, 831, 830, 829, 828, 826, 825, 824, + 823, 822, 821, 820, 810, 798, 777, 773, 739, 726, + 695, 668, 664, 655, 635, 622, 505, 480, 427, 343, + 308, 254, 55, 0 + } ; + +static yyconst flex_int16_t yy_def[345] = + { 0, + 310, 311, 309, 309, 309, 312, 313, 314, 312, 315, + 309, 312, 313, 309, 314, 314, 316, 309, 314, 314, + 314, 314, 314, 314, 314, 316, 309, 316, 316, 316, + 316, 316, 316, 316, 314, 314, 314, 314, 314, 314, + 314, 314, 314, 314, 316, 316, 316, 316, 316, 316, + 316, 316, 316, 316, 314, 314, 314, 314, 314, 314, + 317, 318, 309, 314, 314, 314, 314, 314, 314, 316, + 316, 316, 316, 316, 316, 318, 316, 316, 316, 316, + 316, 316, 314, 314, 314, 314, 314, 314, 317, 318, + 318, 314, 314, 314, 314, 314, 314, 316, 316, 316, + + 316, 316, 316, 316, 316, 316, 316, 316, 316, 314, + 319, 320, 309, 316, 309, 314, 321, 314, 314, 314, + 322, 323, 309, 314, 314, 314, 316, 320, 316, 324, + 316, 316, 316, 323, 316, 316, 316, 314, 319, 320, + 320, 316, 309, 321, 324, 309, 314, 314, 325, 309, + 314, 322, 323, 323, 326, 327, 314, 316, 316, 316, + 316, 328, 316, 329, 314, 330, 331, 326, 328, 309, + 332, 333, 316, 328, 334, 335, 314, 316, 309, 330, + 336, 328, 328, 328, 316, 309, 332, 333, 334, 309, + 316, 334, 337, 309, 338, 335, 339, 316, 309, 336, + + 328, 328, 328, 334, 340, 338, 339, 341, 309, 328, + 328, 328, 334, 340, 309, 342, 342, 328, 328, 328, + 334, 340, 217, 343, 217, 328, 328, 328, 334, 309, + 343, 344, 344, 233, 233, 233, 217, 328, 309, 328, + 328, 328, 340, 309, 233, 233, 233, 233, 233, 340, + 231, 328, 328, 328, 233, 233, 233, 233, 231, 233, + 233, 233, 233, 328, 328, 233, 233, 233, 233, 233, + 233, 233, 233, 328, 328, 233, 233, 233, 340, 309, + 233, 233, 233, 233, 328, 309, 233, 233, 233, 233, + 233, 233, 233, 233, 233, 233, 340, 309, 340, 309, + + 233, 233, 233, 340, 309, 233, 340, 309, 0, 309, + 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, + 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, + 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, + 309, 309, 309, 309 + } ; + +static yyconst flex_int16_t yy_nxt[900] = + { 0, + 245, 7, 5, 8, 10, 11, 13, 14, 15, 17, + 18, 10, 11, 10, 11, 13, 14, 15, 26, 27, + 26, 27, 27, 26, 27, 27, 19, 20, 26, 27, + 21, 22, 27, 26, 27, 23, 26, 27, 35, 45, + 24, 25, 17, 18, 41, 26, 27, 40, 27, 27, + 50, 27, 52, 27, 44, 232, 27, 26, 27, 19, + 20, 42, 27, 21, 22, 54, 26, 27, 23, 43, + 100, 51, 53, 24, 25, 17, 18, 46, 56, 47, + 70, 26, 27, 48, 27, 55, 57, 26, 27, 49, + 26, 27, 28, 29, 26, 27, 30, 31, 58, 26, + + 27, 32, 26, 27, 71, 27, 33, 34, 26, 27, + 26, 27, 72, 27, 67, 59, 27, 27, 66, 68, + 60, 73, 27, 27, 170, 27, 90, 63, 26, 27, + 36, 80, 37, 210, 26, 27, 38, 27, 69, 79, + 74, 81, 39, 61, 62, 63, 61, 61, 61, 83, + 82, 75, 61, 84, 103, 26, 27, 26, 27, 26, + 27, 64, 26, 27, 91, 63, 26, 27, 65, 76, + 62, 63, 76, 76, 76, 85, 86, 27, 76, 27, + 88, 26, 27, 93, 87, 26, 27, 77, 26, 27, + 27, 26, 27, 27, 78, 26, 27, 98, 27, 92, + + 27, 27, 27, 94, 27, 27, 27, 109, 95, 96, + 101, 99, 26, 27, 114, 115, 27, 104, 105, 162, + 107, 106, 102, 108, 97, 26, 27, 26, 27, 26, + 27, 90, 63, 91, 63, 170, 110, 111, 112, 113, + 111, 111, 111, 130, 116, 27, 111, 26, 27, 26, + 27, 26, 27, 118, 223, 117, 26, 27, 26, 27, + 27, 114, 115, 129, 27, 219, 119, 120, 121, 122, + 123, 121, 121, 121, 124, 125, 27, 121, 27, 126, + 27, 170, 132, 127, 128, 112, 113, 128, 128, 128, + 27, 27, 27, 128, 201, 133, 26, 27, 136, 131, + + 134, 122, 123, 134, 134, 134, 140, 113, 216, 134, + 161, 137, 135, 27, 138, 141, 113, 114, 115, 142, + 143, 145, 146, 26, 27, 26, 27, 153, 123, 154, + 123, 26, 27, 156, 27, 26, 27, 142, 143, 156, + 27, 159, 27, 214, 151, 27, 155, 164, 27, 140, + 113, 170, 147, 148, 149, 150, 148, 148, 148, 158, + 157, 218, 148, 160, 149, 150, 160, 160, 160, 163, + 141, 113, 160, 142, 143, 145, 146, 26, 27, 153, + 123, 154, 123, 169, 170, 164, 27, 27, 169, 170, + 174, 170, 189, 190, 189, 190, 178, 179, 165, 148, + + 160, 150, 148, 148, 148, 185, 186, 173, 148, 160, + 149, 150, 160, 160, 160, 26, 26, 26, 160, 148, + 167, 150, 148, 148, 148, 26, 27, 207, 148, 26, + 156, 27, 26, 26, 26, 26, 26, 26, 26, 192, + 190, 170, 170, 27, 27, 208, 209, 198, 199, 172, + 160, 160, 150, 160, 160, 160, 26, 27, 202, 160, + 160, 167, 150, 160, 160, 160, 175, 203, 191, 160, + 26, 164, 27, 26, 26, 26, 26, 26, 26, 26, + 206, 177, 26, 178, 179, 26, 26, 26, 27, 169, + 170, 26, 160, 167, 150, 160, 160, 160, 26, 26, + + 26, 160, 182, 189, 190, 193, 183, 26, 27, 204, + 245, 205, 170, 247, 184, 26, 185, 186, 26, 26, + 26, 208, 209, 170, 26, 193, 193, 194, 193, 195, + 193, 197, 214, 209, 193, 26, 178, 179, 26, 26, + 26, 212, 170, 220, 26, 26, 198, 199, 26, 26, + 26, 170, 170, 226, 26, 26, 185, 186, 26, 26, + 26, 229, 230, 170, 26, 193, 193, 194, 193, 195, + 193, 170, 242, 228, 193, 26, 198, 199, 26, 26, + 26, 190, 227, 170, 26, 213, 211, 214, 208, 209, + 214, 214, 214, 214, 214, 214, 214, 190, 238, 239, + + 227, 221, 245, 217, 214, 222, 209, 214, 214, 214, + 229, 230, 268, 224, 214, 222, 209, 214, 214, 214, + 222, 209, 200, 224, 240, 170, 248, 241, 224, 245, + 249, 238, 239, 252, 170, 196, 245, 225, 214, 231, + 209, 214, 214, 214, 214, 214, 214, 214, 240, 170, + 170, 241, 243, 244, 245, 192, 233, 234, 253, 256, + 245, 250, 255, 245, 188, 245, 257, 235, 187, 251, + 258, 259, 236, 214, 231, 209, 214, 214, 214, 214, + 214, 214, 214, 223, 254, 250, 209, 170, 260, 261, + 266, 233, 234, 251, 245, 181, 245, 269, 267, 262, + + 252, 170, 235, 245, 263, 265, 170, 236, 214, 243, + 244, 214, 214, 214, 259, 245, 277, 214, 214, 243, + 244, 214, 214, 214, 264, 253, 180, 214, 245, 265, + 245, 260, 261, 271, 272, 273, 281, 245, 276, 176, + 246, 245, 262, 245, 274, 170, 282, 263, 275, 279, + 280, 245, 245, 245, 274, 170, 269, 283, 275, 245, + 284, 285, 286, 245, 287, 245, 279, 280, 289, 245, + 245, 290, 288, 174, 245, 245, 245, 171, 292, 291, + 285, 286, 269, 293, 294, 245, 245, 245, 295, 245, + 297, 298, 299, 300, 245, 301, 302, 245, 168, 245, + + 297, 298, 299, 300, 303, 292, 304, 305, 245, 306, + 166, 245, 245, 245, 304, 305, 307, 308, 307, 308, + 145, 153, 152, 144, 140, 139, 90, 245, 89, 26, + 10, 16, 12, 9, 6, 4, 296, 245, 278, 270, + 245, 237, 223, 209, 215, 194, 194, 190, 170, 123, + 146, 113, 123, 146, 113, 63, 63, 27, 11, 309, + 5, 3, 309, 309, 309, 309, 309, 309, 309, 309, + 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, + 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, + 309, 309, 309, 309, 309, 309, 309, 309, 309 + + } ; + +static yyconst flex_int16_t yy_chk[900] = + { 0, + 344, 2, 2, 2, 6, 6, 7, 7, 7, 8, + 8, 9, 9, 12, 12, 13, 13, 13, 16, 16, + 19, 19, 28, 22, 22, 32, 8, 8, 21, 21, + 8, 8, 30, 23, 23, 8, 25, 25, 19, 28, + 8, 8, 15, 15, 22, 24, 24, 21, 34, 33, + 30, 31, 32, 72, 25, 343, 29, 36, 36, 15, + 15, 23, 45, 15, 15, 34, 35, 35, 15, 24, + 72, 31, 33, 15, 15, 17, 17, 29, 36, 29, + 45, 37, 37, 29, 46, 35, 36, 38, 38, 29, + 39, 39, 17, 17, 41, 41, 17, 17, 37, 42, + + 42, 17, 43, 43, 46, 47, 17, 17, 20, 20, + 44, 44, 46, 48, 42, 38, 51, 52, 41, 43, + 39, 47, 49, 54, 201, 53, 61, 61, 55, 55, + 20, 52, 20, 201, 56, 56, 20, 75, 44, 51, + 48, 53, 20, 40, 40, 40, 40, 40, 40, 55, + 54, 49, 40, 56, 75, 58, 58, 57, 57, 59, + 59, 40, 60, 60, 62, 62, 65, 65, 40, 50, + 50, 50, 50, 50, 50, 57, 58, 70, 50, 82, + 60, 64, 64, 65, 59, 66, 66, 50, 67, 67, + 73, 68, 68, 71, 50, 69, 69, 70, 74, 64, + + 77, 80, 78, 66, 79, 135, 81, 82, 67, 68, + 73, 71, 83, 83, 85, 85, 102, 77, 78, 135, + 80, 79, 74, 81, 69, 86, 86, 87, 87, 88, + 88, 89, 89, 91, 91, 211, 83, 84, 84, 84, + 84, 84, 84, 102, 86, 101, 84, 92, 92, 93, + 93, 95, 95, 88, 342, 87, 96, 96, 97, 97, + 98, 100, 100, 101, 104, 211, 92, 93, 94, 94, + 94, 94, 94, 94, 95, 96, 103, 94, 105, 97, + 108, 182, 104, 98, 99, 99, 99, 99, 99, 99, + 107, 109, 133, 99, 182, 105, 110, 110, 108, 103, + + 106, 106, 106, 106, 106, 106, 111, 111, 341, 106, + 133, 109, 107, 131, 110, 112, 112, 114, 114, 116, + 116, 117, 117, 118, 118, 120, 120, 121, 121, 122, + 122, 124, 124, 125, 125, 126, 126, 129, 129, 136, + 136, 131, 127, 340, 120, 137, 124, 138, 138, 139, + 139, 210, 118, 119, 119, 119, 119, 119, 119, 127, + 126, 210, 119, 132, 132, 132, 132, 132, 132, 137, + 141, 141, 132, 142, 142, 144, 144, 147, 147, 152, + 152, 154, 154, 155, 155, 158, 158, 159, 162, 162, + 168, 168, 172, 172, 175, 175, 178, 178, 147, 148, + + 148, 148, 148, 148, 148, 185, 185, 159, 148, 149, + 149, 149, 149, 149, 149, 149, 149, 149, 149, 151, + 151, 151, 151, 151, 151, 157, 157, 339, 151, 156, + 156, 156, 156, 156, 156, 156, 156, 156, 156, 188, + 188, 183, 184, 163, 173, 197, 197, 198, 198, 157, + 160, 160, 160, 160, 160, 160, 165, 165, 183, 160, + 161, 161, 161, 161, 161, 161, 163, 184, 173, 161, + 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, + 338, 165, 166, 166, 166, 166, 166, 166, 191, 169, + 169, 166, 167, 167, 167, 167, 167, 167, 167, 167, + + 167, 167, 169, 189, 189, 337, 169, 177, 177, 189, + 234, 191, 203, 234, 169, 171, 171, 171, 171, 171, + 171, 205, 205, 212, 171, 176, 176, 176, 176, 176, + 176, 177, 207, 207, 176, 180, 180, 180, 180, 180, + 180, 203, 218, 212, 180, 181, 181, 181, 181, 181, + 181, 220, 228, 218, 181, 187, 187, 187, 187, 187, + 187, 221, 221, 219, 187, 196, 196, 196, 196, 196, + 196, 202, 228, 220, 196, 200, 200, 200, 200, 200, + 200, 204, 219, 254, 200, 204, 202, 208, 208, 208, + 208, 208, 208, 208, 208, 208, 208, 213, 226, 226, + + 254, 213, 257, 208, 216, 216, 216, 216, 216, 216, + 229, 229, 257, 216, 217, 217, 217, 217, 217, 217, + 222, 222, 336, 217, 227, 227, 235, 227, 222, 235, + 236, 238, 238, 241, 241, 335, 236, 217, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, 240, 240, + 242, 240, 243, 243, 246, 334, 224, 224, 241, 247, + 248, 237, 246, 249, 333, 247, 248, 224, 332, 237, + 249, 251, 224, 231, 231, 231, 231, 231, 231, 231, + 231, 231, 231, 237, 242, 250, 250, 264, 251, 251, + 255, 231, 231, 250, 258, 331, 255, 258, 256, 251, + + 252, 252, 231, 256, 251, 264, 253, 231, 232, 232, + 232, 232, 232, 232, 259, 267, 267, 232, 233, 233, + 233, 233, 233, 233, 253, 252, 330, 233, 270, 253, + 261, 259, 259, 261, 262, 263, 270, 262, 266, 329, + 233, 263, 259, 266, 265, 265, 271, 259, 265, 269, + 269, 272, 271, 273, 274, 274, 277, 272, 274, 277, + 273, 275, 275, 276, 276, 278, 279, 279, 281, 283, + 269, 282, 278, 328, 281, 284, 282, 327, 284, 283, + 285, 285, 287, 288, 289, 287, 288, 290, 290, 289, + 292, 292, 293, 293, 294, 294, 295, 296, 326, 295, + + 297, 297, 299, 299, 296, 301, 302, 302, 301, 303, + 325, 292, 303, 293, 304, 304, 306, 306, 307, 307, + 324, 323, 322, 321, 320, 319, 318, 302, 317, 316, + 315, 314, 313, 312, 311, 310, 291, 306, 268, 260, + 245, 225, 223, 214, 206, 195, 193, 192, 174, 153, + 145, 140, 134, 130, 128, 90, 76, 26, 10, 3, + 1, 309, 309, 309, 309, 309, 309, 309, 309, 309, + 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, + 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, + 309, 309, 309, 309, 309, 309, 309, 309, 309 + + } ; + +static yy_state_type yy_last_accepting_state; +static char *yy_last_accepting_cpos; + +extern int hazelPrep_flex_debug; +int hazelPrep_flex_debug = 0; + +/* The intent behind this definition is that it'll catch + * any uses of REJECT which flex missed. + */ +#define REJECT reject_used_but_not_detected +#define yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +char *hazelPreptext; +#include "es2front.h" +#include <ctype.h> + +/* hooking for EvalLex and EvalYacc */ +extern void hazelEvalPrepare(char* ptr); +extern int hazelEvalparse(void); +extern int hazelEvalGetResult(int* pEvalA, int* pEvalB); +extern void hazelEvalTerminate(void); + +extern int hazelEnableTexture3D; + +static struct ShaderObjectUnit* pUnit; +static int iIndex; +static char* pSrcPtr; + +static char strBuf[32]; +static int iFILE = 0; +static int iLINE = 1; +static int iState = 0; +static int iErrorCode = 0; +static int bOutputed = 0; +static int delayed_newline = 0; + +static int ifStack[128]; +static int ifStackTop = -1; +enum { + STATE_FALSE_PARENT = 1, + STATE_TRUE_AFTER_IF = 2, + STATE_FALSE_AFTER_ELIF = 3, + STATE_FALSE_AFTER_ELSE = 4, + STATE_FALSE_AFTER_IF = 5, + STATE_TRUE_AFTER_ELSE = 6, +}; + +static int VALID_STACK_TOP(void) { + return ((-1 <= ifStackTop) + && (ifStackTop < (int)(sizeof(ifStack) / sizeof(ifStack[0])))) ? GL_TRUE : GL_FALSE; +} + +static int IN_TRUE_SECTION(void) { + int i; + assert(VALID_STACK_TOP() == GL_TRUE); + if (ifStackTop < 0) { + return GL_TRUE; + } + for (i = ifStackTop; i >= 0; i--) { + if ((ifStack[i] == STATE_FALSE_PARENT) + || (ifStack[i] == STATE_FALSE_AFTER_ELIF) + || (ifStack[i] == STATE_FALSE_AFTER_ELSE) + || (ifStack[i] == STATE_FALSE_AFTER_IF)) return GL_FALSE; + } + return GL_TRUE; +} + +int hazelPrepGetError(void) { + return iErrorCode; +} + +void hazelPrepPrepare(struct ShaderObjectUnit* pShaderObject) { + assert(pShaderObject->nSourceUsed > 0); + pUnit = pShaderObject; + iIndex = 0; + pSrcPtr = pUnit->aStrSource[iIndex]; + iFILE = 0; + iLINE = 0; + iState = 0; + iErrorCode = 0; + bOutputed = 0; + delayed_newline = 0; + ifStackTop = -1; +} + +extern int hazelPreplex_destroy(void); + +void hazelPrepTerminate(void) { + hazelPreplex_destroy(); +} + +static void OUTPUT(const char* str, int len) { + ES2INTER(ShaderObjectPrepedAppend)(pUnit, str, len); +} + +static int hazelPrepwrap(void) { + iIndex++; + if (iIndex >= pUnit->nSourceUsed) { + if (iState != 0) { + ES2INTER(ShaderObjectInfoLogAppend)(pUnit, "ERROR: unexpected EOF"); + iErrorCode = 1; + } + return 1; + } + pSrcPtr = pUnit->aStrSource[iIndex]; + iFILE++; + iLINE = 0; + return 0; +} + +#define PUTCHAR(c) (*dst++ = c, num++) +#define PUTLINE(c) (*dst++ = c, iLINE++, num++) + +static int INPUT(char* dst) { + int num = 0; + int c; + while (1) { + do { + c = *pSrcPtr++; + } while (c == '\r'); + if (c == '\0') { + return YY_NULL; + } + switch (iState) { + case 0: + if (c == '/') { iState = 1; } + else if (c == '\\') { iState = 5; } + else if (c == '\n') { + while (delayed_newline > 0) { delayed_newline--; PUTLINE('\n'); } + PUTLINE('\n'); iState = 0; return num; + } else { PUTCHAR(c); iState = 0; return num; } + break; + case 1: + if (c == '*') { iState = 2; } + else if (c == '/') { iState = 4; } + else { PUTCHAR('/'); PUTCHAR(c); iState = 0; return num; } + break; + case 2: + if (c == '*') { iState = 3; } + else if (c == '\n') { delayed_newline++; iState = 2; } + else { iState = 2; } + break; + case 3: + if (c == '/') { PUTCHAR(' '); iState = 0; return num; } + else { iState = 2; } + break; + case 4: + if (c == '\n') { PUTLINE('\n'); iState = 0; return num; } + else { iState = 4; } + break; + case 5: + if (c == '\n') { delayed_newline++; iState = 0; } + else { PUTCHAR('\\'); PUTCHAR(c); iState = 0; return num; } + break; + } + } +} + +#undef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + { \ + result = INPUT(buf); \ + } + +#define INITIAL 0 + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +static int yy_init_globals (void ); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int hazelPreplex_destroy (void ); + +int hazelPrepget_debug (void ); + +void hazelPrepset_debug (int debug_flag ); + +YY_EXTRA_TYPE hazelPrepget_extra (void ); + +void hazelPrepset_extra (YY_EXTRA_TYPE user_defined ); + +FILE *hazelPrepget_in (void ); + +void hazelPrepset_in (FILE * in_str ); + +FILE *hazelPrepget_out (void ); + +void hazelPrepset_out (FILE * out_str ); + +int hazelPrepget_leng (void ); + +char *hazelPrepget_text (void ); + +int hazelPrepget_lineno (void ); + +void hazelPrepset_lineno (int line_number ); + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int hazelPrepwrap (void ); +#else +extern int hazelPrepwrap (void ); +#endif +#endif + + static void yyunput (int c,char *buf_ptr ); + +#ifndef yytext_ptr +static void yy_flex_strncpy (char *,yyconst char *,int ); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (yyconst char * ); +#endif + +#ifndef YY_NO_INPUT + +#ifdef __cplusplus +static int yyinput (void ); +#else +static int input (void ); +#endif + +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#define YY_READ_BUF_SIZE 8192 +#endif + +/* Copy whatever the last rule matched to the standard output. */ +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO fwrite( hazelPreptext, hazelPrepleng, 1, hazelPrepout ) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ + { \ + int c = '*'; \ + unsigned n; \ + for ( n = 0; n < max_size && \ + (c = getc( hazelPrepin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( hazelPrepin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else \ + { \ + errno=0; \ + while ( (result = fread(buf, 1, max_size, hazelPrepin))==0 && ferror(hazelPrepin)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(hazelPrepin); \ + } \ + }\ +\ + +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) +#endif + +/* end tables serialization structures and prototypes */ + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 + +extern int hazelPreplex (void); + +#define YY_DECL int hazelPreplex (void) +#endif /* !YY_DECL */ + +/* Code executed at the beginning of each rule, after hazelPreptext and hazelPrepleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK break; +#endif + +#define YY_RULE_SETUP \ + if ( hazelPrepleng > 0 ) \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ + (hazelPreptext[hazelPrepleng - 1] == '\n'); \ + YY_USER_ACTION + +/** The main scanner function which does all the work. + */ +YY_DECL +{ + register yy_state_type yy_current_state; + register char *yy_cp, *yy_bp; + register int yy_act; + + /* #ifdef, #ifndef ---------------------------------------------- */ + + if ( !(yy_init) ) + { + (yy_init) = 1; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! (yy_start) ) + (yy_start) = 1; /* first start state */ + + if ( ! hazelPrepin ) + hazelPrepin = stdin; + + if ( ! hazelPrepout ) + hazelPrepout = stdout; + + if ( ! YY_CURRENT_BUFFER ) { + hazelPrepensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + hazelPrep_create_buffer(hazelPrepin,YY_BUF_SIZE ); + } + + hazelPrep_load_buffer_state( ); + } + + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = (yy_c_buf_p); + + /* Support of hazelPreptext. */ + *yy_cp = (yy_hold_char); + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = (yy_start); + yy_current_state += YY_AT_BOL(); +yy_match: + do + { + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 310 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + ++yy_cp; + } + while ( yy_base[yy_current_state] != 862 ); + +yy_find_action: + yy_act = yy_accept[yy_current_state]; + if ( yy_act == 0 ) + { /* have to back up */ + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + yy_act = yy_accept[yy_current_state]; + } + + YY_DO_BEFORE_ACTION; + +do_action: /* This label is used only to access EOF actions. */ + + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = (yy_hold_char); + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + goto yy_find_action; + +case 1: +*yy_cp = (yy_hold_char); /* undo effects of setting up hazelPreptext */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up hazelPreptext again */ +YY_RULE_SETUP +{ + char* ptr = hazelPreptext; + char* qtr; + int n = 0; + int state; + if (IN_TRUE_SECTION() == GL_TRUE) { + while (n++ < 2) { while (*ptr++ != 'f') ; } + while (*ptr == ' ' || *ptr == '\t') ptr++; + for (qtr = ptr + 1; *qtr == '_' || isalnum(*qtr); qtr++) ; + *qtr = '\0'; + state = + (ES2INTER(MacroSearchMacro)(ptr) != NULL) ? STATE_TRUE_AFTER_IF : STATE_FALSE_AFTER_IF; + } else { + state = STATE_FALSE_PARENT; + } + ifStack[++ifStackTop] = state; + assert(VALID_STACK_TOP() == GL_TRUE); + bOutputed = 1; +} + YY_BREAK +case 2: +*yy_cp = (yy_hold_char); /* undo effects of setting up hazelPreptext */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up hazelPreptext again */ +YY_RULE_SETUP +{ + char* ptr = hazelPreptext; + char* qtr; + int n = 0; + int state; + if (IN_TRUE_SECTION() == GL_TRUE) { + while (n++ < 2) { while (*ptr++ != 'f') ; } + while (*ptr == ' ' || *ptr == '\t') ptr++; + for (qtr = ptr + 1; *qtr == '_' || isalnum(*qtr); qtr++) ; + *qtr = '\0'; + state = + (ES2INTER(MacroSearchMacro)(ptr) == NULL) ? STATE_TRUE_AFTER_IF : STATE_FALSE_AFTER_IF; + } else { + state = STATE_FALSE_PARENT; + } + ifStack[++ifStackTop] = state; + assert(VALID_STACK_TOP() == GL_TRUE); + bOutputed = 1; +} + YY_BREAK +case 3: +*yy_cp = (yy_hold_char); /* undo effects of setting up hazelPreptext */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up hazelPreptext again */ +YY_RULE_SETUP +{ + if (IN_TRUE_SECTION() == GL_TRUE) { + ES2INTER(ShaderObjectInfoLogAppend)(pUnit, + "ERROR (line %d, file %d): #ifdef/#ifndef: syntax error\n", iLINE, iFILE); + iErrorCode = 1; + } else { + ifStack[++ifStackTop] = STATE_FALSE_PARENT; + } + assert(VALID_STACK_TOP() == GL_TRUE); + bOutputed = 1; +} + YY_BREAK +/* #if ---------------------------------------------------------- */ +case 4: +*yy_cp = (yy_hold_char); /* undo effects of setting up hazelPreptext */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up hazelPreptext again */ +YY_RULE_SETUP +{ + char* ptr = hazelPreptext; + char* qtr = &(hazelPreptext[hazelPrepleng-1]); + char* expanded; + int evalA = GL_FALSE; + int evalB = GL_FALSE; + int state; + if (IN_TRUE_SECTION() == GL_TRUE) { + while (*qtr == ' ' || *qtr == '\t') *qtr-- = '\0'; + while (*ptr++ != 'f') ; + while (*ptr == ' ' || *ptr == '\t') ptr++; + if (ptr > qtr) { + ES2INTER(ShaderObjectInfoLogAppend)(pUnit, + "ERROR (line %d, file %d): #if: syntax error\n", iLINE, iFILE); + iErrorCode = 1; + state = STATE_FALSE_AFTER_IF; + } else { + ES2INTER(MacroSetLineFile)(iLINE, iFILE); + expanded = ES2INTER(MacroExpand)(ptr, 1); + hazelEvalPrepare(expanded); + if (expanded == NULL + || hazelEvalparse() != 0 + || hazelEvalGetResult(&evalA, &evalB) != 1) { + ES2INTER(ShaderObjectInfoLogAppend)(pUnit, + "ERROR (line %d, file %d): #if: expression parsing error.\n", iLINE, iFILE); + iErrorCode = 1; + evalA = GL_FALSE; + } + hazelEvalTerminate(); + state = (evalA == GL_FALSE) ? STATE_FALSE_AFTER_IF : STATE_TRUE_AFTER_IF; + } + } else { + state = STATE_FALSE_PARENT; + } + ifStack[++ifStackTop] = state; + assert(VALID_STACK_TOP() == GL_TRUE); + bOutputed = 1; +} + YY_BREAK +/* #elif -------------------------------------------------------- */ +case 5: +*yy_cp = (yy_hold_char); /* undo effects of setting up hazelPreptext */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up hazelPreptext again */ +YY_RULE_SETUP +{ + char* ptr = hazelPreptext; + char* qtr = &(hazelPreptext[hazelPrepleng-1]); + char* expanded; + int evalA = GL_FALSE; + int evalB = GL_FALSE; + int state; + if (ifStackTop < 0 || (! VALID_STACK_TOP())) { + ES2INTER(ShaderObjectInfoLogAppend)(pUnit, + "ERROR (line %d, file %d): #elif: dangling elif\n", iLINE, iFILE); + iErrorCode = 1; + } else if (ifStack[ifStackTop] == STATE_FALSE_AFTER_IF) { + while (*qtr == ' ' || *qtr == '\t') *qtr-- = '\0'; + while (*ptr++ != 'f') ; + while (*ptr == ' ' || *ptr == '\t') ptr++; + if (ptr > qtr) { + ES2INTER(ShaderObjectInfoLogAppend)(pUnit, + "ERROR (line %d, file %d): #elif: syntax error\n", iLINE, iFILE); + iErrorCode = 1; + } else { + ES2INTER(MacroSetLineFile)(iLINE, iFILE); + expanded = ES2INTER(MacroExpand)(ptr, 1); + hazelEvalPrepare(expanded); + if (expanded == NULL + || hazelEvalparse() != 0 + || hazelEvalGetResult(&evalA, &evalB) != 1) { + ES2INTER(ShaderObjectInfoLogAppend)(pUnit, + "ERROR (line %d, file %d): #elif: expression parsing error.\n", iLINE, iFILE); + iErrorCode = 1; + evalA = GL_FALSE; + } + } + } + switch (ifStack[ifStackTop]) { + case STATE_FALSE_PARENT: + break; + case STATE_TRUE_AFTER_IF: + ifStack[ifStackTop] = STATE_FALSE_AFTER_ELIF; + break; + case STATE_FALSE_AFTER_IF: + ifStack[ifStackTop] = (evalA == GL_FALSE) ? STATE_FALSE_AFTER_IF : STATE_TRUE_AFTER_IF; + break; + default: + ES2INTER(ShaderObjectInfoLogAppend)(pUnit, + "ERROR (line %d, file %d): #elif: illegal elif .\n", iLINE, iFILE); + iErrorCode = 1; + break; + } + bOutputed = 1; +} + YY_BREAK +/* #else -------------------------------------------------------- */ +case 6: +*yy_cp = (yy_hold_char); /* undo effects of setting up hazelPreptext */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up hazelPreptext again */ +YY_RULE_SETUP +{ + if (ifStackTop < 0 || (! VALID_STACK_TOP())) { + ES2INTER(ShaderObjectInfoLogAppend)(pUnit, + "ERROR (line %d, file %d): #else: dangling else\n", iLINE, iFILE); + iErrorCode = 1; + } else { + switch (ifStack[ifStackTop]) { + case STATE_FALSE_PARENT: + break; + case STATE_TRUE_AFTER_IF: + ifStack[ifStackTop] = STATE_FALSE_AFTER_ELSE; + break; + case STATE_FALSE_AFTER_ELIF: + ifStack[ifStackTop] = STATE_FALSE_AFTER_ELSE; + break; + case STATE_FALSE_AFTER_IF: + ifStack[ifStackTop] = STATE_TRUE_AFTER_ELSE; + break; + default: + ES2INTER(ShaderObjectInfoLogAppend)(pUnit, + "ERROR (line %d, file %d): #else: illegal else\n", iLINE, iFILE); + iErrorCode = 1; + break; + } + } + bOutputed = 1; +} + YY_BREAK +/* #endif ------------------------------------------------------- */ +case 7: +*yy_cp = (yy_hold_char); /* undo effects of setting up hazelPreptext */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up hazelPreptext again */ +YY_RULE_SETUP +{ + if (ifStackTop < 0 || (! VALID_STACK_TOP())) { + ES2INTER(ShaderObjectInfoLogAppend)(pUnit, + "ERROR (line %d, file %d): #endif: dangling endif\n", iLINE, iFILE); + iErrorCode = 1; + } else { + ifStackTop--; + } + assert(VALID_STACK_TOP() == GL_TRUE); + bOutputed = 1; +} + YY_BREAK +/* #line -------------------------------------------------------- */ +case 8: +*yy_cp = (yy_hold_char); /* undo effects of setting up hazelPreptext */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up hazelPreptext again */ +YY_RULE_SETUP +{ + char* ptr = hazelPreptext; + char* qtr = &(hazelPreptext[hazelPrepleng-1]); + char* expanded; + int evalA = 0; + int evalB = 0; + int nEval; + if (IN_TRUE_SECTION() == GL_TRUE) { + while (*qtr == ' ' || *qtr == '\t') *qtr-- = '\0'; + while (*ptr++ != 'e') ; + while (*ptr == ' ' || *ptr == '\t') ptr++; + if (ptr > qtr) { + ES2INTER(ShaderObjectInfoLogAppend)(pUnit, + "ERROR (line %d, file %d): #line: syntax error\n", iLINE, iFILE); + iErrorCode = 1; + } else { + ES2INTER(MacroSetLineFile)(iLINE, iFILE); + expanded = ES2INTER(MacroExpand)(ptr, 0); + hazelEvalPrepare(expanded); + if (expanded == NULL + || hazelEvalparse() != 0 + || (nEval = hazelEvalGetResult(&evalA, &evalB)) <= 0) { + ES2INTER(ShaderObjectInfoLogAppend)(pUnit, + "ERROR (line %d, file %d): #line: expression parsing error.\n", + iLINE, iFILE); + iErrorCode = 1; + } else { + iLINE = evalA; + if (nEval >= 2) iFILE = evalB; + } + } + } + bOutputed = 1; +} + YY_BREAK +/* #define ------------------------------------------------------ */ +case 9: +*yy_cp = (yy_hold_char); /* undo effects of setting up hazelPreptext */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up hazelPreptext again */ +YY_RULE_SETUP +{ + char* ptr = hazelPreptext; + char* qtr = &(hazelPreptext[hazelPrepleng-1]); + int n = 0; + if (IN_TRUE_SECTION() == GL_TRUE) { + while (isspace(*qtr)) *qtr-- = '\0'; + while (n++ < 2) { while (*ptr++ != 'e') ; } + while (*ptr == ' ' || *ptr == '\t') ptr++; + for (qtr = ptr + 1; *qtr == '_' || isalnum(*qtr); qtr++) ; + assert(*qtr == '('); + *qtr = '\0'; + if (strcmp(ptr, "defined") == 0 + || strncmp(ptr, "GL_", 3) == 0 + || strstr(ptr, "__") != NULL) { + ES2INTER(ShaderObjectInfoLogAppend)(pUnit, + "ERROR (line %d, file %d): #define: illegal identifier name '%s'\n", + iLINE, iFILE, ptr); + iErrorCode = 1; + } else { + for (*qtr++ = '('; *qtr != '\0' && *qtr != ')'; qtr++) ; + if (qtr == '\0') { + ES2INTER(ShaderObjectInfoLogAppend)(pUnit, + "ERROR (line %d, file %d): #define: unexpected end of string\n", + iLINE, iFILE); + iErrorCode = 1; + } else { + assert(*qtr == ')'); + qtr++; + if (qtr == '\0') { + qtr = ""; + } else { + *qtr++ = '\0'; + while (isspace(*qtr)) qtr++; + } + if (ES2INTER(MacroDefineFunc)(ptr, qtr) == GL_FALSE) { + ES2INTER(ShaderObjectInfoLogAppend)(pUnit, + "ERROR (line %d, file %d): #define: trying to redefine '%s'\n", + iLINE, iFILE, ptr); + iErrorCode = 1; + } + } + } + } + bOutputed = 1; +} + YY_BREAK +case 10: +*yy_cp = (yy_hold_char); /* undo effects of setting up hazelPreptext */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up hazelPreptext again */ +YY_RULE_SETUP +{ + char* ptr = hazelPreptext; + char* qtr = &(hazelPreptext[hazelPrepleng-1]); + int n = 0; + if (IN_TRUE_SECTION() == GL_TRUE) { + while (isspace(*qtr)) *qtr-- = '\0'; + while (n++ < 2) { while (*ptr++ != 'e') ; } + while (*ptr == ' ' || *ptr == '\t') ptr++; + for (qtr = ptr + 1; *qtr == '_' || isalnum(*qtr); qtr++) ; + if (*qtr == '\0') { + qtr = "1"; + } else { + *qtr++ = '\0'; + while (*qtr == ' ' || *qtr == '\t') qtr++; + } + if (strcmp(ptr, "defined") == 0 + || strncmp(ptr, "GL_", 3) == 0 + || strstr(ptr, "__") != NULL) { + ES2INTER(ShaderObjectInfoLogAppend)(pUnit, + "ERROR (line %d, file %d): #define: illegal identifier name '%s'\n", + iLINE, iFILE, ptr); + iErrorCode = 1; + } else if (ES2INTER(MacroDefineName)(ptr, qtr) == GL_FALSE) { + ES2INTER(ShaderObjectInfoLogAppend)(pUnit, + "ERROR (line %d, file %d): #define: trying to redefine '%s'\n", + iLINE, iFILE, ptr); + iErrorCode = 1; + } + } + bOutputed = 1; +} + YY_BREAK +/* #undef */ +case 11: +*yy_cp = (yy_hold_char); /* undo effects of setting up hazelPreptext */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up hazelPreptext again */ +YY_RULE_SETUP +{ + char* ptr = hazelPreptext; + char* qtr; + if (IN_TRUE_SECTION() == GL_TRUE) { + while (*ptr++ != 'f') ; + while (*ptr == ' ' || *ptr == '\t') ptr++; + for (qtr = ptr + 1; *qtr == '_' || isalnum(*qtr); qtr++) ; + *qtr++ = '\0'; + if (ES2INTER(MacroUndef)(ptr) == GL_FALSE) { + ES2INTER(ShaderObjectInfoLogAppend)(pUnit, + "ERROR (line %d, file %d): #undef: cannot undefine '%s'\n", iLINE, iFILE, ptr); + iErrorCode = 1; + } + } + bOutputed = 1; +} + YY_BREAK +/* #error */ +case 12: +*yy_cp = (yy_hold_char); /* undo effects of setting up hazelPreptext */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up hazelPreptext again */ +YY_RULE_SETUP +{ + char* ptr = hazelPreptext; + int n = 0; + if (IN_TRUE_SECTION() == GL_TRUE) { + while (n++ < 3) { while (*ptr++ != 'r') ; } + while (*ptr == ' ' || *ptr == '\t') ptr++; + ES2INTER(ShaderObjectInfoLogAppend)(pUnit, + "ERROR (line %d, file %d): #error: %s\n", iLINE, iFILE, ptr); + iErrorCode = 1; + } + bOutputed = 1; +} + YY_BREAK +/* #pragma : just ignore it */ +case 13: +*yy_cp = (yy_hold_char); /* undo effects of setting up hazelPreptext */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up hazelPreptext again */ +YY_RULE_SETUP +{ + bOutputed = 1; +} + YY_BREAK +case 14: +*yy_cp = (yy_hold_char); /* undo effects of setting up hazelPreptext */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up hazelPreptext again */ +YY_RULE_SETUP +{ + bOutputed = 1; +} + YY_BREAK +case 15: +*yy_cp = (yy_hold_char); /* undo effects of setting up hazelPreptext */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up hazelPreptext again */ +YY_RULE_SETUP +{ + if (IN_TRUE_SECTION() == GL_TRUE) { + ES2INTER(ShaderObjectInfoLogAppend)(pUnit, + "Warning (line %d, file %d): #pragma: ignore unrecognizable string\n", + iLINE, iFILE); + } + bOutputed = 1; +} + YY_BREAK +/* #extension */ +case 16: +*yy_cp = (yy_hold_char); /* undo effects of setting up hazelPreptext */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up hazelPreptext again */ +YY_RULE_SETUP +{ + if (IN_TRUE_SECTION() == GL_TRUE) { + ES2INTER(ShaderObjectInfoLogAppend)(pUnit, + "ERROR (line %d, file %d): #extension: cannot use 'require' or 'enable' with 'all'\n", + iLINE, iFILE); + iErrorCode = 1; + } + bOutputed = 1; +} + YY_BREAK +case 17: +*yy_cp = (yy_hold_char); /* undo effects of setting up hazelPreptext */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up hazelPreptext again */ +YY_RULE_SETUP +{ + bOutputed = 1; +} + YY_BREAK +case 18: +*yy_cp = (yy_hold_char); /* undo effects of setting up hazelPreptext */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up hazelPreptext again */ +YY_RULE_SETUP +{ + char* ptr = hazelPreptext; + char* qtr; + int n = 0; + if (IN_TRUE_SECTION() == GL_TRUE) { + while (n++ < 2) { while (*ptr++ != 'n') ; } + while (*ptr == ' ' || *ptr == '\t') ptr++; + for (qtr = ptr + 1; *qtr == '_' || isalnum(*qtr); qtr++) ; + *qtr = '\0'; + ES2INTER(ShaderObjectInfoLogAppend)(pUnit, + "ERROR (line %d, file %d): #extension: unsupported extension '%s'\n", + iLINE, iFILE, ptr); + iErrorCode = 1; + } + bOutputed = 1; +} + YY_BREAK +case 19: +*yy_cp = (yy_hold_char); /* undo effects of setting up hazelPreptext */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up hazelPreptext again */ +YY_RULE_SETUP +{ + char* ptr = hazelPreptext; + char* qtr; + int n = 0; + if (IN_TRUE_SECTION() == GL_TRUE) { + while (n++ < 2) { while (*ptr++ != 'n') ; } + while (*ptr == ' ' || *ptr == '\t') ptr++; + for (qtr = ptr + 1; *qtr == '_' || isalnum(*qtr); qtr++) ; + *qtr = '\0'; + if (strcmp(ptr, "GL_OES_texture_3D") == 0) { + hazelEnableTexture3D = GL_TRUE; + } else { + ES2INTER(ShaderObjectInfoLogAppend)(pUnit, + "Warning (line %d, file %d): #extension: unsupported extension '%s'\n", + iLINE, iFILE, ptr); + } + } + bOutputed = 1; +} + YY_BREAK +case 20: +*yy_cp = (yy_hold_char); /* undo effects of setting up hazelPreptext */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up hazelPreptext again */ +YY_RULE_SETUP +{ + if (IN_TRUE_SECTION() == GL_TRUE) { + ES2INTER(ShaderObjectInfoLogAppend)(pUnit, + "ERROR (line %d, file %d): #extension: illegal behavior\n", + iLINE, iFILE); + iErrorCode = 1; + } + bOutputed = 1; +} + YY_BREAK +case 21: +*yy_cp = (yy_hold_char); /* undo effects of setting up hazelPreptext */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up hazelPreptext again */ +YY_RULE_SETUP +{ + if (IN_TRUE_SECTION() == GL_TRUE) { + ES2INTER(ShaderObjectInfoLogAppend)(pUnit, + "ERROR (line %d, file %d): #extension: syntax error\n", iLINE, iFILE); + iErrorCode = 1; + } + bOutputed = 1; +} + YY_BREAK +/* #version : no macro expansion */ +case 22: +*yy_cp = (yy_hold_char); /* undo effects of setting up hazelPreptext */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up hazelPreptext again */ +YY_RULE_SETUP +{ + if (IN_TRUE_SECTION() == GL_TRUE) { + if (bOutputed != 0) { + ES2INTER(ShaderObjectInfoLogAppend)(pUnit, + "ERROR (line %d, file %d): #version: must be the first statement and may not be repeated.\n", iLINE, iFILE); + iErrorCode = 1; + } + } + bOutputed = 1; +} + YY_BREAK +case 23: +*yy_cp = (yy_hold_char); /* undo effects of setting up hazelPreptext */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up hazelPreptext again */ +YY_RULE_SETUP +{ + if (IN_TRUE_SECTION() == GL_TRUE) { + ES2INTER(ShaderObjectInfoLogAppend)(pUnit, + "ERROR (line %d, file %d): #version: illegal version number\n", iLINE, iFILE); + iErrorCode = 1; + } + bOutputed = 1; +} + YY_BREAK +/* only-# lines : just ignore it */ +case 24: +*yy_cp = (yy_hold_char); /* undo effects of setting up hazelPreptext */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up hazelPreptext again */ +YY_RULE_SETUP +{ + bOutputed = 1; +} + YY_BREAK +/* other #-lines */ +case 25: +*yy_cp = (yy_hold_char); /* undo effects of setting up hazelPreptext */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up hazelPreptext again */ +YY_RULE_SETUP +{ + if (IN_TRUE_SECTION() == GL_TRUE) { + ES2INTER(ShaderObjectInfoLogAppend)(pUnit, + "ERROR (line %d, file %d): invalid macro line: %s\n", iLINE, iFILE, hazelPreptext); + iErrorCode = 1; + } + bOutputed = 1; +} + YY_BREAK +/* plain text */ +case 26: +*yy_cp = (yy_hold_char); /* undo effects of setting up hazelPreptext */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up hazelPreptext again */ +YY_RULE_SETUP +{ + if (IN_TRUE_SECTION() == GL_TRUE) { + char* expanded; + ES2INTER(MacroSetLineFile)(iLINE, iFILE); + expanded = ES2INTER(MacroExpand)(hazelPreptext, 2); + if (expanded == NULL) { + OUTPUT(hazelPreptext, hazelPrepleng); + } else { + OUTPUT(expanded, strlen(expanded)); + } + } + bOutputed = 1; +} + YY_BREAK +case 27: +*yy_cp = (yy_hold_char); /* undo effects of setting up hazelPreptext */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up hazelPreptext again */ +YY_RULE_SETUP +{ } + YY_BREAK +case 28: +/* rule 28 can match eol */ +YY_RULE_SETUP +{ OUTPUT("\n", 1); } + YY_BREAK +case 29: +YY_RULE_SETUP +{ OUTPUT(hazelPreptext, 1); } + YY_BREAK +case 30: +YY_RULE_SETUP +ECHO; + YY_BREAK +case YY_STATE_EOF(INITIAL): + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = (yy_hold_char); + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed hazelPrepin at a new source and called + * hazelPreplex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = hazelPrepin; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++(yy_c_buf_p); + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = (yy_c_buf_p); + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_END_OF_FILE: + { + (yy_did_buffer_switch_on_eof) = 0; + + if ( hazelPrepwrap( ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * hazelPreptext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = + (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + (yy_c_buf_p) = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ +} /* end of hazelPreplex */ + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ +static int yy_get_next_buffer (void) +{ + register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + register char *source = (yytext_ptr); + register int number_to_move, i; + int ret_val; + + if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; + + else + { + int num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER; + + int yy_c_buf_p_offset = + (int) ((yy_c_buf_p) - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + hazelPreprealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; + + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + (yy_n_chars), (size_t) num_to_read ); + + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + if ( (yy_n_chars) == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + hazelPreprestart(hazelPrepin ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) hazelPreprealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + } + + (yy_n_chars) += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; + + (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + + return ret_val; +} + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + + static yy_state_type yy_get_previous_state (void) +{ + register yy_state_type yy_current_state; + register char *yy_cp; + + yy_current_state = (yy_start); + yy_current_state += YY_AT_BOL(); + + for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) + { + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 310 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + } + + return yy_current_state; +} + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) +{ + register int yy_is_jam; + register char *yy_cp = (yy_c_buf_p); + + register YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 310 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_is_jam = (yy_current_state == 309); + + return yy_is_jam ? 0 : yy_current_state; +} + + static void yyunput (int c, register char * yy_bp ) +{ + register char *yy_cp; + + yy_cp = (yy_c_buf_p); + + /* undo effects of setting up hazelPreptext */ + *yy_cp = (yy_hold_char); + + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + register int number_to_move = (yy_n_chars) + 2; + register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; + register char *source = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; + + while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + *--dest = *--source; + + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; + + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } + + *--yy_cp = (char) c; + + (yytext_ptr) = yy_bp; + (yy_hold_char) = *yy_cp; + (yy_c_buf_p) = yy_cp; +} + +#ifndef YY_NO_INPUT +#ifdef __cplusplus + static int yyinput (void) +#else + static int input (void) +#endif + +{ + int c; + + *(yy_c_buf_p) = (yy_hold_char); + + if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + /* This was really a NUL. */ + *(yy_c_buf_p) = '\0'; + + else + { /* need more input */ + int offset = (yy_c_buf_p) - (yytext_ptr); + ++(yy_c_buf_p); + + switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + hazelPreprestart(hazelPrepin ); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( hazelPrepwrap( ) ) + return EOF; + + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(); +#else + return input(); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = (yytext_ptr) + offset; + break; + } + } + } + + c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ + *(yy_c_buf_p) = '\0'; /* preserve hazelPreptext */ + (yy_hold_char) = *++(yy_c_buf_p); + + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); + + return c; +} +#endif /* ifndef YY_NO_INPUT */ + +/** Immediately switch to a different input stream. + * @param input_file A readable stream. + * + * @note This function does not reset the start condition to @c INITIAL . + */ + void hazelPreprestart (FILE * input_file ) +{ + + if ( ! YY_CURRENT_BUFFER ){ + hazelPrepensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + hazelPrep_create_buffer(hazelPrepin,YY_BUF_SIZE ); + } + + hazelPrep_init_buffer(YY_CURRENT_BUFFER,input_file ); + hazelPrep_load_buffer_state( ); +} + +/** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * + */ + void hazelPrep_switch_to_buffer (YY_BUFFER_STATE new_buffer ) +{ + + /* TODO. We should be able to replace this entire function body + * with + * hazelPreppop_buffer_state(); + * hazelPreppush_buffer_state(new_buffer); + */ + hazelPrepensure_buffer_stack (); + if ( YY_CURRENT_BUFFER == new_buffer ) + return; + + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + hazelPrep_load_buffer_state( ); + + /* We don't actually know whether we did this switch during + * EOF (hazelPrepwrap()) processing, but the only time this flag + * is looked at is after hazelPrepwrap() is called, so it's safe + * to go ahead and always set it. + */ + (yy_did_buffer_switch_on_eof) = 1; +} + +static void hazelPrep_load_buffer_state (void) +{ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + hazelPrepin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + (yy_hold_char) = *(yy_c_buf_p); +} + +/** Allocate and initialize an input buffer state. + * @param file A readable stream. + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. + * + * @return the allocated buffer state. + */ + YY_BUFFER_STATE hazelPrep_create_buffer (FILE * file, int size ) +{ + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) hazelPrepalloc(sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in hazelPrep_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) hazelPrepalloc(b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in hazelPrep_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + hazelPrep_init_buffer(b,file ); + + return b; +} + +/** Destroy the buffer. + * @param b a buffer created with hazelPrep_create_buffer() + * + */ + void hazelPrep_delete_buffer (YY_BUFFER_STATE b ) +{ + + if ( ! b ) + return; + + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + hazelPrepfree((void *) b->yy_ch_buf ); + + hazelPrepfree((void *) b ); +} + +#ifndef __cplusplus +extern int isatty (int ); +#endif /* __cplusplus */ + +/* Initializes or reinitializes a buffer. + * This function is sometimes called more than once on the same buffer, + * such as during a hazelPreprestart() or at EOF. + */ + static void hazelPrep_init_buffer (YY_BUFFER_STATE b, FILE * file ) + +{ + int oerrno = errno; + + hazelPrep_flush_buffer(b ); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + + /* If b is the current buffer, then hazelPrep_init_buffer was _probably_ + * called from hazelPreprestart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER){ + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } + + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; + + errno = oerrno; +} + +/** Discard all buffered characters. On the next scan, YY_INPUT will be called. + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. + * + */ + void hazelPrep_flush_buffer (YY_BUFFER_STATE b ) +{ + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == YY_CURRENT_BUFFER ) + hazelPrep_load_buffer_state( ); +} + +/** Pushes the new state onto the stack. The new state becomes + * the current state. This function will allocate the stack + * if necessary. + * @param new_buffer The new state. + * + */ +void hazelPreppush_buffer_state (YY_BUFFER_STATE new_buffer ) +{ + if (new_buffer == NULL) + return; + + hazelPrepensure_buffer_stack(); + + /* This block is copied from hazelPrep_switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + (yy_buffer_stack_top)++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from hazelPrep_switch_to_buffer. */ + hazelPrep_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; +} + +/** Removes and deletes the top of the stack, if present. + * The next element becomes the new top. + * + */ +void hazelPreppop_buffer_state (void) +{ + if (!YY_CURRENT_BUFFER) + return; + + hazelPrep_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + if ((yy_buffer_stack_top) > 0) + --(yy_buffer_stack_top); + + if (YY_CURRENT_BUFFER) { + hazelPrep_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; + } +} + +/* Allocates the stack if it does not exist. + * Guarantees space for at least one push. + */ +static void hazelPrepensure_buffer_stack (void) +{ + int num_to_alloc; + + if (!(yy_buffer_stack)) { + + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. + */ + num_to_alloc = 1; + (yy_buffer_stack) = (struct yy_buffer_state**)hazelPrepalloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in hazelPrepensure_buffer_stack()" ); + + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + (yy_buffer_stack_max) = num_to_alloc; + (yy_buffer_stack_top) = 0; + return; + } + + if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ + + /* Increase the buffer to prepare for a possible push. */ + int grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = (yy_buffer_stack_max) + grow_size; + (yy_buffer_stack) = (struct yy_buffer_state**)hazelPreprealloc + ((yy_buffer_stack), + num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in hazelPrepensure_buffer_stack()" ); + + /* zero only the new slots.*/ + memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); + (yy_buffer_stack_max) = num_to_alloc; + } +} + +/** Setup the input buffer state to scan directly from a user-specified character buffer. + * @param base the character buffer + * @param size the size in bytes of the character buffer + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE hazelPrep_scan_buffer (char * base, yy_size_t size ) +{ + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; + + b = (YY_BUFFER_STATE) hazelPrepalloc(sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in hazelPrep_scan_buffer()" ); + + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + hazelPrep_switch_to_buffer(b ); + + return b; +} + +/** Setup the input buffer state to scan a string. The next call to hazelPreplex() will + * scan from a @e copy of @a str. + * @param yystr a NUL-terminated string to scan + * + * @return the newly allocated buffer state object. + * @note If you want to scan bytes that may contain NUL values, then use + * hazelPrep_scan_bytes() instead. + */ +YY_BUFFER_STATE hazelPrep_scan_string (yyconst char * yystr ) +{ + + return hazelPrep_scan_bytes(yystr,strlen(yystr) ); +} + +/** Setup the input buffer state to scan the given bytes. The next call to hazelPreplex() will + * scan from a @e copy of @a bytes. + * @param bytes the byte buffer to scan + * @param len the number of bytes in the buffer pointed to by @a bytes. + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE hazelPrep_scan_bytes (yyconst char * yybytes, int _yybytes_len ) +{ + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = _yybytes_len + 2; + buf = (char *) hazelPrepalloc(n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in hazelPrep_scan_bytes()" ); + + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; + + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; + + b = hazelPrep_scan_buffer(buf,n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in hazelPrep_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; +} + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +static void yy_fatal_error (yyconst char* msg ) +{ + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); +} + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up hazelPreptext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + hazelPreptext[hazelPrepleng] = (yy_hold_char); \ + (yy_c_buf_p) = hazelPreptext + yyless_macro_arg; \ + (yy_hold_char) = *(yy_c_buf_p); \ + *(yy_c_buf_p) = '\0'; \ + hazelPrepleng = yyless_macro_arg; \ + } \ + while ( 0 ) + +/* Accessor methods (get/set functions) to struct members. */ + +/** Get the current line number. + * + */ +int hazelPrepget_lineno (void) +{ + + return hazelPreplineno; +} + +/** Get the input stream. + * + */ +FILE *hazelPrepget_in (void) +{ + return hazelPrepin; +} + +/** Get the output stream. + * + */ +FILE *hazelPrepget_out (void) +{ + return hazelPrepout; +} + +/** Get the length of the current token. + * + */ +int hazelPrepget_leng (void) +{ + return hazelPrepleng; +} + +/** Get the current token. + * + */ + +char *hazelPrepget_text (void) +{ + return hazelPreptext; +} + +/** Set the current line number. + * @param line_number + * + */ +void hazelPrepset_lineno (int line_number ) +{ + + hazelPreplineno = line_number; +} + +/** Set the input stream. This does not discard the current + * input buffer. + * @param in_str A readable stream. + * + * @see hazelPrep_switch_to_buffer + */ +void hazelPrepset_in (FILE * in_str ) +{ + hazelPrepin = in_str ; +} + +void hazelPrepset_out (FILE * out_str ) +{ + hazelPrepout = out_str ; +} + +int hazelPrepget_debug (void) +{ + return hazelPrep_flex_debug; +} + +void hazelPrepset_debug (int bdebug ) +{ + hazelPrep_flex_debug = bdebug ; +} + +static int yy_init_globals (void) +{ + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from hazelPreplex_destroy(), so don't allocate here. + */ + + (yy_buffer_stack) = 0; + (yy_buffer_stack_top) = 0; + (yy_buffer_stack_max) = 0; + (yy_c_buf_p) = (char *) 0; + (yy_init) = 0; + (yy_start) = 0; + +/* Defined in main.c */ +#ifdef YY_STDINIT + hazelPrepin = stdin; + hazelPrepout = stdout; +#else + hazelPrepin = (FILE *) 0; + hazelPrepout = (FILE *) 0; +#endif + + /* For future reference: Set errno on error, since we are called by + * hazelPreplex_init() + */ + return 0; +} + +/* hazelPreplex_destroy is for both reentrant and non-reentrant scanners. */ +int hazelPreplex_destroy (void) +{ + + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER){ + hazelPrep_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + hazelPreppop_buffer_state(); + } + + /* Destroy the stack itself. */ + hazelPrepfree((yy_buffer_stack) ); + (yy_buffer_stack) = NULL; + + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * hazelPreplex() is called, initialization will occur. */ + yy_init_globals( ); + + return 0; +} + +/* + * Internal utility routines. + */ + +#ifndef yytext_ptr +static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) +{ + register int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; +} +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (yyconst char * s ) +{ + register int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; +} +#endif + +void *hazelPrepalloc (yy_size_t size ) +{ + return (void *) malloc( size ); +} + +void *hazelPreprealloc (void * ptr, yy_size_t size ) +{ + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return (void *) realloc( (char *) ptr, size ); +} + +void hazelPrepfree (void * ptr ) +{ + free( (char *) ptr ); /* see hazelPreprealloc() for (char *) cast */ +} + +#define YYTABLES_NAME "yytables" + + + diff --git a/es_2_0/Primitive.c b/es_2_0/Primitive.c new file mode 100755 index 0000000..d782078 --- /dev/null +++ b/es_2_0/Primitive.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "es2front.h" + + +void GL_APIENTRY ES2ENTRY(LineWidth)(GLfloat width) { + if (width <= 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + FNPTR(LineWidth)(width); +} + +void GL_APIENTRY ES2ENTRY(DepthRangef)(GLclampf zNear, GLclampf zFar) { + FNPTR(DepthRange)((GLclampd)zNear, (GLclampd)zFar); +} + +void GL_APIENTRY ES2ENTRY(Viewport)(GLint x, GLint y, GLsizei width, GLsizei height) { + if (width < 0 || height < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + FNPTR(Viewport)(x, y, width, height); +} + +void GL_APIENTRY ES2ENTRY(CullFace)(GLenum mode) { + switch (mode) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_FRONT: + case GL_BACK: + case GL_FRONT_AND_BACK: + break; + } + FNPTR(CullFace)(mode); +} + +void GL_APIENTRY ES2ENTRY(FrontFace)(GLenum mode) { + switch (mode) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_CW: + case GL_CCW: + break; + } + FNPTR(FrontFace)(mode); +} + +void GL_APIENTRY ES2ENTRY(PolygonOffset)(GLfloat factor, GLfloat units) { + FNPTR(PolygonOffset)(factor, units); +} diff --git a/es_2_0/Program.c b/es_2_0/Program.c new file mode 100755 index 0000000..ab0107d --- /dev/null +++ b/es_2_0/Program.c @@ -0,0 +1,389 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "es2front.h" +#include <stdarg.h> + + +void GL_APIENTRY ES2INTER(ProgramObjectInit)(struct ProgramObjectUnit* pUnit) { + pUnit->bLinkStatus = GL_FALSE; + pUnit->strInfoLog = NULL; +} + +void GL_APIENTRY ES2INTER(ProgramObjectRelease)(struct ProgramObjectUnit* pUnit) { + register int i; + if (pUnit->strInfoLog != NULL) { + free(pUnit->strInfoLog); + } + pUnit->bLinkStatus = GL_FALSE; + pUnit->strInfoLog = NULL; +} + +void GL_APIENTRY ES2INTER(ProgramObjectInfoLogReset)(struct ProgramObjectUnit* pUnit) { + pUnit->strInfoLog = realloc(pUnit->strInfoLog, 1024 * sizeof(GLchar)); + assert(pUnit->strInfoLog != NULL); + pUnit->strInfoLog[0] = '\0'; +} + +void GL_APIENTRY ES2INTER(ProgramObjectInfoLogAppend)(struct ProgramObjectUnit* pUnit, + const char* format, ...) { + static char cBuf[1024]; + int len; + va_list ap; + va_start(ap, format); + vsnprintf(cBuf, 1024, format, ap); + if (pUnit->strInfoLog == NULL) { + pUnit->strInfoLog = realloc(pUnit->strInfoLog, 1024 * sizeof(GLchar)); + assert(pUnit->strInfoLog != NULL); + pUnit->strInfoLog[0] = '\0'; + } + len = strlen(pUnit->strInfoLog) + strlen(cBuf); + pUnit->strInfoLog = realloc(pUnit->strInfoLog, (len + 1) * sizeof(GLchar)); + assert(pUnit->strInfoLog != NULL); + strcat(pUnit->strInfoLog, cBuf); + va_end(ap); +} + +GLuint GL_APIENTRY ES2ENTRY(CreateProgram)(void) { + register GLuint uResult; + register GLint nAllocated; + register int i; + uResult = FNPTR(CreateProgram)(); + nAllocated = CCV(nProgramObjectAllocated); + while (nAllocated <= uResult) { + nAllocated *= 2; + } + if (CCV(nProgramObjectAllocated) < nAllocated) { + register struct ProgramObjectUnit* pUnit = realloc(CCV(pProgramObject), + nAllocated * sizeof(struct ProgramObjectUnit)); + assert(pUnit != NULL); + for (i = CCV(nProgramObjectAllocated); i < nAllocated; i++) { + ES2INTER(ProgramObjectInit)(&(pUnit[i])); + } + CCV(pProgramObject) = pUnit; + CCV(nProgramObjectAllocated) = nAllocated; + } + return uResult; +} + +void GL_APIENTRY ES2ENTRY(DeleteProgram)(GLuint program) { + if (program == 0) { + return; + } else if (FNPTR(IsProgram) != NULL && FNPTR(IsProgram)(program) == GL_FALSE) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + if (CCV(nProgramObjectAllocated) == NULL) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + + if (program < CCV(nProgramObjectAllocated)) { + GLint nAttachedShaders = 0; + FNPTR(GetProgramiv)(program, GL_ATTACHED_SHADERS, &nAttachedShaders); + if (nAttachedShaders > 0) { + GLuint* pAttachedShaders = NULL; + int i; + pAttachedShaders = (GLuint*)realloc(pAttachedShaders, + nAttachedShaders * sizeof(GLuint)); + assert(pAttachedShaders != NULL); + FNPTR(GetAttachedShaders)(program, nAttachedShaders, &i, pAttachedShaders); + assert(nAttachedShaders == i); + for (i = 0; i < nAttachedShaders; i++) { + int index = pAttachedShaders[i]; + if (index < CCV(nShaderObjectAllocated)) { + struct ShaderObjectUnit* pShader = &(CCV(pShaderObject)[index]); + if (pShader->nAttached > 0) pShader->nAttached--; + if (pShader->bDeleteStatus == GL_TRUE && pShader->nAttached == 0) { + ES2INTER(ShaderObjectRelease)(pShader); + } + } + } + } + ES2INTER(ProgramObjectRelease)(&(CCV(pProgramObject)[program])); + } + FNPTR(DeleteProgram)(program); +} + +GLboolean GL_APIENTRY ES2ENTRY(IsProgram)(GLuint program) { + register GLboolean bResult; + bResult = FNPTR(IsProgram)(program); + return bResult; +} + +void GL_APIENTRY ES2ENTRY(AttachShader)(GLuint program, GLuint shader) { + struct ShaderObjectUnit* pShader; + if ((GLint)(program) <= 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } else if (FNPTR(IsProgram)(program) == GL_FALSE) { + if (program == 30) { + ES2INTER(SetError)(GL_INVALID_VALUE); + } else { + ES2INTER(SetError)(GL_INVALID_OPERATION); + } + return; + } + if ((GLint)(shader) <= 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } else if (FNPTR(IsShader)(shader) == GL_FALSE) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + FNPTR(AttachShader)(program, shader); + pShader = &(CCV(pShaderObject)[shader]); + pShader->nAttached++; +} + +void GL_APIENTRY ES2ENTRY(DetachShader)(GLuint program, GLuint shader) { + struct ShaderObjectUnit* pShader; + if ((GLint)(program) <= 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } else if (FNPTR(IsProgram) != NULL && FNPTR(IsProgram)(program) == GL_FALSE) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + if ((GLint)(shader) <= 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } else if (FNPTR(IsShader) != NULL && FNPTR(IsShader)(shader) == GL_FALSE) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + if (FNPTR(DetachShader) != NULL) + FNPTR(DetachShader)(program, shader); + if (CCV(pShaderObject) != NULL) { + pShader = &(CCV(pShaderObject)[shader]); + if (pShader->nAttached > 0) + pShader->nAttached--; + if (pShader->nAttached == 0 && pShader->bDeleteStatus == GL_TRUE) + ES2INTER(ShaderObjectRelease)(pShader); + } +} + +void GL_APIENTRY ES2ENTRY(GetAttachedShaders)(GLuint program, + GLsizei maxcount, GLsizei* count, GLuint* shaders) { + if ((GLint)(program) <= 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } else if (FNPTR(IsProgram)(program) == GL_FALSE) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + if (maxcount < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + FNPTR(GetAttachedShaders)(program, maxcount, count, shaders); +} + +void GL_APIENTRY ES2ENTRY(LinkProgram)(GLuint program) { + struct ProgramObjectUnit* pUnit; + int nAttachedShaders; + int iResult; + GLboolean bFlag; + int nVertexShader = 0; + int nFragmentShader = 0; + if ((GLint)(program) <= 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } else if (FNPTR(IsProgram)(program) == GL_FALSE) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + FNPTR(GetProgramiv)(program, GL_ATTACHED_SHADERS, &nAttachedShaders); + bFlag = GL_TRUE; + assert(program < CCV(nProgramObjectAllocated)); + pUnit = &(CCV(pProgramObject)[program]); + ES2INTER(ProgramObjectInfoLogReset)(pUnit); + if (nAttachedShaders > 0) { + GLuint* pAttachedShaders = NULL; + int i; + pAttachedShaders = (GLuint*)realloc(pAttachedShaders, nAttachedShaders * sizeof(GLuint)); + assert(pAttachedShaders != NULL); + FNPTR(GetAttachedShaders)(program, nAttachedShaders, &i, pAttachedShaders); + assert(nAttachedShaders == i); + for (i = 0; i < nAttachedShaders; i++) { + int index = pAttachedShaders[i]; + if (index < CCV(nShaderObjectAllocated)) { + struct ShaderObjectUnit* pShader = &(CCV(pShaderObject)[index]); + if (pShader->eShaderType == GL_VERTEX_SHADER) { + nVertexShader++; + } else if (pShader->eShaderType == GL_FRAGMENT_SHADER) { + nFragmentShader++; + } + if (pShader->bCompileStatus == GL_FALSE) { + bFlag = GL_FALSE; + ES2INTER(ProgramObjectInfoLogAppend)(pUnit, + "ERROR: shader=%d was not compiled or failed to compile\n", index); + } + } + } + } + if (nVertexShader == 0) { + ES2INTER(ProgramObjectInfoLogAppend)(pUnit, "ERROR: no vertex shader found\n"); + bFlag = GL_FALSE; + } + if (nFragmentShader == 0) { + ES2INTER(ProgramObjectInfoLogAppend)(pUnit, "ERROR: no fragment shader found\n"); + bFlag = GL_FALSE; + } + if (bFlag == GL_FALSE) { + CCV(pProgramObject)[program].bLinkStatus = GL_FALSE; + ES2INTER(ProgramObjectInfoLogAppend)(pUnit, "ERROR: link failed\n"); + return; + } + FNPTR(LinkProgram)(program); + FNPTR(GetProgramiv)(program, GL_LINK_STATUS, &iResult); + pUnit->bLinkStatus = (iResult == GL_FALSE) ? GL_FALSE : GL_TRUE; +} + +void GL_APIENTRY ES2ENTRY(UseProgram)(GLuint program) { + if ((GLint)(program) < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + } else if (program != 0 && FNPTR(IsProgram)(program) == GL_FALSE) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + FNPTR(UseProgram)(program); +} + +void GL_APIENTRY ES2ENTRY(ValidateProgram)(GLuint program) { + struct ProgramObjectUnit* pUnit; + GLint valid; + if ((GLint)(program) <= 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } else if (FNPTR(IsProgram)(program) == GL_FALSE) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + pUnit = &(CCV(pProgramObject)[program]); + ES2INTER(ProgramObjectInfoLogReset)(pUnit); + FNPTR(ValidateProgram)(program); + FNPTR(GetProgramiv)(program, GL_VALIDATE_STATUS, &valid); + if (valid != GL_FALSE) { + ES2ENTRY(LinkProgram)(program); + } +} + +void GL_APIENTRY ES2ENTRY(GetProgramiv)(GLuint program, GLenum pname, GLint* params) { + if ((GLint)(program) <= 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } else if (FNPTR(IsProgram)(program) == GL_FALSE) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + switch (pname) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_LINK_STATUS: + if (program < CCV(nProgramObjectAllocated)) { + *params = CCV(pProgramObject)[program].bLinkStatus; + } else { + FNPTR(GetProgramiv)(program, pname, params); + } + break; + case GL_DELETE_STATUS: + FNPTR(GetProgramiv)(program, pname, params); + break; + case GL_VALIDATE_STATUS: + FNPTR(GetProgramiv)(program, pname, params); + if (*params != GL_FALSE) { + if (program < CCV(nProgramObjectAllocated)) { + *params = CCV(pProgramObject)[program].bLinkStatus; + } else { + FNPTR(GetProgramiv)(program, GL_LINK_STATUS, params); + } + } + break; + case GL_INFO_LOG_LENGTH: + if (program < CCV(nProgramObjectAllocated) + && CCV(pProgramObject)[program].strInfoLog != NULL) { + *params = strlen(CCV(pProgramObject)[program].strInfoLog) + 1; + if (*params <= 1) { + FNPTR(GetProgramiv)(program, pname, params); + } + } else { + FNPTR(GetProgramiv)(program, pname, params); + } + break; + case GL_ATTACHED_SHADERS: + case GL_ACTIVE_ATTRIBUTES: + case GL_ACTIVE_ATTRIBUTE_MAX_LENGTH: + case GL_ACTIVE_UNIFORMS: + case GL_ACTIVE_UNIFORM_MAX_LENGTH: + FNPTR(GetProgramiv)(program, pname, params); + break; + } +} + +void GL_APIENTRY ES2ENTRY(GetProgramInfoLog)(GLuint program, + GLsizei bufsize, GLsizei* length, char* infolog) { + struct ProgramObjectUnit* pUnit; + if ((GLint)(program) <= 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } else if (FNPTR(IsProgram)(program) == GL_FALSE) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + if (bufsize < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + assert(program < CCV(nProgramObjectAllocated)); + pUnit = &CCV(pProgramObject[program]); + if (pUnit->strInfoLog != NULL) { + int len = strlen(pUnit->strInfoLog); + if (len >= bufsize) { + len = bufsize - 1; + } + if (len > 0) { + if (length != NULL) { + *length = len; + } + if (infolog != NULL) { + strncpy(infolog, pUnit->strInfoLog, len); + infolog[len] = '\0'; + } + } else { + FNPTR(GetProgramInfoLog)(program, bufsize, length, infolog); + } + } else { + FNPTR(GetProgramInfoLog)(program, bufsize, length, infolog); + } +} + diff --git a/es_2_0/Shader.c b/es_2_0/Shader.c new file mode 100755 index 0000000..e53c92c --- /dev/null +++ b/es_2_0/Shader.c @@ -0,0 +1,553 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "es2front.h" +#include <stdarg.h> + + +void GL_APIENTRY ES2INTER(ShaderObjectInit)(struct ShaderObjectUnit* pUnit) { + pUnit->eShaderType = 0; + pUnit->bDeleteStatus = GL_FALSE; + pUnit->bCompileStatus = GL_FALSE; + pUnit->nAttached = 0; + pUnit->aStrSource = NULL; + pUnit->nSourceAlloc = 0; + pUnit->nSourceUsed = 0; + pUnit->nSourceLength = 0; + pUnit->strInfoLog = NULL; + pUnit->nInfoLogAlloc = 0; + pUnit->strPreped = NULL; + pUnit->nPrepedAlloc = 0; + pUnit->symbolLevel = -1; +} + +void GL_APIENTRY ES2INTER(ShaderObjectRelease)(struct ShaderObjectUnit* pUnit) { + register int i; + assert(pUnit->bDeleteStatus == GL_TRUE && pUnit->nAttached == 0); + for (i = 0; pUnit->aStrSource != NULL && i < pUnit->nSourceAlloc; i++) { + if (pUnit->aStrSource[i] != NULL) { + free(pUnit->aStrSource[i]); + } + } + if (pUnit->aStrSource != NULL) { + free(pUnit->aStrSource); + } + if (pUnit->strInfoLog != NULL) { + free(pUnit->strInfoLog); + } + if (pUnit->strPreped != NULL) { + free(pUnit->strPreped); + } + pUnit->eShaderType = 0; + pUnit->bDeleteStatus = GL_FALSE; + pUnit->bCompileStatus = GL_FALSE; + pUnit->nAttached = 0; + pUnit->aStrSource = NULL; + pUnit->nSourceAlloc = 0; + pUnit->nSourceUsed = 0; + pUnit->nSourceLength = 0; + pUnit->strInfoLog = NULL; + pUnit->nInfoLogAlloc = 0; + pUnit->strPreped = NULL; + pUnit->nPrepedAlloc = 0; + ES2INTER(SymbolRelease)(pUnit); +} + +void GL_APIENTRY ES2INTER(ShaderObjectInfoLogReset)(struct ShaderObjectUnit* pUnit) { + if (pUnit->strInfoLog == NULL) { + assert(pUnit->nInfoLogAlloc == 0); + pUnit->nInfoLogAlloc = 1024; + pUnit->strInfoLog = realloc(pUnit->strInfoLog, pUnit->nInfoLogAlloc * sizeof(GLchar)); + assert(pUnit->strInfoLog != NULL); + } + pUnit->strInfoLog[0] = '\0'; +} + +void GL_APIENTRY ES2INTER(ShaderObjectInfoLogAppend)(struct ShaderObjectUnit* pUnit, + const char* format, ...) { + static char cBuf[1024]; + int nLenBuf; + int nLenLog; + va_list ap; + va_start(ap, format); + vsnprintf(cBuf, 1024, format, ap); + if (pUnit->bDeleteStatus != GL_TRUE) { + if (pUnit->strInfoLog == NULL) { + assert(pUnit->nInfoLogAlloc == 0); + pUnit->nInfoLogAlloc = 1024; + pUnit->strInfoLog = realloc(pUnit->strInfoLog, pUnit->nInfoLogAlloc * sizeof(GLchar)); + assert(pUnit->strInfoLog != NULL); + pUnit->strInfoLog[0] = '\0'; + } + nLenBuf = strlen(cBuf) + 1; + nLenLog = strlen(pUnit->strInfoLog); + if (nLenBuf + nLenLog >= pUnit->nInfoLogAlloc) { + while (nLenBuf + nLenLog >= pUnit->nInfoLogAlloc) { + pUnit->nInfoLogAlloc *= 2; + } + pUnit->strInfoLog = realloc(pUnit->strInfoLog, pUnit->nInfoLogAlloc * sizeof(GLchar)); + assert(pUnit->strInfoLog != NULL); + } + strcat(pUnit->strInfoLog, cBuf); + } else { + ES2INTER(SetError)(GL_NO_ERROR); + } + va_end(ap); +} + +void GL_APIENTRY ES2INTER(ShaderObjectPrepedReset)(struct ShaderObjectUnit* pUnit) { + if (pUnit->strPreped == NULL) { + assert(pUnit->nPrepedAlloc == 0); + pUnit->nPrepedAlloc = 1024; + pUnit->strPreped = realloc(pUnit->strPreped, pUnit->nPrepedAlloc * sizeof(GLchar)); + assert(pUnit->strPreped != NULL); + } + pUnit->strPreped[0] = '\0'; +} + +void GL_APIENTRY ES2INTER(ShaderObjectPrepedAppend)(struct ShaderObjectUnit* pUnit, + const char* strBuf, int nLenBuf) { + int nLenPreped; + if (pUnit->strPreped == NULL) { + assert(pUnit->nPrepedAlloc == 0); + pUnit->nPrepedAlloc = 1024; + pUnit->strPreped = realloc(pUnit->strPreped, pUnit->nPrepedAlloc * sizeof(GLchar)); + assert(pUnit->strPreped != NULL); + pUnit->strPreped[0] = '\0'; + } + nLenPreped = strlen(pUnit->strPreped); + if (nLenBuf + nLenPreped >= pUnit->nPrepedAlloc) { + while (nLenBuf + nLenPreped >= pUnit->nPrepedAlloc) { + pUnit->nPrepedAlloc *= 2; + } + pUnit->strPreped = realloc(pUnit->strPreped, pUnit->nPrepedAlloc * sizeof(GLchar)); + assert(pUnit->strPreped != NULL); + } + strncat(pUnit->strPreped, strBuf, nLenBuf); +} + +GLuint GL_APIENTRY ES2ENTRY(CreateShader)(GLenum type) { + register GLuint uResult; + register GLint nAllocated; + register int i; + switch (type) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return 0; + case GL_VERTEX_SHADER: + case GL_FRAGMENT_SHADER: + uResult = FNPTR(CreateShader)(type); + nAllocated = CCV(nShaderObjectAllocated); + while (nAllocated <= uResult) { + nAllocated *= 2; + } + if (CCV(nShaderObjectAllocated) < nAllocated) { + register struct ShaderObjectUnit* pUnit = realloc(CCV(pShaderObject), + nAllocated * sizeof(struct ShaderObjectUnit)); + assert(pUnit != NULL); + for (i = CCV(nShaderObjectAllocated); i < nAllocated; i++) { + ES2INTER(ShaderObjectInit)(&(pUnit[i])); + } + CCV(pShaderObject) = pUnit; + CCV(nShaderObjectAllocated) = nAllocated; + } + CCV(pShaderObject)[uResult].eShaderType = type; + return uResult; + } +} + +void GL_APIENTRY ES2ENTRY(DeleteShader)(GLuint shader) { + if (shader == 0) { + return; + } else if (FNPTR(IsShader) != NULL && FNPTR(IsShader)(shader) == GL_FALSE) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + if (FNPTR(DeleteShader) != NULL) + FNPTR(DeleteShader)(shader); + if (!CCV(nShaderObjectAllocated)) + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + if (shader < CCV(nShaderObjectAllocated)) { + struct ShaderObjectUnit* pUnit = &CCV(pShaderObject[shader]); + pUnit->bDeleteStatus = GL_TRUE; + if (pUnit->nAttached == 0) { + ES2INTER(ShaderObjectRelease)(pUnit); + } + } +} + +GLboolean GL_APIENTRY ES2ENTRY(IsShader)(GLuint shader) { + register GLboolean bResult; + bResult = FNPTR(IsShader)(shader); + return bResult; +} + +void GL_APIENTRY ES2ENTRY(ShaderSource)(GLuint shader, + GLsizei count, const char** string, const GLint* length) { + register struct ShaderObjectUnit* pUnit; + register int i; + if (CCV(bShaderCompiler) == GL_FALSE) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + if ((GLint)(shader) <= 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } else if (FNPTR(IsShader)(shader) == GL_FALSE) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + if (count < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + assert(shader < CCV(nShaderObjectAllocated)); + pUnit = &CCV(pShaderObject[shader]); + pUnit->bCompileStatus = GL_FALSE; + pUnit->nSourceUsed = count; + if (pUnit->nSourceAlloc < count) { + pUnit->aStrSource = (GLchar**)realloc(pUnit->aStrSource, count * sizeof(GLchar*)); + assert(pUnit->aStrSource != NULL); + for (i = pUnit->nSourceAlloc; i < count; i++) { + pUnit->aStrSource[i] = NULL; + } + pUnit->nSourceAlloc = count; + } + pUnit->nSourceLength = 0; + for (i = 0; i < count; i++) { + register int len = (length == NULL) ? strlen(string[i]) : length[i]; + pUnit->aStrSource[i] = (GLchar*)realloc(pUnit->aStrSource[i], (len + 2) * sizeof(GLchar)); + if (pUnit->aStrSource[i] == NULL) { + ES2INTER(SetError)(GL_OUT_OF_MEMORY); + } + strncpy(pUnit->aStrSource[i], string[i], len); + pUnit->aStrSource[i][len] = (pUnit->aStrSource[i][len - 1] != '\n') ? '\n' : '\0'; + pUnit->aStrSource[i][len + 1] = '\0'; + pUnit->nSourceLength += (pUnit->aStrSource[i][len - 1] != '\n') ? (len + 1) : len; + } + if (pUnit->nSourceLength > 0) pUnit->nSourceLength++; + ES2INTER(ShaderObjectInfoLogReset)(pUnit); + ES2INTER(ShaderObjectPrepedReset)(pUnit); + FNPTR(ShaderSource)(shader, pUnit->nSourceUsed, (const GLchar**)pUnit->aStrSource, NULL); +} + +void GL_APIENTRY ES2ENTRY(GetShaderSource)(GLuint shader, + GLsizei bufsize, GLsizei* length, char* source) { + register struct ShaderObjectUnit* pUnit; + register char* pDst; + register char* pSrc; + register int i; + register int len; + if ((GLint)(shader) <= 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } else if (FNPTR(IsShader)(shader) == GL_FALSE) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + if (bufsize < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } else if (bufsize == 0) { + return; + } else if (bufsize == 1) { + *source = '\0'; + if (length != NULL) *length = 0; + return; + } + pUnit = &CCV(pShaderObject[shader]); + pDst = source; + for (i = 0; bufsize > 1 && i < pUnit->nSourceUsed; i++) { + pSrc = pUnit->aStrSource[i]; + while (bufsize-- > 1) { + *pDst++ = *pSrc++; + } + } + *pDst = '\0'; + len = (int)(pDst - source); + if (length != NULL) { + *length = len; + } +} + +void GL_APIENTRY ES2ENTRY(ShaderBinary)(GLsizei n, const GLuint* shaders, + GLenum binaryformat, const void* binary, GLsizei length) { + register int i; + if (n < 0 || length < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + for (i = 0; i < n; i++) { + if (shaders[i] == 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } else if (FNPTR(IsShader)(shaders[i]) == GL_FALSE) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + } + + ES2INTER(SetError)(GL_INVALID_OPERATION); +} + +/* hooking for PrepLex analyzer */ +extern void hazelPrepPrepare(struct ShaderObjectUnit* pShaderObject); +extern int hazelPrepGetError(void); +extern int hazelPreplex(void); +extern void hazelPrepTerminate(void); + +extern void hazelParsePrepare(struct ShaderObjectUnit* ptr, const char* src, char* dst); +extern int hazelParseparse(void); +extern int hazelParseGetError(void); +extern void hazelParseTerminate(void); + +int hazelEnableTexture3D = GL_FALSE; + +void GL_APIENTRY ES2ENTRY(CompileShader)(GLuint shader) { + register struct ShaderObjectUnit* pUnit; + char* pExpanded; + static char* pParsed = NULL; + GLint nResult; + GLint nSemError; + if (CCV(bShaderCompiler) == GL_FALSE) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + if ((GLint)(shader) <= 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } else if (FNPTR(IsShader)(shader) == GL_FALSE) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + assert(shader < CCV(nShaderObjectAllocated)); + pUnit = &CCV(pShaderObject[shader]); + ES2INTER(ShaderObjectInfoLogReset)(pUnit); + ES2INTER(ShaderObjectPrepedReset)(pUnit); + if (pUnit->nSourceUsed <= 0) { + ES2INTER(ShaderObjectInfoLogAppend)(pUnit, "ERROR: no source code available\n"); + pUnit->bCompileStatus = GL_FALSE; + return; + } + ES2INTER(MacroInit)(); + hazelPrepPrepare(pUnit); + hazelPreplex(); + nResult = hazelPrepGetError(); + hazelPrepTerminate(); + if (nResult != 0) { + ES2INTER(ShaderObjectInfoLogAppend)(pUnit, "ERROR: stopped during preprocessing\n"); + pUnit->bCompileStatus = GL_FALSE; + ES2INTER(MacroRelease)(); + return; + } + ES2INTER(MacroUndef)("__LINE__"); + ES2INTER(MacroUndef)("__FILE__"); + pExpanded = ES2INTER(MacroExpand)(pUnit->strPreped, 0); + if (pExpanded == NULL) { + ES2INTER(ShaderObjectInfoLogAppend)(pUnit, "ERROR: stopped during source expansion\n"); + pUnit->bCompileStatus = GL_FALSE; + ES2INTER(MacroRelease)(); + return; + } + ES2INTER(MacroRelease)(); + if (strncmp (pExpanded, "#version", 8) != 0) { + /* here pParsed has removed all the useless characters like comments. + * If the first strig is not version, set the version number to be 120. + */ + const char *versionStr = "#version 120\n"; + pParsed = realloc(pParsed, 2 * strlen(pExpanded) + strlen(versionStr)); + memset(pParsed, 0, 2 * strlen(pExpanded) + strlen(versionStr)); + + strncpy(pParsed, versionStr, strlen(versionStr)); + hazelParsePrepare(pUnit, pExpanded, &pParsed[strlen(versionStr)]); + } else { + pParsed = realloc(pParsed, 2 * strlen(pExpanded)); + memset(pParsed, 0, 2 * strlen(pExpanded)); + hazelParsePrepare(pUnit, pExpanded, pParsed); + } + + nResult = hazelParseparse(); + nSemError = hazelParseGetError(); + hazelParseTerminate(); + if (nResult != 0 || nSemError != 0) { + ES2INTER(ShaderObjectInfoLogAppend)(pUnit, "ERROR: stopped during parsing\n"); + pUnit->bCompileStatus = GL_FALSE; + return; + } + FNPTR(ShaderSource)(shader, 1, (const GLchar**)&(pParsed), NULL); + FNPTR(CompileShader)(shader); + FNPTR(GetShaderiv)(shader, GL_COMPILE_STATUS, &nResult); + pUnit->bCompileStatus = (nResult == 0) ? GL_FALSE : GL_TRUE; + FNPTR(GetShaderiv)(shader, GL_INFO_LOG_LENGTH, &nResult); + if (nResult > 1) { + GLchar* str = malloc((nResult + 1) * sizeof(GLchar)); + FNPTR(GetShaderInfoLog)(shader, nResult + 1, NULL, str); + ES2INTER(ShaderObjectInfoLogAppend)(pUnit, "%s", str); + free(str); + } +} + +void GL_APIENTRY ES2ENTRY(ReleaseShaderCompiler)(void) { + if (CCV(bShaderCompiler) == GL_FALSE) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + +} + +void GL_APIENTRY ES2ENTRY(GetShaderiv)(GLuint shader, GLenum pname, GLint* params) { + register struct ShaderObjectUnit* pUnit; + int nLenInfoLog; + if (pname == GL_COMPILE_STATUS + || pname == GL_INFO_LOG_LENGTH + || pname == GL_SHADER_SOURCE_LENGTH) { + if (CCV(bShaderCompiler) == GL_FALSE) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + } + if ((GLint)(shader) <= 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } else if (FNPTR(IsShader)(shader) == GL_FALSE) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + pUnit = &CCV(pShaderObject[shader]); + switch (pname) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_SHADER_TYPE: + if (params != NULL) { + *params = pUnit->eShaderType; + } + break; + case GL_DELETE_STATUS: + if (params != NULL) { + *params = pUnit->bDeleteStatus; + } + break; + case GL_COMPILE_STATUS: + if (params != NULL) { + *params = pUnit->bCompileStatus; + } + break; + case GL_INFO_LOG_LENGTH: + if (pUnit->strInfoLog != NULL + && (nLenInfoLog = strlen(pUnit->strInfoLog)) > 0) { + if (params != NULL) { + *params = nLenInfoLog + 1; + } + } else { + FNPTR(GetShaderiv)(shader, pname, params); + } + break; + case GL_SHADER_SOURCE_LENGTH: + if (params != NULL) { + params[0] = pUnit->nSourceLength; + } + } +} + +void GL_APIENTRY ES2ENTRY(GetShaderInfoLog)(GLuint shader, + GLsizei bufsize, GLsizei* length, char* infolog) { + register struct ShaderObjectUnit* pUnit; + int len; + GLboolean done; + if ((GLint)(shader) <= 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } else if (FNPTR(IsShader)(shader) == GL_FALSE) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + if (bufsize < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + done = GL_FALSE; + if (shader < CCV(nShaderObjectAllocated)) { + pUnit = &CCV(pShaderObject[shader]); + if (pUnit->strInfoLog != NULL) { + len = strlen(pUnit->strInfoLog); + if (len + 1 <= bufsize) { + strcpy(infolog, pUnit->strInfoLog); + if (length != NULL) *length = len; + done = GL_TRUE; + } else if (bufsize > 0) { + strncpy(infolog, pUnit->strInfoLog, bufsize - 1); + infolog[bufsize - 1] = '\0'; + if (length != NULL) *length = bufsize - 1; + done = GL_TRUE; + } + } + } + if (done == GL_FALSE) { + FNPTR(GetShaderInfoLog)(shader, bufsize, length, infolog); + } +} + +void GL_APIENTRY ES2ENTRY(GetShaderPrecisionFormat)(GLenum shadertype, + GLenum precisiontype, GLint* range, GLint* precision) { + if (CCV(bShaderCompiler) == GL_FALSE) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + switch (shadertype) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_VERTEX_SHADER: + case GL_FRAGMENT_SHADER: + switch (precisiontype) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_LOW_FLOAT: + case GL_MEDIUM_FLOAT: + case GL_HIGH_FLOAT: + range[0] = -10; + range[1] = 10; + precision[0] = 1; + break; + case GL_LOW_INT: + case GL_MEDIUM_INT: + case GL_HIGH_INT: + range[0] = -10; + range[1] = 10; + precision[0] = 0; + break; + } + break; + } +} diff --git a/es_2_0/Tex3D.c b/es_2_0/Tex3D.c new file mode 100755 index 0000000..9ae7645 --- /dev/null +++ b/es_2_0/Tex3D.c @@ -0,0 +1,387 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "es2front.h" +#include <GLES2/gl2ext.h> + + +#ifndef GL_TEXTURE_WIDTH +#define GL_TEXTURE_WIDTH 0x1000 +#endif + +#ifndef GL_TEXTURE_HEIGHT +#define GL_TEXTURE_HEIGHT 0x1001 +#endif + +#ifndef GL_TEXTURE_DEPTH +#define GL_TEXTURE_DEPTH 0x8071 +#endif + +#ifndef GL_TEXTURE_INTERNAL_FORMAT +#define GL_TEXTURE_INTERNAL_FORMAT 0x1003 +#endif + + + +#if defined(PROVIDING_OES_texture_3D) + +static GLint ES2INTER(mapFormat)[] = { 0, GL_LUMINANCE, GL_LUMINANCE_ALPHA, GL_RGB, GL_RGBA }; + + +void GL_APIENTRY ES2ENTRY(TexImage3DOES)(GLenum target, + GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, + GLint border, GLenum format, GLenum type, const void* pixels) { + int iMaxSize; + if (1 <= internalformat && internalformat <= 4) { + internalformat = ES2INTER(mapFormat)[internalformat]; + } + if (1 <= format && format <= 4) { + format = ES2INTER(mapFormat)[format]; + } + switch (target) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_TEXTURE_3D_OES: + FNPTR(GetIntegerv)(GL_MAX_TEXTURE_SIZE, &iMaxSize); + break; + } + switch (format) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_ALPHA: + case GL_LUMINANCE: + case GL_LUMINANCE_ALPHA: + case GL_RGB: + case GL_RGBA: + break; + } + switch (internalformat) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_ALPHA: + case GL_LUMINANCE: + case GL_LUMINANCE_ALPHA: + case GL_RGB: + case GL_RGBA: + break; + } + switch (type) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_UNSIGNED_BYTE: + break; + case GL_UNSIGNED_SHORT_5_6_5: + if (format != GL_RGB) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + break; + case GL_UNSIGNED_SHORT_4_4_4_4: + case GL_UNSIGNED_SHORT_5_5_5_1: + if (format != GL_RGBA) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + break; + } + if (level < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } else if (ES2INTER(Log2)(iMaxSize) < level) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + if (width < 0 || iMaxSize < width || height < 0 || iMaxSize < height + || depth < 0 || iMaxSize < depth) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + if (border != 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + FNPTR(TexImage3D)(target, level, internalformat, width, height, depth, + border, format, type, pixels); +} + +void GL_APIENTRY ES2ENTRY(TexSubImage3DOES)(GLenum target, + GLint level, GLint xoffset, GLint yoffset, GLint zoffset, + GLsizei width, GLsizei height, GLsizei depth, + GLenum format, GLenum type, const GLvoid* pixels) { + int iMaxSize; + int iWidth, iHeight, iDepth; + int iInternalFormat; + if (1 <= format && format <= 4) { + format = ES2INTER(mapFormat)[format]; + } + switch (target) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_TEXTURE_3D_OES: + FNPTR(GetIntegerv)(GL_MAX_TEXTURE_SIZE, &iMaxSize); + break; + } + switch (format) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_ALPHA: + case GL_LUMINANCE: + case GL_LUMINANCE_ALPHA: + case GL_RGB: + case GL_RGBA: + break; + } + switch (type) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_UNSIGNED_BYTE: + break; + case GL_UNSIGNED_SHORT_5_6_5: + if (format != GL_RGB) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + break; + case GL_UNSIGNED_SHORT_4_4_4_4: + case GL_UNSIGNED_SHORT_5_5_5_1: + if (format != GL_RGBA) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + break; + } + if (level < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } else if (ES2INTER(Log2)(iMaxSize) < level) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + if (width < 0 || height < 0 || depth < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + FNPTR(GetTexLevelParameteriv)(target, level, GL_TEXTURE_WIDTH, &iWidth); + FNPTR(GetTexLevelParameteriv)(target, level, GL_TEXTURE_HEIGHT, &iHeight); + FNPTR(GetTexLevelParameteriv)(target, level, GL_TEXTURE_DEPTH, &iDepth); + if (xoffset < 0 || iWidth < (xoffset + width) || yoffset < 0 || iHeight < (yoffset + height) + || zoffset < 0 || iDepth < (zoffset + depth)) { + ES2INTER(SetError)(GL_INVALID_VALUE); + } + FNPTR(TexSubImage3D)(target, level, xoffset, yoffset, zoffset, + width, height, depth, format, type, pixels); +} + +void GL_APIENTRY ES2ENTRY(CopyTexSubImage3DOES)(GLenum target, + GLint level, GLint xoffset, GLint yoffset, GLint zoffset, + GLint x, GLint y, GLsizei width, GLsizei height) { + int iMaxSize; + int iWidth, iHeight, iDepth; + int iInternalFormat; + switch (target) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_TEXTURE_3D_OES: + FNPTR(GetIntegerv)(GL_MAX_TEXTURE_SIZE, &iMaxSize); + break; + } + if (level < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } else if (ES2INTER(Log2)(iMaxSize) < level) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + if (width < 0 || height < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + FNPTR(GetTexLevelParameteriv)(target, level, GL_TEXTURE_WIDTH, &iWidth); + FNPTR(GetTexLevelParameteriv)(target, level, GL_TEXTURE_HEIGHT, &iHeight); + if (xoffset < 0 || iWidth < (xoffset + width) || yoffset < 0 || iHeight < (yoffset + height) + || zoffset < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + } + FNPTR(CopyTexSubImage3D)(target, level, xoffset, yoffset, zoffset, x, y, width, height); +} + +void GL_APIENTRY ES2ENTRY(CompressedTexImage3DOES)(GLenum target, + GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, + GLint border, GLsizei imageSize, const void* data) { + GLint iCompressedTexFormats[64]; + GLint nCompressedTexFormats; + int iMaxSize; + int i; + switch (target) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_TEXTURE_3D_OES: + FNPTR(GetIntegerv)(GL_MAX_TEXTURE_SIZE, &iMaxSize); + break; + } + FNPTR(GetIntegerv)(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &nCompressedTexFormats); + FNPTR(GetIntegerv)(GL_COMPRESSED_TEXTURE_FORMATS, iCompressedTexFormats); + for (i = 0; i < nCompressedTexFormats; i++) { + if (iCompressedTexFormats[i] == internalformat) break; + } + if (i == nCompressedTexFormats) { + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + } + if (level < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } else if (ES2INTER(Log2)(iMaxSize) < level) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + if (width < 0 || iMaxSize < width || height < 0 || iMaxSize < height + || depth < 0 || iMaxSize < depth) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + if (border != 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + + FNPTR(CompressedTexImage3D)(target, level, internalformat, width, height, depth, border, + imageSize, data); +} + +void GL_APIENTRY ES2ENTRY(CompressedTexSubImage3DOES)(GLenum target, + GLint level, GLint xoffset, GLint yoffset, GLint zoffset, + GLsizei width, GLsizei height, GLsizei depth, + GLenum format, GLsizei imageSize, const GLvoid* data) { + GLint iCompressedTexFormats[64]; + GLint nCompressedTexFormats; + int iMaxSize; + int iWidth, iHeight, iDepth; + int iInternalFormat; + int i; + switch (target) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_TEXTURE_3D_OES: + FNPTR(GetIntegerv)(GL_MAX_TEXTURE_SIZE, &iMaxSize); + break; + } + FNPTR(GetIntegerv)(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &nCompressedTexFormats); + FNPTR(GetIntegerv)(GL_COMPRESSED_TEXTURE_FORMATS, iCompressedTexFormats); + for (i = 0; i < nCompressedTexFormats; i++) { + if (iCompressedTexFormats[i] == format) break; + } + if (i == nCompressedTexFormats) { + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + } + if (level < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } else if (ES2INTER(Log2)(iMaxSize) < level) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + if (width < 0 || height < 0 || depth < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + FNPTR(GetTexLevelParameteriv)(target, level, GL_TEXTURE_WIDTH, &iWidth); + FNPTR(GetTexLevelParameteriv)(target, level, GL_TEXTURE_HEIGHT, &iHeight); + FNPTR(GetTexLevelParameteriv)(target, level, GL_TEXTURE_DEPTH, &iDepth); + if (xoffset < 0 || iWidth < (xoffset + width) || yoffset < 0 || iHeight < (yoffset + height) + || zoffset < 0 || iDepth < (zoffset + depth)) { + ES2INTER(SetError)(GL_INVALID_VALUE); + } + FNPTR(CompressedTexSubImage3D)(target, level, xoffset, yoffset, zoffset, width, height, depth, + format, imageSize, data); +} + +void GL_APIENTRY ES2ENTRY(FramebufferTexture3DOES)(GLenum target, GLenum attachment, + GLenum textarget, GLuint texture, GLint level, GLint zoffset) { + GLuint uBuffer; + if (target != GL_FRAMEBUFFER) { + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + } + FNPTR(GetIntegerv)(GL_FRAMEBUFFER_BINDING, &uBuffer); + if (uBuffer == 0) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + switch (attachment) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_COLOR_ATTACHMENT0: + case GL_DEPTH_ATTACHMENT: + case GL_STENCIL_ATTACHMENT: + break; + } + if (texture == 0) { + FNPTR(FramebufferTexture2D)(target, attachment, textarget, texture, level); + return; + } + if (FNPTR(IsTexture)(texture) == GL_FALSE) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + if (level != 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + switch (textarget) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_TEXTURE_3D_OES: + FNPTR(GenerateMipmap)(GL_TEXTURE_3D_OES); + break; + } + if (zoffset < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + FNPTR(FramebufferTexture3D)(target, attachment, textarget, texture, level, zoffset); +} + + +#endif diff --git a/es_2_0/TexImage.c b/es_2_0/TexImage.c new file mode 100755 index 0000000..7dfa33f --- /dev/null +++ b/es_2_0/TexImage.c @@ -0,0 +1,346 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "es2front.h" +#include <GLES2/gl2ext.h> + + +#ifndef GL_TEXTURE_WIDTH +#define GL_TEXTURE_WIDTH 0x1000 +#endif + +#ifndef GL_TEXTURE_HEIGHT +#define GL_TEXTURE_HEIGHT 0x1001 +#endif + +#ifndef GL_TEXTURE_INTERNAL_FORMAT +#define GL_TEXTURE_INTERNAL_FORMAT 0x1003 +#endif + + +static GLint ES2INTER(mapFormat)[] = { 0, GL_LUMINANCE, GL_LUMINANCE_ALPHA, GL_RGB, GL_RGBA }; + +int GL_APIENTRY ES2INTER(Log2)(GLint x) { + register int val = 0; + if (x <= 0) return -1; + if ((x & 0xFFFF0000) != 0) { val += 16; x >>= 16; } + if ((x & 0x0000FF00) != 0) { val += 8; x >>= 8; } + if ((x & 0x000000F0) != 0) { val += 4; x >>= 4; } + if ((x & 0x0000000C) != 0) { val += 2; x >>= 2; } + if ((x & 0x00000002) != 0) { val += 1; x >>= 1; } + return val; +} + +void GL_APIENTRY ES2ENTRY(TexImage2D)(GLenum target, + GLint level, GLenum internalformat, GLsizei width, GLsizei height, + GLint border, GLenum format, GLenum type, const void* pixels) { + int iMaxSize; + if (1 <= internalformat && internalformat <= 4) { + internalformat = ES2INTER(mapFormat)[internalformat]; + } + if (1 <= format && format <= 4) { + format = ES2INTER(mapFormat)[format]; + } + switch (target) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_TEXTURE_2D: + FNPTR(GetIntegerv)(GL_MAX_TEXTURE_SIZE, &iMaxSize); + break; + case GL_TEXTURE_CUBE_MAP_POSITIVE_X: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: + if (width != height) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + FNPTR(GetIntegerv)(GL_MAX_CUBE_MAP_TEXTURE_SIZE, &iMaxSize); + break; + } + switch (format) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; +#if defined(PROVIDING_OES_packed_depth_stencil) + case GL_DEPTH_STENCIL_OES: +#endif + case GL_ALPHA: + case GL_LUMINANCE: + case GL_LUMINANCE_ALPHA: + case GL_RGB: + case GL_RGBA: + break; + } + switch (internalformat) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; +#if defined(PROVIDING_OES_packed_depth_stencil) + case GL_DEPTH_STENCIL_OES: +#endif + case GL_ALPHA: + case GL_LUMINANCE: + case GL_LUMINANCE_ALPHA: + case GL_RGB: + case GL_RGBA: + break; + } + switch (type) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; +#if defined(PROVIDING_OES_packed_depth_stencil) + case GL_UNSIGNED_INT_24_8_OES: +#endif + case GL_UNSIGNED_BYTE: + break; + case GL_UNSIGNED_SHORT_5_6_5: + if (format != GL_RGB) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + break; + case GL_UNSIGNED_SHORT_4_4_4_4: + case GL_UNSIGNED_SHORT_5_5_5_1: + if (format != GL_RGBA) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + break; + } + if (level < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } else if (ES2INTER(Log2)(iMaxSize) < level) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + if (width < 0 || iMaxSize < width || height < 0 || iMaxSize < height) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + if (border != 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + FNPTR(TexImage2D)(target, level, internalformat, width, height, border, format, type, pixels); +} + +void GL_APIENTRY ES2ENTRY(TexSubImage2D)(GLenum target, + GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, + GLenum format, GLenum type, const GLvoid* pixels) { + int iMaxSize; + int iWidth, iHeight; + int iInternalFormat; + if (1 <= format && format <= 4) { + format = ES2INTER(mapFormat)[format]; + } + switch (target) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_TEXTURE_2D: + FNPTR(GetIntegerv)(GL_MAX_TEXTURE_SIZE, &iMaxSize); + break; + case GL_TEXTURE_CUBE_MAP_POSITIVE_X: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: + if (width != height) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + FNPTR(GetIntegerv)(GL_MAX_CUBE_MAP_TEXTURE_SIZE, &iMaxSize); + break; + } + switch (format) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; +#if defined(PROVIDING_OES_packed_depth_stencil) + case GL_DEPTH_STENCIL_OES: +#endif + case GL_ALPHA: + case GL_LUMINANCE: + case GL_LUMINANCE_ALPHA: + case GL_RGB: + case GL_RGBA: + break; + } + switch (type) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; +#if defined(PROVIDING_OES_packed_depth_stencil) + case GL_UNSIGNED_INT_24_8_OES: +#endif + case GL_UNSIGNED_BYTE: + break; + case GL_UNSIGNED_SHORT_5_6_5: + if (format != GL_RGB) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + break; + case GL_UNSIGNED_SHORT_4_4_4_4: + case GL_UNSIGNED_SHORT_5_5_5_1: + if (format != GL_RGBA) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + break; + } + if (level < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } else if (ES2INTER(Log2)(iMaxSize) < level) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + if (width < 0 || height < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + FNPTR(GetTexLevelParameteriv)(target, level, GL_TEXTURE_WIDTH, &iWidth); + FNPTR(GetTexLevelParameteriv)(target, level, GL_TEXTURE_HEIGHT, &iHeight); + if (xoffset < 0 || iWidth < (xoffset + width) || yoffset < 0 || iHeight < (yoffset + height)) { + ES2INTER(SetError)(GL_INVALID_VALUE); + } + FNPTR(TexSubImage2D)(target, level, xoffset, yoffset, width, height, format, type, pixels); +} + +void GL_APIENTRY ES2ENTRY(CopyTexImage2D)(GLenum target, + GLint level, GLenum internalformat, + GLint x, GLint y, GLsizei width, GLsizei height, GLint border) { + int iMaxSize; + if (1 <= internalformat && internalformat <= 4) { + internalformat = ES2INTER(mapFormat)[internalformat]; + } + switch (target) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_TEXTURE_2D: + FNPTR(GetIntegerv)(GL_MAX_TEXTURE_SIZE, &iMaxSize); + break; + case GL_TEXTURE_CUBE_MAP_POSITIVE_X: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: + if (width != height) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + FNPTR(GetIntegerv)(GL_MAX_CUBE_MAP_TEXTURE_SIZE, &iMaxSize); + break; + } + switch (internalformat) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_ALPHA: + case GL_LUMINANCE: + case GL_LUMINANCE_ALPHA: + case GL_RGB: + case GL_RGBA: + break; + } + if (level < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } else if (ES2INTER(Log2)(iMaxSize) < level) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + if (width < 0 || iMaxSize < width || height < 0 || iMaxSize < height) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + if (border != 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + + FNPTR(CopyTexImage2D)(target, level, internalformat, x, y, width, height, border); +} + +void GL_APIENTRY ES2ENTRY(CopyTexSubImage2D)(GLenum target, + GLint level, GLint xoffset, GLint yoffset, + GLint x, GLint y, GLsizei width, GLsizei height) { + int iMaxSize; + int iWidth, iHeight; + int iInternalFormat; + switch (target) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_TEXTURE_2D: + FNPTR(GetIntegerv)(GL_MAX_TEXTURE_SIZE, &iMaxSize); + break; + case GL_TEXTURE_CUBE_MAP_POSITIVE_X: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: + if (width != height) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + FNPTR(GetIntegerv)(GL_MAX_CUBE_MAP_TEXTURE_SIZE, &iMaxSize); + break; + } + if (level < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } else if (ES2INTER(Log2)(iMaxSize) < level) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + if (width < 0 || height < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + FNPTR(GetTexLevelParameteriv)(target, level, GL_TEXTURE_WIDTH, &iWidth); + FNPTR(GetTexLevelParameteriv)(target, level, GL_TEXTURE_HEIGHT, &iHeight); + if (xoffset < 0 || iWidth < (xoffset + width) || yoffset < 0 || iHeight < (yoffset + height)) { + ES2INTER(SetError)(GL_INVALID_VALUE); + } + FNPTR(CopyTexSubImage2D)(target, level, xoffset, yoffset, x, y, width, height); +} diff --git a/es_2_0/Texture.c b/es_2_0/Texture.c new file mode 100755 index 0000000..5529ee6 --- /dev/null +++ b/es_2_0/Texture.c @@ -0,0 +1,246 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "es2front.h" +#include <GLES2/gl2ext.h> + + +void GL_APIENTRY ES2ENTRY(GenTextures)(GLsizei n, GLuint* textures) { + if (n < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } else if (n == 0) { + ES2INTER(SetError)(GL_NO_ERROR); + return; + } + FNPTR(GenTextures)(n, textures); +} + +void GL_APIENTRY ES2ENTRY(DeleteTextures)(GLsizei n, const GLuint* textures) { + if (n < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + FNPTR(DeleteTextures)(n, textures); +} + +GLboolean GL_APIENTRY ES2ENTRY(IsTexture)(GLuint texture) { + return FNPTR(IsTexture)(texture); +} + +#if ! defined(GL_GENERATE_MIPMAP) +#define GL_GENERATE_MIPMAP 0x8191 +#endif + +void GL_APIENTRY ES2ENTRY(BindTexture)(GLenum target, GLuint texture) { + switch (target) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_TEXTURE_2D: + case GL_TEXTURE_CUBE_MAP: + FNPTR(BindTexture)(target, texture); + break; + } +} + +void GL_APIENTRY ES2ENTRY(PixelStorei)(GLenum pname, GLint param) { + switch (pname) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_PACK_ALIGNMENT: + case GL_UNPACK_ALIGNMENT: + break; + } + if (param != 1 && param != 2 && param != 4 && param != 8) { + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + } + FNPTR(PixelStorei)(pname, param); +} + +void GL_APIENTRY ES2ENTRY(ActiveTexture)(GLenum texture) { + GLint iMaxCombinedTextureImageUnits; + FNPTR(GetIntegerv)(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &iMaxCombinedTextureImageUnits); + if (texture < GL_TEXTURE0 || GL_TEXTURE0 + iMaxCombinedTextureImageUnits <= texture) { + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + } + FNPTR(ActiveTexture)(texture); +} + +void GL_APIENTRY ES2ENTRY(GenerateMipmap)(GLenum target) { + switch (target) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_TEXTURE_2D: + case GL_TEXTURE_CUBE_MAP: + break; + } + FNPTR(GenerateMipmap)(target); +} + +void GL_APIENTRY ES2ENTRY(TexParameterf)(GLenum target, GLenum pname, GLfloat param) { + GLint iParam = (GLint)(param); + GLfloat fError = param - iParam; + if (fError != 0.0F) { + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + } + ES2ENTRY(TexParameteri)(target, pname, iParam); +} + +void GL_APIENTRY ES2ENTRY(TexParameterfv)(GLenum target, GLenum pname, const GLfloat* params) { + GLint iParam = (GLint)(*params); + GLfloat fError = *params - iParam; + if (fError != 0.0F) { + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + } + ES2ENTRY(TexParameteri)(target, pname, iParam); +} + +void GL_APIENTRY ES2ENTRY(TexParameteri)(GLenum target, GLenum pname, GLint param) { + switch (target) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_TEXTURE_2D: + case GL_TEXTURE_CUBE_MAP: + break; + } + switch (pname) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_TEXTURE_MIN_FILTER: + switch (param) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_NEAREST: + case GL_LINEAR: + case GL_NEAREST_MIPMAP_NEAREST: + case GL_LINEAR_MIPMAP_NEAREST: + case GL_NEAREST_MIPMAP_LINEAR: + case GL_LINEAR_MIPMAP_LINEAR: + break; + } + break; + case GL_TEXTURE_MAG_FILTER: + switch (param) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_NEAREST: + case GL_LINEAR: + break; + } + break; + case GL_TEXTURE_WRAP_S: + case GL_TEXTURE_WRAP_T: +#if defined(PROVIDING_OES_texture_3D) + case GL_TEXTURE_WRAP_R_OES: +#endif + switch (param) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_CLAMP_TO_EDGE: + case GL_MIRRORED_REPEAT: + case GL_REPEAT: + break; + } + } + FNPTR(TexParameteri)(target, pname, param); +} + +void GL_APIENTRY ES2ENTRY(TexParameteriv)(GLenum target, GLenum pname, const GLint* params) { + ES2ENTRY(TexParameteri)(target, pname, *params); +} + +void GL_APIENTRY ES2ENTRY(GetTexParameterfv)(GLenum target, GLenum pname, GLfloat* params) { + switch (target) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_TEXTURE_2D: + case GL_TEXTURE_CUBE_MAP: +#if defined(PROVIDING_OES_texture_3D) + case GL_TEXTURE_3D_OES: +#endif + break; + } + switch (pname) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_TEXTURE_MAG_FILTER: + case GL_TEXTURE_MIN_FILTER: + case GL_TEXTURE_WRAP_S: + case GL_TEXTURE_WRAP_T: +#if defined(PROVIDING_OES_texture_3D) + case GL_TEXTURE_WRAP_R_OES: +#endif + break; + } + FNPTR(GetTexParameterfv)(target, pname, params); +} + +void GL_APIENTRY ES2ENTRY(GetTexParameteriv)(GLenum target, GLenum pname, GLint* params) { + switch (target) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_TEXTURE_2D: + case GL_TEXTURE_CUBE_MAP: +#if defined(PROVIDING_OES_texture_3D) + case GL_TEXTURE_3D_OES: +#endif + break; + } + switch (pname) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_TEXTURE_MAG_FILTER: + case GL_TEXTURE_MIN_FILTER: + case GL_TEXTURE_WRAP_S: + case GL_TEXTURE_WRAP_T: +#if defined(PROVIDING_OES_texture_3D) + case GL_TEXTURE_WRAP_R_OES: +#endif + break; + } + FNPTR(GetTexParameteriv)(target, pname, params); +} diff --git a/es_2_0/Uniform.c b/es_2_0/Uniform.c new file mode 100755 index 0000000..00046df --- /dev/null +++ b/es_2_0/Uniform.c @@ -0,0 +1,918 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "es2front.h" + +/* Disable the using of glGetActiveUniform(). The previous code is to use the location + * returned from glGetUniformLocation() as the index to call glGetActiveUniform(). However + * the index may not always corresponds to the value of the location. Especially on Intel + * graphic driver, it caused errors. Seems that the only valid usage of glGetActiveUniform() + * is to iterate every index from 0 to the number of uniforms. It does not match the usage + * here. + */ +#undef ENABLE_USING_GETACTIVEUNIFORM + +static GLint* ES2INTER(pValue) = NULL; + +#ifdef ENABLE_USING_GETACTIVEUNIFORM +GLboolean GL_APIENTRY ES2INTER(GetUniformSizeType)(const char* funcname, + GLint location, GLint* size, GLenum* type) { + GLuint program; + GLint nActiveUniforms; + GLsizei nLength; + GLchar strName[256]; + FNPTR(GetIntegerv)(GL_CURRENT_PROGRAM, &program); + if (program == 0) { + SET_ERROR(GL_INVALID_OPERATION, "%s: no current program object", funcname); + return GL_FALSE; + } + FNPTR(GetProgramiv)(program, GL_ACTIVE_UNIFORMS, &nActiveUniforms); + if (location < -1 || nActiveUniforms <= location) { + SET_ERROR(GL_INVALID_OPERATION, "%s: location=%d is out of range[%d,%d]", + funcname, location, -1, nActiveUniforms); + return GL_FALSE; + } + if (location == -1) { + return GL_FALSE; + } + FNPTR(GetActiveUniform)(program, location, sizeof(strName) / sizeof(strName[0]), + &nLength, size, type, strName); + return GL_TRUE; +} +#endif + +void GL_APIENTRY ES2ENTRY(GetUniformfv)(GLuint program, GLint location, GLfloat* params) { + GLint iLinkStatus; + GLint nActiveUniforms; + if ((GLint)(program) <= 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } else if (FNPTR(IsProgram)(program) == GL_FALSE) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + FNPTR(GetProgramiv)(program, GL_LINK_STATUS, &iLinkStatus); + if (iLinkStatus == GL_FALSE) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + + FNPTR(GetProgramiv)(program, GL_ACTIVE_UNIFORMS, &nActiveUniforms); + if (location < 0 || nActiveUniforms <= location) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + + FNPTR(GetUniformfv)(program, location, params); +} + +void GL_APIENTRY ES2ENTRY(GetUniformiv)(GLuint program, GLint location, GLint* params) { + GLint iLinkStatus; + GLint nActiveUniforms; + if ((GLint)(program) <= 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } else if (FNPTR(IsProgram)(program) == GL_FALSE) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + FNPTR(GetProgramiv)(program, GL_LINK_STATUS, &iLinkStatus); + if (iLinkStatus == GL_FALSE) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + + FNPTR(GetProgramiv)(program, GL_ACTIVE_UNIFORMS, &nActiveUniforms); + if (location < 0 || nActiveUniforms <= location) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + + FNPTR(GetUniformiv)(program, location, params); +} + +void GL_APIENTRY ES2ENTRY(Uniform1f)(GLint location, GLfloat x) { +#define FUNC_NAME "Uniform1f" +#ifdef ENABLE_USING_GETACTIVEUNIFORM + GLint iSize; + GLenum eType; + if (ES2INTER(GetUniformSizeType)(FUNC_NAME, location, &iSize, &eType) == GL_FALSE) { + return; + } + switch (eType) { + default: + assert(0); + case GL_FLOAT_VEC2: + case GL_FLOAT_VEC3: + case GL_FLOAT_VEC4: + case GL_INT: + case GL_INT_VEC2: + case GL_INT_VEC3: + case GL_INT_VEC4: + case GL_BOOL_VEC2: + case GL_BOOL_VEC3: + case GL_BOOL_VEC4: + case GL_FLOAT_MAT2: + case GL_FLOAT_MAT3: + case GL_FLOAT_MAT4: + case GL_SAMPLER_2D: + case GL_SAMPLER_CUBE: + SET_ERROR(GL_INVALID_OPERATION, FUNCNAME ": cannot handle uniform of (size=%d,type=%s).", + iSize, GET_NAME(eType)); + return; + case GL_BOOL: + FNPTR(Uniform1i)(location, (x != 0.0F)); + break; + case GL_FLOAT: + FNPTR(Uniform1f)(location, x); + break; + } +#else + FNPTR(Uniform1f)(location, x); +#endif +#undef FUNC_NAME +} + +void GL_APIENTRY ES2ENTRY(Uniform2f)(GLint location, GLfloat x, GLfloat y) { +#define FUNC_NAME "Uniform2f" +#ifdef ENABLE_USING_GETACTIVEUNIFORM + GLint iSize; + GLenum eType; + if (ES2INTER(GetUniformSizeType)("Uniform2f", location, &iSize, &eType) == GL_FALSE) { + return; + } + switch (eType) { + default: + assert(0); + case GL_FLOAT: + case GL_FLOAT_VEC3: + case GL_FLOAT_VEC4: + case GL_INT: + case GL_INT_VEC2: + case GL_INT_VEC3: + case GL_INT_VEC4: + case GL_BOOL: + case GL_BOOL_VEC3: + case GL_BOOL_VEC4: + case GL_FLOAT_MAT2: + case GL_FLOAT_MAT3: + case GL_FLOAT_MAT4: + case GL_SAMPLER_2D: + case GL_SAMPLER_CUBE: + SET_ERROR(GL_INVALID_OPERATION, FUNCNAME ": cannot handle uniform of (size=%d,type=%s).", + iSize, GET_NAME(eType)); + return; + case GL_BOOL_VEC2: + FNPTR(Uniform2i)(location, (x != 0.0F), (y != 0.0F)); + break; + case GL_FLOAT_VEC2: + FNPTR(Uniform2f)(location, x, y); + break; + } +#else + FNPTR(Uniform2f)(location, x, y); +#endif +#undef FUNC_NAME +} + +void GL_APIENTRY ES2ENTRY(Uniform3f)(GLint location, GLfloat x, GLfloat y, GLfloat z) { +#define FUNC_NAME "Uniform3f" +#ifdef ENABLE_USING_GETACTIVEUNIFORM + GLint iSize; + GLenum eType; + if (ES2INTER(GetUniformSizeType)(FUNC_NAME, location, &iSize, &eType) == GL_FALSE) { + return; + } + switch (eType) { + default: + assert(0); + case GL_FLOAT: + case GL_FLOAT_VEC2: + case GL_FLOAT_VEC4: + case GL_INT: + case GL_INT_VEC2: + case GL_INT_VEC3: + case GL_INT_VEC4: + case GL_BOOL: + case GL_BOOL_VEC2: + case GL_BOOL_VEC4: + case GL_FLOAT_MAT2: + case GL_FLOAT_MAT3: + case GL_FLOAT_MAT4: + case GL_SAMPLER_2D: + case GL_SAMPLER_CUBE: + SET_ERROR(GL_INVALID_OPERATION, FUNCNAME ": cannot handle uniform of (size=%d,type=%s).", + iSize, GET_NAME(eType)); + return; + case GL_BOOL_VEC3: + FNPTR(Uniform3i)(location, (x != 0.0F), (y != 0.0F), (z != 0.0F)); + break; + case GL_FLOAT_VEC3: + FNPTR(Uniform3f)(location, x, y, z); + break; + } +#else + FNPTR(Uniform3f)(location, x, y, z); +#endif +#undef FUNC_NAME +} + +void GL_APIENTRY ES2ENTRY(Uniform4f)(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) { +#define FUNC_NAME "Uniform4f" +#ifdef ENABLE_USING_GETACTIVEUNIFORM + GLint iSize; + GLenum eType; + if (ES2INTER(GetUniformSizeType)(FUNC_NAME, location, &iSize, &eType) == GL_FALSE) { + return; + } + switch (eType) { + default: + assert(0); + case GL_FLOAT: + case GL_FLOAT_VEC2: + case GL_FLOAT_VEC3: + case GL_INT: + case GL_INT_VEC2: + case GL_INT_VEC3: + case GL_INT_VEC4: + case GL_BOOL: + case GL_BOOL_VEC2: + case GL_BOOL_VEC3: + case GL_FLOAT_MAT2: + case GL_FLOAT_MAT3: + case GL_FLOAT_MAT4: + case GL_SAMPLER_2D: + case GL_SAMPLER_CUBE: + SET_ERROR(GL_INVALID_OPERATION, FUNCNAME ": cannot handle uniform of (size=%d,type=%s).", + iSize, GET_NAME(eType)); + return; + case GL_BOOL_VEC4: + FNPTR(Uniform4i)(location, (x != 0.0F), (y != 0.0F), (z != 0.0F), (w != 0.0F)); + break; + case GL_FLOAT_VEC4: + FNPTR(Uniform4f)(location, x, y, z, w); + break; + } +#else + FNPTR(Uniform4f)(location, x, y, z, w); +#endif +#undef FUNC_NAME +} + +void GL_APIENTRY ES2ENTRY(Uniform1fv)(GLint location, GLsizei count, const GLfloat* v) { +#define FUNC_NAME "Uniform1fv" +#ifdef ENABLE_USING_GETACTIVEUNIFORM + GLint iSize; + GLenum eType; + register int i; + if ((GLint)(count) < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + if (ES2INTER(GetUniformSizeType)(FUNC_NAME, location, &iSize, &eType) == GL_FALSE) { + return; + } + if (1 < count && iSize == 1) { + SET_ERROR(GL_INVALID_OPERATION, FUNCNAME ": uniform of (size=%d,type=%s) is not an array.", + iSize, GET_NAME(eType)); + return; + } + switch (eType) { + default: + assert(0); case GL_FLOAT_VEC2: + case GL_FLOAT_VEC3: + case GL_FLOAT_VEC4: + case GL_INT: + case GL_INT_VEC2: + case GL_INT_VEC3: + case GL_INT_VEC4: + case GL_BOOL_VEC2: + case GL_BOOL_VEC3: + case GL_BOOL_VEC4: + case GL_FLOAT_MAT2: + case GL_FLOAT_MAT3: + case GL_FLOAT_MAT4: + case GL_SAMPLER_2D: + case GL_SAMPLER_CUBE: + SET_ERROR(GL_INVALID_OPERATION, FUNCNAME ": cannot handle uniform of (size=%d,type=%s).", + iSize, GET_NAME(eType)); + return; + case GL_BOOL: + ES2INTER(pValue) = (GLint*)realloc(ES2INTER(pValue), count * sizeof(GLint)); + for (i = 0; i < count; i++) { + ES2INTER(pValue)[i] = (v[i] == 0.0F) ? GL_FALSE : GL_TRUE; + } + FNPTR(Uniform1iv)(location, count, ES2INTER(pValue)); + break; + case GL_FLOAT: + FNPTR(Uniform1fv)(location, count, v); + break; + } +#else + FNPTR(Uniform1fv)(location, count, v); +#endif +#undef FUNC_NAME +} + +void GL_APIENTRY ES2ENTRY(Uniform2fv)(GLint location, GLsizei count, const GLfloat* v) { +#define FUNC_NAME "Uniform2fv" +#ifdef ENABLE_USING_GETACTIVEUNIFORM + GLint iSize; + GLenum eType; + register int i; + if ((GLint)(count) < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + if (ES2INTER(GetUniformSizeType)(FUNC_NAME, location, &iSize, &eType) == GL_FALSE) { + return; + } + if (1 < count && iSize == 1) { + SET_ERROR(GL_INVALID_OPERATION, FUNCNAME ": uniform of (size=%d,type=%s) is not an array.", + iSize, GET_NAME(eType)); + return; + } + switch (eType) { + default: + assert(0); + case GL_FLOAT: + case GL_FLOAT_VEC3: + case GL_FLOAT_VEC4: + case GL_INT: + case GL_INT_VEC2: + case GL_INT_VEC3: + case GL_INT_VEC4: + case GL_BOOL: + case GL_BOOL_VEC3: + case GL_BOOL_VEC4: + case GL_FLOAT_MAT2: + case GL_FLOAT_MAT3: + case GL_FLOAT_MAT4: + case GL_SAMPLER_2D: + case GL_SAMPLER_CUBE: + SET_ERROR(GL_INVALID_OPERATION, FUNCNAME ": cannot handle uniform of (size=%d,type=%s).", + iSize, GET_NAME(eType)); + return; + case GL_BOOL_VEC2: + ES2INTER(pValue) = (GLint*)realloc(ES2INTER(pValue), 2 * count * sizeof(GLint)); + for (i = 0; i < 2 * count; i++) { + ES2INTER(pValue)[i] = (v[i] == 0.0F) ? GL_FALSE : GL_TRUE; + } + FNPTR(Uniform2iv)(location, count, ES2INTER(pValue)); + break; + case GL_FLOAT_VEC2: + FNPTR(Uniform2fv)(location, count, v); + break; + } +#else + FNPTR(Uniform2fv)(location, count, v); +#endif +#undef FUNC_NAME +} + +void GL_APIENTRY ES2ENTRY(Uniform3fv)(GLint location, GLsizei count, const GLfloat* v) { +#define FUNC_NAME "Uniform3fv" +#ifdef ENABLE_USING_GETACTIVEUNIFORM + GLint iSize; + GLenum eType; + register int i; + if ((GLint)(count) < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + if (ES2INTER(GetUniformSizeType)(FUNC_NAME, location, &iSize, &eType) == GL_FALSE) { + return; + } + if (1 < count && iSize == 1) { + SET_ERROR(GL_INVALID_OPERATION, FUNCNAME ": uniform of (size=%d,type=%s) is not an array.", + iSize, GET_NAME(eType)); + return; + } + switch (eType) { + default: + assert(0); + case GL_FLOAT: + case GL_FLOAT_VEC2: + case GL_FLOAT_VEC4: + case GL_INT: + case GL_INT_VEC2: + case GL_INT_VEC3: + case GL_INT_VEC4: + case GL_BOOL: + case GL_BOOL_VEC2: + case GL_BOOL_VEC4: + case GL_FLOAT_MAT2: + case GL_FLOAT_MAT3: + case GL_FLOAT_MAT4: + case GL_SAMPLER_2D: + case GL_SAMPLER_CUBE: + SET_ERROR(GL_INVALID_OPERATION, FUNCNAME ": cannot handle uniform of (size=%d,type=%s).", + iSize, GET_NAME(eType)); + return; + case GL_BOOL_VEC3: + ES2INTER(pValue) = (GLint*)realloc(ES2INTER(pValue), 3 * count * sizeof(GLint)); + for (i = 0; i < 3 * count; i++) { + ES2INTER(pValue)[i] = (v[i] == 0.0F) ? GL_FALSE : GL_TRUE; + } + FNPTR(Uniform3iv)(location, count, ES2INTER(pValue)); + break; + case GL_FLOAT_VEC3: + FNPTR(Uniform3fv)(location, count, v); + break; + } +#else + FNPTR(Uniform3fv)(location, count, v); +#endif +#undef FUNC_NAME +} + +void GL_APIENTRY ES2ENTRY(Uniform4fv)(GLint location, GLsizei count, const GLfloat* v) { +#define FUNC_NAME "Uniform4fv" +#ifdef ENABLE_USING_GETACTIVEUNIFORM + GLint iSize; + GLenum eType; + register int i; + if ((GLint)(count) < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + if (ES2INTER(GetUniformSizeType)(FUNC_NAME, location, &iSize, &eType) == GL_FALSE) { + return; + } + if (1 < count && iSize == 1) { + SET_ERROR(GL_INVALID_OPERATION, FUNCNAME ": uniform of (size=%d,type=%s) is not an array.", + iSize, GET_NAME(eType)); + return; + } + switch (eType) { + default: + assert(0); + case GL_FLOAT: + case GL_FLOAT_VEC2: + case GL_FLOAT_VEC3: + case GL_INT: + case GL_INT_VEC2: + case GL_INT_VEC3: + case GL_INT_VEC4: + case GL_BOOL: + case GL_BOOL_VEC2: + case GL_BOOL_VEC3: + case GL_FLOAT_MAT2: + case GL_FLOAT_MAT3: + case GL_FLOAT_MAT4: + case GL_SAMPLER_2D: + case GL_SAMPLER_CUBE: + SET_ERROR(GL_INVALID_OPERATION, FUNCNAME ": cannot handle uniform of (size=%d,type=%s).", + iSize, GET_NAME(eType)); + return; + case GL_BOOL_VEC4: + ES2INTER(pValue) = (GLint*)realloc(ES2INTER(pValue), 4 * count * sizeof(GLint)); + for (i = 0; i < 4 * count; i++) { + ES2INTER(pValue)[i] = (v[i] == 0.0F) ? GL_FALSE : GL_TRUE; + } + FNPTR(Uniform4iv)(location, count, ES2INTER(pValue)); + break; + case GL_FLOAT_VEC4: + FNPTR(Uniform4fv)(location, count, v); + break; + } +#else + FNPTR(Uniform4fv)(location, count, v); +#endif +#undef FUNC_NAME +} + +void GL_APIENTRY ES2ENTRY(Uniform1i)(GLint location, GLint x) { +#define FUNC_NAME "Uniform1i" +#ifdef ENABLE_USING_GETACTIVEUNIFORM + GLint iSize; + GLenum eType; + if (ES2INTER(GetUniformSizeType)(FUNC_NAME, location, &iSize, &eType) == GL_FALSE) { + return; + } + switch (eType) { + default: + assert(0); + case GL_FLOAT: + case GL_FLOAT_VEC2: + case GL_FLOAT_VEC3: + case GL_FLOAT_VEC4: + case GL_INT_VEC2: + case GL_INT_VEC3: + case GL_INT_VEC4: + case GL_BOOL_VEC2: + case GL_BOOL_VEC3: + case GL_BOOL_VEC4: + case GL_FLOAT_MAT2: + case GL_FLOAT_MAT3: + case GL_FLOAT_MAT4: + SET_ERROR(GL_INVALID_OPERATION, FUNCNAME ": cannot handle uniform of (size=%d,type=%s).", + iSize, GET_NAME(eType)); + return; + case GL_INT: + case GL_BOOL: + case GL_SAMPLER_2D: + case GL_SAMPLER_CUBE: + FNPTR(Uniform1i)(location, x); + break; + } +#else + FNPTR(Uniform1i)(location, x); +#endif +#undef FUNC_NAME +} + +void GL_APIENTRY ES2ENTRY(Uniform2i)(GLint location, GLint x, GLint y) { +#define FUNC_NAME "Uniform2i" +#ifdef ENABLE_USING_GETACTIVEUNIFORM + GLint iSize; + GLenum eType; + if (ES2INTER(GetUniformSizeType)(FUNC_NAME, location, &iSize, &eType) == GL_FALSE) { + return; + } + switch (eType) { + default: + assert(0); + case GL_FLOAT: + case GL_FLOAT_VEC2: + case GL_FLOAT_VEC3: + case GL_FLOAT_VEC4: + case GL_INT: + case GL_INT_VEC3: + case GL_INT_VEC4: + case GL_BOOL: + case GL_BOOL_VEC3: + case GL_BOOL_VEC4: + case GL_FLOAT_MAT2: + case GL_FLOAT_MAT3: + case GL_FLOAT_MAT4: + case GL_SAMPLER_2D: + case GL_SAMPLER_CUBE: + SET_ERROR(GL_INVALID_OPERATION, FUNCNAME ": cannot handle uniform of (size=%d,type=%s).", + iSize, GET_NAME(eType)); + return; + case GL_INT_VEC2: + case GL_BOOL_VEC2: + FNPTR(Uniform2i)(location, x, y); + break; + } +#else + FNPTR(Uniform2i)(location, x, y); +#endif +#undef FUNC_NAME +} + +void GL_APIENTRY ES2ENTRY(Uniform3i)(GLint location, GLint x, GLint y, GLint z) { +#define FUNC_NAME "Uniform3i" +#ifdef ENABLE_USING_GETACTIVEUNIFORM + GLint iSize; + GLenum eType; + if (ES2INTER(GetUniformSizeType)(FUNC_NAME, location, &iSize, &eType) == GL_FALSE) { + return; + } + switch (eType) { + default: + assert(0); + case GL_FLOAT: + case GL_FLOAT_VEC2: + case GL_FLOAT_VEC3: + case GL_FLOAT_VEC4: + case GL_INT: + case GL_INT_VEC2: + case GL_INT_VEC4: + case GL_BOOL: + case GL_BOOL_VEC2: + case GL_BOOL_VEC4: + case GL_FLOAT_MAT2: + case GL_FLOAT_MAT3: + case GL_FLOAT_MAT4: + case GL_SAMPLER_2D: + case GL_SAMPLER_CUBE: + SET_ERROR(GL_INVALID_OPERATION, FUNCNAME ": cannot handle uniform of (size=%d,type=%s).", + iSize, GET_NAME(eType)); + return; + case GL_INT_VEC3: + case GL_BOOL_VEC3: + FNPTR(Uniform3i)(location, x, y, z); + break; + } +#else + FNPTR(Uniform3i)(location, x, y, z); +#endif +#undef FUNC_NAME +} + +void GL_APIENTRY ES2ENTRY(Uniform4i)(GLint location, GLint x, GLint y, GLint z, GLint w) { +#define FUNC_NAME "Uniform4i" +#ifdef ENABLE_USING_GETACTIVEUNIFORM + GLint iSize; + GLenum eType; + if (ES2INTER(GetUniformSizeType)(FUNC_NAME, location, &iSize, &eType) == GL_FALSE) { + return; + } + switch (eType) { + default: + assert(0); + case GL_FLOAT: + case GL_FLOAT_VEC2: + case GL_FLOAT_VEC3: + case GL_FLOAT_VEC4: + case GL_INT: + case GL_INT_VEC2: + case GL_INT_VEC3: + case GL_BOOL: + case GL_BOOL_VEC2: + case GL_BOOL_VEC3: + case GL_FLOAT_MAT2: + case GL_FLOAT_MAT3: + case GL_FLOAT_MAT4: + case GL_SAMPLER_2D: + case GL_SAMPLER_CUBE: + SET_ERROR(GL_INVALID_OPERATION, FUNCNAME ": cannot handle uniform of (size=%d,type=%s).", + iSize, GET_NAME(eType)); + return; + case GL_INT_VEC4: + case GL_BOOL_VEC4: + FNPTR(Uniform4i)(location, x, y, z, w); + break; + } +#else + FNPTR(Uniform4i)(location, x, y, z, w); +#endif +#undef FUNC_NAME +} + +void GL_APIENTRY ES2ENTRY(Uniform1iv)(GLint location, GLsizei count, const GLint* v) { +#define FUNC_NAME "Uniform1iv" + if ((GLint)(count) < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } +#ifdef ENABLE_USING_GETACTIVEUNIFORM + GLint iSize; + GLenum eType; + if (ES2INTER(GetUniformSizeType)(FUNC_NAME, location, &iSize, &eType) == GL_FALSE) { + return; + } + if (1 < count && iSize == 1) { + SET_ERROR(GL_INVALID_OPERATION, FUNCNAME ": uniform of (size=%d,type=%s) is not an array.", + iSize, GET_NAME(eType)); + return; + } + switch (eType) { + default: + assert(0); + case GL_FLOAT_VEC2: + case GL_FLOAT_VEC3: + case GL_FLOAT_VEC4: + case GL_INT_VEC2: + case GL_INT_VEC3: + case GL_INT_VEC4: + case GL_BOOL_VEC2: + case GL_BOOL_VEC3: + case GL_BOOL_VEC4: + case GL_FLOAT: + case GL_FLOAT_MAT2: + case GL_FLOAT_MAT3: + case GL_FLOAT_MAT4: + SET_ERROR(GL_INVALID_OPERATION, FUNCNAME ": cannot handle uniform of (size=%d,type=%s).", + iSize, GET_NAME(eType)); + return; + case GL_INT: + case GL_BOOL: + case GL_SAMPLER_2D: + case GL_SAMPLER_CUBE: + FNPTR(Uniform1iv)(location, count, v); + break; + } +#else + FNPTR(Uniform1iv)(location, count, v); +#endif +#undef FUNC_NAME +} + +void GL_APIENTRY ES2ENTRY(Uniform2iv)(GLint location, GLsizei count, const GLint* v) { +#define FUNC_NAME "Uniform2iv" + if ((GLint)(count) < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } +#ifdef ENABLE_USING_GETACTIVEUNIFORM + GLint iSize; + GLenum eType; + if (ES2INTER(GetUniformSizeType)(FUNC_NAME, location, &iSize, &eType) == GL_FALSE) { + return; + } + if (1 < count && iSize == 1) { + SET_ERROR(GL_INVALID_OPERATION, FUNCNAME ": uniform of (size=%d,type=%s) is not an array.", + iSize, GET_NAME(eType)); + return; + } + switch (eType) { + default: + assert(0); + case GL_FLOAT: + case GL_FLOAT_VEC2: + case GL_FLOAT_VEC3: + case GL_FLOAT_VEC4: + case GL_INT: + case GL_INT_VEC3: + case GL_INT_VEC4: + case GL_BOOL: + case GL_BOOL_VEC3: + case GL_BOOL_VEC4: + case GL_FLOAT_MAT2: + case GL_FLOAT_MAT3: + case GL_FLOAT_MAT4: + case GL_SAMPLER_2D: + case GL_SAMPLER_CUBE: + SET_ERROR(GL_INVALID_OPERATION, FUNCNAME ": cannot handle uniform of (size=%d,type=%s).", + iSize, GET_NAME(eType)); + return; + case GL_INT_VEC2: + case GL_BOOL_VEC2: + FNPTR(Uniform2iv)(location, count, v); + break; + } +#else + FNPTR(Uniform2iv)(location, count, v); +#endif +#undef FUNC_NAME +} + +void GL_APIENTRY ES2ENTRY(Uniform3iv)(GLint location, GLsizei count, const GLint* v) { +#define FUNC_NAME "Uniform3iv" + if ((GLint)(count) < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } +#ifdef ENABLE_USING_GETACTIVEUNIFORM + GLint iSize; + GLenum eType; + if (ES2INTER(GetUniformSizeType)(FUNC_NAME, location, &iSize, &eType) == GL_FALSE) { + return; + } + if (1 < count && iSize == 1) { + SET_ERROR(GL_INVALID_OPERATION, FUNCNAME ": uniform of (size=%d,type=%s) is not an array.", + iSize, GET_NAME(eType)); + return; + } + switch (eType) { + default: + assert(0); + case GL_FLOAT: + case GL_FLOAT_VEC2: + case GL_FLOAT_VEC3: + case GL_FLOAT_VEC4: + case GL_INT: + case GL_INT_VEC2: + case GL_INT_VEC4: + case GL_BOOL: + case GL_BOOL_VEC2: + case GL_BOOL_VEC4: + case GL_FLOAT_MAT2: + case GL_FLOAT_MAT3: + case GL_FLOAT_MAT4: + case GL_SAMPLER_2D: + case GL_SAMPLER_CUBE: + SET_ERROR(GL_INVALID_OPERATION, FUNCNAME ": cannot handle uniform of (size=%d,type=%s).", + iSize, GET_NAME(eType)); + return; + case GL_INT_VEC3: + case GL_BOOL_VEC3: + FNPTR(Uniform3iv)(location, count, v); + break; + } +#else + FNPTR(Uniform3iv)(location, count, v); +#endif +#undef FUNC_NAME +} + +void GL_APIENTRY ES2ENTRY(Uniform4iv)(GLint location, GLsizei count, const GLint* v) { +#define FUNC_NAME "Uniform4iv" + if ((GLint)(count) < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } +#ifdef ENABLE_USING_GETACTIVEUNIFORM + GLint iSize; + GLenum eType; + if (ES2INTER(GetUniformSizeType)(FUNC_NAME, location, &iSize, &eType) == GL_FALSE) { + return; + } + if (1 < count && iSize == 1) { + SET_ERROR(GL_INVALID_OPERATION, FUNCNAME ": uniform of (size=%d,type=%s) is not an array.", + iSize, GET_NAME(eType)); + return; + } + switch (eType) { + default: + assert(0); + case GL_FLOAT: + case GL_FLOAT_VEC2: + case GL_FLOAT_VEC3: + case GL_FLOAT_VEC4: + case GL_INT: + case GL_INT_VEC2: + case GL_INT_VEC3: + case GL_BOOL: + case GL_BOOL_VEC2: + case GL_BOOL_VEC3: + case GL_FLOAT_MAT2: + case GL_FLOAT_MAT3: + case GL_FLOAT_MAT4: + case GL_SAMPLER_2D: + case GL_SAMPLER_CUBE: + SET_ERROR(GL_INVALID_OPERATION, FUNCNAME ": cannot handle uniform of (size=%d,type=%s).", + iSize, GET_NAME(eType)); + return; + case GL_INT_VEC4: + case GL_BOOL_VEC4: + FNPTR(Uniform4iv)(location, count, v); + break; + } +#else + FNPTR(Uniform4iv)(location, count, v); +#endif +#undef FUNC_NAME +} + +void GL_APIENTRY ES2ENTRY(UniformMatrix2fv)(GLint location, + GLsizei count, GLboolean transpose, const GLfloat* value) { +#define FUNC_NAME "UniformMatrix2fv" + GLint iSize; + GLenum eType; + if ((GLint)(count) < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + if (transpose != GL_FALSE) { + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + } + FNPTR(UniformMatrix2fv)(location, count, transpose, value); +#undef FUNC_NAME +} + +void GL_APIENTRY ES2ENTRY(UniformMatrix3fv)(GLint location, + GLsizei count, GLboolean transpose, const GLfloat* value) { +#define FUNC_NAME "UniformMatrix3fv" + GLint iSize; + GLenum eType; + if ((GLint)(count) < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + if (transpose != GL_FALSE) { + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + } + FNPTR(UniformMatrix3fv)(location, count, transpose, value); +#undef FUNC_NAME +} + +void GL_APIENTRY ES2ENTRY(UniformMatrix4fv)(GLint location, + GLsizei count, GLboolean transpose, const GLfloat* value) { +#define FUNC_NAME "UniformMatrix4fv" + GLint iSize; + GLenum eType; + if ((GLint)(count) < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + if (transpose != GL_FALSE) { + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + } + FNPTR(UniformMatrix4fv)(location, count, transpose, value); +#undef FUNC_NAME +} diff --git a/es_2_0/VertexAttrib.c b/es_2_0/VertexAttrib.c new file mode 100755 index 0000000..041698b --- /dev/null +++ b/es_2_0/VertexAttrib.c @@ -0,0 +1,97 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "es2front.h" + + +void GL_APIENTRY ES2ENTRY(VertexAttrib1f)(GLuint indx, GLfloat x) { + if (CCV(nMaxVertexAttribs) <= indx) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + FNPTR(VertexAttrib1f)(indx, x); +} + +void GL_APIENTRY ES2ENTRY(VertexAttrib2f)(GLuint indx, GLfloat x, GLfloat y) { + if (CCV(nMaxVertexAttribs) <= indx) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + FNPTR(VertexAttrib2f)(indx, x, y); +} + +void GL_APIENTRY ES2ENTRY(VertexAttrib3f)(GLuint indx, GLfloat x, GLfloat y, GLfloat z) { + if (CCV(nMaxVertexAttribs) <= indx) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + FNPTR(VertexAttrib3f)(indx, x, y, z); +} + +void GL_APIENTRY ES2ENTRY(VertexAttrib4f)(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w) { + if (CCV(nMaxVertexAttribs) <= indx) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + FNPTR(VertexAttrib4f)(indx, x, y, z, w); +} + +void GL_APIENTRY ES2ENTRY(VertexAttrib1fv)(GLuint indx, const GLfloat* values) { + if (CCV(nMaxVertexAttribs) <= indx) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + FNPTR(VertexAttrib1fv)(indx, values); +} + +void GL_APIENTRY ES2ENTRY(VertexAttrib2fv)(GLuint indx, const GLfloat* values) { + if (CCV(nMaxVertexAttribs) <= indx) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + FNPTR(VertexAttrib2fv)(indx, values); +} + +void GL_APIENTRY ES2ENTRY(VertexAttrib3fv)(GLuint indx, const GLfloat* values) { + if (CCV(nMaxVertexAttribs) <= indx) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + FNPTR(VertexAttrib3fv)(indx, values); +} + +void GL_APIENTRY ES2ENTRY(VertexAttrib4fv)(GLuint indx, const GLfloat* values) { + if (CCV(nMaxVertexAttribs) <= indx) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + FNPTR(VertexAttrib4fv)(indx, values); +} diff --git a/es_2_0/VertexPointer.c b/es_2_0/VertexPointer.c new file mode 100755 index 0000000..8150641 --- /dev/null +++ b/es_2_0/VertexPointer.c @@ -0,0 +1,211 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "es2front.h" + + +void GL_APIENTRY ES2INTER(VertexAttribInit)(struct VertexAttribUnit* pUnit) { + pUnit->bEnabled = GL_FALSE; + pUnit->iSize = 4; + pUnit->eType = GL_FLOAT; + pUnit->bNormalized = GL_FALSE; + pUnit->uStride = 0; + pUnit->pData = NULL; + pUnit->pConverted = NULL; + pUnit->uBufferBinding = 0; +} + +void GL_APIENTRY ES2INTER(VertexAttribRelease)(struct VertexAttribUnit* pUnit) { + if (pUnit->pConverted != NULL) { + free(pUnit->pConverted); + pUnit->pConverted = NULL; + } +} + +void GL_APIENTRY ES2ENTRY(VertexAttribPointer)(GLuint indx, + GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr) { + struct VertexAttribUnit* pVertexAttrib; + if (CCV(nMaxVertexAttribs) <= indx) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + if (size < 1 || 4 < size) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + if (stride < 0) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + switch (type) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_BYTE: + case GL_UNSIGNED_BYTE: + case GL_SHORT: + case GL_UNSIGNED_SHORT: + case GL_FIXED: + case GL_FLOAT: + break; + } + pVertexAttrib = &(CCV(pVertexAttrib[indx])); + pVertexAttrib->iSize = size; + pVertexAttrib->eType = type; + pVertexAttrib->bNormalized = normalized; + if (stride == 0) { + switch (type) { + case GL_BYTE: pVertexAttrib->uStride = size * sizeof(GLbyte); break; + case GL_UNSIGNED_BYTE: pVertexAttrib->uStride = size * sizeof(GLubyte); break; + case GL_SHORT: pVertexAttrib->uStride = size * sizeof(GLshort); break; + case GL_UNSIGNED_SHORT: pVertexAttrib->uStride = size * sizeof(GLushort); break; + case GL_FIXED: pVertexAttrib->uStride = size * sizeof(GLfixed); break; + case GL_FLOAT: pVertexAttrib->uStride = size * sizeof(GLfloat); break; + } + } else { + pVertexAttrib->uStride = stride; + } + pVertexAttrib->pData = ptr; + pVertexAttrib->uBufferBinding = CCV(uArrayBufferBinding); + if (type == GL_FIXED) { + FNPTR(VertexAttribPointer)(indx, size, GL_FLOAT, normalized, stride, ptr); + } else { + FNPTR(VertexAttribPointer)(indx, size, type, normalized, stride, ptr); + } +} + +void GL_APIENTRY ES2ENTRY(EnableVertexAttribArray)(GLuint index) { + if (CCV(nMaxVertexAttribs) <= index) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + CCV(pVertexAttrib[index].bEnabled) = GL_TRUE; + FNPTR(EnableVertexAttribArray)(index); +} + +void GL_APIENTRY ES2ENTRY(DisableVertexAttribArray)(GLuint index) { + if (CCV(nMaxVertexAttribs) <= index) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + CCV(pVertexAttrib[index].bEnabled) = GL_FALSE; + FNPTR(DisableVertexAttribArray)(index); +} + +void GL_APIENTRY ES2ENTRY(GetVertexAttribPointerv)(GLuint index, GLenum pname, void** pointer) { + if (pname != GL_VERTEX_ATTRIB_ARRAY_POINTER) { + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + } + if (CCV(nMaxVertexAttribs) <= index) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + *pointer = (void*)CCV(pVertexAttrib[index].pData); +} + +void GL_APIENTRY ES2ENTRY(GetVertexAttribfv)(GLuint index, GLenum pname, GLfloat* params) { + struct VertexAttribUnit* pVertexAttrib; + if (CCV(nMaxVertexAttribs) <= index) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + pVertexAttrib = &(CCV(pVertexAttrib[index])); + switch (pname) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: + *params = (GLfloat)(pVertexAttrib->uBufferBinding); + break; + case GL_VERTEX_ATTRIB_ARRAY_ENABLED: + *params = (GLfloat)(pVertexAttrib->bEnabled); + break; + case GL_VERTEX_ATTRIB_ARRAY_SIZE: + *params = (GLfloat)(pVertexAttrib->iSize); + break; + case GL_VERTEX_ATTRIB_ARRAY_STRIDE: + *params = (GLfloat)(pVertexAttrib->uStride); + break; + case GL_VERTEX_ATTRIB_ARRAY_TYPE: + *params = (GLfloat)(pVertexAttrib->eType); + break; + case GL_VERTEX_ATTRIB_ARRAY_NORMALIZED: + *params = (GLfloat)(pVertexAttrib->bNormalized); + break; + case GL_CURRENT_VERTEX_ATTRIB: + if (index == 0) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + FNPTR(GetVertexAttribfv)(index, pname, params); + break; + } +} + +void GL_APIENTRY ES2ENTRY(GetVertexAttribiv)(GLuint index, GLenum pname, GLint* params) { + struct VertexAttribUnit* pVertexAttrib; + if (CCV(nMaxVertexAttribs) <= index) { + ES2INTER(SetError)(GL_INVALID_VALUE); + return; + } + pVertexAttrib = &(CCV(pVertexAttrib[index])); + switch (pname) { + default: + ES2INTER(SetError)(GL_INVALID_ENUM); + return; + case GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: + *params = (GLint)(pVertexAttrib->uBufferBinding); + break; + case GL_VERTEX_ATTRIB_ARRAY_ENABLED: + *params = (GLint)(pVertexAttrib->bEnabled); + break; + case GL_VERTEX_ATTRIB_ARRAY_SIZE: + *params = (GLint)(pVertexAttrib->iSize); + break; + case GL_VERTEX_ATTRIB_ARRAY_STRIDE: + *params = (GLint)(pVertexAttrib->uStride); + break; + case GL_VERTEX_ATTRIB_ARRAY_TYPE: + *params = (GLint)(pVertexAttrib->eType); + break; + case GL_VERTEX_ATTRIB_ARRAY_NORMALIZED: + *params = (GLint)(pVertexAttrib->bNormalized); + break; + case GL_CURRENT_VERTEX_ATTRIB: + if (index == 0) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } + FNPTR(GetVertexAttribiv)(index, pname, params); + break; + } +} diff --git a/es_2_0/es2front.h b/es_2_0/es2front.h new file mode 100755 index 0000000..5e340ad --- /dev/null +++ b/es_2_0/es2front.h @@ -0,0 +1,412 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#ifndef _ES2_FRONT_H_ +#define _ES2_FRONT_H_ + +#include <assert.h> +#include <stdio.h> +#include <string.h> +#include <malloc.h> + +#if defined(WIN32) +#include <windows.h> +#include <GLee/GLee.h> +#define ES2ENTRY(name) OGL2_gl##name +#endif + +#include <GLES2/gl2.h> + + +#ifdef __cplusplus +extern "C" { +#endif + +#if ! defined(WIN32) +#define ES2ENTRY(name) gl##name +#endif +#define ES2INTER(name) _hazel_es2_##name + +#define INTERNAL_NUM_BUFFER_OBJECTS 16 +#define INTERNAL_NUM_SHADER_OBJECTS 16 +#define INTERNAL_NUM_PROGRAM_OBJECTS 16 + +#define fixed_to_float(v) ((float)(v)/(1 << 16)) + +#ifndef GL_VERSION_2_0 +/* GL type for program/shader text */ +typedef char GLchar; /* native character */ +typedef double GLclampd; +#endif + +struct VertexAttribUnit { + GLboolean bEnabled; + GLint iSize; + GLenum eType; + GLboolean bNormalized; + GLsizei uStride; + const GLvoid* pData; + GLvoid* pConverted; + GLuint uBufferBinding; +}; +GL_APICALL void GL_APIENTRY ES2INTER(VertexAttribInit)(struct VertexAttribUnit* pUnit); +GL_APICALL void GL_APIENTRY ES2INTER(VertexAttribRelease)(struct VertexAttribUnit* pUnit); + +struct BufferObjectUnit { + GLboolean bGenerated; + GLsizei uSize; + GLenum eUsage; + GLvoid* pData; + GLvoid* pConverted; + GLintptr uOffset; +}; +GL_APICALL void GL_APIENTRY ES2INTER(BufferObjectInit)(struct BufferObjectUnit* pUnit); +GL_APICALL void GL_APIENTRY ES2INTER(BufferObjectRelease)(struct BufferObjectUnit* pUnit); + +struct SymbolEntry { + char* formal; + char* actual; + int nparams; + int start; +}; +GL_APICALL void GL_APIENTRY ES2INTER(MacroInit)(void); +GL_APICALL void GL_APIENTRY ES2INTER(MacroSetLineFile)(int iLine, int iFile); +GL_APICALL void GL_APIENTRY ES2INTER(MacroRelease)(void); +GL_APICALL struct SymbolEntry* GL_APIENTRY ES2INTER(MacroSearchParam)(char* name, int start, int n); +GL_APICALL struct SymbolEntry* GL_APIENTRY ES2INTER(MacroSearchMacro)(char* name); +GL_APICALL struct SymbolEntry* GL_APIENTRY ES2INTER(MacroAppend)(char* name, char* body); +GL_APICALL GLboolean GL_APIENTRY ES2INTER(MacroUndef)(char* name); +GL_APICALL GLboolean GL_APIENTRY ES2INTER(MacroDefineName)(char* name, char* body); +GL_APICALL GLboolean GL_APIENTRY ES2INTER(MacroDefineFunc)(char* head, char* body); +GL_APICALL char* GL_APIENTRY ES2INTER(MacroExpand)(char* src, int detailed); + + +#define T_VOID 0x0010 +#define T_BOOL 0x0021 +#define T_INT 0x0031 +#define T_FLOAT 0x0041 +#define T_BVEC2 0x0022 +#define T_BVEC3 0x0023 +#define T_BVEC4 0x0024 +#define T_IVEC2 0x0032 +#define T_IVEC3 0x0033 +#define T_IVEC4 0x0034 +#define T_VEC2 0x0042 +#define T_VEC3 0x0043 +#define T_VEC4 0x0044 +#define T_MAT2 0x0052 +#define T_MAT3 0x0053 +#define T_MAT4 0x0054 +#define T_SAMPLER2D 0x0062 +#define T_SAMPLER3D 0x0063 +#define T_SAMPLERCUBE 0x0072 +#define T_STRUCT_DCL 0x0081 +#define T_STRUCT_DEF 0x0082 +#define T_STRUCT_VAR 0x0083 +#define T_FUNC_DCL 0x0091 +#define T_FUNC_DEF 0x0092 +#define T_FUNC_CALL 0x0093 +#define T_IDENTIFER 0x00F1 +#define T_KEYWORD 0x00F2 +#define T_OPERATOR 0x00F3 +#define GET_TYPE(type) ((type) & 0xFFFF) +#define S_HIGHP 0x00001000 +#define S_MEDIUMP 0x00002000 +#define S_LOWP 0x00004000 +#define S_IN 0x00010000 +#define S_OUT 0x00020000 +#define S_INOUT 0x00040000 +#define S_CONST 0x00100000 +#define S_ATTRIBUTE 0x00200000 +#define S_VARYING 0x00400000 +#define S_UNIFORM 0x00800000 +#define IS_CONST(type) (((type) & S_CONST) != 0) +#define S_INVARIANT 0x10000000 + +struct TableEntry { + char* name; + int type; + int dim; + struct TableEntry* ptr; + union { + int nparams; + int ival; + float fval; + void* data; + }; +}; + +int GL_APIENTRY ES2INTER(ProcSwizzler)(int basetype, char* swizzler); + +#define MAX_SYMBOL_LEVEL 32 +struct ShaderObjectUnit { + GLenum eShaderType; + GLboolean bDeleteStatus; + GLboolean bCompileStatus; + GLint nAttached; + GLchar** aStrSource; + GLsizei nSourceAlloc; + GLsizei nSourceUsed; + GLsizei nSourceLength; + GLchar* strInfoLog; + GLsizei nInfoLogAlloc; + GLchar* strPreped; + GLsizei nPrepedAlloc; + struct TableEntry* symbolTable[MAX_SYMBOL_LEVEL]; + int symbolAllocated[MAX_SYMBOL_LEVEL]; + int symbolUsed[MAX_SYMBOL_LEVEL]; + int symbolLevel; +}; +GL_APICALL void GL_APIENTRY ES2INTER(ShaderObjectInit)(struct ShaderObjectUnit* pUnit); +GL_APICALL void GL_APIENTRY ES2INTER(ShaderObjectRelease)(struct ShaderObjectUnit* pUnit); +GL_APICALL void GL_APIENTRY ES2INTER(ShaderObjectInfoLogReset)(struct ShaderObjectUnit* pUnit); +GL_APICALL void GL_APIENTRY ES2INTER(ShaderObjectInfoLogAppend)(struct ShaderObjectUnit* pUnit, + const char* format, ...); +GL_APICALL void GL_APIENTRY ES2INTER(ShaderObjectPrepedReset)(struct ShaderObjectUnit* pUnit); +GL_APICALL void GL_APIENTRY ES2INTER(ShaderObjectPrepedAppend)(struct ShaderObjectUnit* pUnit, + const char* strBuf, int nLenBuf); + +GL_APICALL void GL_APIENTRY ES2INTER(LevelInit)(struct ShaderObjectUnit* pUnit, int level); +GL_APICALL void GL_APIENTRY ES2INTER(LevelRelease)(struct ShaderObjectUnit* pUnit, int level); +GL_APICALL void GL_APIENTRY ES2INTER(ScopeBegin)(struct ShaderObjectUnit* pUnit); +GL_APICALL void GL_APIENTRY ES2INTER(ScopeEnd)(struct ShaderObjectUnit* pUnit); +GL_APICALL void GL_APIENTRY ES2INTER(SymbolInit)(struct ShaderObjectUnit* pUnit); +GL_APICALL void GL_APIENTRY ES2INTER(SymbolRelease)(struct ShaderObjectUnit* pUnit); + +GL_APICALL struct TableEntry* GL_APIENTRY ES2INTER(SearchSymbol)(struct ShaderObjectUnit* pUnit, + char* name, int* pLevelReturn); +GL_APICALL struct TableEntry* GL_APIENTRY ES2INTER(AppendSymbol)(struct ShaderObjectUnit* pUnit, + char* name, int type); + +struct ProgramObjectUnit { + GLboolean bLinkStatus; + GLchar* strInfoLog; +}; +GL_APICALL void GL_APIENTRY ES2INTER(ProgramObjectInit)(struct ProgramObjectUnit* pUnit); +GL_APICALL void GL_APIENTRY ES2INTER(ProgramObjectRelease)(struct ProgramObjectUnit* pUnit); +GL_APICALL void GL_APIENTRY ES2INTER(ProgramObjectInfoLogReset)(struct ProgramObjectUnit* pUnit); +GL_APICALL void GL_APIENTRY ES2INTER(ProgramObjectInfoLogAppend)(struct ProgramObjectUnit* pUnit, + const char* format, ...); + +struct es2Context { + + GLboolean bShaderCompiler; + GLint nMaxVertexAttribs; + GLenum eError; + struct VertexAttribUnit* pVertexAttrib; + GLuint uArrayBufferBinding; + GLuint uElementArrayBufferBinding; + struct BufferObjectUnit* pBufferObject; + GLint nBufferObjectAllocated; + struct ShaderObjectUnit* pShaderObject; + GLint nShaderObjectAllocated; + struct ProgramObjectUnit* pProgramObject; + GLint nProgramObjectAllocated; + GLenum (*fpGetError)(void); + void (*fpEnable)(GLenum); + void (*fpDisable)(GLenum); + GLboolean (*fpIsEnabled)(GLenum); + void (*fpVertexAttrib1f)(GLuint, GLfloat); + void (*fpVertexAttrib2f)(GLuint, GLfloat, GLfloat); + void (*fpVertexAttrib3f)(GLuint, GLfloat, GLfloat, GLfloat); + void (*fpVertexAttrib4f)(GLuint, GLfloat, GLfloat, GLfloat, GLfloat); + void (*fpVertexAttrib1fv)(GLuint, const GLfloat*); + void (*fpVertexAttrib2fv)(GLuint, const GLfloat*); + void (*fpVertexAttrib3fv)(GLuint, const GLfloat*); + void (*fpVertexAttrib4fv)(GLuint, const GLfloat*); + GLuint (*fpCreateShader)(GLenum); + void (*fpShaderSource)(GLuint, GLsizei, const GLchar**, const GLint*); + void (*fpCompileShader)(GLuint); + void (*fpDeleteShader)(GLuint); + void (*fpGetShaderInfoLog)(GLuint, GLsizei, GLsizei*, GLchar*); + void (*fpGetShaderSource)(GLuint, GLsizei, GLsizei*, GLchar*); + void (*fpGetShaderiv)(GLuint, GLenum, GLint*); + GLboolean (*fpIsShader)(GLuint); + GLuint (*fpCreateProgram)(void); + void (*fpAttachShader)(GLuint, GLuint); + void (*fpDetachShader)(GLuint, GLuint); + void (*fpLinkProgram)(GLuint); + void (*fpUseProgram)(GLuint); + void (*fpDeleteProgram)(GLuint); + void (*fpValidateProgram)(GLuint); + void (*fpGetAttachedShaders)(GLuint, GLsizei, GLsizei*, GLuint*); + void (*fpGetProgramInfoLog)(GLuint, GLsizei, GLsizei*, GLchar*); + void (*fpGetProgramiv)(GLuint, GLenum, GLint*); + GLboolean (*fpIsProgram)(GLuint); + void (*fpGetActiveUniform)(GLuint, GLuint, GLsizei, GLsizei*, GLint*, GLenum*, GLchar*); + GLint (*fpGetUniformLocation)(GLuint, const GLchar*); + void (*fpGetUniformfv)(GLuint, GLint, GLfloat*); + void (*fpGetUniformiv)(GLuint, GLint, GLint*); + void (*fpUniform1f)(GLint, GLfloat); + void (*fpUniform2f)(GLint, GLfloat, GLfloat); + void (*fpUniform3f)(GLint, GLfloat, GLfloat, GLfloat); + void (*fpUniform4f)(GLint, GLfloat, GLfloat, GLfloat, GLfloat); + void (*fpUniform1i)(GLint, GLint); + void (*fpUniform2i)(GLint, GLint, GLint); + void (*fpUniform3i)(GLint, GLint, GLint, GLint); + void (*fpUniform4i)(GLint, GLint, GLint, GLint, GLint); + void (*fpUniform1fv)(GLint, GLsizei, const GLfloat*); + void (*fpUniform2fv)(GLint, GLsizei, const GLfloat*); + void (*fpUniform3fv)(GLint, GLsizei, const GLfloat*); + void (*fpUniform4fv)(GLint, GLsizei, const GLfloat*); + void (*fpUniform1iv)(GLint, GLsizei, const GLint*); + void (*fpUniform2iv)(GLint, GLsizei, const GLint*); + void (*fpUniform3iv)(GLint, GLsizei, const GLint*); + void (*fpUniform4iv)(GLint, GLsizei, const GLint*); + void (*fpUniformMatrix2fv)(GLint, GLsizei, GLboolean, const GLfloat*); + void (*fpUniformMatrix3fv)(GLint, GLsizei, GLboolean, const GLfloat*); + void (*fpUniformMatrix4fv)(GLint, GLsizei, GLboolean, const GLfloat*); + void (*fpVertexAttribPointer)(GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid*); + void (*fpEnableVertexAttribArray)(GLuint); + void (*fpDisableVertexAttribArray)(GLuint); + void (*fpGetVertexAttribPointerv)(GLuint, GLenum, void**); + void (*fpGetVertexAttribfv)(GLuint, GLenum, GLfloat*); + void (*fpGetVertexAttribiv)(GLuint, GLenum, GLint*); + void (*fpGetActiveAttrib)(GLuint, GLuint, GLsizei, GLsizei*, GLint*, GLenum*, GLchar*); + GLint (*fpGetAttribLocation)(GLuint, const GLchar*); + void (*fpBindAttribLocation)(GLuint, GLuint, const GLchar*); + void (*fpGenBuffers)(GLsizei, GLuint*); + void (*fpDeleteBuffers)(GLsizei, const GLuint*); + GLboolean (*fpIsBuffer)(GLuint); + void (*fpBindBuffer)(GLenum, GLuint); + void (*fpBufferData)(GLenum, GLsizeiptr, const GLvoid*, GLenum); + void (*fpBufferSubData)(GLenum, GLintptr, GLsizeiptr, const GLvoid*); + void (*fpGetBufferSubData)(GLenum, GLintptr, GLsizeiptr, const GLvoid* data); + void (*fpDrawArrays)(GLenum, GLint, GLsizei); + void (*fpDrawElements)(GLenum, GLsizei, GLenum, const void*); + void (*fpLineWidth)(GLfloat); + void (*fpDepthRange)(GLclampd, GLclampd); + void (*fpViewport)(GLint, GLint, GLsizei, GLsizei); + void (*fpCullFace)(GLenum); + void (*fpFrontFace)(GLenum); + void (*fpPolygonOffset)(GLfloat, GLfloat); + void (*fpGenTextures)(GLsizei, GLuint*); + void (*fpDeleteTextures)(GLsizei, const GLuint*); + GLboolean (*fpIsTexture)(GLuint); + void (*fpBindTexture)(GLenum, GLuint); + void (*fpPixelStorei)(GLenum, GLint); + void (*fpActiveTexture)(GLenum); + void (*fpGenerateMipmap)(GLenum); + void (*fpTexParameteri)(GLenum, GLenum, GLint); + void (*fpGetTexParameterfv)(GLenum, GLenum, GLfloat*); + void (*fpGetTexParameteriv)(GLenum, GLenum, GLint*); + void (*fpTexImage2D)(GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid*); + void (*fpTexSubImage2D)(GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid*); + void (*fpGetTexLevelParameteriv)(GLenum, GLint, GLenum, GLint*); + void (*fpCopyTexImage2D)(GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint); + void (*fpCopyTexSubImage2D)(GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); + void (*fpCompressedTexImage2D)(GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid*); + void (*fpCompressedTexSubImage2D)(GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid*); + void (*fpClear)(GLbitfield); + void (*fpClearColor)(GLclampf, GLclampf, GLclampf, GLclampf); + void (*fpClearDepth)(GLclampd); + void (*fpClearStencil)(GLint); + void (*fpColorMask)(GLboolean, GLboolean, GLboolean, GLboolean); + void (*fpDepthMask)(GLboolean); + void (*fpStencilMask)(GLuint); + void (*fpStencilMaskSeparate)(GLenum, GLuint); + void (*fpScissor)(GLint, GLint, GLsizei, GLsizei); + void (*fpStencilFunc)(GLenum, GLint, GLuint); + void (*fpStencilFuncSeparate)(GLenum, GLenum, GLint, GLuint); + void (*fpStencilOp)(GLenum, GLenum, GLenum); + void (*fpStencilOpSeparate)(GLenum, GLenum, GLenum, GLenum); + void (*fpDepthFunc)(GLenum); + void (*fpBlendFunc)(GLenum, GLenum); + void (*fpBlendFuncSeparate)(GLenum, GLenum, GLenum, GLenum); + void (*fpBlendColor)(GLclampf, GLclampf, GLclampf, GLclampf); + void (*fpBlendEquation)(GLenum); + void (*fpBlendEquationSeparate)(GLenum, GLenum); + void (*fpSampleCoverage)(GLclampf, GLboolean); + void (*fpReadPixels)(GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLvoid*); + void (*fpFlush)(void); + void (*fpFinish)(void); + void (*fpHint)(GLenum, GLenum); + const GLubyte* (*fpGetString)(GLenum); + void (*fpGetFloatv)(GLenum, GLfloat*); + void (*fpGetIntegerv)(GLenum, GLint*); + void (*fpGetBooleanv)(GLenum, GLboolean*); + void (*fpGenFramebuffers)(GLsizei, GLuint*); + void (*fpGenRenderbuffers)(GLsizei, GLuint*); + void (*fpDeleteFramebuffers)(GLsizei, const GLuint*); + void (*fpDeleteRenderbuffers)(GLsizei, const GLuint*); + GLboolean (*fpIsFramebuffer)(GLuint); + GLboolean (*fpIsRenderbuffer)(GLuint); + void (*fpBindFramebuffer)(GLenum, GLuint); + void (*fpBindRenderbuffer)(GLenum, GLuint); + void (*fpRenderbufferStorage)(GLenum, GLenum, GLsizei, GLsizei); + void (*fpGetRenderbufferParameteriv)(GLenum, GLenum, GLint*); + void (*fpFramebufferRenderbuffer)(GLenum, GLenum, GLenum, GLuint); + void (*fpFramebufferTexture2D)(GLenum, GLenum, GLenum, GLuint, GLint); + void (*fpGetFramebufferAttachmentParameteriv)(GLenum, GLenum, GLenum, GLint*); + GLenum (*fpCheckFramebufferStatus)(GLenum); + void (*fpEGLImageTargetTexture2DOES)(GLenum, GLint); +#if defined(PROVIDING_OES_texture_3D) + void (*fpTexImage3D)(GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid*); + void (*fpTexSubImage3D)(GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid*); + void (*fpCopyTexSubImage3D)(GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); + void (*fpCompressedTexImage3D)(GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid*); + void (*fpCompressedTexSubImage3D)(GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid*); + void (*fpFramebufferTexture3D)(GLenum, GLenum, GLenum, GLuint, GLint, GLint); +#endif +}; + +extern struct es2Context* ES2INTER(curContext); + +#define CCV(name) (ES2INTER(curContext)->name) +#if defined(WIN32) +#define FNPTR(name) gl##name +#else +#define FNPTR(name) (ES2INTER(curContext)->fp##name) +#endif + +GL_APICALL void GL_APIENTRY ES2INTER(NotBound)(void); +GL_APICALL void GL_APIENTRY ES2INTER(ResetFnptrs)(struct es2Context* pContext); +GL_APICALL void GL_APIENTRY ES2INTER(BindFnptrs)(struct es2Context* pContext); + +#define EGLCROSS(name) __hazel_cross__##name + +GL_APICALL void* GL_APIENTRY EGLCROSS(CreateContext)(void); +GL_APICALL void GL_APIENTRY EGLCROSS(MakeCurrent)(void*); +GL_APICALL void GL_APIENTRY EGLCROSS(ReleaseContext)(void*); + +#define CHECK_ERROR (void)(0) + +GL_APICALL void GL_APIENTRY ES2INTER(SetError)(GLenum eErrorCode); +#define SET_ERROR(code,...) ES2INTER(SetError)(code) + +GL_APICALL int GL_APIENTRY ES2INTER(Log2)(GLint x); + +#ifdef __cplusplus +} +#endif + + +#endif diff --git a/es_2_0/funcaction.inl b/es_2_0/funcaction.inl new file mode 100755 index 0000000..51aa375 --- /dev/null +++ b/es_2_0/funcaction.inl @@ -0,0 +1,146 @@ + ACTION( GetError ); + ACTION( Enable ); + ACTION( Disable ); + ACTION( IsEnabled ); + ACTION( VertexAttrib1f ); + ACTION( VertexAttrib2f ); + ACTION( VertexAttrib3f ); + ACTION( VertexAttrib4f ); + ACTION( VertexAttrib1fv ); + ACTION( VertexAttrib2fv ); + ACTION( VertexAttrib3fv ); + ACTION( VertexAttrib4fv ); + ACTION( CreateShader ); + ACTION( ShaderSource ); + ACTION( CompileShader ); + ACTION( DeleteShader ); + ACTION( GetShaderInfoLog ); + ACTION( GetShaderSource ); + ACTION( GetShaderiv ); + ACTION( IsShader ); + ACTION( CreateProgram ); + ACTION( AttachShader ); + ACTION( DetachShader ); + ACTION( LinkProgram ); + ACTION( UseProgram ); + ACTION( DeleteProgram ); + ACTION( ValidateProgram ); + ACTION( GetAttachedShaders ); + ACTION( GetProgramInfoLog ); + ACTION( GetProgramiv ); + ACTION( IsProgram ); + ACTION( GetActiveUniform ); + ACTION( GetUniformLocation ); + ACTION( GetUniformfv ); + ACTION( GetUniformiv ); + ACTION( Uniform1f ); + ACTION( Uniform2f ); + ACTION( Uniform3f ); + ACTION( Uniform4f ); + ACTION( Uniform1i ); + ACTION( Uniform2i ); + ACTION( Uniform3i ); + ACTION( Uniform4i ); + ACTION( Uniform1fv ); + ACTION( Uniform2fv ); + ACTION( Uniform3fv ); + ACTION( Uniform4fv ); + ACTION( Uniform1iv ); + ACTION( Uniform2iv ); + ACTION( Uniform3iv ); + ACTION( Uniform4iv ); + ACTION( UniformMatrix2fv ); + ACTION( UniformMatrix3fv ); + ACTION( UniformMatrix4fv ); + ACTION( VertexAttribPointer ); + ACTION( EnableVertexAttribArray ); + ACTION( DisableVertexAttribArray ); + ACTION( GetVertexAttribPointerv ); + ACTION( GetVertexAttribfv ); + ACTION( GetVertexAttribiv ); + ACTION( GetActiveAttrib ); + ACTION( GetAttribLocation ); + ACTION( BindAttribLocation ); + ACTION( GenBuffers ); + ACTION( DeleteBuffers ); + ACTION( IsBuffer ); + ACTION( BindBuffer ); + ACTION( BufferData ); + ACTION( BufferSubData ); + ACTION( GetBufferSubData ); + ACTION( DrawArrays ); + ACTION( DrawElements ); + ACTION( LineWidth ); + ACTION( DepthRange ); + ACTION( Viewport ); + ACTION( CullFace ); + ACTION( FrontFace ); + ACTION( PolygonOffset ); + ACTION( GenTextures ); + ACTION( DeleteTextures ); + ACTION( IsTexture ); + ACTION( BindTexture ); + ACTION( PixelStorei ); + ACTION( ActiveTexture ); + ACTION( GenerateMipmap ); + ACTION( TexParameteri ); + ACTION( GetTexParameterfv ); + ACTION( GetTexParameteriv ); + ACTION( TexImage2D ); + ACTION( TexSubImage2D ); + ACTION( GetTexLevelParameteriv ); + ACTION( CopyTexImage2D ); + ACTION( CopyTexSubImage2D ); + ACTION( CompressedTexImage2D ); + ACTION( CompressedTexSubImage2D ); + ACTION( Clear ); + ACTION( ClearColor ); + ACTION( ClearDepth ); + ACTION( ClearStencil ); + ACTION( ColorMask ); + ACTION( DepthMask ); + ACTION( StencilMask ); + ACTION( StencilMaskSeparate ); + ACTION( Scissor ); + ACTION( StencilFunc ); + ACTION( StencilFuncSeparate ); + ACTION( StencilOp ); + ACTION( StencilOpSeparate ); + ACTION( DepthFunc ); + ACTION( BlendFunc ); + ACTION( BlendFuncSeparate ); + ACTION( BlendColor ); + ACTION( BlendEquation ); + ACTION( BlendEquationSeparate ); + ACTION( SampleCoverage ); + ACTION( ReadPixels ); + ACTION( Flush ); + ACTION( Finish ); + ACTION( Hint ); + ACTION( GetString ); + ACTION( GetFloatv ); + ACTION( GetIntegerv ); + ACTION( GetBooleanv ); + ACTION( GenFramebuffers ); + ACTION( GenRenderbuffers ); + ACTION( DeleteFramebuffers ); + ACTION( DeleteRenderbuffers ); + ACTION( IsFramebuffer ); + ACTION( IsRenderbuffer ); + ACTION( BindFramebuffer ); + ACTION( BindRenderbuffer ); + ACTION( RenderbufferStorage ); + ACTION( GetRenderbufferParameteriv ); + ACTION( FramebufferRenderbuffer ); + ACTION( FramebufferTexture2D ); + ACTION( GetFramebufferAttachmentParameteriv ); + ACTION( CheckFramebufferStatus ); + ACTION( EGLImageTargetTexture2DOES ); +#if defined(PROVIDING_OES_texture_3D) + ACTION( TexImage3D ); + ACTION( TexSubImage3D ); + ACTION( CopyTexSubImage3D ); + ACTION( CompressedTexImage3D ); + ACTION( CompressedTexSubImage3D ); + ACTION( FramebufferTexture3D ); +#endif diff --git a/es_2_0/internal.c b/es_2_0/internal.c new file mode 100755 index 0000000..65647d1 --- /dev/null +++ b/es_2_0/internal.c @@ -0,0 +1,226 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "es2front.h" + +#if ! defined(WIN32) +#include <dlfcn.h> +#endif +#include <malloc.h> + +static struct es2Context s_defaultContext = { + GL_FALSE, + 0, + GL_NO_ERROR, + NULL, 0, 0, + NULL, 0, + NULL, 0, + NULL, 0, + (void*)(&(ES2INTER(NotBound))), +}; + +static struct es2Context s_context = { + GL_FALSE, + 0, + GL_NO_ERROR, + NULL, 0, 0, + NULL, 0, + NULL, 0, + NULL, 0, + (void*)(&(ES2INTER(NotBound))), +}; + +struct es2Context* ES2INTER(curContext) = &s_context; + +void GL_APIENTRY ES2INTER(NotBound)(void) { + fprintf(stderr, "ES2 internal error: you are calling not-bound function\n"); +} + +void GL_APIENTRY ES2INTER(ResetFnptrs)(struct es2Context* pContext) { +#define ACTION(name) do { \ + *(void**)(&pContext->fp##name) = (void*)(&(ES2INTER(NotBound))); \ + } while (0) +#include "funcaction.inl" +#undef ACTION +} + +void GL_APIENTRY ES2INTER(BindFnptrs)(struct es2Context* pContext) { +#if ! defined(WIN32) + void* dl; + if ((dl = dlopen("libGL.so", RTLD_NOW | RTLD_GLOBAL)) == 0) { + ES2INTER(SetError)(GL_INVALID_OPERATION); + return; + } +#define ACTION(name) do { \ + *(void**)(&pContext->fp##name) = dlsym(dl, "gl" #name ); \ + if (pContext->fp##name == NULL) { \ + *(void**)(&pContext->fp##name) = dlsym(dl, "gl" #name "EXT"); \ + assert(pContext->fp##name != NULL) ; \ + if (pContext->fp##name == NULL) { \ + *(void**)(&pContext->fp##name) = (void*)(&(ES2INTER(NotBound))); \ + } \ + } \ + } while (0) +#include "funcaction.inl" +#undef ACTION + dlclose(dl); +#endif +} + + +void* GL_APIENTRY EGLCROSS(CreateContext)(void) { + struct es2Context* pContext = malloc(sizeof(struct es2Context)); + if (pContext == NULL) { + ES2INTER(SetError)(GL_OUT_OF_MEMORY); + return NULL; + } + memcpy(pContext, &s_defaultContext, sizeof(struct es2Context)); + ES2INTER(ResetFnptrs)(pContext); + return pContext; +} + +void GL_APIENTRY EGLCROSS(MakeCurrent)(void* ptr) { + int i; + struct es2Context* pContext = (struct es2Context*)ptr; + if (ptr == NULL) { + ES2INTER(curContext) = &s_context; + return; + } + ES2INTER(BindFnptrs)(pContext); + ES2INTER(curContext) = pContext; + pContext->bShaderCompiler = GL_TRUE; + FNPTR(GetIntegerv)(GL_MAX_VERTEX_ATTRIBS, &pContext->nMaxVertexAttribs); + assert(8 <= pContext->nMaxVertexAttribs); + if (pContext->pVertexAttrib == NULL) { + pContext->pVertexAttrib = calloc(pContext->nMaxVertexAttribs, + sizeof(struct VertexAttribUnit)); + if (pContext->pVertexAttrib == NULL) { + ES2INTER(SetError)(GL_OUT_OF_MEMORY); + return; + } + for (i = 0; i < pContext->nMaxVertexAttribs; i++) { + ES2INTER(VertexAttribInit)(&(pContext->pVertexAttrib[i])); + } + pContext->uArrayBufferBinding = 0; + pContext->uElementArrayBufferBinding = 0; + } + if (pContext->pBufferObject == NULL) { + pContext->pBufferObject = calloc(INTERNAL_NUM_BUFFER_OBJECTS, + sizeof(struct BufferObjectUnit)); + if (pContext->pBufferObject == NULL) { + ES2INTER(SetError)(GL_OUT_OF_MEMORY); + return; + } + pContext->nBufferObjectAllocated = INTERNAL_NUM_BUFFER_OBJECTS; + for (i = 0; i < pContext->nBufferObjectAllocated; i++) { + ES2INTER(BufferObjectInit)(&(pContext->pBufferObject[i])); + } + pContext->pBufferObject[0].bGenerated = GL_TRUE; + } + if (pContext->pShaderObject == NULL) { + pContext->pShaderObject = calloc(INTERNAL_NUM_SHADER_OBJECTS, + sizeof(struct ShaderObjectUnit)); + if (pContext->pShaderObject == NULL) { + ES2INTER(SetError)(GL_OUT_OF_MEMORY); + return; + } + pContext->nShaderObjectAllocated = INTERNAL_NUM_SHADER_OBJECTS; + for (i = 0; i < pContext->nShaderObjectAllocated; i++) { + ES2INTER(ShaderObjectInit)(&(pContext->pShaderObject[i])); + } + } + if (pContext->pProgramObject == NULL) { + pContext->pProgramObject = calloc(INTERNAL_NUM_PROGRAM_OBJECTS, + sizeof(struct ProgramObjectUnit)); + if (pContext->pProgramObject == NULL) { + ES2INTER(SetError)(GL_OUT_OF_MEMORY); + return; + } + pContext->nProgramObjectAllocated = INTERNAL_NUM_PROGRAM_OBJECTS; + for (i = 0; i < pContext->nProgramObjectAllocated; i++) { + ES2INTER(ProgramObjectInit)(&(pContext->pProgramObject[i])); + } + } + /* from the sepc., + The values in gl_PointCoord are two-dimensional coordinates indicating + where within a point primitive the current fragment is located, when point + sprites are enabled. They range from 0.0 to 1.0 across the point. If the + current primitive is not a point, or if point sprites are not enabled, + then the values read from gl_PointCoord are undefined. + */ +#if ! defined(GL_POINT_SPRITE) +#define GL_POINT_SPRITE 0x8861 +#endif +#if ! defined(GL_VERTEX_PROGRAM_POINT_SIZE) +#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 +#endif + FNPTR(Enable)(GL_POINT_SPRITE); + FNPTR(Enable)(GL_VERTEX_PROGRAM_POINT_SIZE); +} + +void GL_APIENTRY EGLCROSS(ReleaseContext)(void* ptr) { + int i; + struct es2Context* pContext = (struct es2Context*)ptr; + if (ptr == NULL) return; + if (pContext == &s_context) return; + if (pContext->pVertexAttrib != NULL) { + for (i = 0; i < pContext->nMaxVertexAttribs; i++) { + ES2INTER(VertexAttribRelease)(&(pContext->pVertexAttrib[i])); + } + free(pContext->pVertexAttrib); + pContext->pVertexAttrib = NULL; + } + if (pContext->pBufferObject == NULL) { + for (i = 0; i < pContext->nBufferObjectAllocated; i++) { + ES2INTER(BufferObjectRelease)(&(pContext->pBufferObject[i])); + } + free(pContext->pBufferObject); + pContext->pBufferObject = NULL; + } + if (pContext->pShaderObject == NULL) { + for (i = 0; i < pContext->nShaderObjectAllocated; i++) { + ES2INTER(ShaderObjectRelease)(&(pContext->pShaderObject[i])); + } + free(pContext->pShaderObject); + pContext->pShaderObject = NULL; + } + if (pContext->pProgramObject == NULL) { + for (i = 0; i < pContext->nProgramObjectAllocated; i++) { + ES2INTER(ProgramObjectRelease)(&(pContext->pProgramObject[i])); + } + free(pContext->pProgramObject); + pContext->pProgramObject = NULL; + } + free(pContext); + if (pContext == ES2INTER(curContext)) { + ES2INTER(curContext) = &s_context; + } +} diff --git a/es_2_0/macro.c b/es_2_0/macro.c new file mode 100755 index 0000000..a2ff857 --- /dev/null +++ b/es_2_0/macro.c @@ -0,0 +1,508 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "es2front.h" +#include <ctype.h> + + +#define SIMPLE_MACRO -2 + +static struct SymbolEntry* symbolTable = NULL; +static int symbolAllocated = 0; +static int symbolUsed = 0; + +struct SymbolEntry* GL_APIENTRY ES2INTER(MacroAppend)(char* name, char* body); + +void GL_APIENTRY ES2INTER(MacroInit)(void) { + struct SymbolEntry* ptr; + assert(symbolTable == NULL); + assert(symbolAllocated == 0); + symbolAllocated = 64; + symbolUsed = 0; + symbolTable = calloc(symbolAllocated, sizeof(struct SymbolEntry)); + ptr = ES2INTER(MacroAppend)("__LINE__", " "); + ptr->nparams = SIMPLE_MACRO; + ptr = ES2INTER(MacroAppend)("__FILE__", " "); + ptr->nparams = SIMPLE_MACRO; + ptr = ES2INTER(MacroAppend)("__VERSION__", "100"); + ptr->nparams = SIMPLE_MACRO; + ptr = ES2INTER(MacroAppend)("GL_ES", "1"); + ptr->nparams = SIMPLE_MACRO; +} + +void GL_APIENTRY ES2INTER(MacroSetLineFile)(int iLine, int iFile) { + sprintf(symbolTable[0].actual, "%d", iLine); + sprintf(symbolTable[1].actual, "%d", iFile); +} + +void GL_APIENTRY ES2INTER(MacroRelease)(void) { + int i; + assert(symbolTable != NULL); + assert(symbolAllocated != 0); + for (i = 0; i < symbolUsed; i++) { + if (symbolTable[i].formal != NULL) free(symbolTable[i].formal); + if (symbolTable[i].actual != NULL) free(symbolTable[i].actual); + } + free(symbolTable); + symbolTable = NULL; + symbolAllocated = 0; + symbolUsed = 0; +} + +struct SymbolEntry* GL_APIENTRY ES2INTER(MacroSearchParam)(char* name, int start, int nparams) { + struct SymbolEntry* ptr = &(symbolTable[start]); + while (nparams--) { + assert(ptr->formal != NULL); + assert(ptr->nparams == -1); + if (strcmp(name, ptr->formal) == 0) { + return ptr; + } + ptr++; + } + return NULL; +} + +struct SymbolEntry* GL_APIENTRY ES2INTER(MacroSearchMacro)(char* name) { + struct SymbolEntry* ptr = &(symbolTable[0]); + int count = symbolUsed; + while (count--) { + if (ptr->formal != NULL && ptr->nparams != -1 && strcmp(name, ptr->formal) == 0) { + return ptr; + } + ptr++; + } + return NULL; +} + +struct SymbolEntry* GL_APIENTRY ES2INTER(MacroAppend)(char* name, char* body) { + struct SymbolEntry* ptr; + assert(name != NULL && name[0] != '\0'); + if (symbolUsed == symbolAllocated) { + int oldAllocated = symbolAllocated; + symbolAllocated *= 2; + symbolTable = realloc(symbolTable, symbolAllocated * sizeof(struct SymbolEntry)); + memset(&(symbolTable[oldAllocated]), 0, oldAllocated * sizeof(struct SymbolEntry)); + } + ptr = &(symbolTable[symbolUsed++]); + ptr->formal = malloc(strlen(name) + 1); + strcpy(ptr->formal, name); + if (body != NULL) { + ptr->actual = realloc(ptr->actual, strlen(body) + 1); + strcpy(ptr->actual, body); + } else { + ptr->actual = NULL; + } + return ptr; +} + + +void ES2INTER(MacroSetActualValue)(struct SymbolEntry* ptrParam, char* first, char* last) { + int len; + last--; + while (isspace(*last)) last--; + len = last - first + 1; + assert(len > 0); + ptrParam->actual = realloc(ptrParam->actual, len + 1); + strncpy(ptrParam->actual, first, len); + ptrParam->actual[len] = '\0'; +} + + +int ES2INTER(MacroExpandFunc)(struct SymbolEntry* ptrIden, int nparams, char* dst) { +#define PUTCHAR(c) do { \ + if (dst != NULL) *dst++ = c; n++; \ + } while (0) + struct SymbolEntry* ptrParam; + int n = 0; + int state = 0; + char* src = ptrIden->actual; + char* iden; + int c; + if (nparams != ptrIden->nparams) return -1; + PUTCHAR(' '); + do { + c = *src++; + switch (state) { + case 0: + if (isalpha(c) || c == '_') { iden = (src - 1); state = 1; } + else if (c != '\0') { PUTCHAR(c); /* state = 0; */ } + break; + case 1: + if (isalnum(c) || c == '_') { state = 1; } + else { + *--src = '\0'; + ptrParam = ES2INTER(MacroSearchParam)(iden, ptrIden->start, ptrIden->nparams); + if (ptrParam == NULL) { + while (*iden != '\0') { PUTCHAR(*iden); iden++; } + assert(iden == src); + } else { + iden = ptrParam->actual; + PUTCHAR(' '); + while (*iden != '\0') { PUTCHAR(*iden); iden++; } + } + *src = c; + state = 0; + } + break; + default: + assert(0); + break; + } + } while (c != '\0'); + assert(state == 0); + return n; +#undef PUTCHAR +} + +GLboolean GL_APIENTRY ES2INTER(MacroUndef)(char* name) { + register struct SymbolEntry* ptr = ES2INTER(MacroSearchMacro)(name); + if (ptr == NULL) return GL_FALSE; + if (ptr->nparams > 0) { + register struct SymbolEntry* qtr = &(symbolTable[ptr->start]); + register int nparams = ptr->nparams; + while (nparams--) { + assert(qtr->formal != NULL); + assert(qtr->nparams == -1); + free(qtr->formal); + qtr->formal = NULL; + if (qtr->actual != NULL) { + free(qtr->actual); + qtr->actual = NULL; + } + qtr++; + } + } + assert(ptr->formal != NULL); + assert(ptr->actual != NULL); + assert(ptr->nparams != -1); + free(ptr->formal); + ptr->formal = NULL; + free(ptr->actual); + ptr->actual = NULL; + return GL_TRUE; +} + +GLboolean GL_APIENTRY ES2INTER(MacroDefineName)(char* name, char* body) { + register struct SymbolEntry* ptr = ES2INTER(MacroSearchMacro)(name); + if (ptr != NULL) return GL_FALSE; + ptr = ES2INTER(MacroAppend)(name, body); + if (ptr == NULL) return GL_FALSE; + ptr->nparams = SIMPLE_MACRO; + return GL_TRUE; +} + +GLboolean GL_APIENTRY ES2INTER(MacroDefineFunc)(char* head, char* body) { + struct SymbolEntry* ptr; + struct SymbolEntry* qtr; + char* p; + char* s; + int iState; + for (p = head; *p != '('; p++) ; + *p++ = '\0'; + ptr = ES2INTER(MacroSearchMacro)(head); + if (ptr != NULL) return GL_FALSE; + ptr = ES2INTER(MacroAppend)(head, body); + if (ptr == NULL) return GL_FALSE; + ptr->nparams = 0; + ptr->start = symbolUsed; + iState = 0; + while (1) { + register char c = *p; + switch (iState) { + case 0: + if (isspace(c)) { iState = 0; } + else if (isalpha(c) || c == '_') { s = p; iState = 1; } + else if (c == '.') { iState = 5; } + else if (c == ')') goto SUCCESS_STATE; + else goto ERROR_STATE; + break; + case 1: + if (isalnum(c) || c == '_') { iState = 1; } + else if (isspace(c) || c == ',' || c == ')') { + *p = '\0'; + qtr = ES2INTER(MacroSearchParam)(s, ptr->start, ptr->nparams); + if (qtr != NULL) goto ERROR_STATE; + qtr = ES2INTER(MacroAppend)(s, ""); + if (qtr == NULL) goto ERROR_STATE; + qtr->nparams = -1; + ptr->nparams++; + *p = c; + if (c == ',') { iState = 3; } + else if (c == ')') goto SUCCESS_STATE; + else { iState = 2; } + } else goto ERROR_STATE; + break; + case 2: + if (isspace(c)) { iState = 2; } + else if (c == ',') { iState = 3; } + else if (c == ')') goto SUCCESS_STATE; + else goto ERROR_STATE; + break; + case 3: + if (isspace(c)) { iState = 3; } + else if (isalpha(c) || c == '_') { s = p; iState = 1; } + else if (c == '.') { iState = 5; } + else goto ERROR_STATE; + break; + case 5: + if (c == '.') { iState = 6; } + else goto ERROR_STATE; + break; + case 6: + if (c == '.') { + qtr = ES2INTER(MacroSearchParam)("__VA_ARGS__", ptr->start, ptr->nparams); + if (qtr != NULL) goto ERROR_STATE; + qtr = ES2INTER(MacroAppend)("__VA_ARGS__", ""); + if (qtr == NULL) goto ERROR_STATE; + qtr->nparams = -1; + ptr->nparams++; + iState = 7; + } else goto ERROR_STATE; + break; + case 7: + if (isspace(c)) { iState = 7; } + else if (c == ')') goto SUCCESS_STATE; + else goto ERROR_STATE; + break; + } + p++; + } +SUCCESS_STATE: + return GL_TRUE; +ERROR_STATE: + qtr = &(symbolTable[ptr->start]); + while (ptr->nparams--) { + if (qtr->formal != NULL) free(qtr->formal); + if (qtr->actual != NULL) free(qtr->actual); + qtr->formal = NULL; + qtr->actual = NULL; + qtr++; + } + if (ptr->formal != NULL) free(ptr->formal); + if (ptr->actual != NULL) free(ptr->actual); + ptr->formal = NULL; + ptr->actual = NULL; + return GL_FALSE; +} + +int GL_APIENTRY ES2INTER(MacroExpandLow)(char* src, char* dst, int detailed) { +#define PUTCHAR(c) do { \ + if (dst != NULL) *dst++ = c; \ + n++; \ + } while (0) + struct SymbolEntry* ptrIden; + struct SymbolEntry* ptrParam; + char* iden; + char* param; + int n = 0; + int state = 0; + int nparams; + int parens; + int len; + int c; + do { + c = *src++; + switch (state) { + case 0: + if (isalpha(c) || c == '_') { iden = (src - 1); state = 1; } + else if (c != '\0') { PUTCHAR(c); /* state = 0; */ } + break; + case 1: + if (isalnum(c) || c == '_') { /* state = 1; */ } + else { + *--src = '\0'; + if (detailed == 1 && strcmp(iden, "defined") == 0) { + while (*iden != '\0') { PUTCHAR(*iden); iden++; } + assert(iden == src); + state = 11; + } else { + ptrIden = ES2INTER(MacroSearchMacro)(iden); + if (ptrIden != NULL && ptrIden->nparams == -2 + && (detailed != 2 + || strcmp(iden, "__LINE__") == 0 + || strcmp(iden, "__FILE__") == 0)) { + iden = ptrIden->actual; + PUTCHAR(' '); + while (*iden != '\0') { PUTCHAR(*iden); iden++; } + state = 0; + } else if (ptrIden != NULL && detailed != 2) { + assert(ptrIden->nparams >= 0); + nparams = 0; + state = 2; + } else { + while (*iden != '\0') { PUTCHAR(*iden); iden++; } + assert(iden == src); + state = 0; + } + } + *src = c; + } + break; + case 2: + if (isspace(c)) { /* state = 2; */ } + else if (c == '(') { state = 3; } + else { return -1; } + break; + case 3: + if (isspace(c)) { /* state = 3; */ } + else if (c == ',') { return -1; } + else if (c == ')') { + len = ES2INTER(MacroExpandFunc)(ptrIden, nparams, dst); + if (len < 0) return -1; + if (dst != NULL) dst += len; + n += len; + state = 0; + } else { + param = --src; + parens = 0; + state = 4; + } + break; + case 6: + if (c == ',') { return -1; } + else if (c == ')') { + len = ES2INTER(MacroExpandFunc)(ptrIden, nparams, dst); + if (len < 0) return -1; + if (dst != NULL) dst += len; + n += len; + state = 0; + } else { + --src; + parens = 0; + state = 4; + } + break; + case 4: + if (c == '(') { parens++; /* state = 4; */ } + else if (c == '"' && (param == (src - 1) || *(src - 2) != '\\')) { state = 5; } + else if (c == ',' && parens == 0) { + ptrParam = &(symbolTable[ptrIden->start + nparams]); + if (strcmp(ptrParam->formal, "__VA_ARGS__") == 0) { + state = 6; + } else { + ES2INTER(MacroSetActualValue)(ptrParam, param, src - 1); + nparams++; + state = 3; + } + } else if (c == ')') { + if (--parens < 0) { + ptrParam = &(symbolTable[ptrIden->start + nparams]); + ES2INTER(MacroSetActualValue)(ptrParam, param, src - 1); + nparams++; + len = ES2INTER(MacroExpandFunc)(ptrIden, nparams, dst); + if (len < 0) return -1; + if (dst != NULL) dst += len; + n += len; + state = 0; + } else { + /* state = 4; */ + } + } else { /* state = 4; */ } + break; + case 5: + if (c == '"' && *(src - 2) != '\\') { state = 4; } + else { /* state = 5; */ } + break; + case 11: + if (isspace(c)) { /* state = 11; */ } + else if (isalpha(c) || c == '_') { iden = (src - 1); state = 12; } + else if (c == '(') { PUTCHAR('('); state = 13; } + else { return -1; } + break; + case 12: + if (isalnum(c) || c == '_') { /* state = 12; */ } + else { + *--src = '\0'; + PUTCHAR(' '); + while (*iden != '\0') { PUTCHAR(*iden); iden++; } + assert(iden == src); + state = 0; + *src = c; + } + break; + case 13: + if (isspace(c)) { /* state = 13; */ } + else if (isalpha(c) || c == '_') { iden = (src - 1); state = 14; } + else { return -1; } + break; + case 14: + if (isalnum(c) || c == '_') { /* state = 14; */ } + else { + *--src = '\0'; + PUTCHAR(' '); + while (*iden != '\0') { PUTCHAR(*iden); iden++; } + assert(iden == src); + state = 15; + *src = c; + } + break; + case 15: + if (isspace(c)) { /* state = 15; */ } + else if (c == ')') { PUTCHAR(')'); state = 0; } + else { return -1; } + break; + default: + assert(0); + break; + } + } while (c != '\0'); + PUTCHAR('\0'); + return (state == 0) ? n : -1; +#undef PUTCHAR +} + +char* GL_APIENTRY ES2INTER(MacroExpand)(char* src, int detailed) { + static int len[2] = { 0, 0 }; + static char* buf[2] = { NULL, NULL }; + int step = 0; + int srcIndex; + int dstIndex; + int result; + result = strlen(src); + if (len[0] < result + 1) { + buf[0] = (char*)realloc(buf[0], result + 1); + } + strcpy(buf[0], src); + do { + step++; + srcIndex = (step - 1) % 2; + dstIndex = step % 2; + result = ES2INTER(MacroExpandLow)(buf[srcIndex], NULL, detailed); + if (result < 0) return NULL; + if (len[dstIndex] < result + 1) { + buf[dstIndex] = (char*)realloc(buf[dstIndex], result + 1); + len[dstIndex] = result + 1; + } + result = ES2INTER(MacroExpandLow)(buf[srcIndex], buf[dstIndex], detailed); + assert(result < len[dstIndex]); + } while (strcmp(buf[srcIndex], buf[dstIndex]) != 0 && step < 100); + return (step < 100) ? buf[dstIndex] : NULL; +} diff --git a/es_2_0/makefile b/es_2_0/makefile new file mode 100755 index 0000000..50420ef --- /dev/null +++ b/es_2_0/makefile @@ -0,0 +1,22 @@ +#!make + +default: +# make -f makefile-static clean + make -f makefile-dynamic clean +# make -f makefile-static install +# make -f makefile-static clean + make -f makefile-dynamic install + +install: + make -f makefile-dynamic install + +clean: +# make -f makefile-static clean + make -f makefile-dynamic clean + +clobber: +# make -f makefile-static clobber + make -f makefile-dynamic clobber + +wc: + make -f makefile-dynamic wc diff --git a/es_2_0/makefile-dynamic b/es_2_0/makefile-dynamic new file mode 100755 index 0000000..3511dde --- /dev/null +++ b/es_2_0/makefile-dynamic @@ -0,0 +1,89 @@ +#!/bin/make + +CFLAGS = -I. -I../include -fPIC -Werror-implicit-function-declaration -O3 -g +ARFLAGS = rucv + +CFLAGS += -DPROVIDING_OES_blend_func_separate +CFLAGS += -DPROVIDING_OES_blend_subtract + # never CFLAGS += -DPROVIDING_OES_byte_coordinates # N/A for ES 2.0 +CFLAGS += -DPROVIDING_OES_fixed_point # always ON + # never CFLAGS += -DPROVIDING_OES_matrix_get # N/A for ES 2.0 + # never CFLAGS += -DPROVIDING_OES_point_size_array # N/A for ES 2.0 + # never CFLAGS += -DPROVIDING_OES_point_sprite # N/A for ES 2.0 + # never CFLAGS += -DPROVIDING_OES_query_matrix # N/A for ES 2.0 +CFLAGS += -DPROVIDING_OES_single_precision +CFLAGS += -DPROVIDING_OES_stencil_wrap # always ON + # never CFLAGS += -DPROVIDING_OES_texture_cube_map # N/A for ES 2.0 + # never CFLAGS += -DPROVIDING_OES_texture_env_crossbar # N/A for ES 2.0 +CFLAGS += -DPROVIDING_OES_texture_mirrored_repeat # always ON +CFLAGS += -DPROVIDING_OES_element_index_uint +CFLAGS += -DPROVIDING_OES_texture_3D +CFLAGS += -DPROVIDING_OES_texture_npot +CFLAGS += -DPROVIDING_OES_rgb8_rgba8 +CFLAGS += -DPROVIDING_OES_packed_depth_stencil + +LIBBASE = libGLESv2.so +LIBVER = 1.0 +LIB = $(LIBBASE).$(LIBVER) + +END = +SRCS = \ + Enable.c \ + Error.c \ + Flush.c \ + Shader.c \ + Program.c \ + Link.c \ + Uniform.c \ + VertexAttrib.c \ + VertexPointer.c \ + Buffer.c \ + DrawArray.c \ + DrawElement.c \ + Primitive.c \ + Texture.c \ + TexImage.c \ + Tex3D.c \ + Compressed.c \ + Clear.c \ + Fragment.c \ + Get.c \ + Framebuffer.c \ + Extend.c \ + PrepLex.c \ + EvalParse.c \ + ParseParse.c \ + internal.c \ + macro.c \ + symbol.c \ + EGLImage.c \ + $(END) +OBJS = $(SRCS:.c=.o) + + +default: __touch__ $(LIB) + + +__touch__: + touch Get.c + +$(LIB): $(OBJS) + $(CC) -shared -Wl,-soname,$(LIBBASE).1 -o $@ $(OBJS) -ldl -lX11 + +install: $(LIB) + cp $(LIB) ../lib/host-gl/ + +# supports + +clean: + $(RM) $(RMFLAGS) $(OBJS) + +wc: + wc $(SRCS) *.h *.inl + +#$(OBJS): GLES2/gl2.h es2front.h + + +clobber: clean + $(RM) $(RMFLAGS) $(LIB) core a.out + diff --git a/es_2_0/makefile-static b/es_2_0/makefile-static new file mode 100755 index 0000000..75bf10f --- /dev/null +++ b/es_2_0/makefile-static @@ -0,0 +1,62 @@ +#!/bin/make + +CFLAGS = -I. -Werror-implicit-function-declaration -O0 -g3 + + +LIB = libGLESv2.a +ARFLAGS = rucv + +END = +SRCS = \ + Enable.c \ + Error.c \ + Flush.c \ + Shader.c \ + Program.c \ + Link.c \ + Uniform.c \ + VertexAttrib.c \ + VertexPointer.c \ + Buffer.c \ + DrawArray.c \ + DrawElement.c \ + Primitive.c \ + Texture.c \ + TexImage.c \ + Compressed.c \ + Clear.c \ + Fragment.c \ + Get.c \ + Framebuffer.c \ + internal.c \ + macro.c \ + EGLImage.c \ + $(END) +OBJS = $(SRCS:.c=.o) + + +default: __touch__ $(LIB) + + +__touch__: + touch Get.c + +$(LIB): $(OBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) + +install: $(LIB) + cp $(LIB) ../lib + +# supports + +clean: + $(RM) $(RMFLAGS) $(OBJS) + +clobber: clean + $(RM) $(RMFLAGS) $(LIB) core a.out + +wc: + wc $(SRCS) *.inl *.h + +$(OBJS): GLES2/gl2.h + diff --git a/es_2_0/symbol.c b/es_2_0/symbol.c new file mode 100755 index 0000000..2ddb40a --- /dev/null +++ b/es_2_0/symbol.c @@ -0,0 +1,180 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "es2front.h" +#include <ctype.h> + + +int GL_APIENTRY ES2INTER(ProcSwizzler)(int basetype, char* swizzler) { + return basetype; +} + +void GL_APIENTRY ES2INTER(LevelInit)(struct ShaderObjectUnit* pUnit, int level) { + assert(0 <= level && level < MAX_SYMBOL_LEVEL); + assert(pUnit->symbolTable[level] == NULL); + assert(pUnit->symbolAllocated[level] == 0); + pUnit->symbolAllocated[level] = 64; + pUnit->symbolUsed[level] = 0; + pUnit->symbolTable[level] = calloc(pUnit->symbolAllocated[level], sizeof(struct TableEntry)); +} + +void GL_APIENTRY ES2INTER(LevelRelease)(struct ShaderObjectUnit* pUnit, int level) { + int i; + assert(pUnit->symbolTable[level] != NULL); + assert(pUnit->symbolAllocated[level] > 0); + for (i = 0; i < pUnit->symbolUsed[level]; i++) { + if (pUnit->symbolTable[level][i].name != NULL) free(pUnit->symbolTable[level][i].name); + } + free(pUnit->symbolTable[level]); + pUnit->symbolTable[level] = NULL; + pUnit->symbolAllocated[level] = 0; + pUnit->symbolUsed[level] = 0; +} + +void GL_APIENTRY ES2INTER(ScopeBegin)(struct ShaderObjectUnit* pUnit) { + pUnit->symbolLevel++; + assert(pUnit->symbolLevel < MAX_SYMBOL_LEVEL); + ES2INTER(LevelInit)(pUnit, pUnit->symbolLevel); +} + +void GL_APIENTRY ES2INTER(ScopeEnd)(struct ShaderObjectUnit* pUnit) { + assert(pUnit->symbolLevel >= 0); + ES2INTER(LevelRelease)(pUnit, pUnit->symbolLevel); + pUnit->symbolLevel--; +} + +void GL_APIENTRY ES2INTER(SymbolRelease)(struct ShaderObjectUnit* pUnit) { + for (; pUnit->symbolLevel >= 0; pUnit->symbolLevel--) { + ES2INTER(LevelRelease)(pUnit, pUnit->symbolLevel); + } +} + +void GL_APIENTRY ES2INTER(SymbolInit)(struct ShaderObjectUnit* pUnit) { + if (pUnit->symbolLevel == -1) { + memset(pUnit->symbolTable, 0, sizeof(pUnit->symbolTable)); + memset(pUnit->symbolAllocated, 0, sizeof(pUnit->symbolAllocated)); + memset(pUnit->symbolUsed, 0, sizeof(pUnit->symbolUsed)); + ES2INTER(ScopeBegin)(pUnit); + /* as defiend in the ES SL specification, + const mediump int gl_MaxVertexAttribs = 8; + const mediump int gl_MaxVertexUniformVectors = 128; + const mediump int gl_MaxVaryingVectors = 8; + const mediump int gl_MaxVertexTextureImageUnits = 0; + const mediump int gl_MaxCombinedTextureImageUnits = 8; + const mediump int gl_MaxTextureImageUnits = 8; + const mediump int gl_MaxFragmentUniformVectors = 16; + const mediump int gl_MaxDrawBuffers = 1; + */ + ES2INTER(AppendSymbol)(pUnit, "gl_MaxVertexAttribs", T_INT | S_CONST); + ES2INTER(AppendSymbol)(pUnit, "gl_MaxVertexUniformVectros", T_INT | S_CONST); + ES2INTER(AppendSymbol)(pUnit, "gl_VaryingVectors", T_INT | S_CONST); + ES2INTER(AppendSymbol)(pUnit, "gl_MaxVertexTextureImageUnits", T_INT | S_CONST); + ES2INTER(AppendSymbol)(pUnit, "gl_MaxCombinedTextureImageUnits", T_INT | S_CONST); + ES2INTER(AppendSymbol)(pUnit, "gl_MaxTextureImageUnits", T_INT | S_CONST); + ES2INTER(AppendSymbol)(pUnit, "gl_MaxFragmentUniformVectors", T_INT | S_CONST); + ES2INTER(AppendSymbol)(pUnit, "gl_MaxDrawBuffers", T_INT | S_CONST); + /* as defiend in the ES SL specification, + struct gl_DepthRangeParameters { + highp float near; + highp float far; + highp float diff; + }; + uniform gl_DepthRangeParameters gl_DepthRange; + */ + ES2INTER(AppendSymbol)(pUnit, "gl_DepthRange", T_STRUCT_DEF); + /* as defiend in the ES SL specification, + highp vec4 gl_Position; + mediump float gl_PointSize; + */ + if (pUnit->eShaderType == GL_VERTEX_SHADER) { + ES2INTER(AppendSymbol)(pUnit, "gl_Position", T_VEC4); + ES2INTER(AppendSymbol)(pUnit, "gl_PointSize", T_FLOAT); + } + /* as defiend in the ES SL specification, + mediump vec4 gl_FragCoord; + bool gl_FrontFacing; + mediump vec4 gl_FragColor; + mediump vec4 gl_FragData[gl_MaxDrawBuffers]; + mediump vec2 gl_PointCoord; + */ + if (pUnit->eShaderType == GL_FRAGMENT_SHADER) { + ES2INTER(AppendSymbol)(pUnit, "gl_FragCoord", T_VEC4); + ES2INTER(AppendSymbol)(pUnit, "gl_FrontFacing", T_BOOL); + ES2INTER(AppendSymbol)(pUnit, "gl_FragColor", T_VEC4); + ES2INTER(AppendSymbol)(pUnit, "gl_FragData", T_VEC4); + ES2INTER(AppendSymbol)(pUnit, "gl_PointCoord", T_VEC2); + } + } + for (; pUnit->symbolLevel >= 1; pUnit->symbolLevel--) { + ES2INTER(LevelRelease)(pUnit, pUnit->symbolLevel); + } + ES2INTER(ScopeBegin)(pUnit); +} + +struct TableEntry* GL_APIENTRY ES2INTER(SearchSymbol)(struct ShaderObjectUnit* pUnit, + char* name, int* pLevelReturn) { + int k; + for (k = pUnit->symbolLevel; k >= 0; k--) { + struct TableEntry* ptr = pUnit->symbolTable[k]; + int n = pUnit->symbolUsed[k]; + while (n-- > 0) { + assert(ptr->name != NULL); + if (ptr->nparams >= -1 && strcmp(name, ptr->name) == 0) { + if (pLevelReturn != NULL) *pLevelReturn = k; + return ptr; + } + ptr++; + } + } + return NULL; +} + +struct TableEntry* GL_APIENTRY ES2INTER(AppendSymbol)(struct ShaderObjectUnit* pUnit, + char* name, int type) { + int level = pUnit->symbolLevel; + struct TableEntry* ptr; + assert(name != NULL && name[0] != '\0'); + if (pUnit->symbolUsed[level] == pUnit->symbolAllocated[level]) { + int oldAllocated = pUnit->symbolAllocated[level]; + pUnit->symbolAllocated[level] *= 2; + pUnit->symbolTable[level] = realloc(pUnit->symbolTable[level], + pUnit->symbolAllocated[level] * sizeof(struct TableEntry)); + memset(&(pUnit->symbolTable[level][oldAllocated]), 0, + oldAllocated * sizeof(struct TableEntry)); + } + ptr = &(pUnit->symbolTable[level][pUnit->symbolUsed[level]++]); + ptr->name = malloc(strlen(name) + 1); + strcpy(ptr->name, name); + ptr->type = type; + return ptr; +} + + diff --git a/es_2_0/symbol.h b/es_2_0/symbol.h new file mode 100755 index 0000000..e2d868c --- /dev/null +++ b/es_2_0/symbol.h @@ -0,0 +1,79 @@ +/* + * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * DongKyun Yun <dk77.yun@samsung.com> + * SangJin Kim <sangjin3.kim@samsung.com> + * HyunGoo Kang <hyungoo1.kang@samsung.com> + * + * 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. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#ifndef _HAZEL_SYMBOL_H_ +#define _HAZEL_SYMBOL_H_ + +#ifndef _ES2_FRONT_H_ +#error symbol.h shoule be used in the es2front.h +#endif + +struct SymbolEntry { + char* formal; + char* actual; + int nparams; + int start; +}; +GL_APICALL void GL_APIENTRY ES2INTER(MacroInit)(void); +GL_APICALL void GL_APIENTRY ES2INTER(MacroSetLineFile)(int iLine, int iFile); +GL_APICALL void GL_APIENTRY ES2INTER(MacroRelease)(void); +GL_APICALL struct SymbolEntry* GL_APIENTRY ES2INTER(MacroSearchParam)(char* name, int start, int n); +GL_APICALL struct SymbolEntry* GL_APIENTRY ES2INTER(MacroSearchMacro)(char* name); +GL_APICALL struct SymbolEntry* GL_APIENTRY ES2INTER(MacroAppend)(char* name, char* body); +GL_APICALL GLboolean GL_APIENTRY ES2INTER(MacroUndef)(char* name); +GL_APICALL GLboolean GL_APIENTRY ES2INTER(MacroDefineName)(char* name, char* body); +GL_APICALL GLboolean GL_APIENTRY ES2INTER(MacroDefineFunc)(char* head, char* body); +GL_APICALL char* GL_APIENTRY ES2INTER(MacroExpand)(char* src, int detailed); + +struct TableEntry { + char* name; + int type; + int dim; + int nparams; + int start; + int specifier; +}; + +GL_APICALL void GL_APIENTRY ES2INTER(LevelInit)(int level); +GL_APICALL void GL_APIENTRY ES2INTER(LevelRelease)(int level); + +GL_APICALL void GL_APIENTRY ES2INTER(SymbolInit)(void); +GL_APICALL void GL_APIENTRY ES2INTER(SymbolPrepare)(GLenum type); +GL_APICALL void GL_APIENTRY ES2INTER(SymbolRelease)(void); + +GL_APICALL void GL_APIENTRY ES2INTER(ScopeBegin)(void); +GL_APICALL void GL_APIENTRY ES2INTER(ScopeEnd)(void); + +GL_APICALL struct TableEntry* GL_APIENTRY ES2INTER(SearchSymbol)(char* name, int* pLevelReturn); +GL_APICALL struct TableEntry* GL_APIENTRY ES2INTER(AppendSymbolLevel)(char* name, int level); +GL_APICALL struct TableEntry* GL_APIENTRY ES2INTER(AppendSymbol)(char* name); + +#endif @@ -0,0 +1,2 @@ +opengl-es-dev_0.1-1_i386.deb libs optional +opengl-es_0.1-1_i386.deb libdevel optional diff --git a/include/EGL/egl.h b/include/EGL/egl.h new file mode 100755 index 0000000..c269976 --- /dev/null +++ b/include/EGL/egl.h @@ -0,0 +1,330 @@ +/* -*- mode: c; tab-width: 8; -*- */ +/* vi: set sw=4 ts=8: */ +/* Reference version of egl.h for EGL 1.4. + * $Revision: 7244 $ on $Date: 2009-01-20 17:06:59 -0800 (Tue, 20 Jan 2009) $ + */ + +/* +** Copyright (c) 2007-2009 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +#ifndef __egl_h_ +#define __egl_h_ + +/* All platform-dependent types and macro boilerplate (such as EGLAPI + * and EGLAPIENTRY) should go in eglplatform.h. + */ +#include <EGL/eglplatform.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/* EGL Types */ +/* EGLint is defined in eglplatform.h */ +typedef unsigned int EGLBoolean; +typedef unsigned int EGLenum; +typedef void *EGLConfig; +typedef void *EGLContext; +typedef void *EGLDisplay; +typedef void *EGLSurface; +typedef void *EGLClientBuffer; + +/* EGL Versioning */ +#define EGL_VERSION_1_0 1 +#define EGL_VERSION_1_1 1 +#define EGL_VERSION_1_2 1 +#define EGL_VERSION_1_3 1 +#define EGL_VERSION_1_4 1 + +/* EGL Enumerants. Bitmasks and other exceptional cases aside, most + * enums are assigned unique values starting at 0x3000. + */ + +/* EGL aliases */ +#define EGL_FALSE 0 +#define EGL_TRUE 1 + +/* Out-of-band handle values */ +#define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType)0) +#define EGL_NO_CONTEXT ((EGLContext)0) +#define EGL_NO_DISPLAY ((EGLDisplay)0) +#define EGL_NO_SURFACE ((EGLSurface)0) + +/* Out-of-band attribute value */ +#define EGL_DONT_CARE ((EGLint)-1) + +/* Errors / GetError return values */ +#define EGL_SUCCESS 0x3000 +#define EGL_NOT_INITIALIZED 0x3001 +#define EGL_BAD_ACCESS 0x3002 +#define EGL_BAD_ALLOC 0x3003 +#define EGL_BAD_ATTRIBUTE 0x3004 +#define EGL_BAD_CONFIG 0x3005 +#define EGL_BAD_CONTEXT 0x3006 +#define EGL_BAD_CURRENT_SURFACE 0x3007 +#define EGL_BAD_DISPLAY 0x3008 +#define EGL_BAD_MATCH 0x3009 +#define EGL_BAD_NATIVE_PIXMAP 0x300A +#define EGL_BAD_NATIVE_WINDOW 0x300B +#define EGL_BAD_PARAMETER 0x300C +#define EGL_BAD_SURFACE 0x300D +#define EGL_CONTEXT_LOST 0x300E /* EGL 1.1 - IMG_power_management */ + +/* Reserved 0x300F-0x301F for additional errors */ + +/* Config attributes */ +#define EGL_BUFFER_SIZE 0x3020 +#define EGL_ALPHA_SIZE 0x3021 +#define EGL_BLUE_SIZE 0x3022 +#define EGL_GREEN_SIZE 0x3023 +#define EGL_RED_SIZE 0x3024 +#define EGL_DEPTH_SIZE 0x3025 +#define EGL_STENCIL_SIZE 0x3026 +#define EGL_CONFIG_CAVEAT 0x3027 +#define EGL_CONFIG_ID 0x3028 +#define EGL_LEVEL 0x3029 +#define EGL_MAX_PBUFFER_HEIGHT 0x302A +#define EGL_MAX_PBUFFER_PIXELS 0x302B +#define EGL_MAX_PBUFFER_WIDTH 0x302C +#define EGL_NATIVE_RENDERABLE 0x302D +#define EGL_NATIVE_VISUAL_ID 0x302E +#define EGL_NATIVE_VISUAL_TYPE 0x302F +#define EGL_PRESERVED_RESOURCES 0x3030 +#define EGL_SAMPLES 0x3031 +#define EGL_SAMPLE_BUFFERS 0x3032 +#define EGL_SURFACE_TYPE 0x3033 +#define EGL_TRANSPARENT_TYPE 0x3034 +#define EGL_TRANSPARENT_BLUE_VALUE 0x3035 +#define EGL_TRANSPARENT_GREEN_VALUE 0x3036 +#define EGL_TRANSPARENT_RED_VALUE 0x3037 +#define EGL_NONE 0x3038 /* Attrib list terminator */ +#define EGL_BIND_TO_TEXTURE_RGB 0x3039 +#define EGL_BIND_TO_TEXTURE_RGBA 0x303A +#define EGL_MIN_SWAP_INTERVAL 0x303B +#define EGL_MAX_SWAP_INTERVAL 0x303C +#define EGL_LUMINANCE_SIZE 0x303D +#define EGL_ALPHA_MASK_SIZE 0x303E +#define EGL_COLOR_BUFFER_TYPE 0x303F +#define EGL_RENDERABLE_TYPE 0x3040 +#define EGL_MATCH_NATIVE_PIXMAP 0x3041 /* Pseudo-attribute (not queryable) */ +#define EGL_CONFORMANT 0x3042 + +/* Reserved 0x3041-0x304F for additional config attributes */ + +/* Config attribute values */ +#define EGL_SLOW_CONFIG 0x3050 /* EGL_CONFIG_CAVEAT value */ +#define EGL_NON_CONFORMANT_CONFIG 0x3051 /* EGL_CONFIG_CAVEAT value */ +#define EGL_TRANSPARENT_RGB 0x3052 /* EGL_TRANSPARENT_TYPE value */ +#define EGL_RGB_BUFFER 0x308E /* EGL_COLOR_BUFFER_TYPE value */ +#define EGL_LUMINANCE_BUFFER 0x308F /* EGL_COLOR_BUFFER_TYPE value */ + +/* More config attribute values, for EGL_TEXTURE_FORMAT */ +#define EGL_NO_TEXTURE 0x305C +#define EGL_TEXTURE_RGB 0x305D +#define EGL_TEXTURE_RGBA 0x305E +#define EGL_TEXTURE_2D 0x305F + +/* Config attribute mask bits */ +#define EGL_PBUFFER_BIT 0x0001 /* EGL_SURFACE_TYPE mask bits */ +#define EGL_PIXMAP_BIT 0x0002 /* EGL_SURFACE_TYPE mask bits */ +#define EGL_WINDOW_BIT 0x0004 /* EGL_SURFACE_TYPE mask bits */ +#define EGL_VG_COLORSPACE_LINEAR_BIT 0x0020 /* EGL_SURFACE_TYPE mask bits */ +#define EGL_VG_ALPHA_FORMAT_PRE_BIT 0x0040 /* EGL_SURFACE_TYPE mask bits */ +#define EGL_MULTISAMPLE_RESOLVE_BOX_BIT 0x0200 /* EGL_SURFACE_TYPE mask bits */ +#define EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400 /* EGL_SURFACE_TYPE mask bits */ + +#define EGL_OPENGL_ES_BIT 0x0001 /* EGL_RENDERABLE_TYPE mask bits */ +#define EGL_OPENVG_BIT 0x0002 /* EGL_RENDERABLE_TYPE mask bits */ +#define EGL_OPENGL_ES2_BIT 0x0004 /* EGL_RENDERABLE_TYPE mask bits */ +#define EGL_OPENGL_BIT 0x0008 /* EGL_RENDERABLE_TYPE mask bits */ + +/* QueryString targets */ +#define EGL_VENDOR 0x3053 +#define EGL_VERSION 0x3054 +#define EGL_EXTENSIONS 0x3055 +#define EGL_CLIENT_APIS 0x308D + +/* QuerySurface / SurfaceAttrib / CreatePbufferSurface targets */ +#define EGL_HEIGHT 0x3056 +#define EGL_WIDTH 0x3057 +#define EGL_LARGEST_PBUFFER 0x3058 +#define EGL_TEXTURE_FORMAT 0x3080 +#define EGL_TEXTURE_TARGET 0x3081 +#define EGL_MIPMAP_TEXTURE 0x3082 +#define EGL_MIPMAP_LEVEL 0x3083 +#define EGL_RENDER_BUFFER 0x3086 +#define EGL_VG_COLORSPACE 0x3087 +#define EGL_VG_ALPHA_FORMAT 0x3088 +#define EGL_HORIZONTAL_RESOLUTION 0x3090 +#define EGL_VERTICAL_RESOLUTION 0x3091 +#define EGL_PIXEL_ASPECT_RATIO 0x3092 +#define EGL_SWAP_BEHAVIOR 0x3093 +#define EGL_MULTISAMPLE_RESOLVE 0x3099 + +/* EGL_RENDER_BUFFER values / BindTexImage / ReleaseTexImage buffer targets */ +#define EGL_BACK_BUFFER 0x3084 +#define EGL_SINGLE_BUFFER 0x3085 + +/* OpenVG color spaces */ +#define EGL_VG_COLORSPACE_sRGB 0x3089 /* EGL_VG_COLORSPACE value */ +#define EGL_VG_COLORSPACE_LINEAR 0x308A /* EGL_VG_COLORSPACE value */ + +/* OpenVG alpha formats */ +#define EGL_VG_ALPHA_FORMAT_NONPRE 0x308B /* EGL_ALPHA_FORMAT value */ +#define EGL_VG_ALPHA_FORMAT_PRE 0x308C /* EGL_ALPHA_FORMAT value */ + +/* Constant scale factor by which fractional display resolutions & + * aspect ratio are scaled when queried as integer values. + */ +#define EGL_DISPLAY_SCALING 10000 + +/* Unknown display resolution/aspect ratio */ +#define EGL_UNKNOWN ((EGLint)-1) + +/* Back buffer swap behaviors */ +#define EGL_BUFFER_PRESERVED 0x3094 /* EGL_SWAP_BEHAVIOR value */ +#define EGL_BUFFER_DESTROYED 0x3095 /* EGL_SWAP_BEHAVIOR value */ + +/* CreatePbufferFromClientBuffer buffer types */ +#define EGL_OPENVG_IMAGE 0x3096 + +/* QueryContext targets */ +#define EGL_CONTEXT_CLIENT_TYPE 0x3097 + +/* CreateContext attributes */ +#define EGL_CONTEXT_CLIENT_VERSION 0x3098 + +/* Multisample resolution behaviors */ +#define EGL_MULTISAMPLE_RESOLVE_DEFAULT 0x309A /* EGL_MULTISAMPLE_RESOLVE value */ +#define EGL_MULTISAMPLE_RESOLVE_BOX 0x309B /* EGL_MULTISAMPLE_RESOLVE value */ + +/* BindAPI/QueryAPI targets */ +#define EGL_OPENGL_ES_API 0x30A0 +#define EGL_OPENVG_API 0x30A1 +#define EGL_OPENGL_API 0x30A2 + +/* GetCurrentSurface targets */ +#define EGL_DRAW 0x3059 +#define EGL_READ 0x305A + +/* WaitNative engines */ +#define EGL_CORE_NATIVE_ENGINE 0x305B + +/* EGL 1.2 tokens renamed for consistency in EGL 1.3 */ +#define EGL_COLORSPACE EGL_VG_COLORSPACE +#define EGL_ALPHA_FORMAT EGL_VG_ALPHA_FORMAT +#define EGL_COLORSPACE_sRGB EGL_VG_COLORSPACE_sRGB +#define EGL_COLORSPACE_LINEAR EGL_VG_COLORSPACE_LINEAR +#define EGL_ALPHA_FORMAT_NONPRE EGL_VG_ALPHA_FORMAT_NONPRE +#define EGL_ALPHA_FORMAT_PRE EGL_VG_ALPHA_FORMAT_PRE + +/* EGL extensions must request enum blocks from the Khronos + * API Registrar, who maintains the enumerant registry. Submit + * a bug in Khronos Bugzilla against task "Registry". + */ + + + +/* EGL Functions */ + +EGLAPI EGLint EGLAPIENTRY eglGetError(void); + +EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay(EGLNativeDisplayType display_id); +EGLAPI EGLBoolean EGLAPIENTRY eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor); +EGLAPI EGLBoolean EGLAPIENTRY eglTerminate(EGLDisplay dpy); + +EGLAPI const char * EGLAPIENTRY eglQueryString(EGLDisplay dpy, EGLint name); + +EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigs(EGLDisplay dpy, EGLConfig *configs, + EGLint config_size, EGLint *num_config); +EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list, + EGLConfig *configs, EGLint config_size, + EGLint *num_config); +EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config, + EGLint attribute, EGLint *value); + +EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, + EGLNativeWindowType win, + const EGLint *attrib_list); +EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config, + const EGLint *attrib_list); +EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config, + EGLNativePixmapType pixmap, + const EGLint *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglDestroySurface(EGLDisplay dpy, EGLSurface surface); +EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface(EGLDisplay dpy, EGLSurface surface, + EGLint attribute, EGLint *value); + +EGLAPI EGLBoolean EGLAPIENTRY eglBindAPI(EGLenum api); +EGLAPI EGLenum EGLAPIENTRY eglQueryAPI(void); + +EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient(void); + +EGLAPI EGLBoolean EGLAPIENTRY eglReleaseThread(void); + +EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferFromClientBuffer( + EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, + EGLConfig config, const EGLint *attrib_list); + +EGLAPI EGLBoolean EGLAPIENTRY eglSurfaceAttrib(EGLDisplay dpy, EGLSurface surface, + EGLint attribute, EGLint value); +EGLAPI EGLBoolean EGLAPIENTRY eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer); +EGLAPI EGLBoolean EGLAPIENTRY eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer); + + +EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval(EGLDisplay dpy, EGLint interval); + + +EGLAPI EGLContext EGLAPIENTRY eglCreateContext(EGLDisplay dpy, EGLConfig config, + EGLContext share_context, + const EGLint *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglDestroyContext(EGLDisplay dpy, EGLContext ctx); +EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, + EGLSurface read, EGLContext ctx); + +EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext(void); +EGLAPI EGLSurface EGLAPIENTRY eglGetCurrentSurface(EGLint readdraw); +EGLAPI EGLDisplay EGLAPIENTRY eglGetCurrentDisplay(void); +EGLAPI EGLBoolean EGLAPIENTRY eglQueryContext(EGLDisplay dpy, EGLContext ctx, + EGLint attribute, EGLint *value); + +EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL(void); +EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative(EGLint engine); +EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surface); +EGLAPI EGLBoolean EGLAPIENTRY eglCopyBuffers(EGLDisplay dpy, EGLSurface surface, + EGLNativePixmapType target); + +/* This is a generic function pointer type, whose name indicates it must + * be cast to the proper type *and calling convention* before use. + */ +typedef void (*__eglMustCastToProperFunctionPointerType)(void); + +/* Now, define eglGetProcAddress using the generic function ptr. type */ +EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY + eglGetProcAddress(const char *procname); + +#ifdef __cplusplus +} +#endif + +#endif /* __egl_h_ */ diff --git a/include/EGL/eglext.h b/include/EGL/eglext.h new file mode 100644 index 0000000..0460393 --- /dev/null +++ b/include/EGL/eglext.h @@ -0,0 +1,384 @@ +#ifndef __eglext_h_ +#define __eglext_h_ + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Copyright (c) 2007-2010 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +#include <EGL/eglplatform.h> + +/*************************************************************/ + +/* Header file version number */ +/* Current version at http://www.khronos.org/registry/egl/ */ +/* $Revision: 12124 $ on $Date: 2010-07-27 20:12:35 -0700 (Tue, 27 Jul 2010) $ */ +#define EGL_EGLEXT_VERSION 7 + +#ifndef EGL_KHR_config_attribs +#define EGL_KHR_config_attribs 1 +#define EGL_CONFORMANT_KHR 0x3042 /* EGLConfig attribute */ +#define EGL_VG_COLORSPACE_LINEAR_BIT_KHR 0x0020 /* EGL_SURFACE_TYPE bitfield */ +#define EGL_VG_ALPHA_FORMAT_PRE_BIT_KHR 0x0040 /* EGL_SURFACE_TYPE bitfield */ +#endif + +#ifndef EGL_KHR_lock_surface +#define EGL_KHR_lock_surface 1 +#define EGL_READ_SURFACE_BIT_KHR 0x0001 /* EGL_LOCK_USAGE_HINT_KHR bitfield */ +#define EGL_WRITE_SURFACE_BIT_KHR 0x0002 /* EGL_LOCK_USAGE_HINT_KHR bitfield */ +#define EGL_LOCK_SURFACE_BIT_KHR 0x0080 /* EGL_SURFACE_TYPE bitfield */ +#define EGL_OPTIMAL_FORMAT_BIT_KHR 0x0100 /* EGL_SURFACE_TYPE bitfield */ +#define EGL_MATCH_FORMAT_KHR 0x3043 /* EGLConfig attribute */ +#define EGL_FORMAT_RGB_565_EXACT_KHR 0x30C0 /* EGL_MATCH_FORMAT_KHR value */ +#define EGL_FORMAT_RGB_565_KHR 0x30C1 /* EGL_MATCH_FORMAT_KHR value */ +#define EGL_FORMAT_RGBA_8888_EXACT_KHR 0x30C2 /* EGL_MATCH_FORMAT_KHR value */ +#define EGL_FORMAT_RGBA_8888_KHR 0x30C3 /* EGL_MATCH_FORMAT_KHR value */ +#define EGL_MAP_PRESERVE_PIXELS_KHR 0x30C4 /* eglLockSurfaceKHR attribute */ +#define EGL_LOCK_USAGE_HINT_KHR 0x30C5 /* eglLockSurfaceKHR attribute */ +#define EGL_BITMAP_POINTER_KHR 0x30C6 /* eglQuerySurface attribute */ +#define EGL_BITMAP_PITCH_KHR 0x30C7 /* eglQuerySurface attribute */ +#define EGL_BITMAP_ORIGIN_KHR 0x30C8 /* eglQuerySurface attribute */ +#define EGL_BITMAP_PIXEL_RED_OFFSET_KHR 0x30C9 /* eglQuerySurface attribute */ +#define EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR 0x30CA /* eglQuerySurface attribute */ +#define EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR 0x30CB /* eglQuerySurface attribute */ +#define EGL_BITMAP_PIXEL_ALPHA_OFFSET_KHR 0x30CC /* eglQuerySurface attribute */ +#define EGL_BITMAP_PIXEL_LUMINANCE_OFFSET_KHR 0x30CD /* eglQuerySurface attribute */ +#define EGL_LOWER_LEFT_KHR 0x30CE /* EGL_BITMAP_ORIGIN_KHR value */ +#define EGL_UPPER_LEFT_KHR 0x30CF /* EGL_BITMAP_ORIGIN_KHR value */ +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglLockSurfaceKHR (EGLDisplay display, EGLSurface surface, const EGLint *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglUnlockSurfaceKHR (EGLDisplay display, EGLSurface surface); +#endif /* EGL_EGLEXT_PROTOTYPES */ +typedef EGLBoolean (EGLAPIENTRYP PFNEGLLOCKSURFACEKHRPROC) (EGLDisplay display, EGLSurface surface, const EGLint *attrib_list); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNLOCKSURFACEKHRPROC) (EGLDisplay display, EGLSurface surface); +#endif + +#ifndef EGL_KHR_image +#define EGL_KHR_image 1 +#define EGL_NATIVE_PIXMAP_KHR 0x30B0 /* eglCreateImageKHR target */ +typedef void *EGLImageKHR; +#define EGL_NO_IMAGE_KHR ((EGLImageKHR)0) +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLImageKHR EGLAPIENTRY eglCreateImageKHR (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImageKHR (EGLDisplay dpy, EGLImageKHR image); +#endif /* EGL_EGLEXT_PROTOTYPES */ +typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEIMAGEKHRPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGLImageKHR image); +#endif + +#ifndef EGL_KHR_vg_parent_image +#define EGL_KHR_vg_parent_image 1 +#define EGL_VG_PARENT_IMAGE_KHR 0x30BA /* eglCreateImageKHR target */ +#endif + +#ifndef EGL_KHR_gl_texture_2D_image +#define EGL_KHR_gl_texture_2D_image 1 +#define EGL_GL_TEXTURE_2D_KHR 0x30B1 /* eglCreateImageKHR target */ +#define EGL_GL_TEXTURE_LEVEL_KHR 0x30BC /* eglCreateImageKHR attribute */ +#endif + +#ifndef EGL_KHR_gl_texture_cubemap_image +#define EGL_KHR_gl_texture_cubemap_image 1 +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X_KHR 0x30B3 /* eglCreateImageKHR target */ +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X_KHR 0x30B4 /* eglCreateImageKHR target */ +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y_KHR 0x30B5 /* eglCreateImageKHR target */ +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_KHR 0x30B6 /* eglCreateImageKHR target */ +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z_KHR 0x30B7 /* eglCreateImageKHR target */ +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_KHR 0x30B8 /* eglCreateImageKHR target */ +#endif + +#ifndef EGL_KHR_gl_texture_3D_image +#define EGL_KHR_gl_texture_3D_image 1 +#define EGL_GL_TEXTURE_3D_KHR 0x30B2 /* eglCreateImageKHR target */ +#define EGL_GL_TEXTURE_ZOFFSET_KHR 0x30BD /* eglCreateImageKHR attribute */ +#endif + +#ifndef EGL_KHR_gl_renderbuffer_image +#define EGL_KHR_gl_renderbuffer_image 1 +#define EGL_GL_RENDERBUFFER_KHR 0x30B9 /* eglCreateImageKHR target */ +#endif + +#ifndef EGL_MESA_drm_image +#define EGL_MESA_drm_image 1 +#define EGL_DRM_BUFFER_FORMAT_MESA 0x31D0 /* eglCreateImageKHR attribute */ +#define EGL_DRM_BUFFER_USE_MESA 0x31D1 + +/* EGL_DRM_BUFFER_FORMAT_MESA tokens */ +#define EGL_DRM_BUFFER_FORMAT_ARGB32_MESA 0x31D2 + +/* EGL_DRM_BUFFER_USE_MESA bits */ +#define EGL_DRM_BUFFER_USE_SCANOUT_MESA 0x0001 +#define EGL_DRM_BUFFER_USE_SHARE_MESA 0x0002 + +#define EGL_DRM_BUFFER_MESA 0x31D3 /* eglCreateImageKHR target */ +#define EGL_DRM_BUFFER_STRIDE_MESA 0x31D4 /* eglCreateImageKHR attribute */ + +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLImageKHR EGLAPIENTRY eglCreateDRMImageMESA(EGLDisplay dpy, const EGLint *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglExportDRMImageMESA(EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride); +#endif +typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEDRMIMAGEMESA) (EGLDisplay dpy, const EGLint *attrib_list); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDRMIMAGEMESA) (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride); +#endif + +#if KHRONOS_SUPPORT_INT64 /* EGLTimeKHR requires 64-bit uint support */ +#ifndef EGL_KHR_reusable_sync +#define EGL_KHR_reusable_sync 1 + +typedef void* EGLSyncKHR; +typedef khronos_utime_nanoseconds_t EGLTimeKHR; + +#define EGL_SYNC_STATUS_KHR 0x30F1 +#define EGL_SIGNALED_KHR 0x30F2 +#define EGL_UNSIGNALED_KHR 0x30F3 +#define EGL_TIMEOUT_EXPIRED_KHR 0x30F5 +#define EGL_CONDITION_SATISFIED_KHR 0x30F6 +#define EGL_SYNC_TYPE_KHR 0x30F7 +#define EGL_SYNC_REUSABLE_KHR 0x30FA +#define EGL_SYNC_FLUSH_COMMANDS_BIT_KHR 0x0001 /* eglClientWaitSyncKHR <flags> bitfield */ +#define EGL_FOREVER_KHR 0xFFFFFFFFFFFFFFFFull +#define EGL_NO_SYNC_KHR ((EGLSyncKHR)0) +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync); +EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout); +EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode); +EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value); +#endif /* EGL_EGLEXT_PROTOTYPES */ +typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESYNCKHRPROC) (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync); +typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value); +#endif +#endif + +/* EGL_MESA_screen extension >>> PRELIMINARY <<< */ +#ifndef EGL_MESA_screen_surface +#define EGL_MESA_screen_surface 1 + +#define EGL_BAD_SCREEN_MESA 0x4000 +#define EGL_BAD_MODE_MESA 0x4001 +#define EGL_SCREEN_COUNT_MESA 0x4002 +#define EGL_SCREEN_POSITION_MESA 0x4003 +#define EGL_SCREEN_POSITION_GRANULARITY_MESA 0x4004 +#define EGL_MODE_ID_MESA 0x4005 +#define EGL_REFRESH_RATE_MESA 0x4006 +#define EGL_OPTIMAL_MESA 0x4007 +#define EGL_INTERLACED_MESA 0x4008 +#define EGL_SCREEN_BIT_MESA 0x08 + +typedef khronos_uint32_t EGLScreenMESA; +typedef khronos_uint32_t EGLModeMESA; + +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglChooseModeMESA(EGLDisplay dpy, EGLScreenMESA screen, const EGLint *attrib_list, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes); +EGLAPI EGLBoolean EGLAPIENTRY eglGetModesMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes); +EGLAPI EGLBoolean EGLAPIENTRY eglGetModeAttribMESA(EGLDisplay dpy, EGLModeMESA mode, EGLint attribute, EGLint *value); +EGLAPI EGLBoolean EGLAPIENTRY eglGetScreensMESA(EGLDisplay dpy, EGLScreenMESA *screens, EGLint max_screens, EGLint *num_screens); +EGLAPI EGLSurface EGLAPIENTRY eglCreateScreenSurfaceMESA(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglShowScreenSurfaceMESA(EGLDisplay dpy, EGLint screen, EGLSurface surface, EGLModeMESA mode); +EGLAPI EGLBoolean EGLAPIENTRY eglScreenPositionMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLint x, EGLint y); +EGLAPI EGLBoolean EGLAPIENTRY eglQueryScreenMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLint attribute, EGLint *value); +EGLAPI EGLBoolean EGLAPIENTRY eglQueryScreenSurfaceMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLSurface *surface); +EGLAPI EGLBoolean EGLAPIENTRY eglQueryScreenModeMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *mode); +EGLAPI const char * EGLAPIENTRY eglQueryModeStringMESA(EGLDisplay dpy, EGLModeMESA mode); +#endif /* EGL_EGLEXT_PROTOTYPES */ + +typedef EGLBoolean (EGLAPIENTRYP PFNEGLCHOOSEMODEMESA) (EGLDisplay dpy, EGLScreenMESA screen, const EGLint *attrib_list, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETMODESMESA) (EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLGetModeATTRIBMESA) (EGLDisplay dpy, EGLModeMESA mode, EGLint attribute, EGLint *value); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSCRREENSMESA) (EGLDisplay dpy, EGLScreenMESA *screens, EGLint max_screens, EGLint *num_screens); +typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATESCREENSURFACEMESA) (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSHOWSCREENSURFACEMESA) (EGLDisplay dpy, EGLint screen, EGLSurface surface, EGLModeMESA mode); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSCREENPOSIITONMESA) (EGLDisplay dpy, EGLScreenMESA screen, EGLint x, EGLint y); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSCREENMESA) (EGLDisplay dpy, EGLScreenMESA screen, EGLint attribute, EGLint *value); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSCREENSURFACEMESA) (EGLDisplay dpy, EGLScreenMESA screen, EGLSurface *surface); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSCREENMODEMESA) (EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *mode); +typedef const char * (EGLAPIENTRYP PFNEGLQUERYMODESTRINGMESA) (EGLDisplay dpy, EGLModeMESA mode); + +#endif /* EGL_MESA_screen_surface */ + + +#ifndef EGL_MESA_copy_context +#define EGL_MESA_copy_context 1 + +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglCopyContextMESA(EGLDisplay dpy, EGLContext source, EGLContext dest, EGLint mask); +#endif /* EGL_EGLEXT_PROTOTYPES */ + +typedef EGLBoolean (EGLAPIENTRYP PFNEGLCOPYCONTEXTMESA) (EGLDisplay dpy, EGLContext source, EGLContext dest, EGLint mask); + +#endif /* EGL_MESA_copy_context */ + +#ifndef EGL_MESA_drm_display +#define EGL_MESA_drm_display 1 + +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLDisplay EGLAPIENTRY eglGetDRMDisplayMESA(int fd); +#endif /* EGL_EGLEXT_PROTOTYPES */ + +typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETDRMDISPLAYMESA) (int fd); + +#endif /* EGL_MESA_drm_display */ + +#ifndef EGL_KHR_image_base +#define EGL_KHR_image_base 1 +/* Most interfaces defined by EGL_KHR_image_pixmap above */ +#define EGL_IMAGE_PRESERVED_KHR 0x30D2 /* eglCreateImageKHR attribute */ +#endif + +#ifndef EGL_KHR_image_pixmap +#define EGL_KHR_image_pixmap 1 +/* Interfaces defined by EGL_KHR_image above */ +#endif + +#ifndef EGL_IMG_context_priority +#define EGL_IMG_context_priority 1 +#define EGL_CONTEXT_PRIORITY_LEVEL_IMG 0x3100 +#define EGL_CONTEXT_PRIORITY_HIGH_IMG 0x3101 +#define EGL_CONTEXT_PRIORITY_MEDIUM_IMG 0x3102 +#define EGL_CONTEXT_PRIORITY_LOW_IMG 0x3103 +#endif + +#ifndef EGL_KHR_lock_surface2 +#define EGL_KHR_lock_surface2 1 +#define EGL_BITMAP_PIXEL_SIZE_KHR 0x3110 +#endif + +#ifndef EGL_NV_coverage_sample +#define EGL_NV_coverage_sample 1 +#define EGL_COVERAGE_BUFFERS_NV 0x30E0 +#define EGL_COVERAGE_SAMPLES_NV 0x30E1 +#endif + +#ifndef EGL_NV_depth_nonlinear +#define EGL_NV_depth_nonlinear 1 +#define EGL_DEPTH_ENCODING_NV 0x30E2 +#define EGL_DEPTH_ENCODING_NONE_NV 0 +#define EGL_DEPTH_ENCODING_NONLINEAR_NV 0x30E3 +#endif + +#if KHRONOS_SUPPORT_INT64 /* EGLTimeNV requires 64-bit uint support */ +#ifndef EGL_NV_sync +#define EGL_NV_sync 1 +#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_NV 0x30E6 +#define EGL_SYNC_STATUS_NV 0x30E7 +#define EGL_SIGNALED_NV 0x30E8 +#define EGL_UNSIGNALED_NV 0x30E9 +#define EGL_SYNC_FLUSH_COMMANDS_BIT_NV 0x0001 +#define EGL_FOREVER_NV 0xFFFFFFFFFFFFFFFFull +#define EGL_ALREADY_SIGNALED_NV 0x30EA +#define EGL_TIMEOUT_EXPIRED_NV 0x30EB +#define EGL_CONDITION_SATISFIED_NV 0x30EC +#define EGL_SYNC_TYPE_NV 0x30ED +#define EGL_SYNC_CONDITION_NV 0x30EE +#define EGL_SYNC_FENCE_NV 0x30EF +#define EGL_NO_SYNC_NV ((EGLSyncNV)0) +typedef void* EGLSyncNV; +typedef khronos_utime_nanoseconds_t EGLTimeNV; +#ifdef EGL_EGLEXT_PROTOTYPES +EGLSyncNV eglCreateFenceSyncNV (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list); +EGLBoolean eglDestroySyncNV (EGLSyncNV sync); +EGLBoolean eglFenceNV (EGLSyncNV sync); +EGLint eglClientWaitSyncNV (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout); +EGLBoolean eglSignalSyncNV (EGLSyncNV sync, EGLenum mode); +EGLBoolean eglGetSyncAttribNV (EGLSyncNV sync, EGLint attribute, EGLint *value); +#endif /* EGL_EGLEXT_PROTOTYPES */ +typedef EGLSyncNV (EGLAPIENTRYP PFNEGLCREATEFENCESYNCNVPROC) (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCNVPROC) (EGLSyncNV sync); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLFENCENVPROC) (EGLSyncNV sync); +typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCNVPROC) (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCNVPROC) (EGLSyncNV sync, EGLenum mode); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBNVPROC) (EGLSyncNV sync, EGLint attribute, EGLint *value); +#endif +#endif + +#if KHRONOS_SUPPORT_INT64 /* Dependent on EGL_KHR_reusable_sync which requires 64-bit uint support */ +#ifndef EGL_KHR_fence_sync +#define EGL_KHR_fence_sync 1 +/* Reuses most tokens and entry points from EGL_KHR_reusable_sync */ +#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR 0x30F0 +#define EGL_SYNC_CONDITION_KHR 0x30F8 +#define EGL_SYNC_FENCE_KHR 0x30F9 +#endif +#endif + +#ifndef EGL_HI_clientpixmap +#define EGL_HI_clientpixmap 1 + +/* Surface Attribute */ +#define EGL_CLIENT_PIXMAP_POINTER_HI 0x8F74 +/* + * Structure representing a client pixmap + * (pixmap's data is in client-space memory). + */ +struct EGLClientPixmapHI +{ + void* pData; + EGLint iWidth; + EGLint iHeight; + EGLint iStride; +}; + +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurfaceHI(EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI* pixmap); +#endif /* EGL_EGLEXT_PROTOTYPES */ +typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPIXMAPSURFACEHIPROC) (EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI* pixmap); +#endif /* EGL_HI_clientpixmap */ + +#ifndef EGL_HI_colorformats +#define EGL_HI_colorformats 1 +/* Config Attribute */ +#define EGL_COLOR_FORMAT_HI 0x8F70 +/* Color Formats */ +#define EGL_COLOR_RGB_HI 0x8F71 +#define EGL_COLOR_RGBA_HI 0x8F72 +#define EGL_COLOR_ARGB_HI 0x8F73 +#endif /* EGL_HI_colorformats */ + +#ifndef EGL_NOK_swap_region +#define EGL_NOK_swap_region 1 + +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersRegionNOK(EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint* rects); +#endif + +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSREGIONNOK) (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint* rects); +#endif + + +#ifndef EGL_NOK_texture_from_pixmap +#define EGL_NOK_texture_from_pixmap 1 + +#define EGL_Y_INVERTED_NOK 0x307F +#endif /* EGL_NOK_texture_from_pixmap */ + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/EGL/eglplatform.h b/include/EGL/eglplatform.h new file mode 100755 index 0000000..b9c425e --- /dev/null +++ b/include/EGL/eglplatform.h @@ -0,0 +1,108 @@ +#ifndef __eglplatform_h_ +#define __eglplatform_h_ + +/* +** Copyright (c) 2007-2009 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +/* Platform-specific types and definitions for egl.h + * $Revision: 7244 $ on $Date: 2009-01-20 17:06:59 -0800 (Tue, 20 Jan 2009) $ + * + * Adopters may modify khrplatform.h and this file to suit their platform. + * You are encouraged to submit all modifications to the Khronos group so that + * they can be included in future versions of this file. Please submit changes + * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla) + * by filing a bug against product "EGL" component "Registry". + */ + +#include <KHR/khrplatform.h> + +/* Macros used in EGL function prototype declarations. + * + * EGL functions should be prototyped as: + * + * EGLAPI return-type EGLAPIENTRY eglFunction(arguments); + * typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments); + * + * KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h + */ + +#ifndef EGLAPI +#define EGLAPI KHRONOS_APICALL +#endif + +#define EGLAPIENTRY KHRONOS_APIENTRY +#define EGLAPIENTRYP KHRONOS_APIENTRY* + +/* The types NativeDisplayType, NativeWindowType, and NativePixmapType + * are aliases of window-system-dependent types, such as X Display * or + * Windows Device Context. They must be defined in platform-specific + * code below. The EGL-prefixed versions of Native*Type are the same + * types, renamed in EGL 1.3 so all types in the API start with "EGL". + */ + +#if defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */ +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN 1 +#endif +#include <windows.h> + +typedef HDC EGLNativeDisplayType; +typedef HBITMAP EGLNativePixmapType; +typedef HWND EGLNativeWindowType; + +#elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */ + +typedef int EGLNativeDisplayType; +typedef void *EGLNativeWindowType; +typedef void *EGLNativePixmapType; + +#elif defined(__unix__) + +/* X11 (tentative) */ +#include <X11/Xlib.h> +#include <X11/Xutil.h> + +typedef Display *EGLNativeDisplayType; +typedef Pixmap EGLNativePixmapType; +typedef Window EGLNativeWindowType; + +#else +#error "Platform not recognized" +#endif + +/* EGL 1.2 types, renamed for consistency in EGL 1.3 */ +typedef EGLNativeDisplayType NativeDisplayType; +typedef EGLNativePixmapType NativePixmapType; +typedef EGLNativeWindowType NativeWindowType; + + +/* Define EGLint. This must be a signed integral type large enough to contain + * all legal attribute names and values passed into and out of EGL, whether + * their type is boolean, bitmask, enumerant (symbolic constant), integer, + * handle, or other. While in general a 32-bit integer will suffice, if + * handles are 64 bit types, then EGLint should be defined as a signed 64-bit + * integer type. + */ +typedef khronos_int32_t EGLint; + +#endif /* __eglplatform_h */ diff --git a/include/GL/gl.h b/include/GL/gl.h new file mode 100644 index 0000000..4f0c0e0 --- /dev/null +++ b/include/GL/gl.h @@ -0,0 +1,2251 @@ +/* + * 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/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 <GL/glext.h> + +#endif /* GL_GLEXT_LEGACY */ + + + +#if GL_ARB_shader_objects + +#ifndef GL_MESA_shader_debug +#define GL_MESA_shader_debug 1 + +#define GL_DEBUG_OBJECT_MESA 0x8759 +#define GL_DEBUG_PRINT_MESA 0x875A +#define GL_DEBUG_ASSERT_MESA 0x875B + +GLAPI GLhandleARB 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_ */ diff --git a/include/GL/glext.h b/include/GL/glext.h new file mode 100644 index 0000000..a82595e --- /dev/null +++ b/include/GL/glext.h @@ -0,0 +1,7279 @@ +#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 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 + + +#ifdef __cplusplus +} +#endif + +#endif + + +/* ERO */ +GLAPI void GLAPIENTRY fake_gluBuild2DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *data); diff --git a/include/GL/glu.h b/include/GL/glu.h new file mode 100644 index 0000000..63947d0 --- /dev/null +++ b/include/GL/glu.h @@ -0,0 +1,354 @@ +/* +** 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)(); + +GLAPI void GLAPIENTRY gluBeginCurve (GLUnurbs* nurb); +GLAPI void GLAPIENTRY gluBeginPolygon (GLUtesselator* tess); +GLAPI void GLAPIENTRY gluBeginSurface (GLUnurbs* nurb); +GLAPI void GLAPIENTRY gluBeginTrim (GLUnurbs* nurb); +GLAPI GLint GLAPIENTRY gluBuild1DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data); +GLAPI GLint GLAPIENTRY gluBuild1DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, const void *data); +GLAPI GLint GLAPIENTRY gluBuild2DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data); +GLAPI GLint GLAPIENTRY gluBuild2DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *data); +GLAPI GLint GLAPIENTRY gluBuild3DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data); +GLAPI GLint GLAPIENTRY gluBuild3DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data); +GLAPI GLboolean GLAPIENTRY gluCheckExtension (const GLubyte *extName, const GLubyte *extString); +GLAPI void GLAPIENTRY gluCylinder (GLUquadric* quad, GLdouble base, GLdouble top, GLdouble height, GLint slices, GLint stacks); +GLAPI void GLAPIENTRY gluDeleteNurbsRenderer (GLUnurbs* nurb); +GLAPI void GLAPIENTRY gluDeleteQuadric (GLUquadric* quad); +GLAPI void GLAPIENTRY gluDeleteTess (GLUtesselator* tess); +GLAPI void GLAPIENTRY gluDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops); +GLAPI void GLAPIENTRY gluEndCurve (GLUnurbs* nurb); +GLAPI void GLAPIENTRY gluEndPolygon (GLUtesselator* tess); +GLAPI void GLAPIENTRY gluEndSurface (GLUnurbs* nurb); +GLAPI void GLAPIENTRY gluEndTrim (GLUnurbs* nurb); +GLAPI const GLubyte * GLAPIENTRY gluErrorString (GLenum error); +GLAPI void GLAPIENTRY gluGetNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat* data); +GLAPI const GLubyte * GLAPIENTRY gluGetString (GLenum name); +GLAPI void GLAPIENTRY gluGetTessProperty (GLUtesselator* tess, GLenum which, GLdouble* data); +GLAPI void GLAPIENTRY gluLoadSamplingMatrices (GLUnurbs* nurb, const GLfloat *model, const GLfloat *perspective, const GLint *view); +GLAPI void GLAPIENTRY gluLookAt (GLdouble eyeX, GLdouble eyeY, GLdouble eyeZ, GLdouble centerX, GLdouble centerY, GLdouble centerZ, GLdouble upX, GLdouble upY, GLdouble upZ); +GLAPI GLUnurbs* GLAPIENTRY gluNewNurbsRenderer (void); +GLAPI GLUquadric* GLAPIENTRY gluNewQuadric (void); +GLAPI GLUtesselator* GLAPIENTRY gluNewTess (void); +GLAPI void GLAPIENTRY gluNextContour (GLUtesselator* tess, GLenum type); +GLAPI void GLAPIENTRY gluNurbsCallback (GLUnurbs* nurb, GLenum which, _GLUfuncptr CallBackFunc); +GLAPI void GLAPIENTRY gluNurbsCallbackData (GLUnurbs* nurb, GLvoid* userData); +GLAPI void GLAPIENTRY gluNurbsCallbackDataEXT (GLUnurbs* nurb, GLvoid* userData); +GLAPI void GLAPIENTRY gluNurbsCurve (GLUnurbs* nurb, GLint knotCount, GLfloat *knots, GLint stride, GLfloat *control, GLint order, GLenum type); +GLAPI void GLAPIENTRY gluNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat value); +GLAPI void GLAPIENTRY gluNurbsSurface (GLUnurbs* nurb, GLint sKnotCount, GLfloat* sKnots, GLint tKnotCount, GLfloat* tKnots, GLint sStride, GLint tStride, GLfloat* control, GLint sOrder, GLint tOrder, GLenum type); +GLAPI void GLAPIENTRY gluOrtho2D (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top); +GLAPI void GLAPIENTRY gluPartialDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops, GLdouble start, GLdouble sweep); +GLAPI void GLAPIENTRY gluPerspective (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar); +GLAPI void GLAPIENTRY gluPickMatrix (GLdouble x, GLdouble y, GLdouble delX, GLdouble delY, GLint *viewport); +GLAPI GLint GLAPIENTRY gluProject (GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* winX, GLdouble* winY, GLdouble* winZ); +GLAPI void GLAPIENTRY gluPwlCurve (GLUnurbs* nurb, GLint count, GLfloat* data, GLint stride, GLenum type); +GLAPI void GLAPIENTRY gluQuadricCallback (GLUquadric* quad, GLenum which, _GLUfuncptr CallBackFunc); +GLAPI void GLAPIENTRY gluQuadricDrawStyle (GLUquadric* quad, GLenum draw); +GLAPI void GLAPIENTRY gluQuadricNormals (GLUquadric* quad, GLenum normal); +GLAPI void GLAPIENTRY gluQuadricOrientation (GLUquadric* quad, GLenum orientation); +GLAPI void GLAPIENTRY gluQuadricTexture (GLUquadric* quad, GLboolean texture); +GLAPI GLint GLAPIENTRY gluScaleImage (GLenum format, GLsizei wIn, GLsizei hIn, GLenum typeIn, const void *dataIn, GLsizei wOut, GLsizei hOut, GLenum typeOut, GLvoid* dataOut); +GLAPI void GLAPIENTRY gluSphere (GLUquadric* quad, GLdouble radius, GLint slices, GLint stacks); +GLAPI void GLAPIENTRY gluTessBeginContour (GLUtesselator* tess); +GLAPI void GLAPIENTRY gluTessBeginPolygon (GLUtesselator* tess, GLvoid* data); +GLAPI void GLAPIENTRY gluTessCallback (GLUtesselator* tess, GLenum which, _GLUfuncptr CallBackFunc); +GLAPI void GLAPIENTRY gluTessEndContour (GLUtesselator* tess); +GLAPI void GLAPIENTRY gluTessEndPolygon (GLUtesselator* tess); +GLAPI void GLAPIENTRY gluTessNormal (GLUtesselator* tess, GLdouble valueX, GLdouble valueY, GLdouble valueZ); +GLAPI void GLAPIENTRY gluTessProperty (GLUtesselator* tess, GLenum which, GLdouble data); +GLAPI void GLAPIENTRY gluTessVertex (GLUtesselator* tess, GLdouble *location, GLvoid* data); +GLAPI GLint GLAPIENTRY gluUnProject (GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* objX, GLdouble* objY, GLdouble* objZ); +GLAPI GLint GLAPIENTRY gluUnProject4 (GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble nearVal, GLdouble farVal, GLdouble* objX, GLdouble* objY, GLdouble* objZ, GLdouble* objW); + +#ifdef __cplusplus +} +#endif + +#endif /* __glu_h__ */ diff --git a/include/GL/glx.h b/include/GL/glx.h new file mode 100644 index 0000000..bb742d9 --- /dev/null +++ b/include/GL/glx.h @@ -0,0 +1,510 @@ +/* + * Mesa 3-D graphics library + * Version: 6.5 + * + * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + + +#ifndef GLX_H +#define GLX_H + + +#ifdef __VMS +#include <GL/vms_x_fix.h> +# ifdef __cplusplus +/* VMS Xlib.h gives problems with C++. + * this avoids a bunch of trivial warnings */ +#pragma message disable nosimpint +#endif +#endif +#include <X11/Xlib.h> +#include <X11/Xutil.h> +#ifdef __VMS +# ifdef __cplusplus +#pragma message enable nosimpint +#endif +#endif +#include <GL/gl.h> + + +#if defined(USE_MGL_NAMESPACE) +#include "glx_mangle.h" +#endif + + +#ifdef __cplusplus +extern "C" { +#endif + + +#define GLX_VERSION_1_1 1 +#define GLX_VERSION_1_2 1 +#define GLX_VERSION_1_3 1 +#define GLX_VERSION_1_4 1 + +#define GLX_EXTENSION_NAME "GLX" + + + +/* + * Tokens for glXChooseVisual and glXGetConfig: + */ +#define GLX_USE_GL 1 +#define GLX_BUFFER_SIZE 2 +#define GLX_LEVEL 3 +#define GLX_RGBA 4 +#define GLX_DOUBLEBUFFER 5 +#define GLX_STEREO 6 +#define GLX_AUX_BUFFERS 7 +#define GLX_RED_SIZE 8 +#define GLX_GREEN_SIZE 9 +#define GLX_BLUE_SIZE 10 +#define GLX_ALPHA_SIZE 11 +#define GLX_DEPTH_SIZE 12 +#define GLX_STENCIL_SIZE 13 +#define GLX_ACCUM_RED_SIZE 14 +#define GLX_ACCUM_GREEN_SIZE 15 +#define GLX_ACCUM_BLUE_SIZE 16 +#define GLX_ACCUM_ALPHA_SIZE 17 + + +/* + * Error codes returned by glXGetConfig: + */ +#define GLX_BAD_SCREEN 1 +#define GLX_BAD_ATTRIBUTE 2 +#define GLX_NO_EXTENSION 3 +#define GLX_BAD_VISUAL 4 +#define GLX_BAD_CONTEXT 5 +#define GLX_BAD_VALUE 6 +#define GLX_BAD_ENUM 7 + + +/* + * GLX 1.1 and later: + */ +#define GLX_VENDOR 1 +#define GLX_VERSION 2 +#define GLX_EXTENSIONS 3 + + +/* + * GLX 1.3 and later: + */ +#define GLX_CONFIG_CAVEAT 0x20 +#define GLX_DONT_CARE 0xFFFFFFFF +#define GLX_X_VISUAL_TYPE 0x22 +#define GLX_TRANSPARENT_TYPE 0x23 +#define GLX_TRANSPARENT_INDEX_VALUE 0x24 +#define GLX_TRANSPARENT_RED_VALUE 0x25 +#define GLX_TRANSPARENT_GREEN_VALUE 0x26 +#define GLX_TRANSPARENT_BLUE_VALUE 0x27 +#define GLX_TRANSPARENT_ALPHA_VALUE 0x28 +#define GLX_WINDOW_BIT 0x00000001 +#define GLX_PIXMAP_BIT 0x00000002 +#define GLX_PBUFFER_BIT 0x00000004 +#define GLX_AUX_BUFFERS_BIT 0x00000010 +#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001 +#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002 +#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004 +#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008 +#define GLX_DEPTH_BUFFER_BIT 0x00000020 +#define GLX_STENCIL_BUFFER_BIT 0x00000040 +#define GLX_ACCUM_BUFFER_BIT 0x00000080 +#define GLX_NONE 0x8000 +#define GLX_SLOW_CONFIG 0x8001 +#define GLX_TRUE_COLOR 0x8002 +#define GLX_DIRECT_COLOR 0x8003 +#define GLX_PSEUDO_COLOR 0x8004 +#define GLX_STATIC_COLOR 0x8005 +#define GLX_GRAY_SCALE 0x8006 +#define GLX_STATIC_GRAY 0x8007 +#define GLX_TRANSPARENT_RGB 0x8008 +#define GLX_TRANSPARENT_INDEX 0x8009 +#define GLX_VISUAL_ID 0x800B +#define GLX_SCREEN 0x800C +#define GLX_NON_CONFORMANT_CONFIG 0x800D +#define GLX_DRAWABLE_TYPE 0x8010 +#define GLX_RENDER_TYPE 0x8011 +#define GLX_X_RENDERABLE 0x8012 +#define GLX_FBCONFIG_ID 0x8013 +#define GLX_RGBA_TYPE 0x8014 +#define GLX_COLOR_INDEX_TYPE 0x8015 +#define GLX_MAX_PBUFFER_WIDTH 0x8016 +#define GLX_MAX_PBUFFER_HEIGHT 0x8017 +#define GLX_MAX_PBUFFER_PIXELS 0x8018 +#define GLX_PRESERVED_CONTENTS 0x801B +#define GLX_LARGEST_PBUFFER 0x801C +#define GLX_WIDTH 0x801D +#define GLX_HEIGHT 0x801E +#define GLX_EVENT_MASK 0x801F +#define GLX_DAMAGED 0x8020 +#define GLX_SAVED 0x8021 +#define GLX_WINDOW 0x8022 +#define GLX_PBUFFER 0x8023 +#define GLX_PBUFFER_HEIGHT 0x8040 +#define GLX_PBUFFER_WIDTH 0x8041 +#define GLX_RGBA_BIT 0x00000001 +#define GLX_COLOR_INDEX_BIT 0x00000002 +#define GLX_PBUFFER_CLOBBER_MASK 0x08000000 + + +/* + * GLX 1.4 and later: + */ +#define GLX_SAMPLE_BUFFERS 0x186a0 /*100000*/ +#define GLX_SAMPLES 0x186a1 /*100001*/ + + + +typedef struct __GLXcontextRec *GLXContext; +typedef XID GLXPixmap; +typedef XID GLXDrawable; +/* GLX 1.3 and later */ +typedef struct __GLXFBConfigRec *GLXFBConfig; +typedef XID GLXFBConfigID; +typedef XID GLXContextID; +typedef XID GLXWindow; +typedef XID GLXPbuffer; + + + +extern XVisualInfo* glXChooseVisual( Display *dpy, int screen, + int *attribList ); + +extern GLXContext glXCreateContext( Display *dpy, XVisualInfo *vis, + GLXContext shareList, Bool direct ); + +extern void glXDestroyContext( Display *dpy, GLXContext ctx ); + +extern Bool glXMakeCurrent( Display *dpy, GLXDrawable drawable, + GLXContext ctx); + +extern void glXCopyContext( Display *dpy, GLXContext src, GLXContext dst, + unsigned long mask ); + +extern void glXSwapBuffers( Display *dpy, GLXDrawable drawable ); + +extern GLXPixmap glXCreateGLXPixmap( Display *dpy, XVisualInfo *visual, + Pixmap pixmap ); + +extern void glXDestroyGLXPixmap( Display *dpy, GLXPixmap pixmap ); + +extern Bool glXQueryExtension( Display *dpy, int *errorb, int *event ); + +extern Bool glXQueryVersion( Display *dpy, int *maj, int *min ); + +extern Bool glXIsDirect( Display *dpy, GLXContext ctx ); + +extern int glXGetConfig( Display *dpy, XVisualInfo *visual, + int attrib, int *value ); + +extern GLXContext glXGetCurrentContext( void ); + +extern GLXDrawable glXGetCurrentDrawable( void ); + +extern void glXWaitGL( void ); + +extern void glXWaitX( void ); + +extern void glXUseXFont( Font font, int first, int count, int list ); + + + +/* GLX 1.1 and later */ +extern const char *glXQueryExtensionsString( Display *dpy, int screen ); + +extern const char *glXQueryServerString( Display *dpy, int screen, int name ); + +extern const char *glXGetClientString( Display *dpy, int name ); + + +/* GLX 1.2 and later */ +extern Display *glXGetCurrentDisplay( void ); + + +/* GLX 1.3 and later */ +extern GLXFBConfig *glXChooseFBConfig( Display *dpy, int screen, + const int *attribList, int *nitems ); + +extern int glXGetFBConfigAttrib( Display *dpy, GLXFBConfig config, + int attribute, int *value ); + +extern GLXFBConfig *glXGetFBConfigs( Display *dpy, int screen, + int *nelements ); + +extern XVisualInfo *glXGetVisualFromFBConfig( Display *dpy, + GLXFBConfig config ); + +extern GLXWindow glXCreateWindow( Display *dpy, GLXFBConfig config, + Window win, const int *attribList ); + +extern void glXDestroyWindow( Display *dpy, GLXWindow window ); + +extern GLXPixmap glXCreatePixmap( Display *dpy, GLXFBConfig config, + Pixmap pixmap, const int *attribList ); + +extern void glXDestroyPixmap( Display *dpy, GLXPixmap pixmap ); + +extern GLXPbuffer glXCreatePbuffer( Display *dpy, GLXFBConfig config, + const int *attribList ); + +extern void glXDestroyPbuffer( Display *dpy, GLXPbuffer pbuf ); + +extern void glXQueryDrawable( Display *dpy, GLXDrawable draw, int attribute, + unsigned int *value ); + +extern GLXContext glXCreateNewContext( Display *dpy, GLXFBConfig config, + int renderType, GLXContext shareList, + Bool direct ); + +extern Bool glXMakeContextCurrent( Display *dpy, GLXDrawable draw, + GLXDrawable read, GLXContext ctx ); + +extern GLXDrawable glXGetCurrentReadDrawable( void ); + +extern int glXQueryContext( Display *dpy, GLXContext ctx, int attribute, + int *value ); + +extern void glXSelectEvent( Display *dpy, GLXDrawable drawable, + unsigned long mask ); + +extern void glXGetSelectedEvent( Display *dpy, GLXDrawable drawable, + unsigned long *mask ); + + +/* GLX 1.4 and later */ +extern void (*glXGetProcAddress(const GLubyte *procname))( void ); + + +#ifndef GLX_GLXEXT_LEGACY + +#include <GL/glxext.h> + +#else + + + +/* + * ARB 2. GLX_ARB_get_proc_address + */ +#ifndef GLX_ARB_get_proc_address +#define GLX_ARB_get_proc_address 1 + +typedef void (*__GLXextFuncPtr)(void); +extern __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *); + +#endif /* GLX_ARB_get_proc_address */ + + + +#endif /* GLX_GLXEXT_LEGACY */ + + +/** + ** The following aren't in glxext.h yet. + **/ + + +/* + * ???. GLX_NV_vertex_array_range + */ +#ifndef GLX_NV_vertex_array_range +#define GLX_NV_vertex_array_range + +extern void *glXAllocateMemoryNV(GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority); +extern void glXFreeMemoryNV(GLvoid *pointer); +typedef void * ( * PFNGLXALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority); +typedef void ( * PFNGLXFREEMEMORYNVPROC) (GLvoid *pointer); + +#endif /* GLX_NV_vertex_array_range */ + + +/* + * ???. GLX_MESA_allocate_memory + */ +#ifndef GLX_MESA_allocate_memory +#define GLX_MESA_allocate_memory 1 + +extern void *glXAllocateMemoryMESA(Display *dpy, int scrn, size_t size, float readfreq, float writefreq, float priority); +extern void glXFreeMemoryMESA(Display *dpy, int scrn, void *pointer); +extern GLuint glXGetMemoryOffsetMESA(Display *dpy, int scrn, const void *pointer); +typedef void * ( * PFNGLXALLOCATEMEMORYMESAPROC) (Display *dpy, int scrn, size_t size, float readfreq, float writefreq, float priority); +typedef void ( * PFNGLXFREEMEMORYMESAPROC) (Display *dpy, int scrn, void *pointer); +typedef GLuint (* PFNGLXGETMEMORYOFFSETMESAPROC) (Display *dpy, int scrn, const void *pointer); + +#endif /* GLX_MESA_allocate_memory */ + + +/* + * ARB ?. GLX_ARB_render_texture + * XXX This was never finalized! + */ +#ifndef GLX_ARB_render_texture +#define GLX_ARB_render_texture 1 + +extern Bool glXBindTexImageARB(Display *dpy, GLXPbuffer pbuffer, int buffer); +extern Bool glXReleaseTexImageARB(Display *dpy, GLXPbuffer pbuffer, int buffer); +extern Bool glXDrawableAttribARB(Display *dpy, GLXDrawable draw, const int *attribList); + +#endif /* GLX_ARB_render_texture */ + + +#ifndef GLX_ATI_render_texture +#define GLX_ATI_render_texture 1 + +extern void glXBindTexImageATI(Display *dpy, GLXPbuffer pbuffer, int buffer); +extern void glXReleaseTexImageATI(Display *dpy, GLXPbuffer pbuffer, int buffer); +extern void glXDrawableAttribATI(Display *dpy, GLXDrawable draw, const int *attribList); + +#endif /* GLX_ATI_render_texture */ + + +/* + * Remove this when glxext.h is updated. + */ +#ifndef GLX_NV_float_buffer +#define GLX_NV_float_buffer 1 + +#define GLX_FLOAT_COMPONENTS_NV 0x20B0 + +#endif /* GLX_NV_float_buffer */ + + + +/* + * #?. GLX_MESA_swap_frame_usage + */ +#ifndef GLX_MESA_swap_frame_usage +#define GLX_MESA_swap_frame_usage 1 + +extern int glXGetFrameUsageMESA(Display *dpy, GLXDrawable drawable, float *usage); +extern int glXBeginFrameTrackingMESA(Display *dpy, GLXDrawable drawable); +extern int glXEndFrameTrackingMESA(Display *dpy, GLXDrawable drawable); +extern int glXQueryFrameTrackingMESA(Display *dpy, GLXDrawable drawable, int64_t *swapCount, int64_t *missedFrames, float *lastMissedUsage); + +typedef int (*PFNGLXGETFRAMEUSAGEMESAPROC) (Display *dpy, GLXDrawable drawable, float *usage); +typedef int (*PFNGLXBEGINFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable); +typedef int (*PFNGLXENDFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable); +typedef int (*PFNGLXQUERYFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable, int64_t *swapCount, int64_t *missedFrames, float *lastMissedUsage); + +#endif /* GLX_MESA_swap_frame_usage */ + + + +/* + * #?. GLX_MESA_swap_control + */ +#ifndef GLX_MESA_swap_control +#define GLX_MESA_swap_control 1 + +extern int glXSwapIntervalMESA(unsigned int interval); +extern int glXGetSwapIntervalMESA(void); + +typedef int (*PFNGLXSWAPINTERVALMESAPROC)(unsigned int interval); +typedef int (*PFNGLXGETSWAPINTERVALMESAPROC)(void); + +#endif /* GLX_MESA_swap_control */ + + + +/* + * #?. GLX_EXT_texture_from_pixmap + * XXX not finished? + */ +#ifndef GLX_EXT_texture_from_pixmap +#define GLX_EXT_texture_from_pixmap 1 + +#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0 +#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1 +#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2 +#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3 +#define GLX_Y_INVERTED_EXT 0x20D4 + +#define GLX_TEXTURE_FORMAT_EXT 0x20D5 +#define GLX_TEXTURE_TARGET_EXT 0x20D6 +#define GLX_MIPMAP_TEXTURE_EXT 0x20D7 + +#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8 +#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9 +#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA + +#define GLX_TEXTURE_1D_BIT_EXT 0x00000001 +#define GLX_TEXTURE_2D_BIT_EXT 0x00000002 +#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004 + +#define GLX_TEXTURE_1D_EXT 0x20DB +#define GLX_TEXTURE_2D_EXT 0x20DC +#define GLX_TEXTURE_RECTANGLE_EXT 0x20DD + +#define GLX_FRONT_LEFT_EXT 0x20DE +#define GLX_FRONT_RIGHT_EXT 0x20DF +#define GLX_BACK_LEFT_EXT 0x20E0 +#define GLX_BACK_RIGHT_EXT 0x20E1 +#define GLX_FRONT_EXT GLX_FRONT_LEFT_EXT +#define GLX_BACK_EXT GLX_BACK_LEFT_EXT +#define GLX_AUX0_EXT 0x20E2 +#define GLX_AUX1_EXT 0x20E3 +#define GLX_AUX2_EXT 0x20E4 +#define GLX_AUX3_EXT 0x20E5 +#define GLX_AUX4_EXT 0x20E6 +#define GLX_AUX5_EXT 0x20E7 +#define GLX_AUX6_EXT 0x20E8 +#define GLX_AUX7_EXT 0x20E9 +#define GLX_AUX8_EXT 0x20EA +#define GLX_AUX9_EXT 0x20EB + +extern void glXBindTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list); +extern void glXReleaseTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer); + +#endif /* GLX_EXT_texture_from_pixmap */ + + + + +/*** Should these go here, or in another header? */ +/* +** GLX Events +*/ +typedef struct { + int event_type; /* GLX_DAMAGED or GLX_SAVED */ + int draw_type; /* GLX_WINDOW or GLX_PBUFFER */ + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came for SendEvent request */ + Display *display; /* display the event was read from */ + GLXDrawable drawable; /* XID of Drawable */ + unsigned int buffer_mask; /* mask indicating which buffers are affected */ + unsigned int aux_buffer; /* which aux buffer was affected */ + int x, y; + int width, height; + int count; /* if nonzero, at least this many more */ +} GLXPbufferClobberEvent; + +typedef union __GLXEvent { + GLXPbufferClobberEvent glxpbufferclobber; + long pad[24]; +} GLXEvent; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/GL/glxext.h b/include/GL/glxext.h new file mode 100644 index 0000000..0f66df6 --- /dev/null +++ b/include/GL/glxext.h @@ -0,0 +1,785 @@ +#ifndef __glxext_h_ +#define __glxext_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 */ +/* glxext.h last updated 2007/04/21 */ +/* Current version at http://www.opengl.org/registry/ */ +#define GLX_GLXEXT_VERSION 19 + +#ifndef GLX_VERSION_1_3 +#define GLX_WINDOW_BIT 0x00000001 +#define GLX_PIXMAP_BIT 0x00000002 +#define GLX_PBUFFER_BIT 0x00000004 +#define GLX_RGBA_BIT 0x00000001 +#define GLX_COLOR_INDEX_BIT 0x00000002 +#define GLX_PBUFFER_CLOBBER_MASK 0x08000000 +#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001 +#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002 +#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004 +#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008 +#define GLX_AUX_BUFFERS_BIT 0x00000010 +#define GLX_DEPTH_BUFFER_BIT 0x00000020 +#define GLX_STENCIL_BUFFER_BIT 0x00000040 +#define GLX_ACCUM_BUFFER_BIT 0x00000080 +#define GLX_CONFIG_CAVEAT 0x20 +#define GLX_X_VISUAL_TYPE 0x22 +#define GLX_TRANSPARENT_TYPE 0x23 +#define GLX_TRANSPARENT_INDEX_VALUE 0x24 +#define GLX_TRANSPARENT_RED_VALUE 0x25 +#define GLX_TRANSPARENT_GREEN_VALUE 0x26 +#define GLX_TRANSPARENT_BLUE_VALUE 0x27 +#define GLX_TRANSPARENT_ALPHA_VALUE 0x28 +#define GLX_DONT_CARE 0xFFFFFFFF +#define GLX_NONE 0x8000 +#define GLX_SLOW_CONFIG 0x8001 +#define GLX_TRUE_COLOR 0x8002 +#define GLX_DIRECT_COLOR 0x8003 +#define GLX_PSEUDO_COLOR 0x8004 +#define GLX_STATIC_COLOR 0x8005 +#define GLX_GRAY_SCALE 0x8006 +#define GLX_STATIC_GRAY 0x8007 +#define GLX_TRANSPARENT_RGB 0x8008 +#define GLX_TRANSPARENT_INDEX 0x8009 +#define GLX_VISUAL_ID 0x800B +#define GLX_SCREEN 0x800C +#define GLX_NON_CONFORMANT_CONFIG 0x800D +#define GLX_DRAWABLE_TYPE 0x8010 +#define GLX_RENDER_TYPE 0x8011 +#define GLX_X_RENDERABLE 0x8012 +#define GLX_FBCONFIG_ID 0x8013 +#define GLX_RGBA_TYPE 0x8014 +#define GLX_COLOR_INDEX_TYPE 0x8015 +#define GLX_MAX_PBUFFER_WIDTH 0x8016 +#define GLX_MAX_PBUFFER_HEIGHT 0x8017 +#define GLX_MAX_PBUFFER_PIXELS 0x8018 +#define GLX_PRESERVED_CONTENTS 0x801B +#define GLX_LARGEST_PBUFFER 0x801C +#define GLX_WIDTH 0x801D +#define GLX_HEIGHT 0x801E +#define GLX_EVENT_MASK 0x801F +#define GLX_DAMAGED 0x8020 +#define GLX_SAVED 0x8021 +#define GLX_WINDOW 0x8022 +#define GLX_PBUFFER 0x8023 +#define GLX_PBUFFER_HEIGHT 0x8040 +#define GLX_PBUFFER_WIDTH 0x8041 +#endif + +#ifndef GLX_VERSION_1_4 +#define GLX_SAMPLE_BUFFERS 100000 +#define GLX_SAMPLES 100001 +#endif + +#ifndef GLX_ARB_get_proc_address +#endif + +#ifndef GLX_ARB_multisample +#define GLX_SAMPLE_BUFFERS_ARB 100000 +#define GLX_SAMPLES_ARB 100001 +#endif + +#ifndef GLX_ARB_fbconfig_float +#define GLX_RGBA_FLOAT_TYPE_ARB 0x20B9 +#define GLX_RGBA_FLOAT_BIT_ARB 0x00000004 +#endif + +#ifndef GLX_SGIS_multisample +#define GLX_SAMPLE_BUFFERS_SGIS 100000 +#define GLX_SAMPLES_SGIS 100001 +#endif + +#ifndef GLX_EXT_visual_info +#define GLX_X_VISUAL_TYPE_EXT 0x22 +#define GLX_TRANSPARENT_TYPE_EXT 0x23 +#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24 +#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25 +#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26 +#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27 +#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28 +#define GLX_NONE_EXT 0x8000 +#define GLX_TRUE_COLOR_EXT 0x8002 +#define GLX_DIRECT_COLOR_EXT 0x8003 +#define GLX_PSEUDO_COLOR_EXT 0x8004 +#define GLX_STATIC_COLOR_EXT 0x8005 +#define GLX_GRAY_SCALE_EXT 0x8006 +#define GLX_STATIC_GRAY_EXT 0x8007 +#define GLX_TRANSPARENT_RGB_EXT 0x8008 +#define GLX_TRANSPARENT_INDEX_EXT 0x8009 +#endif + +#ifndef GLX_SGI_swap_control +#endif + +#ifndef GLX_SGI_video_sync +#endif + +#ifndef GLX_SGI_make_current_read +#endif + +#ifndef GLX_SGIX_video_source +#endif + +#ifndef GLX_EXT_visual_rating +#define GLX_VISUAL_CAVEAT_EXT 0x20 +#define GLX_SLOW_VISUAL_EXT 0x8001 +#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D +/* reuse GLX_NONE_EXT */ +#endif + +#ifndef GLX_EXT_import_context +#define GLX_SHARE_CONTEXT_EXT 0x800A +#define GLX_VISUAL_ID_EXT 0x800B +#define GLX_SCREEN_EXT 0x800C +#endif + +#ifndef GLX_SGIX_fbconfig +#define GLX_WINDOW_BIT_SGIX 0x00000001 +#define GLX_PIXMAP_BIT_SGIX 0x00000002 +#define GLX_RGBA_BIT_SGIX 0x00000001 +#define GLX_COLOR_INDEX_BIT_SGIX 0x00000002 +#define GLX_DRAWABLE_TYPE_SGIX 0x8010 +#define GLX_RENDER_TYPE_SGIX 0x8011 +#define GLX_X_RENDERABLE_SGIX 0x8012 +#define GLX_FBCONFIG_ID_SGIX 0x8013 +#define GLX_RGBA_TYPE_SGIX 0x8014 +#define GLX_COLOR_INDEX_TYPE_SGIX 0x8015 +/* reuse GLX_SCREEN_EXT */ +#endif + +#ifndef GLX_SGIX_pbuffer +#define GLX_PBUFFER_BIT_SGIX 0x00000004 +#define GLX_BUFFER_CLOBBER_MASK_SGIX 0x08000000 +#define GLX_FRONT_LEFT_BUFFER_BIT_SGIX 0x00000001 +#define GLX_FRONT_RIGHT_BUFFER_BIT_SGIX 0x00000002 +#define GLX_BACK_LEFT_BUFFER_BIT_SGIX 0x00000004 +#define GLX_BACK_RIGHT_BUFFER_BIT_SGIX 0x00000008 +#define GLX_AUX_BUFFERS_BIT_SGIX 0x00000010 +#define GLX_DEPTH_BUFFER_BIT_SGIX 0x00000020 +#define GLX_STENCIL_BUFFER_BIT_SGIX 0x00000040 +#define GLX_ACCUM_BUFFER_BIT_SGIX 0x00000080 +#define GLX_SAMPLE_BUFFERS_BIT_SGIX 0x00000100 +#define GLX_MAX_PBUFFER_WIDTH_SGIX 0x8016 +#define GLX_MAX_PBUFFER_HEIGHT_SGIX 0x8017 +#define GLX_MAX_PBUFFER_PIXELS_SGIX 0x8018 +#define GLX_OPTIMAL_PBUFFER_WIDTH_SGIX 0x8019 +#define GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX 0x801A +#define GLX_PRESERVED_CONTENTS_SGIX 0x801B +#define GLX_LARGEST_PBUFFER_SGIX 0x801C +#define GLX_WIDTH_SGIX 0x801D +#define GLX_HEIGHT_SGIX 0x801E +#define GLX_EVENT_MASK_SGIX 0x801F +#define GLX_DAMAGED_SGIX 0x8020 +#define GLX_SAVED_SGIX 0x8021 +#define GLX_WINDOW_SGIX 0x8022 +#define GLX_PBUFFER_SGIX 0x8023 +#endif + +#ifndef GLX_SGI_cushion +#endif + +#ifndef GLX_SGIX_video_resize +#define GLX_SYNC_FRAME_SGIX 0x00000000 +#define GLX_SYNC_SWAP_SGIX 0x00000001 +#endif + +#ifndef GLX_SGIX_dmbuffer +#define GLX_DIGITAL_MEDIA_PBUFFER_SGIX 0x8024 +#endif + +#ifndef GLX_SGIX_swap_group +#endif + +#ifndef GLX_SGIX_swap_barrier +#endif + +#ifndef GLX_SGIS_blended_overlay +#define GLX_BLENDED_RGBA_SGIS 0x8025 +#endif + +#ifndef GLX_SGIS_shared_multisample +#define GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026 +#define GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027 +#endif + +#ifndef GLX_SUN_get_transparent_index +#endif + +#ifndef GLX_3DFX_multisample +#define GLX_SAMPLE_BUFFERS_3DFX 0x8050 +#define GLX_SAMPLES_3DFX 0x8051 +#endif + +#ifndef GLX_MESA_copy_sub_buffer +#endif + +#ifndef GLX_MESA_pixmap_colormap +#endif + +#ifndef GLX_MESA_release_buffers +#endif + +#ifndef GLX_MESA_set_3dfx_mode +#define GLX_3DFX_WINDOW_MODE_MESA 0x1 +#define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2 +#endif + +#ifndef GLX_SGIX_visual_select_group +#define GLX_VISUAL_SELECT_GROUP_SGIX 0x8028 +#endif + +#ifndef GLX_OML_swap_method +#define GLX_SWAP_METHOD_OML 0x8060 +#define GLX_SWAP_EXCHANGE_OML 0x8061 +#define GLX_SWAP_COPY_OML 0x8062 +#define GLX_SWAP_UNDEFINED_OML 0x8063 +#endif + +#ifndef GLX_OML_sync_control +#endif + +#ifndef GLX_NV_float_buffer +#define GLX_FLOAT_COMPONENTS_NV 0x20B0 +#endif + +#ifndef GLX_SGIX_hyperpipe +#define GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80 +#define GLX_BAD_HYPERPIPE_CONFIG_SGIX 91 +#define GLX_BAD_HYPERPIPE_SGIX 92 +#define GLX_HYPERPIPE_DISPLAY_PIPE_SGIX 0x00000001 +#define GLX_HYPERPIPE_RENDER_PIPE_SGIX 0x00000002 +#define GLX_PIPE_RECT_SGIX 0x00000001 +#define GLX_PIPE_RECT_LIMITS_SGIX 0x00000002 +#define GLX_HYPERPIPE_STEREO_SGIX 0x00000003 +#define GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX 0x00000004 +#define GLX_HYPERPIPE_ID_SGIX 0x8030 +#endif + +#ifndef GLX_MESA_agp_offset +#endif + +#ifndef GLX_EXT_fbconfig_packed_float +#define GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1 +#define GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008 +#endif + +#ifndef GLX_EXT_framebuffer_sRGB +#define GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20B2 +#endif + +#ifndef GLX_EXT_texture_from_pixmap +#define GLX_TEXTURE_1D_BIT_EXT 0x00000001 +#define GLX_TEXTURE_2D_BIT_EXT 0x00000002 +#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004 +#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0 +#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1 +#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2 +#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3 +#define GLX_Y_INVERTED_EXT 0x20D4 +#define GLX_TEXTURE_FORMAT_EXT 0x20D5 +#define GLX_TEXTURE_TARGET_EXT 0x20D6 +#define GLX_MIPMAP_TEXTURE_EXT 0x20D7 +#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8 +#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9 +#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA +#define GLX_TEXTURE_1D_EXT 0x20DB +#define GLX_TEXTURE_2D_EXT 0x20DC +#define GLX_TEXTURE_RECTANGLE_EXT 0x20DD +#define GLX_FRONT_LEFT_EXT 0x20DE +#define GLX_FRONT_RIGHT_EXT 0x20DF +#define GLX_BACK_LEFT_EXT 0x20E0 +#define GLX_BACK_RIGHT_EXT 0x20E1 +#define GLX_FRONT_EXT GLX_FRONT_LEFT_EXT +#define GLX_BACK_EXT GLX_BACK_LEFT_EXT +#define GLX_AUX0_EXT 0x20E2 +#define GLX_AUX1_EXT 0x20E3 +#define GLX_AUX2_EXT 0x20E4 +#define GLX_AUX3_EXT 0x20E5 +#define GLX_AUX4_EXT 0x20E6 +#define GLX_AUX5_EXT 0x20E7 +#define GLX_AUX6_EXT 0x20E8 +#define GLX_AUX7_EXT 0x20E9 +#define GLX_AUX8_EXT 0x20EA +#define GLX_AUX9_EXT 0x20EB +#endif + + +/*************************************************************/ + +#ifndef GLX_ARB_get_proc_address +typedef void (*__GLXextFuncPtr)(void); +#endif + +#ifndef GLX_SGIX_video_source +typedef XID GLXVideoSourceSGIX; +#endif + +#ifndef GLX_SGIX_fbconfig +typedef XID GLXFBConfigIDSGIX; +typedef struct __GLXFBConfigRec *GLXFBConfigSGIX; +#endif + +#ifndef GLX_SGIX_pbuffer +typedef XID GLXPbufferSGIX; +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came for SendEvent request */ + Display *display; /* display the event was read from */ + GLXDrawable drawable; /* i.d. of Drawable */ + int event_type; /* GLX_DAMAGED_SGIX or GLX_SAVED_SGIX */ + int draw_type; /* GLX_WINDOW_SGIX or GLX_PBUFFER_SGIX */ + unsigned int mask; /* mask indicating which buffers are affected*/ + int x, y; + int width, height; + int count; /* if nonzero, at least this many more */ +} GLXBufferClobberEventSGIX; +#endif + +#ifndef GLEXT_64_TYPES_DEFINED +/* This code block is duplicated in glxext.h, so must be protected */ +#define GLEXT_64_TYPES_DEFINED +/* Define int32_t, int64_t, and uint64_t types for UST/MSC */ +/* (as used in the GLX_OML_sync_control extension). */ +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +#include <inttypes.h> +#elif defined(__sun__) || defined(__digital__) +#include <inttypes.h> +#if defined(__STDC__) +#if defined(__arch64__) +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 GLX_VERSION_1_3 +#define GLX_VERSION_1_3 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern GLXFBConfig * glXGetFBConfigs (Display *, int, int *); +extern GLXFBConfig * glXChooseFBConfig (Display *, int, const int *, int *); +extern int glXGetFBConfigAttrib (Display *, GLXFBConfig, int, int *); +extern XVisualInfo * glXGetVisualFromFBConfig (Display *, GLXFBConfig); +extern GLXWindow glXCreateWindow (Display *, GLXFBConfig, Window, const int *); +extern void glXDestroyWindow (Display *, GLXWindow); +extern GLXPixmap glXCreatePixmap (Display *, GLXFBConfig, Pixmap, const int *); +extern void glXDestroyPixmap (Display *, GLXPixmap); +extern GLXPbuffer glXCreatePbuffer (Display *, GLXFBConfig, const int *); +extern void glXDestroyPbuffer (Display *, GLXPbuffer); +extern void glXQueryDrawable (Display *, GLXDrawable, int, unsigned int *); +extern GLXContext glXCreateNewContext (Display *, GLXFBConfig, int, GLXContext, Bool); +extern Bool glXMakeContextCurrent (Display *, GLXDrawable, GLXDrawable, GLXContext); +extern GLXDrawable glXGetCurrentReadDrawable (void); +extern Display * glXGetCurrentDisplay (void); +extern int glXQueryContext (Display *, GLXContext, int, int *); +extern void glXSelectEvent (Display *, GLXDrawable, unsigned long); +extern void glXGetSelectedEvent (Display *, GLXDrawable, unsigned long *); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef GLXFBConfig * ( * PFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements); +typedef GLXFBConfig * ( * PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements); +typedef int ( * PFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value); +typedef XVisualInfo * ( * PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config); +typedef GLXWindow ( * PFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list); +typedef void ( * PFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win); +typedef GLXPixmap ( * PFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list); +typedef void ( * PFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap); +typedef GLXPbuffer ( * PFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list); +typedef void ( * PFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf); +typedef void ( * PFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value); +typedef GLXContext ( * PFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct); +typedef Bool ( * PFNGLXMAKECONTEXTCURRENTPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx); +typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLEPROC) (void); +typedef Display * ( * PFNGLXGETCURRENTDISPLAYPROC) (void); +typedef int ( * PFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value); +typedef void ( * PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask); +typedef void ( * PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask); +#endif + +#ifndef GLX_VERSION_1_4 +#define GLX_VERSION_1_4 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern __GLXextFuncPtr glXGetProcAddress (const GLubyte *); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSPROC) (const GLubyte *procName); +#endif + +#ifndef GLX_ARB_get_proc_address +#define GLX_ARB_get_proc_address 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSARBPROC) (const GLubyte *procName); +#endif + +#ifndef GLX_ARB_multisample +#define GLX_ARB_multisample 1 +#endif + +#ifndef GLX_ARB_fbconfig_float +#define GLX_ARB_fbconfig_float 1 +#endif + +#ifndef GLX_SGIS_multisample +#define GLX_SGIS_multisample 1 +#endif + +#ifndef GLX_EXT_visual_info +#define GLX_EXT_visual_info 1 +#endif + +#ifndef GLX_SGI_swap_control +#define GLX_SGI_swap_control 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern int glXSwapIntervalSGI (int); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef int ( * PFNGLXSWAPINTERVALSGIPROC) (int interval); +#endif + +#ifndef GLX_SGI_video_sync +#define GLX_SGI_video_sync 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern int glXGetVideoSyncSGI (unsigned int *); +extern int glXWaitVideoSyncSGI (int, int, unsigned int *); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef int ( * PFNGLXGETVIDEOSYNCSGIPROC) (unsigned int *count); +typedef int ( * PFNGLXWAITVIDEOSYNCSGIPROC) (int divisor, int remainder, unsigned int *count); +#endif + +#ifndef GLX_SGI_make_current_read +#define GLX_SGI_make_current_read 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern Bool glXMakeCurrentReadSGI (Display *, GLXDrawable, GLXDrawable, GLXContext); +extern GLXDrawable glXGetCurrentReadDrawableSGI (void); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef Bool ( * PFNGLXMAKECURRENTREADSGIPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx); +typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLESGIPROC) (void); +#endif + +#ifndef GLX_SGIX_video_source +#define GLX_SGIX_video_source 1 +#ifdef _VL_H +#ifdef GLX_GLXEXT_PROTOTYPES +extern GLXVideoSourceSGIX glXCreateGLXVideoSourceSGIX (Display *, int, VLServer, VLPath, int, VLNode); +extern void glXDestroyGLXVideoSourceSGIX (Display *, GLXVideoSourceSGIX); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef GLXVideoSourceSGIX ( * PFNGLXCREATEGLXVIDEOSOURCESGIXPROC) (Display *display, int screen, VLServer server, VLPath path, int nodeClass, VLNode drainNode); +typedef void ( * PFNGLXDESTROYGLXVIDEOSOURCESGIXPROC) (Display *dpy, GLXVideoSourceSGIX glxvideosource); +#endif /* _VL_H */ +#endif + +#ifndef GLX_EXT_visual_rating +#define GLX_EXT_visual_rating 1 +#endif + +#ifndef GLX_EXT_import_context +#define GLX_EXT_import_context 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern Display * glXGetCurrentDisplayEXT (void); +extern int glXQueryContextInfoEXT (Display *, GLXContext, int, int *); +extern GLXContextID glXGetContextIDEXT (const GLXContext); +extern GLXContext glXImportContextEXT (Display *, GLXContextID); +extern void glXFreeContextEXT (Display *, GLXContext); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef Display * ( * PFNGLXGETCURRENTDISPLAYEXTPROC) (void); +typedef int ( * PFNGLXQUERYCONTEXTINFOEXTPROC) (Display *dpy, GLXContext context, int attribute, int *value); +typedef GLXContextID ( * PFNGLXGETCONTEXTIDEXTPROC) (const GLXContext context); +typedef GLXContext ( * PFNGLXIMPORTCONTEXTEXTPROC) (Display *dpy, GLXContextID contextID); +typedef void ( * PFNGLXFREECONTEXTEXTPROC) (Display *dpy, GLXContext context); +#endif + +#ifndef GLX_SGIX_fbconfig +#define GLX_SGIX_fbconfig 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern int glXGetFBConfigAttribSGIX (Display *, GLXFBConfigSGIX, int, int *); +extern GLXFBConfigSGIX * glXChooseFBConfigSGIX (Display *, int, int *, int *); +extern GLXPixmap glXCreateGLXPixmapWithConfigSGIX (Display *, GLXFBConfigSGIX, Pixmap); +extern GLXContext glXCreateContextWithConfigSGIX (Display *, GLXFBConfigSGIX, int, GLXContext, Bool); +extern XVisualInfo * glXGetVisualFromFBConfigSGIX (Display *, GLXFBConfigSGIX); +extern GLXFBConfigSGIX glXGetFBConfigFromVisualSGIX (Display *, XVisualInfo *); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef int ( * PFNGLXGETFBCONFIGATTRIBSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, int attribute, int *value); +typedef GLXFBConfigSGIX * ( * PFNGLXCHOOSEFBCONFIGSGIXPROC) (Display *dpy, int screen, int *attrib_list, int *nelements); +typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, Pixmap pixmap); +typedef GLXContext ( * PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct); +typedef XVisualInfo * ( * PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config); +typedef GLXFBConfigSGIX ( * PFNGLXGETFBCONFIGFROMVISUALSGIXPROC) (Display *dpy, XVisualInfo *vis); +#endif + +#ifndef GLX_SGIX_pbuffer +#define GLX_SGIX_pbuffer 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern GLXPbufferSGIX glXCreateGLXPbufferSGIX (Display *, GLXFBConfigSGIX, unsigned int, unsigned int, int *); +extern void glXDestroyGLXPbufferSGIX (Display *, GLXPbufferSGIX); +extern int glXQueryGLXPbufferSGIX (Display *, GLXPbufferSGIX, int, unsigned int *); +extern void glXSelectEventSGIX (Display *, GLXDrawable, unsigned long); +extern void glXGetSelectedEventSGIX (Display *, GLXDrawable, unsigned long *); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef GLXPbufferSGIX ( * PFNGLXCREATEGLXPBUFFERSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list); +typedef void ( * PFNGLXDESTROYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf); +typedef int ( * PFNGLXQUERYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value); +typedef void ( * PFNGLXSELECTEVENTSGIXPROC) (Display *dpy, GLXDrawable drawable, unsigned long mask); +typedef void ( * PFNGLXGETSELECTEDEVENTSGIXPROC) (Display *dpy, GLXDrawable drawable, unsigned long *mask); +#endif + +#ifndef GLX_SGI_cushion +#define GLX_SGI_cushion 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern void glXCushionSGI (Display *, Window, float); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef void ( * PFNGLXCUSHIONSGIPROC) (Display *dpy, Window window, float cushion); +#endif + +#ifndef GLX_SGIX_video_resize +#define GLX_SGIX_video_resize 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern int glXBindChannelToWindowSGIX (Display *, int, int, Window); +extern int glXChannelRectSGIX (Display *, int, int, int, int, int, int); +extern int glXQueryChannelRectSGIX (Display *, int, int, int *, int *, int *, int *); +extern int glXQueryChannelDeltasSGIX (Display *, int, int, int *, int *, int *, int *); +extern int glXChannelRectSyncSGIX (Display *, int, int, GLenum); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef int ( * PFNGLXBINDCHANNELTOWINDOWSGIXPROC) (Display *display, int screen, int channel, Window window); +typedef int ( * PFNGLXCHANNELRECTSGIXPROC) (Display *display, int screen, int channel, int x, int y, int w, int h); +typedef int ( * PFNGLXQUERYCHANNELRECTSGIXPROC) (Display *display, int screen, int channel, int *dx, int *dy, int *dw, int *dh); +typedef int ( * PFNGLXQUERYCHANNELDELTASSGIXPROC) (Display *display, int screen, int channel, int *x, int *y, int *w, int *h); +typedef int ( * PFNGLXCHANNELRECTSYNCSGIXPROC) (Display *display, int screen, int channel, GLenum synctype); +#endif + +#ifndef GLX_SGIX_dmbuffer +#define GLX_SGIX_dmbuffer 1 +#ifdef _DM_BUFFER_H_ +#ifdef GLX_GLXEXT_PROTOTYPES +extern Bool glXAssociateDMPbufferSGIX (Display *, GLXPbufferSGIX, DMparams *, DMbuffer); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef Bool ( * PFNGLXASSOCIATEDMPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuffer, DMparams *params, DMbuffer dmbuffer); +#endif /* _DM_BUFFER_H_ */ +#endif + +#ifndef GLX_SGIX_swap_group +#define GLX_SGIX_swap_group 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern void glXJoinSwapGroupSGIX (Display *, GLXDrawable, GLXDrawable); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef void ( * PFNGLXJOINSWAPGROUPSGIXPROC) (Display *dpy, GLXDrawable drawable, GLXDrawable member); +#endif + +#ifndef GLX_SGIX_swap_barrier +#define GLX_SGIX_swap_barrier 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern void glXBindSwapBarrierSGIX (Display *, GLXDrawable, int); +extern Bool glXQueryMaxSwapBarriersSGIX (Display *, int, int *); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef void ( * PFNGLXBINDSWAPBARRIERSGIXPROC) (Display *dpy, GLXDrawable drawable, int barrier); +typedef Bool ( * PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC) (Display *dpy, int screen, int *max); +#endif + +#ifndef GLX_SUN_get_transparent_index +#define GLX_SUN_get_transparent_index 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern Status glXGetTransparentIndexSUN (Display *, Window, Window, long *); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef Status ( * PFNGLXGETTRANSPARENTINDEXSUNPROC) (Display *dpy, Window overlay, Window underlay, long *pTransparentIndex); +#endif + +#ifndef GLX_MESA_copy_sub_buffer +#define GLX_MESA_copy_sub_buffer 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern void glXCopySubBufferMESA (Display *, GLXDrawable, int, int, int, int); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef void ( * PFNGLXCOPYSUBBUFFERMESAPROC) (Display *dpy, GLXDrawable drawable, int x, int y, int width, int height); +#endif + +#ifndef GLX_MESA_pixmap_colormap +#define GLX_MESA_pixmap_colormap 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern GLXPixmap glXCreateGLXPixmapMESA (Display *, XVisualInfo *, Pixmap, Colormap); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPMESAPROC) (Display *dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap); +#endif + +#ifndef GLX_MESA_release_buffers +#define GLX_MESA_release_buffers 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern Bool glXReleaseBuffersMESA (Display *, GLXDrawable); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef Bool ( * PFNGLXRELEASEBUFFERSMESAPROC) (Display *dpy, GLXDrawable drawable); +#endif + +#ifndef GLX_MESA_set_3dfx_mode +#define GLX_MESA_set_3dfx_mode 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern Bool glXSet3DfxModeMESA (int); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef Bool ( * PFNGLXSET3DFXMODEMESAPROC) (int mode); +#endif + +#ifndef GLX_SGIX_visual_select_group +#define GLX_SGIX_visual_select_group 1 +#endif + +#ifndef GLX_OML_swap_method +#define GLX_OML_swap_method 1 +#endif + +#ifndef GLX_OML_sync_control +#define GLX_OML_sync_control 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern Bool glXGetSyncValuesOML (Display *, GLXDrawable, int64_t *, int64_t *, int64_t *); +extern Bool glXGetMscRateOML (Display *, GLXDrawable, int32_t *, int32_t *); +extern int64_t glXSwapBuffersMscOML (Display *, GLXDrawable, int64_t, int64_t, int64_t); +extern Bool glXWaitForMscOML (Display *, GLXDrawable, int64_t, int64_t, int64_t, int64_t *, int64_t *, int64_t *); +extern Bool glXWaitForSbcOML (Display *, GLXDrawable, int64_t, int64_t *, int64_t *, int64_t *); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef Bool ( * PFNGLXGETSYNCVALUESOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t *ust, int64_t *msc, int64_t *sbc); +typedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (Display *dpy, GLXDrawable drawable, int32_t *numerator, int32_t *denominator); +typedef int64_t ( * PFNGLXSWAPBUFFERSMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder); +typedef Bool ( * PFNGLXWAITFORMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t *ust, int64_t *msc, int64_t *sbc); +typedef Bool ( * PFNGLXWAITFORSBCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_sbc, int64_t *ust, int64_t *msc, int64_t *sbc); +#endif + +#ifndef GLX_NV_float_buffer +#define GLX_NV_float_buffer 1 +#endif + +#ifndef GLX_SGIX_hyperpipe +#define GLX_SGIX_hyperpipe 1 + +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int networkId; +} GLXHyperpipeNetworkSGIX; + +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int channel; + unsigned int + participationType; + int timeSlice; +} GLXHyperpipeConfigSGIX; + +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int srcXOrigin, srcYOrigin, srcWidth, srcHeight; + int destXOrigin, destYOrigin, destWidth, destHeight; +} GLXPipeRect; + +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int XOrigin, YOrigin, maxHeight, maxWidth; +} GLXPipeRectLimits; + +#ifdef GLX_GLXEXT_PROTOTYPES +extern GLXHyperpipeNetworkSGIX * glXQueryHyperpipeNetworkSGIX (Display *, int *); +extern int glXHyperpipeConfigSGIX (Display *, int, int, GLXHyperpipeConfigSGIX *, int *); +extern GLXHyperpipeConfigSGIX * glXQueryHyperpipeConfigSGIX (Display *, int, int *); +extern int glXDestroyHyperpipeConfigSGIX (Display *, int); +extern int glXBindHyperpipeSGIX (Display *, int); +extern int glXQueryHyperpipeBestAttribSGIX (Display *, int, int, int, void *, void *); +extern int glXHyperpipeAttribSGIX (Display *, int, int, int, void *); +extern int glXQueryHyperpipeAttribSGIX (Display *, int, int, int, void *); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef GLXHyperpipeNetworkSGIX * ( * PFNGLXQUERYHYPERPIPENETWORKSGIXPROC) (Display *dpy, int *npipes); +typedef int ( * PFNGLXHYPERPIPECONFIGSGIXPROC) (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId); +typedef GLXHyperpipeConfigSGIX * ( * PFNGLXQUERYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId, int *npipes); +typedef int ( * PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId); +typedef int ( * PFNGLXBINDHYPERPIPESGIXPROC) (Display *dpy, int hpId); +typedef int ( * PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList); +typedef int ( * PFNGLXHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList); +typedef int ( * PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList); +#endif + +#ifndef GLX_MESA_agp_offset +#define GLX_MESA_agp_offset 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern unsigned int glXGetAGPOffsetMESA (const void *); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef unsigned int ( * PFNGLXGETAGPOFFSETMESAPROC) (const void *pointer); +#endif + +#ifndef GLX_EXT_fbconfig_packed_float +#define GLX_EXT_fbconfig_packed_float 1 +#endif + +#ifndef GLX_EXT_framebuffer_sRGB +#define GLX_EXT_framebuffer_sRGB 1 +#endif + +#ifndef GLX_EXT_texture_from_pixmap +#define GLX_EXT_texture_from_pixmap 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern void glXBindTexImageEXT (Display *, GLXDrawable, int, const int *); +extern void glXReleaseTexImageEXT (Display *, GLXDrawable, int); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef void ( * PFNGLXBINDTEXIMAGEEXTPROC) (Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list); +typedef void ( * PFNGLXRELEASETEXIMAGEEXTPROC) (Display *dpy, GLXDrawable drawable, int buffer); +#endif + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/GLES/egl.h b/include/GLES/egl.h new file mode 100755 index 0000000..5778e00 --- /dev/null +++ b/include/GLES/egl.h @@ -0,0 +1,15 @@ +/* + * Skeleton egl.h to provide compatibility for early GLES 1.0 + * applications. Several early implementations included gl.h + * in egl.h leading applications to include only egl.h + * + * $Revision: 6252 $ on $Date:: 2008-08-06 16:35:08 -0700 #$ + */ + +#ifndef __legacy_egl_h_ +#define __legacy_egl_h_ + +#include <EGL/egl.h> +#include <GLES/gl.h> + +#endif /* __legacy_egl_h_ */ diff --git a/include/GLES/gl.h b/include/GLES/gl.h new file mode 100755 index 0000000..2e8b971 --- /dev/null +++ b/include/GLES/gl.h @@ -0,0 +1,769 @@ +#ifndef __gl_h_ +#define __gl_h_ + +/* $Revision: 7172 $ on $Date:: 2009-01-09 11:17:41 -0800 #$ */ + +#include <GLES/glplatform.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * This document is licensed under the SGI Free Software B License Version + * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ . + */ + +typedef void GLvoid; +typedef unsigned int GLenum; +typedef unsigned char GLboolean; +typedef unsigned int GLbitfield; +typedef khronos_int8_t GLbyte; +typedef short GLshort; +typedef int GLint; +typedef int GLsizei; +typedef khronos_uint8_t GLubyte; +typedef unsigned short GLushort; +typedef unsigned int GLuint; +typedef khronos_float_t GLfloat; +typedef khronos_float_t GLclampf; +typedef khronos_int32_t GLfixed; +typedef khronos_int32_t GLclampx; + +typedef khronos_intptr_t GLintptr; +typedef khronos_ssize_t GLsizeiptr; + + +/*************************************************************/ + +/* OpenGL ES core versions */ +#define GL_VERSION_ES_CM_1_0 1 +#define GL_VERSION_ES_CL_1_0 1 +#define GL_VERSION_ES_CM_1_1 1 +#define GL_VERSION_ES_CL_1_1 1 + +/* ClearBufferMask */ +#define GL_DEPTH_BUFFER_BIT 0x00000100 +#define GL_STENCIL_BUFFER_BIT 0x00000400 +#define GL_COLOR_BUFFER_BIT 0x00004000 + +/* Boolean */ +#define GL_FALSE 0 +#define GL_TRUE 1 + +/* BeginMode */ +#define GL_POINTS 0x0000 +#define GL_LINES 0x0001 +#define GL_LINE_LOOP 0x0002 +#define GL_LINE_STRIP 0x0003 +#define GL_TRIANGLES 0x0004 +#define GL_TRIANGLE_STRIP 0x0005 +#define GL_TRIANGLE_FAN 0x0006 + +/* AlphaFunction */ +#define GL_NEVER 0x0200 +#define GL_LESS 0x0201 +#define GL_EQUAL 0x0202 +#define GL_LEQUAL 0x0203 +#define GL_GREATER 0x0204 +#define GL_NOTEQUAL 0x0205 +#define GL_GEQUAL 0x0206 +#define GL_ALWAYS 0x0207 + +/* BlendingFactorDest */ +#define GL_ZERO 0 +#define GL_ONE 1 +#define GL_SRC_COLOR 0x0300 +#define GL_ONE_MINUS_SRC_COLOR 0x0301 +#define GL_SRC_ALPHA 0x0302 +#define GL_ONE_MINUS_SRC_ALPHA 0x0303 +#define GL_DST_ALPHA 0x0304 +#define GL_ONE_MINUS_DST_ALPHA 0x0305 + +/* BlendingFactorSrc */ +/* GL_ZERO */ +/* GL_ONE */ +#define GL_DST_COLOR 0x0306 +#define GL_ONE_MINUS_DST_COLOR 0x0307 +#define GL_SRC_ALPHA_SATURATE 0x0308 +/* GL_SRC_ALPHA */ +/* GL_ONE_MINUS_SRC_ALPHA */ +/* GL_DST_ALPHA */ +/* GL_ONE_MINUS_DST_ALPHA */ + +/* ClipPlaneName */ +#define GL_CLIP_PLANE0 0x3000 +#define GL_CLIP_PLANE1 0x3001 +#define GL_CLIP_PLANE2 0x3002 +#define GL_CLIP_PLANE3 0x3003 +#define GL_CLIP_PLANE4 0x3004 +#define GL_CLIP_PLANE5 0x3005 + +/* ColorMaterialFace */ +/* GL_FRONT_AND_BACK */ + +/* ColorMaterialParameter */ +/* GL_AMBIENT_AND_DIFFUSE */ + +/* ColorPointerType */ +/* GL_UNSIGNED_BYTE */ +/* GL_FLOAT */ +/* GL_FIXED */ + +/* CullFaceMode */ +#define GL_FRONT 0x0404 +#define GL_BACK 0x0405 +#define GL_FRONT_AND_BACK 0x0408 + +/* DepthFunction */ +/* GL_NEVER */ +/* GL_LESS */ +/* GL_EQUAL */ +/* GL_LEQUAL */ +/* GL_GREATER */ +/* GL_NOTEQUAL */ +/* GL_GEQUAL */ +/* GL_ALWAYS */ + +/* EnableCap */ +#define GL_FOG 0x0B60 +#define GL_LIGHTING 0x0B50 +#define GL_TEXTURE_2D 0x0DE1 +#define GL_CULL_FACE 0x0B44 +#define GL_ALPHA_TEST 0x0BC0 +#define GL_BLEND 0x0BE2 +#define GL_COLOR_LOGIC_OP 0x0BF2 +#define GL_DITHER 0x0BD0 +#define GL_STENCIL_TEST 0x0B90 +#define GL_DEPTH_TEST 0x0B71 +/* GL_LIGHT0 */ +/* GL_LIGHT1 */ +/* GL_LIGHT2 */ +/* GL_LIGHT3 */ +/* GL_LIGHT4 */ +/* GL_LIGHT5 */ +/* GL_LIGHT6 */ +/* GL_LIGHT7 */ +#define GL_POINT_SMOOTH 0x0B10 +#define GL_LINE_SMOOTH 0x0B20 +#define GL_SCISSOR_TEST 0x0C11 +#define GL_COLOR_MATERIAL 0x0B57 +#define GL_NORMALIZE 0x0BA1 +#define GL_RESCALE_NORMAL 0x803A +#define GL_POLYGON_OFFSET_FILL 0x8037 +#define GL_VERTEX_ARRAY 0x8074 +#define GL_NORMAL_ARRAY 0x8075 +#define GL_COLOR_ARRAY 0x8076 +#define GL_TEXTURE_COORD_ARRAY 0x8078 +#define GL_MULTISAMPLE 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE 0x809F +#define GL_SAMPLE_COVERAGE 0x80A0 + +/* ErrorCode */ +#define GL_NO_ERROR 0 +#define GL_INVALID_ENUM 0x0500 +#define GL_INVALID_VALUE 0x0501 +#define GL_INVALID_OPERATION 0x0502 +#define GL_STACK_OVERFLOW 0x0503 +#define GL_STACK_UNDERFLOW 0x0504 +#define GL_OUT_OF_MEMORY 0x0505 + +/* FogMode */ +/* GL_LINEAR */ +#define GL_EXP 0x0800 +#define GL_EXP2 0x0801 + +/* FogParameter */ +#define GL_FOG_DENSITY 0x0B62 +#define GL_FOG_START 0x0B63 +#define GL_FOG_END 0x0B64 +#define GL_FOG_MODE 0x0B65 +#define GL_FOG_COLOR 0x0B66 + +/* FrontFaceDirection */ +#define GL_CW 0x0900 +#define GL_CCW 0x0901 + +/* GetPName */ +#define GL_CURRENT_COLOR 0x0B00 +#define GL_CURRENT_NORMAL 0x0B02 +#define GL_CURRENT_TEXTURE_COORDS 0x0B03 +#define GL_POINT_SIZE 0x0B11 +#define GL_POINT_SIZE_MIN 0x8126 +#define GL_POINT_SIZE_MAX 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 +#define GL_POINT_DISTANCE_ATTENUATION 0x8129 +#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 +#define GL_LINE_WIDTH 0x0B21 +#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 +#define GL_ALIASED_POINT_SIZE_RANGE 0x846D +#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E +#define GL_CULL_FACE_MODE 0x0B45 +#define GL_FRONT_FACE 0x0B46 +#define GL_SHADE_MODEL 0x0B54 +#define GL_DEPTH_RANGE 0x0B70 +#define GL_DEPTH_WRITEMASK 0x0B72 +#define GL_DEPTH_CLEAR_VALUE 0x0B73 +#define GL_DEPTH_FUNC 0x0B74 +#define GL_STENCIL_CLEAR_VALUE 0x0B91 +#define GL_STENCIL_FUNC 0x0B92 +#define GL_STENCIL_VALUE_MASK 0x0B93 +#define GL_STENCIL_FAIL 0x0B94 +#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 +#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 +#define GL_STENCIL_REF 0x0B97 +#define GL_STENCIL_WRITEMASK 0x0B98 +#define GL_MATRIX_MODE 0x0BA0 +#define GL_VIEWPORT 0x0BA2 +#define GL_MODELVIEW_STACK_DEPTH 0x0BA3 +#define GL_PROJECTION_STACK_DEPTH 0x0BA4 +#define GL_TEXTURE_STACK_DEPTH 0x0BA5 +#define GL_MODELVIEW_MATRIX 0x0BA6 +#define GL_PROJECTION_MATRIX 0x0BA7 +#define GL_TEXTURE_MATRIX 0x0BA8 +#define GL_ALPHA_TEST_FUNC 0x0BC1 +#define GL_ALPHA_TEST_REF 0x0BC2 +#define GL_BLEND_DST 0x0BE0 +#define GL_BLEND_SRC 0x0BE1 +#define GL_LOGIC_OP_MODE 0x0BF0 +#define GL_SCISSOR_BOX 0x0C10 +#define GL_SCISSOR_TEST 0x0C11 +#define GL_COLOR_CLEAR_VALUE 0x0C22 +#define GL_COLOR_WRITEMASK 0x0C23 +#define GL_UNPACK_ALIGNMENT 0x0CF5 +#define GL_PACK_ALIGNMENT 0x0D05 +#define GL_MAX_LIGHTS 0x0D31 +#define GL_MAX_CLIP_PLANES 0x0D32 +#define GL_MAX_TEXTURE_SIZE 0x0D33 +#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36 +#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38 +#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39 +#define GL_MAX_VIEWPORT_DIMS 0x0D3A +#define GL_MAX_TEXTURE_UNITS 0x84E2 +#define GL_SUBPIXEL_BITS 0x0D50 +#define GL_RED_BITS 0x0D52 +#define GL_GREEN_BITS 0x0D53 +#define GL_BLUE_BITS 0x0D54 +#define GL_ALPHA_BITS 0x0D55 +#define GL_DEPTH_BITS 0x0D56 +#define GL_STENCIL_BITS 0x0D57 +#define GL_POLYGON_OFFSET_UNITS 0x2A00 +#define GL_POLYGON_OFFSET_FILL 0x8037 +#define GL_POLYGON_OFFSET_FACTOR 0x8038 +#define GL_TEXTURE_BINDING_2D 0x8069 +#define GL_VERTEX_ARRAY_SIZE 0x807A +#define GL_VERTEX_ARRAY_TYPE 0x807B +#define GL_VERTEX_ARRAY_STRIDE 0x807C +#define GL_NORMAL_ARRAY_TYPE 0x807E +#define GL_NORMAL_ARRAY_STRIDE 0x807F +#define GL_COLOR_ARRAY_SIZE 0x8081 +#define GL_COLOR_ARRAY_TYPE 0x8082 +#define GL_COLOR_ARRAY_STRIDE 0x8083 +#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A +#define GL_VERTEX_ARRAY_POINTER 0x808E +#define GL_NORMAL_ARRAY_POINTER 0x808F +#define GL_COLOR_ARRAY_POINTER 0x8090 +#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092 +#define GL_SAMPLE_BUFFERS 0x80A8 +#define GL_SAMPLES 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT 0x80AB + +/* GetTextureParameter */ +/* GL_TEXTURE_MAG_FILTER */ +/* GL_TEXTURE_MIN_FILTER */ +/* GL_TEXTURE_WRAP_S */ +/* GL_TEXTURE_WRAP_T */ + +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 + +/* HintMode */ +#define GL_DONT_CARE 0x1100 +#define GL_FASTEST 0x1101 +#define GL_NICEST 0x1102 + +/* HintTarget */ +#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50 +#define GL_POINT_SMOOTH_HINT 0x0C51 +#define GL_LINE_SMOOTH_HINT 0x0C52 +#define GL_FOG_HINT 0x0C54 +#define GL_GENERATE_MIPMAP_HINT 0x8192 + +/* LightModelParameter */ +#define GL_LIGHT_MODEL_AMBIENT 0x0B53 +#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52 + +/* LightParameter */ +#define GL_AMBIENT 0x1200 +#define GL_DIFFUSE 0x1201 +#define GL_SPECULAR 0x1202 +#define GL_POSITION 0x1203 +#define GL_SPOT_DIRECTION 0x1204 +#define GL_SPOT_EXPONENT 0x1205 +#define GL_SPOT_CUTOFF 0x1206 +#define GL_CONSTANT_ATTENUATION 0x1207 +#define GL_LINEAR_ATTENUATION 0x1208 +#define GL_QUADRATIC_ATTENUATION 0x1209 + +/* DataType */ +#define GL_BYTE 0x1400 +#define GL_UNSIGNED_BYTE 0x1401 +#define GL_SHORT 0x1402 +#define GL_UNSIGNED_SHORT 0x1403 +#define GL_FLOAT 0x1406 +#define GL_FIXED 0x140C + +/* LogicOp */ +#define GL_CLEAR 0x1500 +#define GL_AND 0x1501 +#define GL_AND_REVERSE 0x1502 +#define GL_COPY 0x1503 +#define GL_AND_INVERTED 0x1504 +#define GL_NOOP 0x1505 +#define GL_XOR 0x1506 +#define GL_OR 0x1507 +#define GL_NOR 0x1508 +#define GL_EQUIV 0x1509 +#define GL_INVERT 0x150A +#define GL_OR_REVERSE 0x150B +#define GL_COPY_INVERTED 0x150C +#define GL_OR_INVERTED 0x150D +#define GL_NAND 0x150E +#define GL_SET 0x150F + +/* MaterialFace */ +/* GL_FRONT_AND_BACK */ + +/* MaterialParameter */ +#define GL_EMISSION 0x1600 +#define GL_SHININESS 0x1601 +#define GL_AMBIENT_AND_DIFFUSE 0x1602 +/* GL_AMBIENT */ +/* GL_DIFFUSE */ +/* GL_SPECULAR */ + +/* MatrixMode */ +#define GL_MODELVIEW 0x1700 +#define GL_PROJECTION 0x1701 +#define GL_TEXTURE 0x1702 + +/* NormalPointerType */ +/* GL_BYTE */ +/* GL_SHORT */ +/* GL_FLOAT */ +/* GL_FIXED */ + +/* PixelFormat */ +#define GL_ALPHA 0x1906 +#define GL_RGB 0x1907 +#define GL_RGBA 0x1908 +#define GL_LUMINANCE 0x1909 +#define GL_LUMINANCE_ALPHA 0x190A + +/* PixelStoreParameter */ +#define GL_UNPACK_ALIGNMENT 0x0CF5 +#define GL_PACK_ALIGNMENT 0x0D05 + +/* PixelType */ +/* GL_UNSIGNED_BYTE */ +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 + +/* ShadingModel */ +#define GL_FLAT 0x1D00 +#define GL_SMOOTH 0x1D01 + +/* StencilFunction */ +/* GL_NEVER */ +/* GL_LESS */ +/* GL_EQUAL */ +/* GL_LEQUAL */ +/* GL_GREATER */ +/* GL_NOTEQUAL */ +/* GL_GEQUAL */ +/* GL_ALWAYS */ + +/* StencilOp */ +/* GL_ZERO */ +#define GL_KEEP 0x1E00 +#define GL_REPLACE 0x1E01 +#define GL_INCR 0x1E02 +#define GL_DECR 0x1E03 +/* GL_INVERT */ + +/* StringName */ +#define GL_VENDOR 0x1F00 +#define GL_RENDERER 0x1F01 +#define GL_VERSION 0x1F02 +#define GL_EXTENSIONS 0x1F03 + +/* TexCoordPointerType */ +/* GL_SHORT */ +/* GL_FLOAT */ +/* GL_FIXED */ +/* GL_BYTE */ + +/* TextureEnvMode */ +#define GL_MODULATE 0x2100 +#define GL_DECAL 0x2101 +/* GL_BLEND */ +#define GL_ADD 0x0104 +/* GL_REPLACE */ + +/* TextureEnvParameter */ +#define GL_TEXTURE_ENV_MODE 0x2200 +#define GL_TEXTURE_ENV_COLOR 0x2201 + +/* TextureEnvTarget */ +#define GL_TEXTURE_ENV 0x2300 + +/* TextureMagFilter */ +#define GL_NEAREST 0x2600 +#define GL_LINEAR 0x2601 + +/* TextureMinFilter */ +/* GL_NEAREST */ +/* GL_LINEAR */ +#define GL_NEAREST_MIPMAP_NEAREST 0x2700 +#define GL_LINEAR_MIPMAP_NEAREST 0x2701 +#define GL_NEAREST_MIPMAP_LINEAR 0x2702 +#define GL_LINEAR_MIPMAP_LINEAR 0x2703 + +/* TextureParameterName */ +#define GL_TEXTURE_MAG_FILTER 0x2800 +#define GL_TEXTURE_MIN_FILTER 0x2801 +#define GL_TEXTURE_WRAP_S 0x2802 +#define GL_TEXTURE_WRAP_T 0x2803 +#define GL_GENERATE_MIPMAP 0x8191 + +/* TextureTarget */ +/* GL_TEXTURE_2D */ + +/* TextureUnit */ +#define GL_TEXTURE0 0x84C0 +#define GL_TEXTURE1 0x84C1 +#define GL_TEXTURE2 0x84C2 +#define GL_TEXTURE3 0x84C3 +#define GL_TEXTURE4 0x84C4 +#define GL_TEXTURE5 0x84C5 +#define GL_TEXTURE6 0x84C6 +#define GL_TEXTURE7 0x84C7 +#define GL_TEXTURE8 0x84C8 +#define GL_TEXTURE9 0x84C9 +#define GL_TEXTURE10 0x84CA +#define GL_TEXTURE11 0x84CB +#define GL_TEXTURE12 0x84CC +#define GL_TEXTURE13 0x84CD +#define GL_TEXTURE14 0x84CE +#define GL_TEXTURE15 0x84CF +#define GL_TEXTURE16 0x84D0 +#define GL_TEXTURE17 0x84D1 +#define GL_TEXTURE18 0x84D2 +#define GL_TEXTURE19 0x84D3 +#define GL_TEXTURE20 0x84D4 +#define GL_TEXTURE21 0x84D5 +#define GL_TEXTURE22 0x84D6 +#define GL_TEXTURE23 0x84D7 +#define GL_TEXTURE24 0x84D8 +#define GL_TEXTURE25 0x84D9 +#define GL_TEXTURE26 0x84DA +#define GL_TEXTURE27 0x84DB +#define GL_TEXTURE28 0x84DC +#define GL_TEXTURE29 0x84DD +#define GL_TEXTURE30 0x84DE +#define GL_TEXTURE31 0x84DF +#define GL_ACTIVE_TEXTURE 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 + +/* TextureWrapMode */ +#define GL_REPEAT 0x2901 +#define GL_CLAMP_TO_EDGE 0x812F + +/* VertexPointerType */ +/* GL_SHORT */ +/* GL_FLOAT */ +/* GL_FIXED */ +/* GL_BYTE */ + +/* LightName */ +#define GL_LIGHT0 0x4000 +#define GL_LIGHT1 0x4001 +#define GL_LIGHT2 0x4002 +#define GL_LIGHT3 0x4003 +#define GL_LIGHT4 0x4004 +#define GL_LIGHT5 0x4005 +#define GL_LIGHT6 0x4006 +#define GL_LIGHT7 0x4007 + +/* Buffer Objects */ +#define GL_ARRAY_BUFFER 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER 0x8893 + +#define GL_ARRAY_BUFFER_BINDING 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A + +#define GL_STATIC_DRAW 0x88E4 +#define GL_DYNAMIC_DRAW 0x88E8 + +#define GL_BUFFER_SIZE 0x8764 +#define GL_BUFFER_USAGE 0x8765 + +/* Texture combine + dot3 */ +#define GL_SUBTRACT 0x84E7 +#define GL_COMBINE 0x8570 +#define GL_COMBINE_RGB 0x8571 +#define GL_COMBINE_ALPHA 0x8572 +#define GL_RGB_SCALE 0x8573 +#define GL_ADD_SIGNED 0x8574 +#define GL_INTERPOLATE 0x8575 +#define GL_CONSTANT 0x8576 +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PREVIOUS 0x8578 +#define GL_OPERAND0_RGB 0x8590 +#define GL_OPERAND1_RGB 0x8591 +#define GL_OPERAND2_RGB 0x8592 +#define GL_OPERAND0_ALPHA 0x8598 +#define GL_OPERAND1_ALPHA 0x8599 +#define GL_OPERAND2_ALPHA 0x859A + +#define GL_ALPHA_SCALE 0x0D1C + +#define GL_SRC0_RGB 0x8580 +#define GL_SRC1_RGB 0x8581 +#define GL_SRC2_RGB 0x8582 +#define GL_SRC0_ALPHA 0x8588 +#define GL_SRC1_ALPHA 0x8589 +#define GL_SRC2_ALPHA 0x858A + +#define GL_DOT3_RGB 0x86AE +#define GL_DOT3_RGBA 0x86AF + +/*------------------------------------------------------------------------* + * required OES extension tokens + *------------------------------------------------------------------------*/ + +/* OES_read_format */ +#ifndef GL_OES_read_format +#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B +#endif + +/* GL_OES_compressed_paletted_texture */ +#ifndef GL_OES_compressed_paletted_texture +#define GL_PALETTE4_RGB8_OES 0x8B90 +#define GL_PALETTE4_RGBA8_OES 0x8B91 +#define GL_PALETTE4_R5_G6_B5_OES 0x8B92 +#define GL_PALETTE4_RGBA4_OES 0x8B93 +#define GL_PALETTE4_RGB5_A1_OES 0x8B94 +#define GL_PALETTE8_RGB8_OES 0x8B95 +#define GL_PALETTE8_RGBA8_OES 0x8B96 +#define GL_PALETTE8_R5_G6_B5_OES 0x8B97 +#define GL_PALETTE8_RGBA4_OES 0x8B98 +#define GL_PALETTE8_RGB5_A1_OES 0x8B99 +#endif + +/* OES_point_size_array */ +#ifndef GL_OES_point_size_array +#define GL_POINT_SIZE_ARRAY_OES 0x8B9C +#define GL_POINT_SIZE_ARRAY_TYPE_OES 0x898A +#define GL_POINT_SIZE_ARRAY_STRIDE_OES 0x898B +#define GL_POINT_SIZE_ARRAY_POINTER_OES 0x898C +#define GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES 0x8B9F +#endif + +/* GL_OES_point_sprite */ +#ifndef GL_OES_point_sprite +#define GL_POINT_SPRITE_OES 0x8861 +#define GL_COORD_REPLACE_OES 0x8862 +#endif + +/*************************************************************/ + +/* Available only in Common profile */ +GL_API void GL_APIENTRY glAlphaFunc (GLenum func, GLclampf ref); +GL_API void GL_APIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +GL_API void GL_APIENTRY glClearDepthf (GLclampf depth); +GL_API void GL_APIENTRY glClipPlanef (GLenum plane, const GLfloat *equation); +GL_API void GL_APIENTRY glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GL_API void GL_APIENTRY glDepthRangef (GLclampf zNear, GLclampf zFar); +GL_API void GL_APIENTRY glFogf (GLenum pname, GLfloat param); +GL_API void GL_APIENTRY glFogfv (GLenum pname, const GLfloat *params); +GL_API void GL_APIENTRY glFrustumf (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); +GL_API void GL_APIENTRY glGetClipPlanef (GLenum pname, GLfloat eqn[4]); +GL_API void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat *params); +GL_API void GL_APIENTRY glGetLightfv (GLenum light, GLenum pname, GLfloat *params); +GL_API void GL_APIENTRY glGetMaterialfv (GLenum face, GLenum pname, GLfloat *params); +GL_API void GL_APIENTRY glGetTexEnvfv (GLenum env, GLenum pname, GLfloat *params); +GL_API void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params); +GL_API void GL_APIENTRY glLightModelf (GLenum pname, GLfloat param); +GL_API void GL_APIENTRY glLightModelfv (GLenum pname, const GLfloat *params); +GL_API void GL_APIENTRY glLightf (GLenum light, GLenum pname, GLfloat param); +GL_API void GL_APIENTRY glLightfv (GLenum light, GLenum pname, const GLfloat *params); +GL_API void GL_APIENTRY glLineWidth (GLfloat width); +GL_API void GL_APIENTRY glLoadMatrixf (const GLfloat *m); +GL_API void GL_APIENTRY glMaterialf (GLenum face, GLenum pname, GLfloat param); +GL_API void GL_APIENTRY glMaterialfv (GLenum face, GLenum pname, const GLfloat *params); +GL_API void GL_APIENTRY glMultMatrixf (const GLfloat *m); +GL_API void GL_APIENTRY glMultiTexCoord4f (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +GL_API void GL_APIENTRY glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz); +GL_API void GL_APIENTRY glOrthof (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); +GL_API void GL_APIENTRY glPointParameterf (GLenum pname, GLfloat param); +GL_API void GL_APIENTRY glPointParameterfv (GLenum pname, const GLfloat *params); +GL_API void GL_APIENTRY glPointSize (GLfloat size); +GL_API void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units); +GL_API void GL_APIENTRY glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +GL_API void GL_APIENTRY glScalef (GLfloat x, GLfloat y, GLfloat z); +GL_API void GL_APIENTRY glTexEnvf (GLenum target, GLenum pname, GLfloat param); +GL_API void GL_APIENTRY glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params); +GL_API void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param); +GL_API void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params); +GL_API void GL_APIENTRY glTranslatef (GLfloat x, GLfloat y, GLfloat z); + +/* Available in both Common and Common-Lite profiles */ +GL_API void GL_APIENTRY glActiveTexture (GLenum texture); +GL_API void GL_APIENTRY glAlphaFuncx (GLenum func, GLclampx ref); +GL_API void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer); +GL_API void GL_APIENTRY glBindTexture (GLenum target, GLuint texture); +GL_API void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor); +GL_API void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage); +GL_API void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data); +GL_API void GL_APIENTRY glClear (GLbitfield mask); +GL_API void GL_APIENTRY glClearColorx (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha); +GL_API void GL_APIENTRY glClearDepthx (GLclampx depth); +GL_API void GL_APIENTRY glClearStencil (GLint s); +GL_API void GL_APIENTRY glClientActiveTexture (GLenum texture); +GL_API void GL_APIENTRY glClipPlanex (GLenum plane, const GLfixed *equation); +GL_API void GL_APIENTRY glColor4ub (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); +GL_API void GL_APIENTRY glColor4x (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +GL_API void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +GL_API void GL_APIENTRY glColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GL_API void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +GL_API void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +GL_API void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GL_API void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GL_API void GL_APIENTRY glCullFace (GLenum mode); +GL_API void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers); +GL_API void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint *textures); +GL_API void GL_APIENTRY glDepthFunc (GLenum func); +GL_API void GL_APIENTRY glDepthMask (GLboolean flag); +GL_API void GL_APIENTRY glDepthRangex (GLclampx zNear, GLclampx zFar); +GL_API void GL_APIENTRY glDisable (GLenum cap); +GL_API void GL_APIENTRY glDisableClientState (GLenum array); +GL_API void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count); +GL_API void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices); +GL_API void GL_APIENTRY glEnable (GLenum cap); +GL_API void GL_APIENTRY glEnableClientState (GLenum array); +GL_API void GL_APIENTRY glFinish (void); +GL_API void GL_APIENTRY glFlush (void); +GL_API void GL_APIENTRY glFogx (GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glFogxv (GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glFrontFace (GLenum mode); +GL_API void GL_APIENTRY glFrustumx (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); +GL_API void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean *params); +GL_API void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params); +GL_API void GL_APIENTRY glGetClipPlanex (GLenum pname, GLfixed eqn[4]); +GL_API void GL_APIENTRY glGenBuffers (GLsizei n, GLuint *buffers); +GL_API void GL_APIENTRY glGenTextures (GLsizei n, GLuint *textures); +GL_API GLenum GL_APIENTRY glGetError (void); +GL_API void GL_APIENTRY glGetFixedv (GLenum pname, GLfixed *params); +GL_API void GL_APIENTRY glGetIntegerv (GLenum pname, GLint *params); +GL_API void GL_APIENTRY glGetLightxv (GLenum light, GLenum pname, GLfixed *params); +GL_API void GL_APIENTRY glGetMaterialxv (GLenum face, GLenum pname, GLfixed *params); +GL_API void GL_APIENTRY glGetPointerv (GLenum pname, void **params); +GL_API const GLubyte * GL_APIENTRY glGetString (GLenum name); +GL_API void GL_APIENTRY glGetTexEnviv (GLenum env, GLenum pname, GLint *params); +GL_API void GL_APIENTRY glGetTexEnvxv (GLenum env, GLenum pname, GLfixed *params); +GL_API void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params); +GL_API void GL_APIENTRY glGetTexParameterxv (GLenum target, GLenum pname, GLfixed *params); +GL_API void GL_APIENTRY glHint (GLenum target, GLenum mode); +GL_API GLboolean GL_APIENTRY glIsBuffer (GLuint buffer); +GL_API GLboolean GL_APIENTRY glIsEnabled (GLenum cap); +GL_API GLboolean GL_APIENTRY glIsTexture (GLuint texture); +GL_API void GL_APIENTRY glLightModelx (GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glLightModelxv (GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glLightx (GLenum light, GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glLightxv (GLenum light, GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glLineWidthx (GLfixed width); +GL_API void GL_APIENTRY glLoadIdentity (void); +GL_API void GL_APIENTRY glLoadMatrixx (const GLfixed *m); +GL_API void GL_APIENTRY glLogicOp (GLenum opcode); +GL_API void GL_APIENTRY glMaterialx (GLenum face, GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glMaterialxv (GLenum face, GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glMatrixMode (GLenum mode); +GL_API void GL_APIENTRY glMultMatrixx (const GLfixed *m); +GL_API void GL_APIENTRY glMultiTexCoord4x (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q); +GL_API void GL_APIENTRY glNormal3x (GLfixed nx, GLfixed ny, GLfixed nz); +GL_API void GL_APIENTRY glNormalPointer (GLenum type, GLsizei stride, const GLvoid *pointer); +GL_API void GL_APIENTRY glOrthox (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); +GL_API void GL_APIENTRY glPixelStorei (GLenum pname, GLint param); +GL_API void GL_APIENTRY glPointParameterx (GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glPointParameterxv (GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glPointSizex (GLfixed size); +GL_API void GL_APIENTRY glPolygonOffsetx (GLfixed factor, GLfixed units); +GL_API void GL_APIENTRY glPopMatrix (void); +GL_API void GL_APIENTRY glPushMatrix (void); +GL_API void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels); +GL_API void GL_APIENTRY glRotatex (GLfixed angle, GLfixed x, GLfixed y, GLfixed z); +GL_API void GL_APIENTRY glSampleCoverage (GLclampf value, GLboolean invert); +GL_API void GL_APIENTRY glSampleCoveragex (GLclampx value, GLboolean invert); +GL_API void GL_APIENTRY glScalex (GLfixed x, GLfixed y, GLfixed z); +GL_API void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height); +GL_API void GL_APIENTRY glShadeModel (GLenum mode); +GL_API void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask); +GL_API void GL_APIENTRY glStencilMask (GLuint mask); +GL_API void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass); +GL_API void GL_APIENTRY glTexCoordPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GL_API void GL_APIENTRY glTexEnvi (GLenum target, GLenum pname, GLint param); +GL_API void GL_APIENTRY glTexEnvx (GLenum target, GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glTexEnviv (GLenum target, GLenum pname, const GLint *params); +GL_API void GL_APIENTRY glTexEnvxv (GLenum target, GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GL_API void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param); +GL_API void GL_APIENTRY glTexParameterx (GLenum target, GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params); +GL_API void GL_APIENTRY glTexParameterxv (GLenum target, GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +GL_API void GL_APIENTRY glTranslatex (GLfixed x, GLfixed y, GLfixed z); +GL_API void GL_APIENTRY glVertexPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GL_API void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height); + +/*------------------------------------------------------------------------* + * Required OES extension functions + *------------------------------------------------------------------------*/ + +/* GL_OES_read_format */ +#ifndef GL_OES_read_format +#define GL_OES_read_format 1 +#endif + +/* GL_OES_compressed_paletted_texture */ +#ifndef GL_OES_compressed_paletted_texture +#define GL_OES_compressed_paletted_texture 1 +#endif + +/* GL_OES_point_size_array */ +#ifndef GL_OES_point_size_array +#define GL_OES_point_size_array 1 +GL_API void GL_APIENTRY glPointSizePointerOES (GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +/* GL_OES_point_sprite */ +#ifndef GL_OES_point_sprite +#define GL_OES_point_sprite 1 +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* __gl_h_ */ + diff --git a/include/GLES/glext.h b/include/GLES/glext.h new file mode 100755 index 0000000..e0ee2c3 --- /dev/null +++ b/include/GLES/glext.h @@ -0,0 +1,884 @@ +#ifndef __glext_h_ +#define __glext_h_ + +/* $Revision: 8938 $ on $Date:: 2009-09-17 19:43:02 -0700 #$ */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * This document is licensed under the SGI Free Software B License Version + * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ . + */ + +#ifndef GL_APIENTRYP +# define GL_APIENTRYP GL_APIENTRY* +#endif + +/*------------------------------------------------------------------------* + * OES extension tokens + *------------------------------------------------------------------------*/ + +/* GL_OES_blend_equation_separate */ +#ifndef GL_OES_blend_equation_separate +/* BLEND_EQUATION_RGB_OES same as BLEND_EQUATION_OES */ +#define GL_BLEND_EQUATION_RGB_OES 0x8009 +#define GL_BLEND_EQUATION_ALPHA_OES 0x883D +#endif + +/* GL_OES_blend_func_separate */ +#ifndef GL_OES_blend_func_separate +#define GL_BLEND_DST_RGB_OES 0x80C8 +#define GL_BLEND_SRC_RGB_OES 0x80C9 +#define GL_BLEND_DST_ALPHA_OES 0x80CA +#define GL_BLEND_SRC_ALPHA_OES 0x80CB +#endif + +/* GL_OES_blend_subtract */ +#ifndef GL_OES_blend_subtract +#define GL_BLEND_EQUATION_OES 0x8009 +#define GL_FUNC_ADD_OES 0x8006 +#define GL_FUNC_SUBTRACT_OES 0x800A +#define GL_FUNC_REVERSE_SUBTRACT_OES 0x800B +#endif + +/* GL_OES_compressed_ETC1_RGB8_texture */ +#ifndef GL_OES_compressed_ETC1_RGB8_texture +#define GL_ETC1_RGB8_OES 0x8D64 +#endif + +/* GL_OES_depth24 */ +#ifndef GL_OES_depth24 +#define GL_DEPTH_COMPONENT24_OES 0x81A6 +#endif + +/* GL_OES_depth32 */ +#ifndef GL_OES_depth32 +#define GL_DEPTH_COMPONENT32_OES 0x81A7 +#endif + +/* GL_OES_draw_texture */ +#ifndef GL_OES_draw_texture +#define GL_TEXTURE_CROP_RECT_OES 0x8B9D +#endif + +/* GL_OES_EGL_image */ +#ifndef GL_OES_EGL_image +typedef void* GLeglImageOES; +#endif + +/* GL_OES_fixed_point */ +#ifndef GL_OES_fixed_point +#define GL_FIXED_OES 0x140C +#endif + +/* GL_OES_framebuffer_object */ +#ifndef GL_OES_framebuffer_object +#define GL_NONE_OES 0 +#define GL_FRAMEBUFFER_OES 0x8D40 +#define GL_RENDERBUFFER_OES 0x8D41 +#define GL_RGBA4_OES 0x8056 +#define GL_RGB5_A1_OES 0x8057 +#define GL_RGB565_OES 0x8D62 +#define GL_DEPTH_COMPONENT16_OES 0x81A5 +#define GL_RENDERBUFFER_WIDTH_OES 0x8D42 +#define GL_RENDERBUFFER_HEIGHT_OES 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT_OES 0x8D44 +#define GL_RENDERBUFFER_RED_SIZE_OES 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE_OES 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE_OES 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE_OES 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE_OES 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE_OES 0x8D55 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_OES 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_OES 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_OES 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_OES 0x8CD3 +#define GL_COLOR_ATTACHMENT0_OES 0x8CE0 +#define GL_DEPTH_ATTACHMENT_OES 0x8D00 +#define GL_STENCIL_ATTACHMENT_OES 0x8D20 +#define GL_FRAMEBUFFER_COMPLETE_OES 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_OES 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_OES 0x8CD9 +#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_OES 0x8CDA +#define GL_FRAMEBUFFER_UNSUPPORTED_OES 0x8CDD +#define GL_FRAMEBUFFER_BINDING_OES 0x8CA6 +#define GL_RENDERBUFFER_BINDING_OES 0x8CA7 +#define GL_MAX_RENDERBUFFER_SIZE_OES 0x84E8 +#define GL_INVALID_FRAMEBUFFER_OPERATION_OES 0x0506 +#endif + +/* GL_OES_mapbuffer */ +#ifndef GL_OES_mapbuffer +#define GL_WRITE_ONLY_OES 0x88B9 +#define GL_BUFFER_ACCESS_OES 0x88BB +#define GL_BUFFER_MAPPED_OES 0x88BC +#define GL_BUFFER_MAP_POINTER_OES 0x88BD +#endif + +/* GL_OES_matrix_get */ +#ifndef GL_OES_matrix_get +#define GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES 0x898D +#define GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES 0x898E +#define GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES 0x898F +#endif + +/* GL_OES_matrix_palette */ +#ifndef GL_OES_matrix_palette +#define GL_MAX_VERTEX_UNITS_OES 0x86A4 +#define GL_MAX_PALETTE_MATRICES_OES 0x8842 +#define GL_MATRIX_PALETTE_OES 0x8840 +#define GL_MATRIX_INDEX_ARRAY_OES 0x8844 +#define GL_WEIGHT_ARRAY_OES 0x86AD +#define GL_CURRENT_PALETTE_MATRIX_OES 0x8843 +#define GL_MATRIX_INDEX_ARRAY_SIZE_OES 0x8846 +#define GL_MATRIX_INDEX_ARRAY_TYPE_OES 0x8847 +#define GL_MATRIX_INDEX_ARRAY_STRIDE_OES 0x8848 +#define GL_MATRIX_INDEX_ARRAY_POINTER_OES 0x8849 +#define GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES 0x8B9E +#define GL_WEIGHT_ARRAY_SIZE_OES 0x86AB +#define GL_WEIGHT_ARRAY_TYPE_OES 0x86A9 +#define GL_WEIGHT_ARRAY_STRIDE_OES 0x86AA +#define GL_WEIGHT_ARRAY_POINTER_OES 0x86AC +#define GL_WEIGHT_ARRAY_BUFFER_BINDING_OES 0x889E +#endif + +/* GL_OES_packed_depth_stencil */ +#ifndef GL_OES_packed_depth_stencil +#define GL_DEPTH_STENCIL_OES 0x84F9 +#define GL_UNSIGNED_INT_24_8_OES 0x84FA +#define GL_DEPTH24_STENCIL8_OES 0x88F0 +#endif + +/* GL_OES_rgb8_rgba8 */ +#ifndef GL_OES_rgb8_rgba8 +#define GL_RGB8_OES 0x8051 +#define GL_RGBA8_OES 0x8058 +#endif + +/* GL_OES_stencil1 */ +#ifndef GL_OES_stencil1 +#define GL_STENCIL_INDEX1_OES 0x8D46 +#endif + +/* GL_OES_stencil4 */ +#ifndef GL_OES_stencil4 +#define GL_STENCIL_INDEX4_OES 0x8D47 +#endif + +/* GL_OES_stencil8 */ +#ifndef GL_OES_stencil8 +#define GL_STENCIL_INDEX8_OES 0x8D48 +#endif + +/* GL_OES_stencil_wrap */ +#ifndef GL_OES_stencil_wrap +#define GL_INCR_WRAP_OES 0x8507 +#define GL_DECR_WRAP_OES 0x8508 +#endif + +/* GL_OES_texture_cube_map */ +#ifndef GL_OES_texture_cube_map +#define GL_NORMAL_MAP_OES 0x8511 +#define GL_REFLECTION_MAP_OES 0x8512 +#define GL_TEXTURE_CUBE_MAP_OES 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_OES 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES 0x851A +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_OES 0x851C +#define GL_TEXTURE_GEN_MODE_OES 0x2500 +#define GL_TEXTURE_GEN_STR_OES 0x8D60 +#endif + +/* GL_OES_texture_mirrored_repeat */ +#ifndef GL_OES_texture_mirrored_repeat +#define GL_MIRRORED_REPEAT_OES 0x8370 +#endif + +/*------------------------------------------------------------------------* + * AMD extension tokens + *------------------------------------------------------------------------*/ + +/* GL_AMD_compressed_3DC_texture */ +#ifndef GL_AMD_compressed_3DC_texture +#define GL_3DC_X_AMD 0x87F9 +#define GL_3DC_XY_AMD 0x87FA +#endif + +/* GL_AMD_compressed_ATC_texture */ +#ifndef GL_AMD_compressed_ATC_texture +#define GL_ATC_RGB_AMD 0x8C92 +#define GL_ATC_RGBA_EXPLICIT_ALPHA_AMD 0x8C93 +#define GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD 0x87EE +#endif + +/*------------------------------------------------------------------------* + * APPLE extension tokens + *------------------------------------------------------------------------*/ + +/* GL_APPLE_texture_2D_limited_npot */ +/* No new tokens introduced by this extension. */ + +/*------------------------------------------------------------------------* + * EXT extension tokens + *------------------------------------------------------------------------*/ + +/* GL_EXT_texture_filter_anisotropic */ +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE +#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF +#endif + +/* GL_EXT_texture_format_BGRA8888 */ +#ifndef GL_EXT_texture_format_BGRA8888 +#define GL_BGRA 0x80E1 +#endif + +/* GL_EXT_texture_lod_bias */ +#ifndef GL_EXT_texture_lod_bias +#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD +#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 +#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 +#endif + +/* GL_EXT_discard_framebuffer */ +#ifndef GL_EXT_discard_framebuffer +#define GL_COLOR_EXT 0x1800 +#define GL_DEPTH_EXT 0x1801 +#define GL_STENCIL_EXT 0x1802 +#endif + +#ifndef GL_EXT_blend_minmax +#define GL_MIN_EXT 0x8007 +#define GL_MAX_EXT 0x8008 +#endif + +/*------------------------------------------------------------------------* + * IMG extension tokens + *------------------------------------------------------------------------*/ + +/* GL_IMG_read_format */ +#ifndef GL_IMG_read_format +#define GL_BGRA 0x80E1 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 +#endif + +/* GL_IMG_texture_compression_pvrtc */ +#ifndef GL_IMG_texture_compression_pvrtc +#define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00 +#define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG 0x8C01 +#define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02 +#define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03 +#endif + +/* GL_IMG_user_clip_plane */ +#ifndef GL_IMG_user_clip_plane +#define GL_CLIP_PLANE0_IMG 0x3000 +#define GL_CLIP_PLANE1_IMG 0x3001 +#define GL_CLIP_PLANE2_IMG 0x3002 +#define GL_CLIP_PLANE3_IMG 0x3003 +#define GL_CLIP_PLANE4_IMG 0x3004 +#define GL_CLIP_PLANE5_IMG 0x3005 +#define GL_MAX_CLIP_PLANES_IMG 0x0D32 +#endif + +/* GL_IMG_texture_env_enhanced_fixed_function */ +#ifndef GL_IMG_texture_env_enhanced_fixed_function +#define GL_MODULATE_COLOR_IMG 0x8C04 +#define GL_RECIP_ADD_SIGNED_ALPHA_IMG 0x8C05 +#define GL_TEXTURE_ALPHA_MODULATE_IMG 0x8C06 +#define GL_FACTOR_ALPHA_MODULATE_IMG 0x8C07 +#define GL_FRAGMENT_ALPHA_MODULATE_IMG 0x8C08 +#define GL_ADD_BLEND_IMG 0x8C09 +#define GL_DOT3_RGBA_IMG 0x86AF +#endif + +/*------------------------------------------------------------------------* + * NV extension tokens + *------------------------------------------------------------------------*/ + +/* GL_NV_fence */ +#ifndef GL_NV_fence +#define GL_ALL_COMPLETED_NV 0x84F2 +#define GL_FENCE_STATUS_NV 0x84F3 +#define GL_FENCE_CONDITION_NV 0x84F4 +#endif + +/*------------------------------------------------------------------------* + * QCOM extension tokens + *------------------------------------------------------------------------*/ + +/* GL_QCOM_driver_control */ +/* No new tokens introduced by this extension. */ + +/* GL_QCOM_perfmon_global_mode */ +#ifndef GL_QCOM_perfmon_global_mode +#define GL_PERFMON_GLOBAL_MODE_QCOM 0x8FA0 +#endif + +/* GL_QCOM_writeonly_rendering */ +#ifndef GL_QCOM_writeonly_rendering +#define GL_WRITEONLY_RENDERING_AMD 0x8823 +#endif + +/* GL_QCOM_extended_get */ +#ifndef GL_QCOM_extended_get +#define GL_TEXTURE_WIDTH_QCOM 0x8BD2 +#define GL_TEXTURE_HEIGHT_QCOM 0x8BD3 +#define GL_TEXTURE_DEPTH_QCOM 0x8BD4 +#define GL_TEXTURE_INTERNAL_FORMAT_QCOM 0x8BD5 +#define GL_TEXTURE_FORMAT_QCOM 0x8BD6 +#define GL_TEXTURE_TYPE_QCOM 0x8BD7 +#define GL_TEXTURE_IMAGE_VALID_QCOM 0x8BD8 +#define GL_TEXTURE_NUM_LEVELS_QCOM 0x8BD9 +#define GL_TEXTURE_TARGET_QCOM 0x8BDA +#define GL_TEXTURE_OBJECT_VALID_QCOM 0x8BDB +#define GL_STATE_RESTORE 0x8BDC +#endif + +/* GL_QCOM_extended_get2 */ +/* No new tokens introduced by this extension. */ + +/*------------------------------------------------------------------------* + * End of extension tokens, start of corresponding extension functions + *------------------------------------------------------------------------*/ + +/*------------------------------------------------------------------------* + * OES extension functions + *------------------------------------------------------------------------*/ + +/* GL_OES_blend_equation_separate */ +#ifndef GL_OES_blend_equation_separate +#define GL_OES_blend_equation_separate 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glBlendEquationSeparateOES (GLenum modeRGB, GLenum modeAlpha); +#endif +typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONSEPARATEOESPROC) (GLenum modeRGB, GLenum modeAlpha); +#endif + +/* GL_OES_blend_func_separate */ +#ifndef GL_OES_blend_func_separate +#define GL_OES_blend_func_separate 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glBlendFuncSeparateOES (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +#endif +typedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATEOESPROC) (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +#endif + +/* GL_OES_blend_subtract */ +#ifndef GL_OES_blend_subtract +#define GL_OES_blend_subtract 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glBlendEquationOES (GLenum mode); +#endif +typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONOESPROC) (GLenum mode); +#endif + +/* GL_OES_byte_coordinates */ +#ifndef GL_OES_byte_coordinates +#define GL_OES_byte_coordinates 1 +#endif + +/* GL_OES_compressed_ETC1_RGB8_texture */ +#ifndef GL_OES_compressed_ETC1_RGB8_texture +#define GL_OES_compressed_ETC1_RGB8_texture 1 +#endif + +/* GL_OES_depth24 */ +#ifndef GL_OES_depth24 +#define GL_OES_depth24 1 +#endif + +/* GL_OES_depth32 */ +#ifndef GL_OES_depth32 +#define GL_OES_depth32 1 +#endif + +/* GL_OES_draw_texture */ +#ifndef GL_OES_draw_texture +#define GL_OES_draw_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glDrawTexsOES (GLshort x, GLshort y, GLshort z, GLshort width, GLshort height); +GL_API void GL_APIENTRY glDrawTexiOES (GLint x, GLint y, GLint z, GLint width, GLint height); +GL_API void GL_APIENTRY glDrawTexxOES (GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height); +GL_API void GL_APIENTRY glDrawTexsvOES (const GLshort *coords); +GL_API void GL_APIENTRY glDrawTexivOES (const GLint *coords); +GL_API void GL_APIENTRY glDrawTexxvOES (const GLfixed *coords); +GL_API void GL_APIENTRY glDrawTexfOES (GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height); +GL_API void GL_APIENTRY glDrawTexfvOES (const GLfloat *coords); +#endif +typedef void (GL_APIENTRYP PFNGLDRAWTEXSOESPROC) (GLshort x, GLshort y, GLshort z, GLshort width, GLshort height); +typedef void (GL_APIENTRYP PFNGLDRAWTEXIOESPROC) (GLint x, GLint y, GLint z, GLint width, GLint height); +typedef void (GL_APIENTRYP PFNGLDRAWTEXXOESPROC) (GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height); +typedef void (GL_APIENTRYP PFNGLDRAWTEXSVOESPROC) (const GLshort *coords); +typedef void (GL_APIENTRYP PFNGLDRAWTEXIVOESPROC) (const GLint *coords); +typedef void (GL_APIENTRYP PFNGLDRAWTEXXVOESPROC) (const GLfixed *coords); +typedef void (GL_APIENTRYP PFNGLDRAWTEXFOESPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height); +typedef void (GL_APIENTRYP PFNGLDRAWTEXFVOESPROC) (const GLfloat *coords); +#endif + +/* GL_OES_EGL_image */ +#ifndef GL_OES_EGL_image +#define GL_OES_EGL_image 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image); +GL_API void GL_APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image); +#endif +typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image); +typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image); +#endif + +/* GL_OES_element_index_uint */ +#ifndef GL_OES_element_index_uint +#define GL_OES_element_index_uint 1 +#endif + +/* GL_OES_extended_matrix_palette */ +#ifndef GL_OES_extended_matrix_palette +#define GL_OES_extended_matrix_palette 1 +#endif + +/* GL_OES_fbo_render_mipmap */ +#ifndef GL_OES_fbo_render_mipmap +#define GL_OES_fbo_render_mipmap 1 +#endif + +/* GL_OES_fixed_point */ +#ifndef GL_OES_fixed_point +#define GL_OES_fixed_point 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glAlphaFuncxOES (GLenum func, GLclampx ref); +GL_API void GL_APIENTRY glClearColorxOES (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha); +GL_API void GL_APIENTRY glClearDepthxOES (GLclampx depth); +GL_API void GL_APIENTRY glClipPlanexOES (GLenum plane, const GLfixed *equation); +GL_API void GL_APIENTRY glColor4xOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +GL_API void GL_APIENTRY glDepthRangexOES (GLclampx zNear, GLclampx zFar); +GL_API void GL_APIENTRY glFogxOES (GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glFogxvOES (GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glFrustumxOES (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); +GL_API void GL_APIENTRY glGetClipPlanexOES (GLenum pname, GLfixed eqn[4]); +GL_API void GL_APIENTRY glGetFixedvOES (GLenum pname, GLfixed *params); +GL_API void GL_APIENTRY glGetLightxvOES (GLenum light, GLenum pname, GLfixed *params); +GL_API void GL_APIENTRY glGetMaterialxvOES (GLenum face, GLenum pname, GLfixed *params); +GL_API void GL_APIENTRY glGetTexEnvxvOES (GLenum env, GLenum pname, GLfixed *params); +GL_API void GL_APIENTRY glGetTexParameterxvOES (GLenum target, GLenum pname, GLfixed *params); +GL_API void GL_APIENTRY glLightModelxOES (GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glLightModelxvOES (GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glLightxOES (GLenum light, GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glLightxvOES (GLenum light, GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glLineWidthxOES (GLfixed width); +GL_API void GL_APIENTRY glLoadMatrixxOES (const GLfixed *m); +GL_API void GL_APIENTRY glMaterialxOES (GLenum face, GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glMaterialxvOES (GLenum face, GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glMultMatrixxOES (const GLfixed *m); +GL_API void GL_APIENTRY glMultiTexCoord4xOES (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q); +GL_API void GL_APIENTRY glNormal3xOES (GLfixed nx, GLfixed ny, GLfixed nz); +GL_API void GL_APIENTRY glOrthoxOES (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); +GL_API void GL_APIENTRY glPointParameterxOES (GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glPointParameterxvOES (GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glPointSizexOES (GLfixed size); +GL_API void GL_APIENTRY glPolygonOffsetxOES (GLfixed factor, GLfixed units); +GL_API void GL_APIENTRY glRotatexOES (GLfixed angle, GLfixed x, GLfixed y, GLfixed z); +GL_API void GL_APIENTRY glSampleCoveragexOES (GLclampx value, GLboolean invert); +GL_API void GL_APIENTRY glScalexOES (GLfixed x, GLfixed y, GLfixed z); +GL_API void GL_APIENTRY glTexEnvxOES (GLenum target, GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glTexEnvxvOES (GLenum target, GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glTexParameterxOES (GLenum target, GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glTexParameterxvOES (GLenum target, GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glTranslatexOES (GLfixed x, GLfixed y, GLfixed z); +#endif +typedef void (GL_APIENTRYP PFNGLALPHAFUNCXOESPROC) (GLenum func, GLclampx ref); +typedef void (GL_APIENTRYP PFNGLCLEARCOLORXOESPROC) (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha); +typedef void (GL_APIENTRYP PFNGLCLEARDEPTHXOESPROC) (GLclampx depth); +typedef void (GL_APIENTRYP PFNGLCLIPPLANEXOESPROC) (GLenum plane, const GLfixed *equation); +typedef void (GL_APIENTRYP PFNGLCOLOR4XOESPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +typedef void (GL_APIENTRYP PFNGLDEPTHRANGEXOESPROC) (GLclampx zNear, GLclampx zFar); +typedef void (GL_APIENTRYP PFNGLFOGXOESPROC) (GLenum pname, GLfixed param); +typedef void (GL_APIENTRYP PFNGLFOGXVOESPROC) (GLenum pname, const GLfixed *params); +typedef void (GL_APIENTRYP PFNGLFRUSTUMXOESPROC) (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); +typedef void (GL_APIENTRYP PFNGLGETCLIPPLANEXOESPROC) (GLenum pname, GLfixed eqn[4]); +typedef void (GL_APIENTRYP PFNGLGETFIXEDVOESPROC) (GLenum pname, GLfixed *params); +typedef void (GL_APIENTRYP PFNGLGETLIGHTXVOESPROC) (GLenum light, GLenum pname, GLfixed *params); +typedef void (GL_APIENTRYP PFNGLGETMATERIALXVOESPROC) (GLenum face, GLenum pname, GLfixed *params); +typedef void (GL_APIENTRYP PFNGLGETTEXENVXVOESPROC) (GLenum env, GLenum pname, GLfixed *params); +typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERXVOESPROC) (GLenum target, GLenum pname, GLfixed *params); +typedef void (GL_APIENTRYP PFNGLLIGHTMODELXOESPROC) (GLenum pname, GLfixed param); +typedef void (GL_APIENTRYP PFNGLLIGHTMODELXVOESPROC) (GLenum pname, const GLfixed *params); +typedef void (GL_APIENTRYP PFNGLLIGHTXOESPROC) (GLenum light, GLenum pname, GLfixed param); +typedef void (GL_APIENTRYP PFNGLLIGHTXVOESPROC) (GLenum light, GLenum pname, const GLfixed *params); +typedef void (GL_APIENTRYP PFNGLLINEWIDTHXOESPROC) (GLfixed width); +typedef void (GL_APIENTRYP PFNGLLOADMATRIXXOESPROC) (const GLfixed *m); +typedef void (GL_APIENTRYP PFNGLMATERIALXOESPROC) (GLenum face, GLenum pname, GLfixed param); +typedef void (GL_APIENTRYP PFNGLMATERIALXVOESPROC) (GLenum face, GLenum pname, const GLfixed *params); +typedef void (GL_APIENTRYP PFNGLMULTMATRIXXOESPROC) (const GLfixed *m); +typedef void (GL_APIENTRYP PFNGLMULTITEXCOORD4XOESPROC) (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q); +typedef void (GL_APIENTRYP PFNGLNORMAL3XOESPROC) (GLfixed nx, GLfixed ny, GLfixed nz); +typedef void (GL_APIENTRYP PFNGLORTHOXOESPROC) (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); +typedef void (GL_APIENTRYP PFNGLPOINTPARAMETERXOESPROC) (GLenum pname, GLfixed param); +typedef void (GL_APIENTRYP PFNGLPOINTPARAMETERXVOESPROC) (GLenum pname, const GLfixed *params); +typedef void (GL_APIENTRYP PFNGLPOINTSIZEXOESPROC) (GLfixed size); +typedef void (GL_APIENTRYP PFNGLPOLYGONOFFSETXOESPROC) (GLfixed factor, GLfixed units); +typedef void (GL_APIENTRYP PFNGLROTATEXOESPROC) (GLfixed angle, GLfixed x, GLfixed y, GLfixed z); +typedef void (GL_APIENTRYP PFNGLSAMPLECOVERAGEXOESPROC) (GLclampx value, GLboolean invert); +typedef void (GL_APIENTRYP PFNGLSCALEXOESPROC) (GLfixed x, GLfixed y, GLfixed z); +typedef void (GL_APIENTRYP PFNGLTEXENVXOESPROC) (GLenum target, GLenum pname, GLfixed param); +typedef void (GL_APIENTRYP PFNGLTEXENVXVOESPROC) (GLenum target, GLenum pname, const GLfixed *params); +typedef void (GL_APIENTRYP PFNGLTEXPARAMETERXOESPROC) (GLenum target, GLenum pname, GLfixed param); +typedef void (GL_APIENTRYP PFNGLTEXPARAMETERXVOESPROC) (GLenum target, GLenum pname, const GLfixed *params); +typedef void (GL_APIENTRYP PFNGLTRANSLATEXOESPROC) (GLfixed x, GLfixed y, GLfixed z); +#endif + +/* GL_OES_framebuffer_object */ +#ifndef GL_OES_framebuffer_object +#define GL_OES_framebuffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API GLboolean GL_APIENTRY glIsRenderbufferOES (GLuint renderbuffer); +GL_API void GL_APIENTRY glBindRenderbufferOES (GLenum target, GLuint renderbuffer); +GL_API void GL_APIENTRY glDeleteRenderbuffersOES (GLsizei n, const GLuint* renderbuffers); +GL_API void GL_APIENTRY glGenRenderbuffersOES (GLsizei n, GLuint* renderbuffers); +GL_API void GL_APIENTRY glRenderbufferStorageOES (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +GL_API void GL_APIENTRY glGetRenderbufferParameterivOES (GLenum target, GLenum pname, GLint* params); +GL_API GLboolean GL_APIENTRY glIsFramebufferOES (GLuint framebuffer); +GL_API void GL_APIENTRY glBindFramebufferOES (GLenum target, GLuint framebuffer); +GL_API void GL_APIENTRY glDeleteFramebuffersOES (GLsizei n, const GLuint* framebuffers); +GL_API void GL_APIENTRY glGenFramebuffersOES (GLsizei n, GLuint* framebuffers); +GL_API GLenum GL_APIENTRY glCheckFramebufferStatusOES (GLenum target); +GL_API void GL_APIENTRY glFramebufferRenderbufferOES (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +GL_API void GL_APIENTRY glFramebufferTexture2DOES (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GL_API void GL_APIENTRY glGetFramebufferAttachmentParameterivOES (GLenum target, GLenum attachment, GLenum pname, GLint* params); +GL_API void GL_APIENTRY glGenerateMipmapOES (GLenum target); +#endif +typedef GLboolean (GL_APIENTRYP PFNGLISRENDERBUFFEROESPROC) (GLuint renderbuffer); +typedef void (GL_APIENTRYP PFNGLBINDRENDERBUFFEROESPROC) (GLenum target, GLuint renderbuffer); +typedef void (GL_APIENTRYP PFNGLDELETERENDERBUFFERSOESPROC) (GLsizei n, const GLuint* renderbuffers); +typedef void (GL_APIENTRYP PFNGLGENRENDERBUFFERSOESPROC) (GLsizei n, GLuint* renderbuffers); +typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GL_APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVOESPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GL_APIENTRYP PFNGLISFRAMEBUFFEROESPROC) (GLuint framebuffer); +typedef void (GL_APIENTRYP PFNGLBINDFRAMEBUFFEROESPROC) (GLenum target, GLuint framebuffer); +typedef void (GL_APIENTRYP PFNGLDELETEFRAMEBUFFERSOESPROC) (GLsizei n, const GLuint* framebuffers); +typedef void (GL_APIENTRYP PFNGLGENFRAMEBUFFERSOESPROC) (GLsizei n, GLuint* framebuffers); +typedef GLenum (GL_APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSOESPROC) (GLenum target); +typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEROESPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DOESPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GL_APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVOESPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params); +typedef void (GL_APIENTRYP PFNGLGENERATEMIPMAPOESPROC) (GLenum target); +#endif + +/* GL_OES_mapbuffer */ +#ifndef GL_OES_mapbuffer +#define GL_OES_mapbuffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void* GL_APIENTRY glMapBufferOES (GLenum target, GLenum access); +GL_API GLboolean GL_APIENTRY glUnmapBufferOES (GLenum target); +GL_API void GL_APIENTRY glGetBufferPointervOES (GLenum target, GLenum pname, void** params); +#endif +typedef void* (GL_APIENTRYP PFNGLMAPBUFFEROESPROC) (GLenum target, GLenum access); +typedef GLboolean (GL_APIENTRYP PFNGLUNMAPBUFFEROESPROC) (GLenum target); +typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum pname, void** params); +#endif + +/* GL_OES_matrix_get */ +#ifndef GL_OES_matrix_get +#define GL_OES_matrix_get 1 +#endif + +/* GL_OES_matrix_palette */ +#ifndef GL_OES_matrix_palette +#define GL_OES_matrix_palette 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glCurrentPaletteMatrixOES (GLuint matrixpaletteindex); +GL_API void GL_APIENTRY glLoadPaletteFromModelViewMatrixOES (void); +GL_API void GL_APIENTRY glMatrixIndexPointerOES (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GL_API void GL_APIENTRY glWeightPointerOES (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +#endif +typedef void (GL_APIENTRYP PFNGLCURRENTPALETTEMATRIXOESPROC) (GLuint matrixpaletteindex); +typedef void (GL_APIENTRYP PFNGLLOADPALETTEFROMMODELVIEWMATRIXOESPROC) (void); +typedef void (GL_APIENTRYP PFNGLMATRIXINDEXPOINTEROESPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (GL_APIENTRYP PFNGLWEIGHTPOINTEROESPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +/* GL_OES_packed_depth_stencil */ +#ifndef GL_OES_packed_depth_stencil +#define GL_OES_packed_depth_stencil 1 +#endif + +/* GL_OES_query_matrix */ +#ifndef GL_OES_query_matrix +#define GL_OES_query_matrix 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API GLbitfield GL_APIENTRY glQueryMatrixxOES (GLfixed mantissa[16], GLint exponent[16]); +#endif +typedef GLbitfield (GL_APIENTRYP PFNGLQUERYMATRIXXOESPROC) (GLfixed mantissa[16], GLint exponent[16]); +#endif + +/* GL_OES_rgb8_rgba8 */ +#ifndef GL_OES_rgb8_rgba8 +#define GL_OES_rgb8_rgba8 1 +#endif + +/* GL_OES_single_precision */ +#ifndef GL_OES_single_precision +#define GL_OES_single_precision 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glDepthRangefOES (GLclampf zNear, GLclampf zFar); +GL_API void GL_APIENTRY glFrustumfOES (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); +GL_API void GL_APIENTRY glOrthofOES (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); +GL_API void GL_APIENTRY glClipPlanefOES (GLenum plane, const GLfloat *equation); +GL_API void GL_APIENTRY glGetClipPlanefOES (GLenum pname, GLfloat eqn[4]); +GL_API void GL_APIENTRY glClearDepthfOES (GLclampf depth); +#endif +typedef void (GL_APIENTRYP PFNGLDEPTHRANGEFOESPROC) (GLclampf zNear, GLclampf zFar); +typedef void (GL_APIENTRYP PFNGLFRUSTUMFOESPROC) (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); +typedef void (GL_APIENTRYP PFNGLORTHOFOESPROC) (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); +typedef void (GL_APIENTRYP PFNGLCLIPPLANEFOESPROC) (GLenum plane, const GLfloat *equation); +typedef void (GL_APIENTRYP PFNGLGETCLIPPLANEFOESPROC) (GLenum pname, GLfloat eqn[4]); +typedef void (GL_APIENTRYP PFNGLCLEARDEPTHFOESPROC) (GLclampf depth); +#endif + +/* GL_OES_stencil1 */ +#ifndef GL_OES_stencil1 +#define GL_OES_stencil1 1 +#endif + +/* GL_OES_stencil4 */ +#ifndef GL_OES_stencil4 +#define GL_OES_stencil4 1 +#endif + +/* GL_OES_stencil8 */ +#ifndef GL_OES_stencil8 +#define GL_OES_stencil8 1 +#endif + +/* GL_OES_stencil_wrap */ +#ifndef GL_OES_stencil_wrap +#define GL_OES_stencil_wrap 1 +#endif + +/* GL_OES_texture_cube_map */ +#ifndef GL_OES_texture_cube_map +#define GL_OES_texture_cube_map 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glTexGenfOES (GLenum coord, GLenum pname, GLfloat param); +GL_API void GL_APIENTRY glTexGenfvOES (GLenum coord, GLenum pname, const GLfloat *params); +GL_API void GL_APIENTRY glTexGeniOES (GLenum coord, GLenum pname, GLint param); +GL_API void GL_APIENTRY glTexGenivOES (GLenum coord, GLenum pname, const GLint *params); +GL_API void GL_APIENTRY glTexGenxOES (GLenum coord, GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glTexGenxvOES (GLenum coord, GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glGetTexGenfvOES (GLenum coord, GLenum pname, GLfloat *params); +GL_API void GL_APIENTRY glGetTexGenivOES (GLenum coord, GLenum pname, GLint *params); +GL_API void GL_APIENTRY glGetTexGenxvOES (GLenum coord, GLenum pname, GLfixed *params); +#endif +typedef void (GL_APIENTRYP PFNGLTEXGENFOESPROC) (GLenum coord, GLenum pname, GLfloat param); +typedef void (GL_APIENTRYP PFNGLTEXGENFVOESPROC) (GLenum coord, GLenum pname, const GLfloat *params); +typedef void (GL_APIENTRYP PFNGLTEXGENIOESPROC) (GLenum coord, GLenum pname, GLint param); +typedef void (GL_APIENTRYP PFNGLTEXGENIVOESPROC) (GLenum coord, GLenum pname, const GLint *params); +typedef void (GL_APIENTRYP PFNGLTEXGENXOESPROC) (GLenum coord, GLenum pname, GLfixed param); +typedef void (GL_APIENTRYP PFNGLTEXGENXVOESPROC) (GLenum coord, GLenum pname, const GLfixed *params); +typedef void (GL_APIENTRYP PFNGLGETTEXGENFVOESPROC) (GLenum coord, GLenum pname, GLfloat *params); +typedef void (GL_APIENTRYP PFNGLGETTEXGENIVOESPROC) (GLenum coord, GLenum pname, GLint *params); +typedef void (GL_APIENTRYP PFNGLGETTEXGENXVOESPROC) (GLenum coord, GLenum pname, GLfixed *params); +#endif + +/* GL_OES_texture_env_crossbar */ +#ifndef GL_OES_texture_env_crossbar +#define GL_OES_texture_env_crossbar 1 +#endif + +/* GL_OES_texture_mirrored_repeat */ +#ifndef GL_OES_texture_mirrored_repeat +#define GL_OES_texture_mirrored_repeat 1 +#endif + +/*------------------------------------------------------------------------* + * AMD extension functions + *------------------------------------------------------------------------*/ + +/* GL_AMD_compressed_3DC_texture */ +#ifndef GL_AMD_compressed_3DC_texture +#define GL_AMD_compressed_3DC_texture 1 +#endif + +/* GL_AMD_compressed_ATC_texture */ +#ifndef GL_AMD_compressed_ATC_texture +#define GL_AMD_compressed_ATC_texture 1 +#endif + +/*------------------------------------------------------------------------* + * APPLE extension functions + *------------------------------------------------------------------------*/ + +/* GL_APPLE_texture_2D_limited_npot */ +#ifndef GL_APPLE_texture_2D_limited_npot +#define GL_APPLE_texture_2D_limited_npot 1 +#endif + +/*------------------------------------------------------------------------* + * EXT extension functions + *------------------------------------------------------------------------*/ + +/* GL_EXT_texture_filter_anisotropic */ +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_EXT_texture_filter_anisotropic 1 +#endif + +/* GL_EXT_texture_format_BGRA8888 */ +#ifndef GL_EXT_texture_format_BGRA8888 +#define GL_EXT_texture_format_BGRA8888 1 +#endif + +/* GL_EXT_texture_lod_bias */ +#ifndef GL_EXT_texture_lod_bias +#define GL_EXT_texture_lod_bias 1 +#endif + +/* GL_EXT_discard_framebuffer */ +#ifndef GL_EXT_discard_framebuffer +#define GL_EXT_discard_framebuffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glDiscardFramebufferEXT (GLenum target, GLsizei numAttachments, const GLenum *attachments); +#endif +typedef void (GL_APIENTRYP PFNGLDISCARDFRAMEBUFFEREXTPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments); +#endif + +/* GL_EXT_blend_minmax */ +#ifndef GL_EXT_blend_minmax +#define GL_EXT_blend_minmax 1 +#endif + +/*------------------------------------------------------------------------* + * IMG extension functions + *------------------------------------------------------------------------*/ + +/* GL_IMG_read_format */ +#ifndef GL_IMG_read_format +#define GL_IMG_read_format 1 +#endif + +/* GL_IMG_texture_compression_pvrtc */ +#ifndef GL_IMG_texture_compression_pvrtc +#define GL_IMG_texture_compression_pvrtc 1 +#endif + +/* GL_IMG_user_clip_plane */ +#ifndef GL_IMG_user_clip_plane +#define GL_IMG_user_clip_plane 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glClipPlanefIMG (GLenum, const GLfloat *); +GL_API void GL_APIENTRY glClipPlanexIMG (GLenum, const GLfixed *); +#endif +typedef void (GL_APIENTRYP PFNGLCLIPPLANEFIMGPROC) (GLenum p, const GLfloat *eqn); +typedef void (GL_APIENTRYP PFNGLCLIPPLANEXIMGPROC) (GLenum p, const GLfixed *eqn); +#endif + +/* GL_IMG_texture_env_enhanced_fixed_function */ +#ifndef GL_IMG_texture_env_enhanced_fixed_function +#define GL_IMG_texture_env_enhanced_fixed_function 1 +#endif + +/*------------------------------------------------------------------------* + * NV extension functions + *------------------------------------------------------------------------*/ + +/* NV_fence */ +#ifndef GL_NV_fence +#define GL_NV_fence 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glDeleteFencesNV (GLsizei, const GLuint *); +GL_API void GL_APIENTRY glGenFencesNV (GLsizei, GLuint *); +GL_API GLboolean GL_APIENTRY glIsFenceNV (GLuint); +GL_API GLboolean GL_APIENTRY glTestFenceNV (GLuint); +GL_API void GL_APIENTRY glGetFenceivNV (GLuint, GLenum, GLint *); +GL_API void GL_APIENTRY glFinishFenceNV (GLuint); +GL_API void GL_APIENTRY glSetFenceNV (GLuint, GLenum); +#endif +typedef void (GL_APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences); +typedef void (GL_APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences); +typedef GLboolean (GL_APIENTRYP PFNGLISFENCENVPROC) (GLuint fence); +typedef GLboolean (GL_APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence); +typedef void (GL_APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params); +typedef void (GL_APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence); +typedef void (GL_APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); +#endif + +/*------------------------------------------------------------------------* + * QCOM extension functions + *------------------------------------------------------------------------*/ + +/* GL_QCOM_driver_control */ +#ifndef GL_QCOM_driver_control +#define GL_QCOM_driver_control 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glGetDriverControlsQCOM (GLint *num, GLsizei size, GLuint *driverControls); +GL_API void GL_APIENTRY glGetDriverControlStringQCOM (GLuint driverControl, GLsizei bufSize, GLsizei *length, char *driverControlString); +GL_API void GL_APIENTRY glEnableDriverControlQCOM (GLuint driverControl); +GL_API void GL_APIENTRY glDisableDriverControlQCOM (GLuint driverControl); +#endif +typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSQCOMPROC) (GLint *num, GLsizei size, GLuint *driverControls); +typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSTRINGQCOMPROC) (GLuint driverControl, GLsizei bufSize, GLsizei *length, char *driverControlString); +typedef void (GL_APIENTRYP PFNGLENABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl); +typedef void (GL_APIENTRYP PFNGLDISABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl); +#endif + +/* GL_QCOM_perfmon_global_mode */ +#ifndef GL_QCOM_perfmon_global_mode +#define GL_QCOM_perfmon_global_mode 1 +#endif + +/* GL_QCOM_writeonly_rendering */ +#ifndef GL_QCOM_writeonly_rendering +#define GL_QCOM_writeonly_rendering 1 +#endif + +/* GL_QCOM_extended_get */ +#ifndef GL_QCOM_extended_get +#define GL_QCOM_extended_get 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glExtGetTexturesQCOM (GLuint *textures, GLint maxTextures, GLint *numTextures); +GL_API void GL_APIENTRY glExtGetBuffersQCOM (GLuint *buffers, GLint maxBuffers, GLint *numBuffers); +GL_API void GL_APIENTRY glExtGetRenderbuffersQCOM (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers); +GL_API void GL_APIENTRY glExtGetFramebuffersQCOM (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers); +GL_API void GL_APIENTRY glExtGetTexLevelParameterivQCOM (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params); +GL_API void GL_APIENTRY glExtTexObjectStateOverrideiQCOM (GLenum target, GLenum pname, GLint param); +GL_API void GL_APIENTRY glExtGetTexSubImageQCOM (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, void *texels); +GL_API void GL_APIENTRY glExtGetBufferPointervQCOM (GLenum target, void **params); +#endif +typedef void (GL_APIENTRYP PFNGLEXTGETTEXTURESQCOMPROC) (GLuint *textures, GLint maxTextures, GLint *numTextures); +typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERSQCOMPROC) (GLuint *buffers, GLint maxBuffers, GLint *numBuffers); +typedef void (GL_APIENTRYP PFNGLEXTGETRENDERBUFFERSQCOMPROC) (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers); +typedef void (GL_APIENTRYP PFNGLEXTGETFRAMEBUFFERSQCOMPROC) (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers); +typedef void (GL_APIENTRYP PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC) (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params); +typedef void (GL_APIENTRYP PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC) (GLenum target, GLenum pname, GLint param); +typedef void (GL_APIENTRYP PFNGLEXTGETTEXSUBIMAGEQCOMPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, void *texels); +typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERPOINTERVQCOMPROC) (GLenum target, void **params); +#endif + +/* GL_QCOM_extended_get2 */ +#ifndef GL_QCOM_extended_get2 +#define GL_QCOM_extended_get2 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glExtGetShadersQCOM (GLuint *shaders, GLint maxShaders, GLint *numShaders); +GL_API void GL_APIENTRY glExtGetProgramsQCOM (GLuint *programs, GLint maxPrograms, GLint *numPrograms); +GL_API void GL_APIENTRY glExtIsProgramBinaryQCOM (GLuint program); +GL_API void GL_APIENTRY glExtGetProgramBinarySourceQCOM (GLuint program, GLenum shadertype, char *source, GLint *length); +#endif +typedef void (GL_APIENTRYP PFNGLEXTGETSHADERSQCOMPROC) (GLuint *shaders, GLint maxShaders, GLint *numShaders); +typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMSQCOMPROC) (GLuint *programs, GLint maxPrograms, GLint *numPrograms); +typedef void (GL_APIENTRYP PFNGLEXTISPROGRAMBINARYQCOMPROC) (GLuint program); +typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC) (GLuint program, GLenum shadertype, char *source, GLint *length); +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* __glext_h_ */ + diff --git a/include/GLES/glplatform.h b/include/GLES/glplatform.h new file mode 100755 index 0000000..83d936a --- /dev/null +++ b/include/GLES/glplatform.h @@ -0,0 +1,29 @@ +#ifndef __glplatform_h_ +#define __glplatform_h_ + +/* $Revision: 7172 $ on $Date:: 2009-01-09 11:17:41 -0800 #$ */ + +/* + * This document is licensed under the SGI Free Software B License Version + * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ . + */ + +/* Platform-specific types and definitions for OpenGL ES 1.X gl.h + * Last modified on 2008/12/19 + * + * Adopters may modify khrplatform.h and this file to suit their platform. + * You are encouraged to submit all modifications to the Khronos group so that + * they can be included in future versions of this file. Please submit changes + * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla) + * by filing a bug against product "OpenGL-ES" component "Registry". + */ + +#include <KHR/khrplatform.h> + +#ifndef GL_API +#define GL_API KHRONOS_APICALL +#endif + +#define GL_APIENTRY KHRONOS_APIENTRY + +#endif /* __glplatform_h_ */ diff --git a/include/GLES2/gl2.h b/include/GLES2/gl2.h new file mode 100755 index 0000000..8309074 --- /dev/null +++ b/include/GLES2/gl2.h @@ -0,0 +1,620 @@ +#ifndef __gl2_h_ +#define __gl2_h_ + +/* $Revision: 7173 $ on $Date:: 2009-01-09 11:18:21 -0800 #$ */ + +#include <GLES2/gl2platform.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * This document is licensed under the SGI Free Software B License Version + * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ . + */ + +/*------------------------------------------------------------------------- + * Data type definitions + *-----------------------------------------------------------------------*/ + +typedef void GLvoid; +typedef unsigned int GLenum; +typedef unsigned char GLboolean; +typedef unsigned int GLbitfield; +typedef khronos_int8_t GLbyte; +typedef short GLshort; +typedef int GLint; +typedef int GLsizei; +typedef khronos_uint8_t GLubyte; +typedef unsigned short GLushort; +typedef unsigned int GLuint; +typedef khronos_float_t GLfloat; +typedef khronos_float_t GLclampf; +typedef khronos_int32_t GLfixed; + +/* GL types for handling large vertex buffer objects */ +typedef khronos_intptr_t GLintptr; +typedef khronos_ssize_t GLsizeiptr; + +/* OpenGL ES core versions */ +#define GL_ES_VERSION_2_0 1 + +/* ClearBufferMask */ +#define GL_DEPTH_BUFFER_BIT 0x00000100 +#define GL_STENCIL_BUFFER_BIT 0x00000400 +#define GL_COLOR_BUFFER_BIT 0x00004000 + +/* Boolean */ +#define GL_FALSE 0 +#define GL_TRUE 1 + +/* BeginMode */ +#define GL_POINTS 0x0000 +#define GL_LINES 0x0001 +#define GL_LINE_LOOP 0x0002 +#define GL_LINE_STRIP 0x0003 +#define GL_TRIANGLES 0x0004 +#define GL_TRIANGLE_STRIP 0x0005 +#define GL_TRIANGLE_FAN 0x0006 + +/* AlphaFunction (not supported in ES20) */ +/* GL_NEVER */ +/* GL_LESS */ +/* GL_EQUAL */ +/* GL_LEQUAL */ +/* GL_GREATER */ +/* GL_NOTEQUAL */ +/* GL_GEQUAL */ +/* GL_ALWAYS */ + +/* BlendingFactorDest */ +#define GL_ZERO 0 +#define GL_ONE 1 +#define GL_SRC_COLOR 0x0300 +#define GL_ONE_MINUS_SRC_COLOR 0x0301 +#define GL_SRC_ALPHA 0x0302 +#define GL_ONE_MINUS_SRC_ALPHA 0x0303 +#define GL_DST_ALPHA 0x0304 +#define GL_ONE_MINUS_DST_ALPHA 0x0305 + +/* BlendingFactorSrc */ +/* GL_ZERO */ +/* GL_ONE */ +#define GL_DST_COLOR 0x0306 +#define GL_ONE_MINUS_DST_COLOR 0x0307 +#define GL_SRC_ALPHA_SATURATE 0x0308 +/* GL_SRC_ALPHA */ +/* GL_ONE_MINUS_SRC_ALPHA */ +/* GL_DST_ALPHA */ +/* GL_ONE_MINUS_DST_ALPHA */ + +/* BlendEquationSeparate */ +#define GL_FUNC_ADD 0x8006 +#define GL_BLEND_EQUATION 0x8009 +#define GL_BLEND_EQUATION_RGB 0x8009 /* same as BLEND_EQUATION */ +#define GL_BLEND_EQUATION_ALPHA 0x883D + +/* BlendSubtract */ +#define GL_FUNC_SUBTRACT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT 0x800B + +/* Separate Blend Functions */ +#define GL_BLEND_DST_RGB 0x80C8 +#define GL_BLEND_SRC_RGB 0x80C9 +#define GL_BLEND_DST_ALPHA 0x80CA +#define GL_BLEND_SRC_ALPHA 0x80CB +#define GL_CONSTANT_COLOR 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 +#define GL_CONSTANT_ALPHA 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 +#define GL_BLEND_COLOR 0x8005 + +/* Buffer Objects */ +#define GL_ARRAY_BUFFER 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER 0x8893 +#define GL_ARRAY_BUFFER_BINDING 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 + +#define GL_STREAM_DRAW 0x88E0 +#define GL_STATIC_DRAW 0x88E4 +#define GL_DYNAMIC_DRAW 0x88E8 + +#define GL_BUFFER_SIZE 0x8764 +#define GL_BUFFER_USAGE 0x8765 + +#define GL_CURRENT_VERTEX_ATTRIB 0x8626 + +/* CullFaceMode */ +#define GL_FRONT 0x0404 +#define GL_BACK 0x0405 +#define GL_FRONT_AND_BACK 0x0408 + +/* DepthFunction */ +/* GL_NEVER */ +/* GL_LESS */ +/* GL_EQUAL */ +/* GL_LEQUAL */ +/* GL_GREATER */ +/* GL_NOTEQUAL */ +/* GL_GEQUAL */ +/* GL_ALWAYS */ + +/* EnableCap */ +#define GL_TEXTURE_2D 0x0DE1 +#define GL_CULL_FACE 0x0B44 +#define GL_BLEND 0x0BE2 +#define GL_DITHER 0x0BD0 +#define GL_STENCIL_TEST 0x0B90 +#define GL_DEPTH_TEST 0x0B71 +#define GL_SCISSOR_TEST 0x0C11 +#define GL_POLYGON_OFFSET_FILL 0x8037 +#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E +#define GL_SAMPLE_COVERAGE 0x80A0 + +/* ErrorCode */ +#define GL_NO_ERROR 0 +#define GL_INVALID_ENUM 0x0500 +#define GL_INVALID_VALUE 0x0501 +#define GL_INVALID_OPERATION 0x0502 +#define GL_OUT_OF_MEMORY 0x0505 + +/* FrontFaceDirection */ +#define GL_CW 0x0900 +#define GL_CCW 0x0901 + +/* GetPName */ +#define GL_LINE_WIDTH 0x0B21 +#define GL_ALIASED_POINT_SIZE_RANGE 0x846D +#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E +#define GL_CULL_FACE_MODE 0x0B45 +#define GL_FRONT_FACE 0x0B46 +#define GL_DEPTH_RANGE 0x0B70 +#define GL_DEPTH_WRITEMASK 0x0B72 +#define GL_DEPTH_CLEAR_VALUE 0x0B73 +#define GL_DEPTH_FUNC 0x0B74 +#define GL_STENCIL_CLEAR_VALUE 0x0B91 +#define GL_STENCIL_FUNC 0x0B92 +#define GL_STENCIL_FAIL 0x0B94 +#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 +#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 +#define GL_STENCIL_REF 0x0B97 +#define GL_STENCIL_VALUE_MASK 0x0B93 +#define GL_STENCIL_WRITEMASK 0x0B98 +#define GL_STENCIL_BACK_FUNC 0x8800 +#define GL_STENCIL_BACK_FAIL 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 +#define GL_STENCIL_BACK_REF 0x8CA3 +#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 +#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 +#define GL_VIEWPORT 0x0BA2 +#define GL_SCISSOR_BOX 0x0C10 +/* GL_SCISSOR_TEST */ +#define GL_COLOR_CLEAR_VALUE 0x0C22 +#define GL_COLOR_WRITEMASK 0x0C23 +#define GL_UNPACK_ALIGNMENT 0x0CF5 +#define GL_PACK_ALIGNMENT 0x0D05 +#define GL_MAX_TEXTURE_SIZE 0x0D33 +#define GL_MAX_VIEWPORT_DIMS 0x0D3A +#define GL_SUBPIXEL_BITS 0x0D50 +#define GL_RED_BITS 0x0D52 +#define GL_GREEN_BITS 0x0D53 +#define GL_BLUE_BITS 0x0D54 +#define GL_ALPHA_BITS 0x0D55 +#define GL_DEPTH_BITS 0x0D56 +#define GL_STENCIL_BITS 0x0D57 +#define GL_POLYGON_OFFSET_UNITS 0x2A00 +/* GL_POLYGON_OFFSET_FILL */ +#define GL_POLYGON_OFFSET_FACTOR 0x8038 +#define GL_TEXTURE_BINDING_2D 0x8069 +#define GL_SAMPLE_BUFFERS 0x80A8 +#define GL_SAMPLES 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT 0x80AB + +/* GetTextureParameter */ +/* GL_TEXTURE_MAG_FILTER */ +/* GL_TEXTURE_MIN_FILTER */ +/* GL_TEXTURE_WRAP_S */ +/* GL_TEXTURE_WRAP_T */ + +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 + +/* HintMode */ +#define GL_DONT_CARE 0x1100 +#define GL_FASTEST 0x1101 +#define GL_NICEST 0x1102 + +/* HintTarget */ +#define GL_GENERATE_MIPMAP_HINT 0x8192 + +/* DataType */ +#define GL_BYTE 0x1400 +#define GL_UNSIGNED_BYTE 0x1401 +#define GL_SHORT 0x1402 +#define GL_UNSIGNED_SHORT 0x1403 +#define GL_INT 0x1404 +#define GL_UNSIGNED_INT 0x1405 +#define GL_FLOAT 0x1406 +#define GL_FIXED 0x140C + +/* PixelFormat */ +#define GL_DEPTH_COMPONENT 0x1902 +#define GL_ALPHA 0x1906 +#define GL_RGB 0x1907 +#define GL_RGBA 0x1908 +#define GL_LUMINANCE 0x1909 +#define GL_LUMINANCE_ALPHA 0x190A + +/* PixelType */ +/* GL_UNSIGNED_BYTE */ +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 + +/* Shaders */ +#define GL_FRAGMENT_SHADER 0x8B30 +#define GL_VERTEX_SHADER 0x8B31 +#define GL_MAX_VERTEX_ATTRIBS 0x8869 +#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB +#define GL_MAX_VARYING_VECTORS 0x8DFC +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C +#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 +#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD +#define GL_SHADER_TYPE 0x8B4F +#define GL_DELETE_STATUS 0x8B80 +#define GL_LINK_STATUS 0x8B82 +#define GL_VALIDATE_STATUS 0x8B83 +#define GL_ATTACHED_SHADERS 0x8B85 +#define GL_ACTIVE_UNIFORMS 0x8B86 +#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 +#define GL_ACTIVE_ATTRIBUTES 0x8B89 +#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A +#define GL_SHADING_LANGUAGE_VERSION 0x8B8C +#define GL_CURRENT_PROGRAM 0x8B8D + +/* StencilFunction */ +#define GL_NEVER 0x0200 +#define GL_LESS 0x0201 +#define GL_EQUAL 0x0202 +#define GL_LEQUAL 0x0203 +#define GL_GREATER 0x0204 +#define GL_NOTEQUAL 0x0205 +#define GL_GEQUAL 0x0206 +#define GL_ALWAYS 0x0207 + +/* StencilOp */ +/* GL_ZERO */ +#define GL_KEEP 0x1E00 +#define GL_REPLACE 0x1E01 +#define GL_INCR 0x1E02 +#define GL_DECR 0x1E03 +#define GL_INVERT 0x150A +#define GL_INCR_WRAP 0x8507 +#define GL_DECR_WRAP 0x8508 + +/* StringName */ +#define GL_VENDOR 0x1F00 +#define GL_RENDERER 0x1F01 +#define GL_VERSION 0x1F02 +#define GL_EXTENSIONS 0x1F03 + +/* TextureMagFilter */ +#define GL_NEAREST 0x2600 +#define GL_LINEAR 0x2601 + +/* TextureMinFilter */ +/* GL_NEAREST */ +/* GL_LINEAR */ +#define GL_NEAREST_MIPMAP_NEAREST 0x2700 +#define GL_LINEAR_MIPMAP_NEAREST 0x2701 +#define GL_NEAREST_MIPMAP_LINEAR 0x2702 +#define GL_LINEAR_MIPMAP_LINEAR 0x2703 + +/* TextureParameterName */ +#define GL_TEXTURE_MAG_FILTER 0x2800 +#define GL_TEXTURE_MIN_FILTER 0x2801 +#define GL_TEXTURE_WRAP_S 0x2802 +#define GL_TEXTURE_WRAP_T 0x2803 + +/* TextureTarget */ +/* GL_TEXTURE_2D */ +#define GL_TEXTURE 0x1702 + +#define GL_TEXTURE_CUBE_MAP 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C + +/* TextureUnit */ +#define GL_TEXTURE0 0x84C0 +#define GL_TEXTURE1 0x84C1 +#define GL_TEXTURE2 0x84C2 +#define GL_TEXTURE3 0x84C3 +#define GL_TEXTURE4 0x84C4 +#define GL_TEXTURE5 0x84C5 +#define GL_TEXTURE6 0x84C6 +#define GL_TEXTURE7 0x84C7 +#define GL_TEXTURE8 0x84C8 +#define GL_TEXTURE9 0x84C9 +#define GL_TEXTURE10 0x84CA +#define GL_TEXTURE11 0x84CB +#define GL_TEXTURE12 0x84CC +#define GL_TEXTURE13 0x84CD +#define GL_TEXTURE14 0x84CE +#define GL_TEXTURE15 0x84CF +#define GL_TEXTURE16 0x84D0 +#define GL_TEXTURE17 0x84D1 +#define GL_TEXTURE18 0x84D2 +#define GL_TEXTURE19 0x84D3 +#define GL_TEXTURE20 0x84D4 +#define GL_TEXTURE21 0x84D5 +#define GL_TEXTURE22 0x84D6 +#define GL_TEXTURE23 0x84D7 +#define GL_TEXTURE24 0x84D8 +#define GL_TEXTURE25 0x84D9 +#define GL_TEXTURE26 0x84DA +#define GL_TEXTURE27 0x84DB +#define GL_TEXTURE28 0x84DC +#define GL_TEXTURE29 0x84DD +#define GL_TEXTURE30 0x84DE +#define GL_TEXTURE31 0x84DF +#define GL_ACTIVE_TEXTURE 0x84E0 + +/* TextureWrapMode */ +#define GL_REPEAT 0x2901 +#define GL_CLAMP_TO_EDGE 0x812F +#define GL_MIRRORED_REPEAT 0x8370 + +/* Uniform Types */ +#define GL_FLOAT_VEC2 0x8B50 +#define GL_FLOAT_VEC3 0x8B51 +#define GL_FLOAT_VEC4 0x8B52 +#define GL_INT_VEC2 0x8B53 +#define GL_INT_VEC3 0x8B54 +#define GL_INT_VEC4 0x8B55 +#define GL_BOOL 0x8B56 +#define GL_BOOL_VEC2 0x8B57 +#define GL_BOOL_VEC3 0x8B58 +#define GL_BOOL_VEC4 0x8B59 +#define GL_FLOAT_MAT2 0x8B5A +#define GL_FLOAT_MAT3 0x8B5B +#define GL_FLOAT_MAT4 0x8B5C +#define GL_SAMPLER_2D 0x8B5E +#define GL_SAMPLER_CUBE 0x8B60 + +/* Vertex Arrays */ +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A +#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F + +/* Read Format */ +#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B + +/* Shader Source */ +#define GL_COMPILE_STATUS 0x8B81 +#define GL_INFO_LOG_LENGTH 0x8B84 +#define GL_SHADER_SOURCE_LENGTH 0x8B88 +#define GL_SHADER_COMPILER 0x8DFA + +/* Shader Binary */ +#define GL_SHADER_BINARY_FORMATS 0x8DF8 +#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 + +/* Shader Precision-Specified Types */ +#define GL_LOW_FLOAT 0x8DF0 +#define GL_MEDIUM_FLOAT 0x8DF1 +#define GL_HIGH_FLOAT 0x8DF2 +#define GL_LOW_INT 0x8DF3 +#define GL_MEDIUM_INT 0x8DF4 +#define GL_HIGH_INT 0x8DF5 + +/* Framebuffer Object. */ +#define GL_FRAMEBUFFER 0x8D40 +#define GL_RENDERBUFFER 0x8D41 + +#define GL_RGBA4 0x8056 +#define GL_RGB5_A1 0x8057 +#define GL_RGB565 0x8D62 +#define GL_DEPTH_COMPONENT16 0x81A5 +#define GL_STENCIL_INDEX 0x1901 +#define GL_STENCIL_INDEX8 0x8D48 + +#define GL_RENDERBUFFER_WIDTH 0x8D42 +#define GL_RENDERBUFFER_HEIGHT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 +#define GL_RENDERBUFFER_RED_SIZE 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 + +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 + +#define GL_COLOR_ATTACHMENT0 0x8CE0 +#define GL_DEPTH_ATTACHMENT 0x8D00 +#define GL_STENCIL_ATTACHMENT 0x8D20 + +#define GL_NONE 0 + +#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9 +#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD + +#define GL_FRAMEBUFFER_BINDING 0x8CA6 +#define GL_RENDERBUFFER_BINDING 0x8CA7 +#define GL_MAX_RENDERBUFFER_SIZE 0x84E8 + +#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 + +/*------------------------------------------------------------------------- + * GL core functions. + *-----------------------------------------------------------------------*/ + +GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture); +GL_APICALL void GL_APIENTRY glAttachShader (GLuint program, GLuint shader); +GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const char* name); +GL_APICALL void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer); +GL_APICALL void GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer); +GL_APICALL void GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer); +GL_APICALL void GL_APIENTRY glBindTexture (GLenum target, GLuint texture); +GL_APICALL void GL_APIENTRY glBlendColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +GL_APICALL void GL_APIENTRY glBlendEquation ( GLenum mode ); +GL_APICALL void GL_APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha); +GL_APICALL void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor); +GL_APICALL void GL_APIENTRY glBlendFuncSeparate (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const void* data, GLenum usage); +GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void* data); +GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus (GLenum target); +GL_APICALL void GL_APIENTRY glClear (GLbitfield mask); +GL_APICALL void GL_APIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +GL_APICALL void GL_APIENTRY glClearDepthf (GLclampf depth); +GL_APICALL void GL_APIENTRY glClearStencil (GLint s); +GL_APICALL void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +GL_APICALL void GL_APIENTRY glCompileShader (GLuint shader); +GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data); +GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data); +GL_APICALL void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GL_APICALL void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GL_APICALL GLuint GL_APIENTRY glCreateProgram (void); +GL_APICALL GLuint GL_APIENTRY glCreateShader (GLenum type); +GL_APICALL void GL_APIENTRY glCullFace (GLenum mode); +GL_APICALL void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint* buffers); +GL_APICALL void GL_APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint* framebuffers); +GL_APICALL void GL_APIENTRY glDeleteProgram (GLuint program); +GL_APICALL void GL_APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint* renderbuffers); +GL_APICALL void GL_APIENTRY glDeleteShader (GLuint shader); +GL_APICALL void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint* textures); +GL_APICALL void GL_APIENTRY glDepthFunc (GLenum func); +GL_APICALL void GL_APIENTRY glDepthMask (GLboolean flag); +GL_APICALL void GL_APIENTRY glDepthRangef (GLclampf zNear, GLclampf zFar); +GL_APICALL void GL_APIENTRY glDetachShader (GLuint program, GLuint shader); +GL_APICALL void GL_APIENTRY glDisable (GLenum cap); +GL_APICALL void GL_APIENTRY glDisableVertexAttribArray (GLuint index); +GL_APICALL void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count); +GL_APICALL void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const void* indices); +GL_APICALL void GL_APIENTRY glEnable (GLenum cap); +GL_APICALL void GL_APIENTRY glEnableVertexAttribArray (GLuint index); +GL_APICALL void GL_APIENTRY glFinish (void); +GL_APICALL void GL_APIENTRY glFlush (void); +GL_APICALL void GL_APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +GL_APICALL void GL_APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GL_APICALL void GL_APIENTRY glFrontFace (GLenum mode); +GL_APICALL void GL_APIENTRY glGenBuffers (GLsizei n, GLuint* buffers); +GL_APICALL void GL_APIENTRY glGenerateMipmap (GLenum target); +GL_APICALL void GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint* framebuffers); +GL_APICALL void GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint* renderbuffers); +GL_APICALL void GL_APIENTRY glGenTextures (GLsizei n, GLuint* textures); +GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name); +GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name); +GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders); +GL_APICALL int GL_APIENTRY glGetAttribLocation (GLuint program, const char* name); +GL_APICALL void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean* params); +GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint* params); +GL_APICALL GLenum GL_APIENTRY glGetError (void); +GL_APICALL void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat* params); +GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint* params); +GL_APICALL void GL_APIENTRY glGetIntegerv (GLenum pname, GLint* params); +GL_APICALL void GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint* params); +GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufsize, GLsizei* length, char* infolog); +GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint* params); +GL_APICALL void GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint* params); +GL_APICALL void GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog); +GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision); +GL_APICALL void GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufsize, GLsizei* length, char* source); +GL_APICALL const GLubyte* GL_APIENTRY glGetString (GLenum name); +GL_APICALL void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat* params); +GL_APICALL void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint* params); +GL_APICALL void GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat* params); +GL_APICALL void GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint* params); +GL_APICALL int GL_APIENTRY glGetUniformLocation (GLuint program, const char* name); +GL_APICALL void GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat* params); +GL_APICALL void GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint* params); +GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, void** pointer); +GL_APICALL void GL_APIENTRY glHint (GLenum target, GLenum mode); +GL_APICALL GLboolean GL_APIENTRY glIsBuffer (GLuint buffer); +GL_APICALL GLboolean GL_APIENTRY glIsEnabled (GLenum cap); +GL_APICALL GLboolean GL_APIENTRY glIsFramebuffer (GLuint framebuffer); +GL_APICALL GLboolean GL_APIENTRY glIsProgram (GLuint program); +GL_APICALL GLboolean GL_APIENTRY glIsRenderbuffer (GLuint renderbuffer); +GL_APICALL GLboolean GL_APIENTRY glIsShader (GLuint shader); +GL_APICALL GLboolean GL_APIENTRY glIsTexture (GLuint texture); +GL_APICALL void GL_APIENTRY glLineWidth (GLfloat width); +GL_APICALL void GL_APIENTRY glLinkProgram (GLuint program); +GL_APICALL void GL_APIENTRY glPixelStorei (GLenum pname, GLint param); +GL_APICALL void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units); +GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels); +GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void); +GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +GL_APICALL void GL_APIENTRY glSampleCoverage (GLclampf value, GLboolean invert); +GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height); +GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length); +GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const char** string, const GLint* length); +GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask); +GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask); +GL_APICALL void GL_APIENTRY glStencilMask (GLuint mask); +GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask); +GL_APICALL void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass); +GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum fail, GLenum zfail, GLenum zpass); +GL_APICALL void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels); +GL_APICALL void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param); +GL_APICALL void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat* params); +GL_APICALL void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param); +GL_APICALL void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint* params); +GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels); +GL_APICALL void GL_APIENTRY glUniform1f (GLint location, GLfloat x); +GL_APICALL void GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat* v); +GL_APICALL void GL_APIENTRY glUniform1i (GLint location, GLint x); +GL_APICALL void GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint* v); +GL_APICALL void GL_APIENTRY glUniform2f (GLint location, GLfloat x, GLfloat y); +GL_APICALL void GL_APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat* v); +GL_APICALL void GL_APIENTRY glUniform2i (GLint location, GLint x, GLint y); +GL_APICALL void GL_APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint* v); +GL_APICALL void GL_APIENTRY glUniform3f (GLint location, GLfloat x, GLfloat y, GLfloat z); +GL_APICALL void GL_APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat* v); +GL_APICALL void GL_APIENTRY glUniform3i (GLint location, GLint x, GLint y, GLint z); +GL_APICALL void GL_APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint* v); +GL_APICALL void GL_APIENTRY glUniform4f (GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GL_APICALL void GL_APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat* v); +GL_APICALL void GL_APIENTRY glUniform4i (GLint location, GLint x, GLint y, GLint z, GLint w); +GL_APICALL void GL_APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint* v); +GL_APICALL void GL_APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +GL_APICALL void GL_APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +GL_APICALL void GL_APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +GL_APICALL void GL_APIENTRY glUseProgram (GLuint program); +GL_APICALL void GL_APIENTRY glValidateProgram (GLuint program); +GL_APICALL void GL_APIENTRY glVertexAttrib1f (GLuint indx, GLfloat x); +GL_APICALL void GL_APIENTRY glVertexAttrib1fv (GLuint indx, const GLfloat* values); +GL_APICALL void GL_APIENTRY glVertexAttrib2f (GLuint indx, GLfloat x, GLfloat y); +GL_APICALL void GL_APIENTRY glVertexAttrib2fv (GLuint indx, const GLfloat* values); +GL_APICALL void GL_APIENTRY glVertexAttrib3f (GLuint indx, GLfloat x, GLfloat y, GLfloat z); +GL_APICALL void GL_APIENTRY glVertexAttrib3fv (GLuint indx, const GLfloat* values); +GL_APICALL void GL_APIENTRY glVertexAttrib4f (GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint indx, const GLfloat* values); +GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr); +GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height); + +#ifdef __cplusplus +} +#endif + +#endif /* __gl2_h_ */ diff --git a/include/GLES2/gl2ext.h b/include/GLES2/gl2ext.h new file mode 100755 index 0000000..b9a3847 --- /dev/null +++ b/include/GLES2/gl2ext.h @@ -0,0 +1,518 @@ +#ifndef __gl2ext_h_ +#define __gl2ext_h_ + +/* $Revision: 8271 $ on $Date:: 2009-05-21 09:33:40 -0700 #$ */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * This document is licensed under the SGI Free Software B License Version + * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ . + */ + +#ifndef GL_APIENTRYP +# define GL_APIENTRYP GL_APIENTRY* +#endif + +/*------------------------------------------------------------------------* + * OES extension tokens + *------------------------------------------------------------------------*/ + +/* GL_OES_compressed_ETC1_RGB8_texture */ +#ifndef GL_OES_compressed_ETC1_RGB8_texture +#define GL_ETC1_RGB8_OES 0x8D64 +#endif + +/* GL_OES_compressed_paletted_texture */ +#ifndef GL_OES_compressed_paletted_texture +#define GL_PALETTE4_RGB8_OES 0x8B90 +#define GL_PALETTE4_RGBA8_OES 0x8B91 +#define GL_PALETTE4_R5_G6_B5_OES 0x8B92 +#define GL_PALETTE4_RGBA4_OES 0x8B93 +#define GL_PALETTE4_RGB5_A1_OES 0x8B94 +#define GL_PALETTE8_RGB8_OES 0x8B95 +#define GL_PALETTE8_RGBA8_OES 0x8B96 +#define GL_PALETTE8_R5_G6_B5_OES 0x8B97 +#define GL_PALETTE8_RGBA4_OES 0x8B98 +#define GL_PALETTE8_RGB5_A1_OES 0x8B99 +#endif + +/* GL_OES_depth24 */ +#ifndef GL_OES_depth24 +#define GL_DEPTH_COMPONENT24_OES 0x81A6 +#endif + +/* GL_OES_depth32 */ +#ifndef GL_OES_depth32 +#define GL_DEPTH_COMPONENT32_OES 0x81A7 +#endif + +/* GL_OES_depth_texture */ +/* No new tokens introduced by this extension. */ + +/* GL_OES_EGL_image */ +#ifndef GL_OES_EGL_image +typedef void* GLeglImageOES; +#endif + +/* GL_OES_get_program_binary */ +#ifndef GL_OES_get_program_binary +#define GL_PROGRAM_BINARY_LENGTH_OES 0x8741 +#define GL_NUM_PROGRAM_BINARY_FORMATS_OES 0x87FE +#define GL_PROGRAM_BINARY_FORMATS_OES 0x87FF +#endif + +/* GL_OES_mapbuffer */ +#ifndef GL_OES_mapbuffer +#define GL_WRITE_ONLY_OES 0x88B9 +#define GL_BUFFER_ACCESS_OES 0x88BB +#define GL_BUFFER_MAPPED_OES 0x88BC +#define GL_BUFFER_MAP_POINTER_OES 0x88BD +#endif + +/* GL_OES_packed_depth_stencil */ +#ifndef GL_OES_packed_depth_stencil +#define GL_DEPTH_STENCIL_OES 0x84F9 +#define GL_UNSIGNED_INT_24_8_OES 0x84FA +#define GL_DEPTH24_STENCIL8_OES 0x88F0 +#endif + +/* GL_OES_rgb8_rgba8 */ +#ifndef GL_OES_rgb8_rgba8 +#define GL_RGB8_OES 0x8051 +#define GL_RGBA8_OES 0x8058 +#endif + +/* GL_OES_standard_derivatives */ +#ifndef GL_OES_standard_derivatives +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES 0x8B8B +#endif + +/* GL_OES_stencil1 */ +#ifndef GL_OES_stencil1 +#define GL_STENCIL_INDEX1_OES 0x8D46 +#endif + +/* GL_OES_stencil4 */ +#ifndef GL_OES_stencil4 +#define GL_STENCIL_INDEX4_OES 0x8D47 +#endif + +/* GL_OES_texture3D */ +#ifndef GL_OES_texture3D +#define GL_TEXTURE_WRAP_R_OES 0x8072 +#define GL_TEXTURE_3D_OES 0x806F +#define GL_TEXTURE_BINDING_3D_OES 0x806A +#define GL_MAX_3D_TEXTURE_SIZE_OES 0x8073 +#define GL_SAMPLER_3D_OES 0x8B5F +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES 0x8CD4 +#endif + +/* GL_OES_texture_half_float */ +#ifndef GL_OES_texture_half_float +#define GL_HALF_FLOAT_OES 0x8D61 +#endif + +/* GL_OES_vertex_half_float */ +/* GL_HALF_FLOAT_OES defined in GL_OES_texture_half_float already. */ + +/* GL_OES_vertex_type_10_10_10_2 */ +#ifndef GL_OES_vertex_type_10_10_10_2 +#define GL_UNSIGNED_INT_10_10_10_2_OES 0x8DF6 +#define GL_INT_10_10_10_2_OES 0x8DF7 +#endif + +/*------------------------------------------------------------------------* + * AMD extension tokens + *------------------------------------------------------------------------*/ + +/* GL_AMD_compressed_3DC_texture */ +#ifndef GL_AMD_compressed_3DC_texture +#define GL_3DC_X_AMD 0x87F9 +#define GL_3DC_XY_AMD 0x87FA +#endif + +/* GL_AMD_compressed_ATC_texture */ +#ifndef GL_AMD_compressed_ATC_texture +#define GL_ATC_RGB_AMD 0x8C92 +#define GL_ATC_RGBA_EXPLICIT_ALPHA_AMD 0x8C93 +#define GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD 0x87EE +#endif + +/* GL_AMD_program_binary_Z400 */ +#ifndef GL_AMD_program_binary_Z400 +#define GL_Z400_BINARY_AMD 0x8740 +#endif + +/* GL_AMD_performance_monitor */ +#ifndef GL_AMD_performance_monitor +#define GL_COUNTER_TYPE_AMD 0x8BC0 +#define GL_COUNTER_RANGE_AMD 0x8BC1 +#define GL_UNSIGNED_INT64_AMD 0x8BC2 +#define GL_PERCENTAGE_AMD 0x8BC3 +#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4 +#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5 +#define GL_PERFMON_RESULT_AMD 0x8BC6 +#endif + +/*------------------------------------------------------------------------* + * EXT extension tokens + *------------------------------------------------------------------------*/ + +/* GL_EXT_texture_filter_anisotropic */ +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE +#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF +#endif + +/* GL_EXT_texture_type_2_10_10_10_REV */ +#ifndef GL_EXT_texture_type_2_10_10_10_REV +#define GL_UNSIGNED_INT_2_10_10_10_REV_EXT 0x8368 +#endif + +/* GL_EXT_texture_format_BGRA8888 */ +#ifndef GL_EXT_texture_format_BGRA8888 +#define GL_BGRA 0x80E1 +#endif + +/*------------------------------------------------------------------------* + * IMG extension tokens + *------------------------------------------------------------------------*/ + +/* GL_IMG_read_format */ +#ifndef GL_IMG_read_format +#define GL_BGRA 0x80E1 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 +#endif + +/* GL_IMG_texture_compression_pvrtc */ +#ifndef GL_IMG_texture_compression_pvrtc +#define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00 +#define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG 0x8C01 +#define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02 +#define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03 +#endif + +/*------------------------------------------------------------------------* + * NV extension tokens + *------------------------------------------------------------------------*/ + +/* GL_NV_fence */ +#ifndef GL_NV_fence +#define GL_ALL_COMPLETED_NV 0x84F2 +#define GL_FENCE_STATUS_NV 0x84F3 +#define GL_FENCE_CONDITION_NV 0x84F4 +#endif + +/*------------------------------------------------------------------------* + * QCOM extension tokens + *------------------------------------------------------------------------*/ + +/* GL_QCOM_driver_control */ +/* No new tokens introduced by this extension. */ + +/* GL_QCOM_perfmon_global_mode */ +#ifndef GL_QCOM_perfmon_global_mode +#define GL_PERFMON_GLOBAL_MODE_QCOM 0x8FA0 +#endif + +/*------------------------------------------------------------------------* + * End of extension tokens, start of corresponding extension functions + *------------------------------------------------------------------------*/ + +/*------------------------------------------------------------------------* + * OES extension functions + *------------------------------------------------------------------------*/ + +/* GL_OES_compressed_ETC1_RGB8_texture */ +#ifndef GL_OES_compressed_ETC1_RGB8_texture +#define GL_OES_compressed_ETC1_RGB8_texture 1 +#endif + +/* GL_OES_compressed_paletted_texture */ +#ifndef GL_OES_compressed_paletted_texture +#define GL_OES_compressed_paletted_texture 1 +#endif + +/* GL_OES_EGL_image */ +#ifndef GL_OES_EGL_image +#define GL_OES_EGL_image 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image); +GL_APICALL void GL_APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image); +#endif +typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image); +typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image); +#endif + +/* GL_OES_depth24 */ +#ifndef GL_OES_depth24 +#define GL_OES_depth24 1 +#endif + +/* GL_OES_depth32 */ +#ifndef GL_OES_depth32 +#define GL_OES_depth32 1 +#endif + +/* GL_OES_depth_texture */ +#ifndef GL_OES_depth_texture +#define GL_OES_depth_texture 1 +#endif + +/* GL_OES_element_index_uint */ +#ifndef GL_OES_element_index_uint +#define GL_OES_element_index_uint 1 +#endif + +/* GL_OES_fbo_render_mipmap */ +#ifndef GL_OES_fbo_render_mipmap +#define GL_OES_fbo_render_mipmap 1 +#endif + +/* GL_OES_fragment_precision_high */ +#ifndef GL_OES_fragment_precision_high +#define GL_OES_fragment_precision_high 1 +#endif + +/* GL_OES_get_program_binary */ +#ifndef GL_OES_get_program_binary +#define GL_OES_get_program_binary 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glGetProgramBinaryOES (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary); +GL_APICALL void GL_APIENTRY glProgramBinaryOES (GLuint program, GLenum binaryFormat, const void *binary, GLint length); +#endif +typedef void (GL_APIENTRYP PFNGLGETPROGRAMBINARYOESPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary); +typedef void (GL_APIENTRYP PFNGLPROGRAMBINARYOESPROC) (GLuint program, GLenum binaryFormat, const void *binary, GLint length); +#endif + +/* GL_OES_mapbuffer */ +#ifndef GL_OES_mapbuffer +#define GL_OES_mapbuffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void* GL_APIENTRY glMapBufferOES (GLenum target, GLenum access); +GL_APICALL GLboolean GL_APIENTRY glUnmapBufferOES (GLenum target); +GL_APICALL void GL_APIENTRY glGetBufferPointervOES (GLenum target, GLenum pname, void** params); +#endif +typedef void* (GL_APIENTRYP PFNGLMAPBUFFEROESPROC) (GLenum target, GLenum access); +typedef GLboolean (GL_APIENTRYP PFNGLUNMAPBUFFEROESPROC) (GLenum target); +typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum pname, void** params); +#endif + +/* GL_OES_packed_depth_stencil */ +#ifndef GL_OES_packed_depth_stencil +#define GL_OES_packed_depth_stencil 1 +#endif + +/* GL_OES_rgb8_rgba8 */ +#ifndef GL_OES_rgb8_rgba8 +#define GL_OES_rgb8_rgba8 1 +#endif + +/* GL_OES_standard_derivatives */ +#ifndef GL_OES_standard_derivatives +#define GL_OES_standard_derivatives 1 +#endif + +/* GL_OES_stencil1 */ +#ifndef GL_OES_stencil1 +#define GL_OES_stencil1 1 +#endif + +/* GL_OES_stencil4 */ +#ifndef GL_OES_stencil4 +#define GL_OES_stencil4 1 +#endif + +/* GL_OES_texture_3D */ +#ifndef GL_OES_texture_3D +#define GL_OES_texture_3D 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels); +GL_APICALL void GL_APIENTRY glTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels); +GL_APICALL void GL_APIENTRY glCopyTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GL_APICALL void GL_APIENTRY glCompressedTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data); +GL_APICALL void GL_APIENTRY glCompressedTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data); +GL_APICALL void GL_APIENTRY glFramebufferTexture3DOES (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +#endif +typedef void (GL_APIENTRYP PFNGLTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels); +typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels); +typedef void (GL_APIENTRYP PFNGLCOPYTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data); +typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data); +typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DOES) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +#endif + +/* GL_OES_texture_float_linear */ +#ifndef GL_OES_texture_float_linear +#define GL_OES_texture_float_linear 1 +#endif + +/* GL_OES_texture_half_float_linear */ +#ifndef GL_OES_texture_half_float_linear +#define GL_OES_texture_half_float_linear 1 +#endif + +/* GL_OES_texture_float */ +#ifndef GL_OES_texture_float +#define GL_OES_texture_float 1 +#endif + +/* GL_OES_texture_half_float */ +#ifndef GL_OES_texture_half_float +#define GL_OES_texture_half_float 1 +#endif + +/* GL_OES_texture_npot */ +#ifndef GL_OES_texture_npot +#define GL_OES_texture_npot 1 +#endif + +/* GL_OES_vertex_half_float */ +#ifndef GL_OES_vertex_half_float +#define GL_OES_vertex_half_float 1 +#endif + +/* GL_OES_vertex_type_10_10_10_2 */ +#ifndef GL_OES_vertex_type_10_10_10_2 +#define GL_OES_vertex_type_10_10_10_2 1 +#endif + +/*------------------------------------------------------------------------* + * AMD extension functions + *------------------------------------------------------------------------*/ + +/* GL_AMD_compressed_3DC_texture */ +#ifndef GL_AMD_compressed_3DC_texture +#define GL_AMD_compressed_3DC_texture 1 +#endif + +/* GL_AMD_compressed_ATC_texture */ +#ifndef GL_AMD_compressed_ATC_texture +#define GL_AMD_compressed_ATC_texture 1 +#endif + +/* GL_AMD_program_binary_Z400 */ +#ifndef GL_AMD_program_binary_Z400 +#define GL_AMD_program_binary_Z400 1 +#endif + +/* AMD_performance_monitor */ +#ifndef GL_AMD_performance_monitor +#define GL_AMD_performance_monitor 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glGetPerfMonitorGroupsAMD (GLint *numGroups, GLsizei groupsSize, GLuint *groups); +GL_APICALL void GL_APIENTRY glGetPerfMonitorCountersAMD (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); +GL_APICALL void GL_APIENTRY glGetPerfMonitorGroupStringAMD (GLuint group, GLsizei bufSize, GLsizei *length, char *groupString); +GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterStringAMD (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, char *counterString); +GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint group, GLuint counter, GLenum pname, void *data); +GL_APICALL void GL_APIENTRY glGenPerfMonitorsAMD (GLsizei n, GLuint *monitors); +GL_APICALL void GL_APIENTRY glDeletePerfMonitorsAMD (GLsizei n, GLuint *monitors); +GL_APICALL void GL_APIENTRY glSelectPerfMonitorCountersAMD (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList); +GL_APICALL void GL_APIENTRY glBeginPerfMonitorAMD (GLuint monitor); +GL_APICALL void GL_APIENTRY glEndPerfMonitorAMD (GLuint monitor); +GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterDataAMD (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); +#endif +typedef void (GL_APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups); +typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); +typedef void (GL_APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, char *groupString); +typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, char *counterString); +typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, void *data); +typedef void (GL_APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); +typedef void (GL_APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); +typedef void (GL_APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList); +typedef void (GL_APIENTRYP PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor); +typedef void (GL_APIENTRYP PFNGLENDPERFMONITORAMDPROC) (GLuint monitor); +typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); +#endif + +/*------------------------------------------------------------------------* + * EXT extension functions + *------------------------------------------------------------------------*/ + +/* GL_EXT_texture_filter_anisotropic */ +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_EXT_texture_filter_anisotropic 1 +#endif + +/* GL_EXT_texture_type_2_10_10_10_REV */ +#ifndef GL_EXT_texture_type_2_10_10_10_REV +#define GL_EXT_texture_type_2_10_10_10_REV 1 +#endif + +/* GL_EXT_texture_format_BGRA8888 */ +#ifndef GL_EXT_texture_format_BGRA8888 +#define GL_EXT_texture_format_BGRA8888 1 +#endif + +/*------------------------------------------------------------------------* + * IMG extension functions + *------------------------------------------------------------------------*/ + +/* GL_IMG_read_format */ +#ifndef GL_IMG_read_format +#define GL_IMG_read_format 1 +#endif + +/* GL_IMG_texture_compression_pvrtc */ +#ifndef GL_IMG_texture_compression_pvrtc +#define GL_IMG_texture_compression_pvrtc 1 +#endif + +/*------------------------------------------------------------------------* + * NV extension functions + *------------------------------------------------------------------------*/ + +/* GL_NV_fence */ +#ifndef GL_NV_fence +#define GL_NV_fence 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glDeleteFencesNV (GLsizei, const GLuint *); +GL_APICALL void GL_APIENTRY glGenFencesNV (GLsizei, GLuint *); +GL_APICALL GLboolean GL_APIENTRY glIsFenceNV (GLuint); +GL_APICALL GLboolean GL_APIENTRY glTestFenceNV (GLuint); +GL_APICALL void GL_APIENTRY glGetFenceivNV (GLuint, GLenum, GLint *); +GL_APICALL void GL_APIENTRY glFinishFenceNV (GLuint); +GL_APICALL void GL_APIENTRY glSetFenceNV (GLuint, GLenum); +#endif +typedef void (GL_APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences); +typedef void (GL_APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences); +typedef GLboolean (GL_APIENTRYP PFNGLISFENCENVPROC) (GLuint fence); +typedef GLboolean (GL_APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence); +typedef void (GL_APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params); +typedef void (GL_APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence); +typedef void (GL_APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); +#endif + +/*------------------------------------------------------------------------* + * QCOM extension functions + *------------------------------------------------------------------------*/ + +/* GL_QCOM_driver_control */ +#ifndef GL_QCOM_driver_control +#define GL_QCOM_driver_control 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glGetDriverControlsQCOM (GLint *num, GLsizei size, GLuint *driverControls); +GL_APICALL void GL_APIENTRY glGetDriverControlStringQCOM (GLuint driverControl, GLsizei bufSize, GLsizei *length, char *driverControlString); +GL_APICALL void GL_APIENTRY glEnableDriverControlQCOM (GLuint driverControl); +GL_APICALL void GL_APIENTRY glDisableDriverControlQCOM (GLuint driverControl); +#endif +typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSQCOMPROC) (GLint *num, GLsizei size, GLuint *driverControls); +typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSTRINGQCOMPROC) (GLuint driverControl, GLsizei bufSize, GLsizei *length, char *driverControlString); +typedef void (GL_APIENTRYP PFNGLENABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl); +typedef void (GL_APIENTRYP PFNGLDISABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl); +#endif + +/* GL_QCOM_perfmon_global_mode */ +#ifndef GL_QCOM_perfmon_global_mode +#define GL_QCOM_perfmon_global_mode 1 +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* __gl2ext_h_ */ diff --git a/include/GLES2/gl2platform.h b/include/GLES2/gl2platform.h new file mode 100755 index 0000000..3e9036c --- /dev/null +++ b/include/GLES2/gl2platform.h @@ -0,0 +1,29 @@ +#ifndef __gl2platform_h_ +#define __gl2platform_h_ + +/* $Revision: 7173 $ on $Date:: 2009-01-09 11:18:21 -0800 #$ */ + +/* + * This document is licensed under the SGI Free Software B License Version + * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ . + */ + +/* Platform-specific types and definitions for OpenGL ES 2.X gl2.h + * Last modified on 2008/12/19 + * + * Adopters may modify khrplatform.h and this file to suit their platform. + * You are encouraged to submit all modifications to the Khronos group so that + * they can be included in future versions of this file. Please submit changes + * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla) + * by filing a bug against product "OpenGL-ES" component "Registry". + */ + +#include <KHR/khrplatform.h> + +#ifndef GL_APICALL +#define GL_APICALL KHRONOS_APICALL +#endif + +#define GL_APIENTRY KHRONOS_APIENTRY + +#endif /* __gl2platform_h_ */ diff --git a/include/KHR/khrplatform.h b/include/KHR/khrplatform.h new file mode 100755 index 0000000..8341f71 --- /dev/null +++ b/include/KHR/khrplatform.h @@ -0,0 +1,269 @@ +#ifndef __khrplatform_h_ +#define __khrplatform_h_ + +/* +** Copyright (c) 2008-2009 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +/* Khronos platform-specific types and definitions. + * + * $Revision: 7820 $ on $Date: 2009-04-03 13:46:26 -0700 (Fri, 03 Apr 2009) $ + * + * Adopters may modify this file to suit their platform. Adopters are + * encouraged to submit platform specific modifications to the Khronos + * group so that they can be included in future versions of this file. + * Please submit changes by sending them to the public Khronos Bugzilla + * (http://khronos.org/bugzilla) by filing a bug against product + * "Khronos (general)" component "Registry". + * + * A predefined template which fills in some of the bug fields can be + * reached using http://tinyurl.com/khrplatform-h-bugreport, but you + * must create a Bugzilla login first. + * + * + * See the Implementer's Guidelines for information about where this file + * should be located on your system and for more details of its use: + * http://www.khronos.org/registry/implementers_guide.pdf + * + * This file should be included as + * #include <KHR/khrplatform.h> + * by Khronos client API header files that use its types and defines. + * + * The types in khrplatform.h should only be used to define API-specific types. + * + * Types defined in khrplatform.h: + * khronos_int8_t signed 8 bit + * khronos_uint8_t unsigned 8 bit + * khronos_int16_t signed 16 bit + * khronos_uint16_t unsigned 16 bit + * khronos_int32_t signed 32 bit + * khronos_uint32_t unsigned 32 bit + * khronos_int64_t signed 64 bit + * khronos_uint64_t unsigned 64 bit + * khronos_intptr_t signed same number of bits as a pointer + * khronos_uintptr_t unsigned same number of bits as a pointer + * khronos_ssize_t signed size + * khronos_usize_t unsigned size + * khronos_float_t signed 32 bit floating point + * khronos_time_ns_t unsigned 64 bit time in nanoseconds + * khronos_utime_nanoseconds_t unsigned time interval or absolute time in + * nanoseconds + * khronos_stime_nanoseconds_t signed time interval in nanoseconds + * khronos_boolean_enum_t enumerated boolean type. This should + * only be used as a base type when a client API's boolean type is + * an enum. Client APIs which use an integer or other type for + * booleans cannot use this as the base type for their boolean. + * + * Tokens defined in khrplatform.h: + * + * KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values. + * + * KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0. + * KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0. + * + * Calling convention macros defined in this file: + * KHRONOS_APICALL + * KHRONOS_APIENTRY + * KHRONOS_APIATTRIBUTES + * + * These may be used in function prototypes as: + * + * KHRONOS_APICALL void KHRONOS_APIENTRY funcname( + * int arg1, + * int arg2) KHRONOS_APIATTRIBUTES; + */ + +/*------------------------------------------------------------------------- + * Definition of KHRONOS_APICALL + *------------------------------------------------------------------------- + * This precedes the return type of the function in the function prototype. + */ +#if defined(_WIN32) && !defined(__SCITECH_SNAP__) +# define KHRONOS_APICALL __declspec(dllimport) +#elif defined (__SYMBIAN32__) +# define KHRONOS_APICALL IMPORT_C +#else +# define KHRONOS_APICALL +#endif + +/*------------------------------------------------------------------------- + * Definition of KHRONOS_APIENTRY + *------------------------------------------------------------------------- + * This follows the return type of the function and precedes the function + * name in the function prototype. + */ +#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__) + /* Win32 but not WinCE */ +# define KHRONOS_APIENTRY __stdcall +#else +# define KHRONOS_APIENTRY +#endif + +/*------------------------------------------------------------------------- + * Definition of KHRONOS_APIATTRIBUTES + *------------------------------------------------------------------------- + * This follows the closing parenthesis of the function prototype arguments. + */ +#if defined (__ARMCC_2__) +#define KHRONOS_APIATTRIBUTES __softfp +#else +#define KHRONOS_APIATTRIBUTES +#endif + +/*------------------------------------------------------------------------- + * basic type definitions + *-----------------------------------------------------------------------*/ +#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__) + + +/* + * Using <stdint.h> + */ +#include <stdint.h> +typedef int32_t khronos_int32_t; +typedef uint32_t khronos_uint32_t; +typedef int64_t khronos_int64_t; +typedef uint64_t khronos_uint64_t; +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#elif defined(__VMS ) || defined(__sgi) + +/* + * Using <inttypes.h> + */ +#include <inttypes.h> +typedef int32_t khronos_int32_t; +typedef uint32_t khronos_uint32_t; +typedef int64_t khronos_int64_t; +typedef uint64_t khronos_uint64_t; +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#elif defined(_WIN32) && !defined(__SCITECH_SNAP__) + +/* + * Win32 + */ +typedef __int32 khronos_int32_t; +typedef unsigned __int32 khronos_uint32_t; +typedef __int64 khronos_int64_t; +typedef unsigned __int64 khronos_uint64_t; +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#elif defined(__sun__) || defined(__digital__) + +/* + * Sun or Digital + */ +typedef int khronos_int32_t; +typedef unsigned int khronos_uint32_t; +#if defined(__arch64__) || defined(_LP64) +typedef long int khronos_int64_t; +typedef unsigned long int khronos_uint64_t; +#else +typedef long long int khronos_int64_t; +typedef unsigned long long int khronos_uint64_t; +#endif /* __arch64__ */ +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#elif 0 + +/* + * Hypothetical platform with no float or int64 support + */ +typedef int khronos_int32_t; +typedef unsigned int khronos_uint32_t; +#define KHRONOS_SUPPORT_INT64 0 +#define KHRONOS_SUPPORT_FLOAT 0 + +#else + +/* + * Generic fallback + */ +#include <stdint.h> +typedef int32_t khronos_int32_t; +typedef uint32_t khronos_uint32_t; +typedef int64_t khronos_int64_t; +typedef uint64_t khronos_uint64_t; +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#endif + + +/* + * Types that are (so far) the same on all platforms + */ +typedef signed char khronos_int8_t; +typedef unsigned char khronos_uint8_t; +typedef signed short int khronos_int16_t; +typedef unsigned short int khronos_uint16_t; +typedef signed long int khronos_intptr_t; +typedef unsigned long int khronos_uintptr_t; +typedef signed long int khronos_ssize_t; +typedef unsigned long int khronos_usize_t; + +#if KHRONOS_SUPPORT_FLOAT +/* + * Float type + */ +typedef float khronos_float_t; +#endif + +#if KHRONOS_SUPPORT_INT64 +/* Time types + * + * These types can be used to represent a time interval in nanoseconds or + * an absolute Unadjusted System Time. Unadjusted System Time is the number + * of nanoseconds since some arbitrary system event (e.g. since the last + * time the system booted). The Unadjusted System Time is an unsigned + * 64 bit value that wraps back to 0 every 584 years. Time intervals + * may be either signed or unsigned. + */ +typedef khronos_uint64_t khronos_utime_nanoseconds_t; +typedef khronos_int64_t khronos_stime_nanoseconds_t; +#endif + +/* + * Dummy value used to pad enum types to 32 bits. + */ +#ifndef KHRONOS_MAX_ENUM +#define KHRONOS_MAX_ENUM 0x7FFFFFFF +#endif + +/* + * Enumerated boolean type + * + * Values other than zero should be considered to be true. Therefore + * comparisons should not be made against KHRONOS_TRUE. + */ +typedef enum { + KHRONOS_FALSE = 0, + KHRONOS_TRUE = 1, + KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM +} khronos_boolean_enum_t; + +#endif /* __khrplatform_h_ */ diff --git a/lib/libEGL.so b/lib/libEGL.so new file mode 120000 index 0000000..b81a6fd --- /dev/null +++ b/lib/libEGL.so @@ -0,0 +1 @@ +host-gl/libEGL.so.1.0
\ No newline at end of file diff --git a/lib/libEGL.so.1 b/lib/libEGL.so.1 new file mode 120000 index 0000000..b81a6fd --- /dev/null +++ b/lib/libEGL.so.1 @@ -0,0 +1 @@ +host-gl/libEGL.so.1.0
\ No newline at end of file diff --git a/lib/libGL.so b/lib/libGL.so new file mode 120000 index 0000000..3a27339 --- /dev/null +++ b/lib/libGL.so @@ -0,0 +1 @@ +host-gl/libGL.so.1.2
\ No newline at end of file diff --git a/lib/libGL.so.1 b/lib/libGL.so.1 new file mode 120000 index 0000000..3a27339 --- /dev/null +++ b/lib/libGL.so.1 @@ -0,0 +1 @@ +host-gl/libGL.so.1.2
\ No newline at end of file diff --git a/lib/libGL.so.1.0 b/lib/libGL.so.1.0 new file mode 120000 index 0000000..3a27339 --- /dev/null +++ b/lib/libGL.so.1.0 @@ -0,0 +1 @@ +host-gl/libGL.so.1.2
\ No newline at end of file diff --git a/lib/libGLESv1_CM.so b/lib/libGLESv1_CM.so new file mode 120000 index 0000000..eaabe7d --- /dev/null +++ b/lib/libGLESv1_CM.so @@ -0,0 +1 @@ +host-gl/libGLESv1_CM.so.1.0
\ No newline at end of file diff --git a/lib/libGLESv1_CM.so.1 b/lib/libGLESv1_CM.so.1 new file mode 120000 index 0000000..eaabe7d --- /dev/null +++ b/lib/libGLESv1_CM.so.1 @@ -0,0 +1 @@ +host-gl/libGLESv1_CM.so.1.0
\ No newline at end of file diff --git a/lib/libGLESv2.so b/lib/libGLESv2.so new file mode 120000 index 0000000..c3dc772 --- /dev/null +++ b/lib/libGLESv2.so @@ -0,0 +1 @@ +host-gl/libGLESv2.so.1.0
\ No newline at end of file diff --git a/lib/libGLESv2.so.1 b/lib/libGLESv2.so.1 new file mode 120000 index 0000000..c3dc772 --- /dev/null +++ b/lib/libGLESv2.so.1 @@ -0,0 +1 @@ +host-gl/libGLESv2.so.1.0
\ No newline at end of file diff --git a/lib/pkgconfig/gles11.pc b/lib/pkgconfig/gles11.pc new file mode 100644 index 0000000..9e010b1 --- /dev/null +++ b/lib/pkgconfig/gles11.pc @@ -0,0 +1,12 @@ +prefix=/usr +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: Desktop OpenGL ES +Description: Desktop OpenGL ES Library +Version:0.5 + +Libs: -L${libdir} -lEGL -lGLESv1_CM -lX11 -ldl -lm +Cflags: -I${includedir} + diff --git a/lib/pkgconfig/gles20.pc b/lib/pkgconfig/gles20.pc new file mode 100644 index 0000000..451ab9f --- /dev/null +++ b/lib/pkgconfig/gles20.pc @@ -0,0 +1,12 @@ +prefix=/usr +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: Desktop OpenGL ES 2.0 +Description: Desktop OpenGL ES 2.0 Library +Version:0.5 + +Libs: -L${libdir} -lEGL -lGLESv2 -lX11 -ldl -lm +Cflags: -I${includedir} + diff --git a/libGL/Makefile b/libGL/Makefile new file mode 100755 index 0000000..3f5c0d0 --- /dev/null +++ b/libGL/Makefile @@ -0,0 +1,40 @@ +BUILD_CC := gcc +CC = gcc +GL_CFLAGS := -Wall -g -fno-strict-aliasing -O3 + +all: libGL.so.1.2 + +client_gl.o: client_gl.c client_gl.h + $(CC) -fPIC $(GL_CFLAGS) -c client_gl.c -o client_gl.o -I. + +client_glx.o: client_glx.c client_gl.h opengl_client_xfonts.c + $(CC) -fPIC $(GL_CFLAGS) -c client_glx.c -o client_glx.o -I. + +.c.o: + $(CC) -fPIC $(GL_CFLAGS) -c $< -o $@ + +libGL.so.1.2: client_stub.c opengl_client.c glgetv_cst.h opengl_func.h opengl_utils.h mesa_gl.h mesa_glext.h mesa_glx.h mesa_glxext.h client_gl.o log.o opengl_utils.o gl_tables.o client_glx.o range_alloc.o + $(CC) -fPIC $(GL_CFLAGS) opengl_client.c -shared -o libGL.so.1.2 -L$(D)/usr/X11R6/lib -I. client_gl.o log.o opengl_utils.o gl_tables.o client_glx.o range_alloc.o -lX11 -lxcb -lX11-xcb -lXfixes -lm -lXext -lpthread + +opengl_func.h: gl_func.h + +gl_func.h: parse_gl_h mesa_gl.h mesa_glext.h gl_func_perso.h + ./parse_gl_h 2> /dev/null +gl_func_tabs.h: parse_gl_h mesa_gl.h mesa_glext.h gl_func_perso.h + ./parse_gl_h 2> /dev/null +client_stub.c: parse_gl_h mesa_gl.h mesa_glext.h gl_func_perso.h + ./parse_gl_h 2> /dev/null +server_stub.c: parse_gl_h mesa_gl.h mesa_glext.h gl_func_perso.h + ./parse_gl_h 2> /dev/null +glgetv_cst.h: parse_mesa_get_c mesa_get.c mesa_gl.h mesa_glext.h + ./parse_mesa_get_c 2> /dev/null +parse_gl_h: parse_gl_h.c + $(BUILD_CC) -g -o $@ $< +parse_mesa_get_c: parse_mesa_get_c.c mesa_gl.h mesa_glext.h + $(BUILD_CC) -g -o $@ parse_mesa_get_c.c + +install: libGL.so.1.2 + cp libGL.so.1.2 ../lib/host-gl/ + +clean: + rm -f client_stub.c server_stub.c gl_func.h glgetv_cst.h parse_gl_h parse_mesa_get_c *.o gl_func_tabs.h diff --git a/libGL/call.h b/libGL/call.h new file mode 100755 index 0000000..cb4640d --- /dev/null +++ b/libGL/call.h @@ -0,0 +1,29 @@ +/* + * 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. + */ +extern void do_opengl_call_no_lock(int func_number, void* ret_ptr, long* args, int* args_size_opt); + +static inline void do_opengl_call(int func_number, void* ret_ptr, long* args, int* args_size_opt) +{ + LOCK(func_number); + do_opengl_call_no_lock(func_number, ret_ptr, args, args_size_opt); + UNLOCK(func_number); +} diff --git a/libGL/client_gl.c b/libGL/client_gl.c new file mode 100755 index 0000000..4d6805b --- /dev/null +++ b/libGL/client_gl.c @@ -0,0 +1,6688 @@ +/* + * Guest-side implementation of GL/GLX API. Replacement of standard libGL.so + * + * 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. + */ + +#include <stdlib.h> +#include <string.h> +#include <assert.h> +#include <math.h> + +#include "opengl_func.h" +#include "common.h" +#include "lock.h" +#include "call.h" + +#include "client_stub.c" + +#include "glgetv_cst.h" + +#include "log.h" + +extern GLFunctionTable glFuncTable; +GLAPI void APIENTRY glPushAttrib(GLbitfield mask) +{ + GET_CURRENT_STATE(); + long args[] = { UNSIGNED_INT_TO_ARG(mask)}; + if (state->server_sp < MAX_SERVER_STATE_STACK_SIZE) + { + state->server_stack[state->server_sp].mask = mask; + if (mask & GL_ENABLE_BIT) + { + state->server_stack[state->server_sp].linesmoothEnabled = state->current_server_state.linesmoothEnabled; + state->server_stack[state->server_sp].lightingEnabled = state->current_server_state.lightingEnabled; + state->server_stack[state->server_sp].texture2DEnabled = state->current_server_state.texture2DEnabled; + state->server_stack[state->server_sp].blendEnabled = state->current_server_state.blendEnabled; + } + if (mask & GL_TRANSFORM_BIT) + { + state->server_stack[state->server_sp].matrixMode = state->current_server_state.matrixMode; + } + if (mask & GL_DEPTH_BUFFER_BIT) + { + state->server_stack[state->server_sp].depthFunc = state->current_server_state.depthFunc; + } + if (mask & GL_TEXTURE_BIT) + { + state->server_stack[state->server_sp].bindTexture2D = state->current_server_state.bindTexture2D; + state->server_stack[state->server_sp].bindTextureRectangle = state->current_server_state.bindTextureRectangle; + } + if (mask & GL_FOG_BIT) + { + state->server_stack[state->server_sp].fog = state->current_server_state.fog; + } + state->server_sp++; + } + else + { + log_gl("server_sp > MAX_SERVER_STATE_STACK_SIZE\n"); + } + do_opengl_call(glPushAttrib_func, NULL, args, NULL); +} + +GLAPI void APIENTRY glPopAttrib() +{ + GET_CURRENT_STATE(); + if (state->server_sp > 0) + { + state->server_sp--; + if (state->server_stack[state->server_sp].mask & GL_ENABLE_BIT) + { + state->current_server_state.linesmoothEnabled = state->server_stack[state->server_sp].linesmoothEnabled; + state->current_server_state.lightingEnabled = state->server_stack[state->server_sp].lightingEnabled; + state->current_server_state.texture2DEnabled = state->server_stack[state->server_sp].texture2DEnabled; + state->current_server_state.blendEnabled = state->server_stack[state->server_sp].blendEnabled; + } + if (state->server_stack[state->server_sp].mask & GL_TRANSFORM_BIT) + { + state->current_server_state.matrixMode = state->server_stack[state->server_sp].matrixMode; + } + if (state->server_stack[state->server_sp].mask & GL_DEPTH_BUFFER_BIT) + { + state->current_server_state.depthFunc = state->server_stack[state->server_sp].depthFunc; + } + if (state->server_stack[state->server_sp].mask & GL_TEXTURE_BIT) + { + state->current_server_state.bindTexture2D = state->server_stack[state->server_sp].bindTexture2D; + state->current_server_state.bindTextureRectangle = state->server_stack[state->server_sp].bindTextureRectangle; + } + if (state->server_stack[state->server_sp].mask & GL_FOG_BIT) + { + state->current_server_state.fog = state->server_stack[state->server_sp].fog; + } + } + else + { + log_gl("server_sp <= 0\n"); + } + do_opengl_call(glPopAttrib_func, NULL, NULL, NULL); +} + +GLAPI GLboolean APIENTRY glIsEnabled( GLenum cap ) +{ + GLboolean ret = 0; + if (debug_gl) log_gl("glIsEnabled(0x%X)\n", cap); + GET_CURRENT_STATE(); + if (!disable_optim) + { + if (cap == GL_LINE_SMOOTH) + { + return state->current_server_state.linesmoothEnabled; + } + else if (cap == GL_LIGHTING) + { + return state->current_server_state.lightingEnabled; + } + else if (cap == GL_TEXTURE_2D) + { + return state->current_server_state.texture2DEnabled; + } + else if (cap == GL_BLEND) + { + return state->current_server_state.blendEnabled; + } + else if (cap == GL_SCISSOR_TEST) + { + return state->current_server_state.scissorTestEnabled; + } + else if (cap == GL_VERTEX_PROGRAM_NV) + { + return state->current_server_state.vertexProgramEnabled; + } + else if (cap == GL_FOG) + { + return state->current_server_state.fogEnabled; + } + } + long args[] = { INT_TO_ARG(cap) }; + do_opengl_call(glIsEnabled_func, &ret, args, NULL); + if (debug_gl) log_gl("glIsEnabled(0x%X) = %d\n", cap, ret); + return ret; +} + +static ClientArray* _getArray(GLenum cap, int verbose) +{ + GET_CURRENT_STATE(); + switch(cap) + { + case GL_VERTEX_ARRAY: return &state->client_state.arrays.vertexArray; + case GL_COLOR_ARRAY: return &state->client_state.arrays.colorArray; + case GL_SECONDARY_COLOR_ARRAY: return &state->client_state.arrays.secondaryColorArray; + case GL_NORMAL_ARRAY: return &state->client_state.arrays.normalArray; + case GL_INDEX_ARRAY: return &state->client_state.arrays.indexArray; + case GL_TEXTURE_COORD_ARRAY: + return &state->client_state.arrays.texCoordArray[state->client_state.clientActiveTexture]; + case GL_EDGE_FLAG_ARRAY: return &state->client_state.arrays.edgeFlagArray; + case GL_WEIGHT_ARRAY_ARB: return &state->client_state.arrays.weightArray; + case GL_MATRIX_INDEX_ARRAY_POINTER_ARB: return &state->client_state.arrays.matrixIndexArray; + case GL_FOG_COORD_ARRAY: return &state->client_state.arrays.fogCoordArray; + case GL_ELEMENT_ARRAY_ATI: return &state->client_state.arrays.elementArrayATI; + default: + if (cap >= GL_VERTEX_ATTRIB_ARRAY0_NV && cap < GL_VERTEX_ATTRIB_ARRAY0_NV + MY_GL_MAX_VERTEX_ATTRIBS_NV) + return &state->client_state.arrays.vertexAttribArrayNV[cap - GL_VERTEX_ATTRIB_ARRAY0_NV]; + if (verbose) log_gl("unhandled cap : %d\n", cap); return NULL; + } +} + +GLAPI void APIENTRY glEnable(GLenum cap) +{ + GET_CURRENT_STATE(); + /* Strange but some programs use glEnable(GL_VERTEX_ARRAY) + instead of glEnableClientState(GL_VERTEX_ARRAY) ... + I've discovered that while trying to make the spheres demo of chromium running + and mesa confirms it too */ + if (_getArray(cap, 0)) + { + glFuncTable.fpEnableClientState(cap); + return; + } + + if (cap == GL_LINE_SMOOTH) + { + state->current_server_state.linesmoothEnabled = 1; + } + else if (cap == GL_LIGHTING) + { + state->current_server_state.lightingEnabled = 1; + } + else if (cap == GL_TEXTURE_2D) + { + state->current_server_state.texture2DEnabled = 1; + } + else if (cap == GL_BLEND) + { + state->current_server_state.blendEnabled = 1; + } + else if (cap == GL_SCISSOR_TEST) + { + state->current_server_state.scissorTestEnabled = 1; + } + else if (cap == GL_VERTEX_PROGRAM_NV) + { + state->current_server_state.vertexProgramEnabled = 1; + } + else if (cap == GL_FOG) + { + state->current_server_state.fogEnabled = 1; + } + long args[] = { INT_TO_ARG(cap)}; + do_opengl_call(glEnable_func, NULL, args, NULL); +} + +GLAPI void APIENTRY glDisable(GLenum cap) +{ + GET_CURRENT_STATE(); + if (_getArray(cap, 0)) + { + glFuncTable.fpDisableClientState(cap); + return; + } + + if (cap == GL_LINE_SMOOTH) + { + state->current_server_state.linesmoothEnabled = 0; + } + else if (cap == GL_LIGHTING) + { + state->current_server_state.lightingEnabled = 0; + } + else if (cap == GL_TEXTURE_2D) + { + state->current_server_state.texture2DEnabled = 0; + } + else if (cap == GL_BLEND) + { + state->current_server_state.blendEnabled = 0; + } + else if (cap == GL_SCISSOR_TEST) + { + state->current_server_state.scissorTestEnabled = 0; + } + else if (cap == GL_VERTEX_PROGRAM_NV) + { + state->current_server_state.vertexProgramEnabled = 0; + } + else if (cap == GL_FOG) + { + state->current_server_state.fogEnabled = 0; + } + long args[] = { INT_TO_ARG(cap)}; + do_opengl_call(glDisable_func, NULL, args, NULL); +} + +#define GET_CAP_NAME(x) case x: return #x; +static const char* _getArrayName(GLenum cap) +{ + switch (cap) + { + GET_CAP_NAME(GL_VERTEX_ARRAY); + GET_CAP_NAME(GL_COLOR_ARRAY); + GET_CAP_NAME(GL_SECONDARY_COLOR_ARRAY); + GET_CAP_NAME(GL_NORMAL_ARRAY); + GET_CAP_NAME(GL_INDEX_ARRAY); + GET_CAP_NAME(GL_TEXTURE_COORD_ARRAY); + GET_CAP_NAME(GL_EDGE_FLAG_ARRAY); + GET_CAP_NAME(GL_WEIGHT_ARRAY_ARB); + GET_CAP_NAME(GL_MATRIX_INDEX_ARRAY_ARB); + GET_CAP_NAME(GL_FOG_COORD_ARRAY); + GET_CAP_NAME(GL_ELEMENT_ARRAY_ATI); + GET_CAP_NAME(GL_VERTEX_ATTRIB_ARRAY0_NV); + GET_CAP_NAME(GL_VERTEX_ATTRIB_ARRAY1_NV); + GET_CAP_NAME(GL_VERTEX_ATTRIB_ARRAY2_NV); + GET_CAP_NAME(GL_VERTEX_ATTRIB_ARRAY3_NV); + GET_CAP_NAME(GL_VERTEX_ATTRIB_ARRAY4_NV); + GET_CAP_NAME(GL_VERTEX_ATTRIB_ARRAY5_NV); + GET_CAP_NAME(GL_VERTEX_ATTRIB_ARRAY6_NV); + GET_CAP_NAME(GL_VERTEX_ATTRIB_ARRAY7_NV); + GET_CAP_NAME(GL_VERTEX_ATTRIB_ARRAY8_NV); + GET_CAP_NAME(GL_VERTEX_ATTRIB_ARRAY9_NV); + GET_CAP_NAME(GL_VERTEX_ATTRIB_ARRAY10_NV); + GET_CAP_NAME(GL_VERTEX_ATTRIB_ARRAY11_NV); + GET_CAP_NAME(GL_VERTEX_ATTRIB_ARRAY12_NV); + GET_CAP_NAME(GL_VERTEX_ATTRIB_ARRAY13_NV); + GET_CAP_NAME(GL_VERTEX_ATTRIB_ARRAY14_NV); + GET_CAP_NAME(GL_VERTEX_ATTRIB_ARRAY15_NV); + } + return "unknown"; +} + +GLAPI void APIENTRY EXT_FUNC(glEnableVertexAttribArrayARB)(GLuint index) +{ + CHECK_PROC(glEnableVertexAttribArrayARB); + GET_CURRENT_STATE(); + long args[] = { index }; + do_opengl_call(glEnableVertexAttribArrayARB_func, NULL, args, NULL); + + if (index < MY_GL_MAX_VERTEX_ATTRIBS_ARB) + { + state->client_state.arrays.vertexAttribArray[index].enabled = 1; + } + else + { + log_gl("%s: index >= MY_GL_MAX_VERTEX_ATTRIBS_ARB. (index = %d; MAX=%d)\n", + "glEnableVertexAttribArrayARB", + index, MY_GL_MAX_VERTEX_ATTRIBS_ARB); + } +} + +GLAPI void APIENTRY EXT_FUNC(glEnableVertexAttribArray)(GLuint index) +{ + CHECK_PROC(glEnableVertexAttribArray); + GET_CURRENT_STATE(); + long args[] = { index }; + do_opengl_call(glEnableVertexAttribArray_func, NULL, args, NULL); + + if (index < MY_GL_MAX_VERTEX_ATTRIBS_ARB) + { + state->client_state.arrays.vertexAttribArray[index].enabled = 1; + } + else + { + log_gl("%s: index >= MY_GL_MAX_VERTEX_ATTRIBS_ARB. (index = %d; MAX=%d)\n", + "glEnableVertexAttribArray", + index, MY_GL_MAX_VERTEX_ATTRIBS_ARB); + } +} + +GLAPI void APIENTRY EXT_FUNC(glDisableVertexAttribArrayARB)(GLuint index) +{ + CHECK_PROC(glDisableVertexAttribArrayARB); + GET_CURRENT_STATE(); + long args[] = { index }; + do_opengl_call(glDisableVertexAttribArrayARB_func, NULL, args, NULL); + + if (index < MY_GL_MAX_VERTEX_ATTRIBS_ARB) + { + state->client_state.arrays.vertexAttribArray[index].enabled = 0; + } + else + { + log_gl("%s: index >= MY_GL_MAX_VERTEX_ATTRIBS_ARB. (index = %d; MAX=%d)\n", + "1", + index, MY_GL_MAX_VERTEX_ATTRIBS_ARB); + } +} + +GLAPI void APIENTRY EXT_FUNC(glDisableVertexAttribArray)(GLuint index) +{ + CHECK_PROC(glDisableVertexAttribArray); + GET_CURRENT_STATE(); + long args[] = { index }; + do_opengl_call(glDisableVertexAttribArray_func, NULL, args, NULL); + + if (index < MY_GL_MAX_VERTEX_ATTRIBS_ARB) + { + state->client_state.arrays.vertexAttribArray[index].enabled = 0; + } + else + { + log_gl("%s: index >= MY_GL_MAX_VERTEX_ATTRIBS_ARB. (index = %d; MAX=%d)\n", + "2", + index, MY_GL_MAX_VERTEX_ATTRIBS_ARB); + } +} + +GLAPI void APIENTRY glEnableClientState(GLenum cap) +{ + if (cap == GL_VERTEX_ARRAY_RANGE_NV || + cap == GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV) return; /* FIXME */ + GET_CURRENT_STATE(); + ClientArray* array = _getArray(cap, 1); + if (array == NULL) return; + if (debug_array_ptr) + { + if (cap == GL_TEXTURE_COORD_ARRAY) + log_gl("enable texture %d\n", state->client_state.clientActiveTexture); + else + log_gl("enable feature %s\n", _getArrayName(cap)); + } + if ((!disable_optim) && array->enabled) + { + //log_gl("discard useless command\n"); + return; + } + array->enabled = 1; + /*if ((!disable_optim) && cap == GL_TEXTURE_COORD_ARRAY) + { + long args[] = { UNSIGNED_INT_TO_ARG(state->client_state.clientActiveTexture + GL_TEXTURE0_ARB)}; + do_opengl_call(glClientActiveTexture_func, NULL, args, NULL); + }*/ + long args[] = { UNSIGNED_INT_TO_ARG(cap)}; + do_opengl_call(glEnableClientState_func, NULL, args, NULL); +} + +GLAPI void APIENTRY glDisableClientState(GLenum cap) +{ + if (cap == GL_VERTEX_ARRAY_RANGE_NV || + cap == GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV) return; /* FIXME */ + GET_CURRENT_STATE(); + ClientArray* array = _getArray(cap, 1); + if (array == NULL) return; + if (debug_array_ptr) + { + if (cap == GL_TEXTURE_COORD_ARRAY) + log_gl("disable texture %d\n", state->client_state.clientActiveTexture); + else + log_gl("disable feature %s\n", _getArrayName(cap)); + } + + if ((!disable_optim) && array->enabled == 0) + { + //log_gl("discard useless command\n"); + return; + } + array->enabled = 0; + /*if ((!disable_optim) && cap == GL_TEXTURE_COORD_ARRAY) + { + long args[] = { UNSIGNED_INT_TO_ARG(state->client_state.clientActiveTexture + GL_TEXTURE0_ARB)}; + do_opengl_call(glClientActiveTexture_func, NULL, args, NULL); + }*/ + long args[] = { UNSIGNED_INT_TO_ARG(cap)}; + do_opengl_call(glDisableClientState_func, NULL, args, NULL); +} + + +GLAPI void APIENTRY glClientActiveTexture(GLenum texture) +{ + GET_CURRENT_STATE(); + + if (disable_optim || state->client_state.clientActiveTexture != (int)texture - GL_TEXTURE0_ARB) + { + long args[] = { UNSIGNED_INT_TO_ARG(texture)}; + do_opengl_call(glClientActiveTexture_func, NULL, args, NULL); + } + + state->client_state.clientActiveTexture = (int)texture - GL_TEXTURE0_ARB; + + assert(state->client_state.clientActiveTexture >= 0 && + state->client_state.clientActiveTexture < NB_MAX_TEXTURES); +} + +GLAPI void APIENTRY glClientActiveTextureARB(GLenum texture) +{ + glFuncTable.fpClientActiveTexture(texture); +} + +GLAPI void APIENTRY glActiveTextureARB(GLenum texture) +{ + GET_CURRENT_STATE(); + if (disable_optim || state->activeTexture != texture) + { + state->activeTexture = texture; + + long args[] = { INT_TO_ARG(texture) }; + do_opengl_call(glActiveTextureARB_func, NULL, args, NULL); + } +} + +GLAPI void APIENTRY glPushClientAttrib(GLbitfield mask) +{ + GET_CURRENT_STATE(); + long args[] = { UNSIGNED_INT_TO_ARG(mask)}; + if (state->client_state_sp < MAX_CLIENT_STATE_STACK_SIZE) + { + state->client_state_stack[state->client_state_sp].mask = mask; + if (mask & GL_CLIENT_VERTEX_ARRAY_BIT) + { + state->client_state_stack[state->client_state_sp].arrays = state->client_state.arrays; + } + if (mask & GL_CLIENT_PIXEL_STORE_BIT) + { + state->client_state_stack[state->client_state_sp].pack = state->client_state.pack; + state->client_state_stack[state->client_state_sp].unpack = state->client_state.unpack; + } + state->client_state_sp++; + } + else + { + log_gl("state->client_state_sp > MAX_CLIENT_STATE_STACK_SIZE\n"); + } + do_opengl_call(glPushClientAttrib_func, NULL, args, NULL); +} + +GLAPI void APIENTRY glPopClientAttrib() +{ + GET_CURRENT_STATE(); + if (state->client_state_sp > 0) + { + state->client_state_sp--; + if (state->client_state_stack[state->client_state_sp].mask & GL_CLIENT_VERTEX_ARRAY_BIT) + { + state->client_state.arrays = state->client_state_stack[state->client_state_sp].arrays; + } + if (state->client_state_stack[state->client_state_sp].mask & GL_CLIENT_PIXEL_STORE_BIT) + { + state->client_state.pack = state->client_state_stack[state->client_state_sp].pack; + state->client_state.unpack = state->client_state_stack[state->client_state_sp].unpack; + } + } + else + { + log_gl("state->client_state_sp <= 0\n"); + } + do_opengl_call(glPopClientAttrib_func, NULL, NULL, NULL); +} + +static void _glPixelStore(GLenum pname, GLint param) +{ + GET_CURRENT_STATE(); + switch (pname) + { + case GL_PACK_SWAP_BYTES: state->client_state.pack.swapEndian = param != 0; break; + case GL_PACK_LSB_FIRST: state->client_state.pack.lsbFirst = param != 0; break; + case GL_PACK_ROW_LENGTH: if (param >= 0) state->client_state.pack.rowLength = param; break; + case GL_PACK_IMAGE_HEIGHT: if (param >= 0) state->client_state.pack.imageHeight = param; break; + case GL_PACK_SKIP_ROWS: if (param >= 0) state->client_state.pack.skipRows = param; break; + case GL_PACK_SKIP_PIXELS: if (param >= 0) state->client_state.pack.skipPixels = param; break; + case GL_PACK_SKIP_IMAGES: if (param >= 0) state->client_state.pack.skipImages = param; break; + case GL_PACK_ALIGNMENT: if (param == 1 || param == 2 || param == 4 || param == 8) + state->client_state.pack.alignment = param; break; + case GL_UNPACK_SWAP_BYTES: state->client_state.unpack.swapEndian = param != 0; break; + case GL_UNPACK_LSB_FIRST: state->client_state.unpack.lsbFirst = param != 0; break; + case GL_UNPACK_ROW_LENGTH: if (param >= 0) state->client_state.unpack.rowLength = param; break; + case GL_UNPACK_IMAGE_HEIGHT: if (param >= 0) state->client_state.unpack.imageHeight = param; break; + case GL_UNPACK_SKIP_ROWS: if (param >= 0) state->client_state.unpack.skipRows = param; break; + case GL_UNPACK_SKIP_PIXELS: if (param >= 0) state->client_state.unpack.skipPixels = param; break; + case GL_UNPACK_SKIP_IMAGES: if (param >= 0) state->client_state.unpack.skipImages = param; break; + case GL_UNPACK_ALIGNMENT: if (param == 1 || param == 2 || param == 4 || param == 8) + state->client_state.unpack.alignment = param; break; + default: log_gl("unhandled pname %d\n", pname); break; + } +} + +GLAPI void APIENTRY glPixelStoref(GLenum pname, GLfloat param) +{ + long args[] = { UNSIGNED_INT_TO_ARG(pname), FLOAT_TO_ARG(param)}; + if (!(pname == GL_PACK_SKIP_PIXELS || pname == GL_PACK_SKIP_PIXELS || pname == GL_PACK_SKIP_IMAGES || + pname == GL_UNPACK_SKIP_PIXELS || pname == GL_UNPACK_SKIP_PIXELS || pname == GL_UNPACK_SKIP_IMAGES)) + { + _glPixelStore(pname, (GLint)(param + 0.5)); + do_opengl_call(glPixelStoref_func, NULL, args, NULL); + } +} + +void glPixelStorei_no_lock(GLenum pname, GLint param) +{ + _glPixelStore(pname, param); + if (!(pname == GL_PACK_SKIP_PIXELS || pname == GL_PACK_SKIP_ROWS || pname == GL_PACK_SKIP_IMAGES || + pname == GL_UNPACK_SKIP_PIXELS || pname == GL_UNPACK_SKIP_ROWS || pname == GL_UNPACK_SKIP_IMAGES)) + { + long args[] = { UNSIGNED_INT_TO_ARG(pname), INT_TO_ARG(param)}; + do_opengl_call_no_lock(glPixelStorei_func, NULL, args, NULL); + } +} + +GLAPI void APIENTRY glPixelStorei(GLenum pname, GLint param) +{ + LOCK(glPixelStorei_func); + glPixelStorei_no_lock(pname, param); + UNLOCK(glPixelStorei_func); +} + +static int get_nb_composants_of_gl_get_constant_compare(const void* a, const void* b) +{ + GlGetConstant* constantA = (GlGetConstant*)a; + GlGetConstant* constantB = (GlGetConstant*)b; + return constantA->token - constantB->token; +} + +static int get_size_get_boolean_integer_float_double_v(int func_number, int pname) +{ + GlGetConstant constant; + GlGetConstant* found; + constant.token = pname; + found = bsearch(&constant, gl_get_constants, + sizeof(gl_get_constants) / sizeof(GlGetConstant), sizeof(GlGetConstant), + get_nb_composants_of_gl_get_constant_compare); + if (found) + return found->count; + else + { + log_gl("unknown name for %s : %d\n", tab_opengl_calls_name[func_number], pname); + log_gl("hoping that size is 1...\n"); + return 1; + } +} + +#define AFFECT_N(x, y, N) do { int _i; for(_i=0;_i<N;_i++) x[_i]=y[_i]; } while(0) + +#define IS_VALID_MATRIX_MODE(mode) \ + ((mode >= GL_MODELVIEW && mode <= GL_TEXTURE) || \ + (mode == GL_MATRIX_PALETTE_ARB) || \ + (mode == GL_MODELVIEW1_ARB) || \ + (mode >= GL_MODELVIEW2_ARB && mode <= GL_MODELVIEW31_ARB)) + +#define MATRIX_MODE_TO_MATRIX_INDEX(mode) \ + ((mode == GL_MODELVIEW) ? 0 : \ + (mode == GL_PROJECTION) ? 1 : \ + (mode == GL_TEXTURE) ? 2 + state->activeTexture - GL_TEXTURE0_ARB: \ + (mode == GL_MATRIX_PALETTE_ARB) ? 2 + NB_MAX_TEXTURES : \ + (mode == GL_MODELVIEW1_ARB) ? 3 + NB_MAX_TEXTURES : \ + (mode >= GL_MODELVIEW2_ARB && mode <= GL_MODELVIEW31_ARB) ? 4 + NB_MAX_TEXTURES + mode - GL_MODELVIEW2_ARB : -1) + +static int maxTextureSize = -1; /* optimization for ppracer */ +static int maxTextureUnits = -1; + +static int _glGetIntegerv(GLenum pname) +{ + int ret; + long args[] = { INT_TO_ARG(pname), POINTER_TO_ARG(&ret) }; + int args_size[] = { 0, sizeof(int) }; + do_opengl_call_no_lock(glGetIntegerv_func, NULL, CHECK_ARGS(args, args_size)); + return ret; +} + +void glGetIntegerv_no_lock( GLenum pname, GLint *params ); + +#define glGetf(funcName, funcNumber, cType, typeBase) \ +void CONCAT(funcName,_no_lock)( GLenum pname, cType *params ) \ +{ \ + GET_CURRENT_STATE(); \ + switch (pname) \ + { \ + case GL_VERTEX_ARRAY: *params = state->client_state.arrays.vertexArray.enabled; break; \ + case GL_NORMAL_ARRAY: *params = state->client_state.arrays.normalArray.enabled; break; \ + case GL_COLOR_ARRAY: *params = state->client_state.arrays.colorArray.enabled; break; \ + case GL_INDEX_ARRAY: *params = state->client_state.arrays.indexArray.enabled; break; \ + case GL_TEXTURE_COORD_ARRAY: *params = state->client_state.arrays.texCoordArray[state->client_state.clientActiveTexture].enabled; break; \ + case GL_EDGE_FLAG_ARRAY: *params = state->client_state.arrays.edgeFlagArray.enabled; break; \ + case GL_SECONDARY_COLOR_ARRAY: *params = state->client_state.arrays.secondaryColorArray.enabled; break; \ + case GL_FOG_COORDINATE_ARRAY: *params = state->client_state.arrays.fogCoordArray.enabled; break; \ + case GL_WEIGHT_ARRAY_ARB: *params = state->client_state.arrays.weightArray.enabled; break; \ + case GL_VERTEX_ARRAY_SIZE: *params = state->client_state.arrays.vertexArray.size; break; \ + case GL_VERTEX_ARRAY_TYPE: *params = state->client_state.arrays.vertexArray.type; break; \ + case GL_VERTEX_ARRAY_STRIDE: *params = state->client_state.arrays.vertexArray.stride; break; \ + case GL_NORMAL_ARRAY_TYPE: *params = state->client_state.arrays.normalArray.type; break; \ + case GL_NORMAL_ARRAY_STRIDE: *params = state->client_state.arrays.normalArray.stride; break; \ + case GL_COLOR_ARRAY_SIZE: *params = state->client_state.arrays.colorArray.size; break; \ + case GL_COLOR_ARRAY_TYPE: *params = state->client_state.arrays.colorArray.type; break; \ + case GL_COLOR_ARRAY_STRIDE: *params = state->client_state.arrays.colorArray.stride; break; \ + case GL_INDEX_ARRAY_TYPE: *params = state->client_state.arrays.indexArray.type; break; \ + case GL_INDEX_ARRAY_STRIDE: *params = state->client_state.arrays.indexArray.stride; break; \ + case GL_TEXTURE_COORD_ARRAY_SIZE: *params = state->client_state.arrays.texCoordArray[state->client_state.clientActiveTexture].size; break; \ + case GL_TEXTURE_COORD_ARRAY_TYPE: *params = state->client_state.arrays.texCoordArray[state->client_state.clientActiveTexture].type; break; \ + case GL_TEXTURE_COORD_ARRAY_STRIDE: *params = state->client_state.arrays.texCoordArray[state->client_state.clientActiveTexture].stride; break; \ + case GL_EDGE_FLAG_ARRAY_STRIDE: *params = state->client_state.arrays.edgeFlagArray.stride; break; \ + case GL_SECONDARY_COLOR_ARRAY_SIZE: *params = state->client_state.arrays.secondaryColorArray.size; break; \ + case GL_SECONDARY_COLOR_ARRAY_TYPE: *params = state->client_state.arrays.secondaryColorArray.type; break; \ + case GL_SECONDARY_COLOR_ARRAY_STRIDE: *params = state->client_state.arrays.secondaryColorArray.stride; break; \ + case GL_FOG_COORDINATE_ARRAY_TYPE: *params = state->client_state.arrays.fogCoordArray.type; break; \ + case GL_FOG_COORDINATE_ARRAY_POINTER: *params = state->client_state.arrays.fogCoordArray.stride; break; \ + case GL_WEIGHT_ARRAY_SIZE_ARB: *params = state->client_state.arrays.weightArray.size; break; \ + case GL_WEIGHT_ARRAY_TYPE_ARB: *params = state->client_state.arrays.weightArray.type; break; \ + case GL_WEIGHT_ARRAY_STRIDE_ARB: *params = state->client_state.arrays.weightArray.stride; break; \ + case GL_MATRIX_INDEX_ARRAY_SIZE_ARB: *params = state->client_state.arrays.matrixIndexArray.size; break; \ + case GL_MATRIX_INDEX_ARRAY_TYPE_ARB: *params = state->client_state.arrays.matrixIndexArray.type; break; \ + case GL_MATRIX_INDEX_ARRAY_STRIDE_ARB: *params = state->client_state.arrays.matrixIndexArray.stride; break; \ + case GL_VERTEX_ARRAY_BUFFER_BINDING: *params = state->client_state.arrays.vertexArray.vbo_name; break; \ + case GL_NORMAL_ARRAY_BUFFER_BINDING: *params = state->client_state.arrays.normalArray.vbo_name; break; \ + case GL_COLOR_ARRAY_BUFFER_BINDING: *params = state->client_state.arrays.colorArray.vbo_name; break; \ + case GL_INDEX_ARRAY_BUFFER_BINDING: *params = state->client_state.arrays.indexArray.vbo_name; break; \ + case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING: *params = state->client_state.arrays.texCoordArray[state->client_state.clientActiveTexture].vbo_name; break; \ + case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING: *params = state->client_state.arrays.edgeFlagArray.vbo_name; break; \ + case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING: *params = state->client_state.arrays.secondaryColorArray.vbo_name; break; \ + case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING: *params = state->client_state.arrays.fogCoordArray.vbo_name; break; \ + case GL_WEIGHT_ARRAY_BUFFER_BINDING: *params = state->client_state.arrays.weightArray.vbo_name; break; \ + case GL_PACK_SWAP_BYTES: *params = state->client_state.pack.swapEndian; break; \ + case GL_PACK_LSB_FIRST: *params = state->client_state.pack.lsbFirst; break; \ + case GL_PACK_ROW_LENGTH: *params = state->client_state.pack.rowLength; break; \ + case GL_PACK_IMAGE_HEIGHT: *params = state->client_state.pack.imageHeight; break; \ + case GL_PACK_SKIP_ROWS: *params = state->client_state.pack.skipRows; break; \ + case GL_PACK_SKIP_PIXELS: *params = state->client_state.pack.skipPixels; break; \ + case GL_PACK_SKIP_IMAGES: *params = state->client_state.pack.skipImages; break; \ + case GL_PACK_ALIGNMENT: *params = state->client_state.pack.alignment; break; \ + case GL_UNPACK_SWAP_BYTES: *params = state->client_state.unpack.swapEndian; break; \ + case GL_UNPACK_LSB_FIRST: *params = state->client_state.unpack.lsbFirst; break; \ + case GL_UNPACK_ROW_LENGTH: *params = state->client_state.unpack.rowLength; break; \ + case GL_UNPACK_IMAGE_HEIGHT: *params = state->client_state.unpack.imageHeight; break; \ + case GL_UNPACK_SKIP_ROWS: *params = state->client_state.unpack.skipRows; break; \ + case GL_UNPACK_SKIP_PIXELS: *params = state->client_state.unpack.skipPixels; break; \ + case GL_UNPACK_SKIP_IMAGES: *params = state->client_state.unpack.skipImages; break; \ + case GL_UNPACK_ALIGNMENT: *params = state->client_state.unpack.alignment; break; \ + case GL_TEXTURE_2D_BINDING_EXT: *params = state->current_server_state.bindTexture2D; break; \ + case GL_TEXTURE_BINDING_RECTANGLE_ARB: *params = state->current_server_state.bindTextureRectangle; break; \ + case GL_VIEWPORT: params[0] = state->viewport.x; params[1] = state->viewport.y; params[2] = state->viewport.width; params[3] = state->viewport.height; break; \ + case GL_SCISSOR_BOX: params[0] = state->scissorbox.x; params[1] = state->scissorbox.y; params[2] = state->scissorbox.width; params[3] = state->scissorbox.height; break; \ + case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT: *params = 16; break;\ + case GL_MATRIX_MODE: *params = state->current_server_state.matrixMode; break; \ + case GL_DEPTH_FUNC: *params = state->current_server_state.depthFunc; break; \ + case GL_FOG_MODE: *params = state->current_server_state.fog.mode; break; \ + case GL_FOG_DENSITY: *params = state->current_server_state.fog.density; break; \ + case GL_FOG_START: *params = state->current_server_state.fog.start; break; \ + case GL_FOG_END: *params = state->current_server_state.fog.end; break; \ + case GL_FOG_INDEX: *params = state->current_server_state.fog.index; break; \ + case GL_FOG_COLOR: AFFECT_N(params, state->current_server_state.fog.color, 4); break; \ + case GL_COMPRESSED_TEXTURE_FORMATS_ARB: \ + { \ + long args[] = { INT_TO_ARG(pname), POINTER_TO_ARG(params) }; \ + int args_size[] = { 0, 0 }; \ + int nb_compressed_texture_formats = 0; \ + glGetIntegerv_no_lock(GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB, &nb_compressed_texture_formats); \ + args_size[1] = tab_args_type_length[typeBase] * nb_compressed_texture_formats; \ + do_opengl_call_no_lock(funcNumber, NULL, CHECK_ARGS(args, args_size)); \ + break; \ + } \ + case GL_ARRAY_BUFFER_BINDING: *params = state->arrayBuffer; break; \ + case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB: *params = state->elementArrayBuffer; break; \ + case GL_MAX_TEXTURE_SIZE: if (maxTextureSize == -1) maxTextureSize = _glGetIntegerv(pname); *params = maxTextureSize; break; \ + case GL_MAX_TEXTURE_UNITS_ARB: if (maxTextureUnits == -1) maxTextureUnits = _glGetIntegerv(pname); *params = maxTextureUnits; break; \ + case GL_MODELVIEW_MATRIX: \ + case GL_PROJECTION_MATRIX: \ + case GL_TEXTURE_MATRIX: AFFECT_N(params, state->matrix[pname - GL_MODELVIEW_MATRIX].current.val, 16); break; \ + case GL_CURRENT_RASTER_POSITION: \ + { \ + if (!state->currentRasterPosKnown) \ + { \ + long args[] = { INT_TO_ARG(pname), POINTER_TO_ARG(state->currentRasterPos) }; \ + int args_size[] = { 0, 4 * sizeof(float) }; \ + if(debug_gl) log_gl("getting value 0x%X\n", pname); \ + do_opengl_call_no_lock(glGetFloatv_func, NULL, CHECK_ARGS(args, args_size)); \ + state->currentRasterPosKnown = 1; \ + } \ + AFFECT_N(params, state->currentRasterPos, 4); \ + break; \ + } \ + default: \ + { \ + long args[] = { INT_TO_ARG(pname), POINTER_TO_ARG(params) }; \ + int args_size[] = { 0, 0 }; \ + args_size[1] = tab_args_type_length[typeBase] * get_size_get_boolean_integer_float_double_v(funcNumber, pname); \ + if(debug_gl) log_gl("getting value 0x%X\n", pname); \ + do_opengl_call_no_lock(funcNumber, NULL, CHECK_ARGS(args, args_size)); \ + if (debug_gl && typeBase == TYPE_INT) log_gl("val=%d\n", (int)*params); \ + else if (debug_gl && typeBase == TYPE_FLOAT) log_gl("val=%f\n", (float)*params); \ + } \ + } \ +} \ +GLAPI void APIENTRY funcName( GLenum pname, cType *params ) \ +{ \ + LOCK(funcNumber); \ + CONCAT(funcName,_no_lock)(pname, params); \ + UNLOCK(funcNumber); \ +} + +glGetf(glGetBooleanv, glGetBooleanv_func, GLboolean, TYPE_CHAR); +glGetf(glGetIntegerv, glGetIntegerv_func, GLint, TYPE_INT); +glGetf(glGetFloatv, glGetFloatv_func, GLfloat, TYPE_FLOAT); +glGetf(glGetDoublev, glGetDoublev_func, GLdouble, TYPE_DOUBLE); + +GLAPI void APIENTRY glDepthFunc(GLenum func) +{ + long args[] = { UNSIGNED_INT_TO_ARG(func)}; + GET_CURRENT_STATE(); + state->current_server_state.depthFunc = func; + do_opengl_call(glDepthFunc_func, NULL, args, NULL); +} + +GLAPI void APIENTRY glClipPlane(GLenum plane, const GLdouble * equation) +{ + GET_CURRENT_STATE(); + if (plane >= GL_CLIP_PLANE0 && plane < GL_CLIP_PLANE0 + N_CLIP_PLANES) + memcpy(state->current_server_state.clipPlanes[plane-GL_CLIP_PLANE0], equation, 4 * sizeof(double)); + long args[] = { UNSIGNED_INT_TO_ARG(plane), POINTER_TO_ARG(equation)}; + do_opengl_call(glClipPlane_func, NULL, args, NULL); +} + +GLAPI void APIENTRY glGetClipPlane(GLenum plane, GLdouble * equation) +{ + GET_CURRENT_STATE(); + if (plane >= GL_CLIP_PLANE0 && plane < GL_CLIP_PLANE0 + N_CLIP_PLANES) + { + memcpy(equation, state->current_server_state.clipPlanes[plane-GL_CLIP_PLANE0], 4 * sizeof(double)); + return; + } + long args[] = { UNSIGNED_INT_TO_ARG(plane), POINTER_TO_ARG(equation)}; + do_opengl_call(glGetClipPlane_func, NULL, args, NULL); +} + + +GLAPI void APIENTRY glViewport(GLint x, GLint y, GLsizei width, GLsizei height) +{ + GET_CURRENT_STATE(); + long args[] = { INT_TO_ARG(x), INT_TO_ARG(y), INT_TO_ARG(width), INT_TO_ARG(height)}; + + /* + * Update the render buffer if the current window size is different from the one in state. + */ + _check_and_resize_window (state, state->current_drawable); +#if 0 + glFuncTable.fpEnable(GL_DEPTH_TEST); + glClearDepth (1.0); + glFuncTable.fpClear(GL_DEPTH_BUFFER_BIT); +#endif + state->viewport.x = x; + state->viewport.y = y; + state->viewport.width = width; + state->viewport.height = height; + if (debug_gl) log_gl("viewport %d,%d,%d,%d\n", x, y, width, height); + do_opengl_call(glViewport_func, NULL, args, NULL); +} + +GLAPI void APIENTRY glScissor(GLint x, GLint y, GLsizei width, GLsizei height) +{ + GET_CURRENT_STATE(); + long args[] = { INT_TO_ARG(x), INT_TO_ARG(y), INT_TO_ARG(width), INT_TO_ARG(height)}; + state->scissorbox.x = x; + state->scissorbox.y = y; + state->scissorbox.width = width; + state->scissorbox.height = height; + do_opengl_call(glScissor_func, NULL, args, NULL); +} + + +/* Matrix optimization : openquartz */ +#if 1 +GLAPI void APIENTRY glMatrixMode(GLenum mode) +{ + GET_CURRENT_STATE(); + long args[] = { UNSIGNED_INT_TO_ARG(mode)}; + if (IS_VALID_MATRIX_MODE(mode)) + state->current_server_state.matrixMode = mode; + do_opengl_call(glMatrixMode_func, NULL, args, NULL); +} + +GLAPI void APIENTRY glPushMatrix() +{ + GET_CURRENT_STATE(); + int index_mode = MATRIX_MODE_TO_MATRIX_INDEX(state->current_server_state.matrixMode); + if (index_mode >= 0) + { + if (state->matrix[index_mode].sp < MAX_MATRIX_STACK_SIZE) + { + memcpy(state->matrix[index_mode].stack[state->matrix[index_mode].sp].val, + state->matrix[index_mode].current.val, + 16 * sizeof(double)); + state->matrix[index_mode].sp++; + } + else + { + log_gl("matrix[mode].sp >= MAX_MATRIX_STACK_SIZE\n"); + } + } + + do_opengl_call(glPushMatrix_func, NULL, NULL, NULL); +} + +GLAPI void APIENTRY glPopMatrix() +{ + GET_CURRENT_STATE(); + int index_mode = MATRIX_MODE_TO_MATRIX_INDEX(state->current_server_state.matrixMode); + if (index_mode >= 0) + { + if (state->matrix[index_mode].sp > 0) + { + state->matrix[index_mode].sp--; + memcpy(state->matrix[index_mode].current.val, + state->matrix[index_mode].stack[state->matrix[index_mode].sp].val, + 16 * sizeof(double)); + } + else + { + log_gl("matrix[mode].sp <= 0\n"); + } + } + + do_opengl_call(glPopMatrix_func, NULL, NULL, NULL); +} + +GLAPI void APIENTRY glLoadIdentity() +{ + GET_CURRENT_STATE(); + int index_mode = MATRIX_MODE_TO_MATRIX_INDEX(state->current_server_state.matrixMode); + int j; + if (index_mode >= 0) + { + for(j=0;j<16;j++) + { + state->matrix[index_mode].current.val[j] = (j == 0 || j == 5 || j == 10 || j == 15); + } + } + do_opengl_call(glLoadIdentity_func, NULL, NULL, NULL); +} + +static void _internal_glLoadMatrixd(const GLdouble matrix[16]) +{ + GET_CURRENT_STATE(); + int index_mode = MATRIX_MODE_TO_MATRIX_INDEX(state->current_server_state.matrixMode); + if (index_mode >= 0) + memcpy(state->matrix[index_mode].current.val, matrix, 16 * sizeof(double)); +} + +static void _internal_glLoadMatrixf(const GLfloat matrix[16]) +{ + GET_CURRENT_STATE(); + int index_mode = MATRIX_MODE_TO_MATRIX_INDEX(state->current_server_state.matrixMode); + if (index_mode >= 0) + { + int i; + for(i=0;i<16;i++) + state->matrix[index_mode].current.val[i] = matrix[i]; + } +} + +GLAPI void APIENTRY glLoadMatrixd(const GLdouble matrix[16]) +{ + _internal_glLoadMatrixd(matrix); + long args[] = { POINTER_TO_ARG(matrix)}; + do_opengl_call(glLoadMatrixd_func, NULL, args, NULL); +} + +static void matrixfToMatrixd(const GLfloat matrixf[16], GLdouble matrix[16]) +{ + int i; + for(i=0;i<16;i++) + { + matrix[i] = matrixf[i]; + } +} + +GLAPI void APIENTRY glLoadMatrixf(const GLfloat matrix[16]) +{ + _internal_glLoadMatrixf(matrix); + + long args[] = { POINTER_TO_ARG(matrix)}; + do_opengl_call(glLoadMatrixf_func, NULL, args, NULL); +} + +static void _internal_glMultMatrixd(const GLdouble matrix[16]) +{ + GET_CURRENT_STATE(); + GLdouble destMatrix[16]; + int index_mode = MATRIX_MODE_TO_MATRIX_INDEX(state->current_server_state.matrixMode); + if (index_mode >= 0) + { + GLdouble* oriMatrix = state->matrix[index_mode].current.val; + + /* t(C)=t(A.B)=t(B).t(A) */ + + destMatrix[0*4+0] = matrix[0*4+0] * oriMatrix[0*4+0] + + matrix[0*4+1] * oriMatrix[1*4+0] + + matrix[0*4+2] * oriMatrix[2*4+0] + + matrix[0*4+3] * oriMatrix[3*4+0]; + destMatrix[0*4+1] = matrix[0*4+0] * oriMatrix[0*4+1] + + matrix[0*4+1] * oriMatrix[1*4+1] + + matrix[0*4+2] * oriMatrix[2*4+1] + + matrix[0*4+3] * oriMatrix[3*4+1]; + destMatrix[0*4+2] = matrix[0*4+0] * oriMatrix[0*4+2] + + matrix[0*4+1] * oriMatrix[1*4+2] + + matrix[0*4+2] * oriMatrix[2*4+2] + + matrix[0*4+3] * oriMatrix[3*4+2]; + destMatrix[0*4+3] = matrix[0*4+0] * oriMatrix[0*4+3] + + matrix[0*4+1] * oriMatrix[1*4+3] + + matrix[0*4+2] * oriMatrix[2*4+3] + + matrix[0*4+3] * oriMatrix[3*4+3]; + + destMatrix[1*4+0] = matrix[1*4+0] * oriMatrix[0*4+0] + + matrix[1*4+1] * oriMatrix[1*4+0] + + matrix[1*4+2] * oriMatrix[2*4+0] + + matrix[1*4+3] * oriMatrix[3*4+0]; + destMatrix[1*4+1] = matrix[1*4+0] * oriMatrix[0*4+1] + + matrix[1*4+1] * oriMatrix[1*4+1] + + matrix[1*4+2] * oriMatrix[2*4+1] + + matrix[1*4+3] * oriMatrix[3*4+1]; + destMatrix[1*4+2] = matrix[1*4+0] * oriMatrix[0*4+2] + + matrix[1*4+1] * oriMatrix[1*4+2] + + matrix[1*4+2] * oriMatrix[2*4+2] + + matrix[1*4+3] * oriMatrix[3*4+2]; + destMatrix[1*4+3] = matrix[1*4+0] * oriMatrix[0*4+3] + + matrix[1*4+1] * oriMatrix[1*4+3] + + matrix[1*4+2] * oriMatrix[2*4+3] + + matrix[1*4+3] * oriMatrix[3*4+3]; + + destMatrix[2*4+0] = matrix[2*4+0] * oriMatrix[0*4+0] + + matrix[2*4+1] * oriMatrix[1*4+0] + + matrix[2*4+2] * oriMatrix[2*4+0] + + matrix[2*4+3] * oriMatrix[3*4+0]; + destMatrix[2*4+1] = matrix[2*4+0] * oriMatrix[0*4+1] + + matrix[2*4+1] * oriMatrix[1*4+1] + + matrix[2*4+2] * oriMatrix[2*4+1] + + matrix[2*4+3] * oriMatrix[3*4+1]; + destMatrix[2*4+2] = matrix[2*4+0] * oriMatrix[0*4+2] + + matrix[2*4+1] * oriMatrix[1*4+2] + + matrix[2*4+2] * oriMatrix[2*4+2] + + matrix[2*4+3] * oriMatrix[3*4+2]; + destMatrix[2*4+3] = matrix[2*4+0] * oriMatrix[0*4+3] + + matrix[2*4+1] * oriMatrix[1*4+3] + + matrix[2*4+2] * oriMatrix[2*4+3] + + matrix[2*4+3] * oriMatrix[3*4+3]; + + destMatrix[3*4+0] = matrix[3*4+0] * oriMatrix[0*4+0] + + matrix[3*4+1] * oriMatrix[1*4+0] + + matrix[3*4+2] * oriMatrix[2*4+0] + + matrix[3*4+3] * oriMatrix[3*4+0]; + destMatrix[3*4+1] = matrix[3*4+0] * oriMatrix[0*4+1] + + matrix[3*4+1] * oriMatrix[1*4+1] + + matrix[3*4+2] * oriMatrix[2*4+1] + + matrix[3*4+3] * oriMatrix[3*4+1]; + destMatrix[3*4+2] = matrix[3*4+0] * oriMatrix[0*4+2] + + matrix[3*4+1] * oriMatrix[1*4+2] + + matrix[3*4+2] * oriMatrix[2*4+2] + + matrix[3*4+3] * oriMatrix[3*4+2]; + destMatrix[3*4+3] = matrix[3*4+0] * oriMatrix[0*4+3] + + matrix[3*4+1] * oriMatrix[1*4+3] + + matrix[3*4+2] * oriMatrix[2*4+3] + + matrix[3*4+3] * oriMatrix[3*4+3]; + + memcpy(oriMatrix, destMatrix, 16 * sizeof(double)); + } +} + +GLAPI void APIENTRY glMultMatrixd(const GLdouble matrix[16]) +{ + _internal_glMultMatrixd(matrix); + + long args[] = { POINTER_TO_ARG(matrix)}; + do_opengl_call(glMultMatrixd_func, NULL, args, NULL); +} + +GLAPI void APIENTRY glMultMatrixf(const GLfloat matrix[16]) +{ + GLdouble matrixd[16]; + matrixfToMatrixd(matrix, matrixd); + _internal_glMultMatrixd(matrixd); + + long args[] = { POINTER_TO_ARG(matrix)}; + do_opengl_call(glMultMatrixf_func, NULL, args, NULL); +} + +/** + * Transpose a GLfloat matrix. + * + * \param to destination array. + * \param from source array. + */ +static void +_math_transposef( GLfloat to[16], const GLfloat from[16] ) +{ + to[0] = from[0]; + to[1] = from[4]; + to[2] = from[8]; + to[3] = from[12]; + to[4] = from[1]; + to[5] = from[5]; + to[6] = from[9]; + to[7] = from[13]; + to[8] = from[2]; + to[9] = from[6]; + to[10] = from[10]; + to[11] = from[14]; + to[12] = from[3]; + to[13] = from[7]; + to[14] = from[11]; + to[15] = from[15]; +} + + +/** + * Transpose a GLdouble matrix. + * + * \param to destination array. + * \param from source array. + */ +static void +_math_transposed( GLdouble to[16], const GLdouble from[16] ) +{ + to[0] = from[0]; + to[1] = from[4]; + to[2] = from[8]; + to[3] = from[12]; + to[4] = from[1]; + to[5] = from[5]; + to[6] = from[9]; + to[7] = from[13]; + to[8] = from[2]; + to[9] = from[6]; + to[10] = from[10]; + to[11] = from[14]; + to[12] = from[3]; + to[13] = from[7]; + to[14] = from[11]; + to[15] = from[15]; +} + +GLAPI void APIENTRY glLoadTransposeMatrixf (const GLfloat m[16]) +{ + GLfloat dest[16]; + _math_transposef(dest, m); + glFuncTable.fpLoadMatrixf(dest); +} + +GLAPI void APIENTRY glLoadTransposeMatrixd (const GLdouble m[16]) +{ + GLdouble dest[16]; + _math_transposed(dest, m); + glLoadMatrixd(dest); +} + +GLAPI void APIENTRY glMultTransposeMatrixf (const GLfloat m[16]) +{ + GLfloat dest[16]; + _math_transposef(dest, m); + glFuncTable.fpMultMatrixf(dest); +} + +GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble m[16]) +{ + GLdouble dest[16]; + _math_transposed(dest, m); + glMultMatrixd(dest); +} + +GLAPI void APIENTRY glLoadTransposeMatrixfARB (const GLfloat* m) +{ + GLfloat dest[16]; + _math_transposef(dest, m); + glFuncTable.fpLoadMatrixf(dest); +} + +GLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble* m) +{ + GLdouble dest[16]; + _math_transposed(dest, m); + glLoadMatrixd(dest); +} + +GLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat* m) +{ + GLfloat dest[16]; + _math_transposef(dest, m); + glFuncTable.fpMultMatrixf(dest); +} + +GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble* m) +{ + GLdouble dest[16]; + _math_transposed(dest, m); + glMultMatrixd(dest); +} + +GLAPI void APIENTRY glOrtho( GLdouble left, + GLdouble right, + GLdouble bottom, + GLdouble top, + GLdouble near_val, + GLdouble far_val) +{ + double tx, ty, tz; + tx = -(right + left) / (right - left); + ty = -(top + bottom) / (top - bottom); + tz = -(far_val + near_val) / (far_val - near_val); + double matrix[16] = { 2/(right - left), 0, 0, 0, + 0, 2/(top-bottom), 0, 0, + 0, 0, -2/(far_val - near_val), 0, + tx, ty, tz, 1 }; + _internal_glMultMatrixd(matrix); + + long args[] = { DOUBLE_TO_ARG(left), DOUBLE_TO_ARG(right), DOUBLE_TO_ARG(bottom), DOUBLE_TO_ARG(top), DOUBLE_TO_ARG(near_val), DOUBLE_TO_ARG(far_val)}; + do_opengl_call(glOrtho_func, NULL, args, NULL); +} + +GLAPI void APIENTRY glFrustum( GLdouble left, + GLdouble right, + GLdouble bottom, + GLdouble top, + GLdouble near_val, + GLdouble far_val) +{ + double V1, V2, A, B, C, D; + V1 = 2 * near_val / (right - left); + V2 = 2 * near_val / (top - bottom); + A = (right + left) / (right - left); + B = (top + bottom) / (top - bottom); + C = -(far_val + near_val) / (far_val - near_val); + D = -2 * far_val * near_val / (far_val - near_val); + double matrix[16] = { V1, 0, 0, 0, + 0, V2, 0, 0, + A, B, C, -1, + 0, 0, D, 0}; + _internal_glMultMatrixd(matrix); + + long args[] = { DOUBLE_TO_ARG(left), DOUBLE_TO_ARG(right), DOUBLE_TO_ARG(bottom), DOUBLE_TO_ARG(top), DOUBLE_TO_ARG(near_val), DOUBLE_TO_ARG(far_val)}; + do_opengl_call(glFrustum_func, NULL, args, NULL); + +} + +static void _glRotate_internal(GLdouble angle, GLdouble x, GLdouble y, GLdouble z) +{ + double c = cos(angle / 180. * M_PI); + double s = sin(angle / 180. * M_PI); + if (x == 1 && y == 0 && z == 0) + { + GET_CURRENT_STATE(); + int index_mode = MATRIX_MODE_TO_MATRIX_INDEX(state->current_server_state.matrixMode); + if (index_mode >= 0) + { + GLdouble* matrix = state->matrix[index_mode].current.val; + double t, u; + + t = matrix[1*4+0]; + u = matrix[2*4+0]; + matrix[1*4+0] = c * t + s * u; + matrix[2*4+0] = c * u - s * t; + + t = matrix[1*4+1]; + u = matrix[2*4+1]; + matrix[1*4+1] = c * t + s * u; + matrix[2*4+1] = c * u - s * t; + + t = matrix[1*4+2]; + u = matrix[2*4+2]; + matrix[1*4+2] = c * t + s * u; + matrix[2*4+2] = c * u - s * t; + + t = matrix[1*4+3]; + u = matrix[2*4+3]; + matrix[1*4+3] = c * t + s * u; + matrix[2*4+3] = c * u - s * t; + } + } + else if (x == 0 && y == 1 && z == 0) + { + GET_CURRENT_STATE(); + int index_mode = MATRIX_MODE_TO_MATRIX_INDEX(state->current_server_state.matrixMode); + if (index_mode >= 0) + { + GLdouble* matrix = state->matrix[index_mode].current.val; + double t, u; + + t = matrix[0*4+0]; + u = matrix[2*4+0]; + matrix[0*4+0] = c * t - s * u; + matrix[2*4+0] = s * t + c * u; + + t = matrix[0*4+1]; + u = matrix[2*4+1]; + matrix[0*4+1] = c * t - s * u; + matrix[2*4+1] = s * t + c * u; + + t = matrix[0*4+2]; + u = matrix[2*4+2]; + matrix[0*4+2] = c * t - s * u; + matrix[2*4+2] = s * t + c * u; + + t = matrix[0*4+3]; + u = matrix[2*4+3]; + matrix[0*4+3] = c * t - s * u; + matrix[2*4+3] = s * t + c * u; + } + } + else if (x == 0 && y == 0 && z == 1) + { + GET_CURRENT_STATE(); + int index_mode = MATRIX_MODE_TO_MATRIX_INDEX(state->current_server_state.matrixMode); + if (index_mode >= 0) + { + GLdouble* matrix = state->matrix[index_mode].current.val; + double t, u; + + t = matrix[0*4+0]; + u = matrix[1*4+0]; + matrix[0*4+0] = c * t + s * u; + matrix[1*4+0] = c * u - s * t; + + t = matrix[0*4+1]; + u = matrix[1*4+1]; + matrix[0*4+1] = c * t + s * u; + matrix[1*4+1] = c * u - s * t; + + t = matrix[0*4+2]; + u = matrix[1*4+2]; + matrix[0*4+2] = c * t + s * u; + matrix[1*4+2] = c * u - s * t; + + t = matrix[0*4+3]; + u = matrix[1*4+3]; + matrix[0*4+3] = c * t + s * u; + matrix[1*4+3] = c * u - s * t; + } + } + else + { + double sqrt_sum_sqr = sqrt(x*x+y*y+z*z); + if (sqrt_sum_sqr < 1e-4) return; + x /= sqrt_sum_sqr; + y /= sqrt_sum_sqr; + z /= sqrt_sum_sqr; + double matrix[16] = { x*x*(1-c)+c, y*x*(1-c)+z*s, x*z*(1-c)-y*s, 0, + x*y*(1-c)-z*s, y*y*(1-c)+c, y*z*(1-c)+x*s, 0, + x*z*(1-c)+y*s, y*z*(1-c)-x*s, z*z*(1-c)+c, 0, + 0, 0, 0, 1}; + _internal_glMultMatrixd(matrix); + } +} + +GLAPI void APIENTRY glRotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z) +{ + _glRotate_internal(angle, x, y, z); + + long args[] = { DOUBLE_TO_ARG(angle), DOUBLE_TO_ARG(x), DOUBLE_TO_ARG(y), DOUBLE_TO_ARG(z)}; + do_opengl_call(glRotated_func, NULL, args, NULL); +} + +GLAPI void APIENTRY glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z) +{ + _glRotate_internal(angle, x, y, z); + + long args[] = { FLOAT_TO_ARG(angle), FLOAT_TO_ARG(x), FLOAT_TO_ARG(y), FLOAT_TO_ARG(z)}; + do_opengl_call(glRotatef_func, NULL, args, NULL); +} + +static void _glScale_internal(double a, double b, double c) +{ + GET_CURRENT_STATE(); + int index_mode = MATRIX_MODE_TO_MATRIX_INDEX(state->current_server_state.matrixMode); + if (index_mode >= 0) + { + GLdouble* matrix = state->matrix[index_mode].current.val; + matrix[0*4+0] *= a; + matrix[0*4+1] *= a; + matrix[0*4+2] *= a; + matrix[0*4+3] *= a; + matrix[1*4+0] *= b; + matrix[1*4+1] *= b; + matrix[1*4+2] *= b; + matrix[1*4+3] *= b; + matrix[2*4+0] *= c; + matrix[2*4+1] *= c; + matrix[2*4+2] *= c; + matrix[2*4+3] *= c; + } +} + +GLAPI void APIENTRY glScaled(GLdouble x, GLdouble y, GLdouble z) +{ + _glScale_internal(x, y, z); + + long args[] = { DOUBLE_TO_ARG(x), DOUBLE_TO_ARG(y), DOUBLE_TO_ARG(z)}; + do_opengl_call(glScaled_func, NULL, args, NULL); +} + +GLAPI void APIENTRY glScalef(GLfloat x, GLfloat y, GLfloat z) +{ + _glScale_internal(x, y, z); + + long args[] = { FLOAT_TO_ARG(x), FLOAT_TO_ARG(y), FLOAT_TO_ARG(z)}; + do_opengl_call(glScalef_func, NULL, args, NULL); +} + +static void _glTranslate_internal(double a, double b, double c) +{ + GET_CURRENT_STATE(); + int index_mode = MATRIX_MODE_TO_MATRIX_INDEX(state->current_server_state.matrixMode); + if (index_mode >= 0) + { + GLdouble* matrix = state->matrix[index_mode].current.val; + + matrix[3*4+0] += a * matrix[0*4+0] + b * matrix[1*4+0] + c * matrix[2*4+0]; + matrix[3*4+1] += a * matrix[0*4+1] + b * matrix[1*4+1] + c * matrix[2*4+1]; + matrix[3*4+2] += a * matrix[0*4+2] + b * matrix[1*4+2] + c * matrix[2*4+2]; + matrix[3*4+3] += a * matrix[0*4+3] + b * matrix[1*4+3] + c * matrix[2*4+3]; + } +} + +GLAPI void APIENTRY glTranslated(GLdouble x, GLdouble y, GLdouble z) +{ + _glTranslate_internal(x, y, z); + + long args[] = { DOUBLE_TO_ARG(x), DOUBLE_TO_ARG(y), DOUBLE_TO_ARG(z)}; + do_opengl_call(glTranslated_func, NULL, args, NULL); +} + +GLAPI void APIENTRY glTranslatef(GLfloat x, GLfloat y, GLfloat z) +{ + _glTranslate_internal(x, y, z); + + long args[] = { FLOAT_TO_ARG(x), FLOAT_TO_ARG(y), FLOAT_TO_ARG(z)}; + do_opengl_call(glTranslatef_func, NULL, args, NULL); +} +#endif +/* End of matrix optimization */ + +void glBindBufferARB_no_lock(GLenum target, GLuint buffer) +{ + CHECK_PROC(glBindBufferARB); + GET_CURRENT_STATE(); + if (buffer >= 32768) + { + log_gl("buffer >= 32768\n"); + return; + } + long args[] = {INT_TO_ARG(target), INT_TO_ARG(buffer)}; + if (target == GL_ARRAY_BUFFER_ARB) + { + //log_gl("glBindBufferARB(GL_ARRAY_BUFFER,%d)\n", buffer); + state->arrayBuffer = buffer; + } + else if (target == GL_ELEMENT_ARRAY_BUFFER_ARB) + { + //log_gl("glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB,%d)\n", buffer); + state->elementArrayBuffer = buffer; + } + else if (target == GL_PIXEL_UNPACK_BUFFER_EXT) + { + //log_gl("glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT,%d)\n", buffer); + state->pixelUnpackBuffer = buffer; + } + else if (target == GL_PIXEL_PACK_BUFFER_EXT) + { + //log_gl("glBindBufferARB(GL_PIXEL_PACK_BUFFER_EXT,%d)\n", buffer); + state->pixelPackBuffer = buffer; + } + do_opengl_call_no_lock(glBindBufferARB_func, NULL, args, NULL); +} + +GLAPI void APIENTRY EXT_FUNC(glBindBufferARB) (GLenum target, GLuint buffer) +{ + LOCK(glBindBufferARB_func); + glBindBufferARB_no_lock(target, buffer); + UNLOCK(glBindBufferARB_func); +} + +GLAPI void APIENTRY EXT_FUNC(glBindBuffer) (GLenum target, GLuint buffer) +{ + glBindBufferARB(target, buffer); +} + +GLAPI void APIENTRY glGenBuffersARB (GLsizei n, GLuint * tab) +{ + CHECK_PROC(glGenBuffersARB); + GET_CURRENT_STATE(); + if (n <= 0) { log_gl("n <= 0\n"); return; } + alloc_range(state->bufferAllocator, n, tab); + long args[] = { INT_TO_ARG(n) }; + do_opengl_call(glGenBuffersARB_fake_func, NULL, args, NULL); +} + +GLAPI void APIENTRY glGenBuffers (GLsizei n, GLuint * tab) +{ + glGenBuffersARB(n, tab); +} + +GLAPI void APIENTRY glDeleteBuffersARB (GLsizei n, const GLuint * tab) +{ + CHECK_PROC(glDeleteBuffersARB); + GET_CURRENT_STATE(); + if (n <= 0) { log_gl("n <= 0\n"); return; } + delete_range(state->bufferAllocator, n, tab); + long args[] = { INT_TO_ARG(n), POINTER_TO_ARG(tab) }; + do_opengl_call(glDeleteBuffersARB_func, NULL, args, NULL); +} + +GLAPI void APIENTRY glDeleteBuffers(GLsizei n, const GLuint * tab) +{ + glDeleteBuffersARB(n, tab); +} + +static Buffer* _get_buffer(GLenum target) +{ + GET_CURRENT_STATE(); + if (target == GL_ARRAY_BUFFER_ARB) + { + if (state->arrayBuffer) + return &state->arrayBuffers[state->arrayBuffer]; + else + return NULL; + } + else if (target == GL_ELEMENT_ARRAY_BUFFER_ARB) + { + if (state->elementArrayBuffer) + return &state->elementArrayBuffers[state->elementArrayBuffer]; + else + return NULL; + } + else if (target == GL_PIXEL_UNPACK_BUFFER_EXT) + { + if (state->pixelUnpackBuffer) + return &state->pixelUnpackBuffers[state->pixelUnpackBuffer]; + else + return NULL; + } + else if (target == GL_PIXEL_PACK_BUFFER_EXT) + { + if (state->pixelPackBuffer) + return &state->pixelPackBuffers[state->pixelPackBuffer]; + else + return NULL; + } + else + { + return NULL; + } +} + +GLAPI GLenum APIENTRY glGetError() +{ + int ret = 0; + if (disable_optim) + { + do_opengl_call(glGetError_func, &ret, NULL, NULL); + log_gl("glGetError() = %d\n", ret); + } + else + do_opengl_call(_glGetError_fake_func, NULL, NULL, NULL); + return ret; +} + +GLAPI void APIENTRY glBufferDataARB (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage) +{ + CHECK_PROC(glBufferDataARB); + + Buffer* buffer = _get_buffer(target); + if (buffer) + { + buffer->usage = usage; + buffer->size = size; + buffer->ptr = realloc(buffer->ptr, size); + if (data) memcpy(buffer->ptr, data, size); + } + else + { + fprintf(stderr, "unknown buffer/buffer target : %d\n", target); + } + long args[] = { INT_TO_ARG(target), INT_TO_ARG(size), POINTER_TO_ARG(data), INT_TO_ARG(usage) }; + int args_size[] = { 0, 0, (data) ? size : 0, 0 }; + do_opengl_call(glBufferDataARB_func, NULL, CHECK_ARGS(args, args_size)); +} + +GLAPI void APIENTRY glBufferData (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage) +{ + glBufferDataARB(target, size, data, usage); +} + +GLAPI void APIENTRY glBufferSubDataARB(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data) +{ + CHECK_PROC(glBufferSubDataARB); + + //log_gl("glBufferSubDataARB %d %d\n", offset, size); + + Buffer* buffer = _get_buffer(target); + if (buffer) + { + assert(offset + size <= buffer->size); + assert(buffer->ptr); + memcpy(buffer->ptr + offset, data, size); + } + else + { + fprintf(stderr, "unknown buffer/buffer target : %d\n", target); + } + long args[] = { INT_TO_ARG(target), INT_TO_ARG(offset), INT_TO_ARG(size), POINTER_TO_ARG(data) }; + int args_size[] = { 0, 0, 0, size }; + do_opengl_call(glBufferSubDataARB_func, NULL, CHECK_ARGS(args, args_size)); +} + +GLAPI void APIENTRY glBufferSubData(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data) +{ + glBufferSubDataARB(target, offset, size, data); +} + +GLAPI void APIENTRY glGetBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data) +{ + CHECK_PROC(glGetBufferSubDataARB); + + Buffer* buffer = _get_buffer(target); + if (!buffer) return; + + assert(offset + size <= buffer->size); + assert(buffer->ptr); + + memcpy(data, buffer->ptr + offset, size); +} + +GLAPI void APIENTRY glGetBufferSubData (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data) +{ + glGetBufferSubDataARB(target, offset, size, data); +} + +GLvoid* glMapBufferARB (GLenum target, GLenum access) +{ + CHECK_PROC_WITH_RET(glMapBufferARB); + + Buffer* buffer = _get_buffer(target); + if (!buffer) return NULL; + if (target == GL_PIXEL_PACK_BUFFER_EXT && (access == GL_READ_ONLY || access == GL_READ_WRITE)) + { + int ret_int = 0; + long args[] = { INT_TO_ARG(target), INT_TO_ARG(buffer->size), POINTER_TO_ARG(buffer->ptr) }; + int args_size[] = { 0, 0, buffer->size }; + do_opengl_call(_glMapBufferARB_fake_func, &ret_int, CHECK_ARGS(args, args_size)); + if (ret_int == 0) + return NULL; + } + buffer->access = access; + buffer->mapped = 1; + return buffer->ptr; +} + +GLvoid* glMapBuffer(GLenum target, GLenum access) +{ + return glMapBufferARB(target, access); +} + +GLAPI void APIENTRY glGetBufferParameterivARB (GLenum target, GLenum pname, GLint *params) +{ + CHECK_PROC(glGetBufferParameterivARB); + + Buffer* buffer = _get_buffer(target); + if (!buffer) return; + + switch (pname) + { + case GL_BUFFER_SIZE_ARB: *params = buffer->size; break; + case GL_BUFFER_USAGE_ARB: *params = buffer->usage; break; + case GL_BUFFER_ACCESS_ARB: *params = buffer->access; break; + case GL_BUFFER_MAPPED_ARB: *params = buffer->mapped; break; + default: + log_gl("unknown pname = 0x%X\n", pname); + } +} + +GLAPI void APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params) +{ + glGetBufferParameterivARB(target, pname, params); +} + +GLAPI void APIENTRY glGetBufferPointervARB (GLenum target, GLenum pname, GLvoid* *params) +{ + CHECK_PROC(glGetBufferPointervARB); + if (pname != GL_BUFFER_MAP_POINTER_ARB) + { + log_gl("glGetBufferPointervARB : unknown buffer data pname : %x\n", pname); + return; + } + Buffer* buffer = _get_buffer(target); + if (!buffer) return; + if (buffer->mapped) *params = buffer->ptr; else *params = NULL; +} + +GLAPI void APIENTRY glGetBufferPointerv (GLenum target, GLenum pname, GLvoid* *params) +{ + glGetBufferPointervARB(target, pname, params); +} + +GLAPI GLboolean APIENTRY glUnmapBufferARB(GLenum target) +{ + CHECK_PROC_WITH_RET(glUnmapBufferARB); + Buffer* buffer = _get_buffer(target); + if (!buffer) return 0; + if (!buffer->mapped) + { + log_gl("unmapped buffer"); + return 0; + } + buffer->mapped = 0; + if (buffer->access != GL_READ_ONLY) + { + glBufferSubDataARB(target, 0, buffer->size, buffer->ptr); + } + buffer->access = 0; + return 1; +} + +GLAPI GLboolean APIENTRY glUnmapBuffer(GLenum target) +{ + return glUnmapBufferARB(target); +} + +GLAPI void GLAPIENTRY glNewList( GLuint list, GLenum mode ) +{ + long args[] = { INT_TO_ARG(list), INT_TO_ARG(mode) }; + GET_CURRENT_STATE(); + alloc_value(state->listAllocator, list); + do_opengl_call(glNewList_func, NULL, args, NULL); +} + +GLAPI void GLAPIENTRY glDeleteLists( GLuint list, GLsizei range ) +{ + long args[] = { INT_TO_ARG(list), INT_TO_ARG(range) }; + GET_CURRENT_STATE(); + delete_consecutive_values(state->listAllocator, list, range); + do_opengl_call(glDeleteLists_func, NULL, args, NULL); +} + +GLAPI GLuint GLAPIENTRY glGenLists( GLsizei range ) +{ + GET_CURRENT_STATE(); + unsigned int firstValue = alloc_range(state->listAllocator, range, NULL); + long args[] = { INT_TO_ARG(range) }; + do_opengl_call(glGenLists_fake_func, NULL, args, NULL); + return firstValue; +} + +GLAPI void APIENTRY glCallLists( GLsizei n, + GLenum type, + const GLvoid *lists ) +{ + long args[] = { INT_TO_ARG(n), INT_TO_ARG(type), POINTER_TO_ARG(lists) }; + int args_size[] = { 0, 0, 0 }; + int size = n; + if (n <= 0) { log_gl("n <= 0\n"); return; } + switch(type) + { + case GL_BYTE: + case GL_UNSIGNED_BYTE: + break; + + case GL_SHORT: + case GL_UNSIGNED_SHORT: + case GL_2_BYTES: + size *= 2; + break; + + case GL_3_BYTES: + size *= 3; + break; + + case GL_INT: + case GL_UNSIGNED_INT: + case GL_FLOAT: + case GL_4_BYTES: + size *= 4; + break; + + default: + log_gl("unsupported type = %d\n", type); + return; + } + args_size[2] = size; + do_opengl_call(glCallLists_func, NULL, CHECK_ARGS(args, args_size)); +} + +GLAPI const GLubyte * APIENTRY glGetString( GLenum name ) +{ + int i; + static GLubyte* glStrings[6] = {NULL}; + static const char* glGetStringsName[] = { + "GL_VENDOR", + "GL_RENDERER", + "GL_VERSION", + "GL_EXTENSIONS", + "GL_SHADING_LANGUAGE_VERSION", + }; + + if (name >= GL_VENDOR && name <= GL_EXTENSIONS) + i = name - GL_VENDOR; + else if (name == GL_SHADING_LANGUAGE_VERSION) + i = 4; + else if (name == GL_PROGRAM_ERROR_STRING_NV) + i = 5; + else + { + log_gl("assert(name >= GL_VENDOR && name <= GL_EXTENSIONS || name == GL_SHADING_LANGUAGE_VERSION || name == GL_PROGRAM_ERROR_STRING_NV)\n"); + return NULL; + } + LOCK(glGetString_func); + if (glStrings[i] == NULL) + { + if (i <= 4 && getenv(glGetStringsName[i])) + { + glStrings[i] = (GLubyte*)getenv(glGetStringsName[i]); + } + else + { + long args[] = { INT_TO_ARG(name) }; + do_opengl_call_no_lock(glGetString_func, &glStrings[i], args, NULL); + } + + if(debug_gl) log_gl("glGetString(0x%X) = %s\n", name, glStrings[i]); + if (name >= GL_VENDOR && name <= GL_EXTENSIONS) { + glStrings[name - GL_VENDOR] = (GLubyte*)strdup((char *)glStrings[i]); + } + else if (name == GL_SHADING_LANGUAGE_VERSION) + { + glStrings[i] = (GLubyte*)strdup((char *)glStrings[i]); + } + } + UNLOCK(glGetString_func); + return glStrings[i]; +} + +#define CASE_GL_PIXEL_MAP(x) case GL_PIXEL_MAP_##x: glGetIntegerv(CONCAT(GL_PIXEL_MAP_##x,_SIZE), &value); return value; + +static int get_glgetpixelmapv_size(int map) +{ + int value; + switch (map) + { + CASE_GL_PIXEL_MAP(I_TO_I); + CASE_GL_PIXEL_MAP(S_TO_S); + CASE_GL_PIXEL_MAP(I_TO_R); + CASE_GL_PIXEL_MAP(I_TO_G); + CASE_GL_PIXEL_MAP(I_TO_B); + CASE_GL_PIXEL_MAP(I_TO_A); + CASE_GL_PIXEL_MAP(R_TO_R); + CASE_GL_PIXEL_MAP(G_TO_G); + CASE_GL_PIXEL_MAP(B_TO_B); + CASE_GL_PIXEL_MAP(A_TO_A); + default : + { + log_gl("unhandled map = %d\n", map); + return 0; + } + } +} + +GLAPI void APIENTRY glGetPixelMapfv( GLenum map, GLfloat *values ) +{ + long args[] = { INT_TO_ARG(map), POINTER_TO_ARG(values) }; + int args_size[] = { 0, get_glgetpixelmapv_size(map) * sizeof(float) }; + if (args_size[1] == 0) return; + do_opengl_call(glGetPixelMapfv_func, NULL, CHECK_ARGS(args, args_size)); +} + +GLAPI void APIENTRY glGetPixelMapuiv( GLenum map, GLuint *values ) +{ + long args[] = { INT_TO_ARG(map), POINTER_TO_ARG(values) }; + int args_size[] = { 0, get_glgetpixelmapv_size(map) * sizeof(int) }; + if (args_size[1] == 0) return; + do_opengl_call(glGetPixelMapuiv_func, NULL, CHECK_ARGS(args, args_size)); +} + +GLAPI void APIENTRY glGetPixelMapusv( GLenum map, GLushort *values ) +{ + long args[] = { INT_TO_ARG(map), POINTER_TO_ARG(values) }; + int args_size[] = { 0, get_glgetpixelmapv_size(map) * sizeof(short) }; + if (args_size[1] == 0) return; + do_opengl_call(glGetPixelMapusv_func, NULL, CHECK_ARGS(args, args_size)); +} + +static int glMap1_get_multiplier(GLenum target) +{ + switch (target) + { + case GL_MAP1_VERTEX_3: + case GL_MAP1_NORMAL: + case GL_MAP1_TEXTURE_COORD_3: + return 3; + break; + + case GL_MAP1_VERTEX_4: + case GL_MAP1_COLOR_4: + case GL_MAP1_TEXTURE_COORD_4: + return 4; + break; + + case GL_MAP1_INDEX: + case GL_MAP1_TEXTURE_COORD_1: + return 1; + break; + + case GL_MAP1_TEXTURE_COORD_2: + return 2; + break; + + default: + if (target >= GL_MAP1_VERTEX_ATTRIB0_4_NV && target <= GL_MAP1_VERTEX_ATTRIB15_4_NV) + return 4; + log_gl("unhandled target = %d\n", target); + return 0; + } +} + + +static int glMap2_get_multiplier(GLenum target) +{ + switch (target) + { + case GL_MAP2_VERTEX_3: + case GL_MAP2_NORMAL: + case GL_MAP2_TEXTURE_COORD_3: + return 3; + break; + + case GL_MAP2_VERTEX_4: + case GL_MAP2_COLOR_4: + case GL_MAP2_TEXTURE_COORD_4: + return 4; + break; + + case GL_MAP2_INDEX: + case GL_MAP2_TEXTURE_COORD_1: + return 1; + break; + + case GL_MAP2_TEXTURE_COORD_2: + return 2; + break; + + default: + if (target >= GL_MAP2_VERTEX_ATTRIB0_4_NV && target <= GL_MAP2_VERTEX_ATTRIB15_4_NV) + return 4; + log_gl("unhandled target = %d\n", target); + return 0; + } +} + +static int get_dimensionnal_evaluator(GLenum target) +{ + switch(target) + { + case GL_MAP1_COLOR_4: + case GL_MAP1_INDEX: + case GL_MAP1_NORMAL: + case GL_MAP1_TEXTURE_COORD_1: + case GL_MAP1_TEXTURE_COORD_2: + case GL_MAP1_TEXTURE_COORD_3: + case GL_MAP1_TEXTURE_COORD_4: + case GL_MAP1_VERTEX_3: + case GL_MAP1_VERTEX_4: + return 1; + + case GL_MAP2_COLOR_4: + case GL_MAP2_INDEX: + case GL_MAP2_NORMAL: + case GL_MAP2_TEXTURE_COORD_1: + case GL_MAP2_TEXTURE_COORD_2: + case GL_MAP2_TEXTURE_COORD_3: + case GL_MAP2_TEXTURE_COORD_4: + case GL_MAP2_VERTEX_3: + case GL_MAP2_VERTEX_4: + return 2; + + default: + log_gl("unhandled target %d\n", target); + return 0; + } +} + +GLAPI void APIENTRY glMap1f( GLenum target, + GLfloat u1, + GLfloat u2, + GLint stride, + GLint order, + const GLfloat *points ) +{ + long args[] = { INT_TO_ARG(target), FLOAT_TO_ARG(u1), FLOAT_TO_ARG(u2), + INT_TO_ARG(stride), INT_TO_ARG(order), POINTER_TO_ARG(points) }; + int args_size[] = { 0, 0, 0, 0, 0, 0 }; + int num_points = order; + int multiplier = glMap1_get_multiplier(target); + if (multiplier) + { + num_points *= multiplier; + args_size[5] = num_points * sizeof(float); + do_opengl_call(glMap1f_func, NULL, CHECK_ARGS(args, args_size)); + } +} + +GLAPI void APIENTRY glMap1d( GLenum target, + GLdouble u1, + GLdouble u2, + GLint stride, + GLint order, + const GLdouble *points ) +{ + long args[] = { INT_TO_ARG(target), DOUBLE_TO_ARG(u1), DOUBLE_TO_ARG(u2), + INT_TO_ARG(stride), INT_TO_ARG(order), POINTER_TO_ARG(points) }; + int args_size[] = { 0, 0, 0, 0, 0, 0 }; + int num_points = order; + int multiplier = glMap1_get_multiplier(target); + if (multiplier) + { + num_points *= multiplier; + args_size[5] = num_points * sizeof(double); + do_opengl_call(glMap1d_func, NULL, CHECK_ARGS(args, args_size)); + } +} + +GLAPI void APIENTRY glMap2f( GLenum target, + GLfloat u1, + GLfloat u2, + GLint ustride, + GLint uorder, + GLfloat v1, + GLfloat v2, + GLint vstride, + GLint vorder, + const GLfloat *points ) +{ + long args[] = { INT_TO_ARG(target), + FLOAT_TO_ARG(u1), FLOAT_TO_ARG(u2), + INT_TO_ARG(ustride), INT_TO_ARG(uorder), + FLOAT_TO_ARG(v1), FLOAT_TO_ARG(v2), + INT_TO_ARG(vstride), INT_TO_ARG(vorder), + POINTER_TO_ARG(points) }; + int args_size[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + int num_points = uorder * vorder; + int multiplier = glMap2_get_multiplier(target); + if (multiplier) + { + num_points *= multiplier; + args_size[9] = num_points * sizeof(float); + do_opengl_call(glMap2f_func, NULL, CHECK_ARGS(args, args_size)); + } +} + +GLAPI void APIENTRY glMap2d( GLenum target, + GLdouble u1, + GLdouble u2, + GLint ustride, + GLint uorder, + GLdouble v1, + GLdouble v2, + GLint vstride, + GLint vorder, + const GLdouble *points ) +{ + long args[] = { INT_TO_ARG(target), + DOUBLE_TO_ARG(u1), DOUBLE_TO_ARG(u2), + INT_TO_ARG(ustride), INT_TO_ARG(uorder), + DOUBLE_TO_ARG(v1), DOUBLE_TO_ARG(v2), + INT_TO_ARG(vstride), INT_TO_ARG(vorder), + POINTER_TO_ARG(points) }; + int args_size[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + + int num_points = uorder * vorder; + int multiplier = glMap2_get_multiplier(target); + if (multiplier) + { + num_points *= multiplier; + args_size[9] = num_points * sizeof(double); + do_opengl_call(glMap2d_func, NULL, CHECK_ARGS(args, args_size)); + } +} + +static int _glGetMapv_get_n_components( GLenum target, GLenum query) +{ + int dim = get_dimensionnal_evaluator(target); + if (query == GL_COEFF) + { + int orders[2] = { 1, 1 }; + glGetMapiv(target, GL_ORDER, orders); + return orders[0] * orders[1] * ((dim == 1) ? glMap1_get_multiplier(target) : glMap2_get_multiplier(target)); + } + else if (query == GL_ORDER) + { + return dim; + } + else if (query == GL_DOMAIN) + { + return 2 * dim; + } + else + return 0; +} + + +GLAPI void APIENTRY glGetMapdv( GLenum target, GLenum query, GLdouble *v ) +{ + int dim = get_dimensionnal_evaluator(target); + if (dim == 0) return; + long args[] = { INT_TO_ARG(target), INT_TO_ARG(query), POINTER_TO_ARG(v) }; + int args_size[] = { 0, 0, _glGetMapv_get_n_components(target, query) * sizeof(double) }; + do_opengl_call(glGetMapdv_func, NULL, CHECK_ARGS(args, args_size)); +} + +GLAPI void APIENTRY glGetMapfv( GLenum target, GLenum query, GLfloat *v ) +{ + int dim = get_dimensionnal_evaluator(target); + if (dim == 0) return; + long args[] = { INT_TO_ARG(target), INT_TO_ARG(query), POINTER_TO_ARG(v) }; + int args_size[] = { 0, 0, _glGetMapv_get_n_components(target, query) * sizeof(float) }; + do_opengl_call(glGetMapfv_func, NULL, CHECK_ARGS(args, args_size)); +} + +GLAPI void APIENTRY glGetMapiv( GLenum target, GLenum query, GLint *v ) +{ + int dim = get_dimensionnal_evaluator(target); + if (dim == 0) return; + long args[] = { INT_TO_ARG(target), INT_TO_ARG(query), POINTER_TO_ARG(v) }; + int args_size[] = { 0, 0, _glGetMapv_get_n_components(target, query) * sizeof(int) }; + do_opengl_call(glGetMapiv_func, NULL, CHECK_ARGS(args, args_size)); +} + +GLAPI void APIENTRY glBindTexture(GLenum target, GLuint texture) +{ + CHECK_PROC(glBindTexture); + GET_CURRENT_STATE(); + alloc_value(state->textureAllocator, texture); + long args[] = { INT_TO_ARG(target), INT_TO_ARG(texture) }; + if (target == GL_TEXTURE_2D) + { + state->current_server_state.bindTexture2D = texture; + } + else if (target == GL_TEXTURE_RECTANGLE_ARB) + { + state->current_server_state.bindTextureRectangle = texture; + } + do_opengl_call(glBindTexture_func, NULL, args, NULL); +} + +GLAPI void APIENTRY EXT_FUNC(glBindTextureEXT) (GLenum target, GLuint texture) +{ + glFuncTable.fpBindTexture(target, texture); +} + + +GLAPI void APIENTRY glGenTextures( GLsizei n, GLuint *textures ) +{ + CHECK_PROC(glGenTextures); + GET_CURRENT_STATE(); + if (n <= 0) { log_gl("n <= 0\n"); return; } + alloc_range(state->textureAllocator, n, textures); + long args[] = { n }; + do_opengl_call(glGenTextures_fake_func, NULL, args, NULL); +} + +GLAPI void APIENTRY glGenTexturesEXT( GLsizei n, GLuint *textures ) +{ + glFuncTable.fpGenTextures(n, textures); +} + +GLAPI void APIENTRY glDeleteTextures ( GLsizei n, const GLuint *textures ) +{ + CHECK_PROC(glDeleteTextures); + GET_CURRENT_STATE(); + if (n <= 0) { log_gl("n <= 0\n"); return; } + delete_range(state->textureAllocator, n, textures); + long args[] = { INT_TO_ARG(n), POINTER_TO_ARG(textures) }; + do_opengl_call(glDeleteTextures_func, NULL, args, NULL); +} + +GLAPI void APIENTRY glDeleteTexturesEXT ( GLsizei n, const GLuint *textures ) +{ + glFuncTable.fpDeleteTextures(n, textures); +} + +static int getTexImageTypeSizeSimple(int format, int type) +{ + switch (type) + { + case GL_UNSIGNED_BYTE: + case GL_BYTE: + return 1; + + case GL_UNSIGNED_SHORT: + case GL_SHORT: + return 2; + + case GL_UNSIGNED_INT: + case GL_INT: + case GL_UNSIGNED_INT_24_8_EXT: + case GL_FLOAT: + return 4; + + default: + log_gl("unknown texture type %d for texture format %d\n", type, format); + return 0; + } +} + +static int getTexImageFactorFromFormatAndType(int format, int type) +{ + switch (format) + { + case GL_COLOR_INDEX: + case GL_RED: + case GL_GREEN: + case GL_BLUE: + case GL_ALPHA: + case GL_LUMINANCE: + case GL_INTENSITY: + case GL_DEPTH_COMPONENT: + case GL_STENCIL_INDEX: + case GL_DEPTH_STENCIL_EXT: + return 1 * getTexImageTypeSizeSimple(format, type); + break; + + case GL_LUMINANCE_ALPHA: + return 2 * getTexImageTypeSizeSimple(format, type); + break; + + case GL_YCBCR_MESA: + { + switch (type) + { + case GL_UNSIGNED_SHORT_8_8_MESA: + case GL_UNSIGNED_SHORT_8_8_REV_MESA: + return 2; + + default: + log_gl("unknown texture type %d for texture format %d\n", type, format); + return 0; + } + } + + case GL_RGB: + case GL_BGR: + { + switch (type) + { + case GL_UNSIGNED_BYTE: + case GL_BYTE: + return 1 * 3; + + case GL_UNSIGNED_SHORT: + case GL_SHORT: + return 2 * 3; + + case GL_UNSIGNED_INT: + case GL_INT: + case GL_FLOAT: + return 4 * 3; + + case GL_UNSIGNED_BYTE_3_3_2: + case GL_UNSIGNED_BYTE_2_3_3_REV: + return 1; + + case GL_UNSIGNED_SHORT_5_6_5: + case GL_UNSIGNED_SHORT_5_6_5_REV: + case GL_UNSIGNED_SHORT_8_8_MESA: + case GL_UNSIGNED_SHORT_8_8_REV_MESA: + return 2; + + default: + log_gl("unknown texture type %d for texture format %d\n", type, format); + return 0; + } + } + + case GL_RGBA: + case GL_BGRA: + case GL_ABGR_EXT: + { + switch (type) + { + case GL_UNSIGNED_BYTE: + case GL_BYTE: + return 1 * 4; + + case GL_UNSIGNED_SHORT: + case GL_SHORT: + return 2 * 4; + + case GL_UNSIGNED_INT: + case GL_INT: + case GL_FLOAT: + return 4 * 4; + + case GL_UNSIGNED_SHORT_4_4_4_4: + case GL_UNSIGNED_SHORT_4_4_4_4_REV: + case GL_UNSIGNED_SHORT_5_5_5_1: + case GL_UNSIGNED_SHORT_1_5_5_5_REV: + return 2; + + case GL_UNSIGNED_INT_8_8_8_8: + case GL_UNSIGNED_INT_8_8_8_8_REV: + case GL_UNSIGNED_INT_10_10_10_2: + case GL_UNSIGNED_INT_2_10_10_10_REV: + return 4; + + default: + log_gl("unknown texture type %d for texture format %d\n", type, format); + return 0; + } + } + + default: + log_gl("unknown texture format : %d\n", format); + return 0; + } +} + +static void* _calcReadSize(int width, int height, int depth, GLenum format, GLenum type, void* pixels, int* p_size) +{ + int pack_row_length, pack_alignment, pack_skip_rows, pack_skip_pixels; + + glFuncTable.fpGetIntegerv(GL_PACK_ROW_LENGTH, &pack_row_length); + glFuncTable.fpGetIntegerv(GL_PACK_ALIGNMENT, &pack_alignment); + glFuncTable.fpGetIntegerv(GL_PACK_SKIP_ROWS, &pack_skip_rows); + glFuncTable.fpGetIntegerv(GL_PACK_SKIP_PIXELS, &pack_skip_pixels); + + int w = (pack_row_length == 0) ? width : pack_row_length; + int size = ((width * getTexImageFactorFromFormatAndType(format, type) + pack_alignment - 1) & (~(pack_alignment-1))) * depth; + if (height >= 1) + size += ((w * getTexImageFactorFromFormatAndType(format, type) + pack_alignment - 1) & (~(pack_alignment-1)))* (height-1) * depth ; + *p_size = size; + + pixels += (pack_skip_pixels + pack_skip_rows * w) * getTexImageFactorFromFormatAndType(format, type); + + return pixels; +} + +static const void* _calcWriteSize(int width, int height, int depth, GLenum format, GLenum type, const void* pixels, int* p_size) +{ + int unpack_row_length, unpack_alignment, unpack_skip_rows, unpack_skip_pixels; + + glFuncTable.fpGetIntegerv(GL_UNPACK_ROW_LENGTH, &unpack_row_length); + glFuncTable.fpGetIntegerv(GL_UNPACK_ALIGNMENT, &unpack_alignment); + glFuncTable.fpGetIntegerv(GL_UNPACK_SKIP_ROWS, &unpack_skip_rows); + glFuncTable.fpGetIntegerv(GL_UNPACK_SKIP_PIXELS, &unpack_skip_pixels); + + int w = (unpack_row_length == 0) ? width : unpack_row_length; + int size = ((width * getTexImageFactorFromFormatAndType(format, type) + unpack_alignment - 1) & (~(unpack_alignment-1))) * depth; + if (height >= 1) + size += ((w * getTexImageFactorFromFormatAndType(format, type) + unpack_alignment - 1) & (~(unpack_alignment-1))) * (height-1) * depth; + *p_size = size; + + pixels += (unpack_skip_pixels + unpack_skip_rows * w) * getTexImageFactorFromFormatAndType(format, type); + + return pixels; +} + +GLAPI void APIENTRY glTexImage1D(GLenum target, + GLint level, + GLint internalFormat, + GLsizei width, + GLint border, + GLenum format, + GLenum type, + const GLvoid *pixels ) +{ + int size = 0; + if (pixels) + pixels = _calcWriteSize(width, 1, 1, format, type, pixels, &size); + + long args[] = { INT_TO_ARG(target), INT_TO_ARG(level), INT_TO_ARG(internalFormat), + INT_TO_ARG(width), INT_TO_ARG(border), INT_TO_ARG(format), INT_TO_ARG(type), POINTER_TO_ARG(pixels) }; + int args_size[] = { 0, 0, 0, 0, 0, 0, 0, (pixels == NULL) ? 0 : size }; + do_opengl_call(glTexImage1D_func, NULL, CHECK_ARGS(args, args_size)); + +} + +GLAPI void APIENTRY glTexImage1DEXT(GLenum target, + GLint level, + GLint internalFormat, + GLsizei width, + GLint border, + GLenum format, + GLenum type, + const GLvoid *pixels ) +{ + glTexImage1D(target, level, internalFormat, width, border, format, type, pixels); +} + +GLAPI GLint GLAPIENTRY gluBuild2DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels) +{ + int size = 0; + pixels = _calcWriteSize(width, height, 1, format, type, pixels, &size); + long args[] = { INT_TO_ARG(target), INT_TO_ARG(internalFormat), + INT_TO_ARG(width), INT_TO_ARG(height), INT_TO_ARG(format), INT_TO_ARG(type), POINTER_TO_ARG(pixels) }; + int args_size[] = { 0, 0, 0, 0, 0, 0, size }; + do_opengl_call(fake_gluBuild2DMipmaps_func, NULL, CHECK_ARGS(args, args_size)); + return 0; +} + + +GLAPI void APIENTRY glTexImage2D( GLenum target, + GLint level, + GLint internalFormat, + GLsizei width, + GLsizei height, + GLint border, + GLenum format, + GLenum type, + const GLvoid *pixels ) +{ + GET_CURRENT_STATE(); + int i; + int size = 0; + if (pixels) + pixels = _calcWriteSize(width, height, 1, format, type, pixels, &size); + + if (target == GL_TEXTURE_2D) + { + for(i=0;i<state->current_server_state.texture2DCacheDim;i++) + { + if (state->current_server_state.texture2DCache[i].texture == state->current_server_state.bindTexture2D && + state->current_server_state.texture2DCache[i].level == level) + { + state->current_server_state.texture2DCache[i].width = width; + state->current_server_state.texture2DCache[i].height = height; + break; + } + } + if (i == state->current_server_state.texture2DCacheDim) + { + state->current_server_state.texture2DCache = + realloc(state->current_server_state.texture2DCache, sizeof(Texture2DDim) * + (state->current_server_state.texture2DCacheDim + 1)); + i = state->current_server_state.texture2DCacheDim; + state->current_server_state.texture2DCache[i].texture = state->current_server_state.bindTexture2D; + state->current_server_state.texture2DCache[i].level = level; + state->current_server_state.texture2DCache[i].width = width; + state->current_server_state.texture2DCache[i].height = height; + state->current_server_state.texture2DCacheDim++; + } + } + else if (target == GL_PROXY_TEXTURE_2D_EXT) + { + for(i=0;i<state->current_server_state.textureProxy2DCacheDim;i++) + { + if (state->current_server_state.textureProxy2DCache[i].level == level) + { + state->current_server_state.textureProxy2DCache[i].width = width; + state->current_server_state.textureProxy2DCache[i].height = height; + break; + } + } + if (i == state->current_server_state.textureProxy2DCacheDim) + { + state->current_server_state.textureProxy2DCache = + realloc(state->current_server_state.textureProxy2DCache, sizeof(Texture2DDim) * + (state->current_server_state.textureProxy2DCacheDim + 1)); + i = state->current_server_state.textureProxy2DCacheDim; + state->current_server_state.textureProxy2DCache[i].level = level; + state->current_server_state.textureProxy2DCache[i].width = width; + state->current_server_state.textureProxy2DCache[i].height = height; + state->current_server_state.textureProxy2DCacheDim++; + } + } + else if (target == GL_TEXTURE_RECTANGLE_ARB) + { + for(i=0;i<state->current_server_state.textureRectangleCacheDim;i++) + { + if (state->current_server_state.textureRectangleCache[i].texture == state->current_server_state.bindTextureRectangle && + state->current_server_state.textureRectangleCache[i].level == level) + { + state->current_server_state.textureRectangleCache[i].width = width; + state->current_server_state.textureRectangleCache[i].height = height; + break; + } + } + if (i == state->current_server_state.textureRectangleCacheDim) + { + state->current_server_state.textureRectangleCache = + realloc(state->current_server_state.textureRectangleCache, sizeof(Texture2DDim) * + (state->current_server_state.textureRectangleCacheDim + 1)); + i = state->current_server_state.textureRectangleCacheDim; + state->current_server_state.textureRectangleCache[i].texture = state->current_server_state.bindTextureRectangle; + state->current_server_state.textureRectangleCache[i].level = level; + state->current_server_state.textureRectangleCache[i].width = width; + state->current_server_state.textureRectangleCache[i].height = height; + state->current_server_state.textureRectangleCacheDim++; + } + } + else if (target == GL_PROXY_TEXTURE_RECTANGLE_ARB) + { + for(i=0;i<state->current_server_state.textureProxyRectangleCacheDim;i++) + { + if (state->current_server_state.textureProxyRectangleCache[i].level == level) + { + state->current_server_state.textureProxyRectangleCache[i].width = width; + state->current_server_state.textureProxyRectangleCache[i].height = height; + break; + } + } + if (i == state->current_server_state.textureProxyRectangleCacheDim) + { + state->current_server_state.textureProxyRectangleCache = + realloc(state->current_server_state.textureProxyRectangleCache, sizeof(Texture2DDim) * + (state->current_server_state.textureProxyRectangleCacheDim + 1)); + i = state->current_server_state.textureProxyRectangleCacheDim; + state->current_server_state.textureProxyRectangleCache[i].level = level; + state->current_server_state.textureProxyRectangleCache[i].width = width; + state->current_server_state.textureProxyRectangleCache[i].height = height; + state->current_server_state.textureProxyRectangleCacheDim++; + } + } + + + long args[] = { INT_TO_ARG(target), INT_TO_ARG(level), INT_TO_ARG(internalFormat), + INT_TO_ARG(width), INT_TO_ARG(height), INT_TO_ARG(border), INT_TO_ARG(format), INT_TO_ARG(type), POINTER_TO_ARG(pixels) }; + int args_size[] = { 0, 0, 0, 0, 0, 0, 0, 0, (pixels == NULL) ? 0 : size }; + do_opengl_call(glTexImage2D_func, NULL, CHECK_ARGS(args, args_size)); +} + +GLAPI void APIENTRY glTexImage2DEXT(GLenum target, + GLint level, + GLint internalFormat, + GLsizei width, + GLsizei height, + GLint border, + GLenum format, + GLenum type, + const GLvoid *pixels ) +{ + glFuncTable.fpTexImage2D(target, level, internalFormat, width, height, border, format, type, pixels); +} + +GLAPI void APIENTRY glTexImage3D( GLenum target, + GLint level, + GLint internalFormat, + GLsizei width, + GLsizei height, + GLsizei depth, + GLint border, + GLenum format, + GLenum type, + const GLvoid *pixels ) +{ + int size = 0; + if (pixels) + pixels = _calcWriteSize(width, height, depth, format, type, pixels, &size); + + long args[] = { INT_TO_ARG(target), INT_TO_ARG(level), INT_TO_ARG(internalFormat), + INT_TO_ARG(width), INT_TO_ARG(height), INT_TO_ARG(depth), INT_TO_ARG(border), INT_TO_ARG(format), INT_TO_ARG(type), POINTER_TO_ARG(pixels) }; + int args_size[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, (pixels == NULL) ? 0 : size }; + do_opengl_call(glTexImage3D_func, NULL, CHECK_ARGS(args, args_size)); +} + +GLAPI void APIENTRY EXT_FUNC(glTexImage3DEXT)(GLenum target, + GLint level, + GLint internalFormat, + GLsizei width, + GLsizei height, + GLsizei depth, + GLint border, + GLenum format, + GLenum type, + const GLvoid *pixels ) +{ + CHECK_PROC(glTexImage3DEXT); + glTexImage3D(target, level, internalFormat, width, height, depth, border, format, type, pixels); +} + +GLAPI void APIENTRY glTexSubImage1D( GLenum target, + GLint level, + GLint xoffset, + GLsizei width, + GLenum format, + GLenum type, + const GLvoid *pixels ) +{ + int size = 0; + if (pixels) + pixels = _calcWriteSize(width, 1, 1, format, type, pixels, &size); + + long args[] = { INT_TO_ARG(target), INT_TO_ARG(level), INT_TO_ARG(xoffset), + INT_TO_ARG(width), INT_TO_ARG(format), INT_TO_ARG(type), POINTER_TO_ARG(pixels) }; + int args_size[] = { 0, 0, 0, 0, 0, 0, size }; + do_opengl_call(glTexSubImage1D_func, NULL, CHECK_ARGS(args, args_size)); +} + +GLAPI void APIENTRY EXT_FUNC(glTexSubImage1DEXT)( GLenum target, + GLint level, + GLint xoffset, + GLsizei width, + GLenum format, + GLenum type, + const GLvoid *pixels ) +{ + CHECK_PROC(glTexSubImage1DEXT); + glTexSubImage1D(target, level, xoffset, width, format, type, pixels); +} + +GLAPI void APIENTRY glTexSubImage2D( GLenum target, + GLint level, + GLint xoffset, + GLint yoffset, + GLsizei width, + GLsizei height, + GLenum format, + GLenum type, + const GLvoid *pixels ) +{ + int size = 0; + if (pixels) + pixels = _calcWriteSize(width, height, 1, format, type, pixels, &size); + + long args[] = { INT_TO_ARG(target), INT_TO_ARG(level), INT_TO_ARG(xoffset), INT_TO_ARG(yoffset), + INT_TO_ARG(width), INT_TO_ARG(height), INT_TO_ARG(format), INT_TO_ARG(type), POINTER_TO_ARG(pixels) }; + int args_size[] = { 0, 0, 0, 0, 0, 0, 0, 0, size }; + do_opengl_call(glTexSubImage2D_func, NULL, CHECK_ARGS(args, args_size)); +} + +GLAPI void APIENTRY EXT_FUNC(glTexSubImage2DEXT)( GLenum target, + GLint level, + GLint xoffset, + GLint yoffset, + GLsizei width, + GLsizei height, + GLenum format, + GLenum type, + const GLvoid *pixels ) +{ + CHECK_PROC(glTexSubImage2DEXT); + glFuncTable.fpTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels); +} + +GLAPI void APIENTRY glTexSubImage3D( GLenum target, + GLint level, + GLint xoffset, + GLint yoffset, + GLint zoffset, + GLsizei width, + GLsizei height, + GLsizei depth, + GLenum format, + GLenum type, + const GLvoid *pixels ) +{ + int size = 0; + if (pixels) + pixels = _calcWriteSize(width, height, depth, format, type, pixels, &size); + + long args[] = { INT_TO_ARG(target), INT_TO_ARG(level), INT_TO_ARG(xoffset), INT_TO_ARG(yoffset), INT_TO_ARG(zoffset), + INT_TO_ARG(width), INT_TO_ARG(height), INT_TO_ARG(depth), INT_TO_ARG(format), INT_TO_ARG(type), + POINTER_TO_ARG(pixels) }; + int args_size[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, size }; + do_opengl_call(glTexSubImage3D_func, NULL, CHECK_ARGS(args, args_size)); +} + +GLAPI void APIENTRY EXT_FUNC(glTexSubImage3DEXT)( GLenum target, + GLint level, + GLint xoffset, + GLint yoffset, + GLint zoffset, + GLsizei width, + GLsizei height, + GLsizei depth, + GLenum format, + GLenum type, + const GLvoid *pixels ) +{ + CHECK_PROC(glTexSubImage3DEXT); + glTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); +} + +GLAPI void APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLint image) +{ + CHECK_PROC(glEGLImageTargetTexture2DOES); + long args[] = { INT_TO_ARG(target), INT_TO_ARG(image) }; + do_opengl_call(glEGLImageTargetTexture2DOES_fake_func, NULL, args, NULL); +} + +GLAPI void APIENTRY glSelectBuffer( GLsizei size, GLuint *buffer ) +{ + if (size <= 0) return; + GET_CURRENT_STATE(); + state->client_state.selectBufferSize = size; + state->client_state.selectBufferPtr = buffer; + long args[] = { INT_TO_ARG(size) }; + do_opengl_call(_glSelectBuffer_fake_func, NULL, args, NULL); +} + +GLAPI void APIENTRY glFeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer ) +{ + if (size <= 0) return; + GET_CURRENT_STATE(); + state->client_state.feedbackBufferSize = size; + state->client_state.feedbackBufferPtr = buffer; + long args[] = { INT_TO_ARG(size), INT_TO_ARG(type) }; + do_opengl_call(_glFeedbackBuffer_fake_func, NULL, args, NULL); +} + +GLAPI GLint APIENTRY glRenderMode(GLenum mode) +{ + GLint ret; + GET_CURRENT_STATE(); + long args[] = { UNSIGNED_INT_TO_ARG(mode)}; + do_opengl_call(glRenderMode_func, &ret, args, NULL); + if (mode == GL_SELECT && state->client_state.selectBufferPtr) + { + long args[] = { POINTER_TO_ARG(state->client_state.selectBufferPtr) }; + int args_size[] = { state->client_state.selectBufferSize * 4 }; + do_opengl_call(_glGetSelectBuffer_fake_func, NULL, CHECK_ARGS(args, args_size)); + } + else if (mode == GL_FEEDBACK && state->client_state.selectBufferPtr) + { + long args[] = { POINTER_TO_ARG(state->client_state.feedbackBufferPtr) }; + int args_size[] = { state->client_state.feedbackBufferSize * 4 }; + do_opengl_call(_glGetFeedbackBuffer_fake_func, NULL, CHECK_ARGS(args, args_size)); + } + return ret; +} + + +GLAPI void APIENTRY EXT_FUNC(glGetCompressedTexImageARB)(GLenum target, GLint level, GLvoid *img) +{ + CHECK_PROC(glGetCompressedTexImageARB); + + int imageSize = 0; + glFuncTable.fpGetTexLevelParameteriv(target, 0, GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB, &imageSize); + + long args[] = { INT_TO_ARG(target), INT_TO_ARG(level), POINTER_TO_ARG(img) }; + int args_size[] = { 0, 0, imageSize }; + do_opengl_call(glGetCompressedTexImageARB_func, NULL, CHECK_ARGS(args, args_size)); +} + +GLAPI void APIENTRY EXT_FUNC(glGetCompressedTexImage)(GLenum target, GLint level, GLvoid *img) +{ + glGetCompressedTexImageARB(target, level, img); +} + +GLAPI void APIENTRY EXT_FUNC(glCompressedTexImage1DARB)(GLenum target, + GLint level, + GLint internalFormat, + GLsizei width, + GLint border, + GLsizei imageSize, + const GLvoid * data) +{ + CHECK_PROC(glCompressedTexImage1DARB); + long args[] = { INT_TO_ARG(target), INT_TO_ARG(level), INT_TO_ARG(internalFormat), + INT_TO_ARG(width), INT_TO_ARG(border), INT_TO_ARG(imageSize), POINTER_TO_ARG(data) }; + int args_size[] = { 0, 0, 0, 0, 0, 0, imageSize }; + do_opengl_call(glCompressedTexImage1DARB_func, NULL, CHECK_ARGS(args, args_size)); +} + +GLAPI void APIENTRY EXT_FUNC(glCompressedTexImage1D)(GLenum target, + GLint level, + GLenum internalFormat, + GLsizei width, + GLint border, + GLsizei imageSize, + const GLvoid * data) +{ + glCompressedTexImage1DARB(target, level, internalFormat, width, border, imageSize, data); +} + +GLAPI void APIENTRY EXT_FUNC(glCompressedTexImage2DARB)(GLenum target, + GLint level, + GLint internalFormat, + GLsizei width, + GLsizei height, + GLint border, + GLsizei imageSize, + const GLvoid * data) +{ + CHECK_PROC(glCompressedTexImage2DARB); + long args[] = { INT_TO_ARG(target), INT_TO_ARG(level), INT_TO_ARG(internalFormat), + INT_TO_ARG(width), INT_TO_ARG(height), INT_TO_ARG(border), INT_TO_ARG(imageSize), POINTER_TO_ARG(data) }; + int args_size[] = { 0, 0, 0, 0, 0, 0, 0, imageSize }; + do_opengl_call(glCompressedTexImage2DARB_func, NULL, CHECK_ARGS(args, args_size)); +} + +GLAPI void APIENTRY EXT_FUNC(glCompressedTexImage2D)(GLenum target, + GLint level, + GLenum internalFormat, + GLsizei width, + GLsizei height, + GLint border, + GLsizei imageSize, + const GLvoid * data) +{ + glCompressedTexImage2DARB(target, level, internalFormat, width, height, border, imageSize, data); +} + +GLAPI void APIENTRY EXT_FUNC(glCompressedTexImage3DARB)(GLenum target, + GLint level, + GLint internalFormat, + GLsizei width, + GLsizei height, + GLsizei depth, + GLint border, + GLsizei imageSize, + const GLvoid * data) +{ + CHECK_PROC(glCompressedTexImage3DARB); + long args[] = { INT_TO_ARG(target), INT_TO_ARG(level), INT_TO_ARG(internalFormat), + INT_TO_ARG(width), INT_TO_ARG(height), INT_TO_ARG(depth), INT_TO_ARG(border), INT_TO_ARG(imageSize), POINTER_TO_ARG(data) }; + int args_size[] = { 0, 0, 0, 0, 0, 0, 0, 0, imageSize }; + do_opengl_call(glCompressedTexImage3DARB_func, NULL, CHECK_ARGS(args, args_size)); +} + +GLAPI void APIENTRY EXT_FUNC(glCompressedTexImage3D)(GLenum target, + GLint level, + GLenum internalFormat, + GLsizei width, + GLsizei height, + GLsizei depth, + GLint border, + GLsizei imageSize, + const GLvoid * data) +{ + glCompressedTexImage3DARB(target, level, internalFormat, width, height, depth, border, imageSize, data); +} + +GLAPI void APIENTRY EXT_FUNC(glCompressedTexSubImage1DARB)(GLenum target, + GLint level, + GLint xoffset, + GLsizei width, + GLenum format, + GLsizei imageSize, + const GLvoid * data) +{ + CHECK_PROC(glCompressedTexSubImage1DARB); + long args[] = { INT_TO_ARG(target), INT_TO_ARG(level), INT_TO_ARG(xoffset), + INT_TO_ARG(width), INT_TO_ARG(format), INT_TO_ARG(imageSize), POINTER_TO_ARG(data) }; + int args_size[] = { 0, 0, 0, 0, 0, 0, imageSize }; + do_opengl_call(glCompressedTexSubImage1DARB_func, NULL, CHECK_ARGS(args, args_size)); +} + +GLAPI void APIENTRY EXT_FUNC(glCompressedTexSubImage1D)(GLenum target, + GLint level, + GLint xoffset, + GLsizei width, + GLenum format, + GLsizei imageSize, + const GLvoid * data) +{ + glCompressedTexSubImage1DARB(target, level, xoffset, width, format, imageSize, data); +} + +GLAPI void APIENTRY EXT_FUNC(glCompressedTexSubImage2DARB)(GLenum target, + GLint level, + GLint xoffset, + GLint yoffset, + GLsizei width, + GLsizei height, + GLenum format, + GLsizei imageSize, + const GLvoid * data) +{ + CHECK_PROC(glCompressedTexSubImage2DARB); + long args[] = { INT_TO_ARG(target), INT_TO_ARG(level), INT_TO_ARG(xoffset), INT_TO_ARG(yoffset), + INT_TO_ARG(width), INT_TO_ARG(height), INT_TO_ARG(format), INT_TO_ARG(imageSize), POINTER_TO_ARG(data) }; + int args_size[] = { 0, 0, 0, 0, 0, 0, 0, 0, imageSize }; + do_opengl_call(glCompressedTexSubImage2DARB_func, NULL, CHECK_ARGS(args, args_size)); +} + + +GLAPI void APIENTRY EXT_FUNC(glCompressedTexSubImage2D)(GLenum target, + GLint level, + GLint xoffset, + GLint yoffset, + GLsizei width, + GLsizei height, + GLenum format, + GLsizei imageSize, + const GLvoid * data) +{ + glCompressedTexSubImage2DARB(target, level, xoffset, yoffset, width, height, format, imageSize, data); +} + +GLAPI void APIENTRY EXT_FUNC(glCompressedTexSubImage3DARB)(GLenum target, + GLint level, + GLint xoffset, + GLint yoffset, + GLint zoffset, + GLsizei width, + GLsizei height, + GLsizei depth, + GLenum format, + GLsizei imageSize, + const GLvoid * data) +{ + CHECK_PROC(glCompressedTexSubImage3DARB); + long args[] = { INT_TO_ARG(target), INT_TO_ARG(level), INT_TO_ARG(xoffset), INT_TO_ARG(yoffset), INT_TO_ARG(zoffset), + INT_TO_ARG(width), INT_TO_ARG(height), INT_TO_ARG(depth), INT_TO_ARG(format), INT_TO_ARG(imageSize), POINTER_TO_ARG(data) }; + int args_size[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, imageSize }; + do_opengl_call(glCompressedTexSubImage3DARB_func, NULL, CHECK_ARGS(args, args_size)); +} + +GLAPI void APIENTRY EXT_FUNC(glCompressedTexSubImage3D)(GLenum target, + GLint level, + GLint xoffset, + GLint yoffset, + GLint zoffset, + GLsizei width, + GLsizei height, + GLsizei depth, + GLenum format, + GLsizei imageSize, + const GLvoid * data) +{ + glCompressedTexSubImage3DARB(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data); +} + +GLAPI void APIENTRY glGetTexLevelParameteriv( GLenum target, + GLint level, + GLenum pname, + GLint *params ) +{ + int i; + GET_CURRENT_STATE(); + + if (target == GL_TEXTURE_2D && (pname == GL_TEXTURE_WIDTH || pname == GL_TEXTURE_HEIGHT)) + { + for(i=0;i<state->current_server_state.texture2DCacheDim;i++) + { + if (state->current_server_state.texture2DCache[i].texture == state->current_server_state.bindTexture2D && + state->current_server_state.texture2DCache[i].level == level) + { + if (pname == GL_TEXTURE_WIDTH) + { + *params = state->current_server_state.texture2DCache[i].width; + return; + } + if (pname == GL_TEXTURE_HEIGHT) + { + *params = state->current_server_state.texture2DCache[i].height; + return; + } + } + } + } + else if (target == GL_PROXY_TEXTURE_2D_EXT && (pname == GL_TEXTURE_WIDTH || pname == GL_TEXTURE_HEIGHT)) + { + for(i=0;i<state->current_server_state.textureProxy2DCacheDim;i++) + { + if (state->current_server_state.textureProxy2DCache[i].level == level) + { + if (pname == GL_TEXTURE_WIDTH) + { + *params = state->current_server_state.textureProxy2DCache[i].width; + return; + } + if (pname == GL_TEXTURE_HEIGHT) + { + *params = state->current_server_state.textureProxy2DCache[i].height; + return; + } + } + } + } + else if (target == GL_TEXTURE_RECTANGLE_ARB && (pname == GL_TEXTURE_WIDTH || pname == GL_TEXTURE_HEIGHT)) + { + for(i=0;i<state->current_server_state.textureRectangleCacheDim;i++) + { + if (state->current_server_state.textureRectangleCache[i].texture == state->current_server_state.bindTextureRectangle && + state->current_server_state.textureRectangleCache[i].level == level) + { + if (pname == GL_TEXTURE_WIDTH) + { + *params = state->current_server_state.textureRectangleCache[i].width; + return; + } + if (pname == GL_TEXTURE_HEIGHT) + { + *params = state->current_server_state.textureRectangleCache[i].height; + return; + } + } + } + } + else if (target == GL_PROXY_TEXTURE_RECTANGLE_ARB && (pname == GL_TEXTURE_WIDTH || pname == GL_TEXTURE_HEIGHT)) + { + for(i=0;i<state->current_server_state.textureProxyRectangleCacheDim;i++) + { + if (state->current_server_state.textureProxyRectangleCache[i].level == level) + { + if (pname == GL_TEXTURE_WIDTH) + { + *params = state->current_server_state.textureProxyRectangleCache[i].width; + return; + } + if (pname == GL_TEXTURE_HEIGHT) + { + *params = state->current_server_state.textureProxyRectangleCache[i].height; + return; + } + } + } + } + + long args[] = { INT_TO_ARG(target), INT_TO_ARG(level), INT_TO_ARG(pname), POINTER_TO_ARG(params) }; + do_opengl_call(glGetTexLevelParameteriv_func, NULL, args, NULL); + +} + +GLAPI void APIENTRY glGetTexParameterfv( GLenum target, GLenum pname, GLfloat *params ) +{ + if (pname == GL_TEXTURE_MAX_ANISOTROPY_EXT) + *params = 1; + else + { + int size = __glTexParameter_size(get_err_file(), pname); + long args[] = { INT_TO_ARG(target), INT_TO_ARG(pname), POINTER_TO_ARG(params) }; + int args_size[] = { 0, 0, size * sizeof(GLfloat) }; + do_opengl_call(glGetTexParameterfv_func, NULL, CHECK_ARGS(args, args_size)); + } +} + +GLAPI void APIENTRY glFogf(GLenum pname, GLfloat param) +{ + GET_CURRENT_STATE(); + if (pname == GL_FOG_MODE) + state->current_server_state.fog.mode = param; + else if (pname == GL_FOG_DENSITY) + state->current_server_state.fog.density = param; + else if (pname == GL_FOG_START) + state->current_server_state.fog.start = param; + else if (pname == GL_FOG_END) + state->current_server_state.fog.end = param; + else if (pname == GL_FOG_INDEX) + state->current_server_state.fog.index = param; + long args[] = { UNSIGNED_INT_TO_ARG(pname), FLOAT_TO_ARG(param)}; + do_opengl_call(glFogf_func, NULL, args, NULL); +} + +GLAPI void APIENTRY glFogi(GLenum pname, GLint param) +{ + GET_CURRENT_STATE(); + if (pname == GL_FOG_MODE) + state->current_server_state.fog.mode = param; + else if (pname == GL_FOG_DENSITY) + state->current_server_state.fog.density = param; + else if (pname == GL_FOG_START) + state->current_server_state.fog.start = param; + else if (pname == GL_FOG_END) + state->current_server_state.fog.end = param; + else if (pname == GL_FOG_INDEX) + state->current_server_state.fog.index = param; + long args[] = { UNSIGNED_INT_TO_ARG(pname), INT_TO_ARG(param)}; + do_opengl_call(glFogi_func, NULL, args, NULL); +} + + +GLAPI void APIENTRY glFogfv( GLenum pname, const GLfloat *params ) +{ + if (pname != GL_FOG_COLOR) + { + glFuncTable.fpFogf(pname, *params); + return; + } + GET_CURRENT_STATE(); + long args[] = { INT_TO_ARG(pname), POINTER_TO_ARG(params) }; + memcpy(state->current_server_state.fog.color, params, 4 * sizeof(float)); + do_opengl_call(glFogfv_func, NULL, args, NULL); +} + +GLAPI void APIENTRY glFogiv( GLenum pname, const GLint *params ) +{ + if (pname != GL_FOG_COLOR) + { + glFuncTable.fpFogi(pname, *params); + return; + } + long args[] = { INT_TO_ARG(pname), POINTER_TO_ARG(params) }; + do_opengl_call(glFogiv_func, NULL, args, NULL); +} + +GLAPI void APIENTRY glRectdv( const GLdouble *v1, const GLdouble *v2 ) +{ + glRectd(v1[0], v1[1], v2[0], v2[1]); +} +GLAPI void APIENTRY glRectfv( const GLfloat *v1, const GLfloat *v2 ) +{ + glRectf(v1[0], v1[1], v2[0], v2[1]); +} +GLAPI void APIENTRY glRectiv( const GLint *v1, const GLint *v2 ) +{ + glRecti(v1[0], v1[1], v2[0], v2[1]); +} +GLAPI void APIENTRY glRectsv( const GLshort *v1, const GLshort *v2 ) +{ + glRects(v1[0], v1[1], v2[0], v2[1]); +} + + +GLAPI void APIENTRY glBitmap(GLsizei width, + GLsizei height, + GLfloat xorig, + GLfloat yorig, + GLfloat xmove, + GLfloat ymove, + const GLubyte *bitmap ) +{ + GET_CURRENT_STATE(); + int unpack_alignment, unpack_row_length; + glFuncTable.fpGetIntegerv(GL_UNPACK_ROW_LENGTH, &unpack_row_length); + glFuncTable.fpGetIntegerv(GL_UNPACK_ALIGNMENT, &unpack_alignment); + int w = (unpack_row_length == 0) ? width : unpack_row_length; + int size = ((w + unpack_alignment - 1) & (~(unpack_alignment-1))) * height; + long args[] = { INT_TO_ARG(width), INT_TO_ARG(height), FLOAT_TO_ARG(xorig), FLOAT_TO_ARG(yorig), + FLOAT_TO_ARG(xmove), FLOAT_TO_ARG(ymove), POINTER_TO_ARG(bitmap) }; + int args_size[] = { 0, 0, 0, 0, 0, 0, size }; + do_opengl_call(glBitmap_func, NULL, CHECK_ARGS(args, args_size)); + + state->currentRasterPos[0] += xmove; + state->currentRasterPos[1] += ymove; +} + +GLAPI void APIENTRY glGetTexImage( GLenum target, + GLint level, + GLenum format, + GLenum type, + GLvoid *pixels ) +{ + int size = 0, width, height = 1, depth = 1; + if (target == GL_PROXY_TEXTURE_1D || target == GL_PROXY_TEXTURE_2D || target == GL_PROXY_TEXTURE_3D) + { + log_gl("unhandled target : %d\n", target); + return; + } + glFuncTable.fpGetTexLevelParameteriv(target, level, GL_TEXTURE_WIDTH, &width); + if (target == GL_TEXTURE_2D || target == GL_TEXTURE_RECTANGLE_ARB || target == GL_TEXTURE_3D) + glFuncTable.fpGetTexLevelParameteriv(target, level, GL_TEXTURE_HEIGHT, &height); + if (target == GL_TEXTURE_3D) + glFuncTable.fpGetTexLevelParameteriv(target, level, GL_TEXTURE_DEPTH, &depth); + + pixels = _calcReadSize(width, height, depth, format, type, pixels, &size); + + long args[] = { INT_TO_ARG(target), INT_TO_ARG(level), INT_TO_ARG(format), INT_TO_ARG(type), POINTER_TO_ARG(pixels) }; + int args_size[] = { 0, 0, 0, 0, size }; + do_opengl_call(glGetTexImage_func, NULL, CHECK_ARGS(args, args_size)); +} + + +void glReadPixels_no_lock(GLint x, + GLint y, + GLsizei width, + GLsizei height, + GLenum format, + GLenum type, + GLvoid *pixels ) +{ + GET_CURRENT_STATE(); + if (state->pixelPackBuffer) + { + int fake_ret; + long args[] = { INT_TO_ARG(x), INT_TO_ARG(y), INT_TO_ARG(width), INT_TO_ARG(height), + INT_TO_ARG(format), INT_TO_ARG(type), POINTER_TO_ARG(pixels) }; + /* Make it synchronous, otherwise it floods server */ + do_opengl_call_no_lock(_glReadPixels_pbo_func, &fake_ret, args, NULL); + } + else + { + int size = 0; + + pixels = _calcReadSize(width, height, 1, format, type, pixels, &size); + + long args[] = { INT_TO_ARG(x), INT_TO_ARG(y), INT_TO_ARG(width), INT_TO_ARG(height), + INT_TO_ARG(format), INT_TO_ARG(type), POINTER_TO_ARG(pixels) }; + int args_size[] = { 0, 0, 0, 0, 0, 0, size }; + + do_opengl_call_no_lock(glReadPixels_func, NULL, CHECK_ARGS(args, args_size)); + } +} + +GLAPI void APIENTRY glReadPixels(GLint x, + GLint y, + GLsizei width, + GLsizei height, + GLenum format, + GLenum type, + GLvoid *pixels ) +{ + LOCK(glReadPixels_func); + glReadPixels_no_lock(x, y, width, height, format, type, pixels); + UNLOCK(glReadPixels_func); +} + +GLAPI void APIENTRY glDrawPixels(GLsizei width, + GLsizei height, + GLenum format, + GLenum type, + const GLvoid *pixels ) +{ + GET_CURRENT_STATE(); + if (state->pixelUnpackBuffer) + { + long args[] = { INT_TO_ARG(width), INT_TO_ARG(height), + INT_TO_ARG(format), INT_TO_ARG(type), POINTER_TO_ARG(pixels) }; + do_opengl_call(_glDrawPixels_pbo_func, NULL, args, NULL); + } + else + { + int size = 0; + + pixels = _calcWriteSize(width, height, 1, format, type, pixels, &size); + + long args[] = { INT_TO_ARG(width), INT_TO_ARG(height), + INT_TO_ARG(format), INT_TO_ARG(type), POINTER_TO_ARG(pixels) }; + int args_size[] = { 0, 0, 0, 0, size }; + do_opengl_call(glDrawPixels_func, NULL, CHECK_ARGS(args, args_size)); + } +} + +GLAPI void APIENTRY glInterleavedArrays( GLenum format, + GLsizei stride, + const GLvoid *ptr ) +{ + CHECK_PROC(glInterleavedArrays); + GET_CURRENT_STATE(); + if (debug_array_ptr) + log_gl("glInterleavedArrays format=%d stride=%d ptr=%p\n", format, stride, ptr); + state->client_state.arrays.interleavedArrays.format = format; + state->client_state.arrays.interleavedArrays.stride = stride; + state->client_state.arrays.interleavedArrays.ptr = ptr; +} + +GLAPI void APIENTRY glVertexPointer( GLint size, + GLenum type, + GLsizei stride, + const GLvoid *ptr ) +{ + CHECK_PROC(glVertexPointer); + GET_CURRENT_STATE(); + + state->client_state.arrays.vertexArray.vbo_name = state->arrayBuffer; + if (state->client_state.arrays.vertexArray.vbo_name) + { + long args[] = { INT_TO_ARG(size), INT_TO_ARG(type), INT_TO_ARG(stride), POINTER_TO_ARG(ptr) }; + do_opengl_call(_glVertexPointer_buffer_func, NULL, args, NULL); + return; + } + + if (state->client_state.arrays.vertexArray.size == size && + state->client_state.arrays.vertexArray.type == type && + state->client_state.arrays.vertexArray.stride == stride && + state->client_state.arrays.vertexArray.ptr == ptr) + { + } + else + { + if (debug_array_ptr) + log_gl("glVertexPointer size=%d type=%d stride=%d ptr=%p\n", size, type, stride, ptr); + state->client_state.arrays.vertexArray.size = size; + state->client_state.arrays.vertexArray.type = type; + state->client_state.arrays.vertexArray.stride = stride; + state->client_state.arrays.vertexArray.ptr = ptr; + } +} + +DEFINE_EXT(glVertexPointer, (GLint size, GLenum type, GLsizei stride, const GLvoid *ptr), (size, type, stride, ptr)); + +GLAPI void APIENTRY glNormalPointer( GLenum type, + GLsizei stride, + const GLvoid *ptr ) +{ + CHECK_PROC(glNormalPointer); + GET_CURRENT_STATE(); + + state->client_state.arrays.normalArray.vbo_name = state->arrayBuffer; + if (state->client_state.arrays.normalArray.vbo_name) + { + long args[] = { INT_TO_ARG(type), INT_TO_ARG(stride), POINTER_TO_ARG(ptr) }; + do_opengl_call(_glNormalPointer_buffer_func, NULL, args, NULL); + return; + } + + if (state->client_state.arrays.normalArray.type == type && + state->client_state.arrays.normalArray.stride == stride && + state->client_state.arrays.normalArray.ptr == ptr) + { + } + else + { + if (debug_array_ptr) + log_gl("glNormalPointer type=%d stride=%d ptr=%p\n", type, stride, ptr); + state->client_state.arrays.normalArray.size = 3; + state->client_state.arrays.normalArray.type = type; + state->client_state.arrays.normalArray.stride = stride; + state->client_state.arrays.normalArray.ptr = ptr; + } +} + +DEFINE_EXT(glNormalPointer, (GLenum type, GLsizei stride, const GLvoid *ptr), (type, stride, ptr)); + +GLAPI void APIENTRY glIndexPointer( GLenum type, + GLsizei stride, + const GLvoid *ptr ) +{ + CHECK_PROC(glIndexPointer); + GET_CURRENT_STATE(); + + state->client_state.arrays.indexArray.vbo_name = state->arrayBuffer; + if (state->client_state.arrays.indexArray.vbo_name) + { + long args[] = { INT_TO_ARG(type), INT_TO_ARG(stride), POINTER_TO_ARG(ptr) }; + do_opengl_call(_glIndexPointer_buffer_func, NULL, args, NULL); + return; + } + + if (state->client_state.arrays.indexArray.type == type && + state->client_state.arrays.indexArray.stride == stride && + state->client_state.arrays.indexArray.ptr == ptr) + { + } + else + { + if (debug_array_ptr) + log_gl("glIndexPointer type=%d stride=%d ptr=%p\n", type, stride, ptr); + state->client_state.arrays.indexArray.size = 1; + state->client_state.arrays.indexArray.type = type; + state->client_state.arrays.indexArray.stride = stride; + state->client_state.arrays.indexArray.ptr = ptr; + } +} + +DEFINE_EXT(glIndexPointer, (GLenum type, GLsizei stride, const GLvoid *ptr), (type, stride, ptr)); + +GLAPI void APIENTRY glColorPointer( GLint size, + GLenum type, + GLsizei stride, + const GLvoid *ptr ) +{ + CHECK_PROC(glColorPointer); + GET_CURRENT_STATE(); + + state->client_state.arrays.colorArray.vbo_name = state->arrayBuffer; + if (state->client_state.arrays.colorArray.vbo_name) + { + long args[] = { INT_TO_ARG(size), INT_TO_ARG(type), INT_TO_ARG(stride), POINTER_TO_ARG(ptr) }; + do_opengl_call(_glColorPointer_buffer_func, NULL, args, NULL); + return; + } + + if (state->client_state.arrays.colorArray.size == size && + state->client_state.arrays.colorArray.type == type && + state->client_state.arrays.colorArray.stride == stride && + state->client_state.arrays.colorArray.ptr == ptr) + { + } + else + { + if (debug_array_ptr) + log_gl("glColorPointer size=%d type=%d stride=%d ptr=%p\n", size, type, stride, ptr); + state->client_state.arrays.colorArray.size = size; + state->client_state.arrays.colorArray.type = type; + state->client_state.arrays.colorArray.stride = stride; + state->client_state.arrays.colorArray.ptr = ptr; + } +} + +DEFINE_EXT(glColorPointer, (GLint size, GLenum type, GLsizei stride, const GLvoid *ptr), (size, type, stride, ptr)); + +GLAPI void APIENTRY glSecondaryColorPointer( GLint size, + GLenum type, + GLsizei stride, + const GLvoid *ptr ) +{ + CHECK_PROC(glSecondaryColorPointer); + GET_CURRENT_STATE(); + + state->client_state.arrays.secondaryColorArray.vbo_name = state->arrayBuffer; + if (state->client_state.arrays.secondaryColorArray.vbo_name) + { + long args[] = { INT_TO_ARG(size), INT_TO_ARG(type), INT_TO_ARG(stride), POINTER_TO_ARG(ptr) }; + do_opengl_call(_glSecondaryColorPointer_buffer_func, NULL, args, NULL); + return; + } + + if (state->client_state.arrays.secondaryColorArray.size == size && + state->client_state.arrays.secondaryColorArray.type == type && + state->client_state.arrays.secondaryColorArray.stride == stride && + state->client_state.arrays.secondaryColorArray.ptr == ptr) + { + } + else + { + if (debug_array_ptr) + log_gl("glSecondaryColorPointer size=%d type=%d stride=%d ptr=%p\n", size, type, stride, ptr); + state->client_state.arrays.secondaryColorArray.size = size; + state->client_state.arrays.secondaryColorArray.type = type; + state->client_state.arrays.secondaryColorArray.stride = stride; + state->client_state.arrays.secondaryColorArray.ptr = ptr; + } +} + +DEFINE_EXT(glSecondaryColorPointer, (GLint size, GLenum type, GLsizei stride, const GLvoid *ptr), (size, type, stride, ptr)); + +GLAPI void APIENTRY glTexCoordPointer( GLint size, GLenum type, GLsizei stride, const GLvoid *ptr ) +{ + CHECK_PROC(glTexCoordPointer); + GET_CURRENT_STATE(); + + state->client_state.arrays.texCoordArray[state->client_state.clientActiveTexture].vbo_name = state->arrayBuffer; + if (state->client_state.arrays.texCoordArray[state->client_state.clientActiveTexture].vbo_name) + { + long args[] = { INT_TO_ARG(size), INT_TO_ARG(type), INT_TO_ARG(stride), POINTER_TO_ARG(ptr) }; + do_opengl_call(_glTexCoordPointer_buffer_func, NULL, args, NULL); + return; + } + + if (state->client_state.arrays.texCoordArray[state->client_state.clientActiveTexture].size == size && + state->client_state.arrays.texCoordArray[state->client_state.clientActiveTexture].type == type && + state->client_state.arrays.texCoordArray[state->client_state.clientActiveTexture].stride == stride && + state->client_state.arrays.texCoordArray[state->client_state.clientActiveTexture].ptr == ptr) + { + } + else + { + if (debug_array_ptr) + log_gl("glTexCoordPointer[%d] size=%d type=%d stride=%d ptr=%p\n", + state->client_state.clientActiveTexture, size, type, stride, ptr); + state->client_state.arrays.texCoordArray[state->client_state.clientActiveTexture].index = + state->client_state.clientActiveTexture; + state->client_state.arrays.texCoordArray[state->client_state.clientActiveTexture].size = size; + state->client_state.arrays.texCoordArray[state->client_state.clientActiveTexture].type = type; + state->client_state.arrays.texCoordArray[state->client_state.clientActiveTexture].stride = stride; + state->client_state.arrays.texCoordArray[state->client_state.clientActiveTexture].ptr = ptr; + } +} + +DEFINE_EXT(glTexCoordPointer, (GLint size, GLenum type, GLsizei stride, const GLvoid *ptr), (size, type, stride, ptr)); + +GLAPI void APIENTRY glEdgeFlagPointer( GLsizei stride, const GLvoid *ptr ) +{ + CHECK_PROC(glEdgeFlagPointer); + GET_CURRENT_STATE(); + + state->client_state.arrays.edgeFlagArray.vbo_name = state->arrayBuffer; + if (state->client_state.arrays.edgeFlagArray.vbo_name) + { + long args[] = { INT_TO_ARG(stride), POINTER_TO_ARG(ptr) }; + do_opengl_call(_glEdgeFlagPointer_buffer_func, NULL, args, NULL); + return; + } + + if (state->client_state.arrays.edgeFlagArray.stride == stride && + state->client_state.arrays.edgeFlagArray.ptr == ptr) + { + } + else + { + if (debug_array_ptr) + log_gl("edgeFlagArray stride=%d ptr=%p\n", stride, ptr); + state->client_state.arrays.edgeFlagArray.size = 1; + state->client_state.arrays.edgeFlagArray.type = GL_BYTE; + state->client_state.arrays.edgeFlagArray.stride = stride; + state->client_state.arrays.edgeFlagArray.ptr = ptr; + } +} + +DEFINE_EXT(glEdgeFlagPointer, (GLsizei stride, const GLvoid *ptr), (stride, ptr)); + +GLAPI void APIENTRY glFogCoordPointer(GLenum type, GLsizei stride, const GLvoid *ptr) +{ + CHECK_PROC(glFogCoordPointer); + GET_CURRENT_STATE(); + + state->client_state.arrays.fogCoordArray.vbo_name = state->arrayBuffer; + if (state->client_state.arrays.fogCoordArray.vbo_name) + { + long args[] = { INT_TO_ARG(type), INT_TO_ARG(stride), POINTER_TO_ARG(ptr) }; + do_opengl_call(_glFogCoordPointer_buffer_func, NULL, args, NULL); + return; + } + + if (state->client_state.arrays.fogCoordArray.type == type && + state->client_state.arrays.fogCoordArray.stride == stride && + state->client_state.arrays.fogCoordArray.ptr == ptr) + { + } + else + { + if (debug_array_ptr) + log_gl("glFogCoordPointer type=%d stride=%d ptr=%p\n", type, stride, ptr); + state->client_state.arrays.fogCoordArray.size = 1; + state->client_state.arrays.fogCoordArray.type = type; + state->client_state.arrays.fogCoordArray.stride = stride; + state->client_state.arrays.fogCoordArray.ptr = ptr; + } +} + +DEFINE_EXT(glFogCoordPointer, (GLenum type, GLsizei stride, const GLvoid *ptr), (type, stride, ptr)); + +GLAPI void APIENTRY glWeightPointerARB (GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) +{ + CHECK_PROC(glWeightPointerARB); + GET_CURRENT_STATE(); + + state->client_state.arrays.weightArray.vbo_name = state->arrayBuffer; + if (state->client_state.arrays.weightArray.vbo_name) + { + long args[] = { INT_TO_ARG(size), INT_TO_ARG(type), INT_TO_ARG(stride), POINTER_TO_ARG(ptr) }; + do_opengl_call(_glWeightPointerARB_buffer_func, NULL, args, NULL); + return; + } + + log_gl("glWeightPointerARB\n"); + fflush(get_err_file()); + if (debug_array_ptr) + log_gl("weightArray size=%d type=%d stride=%d ptr=%p\n", size, type, stride, ptr); + state->client_state.arrays.weightArray.size = size; + state->client_state.arrays.weightArray.type = type; + state->client_state.arrays.weightArray.stride = stride; + state->client_state.arrays.weightArray.ptr = ptr; +} + + +GLAPI void APIENTRY glMatrixIndexPointerARB (GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) +{ + CHECK_PROC(glMatrixIndexPointerARB); + GET_CURRENT_STATE(); + + state->client_state.arrays.matrixIndexArray.vbo_name = state->arrayBuffer; + if (state->client_state.arrays.matrixIndexArray.vbo_name) + { + long args[] = { INT_TO_ARG(size), INT_TO_ARG(type), INT_TO_ARG(stride), POINTER_TO_ARG(ptr) }; + do_opengl_call(_glMatrixIndexPointerARB_buffer_func, NULL, args, NULL); + return; + } + + log_gl("glMatrixIndexPointerARB\n"); + fflush(get_err_file()); + if (debug_array_ptr) + log_gl("matrixIndexArray size=%d type=%d stride=%d ptr=%p\n", size, type, stride, ptr); + state->client_state.arrays.matrixIndexArray.size = size; + state->client_state.arrays.matrixIndexArray.type = type; + state->client_state.arrays.matrixIndexArray.stride = stride; + state->client_state.arrays.matrixIndexArray.ptr = ptr; +} + +#define glMatrixIndexvARB(name, type) \ +GLAPI void APIENTRY name (GLint size, const type *indices) \ +{ \ + CHECK_PROC(name); \ + long args[] = { INT_TO_ARG(size), POINTER_TO_ARG(indices) }; \ + int args_size[] = { 0, size * sizeof(type) }; \ + do_opengl_call(CONCAT(name, _func), NULL, CHECK_ARGS(args, args_size)); \ +} + +glMatrixIndexvARB(glMatrixIndexubvARB, GLubyte); +glMatrixIndexvARB(glMatrixIndexusvARB, GLushort); +glMatrixIndexvARB(glMatrixIndexuivARB, GLuint); + + +GLAPI void APIENTRY glVertexWeightfEXT (GLfloat weight) +{ + log_gl("glVertexWeightfEXT : deprecated API. unimplemented\n"); +} + +GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *weight) +{ + log_gl("glVertexWeightfvEXT : deprecated API. unimplemented\n"); +} + +GLAPI void APIENTRY glVertexWeightPointerEXT (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer) +{ + log_gl("glVertexWeightPointerEXT : deprecated API. unimplemented\n"); +} + + + +GLAPI void APIENTRY EXT_FUNC(glVertexAttribPointerARB)(GLuint index, + GLint size, + GLenum type, + GLboolean normalized, + GLsizei stride, + const GLvoid *ptr) +{ + CHECK_PROC(glVertexAttribPointerARB); + + GET_CURRENT_STATE(); + if (index < MY_GL_MAX_VERTEX_ATTRIBS_ARB) + { + state->client_state.arrays.vertexAttribArray[index].vbo_name = state->arrayBuffer; + if (state->client_state.arrays.vertexAttribArray[index].vbo_name) + { + long args[] = { INT_TO_ARG(index), INT_TO_ARG(size), INT_TO_ARG(type), INT_TO_ARG(normalized), INT_TO_ARG(stride), POINTER_TO_ARG(ptr) }; + do_opengl_call(_glVertexAttribPointerARB_buffer_func, NULL, args, NULL); + return; + } + + if (debug_array_ptr) + log_gl("glVertexAttribPointerARB[%d] size=%d type=%d normalized=%d stride=%d ptr=%p\n", + index, size, type, normalized, stride, ptr); + state->client_state.arrays.vertexAttribArray[index].index = index; + state->client_state.arrays.vertexAttribArray[index].size = size; + state->client_state.arrays.vertexAttribArray[index].type = type; + state->client_state.arrays.vertexAttribArray[index].normalized = normalized; + state->client_state.arrays.vertexAttribArray[index].stride = stride; + state->client_state.arrays.vertexAttribArray[index].ptr = ptr; + } + else + { + log_gl("%s: index >= MY_GL_MAX_VERTEX_ATTRIBS_ARB. (index = %d; MAX=%d)\n", + "3", + index, MY_GL_MAX_VERTEX_ATTRIBS_ARB); + } +} + +GLAPI void APIENTRY EXT_FUNC(glVertexAttribPointer)(GLuint index, + GLint size, + GLenum type, + GLboolean normalized, + GLsizei stride, + const GLvoid *ptr) +{ + glVertexAttribPointerARB(index, size, type, normalized, stride, ptr); +} + +GLAPI void APIENTRY EXT_FUNC(glVertexAttribPointerNV)(GLuint index, + GLint size, + GLenum type, + GLsizei stride, + const GLvoid *ptr) +{ + CHECK_PROC(glVertexAttribPointerNV); + + GET_CURRENT_STATE(); + if (index < MY_GL_MAX_VERTEX_ATTRIBS_NV) + { + if (debug_array_ptr) + log_gl("glVertexAttribPointerNV[%d] size=%d type=%d stride=%d ptr=%p\n", + index, size, type, stride, ptr); + state->client_state.arrays.vertexAttribArrayNV[index].index = index; + state->client_state.arrays.vertexAttribArrayNV[index].size = size; + state->client_state.arrays.vertexAttribArrayNV[index].type = type; + state->client_state.arrays.vertexAttribArrayNV[index].stride = stride; + state->client_state.arrays.vertexAttribArrayNV[index].ptr = ptr; + } + else + { + log_gl("index >= MY_GL_MAX_VERTEX_ATTRIBS_NV\n"); + } +} + +GLAPI void APIENTRY EXT_FUNC(glElementPointerATI) (GLenum type, const GLvoid * ptr) +{ + CHECK_PROC(glElementPointerATI); + GET_CURRENT_STATE(); + state->client_state.arrays.elementArrayATI.size = 1; + state->client_state.arrays.elementArrayATI.type = type; + state->client_state.arrays.elementArrayATI.stride = 0; + state->client_state.arrays.elementArrayATI.ptr = ptr; +} + +GLAPI void APIENTRY glGetPointerv( GLenum pname, void **params ) +{ + GET_CURRENT_STATE(); + switch (pname) + { + case GL_COLOR_ARRAY_POINTER: *params = (void*)state->client_state.arrays.colorArray.ptr; break; + case GL_SECONDARY_COLOR_ARRAY_POINTER: *params = (void*)state->client_state.arrays.secondaryColorArray.ptr; break; + case GL_NORMAL_ARRAY_POINTER: *params = (void*)state->client_state.arrays.normalArray.ptr; break; + case GL_INDEX_ARRAY_POINTER: *params = (void*)state->client_state.arrays.indexArray.ptr; break; + case GL_TEXTURE_COORD_ARRAY_POINTER: *params = (void*)state->client_state.arrays.texCoordArray[state->client_state.clientActiveTexture].ptr; break; + case GL_VERTEX_ARRAY_POINTER: *params = (void*)state->client_state.arrays.vertexArray.ptr; break; + case GL_EDGE_FLAG_ARRAY_POINTER: *params = (void*)state->client_state.arrays.edgeFlagArray.ptr; break; + case GL_WEIGHT_ARRAY_POINTER_ARB: *params = (void*)state->client_state.arrays.weightArray.ptr; break; + case GL_MATRIX_INDEX_ARRAY_POINTER_ARB: *params = (void*)state->client_state.arrays.matrixIndexArray.ptr; break; + case GL_FOG_COORD_ARRAY_POINTER: *params = (void*)state->client_state.arrays.fogCoordArray.ptr; break; + case GL_ELEMENT_ARRAY_POINTER_ATI: *params = (void*)state->client_state.arrays.elementArrayATI.ptr; break; + case GL_SELECTION_BUFFER_POINTER: *params = (void*)state->client_state.selectBufferPtr; break; + case GL_FEEDBACK_BUFFER_POINTER: *params = (void*)state->client_state.feedbackBufferPtr; break; + default: + { + log_gl("not yet handled pname %d\n", pname); + *params = NULL; + } + } +} + +GLAPI void APIENTRY glGetPointervEXT( GLenum pname, void **params ) +{ + glFuncTable.fpGetPointerv(pname, params); +} + +GLAPI void APIENTRY EXT_FUNC(glGetVertexAttribPointervARB)(GLuint index, + GLenum pname, + GLvoid **pointer) +{ + GET_CURRENT_STATE(); + + if (index >= MY_GL_MAX_VERTEX_ATTRIBS_ARB) + { + log_gl("%s: index >= MY_GL_MAX_VERTEX_ATTRIBS_ARB. (index = %d; MAX=%d)\n", + "4", + index, MY_GL_MAX_VERTEX_ATTRIBS_ARB); + return; + } + + switch (pname) + { + case GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB: + { + *pointer = (void*)state->client_state.arrays.vertexAttribArray[index].ptr; + break; + } + default: + log_gl("glGetVertexAttribPointervARB : bad pname=0x%X", pname); + break; + } +} + +GLAPI void APIENTRY EXT_FUNC(glGetVertexAttribPointerv)(GLuint index, + GLenum pname, + GLvoid **pointer) +{ + glGetVertexAttribPointervARB(index, pname, pointer); +} + +GLAPI void APIENTRY EXT_FUNC(_glGetVertexAttribiv)(int func_number, GLuint index, GLenum pname, GLint *params) +{ + if (index >= MY_GL_MAX_VERTEX_ATTRIBS_ARB) + { + log_gl("%s: index >= MY_GL_MAX_VERTEX_ATTRIBS_ARB. (index = %d; MAX=%d)\n", + tab_opengl_calls_name[func_number], + index, MY_GL_MAX_VERTEX_ATTRIBS_ARB); + return; + } + + GET_CURRENT_STATE(); + switch (pname) + { + case GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB: + *params = state->client_state.arrays.vertexAttribArray[index].enabled; + break; + case GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB: + *params = state->client_state.arrays.vertexAttribArray[index].size; + break; + case GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB: + *params = state->client_state.arrays.vertexAttribArray[index].stride; + break; + case GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB: + *params = state->client_state.arrays.vertexAttribArray[index].type; + break; + case GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB: + *params = state->client_state.arrays.vertexAttribArray[index].normalized; + break; + case GL_CURRENT_VERTEX_ATTRIB_ARB: + *params = state->client_state.arrays.vertexAttribArray[index].vbo_name; + break; + default: + log_gl("%s : bad pname=0x%X", tab_opengl_calls_name[func_number], pname); + break; + } +} + +#define DEFINE_glGetVertexAttribv(funcName, type) \ +GLAPI void APIENTRY EXT_FUNC(funcName)(GLuint index, GLenum pname, type *params) \ +{ \ + CHECK_PROC(funcName); \ + if (pname == GL_CURRENT_VERTEX_ATTRIB_ARB) \ + { \ + long args[] = { UNSIGNED_INT_TO_ARG(index), UNSIGNED_INT_TO_ARG(pname), POINTER_TO_ARG(params)}; \ + do_opengl_call(CONCAT(funcName,_func), NULL, args, NULL); \ + return; \ + } \ + int i_params; \ + _glGetVertexAttribiv(CONCAT(funcName,_func), index, pname, &i_params); \ + *params = i_params; \ +} + +DEFINE_glGetVertexAttribv(glGetVertexAttribivARB, GLint); +DEFINE_glGetVertexAttribv(glGetVertexAttribiv, GLint); +DEFINE_glGetVertexAttribv(glGetVertexAttribfvARB, GLfloat); +DEFINE_glGetVertexAttribv(glGetVertexAttribfv, GLfloat); +DEFINE_glGetVertexAttribv(glGetVertexAttribdvARB, GLdouble); +DEFINE_glGetVertexAttribv(glGetVertexAttribdv, GLdouble); + + +GLAPI void APIENTRY EXT_FUNC(glGetVertexAttribPointervNV)(GLuint index, + GLenum pname, + GLvoid **pointer) +{ + CHECK_PROC(glGetVertexAttribPointervNV); + GET_CURRENT_STATE(); + if (index >= MY_GL_MAX_VERTEX_ATTRIBS_NV) + { + log_gl("index >= MY_GL_MAX_VERTEX_ATTRIBS_NV\n"); + return; + } + switch (pname) + { + case GL_ATTRIB_ARRAY_POINTER_NV: + { + *pointer = (void*)state->client_state.arrays.vertexAttribArrayNV[index].ptr; + break; + } + default: + log_gl("glGetVertexAttribPointervNV : bad pname=0x%X", pname); + break; + } +} + +static int getGlTypeByteSize(int type) +{ + switch(type) + { + case GL_BYTE: + case GL_UNSIGNED_BYTE: + return 1; + break; + + case GL_SHORT: + case GL_UNSIGNED_SHORT: + return 2; + break; + + case GL_INT: + case GL_UNSIGNED_INT: + case GL_FLOAT: + return 4; + break; + + case GL_DOUBLE: + return 8; + break; + + default: + log_gl("unsupported type = %d\n", type); + return 0; + } +} + +static int getMulFactorFromPointerArray(ClientArray* array) +{ + if (array->stride) + return array->stride; + + return getGlTypeByteSize(array->type) * array->size; +} + + +static void _glArraySend(GLState* state, const char* func_name, int func, ClientArray* array, int first, int last) +{ + if (array->ptr == NULL || array->vbo_name || array->enabled == 0) return; + int offset = first * getMulFactorFromPointerArray(array); + int size = (last - first + 1) * getMulFactorFromPointerArray(array); + if (size == 0) return; + + int currentArrayBuffer = state->arrayBuffer; + if (currentArrayBuffer) + { + glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0); + } + switch(func) + { + case glEdgeFlagPointer_fake_func: + { + long args[] = { INT_TO_ARG(offset), + INT_TO_ARG(array->stride), + INT_TO_ARG(size), + POINTER_TO_ARG(array->ptr + offset) }; + int args_size[] = { 0, 0, 0, size}; + do_opengl_call(func, NULL, CHECK_ARGS(args, args_size)); + break; + } + + case glNormalPointer_fake_func: + case glIndexPointer_fake_func: + case glFogCoordPointer_fake_func: + { + long args[] = { INT_TO_ARG(offset), + INT_TO_ARG(array->type), + INT_TO_ARG(array->stride), + INT_TO_ARG(size), + POINTER_TO_ARG(array->ptr + offset) }; + int args_size[] = { 0, 0, 0, 0, size}; + do_opengl_call(func, NULL, CHECK_ARGS(args, args_size)); + break; + } + + case glVertexPointer_fake_func: + case glColorPointer_fake_func: + case glSecondaryColorPointer_fake_func: + case glWeightPointerARB_fake_func: + case glMatrixIndexPointerARB_fake_func: + { + long args[] = { INT_TO_ARG(offset), + INT_TO_ARG(array->size), + INT_TO_ARG(array->type), + INT_TO_ARG(array->stride), + INT_TO_ARG(size), + POINTER_TO_ARG(array->ptr + offset) }; + int args_size[] = { 0, 0, 0, 0, 0, size}; + do_opengl_call(func, NULL, CHECK_ARGS(args, args_size)); + break; + } + + case glTexCoordPointer_fake_func: + case glVertexAttribPointerNV_fake_func: + { + long args[] = { INT_TO_ARG(offset), + INT_TO_ARG(array->index), + INT_TO_ARG(array->size), + INT_TO_ARG(array->type), + INT_TO_ARG(array->stride), + INT_TO_ARG(size), + POINTER_TO_ARG(array->ptr + offset) }; + int args_size[] = { 0, 0, 0, 0, 0, 0, size}; + do_opengl_call(func, NULL, CHECK_ARGS(args, args_size)); + break; + } + + case glVertexAttribPointerARB_fake_func: + { + long args[] = { INT_TO_ARG(offset), + INT_TO_ARG(array->index), + INT_TO_ARG(array->size), + INT_TO_ARG(array->type), + INT_TO_ARG(array->normalized), + INT_TO_ARG(array->stride), + INT_TO_ARG(size), + POINTER_TO_ARG(array->ptr + offset) }; + int args_size[] = { 0, 0, 0, 0, 0, 0, 0, size}; + do_opengl_call(func, NULL, CHECK_ARGS(args, args_size)); + break; + } + + case glVariantPointerEXT_fake_func: + { + long args[] = { INT_TO_ARG(offset), + INT_TO_ARG(array->index), + INT_TO_ARG(array->type), + INT_TO_ARG(array->stride), + INT_TO_ARG(size), + POINTER_TO_ARG(array->ptr + offset) }; + int args_size[] = { 0, 0, 0, 0, 0, size}; + do_opengl_call(func, NULL, CHECK_ARGS(args, args_size)); + break; + } + + default: + log_gl("shoudln't reach that point\n"); + break; + } + + if (currentArrayBuffer) + { + glBindBufferARB(GL_ARRAY_BUFFER_ARB, currentArrayBuffer); + } +} + + +#define ARRAY_SEND_FUNC(x) #x, CONCAT(x,_fake_func) + +static int _calc_interleaved_arrays_stride(GLenum format) +{ + switch(format) + { + case GL_V2F: return 2 * sizeof(float); break; + case GL_V3F: return 3 * sizeof(float); break; + case GL_C4UB_V2F: return 4 * sizeof(char) + 2 * sizeof(float); break; + case GL_C4UB_V3F: return 4 * sizeof(char) + 3 * sizeof(float); break; + case GL_C3F_V3F: return 3 * sizeof(float) + 3 * sizeof(float); break; + case GL_N3F_V3F: return 3 * sizeof(float) + 3 * sizeof(float); break; + case GL_C4F_N3F_V3F: return 4 * sizeof(float) + 3 * sizeof(float) + 3 * sizeof(float); break; + case GL_T2F_V3F: return 2 * sizeof(float) + 3 * sizeof(float); break; + case GL_T4F_V4F: return 4 * sizeof(float) + 4 * sizeof(float); break; + case GL_T2F_C4UB_V3F: return 2 * sizeof(float) + 4 * sizeof(char) + 3 * sizeof(float); break; + case GL_T2F_C3F_V3F: return 2 * sizeof(float) + 3 * sizeof(float) + 3 * sizeof(float); break; + case GL_T2F_N3F_V3F: return 2 * sizeof(float) + 3 * sizeof(float) + 3 * sizeof(float); break; + case GL_T2F_C4F_N3F_V3F: return 2 * sizeof(float) + 4 * sizeof(float) + 3 * sizeof(float) + 3 * sizeof(float); break; + case GL_T4F_C4F_N3F_V4F: return 4 * sizeof(float) + 4 * sizeof(float) + 3 * sizeof(float) + 4 * sizeof(float); break; + default: log_gl("unknown interleaved array format : %d\n", format); return 0; + } +} + +enum +{ + TEXCOORD_FUNC, + COLOR_FUNC, + NORMAL_FUNC, + INDEX_FUNC, + VERTEX_FUNC +}; + +typedef void (*vector_func_type)(const void*); + +typedef struct +{ + int type; + int size; + int typeFunc; + vector_func_type vector_func; +} VectorFuncStruct; + +VectorFuncStruct vectorFuncArray[] = +{ + { GL_DOUBLE, 1, TEXCOORD_FUNC, (vector_func_type)glTexCoord1dv }, + { GL_DOUBLE, 2, TEXCOORD_FUNC, (vector_func_type)glTexCoord2dv }, + { GL_DOUBLE, 3, TEXCOORD_FUNC, (vector_func_type)glTexCoord3dv }, + { GL_DOUBLE, 4, TEXCOORD_FUNC, (vector_func_type)glTexCoord4dv }, + { GL_FLOAT, 1, TEXCOORD_FUNC, (vector_func_type)glTexCoord1fv }, + { GL_FLOAT, 2, TEXCOORD_FUNC, (vector_func_type)glTexCoord2fv }, + { GL_FLOAT, 3, TEXCOORD_FUNC, (vector_func_type)glTexCoord3fv }, + { GL_FLOAT, 4, TEXCOORD_FUNC, (vector_func_type)glTexCoord4fv }, + { GL_INT, 1, TEXCOORD_FUNC, (vector_func_type)glTexCoord1iv }, + { GL_INT, 2, TEXCOORD_FUNC, (vector_func_type)glTexCoord2iv }, + { GL_INT, 3, TEXCOORD_FUNC, (vector_func_type)glTexCoord3iv }, + { GL_INT, 4, TEXCOORD_FUNC, (vector_func_type)glTexCoord4iv }, + { GL_SHORT, 1, TEXCOORD_FUNC, (vector_func_type)glTexCoord1sv }, + { GL_SHORT, 2, TEXCOORD_FUNC, (vector_func_type)glTexCoord2sv }, + { GL_SHORT, 3, TEXCOORD_FUNC, (vector_func_type)glTexCoord3sv }, + { GL_SHORT, 4, TEXCOORD_FUNC, (vector_func_type)glTexCoord4sv }, + + { GL_BYTE, 3, COLOR_FUNC, (vector_func_type)glColor3bv }, + { GL_DOUBLE, 3, COLOR_FUNC, (vector_func_type)glColor3dv }, + { GL_FLOAT, 3, COLOR_FUNC, (vector_func_type)glColor3fv }, + { GL_INT, 3, COLOR_FUNC, (vector_func_type)glColor3iv }, + { GL_SHORT, 3, COLOR_FUNC, (vector_func_type)glColor3sv }, + { GL_UNSIGNED_BYTE, 3, COLOR_FUNC, (vector_func_type)glColor3ubv }, + { GL_UNSIGNED_INT, 3, COLOR_FUNC, (vector_func_type)glColor3uiv }, + { GL_UNSIGNED_SHORT, 3, COLOR_FUNC, (vector_func_type)glColor3usv }, + { GL_BYTE, 4, COLOR_FUNC, (vector_func_type)glColor4bv }, + { GL_DOUBLE, 4, COLOR_FUNC, (vector_func_type)glColor4dv }, + { GL_FLOAT, 4, COLOR_FUNC, (vector_func_type)glColor4fv }, + { GL_INT, 4, COLOR_FUNC, (vector_func_type)glColor4iv }, + { GL_SHORT, 4, COLOR_FUNC, (vector_func_type)glColor4sv }, + { GL_UNSIGNED_BYTE, 4, COLOR_FUNC, (vector_func_type)glColor4ubv }, + { GL_UNSIGNED_INT, 4, COLOR_FUNC, (vector_func_type)glColor4uiv }, + { GL_UNSIGNED_SHORT, 4, COLOR_FUNC, (vector_func_type)glColor4usv }, + + { GL_BYTE, 3, NORMAL_FUNC, (vector_func_type)glNormal3bv }, + { GL_DOUBLE, 3, NORMAL_FUNC, (vector_func_type)glNormal3dv }, + { GL_FLOAT, 3, NORMAL_FUNC, (vector_func_type)glNormal3fv }, + { GL_INT, 3, NORMAL_FUNC, (vector_func_type)glNormal3iv }, + { GL_SHORT, 3, NORMAL_FUNC, (vector_func_type)glNormal3sv }, + + { GL_DOUBLE, 1, INDEX_FUNC, (vector_func_type)glIndexdv }, + { GL_FLOAT, 1, INDEX_FUNC, (vector_func_type)glIndexfv }, + { GL_INT, 1, INDEX_FUNC, (vector_func_type)glIndexiv }, + { GL_SHORT, 1, INDEX_FUNC, (vector_func_type)glIndexsv }, + { GL_UNSIGNED_BYTE, 1, INDEX_FUNC, (vector_func_type)glIndexubv }, + + { GL_DOUBLE, 2, VERTEX_FUNC, (vector_func_type)glVertex2dv }, + { GL_FLOAT, 2, VERTEX_FUNC, (vector_func_type)glVertex2fv }, + { GL_INT, 2, VERTEX_FUNC, (vector_func_type)glVertex2iv }, + { GL_SHORT, 2, VERTEX_FUNC, (vector_func_type)glVertex2sv }, + { GL_DOUBLE, 3, VERTEX_FUNC, (vector_func_type)glVertex3dv }, + { GL_FLOAT, 3, VERTEX_FUNC, (vector_func_type)glVertex3fv }, + { GL_INT, 3, VERTEX_FUNC, (vector_func_type)glVertex3iv }, + { GL_SHORT, 4, VERTEX_FUNC, (vector_func_type)glVertex4sv }, + { GL_DOUBLE, 4, VERTEX_FUNC, (vector_func_type)glVertex4dv }, + { GL_FLOAT, 4, VERTEX_FUNC, (vector_func_type)glVertex4fv }, + { GL_INT, 4, VERTEX_FUNC, (vector_func_type)glVertex4iv }, + { GL_SHORT, 4, VERTEX_FUNC, (vector_func_type)glVertex4sv }, +}; + +static vector_func_type _get_vector_func(int type, int size, int typeFunc) +{ + int i; + for(i=0;i<sizeof(vectorFuncArray)/sizeof(vectorFuncArray[0]);i++) + { + if (vectorFuncArray[i].type == type && + vectorFuncArray[i].size == size && + vectorFuncArray[i].typeFunc == typeFunc) + return vectorFuncArray[i].vector_func; + } + log_gl("can't find vector_func(type=%X, size=%d, typeFunc=%d)\n", type, size, typeFunc); + return NULL; +} + +static void _glElementArrayImmediate_one(ClientArray* array, int indice, int typeFunc) +{ + if (array->enabled) + { + vector_func_type vector_func = + _get_vector_func(array->type, array->size, typeFunc); + if (vector_func) + { + vector_func(array->ptr + getMulFactorFromPointerArray(array) * indice); + } + } +} + +static void _glElementArrayImmediate(int indice) +{ + GET_CURRENT_STATE(); + + if (state->client_state.arrays.interleavedArrays.ptr != NULL && + state->client_state.arrays.vertexArray.ptr == NULL) + { + GLboolean tflag, cflag, nflag; /* enable/disable flags */ + GLint tcomps, ccomps, vcomps; /* components per texcoord, color, vertex */ + GLenum ctype = 0; /* color type */ + GLint coffset = 0, noffset = 0, voffset;/* color, normal, vertex offsets */ + const GLint toffset = 0; /* always zero */ + GLint defstride; /* default stride */ + GLint c, f; + + int stride = state->client_state.arrays.interleavedArrays.stride; + + f = sizeof(GLfloat); + c = f * ((4 * sizeof(GLubyte) + (f - 1)) / f); + + switch (state->client_state.arrays.interleavedArrays.format) { + case GL_V2F: + tflag = GL_FALSE; cflag = GL_FALSE; nflag = GL_FALSE; + tcomps = 0; ccomps = 0; vcomps = 2; + voffset = 0; + defstride = 2*f; + break; + case GL_V3F: + tflag = GL_FALSE; cflag = GL_FALSE; nflag = GL_FALSE; + tcomps = 0; ccomps = 0; vcomps = 3; + voffset = 0; + defstride = 3*f; + break; + case GL_C4UB_V2F: + tflag = GL_FALSE; cflag = GL_TRUE; nflag = GL_FALSE; + tcomps = 0; ccomps = 4; vcomps = 2; + ctype = GL_UNSIGNED_BYTE; + coffset = 0; + voffset = c; + defstride = c + 2*f; + break; + case GL_C4UB_V3F: + tflag = GL_FALSE; cflag = GL_TRUE; nflag = GL_FALSE; + tcomps = 0; ccomps = 4; vcomps = 3; + ctype = GL_UNSIGNED_BYTE; + coffset = 0; + voffset = c; + defstride = c + 3*f; + break; + case GL_C3F_V3F: + tflag = GL_FALSE; cflag = GL_TRUE; nflag = GL_FALSE; + tcomps = 0; ccomps = 3; vcomps = 3; + ctype = GL_FLOAT; + coffset = 0; + voffset = 3*f; + defstride = 6*f; + break; + case GL_N3F_V3F: + tflag = GL_FALSE; cflag = GL_FALSE; nflag = GL_TRUE; + tcomps = 0; ccomps = 0; vcomps = 3; + noffset = 0; + voffset = 3*f; + defstride = 6*f; + break; + case GL_C4F_N3F_V3F: + tflag = GL_FALSE; cflag = GL_TRUE; nflag = GL_TRUE; + tcomps = 0; ccomps = 4; vcomps = 3; + ctype = GL_FLOAT; + coffset = 0; + noffset = 4*f; + voffset = 7*f; + defstride = 10*f; + break; + case GL_T2F_V3F: + tflag = GL_TRUE; cflag = GL_FALSE; nflag = GL_FALSE; + tcomps = 2; ccomps = 0; vcomps = 3; + voffset = 2*f; + defstride = 5*f; + break; + case GL_T4F_V4F: + tflag = GL_TRUE; cflag = GL_FALSE; nflag = GL_FALSE; + tcomps = 4; ccomps = 0; vcomps = 4; + voffset = 4*f; + defstride = 8*f; + break; + case GL_T2F_C4UB_V3F: + tflag = GL_TRUE; cflag = GL_TRUE; nflag = GL_FALSE; + tcomps = 2; ccomps = 4; vcomps = 3; + ctype = GL_UNSIGNED_BYTE; + coffset = 2*f; + voffset = c+2*f; + defstride = c+5*f; + break; + case GL_T2F_C3F_V3F: + tflag = GL_TRUE; cflag = GL_TRUE; nflag = GL_FALSE; + tcomps = 2; ccomps = 3; vcomps = 3; + ctype = GL_FLOAT; + coffset = 2*f; + voffset = 5*f; + defstride = 8*f; + break; + case GL_T2F_N3F_V3F: + tflag = GL_TRUE; cflag = GL_FALSE; nflag = GL_TRUE; + tcomps = 2; ccomps = 0; vcomps = 3; + noffset = 2*f; + voffset = 5*f; + defstride = 8*f; + break; + case GL_T2F_C4F_N3F_V3F: + tflag = GL_TRUE; cflag = GL_TRUE; nflag = GL_TRUE; + tcomps = 2; ccomps = 4; vcomps = 3; + ctype = GL_FLOAT; + coffset = 2*f; + noffset = 6*f; + voffset = 9*f; + defstride = 12*f; + break; + case GL_T4F_C4F_N3F_V4F: + tflag = GL_TRUE; cflag = GL_TRUE; nflag = GL_TRUE; + tcomps = 4; ccomps = 4; vcomps = 4; + ctype = GL_FLOAT; + coffset = 4*f; + noffset = 8*f; + voffset = 11*f; + defstride = 15*f; + break; + default: + log_gl("unknown interleaved array format : %d\n", state->client_state.arrays.interleavedArrays.format); + return; + } + if (stride==0) { + stride = defstride; + } + + const void* ptr = state->client_state.arrays.interleavedArrays.ptr + indice * stride; + + if (tflag) + { + if (tcomps == 2) + glTexCoord2fv(ptr + toffset); + else if (tcomps == 4) + glTexCoord4fv(ptr + toffset); + else + assert(0); + } + + if (cflag) + { + if (ctype == GL_FLOAT) + { + if (ccomps == 3) + glColor3fv(ptr + coffset); + else if (ccomps == 4) + glColor4fv(ptr + coffset); + else + assert(0); + } + else if (ctype == GL_UNSIGNED_BYTE) + { + if (ccomps == 4) + glColor4ubv(ptr + coffset); + else + assert(0); + } + else + assert(0); + } + + if (nflag) + glNormal3fv(ptr + noffset); + + if (vcomps == 2) + glVertex2fv(ptr + voffset); + else if (vcomps == 3) + glVertex3fv(ptr + voffset); + else if (vcomps == 4) + glVertex4fv(ptr + voffset); + else + assert(0); + + return; + } + int i; + + int prevActiveTexture = state->activeTexture; + for(i=0;i<NB_MAX_TEXTURES;i++) + { + if (state->client_state.arrays.texCoordArray[i].enabled) + { + if (i != 0 || state->activeTexture != GL_TEXTURE0_ARB) + glActiveTextureARB(GL_TEXTURE0_ARB + i); + _glElementArrayImmediate_one(&state->client_state.arrays.texCoordArray[i], indice, TEXCOORD_FUNC); + } + } + glActiveTextureARB(prevActiveTexture); + + _glElementArrayImmediate_one(&state->client_state.arrays.normalArray, indice, NORMAL_FUNC); + _glElementArrayImmediate_one(&state->client_state.arrays.colorArray, indice, COLOR_FUNC); + _glElementArrayImmediate_one(&state->client_state.arrays.indexArray, indice, INDEX_FUNC); + _glElementArrayImmediate_one(&state->client_state.arrays.vertexArray, indice, VERTEX_FUNC); +} + +static void _glArraysSend(int first, int last) +{ + GET_CURRENT_STATE(); + if (debug_array_ptr) + { + log_gl("_glArraysSend from %d to %d\n", first, last); + } + + + int startIndiceTextureToDealtWith = 0; + int i; + int nbElts = 1 + last; + + if (glFuncTable.fpIsEnabled(GL_VERTEX_PROGRAM_NV)) + { + int vertexProgramNV = 0; + for(i=0;i<MY_GL_MAX_VERTEX_ATTRIBS_NV;i++) + { + ClientArray* array = &state->client_state.arrays.vertexAttribArrayNV[i]; + if (!(array->ptr == NULL || array->enabled == 0)) + { + _glArraySend(state, ARRAY_SEND_FUNC(glVertexAttribPointerNV), array, first, last); + vertexProgramNV = 1; + } + } + if (vertexProgramNV) + return; + } + + if (state->client_state.arrays.interleavedArrays.ptr != NULL && + state->client_state.arrays.vertexArray.ptr == NULL) + { + int stride; + if (state->client_state.arrays.interleavedArrays.stride) + stride = state->client_state.arrays.interleavedArrays.stride; + else + stride = _calc_interleaved_arrays_stride(state->client_state.arrays.interleavedArrays.format); + if (stride == 0) return; + int offset = stride * first; + int size = (last - first + 1) * stride; + long args[] = { offset, + state->client_state.arrays.interleavedArrays.format, + state->client_state.arrays.interleavedArrays.stride, + size, + POINTER_TO_ARG(state->client_state.arrays.interleavedArrays.ptr + offset) }; + int args_size[] = { 0, 0, 0, 0, size }; + do_opengl_call(glInterleavedArrays_fake_func, NULL, CHECK_ARGS(args, args_size)); + return; + } + int normalArrayOffset = (long)state->client_state.arrays.normalArray.ptr - + (long)state->client_state.arrays.vertexArray.ptr; + int colorArrayOffset = (long)state->client_state.arrays.colorArray.ptr - + (long)state->client_state.arrays.vertexArray.ptr; + int texCoord0PointerOffset = (long)state->client_state.arrays.texCoordArray[0].ptr - + (long)state->client_state.arrays.vertexArray.ptr; + int texCoord1PointerOffset = (long)state->client_state.arrays.texCoordArray[1].ptr - + (long)state->client_state.arrays.vertexArray.ptr; + int texCoord2PointerOffset = (long)state->client_state.arrays.texCoordArray[2].ptr - + (long)state->client_state.arrays.vertexArray.ptr; + + if (state->client_state.arrays.vertexArray.vbo_name || + state->client_state.arrays.colorArray.vbo_name || + state->client_state.arrays.normalArray.vbo_name || + state->client_state.arrays.texCoordArray[0].vbo_name || + state->client_state.arrays.texCoordArray[1].vbo_name || + state->client_state.arrays.texCoordArray[2].vbo_name) + { + _glArraySend(state, ARRAY_SEND_FUNC(glVertexPointer), &state->client_state.arrays.vertexArray, first, last); + _glArraySend(state, ARRAY_SEND_FUNC(glNormalPointer), &state->client_state.arrays.normalArray, first, last); + _glArraySend(state, ARRAY_SEND_FUNC(glColorPointer), &state->client_state.arrays.colorArray, first, last); + } + else + if (state->client_state.arrays.vertexArray.enabled && + state->client_state.arrays.normalArray.enabled == 0 && + state->client_state.arrays.colorArray.enabled && + state->client_state.arrays.texCoordArray[0].enabled && + state->client_state.arrays.vertexArray.ptr != NULL && + state->client_state.arrays.vertexArray.stride != 0 && + state->client_state.arrays.vertexArray.stride == state->client_state.arrays.colorArray.stride && + state->client_state.arrays.vertexArray.stride == state->client_state.arrays.texCoordArray[0].stride && + colorArrayOffset >= 0 && + colorArrayOffset < state->client_state.arrays.vertexArray.stride && + texCoord0PointerOffset >= 0 && + texCoord0PointerOffset < state->client_state.arrays.vertexArray.stride) + { + /* For unreal tournament 3 with GL_EXTENSIONS="GL_EXT_bgra GL_EXT_texture_compression_s3tc" */ + int offset = first * state->client_state.arrays.vertexArray.stride; + int data_size = (last - first + 1) * state->client_state.arrays.vertexArray.stride; + + if (debug_array_ptr) + { + log_gl("glVertexColorTexCoord0PointerInterlaced_fake_func sending %d bytes from %d\n", + data_size, + offset); + } + long args[] = { INT_TO_ARG(offset), + INT_TO_ARG(state->client_state.arrays.vertexArray.size), + INT_TO_ARG(state->client_state.arrays.vertexArray.type), + INT_TO_ARG(state->client_state.arrays.vertexArray.stride), + INT_TO_ARG(colorArrayOffset), + INT_TO_ARG(state->client_state.arrays.colorArray.size), + INT_TO_ARG(state->client_state.arrays.colorArray.type), + INT_TO_ARG(texCoord0PointerOffset), + INT_TO_ARG(state->client_state.arrays.texCoordArray[0].size), + INT_TO_ARG(state->client_state.arrays.texCoordArray[0].type), + INT_TO_ARG(data_size), + POINTER_TO_ARG(state->client_state.arrays.vertexArray.ptr + offset) }; + int args_size[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, data_size}; + do_opengl_call(glVertexColorTexCoord0PointerInterlaced_fake_func, NULL, CHECK_ARGS(args, args_size)); + + startIndiceTextureToDealtWith = 1; + } + else if (state->client_state.arrays.vertexArray.enabled && + state->client_state.arrays.normalArray.enabled && + state->client_state.arrays.colorArray.enabled && + state->client_state.arrays.texCoordArray[0].enabled && + state->client_state.arrays.texCoordArray[1].enabled && + state->client_state.arrays.texCoordArray[2].enabled && + state->client_state.arrays.vertexArray.ptr != NULL && + state->client_state.arrays.vertexArray.stride != 0 && + state->client_state.arrays.vertexArray.stride == state->client_state.arrays.normalArray.stride && + state->client_state.arrays.vertexArray.stride == state->client_state.arrays.texCoordArray[0].stride && + state->client_state.arrays.vertexArray.stride == state->client_state.arrays.texCoordArray[1].stride && + state->client_state.arrays.vertexArray.stride == state->client_state.arrays.texCoordArray[2].stride && + normalArrayOffset >= 0 && + normalArrayOffset < state->client_state.arrays.vertexArray.stride && + colorArrayOffset >= 0 && + colorArrayOffset < state->client_state.arrays.vertexArray.stride && + texCoord0PointerOffset >= 0 && + texCoord0PointerOffset < state->client_state.arrays.vertexArray.stride && + texCoord1PointerOffset >= 0 && + texCoord1PointerOffset < state->client_state.arrays.vertexArray.stride && + texCoord2PointerOffset >= 0 && + texCoord2PointerOffset < state->client_state.arrays.vertexArray.stride) + { + /* For unreal tournament 4 with GL_EXTENSIONS="GL_EXT_bgra GL_EXT_texture_compression_s3tc" */ + int offset = first * state->client_state.arrays.vertexArray.stride; + int data_size = (last - first + 1) * state->client_state.arrays.vertexArray.stride; + + if (debug_array_ptr) + { + log_gl("glVertexNormalColorTexCoord012PointerInterlaced_fake_func sending %d bytes from %d\n", + data_size, + offset); + } + long args[] = { INT_TO_ARG(offset), + INT_TO_ARG(state->client_state.arrays.vertexArray.size), + INT_TO_ARG(state->client_state.arrays.vertexArray.type), + INT_TO_ARG(state->client_state.arrays.vertexArray.stride), + INT_TO_ARG(normalArrayOffset), + INT_TO_ARG(state->client_state.arrays.normalArray.type), + INT_TO_ARG(colorArrayOffset), + INT_TO_ARG(state->client_state.arrays.colorArray.size), + INT_TO_ARG(state->client_state.arrays.colorArray.type), + INT_TO_ARG(texCoord0PointerOffset), + INT_TO_ARG(state->client_state.arrays.texCoordArray[0].size), + INT_TO_ARG(state->client_state.arrays.texCoordArray[0].type), + INT_TO_ARG(texCoord1PointerOffset), + INT_TO_ARG(state->client_state.arrays.texCoordArray[1].size), + INT_TO_ARG(state->client_state.arrays.texCoordArray[1].type), + INT_TO_ARG(texCoord2PointerOffset), + INT_TO_ARG(state->client_state.arrays.texCoordArray[2].size), + INT_TO_ARG(state->client_state.arrays.texCoordArray[2].type), + INT_TO_ARG(data_size), + POINTER_TO_ARG(state->client_state.arrays.vertexArray.ptr + offset) }; + int args_size[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, data_size}; + do_opengl_call(glVertexNormalColorTexCoord012PointerInterlaced_fake_func, NULL, CHECK_ARGS(args, args_size)); + + startIndiceTextureToDealtWith = 3; + } + else if (state->client_state.arrays.vertexArray.enabled && + state->client_state.arrays.normalArray.enabled && + state->client_state.arrays.colorArray.enabled && + state->client_state.arrays.texCoordArray[0].enabled && + state->client_state.arrays.texCoordArray[1].enabled && + state->client_state.arrays.vertexArray.ptr != NULL && + state->client_state.arrays.vertexArray.stride != 0 && + state->client_state.arrays.vertexArray.stride == state->client_state.arrays.normalArray.stride && + state->client_state.arrays.vertexArray.stride == state->client_state.arrays.texCoordArray[0].stride && + state->client_state.arrays.vertexArray.stride == state->client_state.arrays.texCoordArray[1].stride && + normalArrayOffset >= 0 && + normalArrayOffset < state->client_state.arrays.vertexArray.stride && + colorArrayOffset >= 0 && + colorArrayOffset < state->client_state.arrays.vertexArray.stride && + texCoord0PointerOffset >= 0 && + texCoord0PointerOffset < state->client_state.arrays.vertexArray.stride && + texCoord1PointerOffset >= 0 && + texCoord1PointerOffset < state->client_state.arrays.vertexArray.stride) + { + /* For unreal tournament 3 with GL_EXTENSIONS="GL_EXT_bgra GL_EXT_texture_compression_s3tc" */ + int offset = first * state->client_state.arrays.vertexArray.stride; + int data_size = (last - first + 1) * state->client_state.arrays.vertexArray.stride; + + if (debug_array_ptr) + { + log_gl("glVertexNormalColorTexCoord01PointerInterlaced_fake_func sending %d bytes from %d\n", + data_size, + offset); + } + long args[] = { INT_TO_ARG(offset), + INT_TO_ARG(state->client_state.arrays.vertexArray.size), + INT_TO_ARG(state->client_state.arrays.vertexArray.type), + INT_TO_ARG(state->client_state.arrays.vertexArray.stride), + INT_TO_ARG(normalArrayOffset), + INT_TO_ARG(state->client_state.arrays.normalArray.type), + INT_TO_ARG(colorArrayOffset), + INT_TO_ARG(state->client_state.arrays.colorArray.size), + INT_TO_ARG(state->client_state.arrays.colorArray.type), + INT_TO_ARG(texCoord0PointerOffset), + INT_TO_ARG(state->client_state.arrays.texCoordArray[0].size), + INT_TO_ARG(state->client_state.arrays.texCoordArray[0].type), + INT_TO_ARG(texCoord1PointerOffset), + INT_TO_ARG(state->client_state.arrays.texCoordArray[1].size), + INT_TO_ARG(state->client_state.arrays.texCoordArray[1].type), + INT_TO_ARG(data_size), + POINTER_TO_ARG(state->client_state.arrays.vertexArray.ptr + offset) }; + int args_size[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, data_size}; + do_opengl_call(glVertexNormalColorTexCoord01PointerInterlaced_fake_func, NULL, CHECK_ARGS(args, args_size)); + + startIndiceTextureToDealtWith = 2; + } + else if (state->client_state.arrays.vertexArray.enabled && + state->client_state.arrays.normalArray.enabled && + state->client_state.arrays.colorArray.enabled == 0 && + state->client_state.arrays.texCoordArray[0].enabled && + state->client_state.arrays.texCoordArray[1].enabled && + state->client_state.arrays.texCoordArray[2].enabled && + state->client_state.arrays.vertexArray.ptr != NULL && + state->client_state.arrays.vertexArray.stride != 0 && + state->client_state.arrays.vertexArray.stride == state->client_state.arrays.normalArray.stride && + state->client_state.arrays.vertexArray.stride == state->client_state.arrays.texCoordArray[0].stride && + state->client_state.arrays.vertexArray.stride == state->client_state.arrays.texCoordArray[1].stride && + state->client_state.arrays.vertexArray.stride == state->client_state.arrays.texCoordArray[2].stride && + normalArrayOffset >= 0 && + normalArrayOffset < state->client_state.arrays.vertexArray.stride && + texCoord0PointerOffset >= 0 && + texCoord0PointerOffset < state->client_state.arrays.vertexArray.stride && + texCoord1PointerOffset >= 0 && + texCoord1PointerOffset < state->client_state.arrays.vertexArray.stride && + texCoord2PointerOffset >= 0 && + texCoord2PointerOffset < state->client_state.arrays.vertexArray.stride) + { + /* For unreal tournament 3 with GL_EXTENSIONS="GL_EXT_bgra GL_EXT_texture_compression_s3tc" */ + int offset = first * state->client_state.arrays.vertexArray.stride; + int data_size = (last - first + 1) * state->client_state.arrays.vertexArray.stride; + + if (debug_array_ptr) + { + log_gl("glVertexNormalTexCoord012PointerInterlaced_fake_func sending %d bytes from %d\n", + data_size, + offset); + } + long args[] = { INT_TO_ARG(offset), + INT_TO_ARG(state->client_state.arrays.vertexArray.size), + INT_TO_ARG(state->client_state.arrays.vertexArray.type), + INT_TO_ARG(state->client_state.arrays.vertexArray.stride), + INT_TO_ARG(normalArrayOffset), + INT_TO_ARG(state->client_state.arrays.normalArray.type), + INT_TO_ARG(texCoord0PointerOffset), + INT_TO_ARG(state->client_state.arrays.texCoordArray[0].size), + INT_TO_ARG(state->client_state.arrays.texCoordArray[0].type), + INT_TO_ARG(texCoord1PointerOffset), + INT_TO_ARG(state->client_state.arrays.texCoordArray[1].size), + INT_TO_ARG(state->client_state.arrays.texCoordArray[1].type), + INT_TO_ARG(texCoord2PointerOffset), + INT_TO_ARG(state->client_state.arrays.texCoordArray[2].size), + INT_TO_ARG(state->client_state.arrays.texCoordArray[2].type), + INT_TO_ARG(data_size), + POINTER_TO_ARG(state->client_state.arrays.vertexArray.ptr + offset) }; + int args_size[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, data_size}; + do_opengl_call(glVertexNormalTexCoord012PointerInterlaced_fake_func, NULL, CHECK_ARGS(args, args_size)); + + startIndiceTextureToDealtWith = 3; + } + else if (state->client_state.arrays.vertexArray.enabled && + state->client_state.arrays.normalArray.enabled && + state->client_state.arrays.colorArray.enabled == 0 && + state->client_state.arrays.texCoordArray[0].enabled && + state->client_state.arrays.texCoordArray[1].enabled && + state->client_state.arrays.vertexArray.ptr != NULL && + state->client_state.arrays.vertexArray.stride != 0 && + state->client_state.arrays.vertexArray.stride == state->client_state.arrays.normalArray.stride && + state->client_state.arrays.vertexArray.stride == state->client_state.arrays.texCoordArray[0].stride && + state->client_state.arrays.vertexArray.stride == state->client_state.arrays.texCoordArray[1].stride && + normalArrayOffset >= 0 && + normalArrayOffset < state->client_state.arrays.vertexArray.stride && + texCoord0PointerOffset >= 0 && + texCoord0PointerOffset < state->client_state.arrays.vertexArray.stride && + texCoord1PointerOffset >= 0 && + texCoord1PointerOffset < state->client_state.arrays.vertexArray.stride) + { + /* For unreal tournament 3 with GL_EXTENSIONS="GL_EXT_bgra GL_EXT_texture_compression_s3tc" */ + int offset = first * state->client_state.arrays.vertexArray.stride; + int data_size = (last - first + 1) * state->client_state.arrays.vertexArray.stride; + + if (debug_array_ptr) + { + log_gl("glVertexNormalTexCoord01PointerInterlaced_fake_func sending %d bytes from %d\n", + data_size, + offset); + } + long args[] = { INT_TO_ARG(offset), + INT_TO_ARG(state->client_state.arrays.vertexArray.size), + INT_TO_ARG(state->client_state.arrays.vertexArray.type), + INT_TO_ARG(state->client_state.arrays.vertexArray.stride), + INT_TO_ARG(normalArrayOffset), + INT_TO_ARG(state->client_state.arrays.normalArray.type), + INT_TO_ARG(texCoord0PointerOffset), + INT_TO_ARG(state->client_state.arrays.texCoordArray[0].size), + INT_TO_ARG(state->client_state.arrays.texCoordArray[0].type), + INT_TO_ARG(texCoord1PointerOffset), + INT_TO_ARG(state->client_state.arrays.texCoordArray[1].size), + INT_TO_ARG(state->client_state.arrays.texCoordArray[1].type), + INT_TO_ARG(data_size), + POINTER_TO_ARG(state->client_state.arrays.vertexArray.ptr + offset) }; + int args_size[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, data_size}; + do_opengl_call(glVertexNormalTexCoord01PointerInterlaced_fake_func, NULL, CHECK_ARGS(args, args_size)); + + startIndiceTextureToDealtWith = 2; + } + else if (state->client_state.arrays.vertexArray.enabled && + state->client_state.arrays.normalArray.enabled && + state->client_state.arrays.colorArray.enabled == 0 && + state->client_state.arrays.texCoordArray[0].enabled && + state->client_state.arrays.vertexArray.ptr != NULL && + state->client_state.arrays.vertexArray.stride != 0 && + state->client_state.arrays.vertexArray.stride == state->client_state.arrays.normalArray.stride && + state->client_state.arrays.vertexArray.stride == state->client_state.arrays.texCoordArray[0].stride && + normalArrayOffset >= 0 && + normalArrayOffset < state->client_state.arrays.vertexArray.stride && + texCoord0PointerOffset >= 0 && + texCoord0PointerOffset < state->client_state.arrays.vertexArray.stride) + { + /* For unreal tournament 3 with GL_EXTENSIONS="GL_EXT_bgra GL_EXT_texture_compression_s3tc" */ + int offset = first * state->client_state.arrays.vertexArray.stride; + int data_size = (last - first + 1) * state->client_state.arrays.vertexArray.stride; + + if (debug_array_ptr) + { + log_gl("glVertexNormalTexCoord0PointerInterlaced_fake_func sending %d bytes from %d\n", + data_size, + offset); + } + long args[] = { INT_TO_ARG(offset), + INT_TO_ARG(state->client_state.arrays.vertexArray.size), + INT_TO_ARG(state->client_state.arrays.vertexArray.type), + INT_TO_ARG(state->client_state.arrays.vertexArray.stride), + INT_TO_ARG(normalArrayOffset), + INT_TO_ARG(state->client_state.arrays.normalArray.type), + INT_TO_ARG(texCoord0PointerOffset), + INT_TO_ARG(state->client_state.arrays.texCoordArray[0].size), + INT_TO_ARG(state->client_state.arrays.texCoordArray[0].type), + INT_TO_ARG(data_size), + POINTER_TO_ARG(state->client_state.arrays.vertexArray.ptr + offset) }; + int args_size[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, data_size}; + do_opengl_call(glVertexNormalTexCoord0PointerInterlaced_fake_func, NULL, CHECK_ARGS(args, args_size)); + + startIndiceTextureToDealtWith = 1; + } + else if (state->client_state.arrays.vertexArray.enabled && + state->client_state.arrays.normalArray.enabled && + state->client_state.arrays.colorArray.enabled && + state->client_state.arrays.texCoordArray[0].enabled && + state->client_state.arrays.vertexArray.ptr != NULL && + state->client_state.arrays.vertexArray.stride != 0 && + state->client_state.arrays.vertexArray.stride == state->client_state.arrays.normalArray.stride && + state->client_state.arrays.vertexArray.stride == state->client_state.arrays.colorArray.stride && + state->client_state.arrays.vertexArray.stride == state->client_state.arrays.texCoordArray[0].stride && + normalArrayOffset >= 0 && + normalArrayOffset < state->client_state.arrays.vertexArray.stride && + colorArrayOffset >= 0 && + colorArrayOffset < state->client_state.arrays.vertexArray.stride && + texCoord0PointerOffset >= 0 && + texCoord0PointerOffset < state->client_state.arrays.vertexArray.stride) + { + /* For unreal tournament 3 with GL_EXTENSIONS="GL_EXT_bgra GL_EXT_texture_compression_s3tc" */ + int offset = first * state->client_state.arrays.vertexArray.stride; + int data_size = (last - first + 1) * state->client_state.arrays.vertexArray.stride; + + if (debug_array_ptr) + { + log_gl("glVertexNormalColorTexCoord0PointerInterlaced_fake_func sending %d bytes from %d\n", + data_size, + offset); + } + long args[] = { INT_TO_ARG(offset), + INT_TO_ARG(state->client_state.arrays.vertexArray.size), + INT_TO_ARG(state->client_state.arrays.vertexArray.type), + INT_TO_ARG(state->client_state.arrays.vertexArray.stride), + INT_TO_ARG(normalArrayOffset), + INT_TO_ARG(state->client_state.arrays.normalArray.type), + INT_TO_ARG(colorArrayOffset), + INT_TO_ARG(state->client_state.arrays.colorArray.size), + INT_TO_ARG(state->client_state.arrays.colorArray.type), + INT_TO_ARG(texCoord0PointerOffset), + INT_TO_ARG(state->client_state.arrays.texCoordArray[0].size), + INT_TO_ARG(state->client_state.arrays.texCoordArray[0].type), + INT_TO_ARG(data_size), + POINTER_TO_ARG(state->client_state.arrays.vertexArray.ptr + offset) }; + int args_size[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, data_size}; + do_opengl_call(glVertexNormalColorTexCoord0PointerInterlaced_fake_func, NULL, CHECK_ARGS(args, args_size)); + + startIndiceTextureToDealtWith = 1; + } + else if (state->client_state.arrays.vertexArray.enabled && + state->client_state.arrays.normalArray.enabled && + state->client_state.arrays.vertexArray.ptr != NULL && + getMulFactorFromPointerArray(&state->client_state.arrays.vertexArray) == + getMulFactorFromPointerArray(&state->client_state.arrays.normalArray) && + state->client_state.arrays.vertexArray.ptr == state->client_state.arrays.normalArray.ptr) + { + /* Special optimization for earth3d */ + int data_size = nbElts * getMulFactorFromPointerArray(&state->client_state.arrays.vertexArray); + + if (debug_array_ptr) + { + log_gl("glVertexAndNormalPointer_fake_func sending %d bytes from %d\n", + data_size, + 0); + } + + long args[] = { INT_TO_ARG(state->client_state.arrays.vertexArray.size), + INT_TO_ARG(state->client_state.arrays.vertexArray.type), + INT_TO_ARG(state->client_state.arrays.vertexArray.stride), + INT_TO_ARG(state->client_state.arrays.normalArray.type), + INT_TO_ARG(state->client_state.arrays.normalArray.stride), + INT_TO_ARG(data_size), + POINTER_TO_ARG(state->client_state.arrays.vertexArray.ptr) }; + int args_size[] = { 0, 0, 0, 0, 0, 0, data_size }; + do_opengl_call(glVertexAndNormalPointer_fake_func, NULL, CHECK_ARGS(args, args_size)); + } + + else if (state->client_state.arrays.vertexArray.enabled && + state->client_state.arrays.normalArray.enabled && + /*state->client_state.arrays.colorArray.enabled && */ + state->client_state.arrays.vertexArray.ptr != NULL && + state->client_state.arrays.vertexArray.stride != 0 && + state->client_state.arrays.vertexArray.stride == state->client_state.arrays.normalArray.stride && + state->client_state.arrays.vertexArray.stride == state->client_state.arrays.colorArray.stride && + normalArrayOffset >= 0 && + normalArrayOffset < state->client_state.arrays.vertexArray.stride && + colorArrayOffset >= 0 && + colorArrayOffset < state->client_state.arrays.vertexArray.stride) + { + /* Special optimization for tuxracer */ + /* + glEnableClientState(GL_VERTEX_ARRAY); + glVertexPointer( 3, GL_FLOAT, STRIDE_GL_ARRAY, vnc_array ); + + glEnableClientState(GL_NORMAL_ARRAY); + glNormalPointer( GL_FLOAT, STRIDE_GL_ARRAY, + vnc_array + 4*sizeof(GLfloat) ); + + glEnableClientState(GL_COLOR_ARRAY); + glColorPointer( 4, GL_UNSIGNED_BYTE, STRIDE_GL_ARRAY, + vnc_array + 8*sizeof(GLfloat) ); + */ + int offset = first * state->client_state.arrays.vertexArray.stride; + int data_size = (last - first + 1) * state->client_state.arrays.vertexArray.stride; + + if (debug_array_ptr) + { + log_gl("glVertexNormalColorPointerInterlaced_fake_func sending %d bytes from %d\n", + data_size, + offset); + } + long args[] = { INT_TO_ARG(offset), + INT_TO_ARG(state->client_state.arrays.vertexArray.size), + INT_TO_ARG(state->client_state.arrays.vertexArray.type), + INT_TO_ARG(state->client_state.arrays.vertexArray.stride), + INT_TO_ARG(normalArrayOffset), + INT_TO_ARG(state->client_state.arrays.normalArray.type), + INT_TO_ARG(colorArrayOffset), + INT_TO_ARG(state->client_state.arrays.colorArray.size), + INT_TO_ARG(state->client_state.arrays.colorArray.type), + INT_TO_ARG(data_size), + POINTER_TO_ARG(state->client_state.arrays.vertexArray.ptr + offset) }; + int args_size[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + data_size}; + do_opengl_call(glVertexNormalColorPointerInterlaced_fake_func, NULL, CHECK_ARGS(args, args_size)); + } + else if (state->client_state.arrays.vertexArray.enabled && + state->client_state.arrays.normalArray.enabled && + state->client_state.arrays.vertexArray.ptr != NULL && + state->client_state.arrays.vertexArray.stride != 0 && + state->client_state.arrays.vertexArray.stride == state->client_state.arrays.normalArray.stride && + normalArrayOffset >= 0 && + normalArrayOffset < state->client_state.arrays.vertexArray.stride) + { + /* For unreal tournament 3 with GL_EXTENSIONS="GL_EXT_bgra GL_EXT_texture_compression_s3tc" */ + int offset = first * state->client_state.arrays.vertexArray.stride; + int data_size = (last - first + 1) * state->client_state.arrays.vertexArray.stride; + + if (debug_array_ptr) + { + log_gl("glVertexNormalPointerInterlaced_fake_func sending %d bytes from %d\n", + data_size, + offset); + } + long args[] = { INT_TO_ARG(offset), + INT_TO_ARG(state->client_state.arrays.vertexArray.size), + INT_TO_ARG(state->client_state.arrays.vertexArray.type), + INT_TO_ARG(state->client_state.arrays.vertexArray.stride), + INT_TO_ARG(normalArrayOffset), + INT_TO_ARG(state->client_state.arrays.normalArray.type), + INT_TO_ARG(data_size), + POINTER_TO_ARG(state->client_state.arrays.vertexArray.ptr + offset) }; + int args_size[] = { 0, 0, 0, 0, 0, 0, 0, data_size}; + do_opengl_call(glVertexNormalPointerInterlaced_fake_func, NULL, CHECK_ARGS(args, args_size)); + + _glArraySend(state, ARRAY_SEND_FUNC(glColorPointer), &state->client_state.arrays.colorArray, first, last); + } + else + { + _glArraySend(state, ARRAY_SEND_FUNC(glVertexPointer), &state->client_state.arrays.vertexArray, first, last); + _glArraySend(state, ARRAY_SEND_FUNC(glNormalPointer), &state->client_state.arrays.normalArray, first, last); + _glArraySend(state, ARRAY_SEND_FUNC(glColorPointer), &state->client_state.arrays.colorArray, first, last); + } + _glArraySend(state, ARRAY_SEND_FUNC(glSecondaryColorPointer), &state->client_state.arrays.secondaryColorArray, first, last); + _glArraySend(state, ARRAY_SEND_FUNC(glEdgeFlagPointer), &state->client_state.arrays.edgeFlagArray, first, last); + _glArraySend(state, ARRAY_SEND_FUNC(glIndexPointer), &state->client_state.arrays.indexArray, first, last); + + for(i=0;i<MY_GL_MAX_VERTEX_ATTRIBS_ARB;i++) + { + _glArraySend(state, ARRAY_SEND_FUNC(glVertexAttribPointerARB), &state->client_state.arrays.vertexAttribArray[i], first, last); + } + for(i=0;i<MY_GL_MAX_VARIANT_POINTER_EXT;i++) + { + _glArraySend(state, ARRAY_SEND_FUNC(glVariantPointerEXT), &state->client_state.arrays.variantPointer[i], first, last); + } + + if (startIndiceTextureToDealtWith == 0 && + state->client_state.arrays.texCoordArray[0].vbo_name == 0 && + state->client_state.arrays.texCoordArray[1].vbo_name == 0 && + state->client_state.arrays.texCoordArray[2].vbo_name == 0 && + state->client_state.arrays.texCoordArray[0].enabled && + state->client_state.arrays.texCoordArray[1].enabled && + state->client_state.arrays.texCoordArray[2].enabled && + state->client_state.arrays.texCoordArray[0].ptr && + state->client_state.arrays.texCoordArray[0].ptr == state->client_state.arrays.texCoordArray[1].ptr && + state->client_state.arrays.texCoordArray[0].size == state->client_state.arrays.texCoordArray[1].size && + state->client_state.arrays.texCoordArray[0].type == state->client_state.arrays.texCoordArray[1].type && + state->client_state.arrays.texCoordArray[0].stride == state->client_state.arrays.texCoordArray[1].stride && + state->client_state.arrays.texCoordArray[0].ptr == state->client_state.arrays.texCoordArray[2].ptr && + state->client_state.arrays.texCoordArray[0].size == state->client_state.arrays.texCoordArray[2].size && + state->client_state.arrays.texCoordArray[0].type == state->client_state.arrays.texCoordArray[2].type && + state->client_state.arrays.texCoordArray[0].stride == state->client_state.arrays.texCoordArray[2].stride) + { + /* For unreal tournament 4 with GL_EXTENSIONS="GL_EXT_bgra GL_EXT_texture_compression_s3tc" */ + int data_size = nbElts * getMulFactorFromPointerArray(&state->client_state.arrays.texCoordArray[0]); + if (debug_array_ptr) + { + log_gl("glTexCoordPointer012_fake_func sending %d bytes from %d\n", + data_size, + 0); + } + + long args[] = { INT_TO_ARG(state->client_state.arrays.texCoordArray[0].size), + INT_TO_ARG(state->client_state.arrays.texCoordArray[0].type), + INT_TO_ARG(state->client_state.arrays.texCoordArray[0].stride), + INT_TO_ARG(data_size), + POINTER_TO_ARG(state->client_state.arrays.texCoordArray[0].ptr) }; + int args_size[] = { 0, 0, 0, 0, data_size }; + do_opengl_call(glTexCoordPointer012_fake_func, NULL, CHECK_ARGS(args, args_size)); + + startIndiceTextureToDealtWith = 3; + } + else + if (startIndiceTextureToDealtWith == 0 && + state->client_state.arrays.texCoordArray[0].vbo_name == 0 && + state->client_state.arrays.texCoordArray[1].vbo_name == 0 && + state->client_state.arrays.texCoordArray[0].enabled && + state->client_state.arrays.texCoordArray[1].enabled && + state->client_state.arrays.texCoordArray[0].ptr && + state->client_state.arrays.texCoordArray[0].ptr == state->client_state.arrays.texCoordArray[1].ptr && + state->client_state.arrays.texCoordArray[0].size == state->client_state.arrays.texCoordArray[1].size && + state->client_state.arrays.texCoordArray[0].type == state->client_state.arrays.texCoordArray[1].type && + state->client_state.arrays.texCoordArray[0].stride == state->client_state.arrays.texCoordArray[1].stride) + { + /* Special optimization for earth3d */ + int data_size = nbElts * getMulFactorFromPointerArray(&state->client_state.arrays.texCoordArray[0]); + if (debug_array_ptr) + { + log_gl("glTexCoordPointer01_fake_func sending %d bytes from %d\n", + data_size, + 0); + } + + long args[] = { INT_TO_ARG(state->client_state.arrays.texCoordArray[0].size), + INT_TO_ARG(state->client_state.arrays.texCoordArray[0].type), + INT_TO_ARG(state->client_state.arrays.texCoordArray[0].stride), + INT_TO_ARG(data_size), + POINTER_TO_ARG(state->client_state.arrays.texCoordArray[0].ptr) }; + int args_size[] = { 0, 0, 0, 0, data_size }; + do_opengl_call(glTexCoordPointer01_fake_func, NULL, CHECK_ARGS(args, args_size)); + + startIndiceTextureToDealtWith = 2; + } + + for(i=startIndiceTextureToDealtWith;i<NB_MAX_TEXTURES;i++) + { + _glArraySend(state, ARRAY_SEND_FUNC(glTexCoordPointer), &state->client_state.arrays.texCoordArray[i], first, last); + } + + _glArraySend(state, ARRAY_SEND_FUNC(glWeightPointerARB), &state->client_state.arrays.weightArray, first, last); + _glArraySend(state, ARRAY_SEND_FUNC(glMatrixIndexPointerARB), &state->client_state.arrays.matrixIndexArray, first, last); + _glArraySend(state, ARRAY_SEND_FUNC(glFogCoordPointer), &state->client_state.arrays.fogCoordArray, first, last); +} + +#define ASSERT_COND(cond, val) do { if (!(val)) { state->lastGlError = val; return; } } while(0) +#define CLEAR_ERROR_STATE() do { state->lastGlError = 0; } while(0) + + +GLAPI void APIENTRY EXT_FUNC(glLockArraysEXT) (GLint first, GLsizei count) +{ + /* Quite difficult to be correctly implemented IMHO for a doubtful performance gain */ + /* You need to send data for enabled arrays at this moment, but then for */ + /* the glDrawArrays, glDrawElements, etc... you need to check if enough data has been sent */ + /* For ex consider the following code : + glVertexPointer(.....); + glColorPointer(......); + glNormalPointer(.....); + glEnableClientState(GL_VERTEX_ARRAY); + glLockArraysEXT(0, 16); (1) + glEnableClientState(GL_COLOR_ARRAY); + glEnableClientState(GL_NORMAL_ARRAY); + glDrawArrays(GL_TRIANGLE, 0, 20); (2) + glUnlockArraysEXT(); + */ + /* At (1), you need to send 16 vertices, but at (2) you need to send the */ + /* 4 following ones, or either the whole 20... */ + CHECK_PROC(glLockArraysEXT); + GET_CURRENT_STATE(); + ASSERT_COND(first >= 0, GL_INVALID_VALUE); + ASSERT_COND(count > 0, GL_INVALID_VALUE); + ASSERT_COND(state->isBetweenLockArrays == 0, GL_INVALID_OPERATION); + ASSERT_COND(state->isBetweenBegin == 0, GL_INVALID_OPERATION); + + if (debug_array_ptr) + { + log_gl("glLockArraysEXT(%d,%d)\n", first, count); + } + + state->isBetweenLockArrays = 1; + + state->locked_first = first; + state->locked_count = count; + + CLEAR_ERROR_STATE(); +} + +GLAPI void APIENTRY EXT_FUNC(glUnlockArraysEXT) () +{ + CHECK_PROC(glUnlockArraysEXT); + GET_CURRENT_STATE(); + ASSERT_COND(state->isBetweenLockArrays == 1, GL_INVALID_OPERATION); + ASSERT_COND(state->isBetweenBegin == 0, GL_INVALID_OPERATION); + + if (debug_array_ptr) + { + log_gl("glUnlockArraysEXT()\n"); + } + + state->isBetweenLockArrays = 0; + + CLEAR_ERROR_STATE(); +} + +GLAPI void APIENTRY glArrayElement( GLint i ) +{ + Buffer* buffer = _get_buffer(GL_ARRAY_BUFFER_ARB); + if (buffer) + { + long args[] = { INT_TO_ARG(i) }; + do_opengl_call(glArrayElement_func, NULL, args, NULL); + } + else + { + _glElementArrayImmediate(i); + } +} + +GLAPI void APIENTRY glDrawArrays( GLenum mode, + GLint first, + GLsizei count ) +{ + if (debug_array_ptr) log_gl("glDrawArrays(%d,%d,%d)\n", mode, first, count); + + _glArraysSend(first, first + count - 1); + + long args[] = { INT_TO_ARG(mode), INT_TO_ARG(first), INT_TO_ARG(count) }; + do_opengl_call(glDrawArrays_func, NULL, args, NULL); +} + +static int _isTuxRacer(GLState* state) +{ + int i; + ClientArrays* arrays = &state->client_state.arrays; + if (arrays->vertexArray.vbo_name || + arrays->normalArray.vbo_name || + arrays->colorArray.vbo_name || + arrays->vertexArray.enabled == 0 || + arrays->normalArray.enabled == 0) + return 0; + + int normalArrayOffset = (long)arrays->normalArray.ptr - (long)arrays->vertexArray.ptr; + int colorArrayOffset = (long)arrays->colorArray.ptr - (long)arrays->vertexArray.ptr; + + if (!(arrays->vertexArray.ptr != NULL && + arrays->vertexArray.stride != 0 && + arrays->vertexArray.stride == arrays->normalArray.stride && + arrays->vertexArray.stride == arrays->colorArray.stride && + normalArrayOffset >= 0 && + normalArrayOffset < arrays->vertexArray.stride && + colorArrayOffset >= 0 && + colorArrayOffset < arrays->vertexArray.stride)) + return 0; + + if (!(arrays->vertexArray.type == GL_FLOAT && arrays->vertexArray.size == 3 && + arrays->normalArray.type == GL_FLOAT && + arrays->colorArray.type == GL_UNSIGNED_BYTE && arrays->colorArray.size == 4)) + return 0; + + if (arrays->secondaryColorArray.enabled || + arrays->indexArray.enabled || + arrays->edgeFlagArray.enabled || + arrays->weightArray.enabled || + arrays->matrixIndexArray.enabled || + arrays->fogCoordArray.enabled) + return 0; + + for(i=0;i<NB_MAX_TEXTURES;i++) + { + if (arrays->texCoordArray[i].enabled) + return 0; + } + for(i=0;i<MY_GL_MAX_VERTEX_ATTRIBS_ARB;i++) + { + if (arrays->vertexAttribArray[i].enabled) + return 0; + } + return 1; +} + +static int _check_if_enabled_non_vbo_array() +{ + int i; + GET_CURRENT_STATE(); + ClientArrays* arrays = &state->client_state.arrays; + + if (arrays->vertexArray.vbo_name == 0 && arrays->vertexArray.enabled) + return 1; + if (arrays->normalArray.vbo_name == 0 && arrays->normalArray.enabled) + return 1; + if (arrays->colorArray.vbo_name == 0 && arrays->colorArray.enabled) + return 1; + if (arrays->secondaryColorArray.vbo_name == 0 && arrays->secondaryColorArray.enabled) + return 1; + if (arrays->indexArray.vbo_name == 0 && arrays->indexArray.enabled) + return 1; + if (arrays->edgeFlagArray.vbo_name == 0 && arrays->edgeFlagArray.enabled) + return 1; + if (arrays->weightArray.vbo_name == 0 && arrays->weightArray.enabled) + return 1; + if (arrays->matrixIndexArray.vbo_name == 0 && arrays->matrixIndexArray.enabled) + return 1; + if (arrays->fogCoordArray.vbo_name == 0 && arrays->fogCoordArray.enabled) + return 1; + for(i=0;i<NB_MAX_TEXTURES;i++) + { + if (arrays->texCoordArray[i].vbo_name == 0 && arrays->texCoordArray[i].enabled) + return 1; + } + for(i=0;i<MY_GL_MAX_VERTEX_ATTRIBS_ARB;i++) + { + if (arrays->vertexAttribArray[i].vbo_name == 0 && arrays->vertexAttribArray[i].enabled) + return 1; + } + for(i=0;i<MY_GL_MAX_VARIANT_POINTER_EXT;i++) + { + if (arrays->variantPointer[i].vbo_name == 0 && arrays->variantPointer[i].enabled) + return 1; + } + + return 0; +} + +GLAPI void APIENTRY glDrawElements( GLenum mode, + GLsizei count, + GLenum type, + const GLvoid *indices ) +{ + CHECK_PROC(glDrawElements); + int i; + int size = count; + //Buffer* bufferArray; + Buffer* bufferElement; + + if (debug_array_ptr) log_gl("glDrawElements(%d,%d,%d,%p)\n", mode, count, type, indices); + + if (count == 0) return; + + //bufferArray = _get_buffer(GL_ARRAY_BUFFER_ARB); + bufferElement = _get_buffer(GL_ELEMENT_ARRAY_BUFFER_ARB); + if (bufferElement) + { + if (_check_if_enabled_non_vbo_array()) + { + log_gl("sorry : unsupported : glDrawElements in EBO with a non VBO array enabled\n"); + return; + } + long args[] = { INT_TO_ARG(mode), INT_TO_ARG(count), INT_TO_ARG(type), POINTER_TO_ARG(indices) }; + do_opengl_call(_glDrawElements_buffer_func, NULL, args, NULL); + return; + } + + + int minIndice = 0; + int maxIndice = -1; + + switch(type) + { + case GL_UNSIGNED_BYTE: + { + //if (!bufferArray) + { + unsigned char* tab_indices = (unsigned char*)indices; + minIndice = tab_indices[0]; + maxIndice = tab_indices[0]; + for(i=1;i<count;i++) + { + if (tab_indices[i] < minIndice) minIndice = tab_indices[i]; + if (tab_indices[i] > maxIndice) maxIndice = tab_indices[i]; + } + } + break; + } + + case GL_UNSIGNED_SHORT: + { + size *= 2; + //if (!bufferArray) + { + unsigned short* tab_indices = (unsigned short*)indices; + minIndice = tab_indices[0]; + maxIndice = tab_indices[0]; + for(i=1;i<count;i++) + { + if (tab_indices[i] < minIndice) minIndice = tab_indices[i]; + if (tab_indices[i] > maxIndice) maxIndice = tab_indices[i]; + } + } + break; + } + + case GL_UNSIGNED_INT: + { + size *= 4; + //if (!bufferArray) + { + unsigned int* tab_indices = (unsigned int*)indices; + minIndice = tab_indices[0]; + maxIndice = tab_indices[0]; + for(i=1;i<count;i++) + { + if (tab_indices[i] < minIndice) minIndice = tab_indices[i]; + if (tab_indices[i] > maxIndice) maxIndice = tab_indices[i]; + } + //log_gl("maxIndice = %d\n", maxIndice); + if (maxIndice > 100 * 1024 * 1024) + { + log_gl("too big indice : %d\n",maxIndice); + return; + } + } + break; + } + + default: + log_gl("unsupported type = %d\n", type); + return; + } + + GET_CURRENT_STATE(); + if (_isTuxRacer(state) && type == GL_UNSIGNED_INT) + { + /* Special optimization for tuxracer */ + /* + glEnableClientState(GL_VERTEX_ARRAY); + glVertexPointer( 3, GL_FLOAT, STRIDE_GL_ARRAY, vnc_array ); + + glEnableClientState(GL_NORMAL_ARRAY); + glNormalPointer( GL_FLOAT, STRIDE_GL_ARRAY, + vnc_array + 4*sizeof(GLfloat) ); + + glEnableClientState(GL_COLOR_ARRAY); + glColorPointer( 4, GL_UNSIGNED_BYTE, STRIDE_GL_ARRAY, + vnc_array + 8*sizeof(GLfloat) ); + */ + ClientArrays* arrays = &state->client_state.arrays; + int stride = arrays->vertexArray.stride; + int bufferSize = (maxIndice - minIndice + 1) * stride + sizeof(int) * count; + int eltSize = 6 * sizeof(float) + ((arrays->colorArray.enabled) ? 4 * sizeof(unsigned char) : 0); + int singleCommandSize = count * eltSize; + if (count < bufferSize) + { + unsigned int* tab_indices = (unsigned int*)indices; + const char* vertexArray = (const char*)arrays->vertexArray.ptr; + int normalArrayOffset = (long)arrays->normalArray.ptr - (long)arrays->vertexArray.ptr; + int colorArrayOffset = (long)arrays->colorArray.ptr - (long)arrays->vertexArray.ptr; + state->tuxRacerBuffer = realloc(state->tuxRacerBuffer, singleCommandSize); + + for(i=0;i<count;i++) + { + int ind = tab_indices[i]; + memcpy(&state->tuxRacerBuffer[i * eltSize], &vertexArray[ind * stride], 3 * sizeof(float)); + memcpy(&state->tuxRacerBuffer[i * eltSize + 3 * sizeof(float)], + &vertexArray[ind * stride + normalArrayOffset], 3 * sizeof(float)); + if (arrays->colorArray.enabled) + memcpy(&state->tuxRacerBuffer[i * eltSize + 6 * sizeof(float)], + &vertexArray[ind * stride + colorArrayOffset], 4 * sizeof(unsigned char)); + } + + long args[] = { INT_TO_ARG(mode), INT_TO_ARG(count), INT_TO_ARG(arrays->colorArray.enabled), POINTER_TO_ARG(state->tuxRacerBuffer) }; + int args_size[] = { 0, 0, 0, singleCommandSize} ; + do_opengl_call(glTuxRacerDrawElements_fake_func, NULL, CHECK_ARGS(args, args_size)); + return; + } + } + _glArraysSend(minIndice, maxIndice); + + long args[] = { INT_TO_ARG(mode), INT_TO_ARG(count), INT_TO_ARG(type), POINTER_TO_ARG(indices) }; + int args_size[] = { 0, 0, 0, (indices) ? size : 0 } ; + do_opengl_call(glDrawElements_func, NULL, CHECK_ARGS(args, args_size)); +} + +GLAPI void APIENTRY glDrawRangeElements( GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices ) +{ + CHECK_PROC(glDrawRangeElements); + int size = count; + Buffer* bufferElement; + + if (debug_array_ptr) log_gl("glDrawRangeElements(0x%X, %d, %d, %d, %d, %p)\n", mode, start, end, count, type, indices); + + if (count == 0) return; + + /* Yes : try to send regular arrays even if GL_ELEMENT_ARRAY_BUFFER_ARB is enabled. + This is necessary for nexuiz 2.3 where in GL_ELEMENT_ARRAY_BUFFER_ARB some arrays are regular array pointers, + and some others are stored in VBO... */ + _glArraysSend(start, end); + + bufferElement = _get_buffer(GL_ELEMENT_ARRAY_BUFFER_ARB); + if (bufferElement) + { + long args[] = { INT_TO_ARG(mode), INT_TO_ARG(start), INT_TO_ARG(end), INT_TO_ARG(count), INT_TO_ARG(type), POINTER_TO_ARG(indices) }; + do_opengl_call(_glDrawRangeElements_buffer_func, NULL, args, NULL); + return; + } +#if 0 + int i; + switch(type) + { + case GL_UNSIGNED_BYTE: + { + unsigned char* tab_indices = (unsigned char*)indices; + for(i=0;i<count;i++) + { + if (tab_indices[i] < start || tab_indices[i] > end) + { + log_gl("indice out of bounds at offset %d\n", i); + } + } + break; + } + + case GL_UNSIGNED_SHORT: + { + size *= 2; + unsigned short* tab_indices = (unsigned short*)indices; + for(i=0;i<count;i++) + { + if (tab_indices[i] < start || tab_indices[i] > end) + { + log_gl("indice out of bounds at offset %d\n", i); + } + } + break; + } + + case GL_UNSIGNED_INT: + { + size *= 4; + unsigned int* tab_indices = (unsigned int*)indices; + for(i=0;i<count;i++) + { + if (tab_indices[i] < start || tab_indices[i] > end) + { + log_gl("indice out of bounds at offset %d\n", i); + } + } + break; + } + + default: + log_gl("unsupported type = %d\n", type); + return; + } +#else + switch(type) + { + case GL_UNSIGNED_BYTE: + { + } + + case GL_UNSIGNED_SHORT: + { + size *= 2; + break; + } + + case GL_UNSIGNED_INT: + { + size *= 4; + break; + } + + default: + log_gl("unsupported type = %d\n", type); + return; + } +#endif + long args[] = { INT_TO_ARG(mode), INT_TO_ARG(start), INT_TO_ARG(end), + INT_TO_ARG(count), INT_TO_ARG(type), POINTER_TO_ARG(indices) }; + int args_size[] = { 0, 0, 0, 0, 0, size } ; + do_opengl_call(glDrawRangeElements_func, NULL, CHECK_ARGS(args, args_size)); + +} + +DEFINE_EXT(glDrawRangeElements, ( GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices ), + (mode, start, end, count, type, indices) ) + + +GLAPI void APIENTRY glMultiDrawArrays( GLenum mode, GLint *first, + GLsizei *count, GLsizei primcount ) +{ + GLint i; + + for (i = 0; i < primcount; i++) { + if (count[i] > 0) { + glFuncTable.fpDrawArrays(mode, first[i], count[i]); + } + } +} + +DEFINE_EXT(glMultiDrawArrays, ( GLenum mode, GLint *first, + GLsizei *count, GLsizei primcount ), + (mode, first, count, primcount) ) + +GLAPI void APIENTRY glMultiDrawElements( GLenum mode, const GLsizei *count, GLenum type, + const GLvoid **indices, GLsizei primcount ) +{ + GLint i; + CHECK_PROC(glMultiDrawElements); + + Buffer* bufferElement = _get_buffer(GL_ELEMENT_ARRAY_BUFFER_ARB); + if (bufferElement && primcount > 1) + { + if (_check_if_enabled_non_vbo_array()) + { + log_gl("sorry : unsupported : glMultiDrawElements in EBO with a non VBO array enabled\n"); + return; + } + long args[] = { INT_TO_ARG(mode), POINTER_TO_ARG(count), INT_TO_ARG(type), + POINTER_TO_ARG(indices), INT_TO_ARG(primcount) }; + int args_size[] = { 0, primcount * sizeof(int), 0, primcount * sizeof(void*), 0 }; + do_opengl_call(_glMultiDrawElements_buffer_func, NULL, args, args_size); + return; + } + + for (i = 0; i < primcount; i++) { + if (count[i] > 0) { + glFuncTable.fpDrawElements(mode, count[i], type, indices[i]); + } + } +} + +DEFINE_EXT(glMultiDrawElements, ( GLenum mode, const GLsizei *count, GLenum type, + const GLvoid **indices, GLsizei primcount ), + (mode, count, type, indices, primcount) ) + + +#if 0 +GLAPI void APIENTRY glArrayObjectATI (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset) +{ + CHECK_PROC(glArrayObjectATI); + //log_gl("glArrayObjectATI(array=%p, size=%d, type=%p, stride=%d, buffer=%d, offset=%d)\n", array, size, type, stride, buffer, offset); + long args[] = { UNSIGNED_INT_TO_ARG(array), INT_TO_ARG(size), UNSIGNED_INT_TO_ARG(type), INT_TO_ARG(stride), UNSIGNED_INT_TO_ARG(buffer), UNSIGNED_INT_TO_ARG(offset)}; + do_opengl_call(glArrayObjectATI_func, NULL, args, NULL); +} +#endif + +GLAPI void APIENTRY glDrawElementArrayATI (GLenum mode, GLsizei count) +{ + CHECK_PROC(glDrawElementArrayATI); + GET_CURRENT_STATE(); + + if (state->client_state.arrays.elementArrayATI.enabled && + state->client_state.arrays.elementArrayATI.ptr != NULL) + { + int size = count * getMulFactorFromPointerArray(&state->client_state.arrays.elementArrayATI); + long args[] = { INT_TO_ARG(state->client_state.arrays.elementArrayATI.type), + INT_TO_ARG(size), + INT_TO_ARG(state->client_state.arrays.elementArrayATI.ptr) }; + int args_size[] = {0, 0, size}; + do_opengl_call(glElementPointerATI_fake_func, NULL, CHECK_ARGS(args, args_size)); + } + + long args[] = { INT_TO_ARG(mode), INT_TO_ARG(count) }; + do_opengl_call(glDrawElementArrayATI_func, NULL, args, NULL); +} + +GLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum mode, GLuint start, GLuint end, GLsizei count) +{ + CHECK_PROC(glDrawRangeElementArrayATI); + GET_CURRENT_STATE(); + + if (state->client_state.arrays.elementArrayATI.enabled && + state->client_state.arrays.elementArrayATI.ptr != NULL) + { + int size = count * getMulFactorFromPointerArray(&state->client_state.arrays.elementArrayATI); + long args[] = { INT_TO_ARG(state->client_state.arrays.elementArrayATI.type), + INT_TO_ARG(size), + INT_TO_ARG(state->client_state.arrays.elementArrayATI.ptr) }; + int args_size[] = {0, 0, size}; + do_opengl_call(glElementPointerATI_fake_func, NULL, CHECK_ARGS(args, args_size)); + } + + long args[] = { INT_TO_ARG(mode), INT_TO_ARG(start), INT_TO_ARG(end), INT_TO_ARG(count) }; + do_opengl_call(glDrawRangeElementArrayATI_func, NULL, args, NULL); +} + +GLAPI GLuint APIENTRY glGenSymbolsEXT(GLenum datatype, GLenum storagetype, GLenum range, GLuint components) +{ + GLuint id = 0; + CHECK_PROC_WITH_RET(glGenSymbolsEXT); + GET_CURRENT_STATE(); + long args[] = { datatype, storagetype, range, components }; + do_opengl_call(glGenSymbolsEXT_func, &id, args, NULL); + if (id != 0) + { + state->symbols.tab = realloc(state->symbols.tab, (state->symbols.count+1) * sizeof(Symbol)); + state->symbols.tab[state->symbols.count].id = id; + state->symbols.tab[state->symbols.count].datatype = datatype; + state->symbols.tab[state->symbols.count].components = components; + state->symbols.count++; + } + return id; +} + +static int get_vertex_shader_var_nb_composants(GLuint id) +{ + GET_CURRENT_STATE(); + int i; + for(i=0;i<state->symbols.count;i++) + { + if (id >= state->symbols.tab[i].id && id < state->symbols.tab[i].id + state->symbols.tab[i].components) + { + int size = 0; + + if (state->symbols.tab[i].datatype == GL_SCALAR_EXT) + size = 1; + else if (state->symbols.tab[i].datatype == GL_VECTOR_EXT) + size = 4; + else if (state->symbols.tab[i].datatype == GL_MATRIX_EXT) + size = 16; + else + { + log_gl("unknown datatype %d\n", state->symbols.tab[i].datatype); + return 0; + } + + return size; + } + } + log_gl("unknown id %d\n", id); + return 0; +} + +GLAPI void APIENTRY glSetLocalConstantEXT (GLuint id, GLenum type, const GLvoid *addr) +{ + CHECK_PROC(glSetLocalConstantEXT); + int size = get_vertex_shader_var_nb_composants(id) * getGlTypeByteSize(type); + if (size) + { + long args[] = { id, type, POINTER_TO_ARG(addr) }; + int args_size[] = { 0, 0, size }; + + do_opengl_call(glSetLocalConstantEXT_func, NULL, CHECK_ARGS(args, args_size)); + } +} + +GLAPI void APIENTRY glSetInvariantEXT (GLuint id, GLenum type, const GLvoid *addr) +{ + CHECK_PROC(glSetInvariantEXT); + int size = get_vertex_shader_var_nb_composants(id) * getGlTypeByteSize(type); + if (size) + { + long args[] = { id, type, POINTER_TO_ARG(addr) }; + int args_size[] = { 0, 0, size }; + + do_opengl_call(glSetInvariantEXT_func, NULL, CHECK_ARGS(args, args_size)); + } +} + +#define glVariantGeneric(func_name, gltype) \ +GLAPI void APIENTRY func_name (GLuint id, const gltype * addr)\ +{\ + CHECK_PROC(func_name); \ + int size = get_vertex_shader_var_nb_composants(id) * sizeof(gltype); \ + if (size) \ + { \ + long args[] = { id, POINTER_TO_ARG(addr) }; \ + int args_size[] = { 0, size }; \ + do_opengl_call(CONCAT(func_name,_func), NULL, CHECK_ARGS(args, args_size)); \ + } \ +} + +glVariantGeneric(glVariantbvEXT, GLbyte); +glVariantGeneric(glVariantsvEXT, GLshort); +glVariantGeneric(glVariantivEXT, GLint); +glVariantGeneric(glVariantfvEXT, GLfloat); +glVariantGeneric(glVariantdvEXT, GLdouble); +glVariantGeneric(glVariantubvEXT, GLubyte); +glVariantGeneric(glVariantusvEXT, GLushort); +glVariantGeneric(glVariantuivEXT, GLuint); + +GLAPI void APIENTRY glEnableVariantClientStateEXT (GLuint id) +{ + CHECK_PROC(glEnableVariantClientStateEXT); + long args[] = { id }; + do_opengl_call(glEnableVariantClientStateEXT_func, NULL, args, NULL); + if (id < MY_GL_MAX_VARIANT_POINTER_EXT) + { + GET_CURRENT_STATE(); + state->client_state.arrays.variantPointer[id].enabled = 1; + } +} + +GLAPI void APIENTRY glDisableVariantClientStateEXT (GLuint id) +{ + CHECK_PROC(glDisableVariantClientStateEXT); + long args[] = { id }; + do_opengl_call(glDisableVariantClientStateEXT_func, NULL, args, NULL); + if (id < MY_GL_MAX_VARIANT_POINTER_EXT) + { + GET_CURRENT_STATE(); + state->client_state.arrays.variantPointer[id].enabled = 0; + } +} + +GLAPI void APIENTRY glVariantPointerEXT (GLuint id, GLenum type, GLuint stride, const GLvoid *ptr) +{ + CHECK_PROC(glVariantPointerEXT); + + GET_CURRENT_STATE(); + if (id < MY_GL_MAX_VARIANT_POINTER_EXT) + { + state->client_state.arrays.variantPointer[id].vbo_name = state->arrayBuffer; + if (state->client_state.arrays.variantPointer[id].vbo_name) + { + long args[] = { INT_TO_ARG(id), INT_TO_ARG(type), INT_TO_ARG(stride), POINTER_TO_ARG(ptr) }; + do_opengl_call(_glVariantPointerEXT_buffer_func, NULL, args, NULL); + return; + } + + if (debug_array_ptr) + log_gl("glVariantPointerEXT[%d] type=%dstride=%d ptr=%p\n", + id, type, stride, ptr); + state->client_state.arrays.variantPointer[id].index = id; + state->client_state.arrays.variantPointer[id].size = 4; + state->client_state.arrays.variantPointer[id].type = type; + state->client_state.arrays.variantPointer[id].stride = stride; + state->client_state.arrays.variantPointer[id].ptr = ptr; + } + else + { + log_gl("id >= MY_GL_MAX_VARIANT_POINTER_EXT\n"); + } +} + +#define glGetVariantGeneric(func_name, gltype) \ +GLAPI void APIENTRY func_name (GLuint id, GLenum name, gltype* addr)\ +{\ + CHECK_PROC(func_name); \ + int size = (name == GL_VARIANT_VALUE_EXT) ? get_vertex_shader_var_nb_composants(id) * sizeof(gltype) : sizeof(gltype); \ + if (size) \ + { \ + long args[] = { id, name, POINTER_TO_ARG(addr) }; \ + int args_size[] = { 0, 0, size }; \ + do_opengl_call(CONCAT(func_name,_func), NULL, CHECK_ARGS(args, args_size)); \ + } \ +} + +glGetVariantGeneric(glGetVariantBooleanvEXT, GLboolean); +glGetVariantGeneric(glGetVariantIntegervEXT, GLint); +glGetVariantGeneric(glGetVariantFloatvEXT, GLfloat); + +GLAPI void APIENTRY glGetVariantPointervEXT (GLuint id, GLenum name, GLvoid* *addr) +{ + CHECK_PROC(glGetVariantPointervEXT); + + GET_CURRENT_STATE(); + if (id < MY_GL_MAX_VARIANT_POINTER_EXT) + { + if (name == GL_VARIANT_ARRAY_POINTER_EXT) + *addr = (void*)state->client_state.arrays.variantPointer[id].ptr; + } + else + { + log_gl("id >= MY_GL_MAX_VARIANT_POINTER_EXT\n"); + } +} + +#define glGetInvariantGeneric(func_name, gltype) \ +GLAPI void APIENTRY func_name (GLuint id, GLenum name, gltype* addr)\ +{\ + CHECK_PROC(func_name); \ + int size = (name == GL_INVARIANT_VALUE_EXT) ? get_vertex_shader_var_nb_composants(id) * sizeof(gltype) : sizeof(gltype); \ + if (size) \ + { \ + long args[] = { id, name, POINTER_TO_ARG(addr) }; \ + int args_size[] = { 0, 0, size }; \ + do_opengl_call(CONCAT(func_name,_func), NULL, CHECK_ARGS(args, args_size)); \ + } \ +} + +glGetInvariantGeneric(glGetInvariantBooleanvEXT, GLboolean); +glGetInvariantGeneric(glGetInvariantIntegervEXT, GLint); +glGetInvariantGeneric(glGetInvariantFloatvEXT, GLfloat); + +#define glGetLocalConstantGeneric(func_name, gltype) \ +GLAPI void APIENTRY func_name (GLuint id, GLenum name, gltype* addr)\ +{\ + CHECK_PROC(func_name); \ + int size = (name == GL_LOCAL_CONSTANT_VALUE_EXT) ? get_vertex_shader_var_nb_composants(id) * sizeof(gltype) : sizeof(gltype); \ + if (size) \ + { \ + long args[] = { id, name, POINTER_TO_ARG(addr) }; \ + int args_size[] = { 0, 0, size }; \ + do_opengl_call(CONCAT(func_name,_func), NULL, CHECK_ARGS(args, args_size)); \ + } \ +} + +glGetLocalConstantGeneric(glGetLocalConstantBooleanvEXT, GLboolean); +glGetLocalConstantGeneric(glGetLocalConstantIntegervEXT, GLint); +glGetLocalConstantGeneric(glGetLocalConstantFloatvEXT, GLfloat); + +static void _glShaderSource(int func_number, GLhandleARB handle, GLsizei size, const GLcharARB** tab_prog, const GLint* tab_length) +{ + int i; + int* my_tab_length; + int total_length = 0; + int acc_length = 0; + GLcharARB* all_progs; + + if (size <= 0 || tab_prog == NULL) + { + log_gl("size <= 0 || tab_prog == NULL\n"); + return; + } + my_tab_length = malloc(sizeof(int) * size); + for(i=0;i<size;i++) + { + if (tab_prog[i] == NULL) + { + log_gl("tab_prog[%d] == NULL\n", i); + free(my_tab_length); + return ; + } + my_tab_length[i] = (tab_length && tab_length[i]) ? tab_length[i] : strlen(tab_prog[i]); + total_length += my_tab_length[i]; + } + all_progs = malloc(total_length+1); + all_progs[total_length] = 0; + total_length ++; + for(i=0;i<size;i++) + { + char* str_tmp = all_progs + acc_length; + memcpy(str_tmp, tab_prog[i], my_tab_length[i]); + if (debug_gl) log_gl("glShaderSource[%d] : %s\n", i, str_tmp); + char* version_ptr = strstr(str_tmp, "#version"); + if (version_ptr && version_ptr != str_tmp) + { + /* ATI driver won't be happy if "#version" is not at beginning of program */ + /* Necessary for "Danger from the Deep 0.3.0" */ + int offset = version_ptr - str_tmp; + char* eol = strchr(version_ptr, '\n'); + if (eol) + { + int len = eol - version_ptr + 1; + memcpy(str_tmp, tab_prog[i] + offset, len); + memcpy(str_tmp + len, tab_prog[i], offset); + } + } + acc_length += my_tab_length[i]; + } + long args[] = { INT_TO_ARG(handle), INT_TO_ARG(size), POINTER_TO_ARG(all_progs), POINTER_TO_ARG(my_tab_length) } ; + int args_size[] = { 0, 0, total_length, sizeof(int) * size }; + do_opengl_call(func_number, NULL, CHECK_ARGS(args, args_size)); + free(my_tab_length); + free(all_progs); +} + + +GLAPI void APIENTRY EXT_FUNC(glShaderSourceARB) (GLhandleARB handle, GLsizei size, const GLcharARB** tab_prog, const GLint* tab_length) +{ + CHECK_PROC(glShaderSourceARB); + _glShaderSource(glShaderSourceARB_fake_func, handle, size, tab_prog, tab_length); +} + +GLAPI void APIENTRY EXT_FUNC(glShaderSource) (GLhandleARB handle, GLsizei size, const GLcharARB** tab_prog, const GLint* tab_length) +{ + CHECK_PROC(glShaderSource); + _glShaderSource(glShaderSource_fake_func, handle, size, tab_prog, tab_length); +} + +GLAPI void APIENTRY EXT_FUNC(glGetProgramInfoLog)(GLuint program, + GLsizei maxLength, + GLsizei *length, + GLchar *infoLog) +{ + CHECK_PROC(glGetProgramInfoLog); + int fake_length; + if (length == NULL) length = &fake_length; + long args[] = { INT_TO_ARG(program), INT_TO_ARG(maxLength), POINTER_TO_ARG(length), POINTER_TO_ARG(infoLog) }; + int args_size[] = { 0, 0, sizeof(int), maxLength }; + do_opengl_call(glGetProgramInfoLog_func, NULL, CHECK_ARGS(args, args_size)); + log_gl("glGetProgramInfoLog: %s\n", infoLog); +} + + +GLAPI void APIENTRY EXT_FUNC(glGetProgramStringARB) (GLenum target, GLenum pname, GLvoid *string) +{ + int size = 0; + CHECK_PROC(glGetProgramStringARB); + glGetProgramivARB(target, GL_PROGRAM_LENGTH_ARB, &size); + long args[] = { INT_TO_ARG(target), INT_TO_ARG(pname), POINTER_TO_ARG(string) }; + int args_size[] = { 0, 0, size }; + do_opengl_call(glGetProgramStringARB_func, NULL, CHECK_ARGS(args, args_size)); +} + +GLAPI void APIENTRY EXT_FUNC(glGetProgramStringNV) (GLenum target, GLenum pname, GLvoid *string) +{ + int size = 0; + CHECK_PROC(glGetProgramStringNV); + glGetProgramivNV(target, GL_PROGRAM_LENGTH_NV, &size); + long args[] = { INT_TO_ARG(target), INT_TO_ARG(pname), POINTER_TO_ARG(string) }; + int args_size[] = { 0, 0, size }; + do_opengl_call(glGetProgramStringNV_func, NULL, CHECK_ARGS(args, args_size)); +} + + + +GLAPI void APIENTRY EXT_FUNC(glGetInfoLogARB)(GLhandleARB object, + GLsizei maxLength, + GLsizei *length, + GLcharARB *infoLog) +{ + CHECK_PROC(glGetInfoLogARB); + int fake_length; + if (length == NULL) length = &fake_length; + long args[] = { INT_TO_ARG(object), INT_TO_ARG(maxLength), POINTER_TO_ARG(length), POINTER_TO_ARG(infoLog) }; + /*int size = 0; + glGetObjectParameterARBiv(object, GL_OBJECT_INFO_LOG_LENGTH_ARB, &size);*/ + int args_size[] = { 0, 0, sizeof(int), maxLength }; + do_opengl_call(glGetInfoLogARB_func, NULL, CHECK_ARGS(args, args_size)); + log_gl("glGetInfoLogARB : %s\n", infoLog); +} + +GLAPI void APIENTRY EXT_FUNC(glGetAttachedObjectsARB)(GLhandleARB program, + GLsizei maxCount, + GLsizei *count, + GLhandleARB *objects) +{ + CHECK_PROC(glGetAttachedObjectsARB); + int fake_count; + if (count == NULL) count = &fake_count; + long args[] = { INT_TO_ARG(program), INT_TO_ARG(maxCount), POINTER_TO_ARG(count), POINTER_TO_ARG(objects) }; + /*int size = 0; + glGetObjectParameterARBiv(object, GL_OBJECT_ATTACHED_OBJECTS_ARB, &size);*/ + int args_size[] = { 0, 0, sizeof(int), maxCount * sizeof(int) }; + do_opengl_call(glGetAttachedObjectsARB_func, NULL, CHECK_ARGS(args, args_size)); +} + +GLAPI void APIENTRY EXT_FUNC(glGetAttachedShaders)(GLuint program, + GLsizei maxCount, + GLsizei *count, + GLuint *shaders) +{ + CHECK_PROC(glGetAttachedShaders); + int fake_count; + if (count == NULL) count = &fake_count; + long args[] = { INT_TO_ARG(program), INT_TO_ARG(maxCount), POINTER_TO_ARG(count), POINTER_TO_ARG(shaders) }; + int args_size[] = { 0, 0, sizeof(int), maxCount * sizeof(int) }; + do_opengl_call(glGetAttachedShaders_func, NULL, CHECK_ARGS(args, args_size)); +} + +GLAPI GLint EXT_FUNC(glGetUniformLocationARB) (GLuint program, const GLcharARB *txt) +{ + int i; + int ret = -1; + GET_CURRENT_STATE(); + for(i=0;i<state->countUniformLocations;i++) + { + if (state->uniformLocations[i].program == program && + strcmp(state->uniformLocations[i].txt, txt) == 0) + { + return state->uniformLocations[i].location; + } + } + + CHECK_PROC_WITH_RET(glGetUniformLocationARB); + long args[] = { INT_TO_ARG(program), POINTER_TO_ARG(txt) } ; + do_opengl_call(glGetUniformLocationARB_func, &ret, args, NULL); + + state->uniformLocations = realloc(state->uniformLocations, sizeof(UniformLocation) * (state->countUniformLocations+1)); + state->uniformLocations[state->countUniformLocations].program = program; + state->uniformLocations[state->countUniformLocations].txt = strdup(txt); + state->uniformLocations[state->countUniformLocations].location = ret; + state->countUniformLocations++; + + return ret; +} + +GLAPI GLint EXT_FUNC(glGetUniformLocation) (GLuint program, const GLcharARB *txt) +{ + int i; + int ret = -1; + GET_CURRENT_STATE(); + for(i=0;i<state->countUniformLocations;i++) + { + if (state->uniformLocations[i].program == program && + strcmp(state->uniformLocations[i].txt, txt) == 0) + { + return state->uniformLocations[i].location; + } + } + + CHECK_PROC_WITH_RET(glGetUniformLocation); + long args[] = { INT_TO_ARG(program), POINTER_TO_ARG(txt) } ; + do_opengl_call(glGetUniformLocation_func, &ret, args, NULL); + + state->uniformLocations = realloc(state->uniformLocations, sizeof(UniformLocation) * (state->countUniformLocations+1)); + state->uniformLocations[state->countUniformLocations].program = program; + state->uniformLocations[state->countUniformLocations].txt = strdup(txt); + state->uniformLocations[state->countUniformLocations].location = ret; + state->countUniformLocations++; + + return ret; +} + +/* TODO:re-design the uniformLocations data structure, so that can invalide it + * per program + */ +GLAPI void APIENTRY EXT_FUNC(glLinkProgram) (GLuint program) +{ + /* Invalid cashed uniformlocation */ + GET_CURRENT_STATE(); + state->countUniformLocations = 0; + free(state->uniformLocations); + state->uniformLocations = NULL; + + CHECK_PROC(glLinkProgram); + long args[] = { UNSIGNED_INT_TO_ARG(program)}; + do_opengl_call(glLinkProgram_func, NULL, args, NULL); +} + +GLAPI void APIENTRY EXT_FUNC(glLinkProgramARB) (GLhandleARB program) +{ + /* Invalid cashed uniformlocation */ + GET_CURRENT_STATE(); + state->countUniformLocations = 0; + free(state->uniformLocations); + state->uniformLocations = NULL; + + CHECK_PROC(glLinkProgramARB); + long args[] = { UNSIGNED_INT_TO_ARG(program)}; + do_opengl_call(glLinkProgramARB_func, NULL, args, NULL); +} + +GLAPI void APIENTRY EXT_FUNC(glGetActiveUniformARB)(GLuint program, + GLuint index, + GLsizei maxLength, + GLsizei *length, + GLint *size, + GLenum *type, + GLcharARB *name) +{ + CHECK_PROC(glGetActiveUniformARB); + int fake_length; + if (length == NULL) length = &fake_length; + long args[] = { INT_TO_ARG(program), INT_TO_ARG(index), INT_TO_ARG(maxLength), POINTER_TO_ARG(length), POINTER_TO_ARG(size), POINTER_TO_ARG(type), POINTER_TO_ARG(name) }; + int args_size[] = { 0, 0, 0, sizeof(int), sizeof(int), sizeof(int), maxLength }; + do_opengl_call(glGetActiveUniformARB_func, NULL, CHECK_ARGS(args, args_size)); +} + +GLAPI void APIENTRY EXT_FUNC(glGetActiveUniform)(GLuint program, + GLuint index, + GLsizei maxLength, + GLsizei *length, + GLint *size, + GLenum *type, + GLcharARB *name) +{ + CHECK_PROC(glGetActiveUniform); + int fake_length; + if (length == NULL) length = &fake_length; + long args[] = { INT_TO_ARG(program), INT_TO_ARG(index), INT_TO_ARG(maxLength), POINTER_TO_ARG(length), POINTER_TO_ARG(size), POINTER_TO_ARG(type), POINTER_TO_ARG(name) }; + int args_size[] = { 0, 0, 0, sizeof(int), sizeof(int), sizeof(int), maxLength }; + do_opengl_call(glGetActiveUniform_func, NULL, CHECK_ARGS(args, args_size)); +} + +GLAPI void APIENTRY EXT_FUNC(glGetActiveVaryingNV)(GLuint program, + GLuint index, + GLsizei bufSize, + GLsizei *length, + GLsizei *size, + GLenum *type, + GLchar *name) +{ + CHECK_PROC(glGetActiveVaryingNV); + int fake_length; + if (length == NULL) length = &fake_length; + long args[] = { INT_TO_ARG(program), INT_TO_ARG(index), INT_TO_ARG(bufSize), POINTER_TO_ARG(length), POINTER_TO_ARG(size), POINTER_TO_ARG(type), POINTER_TO_ARG(name) }; + int args_size[] = { 0, 0, 0, sizeof(int), sizeof(int), sizeof(int), bufSize }; + do_opengl_call(glGetActiveVaryingNV_func, NULL, CHECK_ARGS(args, args_size)); +} + +static int _get_size_of_gl_uniform_variables(GLenum type) +{ + switch(type) + { + case GL_FLOAT: return sizeof(float); + case GL_FLOAT_VEC2: return 2*sizeof(float); + case GL_FLOAT_VEC3: return 3*sizeof(float); + case GL_FLOAT_VEC4: return 4*sizeof(float); + case GL_INT: return sizeof(int); + case GL_INT_VEC2: return 2*sizeof(int); + case GL_INT_VEC3: return 3*sizeof(int); + case GL_INT_VEC4: return 4*sizeof(int); + case GL_BOOL: return sizeof(int); + case GL_BOOL_VEC2: return 2*sizeof(int); + case GL_BOOL_VEC3: return 3*sizeof(int); + case GL_BOOL_VEC4: return 4*sizeof(int); + case GL_FLOAT_MAT2: return 2*2*sizeof(float); + case GL_FLOAT_MAT3: return 3*3*sizeof(float); + case GL_FLOAT_MAT4: return 4*4*sizeof(float); + case GL_FLOAT_MAT2x3:return 2*3*sizeof(float); + case GL_FLOAT_MAT2x4:return 2*4*sizeof(float); + case GL_FLOAT_MAT3x2:return 3*2*sizeof(float); + case GL_FLOAT_MAT3x4:return 3*4*sizeof(float); + case GL_FLOAT_MAT4x2:return 4*2*sizeof(float); + case GL_FLOAT_MAT4x3:return 4*3*sizeof(float); + case GL_SAMPLER_1D: + case GL_SAMPLER_2D: + case GL_SAMPLER_3D: + case GL_SAMPLER_CUBE: + case GL_SAMPLER_1D_SHADOW: + case GL_SAMPLER_2D_SHADOW: + return sizeof(int); + + default: + log_gl("unknown type for a uniform variable : %X\n", type); + return 0; + } +} + +static void _gl_get_uniform(PFNGLGETPROGRAMIVPROC getProgramiv, + PFNGLGETACTIVEUNIFORMPROC getActiveUniform, + int func_number, + GLuint program, + GLint location, + void* params) +{ + GET_CURRENT_STATE(); + int nActiveUniforms = 0; + int nameMaxLength = 0; + int i; + + getProgramiv(program, GL_ACTIVE_UNIFORMS, &nActiveUniforms); + getProgramiv(program, GL_ACTIVE_UNIFORM_MAX_LENGTH, &nameMaxLength); + + char* name = malloc(nameMaxLength+1); + char* uniformName = NULL; + for(i=0;i<state->countUniformLocations;i++) + { + if (state->uniformLocations[i].program == program && + state->uniformLocations[i].location == location) + { + uniformName = state->uniformLocations[i].txt; + break; + } + } + if (uniformName == NULL) + { + log_gl("unknown uniform location : %d\n", location); + return; + } + char* uniformName2 = NULL; + if (strchr(uniformName, '[') == 0) + { + uniformName2 = malloc(strlen(uniformName) + 3 + 1); + strcpy(uniformName2, uniformName); + strcat(uniformName2, "[0]"); + } + /*log_gl("nActiveUniforms=%d\n", nActiveUniforms);*/ + for(i=0;i<nActiveUniforms;i++) + { + int actualLength, size; + unsigned int type; + int index = (i == 0 && location < nActiveUniforms) ? location : (i == location) ? 0 : i; + getActiveUniform(program, index, nameMaxLength, &actualLength, &size, &type, name); + /*log_gl("[%d] %s\n", i, name);*/ + if (strcmp(name, uniformName) == 0 || (uniformName2 && strcmp(name, uniformName2) == 0)) + { + long args[] = { INT_TO_ARG(program), INT_TO_ARG(location), POINTER_TO_ARG(params) }; + int args_size[] = { 0, 0, size * _get_size_of_gl_uniform_variables(type) }; + do_opengl_call(func_number, NULL, CHECK_ARGS(args, args_size)); + break; + } + } + if (i == nActiveUniforms) + { + log_gl("sorry : I can't retrieve %s in the list of active uniforms\n", uniformName); + } + free(uniformName2); + free(name); +} + +GLAPI void APIENTRY EXT_FUNC(glGetUniformfvARB)(GLuint program, + GLint location, + GLfloat *params) +{ + CHECK_PROC(glGetUniformfvARB); + _gl_get_uniform(glGetProgramivARB, glGetActiveUniformARB, glGetUniformfvARB_func, program, location, params); +} + +GLAPI void APIENTRY EXT_FUNC(glGetUniformfv)(GLuint program, + GLint location, + GLfloat *params) +{ + CHECK_PROC(glGetUniformfv); + _gl_get_uniform(glGetProgramiv, glGetActiveUniform, glGetUniformfv_func, program, location, params); +} + + +GLAPI void APIENTRY EXT_FUNC(glGetUniformivARB)(GLuint program, + GLint location, + GLint *params) +{ + CHECK_PROC(glGetUniformivARB); + _gl_get_uniform(glGetProgramivARB, glGetActiveUniformARB, glGetUniformivARB_func, program, location, params); +} + +GLAPI void APIENTRY EXT_FUNC(glGetUniformuivEXT)(GLuint program, + GLint location, + GLuint *params) +{ + CHECK_PROC(glGetUniformuivEXT); + _gl_get_uniform(glGetProgramivARB, glGetActiveUniformARB, glGetUniformuivEXT_func, program, location, params); +} + +GLAPI void APIENTRY EXT_FUNC(glGetUniformiv)(GLuint program, + GLint location, + GLint *params) +{ + CHECK_PROC(glGetUniformiv); + _gl_get_uniform(glGetProgramiv, glGetActiveUniform, glGetUniformiv_func, program, location, params); +} + +GLAPI void APIENTRY EXT_FUNC(glGetShaderSourceARB)(GLuint shader, + GLsizei maxLength, + GLsizei *length, + GLcharARB *source) +{ + CHECK_PROC(glGetShaderSourceARB); + int fake_length; + if (length == NULL) length = &fake_length; + long args[] = { INT_TO_ARG(shader), INT_TO_ARG(maxLength), POINTER_TO_ARG(length), POINTER_TO_ARG(source) }; + int args_size[] = { 0, 0, sizeof(int), maxLength }; + do_opengl_call(glGetShaderSourceARB_func, NULL, CHECK_ARGS(args, args_size)); + log_gl("glGetShaderSourceARB : %s\n", source); +} + +GLAPI void APIENTRY EXT_FUNC(glGetShaderSource)(GLuint shader, + GLsizei maxLength, + GLsizei *length, + GLcharARB *source) +{ + CHECK_PROC(glGetShaderSource); + int fake_length; + if (length == NULL) length = &fake_length; + long args[] = { INT_TO_ARG(shader), INT_TO_ARG(maxLength), POINTER_TO_ARG(length), POINTER_TO_ARG(source) }; + int args_size[] = { 0, 0, sizeof(int), maxLength }; + do_opengl_call(glGetShaderSource_func, NULL, CHECK_ARGS(args, args_size)); + log_gl("glGetShaderSource : %s\n", source); +} + + +GLAPI void APIENTRY EXT_FUNC(glGetShaderInfoLog)(GLuint shader, + GLsizei maxLength, + GLsizei *length, + GLchar *infoLog) +{ + CHECK_PROC(glGetShaderInfoLog); + int fake_length; + if (length == NULL) length = &fake_length; + long args[] = { INT_TO_ARG(shader), INT_TO_ARG(maxLength), POINTER_TO_ARG(length), POINTER_TO_ARG(infoLog) }; + int args_size[] = { 0, 0, sizeof(int), maxLength }; + do_opengl_call(glGetShaderInfoLog_func, NULL, CHECK_ARGS(args, args_size)); + log_gl("glGetShaderInfoLog: %s\n", infoLog); +} + + +static ObjectBufferATI* _new_object_buffer_ATI() +{ + GET_CURRENT_STATE(); + int i; + for(i=0;i<32768;i++) + { + if (state->objectBuffersATI[i].bufferid == 0) + { + memset(&state->objectBuffersATI[i], 0, sizeof(ObjectBufferATI)); + return &state->objectBuffersATI[i]; + } + } + return NULL; +} + +static ObjectBufferATI* _find_object_buffer_ATI_from_id(GLuint buffer) +{ + GET_CURRENT_STATE(); + int i; + for(i=0;i<32768;i++) + { + if (state->objectBuffersATI[i].bufferid == buffer) + { + return &state->objectBuffersATI[i]; + } + } + return NULL; +} + +static void _free_object_buffer_ATI(ObjectBufferATI* objectBufferATI) +{ + if (objectBufferATI == NULL) return; + + if (objectBufferATI->ptr) + free(objectBufferATI->ptr); + objectBufferATI->ptr = NULL; + if (objectBufferATI->ptrMapped) + free(objectBufferATI->ptrMapped); + objectBufferATI->ptrMapped = NULL; + if (objectBufferATI->ptrUpdatedWhileMapped) + free(objectBufferATI->ptrUpdatedWhileMapped); + objectBufferATI->ptrUpdatedWhileMapped = NULL; + if (objectBufferATI->updatedRangesAfterMapping.ranges) + free(objectBufferATI->updatedRangesAfterMapping.ranges); + objectBufferATI->updatedRangesAfterMapping.ranges = NULL; + objectBufferATI->updatedRangesAfterMapping.nb = 0; + objectBufferATI->bufferid = 0; + objectBufferATI->size = 0; +} + +GLAPI GLuint APIENTRY EXT_FUNC(glNewObjectBufferATI) (GLsizei size, const GLvoid *pointer, GLenum usage) +{ + int buffer = 0; + CHECK_PROC_WITH_RET(glNewObjectBufferATI); + long args[] = { INT_TO_ARG(size), POINTER_TO_ARG(pointer), INT_TO_ARG(usage) }; + int args_size[] = { 0, (pointer) ? size : 0, 0 }; + do_opengl_call(glNewObjectBufferATI_func, &buffer, CHECK_ARGS(args, args_size)); + //log_gl("glNewObjectBufferATI(%d,%p) --> %d\n", size, pointer, buffer); + + if (buffer != 0) + { + ObjectBufferATI* objectBufferATI = _new_object_buffer_ATI(); + if (objectBufferATI) + { + objectBufferATI->bufferid = buffer; + objectBufferATI->size = size; + objectBufferATI->ptr = malloc(size); + objectBufferATI->ptrMapped = NULL; + if (pointer) + memcpy(objectBufferATI->ptr, pointer, size); + } + } + + return buffer; +} + +GLAPI void APIENTRY EXT_FUNC(glFreeObjectBufferATI) (GLuint buffer) +{ + CHECK_PROC(glFreeObjectBufferATI); + long args[] = { UNSIGNED_INT_TO_ARG(buffer)}; + do_opengl_call(glFreeObjectBufferATI_func, NULL, args, NULL); + _free_object_buffer_ATI(_find_object_buffer_ATI_from_id(buffer)); +} + +static void _add_int_range_to_ranges(IntSetRanges* ranges, int start, int length) +{ + int i,j; + for(i=0;i<ranges->nb;i++) + { + IntRange* range = &ranges->ranges[i]; + if (start <= range->start) + { + if (start + length < range->start) + { + if (ranges->nb == ranges->maxNb) + ranges->ranges = realloc(ranges->ranges, sizeof(IntRange) * (ranges->nb+1)); + memmove(&ranges->ranges[i+1], &ranges->ranges[i], sizeof(IntRange) * (ranges->nb - i)); + ranges->nb++; + if (ranges->nb > ranges->maxNb) + ranges->maxNb = ranges->nb; + ranges->ranges[i].start = start; + ranges->ranges[i].length = length; + return; + } + else if (start + length <= range->start + range->length) + { + range->length = range->start + range->length - start; + range->start = start; + return; + } + else + { + j = i + 1; + range->start = start; + range->length = start + length - range->start; + while(j < ranges->nb && start + length >= ranges->ranges[j].start) + { + if (start + length <= ranges->ranges[j].start + ranges->ranges[j].length) + { + range->length = ranges->ranges[j].start + ranges->ranges[j].length - range->start; + j++; + break; + } + j++; + } + if (i+1<j && j < ranges->nb) + memmove(&ranges->ranges[i+1], &ranges->ranges[j], sizeof(IntRange) * (j - (i + 1))); + ranges->nb -= j - (i+1); + return; + } + } + else + { + if (start > range->start + range->length) + { + continue; + } + else if (start + length <= range->start + range->length) + { + return; + } + else + { + j = i + 1; + range->length = start + length - range->start; + while(j < ranges->nb && start + length >= ranges->ranges[j].start) + { + if (start + length <= ranges->ranges[j].start + ranges->ranges[j].length) + { + range->length = ranges->ranges[j].start + ranges->ranges[j].length - range->start; + j++; + break; + } + j++; + } + if (i+1<j && j < ranges->nb) + memmove(&ranges->ranges[i+1], &ranges->ranges[j], sizeof(IntRange) * (j - (i + 1))); + ranges->nb -= j - (i+1); + return; + } + } + } + if (ranges->nb == ranges->maxNb) + ranges->ranges = realloc(ranges->ranges, sizeof(IntRange) * (ranges->nb+1)); + ranges->ranges[ranges->nb].start = start; + ranges->ranges[ranges->nb].length = length; + ranges->nb++; + if (ranges->nb > ranges->maxNb) + ranges->maxNb = ranges->nb; + return; +} + +static IntSetRanges _get_empty_ranges(IntSetRanges* inRanges, int start, int length) +{ + IntSetRanges outRanges = {0}; + int i; + int end = start+length; + int last_end = 0x80000000; + for(i=0;i<=inRanges->nb;i++) + { + int cur_start, cur_end; + if (i == inRanges->nb) + { + cur_start = cur_end = 0x7FFFFFFF; + } + else + { + IntRange* range = &inRanges->ranges[i]; + cur_start = range->start; + cur_end = range->start + range->length; + } + + /* [last_end,cur_start[ inter [start,end[ */ + if ((last_end >= start && last_end < end) || (start >= last_end && start < cur_start)) + { + outRanges.ranges = realloc(outRanges.ranges, sizeof(IntRange) * (outRanges.nb+1)); + outRanges.ranges[outRanges.nb].start = MAX(start,last_end); + outRanges.ranges[outRanges.nb].length = MIN(end,cur_start) - outRanges.ranges[outRanges.nb].start; + outRanges.nb++; + } + + last_end = cur_end; + } + return outRanges; +} + +GLAPI void APIENTRY EXT_FUNC(glUpdateObjectBufferATI) (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve) +{ + CHECK_PROC(glUpdateObjectBufferATI); + //log_gl("glUpdateObjectBufferATI(%d, %d, %d)\n", buffer, offset, size); + long args[] = { INT_TO_ARG(buffer), INT_TO_ARG(offset), INT_TO_ARG(size), POINTER_TO_ARG(pointer), INT_TO_ARG(preserve) }; + int args_size[] = { 0, 0, 0, size, 0 }; + do_opengl_call(glUpdateObjectBufferATI_func, NULL, CHECK_ARGS(args, args_size)); + ObjectBufferATI* objectBufferATI = _find_object_buffer_ATI_from_id(buffer); + if (objectBufferATI) + { + if (offset >= 0 && offset + size <= objectBufferATI->size) + { + if (objectBufferATI->ptrMapped) + { + log_gl("you shouldn't call glUpdateObjectBufferATI after glMapObjectBufferATI. we're emulating ATI fglrx (strange) behaviour\n"); + objectBufferATI->updatedRangesAfterMapping.nb = 0; + _add_int_range_to_ranges(&objectBufferATI->updatedRangesAfterMapping, offset, size); + objectBufferATI->ptrUpdatedWhileMapped = realloc(objectBufferATI->ptrUpdatedWhileMapped, size); + memcpy(objectBufferATI->ptrUpdatedWhileMapped, pointer, size); + } + else + { + memcpy(objectBufferATI->ptr + offset, pointer, size); + } + } + else + { + log_gl("offset >= 0 && offset + size <= state->objectBuffersATI[i].size failed\n"); + } + } +} + +GLAPI GLvoid* APIENTRY EXT_FUNC(glMapObjectBufferATI) (GLuint buffer) +{ + CHECK_PROC_WITH_RET(glMapObjectBufferATI); + //log_gl("glMapObjectBufferATI(%d)\n", buffer); + ObjectBufferATI* objectBufferATI = _find_object_buffer_ATI_from_id(buffer); + if (objectBufferATI) + { + if (objectBufferATI->ptrMapped == NULL) + { + objectBufferATI->ptrMapped = malloc(objectBufferATI->size); + memcpy(objectBufferATI->ptrMapped, + objectBufferATI->ptr, + objectBufferATI->size); + return objectBufferATI->ptrMapped; + } + else + return NULL; + } + else + return NULL; +} + +GLAPI void APIENTRY EXT_FUNC(glUnmapObjectBufferATI) (GLuint buffer) +{ + CHECK_PROC(glUnmapObjectBufferATI); + //log_gl("glUnmapObjectBufferATI(%d)\n", buffer); + ObjectBufferATI* objectBufferATI = _find_object_buffer_ATI_from_id(buffer); + if (objectBufferATI) + { + if (objectBufferATI->ptrMapped) + { + IntSetRanges outRanges = _get_empty_ranges(&objectBufferATI->updatedRangesAfterMapping, 0, objectBufferATI->size); + int i; + void* ptrMapped = objectBufferATI->ptrMapped; + if (objectBufferATI->ptrUpdatedWhileMapped) + { + assert(objectBufferATI->updatedRangesAfterMapping.nb == 1); + memcpy(objectBufferATI->ptr + objectBufferATI->updatedRangesAfterMapping.ranges[0].start, + objectBufferATI->ptrUpdatedWhileMapped, + objectBufferATI->updatedRangesAfterMapping.ranges[0].length); + free(objectBufferATI->ptrUpdatedWhileMapped); + objectBufferATI->ptrUpdatedWhileMapped = NULL; + } + objectBufferATI->updatedRangesAfterMapping.nb = 0; + objectBufferATI->ptrMapped = NULL; + for(i=0;i<outRanges.nb;i++) + { + glUpdateObjectBufferATI(buffer, outRanges.ranges[i].start, outRanges.ranges[i].length, + ptrMapped, GL_DISCARD_ATI); + } + free(outRanges.ranges); + free(ptrMapped); + } + } +} + +GLAPI void APIENTRY EXT_FUNC(glGetActiveAttribARB)(GLhandleARB program, + GLuint index, + GLsizei maxLength, + GLsizei *length, + GLint *size, + GLenum *type, + GLcharARB *name) +{ + CHECK_PROC(glGetActiveAttribARB); + int fake_length; + if (length == NULL) length = &fake_length; + long args[] = { INT_TO_ARG(program), INT_TO_ARG(index), INT_TO_ARG(maxLength), POINTER_TO_ARG(length), POINTER_TO_ARG(size), POINTER_TO_ARG(type), POINTER_TO_ARG(name) }; + int args_size[] = { 0, 0, 0, sizeof(int), sizeof(int), sizeof(int), maxLength }; + do_opengl_call(glGetActiveAttribARB_func, NULL, CHECK_ARGS(args, args_size)); +} + +GLAPI void APIENTRY EXT_FUNC(glGetActiveAttrib)(GLhandleARB program, + GLuint index, + GLsizei maxLength, + GLsizei *length, + GLint *size, + GLenum *type, + GLcharARB *name) +{ + CHECK_PROC(glGetActiveAttrib); + int fake_length; + if (length == NULL) length = &fake_length; + long args[] = { INT_TO_ARG(program), INT_TO_ARG(index), INT_TO_ARG(maxLength), POINTER_TO_ARG(length), POINTER_TO_ARG(size), POINTER_TO_ARG(type), POINTER_TO_ARG(name) }; + int args_size[] = { 0, 0, 0, sizeof(int), sizeof(int), sizeof(int), maxLength }; + do_opengl_call(glGetActiveAttrib_func, NULL, CHECK_ARGS(args, args_size)); +} + +GLAPI GLint APIENTRY EXT_FUNC(glGetAttribLocationARB)(GLhandleARB program, + const GLcharARB *name) +{ + CHECK_PROC_WITH_RET(glGetAttribLocationARB); + int ret = 0; + long args[] = { INT_TO_ARG(program), POINTER_TO_ARG(name) }; + do_opengl_call(glGetAttribLocationARB_func, &ret, args, NULL); + return ret; +} + +GLAPI GLint APIENTRY EXT_FUNC(glGetAttribLocation)(GLhandleARB program, + const GLcharARB *name) +{ + CHECK_PROC_WITH_RET(glGetAttribLocation); + int ret = 0; + long args[] = { INT_TO_ARG(program), POINTER_TO_ARG(name) }; + do_opengl_call(glGetAttribLocation_func, &ret, args, NULL); + return ret; +} + +GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum target, GLfloat *points) +{ + int npoints = 0; + CHECK_PROC(glGetDetailTexFuncSGIS); + glFuncTable.fpGetTexParameteriv(target, GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS, &npoints); + long args[] = { INT_TO_ARG(target), POINTER_TO_ARG(points) }; + int args_size[] = { 0, 2 * npoints * sizeof(float) }; + do_opengl_call(glGetDetailTexFuncSGIS_func, NULL, CHECK_ARGS(args, args_size)); +} + +GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum target, GLfloat *points) +{ + int npoints = 0; + CHECK_PROC(glGetSharpenTexFuncSGIS); + glFuncTable.fpGetTexParameteriv(target, GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS, &npoints); + long args[] = { INT_TO_ARG(target), POINTER_TO_ARG(points) }; + int args_size[] = { 0, 2 * npoints * sizeof(float) }; + do_opengl_call(glGetSharpenTexFuncSGIS_func, NULL, CHECK_ARGS(args, args_size)); +} + +GLAPI void APIENTRY glColorTable (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table) +{ + NOT_IMPLEMENTED(glColorTable); +} + +GLAPI void APIENTRY glColorTableEXT (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table) +{ + NOT_IMPLEMENTED(glColorTableEXT); +} + + +GLAPI void APIENTRY glColorSubTable (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data) +{ + NOT_IMPLEMENTED(glColorSubTable); +} + +GLAPI void APIENTRY glColorSubTableEXT (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data) +{ + NOT_IMPLEMENTED(glColorSubTableEXT); +} + + +GLAPI void APIENTRY glGetColorTable (GLenum target, GLenum format, GLenum type, GLvoid *table) +{ + NOT_IMPLEMENTED(glGetColorTable); +} + +GLAPI void APIENTRY glGetColorTableEXT (GLenum target, GLenum format, GLenum type, GLvoid *table) +{ + NOT_IMPLEMENTED(glGetColorTableEXT); +} + + +GLAPI void APIENTRY glConvolutionFilter1D (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image) +{ + NOT_IMPLEMENTED(glConvolutionFilter1D); +} + +GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image) +{ + NOT_IMPLEMENTED(glConvolutionFilter1DEXT); +} + +GLAPI void APIENTRY glConvolutionFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image) +{ + NOT_IMPLEMENTED(glConvolutionFilter2D); +} + +GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image) +{ + NOT_IMPLEMENTED(glConvolutionFilter2DEXT); +} + + +GLAPI void APIENTRY glGetConvolutionFilter (GLenum target, GLenum format, GLenum type, GLvoid *image) +{ + NOT_IMPLEMENTED(glGetConvolutionFilter); +} + +GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum target, GLenum format, GLenum type, GLvoid *image) +{ + NOT_IMPLEMENTED(glGetConvolutionFilterEXT); +} + +GLAPI void APIENTRY glGetSeparableFilter (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span) +{ + NOT_IMPLEMENTED(glGetSeparableFilter); +} + +GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span) +{ + NOT_IMPLEMENTED(glGetSeparableFilterEXT); +} + +GLAPI void APIENTRY glSeparableFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column) +{ + NOT_IMPLEMENTED(glSeparableFilter2D); +} + +GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column) +{ + NOT_IMPLEMENTED(glSeparableFilter2DEXT); +} + + +GLAPI void APIENTRY glGetHistogram (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values) +{ + NOT_IMPLEMENTED(glGetHistogram); +} + +GLAPI void APIENTRY glGetHistogramEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values) +{ + NOT_IMPLEMENTED(glGetHistogramEXT); +} + + +GLAPI void APIENTRY glGetMinmax (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values) +{ + NOT_IMPLEMENTED(glGetMinmax); +} + +GLAPI void APIENTRY glGetMinmaxEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values) +{ + NOT_IMPLEMENTED(glGetMinmaxEXT); +} + +GLAPI void* APIENTRY glXAllocateMemoryNV(GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority) +{ + return malloc(size); +} + +GLAPI void APIENTRY glXFreeMemoryNV(GLvoid *pointer) +{ + free(pointer); +} + +GLAPI void APIENTRY glPixelDataRangeNV (GLenum target, GLsizei length, GLvoid *pointer) +{ + CHECK_PROC(glPixelDataRangeNV); + /* do nothing is a possible implementation... */ +} + +GLAPI void APIENTRY glFlushPixelDataRangeNV (GLenum target) +{ + CHECK_PROC(glFlushPixelDataRangeNV); + /* do nothing is a possible implementation... */ +} + +GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei size, const GLvoid *ptr) +{ + CHECK_PROC(glVertexArrayRangeNV); + /* do nothing is a possible implementation... */ +} + +GLAPI void APIENTRY glFlushVertexArrayRangeNV (void) +{ + CHECK_PROC(glFlushVertexArrayRangeNV); + /* do nothing is a possible implementation... */ +} + +// added to support extension api +GLAPI void APIENTRY EXT_FUNC(glGetRenderbufferParameteriv) (GLenum arg_0, GLenum arg_1, GLint * arg_2) +{ + CHECK_PROC(glGetRenderbufferParameterivEXT); + long args[] = { UNSIGNED_INT_TO_ARG(arg_0), UNSIGNED_INT_TO_ARG(arg_1), POINTER_TO_ARG(arg_2)}; + do_opengl_call(glGetRenderbufferParameterivEXT_func, NULL, args, NULL); +} + +GLAPI void APIENTRY EXT_FUNC(glGenRenderbuffers) (GLsizei arg_0, GLuint * arg_1) +{ + CHECK_PROC(glGenRenderbuffersEXT); + long args[] = { INT_TO_ARG(arg_0), POINTER_TO_ARG(arg_1)}; + do_opengl_call(glGenRenderbuffersEXT_func, NULL, args, NULL); +} + +GLAPI GLenum APIENTRY EXT_FUNC(glCheckFramebufferStatus) (GLenum arg_0) +{ + GLenum ret; + CHECK_PROC_WITH_RET(glCheckFramebufferStatusEXT); + long args[] = { UNSIGNED_INT_TO_ARG(arg_0)}; + do_opengl_call(glCheckFramebufferStatusEXT_func, &ret, args, NULL); + return ret; +} + +GLAPI void APIENTRY EXT_FUNC(glGenFramebuffers) (GLsizei arg_0, GLuint * arg_1) +{ + CHECK_PROC(glGenFramebuffersEXT); + long args[] = { INT_TO_ARG(arg_0), POINTER_TO_ARG(arg_1)}; + do_opengl_call(glGenFramebuffersEXT_func, NULL, args, NULL); +} + +GLAPI void APIENTRY EXT_FUNC(glRenderbufferStorage) (GLenum arg_0, GLenum arg_1, GLsizei arg_2, GLsizei arg_3) +{ + CHECK_PROC(glRenderbufferStorageEXT); + long args[] = { UNSIGNED_INT_TO_ARG(arg_0), UNSIGNED_INT_TO_ARG(arg_1), INT_TO_ARG(arg_2), INT_TO_ARG(arg_3)}; + do_opengl_call(glRenderbufferStorageEXT_func, NULL, args, NULL); +} + +GLAPI GLboolean APIENTRY EXT_FUNC(glIsRenderbuffer) (GLuint arg_0) +{ + GLboolean ret; + CHECK_PROC_WITH_RET(glIsRenderbufferEXT); + long args[] = { UNSIGNED_INT_TO_ARG(arg_0)}; + do_opengl_call(glIsRenderbufferEXT_func, &ret, args, NULL); + return ret; +} + +GLAPI void APIENTRY EXT_FUNC(glGenerateMipmap) (GLenum arg_0) +{ + CHECK_PROC(glGenerateMipmapEXT); + long args[] = { UNSIGNED_INT_TO_ARG(arg_0)}; + do_opengl_call(glGenerateMipmapEXT_func, NULL, args, NULL); +} + +GLAPI GLboolean APIENTRY EXT_FUNC(glIsFramebuffer) (GLuint arg_0) +{ + GLboolean ret; + CHECK_PROC_WITH_RET(glIsFramebufferEXT); + long args[] = { UNSIGNED_INT_TO_ARG(arg_0)}; + do_opengl_call(glIsFramebufferEXT_func, &ret, args, NULL); + return ret; +} + +GLAPI void APIENTRY EXT_FUNC(glGetFramebufferAttachmentParameteriv) (GLenum arg_0, GLenum arg_1, GLenum arg_2, GLint * arg_3) +{ + CHECK_PROC(glGetFramebufferAttachmentParameterivEXT); + long args[] = { UNSIGNED_INT_TO_ARG(arg_0), UNSIGNED_INT_TO_ARG(arg_1), UNSIGNED_INT_TO_ARG(arg_2), POINTER_TO_ARG(arg_3)}; + do_opengl_call(glGetFramebufferAttachmentParameterivEXT_func, NULL, args, NULL); +} + +GLAPI void APIENTRY EXT_FUNC(glDeleteFramebuffers) (GLsizei arg_0, const GLuint * arg_1) +{ + CHECK_PROC(glDeleteFramebuffersEXT); + long args[] = { INT_TO_ARG(arg_0), POINTER_TO_ARG(arg_1)}; + do_opengl_call(glDeleteFramebuffersEXT_func, NULL, args, NULL); +} + +GLAPI void APIENTRY EXT_FUNC(glFramebufferRenderbuffer) (GLenum arg_0, GLenum arg_1, GLenum arg_2, GLuint arg_3) +{ + CHECK_PROC(glFramebufferRenderbufferEXT); + long args[] = { UNSIGNED_INT_TO_ARG(arg_0), UNSIGNED_INT_TO_ARG(arg_1), UNSIGNED_INT_TO_ARG(arg_2), UNSIGNED_INT_TO_ARG(arg_3)}; + do_opengl_call(glFramebufferRenderbufferEXT_func, NULL, args, NULL); +} + +GLAPI void APIENTRY EXT_FUNC(glDeleteRenderbuffers) (GLsizei arg_0, const GLuint * arg_1) +{ + CHECK_PROC(glDeleteRenderbuffersEXT); + long args[] = { INT_TO_ARG(arg_0), POINTER_TO_ARG(arg_1)}; + do_opengl_call(glDeleteRenderbuffersEXT_func, NULL, args, NULL); +} + +GLAPI void APIENTRY EXT_FUNC(glBindRenderbuffer) (GLenum arg_0, GLuint arg_1) +{ + CHECK_PROC(glBindRenderbufferEXT); + long args[] = { UNSIGNED_INT_TO_ARG(arg_0), UNSIGNED_INT_TO_ARG(arg_1)}; + do_opengl_call(glBindRenderbufferEXT_func, NULL, args, NULL); +} + +GLAPI void APIENTRY EXT_FUNC(glBindFramebuffer) (GLenum arg_0, GLuint arg_1) +{ + CHECK_PROC(glBindFramebufferEXT); + long args[] = { UNSIGNED_INT_TO_ARG(arg_0), UNSIGNED_INT_TO_ARG(arg_1)}; + do_opengl_call(glBindFramebufferEXT_func, NULL, args, NULL); +} diff --git a/libGL/client_gl.h b/libGL/client_gl.h new file mode 100755 index 0000000..35d6e07 --- /dev/null +++ b/libGL/client_gl.h @@ -0,0 +1,29 @@ +/* + * 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. + */ +extern void glGetIntegerv_no_lock( GLenum pname, GLint *params ); +extern void glPixelStorei_no_lock( GLenum pname, GLint param ); +extern void glBindBufferARB_no_lock (GLenum target, GLuint buffer); +extern void glReadPixels_no_lock ( GLint x, GLint y, + GLsizei width, GLsizei height, + GLenum format, GLenum type, + GLvoid *pixels ); + diff --git a/libGL/client_glx.c b/libGL/client_glx.c new file mode 100755 index 0000000..cf7210a --- /dev/null +++ b/libGL/client_glx.c @@ -0,0 +1,3446 @@ +/* + * Guest-side implementation of GL/GLX API. Replacement of standard libGL.so + * + * 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. + */ + +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#include <assert.h> +#include <dlfcn.h> +#include <sys/time.h> + +#include <X11/Xlib-xcb.h> +#include <xcb/xcb.h> + +#include "opengl_func.h" +#include "common.h" +#include "lock.h" +#include "call.h" +#include "log.h" + +GLState* new_gl_state() +{ + int i, j; + GLState* state; + + state = malloc(sizeof(GLState)); + memset(state, 0, sizeof(GLState)); + state->activeTexture = GL_TEXTURE0_ARB; + state->client_state.pack.alignment = 4; + state->client_state.unpack.alignment = 4; + state->current_server_state.matrixMode = GL_MODELVIEW; + state->current_server_state.depthFunc = GL_LESS; + state->current_server_state.fog.mode = GL_EXP; + state->current_server_state.fog.density = 1; + state->current_server_state.fog.start = 0; + state->current_server_state.fog.end = 1; + state->current_server_state.fog.index = 0; + state->textureAllocator = &state->ownTextureAllocator; + state->bufferAllocator = &state->ownBufferAllocator; + state->listAllocator = &state->ownListAllocator; + state->currentRasterPosKnown = 1; + state->currentRasterPos[0] = 0; + state->currentRasterPos[1] = 0; + state->currentRasterPos[2] = 0; + state->currentRasterPos[3] = 1; + for(i=0;i<NB_GL_MATRIX;i++) + { + state->matrix[i].sp = 0; + for(j=0;j<16;j++) + { + state->matrix[i].current.val[j] = (j == 0 || j == 5 || j == 10 || j == 15); + } + } + return state; +} + + +typedef struct +{ + int attrib; + int value; + int ret; +} _glXGetConfigAttribs; + +typedef struct +{ + int val; + char* name; +} glXAttrib; + +#define VAL_AND_NAME(x) { x, #x } + +static const glXAttrib tabRequestedAttribsPair[] = +{ + VAL_AND_NAME(GLX_USE_GL), + VAL_AND_NAME(GLX_BUFFER_SIZE), + VAL_AND_NAME(GLX_LEVEL), + VAL_AND_NAME(GLX_RGBA), + VAL_AND_NAME(GLX_DOUBLEBUFFER), + VAL_AND_NAME(GLX_STEREO), + VAL_AND_NAME(GLX_AUX_BUFFERS), + VAL_AND_NAME(GLX_RED_SIZE), + VAL_AND_NAME(GLX_GREEN_SIZE), + VAL_AND_NAME(GLX_BLUE_SIZE), + VAL_AND_NAME(GLX_ALPHA_SIZE), + VAL_AND_NAME(GLX_DEPTH_SIZE), + VAL_AND_NAME(GLX_STENCIL_SIZE), + VAL_AND_NAME(GLX_ACCUM_RED_SIZE), + VAL_AND_NAME(GLX_ACCUM_GREEN_SIZE), + VAL_AND_NAME(GLX_ACCUM_BLUE_SIZE), + VAL_AND_NAME(GLX_ACCUM_ALPHA_SIZE), + VAL_AND_NAME(GLX_CONFIG_CAVEAT), + VAL_AND_NAME(GLX_X_VISUAL_TYPE), + VAL_AND_NAME(GLX_TRANSPARENT_TYPE), + VAL_AND_NAME(GLX_TRANSPARENT_INDEX_VALUE), + VAL_AND_NAME(GLX_TRANSPARENT_RED_VALUE), + VAL_AND_NAME(GLX_TRANSPARENT_GREEN_VALUE), + VAL_AND_NAME(GLX_TRANSPARENT_BLUE_VALUE), + VAL_AND_NAME(GLX_TRANSPARENT_ALPHA_VALUE), + VAL_AND_NAME(GLX_SLOW_CONFIG), + VAL_AND_NAME(GLX_TRUE_COLOR), + VAL_AND_NAME(GLX_DIRECT_COLOR), + VAL_AND_NAME(GLX_PSEUDO_COLOR), + VAL_AND_NAME(GLX_STATIC_COLOR), + VAL_AND_NAME(GLX_GRAY_SCALE), + VAL_AND_NAME(GLX_STATIC_GRAY), + VAL_AND_NAME(GLX_TRANSPARENT_RGB), + VAL_AND_NAME(GLX_TRANSPARENT_INDEX), + VAL_AND_NAME(GLX_VISUAL_ID), + VAL_AND_NAME(GLX_DRAWABLE_TYPE), + VAL_AND_NAME(GLX_RENDER_TYPE), + VAL_AND_NAME(GLX_X_RENDERABLE), + VAL_AND_NAME(GLX_FBCONFIG_ID), + VAL_AND_NAME(GLX_RGBA_TYPE), + VAL_AND_NAME(GLX_COLOR_INDEX_TYPE), + VAL_AND_NAME(GLX_MAX_PBUFFER_WIDTH), + VAL_AND_NAME(GLX_MAX_PBUFFER_HEIGHT), + VAL_AND_NAME(GLX_MAX_PBUFFER_PIXELS), + VAL_AND_NAME(GLX_PRESERVED_CONTENTS), + VAL_AND_NAME(GLX_FLOAT_COMPONENTS_NV), + VAL_AND_NAME(GLX_SAMPLE_BUFFERS), + VAL_AND_NAME(GLX_SAMPLES) +}; +#define N_REQUESTED_ATTRIBS (sizeof(tabRequestedAttribsPair)/sizeof(tabRequestedAttribsPair[0])) + +static int* getTabRequestedAttribsInt() +{ + static int tabRequestedAttribsInt[N_REQUESTED_ATTRIBS] = { 0 }; + if (tabRequestedAttribsInt[0] == 0) + { + int i; + for(i=0;i<N_REQUESTED_ATTRIBS;i++) + tabRequestedAttribsInt[i] = tabRequestedAttribsPair[i].val; + } + return tabRequestedAttribsInt; +} + +#define N_MAX_ATTRIBS N_REQUESTED_ATTRIBS+10 +typedef struct +{ + int visualid; + _glXGetConfigAttribs attribs[N_MAX_ATTRIBS]; + int nbAttribs; +} _glXConfigs; +#define N_MAX_CONFIGS 80 +static _glXConfigs configs[N_MAX_CONFIGS]; +static int nbConfigs = 0; + +typedef struct +{ + GLXFBConfig config; + _glXGetConfigAttribs attribs[N_MAX_ATTRIBS]; + int nbAttribs; +} _glXFBConfig; + +static _glXFBConfig fbconfigs[N_MAX_CONFIGS]; +static int nbFBConfigs = 0; + +const char *glXQueryExtensionsString( Display *dpy, int screen ) +{ + LOCK(glXQueryExtensionsString_func); + static char* ret = NULL; + if (ret == NULL) + { + long args[] = { POINTER_TO_ARG(dpy), INT_TO_ARG(screen) }; + do_opengl_call_no_lock(glXQueryExtensionsString_func, &ret, args, NULL); + ret = strdup(ret); + } + UNLOCK(glXQueryExtensionsString_func); + return ret; +} + + +typedef struct +{ + XVisualInfo* vis; + int visualid; + GLXFBConfig fbconfig; +} AssocVisualInfoVisualId; + +#define MAX_SIZE_TAB_ASSOC_VISUALINFO_VISUALID 100 +AssocVisualInfoVisualId tabAssocVisualInfoVisualId[MAX_SIZE_TAB_ASSOC_VISUALINFO_VISUALID]; +int nEltTabAssocVisualInfoVisualId = 0; + +static const char* _getAttribNameFromValue(int val) +{ + int i; + static char buffer[80]; + for(i=0;i<N_REQUESTED_ATTRIBS;i++) + { + if (tabRequestedAttribsPair[i].val == val) + return tabRequestedAttribsPair[i].name; + } + sprintf(buffer, "(unknown name = %d, 0x%X)", val, val); + return buffer; +} + +static int _compute_length_of_attrib_list_including_zero(const int* attribList, int booleanMustHaveValue) +{ + int i = 0; + debug_gl = getenv("DEBUG_GL") != NULL; + //##fredrick.kim + //debug_gl = 1; + + if (debug_gl) log_gl("attribList = \n"); + while(attribList[i]) + { + if (booleanMustHaveValue || + !(attribList[i] == GLX_USE_GL || + attribList[i] == GLX_RGBA || + attribList[i] == GLX_DOUBLEBUFFER || + attribList[i] == GLX_STEREO)) + { + if (debug_gl) log_gl("%s = %d\n", _getAttribNameFromValue(attribList[i]), attribList[i+1]); + i+=2; + } + else + { + if (debug_gl) log_gl("%s\n", _getAttribNameFromValue(attribList[i])); + i++; + } + } + if (debug_gl) log_gl("\n"); + return i + 1; +} + + +XVisualInfo* glXChooseVisual( Display *dpy, int screen, + int *attribList ) +{ + XVisualInfo temp, *vis; + long mask; + int n; + int i; + + int visualid = 0; + long args[] = { POINTER_TO_ARG(dpy), INT_TO_ARG(screen), POINTER_TO_ARG(attribList) }; + int args_size[] = { 0, 0, sizeof(int) * _compute_length_of_attrib_list_including_zero(attribList, 0) }; + do_opengl_call(glXChooseVisual_func, &visualid, CHECK_ARGS(args, args_size)); + + if (visualid) + { + mask = VisualScreenMask | VisualDepthMask | VisualClassMask | VisualIDMask; + temp.screen = screen; + temp.depth = DefaultDepth(dpy,screen); + temp.class = DefaultVisual(dpy,screen)->class; + temp.visualid = DefaultVisual(dpy,screen)->visualid; + + vis = XGetVisualInfo( dpy, mask, &temp, &n ); + if (vis == NULL) + log_gl("cannot get visual from client side\n"); + + assert (nEltTabAssocVisualInfoVisualId < MAX_SIZE_TAB_ASSOC_VISUALINFO_VISUALID); + for(i=0;i<nEltTabAssocVisualInfoVisualId;i++) + { + if (tabAssocVisualInfoVisualId[i].vis == vis) break; + } + if (i == nEltTabAssocVisualInfoVisualId) + nEltTabAssocVisualInfoVisualId++; + tabAssocVisualInfoVisualId[i].vis = vis; + tabAssocVisualInfoVisualId[i].fbconfig = 0; + tabAssocVisualInfoVisualId[i].visualid = visualid; + } + else + { + vis = NULL; + } + + if (debug_gl) log_gl("glXChooseVisual returning vis %p (visualid=%d, 0x%X)\n", vis, visualid, visualid); + + return vis; +} + +const char *glXQueryServerString( Display *dpy, int screen, int name ) +{ + LOCK(glXQueryServerString_func); + static char* glXQueryServerString_ret[100] = {NULL}; + assert(name >= 0 && name < 100); + if (glXQueryServerString_ret[name] == NULL) + { + long args[] = { POINTER_TO_ARG(dpy), INT_TO_ARG(screen), INT_TO_ARG(name) }; + do_opengl_call_no_lock(glXQueryServerString_func, &glXQueryServerString_ret[name], args, NULL); + glXQueryServerString_ret[name] = strdup(glXQueryServerString_ret[name]); + } + UNLOCK(glXQueryServerString_func); + return glXQueryServerString_ret[name]; +} + +const char *glXGetClientString( Display *dpy, int name ) +{ + LOCK(glXGetClientString_func); + static char* glXGetClientString_ret[100] = {NULL}; + assert(name >= 0 && name < 100); + if (glXGetClientString_ret[name] == NULL) + { + long args[] = { POINTER_TO_ARG(dpy), INT_TO_ARG(name) }; + do_opengl_call_no_lock(glXGetClientString_func, &glXGetClientString_ret[name], args, NULL); + if (getenv("GLX_VENDOR") && name == GLX_VENDOR) + { + glXGetClientString_ret[name] = getenv("GLX_VENDOR"); + } + else + glXGetClientString_ret[name] = strdup(glXGetClientString_ret[name]); + } + UNLOCK(glXGetClientString_func); + return glXGetClientString_ret[name]; +} + +static void _create_context(GLXContext context, GLXContext shareList) +{ + int i; + glstates = realloc(glstates, (nbGLStates+1) * sizeof(GLState*)); + glstates[nbGLStates] = new_gl_state(); + glstates[nbGLStates]->ref = 1; + glstates[nbGLStates]->context = context; + glstates[nbGLStates]->shareList = shareList; + glstates[nbGLStates]->viewport.width = 0; + glstates[nbGLStates]->arrayBuffers = glstates[nbGLStates]->ownArrayBuffers; + if (shareList) + { + for(i=0; i<nbGLStates; i++) + { + if (glstates[i]->context == shareList) + { + glstates[i]->ref++; + glstates[nbGLStates]->textureAllocator = glstates[i]->textureAllocator; + glstates[nbGLStates]->bufferAllocator = glstates[i]->bufferAllocator; + glstates[nbGLStates]->listAllocator = glstates[i]->listAllocator; + /* arrayBuffers need to be shared between shareLists */ + glstates[nbGLStates]->arrayBuffers = glstates[i]->arrayBuffers; + break; + } + } + if (i == nbGLStates) + { + log_gl("unknown shareList %p\n", (void*)shareList); + } + } + nbGLStates++; +} + +static GLXFBConfig* glXChooseFBConfig_no_lock( Display *dpy, int screen, + const int *attribList, int *nitems ); +static XVisualInfo* glXGetVisualFromFBConfig_no_lock( Display *dpy, GLXFBConfig config ); + +GLXContext glXCreateContext( Display *dpy, XVisualInfo *vis, + GLXContext shareList, Bool direct ) +{ + LOCK(glXCreateContext_func); + int isFbConfigVisual = 0; + int i; + int visualid = 0; + + for(i=0;i<nEltTabAssocVisualInfoVisualId;i++) + { + if (tabAssocVisualInfoVisualId[i].vis == vis) + { + if (tabAssocVisualInfoVisualId[i].fbconfig != NULL) + { + log_gl("isFbConfigVisual = 1\n"); + isFbConfigVisual = 1; + } + visualid = tabAssocVisualInfoVisualId[i].visualid; + if (debug_gl) log_gl("found visualid %d corresponding to vis %p\n", visualid, vis); + break; + } + } + + GLXContext ctxt = NULL; + if (i == nEltTabAssocVisualInfoVisualId) + { + visualid = vis->visualid; + if (debug_gl) log_gl("not found vis %p in table, visualid=%d\n", vis, visualid); + } + long args[] = { POINTER_TO_ARG(dpy), INT_TO_ARG(visualid), INT_TO_ARG(shareList), INT_TO_ARG(direct) }; + do_opengl_call_no_lock(glXCreateContext_func, &ctxt, args, NULL); + + if (ctxt) + { + _create_context(ctxt, shareList); + glstates[nbGLStates-1]->isAssociatedToFBConfigVisual = isFbConfigVisual; + } + + UNLOCK(glXCreateContext_func); + return ctxt; +} + +GLXContext glXGetCurrentContext (void) +{ + GET_CURRENT_STATE(); + if (debug_gl) log_gl("glXGetCurrentContext() -> %p\n", state ? state->context : NULL); + return state ? state->context : NULL; +} + +GLXDrawable glXGetCurrentDrawable (void) +{ + GET_CURRENT_STATE(); + if (debug_gl) log_gl("glXGetCurrentDrawable() -> %p\n", state ? (void*)state->current_drawable: None); + return state ? state->current_drawable: None; +} + +static void _free_context(Display* dpy, int i, GLState* state) +{ + free(state->last_cursor.pixels); + free(state->ownTextureAllocator.values); + free(state->ownBufferAllocator.values); + free(state->ownListAllocator.values); + free(state); + //memmove(&state, &glstates[i+1], (nbGLStates-i-1) * sizeof(GLState*)); + memmove(&glstates[i], &glstates[i+1], (nbGLStates-i-1) * sizeof(GLState*)); + nbGLStates--; +} + +GLAPI void APIENTRY glXDestroyContext( Display *dpy, GLXContext ctx ) +{ + int i; + LOCK(glXDestroyContext_func); + GET_CURRENT_STATE(); + for(i=0;i<nbGLStates;i++) + { + if (glstates[i]->context == ctx) + { + long args[] = { POINTER_TO_ARG(dpy), POINTER_TO_ARG(ctx) }; + do_opengl_call_no_lock(glXDestroyContext_func, NULL, args, NULL); + if (ctx == state->context) + { + SET_CURRENT_STATE(NULL); + } + + GLXContext shareList = glstates[i]->shareList; + + glstates[i]->ref --; + if (glstates[i]->ref == 0) + { + _free_context(dpy, i, glstates[i]); + } + + if (shareList) + { + for(i=0; i<nbGLStates; i++) + { + if (glstates[i]->context == shareList) + { + glstates[i]->ref--; + if (glstates[i]->ref == 0) + { + _free_context(dpy, i, glstates[i]); + } + break; + } + } + } + break; + } + } + UNLOCK(glXDestroyContext_func); +} + +Bool glXQueryVersion( Display *dpy, int *maj, int *min ) +{ + LOCK(glXQueryVersion_func); + static Bool ret = -1; + static int l_maj, l_min; + if (ret == -1) + { + long args[] = { POINTER_TO_ARG(dpy), POINTER_TO_ARG(&l_maj), POINTER_TO_ARG(&l_min) }; + do_opengl_call_no_lock(glXQueryVersion_func, &ret, args, NULL); + } + if (maj) *maj = l_maj; + if (min) *min = l_min; + UNLOCK(glXQueryVersion_func); + return ret; +} + +/* Getting window information by using XCB API. It looks more complicated + * than the way using xlib API. The reason not to use xlib is to avoid the + * potential conflicts between xcb and xlib. + * + * XCB could be called asynchronously. Take the example of getting window + * attributes. If there is xlib call of "XGetWindowAttributes()" between + * xcb_shape_get_rectangles() and xcb_shape_get_rectangles_reply(), xcb call + * will not be able to get the result. + * + * That is the case we countered for mcompositor in MeeGo handset image while + * running with GL accelerations. Using xcb API here could avoid such conflict. + */ +static void _get_window_info(Display *dpy, Window win, WindowInfoStruct* info) +{ + xcb_generic_error_t *error; + xcb_connection_t *xcb_conn = XGetXCBConnection(dpy); + xcb_get_window_attributes_reply_t *attr = xcb_get_window_attributes_reply( + xcb_conn, + xcb_get_window_attributes(xcb_conn, win), &error); + +#ifndef XCB_EVENT_ERROR_BAD_MATCH +#define XCB_EVENT_ERROR_BAD_MATCH 8 +#define XCB_EVENT_ERROR_BAD_WINDOW 3 +#endif + /* BAD_MATCH indicate the drawable is PIXMAP instead of window */ + if ( !attr && + error->error_code != XCB_EVENT_ERROR_BAD_MATCH && + error->error_code != XCB_EVENT_ERROR_BAD_WINDOW ) + { + info->width = 0; + info->height= 0; + info->depth = 0; + info->map_state = IsUnviewable; + return; + } + + if (attr) { + if (attr->map_state == XCB_MAP_STATE_VIEWABLE) { + info->map_state = IsViewable; + } else if (attr->map_state == XCB_MAP_STATE_UNVIEWABLE){ + info->map_state = IsUnviewable; + } else { + info->map_state = IsUnmapped; + } + free (attr); + } else /* Keep rendering PIXMAP as it can be copied to any window */ + info->map_state = IsViewable; + + xcb_get_geometry_reply_t *geom = xcb_get_geometry_reply( + xcb_conn, + xcb_get_geometry(xcb_conn, win), 0); + + if (geom) { + info->width = geom->width; + info->height = geom->height; + info->depth = geom->depth; + free (geom); + } else { + info->width = 0; + info->height= 0; + info->depth = 0; + } +} + +#if 0 +/* Alternative implementation of getting window attributes. Using xlib API + */ +static void _get_window_info(Display *dpy, Window win, WindowInfoStruct* info) +{ + XWindowAttributes attr; + + XGetWindowAttributes(dpy, win, &attr); + + info->width = attr.width; + info->height = attr.height; + info->map_state = attr.map_state; +} +#endif + +RendererData *renderer_create_image(Display *dpy, Window win, int w, int h, int depth) +{ + RendererData *rdata = calloc(1, sizeof(*rdata)); + + if(!rdata) + goto out; + + rdata->w = w; + rdata->h = h; + rdata->gc = XCreateGC(dpy, win, 0, NULL); + + rdata->image = XShmCreateImage(dpy, DefaultVisual(dpy, 0), depth, ZPixmap, NULL, + &rdata->shminfo, w, h); + + if(!rdata->image) + goto out_try_non_shm; + + rdata->shminfo.shmid = shmget(IPC_PRIVATE, rdata->image->bytes_per_line * h, + IPC_CREAT | 0777); + if(rdata->shminfo.shmid == -1) { + goto out_destroy_img; + } + + rdata->shminfo.shmaddr = shmat(rdata->shminfo.shmid, NULL,0); + if(rdata->shminfo.shmaddr == (void*)-1) + goto out_shmput; + + rdata->buffer = rdata->shminfo.shmaddr; + rdata->image->data = rdata->buffer; + rdata->shminfo.readOnly = False; + rdata->use_shm = 1; + + XShmAttach(dpy, &rdata->shminfo); + XSync(dpy, 0); + + memset(rdata->buffer, 0, rdata->image->bytes_per_line * h); + + return rdata; + +out_shmput: + shmctl(rdata->shminfo.shmid, IPC_RMID, NULL); +out_destroy_img: + XDestroyImage(rdata->image); +out_try_non_shm: + // Fallback path + rdata->image = XCreateImage(dpy, DefaultVisual(dpy, 0), depth, ZPixmap, 0, NULL, w, h, 32, 0); + if(rdata->image) { + rdata->buffer = calloc(1, (rdata->image->bytes_per_line) * h); + if(rdata->buffer) { + rdata->image->data = rdata->buffer; + return rdata; + } + } + XDestroyImage(rdata->image); + if (rdata->gc) + XFreeGC(dpy, rdata->gc); + free(rdata); +out: + return NULL; +} + +void renderer_destroy_image(Display *dpy, RendererData *rdata) { + if(!rdata) { + return; + } + if(rdata->use_shm) + XShmDetach(dpy, &rdata->shminfo); + else + free(rdata->image->data); + + rdata->image->data = NULL; + XDestroyImage(rdata->image); + + if(rdata->use_shm) { + shmdt(rdata->shminfo.shmaddr); + shmctl(rdata->shminfo.shmid, IPC_RMID, NULL); + } + free(rdata); +} + +#define MAX_PBUFFERS 100 + +/* Do this only with lock held */ +static void _request_host_resize(Display *dpy, Window win, GLState *state, int w, int h, int depth) +{ + if(state->renderer_data) + renderer_destroy_image(dpy, state->renderer_data); + + state->renderer_data = renderer_create_image(dpy, win, w, h, depth); + + long args[] = { INT_TO_ARG(win), INT_TO_ARG(w), INT_TO_ARG(h)}; + do_opengl_call_no_lock(_resize_surface_func, NULL, args, 0); +} + +static void _update_renderer(Display *dpy, Window win) { + GET_CURRENT_STATE(); + GC gc; + WindowInfoStruct info; + WindowInfoStruct *old_info = &state->last_win_state; + + if(!win) + return; + + _get_window_info(dpy, win, &info); + + if(info.map_state != IsViewable) { + if(state->renderer_data); + renderer_destroy_image(dpy, state->renderer_data); + state->renderer_data = NULL; + goto out; + } + + if(!state->renderer_data) { + state->renderer_data = renderer_create_image(dpy, win, info.width, info.height, info.depth); + _request_host_resize(dpy, win, state, info.width, info.height, info.depth); + goto out; + } + + if ((info.width != old_info->width) || (info.height != old_info->height) + || (info.depth != old_info->depth)) { + _request_host_resize(dpy, win, state, info.width, info.height, info.depth); + goto out; + } + + //fprintf(stderr, "render: win: %08x w: %d h: %d stride: %d\n", win, state->renderer_data->w, state->renderer_data->h, state->renderer_data->image->bytes_per_line); + +// Actually render stuff + long args[] = { INT_TO_ARG(win), INT_TO_ARG(state->renderer_data->image->bits_per_pixel), INT_TO_ARG(state->renderer_data->image->bytes_per_line), POINTER_TO_ARG(state->renderer_data->buffer)}; + int args_size[] = {0, 0, 0, state->renderer_data->image->bytes_per_line*state->renderer_data->h}; + do_opengl_call_no_lock(_render_surface_func, NULL, args, args_size); + + if (state->renderer_data->gc) + gc = state->renderer_data->gc; + else + gc = DefaultGC(dpy, 0); + + /* draw into window */ + if(state->renderer_data->use_shm) + XShmPutImage(dpy, win, gc, state->renderer_data->image, + 0, 0, 0, 0, state->renderer_data->w, state->renderer_data->h, + False); + else + XPutImage(dpy, win, gc, state->renderer_data->image, 0, 0, + 0, 0, state->renderer_data->w, state->renderer_data->h); + + XFlush(dpy); + +#if 0 + do { + char filename[50]; + FILE *f; + + sprintf(filename, "/home/ian/dump_%08x.rgb", win); + f = fopen(filename, "wb"); + fwrite(state->renderer_data->buffer, state->renderer_data->image->bytes_per_line*state->renderer_data->h, 1, f); + fclose(f); + } while(0); +#endif + +out: + memcpy(old_info, &info, sizeof(info)); +} + +/* Read the X window information to see whether the resize of render buffer + * on host side is needed. If so do the resize and return 1; otherwise + * return 0. + */ +int _check_and_resize_window (GLState *state, Window win) { + WindowInfoStruct info; + WindowInfoStruct *old_info = &state->last_win_state; + int changed = 0; + + if(!win) + return changed; + + _get_window_info(state->display, win, &info); + + LOCK(_resize_surface_func); + if(info.map_state != IsViewable) { + if(state->renderer_data); + renderer_destroy_image(state->display, state->renderer_data); + state->renderer_data = NULL; + changed = 1; + } else if(!state->renderer_data) { + state->renderer_data = renderer_create_image(state->display, win, info.width, info.height, info.depth); + _request_host_resize(state->display, win, state, info.width, info.height, info.depth); + changed = 1; + } else if ((info.width != old_info->width) || (info.height != old_info->height) + || (info.depth != old_info->depth)) { + _request_host_resize(state->display, win, state, info.width, info.height, info.depth); + changed = 1; + } + + memcpy(old_info, &info, sizeof(info)); + UNLOCK(_resize_surface_func); + + return changed; +} + +Bool glXMakeCurrent_no_lock( Display *dpy, GLXDrawable drawable, GLXContext ctx) +{ + Bool ret = False; +#if 0 + if (drawable == 0 && ctx == 0) + return True; + if (current_drawable == drawable && current_context == ctx) /* optimization */ + return True; +#endif + GET_CURRENT_STATE(); + + { + //log_gl("glXMakeCurrent %d %d\n", drawable, ctx); + long args[] = { POINTER_TO_ARG(dpy), INT_TO_ARG(drawable), INT_TO_ARG(ctx) }; + do_opengl_call_no_lock(glXMakeCurrent_func, NULL /*&ret*/, args, NULL); + ret = True; + } + + if (drawable == 0 && ctx == 0) + { + SET_CURRENT_STATE(NULL); + return ret; + } + + if (ret) + { + int i; + + if (ctx > 0) + { + for(i=0; i<nbGLStates; i++) + { + if (glstates[i]->context == ctx) + { + state = glstates[i]; + SET_CURRENT_STATE(state); + break; + } + } + if (i == nbGLStates) + { + log_gl("cannot set current_gl_state\n"); + log_gl("nbGLStates = %d\n", nbGLStates); + } + } + + state->display = dpy; + state->current_drawable = drawable; + state->current_read_drawable = drawable; + } + + return ret; +} + +GLAPI Bool APIENTRY glXMakeCurrent( Display *dpy, GLXDrawable drawable, GLXContext ctx) +{ + Bool ret; + LOCK(glXMakeCurrent_func); + ret = glXMakeCurrent_no_lock(dpy, drawable, ctx); + UNLOCK(glXMakeCurrent_func); + return ret; +} + +GLAPI void APIENTRY glXCopyContext( Display *dpy, GLXContext src, GLXContext dst, unsigned long mask ) +{ + long args[] = { POINTER_TO_ARG(dpy), INT_TO_ARG(src), INT_TO_ARG(dst), INT_TO_ARG(mask) }; + do_opengl_call(glXCopyContext_func, NULL, args, NULL); +} + +GLAPI Bool APIENTRY glXIsDirect( Display *dpy, GLXContext ctx ) +{ + Bool ret = False; + long args[] = { POINTER_TO_ARG(dpy), INT_TO_ARG(ctx) }; + do_opengl_call(glXIsDirect_func, &ret, args, NULL); + return ret; +} + +GLAPI int APIENTRY glXGetConfig( Display *dpy, XVisualInfo *vis, + int attrib, int *value ) +{ + int ret = 0; + int i, j; + if (vis == NULL || value == NULL) return 0; + LOCK(glXGetConfig_func); + + int visualid = 0; + for(i=0;i<nEltTabAssocVisualInfoVisualId;i++) + { + if (vis == tabAssocVisualInfoVisualId[i].vis) + { + visualid = tabAssocVisualInfoVisualId[i].visualid; + if (debug_gl) log_gl("found visualid %d corresponding to vis %p\n", visualid, vis); + break; + } + } + if (i == nEltTabAssocVisualInfoVisualId) + { + if (debug_gl) log_gl("not found vis %p in table\n", vis); + visualid = vis->visualid; + } + + /* Optimization */ + for(i=0;i<nbConfigs;i++) + { + if (visualid == configs[i].visualid) + { + for(j=0;j<configs[i].nbAttribs;j++) + { + if (configs[i].attribs[j].attrib == attrib) + { + *value = configs[i].attribs[j].value; + ret = configs[i].attribs[j].ret; + if (debug_gl) log_gl("glXGetConfig(%s)=%d (%d)\n", _getAttribNameFromValue(attrib), *value, ret); + goto end_of_glx_get_config; + } + } + break; + } + } + + if (i < N_MAX_CONFIGS) + { + if (i == nbConfigs) + { + configs[i].visualid = visualid; + configs[i].nbAttribs = 0; + int tabGottenValues[N_REQUESTED_ATTRIBS]; + int tabGottenRes[N_REQUESTED_ATTRIBS]; + if (debug_gl) log_gl("glXGetConfig_extended visual=%p\n", vis); + long args[] = { POINTER_TO_ARG(dpy), INT_TO_ARG(visualid), INT_TO_ARG(N_REQUESTED_ATTRIBS), + POINTER_TO_ARG(getTabRequestedAttribsInt()), POINTER_TO_ARG(tabGottenValues), + POINTER_TO_ARG(tabGottenRes) }; + int args_size[] = {0, 0, 0, N_REQUESTED_ATTRIBS*sizeof(int), N_REQUESTED_ATTRIBS*sizeof(int), + N_REQUESTED_ATTRIBS*sizeof(int) }; + do_opengl_call_no_lock(glXGetConfig_extended_func, NULL, CHECK_ARGS(args, args_size)); + + int j; + int found = 0; + int jDblBuffer = -1, jUseGL = -1; + for(j=0;j<N_REQUESTED_ATTRIBS;j++) + { + if (GLX_USE_GL == tabRequestedAttribsPair[j].val) + jUseGL = j; + else if (GLX_DOUBLEBUFFER == tabRequestedAttribsPair[j].val) + jDblBuffer = j; + configs[i].attribs[j].attrib = tabRequestedAttribsPair[j].val; + configs[i].attribs[j].value = tabGottenValues[j]; + configs[i].attribs[j].ret = tabGottenRes[j]; + configs[i].nbAttribs++; + if (tabRequestedAttribsPair[j].val == attrib) + { + found = 1; + *value = configs[i].attribs[j].value; + ret = configs[i].attribs[j].ret; + if (debug_gl) log_gl("glXGetConfig(%s)=%d (%d)\n", tabRequestedAttribsPair[j].name, *value, ret); + } + } + + if (getenv("DISABLE_DOUBLE_BUFFER")) + { + if (configs[i].attribs[jDblBuffer].value == 1) + { + if (attrib == GLX_USE_GL) + *value = 0; + configs[i].attribs[jUseGL].value = 0; + } + } + + nbConfigs++; + if (found) + goto end_of_glx_get_config; + } + + { + long args[] = { POINTER_TO_ARG(dpy), INT_TO_ARG(visualid), INT_TO_ARG(attrib), POINTER_TO_ARG(value) }; + do_opengl_call_no_lock(glXGetConfig_func, &ret, args, NULL); + if (debug_gl) log_gl("glXGetConfig visual=%p, attrib=%d -> %d\n", vis, attrib, *value); + if (configs[i].nbAttribs < N_MAX_ATTRIBS) + { + configs[i].attribs[configs[i].nbAttribs].attrib = attrib; + configs[i].attribs[configs[i].nbAttribs].value = *value; + configs[i].attribs[configs[i].nbAttribs].ret = ret; + configs[i].nbAttribs++; + } + } + } + else + { + long args[] = { POINTER_TO_ARG(dpy), INT_TO_ARG(visualid), INT_TO_ARG(attrib), POINTER_TO_ARG(value) }; + do_opengl_call_no_lock(glXGetConfig_func, &ret, args, NULL); + if (debug_gl) log_gl("glXGetConfig visual=%p, attrib=%d -> %d\n", vis, attrib, *value); + } +end_of_glx_get_config: + UNLOCK(glXGetConfig_func); + return ret; +} + +void glXSwapBuffers_no_lock( Display *dpy, GLXDrawable drawable ) +{ + //log_gl("glXSwapBuffers %d\n", drawable); + long args[] = { POINTER_TO_ARG(dpy), INT_TO_ARG(drawable) }; + do_opengl_call_no_lock(glXSwapBuffers_func, NULL, args, NULL); + + _update_renderer(dpy, drawable); +} + +GLAPI void APIENTRY glXSwapBuffers( Display *dpy, GLXDrawable drawable ) +{ + LOCK(glXSwapBuffers_func); + glXSwapBuffers_no_lock(dpy, drawable); + UNLOCK(glXSwapBuffers_func); +} + +GLAPI Bool APIENTRY glXQueryExtension( Display *dpy, int *errorBase, int *eventBase ) +{ + Bool ret; + LOCK(glXQueryExtension_func); + int fake_int; + if (errorBase == NULL) errorBase = &fake_int; + if (eventBase == NULL) eventBase = &fake_int; + long args[] = { POINTER_TO_ARG(dpy), POINTER_TO_ARG(errorBase), POINTER_TO_ARG(eventBase) }; + do_opengl_call_no_lock(glXQueryExtension_func, &ret, args, NULL); + UNLOCK(glXQueryExtension_func); + return ret; +} + +GLAPI void APIENTRY glXWaitGL (void) +{ + int ret; + do_opengl_call(glXWaitGL_func, &ret, NULL, NULL); +} + +GLAPI void APIENTRY glXWaitX (void) +{ + int ret; + do_opengl_call(glXWaitX_func, &ret, NULL, NULL); +} + +GLAPI Display* APIENTRY glXGetCurrentDisplay( void ) +{ + GET_CURRENT_STATE(); + return state->display; +} + +static GLXFBConfig* glXChooseFBConfig_no_lock( Display *dpy, int screen, + const int *attribList, int *nitems ) +{ + CHECK_PROC_WITH_RET(glXChooseFBConfig); + GLXFBConfig* fbConfig = NULL; + if (debug_gl) log_gl("glXChooseFBConfig\n"); + int i=0; + int ret = 0; + int emptyAttribList = None; + if (attribList == NULL) attribList = &emptyAttribList; + long args[] = { POINTER_TO_ARG(dpy), INT_TO_ARG(screen), POINTER_TO_ARG(attribList), POINTER_TO_ARG(nitems) }; + int args_size[] = { 0, 0, sizeof(int) * _compute_length_of_attrib_list_including_zero(attribList, 1), 0 }; + do_opengl_call_no_lock(glXChooseFBConfig_func, &ret, args, args_size); + if (debug_gl) log_gl("nitems = %d\n", *nitems); + if (*nitems == 0) + return NULL; + fbConfig = malloc(sizeof(GLXFBConfig) * (*nitems)); + for(i=0;i<*nitems;i++) + { + fbConfig[i] = (GLXFBConfig)(long)(ret + i); + if (debug_gl && (i == 0 || i == *nitems-1)) log_gl("config %d = %d\n", i, ret+i); + } + return fbConfig; +} + +GLAPI GLXFBConfig* APIENTRY glXChooseFBConfig( Display *dpy, int screen, + const int *attribList, int *nitems ) +{ + GLXFBConfig* fbconfig; + LOCK(glXChooseFBConfig_func); + fbconfig = glXChooseFBConfig_no_lock(dpy, screen, attribList, nitems); + UNLOCK(glXChooseFBConfig_func); + return fbconfig; +} + +GLAPI GLXFBConfig* APIENTRY glXGetFBConfigs( Display *dpy, int screen, int *nitems ) +{ + CHECK_PROC_WITH_RET(glXGetFBConfigs); + if (debug_gl) log_gl("glXGetFBConfigs\n"); + int i = 0; + GLXFBConfig* fbConfig; + int ret = 0; + long args[] = { POINTER_TO_ARG(dpy), INT_TO_ARG(screen), POINTER_TO_ARG(nitems) }; + do_opengl_call(glXGetFBConfigs_func, &ret, args, NULL); + if (debug_gl) log_gl("nitems = %d\n", *nitems); + fbConfig = malloc(sizeof(GLXFBConfig) * (*nitems)); + for(i=0;i<*nitems;i++) + { + fbConfig[i] = (GLXFBConfig)(long)(ret + i); + if (debug_gl && (i == 0 || i == *nitems-1)) log_gl("config %d = %d\n", i, ret+i); + } + return fbConfig; +} + + +GLAPI int APIENTRY glXGetFBConfigAttrib(Display *dpy, GLXFBConfig config, int attrib, int *value) +{ + CHECK_PROC_WITH_RET(glXGetFBConfigAttrib); + LOCK(glXGetFBConfigAttrib_func); + int ret = 0; + int i, j; + + /* Optimization */ + for(i=0;i<nbFBConfigs;i++) + { + if (config == fbconfigs[i].config) + { + for(j=0;j<fbconfigs[i].nbAttribs;j++) + { + if (fbconfigs[i].attribs[j].attrib == attrib) + { + *value = fbconfigs[i].attribs[j].value; + ret = fbconfigs[i].attribs[j].ret; + if (debug_gl) + { + log_gl("glXGetFBConfigAttrib(config=%p,%s)=%d (%d)\n", config, + _getAttribNameFromValue(attrib), *value, ret); + } + goto end_of_glx_get_fb_config_attrib; + } + } + break; + } + } + + if (i < N_MAX_CONFIGS) + { + if (i == nbFBConfigs) + { + fbconfigs[i].config = config; + fbconfigs[i].nbAttribs = 0; + int tabGottenValues[N_REQUESTED_ATTRIBS]; + int tabGottenRes[N_REQUESTED_ATTRIBS]; + if (debug_gl) log_gl("glXGetFBConfigAttrib_extended config=%p\n", config); + long args[] = { POINTER_TO_ARG(dpy), INT_TO_ARG(config), INT_TO_ARG(N_REQUESTED_ATTRIBS), + POINTER_TO_ARG(getTabRequestedAttribsInt()), POINTER_TO_ARG(tabGottenValues), + POINTER_TO_ARG(tabGottenRes) }; + int args_size[] = {0, 0, 0, N_REQUESTED_ATTRIBS*sizeof(int), N_REQUESTED_ATTRIBS*sizeof(int), + N_REQUESTED_ATTRIBS*sizeof(int) }; + do_opengl_call_no_lock(glXGetFBConfigAttrib_extended_func, NULL, CHECK_ARGS(args, args_size)); + + int j; + int found = 0; + for(j=0;j<N_REQUESTED_ATTRIBS;j++) + { + if (tabRequestedAttribsPair[j].val == GLX_VISUAL_ID) { + // ignore the VISUAL_ID from QEMU host; + int screen = 0; + fbconfigs[i].attribs[j].attrib = GLX_VISUAL_ID; + fbconfigs[i].attribs[j].value = DefaultVisual(dpy, screen)->visualid; + fbconfigs[i].attribs[j].ret = 0; + } else if (tabRequestedAttribsPair[j].val == GLX_X_VISUAL_TYPE) { + fbconfigs[i].attribs[j].attrib = GLX_X_VISUAL_TYPE; + fbconfigs[i].attribs[j].value = GLX_TRUE_COLOR; + fbconfigs[i].attribs[j].ret = 0; + } else { + fbconfigs[i].attribs[j].attrib = tabRequestedAttribsPair[j].val; + fbconfigs[i].attribs[j].value = tabGottenValues[j]; + fbconfigs[i].attribs[j].ret = tabGottenRes[j]; + } + fbconfigs[i].nbAttribs++; + if (tabRequestedAttribsPair[j].val == attrib) + { + found = 1; + *value = fbconfigs[i].attribs[j].value; + ret = fbconfigs[i].attribs[j].ret; + if (debug_gl) log_gl("glXGetFBConfigAttrib(config=%p, %s)=%d (%d)\n", + config, tabRequestedAttribsPair[j].name, *value, ret); + } + } + nbFBConfigs++; + if (found) + goto end_of_glx_get_fb_config_attrib; + } + + { + long args[] = { POINTER_TO_ARG(dpy), INT_TO_ARG(config), INT_TO_ARG(attrib), POINTER_TO_ARG(value) }; + do_opengl_call_no_lock(glXGetFBConfigAttrib_func, &ret, args, NULL); + if (debug_gl) log_gl("glXGetFBConfigAttrib config=%p, attrib=%d -> %d\n", config, attrib, *value); + if (fbconfigs[i].nbAttribs < N_MAX_ATTRIBS) + { + fbconfigs[i].attribs[fbconfigs[i].nbAttribs].attrib = attrib; + fbconfigs[i].attribs[fbconfigs[i].nbAttribs].value = *value; + fbconfigs[i].attribs[fbconfigs[i].nbAttribs].ret = ret; + fbconfigs[i].nbAttribs++; + } + } + } + else + { + if (attrib == GLX_VISUAL_ID) { + // get the visual id in guest os + int screen = 0; + *value = DefaultVisual(dpy, screen)->visualid; + ret = 0; + } else if (attrib == GLX_X_VISUAL_TYPE){ + *value = GLX_TRUE_COLOR; + ret = 0; + } else { + long args[] = { POINTER_TO_ARG(dpy), INT_TO_ARG(config), INT_TO_ARG(attrib), POINTER_TO_ARG(value) }; + do_opengl_call_no_lock(glXGetFBConfigAttrib_func, &ret, args, NULL); + if (debug_gl) log_gl("glXGetFBConfigAttrib config=%p, attrib=%d -> %d\n", config, attrib, *value); + } + } +end_of_glx_get_fb_config_attrib: + UNLOCK(glXGetFBConfigAttrib_func); + return ret; +} + +GLAPI int APIENTRY glXQueryContext( Display *dpy, GLXContext ctx, int attribute, int *value ) +{ + CHECK_PROC_WITH_RET(glXQueryContext); + int ret = 0; + long args[] = { POINTER_TO_ARG(dpy), INT_TO_ARG(ctx), INT_TO_ARG(attribute), POINTER_TO_ARG(value) }; + do_opengl_call(glXQueryContext_func, &ret, args, NULL); + return ret; +} + +GLAPI void APIENTRY glXQueryDrawable( Display *dpy, GLXDrawable draw, int attribute, unsigned int *value ) +{ + CHECK_PROC(glXQueryDrawable); + long args[] = { POINTER_TO_ARG(dpy), INT_TO_ARG(draw), INT_TO_ARG(attribute), POINTER_TO_ARG(value) }; + do_opengl_call(glXQueryDrawable_func, NULL, args, NULL); +} + +static XVisualInfo* glXGetVisualFromFBConfig_no_lock( Display *dpy, GLXFBConfig config ) +{ + CHECK_PROC_WITH_RET(glXGetVisualFromFBConfig); + int screen = 0; + + if (debug_gl) log_gl("glXGetVisualFromFBConfig %p\n", (void*)config); + + XVisualInfo temp, *vis; + long mask; + int n; + int i; + + mask = VisualScreenMask | VisualDepthMask | VisualClassMask; + temp.screen = screen; + temp.depth = DefaultDepth(dpy,screen); + temp.class = DefaultVisual(dpy,screen)->class; + temp.visualid = DefaultVisual(dpy,screen)->visualid; + mask |= VisualIDMask; + + vis = XGetVisualInfo( dpy, mask, &temp, &n ); + + long args[] = { POINTER_TO_ARG(dpy), INT_TO_ARG(config)}; + int visualid; + do_opengl_call_no_lock(glXGetVisualFromFBConfig_func, &visualid, args, NULL); + + vis->visualid = visualid; + + assert (nEltTabAssocVisualInfoVisualId < MAX_SIZE_TAB_ASSOC_VISUALINFO_VISUALID); + for(i=0;i<nEltTabAssocVisualInfoVisualId;i++) + { + if (tabAssocVisualInfoVisualId[i].vis == vis) break; + } + if (i == nEltTabAssocVisualInfoVisualId) + nEltTabAssocVisualInfoVisualId++; + tabAssocVisualInfoVisualId[i].vis = vis; + tabAssocVisualInfoVisualId[i].fbconfig = config; + tabAssocVisualInfoVisualId[i].visualid = visualid; + + if (debug_gl) log_gl("glXGetVisualFromFBConfig returning vis %p (visualid=%d, 0x%X)\n", vis, visualid, visualid); + + return vis; +} + +GLAPI XVisualInfo* APIENTRY glXGetVisualFromFBConfig( Display *dpy, GLXFBConfig config ) +{ + XVisualInfo* vis; + LOCK(glXGetVisualFromFBConfig_func); + vis = glXGetVisualFromFBConfig_no_lock(dpy, config); + UNLOCK(glXGetVisualFromFBConfig_func); + return vis; +} + +GLAPI GLXContext APIENTRY glXCreateNewContext(Display * dpy, + GLXFBConfig fbconfig, + int renderType, + GLXContext shareList, + Bool direct) +{ + CHECK_PROC_WITH_RET(glXCreateNewContext); + LOCK(glXCreateNewContext_func); + if (debug_gl) log_gl("glXCreateNewContext %p\n", (void*)fbconfig); + + GLXContext ctxt; + long args[] = { POINTER_TO_ARG(dpy), INT_TO_ARG(fbconfig), INT_TO_ARG(renderType), INT_TO_ARG(shareList), + INT_TO_ARG(direct) }; + do_opengl_call_no_lock(glXCreateNewContext_func, &ctxt, args, NULL); + if (ctxt) + { + _create_context(ctxt, shareList); + } + UNLOCK(glXCreateNewContext_func); + return ctxt; +} + +GLAPI Bool APIENTRY glXMakeContextCurrent( Display *dpy, GLXDrawable draw, + GLXDrawable read, GLXContext ctx ) +{ + Bool ret; + GET_CURRENT_STATE(); + if (draw != read) + { + static int first_time = 1; + if (first_time) + { + first_time = 0; + log_gl("using glXMakeCurrent instead of real glXMakeContextCurrent... may help some program work...\n"); + } + } + ret = glXMakeCurrent(dpy, draw, ctx); + if (ret && ctx) + state->current_read_drawable = read; + return ret; +} + +GLAPI GLXWindow APIENTRY glXCreateWindow( Display *dpy, GLXFBConfig config, Window win, const int *attribList ) +{ + CHECK_PROC_WITH_RET(glXCreateWindow); + /* do nothing. Not sure about this implementation. FIXME */ + fprintf(stderr, "createwindow?\n"); + return win; +} + +GLAPI void APIENTRY glXDestroyWindow( Display *dpy, GLXWindow window ) +{ + CHECK_PROC(glXDestroyWindow); + /* do nothing. Not sure about this implementation. FIXME */ +} + +GLAPI GLXPixmap APIENTRY glXCreateGLXPixmap( Display *dpy, + XVisualInfo *vis, + Pixmap pixmap ) +{ + CHECK_PROC_WITH_RET(glXCreateGLXPixmap); + /* XXX: Not sure about this implementaiton + * Do thing but return pixmap as ID. New pixmap will be created via + * MakeCurrent in Emulator from host. After rendering done on the host, the + * buffer will be copied back when CopyBuffers. + */ + return pixmap; +} + +GLAPI void APIENTRY glXDestroyGLXPixmap( Display *dpy, GLXPixmap pixmap ) +{ + CHECK_PROC(glXDestroyGLXPixmap); + /* XXX:do nothing. Not sure about this implementation */ + /* FIXME */ + log_gl("glXDestroyGLXPixmap : sorry, unsupported call and I don't really see how I could implement it..."); +} + +GLAPI GLXPixmap APIENTRY glXCreatePixmap( Display *dpy, GLXFBConfig fbconfig, + Pixmap pixmap, const int *attribList ) +{ + CHECK_PROC_WITH_RET(glXCreatePixmap); + + LOCK(glXCreatePixmap_func); + if (debug_gl) log_gl("glXCreatePixmap %p\n", (void*)fbconfig); + + int emptyAttribList = None; + if (attribList == NULL) attribList = &emptyAttribList; + GLXPixmap glxpixmap; + long args[] = { POINTER_TO_ARG(dpy), INT_TO_ARG(fbconfig), INT_TO_ARG(pixmap), + POINTER_TO_ARG(attribList) }; + int args_size[] = { 0, 0, 0, sizeof(int) * _compute_length_of_attrib_list_including_zero(attribList, 1) }; + do_opengl_call_no_lock(glXCreatePixmap_func, &glxpixmap, args, args_size); + if (glxpixmap) + { + /*XXX:maintain the info?*/ + } + UNLOCK(glXCreatePixmap_func); + + return glxpixmap; +} + +GLAPI void APIENTRY glXDestroyPixmap( Display *dpy, GLXPixmap pixmap ) +{ + CHECK_PROC(glXDestroyPixmap); + /* XXX:do nothing. Not sure about this implementation */ + /* FIXME */ + log_gl("glXDestroyPixmap : sorry, unsupported call and I don't really see how I could implement it..."); +} + +GLAPI GLXPbuffer APIENTRY glXCreatePbuffer( Display *dpy, GLXFBConfig config, + const int *attribList ) +{ + CHECK_PROC_WITH_RET(glXCreatePbuffer); + /* FIXME */ + log_gl("glXCreatePbuffer: sorry, unsupported call and I don't really see how I could implement it..."); + return 0; +} + +GLAPI void APIENTRY glXDestroyPbuffer( Display *dpy, GLXPbuffer pbuf ) +{ + CHECK_PROC(glXDestroyPbuffer); + /* FIXME */ + log_gl("glXDestroyPbuffer: sorry, unsupported call and I don't really see how I could implement it..."); +} + +GLAPI GLXDrawable APIENTRY glXGetCurrentReadDrawable( void ) +{ + CHECK_PROC_WITH_RET(glXGetCurrentReadDrawable); + GET_CURRENT_STATE(); + return state ? state->current_read_drawable : None; +} + +GLAPI void APIENTRY glXSelectEvent( Display *dpy, GLXDrawable drawable, + unsigned long mask ) +{ + CHECK_PROC(glXSelectEvent); + log_gl("glXSelectEvent : sorry, unsupported call"); +} + +GLAPI void APIENTRY glXGetSelectedEvent( Display *dpy, GLXDrawable drawable, + unsigned long *mask ) +{ + CHECK_PROC(glXGetSelectedEvent); + log_gl("glXGetSelectedEvent : sorry, unsupported call"); +} + + +#include "opengl_client_xfonts.c" + +GLAPI const char * APIENTRY EXT_FUNC(glXGetScreenDriver) (Display *dpy, int screen) +{ + static const char* ret = NULL; + LOCK(glXGetScreenDriver_func); + CHECK_PROC_WITH_RET(glXGetScreenDriver); + if (ret == NULL) + { + long args[] = { POINTER_TO_ARG(dpy), INT_TO_ARG(screen) }; + do_opengl_call_no_lock(glXGetScreenDriver_func, &ret, args, NULL); + ret = strdup(ret); + } + UNLOCK(glXGetScreenDriver_func); + return ret; +} + +GLAPI const char * APIENTRY EXT_FUNC(glXGetDriverConfig) (const char *drivername) +{ + static const char* ret = NULL; + CHECK_PROC_WITH_RET(glXGetDriverConfig); + long args[] = { POINTER_TO_ARG(drivername) }; + if (ret) free((void*)ret); + do_opengl_call(glXGetDriverConfig_func, &ret, args, NULL); + ret = strdup(ret); + return ret; +} + +/* For googleearth */ +static int counterSync = 0; + +GLAPI int APIENTRY EXT_FUNC(glXWaitVideoSyncSGI) ( int divisor, int remainder, unsigned int *count ) +{ + CHECK_PROC_WITH_RET(glXWaitVideoSyncSGI); + //log_gl("glXWaitVideoSyncSGI %d %d\n", divisor, remainder); + *count = counterSync++; // FIXME ? + return 0; +} + +GLAPI int APIENTRY EXT_FUNC(glXGetVideoSyncSGI)( unsigned int *count ) +{ + CHECK_PROC_WITH_RET(glXGetVideoSyncSGI); + //log_gl("glXGetVideoSyncSGI\n"); + *count = counterSync++; // FIXME ? + return 0; +} + +GLAPI int APIENTRY EXT_FUNC(glXSwapIntervalSGI) ( int interval ) +{ + CHECK_PROC_WITH_RET(glXSwapIntervalSGI); + long args[] = { INT_TO_ARG(interval) }; + int ret = 0; + do_opengl_call(glXSwapIntervalSGI_func, &ret, args, NULL); + //log_gl("glXSwapIntervalSGI(%d) = %d\n", interval, ret); + return ret; +} + +static unsigned int str_hash (const void* v) +{ + /* 31 bit hash function */ + const signed char *p = v; + unsigned int h = *p; + + if (h) + for (p += 1; *p != '\0'; p++) + h = (h << 5) - h + *p; + + return h; +} + +static const char* global_glXGetProcAddress_request = +{ +"glAccum\0" +"glActiveStencilFaceEXT\0" +"glActiveTexture\0" +"glActiveTextureARB\0" +"glActiveVaryingNV\0" +"glAddSwapHintRectWIN\0" +"glAlphaFragmentOp1ATI\0" +"glAlphaFragmentOp2ATI\0" +"glAlphaFragmentOp3ATI\0" +"glAlphaFunc\0" +"glApplyTextureEXT\0" +"glAreProgramsResidentNV\0" +"glAreTexturesResident\0" +"glAreTexturesResidentEXT\0" +"glArrayElement\0" +"glArrayElementEXT\0" +"glArrayObjectATI\0" +"glAsyncMarkerSGIX\0" +"glAttachObjectARB\0" +"glAttachShader\0" +"glBegin\0" +"glBeginConditionalRenderNVX\0" +"glBeginDefineVisibilityQueryATI\0" +"glBeginFragmentShaderATI\0" +"glBeginOcclusionQuery\0" +"glBeginOcclusionQueryNV\0" +"glBeginQuery\0" +"glBeginQueryARB\0" +"glBeginSceneEXT\0" +"glBeginTransformFeedbackNV\0" +"glBeginUseVisibilityQueryATI\0" +"glBeginVertexShaderEXT\0" +"glBindArraySetARB\0" +"glBindAttribLocation\0" +"glBindAttribLocationARB\0" +"glBindBuffer\0" +"glBindBufferARB\0" +"glBindBufferBaseNV\0" +"glBindBufferOffsetNV\0" +"glBindBufferRangeNV\0" +"glBindFragDataLocationEXT\0" +"glBindFragmentShaderATI\0" +"glBindFramebufferEXT\0" +"glBindLightParameterEXT\0" +"glBindMaterialParameterEXT\0" +"glBindParameterEXT\0" +"glBindProgramARB\0" +"glBindProgramNV\0" +"glBindRenderbufferEXT\0" +"glBindTexGenParameterEXT\0" +"glBindTexture\0" +"glBindTextureEXT\0" +"glBindTextureUnitParameterEXT\0" +"glBindVertexArrayAPPLE\0" +"glBindVertexShaderEXT\0" +"glBinormal3bEXT\0" +"glBinormal3bvEXT\0" +"glBinormal3dEXT\0" +"glBinormal3dvEXT\0" +"glBinormal3fEXT\0" +"glBinormal3fvEXT\0" +"glBinormal3iEXT\0" +"glBinormal3ivEXT\0" +"glBinormal3sEXT\0" +"glBinormal3svEXT\0" +"glBinormalArrayEXT\0" +"glBitmap\0" +"glBlendColor\0" +"glBlendColorEXT\0" +"glBlendEquation\0" +"glBlendEquationEXT\0" +"glBlendEquationSeparate\0" +"glBlendEquationSeparateATI\0" +"glBlendEquationSeparateEXT\0" +"glBlendFunc\0" +"glBlendFuncSeparate\0" +"glBlendFuncSeparateEXT\0" +"glBlendFuncSeparateINGR\0" +"glBlitFramebufferEXT\0" +"glBufferData\0" +"glBufferDataARB\0" +"glBufferParameteriAPPLE\0" +"glBufferRegionEnabled\0" +"glBufferRegionEnabledEXT\0" +"glBufferSubData\0" +"glBufferSubDataARB\0" +"glCallList\0" +"glCallLists\0" +"glCheckFramebufferStatusEXT\0" +"glClampColorARB\0" +"glClear\0" +"glClearAccum\0" +"glClearColor\0" +"glClearColorIiEXT\0" +"glClearColorIuiEXT\0" +"glClearDepth\0" +"glClearDepthdNV\0" +"glClearIndex\0" +"glClearStencil\0" +"glClientActiveTexture\0" +"glClientActiveTextureARB\0" +"glClientActiveVertexStreamATI\0" +"glClipPlane\0" +"glColor3b\0" +"glColor3bv\0" +"glColor3d\0" +"glColor3dv\0" +"glColor3f\0" +"glColor3fv\0" +"glColor3fVertex3fSUN\0" +"glColor3fVertex3fvSUN\0" +"glColor3hNV\0" +"glColor3hvNV\0" +"glColor3i\0" +"glColor3iv\0" +"glColor3s\0" +"glColor3sv\0" +"glColor3ub\0" +"glColor3ubv\0" +"glColor3ui\0" +"glColor3uiv\0" +"glColor3us\0" +"glColor3usv\0" +"glColor4b\0" +"glColor4bv\0" +"glColor4d\0" +"glColor4dv\0" +"glColor4f\0" +"glColor4fNormal3fVertex3fSUN\0" +"glColor4fNormal3fVertex3fvSUN\0" +"glColor4fv\0" +"glColor4hNV\0" +"glColor4hvNV\0" +"glColor4i\0" +"glColor4iv\0" +"glColor4s\0" +"glColor4sv\0" +"glColor4ub\0" +"glColor4ubv\0" +"glColor4ubVertex2fSUN\0" +"glColor4ubVertex2fvSUN\0" +"glColor4ubVertex3fSUN\0" +"glColor4ubVertex3fvSUN\0" +"glColor4ui\0" +"glColor4uiv\0" +"glColor4us\0" +"glColor4usv\0" +"glColorFragmentOp1ATI\0" +"glColorFragmentOp2ATI\0" +"glColorFragmentOp3ATI\0" +"glColorMask\0" +"glColorMaskIndexedEXT\0" +"glColorMaterial\0" +"glColorPointer\0" +"glColorPointerEXT\0" +"glColorPointerListIBM\0" +"glColorPointervINTEL\0" +"glColorSubTable\0" +"glColorSubTableEXT\0" +"glColorTable\0" +"glColorTableEXT\0" +"glColorTableParameterfv\0" +"glColorTableParameterfvSGI\0" +"glColorTableParameteriv\0" +"glColorTableParameterivSGI\0" +"glColorTableSGI\0" +"glCombinerInputNV\0" +"glCombinerOutputNV\0" +"glCombinerParameterfNV\0" +"glCombinerParameterfvNV\0" +"glCombinerParameteriNV\0" +"glCombinerParameterivNV\0" +"glCombinerStageParameterfvNV\0" +"glCompileShader\0" +"glCompileShaderARB\0" +"glCompressedTexImage1D\0" +"glCompressedTexImage1DARB\0" +"glCompressedTexImage2D\0" +"glCompressedTexImage2DARB\0" +"glCompressedTexImage3D\0" +"glCompressedTexImage3DARB\0" +"glCompressedTexSubImage1D\0" +"glCompressedTexSubImage1DARB\0" +"glCompressedTexSubImage2D\0" +"glCompressedTexSubImage2DARB\0" +"glCompressedTexSubImage3D\0" +"glCompressedTexSubImage3DARB\0" +"glConvolutionFilter1D\0" +"glConvolutionFilter1DEXT\0" +"glConvolutionFilter2D\0" +"glConvolutionFilter2DEXT\0" +"glConvolutionParameterf\0" +"glConvolutionParameterfEXT\0" +"glConvolutionParameterfv\0" +"glConvolutionParameterfvEXT\0" +"glConvolutionParameteri\0" +"glConvolutionParameteriEXT\0" +"glConvolutionParameteriv\0" +"glConvolutionParameterivEXT\0" +"glCopyColorSubTable\0" +"glCopyColorSubTableEXT\0" +"glCopyColorTable\0" +"glCopyColorTableSGI\0" +"glCopyConvolutionFilter1D\0" +"glCopyConvolutionFilter1DEXT\0" +"glCopyConvolutionFilter2D\0" +"glCopyConvolutionFilter2DEXT\0" +"glCopyPixels\0" +"glCopyTexImage1D\0" +"glCopyTexImage1DEXT\0" +"glCopyTexImage2D\0" +"glCopyTexImage2DEXT\0" +"glCopyTexSubImage1D\0" +"glCopyTexSubImage1DEXT\0" +"glCopyTexSubImage2D\0" +"glCopyTexSubImage2DEXT\0" +"glCopyTexSubImage3D\0" +"glCopyTexSubImage3DEXT\0" +"glCreateProgram\0" +"glCreateProgramObjectARB\0" +"glCreateShader\0" +"glCreateShaderObjectARB\0" +"glCullFace\0" +"glCullParameterdvEXT\0" +"glCullParameterfvEXT\0" +"glCurrentPaletteMatrixARB\0" +"glDeformationMap3dSGIX\0" +"glDeformationMap3fSGIX\0" +"glDeformSGIX\0" +"glDeleteArraySetsARB\0" +"glDeleteAsyncMarkersSGIX\0" +"glDeleteBufferRegion\0" +"glDeleteBufferRegionEXT\0" +"glDeleteBuffers\0" +"glDeleteBuffersARB\0" +"glDeleteFencesAPPLE\0" +"glDeleteFencesNV\0" +"glDeleteFragmentShaderATI\0" +"glDeleteFramebuffersEXT\0" +"glDeleteLists\0" +"glDeleteObjectARB\0" +"glDeleteObjectBufferATI\0" +"glDeleteOcclusionQueries\0" +"glDeleteOcclusionQueriesNV\0" +"glDeleteProgram\0" +"glDeleteProgramsARB\0" +"glDeleteProgramsNV\0" +"glDeleteQueries\0" +"glDeleteQueriesARB\0" +"glDeleteRenderbuffersEXT\0" +"glDeleteShader\0" +"glDeleteTextures\0" +"glDeleteTexturesEXT\0" +"glDeleteVertexArraysAPPLE\0" +"glDeleteVertexShaderEXT\0" +"glDeleteVisibilityQueriesATI\0" +"glDepthBoundsdNV\0" +"glDepthBoundsEXT\0" +"glDepthFunc\0" +"glDepthMask\0" +"glDepthRange\0" +"glDepthRangedNV\0" +"glDetachObjectARB\0" +"glDetachShader\0" +"glDetailTexFuncSGIS\0" +"glDisable\0" +"glDisableClientState\0" +"glDisableIndexedEXT\0" +"glDisableVariantClientStateEXT\0" +"glDisableVertexAttribAPPLE\0" +"glDisableVertexAttribArray\0" +"glDisableVertexAttribArrayARB\0" +"glDrawArrays\0" +"glDrawArraysEXT\0" +"glDrawArraysInstancedEXT\0" +"glDrawBuffer\0" +"glDrawBufferRegion\0" +"glDrawBufferRegionEXT\0" +"glDrawBuffers\0" +"glDrawBuffersARB\0" +"glDrawBuffersATI\0" +"glDrawElementArrayAPPLE\0" +"glDrawElementArrayATI\0" +"glDrawElements\0" +"glDrawElementsFGL\0" +"glDrawElementsInstancedEXT\0" +"glDrawMeshArraysSUN\0" +"glDrawMeshNV\0" +"glDrawPixels\0" +"glDrawRangeElementArrayAPPLE\0" +"glDrawRangeElementArrayATI\0" +"glDrawRangeElements\0" +"glDrawRangeElementsEXT\0" +"glDrawWireTrianglesFGL\0" +"glEdgeFlag\0" +"glEdgeFlagPointer\0" +"glEdgeFlagPointerEXT\0" +"glEdgeFlagPointerListIBM\0" +"glEdgeFlagv\0" +"glElementPointerAPPLE\0" +"glElementPointerATI\0" +"glEnable\0" +"glEnableClientState\0" +"glEnableIndexedEXT\0" +"glEnableVariantClientStateEXT\0" +"glEnableVertexAttribAPPLE\0" +"glEnableVertexAttribArray\0" +"glEnableVertexAttribArrayARB\0" +"glEnd\0" +"glEndConditionalRenderNVX\0" +"glEndDefineVisibilityQueryATI\0" +"glEndFragmentShaderATI\0" +"glEndList\0" +"glEndOcclusionQuery\0" +"glEndOcclusionQueryNV\0" +"glEndQuery\0" +"glEndQueryARB\0" +"glEndSceneEXT\0" +"glEndTransformFeedbackNV\0" +"glEndUseVisibilityQueryATI\0" +"glEndVertexShaderEXT\0" +"glEvalCoord1d\0" +"glEvalCoord1dv\0" +"glEvalCoord1f\0" +"glEvalCoord1fv\0" +"glEvalCoord2d\0" +"glEvalCoord2dv\0" +"glEvalCoord2f\0" +"glEvalCoord2fv\0" +"glEvalMapsNV\0" +"glEvalMesh1\0" +"glEvalMesh2\0" +"glEvalPoint1\0" +"glEvalPoint2\0" +"glExecuteProgramNV\0" +"glExtractComponentEXT\0" +"glFeedbackBuffer\0" +"glFinalCombinerInputNV\0" +"glFinish\0" +"glFinishAsyncSGIX\0" +"glFinishFenceAPPLE\0" +"glFinishFenceNV\0" +"glFinishObjectAPPLE\0" +"glFinishRenderAPPLE\0" +"glFinishTextureSUNX\0" +"glFlush\0" +"glFlushMappedBufferRangeAPPLE\0" +"glFlushPixelDataRangeNV\0" +"glFlushRasterSGIX\0" +"glFlushRenderAPPLE\0" +"glFlushVertexArrayRangeAPPLE\0" +"glFlushVertexArrayRangeNV\0" +"glFogCoordd\0" +"glFogCoorddEXT\0" +"glFogCoorddv\0" +"glFogCoorddvEXT\0" +"glFogCoordf\0" +"glFogCoordfEXT\0" +"glFogCoordfv\0" +"glFogCoordfvEXT\0" +"glFogCoordhNV\0" +"glFogCoordhvNV\0" +"glFogCoordPointer\0" +"glFogCoordPointerEXT\0" +"glFogCoordPointerListIBM\0" +"glFogf\0" +"glFogFuncSGIS\0" +"glFogfv\0" +"glFogi\0" +"glFogiv\0" +"glFragmentColorMaterialEXT\0" +"glFragmentColorMaterialSGIX\0" +"glFragmentLightfEXT\0" +"glFragmentLightfSGIX\0" +"glFragmentLightfvEXT\0" +"glFragmentLightfvSGIX\0" +"glFragmentLightiEXT\0" +"glFragmentLightiSGIX\0" +"glFragmentLightivEXT\0" +"glFragmentLightivSGIX\0" +"glFragmentLightModelfEXT\0" +"glFragmentLightModelfSGIX\0" +"glFragmentLightModelfvEXT\0" +"glFragmentLightModelfvSGIX\0" +"glFragmentLightModeliEXT\0" +"glFragmentLightModeliSGIX\0" +"glFragmentLightModelivEXT\0" +"glFragmentLightModelivSGIX\0" +"glFragmentMaterialfEXT\0" +"glFragmentMaterialfSGIX\0" +"glFragmentMaterialfvEXT\0" +"glFragmentMaterialfvSGIX\0" +"glFragmentMaterialiEXT\0" +"glFragmentMaterialiSGIX\0" +"glFragmentMaterialivEXT\0" +"glFragmentMaterialivSGIX\0" +"glFramebufferRenderbufferEXT\0" +"glFramebufferTexture1DEXT\0" +"glFramebufferTexture2DEXT\0" +"glFramebufferTexture2D\0" +"glFramebufferTexture3DEXT\0" +"glFramebufferTextureEXT\0" +"glFramebufferTextureFaceEXT\0" +"glFramebufferTextureLayerEXT\0" +"glFrameZoomSGIX\0" +"glFreeObjectBufferATI\0" +"glFrontFace\0" +"glFrustum\0" +"glGenArraySetsARB\0" +"glGenAsyncMarkersSGIX\0" +"glGenBuffers\0" +"glGenBuffersARB\0" +"glGenerateMipmapEXT\0" +"glGenFencesAPPLE\0" +"glGenFencesNV\0" +"glGenFragmentShadersATI\0" +"glGenFramebuffersEXT\0" +"glGenLists\0" +"glGenOcclusionQueries\0" +"glGenOcclusionQueriesNV\0" +"glGenProgramsARB\0" +"glGenProgramsNV\0" +"glGenQueries\0" +"glGenQueriesARB\0" +"glGenRenderbuffersEXT\0" +"glGenSymbolsEXT\0" +"glGenTextures\0" +"glGenTexturesEXT\0" +"glGenVertexArraysAPPLE\0" +"glGenVertexShadersEXT\0" +"glGenVisibilityQueriesATI\0" +"glGetActiveAttrib\0" +"glGetActiveAttribARB\0" +"glGetActiveUniform\0" +"glGetActiveUniformARB\0" +"glGetActiveVaryingNV\0" +"glGetArrayObjectfvATI\0" +"glGetArrayObjectivATI\0" +"glGetAttachedObjectsARB\0" +"glGetAttachedShaders\0" +"glGetAttribLocation\0" +"glGetAttribLocationARB\0" +"glGetBooleanIndexedvEXT\0" +"glGetBooleanv\0" +"glGetBufferParameteriv\0" +"glGetBufferParameterivARB\0" +"glGetBufferPointerv\0" +"glGetBufferPointervARB\0" +"glGetBufferSubData\0" +"glGetBufferSubDataARB\0" +"glGetClipPlane\0" +"glGetColorTable\0" +"glGetColorTableEXT\0" +"glGetColorTableParameterfv\0" +"glGetColorTableParameterfvEXT\0" +"glGetColorTableParameterfvSGI\0" +"glGetColorTableParameteriv\0" +"glGetColorTableParameterivEXT\0" +"glGetColorTableParameterivSGI\0" +"glGetColorTableSGI\0" +"glGetCombinerInputParameterfvNV\0" +"glGetCombinerInputParameterivNV\0" +"glGetCombinerOutputParameterfvNV\0" +"glGetCombinerOutputParameterivNV\0" +"glGetCombinerStageParameterfvNV\0" +"glGetCompressedTexImage\0" +"glGetCompressedTexImageARB\0" +"glGetConvolutionFilter\0" +"glGetConvolutionFilterEXT\0" +"glGetConvolutionParameterfv\0" +"glGetConvolutionParameterfvEXT\0" +"glGetConvolutionParameteriv\0" +"glGetConvolutionParameterivEXT\0" +"glGetDetailTexFuncSGIS\0" +"glGetDoublev\0" +"glGetError\0" +"glGetFenceivNV\0" +"glGetFinalCombinerInputParameterfvNV\0" +"glGetFinalCombinerInputParameterivNV\0" +"glGetFloatv\0" +"glGetFogFuncSGIS\0" +"glGetFragDataLocationEXT\0" +"glGetFragmentLightfvEXT\0" +"glGetFragmentLightfvSGIX\0" +"glGetFragmentLightivEXT\0" +"glGetFragmentLightivSGIX\0" +"glGetFragmentMaterialfvEXT\0" +"glGetFragmentMaterialfvSGIX\0" +"glGetFragmentMaterialivEXT\0" +"glGetFragmentMaterialivSGIX\0" +"glGetFramebufferAttachmentParameterivEXT\0" +"glGetHandleARB\0" +"glGetHistogram\0" +"glGetHistogramEXT\0" +"glGetHistogramParameterfv\0" +"glGetHistogramParameterfvEXT\0" +"glGetHistogramParameteriv\0" +"glGetHistogramParameterivEXT\0" +"glGetImageTransformParameterfvHP\0" +"glGetImageTransformParameterivHP\0" +"glGetInfoLogARB\0" +"glGetInstrumentsSGIX\0" +"glGetIntegerIndexedvEXT\0" +"glGetIntegerv\0" +"glGetInvariantBooleanvEXT\0" +"glGetInvariantFloatvEXT\0" +"glGetInvariantIntegervEXT\0" +"glGetLightfv\0" +"glGetLightiv\0" +"glGetListParameterfvSGIX\0" +"glGetListParameterivSGIX\0" +"glGetLocalConstantBooleanvEXT\0" +"glGetLocalConstantFloatvEXT\0" +"glGetLocalConstantIntegervEXT\0" +"glGetMapAttribParameterfvNV\0" +"glGetMapAttribParameterivNV\0" +"glGetMapControlPointsNV\0" +"glGetMapdv\0" +"glGetMapfv\0" +"glGetMapiv\0" +"glGetMapParameterfvNV\0" +"glGetMapParameterivNV\0" +"glGetMaterialfv\0" +"glGetMaterialiv\0" +"glGetMinmax\0" +"glGetMinmaxEXT\0" +"glGetMinmaxParameterfv\0" +"glGetMinmaxParameterfvEXT\0" +"glGetMinmaxParameteriv\0" +"glGetMinmaxParameterivEXT\0" +"glGetObjectBufferfvATI\0" +"glGetObjectBufferivATI\0" +"glGetObjectParameterfvARB\0" +"glGetObjectParameterivARB\0" +"glGetOcclusionQueryiv\0" +"glGetOcclusionQueryivNV\0" +"glGetOcclusionQueryuiv\0" +"glGetOcclusionQueryuivNV\0" +"glGetPixelMapfv\0" +"glGetPixelMapuiv\0" +"glGetPixelMapusv\0" +"glGetPixelTexGenParameterfvSGIS\0" +"glGetPixelTexGenParameterivSGIS\0" +"glGetPixelTransformParameterfvEXT\0" +"glGetPixelTransformParameterivEXT\0" +"glGetPointerv\0" +"glGetPointervEXT\0" +"glGetPolygonStipple\0" +"glGetProgramEnvParameterdvARB\0" +"glGetProgramEnvParameterfvARB\0" +"glGetProgramEnvParameterIivNV\0" +"glGetProgramEnvParameterIuivNV\0" +"glGetProgramInfoLog\0" +"glGetProgramiv\0" +"glGetProgramivARB\0" +"glGetProgramivNV\0" +"glGetProgramLocalParameterdvARB\0" +"glGetProgramLocalParameterfvARB\0" +"glGetProgramLocalParameterIivNV\0" +"glGetProgramLocalParameterIuivNV\0" +"glGetProgramNamedParameterdvNV\0" +"glGetProgramNamedParameterfvNV\0" +"glGetProgramParameterdvNV\0" +"glGetProgramParameterfvNV\0" +"glGetProgramRegisterfvMESA\0" +"glGetProgramStringARB\0" +"glGetProgramStringNV\0" +"glGetQueryiv\0" +"glGetQueryivARB\0" +"glGetQueryObjecti64vEXT\0" +"glGetQueryObjectiv\0" +"glGetQueryObjectivARB\0" +"glGetQueryObjectui64vEXT\0" +"glGetQueryObjectuiv\0" +"glGetQueryObjectuivARB\0" +"glGetRenderbufferParameterivEXT\0" +"glGetSeparableFilter\0" +"glGetSeparableFilterEXT\0" +"glGetShaderInfoLog\0" +"glGetShaderiv\0" +"glGetShaderSource\0" +"glGetShaderSourceARB\0" +"glGetSharpenTexFuncSGIS\0" +"glGetString\0" +"glGetTexBumpParameterfvATI\0" +"glGetTexBumpParameterivATI\0" +"glGetTexEnvfv\0" +"glGetTexEnviv\0" +"glGetTexFilterFuncSGIS\0" +"glGetTexGendv\0" +"glGetTexGenfv\0" +"glGetTexGeniv\0" +"glGetTexImage\0" +"glGetTexLevelParameterfv\0" +"glGetTexLevelParameteriv\0" +"glGetTexParameterfv\0" +"glGetTexParameterIivEXT\0" +"glGetTexParameterIuivEXT\0" +"glGetTexParameteriv\0" +"glGetTexParameterPointervAPPLE\0" +"glGetTrackMatrixivNV\0" +"glGetTransformFeedbackVaryingNV\0" +"glGetUniformBufferSizeEXT\0" +"glGetUniformfv\0" +"glGetUniformfvARB\0" +"glGetUniformiv\0" +"glGetUniformivARB\0" +"glGetUniformLocation\0" +"glGetUniformLocationARB\0" +"glGetUniformOffsetEXT\0" +"glGetUniformuivEXT\0" +"glGetVariantArrayObjectfvATI\0" +"glGetVariantArrayObjectivATI\0" +"glGetVariantBooleanvEXT\0" +"glGetVariantFloatvEXT\0" +"glGetVariantIntegervEXT\0" +"glGetVariantPointervEXT\0" +"glGetVaryingLocationNV\0" +"glGetVertexAttribArrayObjectfvATI\0" +"glGetVertexAttribArrayObjectivATI\0" +"glGetVertexAttribdv\0" +"glGetVertexAttribdvARB\0" +"glGetVertexAttribdvNV\0" +"glGetVertexAttribfv\0" +"glGetVertexAttribfvARB\0" +"glGetVertexAttribfvNV\0" +"glGetVertexAttribIivEXT\0" +"glGetVertexAttribIuivEXT\0" +"glGetVertexAttribiv\0" +"glGetVertexAttribivARB\0" +"glGetVertexAttribivNV\0" +"glGetVertexAttribPointerv\0" +"glGetVertexAttribPointervARB\0" +"glGetVertexAttribPointervNV\0" +"glGlobalAlphaFactorbSUN\0" +"glGlobalAlphaFactordSUN\0" +"glGlobalAlphaFactorfSUN\0" +"glGlobalAlphaFactoriSUN\0" +"glGlobalAlphaFactorsSUN\0" +"glGlobalAlphaFactorubSUN\0" +"glGlobalAlphaFactoruiSUN\0" +"glGlobalAlphaFactorusSUN\0" +"glHint\0" +"glHintPGI\0" +"glHistogram\0" +"glHistogramEXT\0" +"glIglooInterfaceSGIX\0" +"glImageTransformParameterfHP\0" +"glImageTransformParameterfvHP\0" +"glImageTransformParameteriHP\0" +"glImageTransformParameterivHP\0" +"glIndexd\0" +"glIndexdv\0" +"glIndexf\0" +"glIndexFuncEXT\0" +"glIndexfv\0" +"glIndexi\0" +"glIndexiv\0" +"glIndexMask\0" +"glIndexMaterialEXT\0" +"glIndexPointer\0" +"glIndexPointerEXT\0" +"glIndexPointerListIBM\0" +"glIndexs\0" +"glIndexsv\0" +"glIndexub\0" +"glIndexubv\0" +"glInitNames\0" +"glInsertComponentEXT\0" +"glInstrumentsBufferSGIX\0" +"glInterleavedArrays\0" +"glIsArraySetARB\0" +"glIsAsyncMarkerSGIX\0" +"glIsBuffer\0" +"glIsBufferARB\0" +"glIsEnabled\0" +"glIsEnabledIndexedEXT\0" +"glIsFenceAPPLE\0" +"glIsFenceNV\0" +"glIsFramebufferEXT\0" +"glIsList\0" +"glIsObjectBufferATI\0" +"glIsOcclusionQuery\0" +"_glIsOcclusionQueryNV\0" +"glIsOcclusionQueryNV\0" +"glIsProgram\0" +"glIsProgramARB\0" +"glIsProgramNV\0" +"glIsQuery\0" +"glIsQueryARB\0" +"glIsRenderbufferEXT\0" +"glIsShader\0" +"glIsTexture\0" +"glIsTextureEXT\0" +"glIsVariantEnabledEXT\0" +"glIsVertexArrayAPPLE\0" +"glIsVertexAttribEnabledAPPLE\0" +"glLightEnviEXT\0" +"glLightEnviSGIX\0" +"glLightf\0" +"glLightfv\0" +"glLighti\0" +"glLightiv\0" +"glLightModelf\0" +"glLightModelfv\0" +"glLightModeli\0" +"glLightModeliv\0" +"glLineStipple\0" +"glLineWidth\0" +"glLinkProgram\0" +"glLinkProgramARB\0" +"glListBase\0" +"glListParameterfSGIX\0" +"glListParameterfvSGIX\0" +"glListParameteriSGIX\0" +"glListParameterivSGIX\0" +"glLoadIdentity\0" +"glLoadIdentityDeformationMapSGIX\0" +"glLoadMatrixd\0" +"glLoadMatrixf\0" +"glLoadName\0" +"glLoadProgramNV\0" +"glLoadTransposeMatrixd\0" +"glLoadTransposeMatrixdARB\0" +"glLoadTransposeMatrixf\0" +"glLoadTransposeMatrixfARB\0" +"glLockArraysEXT\0" +"glLogicOp\0" +"glMap1d\0" +"glMap1f\0" +"glMap2d\0" +"glMap2f\0" +"glMapBuffer\0" +"glMapBufferARB\0" +"glMapControlPointsNV\0" +"glMapGrid1d\0" +"glMapGrid1f\0" +"glMapGrid2d\0" +"glMapGrid2f\0" +"glMapObjectBufferATI\0" +"glMapParameterfvNV\0" +"glMapParameterivNV\0" +"glMapTexture3DATI\0" +"glMapVertexAttrib1dAPPLE\0" +"glMapVertexAttrib1fAPPLE\0" +"glMapVertexAttrib2dAPPLE\0" +"glMapVertexAttrib2fAPPLE\0" +"glMaterialf\0" +"glMaterialfv\0" +"glMateriali\0" +"glMaterialiv\0" +"glMatrixIndexPointerARB\0" +"glMatrixIndexubvARB\0" +"glMatrixIndexuivARB\0" +"glMatrixIndexusvARB\0" +"glMatrixMode\0" +"glMinmax\0" +"glMinmaxEXT\0" +"glMultiDrawArrays\0" +"glMultiDrawArraysEXT\0" +"glMultiDrawElementArrayAPPLE\0" +"glMultiDrawElements\0" +"glMultiDrawElementsEXT\0" +"glMultiDrawRangeElementArrayAPPLE\0" +"glMultiModeDrawArraysIBM\0" +"glMultiModeDrawElementsIBM\0" +"glMultiTexCoord1d\0" +"glMultiTexCoord1dARB\0" +"glMultiTexCoord1dSGIS\0" +"glMultiTexCoord1dv\0" +"glMultiTexCoord1dvARB\0" +"glMultiTexCoord1dvSGIS\0" +"glMultiTexCoord1f\0" +"glMultiTexCoord1fARB\0" +"glMultiTexCoord1fSGIS\0" +"glMultiTexCoord1fv\0" +"glMultiTexCoord1fvARB\0" +"glMultiTexCoord1fvSGIS\0" +"glMultiTexCoord1hNV\0" +"glMultiTexCoord1hvNV\0" +"glMultiTexCoord1i\0" +"glMultiTexCoord1iARB\0" +"glMultiTexCoord1iSGIS\0" +"glMultiTexCoord1iv\0" +"glMultiTexCoord1ivARB\0" +"glMultiTexCoord1ivSGIS\0" +"glMultiTexCoord1s\0" +"glMultiTexCoord1sARB\0" +"glMultiTexCoord1sSGIS\0" +"glMultiTexCoord1sv\0" +"glMultiTexCoord1svARB\0" +"glMultiTexCoord1svSGIS\0" +"glMultiTexCoord2d\0" +"glMultiTexCoord2dARB\0" +"glMultiTexCoord2dSGIS\0" +"glMultiTexCoord2dv\0" +"glMultiTexCoord2dvARB\0" +"glMultiTexCoord2dvSGIS\0" +"glMultiTexCoord2f\0" +"glMultiTexCoord2fARB\0" +"glMultiTexCoord2fSGIS\0" +"glMultiTexCoord2fv\0" +"glMultiTexCoord2fvARB\0" +"glMultiTexCoord2fvSGIS\0" +"glMultiTexCoord2hNV\0" +"glMultiTexCoord2hvNV\0" +"glMultiTexCoord2i\0" +"glMultiTexCoord2iARB\0" +"glMultiTexCoord2iSGIS\0" +"glMultiTexCoord2iv\0" +"glMultiTexCoord2ivARB\0" +"glMultiTexCoord2ivSGIS\0" +"glMultiTexCoord2s\0" +"glMultiTexCoord2sARB\0" +"glMultiTexCoord2sSGIS\0" +"glMultiTexCoord2sv\0" +"glMultiTexCoord2svARB\0" +"glMultiTexCoord2svSGIS\0" +"glMultiTexCoord3d\0" +"glMultiTexCoord3dARB\0" +"glMultiTexCoord3dSGIS\0" +"glMultiTexCoord3dv\0" +"glMultiTexCoord3dvARB\0" +"glMultiTexCoord3dvSGIS\0" +"glMultiTexCoord3f\0" +"glMultiTexCoord3fARB\0" +"glMultiTexCoord3fSGIS\0" +"glMultiTexCoord3fv\0" +"glMultiTexCoord3fvARB\0" +"glMultiTexCoord3fvSGIS\0" +"glMultiTexCoord3hNV\0" +"glMultiTexCoord3hvNV\0" +"glMultiTexCoord3i\0" +"glMultiTexCoord3iARB\0" +"glMultiTexCoord3iSGIS\0" +"glMultiTexCoord3iv\0" +"glMultiTexCoord3ivARB\0" +"glMultiTexCoord3ivSGIS\0" +"glMultiTexCoord3s\0" +"glMultiTexCoord3sARB\0" +"glMultiTexCoord3sSGIS\0" +"glMultiTexCoord3sv\0" +"glMultiTexCoord3svARB\0" +"glMultiTexCoord3svSGIS\0" +"glMultiTexCoord4d\0" +"glMultiTexCoord4dARB\0" +"glMultiTexCoord4dSGIS\0" +"glMultiTexCoord4dv\0" +"glMultiTexCoord4dvARB\0" +"glMultiTexCoord4dvSGIS\0" +"glMultiTexCoord4f\0" +"glMultiTexCoord4fARB\0" +"glMultiTexCoord4fSGIS\0" +"glMultiTexCoord4fv\0" +"glMultiTexCoord4fvARB\0" +"glMultiTexCoord4fvSGIS\0" +"glMultiTexCoord4hNV\0" +"glMultiTexCoord4hvNV\0" +"glMultiTexCoord4i\0" +"glMultiTexCoord4iARB\0" +"glMultiTexCoord4iSGIS\0" +"glMultiTexCoord4iv\0" +"glMultiTexCoord4ivARB\0" +"glMultiTexCoord4ivSGIS\0" +"glMultiTexCoord4s\0" +"glMultiTexCoord4sARB\0" +"glMultiTexCoord4sSGIS\0" +"glMultiTexCoord4sv\0" +"glMultiTexCoord4svARB\0" +"glMultiTexCoord4svSGIS\0" +"glMultiTexCoordPointerSGIS\0" +"glMultMatrixd\0" +"glMultMatrixf\0" +"glMultTransposeMatrixd\0" +"glMultTransposeMatrixdARB\0" +"glMultTransposeMatrixf\0" +"glMultTransposeMatrixfARB\0" +"glNewBufferRegion\0" +"glNewBufferRegionEXT\0" +"glNewList\0" +"glNewObjectBufferATI\0" +"glNormal3b\0" +"glNormal3bv\0" +"glNormal3d\0" +"glNormal3dv\0" +"glNormal3f\0" +"glNormal3fv\0" +"glNormal3fVertex3fSUN\0" +"glNormal3fVertex3fvSUN\0" +"glNormal3hNV\0" +"glNormal3hvNV\0" +"glNormal3i\0" +"glNormal3iv\0" +"glNormal3s\0" +"glNormal3sv\0" +"glNormalPointer\0" +"glNormalPointerEXT\0" +"glNormalPointerListIBM\0" +"glNormalPointervINTEL\0" +"glNormalStream3bATI\0" +"glNormalStream3bvATI\0" +"glNormalStream3dATI\0" +"glNormalStream3dvATI\0" +"glNormalStream3fATI\0" +"glNormalStream3fvATI\0" +"glNormalStream3iATI\0" +"glNormalStream3ivATI\0" +"glNormalStream3sATI\0" +"glNormalStream3svATI\0" +"glOrtho\0" +"glPassTexCoordATI\0" +"glPassThrough\0" +"glPixelDataRangeNV\0" +"glPixelMapfv\0" +"glPixelMapuiv\0" +"glPixelMapusv\0" +"glPixelStoref\0" +"glPixelStorei\0" +"glPixelTexGenParameterfSGIS\0" +"glPixelTexGenParameterfvSGIS\0" +"glPixelTexGenParameteriSGIS\0" +"glPixelTexGenParameterivSGIS\0" +"glPixelTexGenSGIX\0" +"glPixelTransferf\0" +"glPixelTransferi\0" +"glPixelTransformParameterfEXT\0" +"glPixelTransformParameterfvEXT\0" +"glPixelTransformParameteriEXT\0" +"glPixelTransformParameterivEXT\0" +"glPixelZoom\0" +"glPNTrianglesfATI\0" +"glPNTrianglesiATI\0" +"glPointParameterf\0" +"glPointParameterfARB\0" +"glPointParameterfEXT\0" +"glPointParameterfSGIS\0" +"glPointParameterfv\0" +"glPointParameterfvARB\0" +"glPointParameterfvEXT\0" +"glPointParameterfvSGIS\0" +"glPointParameteri\0" +"glPointParameteriEXT\0" +"glPointParameteriNV\0" +"glPointParameteriv\0" +"glPointParameterivEXT\0" +"glPointParameterivNV\0" +"glPointSize\0" +"glPollAsyncSGIX\0" +"glPollInstrumentsSGIX\0" +"glPolygonMode\0" +"glPolygonOffset\0" +"glPolygonOffsetEXT\0" +"glPolygonStipple\0" +"glPopAttrib\0" +"glPopClientAttrib\0" +"glPopMatrix\0" +"glPopName\0" +"glPrimitiveRestartIndexNV\0" +"glPrimitiveRestartNV\0" +"glPrioritizeTextures\0" +"glPrioritizeTexturesEXT\0" +"glProgramBufferParametersfvNV\0" +"glProgramBufferParametersIivNV\0" +"glProgramBufferParametersIuivNV\0" +"glProgramCallbackMESA\0" +"glProgramEnvParameter4dARB\0" +"glProgramEnvParameter4dvARB\0" +"glProgramEnvParameter4fARB\0" +"glProgramEnvParameter4fvARB\0" +"glProgramEnvParameterI4iNV\0" +"glProgramEnvParameterI4ivNV\0" +"glProgramEnvParameterI4uiNV\0" +"glProgramEnvParameterI4uivNV\0" +"glProgramEnvParameters4fvEXT\0" +"glProgramEnvParametersI4ivNV\0" +"glProgramEnvParametersI4uivNV\0" +"glProgramLocalParameter4dARB\0" +"glProgramLocalParameter4dvARB\0" +"glProgramLocalParameter4fARB\0" +"glProgramLocalParameter4fvARB\0" +"glProgramLocalParameterI4iNV\0" +"glProgramLocalParameterI4ivNV\0" +"glProgramLocalParameterI4uiNV\0" +"glProgramLocalParameterI4uivNV\0" +"glProgramLocalParameters4fvEXT\0" +"glProgramLocalParametersI4ivNV\0" +"glProgramLocalParametersI4uivNV\0" +"glProgramNamedParameter4dNV\0" +"glProgramNamedParameter4dvNV\0" +"glProgramNamedParameter4fNV\0" +"glProgramNamedParameter4fvNV\0" +"glProgramParameter4dNV\0" +"glProgramParameter4dvNV\0" +"glProgramParameter4fNV\0" +"glProgramParameter4fvNV\0" +"glProgramParameteriEXT\0" +"glProgramParameters4dvNV\0" +"glProgramParameters4fvNV\0" +"glProgramStringARB\0" +"glProgramVertexLimitNV\0" +"glPushAttrib\0" +"glPushClientAttrib\0" +"glPushMatrix\0" +"glPushName\0" +"glRasterPos2d\0" +"glRasterPos2dv\0" +"glRasterPos2f\0" +"glRasterPos2fv\0" +"glRasterPos2i\0" +"glRasterPos2iv\0" +"glRasterPos2s\0" +"glRasterPos2sv\0" +"glRasterPos3d\0" +"glRasterPos3dv\0" +"glRasterPos3f\0" +"glRasterPos3fv\0" +"glRasterPos3i\0" +"glRasterPos3iv\0" +"glRasterPos3s\0" +"glRasterPos3sv\0" +"glRasterPos4d\0" +"glRasterPos4dv\0" +"glRasterPos4f\0" +"glRasterPos4fv\0" +"glRasterPos4i\0" +"glRasterPos4iv\0" +"glRasterPos4s\0" +"glRasterPos4sv\0" +"glReadBuffer\0" +"glReadBufferRegion\0" +"glReadBufferRegionEXT\0" +"glReadInstrumentsSGIX\0" +"glReadPixels\0" +"glReadVideoPixelsSUN\0" +"glRectd\0" +"glRectdv\0" +"glRectf\0" +"glRectfv\0" +"glRecti\0" +"glRectiv\0" +"glRects\0" +"glRectsv\0" +"glReferencePlaneSGIX\0" +"glRenderbufferStorageEXT\0" +"glRenderbufferStorageMultisampleCoverageNV\0" +"glRenderbufferStorageMultisampleEXT\0" +"glRenderMode\0" +"glReplacementCodePointerSUN\0" +"glReplacementCodeubSUN\0" +"glReplacementCodeubvSUN\0" +"glReplacementCodeuiColor3fVertex3fSUN\0" +"glReplacementCodeuiColor3fVertex3fvSUN\0" +"glReplacementCodeuiColor4fNormal3fVertex3fSUN\0" +"glReplacementCodeuiColor4fNormal3fVertex3fvSUN\0" +"glReplacementCodeuiColor4ubVertex3fSUN\0" +"glReplacementCodeuiColor4ubVertex3fvSUN\0" +"glReplacementCodeuiNormal3fVertex3fSUN\0" +"glReplacementCodeuiNormal3fVertex3fvSUN\0" +"glReplacementCodeuiSUN\0" +"glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN\0" +"glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN\0" +"glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN\0" +"glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN\0" +"glReplacementCodeuiTexCoord2fVertex3fSUN\0" +"glReplacementCodeuiTexCoord2fVertex3fvSUN\0" +"glReplacementCodeuiVertex3fSUN\0" +"glReplacementCodeuiVertex3fvSUN\0" +"glReplacementCodeuivSUN\0" +"glReplacementCodeusSUN\0" +"glReplacementCodeusvSUN\0" +"glRequestResidentProgramsNV\0" +"glResetHistogram\0" +"glResetHistogramEXT\0" +"glResetMinmax\0" +"glResetMinmaxEXT\0" +"glResizeBuffersMESA\0" +"glRotated\0" +"glRotatef\0" +"glSampleCoverage\0" +"glSampleCoverageARB\0" +"glSampleMapATI\0" +"glSampleMaskEXT\0" +"glSampleMaskSGIS\0" +"glSamplePassARB\0" +"glSamplePatternEXT\0" +"glSamplePatternSGIS\0" +"glScaled\0" +"glScalef\0" +"glScissor\0" +"glSecondaryColor3b\0" +"glSecondaryColor3bEXT\0" +"glSecondaryColor3bv\0" +"glSecondaryColor3bvEXT\0" +"glSecondaryColor3d\0" +"glSecondaryColor3dEXT\0" +"glSecondaryColor3dv\0" +"glSecondaryColor3dvEXT\0" +"glSecondaryColor3f\0" +"glSecondaryColor3fEXT\0" +"glSecondaryColor3fv\0" +"glSecondaryColor3fvEXT\0" +"glSecondaryColor3hNV\0" +"glSecondaryColor3hvNV\0" +"glSecondaryColor3i\0" +"glSecondaryColor3iEXT\0" +"glSecondaryColor3iv\0" +"glSecondaryColor3ivEXT\0" +"glSecondaryColor3s\0" +"glSecondaryColor3sEXT\0" +"glSecondaryColor3sv\0" +"glSecondaryColor3svEXT\0" +"glSecondaryColor3ub\0" +"glSecondaryColor3ubEXT\0" +"glSecondaryColor3ubv\0" +"glSecondaryColor3ubvEXT\0" +"glSecondaryColor3ui\0" +"glSecondaryColor3uiEXT\0" +"glSecondaryColor3uiv\0" +"glSecondaryColor3uivEXT\0" +"glSecondaryColor3us\0" +"glSecondaryColor3usEXT\0" +"glSecondaryColor3usv\0" +"glSecondaryColor3usvEXT\0" +"glSecondaryColorPointer\0" +"glSecondaryColorPointerEXT\0" +"glSecondaryColorPointerListIBM\0" +"glSelectBuffer\0" +"glSelectTextureCoordSetSGIS\0" +"glSelectTextureSGIS\0" +"glSelectTextureTransformSGIS\0" +"glSeparableFilter2D\0" +"glSeparableFilter2DEXT\0" +"glSetFenceAPPLE\0" +"glSetFenceNV\0" +"glSetFragmentShaderConstantATI\0" +"glSetInvariantEXT\0" +"glSetLocalConstantEXT\0" +"glShadeModel\0" +"glShaderOp1EXT\0" +"glShaderOp2EXT\0" +"glShaderOp3EXT\0" +"glShaderSource\0" +"glShaderSourceARB\0" +"glSharpenTexFuncSGIS\0" +"glSpriteParameterfSGIX\0" +"glSpriteParameterfvSGIX\0" +"glSpriteParameteriSGIX\0" +"glSpriteParameterivSGIX\0" +"glStartInstrumentsSGIX\0" +"glStencilClearTagEXT\0" +"glStencilFunc\0" +"glStencilFuncSeparate\0" +"glStencilFuncSeparateATI\0" +"glStencilMask\0" +"glStencilMaskSeparate\0" +"glStencilOp\0" +"glStencilOpSeparate\0" +"glStencilOpSeparateATI\0" +"glStopInstrumentsSGIX\0" +"glStringMarkerGREMEDY\0" +"glSwapAPPLE\0" +"glSwizzleEXT\0" +"glTagSampleBufferSGIX\0" +"glTangent3bEXT\0" +"glTangent3bvEXT\0" +"glTangent3dEXT\0" +"glTangent3dvEXT\0" +"glTangent3fEXT\0" +"glTangent3fvEXT\0" +"glTangent3iEXT\0" +"glTangent3ivEXT\0" +"glTangent3sEXT\0" +"glTangent3svEXT\0" +"glTangentPointerEXT\0" +"glTbufferMask3DFX\0" +"glTestFenceAPPLE\0" +"glTestFenceNV\0" +"glTestObjectAPPLE\0" +"glTexBufferEXT\0" +"glTexBumpParameterfvATI\0" +"glTexBumpParameterivATI\0" +"glTexCoord1d\0" +"glTexCoord1dv\0" +"glTexCoord1f\0" +"glTexCoord1fv\0" +"glTexCoord1hNV\0" +"glTexCoord1hvNV\0" +"glTexCoord1i\0" +"glTexCoord1iv\0" +"glTexCoord1s\0" +"glTexCoord1sv\0" +"glTexCoord2d\0" +"glTexCoord2dv\0" +"glTexCoord2f\0" +"glTexCoord2fColor3fVertex3fSUN\0" +"glTexCoord2fColor3fVertex3fvSUN\0" +"glTexCoord2fColor4fNormal3fVertex3fSUN\0" +"glTexCoord2fColor4fNormal3fVertex3fvSUN\0" +"glTexCoord2fColor4ubVertex3fSUN\0" +"glTexCoord2fColor4ubVertex3fvSUN\0" +"glTexCoord2fNormal3fVertex3fSUN\0" +"glTexCoord2fNormal3fVertex3fvSUN\0" +"glTexCoord2fv\0" +"glTexCoord2fVertex3fSUN\0" +"glTexCoord2fVertex3fvSUN\0" +"glTexCoord2hNV\0" +"glTexCoord2hvNV\0" +"glTexCoord2i\0" +"glTexCoord2iv\0" +"glTexCoord2s\0" +"glTexCoord2sv\0" +"glTexCoord3d\0" +"glTexCoord3dv\0" +"glTexCoord3f\0" +"glTexCoord3fv\0" +"glTexCoord3hNV\0" +"glTexCoord3hvNV\0" +"glTexCoord3i\0" +"glTexCoord3iv\0" +"glTexCoord3s\0" +"glTexCoord3sv\0" +"glTexCoord4d\0" +"glTexCoord4dv\0" +"glTexCoord4f\0" +"glTexCoord4fColor4fNormal3fVertex4fSUN\0" +"glTexCoord4fColor4fNormal3fVertex4fvSUN\0" +"glTexCoord4fv\0" +"glTexCoord4fVertex4fSUN\0" +"glTexCoord4fVertex4fvSUN\0" +"glTexCoord4hNV\0" +"glTexCoord4hvNV\0" +"glTexCoord4i\0" +"glTexCoord4iv\0" +"glTexCoord4s\0" +"glTexCoord4sv\0" +"glTexCoordPointer\0" +"glTexCoordPointerEXT\0" +"glTexCoordPointerListIBM\0" +"glTexCoordPointervINTEL\0" +"glTexEnvf\0" +"glTexEnvfv\0" +"glTexEnvi\0" +"glTexEnviv\0" +"glTexFilterFuncSGIS\0" +"glTexGend\0" +"glTexGendv\0" +"glTexGenf\0" +"glTexGenfv\0" +"glTexGeni\0" +"glTexGeniv\0" +"glTexImage1D\0" +"glTexImage2D\0" +"glTexImage3D\0" +"glTexImage3DEXT\0" +"glTexImage4DSGIS\0" +"glTexParameterf\0" +"glTexParameterfv\0" +"glTexParameteri\0" +"glTexParameterIivEXT\0" +"glTexParameterIuivEXT\0" +"glTexParameteriv\0" +"glTexScissorFuncINTEL\0" +"glTexScissorINTEL\0" +"glTexSubImage1D\0" +"glTexSubImage1DEXT\0" +"glTexSubImage2D\0" +"glTexSubImage2DEXT\0" +"glTexSubImage3D\0" +"glTexSubImage3DEXT\0" +"glTexSubImage4DSGIS\0" +"glTextureColorMaskSGIS\0" +"glTextureFogSGIX\0" +"glTextureLightEXT\0" +"glTextureMaterialEXT\0" +"glTextureNormalEXT\0" +"glTextureRangeAPPLE\0" +//"glEGLImageTargetTexture2DOES\n" +"glTrackMatrixNV\0" +"glTransformFeedbackAttribsNV\0" +"glTransformFeedbackVaryingsNV\0" +"glTranslated\0" +"glTranslatef\0" +"glUniform1f\0" +"glUniform1fARB\0" +"glUniform1fv\0" +"glUniform1fvARB\0" +"glUniform1i\0" +"glUniform1iARB\0" +"glUniform1iv\0" +"glUniform1ivARB\0" +"glUniform1uiEXT\0" +"glUniform1uivEXT\0" +"glUniform2f\0" +"glUniform2fARB\0" +"glUniform2fv\0" +"glUniform2fvARB\0" +"glUniform2i\0" +"glUniform2iARB\0" +"glUniform2iv\0" +"glUniform2ivARB\0" +"glUniform2uiEXT\0" +"glUniform2uivEXT\0" +"glUniform3f\0" +"glUniform3fARB\0" +"glUniform3fv\0" +"glUniform3fvARB\0" +"glUniform3i\0" +"glUniform3iARB\0" +"glUniform3iv\0" +"glUniform3ivARB\0" +"glUniform3uiEXT\0" +"glUniform3uivEXT\0" +"glUniform4f\0" +"glUniform4fARB\0" +"glUniform4fv\0" +"glUniform4fvARB\0" +"glUniform4i\0" +"glUniform4iARB\0" +"glUniform4iv\0" +"glUniform4ivARB\0" +"glUniform4uiEXT\0" +"glUniform4uivEXT\0" +"glUniformBufferEXT\0" +"glUniformMatrix2fv\0" +"glUniformMatrix2fvARB\0" +"glUniformMatrix2x3fv\0" +"glUniformMatrix2x4fv\0" +"glUniformMatrix3fv\0" +"glUniformMatrix3fvARB\0" +"glUniformMatrix3x2fv\0" +"glUniformMatrix3x4fv\0" +"glUniformMatrix4fv\0" +"glUniformMatrix4fvARB\0" +"glUniformMatrix4x2fv\0" +"glUniformMatrix4x3fv\0" +"glUnlockArraysEXT\0" +"glUnmapBuffer\0" +"glUnmapBufferARB\0" +"glUnmapObjectBufferATI\0" +"glUnmapTexture3DATI\0" +"glUpdateObjectBufferATI\0" +"glUseProgram\0" +"glUseProgramObjectARB\0" +"glValidateProgram\0" +"glValidateProgramARB\0" +"glValidBackBufferHintAutodesk\0" +"glVariantArrayObjectATI\0" +"glVariantbvEXT\0" +"glVariantdvEXT\0" +"glVariantfvEXT\0" +"glVariantivEXT\0" +"glVariantPointerEXT\0" +"glVariantsvEXT\0" +"glVariantubvEXT\0" +"glVariantuivEXT\0" +"glVariantusvEXT\0" +"glVertex2d\0" +"glVertex2dv\0" +"glVertex2f\0" +"glVertex2fv\0" +"glVertex2hNV\0" +"glVertex2hvNV\0" +"glVertex2i\0" +"glVertex2iv\0" +"glVertex2s\0" +"glVertex2sv\0" +"glVertex3d\0" +"glVertex3dv\0" +"glVertex3f\0" +"glVertex3fv\0" +"glVertex3hNV\0" +"glVertex3hvNV\0" +"glVertex3i\0" +"glVertex3iv\0" +"glVertex3s\0" +"glVertex3sv\0" +"glVertex4d\0" +"glVertex4dv\0" +"glVertex4f\0" +"glVertex4fv\0" +"glVertex4hNV\0" +"glVertex4hvNV\0" +"glVertex4i\0" +"glVertex4iv\0" +"glVertex4s\0" +"glVertex4sv\0" +"glVertexArrayParameteriAPPLE\0" +"glVertexArrayRangeAPPLE\0" +"glVertexArrayRangeNV\0" +"glVertexAttrib1d\0" +"glVertexAttrib1dARB\0" +"glVertexAttrib1dNV\0" +"glVertexAttrib1dv\0" +"glVertexAttrib1dvARB\0" +"glVertexAttrib1dvNV\0" +"glVertexAttrib1f\0" +"glVertexAttrib1fARB\0" +"glVertexAttrib1fNV\0" +"glVertexAttrib1fv\0" +"glVertexAttrib1fvARB\0" +"glVertexAttrib1fvNV\0" +"glVertexAttrib1hNV\0" +"glVertexAttrib1hvNV\0" +"glVertexAttrib1s\0" +"glVertexAttrib1sARB\0" +"glVertexAttrib1sNV\0" +"glVertexAttrib1sv\0" +"glVertexAttrib1svARB\0" +"glVertexAttrib1svNV\0" +"glVertexAttrib2d\0" +"glVertexAttrib2dARB\0" +"glVertexAttrib2dNV\0" +"glVertexAttrib2dv\0" +"glVertexAttrib2dvARB\0" +"glVertexAttrib2dvNV\0" +"glVertexAttrib2f\0" +"glVertexAttrib2fARB\0" +"glVertexAttrib2fNV\0" +"glVertexAttrib2fv\0" +"glVertexAttrib2fvARB\0" +"glVertexAttrib2fvNV\0" +"glVertexAttrib2hNV\0" +"glVertexAttrib2hvNV\0" +"glVertexAttrib2s\0" +"glVertexAttrib2sARB\0" +"glVertexAttrib2sNV\0" +"glVertexAttrib2sv\0" +"glVertexAttrib2svARB\0" +"glVertexAttrib2svNV\0" +"glVertexAttrib3d\0" +"glVertexAttrib3dARB\0" +"glVertexAttrib3dNV\0" +"glVertexAttrib3dv\0" +"glVertexAttrib3dvARB\0" +"glVertexAttrib3dvNV\0" +"glVertexAttrib3f\0" +"glVertexAttrib3fARB\0" +"glVertexAttrib3fNV\0" +"glVertexAttrib3fv\0" +"glVertexAttrib3fvARB\0" +"glVertexAttrib3fvNV\0" +"glVertexAttrib3hNV\0" +"glVertexAttrib3hvNV\0" +"glVertexAttrib3s\0" +"glVertexAttrib3sARB\0" +"glVertexAttrib3sNV\0" +"glVertexAttrib3sv\0" +"glVertexAttrib3svARB\0" +"glVertexAttrib3svNV\0" +"glVertexAttrib4bv\0" +"glVertexAttrib4bvARB\0" +"glVertexAttrib4d\0" +"glVertexAttrib4dARB\0" +"glVertexAttrib4dNV\0" +"glVertexAttrib4dv\0" +"glVertexAttrib4dvARB\0" +"glVertexAttrib4dvNV\0" +"glVertexAttrib4f\0" +"glVertexAttrib4fARB\0" +"glVertexAttrib4fNV\0" +"glVertexAttrib4fv\0" +"glVertexAttrib4fvARB\0" +"glVertexAttrib4fvNV\0" +"glVertexAttrib4hNV\0" +"glVertexAttrib4hvNV\0" +"glVertexAttrib4iv\0" +"glVertexAttrib4ivARB\0" +"glVertexAttrib4Nbv\0" +"glVertexAttrib4NbvARB\0" +"glVertexAttrib4Niv\0" +"glVertexAttrib4NivARB\0" +"glVertexAttrib4Nsv\0" +"glVertexAttrib4NsvARB\0" +"glVertexAttrib4Nub\0" +"glVertexAttrib4NubARB\0" +"glVertexAttrib4Nubv\0" +"glVertexAttrib4NubvARB\0" +"glVertexAttrib4Nuiv\0" +"glVertexAttrib4NuivARB\0" +"glVertexAttrib4Nusv\0" +"glVertexAttrib4NusvARB\0" +"glVertexAttrib4s\0" +"glVertexAttrib4sARB\0" +"glVertexAttrib4sNV\0" +"glVertexAttrib4sv\0" +"glVertexAttrib4svARB\0" +"glVertexAttrib4svNV\0" +"glVertexAttrib4ubNV\0" +"glVertexAttrib4ubv\0" +"glVertexAttrib4ubvARB\0" +"glVertexAttrib4ubvNV\0" +"glVertexAttrib4uiv\0" +"glVertexAttrib4uivARB\0" +"glVertexAttrib4usv\0" +"glVertexAttrib4usvARB\0" +"glVertexAttribArrayObjectATI\0" +"glVertexAttribI1iEXT\0" +"glVertexAttribI1ivEXT\0" +"glVertexAttribI1uiEXT\0" +"glVertexAttribI1uivEXT\0" +"glVertexAttribI2iEXT\0" +"glVertexAttribI2ivEXT\0" +"glVertexAttribI2uiEXT\0" +"glVertexAttribI2uivEXT\0" +"glVertexAttribI3iEXT\0" +"glVertexAttribI3ivEXT\0" +"glVertexAttribI3uiEXT\0" +"glVertexAttribI3uivEXT\0" +"glVertexAttribI4bvEXT\0" +"glVertexAttribI4iEXT\0" +"glVertexAttribI4ivEXT\0" +"glVertexAttribI4svEXT\0" +"glVertexAttribI4ubvEXT\0" +"glVertexAttribI4uiEXT\0" +"glVertexAttribI4uivEXT\0" +"glVertexAttribI4usvEXT\0" +"glVertexAttribIPointerEXT\0" +"glVertexAttribPointer\0" +"glVertexAttribPointerARB\0" +"glVertexAttribPointerNV\0" +"glVertexAttribs1dvNV\0" +"glVertexAttribs1fvNV\0" +"glVertexAttribs1hvNV\0" +"glVertexAttribs1svNV\0" +"glVertexAttribs2dvNV\0" +"glVertexAttribs2fvNV\0" +"glVertexAttribs2hvNV\0" +"glVertexAttribs2svNV\0" +"glVertexAttribs3dvNV\0" +"glVertexAttribs3fvNV\0" +"glVertexAttribs3hvNV\0" +"glVertexAttribs3svNV\0" +"glVertexAttribs4dvNV\0" +"glVertexAttribs4fvNV\0" +"glVertexAttribs4hvNV\0" +"glVertexAttribs4svNV\0" +"glVertexAttribs4ubvNV\0" +"glVertexBlendARB\0" +"glVertexBlendEnvfATI\0" +"glVertexBlendEnviATI\0" +"glVertexPointer\0" +"glVertexPointerEXT\0" +"glVertexPointerListIBM\0" +"glVertexPointervINTEL\0" +"glVertexStream1dATI\0" +"glVertexStream1dvATI\0" +"glVertexStream1fATI\0" +"glVertexStream1fvATI\0" +"glVertexStream1iATI\0" +"glVertexStream1ivATI\0" +"glVertexStream1sATI\0" +"glVertexStream1svATI\0" +"glVertexStream2dATI\0" +"glVertexStream2dvATI\0" +"glVertexStream2fATI\0" +"glVertexStream2fvATI\0" +"glVertexStream2iATI\0" +"glVertexStream2ivATI\0" +"glVertexStream2sATI\0" +"glVertexStream2svATI\0" +"glVertexStream3dATI\0" +"glVertexStream3dvATI\0" +"glVertexStream3fATI\0" +"glVertexStream3fvATI\0" +"glVertexStream3iATI\0" +"glVertexStream3ivATI\0" +"glVertexStream3sATI\0" +"glVertexStream3svATI\0" +"glVertexStream4dATI\0" +"glVertexStream4dvATI\0" +"glVertexStream4fATI\0" +"glVertexStream4fvATI\0" +"glVertexStream4iATI\0" +"glVertexStream4ivATI\0" +"glVertexStream4sATI\0" +"glVertexStream4svATI\0" +"glVertexWeightfEXT\0" +"glVertexWeightfvEXT\0" +"glVertexWeighthNV\0" +"glVertexWeighthvNV\0" +"glVertexWeightPointerEXT\0" +"glViewport\0" +"glWeightbvARB\0" +"glWeightdvARB\0" +"glWeightfvARB\0" +"glWeightivARB\0" +"glWeightPointerARB\0" +"glWeightsvARB\0" +"glWeightubvARB\0" +"glWeightuivARB\0" +"glWeightusvARB\0" +"glWindowBackBufferHintAutodesk\0" +"glWindowPos2d\0" +"glWindowPos2dARB\0" +"glWindowPos2dMESA\0" +"glWindowPos2dv\0" +"glWindowPos2dvARB\0" +"glWindowPos2dvMESA\0" +"glWindowPos2f\0" +"glWindowPos2fARB\0" +"glWindowPos2fMESA\0" +"glWindowPos2fv\0" +"glWindowPos2fvARB\0" +"glWindowPos2fvMESA\0" +"glWindowPos2i\0" +"glWindowPos2iARB\0" +"glWindowPos2iMESA\0" +"glWindowPos2iv\0" +"glWindowPos2ivARB\0" +"glWindowPos2ivMESA\0" +"glWindowPos2s\0" +"glWindowPos2sARB\0" +"glWindowPos2sMESA\0" +"glWindowPos2sv\0" +"glWindowPos2svARB\0" +"glWindowPos2svMESA\0" +"glWindowPos3d\0" +"glWindowPos3dARB\0" +"glWindowPos3dMESA\0" +"glWindowPos3dv\0" +"glWindowPos3dvARB\0" +"glWindowPos3dvMESA\0" +"glWindowPos3f\0" +"glWindowPos3fARB\0" +"glWindowPos3fMESA\0" +"glWindowPos3fv\0" +"glWindowPos3fvARB\0" +"glWindowPos3fvMESA\0" +"glWindowPos3i\0" +"glWindowPos3iARB\0" +"glWindowPos3iMESA\0" +"glWindowPos3iv\0" +"glWindowPos3ivARB\0" +"glWindowPos3ivMESA\0" +"glWindowPos3s\0" +"glWindowPos3sARB\0" +"glWindowPos3sMESA\0" +"glWindowPos3sv\0" +"glWindowPos3svARB\0" +"glWindowPos3svMESA\0" +"glWindowPos4dMESA\0" +"glWindowPos4dvMESA\0" +"glWindowPos4fMESA\0" +"glWindowPos4fvMESA\0" +"glWindowPos4iMESA\0" +"glWindowPos4ivMESA\0" +"glWindowPos4sMESA\0" +"glWindowPos4svMESA\0" +"glWriteMaskEXT\0" +"glXAllocateMemoryMESA\0" +"glXAllocateMemoryNV\0" +"glXBindChannelToWindowSGIX\0" +"glXBindHyperpipeSGIX\0" +"glXBindSwapBarrierNV\0" +"glXBindSwapBarrierSGIX\0" +"glXBindTexImageEXT\0" +"glXBindVideoImageNV\0" +"glXChannelRectSGIX\0" +"glXChannelRectSyncSGIX\0" +"glXChooseFBConfig\0" +"glXChooseVisual\0" +"glXCopyContext\0" +"glXCopySubBufferMESA\0" +"glXCreateContext\0" +"glXCreateGLXPixmap\0" +"glXCreateGLXPixmapMESA\0" +"glXCreateGLXPixmapWithConfigSGIX\0" +"glXCreateNewContext\0" +"glXCreatePbuffer\0" +"glXCreatePixmap\0" +"glXCreateWindow\0" +"glXCushionSGI\0" +"glXDestroyContext\0" +"glXDestroyGLXPixmap\0" +"glXDestroyHyperpipeConfigSGIX\0" +"glXDestroyPbuffer\0" +"glXDestroyPixmap\0" +"glXDestroyWindow\0" +"glXDrawableAttribARB\0" +"glXDrawableAttribATI\0" +"glXFreeContextEXT\0" +"glXFreeMemoryMESA\0" +"glXFreeMemoryNV\0" +"glXGetAGPOffsetMESA\0" +"glXGetClientString\0" +"glXGetConfig\0" +"glXGetContextIDEXT\0" +"glXGetCurrentContext\0" +"glXGetCurrentDisplay\0" +"glXGetCurrentDisplayEXT\0" +"glXGetCurrentDrawable\0" +"glXGetCurrentReadDrawable\0" +"glXGetCurrentReadDrawableSGI\0" +"glXGetDriverConfig\0" +"glXGetFBConfigAttrib\0" +"glXGetFBConfigFromVisualSGIX\0" +"glXGetFBConfigs\0" +"glXGetMemoryOffsetMESA\0" +"glXGetMscRateOML\0" +"glXGetProcAddress\0" +"glXGetProcAddressARB\0" +"glXGetRefreshRateSGI\0" +"glXGetScreenDriver\0" +"glXGetSelectedEvent\0" +"glXGetSelectedEventSGIX\0" +"glXGetSyncValuesOML\0" +"glXGetTransparentIndexSUN\0" +"glXGetVideoDeviceNV\0" +"glXGetVideoInfoNV\0" +"glXGetVideoResizeSUN\0" +"glXGetVideoSyncSGI\0" +"glXGetVisualFromFBConfig\0" +"glXGetVisualFromFBConfigSGIX\0" +"glXHyperpipeAttribSGIX\0" +"glXHyperpipeConfigSGIX\0" +"glXImportContextEXT\0" +"glXIsDirect\0" +"glXJoinSwapGroupNV\0" +"glXJoinSwapGroupSGIX\0" +"glXMakeContextCurrent\0" +"glXMakeCurrent\0" +"glXMakeCurrentReadSGI\0" +"glXQueryChannelDeltasSGIX\0" +"glXQueryChannelRectSGIX\0" +"glXQueryContext\0" +"glXQueryContextInfoEXT\0" +"glXQueryDrawable\0" +"glXQueryExtension\0" +"glXQueryExtensionsString\0" +"glXQueryFrameCountNV\0" +"glXQueryHyperpipeAttribSGIX\0" +"glXQueryHyperpipeBestAttribSGIX\0" +"glXQueryHyperpipeConfigSGIX\0" +"glXQueryHyperpipeNetworkSGIX\0" +"glXQueryMaxSwapBarriersSGIX\0" +"glXQueryMaxSwapGroupsNV\0" +"glXQueryServerString\0" +"glXQuerySwapGroupNV\0" +"glXQueryVersion\0" +"glXReleaseBuffersMESA\0" +"glXReleaseTexImageEXT\0" +"glXReleaseVideoDeviceNV\0" +"glXReleaseVideoImageNV\0" +"glXResetFrameCountNV\0" +"glXSelectEvent\0" +"glXSelectEventSGIX\0" +"glXSendPbufferToVideoNV\0" +"glXSet3DfxModeMESA\0" +"glXSwapBuffers\0" +"glXSwapBuffersMscOML\0" +"glXSwapIntervalSGI\0" +"glXUseXFont\0" +"glXVideoResizeSUN\0" +"glXWaitForMscOML\0" +"glXWaitForSbcOML\0" +"glXWaitGL\0" +"glXWaitVideoSyncSGI\0" +"glXWaitX\0" +"\0" +}; + +typedef struct +{ + unsigned int hash; + char* name; + __GLXextFuncPtr func; + int found_on_client_side; + int found_on_server_side; + int alreadyAsked; +} AssocProcAdress; + +#ifdef PROVIDE_STUB_IMPLEMENTATION +static void _glStubImplementation() +{ + log_gl("This function is a stub !!!\n"); +} +#endif + +__GLXextFuncPtr glXGetProcAddress_no_lock(const GLubyte * _name) +{ + static int nbElts = 0; + static int tabSize = 0; + static AssocProcAdress* tab_assoc = NULL; + static void* handle = NULL; + __GLXextFuncPtr ret = NULL; + + const char* name = (const char*)_name; + if(debug_gl) log_gl(">>> looking for \"%s\",\n", name); + int i; + + if (name == NULL) + { + goto end_of_glx_get_proc_address; + } + + if (tabSize == 0) + { + tabSize = 2000; + tab_assoc = calloc(tabSize, sizeof(AssocProcAdress)); + + handle = dlopen(getenv("REAL_LIBGL") ? getenv("REAL_LIBGL") : "libGL.so.1" ,RTLD_LAZY); + if (!handle) { + log_gl("%s\n", dlerror()); + exit(1); + } + + { + if(debug_gl) log_gl("global_glXGetProcAddress request\n"); + int sizeOfString = 0; + int nbRequestElts = 0; + int i = 0; + while(1) + { + if (global_glXGetProcAddress_request[i] == '\0') + { + nbRequestElts++; + if (global_glXGetProcAddress_request[i + 1] == '\0') + { + sizeOfString = i + 1; + break; + } + } + i++; + } + if(debug_gl) log_gl("nbRequestElts=%d\n", nbRequestElts); + char* result = (char*)malloc(nbRequestElts); + + long args[] = { INT_TO_ARG(nbRequestElts), POINTER_TO_ARG(global_glXGetProcAddress_request), POINTER_TO_ARG(result) }; + int args_size[] = { 0, sizeOfString, nbRequestElts }; + do_opengl_call_no_lock(glXGetProcAddress_global_fake_func, NULL, CHECK_ARGS(args, args_size)); + int offset = 0; + for(i=0; i<nbRequestElts;i++) + { + const char* funcName = global_glXGetProcAddress_request + offset; + void* func = dlsym(handle, funcName); +#ifdef PROVIDE_STUB_IMPLEMENTATION + if (func == NULL) + func = _glStubImplementation; +#endif + if (result[i] && func == NULL && debug_gl) + log_gl("%s %d %d\n", funcName, result[i], func != NULL); + if (result[i] == 0) + { + if (nbElts < tabSize) + { + int hash = str_hash(funcName); + tab_assoc[nbElts].alreadyAsked = 0; + tab_assoc[nbElts].found_on_server_side = 0; + tab_assoc[nbElts].found_on_client_side = func != NULL; + tab_assoc[nbElts].hash = hash; + tab_assoc[nbElts].name = strdup(funcName); + tab_assoc[nbElts].func = NULL; + nbElts ++; + } + } + else + { + if (nbElts < tabSize) + { + int hash = str_hash(funcName); + tab_assoc[nbElts].alreadyAsked = 0; + tab_assoc[nbElts].found_on_server_side = 1; + tab_assoc[nbElts].found_on_client_side = func != NULL; + tab_assoc[nbElts].hash = hash; + tab_assoc[nbElts].name = strdup(funcName); + tab_assoc[nbElts].func = func; + nbElts ++; + } + } + offset += strlen(funcName) + 1; + } + free(result); + + ret = glXGetProcAddress_no_lock(_name); + goto end_of_glx_get_proc_address; + } + } + + int hash = str_hash(name); + for(i=0;i<nbElts;i++) + { + if (tab_assoc[i].hash == hash && strcmp(tab_assoc[i].name, name) == 0) + { + if (tab_assoc[i].alreadyAsked == 0) + { + tab_assoc[i].alreadyAsked = 1; + if (tab_assoc[i].found_on_server_side == 0 && tab_assoc[i].found_on_client_side == 0) + { + log_gl("not found name on server and client side = %s\n", name); + } + else if (tab_assoc[i].found_on_server_side == 0) + { + log_gl("not found name on server side = %s\n", name); + } + else if (tab_assoc[i].found_on_client_side == 0) + { + log_gl("not found name on client side = %s\n", name); + } + } + ret = (__GLXextFuncPtr)tab_assoc[i].func; + goto end_of_glx_get_proc_address; + } + } + if(1/*debug_gl*/) log_gl("==looking for \"%s\",\n", name); + int ret_call = 0; + long args[] = { INT_TO_ARG(name) }; + do_opengl_call_no_lock(glXGetProcAddress_fake_func, &ret_call, args, NULL); + + + void* func = dlsym(handle, name); +#ifdef PROVIDE_STUB_IMPLEMENTATION + if (func == NULL) + func = _glStubImplementation; +#endif + if (ret_call == 0) + { + if (nbElts < tabSize) + { + tab_assoc[nbElts].alreadyAsked = 1; + tab_assoc[nbElts].found_on_server_side = 0; + tab_assoc[nbElts].found_on_client_side = func != NULL; + tab_assoc[nbElts].hash = hash; + tab_assoc[nbElts].name = strdup(name); + tab_assoc[nbElts].func = NULL; + nbElts ++; + } + if (func == NULL) + { + log_gl("not found name on server and client side = %s\n", name); + } + else + { + log_gl("not found name on server side = %s\n", name); + } + ret = NULL; + goto end_of_glx_get_proc_address; + } + else + { + if (func == NULL) + { + log_gl("not found name on client side = %s\n", name); + } + if (nbElts < tabSize) + { + tab_assoc[nbElts].alreadyAsked = 1; + tab_assoc[nbElts].found_on_server_side = 1; + tab_assoc[nbElts].found_on_client_side = func != NULL; + tab_assoc[nbElts].hash = hash; + tab_assoc[nbElts].name = strdup(name); + tab_assoc[nbElts].func = func; + nbElts ++; + } + ret = func; + goto end_of_glx_get_proc_address; + } +end_of_glx_get_proc_address: + return ret; +} + +__GLXextFuncPtr glXGetProcAddress(const GLubyte * name) +{ + __GLXextFuncPtr ret; + LOCK(glXGetProcAddress_fake_func); + ret = glXGetProcAddress_no_lock(name); + UNLOCK(glXGetProcAddress_fake_func); + return ret; +} + +__GLXextFuncPtr glXGetProcAddressARB (const GLubyte * name) +{ + return glXGetProcAddress(name); +} + diff --git a/libGL/client_glx.h b/libGL/client_glx.h new file mode 100755 index 0000000..d410093 --- /dev/null +++ b/libGL/client_glx.h @@ -0,0 +1,26 @@ +/* + * 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. + */ + +extern Bool glXMakeCurrent_no_lock( Display *dpy, GLXDrawable drawable, GLXContext ctx); +extern void glXSwapBuffers_no_lock( Display *dpy, GLXDrawable drawable ); +extern __GLXextFuncPtr glXGetProcAddress_no_lock(const GLubyte * name); + diff --git a/libGL/common.h b/libGL/common.h new file mode 100755 index 0000000..593283e --- /dev/null +++ b/libGL/common.h @@ -0,0 +1,382 @@ +/* + * Guest-side implementation of GL/GLX API. Replacement of standard libGL.so + * + * 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. + */ + +#ifndef __INCLUDE_COMMON_H + +#include <X11/X.h> +#include <X11/Xutil.h> +#include <X11/extensions/Xfixes.h> +#include <X11/extensions/XShm.h> +#include <sys/ipc.h> +#include <sys/shm.h> + +#include "mesa_glx.h" + +#include "range_alloc.h" + +#define ENABLE_THREAD_SAFETY + +extern int debug_gl; +extern int debug_array_ptr; +extern int disable_optim; + +#define IS_GLX_CALL(x) (x >= glXChooseVisual_func && x <= glXDestroyPixmap_func) + +#define SIZE_BUFFER_COMMAND (1024*64) +//#define MAX_SIZE_BUFFER_COMMAND (1024*1024*10) +#define MAX_SIZE_BUFFER_COMMAND (1024*1024*200) + +#define POINTER_TO_ARG(x) (long)(void*)(x) +#define CHAR_TO_ARG(x) (long)(x) +#define SHORT_TO_ARG(x) (long)(x) +#define INT_TO_ARG(x) (long)(x) +#define UNSIGNED_CHAR_TO_ARG(x) (long)(x) +#define UNSIGNED_SHORT_TO_ARG(x) (long)(x) +#define UNSIGNED_INT_TO_ARG(x) (long)(x) +#define FLOAT_TO_ARG(x) (long)*((int*)(&x)) +#define DOUBLE_TO_ARG(x) (long)(&x) + +#define NOT_IMPLEMENTED(x) log_gl(#x " not implemented !\n") +//#define PROVIDE_STUB_IMPLEMENTATION + +#define CHECK_ARGS(x, y) (1 / ((sizeof(x)/sizeof(x[0])) == (sizeof(y)/sizeof(y[0])) ? 1 : 0)) ? x : x, y + +#define EXT_FUNC(x) x + +#define CONCAT(a, b) a##b +#define DEFINE_EXT(glFunc, paramsDecl, paramsCall) GLAPI void APIENTRY CONCAT(glFunc,EXT) paramsDecl { glFunc paramsCall; } + +#ifndef MIN +#define MIN(a, b) (((a) < (b)) ? (a) : (b)) +#endif +#ifndef MAX +#define MAX(a, b) (((a) > (b)) ? (a) : (b)) +#endif + + +#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 + +#define CHECK_PROC(x) +#define CHECK_PROC_WITH_RET(x) + +//static void log_gl(const char* format, ...); + +#include "opengl_utils.h" + +typedef struct +{ + int size; + int type; + int stride; + const void* ptr; + + int index; + int normalized; + + int enabled; + int vbo_name; + + unsigned int last_crc; +} ClientArray; + +typedef struct { + GLboolean swapEndian; + GLboolean lsbFirst; + GLuint rowLength; + GLuint imageHeight; + GLuint skipRows; + GLuint skipPixels; + GLuint skipImages; + GLuint alignment; +} PixelStoreMode; + +typedef struct +{ + int format; + int stride; + const void* ptr; +} InterleavedArrays; + +typedef struct { + ClientArray vertexArray; + ClientArray normalArray; + ClientArray colorArray; + ClientArray secondaryColorArray; + ClientArray indexArray; + ClientArray edgeFlagArray; + ClientArray weightArray; + ClientArray matrixIndexArray; + ClientArray fogCoordArray; + ClientArray texCoordArray[NB_MAX_TEXTURES]; + ClientArray vertexAttribArray[MY_GL_MAX_VERTEX_ATTRIBS_ARB]; + ClientArray vertexAttribArrayNV[MY_GL_MAX_VERTEX_ATTRIBS_NV]; + ClientArray variantPointer[MY_GL_MAX_VARIANT_POINTER_EXT]; + ClientArray elementArrayATI; + InterleavedArrays interleavedArrays; +} ClientArrays; + + +typedef struct +{ + GLbitfield mask; + PixelStoreMode pack; + PixelStoreMode unpack; + ClientArrays arrays; + int clientActiveTexture; + int selectBufferSize; + void* selectBufferPtr; + int feedbackBufferSize; + void* feedbackBufferPtr; +} ClientState; + +#define MAX_MATRIX_STACK_SIZE 64 +#define NB_GL_MATRIX (3+NB_MAX_TEXTURES+31) +typedef struct +{ + double val[16]; +} Matrixd; + +typedef struct +{ + Matrixd stack[MAX_MATRIX_STACK_SIZE]; + Matrixd current; + int sp; +} GLMatrix; + +typedef struct +{ + int x; + int y; + int width; + int height; +} ViewportStruct; + +typedef struct +{ + int width; + int height; + int depth; + int map_state; +} WindowInfoStruct; + +typedef struct +{ + int id; + int datatype; + int components; +} Symbol; + +typedef struct +{ + Symbol* tab; + int count; +} Symbols; + +typedef struct +{ + int texture; + int level; + + int width; + int height; +} Texture2DDim; + +typedef struct +{ + float mode; + float density; + float start; + float end; + float index; + float color[4]; +} Fog; + +typedef struct +{ + int size; + void* ptr; + int mapped; + int usage; + int access; +} Buffer; + +typedef struct +{ + int start; + int length; +} IntRange; + +typedef struct +{ + IntRange* ranges; + int nb; + int maxNb; +} IntSetRanges; + +typedef struct +{ + int bufferid; + int size; + void* ptr; + void* ptrMapped; + IntSetRanges updatedRangesAfterMapping; + void* ptrUpdatedWhileMapped; +} ObjectBufferATI; + +typedef struct +{ + GLuint program; + char* txt; + int location; +} UniformLocation; + + +#define MAX_CLIENT_STATE_STACK_SIZE 16 +#define MAX_SERVER_STATE_STACK_SIZE 16 + +#define N_CLIP_PLANES 8 +typedef struct +{ + GLbitfield mask; + int matrixMode; + int bindTexture2D; /* optimization for openquartz */ + int bindTextureRectangle; + int linesmoothEnabled; /* optimization for googleearth */ + int lightingEnabled; + int texture2DEnabled; + int blendEnabled; + int scissorTestEnabled; + int vertexProgramEnabled; + int fogEnabled; + int depthFunc; + Fog fog; + + Texture2DDim* texture2DCache; + int texture2DCacheDim; + Texture2DDim* textureProxy2DCache; + int textureProxy2DCacheDim; + Texture2DDim* textureRectangleCache; + int textureRectangleCacheDim; + Texture2DDim* textureProxyRectangleCache; + int textureProxyRectangleCacheDim; + + double clipPlanes[N_CLIP_PLANES][4]; +} ServerState; + + +typedef struct +{ + XImage *image; + XShmSegmentInfo shminfo; + char *buffer; + GC gc; + int w; + int h; + int use_shm; +} RendererData; + + +typedef struct +{ + int ref; + Display* display; + GLXContext context; + GLXDrawable current_drawable; + GLXDrawable current_read_drawable; + struct timeval last_swap_buffer_time; + GLXContext shareList; + XFixesCursorImage last_cursor; + GLXPbuffer pbuffer; + + RendererData *renderer_data; + + int isAssociatedToFBConfigVisual; + + ClientState client_state_stack[MAX_CLIENT_STATE_STACK_SIZE]; + ClientState client_state; + int client_state_sp; + + ServerState server_stack[MAX_SERVER_STATE_STACK_SIZE]; + ServerState current_server_state; + int server_sp; + + int arrayBuffer; /* optimization for ww2d */ + int elementArrayBuffer; + int pixelUnpackBuffer; + int pixelPackBuffer; + + Buffer ownArrayBuffers[32768]; + Buffer *arrayBuffers; + Buffer elementArrayBuffers[32768]; + Buffer pixelUnpackBuffers[32768]; + Buffer pixelPackBuffers[32768]; + + RangeAllocator ownTextureAllocator; + RangeAllocator* textureAllocator; + RangeAllocator ownBufferAllocator; + RangeAllocator* bufferAllocator; + RangeAllocator ownListAllocator; + RangeAllocator* listAllocator; + + Symbols symbols; + + ObjectBufferATI objectBuffersATI[32768]; + + UniformLocation* uniformLocations; + int countUniformLocations; + + WindowInfoStruct last_win_state; + ViewportStruct viewport; + ViewportStruct scissorbox; + int drawable_width; + int drawable_height; + + int currentRasterPosKnown; + float currentRasterPos[4]; + + char* tuxRacerBuffer; + + int activeTexture; + + int isBetweenBegin; + + int lastGlError; + + int isBetweenLockArrays; + int locked_first; + int locked_count; + + GLMatrix matrix[NB_GL_MATRIX]; +} GLState; + +extern int nbGLStates; +extern GLState** glstates; +extern GLState* default_gl_state; + +#define __INCLUDE_COMMON_H +#endif /* __INCLUDE_COMMON_H */ + diff --git a/libGL/enumtype.h b/libGL/enumtype.h new file mode 100755 index 0000000..3cd4f01 --- /dev/null +++ b/libGL/enumtype.h @@ -0,0 +1,128 @@ +/* + * Guest-side implementation of GL/GLX API. Replacement of standard libGL.so + * + * 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. + */ +#ifndef __ENUMTYPE_H + +enum +{ +/* 0 */ + TYPE_NONE, + TYPE_CHAR, + TYPE_UNSIGNED_CHAR, + TYPE_SHORT, + TYPE_UNSIGNED_SHORT, + TYPE_INT, + TYPE_UNSIGNED_INT, + TYPE_FLOAT, + TYPE_DOUBLE, + TYPE_1CHAR, +/* 10 */ + TYPE_2CHAR, + TYPE_3CHAR, + TYPE_4CHAR, + TYPE_128UCHAR, + TYPE_1SHORT, + TYPE_2SHORT, + TYPE_3SHORT, + TYPE_4SHORT, + TYPE_1INT, + TYPE_2INT, +/* 20 */ + TYPE_3INT, + TYPE_4INT, + TYPE_1FLOAT, + TYPE_2FLOAT, + TYPE_3FLOAT, + TYPE_4FLOAT, + TYPE_16FLOAT, + TYPE_1DOUBLE, + TYPE_2DOUBLE, + TYPE_3DOUBLE, +/* 30 */ + 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, +/* 40 */ + 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, +/* 50 */ + 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 __ENUMTYPE_H +#endif // __ENUMTYPE_H diff --git a/libGL/gl_func_perso.h b/libGL/gl_func_perso.h new file mode 100755 index 0000000..7ae6e7d --- /dev/null +++ b/libGL/gl_func_perso.h @@ -0,0 +1,122 @@ +/* + * 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(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), diff --git a/libGL/gl_tables.c b/libGL/gl_tables.c new file mode 100755 index 0000000..d04fa0d --- /dev/null +++ b/libGL/gl_tables.c @@ -0,0 +1,28 @@ +/* + * 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. + */ +#include "opengl_func.h" +#include "enumtype.h" + +#include "gl_func_tabs.h" + diff --git a/libGL/glfunclist.inl b/libGL/glfunclist.inl new file mode 100755 index 0000000..94884ca --- /dev/null +++ b/libGL/glfunclist.inl @@ -0,0 +1,191 @@ + ACTION( IsBuffer ); + ACTION( IsEnabled ); + ACTION( IsFramebuffer ); + ACTION( IsProgram ); + ACTION( IsRenderbuffer ); + ACTION( IsShader ); + ACTION( IsTexture ); + ACTION( CheckFramebufferStatus ); + ACTION( GetError ); + ACTION( GetAttribLocation ); + ACTION( GetUniformLocation ); + ACTION( CreateProgram ); + ACTION( CreateShader ); + ACTION( GetString ); + ACTION( ActiveTexture ); + ACTION( AlphaFunc ); + ACTION( AttachShader ); + ACTION( BindAttribLocation ); + ACTION( BindBuffer ); + ACTION( BindFramebuffer ); + ACTION( BindRenderbuffer ); + ACTION( BindTexture ); + ACTION( BlendColor ); + ACTION( BlendEquation ); + ACTION( BlendEquationSeparate ); + ACTION( BlendFunc ); + ACTION( BlendFuncSeparate ); + ACTION( BufferData ); + ACTION( BufferSubData ); + ACTION( Clear ); + ACTION( ClearColor ); +// ACTION( ClearColorx ); + ACTION( ClearDepthf ); + ACTION( ClearStencil ); + ACTION( ClientActiveTexture ); + ACTION( Color4f ); + ACTION( Color4ub ); + ACTION( ColorMask ); + ACTION( ColorPointer ); + ACTION( CompileShader ); + ACTION( CompressedTexImage2D ); + ACTION( CompressedTexSubImage2D ); + ACTION( CopyTexImage2D ); + ACTION( CopyTexSubImage2D ); + ACTION( CullFace ); + ACTION( DeleteBuffers ); + ACTION( DeleteFramebuffers ); + ACTION( DeleteProgram ); + ACTION( DeleteRenderbuffers ); + ACTION( DeleteShader ); + ACTION( DeleteTextures ); + ACTION( DepthFunc ); + ACTION( DepthMask ); + ACTION( DepthRangef ); + ACTION( DetachShader ); + ACTION( Disable ); + ACTION( DisableClientState ); + ACTION( DisableVertexAttribArray ); + ACTION( DrawArrays ); + ACTION( DrawElements ); + ACTION( Enable ); + ACTION( EnableClientState ); + ACTION( EnableVertexAttribArray ); + ACTION( Finish ); + ACTION( Flush ); + ACTION( Fogf ); + ACTION( Fogfv ); + ACTION( Fogi ); + ACTION( FramebufferRenderbuffer ); + ACTION( FramebufferTexture2D ); + ACTION( FrontFace ); + ACTION( GenBuffers ); + ACTION( GenFramebuffers ); + ACTION( GenRenderbuffers ); + ACTION( GenTextures ); + ACTION( GenerateMipmap ); + ACTION( GetActiveAttrib ); + ACTION( GetActiveUniform ); + ACTION( GetAttachedShaders ); + ACTION( GetBooleanv ); + ACTION( GetBufferParameteriv ); + ACTION( GetBufferSubData ); + ACTION( GetFloatv ); + ACTION( GetFramebufferAttachmentParameteriv ); + ACTION( GetIntegerv ); + ACTION( GetLightfv ); + ACTION( GetMaterialfv ); + ACTION( GetPointerv ); + ACTION( GetProgramInfoLog ); + ACTION( GetProgramiv ); + ACTION( GetRenderbufferParameteriv ); + ACTION( GetShaderInfoLog ); + ACTION( GetShaderSource ); + ACTION( GetShaderiv ); + ACTION( GetTexEnvfv ); + ACTION( GetTexEnviv ); + ACTION( GetTexLevelParameteriv ); + ACTION( GetTexParameterfv ); + ACTION( GetTexParameteriv ); + ACTION( GetUniformfv ); + ACTION( GetUniformiv ); + ACTION( GetVertexAttribPointerv ); + ACTION( GetVertexAttribfv ); + ACTION( GetVertexAttribiv ); + ACTION( Hint ); + ACTION( LightModelf ); + ACTION( LightModelfv ); + ACTION( Lightf ); + ACTION( Lightfv ); + ACTION( LineWidth ); + ACTION( LinkProgram ); + ACTION( LoadIdentity ); + ACTION( LoadMatrixf ); + ACTION( LogicOp ); + ACTION( Materialf ); + ACTION( Materialfv ); + ACTION( MatrixMode ); + ACTION( MultMatrixf ); + ACTION( MultiTexCoord4f ); + ACTION( Normal3f ); + ACTION( NormalPointer ); + ACTION( Ortho ); + ACTION( Orthof ); +// ACTION( Orthox ); + ACTION( PixelStorei ); + ACTION( PointParameterf ); + ACTION( PointParameterfv ); + ACTION( PointSize ); + ACTION( PolygonOffset ); + ACTION( PopMatrix ); + ACTION( PushMatrix ); + ACTION( ReadPixels ); + ACTION( RenderbufferStorage ); + ACTION( Rotatef ); +// ACTION( Rotatex ); + ACTION( SampleCoverage ); + ACTION( Scalef ); + ACTION( Scissor ); + ACTION( ShadeModel ); + ACTION( ShaderSource ); + ACTION( StencilFunc ); + ACTION( StencilFuncSeparate ); + ACTION( StencilMask ); + ACTION( StencilMaskSeparate ); + ACTION( StencilOp ); + ACTION( StencilOpSeparate ); + ACTION( TexCoordPointer ); + ACTION( TexEnvf ); + ACTION( TexEnvfv ); + ACTION( TexEnvi ); + ACTION( TexEnviv ); + ACTION( TexImage2D ); + ACTION( TexParameterf ); + ACTION( TexParameterfv ); + ACTION( TexParameteri ); + ACTION( TexParameteriv ); + ACTION( TexSubImage2D ); + ACTION( Translatef ); +// ACTION( Translatex ); + ACTION( Uniform1f ); + ACTION( Uniform1fv ); + ACTION( Uniform1i ); + ACTION( Uniform1iv ); + ACTION( Uniform2f ); + ACTION( Uniform2fv ); + ACTION( Uniform2i ); + ACTION( Uniform2iv ); + ACTION( Uniform3f ); + ACTION( Uniform3fv ); + ACTION( Uniform3i ); + ACTION( Uniform3iv ); + ACTION( Uniform4f ); + ACTION( Uniform4fv ); + ACTION( Uniform4i ); + ACTION( Uniform4iv ); + ACTION( UniformMatrix2fv ); + ACTION( UniformMatrix3fv ); + ACTION( UniformMatrix4fv ); + ACTION( UseProgram ); + ACTION( ValidateProgram ); + ACTION( VertexAttrib1f ); + ACTION( VertexAttrib1fv ); + ACTION( VertexAttrib2f ); + ACTION( VertexAttrib2fv ); + ACTION( VertexAttrib3f ); + ACTION( VertexAttrib3fv ); + ACTION( VertexAttrib4f ); + ACTION( VertexAttrib4fv ); + ACTION( VertexAttribPointer ); + ACTION( VertexPointer ); + ACTION( Viewport ); diff --git a/libGL/lock.h b/libGL/lock.h new file mode 100755 index 0000000..bb33a80 --- /dev/null +++ b/libGL/lock.h @@ -0,0 +1,128 @@ +/* + * Guest-side implementation of GL/GLX API. Replacement of standard libGL.so + * + * 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. + */ +#include <pthread.h> +#include "common.h" +#include "log.h" + +#ifdef ENABLE_THREAD_SAFETY + +extern GLState* new_gl_state(); + +extern pthread_mutex_t global_mutex; +extern pthread_key_t key_current_gl_state; + +extern pthread_t last_current_thread; +extern GLState* _mono_threaded_current_gl_state; +extern GLState* default_gl_state; + + +/* Posix threading */ +/* The concepts used here are coming directly from http://www.mesa3d.org/dispatch.html */ + +#ifdef TEST_IF_LOCK_USE_IS_CORRECT_INTO_MONO_THREADED_CASE + static int lock_count = 0; + #define LOCK(func_number) int __lock__ = 0; assert(lock_count == 0); lock_count++; pthread_mutex_lock( &global_mutex ); + #define UNLOCK(func_number) assert(lock_count + __lock__ == 1); lock_count--; pthread_mutex_unlock( &global_mutex ); + #define IS_MT() 2 + static int _is_mt = 2; +#else + static int _is_mt = 0; + static inline int is_mt() + { + if (_is_mt) return 1; + pthread_t current_thread = pthread_self(); + if (last_current_thread == 0) + last_current_thread = current_thread; + if (current_thread != last_current_thread) + { + _is_mt = 1; + log_gl("-------- Two threads at least are doing OpenGL ---------\n"); + pthread_key_create(&key_current_gl_state, NULL); + } + return _is_mt; + } + #define IS_MT() is_mt() + + /* The idea here is that the first GL/GLX call made in each thread is necessary a GLX call */ + /* So in the case where it's a GLX call we always take the lock and check if we're in MT case */ + /* otherwise (regular GL call), we have to take the lock only in the MT case */ + #define LOCK(func_number) do { if (IS_GLX_CALL(func_number)) { pthread_mutex_lock( &global_mutex ); IS_MT(); } else if (_is_mt) { pthread_mutex_lock( &global_mutex ); } } while(0) + #define UNLOCK(func_number) do { if (IS_GLX_CALL(func_number) || _is_mt) pthread_mutex_unlock( &global_mutex ); } while(0) +#endif + +static void set_current_state(GLState* current_gl_state) +{ + if (_is_mt) + pthread_setspecific(key_current_gl_state, current_gl_state); + else + _mono_threaded_current_gl_state = current_gl_state; +} + +static inline GLState* get_current_state() +{ + GLState* current_gl_state; + if (_is_mt == 1 && + last_current_thread == pthread_self()) + { + _is_mt = 2; + set_current_state(_mono_threaded_current_gl_state); + _mono_threaded_current_gl_state = NULL; + } + current_gl_state = (_is_mt) ? pthread_getspecific(key_current_gl_state) : _mono_threaded_current_gl_state; + if (current_gl_state == NULL) + { + if (default_gl_state == NULL) + { + default_gl_state = new_gl_state(); + } + current_gl_state = default_gl_state; + set_current_state(current_gl_state); + } + return current_gl_state; +} +#define SET_CURRENT_STATE(_x) set_current_state(_x) + +/* No support for threading */ +#else +#define LOCK(func_number) +#define UNLOCK(func_number) +#define GET_CURRENT_THREAD() 0 +#define IS_MT() 0 +static GLState* current_gl_state = NULL; +static inline GLState* get_current_state() +{ + if (current_gl_state == NULL) + { + if (default_gl_state == NULL) + { + default_gl_state = new_gl_state(); + } + return default_gl_state; + } + return current_gl_state; +} +#define SET_CURRENT_STATE(_x) current_gl_state = _x +#endif + +#define GET_CURRENT_STATE() GLState* state = get_current_state() diff --git a/libGL/log.c b/libGL/log.c new file mode 100755 index 0000000..4d369d5 --- /dev/null +++ b/libGL/log.c @@ -0,0 +1,53 @@ +/* + * Guest-side implementation of GL/GLX API. Replacement of standard libGL.so + * + * 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. + */ +#include <stdlib.h> +#include <string.h> +#include <stdarg.h> +#include <stdio.h> + +FILE* get_err_file() +{ + static FILE* err_file = NULL; + if (err_file == NULL) + { + err_file = getenv("GL_ERR_FILE") ? fopen(getenv("GL_ERR_FILE"), "wt") : NULL; + if (err_file == NULL) + err_file = stderr; + } + return err_file; +} + + +void log_gl(const char* format, ...) +{ + va_list list; + va_start(list, format); +#ifdef ENABLE_THREAD_SAFETY + if (IS_MT()) + fprintf(get_err_file(), "[thread %p] : ", (void*)GET_CURRENT_THREAD()); +#endif + vfprintf(get_err_file(), format, list); + va_end(list); +} + diff --git a/libGL/log.h b/libGL/log.h new file mode 100755 index 0000000..31ae080 --- /dev/null +++ b/libGL/log.h @@ -0,0 +1,26 @@ +/* + * 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. + */ + +extern FILE* get_err_file(); + +extern void log_gl(const char* format, ...); + diff --git a/libGL/mesa_get.c b/libGL/mesa_get.c new file mode 100755 index 0000000..3b4c9aa --- /dev/null +++ b/libGL/mesa_get.c @@ -0,0 +1,5563 @@ + +/*** + *** NOTE!!! DO NOT EDIT THIS FILE!!! IT IS GENERATED BY get_gen.py + ***/ + +#include "glheader.h" +#include "context.h" +#include "enable.h" +#include "extensions.h" +#include "fbobject.h" +#include "get.h" +#include "macros.h" +#include "mtypes.h" +#include "state.h" +#include "texcompress.h" + + +#define FLOAT_TO_BOOLEAN(X) ( (X) ? GL_TRUE : GL_FALSE ) + +#define INT_TO_BOOLEAN(I) ( (I) ? GL_TRUE : GL_FALSE ) + +#define ENUM_TO_BOOLEAN(E) ( (E) ? GL_TRUE : GL_FALSE ) +#define ENUM_TO_INT(E) ( (GLint) (E) ) +#define ENUM_TO_FLOAT(E) ( (GLfloat) (E) ) + +#define BOOLEAN_TO_INT(B) ( (GLint) (B) ) +#define BOOLEAN_TO_FLOAT(B) ( (B) ? 1.0F : 0.0F ) + + +/* + * Check if named extension is enabled, if not generate error and return. + */ +#define CHECK_EXT1(EXT1, FUNC) \ + if (!ctx->Extensions.EXT1) { \ + _mesa_error(ctx, GL_INVALID_ENUM, FUNC "(0x%x)", (int) pname); \ + return; \ + } + +/* + * Check if either of two extensions is enabled. + */ +#define CHECK_EXT2(EXT1, EXT2, FUNC) \ + if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2) { \ + _mesa_error(ctx, GL_INVALID_ENUM, FUNC "(0x%x)", (int) pname); \ + return; \ + } + +/* + * Check if either of three extensions is enabled. + */ +#define CHECK_EXT3(EXT1, EXT2, EXT3, FUNC) \ + if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2 && \ + !ctx->Extensions.EXT3) { \ + _mesa_error(ctx, GL_INVALID_ENUM, FUNC "(0x%x)", (int) pname); \ + return; \ + } + +/* + * Check if either of four extensions is enabled. + */ +#define CHECK_EXT4(EXT1, EXT2, EXT3, EXT4, FUNC) \ + if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2 && \ + !ctx->Extensions.EXT3 && !ctx->Extensions.EXT4) { \ + _mesa_error(ctx, GL_INVALID_ENUM, FUNC "(0x%x)", (int) pname); \ + return; \ + } + + +void GLAPIENTRY +_mesa_GetBooleanv( GLenum pname, GLboolean *params ) +{ + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + + if (!params) + return; + + if (ctx->NewState) + _mesa_update_state(ctx); + + if (ctx->Driver.GetBooleanv && + ctx->Driver.GetBooleanv(ctx, pname, params)) + return; + + switch (pname) { + case GL_ACCUM_RED_BITS: + params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.accumRedBits); + break; + case GL_ACCUM_GREEN_BITS: + params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.accumGreenBits); + break; + case GL_ACCUM_BLUE_BITS: + params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.accumBlueBits); + break; + case GL_ACCUM_ALPHA_BITS: + params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.accumAlphaBits); + break; + case GL_ACCUM_CLEAR_VALUE: + params[0] = FLOAT_TO_BOOLEAN(ctx->Accum.ClearColor[0]); + params[1] = FLOAT_TO_BOOLEAN(ctx->Accum.ClearColor[1]); + params[2] = FLOAT_TO_BOOLEAN(ctx->Accum.ClearColor[2]); + params[3] = FLOAT_TO_BOOLEAN(ctx->Accum.ClearColor[3]); + break; + case GL_ALPHA_BIAS: + params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.AlphaBias); + break; + case GL_ALPHA_BITS: + params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.alphaBits); + break; + case GL_ALPHA_SCALE: + params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.AlphaScale); + break; + case GL_ALPHA_TEST: + params[0] = ctx->Color.AlphaEnabled; + break; + case GL_ALPHA_TEST_FUNC: + params[0] = ENUM_TO_BOOLEAN(ctx->Color.AlphaFunc); + break; + case GL_ALPHA_TEST_REF: + params[0] = FLOAT_TO_BOOLEAN(ctx->Color.AlphaRef); + break; + case GL_ATTRIB_STACK_DEPTH: + params[0] = INT_TO_BOOLEAN(ctx->AttribStackDepth); + break; + case GL_AUTO_NORMAL: + params[0] = ctx->Eval.AutoNormal; + break; + case GL_AUX_BUFFERS: + params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.numAuxBuffers); + break; + case GL_BLEND: + params[0] = ctx->Color.BlendEnabled; + break; + case GL_BLEND_DST: + params[0] = ENUM_TO_BOOLEAN(ctx->Color.BlendDstRGB); + break; + case GL_BLEND_SRC: + params[0] = ENUM_TO_BOOLEAN(ctx->Color.BlendSrcRGB); + break; + case GL_BLEND_SRC_RGB_EXT: + params[0] = ENUM_TO_BOOLEAN(ctx->Color.BlendSrcRGB); + break; + case GL_BLEND_DST_RGB_EXT: + params[0] = ENUM_TO_BOOLEAN(ctx->Color.BlendDstRGB); + break; + case GL_BLEND_SRC_ALPHA_EXT: + params[0] = ENUM_TO_BOOLEAN(ctx->Color.BlendSrcA); + break; + case GL_BLEND_DST_ALPHA_EXT: + params[0] = ENUM_TO_BOOLEAN(ctx->Color.BlendDstA); + break; + case GL_BLEND_EQUATION: + params[0] = ENUM_TO_BOOLEAN(ctx->Color.BlendEquationRGB ); + break; + case GL_BLEND_EQUATION_ALPHA_EXT: + params[0] = ENUM_TO_BOOLEAN(ctx->Color.BlendEquationA ); + break; + case GL_BLEND_COLOR_EXT: + params[0] = FLOAT_TO_BOOLEAN(ctx->Color.BlendColor[0]); + params[1] = FLOAT_TO_BOOLEAN(ctx->Color.BlendColor[1]); + params[2] = FLOAT_TO_BOOLEAN(ctx->Color.BlendColor[2]); + params[3] = FLOAT_TO_BOOLEAN(ctx->Color.BlendColor[3]); + break; + case GL_BLUE_BIAS: + params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.BlueBias); + break; + case GL_BLUE_BITS: + params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.blueBits); + break; + case GL_BLUE_SCALE: + params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.BlueScale); + break; + case GL_CLIENT_ATTRIB_STACK_DEPTH: + params[0] = INT_TO_BOOLEAN(ctx->ClientAttribStackDepth); + break; + case GL_CLIP_PLANE0: + params[0] = (ctx->Transform.ClipPlanesEnabled >> 0) & 1; + break; + case GL_CLIP_PLANE1: + params[0] = (ctx->Transform.ClipPlanesEnabled >> 1) & 1; + break; + case GL_CLIP_PLANE2: + params[0] = (ctx->Transform.ClipPlanesEnabled >> 2) & 1; + break; + case GL_CLIP_PLANE3: + params[0] = (ctx->Transform.ClipPlanesEnabled >> 3) & 1; + break; + case GL_CLIP_PLANE4: + params[0] = (ctx->Transform.ClipPlanesEnabled >> 4) & 1; + break; + case GL_CLIP_PLANE5: + params[0] = (ctx->Transform.ClipPlanesEnabled >> 5) & 1; + break; + case GL_COLOR_CLEAR_VALUE: + params[0] = FLOAT_TO_BOOLEAN(ctx->Color.ClearColor[0]); + params[1] = FLOAT_TO_BOOLEAN(ctx->Color.ClearColor[1]); + params[2] = FLOAT_TO_BOOLEAN(ctx->Color.ClearColor[2]); + params[3] = FLOAT_TO_BOOLEAN(ctx->Color.ClearColor[3]); + break; + case GL_COLOR_MATERIAL: + params[0] = ctx->Light.ColorMaterialEnabled; + break; + case GL_COLOR_MATERIAL_FACE: + params[0] = ENUM_TO_BOOLEAN(ctx->Light.ColorMaterialFace); + break; + case GL_COLOR_MATERIAL_PARAMETER: + params[0] = ENUM_TO_BOOLEAN(ctx->Light.ColorMaterialMode); + break; + case GL_COLOR_WRITEMASK: + params[0] = INT_TO_BOOLEAN(ctx->Color.ColorMask[RCOMP] ? 1 : 0); + params[1] = INT_TO_BOOLEAN(ctx->Color.ColorMask[GCOMP] ? 1 : 0); + params[2] = INT_TO_BOOLEAN(ctx->Color.ColorMask[BCOMP] ? 1 : 0); + params[3] = INT_TO_BOOLEAN(ctx->Color.ColorMask[ACOMP] ? 1 : 0); + break; + case GL_CULL_FACE: + params[0] = ctx->Polygon.CullFlag; + break; + case GL_CULL_FACE_MODE: + params[0] = ENUM_TO_BOOLEAN(ctx->Polygon.CullFaceMode); + break; + case GL_CURRENT_COLOR: + { + FLUSH_CURRENT(ctx, 0); + params[0] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0]); + params[1] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1]); + params[2] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2]); + params[3] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3]); + } + break; + case GL_CURRENT_INDEX: + { + FLUSH_CURRENT(ctx, 0); + params[0] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_COLOR_INDEX][0]); + } + break; + case GL_CURRENT_NORMAL: + { + FLUSH_CURRENT(ctx, 0); + params[0] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_NORMAL][0]); + params[1] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_NORMAL][1]); + params[2] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_NORMAL][2]); + } + break; + case GL_CURRENT_RASTER_COLOR: + params[0] = FLOAT_TO_BOOLEAN(ctx->Current.RasterColor[0]); + params[1] = FLOAT_TO_BOOLEAN(ctx->Current.RasterColor[1]); + params[2] = FLOAT_TO_BOOLEAN(ctx->Current.RasterColor[2]); + params[3] = FLOAT_TO_BOOLEAN(ctx->Current.RasterColor[3]); + break; + case GL_CURRENT_RASTER_DISTANCE: + params[0] = FLOAT_TO_BOOLEAN(ctx->Current.RasterDistance); + break; + case GL_CURRENT_RASTER_INDEX: + params[0] = FLOAT_TO_BOOLEAN(ctx->Current.RasterIndex); + break; + case GL_CURRENT_RASTER_POSITION: + params[0] = FLOAT_TO_BOOLEAN(ctx->Current.RasterPos[0]); + params[1] = FLOAT_TO_BOOLEAN(ctx->Current.RasterPos[1]); + params[2] = FLOAT_TO_BOOLEAN(ctx->Current.RasterPos[2]); + params[3] = FLOAT_TO_BOOLEAN(ctx->Current.RasterPos[3]); + break; + case GL_CURRENT_RASTER_SECONDARY_COLOR: + params[0] = FLOAT_TO_BOOLEAN(ctx->Current.RasterSecondaryColor[0]); + params[1] = FLOAT_TO_BOOLEAN(ctx->Current.RasterSecondaryColor[1]); + params[2] = FLOAT_TO_BOOLEAN(ctx->Current.RasterSecondaryColor[2]); + params[3] = FLOAT_TO_BOOLEAN(ctx->Current.RasterSecondaryColor[3]); + break; + case GL_CURRENT_RASTER_TEXTURE_COORDS: + { + const GLuint texUnit = ctx->Texture.CurrentUnit; + params[0] = FLOAT_TO_BOOLEAN(ctx->Current.RasterTexCoords[texUnit][0]); + params[1] = FLOAT_TO_BOOLEAN(ctx->Current.RasterTexCoords[texUnit][1]); + params[2] = FLOAT_TO_BOOLEAN(ctx->Current.RasterTexCoords[texUnit][2]); + params[3] = FLOAT_TO_BOOLEAN(ctx->Current.RasterTexCoords[texUnit][3]); + } + break; + case GL_CURRENT_RASTER_POSITION_VALID: + params[0] = ctx->Current.RasterPosValid; + break; + case GL_CURRENT_TEXTURE_COORDS: + { + const GLuint texUnit = ctx->Texture.CurrentUnit; + params[0] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][0]); + params[1] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][1]); + params[2] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][2]); + params[3] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][3]); + } + break; + case GL_DEPTH_BIAS: + params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.DepthBias); + break; + case GL_DEPTH_BITS: + params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.depthBits); + break; + case GL_DEPTH_CLEAR_VALUE: + params[0] = FLOAT_TO_BOOLEAN(ctx->Depth.Clear); + break; + case GL_DEPTH_FUNC: + params[0] = ENUM_TO_BOOLEAN(ctx->Depth.Func); + break; + case GL_DEPTH_RANGE: + params[0] = FLOAT_TO_BOOLEAN(ctx->Viewport.Near); + params[1] = FLOAT_TO_BOOLEAN(ctx->Viewport.Far); + break; + case GL_DEPTH_SCALE: + params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.DepthScale); + break; + case GL_DEPTH_TEST: + params[0] = ctx->Depth.Test; + break; + case GL_DEPTH_WRITEMASK: + params[0] = ctx->Depth.Mask; + break; + case GL_DITHER: + params[0] = ctx->Color.DitherFlag; + break; + case GL_DOUBLEBUFFER: + params[0] = ctx->DrawBuffer->Visual.doubleBufferMode; + break; + case GL_DRAW_BUFFER: + params[0] = ENUM_TO_BOOLEAN(ctx->DrawBuffer->ColorDrawBuffer[0]); + break; + case GL_EDGE_FLAG: + { + FLUSH_CURRENT(ctx, 0); + params[0] = ctx->Current.EdgeFlag; + } + break; + case GL_FEEDBACK_BUFFER_SIZE: + params[0] = INT_TO_BOOLEAN(ctx->Feedback.BufferSize); + break; + case GL_FEEDBACK_BUFFER_TYPE: + params[0] = ENUM_TO_BOOLEAN(ctx->Feedback.Type); + break; + case GL_FOG: + params[0] = ctx->Fog.Enabled; + break; + case GL_FOG_COLOR: + params[0] = FLOAT_TO_BOOLEAN(ctx->Fog.Color[0]); + params[1] = FLOAT_TO_BOOLEAN(ctx->Fog.Color[1]); + params[2] = FLOAT_TO_BOOLEAN(ctx->Fog.Color[2]); + params[3] = FLOAT_TO_BOOLEAN(ctx->Fog.Color[3]); + break; + case GL_FOG_DENSITY: + params[0] = FLOAT_TO_BOOLEAN(ctx->Fog.Density); + break; + case GL_FOG_END: + params[0] = FLOAT_TO_BOOLEAN(ctx->Fog.End); + break; + case GL_FOG_HINT: + params[0] = ENUM_TO_BOOLEAN(ctx->Hint.Fog); + break; + case GL_FOG_INDEX: + params[0] = FLOAT_TO_BOOLEAN(ctx->Fog.Index); + break; + case GL_FOG_MODE: + params[0] = ENUM_TO_BOOLEAN(ctx->Fog.Mode); + break; + case GL_FOG_START: + params[0] = FLOAT_TO_BOOLEAN(ctx->Fog.Start); + break; + case GL_FRONT_FACE: + params[0] = ENUM_TO_BOOLEAN(ctx->Polygon.FrontFace); + break; + case GL_GREEN_BIAS: + params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.GreenBias); + break; + case GL_GREEN_BITS: + params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.greenBits); + break; + case GL_GREEN_SCALE: + params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.GreenScale); + break; + case GL_INDEX_BITS: + params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.indexBits); + break; + case GL_INDEX_CLEAR_VALUE: + params[0] = INT_TO_BOOLEAN(ctx->Color.ClearIndex); + break; + case GL_INDEX_MODE: + params[0] = !ctx->DrawBuffer->Visual.rgbMode; + break; + case GL_INDEX_OFFSET: + params[0] = INT_TO_BOOLEAN(ctx->Pixel.IndexOffset); + break; + case GL_INDEX_SHIFT: + params[0] = INT_TO_BOOLEAN(ctx->Pixel.IndexShift); + break; + case GL_INDEX_WRITEMASK: + params[0] = INT_TO_BOOLEAN(ctx->Color.IndexMask); + break; + case GL_LIGHT0: + params[0] = ctx->Light.Light[0].Enabled; + break; + case GL_LIGHT1: + params[0] = ctx->Light.Light[1].Enabled; + break; + case GL_LIGHT2: + params[0] = ctx->Light.Light[2].Enabled; + break; + case GL_LIGHT3: + params[0] = ctx->Light.Light[3].Enabled; + break; + case GL_LIGHT4: + params[0] = ctx->Light.Light[4].Enabled; + break; + case GL_LIGHT5: + params[0] = ctx->Light.Light[5].Enabled; + break; + case GL_LIGHT6: + params[0] = ctx->Light.Light[6].Enabled; + break; + case GL_LIGHT7: + params[0] = ctx->Light.Light[7].Enabled; + break; + case GL_LIGHTING: + params[0] = ctx->Light.Enabled; + break; + case GL_LIGHT_MODEL_AMBIENT: + params[0] = FLOAT_TO_BOOLEAN(ctx->Light.Model.Ambient[0]); + params[1] = FLOAT_TO_BOOLEAN(ctx->Light.Model.Ambient[1]); + params[2] = FLOAT_TO_BOOLEAN(ctx->Light.Model.Ambient[2]); + params[3] = FLOAT_TO_BOOLEAN(ctx->Light.Model.Ambient[3]); + break; + case GL_LIGHT_MODEL_COLOR_CONTROL: + params[0] = ENUM_TO_BOOLEAN(ctx->Light.Model.ColorControl); + break; + case GL_LIGHT_MODEL_LOCAL_VIEWER: + params[0] = ctx->Light.Model.LocalViewer; + break; + case GL_LIGHT_MODEL_TWO_SIDE: + params[0] = ctx->Light.Model.TwoSide; + break; + case GL_LINE_SMOOTH: + params[0] = ctx->Line.SmoothFlag; + break; + case GL_LINE_SMOOTH_HINT: + params[0] = ENUM_TO_BOOLEAN(ctx->Hint.LineSmooth); + break; + case GL_LINE_STIPPLE: + params[0] = ctx->Line.StippleFlag; + break; + case GL_LINE_STIPPLE_PATTERN: + params[0] = INT_TO_BOOLEAN(ctx->Line.StipplePattern); + break; + case GL_LINE_STIPPLE_REPEAT: + params[0] = INT_TO_BOOLEAN(ctx->Line.StippleFactor); + break; + case GL_LINE_WIDTH: + params[0] = FLOAT_TO_BOOLEAN(ctx->Line.Width); + break; + case GL_LINE_WIDTH_GRANULARITY: + params[0] = FLOAT_TO_BOOLEAN(ctx->Const.LineWidthGranularity); + break; + case GL_LINE_WIDTH_RANGE: + params[0] = FLOAT_TO_BOOLEAN(ctx->Const.MinLineWidthAA); + params[1] = FLOAT_TO_BOOLEAN(ctx->Const.MaxLineWidthAA); + break; + case GL_ALIASED_LINE_WIDTH_RANGE: + params[0] = FLOAT_TO_BOOLEAN(ctx->Const.MinLineWidth); + params[1] = FLOAT_TO_BOOLEAN(ctx->Const.MaxLineWidth); + break; + case GL_LIST_BASE: + params[0] = INT_TO_BOOLEAN(ctx->List.ListBase); + break; + case GL_LIST_INDEX: + params[0] = INT_TO_BOOLEAN(ctx->ListState.CurrentListNum); + break; + case GL_LIST_MODE: + { + GLenum mode; + if (!ctx->CompileFlag) + mode = 0; + else if (ctx->ExecuteFlag) + mode = GL_COMPILE_AND_EXECUTE; + else + mode = GL_COMPILE; + params[0] = ENUM_TO_BOOLEAN(mode); + } + break; + case GL_INDEX_LOGIC_OP: + params[0] = ctx->Color.IndexLogicOpEnabled; + break; + case GL_COLOR_LOGIC_OP: + params[0] = ctx->Color.ColorLogicOpEnabled; + break; + case GL_LOGIC_OP_MODE: + params[0] = ENUM_TO_BOOLEAN(ctx->Color.LogicOp); + break; + case GL_MAP1_COLOR_4: + params[0] = ctx->Eval.Map1Color4; + break; + case GL_MAP1_GRID_DOMAIN: + params[0] = FLOAT_TO_BOOLEAN(ctx->Eval.MapGrid1u1); + params[1] = FLOAT_TO_BOOLEAN(ctx->Eval.MapGrid1u2); + break; + case GL_MAP1_GRID_SEGMENTS: + params[0] = INT_TO_BOOLEAN(ctx->Eval.MapGrid1un); + break; + case GL_MAP1_INDEX: + params[0] = ctx->Eval.Map1Index; + break; + case GL_MAP1_NORMAL: + params[0] = ctx->Eval.Map1Normal; + break; + case GL_MAP1_TEXTURE_COORD_1: + params[0] = ctx->Eval.Map1TextureCoord1; + break; + case GL_MAP1_TEXTURE_COORD_2: + params[0] = ctx->Eval.Map1TextureCoord2; + break; + case GL_MAP1_TEXTURE_COORD_3: + params[0] = ctx->Eval.Map1TextureCoord3; + break; + case GL_MAP1_TEXTURE_COORD_4: + params[0] = ctx->Eval.Map1TextureCoord4; + break; + case GL_MAP1_VERTEX_3: + params[0] = ctx->Eval.Map1Vertex3; + break; + case GL_MAP1_VERTEX_4: + params[0] = ctx->Eval.Map1Vertex4; + break; + case GL_MAP2_COLOR_4: + params[0] = ctx->Eval.Map2Color4; + break; + case GL_MAP2_GRID_DOMAIN: + params[0] = FLOAT_TO_BOOLEAN(ctx->Eval.MapGrid2u1); + params[1] = FLOAT_TO_BOOLEAN(ctx->Eval.MapGrid2u2); + params[2] = FLOAT_TO_BOOLEAN(ctx->Eval.MapGrid2v1); + params[3] = FLOAT_TO_BOOLEAN(ctx->Eval.MapGrid2v2); + break; + case GL_MAP2_GRID_SEGMENTS: + params[0] = INT_TO_BOOLEAN(ctx->Eval.MapGrid2un); + params[1] = INT_TO_BOOLEAN(ctx->Eval.MapGrid2vn); + break; + case GL_MAP2_INDEX: + params[0] = ctx->Eval.Map2Index; + break; + case GL_MAP2_NORMAL: + params[0] = ctx->Eval.Map2Normal; + break; + case GL_MAP2_TEXTURE_COORD_1: + params[0] = ctx->Eval.Map2TextureCoord1; + break; + case GL_MAP2_TEXTURE_COORD_2: + params[0] = ctx->Eval.Map2TextureCoord2; + break; + case GL_MAP2_TEXTURE_COORD_3: + params[0] = ctx->Eval.Map2TextureCoord3; + break; + case GL_MAP2_TEXTURE_COORD_4: + params[0] = ctx->Eval.Map2TextureCoord4; + break; + case GL_MAP2_VERTEX_3: + params[0] = ctx->Eval.Map2Vertex3; + break; + case GL_MAP2_VERTEX_4: + params[0] = ctx->Eval.Map2Vertex4; + break; + case GL_MAP_COLOR: + params[0] = ctx->Pixel.MapColorFlag; + break; + case GL_MAP_STENCIL: + params[0] = ctx->Pixel.MapStencilFlag; + break; + case GL_MATRIX_MODE: + params[0] = ENUM_TO_BOOLEAN(ctx->Transform.MatrixMode); + break; + case GL_MAX_ATTRIB_STACK_DEPTH: + params[0] = INT_TO_BOOLEAN(MAX_ATTRIB_STACK_DEPTH); + break; + case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH: + params[0] = INT_TO_BOOLEAN(MAX_CLIENT_ATTRIB_STACK_DEPTH); + break; + case GL_MAX_CLIP_PLANES: + params[0] = INT_TO_BOOLEAN(ctx->Const.MaxClipPlanes); + break; + case GL_MAX_ELEMENTS_VERTICES: + params[0] = INT_TO_BOOLEAN(ctx->Const.MaxArrayLockSize); + break; + case GL_MAX_ELEMENTS_INDICES: + params[0] = INT_TO_BOOLEAN(ctx->Const.MaxArrayLockSize); + break; + case GL_MAX_EVAL_ORDER: + params[0] = INT_TO_BOOLEAN(MAX_EVAL_ORDER); + break; + case GL_MAX_LIGHTS: + params[0] = INT_TO_BOOLEAN(ctx->Const.MaxLights); + break; + case GL_MAX_LIST_NESTING: + params[0] = INT_TO_BOOLEAN(MAX_LIST_NESTING); + break; + case GL_MAX_MODELVIEW_STACK_DEPTH: + params[0] = INT_TO_BOOLEAN(MAX_MODELVIEW_STACK_DEPTH); + break; + case GL_MAX_NAME_STACK_DEPTH: + params[0] = INT_TO_BOOLEAN(MAX_NAME_STACK_DEPTH); + break; + case GL_MAX_PIXEL_MAP_TABLE: + params[0] = INT_TO_BOOLEAN(MAX_PIXEL_MAP_TABLE); + break; + case GL_MAX_PROJECTION_STACK_DEPTH: + params[0] = INT_TO_BOOLEAN(MAX_PROJECTION_STACK_DEPTH); + break; + case GL_MAX_TEXTURE_SIZE: + params[0] = INT_TO_BOOLEAN(1 << (ctx->Const.MaxTextureLevels - 1)); + break; + case GL_MAX_3D_TEXTURE_SIZE: + params[0] = INT_TO_BOOLEAN(1 << (ctx->Const.Max3DTextureLevels - 1)); + break; + case GL_MAX_TEXTURE_STACK_DEPTH: + params[0] = INT_TO_BOOLEAN(MAX_TEXTURE_STACK_DEPTH); + break; + case GL_MAX_VIEWPORT_DIMS: + params[0] = INT_TO_BOOLEAN(ctx->Const.MaxViewportWidth); + params[1] = INT_TO_BOOLEAN(ctx->Const.MaxViewportHeight); + break; + case GL_MODELVIEW_MATRIX: + { + const GLfloat *matrix = ctx->ModelviewMatrixStack.Top->m; + params[0] = FLOAT_TO_BOOLEAN(matrix[0]); + params[1] = FLOAT_TO_BOOLEAN(matrix[1]); + params[2] = FLOAT_TO_BOOLEAN(matrix[2]); + params[3] = FLOAT_TO_BOOLEAN(matrix[3]); + params[4] = FLOAT_TO_BOOLEAN(matrix[4]); + params[5] = FLOAT_TO_BOOLEAN(matrix[5]); + params[6] = FLOAT_TO_BOOLEAN(matrix[6]); + params[7] = FLOAT_TO_BOOLEAN(matrix[7]); + params[8] = FLOAT_TO_BOOLEAN(matrix[8]); + params[9] = FLOAT_TO_BOOLEAN(matrix[9]); + params[10] = FLOAT_TO_BOOLEAN(matrix[10]); + params[11] = FLOAT_TO_BOOLEAN(matrix[11]); + params[12] = FLOAT_TO_BOOLEAN(matrix[12]); + params[13] = FLOAT_TO_BOOLEAN(matrix[13]); + params[14] = FLOAT_TO_BOOLEAN(matrix[14]); + params[15] = FLOAT_TO_BOOLEAN(matrix[15]); + } + break; + case GL_MODELVIEW_STACK_DEPTH: + params[0] = INT_TO_BOOLEAN(ctx->ModelviewMatrixStack.Depth + 1); + break; + case GL_NAME_STACK_DEPTH: + params[0] = INT_TO_BOOLEAN(ctx->Select.NameStackDepth); + break; + case GL_NORMALIZE: + params[0] = ctx->Transform.Normalize; + break; + case GL_PACK_ALIGNMENT: + params[0] = INT_TO_BOOLEAN(ctx->Pack.Alignment); + break; + case GL_PACK_LSB_FIRST: + params[0] = ctx->Pack.LsbFirst; + break; + case GL_PACK_ROW_LENGTH: + params[0] = INT_TO_BOOLEAN(ctx->Pack.RowLength); + break; + case GL_PACK_SKIP_PIXELS: + params[0] = INT_TO_BOOLEAN(ctx->Pack.SkipPixels); + break; + case GL_PACK_SKIP_ROWS: + params[0] = INT_TO_BOOLEAN(ctx->Pack.SkipRows); + break; + case GL_PACK_SWAP_BYTES: + params[0] = ctx->Pack.SwapBytes; + break; + case GL_PACK_SKIP_IMAGES_EXT: + params[0] = INT_TO_BOOLEAN(ctx->Pack.SkipImages); + break; + case GL_PACK_IMAGE_HEIGHT_EXT: + params[0] = INT_TO_BOOLEAN(ctx->Pack.ImageHeight); + break; + case GL_PACK_INVERT_MESA: + params[0] = ctx->Pack.Invert; + break; + case GL_PERSPECTIVE_CORRECTION_HINT: + params[0] = ENUM_TO_BOOLEAN(ctx->Hint.PerspectiveCorrection); + break; + case GL_PIXEL_MAP_A_TO_A_SIZE: + params[0] = INT_TO_BOOLEAN(ctx->Pixel.MapAtoAsize); + break; + case GL_PIXEL_MAP_B_TO_B_SIZE: + params[0] = INT_TO_BOOLEAN(ctx->Pixel.MapBtoBsize); + break; + case GL_PIXEL_MAP_G_TO_G_SIZE: + params[0] = INT_TO_BOOLEAN(ctx->Pixel.MapGtoGsize); + break; + case GL_PIXEL_MAP_I_TO_A_SIZE: + params[0] = INT_TO_BOOLEAN(ctx->Pixel.MapItoAsize); + break; + case GL_PIXEL_MAP_I_TO_B_SIZE: + params[0] = INT_TO_BOOLEAN(ctx->Pixel.MapItoBsize); + break; + case GL_PIXEL_MAP_I_TO_G_SIZE: + params[0] = INT_TO_BOOLEAN(ctx->Pixel.MapItoGsize); + break; + case GL_PIXEL_MAP_I_TO_I_SIZE: + params[0] = INT_TO_BOOLEAN(ctx->Pixel.MapItoIsize); + break; + case GL_PIXEL_MAP_I_TO_R_SIZE: + params[0] = INT_TO_BOOLEAN(ctx->Pixel.MapItoRsize); + break; + case GL_PIXEL_MAP_R_TO_R_SIZE: + params[0] = INT_TO_BOOLEAN(ctx->Pixel.MapRtoRsize); + break; + case GL_PIXEL_MAP_S_TO_S_SIZE: + params[0] = INT_TO_BOOLEAN(ctx->Pixel.MapStoSsize); + break; + case GL_POINT_SIZE: + params[0] = FLOAT_TO_BOOLEAN(ctx->Point.Size); + break; + case GL_POINT_SIZE_GRANULARITY: + params[0] = FLOAT_TO_BOOLEAN(ctx->Const.PointSizeGranularity); + break; + case GL_POINT_SIZE_RANGE: + params[0] = FLOAT_TO_BOOLEAN(ctx->Const.MinPointSizeAA); + params[1] = FLOAT_TO_BOOLEAN(ctx->Const.MaxPointSizeAA); + break; + case GL_ALIASED_POINT_SIZE_RANGE: + params[0] = FLOAT_TO_BOOLEAN(ctx->Const.MinPointSize); + params[1] = FLOAT_TO_BOOLEAN(ctx->Const.MaxPointSize); + break; + case GL_POINT_SMOOTH: + params[0] = ctx->Point.SmoothFlag; + break; + case GL_POINT_SMOOTH_HINT: + params[0] = ENUM_TO_BOOLEAN(ctx->Hint.PointSmooth); + break; + case GL_POINT_SIZE_MIN_EXT: + params[0] = FLOAT_TO_BOOLEAN(ctx->Point.MinSize); + break; + case GL_POINT_SIZE_MAX_EXT: + params[0] = FLOAT_TO_BOOLEAN(ctx->Point.MaxSize); + break; + case GL_POINT_FADE_THRESHOLD_SIZE_EXT: + params[0] = FLOAT_TO_BOOLEAN(ctx->Point.Threshold); + break; + case GL_DISTANCE_ATTENUATION_EXT: + params[0] = FLOAT_TO_BOOLEAN(ctx->Point.Params[0]); + params[1] = FLOAT_TO_BOOLEAN(ctx->Point.Params[1]); + params[2] = FLOAT_TO_BOOLEAN(ctx->Point.Params[2]); + break; + case GL_POLYGON_MODE: + params[0] = ENUM_TO_BOOLEAN(ctx->Polygon.FrontMode); + params[1] = ENUM_TO_BOOLEAN(ctx->Polygon.BackMode); + break; + case GL_POLYGON_OFFSET_BIAS_EXT: + params[0] = FLOAT_TO_BOOLEAN(ctx->Polygon.OffsetUnits); + break; + case GL_POLYGON_OFFSET_FACTOR: + params[0] = FLOAT_TO_BOOLEAN(ctx->Polygon.OffsetFactor ); + break; + case GL_POLYGON_OFFSET_UNITS: + params[0] = FLOAT_TO_BOOLEAN(ctx->Polygon.OffsetUnits ); + break; + case GL_POLYGON_SMOOTH: + params[0] = ctx->Polygon.SmoothFlag; + break; + case GL_POLYGON_SMOOTH_HINT: + params[0] = ENUM_TO_BOOLEAN(ctx->Hint.PolygonSmooth); + break; + case GL_POLYGON_STIPPLE: + params[0] = ctx->Polygon.StippleFlag; + break; + case GL_PROJECTION_MATRIX: + { + const GLfloat *matrix = ctx->ProjectionMatrixStack.Top->m; + params[0] = FLOAT_TO_BOOLEAN(matrix[0]); + params[1] = FLOAT_TO_BOOLEAN(matrix[1]); + params[2] = FLOAT_TO_BOOLEAN(matrix[2]); + params[3] = FLOAT_TO_BOOLEAN(matrix[3]); + params[4] = FLOAT_TO_BOOLEAN(matrix[4]); + params[5] = FLOAT_TO_BOOLEAN(matrix[5]); + params[6] = FLOAT_TO_BOOLEAN(matrix[6]); + params[7] = FLOAT_TO_BOOLEAN(matrix[7]); + params[8] = FLOAT_TO_BOOLEAN(matrix[8]); + params[9] = FLOAT_TO_BOOLEAN(matrix[9]); + params[10] = FLOAT_TO_BOOLEAN(matrix[10]); + params[11] = FLOAT_TO_BOOLEAN(matrix[11]); + params[12] = FLOAT_TO_BOOLEAN(matrix[12]); + params[13] = FLOAT_TO_BOOLEAN(matrix[13]); + params[14] = FLOAT_TO_BOOLEAN(matrix[14]); + params[15] = FLOAT_TO_BOOLEAN(matrix[15]); + } + break; + case GL_PROJECTION_STACK_DEPTH: + params[0] = INT_TO_BOOLEAN(ctx->ProjectionMatrixStack.Depth + 1); + break; + case GL_READ_BUFFER: + params[0] = ENUM_TO_BOOLEAN(ctx->ReadBuffer->ColorReadBuffer); + break; + case GL_RED_BIAS: + params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.RedBias); + break; + case GL_RED_BITS: + params[0] = INT_TO_BOOLEAN( ctx->DrawBuffer->Visual.redBits ); + break; + case GL_RED_SCALE: + params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.RedScale); + break; + case GL_RENDER_MODE: + params[0] = ENUM_TO_BOOLEAN(ctx->RenderMode); + break; + case GL_RESCALE_NORMAL: + params[0] = ctx->Transform.RescaleNormals; + break; + case GL_RGBA_MODE: + params[0] = ctx->DrawBuffer->Visual.rgbMode; + break; + case GL_SCISSOR_BOX: + params[0] = INT_TO_BOOLEAN(ctx->Scissor.X); + params[1] = INT_TO_BOOLEAN(ctx->Scissor.Y); + params[2] = INT_TO_BOOLEAN(ctx->Scissor.Width); + params[3] = INT_TO_BOOLEAN(ctx->Scissor.Height); + break; + case GL_SCISSOR_TEST: + params[0] = ctx->Scissor.Enabled; + break; + case GL_SELECTION_BUFFER_SIZE: + params[0] = INT_TO_BOOLEAN(ctx->Select.BufferSize); + break; + case GL_SHADE_MODEL: + params[0] = ENUM_TO_BOOLEAN(ctx->Light.ShadeModel); + break; + case GL_SHARED_TEXTURE_PALETTE_EXT: + params[0] = ctx->Texture.SharedPalette; + break; + case GL_STENCIL_BITS: + params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.stencilBits); + break; + case GL_STENCIL_CLEAR_VALUE: + params[0] = INT_TO_BOOLEAN(ctx->Stencil.Clear); + break; + case GL_STENCIL_FAIL: + params[0] = ENUM_TO_BOOLEAN(ctx->Stencil.FailFunc[ctx->Stencil.ActiveFace]); + break; + case GL_STENCIL_FUNC: + params[0] = ENUM_TO_BOOLEAN(ctx->Stencil.Function[ctx->Stencil.ActiveFace]); + break; + case GL_STENCIL_PASS_DEPTH_FAIL: + params[0] = ENUM_TO_BOOLEAN(ctx->Stencil.ZFailFunc[ctx->Stencil.ActiveFace]); + break; + case GL_STENCIL_PASS_DEPTH_PASS: + params[0] = ENUM_TO_BOOLEAN(ctx->Stencil.ZPassFunc[ctx->Stencil.ActiveFace]); + break; + case GL_STENCIL_REF: + params[0] = INT_TO_BOOLEAN(ctx->Stencil.Ref[ctx->Stencil.ActiveFace]); + break; + case GL_STENCIL_TEST: + params[0] = ctx->Stencil.Enabled; + break; + case GL_STENCIL_VALUE_MASK: + params[0] = INT_TO_BOOLEAN(ctx->Stencil.ValueMask[ctx->Stencil.ActiveFace]); + break; + case GL_STENCIL_WRITEMASK: + params[0] = INT_TO_BOOLEAN(ctx->Stencil.WriteMask[ctx->Stencil.ActiveFace]); + break; + case GL_STEREO: + params[0] = ctx->DrawBuffer->Visual.stereoMode; + break; + case GL_SUBPIXEL_BITS: + params[0] = INT_TO_BOOLEAN(ctx->Const.SubPixelBits); + break; + case GL_TEXTURE_1D: + params[0] = _mesa_IsEnabled(GL_TEXTURE_1D); + break; + case GL_TEXTURE_2D: + params[0] = _mesa_IsEnabled(GL_TEXTURE_2D); + break; + case GL_TEXTURE_3D: + params[0] = _mesa_IsEnabled(GL_TEXTURE_3D); + break; + case GL_TEXTURE_BINDING_1D: + params[0] = INT_TO_BOOLEAN(ctx->Texture.Unit[ctx->Texture.CurrentUnit].Current1D->Name); + break; + case GL_TEXTURE_BINDING_2D: + params[0] = INT_TO_BOOLEAN(ctx->Texture.Unit[ctx->Texture.CurrentUnit].Current2D->Name); + break; + case GL_TEXTURE_BINDING_3D: + params[0] = INT_TO_BOOLEAN(ctx->Texture.Unit[ctx->Texture.CurrentUnit].Current3D->Name); + break; + case GL_TEXTURE_ENV_COLOR: + { + const GLfloat *color = ctx->Texture.Unit[ctx->Texture.CurrentUnit].EnvColor; + params[0] = FLOAT_TO_BOOLEAN(color[0]); + params[1] = FLOAT_TO_BOOLEAN(color[1]); + params[2] = FLOAT_TO_BOOLEAN(color[2]); + params[3] = FLOAT_TO_BOOLEAN(color[3]); + } + break; + case GL_TEXTURE_ENV_MODE: + params[0] = ENUM_TO_BOOLEAN(ctx->Texture.Unit[ctx->Texture.CurrentUnit].EnvMode); + break; + case GL_TEXTURE_GEN_S: + params[0] = ((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & S_BIT) ? 1 : 0); + break; + case GL_TEXTURE_GEN_T: + params[0] = ((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & T_BIT) ? 1 : 0); + break; + case GL_TEXTURE_GEN_R: + params[0] = ((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & R_BIT) ? 1 : 0); + break; + case GL_TEXTURE_GEN_Q: + params[0] = ((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & Q_BIT) ? 1 : 0); + break; + case GL_TEXTURE_MATRIX: + { + const GLfloat *matrix = ctx->TextureMatrixStack[ctx->Texture.CurrentUnit].Top->m; + params[0] = FLOAT_TO_BOOLEAN(matrix[0]); + params[1] = FLOAT_TO_BOOLEAN(matrix[1]); + params[2] = FLOAT_TO_BOOLEAN(matrix[2]); + params[3] = FLOAT_TO_BOOLEAN(matrix[3]); + params[4] = FLOAT_TO_BOOLEAN(matrix[4]); + params[5] = FLOAT_TO_BOOLEAN(matrix[5]); + params[6] = FLOAT_TO_BOOLEAN(matrix[6]); + params[7] = FLOAT_TO_BOOLEAN(matrix[7]); + params[8] = FLOAT_TO_BOOLEAN(matrix[8]); + params[9] = FLOAT_TO_BOOLEAN(matrix[9]); + params[10] = FLOAT_TO_BOOLEAN(matrix[10]); + params[11] = FLOAT_TO_BOOLEAN(matrix[11]); + params[12] = FLOAT_TO_BOOLEAN(matrix[12]); + params[13] = FLOAT_TO_BOOLEAN(matrix[13]); + params[14] = FLOAT_TO_BOOLEAN(matrix[14]); + params[15] = FLOAT_TO_BOOLEAN(matrix[15]); + } + break; + case GL_TEXTURE_STACK_DEPTH: + params[0] = INT_TO_BOOLEAN(ctx->TextureMatrixStack[ctx->Texture.CurrentUnit].Depth + 1); + break; + case GL_UNPACK_ALIGNMENT: + params[0] = INT_TO_BOOLEAN(ctx->Unpack.Alignment); + break; + case GL_UNPACK_LSB_FIRST: + params[0] = ctx->Unpack.LsbFirst; + break; + case GL_UNPACK_ROW_LENGTH: + params[0] = INT_TO_BOOLEAN(ctx->Unpack.RowLength); + break; + case GL_UNPACK_SKIP_PIXELS: + params[0] = INT_TO_BOOLEAN(ctx->Unpack.SkipPixels); + break; + case GL_UNPACK_SKIP_ROWS: + params[0] = INT_TO_BOOLEAN(ctx->Unpack.SkipRows); + break; + case GL_UNPACK_SWAP_BYTES: + params[0] = ctx->Unpack.SwapBytes; + break; + case GL_UNPACK_SKIP_IMAGES_EXT: + params[0] = INT_TO_BOOLEAN(ctx->Unpack.SkipImages); + break; + case GL_UNPACK_IMAGE_HEIGHT_EXT: + params[0] = INT_TO_BOOLEAN(ctx->Unpack.ImageHeight); + break; + case GL_UNPACK_CLIENT_STORAGE_APPLE: + params[0] = ctx->Unpack.ClientStorage; + break; + case GL_VIEWPORT: + params[0] = INT_TO_BOOLEAN(ctx->Viewport.X); + params[1] = INT_TO_BOOLEAN(ctx->Viewport.Y); + params[2] = INT_TO_BOOLEAN(ctx->Viewport.Width); + params[3] = INT_TO_BOOLEAN(ctx->Viewport.Height); + break; + case GL_ZOOM_X: + params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.ZoomX); + break; + case GL_ZOOM_Y: + params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.ZoomY); + break; + case GL_VERTEX_ARRAY: + params[0] = ctx->Array.ArrayObj->Vertex.Enabled; + break; + case GL_VERTEX_ARRAY_SIZE: + params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Vertex.Size); + break; + case GL_VERTEX_ARRAY_TYPE: + params[0] = ENUM_TO_BOOLEAN(ctx->Array.ArrayObj->Vertex.Type); + break; + case GL_VERTEX_ARRAY_STRIDE: + params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Vertex.Stride); + break; + case GL_VERTEX_ARRAY_COUNT_EXT: + params[0] = INT_TO_BOOLEAN(0); + break; + case GL_NORMAL_ARRAY: + params[0] = ENUM_TO_BOOLEAN(ctx->Array.ArrayObj->Normal.Enabled); + break; + case GL_NORMAL_ARRAY_TYPE: + params[0] = ENUM_TO_BOOLEAN(ctx->Array.ArrayObj->Normal.Type); + break; + case GL_NORMAL_ARRAY_STRIDE: + params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Normal.Stride); + break; + case GL_NORMAL_ARRAY_COUNT_EXT: + params[0] = INT_TO_BOOLEAN(0); + break; + case GL_COLOR_ARRAY: + params[0] = ctx->Array.ArrayObj->Color.Enabled; + break; + case GL_COLOR_ARRAY_SIZE: + params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Color.Size); + break; + case GL_COLOR_ARRAY_TYPE: + params[0] = ENUM_TO_BOOLEAN(ctx->Array.ArrayObj->Color.Type); + break; + case GL_COLOR_ARRAY_STRIDE: + params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Color.Stride); + break; + case GL_COLOR_ARRAY_COUNT_EXT: + params[0] = INT_TO_BOOLEAN(0); + break; + case GL_INDEX_ARRAY: + params[0] = ctx->Array.ArrayObj->Index.Enabled; + break; + case GL_INDEX_ARRAY_TYPE: + params[0] = ENUM_TO_BOOLEAN(ctx->Array.ArrayObj->Index.Type); + break; + case GL_INDEX_ARRAY_STRIDE: + params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Index.Stride); + break; + case GL_INDEX_ARRAY_COUNT_EXT: + params[0] = INT_TO_BOOLEAN(0); + break; + case GL_TEXTURE_COORD_ARRAY: + params[0] = ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Enabled; + break; + case GL_TEXTURE_COORD_ARRAY_SIZE: + params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Size); + break; + case GL_TEXTURE_COORD_ARRAY_TYPE: + params[0] = ENUM_TO_BOOLEAN(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Type); + break; + case GL_TEXTURE_COORD_ARRAY_STRIDE: + params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Stride); + break; + case GL_TEXTURE_COORD_ARRAY_COUNT_EXT: + params[0] = INT_TO_BOOLEAN(0); + break; + case GL_EDGE_FLAG_ARRAY: + params[0] = ctx->Array.ArrayObj->EdgeFlag.Enabled; + break; + case GL_EDGE_FLAG_ARRAY_STRIDE: + params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->EdgeFlag.Stride); + break; + case GL_EDGE_FLAG_ARRAY_COUNT_EXT: + params[0] = INT_TO_BOOLEAN(0); + break; + case GL_MAX_TEXTURE_UNITS_ARB: + CHECK_EXT1(ARB_multitexture, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->Const.MaxTextureUnits); + break; + case GL_ACTIVE_TEXTURE_ARB: + CHECK_EXT1(ARB_multitexture, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(GL_TEXTURE0_ARB + ctx->Texture.CurrentUnit); + break; + case GL_CLIENT_ACTIVE_TEXTURE_ARB: + CHECK_EXT1(ARB_multitexture, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(GL_TEXTURE0_ARB + ctx->Array.ActiveTexture); + break; + case GL_TEXTURE_CUBE_MAP_ARB: + CHECK_EXT1(ARB_texture_cube_map, "GetBooleanv"); + params[0] = _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB); + break; + case GL_TEXTURE_BINDING_CUBE_MAP_ARB: + CHECK_EXT1(ARB_texture_cube_map, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentCubeMap->Name); + break; + case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB: + CHECK_EXT1(ARB_texture_cube_map, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN((1 << (ctx->Const.MaxCubeTextureLevels - 1))); + break; + case GL_TEXTURE_COMPRESSION_HINT_ARB: + CHECK_EXT1(ARB_texture_compression, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->Hint.TextureCompression); + break; + case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB: + CHECK_EXT1(ARB_texture_compression, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(_mesa_get_compressed_formats(ctx, NULL, GL_FALSE)); + break; + case GL_COMPRESSED_TEXTURE_FORMATS_ARB: + CHECK_EXT1(ARB_texture_compression, "GetBooleanv"); + { + GLint formats[100]; + GLuint i, n = _mesa_get_compressed_formats(ctx, formats, GL_FALSE); + ASSERT(n <= 100); + for (i = 0; i < n; i++) + params[i] = ENUM_TO_INT(formats[i]); + } + break; + case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT: + CHECK_EXT1(EXT_compiled_vertex_array, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->Array.LockFirst); + break; + case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT: + CHECK_EXT1(EXT_compiled_vertex_array, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->Array.LockCount); + break; + case GL_TRANSPOSE_COLOR_MATRIX_ARB: + { + const GLfloat *matrix = ctx->ColorMatrixStack.Top->m; + params[0] = FLOAT_TO_BOOLEAN(matrix[0]); + params[1] = FLOAT_TO_BOOLEAN(matrix[4]); + params[2] = FLOAT_TO_BOOLEAN(matrix[8]); + params[3] = FLOAT_TO_BOOLEAN(matrix[12]); + params[4] = FLOAT_TO_BOOLEAN(matrix[1]); + params[5] = FLOAT_TO_BOOLEAN(matrix[5]); + params[6] = FLOAT_TO_BOOLEAN(matrix[9]); + params[7] = FLOAT_TO_BOOLEAN(matrix[13]); + params[8] = FLOAT_TO_BOOLEAN(matrix[2]); + params[9] = FLOAT_TO_BOOLEAN(matrix[6]); + params[10] = FLOAT_TO_BOOLEAN(matrix[10]); + params[11] = FLOAT_TO_BOOLEAN(matrix[14]); + params[12] = FLOAT_TO_BOOLEAN(matrix[3]); + params[13] = FLOAT_TO_BOOLEAN(matrix[7]); + params[14] = FLOAT_TO_BOOLEAN(matrix[11]); + params[15] = FLOAT_TO_BOOLEAN(matrix[15]); + } + break; + case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB: + { + const GLfloat *matrix = ctx->ModelviewMatrixStack.Top->m; + params[0] = FLOAT_TO_BOOLEAN(matrix[0]); + params[1] = FLOAT_TO_BOOLEAN(matrix[4]); + params[2] = FLOAT_TO_BOOLEAN(matrix[8]); + params[3] = FLOAT_TO_BOOLEAN(matrix[12]); + params[4] = FLOAT_TO_BOOLEAN(matrix[1]); + params[5] = FLOAT_TO_BOOLEAN(matrix[5]); + params[6] = FLOAT_TO_BOOLEAN(matrix[9]); + params[7] = FLOAT_TO_BOOLEAN(matrix[13]); + params[8] = FLOAT_TO_BOOLEAN(matrix[2]); + params[9] = FLOAT_TO_BOOLEAN(matrix[6]); + params[10] = FLOAT_TO_BOOLEAN(matrix[10]); + params[11] = FLOAT_TO_BOOLEAN(matrix[14]); + params[12] = FLOAT_TO_BOOLEAN(matrix[3]); + params[13] = FLOAT_TO_BOOLEAN(matrix[7]); + params[14] = FLOAT_TO_BOOLEAN(matrix[11]); + params[15] = FLOAT_TO_BOOLEAN(matrix[15]); + } + break; + case GL_TRANSPOSE_PROJECTION_MATRIX_ARB: + { + const GLfloat *matrix = ctx->ProjectionMatrixStack.Top->m; + params[0] = FLOAT_TO_BOOLEAN(matrix[0]); + params[1] = FLOAT_TO_BOOLEAN(matrix[4]); + params[2] = FLOAT_TO_BOOLEAN(matrix[8]); + params[3] = FLOAT_TO_BOOLEAN(matrix[12]); + params[4] = FLOAT_TO_BOOLEAN(matrix[1]); + params[5] = FLOAT_TO_BOOLEAN(matrix[5]); + params[6] = FLOAT_TO_BOOLEAN(matrix[9]); + params[7] = FLOAT_TO_BOOLEAN(matrix[13]); + params[8] = FLOAT_TO_BOOLEAN(matrix[2]); + params[9] = FLOAT_TO_BOOLEAN(matrix[6]); + params[10] = FLOAT_TO_BOOLEAN(matrix[10]); + params[11] = FLOAT_TO_BOOLEAN(matrix[14]); + params[12] = FLOAT_TO_BOOLEAN(matrix[3]); + params[13] = FLOAT_TO_BOOLEAN(matrix[7]); + params[14] = FLOAT_TO_BOOLEAN(matrix[11]); + params[15] = FLOAT_TO_BOOLEAN(matrix[15]); + } + break; + case GL_TRANSPOSE_TEXTURE_MATRIX_ARB: + { + const GLfloat *matrix = ctx->TextureMatrixStack[ctx->Texture.CurrentUnit].Top->m; + params[0] = FLOAT_TO_BOOLEAN(matrix[0]); + params[1] = FLOAT_TO_BOOLEAN(matrix[4]); + params[2] = FLOAT_TO_BOOLEAN(matrix[8]); + params[3] = FLOAT_TO_BOOLEAN(matrix[12]); + params[4] = FLOAT_TO_BOOLEAN(matrix[1]); + params[5] = FLOAT_TO_BOOLEAN(matrix[5]); + params[6] = FLOAT_TO_BOOLEAN(matrix[9]); + params[7] = FLOAT_TO_BOOLEAN(matrix[13]); + params[8] = FLOAT_TO_BOOLEAN(matrix[2]); + params[9] = FLOAT_TO_BOOLEAN(matrix[6]); + params[10] = FLOAT_TO_BOOLEAN(matrix[10]); + params[11] = FLOAT_TO_BOOLEAN(matrix[14]); + params[12] = FLOAT_TO_BOOLEAN(matrix[3]); + params[13] = FLOAT_TO_BOOLEAN(matrix[7]); + params[14] = FLOAT_TO_BOOLEAN(matrix[11]); + params[15] = FLOAT_TO_BOOLEAN(matrix[15]); + } + break; + case GL_COLOR_MATRIX_SGI: + { + const GLfloat *matrix = ctx->ColorMatrixStack.Top->m; + params[0] = FLOAT_TO_BOOLEAN(matrix[0]); + params[1] = FLOAT_TO_BOOLEAN(matrix[1]); + params[2] = FLOAT_TO_BOOLEAN(matrix[2]); + params[3] = FLOAT_TO_BOOLEAN(matrix[3]); + params[4] = FLOAT_TO_BOOLEAN(matrix[4]); + params[5] = FLOAT_TO_BOOLEAN(matrix[5]); + params[6] = FLOAT_TO_BOOLEAN(matrix[6]); + params[7] = FLOAT_TO_BOOLEAN(matrix[7]); + params[8] = FLOAT_TO_BOOLEAN(matrix[8]); + params[9] = FLOAT_TO_BOOLEAN(matrix[9]); + params[10] = FLOAT_TO_BOOLEAN(matrix[10]); + params[11] = FLOAT_TO_BOOLEAN(matrix[11]); + params[12] = FLOAT_TO_BOOLEAN(matrix[12]); + params[13] = FLOAT_TO_BOOLEAN(matrix[13]); + params[14] = FLOAT_TO_BOOLEAN(matrix[14]); + params[15] = FLOAT_TO_BOOLEAN(matrix[15]); + } + break; + case GL_COLOR_MATRIX_STACK_DEPTH_SGI: + params[0] = INT_TO_BOOLEAN(ctx->ColorMatrixStack.Depth + 1); + break; + case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI: + params[0] = INT_TO_BOOLEAN(MAX_COLOR_STACK_DEPTH); + break; + case GL_POST_COLOR_MATRIX_RED_SCALE_SGI: + params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostColorMatrixScale[0]); + break; + case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI: + params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostColorMatrixScale[1]); + break; + case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI: + params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostColorMatrixScale[2]); + break; + case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI: + params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostColorMatrixScale[3]); + break; + case GL_POST_COLOR_MATRIX_RED_BIAS_SGI: + params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostColorMatrixBias[0]); + break; + case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI: + params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostColorMatrixBias[1]); + break; + case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI: + params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostColorMatrixBias[2]); + break; + case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI: + params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostColorMatrixBias[3]); + break; + case GL_CONVOLUTION_1D_EXT: + CHECK_EXT1(EXT_convolution, "GetBooleanv"); + params[0] = ctx->Pixel.Convolution1DEnabled; + break; + case GL_CONVOLUTION_2D_EXT: + CHECK_EXT1(EXT_convolution, "GetBooleanv"); + params[0] = ctx->Pixel.Convolution2DEnabled; + break; + case GL_SEPARABLE_2D_EXT: + CHECK_EXT1(EXT_convolution, "GetBooleanv"); + params[0] = ctx->Pixel.Separable2DEnabled; + break; + case GL_POST_CONVOLUTION_RED_SCALE_EXT: + CHECK_EXT1(EXT_convolution, "GetBooleanv"); + params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostConvolutionScale[0]); + break; + case GL_POST_CONVOLUTION_GREEN_SCALE_EXT: + CHECK_EXT1(EXT_convolution, "GetBooleanv"); + params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostConvolutionScale[1]); + break; + case GL_POST_CONVOLUTION_BLUE_SCALE_EXT: + CHECK_EXT1(EXT_convolution, "GetBooleanv"); + params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostConvolutionScale[2]); + break; + case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT: + CHECK_EXT1(EXT_convolution, "GetBooleanv"); + params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostConvolutionScale[3]); + break; + case GL_POST_CONVOLUTION_RED_BIAS_EXT: + CHECK_EXT1(EXT_convolution, "GetBooleanv"); + params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostConvolutionBias[0]); + break; + case GL_POST_CONVOLUTION_GREEN_BIAS_EXT: + CHECK_EXT1(EXT_convolution, "GetBooleanv"); + params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostConvolutionBias[1]); + break; + case GL_POST_CONVOLUTION_BLUE_BIAS_EXT: + CHECK_EXT1(EXT_convolution, "GetBooleanv"); + params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostConvolutionBias[2]); + break; + case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT: + CHECK_EXT1(EXT_convolution, "GetBooleanv"); + params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostConvolutionBias[3]); + break; + case GL_HISTOGRAM: + CHECK_EXT1(EXT_histogram, "GetBooleanv"); + params[0] = ctx->Pixel.HistogramEnabled; + break; + case GL_MINMAX: + CHECK_EXT1(EXT_histogram, "GetBooleanv"); + params[0] = ctx->Pixel.MinMaxEnabled; + break; + case GL_COLOR_TABLE_SGI: + CHECK_EXT1(SGI_color_table, "GetBooleanv"); + params[0] = ctx->Pixel.ColorTableEnabled; + break; + case GL_POST_CONVOLUTION_COLOR_TABLE_SGI: + CHECK_EXT1(SGI_color_table, "GetBooleanv"); + params[0] = ctx->Pixel.PostConvolutionColorTableEnabled; + break; + case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI: + CHECK_EXT1(SGI_color_table, "GetBooleanv"); + params[0] = ctx->Pixel.PostColorMatrixColorTableEnabled; + break; + case GL_TEXTURE_COLOR_TABLE_SGI: + CHECK_EXT1(SGI_texture_color_table, "GetBooleanv"); + params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].ColorTableEnabled; + break; + case GL_COLOR_SUM_EXT: + CHECK_EXT2(EXT_secondary_color, ARB_vertex_program, "GetBooleanv"); + params[0] = ctx->Fog.ColorSumEnabled; + break; + case GL_CURRENT_SECONDARY_COLOR_EXT: + CHECK_EXT1(EXT_secondary_color, "GetBooleanv"); + { + FLUSH_CURRENT(ctx, 0); + params[0] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0]); + params[1] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1]); + params[2] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2]); + params[3] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][3]); + } + break; + case GL_SECONDARY_COLOR_ARRAY_EXT: + CHECK_EXT1(EXT_secondary_color, "GetBooleanv"); + params[0] = ctx->Array.ArrayObj->SecondaryColor.Enabled; + break; + case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT: + CHECK_EXT1(EXT_secondary_color, "GetBooleanv"); + params[0] = ENUM_TO_BOOLEAN(ctx->Array.ArrayObj->SecondaryColor.Type); + break; + case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT: + CHECK_EXT1(EXT_secondary_color, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->SecondaryColor.Stride); + break; + case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT: + CHECK_EXT1(EXT_secondary_color, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->SecondaryColor.Size); + break; + case GL_CURRENT_FOG_COORDINATE_EXT: + CHECK_EXT1(EXT_fog_coord, "GetBooleanv"); + { + FLUSH_CURRENT(ctx, 0); + params[0] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_FOG][0]); + } + break; + case GL_FOG_COORDINATE_ARRAY_EXT: + CHECK_EXT1(EXT_fog_coord, "GetBooleanv"); + params[0] = ctx->Array.ArrayObj->FogCoord.Enabled; + break; + case GL_FOG_COORDINATE_ARRAY_TYPE_EXT: + CHECK_EXT1(EXT_fog_coord, "GetBooleanv"); + params[0] = ENUM_TO_BOOLEAN(ctx->Array.ArrayObj->FogCoord.Type); + break; + case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT: + CHECK_EXT1(EXT_fog_coord, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->FogCoord.Stride); + break; + case GL_FOG_COORDINATE_SOURCE_EXT: + CHECK_EXT1(EXT_fog_coord, "GetBooleanv"); + params[0] = ENUM_TO_BOOLEAN(ctx->Fog.FogCoordinateSource); + break; + case GL_MAX_TEXTURE_LOD_BIAS_EXT: + CHECK_EXT1(EXT_texture_lod_bias, "GetBooleanv"); + params[0] = FLOAT_TO_BOOLEAN(ctx->Const.MaxTextureLodBias); + break; + case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT: + CHECK_EXT1(EXT_texture_filter_anisotropic, "GetBooleanv"); + params[0] = FLOAT_TO_BOOLEAN(ctx->Const.MaxTextureMaxAnisotropy); + break; + case GL_MULTISAMPLE_ARB: + CHECK_EXT1(ARB_multisample, "GetBooleanv"); + params[0] = ctx->Multisample.Enabled; + break; + case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB: + CHECK_EXT1(ARB_multisample, "GetBooleanv"); + params[0] = ctx->Multisample.SampleAlphaToCoverage; + break; + case GL_SAMPLE_ALPHA_TO_ONE_ARB: + CHECK_EXT1(ARB_multisample, "GetBooleanv"); + params[0] = ctx->Multisample.SampleAlphaToOne; + break; + case GL_SAMPLE_COVERAGE_ARB: + CHECK_EXT1(ARB_multisample, "GetBooleanv"); + params[0] = ctx->Multisample.SampleCoverage; + break; + case GL_SAMPLE_COVERAGE_VALUE_ARB: + CHECK_EXT1(ARB_multisample, "GetBooleanv"); + params[0] = FLOAT_TO_BOOLEAN(ctx->Multisample.SampleCoverageValue); + break; + case GL_SAMPLE_COVERAGE_INVERT_ARB: + CHECK_EXT1(ARB_multisample, "GetBooleanv"); + params[0] = ctx->Multisample.SampleCoverageInvert; + break; + case GL_SAMPLE_BUFFERS_ARB: + CHECK_EXT1(ARB_multisample, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.sampleBuffers); + break; + case GL_SAMPLES_ARB: + CHECK_EXT1(ARB_multisample, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.samples); + break; + case GL_RASTER_POSITION_UNCLIPPED_IBM: + CHECK_EXT1(IBM_rasterpos_clip, "GetBooleanv"); + params[0] = ctx->Transform.RasterPositionUnclipped; + break; + case GL_POINT_SPRITE_NV: + CHECK_EXT2(NV_point_sprite, ARB_point_sprite, "GetBooleanv"); + params[0] = ctx->Point.PointSprite; + break; + case GL_POINT_SPRITE_R_MODE_NV: + CHECK_EXT1(NV_point_sprite, "GetBooleanv"); + params[0] = ENUM_TO_BOOLEAN(ctx->Point.SpriteRMode); + break; + case GL_POINT_SPRITE_COORD_ORIGIN: + CHECK_EXT2(NV_point_sprite, ARB_point_sprite, "GetBooleanv"); + params[0] = ENUM_TO_BOOLEAN(ctx->Point.SpriteOrigin); + break; + case GL_GENERATE_MIPMAP_HINT_SGIS: + CHECK_EXT1(SGIS_generate_mipmap, "GetBooleanv"); + params[0] = ENUM_TO_BOOLEAN(ctx->Hint.GenerateMipmap); + break; + case GL_VERTEX_PROGRAM_BINDING_NV: + CHECK_EXT1(NV_vertex_program, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN((ctx->VertexProgram.Current ? ctx->VertexProgram.Current->Base.Id : 0)); + break; + case GL_VERTEX_ATTRIB_ARRAY0_NV: + CHECK_EXT1(NV_vertex_program, "GetBooleanv"); + params[0] = ctx->Array.ArrayObj->VertexAttrib[0].Enabled; + break; + case GL_VERTEX_ATTRIB_ARRAY1_NV: + CHECK_EXT1(NV_vertex_program, "GetBooleanv"); + params[0] = ctx->Array.ArrayObj->VertexAttrib[1].Enabled; + break; + case GL_VERTEX_ATTRIB_ARRAY2_NV: + CHECK_EXT1(NV_vertex_program, "GetBooleanv"); + params[0] = ctx->Array.ArrayObj->VertexAttrib[2].Enabled; + break; + case GL_VERTEX_ATTRIB_ARRAY3_NV: + CHECK_EXT1(NV_vertex_program, "GetBooleanv"); + params[0] = ctx->Array.ArrayObj->VertexAttrib[3].Enabled; + break; + case GL_VERTEX_ATTRIB_ARRAY4_NV: + CHECK_EXT1(NV_vertex_program, "GetBooleanv"); + params[0] = ctx->Array.ArrayObj->VertexAttrib[4].Enabled; + break; + case GL_VERTEX_ATTRIB_ARRAY5_NV: + CHECK_EXT1(NV_vertex_program, "GetBooleanv"); + params[0] = ctx->Array.ArrayObj->VertexAttrib[5].Enabled; + break; + case GL_VERTEX_ATTRIB_ARRAY6_NV: + CHECK_EXT1(NV_vertex_program, "GetBooleanv"); + params[0] = ctx->Array.ArrayObj->VertexAttrib[6].Enabled; + break; + case GL_VERTEX_ATTRIB_ARRAY7_NV: + CHECK_EXT1(NV_vertex_program, "GetBooleanv"); + params[0] = ctx->Array.ArrayObj->VertexAttrib[7].Enabled; + break; + case GL_VERTEX_ATTRIB_ARRAY8_NV: + CHECK_EXT1(NV_vertex_program, "GetBooleanv"); + params[0] = ctx->Array.ArrayObj->VertexAttrib[8].Enabled; + break; + case GL_VERTEX_ATTRIB_ARRAY9_NV: + CHECK_EXT1(NV_vertex_program, "GetBooleanv"); + params[0] = ctx->Array.ArrayObj->VertexAttrib[9].Enabled; + break; + case GL_VERTEX_ATTRIB_ARRAY10_NV: + CHECK_EXT1(NV_vertex_program, "GetBooleanv"); + params[0] = ctx->Array.ArrayObj->VertexAttrib[10].Enabled; + break; + case GL_VERTEX_ATTRIB_ARRAY11_NV: + CHECK_EXT1(NV_vertex_program, "GetBooleanv"); + params[0] = ctx->Array.ArrayObj->VertexAttrib[11].Enabled; + break; + case GL_VERTEX_ATTRIB_ARRAY12_NV: + CHECK_EXT1(NV_vertex_program, "GetBooleanv"); + params[0] = ctx->Array.ArrayObj->VertexAttrib[12].Enabled; + break; + case GL_VERTEX_ATTRIB_ARRAY13_NV: + CHECK_EXT1(NV_vertex_program, "GetBooleanv"); + params[0] = ctx->Array.ArrayObj->VertexAttrib[13].Enabled; + break; + case GL_VERTEX_ATTRIB_ARRAY14_NV: + CHECK_EXT1(NV_vertex_program, "GetBooleanv"); + params[0] = ctx->Array.ArrayObj->VertexAttrib[14].Enabled; + break; + case GL_VERTEX_ATTRIB_ARRAY15_NV: + CHECK_EXT1(NV_vertex_program, "GetBooleanv"); + params[0] = ctx->Array.ArrayObj->VertexAttrib[15].Enabled; + break; + case GL_MAP1_VERTEX_ATTRIB0_4_NV: + CHECK_EXT1(NV_vertex_program, "GetBooleanv"); + params[0] = ctx->Eval.Map1Attrib[0]; + break; + case GL_MAP1_VERTEX_ATTRIB1_4_NV: + CHECK_EXT1(NV_vertex_program, "GetBooleanv"); + params[0] = ctx->Eval.Map1Attrib[1]; + break; + case GL_MAP1_VERTEX_ATTRIB2_4_NV: + CHECK_EXT1(NV_vertex_program, "GetBooleanv"); + params[0] = ctx->Eval.Map1Attrib[2]; + break; + case GL_MAP1_VERTEX_ATTRIB3_4_NV: + CHECK_EXT1(NV_vertex_program, "GetBooleanv"); + params[0] = ctx->Eval.Map1Attrib[3]; + break; + case GL_MAP1_VERTEX_ATTRIB4_4_NV: + CHECK_EXT1(NV_vertex_program, "GetBooleanv"); + params[0] = ctx->Eval.Map1Attrib[4]; + break; + case GL_MAP1_VERTEX_ATTRIB5_4_NV: + CHECK_EXT1(NV_vertex_program, "GetBooleanv"); + params[0] = ctx->Eval.Map1Attrib[5]; + break; + case GL_MAP1_VERTEX_ATTRIB6_4_NV: + CHECK_EXT1(NV_vertex_program, "GetBooleanv"); + params[0] = ctx->Eval.Map1Attrib[6]; + break; + case GL_MAP1_VERTEX_ATTRIB7_4_NV: + CHECK_EXT1(NV_vertex_program, "GetBooleanv"); + params[0] = ctx->Eval.Map1Attrib[7]; + break; + case GL_MAP1_VERTEX_ATTRIB8_4_NV: + CHECK_EXT1(NV_vertex_program, "GetBooleanv"); + params[0] = ctx->Eval.Map1Attrib[8]; + break; + case GL_MAP1_VERTEX_ATTRIB9_4_NV: + CHECK_EXT1(NV_vertex_program, "GetBooleanv"); + params[0] = ctx->Eval.Map1Attrib[9]; + break; + case GL_MAP1_VERTEX_ATTRIB10_4_NV: + CHECK_EXT1(NV_vertex_program, "GetBooleanv"); + params[0] = ctx->Eval.Map1Attrib[10]; + break; + case GL_MAP1_VERTEX_ATTRIB11_4_NV: + CHECK_EXT1(NV_vertex_program, "GetBooleanv"); + params[0] = ctx->Eval.Map1Attrib[11]; + break; + case GL_MAP1_VERTEX_ATTRIB12_4_NV: + CHECK_EXT1(NV_vertex_program, "GetBooleanv"); + params[0] = ctx->Eval.Map1Attrib[12]; + break; + case GL_MAP1_VERTEX_ATTRIB13_4_NV: + CHECK_EXT1(NV_vertex_program, "GetBooleanv"); + params[0] = ctx->Eval.Map1Attrib[13]; + break; + case GL_MAP1_VERTEX_ATTRIB14_4_NV: + CHECK_EXT1(NV_vertex_program, "GetBooleanv"); + params[0] = ctx->Eval.Map1Attrib[14]; + break; + case GL_MAP1_VERTEX_ATTRIB15_4_NV: + CHECK_EXT1(NV_vertex_program, "GetBooleanv"); + params[0] = ctx->Eval.Map1Attrib[15]; + break; + case GL_FRAGMENT_PROGRAM_NV: + CHECK_EXT1(NV_fragment_program, "GetBooleanv"); + params[0] = ctx->FragmentProgram.Enabled; + break; + case GL_FRAGMENT_PROGRAM_BINDING_NV: + CHECK_EXT1(NV_fragment_program, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->FragmentProgram.Current ? ctx->FragmentProgram.Current->Base.Id : 0); + break; + case GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV: + CHECK_EXT1(NV_fragment_program, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(MAX_NV_FRAGMENT_PROGRAM_PARAMS); + break; + case GL_TEXTURE_RECTANGLE_NV: + CHECK_EXT1(NV_texture_rectangle, "GetBooleanv"); + params[0] = _mesa_IsEnabled(GL_TEXTURE_RECTANGLE_NV); + break; + case GL_TEXTURE_BINDING_RECTANGLE_NV: + CHECK_EXT1(NV_texture_rectangle, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentRect->Name); + break; + case GL_MAX_RECTANGLE_TEXTURE_SIZE_NV: + CHECK_EXT1(NV_texture_rectangle, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->Const.MaxTextureRectSize); + break; + case GL_STENCIL_TEST_TWO_SIDE_EXT: + CHECK_EXT1(EXT_stencil_two_side, "GetBooleanv"); + params[0] = ctx->Stencil.TestTwoSide; + break; + case GL_ACTIVE_STENCIL_FACE_EXT: + CHECK_EXT1(EXT_stencil_two_side, "GetBooleanv"); + params[0] = ENUM_TO_BOOLEAN(ctx->Stencil.ActiveFace ? GL_BACK : GL_FRONT); + break; + case GL_MAX_SHININESS_NV: + CHECK_EXT1(NV_light_max_exponent, "GetBooleanv"); + params[0] = FLOAT_TO_BOOLEAN(ctx->Const.MaxShininess); + break; + case GL_MAX_SPOT_EXPONENT_NV: + CHECK_EXT1(NV_light_max_exponent, "GetBooleanv"); + params[0] = FLOAT_TO_BOOLEAN(ctx->Const.MaxSpotExponent); + break; + case GL_ARRAY_BUFFER_BINDING_ARB: + CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayBufferObj->Name); + break; + case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB: + CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Vertex.BufferObj->Name); + break; + case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB: + CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Normal.BufferObj->Name); + break; + case GL_COLOR_ARRAY_BUFFER_BINDING_ARB: + CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Color.BufferObj->Name); + break; + case GL_INDEX_ARRAY_BUFFER_BINDING_ARB: + CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Index.BufferObj->Name); + break; + case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB: + CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].BufferObj->Name); + break; + case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB: + CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->EdgeFlag.BufferObj->Name); + break; + case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB: + CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->SecondaryColor.BufferObj->Name); + break; + case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB: + CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->FogCoord.BufferObj->Name); + break; + case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB: + CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->Array.ElementArrayBufferObj->Name); + break; + case GL_PIXEL_PACK_BUFFER_BINDING_EXT: + CHECK_EXT1(EXT_pixel_buffer_object, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->Pack.BufferObj->Name); + break; + case GL_PIXEL_UNPACK_BUFFER_BINDING_EXT: + CHECK_EXT1(EXT_pixel_buffer_object, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->Unpack.BufferObj->Name); + break; + case GL_VERTEX_PROGRAM_ARB: + CHECK_EXT2(ARB_vertex_program, NV_vertex_program, "GetBooleanv"); + params[0] = ctx->VertexProgram.Enabled; + break; + case GL_VERTEX_PROGRAM_POINT_SIZE_ARB: + CHECK_EXT2(ARB_vertex_program, NV_vertex_program, "GetBooleanv"); + params[0] = ctx->VertexProgram.PointSizeEnabled; + break; + case GL_VERTEX_PROGRAM_TWO_SIDE_ARB: + CHECK_EXT2(ARB_vertex_program, NV_vertex_program, "GetBooleanv"); + params[0] = ctx->VertexProgram.TwoSideEnabled; + break; + case GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB: + CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_vertex_program, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->Const.MaxProgramMatrixStackDepth); + break; + case GL_MAX_PROGRAM_MATRICES_ARB: + CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_vertex_program, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->Const.MaxProgramMatrices); + break; + case GL_CURRENT_MATRIX_STACK_DEPTH_ARB: + CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_vertex_program, "GetBooleanv"); + params[0] = ctx->CurrentStack->Depth + 1; + break; + case GL_CURRENT_MATRIX_ARB: + CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_fragment_program, "GetBooleanv"); + { + const GLfloat *matrix = ctx->CurrentStack->Top->m; + params[0] = FLOAT_TO_BOOLEAN(matrix[0]); + params[1] = FLOAT_TO_BOOLEAN(matrix[1]); + params[2] = FLOAT_TO_BOOLEAN(matrix[2]); + params[3] = FLOAT_TO_BOOLEAN(matrix[3]); + params[4] = FLOAT_TO_BOOLEAN(matrix[4]); + params[5] = FLOAT_TO_BOOLEAN(matrix[5]); + params[6] = FLOAT_TO_BOOLEAN(matrix[6]); + params[7] = FLOAT_TO_BOOLEAN(matrix[7]); + params[8] = FLOAT_TO_BOOLEAN(matrix[8]); + params[9] = FLOAT_TO_BOOLEAN(matrix[9]); + params[10] = FLOAT_TO_BOOLEAN(matrix[10]); + params[11] = FLOAT_TO_BOOLEAN(matrix[11]); + params[12] = FLOAT_TO_BOOLEAN(matrix[12]); + params[13] = FLOAT_TO_BOOLEAN(matrix[13]); + params[14] = FLOAT_TO_BOOLEAN(matrix[14]); + params[15] = FLOAT_TO_BOOLEAN(matrix[15]); + } + break; + case GL_TRANSPOSE_CURRENT_MATRIX_ARB: + CHECK_EXT2(ARB_vertex_program, ARB_fragment_program, "GetBooleanv"); + { + const GLfloat *matrix = ctx->CurrentStack->Top->m; + params[0] = FLOAT_TO_BOOLEAN(matrix[0]); + params[1] = FLOAT_TO_BOOLEAN(matrix[4]); + params[2] = FLOAT_TO_BOOLEAN(matrix[8]); + params[3] = FLOAT_TO_BOOLEAN(matrix[12]); + params[4] = FLOAT_TO_BOOLEAN(matrix[1]); + params[5] = FLOAT_TO_BOOLEAN(matrix[5]); + params[6] = FLOAT_TO_BOOLEAN(matrix[9]); + params[7] = FLOAT_TO_BOOLEAN(matrix[13]); + params[8] = FLOAT_TO_BOOLEAN(matrix[2]); + params[9] = FLOAT_TO_BOOLEAN(matrix[6]); + params[10] = FLOAT_TO_BOOLEAN(matrix[10]); + params[11] = FLOAT_TO_BOOLEAN(matrix[14]); + params[12] = FLOAT_TO_BOOLEAN(matrix[3]); + params[13] = FLOAT_TO_BOOLEAN(matrix[7]); + params[14] = FLOAT_TO_BOOLEAN(matrix[11]); + params[15] = FLOAT_TO_BOOLEAN(matrix[15]); + } + break; + case GL_MAX_VERTEX_ATTRIBS_ARB: + CHECK_EXT1(ARB_vertex_program, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->Const.VertexProgram.MaxAttribs); + break; + case GL_PROGRAM_ERROR_POSITION_ARB: + CHECK_EXT4(NV_vertex_program, ARB_vertex_program, NV_fragment_program, ARB_fragment_program, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->Program.ErrorPos); + break; + case GL_FRAGMENT_PROGRAM_ARB: + CHECK_EXT1(ARB_fragment_program, "GetBooleanv"); + params[0] = ctx->FragmentProgram.Enabled; + break; + case GL_MAX_TEXTURE_COORDS_ARB: + CHECK_EXT2(ARB_fragment_program, NV_fragment_program, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->Const.MaxTextureCoordUnits); + break; + case GL_MAX_TEXTURE_IMAGE_UNITS_ARB: + CHECK_EXT2(ARB_fragment_program, NV_fragment_program, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->Const.MaxTextureImageUnits); + break; + case GL_DEPTH_BOUNDS_TEST_EXT: + CHECK_EXT1(EXT_depth_bounds_test, "GetBooleanv"); + params[0] = ctx->Depth.BoundsTest; + break; + case GL_DEPTH_BOUNDS_EXT: + CHECK_EXT1(EXT_depth_bounds_test, "GetBooleanv"); + params[0] = FLOAT_TO_BOOLEAN(ctx->Depth.BoundsMin); + params[1] = FLOAT_TO_BOOLEAN(ctx->Depth.BoundsMax); + break; + case GL_FRAGMENT_PROGRAM_CALLBACK_MESA: + CHECK_EXT1(MESA_program_debug, "GetBooleanv"); + params[0] = ctx->FragmentProgram.CallbackEnabled; + break; + case GL_VERTEX_PROGRAM_CALLBACK_MESA: + CHECK_EXT1(MESA_program_debug, "GetBooleanv"); + params[0] = ctx->VertexProgram.CallbackEnabled; + break; + case GL_FRAGMENT_PROGRAM_POSITION_MESA: + CHECK_EXT1(MESA_program_debug, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->FragmentProgram.CurrentPosition); + break; + case GL_VERTEX_PROGRAM_POSITION_MESA: + CHECK_EXT1(MESA_program_debug, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->VertexProgram.CurrentPosition); + break; + case GL_MAX_DRAW_BUFFERS_ARB: + CHECK_EXT1(ARB_draw_buffers, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->Const.MaxDrawBuffers); + break; + case GL_DRAW_BUFFER0_ARB: + CHECK_EXT1(ARB_draw_buffers, "GetBooleanv"); + params[0] = ENUM_TO_BOOLEAN(ctx->DrawBuffer->ColorDrawBuffer[0]); + break; + case GL_DRAW_BUFFER1_ARB: + CHECK_EXT1(ARB_draw_buffers, "GetBooleanv"); + { + GLenum buffer; + if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) { + _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)"); + return; + } + buffer = ctx->DrawBuffer->ColorDrawBuffer[1]; + params[0] = ENUM_TO_BOOLEAN(buffer); + } + break; + case GL_DRAW_BUFFER2_ARB: + CHECK_EXT1(ARB_draw_buffers, "GetBooleanv"); + { + GLenum buffer; + if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) { + _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)"); + return; + } + buffer = ctx->DrawBuffer->ColorDrawBuffer[2]; + params[0] = ENUM_TO_BOOLEAN(buffer); + } + break; + case GL_DRAW_BUFFER3_ARB: + CHECK_EXT1(ARB_draw_buffers, "GetBooleanv"); + { + GLenum buffer; + if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) { + _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)"); + return; + } + buffer = ctx->DrawBuffer->ColorDrawBuffer[3]; + params[0] = ENUM_TO_BOOLEAN(buffer); + } + break; + case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES: + CHECK_EXT1(OES_read_format, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->Const.ColorReadType); + break; + case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES: + CHECK_EXT1(OES_read_format, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->Const.ColorReadFormat); + break; + case GL_NUM_FRAGMENT_REGISTERS_ATI: + CHECK_EXT1(ATI_fragment_shader, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(6); + break; + case GL_NUM_FRAGMENT_CONSTANTS_ATI: + CHECK_EXT1(ATI_fragment_shader, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(8); + break; + case GL_NUM_PASSES_ATI: + CHECK_EXT1(ATI_fragment_shader, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(2); + break; + case GL_NUM_INSTRUCTIONS_PER_PASS_ATI: + CHECK_EXT1(ATI_fragment_shader, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(8); + break; + case GL_NUM_INSTRUCTIONS_TOTAL_ATI: + CHECK_EXT1(ATI_fragment_shader, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(16); + break; + case GL_COLOR_ALPHA_PAIRING_ATI: + CHECK_EXT1(ATI_fragment_shader, "GetBooleanv"); + params[0] = GL_TRUE; + break; + case GL_NUM_LOOPBACK_COMPONENTS_ATI: + CHECK_EXT1(ATI_fragment_shader, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(3); + break; + case GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI: + CHECK_EXT1(ATI_fragment_shader, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(3); + break; + case GL_STENCIL_BACK_FUNC: + params[0] = ENUM_TO_BOOLEAN(ctx->Stencil.Function[1]); + break; + case GL_STENCIL_BACK_VALUE_MASK: + params[0] = INT_TO_BOOLEAN(ctx->Stencil.ValueMask[1]); + break; + case GL_STENCIL_BACK_REF: + params[0] = INT_TO_BOOLEAN(ctx->Stencil.Ref[1]); + break; + case GL_STENCIL_BACK_FAIL: + params[0] = ENUM_TO_BOOLEAN(ctx->Stencil.FailFunc[1]); + break; + case GL_STENCIL_BACK_PASS_DEPTH_FAIL: + params[0] = ENUM_TO_BOOLEAN(ctx->Stencil.ZFailFunc[1]); + break; + case GL_STENCIL_BACK_PASS_DEPTH_PASS: + params[0] = ENUM_TO_BOOLEAN(ctx->Stencil.ZPassFunc[1]); + break; + case GL_FRAMEBUFFER_BINDING_EXT: + CHECK_EXT1(EXT_framebuffer_object, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Name); + break; + case GL_RENDERBUFFER_BINDING_EXT: + CHECK_EXT1(EXT_framebuffer_object, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->CurrentRenderbuffer ? ctx->CurrentRenderbuffer->Name : 0); + break; + case GL_MAX_COLOR_ATTACHMENTS_EXT: + CHECK_EXT1(EXT_framebuffer_object, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->Const.MaxColorAttachments); + break; + case GL_MAX_RENDERBUFFER_SIZE_EXT: + CHECK_EXT1(EXT_framebuffer_object, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->Const.MaxRenderbufferSize); + break; + case GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB: + CHECK_EXT1(ARB_fragment_shader, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(MAX_FRAGMENT_UNIFORM_COMPONENTS); + break; + case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB: + CHECK_EXT1(ARB_fragment_shader, "GetBooleanv"); + params[0] = ENUM_TO_BOOLEAN(ctx->Hint.FragmentShaderDerivative); + break; + case GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB: + CHECK_EXT1(ARB_vertex_shader, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(MAX_VERTEX_UNIFORM_COMPONENTS); + break; + case GL_MAX_VARYING_FLOATS_ARB: + CHECK_EXT1(ARB_vertex_shader, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(MAX_VARYING_FLOATS); + break; + case GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB: + CHECK_EXT1(ARB_vertex_shader, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(MAX_VERTEX_TEXTURE_IMAGE_UNITS); + break; + case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB: + CHECK_EXT1(ARB_vertex_shader, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(MAX_COMBINED_TEXTURE_IMAGE_UNITS); + break; + default: + _mesa_error(ctx, GL_INVALID_ENUM, "glGetBooleanv(pname=0x%x)", pname); + } +} + +void GLAPIENTRY +_mesa_GetFloatv( GLenum pname, GLfloat *params ) +{ + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + + if (!params) + return; + + if (ctx->NewState) + _mesa_update_state(ctx); + + if (ctx->Driver.GetFloatv && + ctx->Driver.GetFloatv(ctx, pname, params)) + return; + + switch (pname) { + case GL_ACCUM_RED_BITS: + params[0] = (GLfloat)(ctx->DrawBuffer->Visual.accumRedBits); + break; + case GL_ACCUM_GREEN_BITS: + params[0] = (GLfloat)(ctx->DrawBuffer->Visual.accumGreenBits); + break; + case GL_ACCUM_BLUE_BITS: + params[0] = (GLfloat)(ctx->DrawBuffer->Visual.accumBlueBits); + break; + case GL_ACCUM_ALPHA_BITS: + params[0] = (GLfloat)(ctx->DrawBuffer->Visual.accumAlphaBits); + break; + case GL_ACCUM_CLEAR_VALUE: + params[0] = ctx->Accum.ClearColor[0]; + params[1] = ctx->Accum.ClearColor[1]; + params[2] = ctx->Accum.ClearColor[2]; + params[3] = ctx->Accum.ClearColor[3]; + break; + case GL_ALPHA_BIAS: + params[0] = ctx->Pixel.AlphaBias; + break; + case GL_ALPHA_BITS: + params[0] = (GLfloat)(ctx->DrawBuffer->Visual.alphaBits); + break; + case GL_ALPHA_SCALE: + params[0] = ctx->Pixel.AlphaScale; + break; + case GL_ALPHA_TEST: + params[0] = BOOLEAN_TO_FLOAT(ctx->Color.AlphaEnabled); + break; + case GL_ALPHA_TEST_FUNC: + params[0] = ENUM_TO_FLOAT(ctx->Color.AlphaFunc); + break; + case GL_ALPHA_TEST_REF: + params[0] = ctx->Color.AlphaRef; + break; + case GL_ATTRIB_STACK_DEPTH: + params[0] = (GLfloat)(ctx->AttribStackDepth); + break; + case GL_AUTO_NORMAL: + params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.AutoNormal); + break; + case GL_AUX_BUFFERS: + params[0] = (GLfloat)(ctx->DrawBuffer->Visual.numAuxBuffers); + break; + case GL_BLEND: + params[0] = BOOLEAN_TO_FLOAT(ctx->Color.BlendEnabled); + break; + case GL_BLEND_DST: + params[0] = ENUM_TO_FLOAT(ctx->Color.BlendDstRGB); + break; + case GL_BLEND_SRC: + params[0] = ENUM_TO_FLOAT(ctx->Color.BlendSrcRGB); + break; + case GL_BLEND_SRC_RGB_EXT: + params[0] = ENUM_TO_FLOAT(ctx->Color.BlendSrcRGB); + break; + case GL_BLEND_DST_RGB_EXT: + params[0] = ENUM_TO_FLOAT(ctx->Color.BlendDstRGB); + break; + case GL_BLEND_SRC_ALPHA_EXT: + params[0] = ENUM_TO_FLOAT(ctx->Color.BlendSrcA); + break; + case GL_BLEND_DST_ALPHA_EXT: + params[0] = ENUM_TO_FLOAT(ctx->Color.BlendDstA); + break; + case GL_BLEND_EQUATION: + params[0] = ENUM_TO_FLOAT(ctx->Color.BlendEquationRGB ); + break; + case GL_BLEND_EQUATION_ALPHA_EXT: + params[0] = ENUM_TO_FLOAT(ctx->Color.BlendEquationA ); + break; + case GL_BLEND_COLOR_EXT: + params[0] = ctx->Color.BlendColor[0]; + params[1] = ctx->Color.BlendColor[1]; + params[2] = ctx->Color.BlendColor[2]; + params[3] = ctx->Color.BlendColor[3]; + break; + case GL_BLUE_BIAS: + params[0] = ctx->Pixel.BlueBias; + break; + case GL_BLUE_BITS: + params[0] = (GLfloat)(ctx->DrawBuffer->Visual.blueBits); + break; + case GL_BLUE_SCALE: + params[0] = ctx->Pixel.BlueScale; + break; + case GL_CLIENT_ATTRIB_STACK_DEPTH: + params[0] = (GLfloat)(ctx->ClientAttribStackDepth); + break; + case GL_CLIP_PLANE0: + params[0] = BOOLEAN_TO_FLOAT((ctx->Transform.ClipPlanesEnabled >> 0) & 1); + break; + case GL_CLIP_PLANE1: + params[0] = BOOLEAN_TO_FLOAT((ctx->Transform.ClipPlanesEnabled >> 1) & 1); + break; + case GL_CLIP_PLANE2: + params[0] = BOOLEAN_TO_FLOAT((ctx->Transform.ClipPlanesEnabled >> 2) & 1); + break; + case GL_CLIP_PLANE3: + params[0] = BOOLEAN_TO_FLOAT((ctx->Transform.ClipPlanesEnabled >> 3) & 1); + break; + case GL_CLIP_PLANE4: + params[0] = BOOLEAN_TO_FLOAT((ctx->Transform.ClipPlanesEnabled >> 4) & 1); + break; + case GL_CLIP_PLANE5: + params[0] = BOOLEAN_TO_FLOAT((ctx->Transform.ClipPlanesEnabled >> 5) & 1); + break; + case GL_COLOR_CLEAR_VALUE: + params[0] = ctx->Color.ClearColor[0]; + params[1] = ctx->Color.ClearColor[1]; + params[2] = ctx->Color.ClearColor[2]; + params[3] = ctx->Color.ClearColor[3]; + break; + case GL_COLOR_MATERIAL: + params[0] = BOOLEAN_TO_FLOAT(ctx->Light.ColorMaterialEnabled); + break; + case GL_COLOR_MATERIAL_FACE: + params[0] = ENUM_TO_FLOAT(ctx->Light.ColorMaterialFace); + break; + case GL_COLOR_MATERIAL_PARAMETER: + params[0] = ENUM_TO_FLOAT(ctx->Light.ColorMaterialMode); + break; + case GL_COLOR_WRITEMASK: + params[0] = (GLfloat)(ctx->Color.ColorMask[RCOMP] ? 1 : 0); + params[1] = (GLfloat)(ctx->Color.ColorMask[GCOMP] ? 1 : 0); + params[2] = (GLfloat)(ctx->Color.ColorMask[BCOMP] ? 1 : 0); + params[3] = (GLfloat)(ctx->Color.ColorMask[ACOMP] ? 1 : 0); + break; + case GL_CULL_FACE: + params[0] = BOOLEAN_TO_FLOAT(ctx->Polygon.CullFlag); + break; + case GL_CULL_FACE_MODE: + params[0] = ENUM_TO_FLOAT(ctx->Polygon.CullFaceMode); + break; + case GL_CURRENT_COLOR: + { + FLUSH_CURRENT(ctx, 0); + params[0] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0]; + params[1] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1]; + params[2] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2]; + params[3] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3]; + } + break; + case GL_CURRENT_INDEX: + { + FLUSH_CURRENT(ctx, 0); + params[0] = ctx->Current.Attrib[VERT_ATTRIB_COLOR_INDEX][0]; + } + break; + case GL_CURRENT_NORMAL: + { + FLUSH_CURRENT(ctx, 0); + params[0] = ctx->Current.Attrib[VERT_ATTRIB_NORMAL][0]; + params[1] = ctx->Current.Attrib[VERT_ATTRIB_NORMAL][1]; + params[2] = ctx->Current.Attrib[VERT_ATTRIB_NORMAL][2]; + } + break; + case GL_CURRENT_RASTER_COLOR: + params[0] = ctx->Current.RasterColor[0]; + params[1] = ctx->Current.RasterColor[1]; + params[2] = ctx->Current.RasterColor[2]; + params[3] = ctx->Current.RasterColor[3]; + break; + case GL_CURRENT_RASTER_DISTANCE: + params[0] = ctx->Current.RasterDistance; + break; + case GL_CURRENT_RASTER_INDEX: + params[0] = ctx->Current.RasterIndex; + break; + case GL_CURRENT_RASTER_POSITION: + params[0] = ctx->Current.RasterPos[0]; + params[1] = ctx->Current.RasterPos[1]; + params[2] = ctx->Current.RasterPos[2]; + params[3] = ctx->Current.RasterPos[3]; + break; + case GL_CURRENT_RASTER_SECONDARY_COLOR: + params[0] = ctx->Current.RasterSecondaryColor[0]; + params[1] = ctx->Current.RasterSecondaryColor[1]; + params[2] = ctx->Current.RasterSecondaryColor[2]; + params[3] = ctx->Current.RasterSecondaryColor[3]; + break; + case GL_CURRENT_RASTER_TEXTURE_COORDS: + { + const GLuint texUnit = ctx->Texture.CurrentUnit; + params[0] = ctx->Current.RasterTexCoords[texUnit][0]; + params[1] = ctx->Current.RasterTexCoords[texUnit][1]; + params[2] = ctx->Current.RasterTexCoords[texUnit][2]; + params[3] = ctx->Current.RasterTexCoords[texUnit][3]; + } + break; + case GL_CURRENT_RASTER_POSITION_VALID: + params[0] = BOOLEAN_TO_FLOAT(ctx->Current.RasterPosValid); + break; + case GL_CURRENT_TEXTURE_COORDS: + { + const GLuint texUnit = ctx->Texture.CurrentUnit; + params[0] = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][0]; + params[1] = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][1]; + params[2] = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][2]; + params[3] = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][3]; + } + break; + case GL_DEPTH_BIAS: + params[0] = ctx->Pixel.DepthBias; + break; + case GL_DEPTH_BITS: + params[0] = (GLfloat)(ctx->DrawBuffer->Visual.depthBits); + break; + case GL_DEPTH_CLEAR_VALUE: + params[0] = ctx->Depth.Clear; + break; + case GL_DEPTH_FUNC: + params[0] = ENUM_TO_FLOAT(ctx->Depth.Func); + break; + case GL_DEPTH_RANGE: + params[0] = ctx->Viewport.Near; + params[1] = ctx->Viewport.Far; + break; + case GL_DEPTH_SCALE: + params[0] = ctx->Pixel.DepthScale; + break; + case GL_DEPTH_TEST: + params[0] = BOOLEAN_TO_FLOAT(ctx->Depth.Test); + break; + case GL_DEPTH_WRITEMASK: + params[0] = BOOLEAN_TO_FLOAT(ctx->Depth.Mask); + break; + case GL_DITHER: + params[0] = BOOLEAN_TO_FLOAT(ctx->Color.DitherFlag); + break; + case GL_DOUBLEBUFFER: + params[0] = BOOLEAN_TO_FLOAT(ctx->DrawBuffer->Visual.doubleBufferMode); + break; + case GL_DRAW_BUFFER: + params[0] = ENUM_TO_FLOAT(ctx->DrawBuffer->ColorDrawBuffer[0]); + break; + case GL_EDGE_FLAG: + { + FLUSH_CURRENT(ctx, 0); + params[0] = BOOLEAN_TO_FLOAT(ctx->Current.EdgeFlag); + } + break; + case GL_FEEDBACK_BUFFER_SIZE: + params[0] = (GLfloat)(ctx->Feedback.BufferSize); + break; + case GL_FEEDBACK_BUFFER_TYPE: + params[0] = ENUM_TO_FLOAT(ctx->Feedback.Type); + break; + case GL_FOG: + params[0] = BOOLEAN_TO_FLOAT(ctx->Fog.Enabled); + break; + case GL_FOG_COLOR: + params[0] = ctx->Fog.Color[0]; + params[1] = ctx->Fog.Color[1]; + params[2] = ctx->Fog.Color[2]; + params[3] = ctx->Fog.Color[3]; + break; + case GL_FOG_DENSITY: + params[0] = ctx->Fog.Density; + break; + case GL_FOG_END: + params[0] = ctx->Fog.End; + break; + case GL_FOG_HINT: + params[0] = ENUM_TO_FLOAT(ctx->Hint.Fog); + break; + case GL_FOG_INDEX: + params[0] = ctx->Fog.Index; + break; + case GL_FOG_MODE: + params[0] = ENUM_TO_FLOAT(ctx->Fog.Mode); + break; + case GL_FOG_START: + params[0] = ctx->Fog.Start; + break; + case GL_FRONT_FACE: + params[0] = ENUM_TO_FLOAT(ctx->Polygon.FrontFace); + break; + case GL_GREEN_BIAS: + params[0] = ctx->Pixel.GreenBias; + break; + case GL_GREEN_BITS: + params[0] = (GLfloat)(ctx->DrawBuffer->Visual.greenBits); + break; + case GL_GREEN_SCALE: + params[0] = ctx->Pixel.GreenScale; + break; + case GL_INDEX_BITS: + params[0] = (GLfloat)(ctx->DrawBuffer->Visual.indexBits); + break; + case GL_INDEX_CLEAR_VALUE: + params[0] = (GLfloat)(ctx->Color.ClearIndex); + break; + case GL_INDEX_MODE: + params[0] = BOOLEAN_TO_FLOAT(!ctx->DrawBuffer->Visual.rgbMode); + break; + case GL_INDEX_OFFSET: + params[0] = (GLfloat)(ctx->Pixel.IndexOffset); + break; + case GL_INDEX_SHIFT: + params[0] = (GLfloat)(ctx->Pixel.IndexShift); + break; + case GL_INDEX_WRITEMASK: + params[0] = (GLfloat)(ctx->Color.IndexMask); + break; + case GL_LIGHT0: + params[0] = BOOLEAN_TO_FLOAT(ctx->Light.Light[0].Enabled); + break; + case GL_LIGHT1: + params[0] = BOOLEAN_TO_FLOAT(ctx->Light.Light[1].Enabled); + break; + case GL_LIGHT2: + params[0] = BOOLEAN_TO_FLOAT(ctx->Light.Light[2].Enabled); + break; + case GL_LIGHT3: + params[0] = BOOLEAN_TO_FLOAT(ctx->Light.Light[3].Enabled); + break; + case GL_LIGHT4: + params[0] = BOOLEAN_TO_FLOAT(ctx->Light.Light[4].Enabled); + break; + case GL_LIGHT5: + params[0] = BOOLEAN_TO_FLOAT(ctx->Light.Light[5].Enabled); + break; + case GL_LIGHT6: + params[0] = BOOLEAN_TO_FLOAT(ctx->Light.Light[6].Enabled); + break; + case GL_LIGHT7: + params[0] = BOOLEAN_TO_FLOAT(ctx->Light.Light[7].Enabled); + break; + case GL_LIGHTING: + params[0] = BOOLEAN_TO_FLOAT(ctx->Light.Enabled); + break; + case GL_LIGHT_MODEL_AMBIENT: + params[0] = ctx->Light.Model.Ambient[0]; + params[1] = ctx->Light.Model.Ambient[1]; + params[2] = ctx->Light.Model.Ambient[2]; + params[3] = ctx->Light.Model.Ambient[3]; + break; + case GL_LIGHT_MODEL_COLOR_CONTROL: + params[0] = ENUM_TO_FLOAT(ctx->Light.Model.ColorControl); + break; + case GL_LIGHT_MODEL_LOCAL_VIEWER: + params[0] = BOOLEAN_TO_FLOAT(ctx->Light.Model.LocalViewer); + break; + case GL_LIGHT_MODEL_TWO_SIDE: + params[0] = BOOLEAN_TO_FLOAT(ctx->Light.Model.TwoSide); + break; + case GL_LINE_SMOOTH: + params[0] = BOOLEAN_TO_FLOAT(ctx->Line.SmoothFlag); + break; + case GL_LINE_SMOOTH_HINT: + params[0] = ENUM_TO_FLOAT(ctx->Hint.LineSmooth); + break; + case GL_LINE_STIPPLE: + params[0] = BOOLEAN_TO_FLOAT(ctx->Line.StippleFlag); + break; + case GL_LINE_STIPPLE_PATTERN: + params[0] = (GLfloat)(ctx->Line.StipplePattern); + break; + case GL_LINE_STIPPLE_REPEAT: + params[0] = (GLfloat)(ctx->Line.StippleFactor); + break; + case GL_LINE_WIDTH: + params[0] = ctx->Line.Width; + break; + case GL_LINE_WIDTH_GRANULARITY: + params[0] = ctx->Const.LineWidthGranularity; + break; + case GL_LINE_WIDTH_RANGE: + params[0] = ctx->Const.MinLineWidthAA; + params[1] = ctx->Const.MaxLineWidthAA; + break; + case GL_ALIASED_LINE_WIDTH_RANGE: + params[0] = ctx->Const.MinLineWidth; + params[1] = ctx->Const.MaxLineWidth; + break; + case GL_LIST_BASE: + params[0] = (GLfloat)(ctx->List.ListBase); + break; + case GL_LIST_INDEX: + params[0] = (GLfloat)(ctx->ListState.CurrentListNum); + break; + case GL_LIST_MODE: + { + GLenum mode; + if (!ctx->CompileFlag) + mode = 0; + else if (ctx->ExecuteFlag) + mode = GL_COMPILE_AND_EXECUTE; + else + mode = GL_COMPILE; + params[0] = ENUM_TO_FLOAT(mode); + } + break; + case GL_INDEX_LOGIC_OP: + params[0] = BOOLEAN_TO_FLOAT(ctx->Color.IndexLogicOpEnabled); + break; + case GL_COLOR_LOGIC_OP: + params[0] = BOOLEAN_TO_FLOAT(ctx->Color.ColorLogicOpEnabled); + break; + case GL_LOGIC_OP_MODE: + params[0] = ENUM_TO_FLOAT(ctx->Color.LogicOp); + break; + case GL_MAP1_COLOR_4: + params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Color4); + break; + case GL_MAP1_GRID_DOMAIN: + params[0] = ctx->Eval.MapGrid1u1; + params[1] = ctx->Eval.MapGrid1u2; + break; + case GL_MAP1_GRID_SEGMENTS: + params[0] = (GLfloat)(ctx->Eval.MapGrid1un); + break; + case GL_MAP1_INDEX: + params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Index); + break; + case GL_MAP1_NORMAL: + params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Normal); + break; + case GL_MAP1_TEXTURE_COORD_1: + params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1TextureCoord1); + break; + case GL_MAP1_TEXTURE_COORD_2: + params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1TextureCoord2); + break; + case GL_MAP1_TEXTURE_COORD_3: + params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1TextureCoord3); + break; + case GL_MAP1_TEXTURE_COORD_4: + params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1TextureCoord4); + break; + case GL_MAP1_VERTEX_3: + params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Vertex3); + break; + case GL_MAP1_VERTEX_4: + params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Vertex4); + break; + case GL_MAP2_COLOR_4: + params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map2Color4); + break; + case GL_MAP2_GRID_DOMAIN: + params[0] = ctx->Eval.MapGrid2u1; + params[1] = ctx->Eval.MapGrid2u2; + params[2] = ctx->Eval.MapGrid2v1; + params[3] = ctx->Eval.MapGrid2v2; + break; + case GL_MAP2_GRID_SEGMENTS: + params[0] = (GLfloat)(ctx->Eval.MapGrid2un); + params[1] = (GLfloat)(ctx->Eval.MapGrid2vn); + break; + case GL_MAP2_INDEX: + params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map2Index); + break; + case GL_MAP2_NORMAL: + params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map2Normal); + break; + case GL_MAP2_TEXTURE_COORD_1: + params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map2TextureCoord1); + break; + case GL_MAP2_TEXTURE_COORD_2: + params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map2TextureCoord2); + break; + case GL_MAP2_TEXTURE_COORD_3: + params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map2TextureCoord3); + break; + case GL_MAP2_TEXTURE_COORD_4: + params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map2TextureCoord4); + break; + case GL_MAP2_VERTEX_3: + params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map2Vertex3); + break; + case GL_MAP2_VERTEX_4: + params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map2Vertex4); + break; + case GL_MAP_COLOR: + params[0] = BOOLEAN_TO_FLOAT(ctx->Pixel.MapColorFlag); + break; + case GL_MAP_STENCIL: + params[0] = BOOLEAN_TO_FLOAT(ctx->Pixel.MapStencilFlag); + break; + case GL_MATRIX_MODE: + params[0] = ENUM_TO_FLOAT(ctx->Transform.MatrixMode); + break; + case GL_MAX_ATTRIB_STACK_DEPTH: + params[0] = (GLfloat)(MAX_ATTRIB_STACK_DEPTH); + break; + case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH: + params[0] = (GLfloat)(MAX_CLIENT_ATTRIB_STACK_DEPTH); + break; + case GL_MAX_CLIP_PLANES: + params[0] = (GLfloat)(ctx->Const.MaxClipPlanes); + break; + case GL_MAX_ELEMENTS_VERTICES: + params[0] = (GLfloat)(ctx->Const.MaxArrayLockSize); + break; + case GL_MAX_ELEMENTS_INDICES: + params[0] = (GLfloat)(ctx->Const.MaxArrayLockSize); + break; + case GL_MAX_EVAL_ORDER: + params[0] = (GLfloat)(MAX_EVAL_ORDER); + break; + case GL_MAX_LIGHTS: + params[0] = (GLfloat)(ctx->Const.MaxLights); + break; + case GL_MAX_LIST_NESTING: + params[0] = (GLfloat)(MAX_LIST_NESTING); + break; + case GL_MAX_MODELVIEW_STACK_DEPTH: + params[0] = (GLfloat)(MAX_MODELVIEW_STACK_DEPTH); + break; + case GL_MAX_NAME_STACK_DEPTH: + params[0] = (GLfloat)(MAX_NAME_STACK_DEPTH); + break; + case GL_MAX_PIXEL_MAP_TABLE: + params[0] = (GLfloat)(MAX_PIXEL_MAP_TABLE); + break; + case GL_MAX_PROJECTION_STACK_DEPTH: + params[0] = (GLfloat)(MAX_PROJECTION_STACK_DEPTH); + break; + case GL_MAX_TEXTURE_SIZE: + params[0] = (GLfloat)(1 << (ctx->Const.MaxTextureLevels - 1)); + break; + case GL_MAX_3D_TEXTURE_SIZE: + params[0] = (GLfloat)(1 << (ctx->Const.Max3DTextureLevels - 1)); + break; + case GL_MAX_TEXTURE_STACK_DEPTH: + params[0] = (GLfloat)(MAX_TEXTURE_STACK_DEPTH); + break; + case GL_MAX_VIEWPORT_DIMS: + params[0] = (GLfloat)(ctx->Const.MaxViewportWidth); + params[1] = (GLfloat)(ctx->Const.MaxViewportHeight); + break; + case GL_MODELVIEW_MATRIX: + { + const GLfloat *matrix = ctx->ModelviewMatrixStack.Top->m; + params[0] = matrix[0]; + params[1] = matrix[1]; + params[2] = matrix[2]; + params[3] = matrix[3]; + params[4] = matrix[4]; + params[5] = matrix[5]; + params[6] = matrix[6]; + params[7] = matrix[7]; + params[8] = matrix[8]; + params[9] = matrix[9]; + params[10] = matrix[10]; + params[11] = matrix[11]; + params[12] = matrix[12]; + params[13] = matrix[13]; + params[14] = matrix[14]; + params[15] = matrix[15]; + } + break; + case GL_MODELVIEW_STACK_DEPTH: + params[0] = (GLfloat)(ctx->ModelviewMatrixStack.Depth + 1); + break; + case GL_NAME_STACK_DEPTH: + params[0] = (GLfloat)(ctx->Select.NameStackDepth); + break; + case GL_NORMALIZE: + params[0] = BOOLEAN_TO_FLOAT(ctx->Transform.Normalize); + break; + case GL_PACK_ALIGNMENT: + params[0] = (GLfloat)(ctx->Pack.Alignment); + break; + case GL_PACK_LSB_FIRST: + params[0] = BOOLEAN_TO_FLOAT(ctx->Pack.LsbFirst); + break; + case GL_PACK_ROW_LENGTH: + params[0] = (GLfloat)(ctx->Pack.RowLength); + break; + case GL_PACK_SKIP_PIXELS: + params[0] = (GLfloat)(ctx->Pack.SkipPixels); + break; + case GL_PACK_SKIP_ROWS: + params[0] = (GLfloat)(ctx->Pack.SkipRows); + break; + case GL_PACK_SWAP_BYTES: + params[0] = BOOLEAN_TO_FLOAT(ctx->Pack.SwapBytes); + break; + case GL_PACK_SKIP_IMAGES_EXT: + params[0] = (GLfloat)(ctx->Pack.SkipImages); + break; + case GL_PACK_IMAGE_HEIGHT_EXT: + params[0] = (GLfloat)(ctx->Pack.ImageHeight); + break; + case GL_PACK_INVERT_MESA: + params[0] = BOOLEAN_TO_FLOAT(ctx->Pack.Invert); + break; + case GL_PERSPECTIVE_CORRECTION_HINT: + params[0] = ENUM_TO_FLOAT(ctx->Hint.PerspectiveCorrection); + break; + case GL_PIXEL_MAP_A_TO_A_SIZE: + params[0] = (GLfloat)(ctx->Pixel.MapAtoAsize); + break; + case GL_PIXEL_MAP_B_TO_B_SIZE: + params[0] = (GLfloat)(ctx->Pixel.MapBtoBsize); + break; + case GL_PIXEL_MAP_G_TO_G_SIZE: + params[0] = (GLfloat)(ctx->Pixel.MapGtoGsize); + break; + case GL_PIXEL_MAP_I_TO_A_SIZE: + params[0] = (GLfloat)(ctx->Pixel.MapItoAsize); + break; + case GL_PIXEL_MAP_I_TO_B_SIZE: + params[0] = (GLfloat)(ctx->Pixel.MapItoBsize); + break; + case GL_PIXEL_MAP_I_TO_G_SIZE: + params[0] = (GLfloat)(ctx->Pixel.MapItoGsize); + break; + case GL_PIXEL_MAP_I_TO_I_SIZE: + params[0] = (GLfloat)(ctx->Pixel.MapItoIsize); + break; + case GL_PIXEL_MAP_I_TO_R_SIZE: + params[0] = (GLfloat)(ctx->Pixel.MapItoRsize); + break; + case GL_PIXEL_MAP_R_TO_R_SIZE: + params[0] = (GLfloat)(ctx->Pixel.MapRtoRsize); + break; + case GL_PIXEL_MAP_S_TO_S_SIZE: + params[0] = (GLfloat)(ctx->Pixel.MapStoSsize); + break; + case GL_POINT_SIZE: + params[0] = ctx->Point.Size; + break; + case GL_POINT_SIZE_GRANULARITY: + params[0] = ctx->Const.PointSizeGranularity; + break; + case GL_POINT_SIZE_RANGE: + params[0] = ctx->Const.MinPointSizeAA; + params[1] = ctx->Const.MaxPointSizeAA; + break; + case GL_ALIASED_POINT_SIZE_RANGE: + params[0] = ctx->Const.MinPointSize; + params[1] = ctx->Const.MaxPointSize; + break; + case GL_POINT_SMOOTH: + params[0] = BOOLEAN_TO_FLOAT(ctx->Point.SmoothFlag); + break; + case GL_POINT_SMOOTH_HINT: + params[0] = ENUM_TO_FLOAT(ctx->Hint.PointSmooth); + break; + case GL_POINT_SIZE_MIN_EXT: + params[0] = ctx->Point.MinSize; + break; + case GL_POINT_SIZE_MAX_EXT: + params[0] = ctx->Point.MaxSize; + break; + case GL_POINT_FADE_THRESHOLD_SIZE_EXT: + params[0] = ctx->Point.Threshold; + break; + case GL_DISTANCE_ATTENUATION_EXT: + params[0] = ctx->Point.Params[0]; + params[1] = ctx->Point.Params[1]; + params[2] = ctx->Point.Params[2]; + break; + case GL_POLYGON_MODE: + params[0] = ENUM_TO_FLOAT(ctx->Polygon.FrontMode); + params[1] = ENUM_TO_FLOAT(ctx->Polygon.BackMode); + break; + case GL_POLYGON_OFFSET_BIAS_EXT: + params[0] = ctx->Polygon.OffsetUnits; + break; + case GL_POLYGON_OFFSET_FACTOR: + params[0] = ctx->Polygon.OffsetFactor ; + break; + case GL_POLYGON_OFFSET_UNITS: + params[0] = ctx->Polygon.OffsetUnits ; + break; + case GL_POLYGON_SMOOTH: + params[0] = BOOLEAN_TO_FLOAT(ctx->Polygon.SmoothFlag); + break; + case GL_POLYGON_SMOOTH_HINT: + params[0] = ENUM_TO_FLOAT(ctx->Hint.PolygonSmooth); + break; + case GL_POLYGON_STIPPLE: + params[0] = BOOLEAN_TO_FLOAT(ctx->Polygon.StippleFlag); + break; + case GL_PROJECTION_MATRIX: + { + const GLfloat *matrix = ctx->ProjectionMatrixStack.Top->m; + params[0] = matrix[0]; + params[1] = matrix[1]; + params[2] = matrix[2]; + params[3] = matrix[3]; + params[4] = matrix[4]; + params[5] = matrix[5]; + params[6] = matrix[6]; + params[7] = matrix[7]; + params[8] = matrix[8]; + params[9] = matrix[9]; + params[10] = matrix[10]; + params[11] = matrix[11]; + params[12] = matrix[12]; + params[13] = matrix[13]; + params[14] = matrix[14]; + params[15] = matrix[15]; + } + break; + case GL_PROJECTION_STACK_DEPTH: + params[0] = (GLfloat)(ctx->ProjectionMatrixStack.Depth + 1); + break; + case GL_READ_BUFFER: + params[0] = ENUM_TO_FLOAT(ctx->ReadBuffer->ColorReadBuffer); + break; + case GL_RED_BIAS: + params[0] = ctx->Pixel.RedBias; + break; + case GL_RED_BITS: + params[0] = (GLfloat)( ctx->DrawBuffer->Visual.redBits ); + break; + case GL_RED_SCALE: + params[0] = ctx->Pixel.RedScale; + break; + case GL_RENDER_MODE: + params[0] = ENUM_TO_FLOAT(ctx->RenderMode); + break; + case GL_RESCALE_NORMAL: + params[0] = BOOLEAN_TO_FLOAT(ctx->Transform.RescaleNormals); + break; + case GL_RGBA_MODE: + params[0] = BOOLEAN_TO_FLOAT(ctx->DrawBuffer->Visual.rgbMode); + break; + case GL_SCISSOR_BOX: + params[0] = (GLfloat)(ctx->Scissor.X); + params[1] = (GLfloat)(ctx->Scissor.Y); + params[2] = (GLfloat)(ctx->Scissor.Width); + params[3] = (GLfloat)(ctx->Scissor.Height); + break; + case GL_SCISSOR_TEST: + params[0] = BOOLEAN_TO_FLOAT(ctx->Scissor.Enabled); + break; + case GL_SELECTION_BUFFER_SIZE: + params[0] = (GLfloat)(ctx->Select.BufferSize); + break; + case GL_SHADE_MODEL: + params[0] = ENUM_TO_FLOAT(ctx->Light.ShadeModel); + break; + case GL_SHARED_TEXTURE_PALETTE_EXT: + params[0] = BOOLEAN_TO_FLOAT(ctx->Texture.SharedPalette); + break; + case GL_STENCIL_BITS: + params[0] = (GLfloat)(ctx->DrawBuffer->Visual.stencilBits); + break; + case GL_STENCIL_CLEAR_VALUE: + params[0] = (GLfloat)(ctx->Stencil.Clear); + break; + case GL_STENCIL_FAIL: + params[0] = ENUM_TO_FLOAT(ctx->Stencil.FailFunc[ctx->Stencil.ActiveFace]); + break; + case GL_STENCIL_FUNC: + params[0] = ENUM_TO_FLOAT(ctx->Stencil.Function[ctx->Stencil.ActiveFace]); + break; + case GL_STENCIL_PASS_DEPTH_FAIL: + params[0] = ENUM_TO_FLOAT(ctx->Stencil.ZFailFunc[ctx->Stencil.ActiveFace]); + break; + case GL_STENCIL_PASS_DEPTH_PASS: + params[0] = ENUM_TO_FLOAT(ctx->Stencil.ZPassFunc[ctx->Stencil.ActiveFace]); + break; + case GL_STENCIL_REF: + params[0] = (GLfloat)(ctx->Stencil.Ref[ctx->Stencil.ActiveFace]); + break; + case GL_STENCIL_TEST: + params[0] = BOOLEAN_TO_FLOAT(ctx->Stencil.Enabled); + break; + case GL_STENCIL_VALUE_MASK: + params[0] = (GLfloat)(ctx->Stencil.ValueMask[ctx->Stencil.ActiveFace]); + break; + case GL_STENCIL_WRITEMASK: + params[0] = (GLfloat)(ctx->Stencil.WriteMask[ctx->Stencil.ActiveFace]); + break; + case GL_STEREO: + params[0] = BOOLEAN_TO_FLOAT(ctx->DrawBuffer->Visual.stereoMode); + break; + case GL_SUBPIXEL_BITS: + params[0] = (GLfloat)(ctx->Const.SubPixelBits); + break; + case GL_TEXTURE_1D: + params[0] = BOOLEAN_TO_FLOAT(_mesa_IsEnabled(GL_TEXTURE_1D)); + break; + case GL_TEXTURE_2D: + params[0] = BOOLEAN_TO_FLOAT(_mesa_IsEnabled(GL_TEXTURE_2D)); + break; + case GL_TEXTURE_3D: + params[0] = BOOLEAN_TO_FLOAT(_mesa_IsEnabled(GL_TEXTURE_3D)); + break; + case GL_TEXTURE_BINDING_1D: + params[0] = (GLfloat)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].Current1D->Name); + break; + case GL_TEXTURE_BINDING_2D: + params[0] = (GLfloat)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].Current2D->Name); + break; + case GL_TEXTURE_BINDING_3D: + params[0] = (GLfloat)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].Current3D->Name); + break; + case GL_TEXTURE_ENV_COLOR: + { + const GLfloat *color = ctx->Texture.Unit[ctx->Texture.CurrentUnit].EnvColor; + params[0] = color[0]; + params[1] = color[1]; + params[2] = color[2]; + params[3] = color[3]; + } + break; + case GL_TEXTURE_ENV_MODE: + params[0] = ENUM_TO_FLOAT(ctx->Texture.Unit[ctx->Texture.CurrentUnit].EnvMode); + break; + case GL_TEXTURE_GEN_S: + params[0] = BOOLEAN_TO_FLOAT(((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & S_BIT) ? 1 : 0)); + break; + case GL_TEXTURE_GEN_T: + params[0] = BOOLEAN_TO_FLOAT(((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & T_BIT) ? 1 : 0)); + break; + case GL_TEXTURE_GEN_R: + params[0] = BOOLEAN_TO_FLOAT(((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & R_BIT) ? 1 : 0)); + break; + case GL_TEXTURE_GEN_Q: + params[0] = BOOLEAN_TO_FLOAT(((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & Q_BIT) ? 1 : 0)); + break; + case GL_TEXTURE_MATRIX: + { + const GLfloat *matrix = ctx->TextureMatrixStack[ctx->Texture.CurrentUnit].Top->m; + params[0] = matrix[0]; + params[1] = matrix[1]; + params[2] = matrix[2]; + params[3] = matrix[3]; + params[4] = matrix[4]; + params[5] = matrix[5]; + params[6] = matrix[6]; + params[7] = matrix[7]; + params[8] = matrix[8]; + params[9] = matrix[9]; + params[10] = matrix[10]; + params[11] = matrix[11]; + params[12] = matrix[12]; + params[13] = matrix[13]; + params[14] = matrix[14]; + params[15] = matrix[15]; + } + break; + case GL_TEXTURE_STACK_DEPTH: + params[0] = (GLfloat)(ctx->TextureMatrixStack[ctx->Texture.CurrentUnit].Depth + 1); + break; + case GL_UNPACK_ALIGNMENT: + params[0] = (GLfloat)(ctx->Unpack.Alignment); + break; + case GL_UNPACK_LSB_FIRST: + params[0] = BOOLEAN_TO_FLOAT(ctx->Unpack.LsbFirst); + break; + case GL_UNPACK_ROW_LENGTH: + params[0] = (GLfloat)(ctx->Unpack.RowLength); + break; + case GL_UNPACK_SKIP_PIXELS: + params[0] = (GLfloat)(ctx->Unpack.SkipPixels); + break; + case GL_UNPACK_SKIP_ROWS: + params[0] = (GLfloat)(ctx->Unpack.SkipRows); + break; + case GL_UNPACK_SWAP_BYTES: + params[0] = BOOLEAN_TO_FLOAT(ctx->Unpack.SwapBytes); + break; + case GL_UNPACK_SKIP_IMAGES_EXT: + params[0] = (GLfloat)(ctx->Unpack.SkipImages); + break; + case GL_UNPACK_IMAGE_HEIGHT_EXT: + params[0] = (GLfloat)(ctx->Unpack.ImageHeight); + break; + case GL_UNPACK_CLIENT_STORAGE_APPLE: + params[0] = BOOLEAN_TO_FLOAT(ctx->Unpack.ClientStorage); + break; + case GL_VIEWPORT: + params[0] = (GLfloat)(ctx->Viewport.X); + params[1] = (GLfloat)(ctx->Viewport.Y); + params[2] = (GLfloat)(ctx->Viewport.Width); + params[3] = (GLfloat)(ctx->Viewport.Height); + break; + case GL_ZOOM_X: + params[0] = ctx->Pixel.ZoomX; + break; + case GL_ZOOM_Y: + params[0] = ctx->Pixel.ZoomY; + break; + case GL_VERTEX_ARRAY: + params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->Vertex.Enabled); + break; + case GL_VERTEX_ARRAY_SIZE: + params[0] = (GLfloat)(ctx->Array.ArrayObj->Vertex.Size); + break; + case GL_VERTEX_ARRAY_TYPE: + params[0] = ENUM_TO_FLOAT(ctx->Array.ArrayObj->Vertex.Type); + break; + case GL_VERTEX_ARRAY_STRIDE: + params[0] = (GLfloat)(ctx->Array.ArrayObj->Vertex.Stride); + break; + case GL_VERTEX_ARRAY_COUNT_EXT: + params[0] = (GLfloat)(0); + break; + case GL_NORMAL_ARRAY: + params[0] = ENUM_TO_FLOAT(ctx->Array.ArrayObj->Normal.Enabled); + break; + case GL_NORMAL_ARRAY_TYPE: + params[0] = ENUM_TO_FLOAT(ctx->Array.ArrayObj->Normal.Type); + break; + case GL_NORMAL_ARRAY_STRIDE: + params[0] = (GLfloat)(ctx->Array.ArrayObj->Normal.Stride); + break; + case GL_NORMAL_ARRAY_COUNT_EXT: + params[0] = (GLfloat)(0); + break; + case GL_COLOR_ARRAY: + params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->Color.Enabled); + break; + case GL_COLOR_ARRAY_SIZE: + params[0] = (GLfloat)(ctx->Array.ArrayObj->Color.Size); + break; + case GL_COLOR_ARRAY_TYPE: + params[0] = ENUM_TO_FLOAT(ctx->Array.ArrayObj->Color.Type); + break; + case GL_COLOR_ARRAY_STRIDE: + params[0] = (GLfloat)(ctx->Array.ArrayObj->Color.Stride); + break; + case GL_COLOR_ARRAY_COUNT_EXT: + params[0] = (GLfloat)(0); + break; + case GL_INDEX_ARRAY: + params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->Index.Enabled); + break; + case GL_INDEX_ARRAY_TYPE: + params[0] = ENUM_TO_FLOAT(ctx->Array.ArrayObj->Index.Type); + break; + case GL_INDEX_ARRAY_STRIDE: + params[0] = (GLfloat)(ctx->Array.ArrayObj->Index.Stride); + break; + case GL_INDEX_ARRAY_COUNT_EXT: + params[0] = (GLfloat)(0); + break; + case GL_TEXTURE_COORD_ARRAY: + params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Enabled); + break; + case GL_TEXTURE_COORD_ARRAY_SIZE: + params[0] = (GLfloat)(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Size); + break; + case GL_TEXTURE_COORD_ARRAY_TYPE: + params[0] = ENUM_TO_FLOAT(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Type); + break; + case GL_TEXTURE_COORD_ARRAY_STRIDE: + params[0] = (GLfloat)(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Stride); + break; + case GL_TEXTURE_COORD_ARRAY_COUNT_EXT: + params[0] = (GLfloat)(0); + break; + case GL_EDGE_FLAG_ARRAY: + params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->EdgeFlag.Enabled); + break; + case GL_EDGE_FLAG_ARRAY_STRIDE: + params[0] = (GLfloat)(ctx->Array.ArrayObj->EdgeFlag.Stride); + break; + case GL_EDGE_FLAG_ARRAY_COUNT_EXT: + params[0] = (GLfloat)(0); + break; + case GL_MAX_TEXTURE_UNITS_ARB: + CHECK_EXT1(ARB_multitexture, "GetFloatv"); + params[0] = (GLfloat)(ctx->Const.MaxTextureUnits); + break; + case GL_ACTIVE_TEXTURE_ARB: + CHECK_EXT1(ARB_multitexture, "GetFloatv"); + params[0] = (GLfloat)(GL_TEXTURE0_ARB + ctx->Texture.CurrentUnit); + break; + case GL_CLIENT_ACTIVE_TEXTURE_ARB: + CHECK_EXT1(ARB_multitexture, "GetFloatv"); + params[0] = (GLfloat)(GL_TEXTURE0_ARB + ctx->Array.ActiveTexture); + break; + case GL_TEXTURE_CUBE_MAP_ARB: + CHECK_EXT1(ARB_texture_cube_map, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(_mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB)); + break; + case GL_TEXTURE_BINDING_CUBE_MAP_ARB: + CHECK_EXT1(ARB_texture_cube_map, "GetFloatv"); + params[0] = (GLfloat)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentCubeMap->Name); + break; + case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB: + CHECK_EXT1(ARB_texture_cube_map, "GetFloatv"); + params[0] = (GLfloat)((1 << (ctx->Const.MaxCubeTextureLevels - 1))); + break; + case GL_TEXTURE_COMPRESSION_HINT_ARB: + CHECK_EXT1(ARB_texture_compression, "GetFloatv"); + params[0] = (GLfloat)(ctx->Hint.TextureCompression); + break; + case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB: + CHECK_EXT1(ARB_texture_compression, "GetFloatv"); + params[0] = (GLfloat)(_mesa_get_compressed_formats(ctx, NULL, GL_FALSE)); + break; + case GL_COMPRESSED_TEXTURE_FORMATS_ARB: + CHECK_EXT1(ARB_texture_compression, "GetFloatv"); + { + GLint formats[100]; + GLuint i, n = _mesa_get_compressed_formats(ctx, formats, GL_FALSE); + ASSERT(n <= 100); + for (i = 0; i < n; i++) + params[i] = ENUM_TO_INT(formats[i]); + } + break; + case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT: + CHECK_EXT1(EXT_compiled_vertex_array, "GetFloatv"); + params[0] = (GLfloat)(ctx->Array.LockFirst); + break; + case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT: + CHECK_EXT1(EXT_compiled_vertex_array, "GetFloatv"); + params[0] = (GLfloat)(ctx->Array.LockCount); + break; + case GL_TRANSPOSE_COLOR_MATRIX_ARB: + { + const GLfloat *matrix = ctx->ColorMatrixStack.Top->m; + params[0] = matrix[0]; + params[1] = matrix[4]; + params[2] = matrix[8]; + params[3] = matrix[12]; + params[4] = matrix[1]; + params[5] = matrix[5]; + params[6] = matrix[9]; + params[7] = matrix[13]; + params[8] = matrix[2]; + params[9] = matrix[6]; + params[10] = matrix[10]; + params[11] = matrix[14]; + params[12] = matrix[3]; + params[13] = matrix[7]; + params[14] = matrix[11]; + params[15] = matrix[15]; + } + break; + case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB: + { + const GLfloat *matrix = ctx->ModelviewMatrixStack.Top->m; + params[0] = matrix[0]; + params[1] = matrix[4]; + params[2] = matrix[8]; + params[3] = matrix[12]; + params[4] = matrix[1]; + params[5] = matrix[5]; + params[6] = matrix[9]; + params[7] = matrix[13]; + params[8] = matrix[2]; + params[9] = matrix[6]; + params[10] = matrix[10]; + params[11] = matrix[14]; + params[12] = matrix[3]; + params[13] = matrix[7]; + params[14] = matrix[11]; + params[15] = matrix[15]; + } + break; + case GL_TRANSPOSE_PROJECTION_MATRIX_ARB: + { + const GLfloat *matrix = ctx->ProjectionMatrixStack.Top->m; + params[0] = matrix[0]; + params[1] = matrix[4]; + params[2] = matrix[8]; + params[3] = matrix[12]; + params[4] = matrix[1]; + params[5] = matrix[5]; + params[6] = matrix[9]; + params[7] = matrix[13]; + params[8] = matrix[2]; + params[9] = matrix[6]; + params[10] = matrix[10]; + params[11] = matrix[14]; + params[12] = matrix[3]; + params[13] = matrix[7]; + params[14] = matrix[11]; + params[15] = matrix[15]; + } + break; + case GL_TRANSPOSE_TEXTURE_MATRIX_ARB: + { + const GLfloat *matrix = ctx->TextureMatrixStack[ctx->Texture.CurrentUnit].Top->m; + params[0] = matrix[0]; + params[1] = matrix[4]; + params[2] = matrix[8]; + params[3] = matrix[12]; + params[4] = matrix[1]; + params[5] = matrix[5]; + params[6] = matrix[9]; + params[7] = matrix[13]; + params[8] = matrix[2]; + params[9] = matrix[6]; + params[10] = matrix[10]; + params[11] = matrix[14]; + params[12] = matrix[3]; + params[13] = matrix[7]; + params[14] = matrix[11]; + params[15] = matrix[15]; + } + break; + case GL_COLOR_MATRIX_SGI: + { + const GLfloat *matrix = ctx->ColorMatrixStack.Top->m; + params[0] = matrix[0]; + params[1] = matrix[1]; + params[2] = matrix[2]; + params[3] = matrix[3]; + params[4] = matrix[4]; + params[5] = matrix[5]; + params[6] = matrix[6]; + params[7] = matrix[7]; + params[8] = matrix[8]; + params[9] = matrix[9]; + params[10] = matrix[10]; + params[11] = matrix[11]; + params[12] = matrix[12]; + params[13] = matrix[13]; + params[14] = matrix[14]; + params[15] = matrix[15]; + } + break; + case GL_COLOR_MATRIX_STACK_DEPTH_SGI: + params[0] = (GLfloat)(ctx->ColorMatrixStack.Depth + 1); + break; + case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI: + params[0] = (GLfloat)(MAX_COLOR_STACK_DEPTH); + break; + case GL_POST_COLOR_MATRIX_RED_SCALE_SGI: + params[0] = ctx->Pixel.PostColorMatrixScale[0]; + break; + case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI: + params[0] = ctx->Pixel.PostColorMatrixScale[1]; + break; + case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI: + params[0] = ctx->Pixel.PostColorMatrixScale[2]; + break; + case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI: + params[0] = ctx->Pixel.PostColorMatrixScale[3]; + break; + case GL_POST_COLOR_MATRIX_RED_BIAS_SGI: + params[0] = ctx->Pixel.PostColorMatrixBias[0]; + break; + case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI: + params[0] = ctx->Pixel.PostColorMatrixBias[1]; + break; + case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI: + params[0] = ctx->Pixel.PostColorMatrixBias[2]; + break; + case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI: + params[0] = ctx->Pixel.PostColorMatrixBias[3]; + break; + case GL_CONVOLUTION_1D_EXT: + CHECK_EXT1(EXT_convolution, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Pixel.Convolution1DEnabled); + break; + case GL_CONVOLUTION_2D_EXT: + CHECK_EXT1(EXT_convolution, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Pixel.Convolution2DEnabled); + break; + case GL_SEPARABLE_2D_EXT: + CHECK_EXT1(EXT_convolution, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Pixel.Separable2DEnabled); + break; + case GL_POST_CONVOLUTION_RED_SCALE_EXT: + CHECK_EXT1(EXT_convolution, "GetFloatv"); + params[0] = ctx->Pixel.PostConvolutionScale[0]; + break; + case GL_POST_CONVOLUTION_GREEN_SCALE_EXT: + CHECK_EXT1(EXT_convolution, "GetFloatv"); + params[0] = ctx->Pixel.PostConvolutionScale[1]; + break; + case GL_POST_CONVOLUTION_BLUE_SCALE_EXT: + CHECK_EXT1(EXT_convolution, "GetFloatv"); + params[0] = ctx->Pixel.PostConvolutionScale[2]; + break; + case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT: + CHECK_EXT1(EXT_convolution, "GetFloatv"); + params[0] = ctx->Pixel.PostConvolutionScale[3]; + break; + case GL_POST_CONVOLUTION_RED_BIAS_EXT: + CHECK_EXT1(EXT_convolution, "GetFloatv"); + params[0] = ctx->Pixel.PostConvolutionBias[0]; + break; + case GL_POST_CONVOLUTION_GREEN_BIAS_EXT: + CHECK_EXT1(EXT_convolution, "GetFloatv"); + params[0] = ctx->Pixel.PostConvolutionBias[1]; + break; + case GL_POST_CONVOLUTION_BLUE_BIAS_EXT: + CHECK_EXT1(EXT_convolution, "GetFloatv"); + params[0] = ctx->Pixel.PostConvolutionBias[2]; + break; + case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT: + CHECK_EXT1(EXT_convolution, "GetFloatv"); + params[0] = ctx->Pixel.PostConvolutionBias[3]; + break; + case GL_HISTOGRAM: + CHECK_EXT1(EXT_histogram, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Pixel.HistogramEnabled); + break; + case GL_MINMAX: + CHECK_EXT1(EXT_histogram, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Pixel.MinMaxEnabled); + break; + case GL_COLOR_TABLE_SGI: + CHECK_EXT1(SGI_color_table, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Pixel.ColorTableEnabled); + break; + case GL_POST_CONVOLUTION_COLOR_TABLE_SGI: + CHECK_EXT1(SGI_color_table, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Pixel.PostConvolutionColorTableEnabled); + break; + case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI: + CHECK_EXT1(SGI_color_table, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Pixel.PostColorMatrixColorTableEnabled); + break; + case GL_TEXTURE_COLOR_TABLE_SGI: + CHECK_EXT1(SGI_texture_color_table, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Texture.Unit[ctx->Texture.CurrentUnit].ColorTableEnabled); + break; + case GL_COLOR_SUM_EXT: + CHECK_EXT2(EXT_secondary_color, ARB_vertex_program, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Fog.ColorSumEnabled); + break; + case GL_CURRENT_SECONDARY_COLOR_EXT: + CHECK_EXT1(EXT_secondary_color, "GetFloatv"); + { + FLUSH_CURRENT(ctx, 0); + params[0] = ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0]; + params[1] = ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1]; + params[2] = ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2]; + params[3] = ctx->Current.Attrib[VERT_ATTRIB_COLOR1][3]; + } + break; + case GL_SECONDARY_COLOR_ARRAY_EXT: + CHECK_EXT1(EXT_secondary_color, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->SecondaryColor.Enabled); + break; + case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT: + CHECK_EXT1(EXT_secondary_color, "GetFloatv"); + params[0] = ENUM_TO_FLOAT(ctx->Array.ArrayObj->SecondaryColor.Type); + break; + case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT: + CHECK_EXT1(EXT_secondary_color, "GetFloatv"); + params[0] = (GLfloat)(ctx->Array.ArrayObj->SecondaryColor.Stride); + break; + case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT: + CHECK_EXT1(EXT_secondary_color, "GetFloatv"); + params[0] = (GLfloat)(ctx->Array.ArrayObj->SecondaryColor.Size); + break; + case GL_CURRENT_FOG_COORDINATE_EXT: + CHECK_EXT1(EXT_fog_coord, "GetFloatv"); + { + FLUSH_CURRENT(ctx, 0); + params[0] = ctx->Current.Attrib[VERT_ATTRIB_FOG][0]; + } + break; + case GL_FOG_COORDINATE_ARRAY_EXT: + CHECK_EXT1(EXT_fog_coord, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->FogCoord.Enabled); + break; + case GL_FOG_COORDINATE_ARRAY_TYPE_EXT: + CHECK_EXT1(EXT_fog_coord, "GetFloatv"); + params[0] = ENUM_TO_FLOAT(ctx->Array.ArrayObj->FogCoord.Type); + break; + case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT: + CHECK_EXT1(EXT_fog_coord, "GetFloatv"); + params[0] = (GLfloat)(ctx->Array.ArrayObj->FogCoord.Stride); + break; + case GL_FOG_COORDINATE_SOURCE_EXT: + CHECK_EXT1(EXT_fog_coord, "GetFloatv"); + params[0] = ENUM_TO_FLOAT(ctx->Fog.FogCoordinateSource); + break; + case GL_MAX_TEXTURE_LOD_BIAS_EXT: + CHECK_EXT1(EXT_texture_lod_bias, "GetFloatv"); + params[0] = ctx->Const.MaxTextureLodBias; + break; + case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT: + CHECK_EXT1(EXT_texture_filter_anisotropic, "GetFloatv"); + params[0] = ctx->Const.MaxTextureMaxAnisotropy; + break; + case GL_MULTISAMPLE_ARB: + CHECK_EXT1(ARB_multisample, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Multisample.Enabled); + break; + case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB: + CHECK_EXT1(ARB_multisample, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Multisample.SampleAlphaToCoverage); + break; + case GL_SAMPLE_ALPHA_TO_ONE_ARB: + CHECK_EXT1(ARB_multisample, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Multisample.SampleAlphaToOne); + break; + case GL_SAMPLE_COVERAGE_ARB: + CHECK_EXT1(ARB_multisample, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Multisample.SampleCoverage); + break; + case GL_SAMPLE_COVERAGE_VALUE_ARB: + CHECK_EXT1(ARB_multisample, "GetFloatv"); + params[0] = ctx->Multisample.SampleCoverageValue; + break; + case GL_SAMPLE_COVERAGE_INVERT_ARB: + CHECK_EXT1(ARB_multisample, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Multisample.SampleCoverageInvert); + break; + case GL_SAMPLE_BUFFERS_ARB: + CHECK_EXT1(ARB_multisample, "GetFloatv"); + params[0] = (GLfloat)(ctx->DrawBuffer->Visual.sampleBuffers); + break; + case GL_SAMPLES_ARB: + CHECK_EXT1(ARB_multisample, "GetFloatv"); + params[0] = (GLfloat)(ctx->DrawBuffer->Visual.samples); + break; + case GL_RASTER_POSITION_UNCLIPPED_IBM: + CHECK_EXT1(IBM_rasterpos_clip, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Transform.RasterPositionUnclipped); + break; + case GL_POINT_SPRITE_NV: + CHECK_EXT2(NV_point_sprite, ARB_point_sprite, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Point.PointSprite); + break; + case GL_POINT_SPRITE_R_MODE_NV: + CHECK_EXT1(NV_point_sprite, "GetFloatv"); + params[0] = ENUM_TO_FLOAT(ctx->Point.SpriteRMode); + break; + case GL_POINT_SPRITE_COORD_ORIGIN: + CHECK_EXT2(NV_point_sprite, ARB_point_sprite, "GetFloatv"); + params[0] = ENUM_TO_FLOAT(ctx->Point.SpriteOrigin); + break; + case GL_GENERATE_MIPMAP_HINT_SGIS: + CHECK_EXT1(SGIS_generate_mipmap, "GetFloatv"); + params[0] = ENUM_TO_FLOAT(ctx->Hint.GenerateMipmap); + break; + case GL_VERTEX_PROGRAM_BINDING_NV: + CHECK_EXT1(NV_vertex_program, "GetFloatv"); + params[0] = (GLfloat)((ctx->VertexProgram.Current ? ctx->VertexProgram.Current->Base.Id : 0)); + break; + case GL_VERTEX_ATTRIB_ARRAY0_NV: + CHECK_EXT1(NV_vertex_program, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[0].Enabled); + break; + case GL_VERTEX_ATTRIB_ARRAY1_NV: + CHECK_EXT1(NV_vertex_program, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[1].Enabled); + break; + case GL_VERTEX_ATTRIB_ARRAY2_NV: + CHECK_EXT1(NV_vertex_program, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[2].Enabled); + break; + case GL_VERTEX_ATTRIB_ARRAY3_NV: + CHECK_EXT1(NV_vertex_program, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[3].Enabled); + break; + case GL_VERTEX_ATTRIB_ARRAY4_NV: + CHECK_EXT1(NV_vertex_program, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[4].Enabled); + break; + case GL_VERTEX_ATTRIB_ARRAY5_NV: + CHECK_EXT1(NV_vertex_program, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[5].Enabled); + break; + case GL_VERTEX_ATTRIB_ARRAY6_NV: + CHECK_EXT1(NV_vertex_program, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[6].Enabled); + break; + case GL_VERTEX_ATTRIB_ARRAY7_NV: + CHECK_EXT1(NV_vertex_program, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[7].Enabled); + break; + case GL_VERTEX_ATTRIB_ARRAY8_NV: + CHECK_EXT1(NV_vertex_program, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[8].Enabled); + break; + case GL_VERTEX_ATTRIB_ARRAY9_NV: + CHECK_EXT1(NV_vertex_program, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[9].Enabled); + break; + case GL_VERTEX_ATTRIB_ARRAY10_NV: + CHECK_EXT1(NV_vertex_program, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[10].Enabled); + break; + case GL_VERTEX_ATTRIB_ARRAY11_NV: + CHECK_EXT1(NV_vertex_program, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[11].Enabled); + break; + case GL_VERTEX_ATTRIB_ARRAY12_NV: + CHECK_EXT1(NV_vertex_program, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[12].Enabled); + break; + case GL_VERTEX_ATTRIB_ARRAY13_NV: + CHECK_EXT1(NV_vertex_program, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[13].Enabled); + break; + case GL_VERTEX_ATTRIB_ARRAY14_NV: + CHECK_EXT1(NV_vertex_program, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[14].Enabled); + break; + case GL_VERTEX_ATTRIB_ARRAY15_NV: + CHECK_EXT1(NV_vertex_program, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[15].Enabled); + break; + case GL_MAP1_VERTEX_ATTRIB0_4_NV: + CHECK_EXT1(NV_vertex_program, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[0]); + break; + case GL_MAP1_VERTEX_ATTRIB1_4_NV: + CHECK_EXT1(NV_vertex_program, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[1]); + break; + case GL_MAP1_VERTEX_ATTRIB2_4_NV: + CHECK_EXT1(NV_vertex_program, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[2]); + break; + case GL_MAP1_VERTEX_ATTRIB3_4_NV: + CHECK_EXT1(NV_vertex_program, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[3]); + break; + case GL_MAP1_VERTEX_ATTRIB4_4_NV: + CHECK_EXT1(NV_vertex_program, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[4]); + break; + case GL_MAP1_VERTEX_ATTRIB5_4_NV: + CHECK_EXT1(NV_vertex_program, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[5]); + break; + case GL_MAP1_VERTEX_ATTRIB6_4_NV: + CHECK_EXT1(NV_vertex_program, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[6]); + break; + case GL_MAP1_VERTEX_ATTRIB7_4_NV: + CHECK_EXT1(NV_vertex_program, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[7]); + break; + case GL_MAP1_VERTEX_ATTRIB8_4_NV: + CHECK_EXT1(NV_vertex_program, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[8]); + break; + case GL_MAP1_VERTEX_ATTRIB9_4_NV: + CHECK_EXT1(NV_vertex_program, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[9]); + break; + case GL_MAP1_VERTEX_ATTRIB10_4_NV: + CHECK_EXT1(NV_vertex_program, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[10]); + break; + case GL_MAP1_VERTEX_ATTRIB11_4_NV: + CHECK_EXT1(NV_vertex_program, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[11]); + break; + case GL_MAP1_VERTEX_ATTRIB12_4_NV: + CHECK_EXT1(NV_vertex_program, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[12]); + break; + case GL_MAP1_VERTEX_ATTRIB13_4_NV: + CHECK_EXT1(NV_vertex_program, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[13]); + break; + case GL_MAP1_VERTEX_ATTRIB14_4_NV: + CHECK_EXT1(NV_vertex_program, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[14]); + break; + case GL_MAP1_VERTEX_ATTRIB15_4_NV: + CHECK_EXT1(NV_vertex_program, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[15]); + break; + case GL_FRAGMENT_PROGRAM_NV: + CHECK_EXT1(NV_fragment_program, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->FragmentProgram.Enabled); + break; + case GL_FRAGMENT_PROGRAM_BINDING_NV: + CHECK_EXT1(NV_fragment_program, "GetFloatv"); + params[0] = (GLfloat)(ctx->FragmentProgram.Current ? ctx->FragmentProgram.Current->Base.Id : 0); + break; + case GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV: + CHECK_EXT1(NV_fragment_program, "GetFloatv"); + params[0] = (GLfloat)(MAX_NV_FRAGMENT_PROGRAM_PARAMS); + break; + case GL_TEXTURE_RECTANGLE_NV: + CHECK_EXT1(NV_texture_rectangle, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(_mesa_IsEnabled(GL_TEXTURE_RECTANGLE_NV)); + break; + case GL_TEXTURE_BINDING_RECTANGLE_NV: + CHECK_EXT1(NV_texture_rectangle, "GetFloatv"); + params[0] = (GLfloat)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentRect->Name); + break; + case GL_MAX_RECTANGLE_TEXTURE_SIZE_NV: + CHECK_EXT1(NV_texture_rectangle, "GetFloatv"); + params[0] = (GLfloat)(ctx->Const.MaxTextureRectSize); + break; + case GL_STENCIL_TEST_TWO_SIDE_EXT: + CHECK_EXT1(EXT_stencil_two_side, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Stencil.TestTwoSide); + break; + case GL_ACTIVE_STENCIL_FACE_EXT: + CHECK_EXT1(EXT_stencil_two_side, "GetFloatv"); + params[0] = ENUM_TO_FLOAT(ctx->Stencil.ActiveFace ? GL_BACK : GL_FRONT); + break; + case GL_MAX_SHININESS_NV: + CHECK_EXT1(NV_light_max_exponent, "GetFloatv"); + params[0] = ctx->Const.MaxShininess; + break; + case GL_MAX_SPOT_EXPONENT_NV: + CHECK_EXT1(NV_light_max_exponent, "GetFloatv"); + params[0] = ctx->Const.MaxSpotExponent; + break; + case GL_ARRAY_BUFFER_BINDING_ARB: + CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); + params[0] = (GLfloat)(ctx->Array.ArrayBufferObj->Name); + break; + case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB: + CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); + params[0] = (GLfloat)(ctx->Array.ArrayObj->Vertex.BufferObj->Name); + break; + case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB: + CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); + params[0] = (GLfloat)(ctx->Array.ArrayObj->Normal.BufferObj->Name); + break; + case GL_COLOR_ARRAY_BUFFER_BINDING_ARB: + CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); + params[0] = (GLfloat)(ctx->Array.ArrayObj->Color.BufferObj->Name); + break; + case GL_INDEX_ARRAY_BUFFER_BINDING_ARB: + CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); + params[0] = (GLfloat)(ctx->Array.ArrayObj->Index.BufferObj->Name); + break; + case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB: + CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); + params[0] = (GLfloat)(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].BufferObj->Name); + break; + case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB: + CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); + params[0] = (GLfloat)(ctx->Array.ArrayObj->EdgeFlag.BufferObj->Name); + break; + case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB: + CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); + params[0] = (GLfloat)(ctx->Array.ArrayObj->SecondaryColor.BufferObj->Name); + break; + case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB: + CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); + params[0] = (GLfloat)(ctx->Array.ArrayObj->FogCoord.BufferObj->Name); + break; + case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB: + CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); + params[0] = (GLfloat)(ctx->Array.ElementArrayBufferObj->Name); + break; + case GL_PIXEL_PACK_BUFFER_BINDING_EXT: + CHECK_EXT1(EXT_pixel_buffer_object, "GetFloatv"); + params[0] = (GLfloat)(ctx->Pack.BufferObj->Name); + break; + case GL_PIXEL_UNPACK_BUFFER_BINDING_EXT: + CHECK_EXT1(EXT_pixel_buffer_object, "GetFloatv"); + params[0] = (GLfloat)(ctx->Unpack.BufferObj->Name); + break; + case GL_VERTEX_PROGRAM_ARB: + CHECK_EXT2(ARB_vertex_program, NV_vertex_program, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->VertexProgram.Enabled); + break; + case GL_VERTEX_PROGRAM_POINT_SIZE_ARB: + CHECK_EXT2(ARB_vertex_program, NV_vertex_program, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->VertexProgram.PointSizeEnabled); + break; + case GL_VERTEX_PROGRAM_TWO_SIDE_ARB: + CHECK_EXT2(ARB_vertex_program, NV_vertex_program, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->VertexProgram.TwoSideEnabled); + break; + case GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB: + CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_vertex_program, "GetFloatv"); + params[0] = (GLfloat)(ctx->Const.MaxProgramMatrixStackDepth); + break; + case GL_MAX_PROGRAM_MATRICES_ARB: + CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_vertex_program, "GetFloatv"); + params[0] = (GLfloat)(ctx->Const.MaxProgramMatrices); + break; + case GL_CURRENT_MATRIX_STACK_DEPTH_ARB: + CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_vertex_program, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->CurrentStack->Depth + 1); + break; + case GL_CURRENT_MATRIX_ARB: + CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_fragment_program, "GetFloatv"); + { + const GLfloat *matrix = ctx->CurrentStack->Top->m; + params[0] = matrix[0]; + params[1] = matrix[1]; + params[2] = matrix[2]; + params[3] = matrix[3]; + params[4] = matrix[4]; + params[5] = matrix[5]; + params[6] = matrix[6]; + params[7] = matrix[7]; + params[8] = matrix[8]; + params[9] = matrix[9]; + params[10] = matrix[10]; + params[11] = matrix[11]; + params[12] = matrix[12]; + params[13] = matrix[13]; + params[14] = matrix[14]; + params[15] = matrix[15]; + } + break; + case GL_TRANSPOSE_CURRENT_MATRIX_ARB: + CHECK_EXT2(ARB_vertex_program, ARB_fragment_program, "GetFloatv"); + { + const GLfloat *matrix = ctx->CurrentStack->Top->m; + params[0] = matrix[0]; + params[1] = matrix[4]; + params[2] = matrix[8]; + params[3] = matrix[12]; + params[4] = matrix[1]; + params[5] = matrix[5]; + params[6] = matrix[9]; + params[7] = matrix[13]; + params[8] = matrix[2]; + params[9] = matrix[6]; + params[10] = matrix[10]; + params[11] = matrix[14]; + params[12] = matrix[3]; + params[13] = matrix[7]; + params[14] = matrix[11]; + params[15] = matrix[15]; + } + break; + case GL_MAX_VERTEX_ATTRIBS_ARB: + CHECK_EXT1(ARB_vertex_program, "GetFloatv"); + params[0] = (GLfloat)(ctx->Const.VertexProgram.MaxAttribs); + break; + case GL_PROGRAM_ERROR_POSITION_ARB: + CHECK_EXT4(NV_vertex_program, ARB_vertex_program, NV_fragment_program, ARB_fragment_program, "GetFloatv"); + params[0] = (GLfloat)(ctx->Program.ErrorPos); + break; + case GL_FRAGMENT_PROGRAM_ARB: + CHECK_EXT1(ARB_fragment_program, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->FragmentProgram.Enabled); + break; + case GL_MAX_TEXTURE_COORDS_ARB: + CHECK_EXT2(ARB_fragment_program, NV_fragment_program, "GetFloatv"); + params[0] = (GLfloat)(ctx->Const.MaxTextureCoordUnits); + break; + case GL_MAX_TEXTURE_IMAGE_UNITS_ARB: + CHECK_EXT2(ARB_fragment_program, NV_fragment_program, "GetFloatv"); + params[0] = (GLfloat)(ctx->Const.MaxTextureImageUnits); + break; + case GL_DEPTH_BOUNDS_TEST_EXT: + CHECK_EXT1(EXT_depth_bounds_test, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Depth.BoundsTest); + break; + case GL_DEPTH_BOUNDS_EXT: + CHECK_EXT1(EXT_depth_bounds_test, "GetFloatv"); + params[0] = ctx->Depth.BoundsMin; + params[1] = ctx->Depth.BoundsMax; + break; + case GL_FRAGMENT_PROGRAM_CALLBACK_MESA: + CHECK_EXT1(MESA_program_debug, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->FragmentProgram.CallbackEnabled); + break; + case GL_VERTEX_PROGRAM_CALLBACK_MESA: + CHECK_EXT1(MESA_program_debug, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->VertexProgram.CallbackEnabled); + break; + case GL_FRAGMENT_PROGRAM_POSITION_MESA: + CHECK_EXT1(MESA_program_debug, "GetFloatv"); + params[0] = (GLfloat)(ctx->FragmentProgram.CurrentPosition); + break; + case GL_VERTEX_PROGRAM_POSITION_MESA: + CHECK_EXT1(MESA_program_debug, "GetFloatv"); + params[0] = (GLfloat)(ctx->VertexProgram.CurrentPosition); + break; + case GL_MAX_DRAW_BUFFERS_ARB: + CHECK_EXT1(ARB_draw_buffers, "GetFloatv"); + params[0] = (GLfloat)(ctx->Const.MaxDrawBuffers); + break; + case GL_DRAW_BUFFER0_ARB: + CHECK_EXT1(ARB_draw_buffers, "GetFloatv"); + params[0] = ENUM_TO_FLOAT(ctx->DrawBuffer->ColorDrawBuffer[0]); + break; + case GL_DRAW_BUFFER1_ARB: + CHECK_EXT1(ARB_draw_buffers, "GetFloatv"); + { + GLenum buffer; + if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) { + _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)"); + return; + } + buffer = ctx->DrawBuffer->ColorDrawBuffer[1]; + params[0] = ENUM_TO_FLOAT(buffer); + } + break; + case GL_DRAW_BUFFER2_ARB: + CHECK_EXT1(ARB_draw_buffers, "GetFloatv"); + { + GLenum buffer; + if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) { + _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)"); + return; + } + buffer = ctx->DrawBuffer->ColorDrawBuffer[2]; + params[0] = ENUM_TO_FLOAT(buffer); + } + break; + case GL_DRAW_BUFFER3_ARB: + CHECK_EXT1(ARB_draw_buffers, "GetFloatv"); + { + GLenum buffer; + if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) { + _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)"); + return; + } + buffer = ctx->DrawBuffer->ColorDrawBuffer[3]; + params[0] = ENUM_TO_FLOAT(buffer); + } + break; + case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES: + CHECK_EXT1(OES_read_format, "GetFloatv"); + params[0] = (GLfloat)(ctx->Const.ColorReadType); + break; + case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES: + CHECK_EXT1(OES_read_format, "GetFloatv"); + params[0] = (GLfloat)(ctx->Const.ColorReadFormat); + break; + case GL_NUM_FRAGMENT_REGISTERS_ATI: + CHECK_EXT1(ATI_fragment_shader, "GetFloatv"); + params[0] = (GLfloat)(6); + break; + case GL_NUM_FRAGMENT_CONSTANTS_ATI: + CHECK_EXT1(ATI_fragment_shader, "GetFloatv"); + params[0] = (GLfloat)(8); + break; + case GL_NUM_PASSES_ATI: + CHECK_EXT1(ATI_fragment_shader, "GetFloatv"); + params[0] = (GLfloat)(2); + break; + case GL_NUM_INSTRUCTIONS_PER_PASS_ATI: + CHECK_EXT1(ATI_fragment_shader, "GetFloatv"); + params[0] = (GLfloat)(8); + break; + case GL_NUM_INSTRUCTIONS_TOTAL_ATI: + CHECK_EXT1(ATI_fragment_shader, "GetFloatv"); + params[0] = (GLfloat)(16); + break; + case GL_COLOR_ALPHA_PAIRING_ATI: + CHECK_EXT1(ATI_fragment_shader, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(GL_TRUE); + break; + case GL_NUM_LOOPBACK_COMPONENTS_ATI: + CHECK_EXT1(ATI_fragment_shader, "GetFloatv"); + params[0] = (GLfloat)(3); + break; + case GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI: + CHECK_EXT1(ATI_fragment_shader, "GetFloatv"); + params[0] = (GLfloat)(3); + break; + case GL_STENCIL_BACK_FUNC: + params[0] = ENUM_TO_FLOAT(ctx->Stencil.Function[1]); + break; + case GL_STENCIL_BACK_VALUE_MASK: + params[0] = (GLfloat)(ctx->Stencil.ValueMask[1]); + break; + case GL_STENCIL_BACK_REF: + params[0] = (GLfloat)(ctx->Stencil.Ref[1]); + break; + case GL_STENCIL_BACK_FAIL: + params[0] = ENUM_TO_FLOAT(ctx->Stencil.FailFunc[1]); + break; + case GL_STENCIL_BACK_PASS_DEPTH_FAIL: + params[0] = ENUM_TO_FLOAT(ctx->Stencil.ZFailFunc[1]); + break; + case GL_STENCIL_BACK_PASS_DEPTH_PASS: + params[0] = ENUM_TO_FLOAT(ctx->Stencil.ZPassFunc[1]); + break; + case GL_FRAMEBUFFER_BINDING_EXT: + CHECK_EXT1(EXT_framebuffer_object, "GetFloatv"); + params[0] = (GLfloat)(ctx->DrawBuffer->Name); + break; + case GL_RENDERBUFFER_BINDING_EXT: + CHECK_EXT1(EXT_framebuffer_object, "GetFloatv"); + params[0] = (GLfloat)(ctx->CurrentRenderbuffer ? ctx->CurrentRenderbuffer->Name : 0); + break; + case GL_MAX_COLOR_ATTACHMENTS_EXT: + CHECK_EXT1(EXT_framebuffer_object, "GetFloatv"); + params[0] = (GLfloat)(ctx->Const.MaxColorAttachments); + break; + case GL_MAX_RENDERBUFFER_SIZE_EXT: + CHECK_EXT1(EXT_framebuffer_object, "GetFloatv"); + params[0] = (GLfloat)(ctx->Const.MaxRenderbufferSize); + break; + case GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB: + CHECK_EXT1(ARB_fragment_shader, "GetFloatv"); + params[0] = (GLfloat)(MAX_FRAGMENT_UNIFORM_COMPONENTS); + break; + case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB: + CHECK_EXT1(ARB_fragment_shader, "GetFloatv"); + params[0] = ENUM_TO_FLOAT(ctx->Hint.FragmentShaderDerivative); + break; + case GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB: + CHECK_EXT1(ARB_vertex_shader, "GetFloatv"); + params[0] = (GLfloat)(MAX_VERTEX_UNIFORM_COMPONENTS); + break; + case GL_MAX_VARYING_FLOATS_ARB: + CHECK_EXT1(ARB_vertex_shader, "GetFloatv"); + params[0] = (GLfloat)(MAX_VARYING_FLOATS); + break; + case GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB: + CHECK_EXT1(ARB_vertex_shader, "GetFloatv"); + params[0] = (GLfloat)(MAX_VERTEX_TEXTURE_IMAGE_UNITS); + break; + case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB: + CHECK_EXT1(ARB_vertex_shader, "GetFloatv"); + params[0] = (GLfloat)(MAX_COMBINED_TEXTURE_IMAGE_UNITS); + break; + default: + _mesa_error(ctx, GL_INVALID_ENUM, "glGetFloatv(pname=0x%x)", pname); + } +} + +void GLAPIENTRY +_mesa_GetIntegerv( GLenum pname, GLint *params ) +{ + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + + if (!params) + return; + + if (ctx->NewState) + _mesa_update_state(ctx); + + if (ctx->Driver.GetIntegerv && + ctx->Driver.GetIntegerv(ctx, pname, params)) + return; + + switch (pname) { + case GL_ACCUM_RED_BITS: + params[0] = ctx->DrawBuffer->Visual.accumRedBits; + break; + case GL_ACCUM_GREEN_BITS: + params[0] = ctx->DrawBuffer->Visual.accumGreenBits; + break; + case GL_ACCUM_BLUE_BITS: + params[0] = ctx->DrawBuffer->Visual.accumBlueBits; + break; + case GL_ACCUM_ALPHA_BITS: + params[0] = ctx->DrawBuffer->Visual.accumAlphaBits; + break; + case GL_ACCUM_CLEAR_VALUE: + params[0] = FLOAT_TO_INT(ctx->Accum.ClearColor[0]); + params[1] = FLOAT_TO_INT(ctx->Accum.ClearColor[1]); + params[2] = FLOAT_TO_INT(ctx->Accum.ClearColor[2]); + params[3] = FLOAT_TO_INT(ctx->Accum.ClearColor[3]); + break; + case GL_ALPHA_BIAS: + params[0] = IROUND(ctx->Pixel.AlphaBias); + break; + case GL_ALPHA_BITS: + params[0] = ctx->DrawBuffer->Visual.alphaBits; + break; + case GL_ALPHA_SCALE: + params[0] = IROUND(ctx->Pixel.AlphaScale); + break; + case GL_ALPHA_TEST: + params[0] = BOOLEAN_TO_INT(ctx->Color.AlphaEnabled); + break; + case GL_ALPHA_TEST_FUNC: + params[0] = ENUM_TO_INT(ctx->Color.AlphaFunc); + break; + case GL_ALPHA_TEST_REF: + params[0] = FLOAT_TO_INT(ctx->Color.AlphaRef); + break; + case GL_ATTRIB_STACK_DEPTH: + params[0] = ctx->AttribStackDepth; + break; + case GL_AUTO_NORMAL: + params[0] = BOOLEAN_TO_INT(ctx->Eval.AutoNormal); + break; + case GL_AUX_BUFFERS: + params[0] = ctx->DrawBuffer->Visual.numAuxBuffers; + break; + case GL_BLEND: + params[0] = BOOLEAN_TO_INT(ctx->Color.BlendEnabled); + break; + case GL_BLEND_DST: + params[0] = ENUM_TO_INT(ctx->Color.BlendDstRGB); + break; + case GL_BLEND_SRC: + params[0] = ENUM_TO_INT(ctx->Color.BlendSrcRGB); + break; + case GL_BLEND_SRC_RGB_EXT: + params[0] = ENUM_TO_INT(ctx->Color.BlendSrcRGB); + break; + case GL_BLEND_DST_RGB_EXT: + params[0] = ENUM_TO_INT(ctx->Color.BlendDstRGB); + break; + case GL_BLEND_SRC_ALPHA_EXT: + params[0] = ENUM_TO_INT(ctx->Color.BlendSrcA); + break; + case GL_BLEND_DST_ALPHA_EXT: + params[0] = ENUM_TO_INT(ctx->Color.BlendDstA); + break; + case GL_BLEND_EQUATION: + params[0] = ENUM_TO_INT(ctx->Color.BlendEquationRGB ); + break; + case GL_BLEND_EQUATION_ALPHA_EXT: + params[0] = ENUM_TO_INT(ctx->Color.BlendEquationA ); + break; + case GL_BLEND_COLOR_EXT: + params[0] = FLOAT_TO_INT(ctx->Color.BlendColor[0]); + params[1] = FLOAT_TO_INT(ctx->Color.BlendColor[1]); + params[2] = FLOAT_TO_INT(ctx->Color.BlendColor[2]); + params[3] = FLOAT_TO_INT(ctx->Color.BlendColor[3]); + break; + case GL_BLUE_BIAS: + params[0] = IROUND(ctx->Pixel.BlueBias); + break; + case GL_BLUE_BITS: + params[0] = ctx->DrawBuffer->Visual.blueBits; + break; + case GL_BLUE_SCALE: + params[0] = IROUND(ctx->Pixel.BlueScale); + break; + case GL_CLIENT_ATTRIB_STACK_DEPTH: + params[0] = ctx->ClientAttribStackDepth; + break; + case GL_CLIP_PLANE0: + params[0] = BOOLEAN_TO_INT((ctx->Transform.ClipPlanesEnabled >> 0) & 1); + break; + case GL_CLIP_PLANE1: + params[0] = BOOLEAN_TO_INT((ctx->Transform.ClipPlanesEnabled >> 1) & 1); + break; + case GL_CLIP_PLANE2: + params[0] = BOOLEAN_TO_INT((ctx->Transform.ClipPlanesEnabled >> 2) & 1); + break; + case GL_CLIP_PLANE3: + params[0] = BOOLEAN_TO_INT((ctx->Transform.ClipPlanesEnabled >> 3) & 1); + break; + case GL_CLIP_PLANE4: + params[0] = BOOLEAN_TO_INT((ctx->Transform.ClipPlanesEnabled >> 4) & 1); + break; + case GL_CLIP_PLANE5: + params[0] = BOOLEAN_TO_INT((ctx->Transform.ClipPlanesEnabled >> 5) & 1); + break; + case GL_COLOR_CLEAR_VALUE: + params[0] = FLOAT_TO_INT(ctx->Color.ClearColor[0]); + params[1] = FLOAT_TO_INT(ctx->Color.ClearColor[1]); + params[2] = FLOAT_TO_INT(ctx->Color.ClearColor[2]); + params[3] = FLOAT_TO_INT(ctx->Color.ClearColor[3]); + break; + case GL_COLOR_MATERIAL: + params[0] = BOOLEAN_TO_INT(ctx->Light.ColorMaterialEnabled); + break; + case GL_COLOR_MATERIAL_FACE: + params[0] = ENUM_TO_INT(ctx->Light.ColorMaterialFace); + break; + case GL_COLOR_MATERIAL_PARAMETER: + params[0] = ENUM_TO_INT(ctx->Light.ColorMaterialMode); + break; + case GL_COLOR_WRITEMASK: + params[0] = ctx->Color.ColorMask[RCOMP] ? 1 : 0; + params[1] = ctx->Color.ColorMask[GCOMP] ? 1 : 0; + params[2] = ctx->Color.ColorMask[BCOMP] ? 1 : 0; + params[3] = ctx->Color.ColorMask[ACOMP] ? 1 : 0; + break; + case GL_CULL_FACE: + params[0] = BOOLEAN_TO_INT(ctx->Polygon.CullFlag); + break; + case GL_CULL_FACE_MODE: + params[0] = ENUM_TO_INT(ctx->Polygon.CullFaceMode); + break; + case GL_CURRENT_COLOR: + { + FLUSH_CURRENT(ctx, 0); + params[0] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0]); + params[1] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1]); + params[2] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2]); + params[3] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3]); + } + break; + case GL_CURRENT_INDEX: + { + FLUSH_CURRENT(ctx, 0); + params[0] = IROUND(ctx->Current.Attrib[VERT_ATTRIB_COLOR_INDEX][0]); + } + break; + case GL_CURRENT_NORMAL: + { + FLUSH_CURRENT(ctx, 0); + params[0] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_NORMAL][0]); + params[1] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_NORMAL][1]); + params[2] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_NORMAL][2]); + } + break; + case GL_CURRENT_RASTER_COLOR: + params[0] = FLOAT_TO_INT(ctx->Current.RasterColor[0]); + params[1] = FLOAT_TO_INT(ctx->Current.RasterColor[1]); + params[2] = FLOAT_TO_INT(ctx->Current.RasterColor[2]); + params[3] = FLOAT_TO_INT(ctx->Current.RasterColor[3]); + break; + case GL_CURRENT_RASTER_DISTANCE: + params[0] = IROUND(ctx->Current.RasterDistance); + break; + case GL_CURRENT_RASTER_INDEX: + params[0] = IROUND(ctx->Current.RasterIndex); + break; + case GL_CURRENT_RASTER_POSITION: + params[0] = IROUND(ctx->Current.RasterPos[0]); + params[1] = IROUND(ctx->Current.RasterPos[1]); + params[2] = IROUND(ctx->Current.RasterPos[2]); + params[3] = IROUND(ctx->Current.RasterPos[3]); + break; + case GL_CURRENT_RASTER_SECONDARY_COLOR: + params[0] = FLOAT_TO_INT(ctx->Current.RasterSecondaryColor[0]); + params[1] = FLOAT_TO_INT(ctx->Current.RasterSecondaryColor[1]); + params[2] = FLOAT_TO_INT(ctx->Current.RasterSecondaryColor[2]); + params[3] = FLOAT_TO_INT(ctx->Current.RasterSecondaryColor[3]); + break; + case GL_CURRENT_RASTER_TEXTURE_COORDS: + { + const GLuint texUnit = ctx->Texture.CurrentUnit; + params[0] = IROUND(ctx->Current.RasterTexCoords[texUnit][0]); + params[1] = IROUND(ctx->Current.RasterTexCoords[texUnit][1]); + params[2] = IROUND(ctx->Current.RasterTexCoords[texUnit][2]); + params[3] = IROUND(ctx->Current.RasterTexCoords[texUnit][3]); + } + break; + case GL_CURRENT_RASTER_POSITION_VALID: + params[0] = BOOLEAN_TO_INT(ctx->Current.RasterPosValid); + break; + case GL_CURRENT_TEXTURE_COORDS: + { + const GLuint texUnit = ctx->Texture.CurrentUnit; + params[0] = IROUND(ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][0]); + params[1] = IROUND(ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][1]); + params[2] = IROUND(ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][2]); + params[3] = IROUND(ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][3]); + } + break; + case GL_DEPTH_BIAS: + params[0] = IROUND(ctx->Pixel.DepthBias); + break; + case GL_DEPTH_BITS: + params[0] = ctx->DrawBuffer->Visual.depthBits; + break; + case GL_DEPTH_CLEAR_VALUE: + params[0] = IROUND(ctx->Depth.Clear); + break; + case GL_DEPTH_FUNC: + params[0] = ENUM_TO_INT(ctx->Depth.Func); + break; + case GL_DEPTH_RANGE: + params[0] = FLOAT_TO_INT(ctx->Viewport.Near); + params[1] = FLOAT_TO_INT(ctx->Viewport.Far); + break; + case GL_DEPTH_SCALE: + params[0] = IROUND(ctx->Pixel.DepthScale); + break; + case GL_DEPTH_TEST: + params[0] = BOOLEAN_TO_INT(ctx->Depth.Test); + break; + case GL_DEPTH_WRITEMASK: + params[0] = BOOLEAN_TO_INT(ctx->Depth.Mask); + break; + case GL_DITHER: + params[0] = BOOLEAN_TO_INT(ctx->Color.DitherFlag); + break; + case GL_DOUBLEBUFFER: + params[0] = BOOLEAN_TO_INT(ctx->DrawBuffer->Visual.doubleBufferMode); + break; + case GL_DRAW_BUFFER: + params[0] = ENUM_TO_INT(ctx->DrawBuffer->ColorDrawBuffer[0]); + break; + case GL_EDGE_FLAG: + { + FLUSH_CURRENT(ctx, 0); + params[0] = BOOLEAN_TO_INT(ctx->Current.EdgeFlag); + } + break; + case GL_FEEDBACK_BUFFER_SIZE: + params[0] = ctx->Feedback.BufferSize; + break; + case GL_FEEDBACK_BUFFER_TYPE: + params[0] = ENUM_TO_INT(ctx->Feedback.Type); + break; + case GL_FOG: + params[0] = BOOLEAN_TO_INT(ctx->Fog.Enabled); + break; + case GL_FOG_COLOR: + params[0] = FLOAT_TO_INT(ctx->Fog.Color[0]); + params[1] = FLOAT_TO_INT(ctx->Fog.Color[1]); + params[2] = FLOAT_TO_INT(ctx->Fog.Color[2]); + params[3] = FLOAT_TO_INT(ctx->Fog.Color[3]); + break; + case GL_FOG_DENSITY: + params[0] = IROUND(ctx->Fog.Density); + break; + case GL_FOG_END: + params[0] = IROUND(ctx->Fog.End); + break; + case GL_FOG_HINT: + params[0] = ENUM_TO_INT(ctx->Hint.Fog); + break; + case GL_FOG_INDEX: + params[0] = IROUND(ctx->Fog.Index); + break; + case GL_FOG_MODE: + params[0] = ENUM_TO_INT(ctx->Fog.Mode); + break; + case GL_FOG_START: + params[0] = IROUND(ctx->Fog.Start); + break; + case GL_FRONT_FACE: + params[0] = ENUM_TO_INT(ctx->Polygon.FrontFace); + break; + case GL_GREEN_BIAS: + params[0] = IROUND(ctx->Pixel.GreenBias); + break; + case GL_GREEN_BITS: + params[0] = ctx->DrawBuffer->Visual.greenBits; + break; + case GL_GREEN_SCALE: + params[0] = IROUND(ctx->Pixel.GreenScale); + break; + case GL_INDEX_BITS: + params[0] = ctx->DrawBuffer->Visual.indexBits; + break; + case GL_INDEX_CLEAR_VALUE: + params[0] = ctx->Color.ClearIndex; + break; + case GL_INDEX_MODE: + params[0] = BOOLEAN_TO_INT(!ctx->DrawBuffer->Visual.rgbMode); + break; + case GL_INDEX_OFFSET: + params[0] = ctx->Pixel.IndexOffset; + break; + case GL_INDEX_SHIFT: + params[0] = ctx->Pixel.IndexShift; + break; + case GL_INDEX_WRITEMASK: + params[0] = ctx->Color.IndexMask; + break; + case GL_LIGHT0: + params[0] = BOOLEAN_TO_INT(ctx->Light.Light[0].Enabled); + break; + case GL_LIGHT1: + params[0] = BOOLEAN_TO_INT(ctx->Light.Light[1].Enabled); + break; + case GL_LIGHT2: + params[0] = BOOLEAN_TO_INT(ctx->Light.Light[2].Enabled); + break; + case GL_LIGHT3: + params[0] = BOOLEAN_TO_INT(ctx->Light.Light[3].Enabled); + break; + case GL_LIGHT4: + params[0] = BOOLEAN_TO_INT(ctx->Light.Light[4].Enabled); + break; + case GL_LIGHT5: + params[0] = BOOLEAN_TO_INT(ctx->Light.Light[5].Enabled); + break; + case GL_LIGHT6: + params[0] = BOOLEAN_TO_INT(ctx->Light.Light[6].Enabled); + break; + case GL_LIGHT7: + params[0] = BOOLEAN_TO_INT(ctx->Light.Light[7].Enabled); + break; + case GL_LIGHTING: + params[0] = BOOLEAN_TO_INT(ctx->Light.Enabled); + break; + case GL_LIGHT_MODEL_AMBIENT: + params[0] = FLOAT_TO_INT(ctx->Light.Model.Ambient[0]); + params[1] = FLOAT_TO_INT(ctx->Light.Model.Ambient[1]); + params[2] = FLOAT_TO_INT(ctx->Light.Model.Ambient[2]); + params[3] = FLOAT_TO_INT(ctx->Light.Model.Ambient[3]); + break; + case GL_LIGHT_MODEL_COLOR_CONTROL: + params[0] = ENUM_TO_INT(ctx->Light.Model.ColorControl); + break; + case GL_LIGHT_MODEL_LOCAL_VIEWER: + params[0] = BOOLEAN_TO_INT(ctx->Light.Model.LocalViewer); + break; + case GL_LIGHT_MODEL_TWO_SIDE: + params[0] = BOOLEAN_TO_INT(ctx->Light.Model.TwoSide); + break; + case GL_LINE_SMOOTH: + params[0] = BOOLEAN_TO_INT(ctx->Line.SmoothFlag); + break; + case GL_LINE_SMOOTH_HINT: + params[0] = ENUM_TO_INT(ctx->Hint.LineSmooth); + break; + case GL_LINE_STIPPLE: + params[0] = BOOLEAN_TO_INT(ctx->Line.StippleFlag); + break; + case GL_LINE_STIPPLE_PATTERN: + params[0] = ctx->Line.StipplePattern; + break; + case GL_LINE_STIPPLE_REPEAT: + params[0] = ctx->Line.StippleFactor; + break; + case GL_LINE_WIDTH: + params[0] = IROUND(ctx->Line.Width); + break; + case GL_LINE_WIDTH_GRANULARITY: + params[0] = IROUND(ctx->Const.LineWidthGranularity); + break; + case GL_LINE_WIDTH_RANGE: + params[0] = IROUND(ctx->Const.MinLineWidthAA); + params[1] = IROUND(ctx->Const.MaxLineWidthAA); + break; + case GL_ALIASED_LINE_WIDTH_RANGE: + params[0] = IROUND(ctx->Const.MinLineWidth); + params[1] = IROUND(ctx->Const.MaxLineWidth); + break; + case GL_LIST_BASE: + params[0] = ctx->List.ListBase; + break; + case GL_LIST_INDEX: + params[0] = ctx->ListState.CurrentListNum; + break; + case GL_LIST_MODE: + { + GLenum mode; + if (!ctx->CompileFlag) + mode = 0; + else if (ctx->ExecuteFlag) + mode = GL_COMPILE_AND_EXECUTE; + else + mode = GL_COMPILE; + params[0] = ENUM_TO_INT(mode); + } + break; + case GL_INDEX_LOGIC_OP: + params[0] = BOOLEAN_TO_INT(ctx->Color.IndexLogicOpEnabled); + break; + case GL_COLOR_LOGIC_OP: + params[0] = BOOLEAN_TO_INT(ctx->Color.ColorLogicOpEnabled); + break; + case GL_LOGIC_OP_MODE: + params[0] = ENUM_TO_INT(ctx->Color.LogicOp); + break; + case GL_MAP1_COLOR_4: + params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Color4); + break; + case GL_MAP1_GRID_DOMAIN: + params[0] = IROUND(ctx->Eval.MapGrid1u1); + params[1] = IROUND(ctx->Eval.MapGrid1u2); + break; + case GL_MAP1_GRID_SEGMENTS: + params[0] = ctx->Eval.MapGrid1un; + break; + case GL_MAP1_INDEX: + params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Index); + break; + case GL_MAP1_NORMAL: + params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Normal); + break; + case GL_MAP1_TEXTURE_COORD_1: + params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1TextureCoord1); + break; + case GL_MAP1_TEXTURE_COORD_2: + params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1TextureCoord2); + break; + case GL_MAP1_TEXTURE_COORD_3: + params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1TextureCoord3); + break; + case GL_MAP1_TEXTURE_COORD_4: + params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1TextureCoord4); + break; + case GL_MAP1_VERTEX_3: + params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Vertex3); + break; + case GL_MAP1_VERTEX_4: + params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Vertex4); + break; + case GL_MAP2_COLOR_4: + params[0] = BOOLEAN_TO_INT(ctx->Eval.Map2Color4); + break; + case GL_MAP2_GRID_DOMAIN: + params[0] = IROUND(ctx->Eval.MapGrid2u1); + params[1] = IROUND(ctx->Eval.MapGrid2u2); + params[2] = IROUND(ctx->Eval.MapGrid2v1); + params[3] = IROUND(ctx->Eval.MapGrid2v2); + break; + case GL_MAP2_GRID_SEGMENTS: + params[0] = ctx->Eval.MapGrid2un; + params[1] = ctx->Eval.MapGrid2vn; + break; + case GL_MAP2_INDEX: + params[0] = BOOLEAN_TO_INT(ctx->Eval.Map2Index); + break; + case GL_MAP2_NORMAL: + params[0] = BOOLEAN_TO_INT(ctx->Eval.Map2Normal); + break; + case GL_MAP2_TEXTURE_COORD_1: + params[0] = BOOLEAN_TO_INT(ctx->Eval.Map2TextureCoord1); + break; + case GL_MAP2_TEXTURE_COORD_2: + params[0] = BOOLEAN_TO_INT(ctx->Eval.Map2TextureCoord2); + break; + case GL_MAP2_TEXTURE_COORD_3: + params[0] = BOOLEAN_TO_INT(ctx->Eval.Map2TextureCoord3); + break; + case GL_MAP2_TEXTURE_COORD_4: + params[0] = BOOLEAN_TO_INT(ctx->Eval.Map2TextureCoord4); + break; + case GL_MAP2_VERTEX_3: + params[0] = BOOLEAN_TO_INT(ctx->Eval.Map2Vertex3); + break; + case GL_MAP2_VERTEX_4: + params[0] = BOOLEAN_TO_INT(ctx->Eval.Map2Vertex4); + break; + case GL_MAP_COLOR: + params[0] = BOOLEAN_TO_INT(ctx->Pixel.MapColorFlag); + break; + case GL_MAP_STENCIL: + params[0] = BOOLEAN_TO_INT(ctx->Pixel.MapStencilFlag); + break; + case GL_MATRIX_MODE: + params[0] = ENUM_TO_INT(ctx->Transform.MatrixMode); + break; + case GL_MAX_ATTRIB_STACK_DEPTH: + params[0] = MAX_ATTRIB_STACK_DEPTH; + break; + case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH: + params[0] = MAX_CLIENT_ATTRIB_STACK_DEPTH; + break; + case GL_MAX_CLIP_PLANES: + params[0] = ctx->Const.MaxClipPlanes; + break; + case GL_MAX_ELEMENTS_VERTICES: + params[0] = ctx->Const.MaxArrayLockSize; + break; + case GL_MAX_ELEMENTS_INDICES: + params[0] = ctx->Const.MaxArrayLockSize; + break; + case GL_MAX_EVAL_ORDER: + params[0] = MAX_EVAL_ORDER; + break; + case GL_MAX_LIGHTS: + params[0] = ctx->Const.MaxLights; + break; + case GL_MAX_LIST_NESTING: + params[0] = MAX_LIST_NESTING; + break; + case GL_MAX_MODELVIEW_STACK_DEPTH: + params[0] = MAX_MODELVIEW_STACK_DEPTH; + break; + case GL_MAX_NAME_STACK_DEPTH: + params[0] = MAX_NAME_STACK_DEPTH; + break; + case GL_MAX_PIXEL_MAP_TABLE: + params[0] = MAX_PIXEL_MAP_TABLE; + break; + case GL_MAX_PROJECTION_STACK_DEPTH: + params[0] = MAX_PROJECTION_STACK_DEPTH; + break; + case GL_MAX_TEXTURE_SIZE: + params[0] = 1 << (ctx->Const.MaxTextureLevels - 1); + break; + case GL_MAX_3D_TEXTURE_SIZE: + params[0] = 1 << (ctx->Const.Max3DTextureLevels - 1); + break; + case GL_MAX_TEXTURE_STACK_DEPTH: + params[0] = MAX_TEXTURE_STACK_DEPTH; + break; + case GL_MAX_VIEWPORT_DIMS: + params[0] = ctx->Const.MaxViewportWidth; + params[1] = ctx->Const.MaxViewportHeight; + break; + case GL_MODELVIEW_MATRIX: + { + const GLfloat *matrix = ctx->ModelviewMatrixStack.Top->m; + params[0] = IROUND(matrix[0]); + params[1] = IROUND(matrix[1]); + params[2] = IROUND(matrix[2]); + params[3] = IROUND(matrix[3]); + params[4] = IROUND(matrix[4]); + params[5] = IROUND(matrix[5]); + params[6] = IROUND(matrix[6]); + params[7] = IROUND(matrix[7]); + params[8] = IROUND(matrix[8]); + params[9] = IROUND(matrix[9]); + params[10] = IROUND(matrix[10]); + params[11] = IROUND(matrix[11]); + params[12] = IROUND(matrix[12]); + params[13] = IROUND(matrix[13]); + params[14] = IROUND(matrix[14]); + params[15] = IROUND(matrix[15]); + } + break; + case GL_MODELVIEW_STACK_DEPTH: + params[0] = ctx->ModelviewMatrixStack.Depth + 1; + break; + case GL_NAME_STACK_DEPTH: + params[0] = ctx->Select.NameStackDepth; + break; + case GL_NORMALIZE: + params[0] = BOOLEAN_TO_INT(ctx->Transform.Normalize); + break; + case GL_PACK_ALIGNMENT: + params[0] = ctx->Pack.Alignment; + break; + case GL_PACK_LSB_FIRST: + params[0] = BOOLEAN_TO_INT(ctx->Pack.LsbFirst); + break; + case GL_PACK_ROW_LENGTH: + params[0] = ctx->Pack.RowLength; + break; + case GL_PACK_SKIP_PIXELS: + params[0] = ctx->Pack.SkipPixels; + break; + case GL_PACK_SKIP_ROWS: + params[0] = ctx->Pack.SkipRows; + break; + case GL_PACK_SWAP_BYTES: + params[0] = BOOLEAN_TO_INT(ctx->Pack.SwapBytes); + break; + case GL_PACK_SKIP_IMAGES_EXT: + params[0] = ctx->Pack.SkipImages; + break; + case GL_PACK_IMAGE_HEIGHT_EXT: + params[0] = ctx->Pack.ImageHeight; + break; + case GL_PACK_INVERT_MESA: + params[0] = BOOLEAN_TO_INT(ctx->Pack.Invert); + break; + case GL_PERSPECTIVE_CORRECTION_HINT: + params[0] = ENUM_TO_INT(ctx->Hint.PerspectiveCorrection); + break; + case GL_PIXEL_MAP_A_TO_A_SIZE: + params[0] = ctx->Pixel.MapAtoAsize; + break; + case GL_PIXEL_MAP_B_TO_B_SIZE: + params[0] = ctx->Pixel.MapBtoBsize; + break; + case GL_PIXEL_MAP_G_TO_G_SIZE: + params[0] = ctx->Pixel.MapGtoGsize; + break; + case GL_PIXEL_MAP_I_TO_A_SIZE: + params[0] = ctx->Pixel.MapItoAsize; + break; + case GL_PIXEL_MAP_I_TO_B_SIZE: + params[0] = ctx->Pixel.MapItoBsize; + break; + case GL_PIXEL_MAP_I_TO_G_SIZE: + params[0] = ctx->Pixel.MapItoGsize; + break; + case GL_PIXEL_MAP_I_TO_I_SIZE: + params[0] = ctx->Pixel.MapItoIsize; + break; + case GL_PIXEL_MAP_I_TO_R_SIZE: + params[0] = ctx->Pixel.MapItoRsize; + break; + case GL_PIXEL_MAP_R_TO_R_SIZE: + params[0] = ctx->Pixel.MapRtoRsize; + break; + case GL_PIXEL_MAP_S_TO_S_SIZE: + params[0] = ctx->Pixel.MapStoSsize; + break; + case GL_POINT_SIZE: + params[0] = IROUND(ctx->Point.Size); + break; + case GL_POINT_SIZE_GRANULARITY: + params[0] = IROUND(ctx->Const.PointSizeGranularity); + break; + case GL_POINT_SIZE_RANGE: + params[0] = IROUND(ctx->Const.MinPointSizeAA); + params[1] = IROUND(ctx->Const.MaxPointSizeAA); + break; + case GL_ALIASED_POINT_SIZE_RANGE: + params[0] = IROUND(ctx->Const.MinPointSize); + params[1] = IROUND(ctx->Const.MaxPointSize); + break; + case GL_POINT_SMOOTH: + params[0] = BOOLEAN_TO_INT(ctx->Point.SmoothFlag); + break; + case GL_POINT_SMOOTH_HINT: + params[0] = ENUM_TO_INT(ctx->Hint.PointSmooth); + break; + case GL_POINT_SIZE_MIN_EXT: + params[0] = IROUND(ctx->Point.MinSize); + break; + case GL_POINT_SIZE_MAX_EXT: + params[0] = IROUND(ctx->Point.MaxSize); + break; + case GL_POINT_FADE_THRESHOLD_SIZE_EXT: + params[0] = IROUND(ctx->Point.Threshold); + break; + case GL_DISTANCE_ATTENUATION_EXT: + params[0] = IROUND(ctx->Point.Params[0]); + params[1] = IROUND(ctx->Point.Params[1]); + params[2] = IROUND(ctx->Point.Params[2]); + break; + case GL_POLYGON_MODE: + params[0] = ENUM_TO_INT(ctx->Polygon.FrontMode); + params[1] = ENUM_TO_INT(ctx->Polygon.BackMode); + break; + case GL_POLYGON_OFFSET_BIAS_EXT: + params[0] = IROUND(ctx->Polygon.OffsetUnits); + break; + case GL_POLYGON_OFFSET_FACTOR: + params[0] = IROUND(ctx->Polygon.OffsetFactor ); + break; + case GL_POLYGON_OFFSET_UNITS: + params[0] = IROUND(ctx->Polygon.OffsetUnits ); + break; + case GL_POLYGON_SMOOTH: + params[0] = BOOLEAN_TO_INT(ctx->Polygon.SmoothFlag); + break; + case GL_POLYGON_SMOOTH_HINT: + params[0] = ENUM_TO_INT(ctx->Hint.PolygonSmooth); + break; + case GL_POLYGON_STIPPLE: + params[0] = BOOLEAN_TO_INT(ctx->Polygon.StippleFlag); + break; + case GL_PROJECTION_MATRIX: + { + const GLfloat *matrix = ctx->ProjectionMatrixStack.Top->m; + params[0] = IROUND(matrix[0]); + params[1] = IROUND(matrix[1]); + params[2] = IROUND(matrix[2]); + params[3] = IROUND(matrix[3]); + params[4] = IROUND(matrix[4]); + params[5] = IROUND(matrix[5]); + params[6] = IROUND(matrix[6]); + params[7] = IROUND(matrix[7]); + params[8] = IROUND(matrix[8]); + params[9] = IROUND(matrix[9]); + params[10] = IROUND(matrix[10]); + params[11] = IROUND(matrix[11]); + params[12] = IROUND(matrix[12]); + params[13] = IROUND(matrix[13]); + params[14] = IROUND(matrix[14]); + params[15] = IROUND(matrix[15]); + } + break; + case GL_PROJECTION_STACK_DEPTH: + params[0] = ctx->ProjectionMatrixStack.Depth + 1; + break; + case GL_READ_BUFFER: + params[0] = ENUM_TO_INT(ctx->ReadBuffer->ColorReadBuffer); + break; + case GL_RED_BIAS: + params[0] = IROUND(ctx->Pixel.RedBias); + break; + case GL_RED_BITS: + params[0] = ctx->DrawBuffer->Visual.redBits ; + break; + case GL_RED_SCALE: + params[0] = IROUND(ctx->Pixel.RedScale); + break; + case GL_RENDER_MODE: + params[0] = ENUM_TO_INT(ctx->RenderMode); + break; + case GL_RESCALE_NORMAL: + params[0] = BOOLEAN_TO_INT(ctx->Transform.RescaleNormals); + break; + case GL_RGBA_MODE: + params[0] = BOOLEAN_TO_INT(ctx->DrawBuffer->Visual.rgbMode); + break; + case GL_SCISSOR_BOX: + params[0] = ctx->Scissor.X; + params[1] = ctx->Scissor.Y; + params[2] = ctx->Scissor.Width; + params[3] = ctx->Scissor.Height; + break; + case GL_SCISSOR_TEST: + params[0] = BOOLEAN_TO_INT(ctx->Scissor.Enabled); + break; + case GL_SELECTION_BUFFER_SIZE: + params[0] = ctx->Select.BufferSize; + break; + case GL_SHADE_MODEL: + params[0] = ENUM_TO_INT(ctx->Light.ShadeModel); + break; + case GL_SHARED_TEXTURE_PALETTE_EXT: + params[0] = BOOLEAN_TO_INT(ctx->Texture.SharedPalette); + break; + case GL_STENCIL_BITS: + params[0] = ctx->DrawBuffer->Visual.stencilBits; + break; + case GL_STENCIL_CLEAR_VALUE: + params[0] = ctx->Stencil.Clear; + break; + case GL_STENCIL_FAIL: + params[0] = ENUM_TO_INT(ctx->Stencil.FailFunc[ctx->Stencil.ActiveFace]); + break; + case GL_STENCIL_FUNC: + params[0] = ENUM_TO_INT(ctx->Stencil.Function[ctx->Stencil.ActiveFace]); + break; + case GL_STENCIL_PASS_DEPTH_FAIL: + params[0] = ENUM_TO_INT(ctx->Stencil.ZFailFunc[ctx->Stencil.ActiveFace]); + break; + case GL_STENCIL_PASS_DEPTH_PASS: + params[0] = ENUM_TO_INT(ctx->Stencil.ZPassFunc[ctx->Stencil.ActiveFace]); + break; + case GL_STENCIL_REF: + params[0] = ctx->Stencil.Ref[ctx->Stencil.ActiveFace]; + break; + case GL_STENCIL_TEST: + params[0] = BOOLEAN_TO_INT(ctx->Stencil.Enabled); + break; + case GL_STENCIL_VALUE_MASK: + params[0] = ctx->Stencil.ValueMask[ctx->Stencil.ActiveFace]; + break; + case GL_STENCIL_WRITEMASK: + params[0] = ctx->Stencil.WriteMask[ctx->Stencil.ActiveFace]; + break; + case GL_STEREO: + params[0] = BOOLEAN_TO_INT(ctx->DrawBuffer->Visual.stereoMode); + break; + case GL_SUBPIXEL_BITS: + params[0] = ctx->Const.SubPixelBits; + break; + case GL_TEXTURE_1D: + params[0] = BOOLEAN_TO_INT(_mesa_IsEnabled(GL_TEXTURE_1D)); + break; + case GL_TEXTURE_2D: + params[0] = BOOLEAN_TO_INT(_mesa_IsEnabled(GL_TEXTURE_2D)); + break; + case GL_TEXTURE_3D: + params[0] = BOOLEAN_TO_INT(_mesa_IsEnabled(GL_TEXTURE_3D)); + break; + case GL_TEXTURE_BINDING_1D: + params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].Current1D->Name; + break; + case GL_TEXTURE_BINDING_2D: + params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].Current2D->Name; + break; + case GL_TEXTURE_BINDING_3D: + params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].Current3D->Name; + break; + case GL_TEXTURE_ENV_COLOR: + { + const GLfloat *color = ctx->Texture.Unit[ctx->Texture.CurrentUnit].EnvColor; + params[0] = FLOAT_TO_INT(color[0]); + params[1] = FLOAT_TO_INT(color[1]); + params[2] = FLOAT_TO_INT(color[2]); + params[3] = FLOAT_TO_INT(color[3]); + } + break; + case GL_TEXTURE_ENV_MODE: + params[0] = ENUM_TO_INT(ctx->Texture.Unit[ctx->Texture.CurrentUnit].EnvMode); + break; + case GL_TEXTURE_GEN_S: + params[0] = BOOLEAN_TO_INT(((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & S_BIT) ? 1 : 0)); + break; + case GL_TEXTURE_GEN_T: + params[0] = BOOLEAN_TO_INT(((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & T_BIT) ? 1 : 0)); + break; + case GL_TEXTURE_GEN_R: + params[0] = BOOLEAN_TO_INT(((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & R_BIT) ? 1 : 0)); + break; + case GL_TEXTURE_GEN_Q: + params[0] = BOOLEAN_TO_INT(((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & Q_BIT) ? 1 : 0)); + break; + case GL_TEXTURE_MATRIX: + { + const GLfloat *matrix = ctx->TextureMatrixStack[ctx->Texture.CurrentUnit].Top->m; + params[0] = IROUND(matrix[0]); + params[1] = IROUND(matrix[1]); + params[2] = IROUND(matrix[2]); + params[3] = IROUND(matrix[3]); + params[4] = IROUND(matrix[4]); + params[5] = IROUND(matrix[5]); + params[6] = IROUND(matrix[6]); + params[7] = IROUND(matrix[7]); + params[8] = IROUND(matrix[8]); + params[9] = IROUND(matrix[9]); + params[10] = IROUND(matrix[10]); + params[11] = IROUND(matrix[11]); + params[12] = IROUND(matrix[12]); + params[13] = IROUND(matrix[13]); + params[14] = IROUND(matrix[14]); + params[15] = IROUND(matrix[15]); + } + break; + case GL_TEXTURE_STACK_DEPTH: + params[0] = ctx->TextureMatrixStack[ctx->Texture.CurrentUnit].Depth + 1; + break; + case GL_UNPACK_ALIGNMENT: + params[0] = ctx->Unpack.Alignment; + break; + case GL_UNPACK_LSB_FIRST: + params[0] = BOOLEAN_TO_INT(ctx->Unpack.LsbFirst); + break; + case GL_UNPACK_ROW_LENGTH: + params[0] = ctx->Unpack.RowLength; + break; + case GL_UNPACK_SKIP_PIXELS: + params[0] = ctx->Unpack.SkipPixels; + break; + case GL_UNPACK_SKIP_ROWS: + params[0] = ctx->Unpack.SkipRows; + break; + case GL_UNPACK_SWAP_BYTES: + params[0] = BOOLEAN_TO_INT(ctx->Unpack.SwapBytes); + break; + case GL_UNPACK_SKIP_IMAGES_EXT: + params[0] = ctx->Unpack.SkipImages; + break; + case GL_UNPACK_IMAGE_HEIGHT_EXT: + params[0] = ctx->Unpack.ImageHeight; + break; + case GL_UNPACK_CLIENT_STORAGE_APPLE: + params[0] = BOOLEAN_TO_INT(ctx->Unpack.ClientStorage); + break; + case GL_VIEWPORT: + params[0] = ctx->Viewport.X; + params[1] = ctx->Viewport.Y; + params[2] = ctx->Viewport.Width; + params[3] = ctx->Viewport.Height; + break; + case GL_ZOOM_X: + params[0] = IROUND(ctx->Pixel.ZoomX); + break; + case GL_ZOOM_Y: + params[0] = IROUND(ctx->Pixel.ZoomY); + break; + case GL_VERTEX_ARRAY: + params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->Vertex.Enabled); + break; + case GL_VERTEX_ARRAY_SIZE: + params[0] = ctx->Array.ArrayObj->Vertex.Size; + break; + case GL_VERTEX_ARRAY_TYPE: + params[0] = ENUM_TO_INT(ctx->Array.ArrayObj->Vertex.Type); + break; + case GL_VERTEX_ARRAY_STRIDE: + params[0] = ctx->Array.ArrayObj->Vertex.Stride; + break; + case GL_VERTEX_ARRAY_COUNT_EXT: + params[0] = 0; + break; + case GL_NORMAL_ARRAY: + params[0] = ENUM_TO_INT(ctx->Array.ArrayObj->Normal.Enabled); + break; + case GL_NORMAL_ARRAY_TYPE: + params[0] = ENUM_TO_INT(ctx->Array.ArrayObj->Normal.Type); + break; + case GL_NORMAL_ARRAY_STRIDE: + params[0] = ctx->Array.ArrayObj->Normal.Stride; + break; + case GL_NORMAL_ARRAY_COUNT_EXT: + params[0] = 0; + break; + case GL_COLOR_ARRAY: + params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->Color.Enabled); + break; + case GL_COLOR_ARRAY_SIZE: + params[0] = ctx->Array.ArrayObj->Color.Size; + break; + case GL_COLOR_ARRAY_TYPE: + params[0] = ENUM_TO_INT(ctx->Array.ArrayObj->Color.Type); + break; + case GL_COLOR_ARRAY_STRIDE: + params[0] = ctx->Array.ArrayObj->Color.Stride; + break; + case GL_COLOR_ARRAY_COUNT_EXT: + params[0] = 0; + break; + case GL_INDEX_ARRAY: + params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->Index.Enabled); + break; + case GL_INDEX_ARRAY_TYPE: + params[0] = ENUM_TO_INT(ctx->Array.ArrayObj->Index.Type); + break; + case GL_INDEX_ARRAY_STRIDE: + params[0] = ctx->Array.ArrayObj->Index.Stride; + break; + case GL_INDEX_ARRAY_COUNT_EXT: + params[0] = 0; + break; + case GL_TEXTURE_COORD_ARRAY: + params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Enabled); + break; + case GL_TEXTURE_COORD_ARRAY_SIZE: + params[0] = ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Size; + break; + case GL_TEXTURE_COORD_ARRAY_TYPE: + params[0] = ENUM_TO_INT(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Type); + break; + case GL_TEXTURE_COORD_ARRAY_STRIDE: + params[0] = ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Stride; + break; + case GL_TEXTURE_COORD_ARRAY_COUNT_EXT: + params[0] = 0; + break; + case GL_EDGE_FLAG_ARRAY: + params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->EdgeFlag.Enabled); + break; + case GL_EDGE_FLAG_ARRAY_STRIDE: + params[0] = ctx->Array.ArrayObj->EdgeFlag.Stride; + break; + case GL_EDGE_FLAG_ARRAY_COUNT_EXT: + params[0] = 0; + break; + case GL_MAX_TEXTURE_UNITS_ARB: + CHECK_EXT1(ARB_multitexture, "GetIntegerv"); + params[0] = ctx->Const.MaxTextureUnits; + break; + case GL_ACTIVE_TEXTURE_ARB: + CHECK_EXT1(ARB_multitexture, "GetIntegerv"); + params[0] = GL_TEXTURE0_ARB + ctx->Texture.CurrentUnit; + break; + case GL_CLIENT_ACTIVE_TEXTURE_ARB: + CHECK_EXT1(ARB_multitexture, "GetIntegerv"); + params[0] = GL_TEXTURE0_ARB + ctx->Array.ActiveTexture; + break; + case GL_TEXTURE_CUBE_MAP_ARB: + CHECK_EXT1(ARB_texture_cube_map, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(_mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB)); + break; + case GL_TEXTURE_BINDING_CUBE_MAP_ARB: + CHECK_EXT1(ARB_texture_cube_map, "GetIntegerv"); + params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentCubeMap->Name; + break; + case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB: + CHECK_EXT1(ARB_texture_cube_map, "GetIntegerv"); + params[0] = (1 << (ctx->Const.MaxCubeTextureLevels - 1)); + break; + case GL_TEXTURE_COMPRESSION_HINT_ARB: + CHECK_EXT1(ARB_texture_compression, "GetIntegerv"); + params[0] = ctx->Hint.TextureCompression; + break; + case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB: + CHECK_EXT1(ARB_texture_compression, "GetIntegerv"); + params[0] = _mesa_get_compressed_formats(ctx, NULL, GL_FALSE); + break; + case GL_COMPRESSED_TEXTURE_FORMATS_ARB: + CHECK_EXT1(ARB_texture_compression, "GetIntegerv"); + { + GLint formats[100]; + GLuint i, n = _mesa_get_compressed_formats(ctx, formats, GL_FALSE); + ASSERT(n <= 100); + for (i = 0; i < n; i++) + params[i] = ENUM_TO_INT(formats[i]); + } + break; + case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT: + CHECK_EXT1(EXT_compiled_vertex_array, "GetIntegerv"); + params[0] = ctx->Array.LockFirst; + break; + case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT: + CHECK_EXT1(EXT_compiled_vertex_array, "GetIntegerv"); + params[0] = ctx->Array.LockCount; + break; + case GL_TRANSPOSE_COLOR_MATRIX_ARB: + { + const GLfloat *matrix = ctx->ColorMatrixStack.Top->m; + params[0] = IROUND(matrix[0]); + params[1] = IROUND(matrix[4]); + params[2] = IROUND(matrix[8]); + params[3] = IROUND(matrix[12]); + params[4] = IROUND(matrix[1]); + params[5] = IROUND(matrix[5]); + params[6] = IROUND(matrix[9]); + params[7] = IROUND(matrix[13]); + params[8] = IROUND(matrix[2]); + params[9] = IROUND(matrix[6]); + params[10] = IROUND(matrix[10]); + params[11] = IROUND(matrix[14]); + params[12] = IROUND(matrix[3]); + params[13] = IROUND(matrix[7]); + params[14] = IROUND(matrix[11]); + params[15] = IROUND(matrix[15]); + } + break; + case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB: + { + const GLfloat *matrix = ctx->ModelviewMatrixStack.Top->m; + params[0] = IROUND(matrix[0]); + params[1] = IROUND(matrix[4]); + params[2] = IROUND(matrix[8]); + params[3] = IROUND(matrix[12]); + params[4] = IROUND(matrix[1]); + params[5] = IROUND(matrix[5]); + params[6] = IROUND(matrix[9]); + params[7] = IROUND(matrix[13]); + params[8] = IROUND(matrix[2]); + params[9] = IROUND(matrix[6]); + params[10] = IROUND(matrix[10]); + params[11] = IROUND(matrix[14]); + params[12] = IROUND(matrix[3]); + params[13] = IROUND(matrix[7]); + params[14] = IROUND(matrix[11]); + params[15] = IROUND(matrix[15]); + } + break; + case GL_TRANSPOSE_PROJECTION_MATRIX_ARB: + { + const GLfloat *matrix = ctx->ProjectionMatrixStack.Top->m; + params[0] = IROUND(matrix[0]); + params[1] = IROUND(matrix[4]); + params[2] = IROUND(matrix[8]); + params[3] = IROUND(matrix[12]); + params[4] = IROUND(matrix[1]); + params[5] = IROUND(matrix[5]); + params[6] = IROUND(matrix[9]); + params[7] = IROUND(matrix[13]); + params[8] = IROUND(matrix[2]); + params[9] = IROUND(matrix[6]); + params[10] = IROUND(matrix[10]); + params[11] = IROUND(matrix[14]); + params[12] = IROUND(matrix[3]); + params[13] = IROUND(matrix[7]); + params[14] = IROUND(matrix[11]); + params[15] = IROUND(matrix[15]); + } + break; + case GL_TRANSPOSE_TEXTURE_MATRIX_ARB: + { + const GLfloat *matrix = ctx->TextureMatrixStack[ctx->Texture.CurrentUnit].Top->m; + params[0] = IROUND(matrix[0]); + params[1] = IROUND(matrix[4]); + params[2] = IROUND(matrix[8]); + params[3] = IROUND(matrix[12]); + params[4] = IROUND(matrix[1]); + params[5] = IROUND(matrix[5]); + params[6] = IROUND(matrix[9]); + params[7] = IROUND(matrix[13]); + params[8] = IROUND(matrix[2]); + params[9] = IROUND(matrix[6]); + params[10] = IROUND(matrix[10]); + params[11] = IROUND(matrix[14]); + params[12] = IROUND(matrix[3]); + params[13] = IROUND(matrix[7]); + params[14] = IROUND(matrix[11]); + params[15] = IROUND(matrix[15]); + } + break; + case GL_COLOR_MATRIX_SGI: + { + const GLfloat *matrix = ctx->ColorMatrixStack.Top->m; + params[0] = IROUND(matrix[0]); + params[1] = IROUND(matrix[1]); + params[2] = IROUND(matrix[2]); + params[3] = IROUND(matrix[3]); + params[4] = IROUND(matrix[4]); + params[5] = IROUND(matrix[5]); + params[6] = IROUND(matrix[6]); + params[7] = IROUND(matrix[7]); + params[8] = IROUND(matrix[8]); + params[9] = IROUND(matrix[9]); + params[10] = IROUND(matrix[10]); + params[11] = IROUND(matrix[11]); + params[12] = IROUND(matrix[12]); + params[13] = IROUND(matrix[13]); + params[14] = IROUND(matrix[14]); + params[15] = IROUND(matrix[15]); + } + break; + case GL_COLOR_MATRIX_STACK_DEPTH_SGI: + params[0] = ctx->ColorMatrixStack.Depth + 1; + break; + case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI: + params[0] = MAX_COLOR_STACK_DEPTH; + break; + case GL_POST_COLOR_MATRIX_RED_SCALE_SGI: + params[0] = IROUND(ctx->Pixel.PostColorMatrixScale[0]); + break; + case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI: + params[0] = IROUND(ctx->Pixel.PostColorMatrixScale[1]); + break; + case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI: + params[0] = IROUND(ctx->Pixel.PostColorMatrixScale[2]); + break; + case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI: + params[0] = IROUND(ctx->Pixel.PostColorMatrixScale[3]); + break; + case GL_POST_COLOR_MATRIX_RED_BIAS_SGI: + params[0] = IROUND(ctx->Pixel.PostColorMatrixBias[0]); + break; + case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI: + params[0] = IROUND(ctx->Pixel.PostColorMatrixBias[1]); + break; + case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI: + params[0] = IROUND(ctx->Pixel.PostColorMatrixBias[2]); + break; + case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI: + params[0] = IROUND(ctx->Pixel.PostColorMatrixBias[3]); + break; + case GL_CONVOLUTION_1D_EXT: + CHECK_EXT1(EXT_convolution, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Pixel.Convolution1DEnabled); + break; + case GL_CONVOLUTION_2D_EXT: + CHECK_EXT1(EXT_convolution, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Pixel.Convolution2DEnabled); + break; + case GL_SEPARABLE_2D_EXT: + CHECK_EXT1(EXT_convolution, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Pixel.Separable2DEnabled); + break; + case GL_POST_CONVOLUTION_RED_SCALE_EXT: + CHECK_EXT1(EXT_convolution, "GetIntegerv"); + params[0] = IROUND(ctx->Pixel.PostConvolutionScale[0]); + break; + case GL_POST_CONVOLUTION_GREEN_SCALE_EXT: + CHECK_EXT1(EXT_convolution, "GetIntegerv"); + params[0] = IROUND(ctx->Pixel.PostConvolutionScale[1]); + break; + case GL_POST_CONVOLUTION_BLUE_SCALE_EXT: + CHECK_EXT1(EXT_convolution, "GetIntegerv"); + params[0] = IROUND(ctx->Pixel.PostConvolutionScale[2]); + break; + case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT: + CHECK_EXT1(EXT_convolution, "GetIntegerv"); + params[0] = IROUND(ctx->Pixel.PostConvolutionScale[3]); + break; + case GL_POST_CONVOLUTION_RED_BIAS_EXT: + CHECK_EXT1(EXT_convolution, "GetIntegerv"); + params[0] = IROUND(ctx->Pixel.PostConvolutionBias[0]); + break; + case GL_POST_CONVOLUTION_GREEN_BIAS_EXT: + CHECK_EXT1(EXT_convolution, "GetIntegerv"); + params[0] = IROUND(ctx->Pixel.PostConvolutionBias[1]); + break; + case GL_POST_CONVOLUTION_BLUE_BIAS_EXT: + CHECK_EXT1(EXT_convolution, "GetIntegerv"); + params[0] = IROUND(ctx->Pixel.PostConvolutionBias[2]); + break; + case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT: + CHECK_EXT1(EXT_convolution, "GetIntegerv"); + params[0] = IROUND(ctx->Pixel.PostConvolutionBias[3]); + break; + case GL_HISTOGRAM: + CHECK_EXT1(EXT_histogram, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Pixel.HistogramEnabled); + break; + case GL_MINMAX: + CHECK_EXT1(EXT_histogram, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Pixel.MinMaxEnabled); + break; + case GL_COLOR_TABLE_SGI: + CHECK_EXT1(SGI_color_table, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Pixel.ColorTableEnabled); + break; + case GL_POST_CONVOLUTION_COLOR_TABLE_SGI: + CHECK_EXT1(SGI_color_table, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Pixel.PostConvolutionColorTableEnabled); + break; + case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI: + CHECK_EXT1(SGI_color_table, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Pixel.PostColorMatrixColorTableEnabled); + break; + case GL_TEXTURE_COLOR_TABLE_SGI: + CHECK_EXT1(SGI_texture_color_table, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Texture.Unit[ctx->Texture.CurrentUnit].ColorTableEnabled); + break; + case GL_COLOR_SUM_EXT: + CHECK_EXT2(EXT_secondary_color, ARB_vertex_program, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Fog.ColorSumEnabled); + break; + case GL_CURRENT_SECONDARY_COLOR_EXT: + CHECK_EXT1(EXT_secondary_color, "GetIntegerv"); + { + FLUSH_CURRENT(ctx, 0); + params[0] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0]); + params[1] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1]); + params[2] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2]); + params[3] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][3]); + } + break; + case GL_SECONDARY_COLOR_ARRAY_EXT: + CHECK_EXT1(EXT_secondary_color, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->SecondaryColor.Enabled); + break; + case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT: + CHECK_EXT1(EXT_secondary_color, "GetIntegerv"); + params[0] = ENUM_TO_INT(ctx->Array.ArrayObj->SecondaryColor.Type); + break; + case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT: + CHECK_EXT1(EXT_secondary_color, "GetIntegerv"); + params[0] = ctx->Array.ArrayObj->SecondaryColor.Stride; + break; + case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT: + CHECK_EXT1(EXT_secondary_color, "GetIntegerv"); + params[0] = ctx->Array.ArrayObj->SecondaryColor.Size; + break; + case GL_CURRENT_FOG_COORDINATE_EXT: + CHECK_EXT1(EXT_fog_coord, "GetIntegerv"); + { + FLUSH_CURRENT(ctx, 0); + params[0] = IROUND(ctx->Current.Attrib[VERT_ATTRIB_FOG][0]); + } + break; + case GL_FOG_COORDINATE_ARRAY_EXT: + CHECK_EXT1(EXT_fog_coord, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->FogCoord.Enabled); + break; + case GL_FOG_COORDINATE_ARRAY_TYPE_EXT: + CHECK_EXT1(EXT_fog_coord, "GetIntegerv"); + params[0] = ENUM_TO_INT(ctx->Array.ArrayObj->FogCoord.Type); + break; + case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT: + CHECK_EXT1(EXT_fog_coord, "GetIntegerv"); + params[0] = ctx->Array.ArrayObj->FogCoord.Stride; + break; + case GL_FOG_COORDINATE_SOURCE_EXT: + CHECK_EXT1(EXT_fog_coord, "GetIntegerv"); + params[0] = ENUM_TO_INT(ctx->Fog.FogCoordinateSource); + break; + case GL_MAX_TEXTURE_LOD_BIAS_EXT: + CHECK_EXT1(EXT_texture_lod_bias, "GetIntegerv"); + params[0] = IROUND(ctx->Const.MaxTextureLodBias); + break; + case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT: + CHECK_EXT1(EXT_texture_filter_anisotropic, "GetIntegerv"); + params[0] = IROUND(ctx->Const.MaxTextureMaxAnisotropy); + break; + case GL_MULTISAMPLE_ARB: + CHECK_EXT1(ARB_multisample, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Multisample.Enabled); + break; + case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB: + CHECK_EXT1(ARB_multisample, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Multisample.SampleAlphaToCoverage); + break; + case GL_SAMPLE_ALPHA_TO_ONE_ARB: + CHECK_EXT1(ARB_multisample, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Multisample.SampleAlphaToOne); + break; + case GL_SAMPLE_COVERAGE_ARB: + CHECK_EXT1(ARB_multisample, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Multisample.SampleCoverage); + break; + case GL_SAMPLE_COVERAGE_VALUE_ARB: + CHECK_EXT1(ARB_multisample, "GetIntegerv"); + params[0] = IROUND(ctx->Multisample.SampleCoverageValue); + break; + case GL_SAMPLE_COVERAGE_INVERT_ARB: + CHECK_EXT1(ARB_multisample, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Multisample.SampleCoverageInvert); + break; + case GL_SAMPLE_BUFFERS_ARB: + CHECK_EXT1(ARB_multisample, "GetIntegerv"); + params[0] = ctx->DrawBuffer->Visual.sampleBuffers; + break; + case GL_SAMPLES_ARB: + CHECK_EXT1(ARB_multisample, "GetIntegerv"); + params[0] = ctx->DrawBuffer->Visual.samples; + break; + case GL_RASTER_POSITION_UNCLIPPED_IBM: + CHECK_EXT1(IBM_rasterpos_clip, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Transform.RasterPositionUnclipped); + break; + case GL_POINT_SPRITE_NV: + CHECK_EXT2(NV_point_sprite, ARB_point_sprite, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Point.PointSprite); + break; + case GL_POINT_SPRITE_R_MODE_NV: + CHECK_EXT1(NV_point_sprite, "GetIntegerv"); + params[0] = ENUM_TO_INT(ctx->Point.SpriteRMode); + break; + case GL_POINT_SPRITE_COORD_ORIGIN: + CHECK_EXT2(NV_point_sprite, ARB_point_sprite, "GetIntegerv"); + params[0] = ENUM_TO_INT(ctx->Point.SpriteOrigin); + break; + case GL_GENERATE_MIPMAP_HINT_SGIS: + CHECK_EXT1(SGIS_generate_mipmap, "GetIntegerv"); + params[0] = ENUM_TO_INT(ctx->Hint.GenerateMipmap); + break; + case GL_VERTEX_PROGRAM_BINDING_NV: + CHECK_EXT1(NV_vertex_program, "GetIntegerv"); + params[0] = (ctx->VertexProgram.Current ? ctx->VertexProgram.Current->Base.Id : 0); + break; + case GL_VERTEX_ATTRIB_ARRAY0_NV: + CHECK_EXT1(NV_vertex_program, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[0].Enabled); + break; + case GL_VERTEX_ATTRIB_ARRAY1_NV: + CHECK_EXT1(NV_vertex_program, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[1].Enabled); + break; + case GL_VERTEX_ATTRIB_ARRAY2_NV: + CHECK_EXT1(NV_vertex_program, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[2].Enabled); + break; + case GL_VERTEX_ATTRIB_ARRAY3_NV: + CHECK_EXT1(NV_vertex_program, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[3].Enabled); + break; + case GL_VERTEX_ATTRIB_ARRAY4_NV: + CHECK_EXT1(NV_vertex_program, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[4].Enabled); + break; + case GL_VERTEX_ATTRIB_ARRAY5_NV: + CHECK_EXT1(NV_vertex_program, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[5].Enabled); + break; + case GL_VERTEX_ATTRIB_ARRAY6_NV: + CHECK_EXT1(NV_vertex_program, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[6].Enabled); + break; + case GL_VERTEX_ATTRIB_ARRAY7_NV: + CHECK_EXT1(NV_vertex_program, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[7].Enabled); + break; + case GL_VERTEX_ATTRIB_ARRAY8_NV: + CHECK_EXT1(NV_vertex_program, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[8].Enabled); + break; + case GL_VERTEX_ATTRIB_ARRAY9_NV: + CHECK_EXT1(NV_vertex_program, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[9].Enabled); + break; + case GL_VERTEX_ATTRIB_ARRAY10_NV: + CHECK_EXT1(NV_vertex_program, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[10].Enabled); + break; + case GL_VERTEX_ATTRIB_ARRAY11_NV: + CHECK_EXT1(NV_vertex_program, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[11].Enabled); + break; + case GL_VERTEX_ATTRIB_ARRAY12_NV: + CHECK_EXT1(NV_vertex_program, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[12].Enabled); + break; + case GL_VERTEX_ATTRIB_ARRAY13_NV: + CHECK_EXT1(NV_vertex_program, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[13].Enabled); + break; + case GL_VERTEX_ATTRIB_ARRAY14_NV: + CHECK_EXT1(NV_vertex_program, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[14].Enabled); + break; + case GL_VERTEX_ATTRIB_ARRAY15_NV: + CHECK_EXT1(NV_vertex_program, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[15].Enabled); + break; + case GL_MAP1_VERTEX_ATTRIB0_4_NV: + CHECK_EXT1(NV_vertex_program, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[0]); + break; + case GL_MAP1_VERTEX_ATTRIB1_4_NV: + CHECK_EXT1(NV_vertex_program, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[1]); + break; + case GL_MAP1_VERTEX_ATTRIB2_4_NV: + CHECK_EXT1(NV_vertex_program, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[2]); + break; + case GL_MAP1_VERTEX_ATTRIB3_4_NV: + CHECK_EXT1(NV_vertex_program, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[3]); + break; + case GL_MAP1_VERTEX_ATTRIB4_4_NV: + CHECK_EXT1(NV_vertex_program, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[4]); + break; + case GL_MAP1_VERTEX_ATTRIB5_4_NV: + CHECK_EXT1(NV_vertex_program, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[5]); + break; + case GL_MAP1_VERTEX_ATTRIB6_4_NV: + CHECK_EXT1(NV_vertex_program, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[6]); + break; + case GL_MAP1_VERTEX_ATTRIB7_4_NV: + CHECK_EXT1(NV_vertex_program, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[7]); + break; + case GL_MAP1_VERTEX_ATTRIB8_4_NV: + CHECK_EXT1(NV_vertex_program, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[8]); + break; + case GL_MAP1_VERTEX_ATTRIB9_4_NV: + CHECK_EXT1(NV_vertex_program, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[9]); + break; + case GL_MAP1_VERTEX_ATTRIB10_4_NV: + CHECK_EXT1(NV_vertex_program, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[10]); + break; + case GL_MAP1_VERTEX_ATTRIB11_4_NV: + CHECK_EXT1(NV_vertex_program, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[11]); + break; + case GL_MAP1_VERTEX_ATTRIB12_4_NV: + CHECK_EXT1(NV_vertex_program, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[12]); + break; + case GL_MAP1_VERTEX_ATTRIB13_4_NV: + CHECK_EXT1(NV_vertex_program, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[13]); + break; + case GL_MAP1_VERTEX_ATTRIB14_4_NV: + CHECK_EXT1(NV_vertex_program, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[14]); + break; + case GL_MAP1_VERTEX_ATTRIB15_4_NV: + CHECK_EXT1(NV_vertex_program, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[15]); + break; + case GL_FRAGMENT_PROGRAM_NV: + CHECK_EXT1(NV_fragment_program, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->FragmentProgram.Enabled); + break; + case GL_FRAGMENT_PROGRAM_BINDING_NV: + CHECK_EXT1(NV_fragment_program, "GetIntegerv"); + params[0] = ctx->FragmentProgram.Current ? ctx->FragmentProgram.Current->Base.Id : 0; + break; + case GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV: + CHECK_EXT1(NV_fragment_program, "GetIntegerv"); + params[0] = MAX_NV_FRAGMENT_PROGRAM_PARAMS; + break; + case GL_TEXTURE_RECTANGLE_NV: + CHECK_EXT1(NV_texture_rectangle, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(_mesa_IsEnabled(GL_TEXTURE_RECTANGLE_NV)); + break; + case GL_TEXTURE_BINDING_RECTANGLE_NV: + CHECK_EXT1(NV_texture_rectangle, "GetIntegerv"); + params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentRect->Name; + break; + case GL_MAX_RECTANGLE_TEXTURE_SIZE_NV: + CHECK_EXT1(NV_texture_rectangle, "GetIntegerv"); + params[0] = ctx->Const.MaxTextureRectSize; + break; + case GL_STENCIL_TEST_TWO_SIDE_EXT: + CHECK_EXT1(EXT_stencil_two_side, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Stencil.TestTwoSide); + break; + case GL_ACTIVE_STENCIL_FACE_EXT: + CHECK_EXT1(EXT_stencil_two_side, "GetIntegerv"); + params[0] = ENUM_TO_INT(ctx->Stencil.ActiveFace ? GL_BACK : GL_FRONT); + break; + case GL_MAX_SHININESS_NV: + CHECK_EXT1(NV_light_max_exponent, "GetIntegerv"); + params[0] = IROUND(ctx->Const.MaxShininess); + break; + case GL_MAX_SPOT_EXPONENT_NV: + CHECK_EXT1(NV_light_max_exponent, "GetIntegerv"); + params[0] = IROUND(ctx->Const.MaxSpotExponent); + break; + case GL_ARRAY_BUFFER_BINDING_ARB: + CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); + params[0] = ctx->Array.ArrayBufferObj->Name; + break; + case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB: + CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); + params[0] = ctx->Array.ArrayObj->Vertex.BufferObj->Name; + break; + case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB: + CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); + params[0] = ctx->Array.ArrayObj->Normal.BufferObj->Name; + break; + case GL_COLOR_ARRAY_BUFFER_BINDING_ARB: + CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); + params[0] = ctx->Array.ArrayObj->Color.BufferObj->Name; + break; + case GL_INDEX_ARRAY_BUFFER_BINDING_ARB: + CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); + params[0] = ctx->Array.ArrayObj->Index.BufferObj->Name; + break; + case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB: + CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); + params[0] = ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].BufferObj->Name; + break; + case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB: + CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); + params[0] = ctx->Array.ArrayObj->EdgeFlag.BufferObj->Name; + break; + case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB: + CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); + params[0] = ctx->Array.ArrayObj->SecondaryColor.BufferObj->Name; + break; + case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB: + CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); + params[0] = ctx->Array.ArrayObj->FogCoord.BufferObj->Name; + break; + case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB: + CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); + params[0] = ctx->Array.ElementArrayBufferObj->Name; + break; + case GL_PIXEL_PACK_BUFFER_BINDING_EXT: + CHECK_EXT1(EXT_pixel_buffer_object, "GetIntegerv"); + params[0] = ctx->Pack.BufferObj->Name; + break; + case GL_PIXEL_UNPACK_BUFFER_BINDING_EXT: + CHECK_EXT1(EXT_pixel_buffer_object, "GetIntegerv"); + params[0] = ctx->Unpack.BufferObj->Name; + break; + case GL_VERTEX_PROGRAM_ARB: + CHECK_EXT2(ARB_vertex_program, NV_vertex_program, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->VertexProgram.Enabled); + break; + case GL_VERTEX_PROGRAM_POINT_SIZE_ARB: + CHECK_EXT2(ARB_vertex_program, NV_vertex_program, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->VertexProgram.PointSizeEnabled); + break; + case GL_VERTEX_PROGRAM_TWO_SIDE_ARB: + CHECK_EXT2(ARB_vertex_program, NV_vertex_program, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->VertexProgram.TwoSideEnabled); + break; + case GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB: + CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_vertex_program, "GetIntegerv"); + params[0] = ctx->Const.MaxProgramMatrixStackDepth; + break; + case GL_MAX_PROGRAM_MATRICES_ARB: + CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_vertex_program, "GetIntegerv"); + params[0] = ctx->Const.MaxProgramMatrices; + break; + case GL_CURRENT_MATRIX_STACK_DEPTH_ARB: + CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_vertex_program, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->CurrentStack->Depth + 1); + break; + case GL_CURRENT_MATRIX_ARB: + CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_fragment_program, "GetIntegerv"); + { + const GLfloat *matrix = ctx->CurrentStack->Top->m; + params[0] = IROUND(matrix[0]); + params[1] = IROUND(matrix[1]); + params[2] = IROUND(matrix[2]); + params[3] = IROUND(matrix[3]); + params[4] = IROUND(matrix[4]); + params[5] = IROUND(matrix[5]); + params[6] = IROUND(matrix[6]); + params[7] = IROUND(matrix[7]); + params[8] = IROUND(matrix[8]); + params[9] = IROUND(matrix[9]); + params[10] = IROUND(matrix[10]); + params[11] = IROUND(matrix[11]); + params[12] = IROUND(matrix[12]); + params[13] = IROUND(matrix[13]); + params[14] = IROUND(matrix[14]); + params[15] = IROUND(matrix[15]); + } + break; + case GL_TRANSPOSE_CURRENT_MATRIX_ARB: + CHECK_EXT2(ARB_vertex_program, ARB_fragment_program, "GetIntegerv"); + { + const GLfloat *matrix = ctx->CurrentStack->Top->m; + params[0] = IROUND(matrix[0]); + params[1] = IROUND(matrix[4]); + params[2] = IROUND(matrix[8]); + params[3] = IROUND(matrix[12]); + params[4] = IROUND(matrix[1]); + params[5] = IROUND(matrix[5]); + params[6] = IROUND(matrix[9]); + params[7] = IROUND(matrix[13]); + params[8] = IROUND(matrix[2]); + params[9] = IROUND(matrix[6]); + params[10] = IROUND(matrix[10]); + params[11] = IROUND(matrix[14]); + params[12] = IROUND(matrix[3]); + params[13] = IROUND(matrix[7]); + params[14] = IROUND(matrix[11]); + params[15] = IROUND(matrix[15]); + } + break; + case GL_MAX_VERTEX_ATTRIBS_ARB: + CHECK_EXT1(ARB_vertex_program, "GetIntegerv"); + params[0] = ctx->Const.VertexProgram.MaxAttribs; + break; + case GL_PROGRAM_ERROR_POSITION_ARB: + CHECK_EXT4(NV_vertex_program, ARB_vertex_program, NV_fragment_program, ARB_fragment_program, "GetIntegerv"); + params[0] = ctx->Program.ErrorPos; + break; + case GL_FRAGMENT_PROGRAM_ARB: + CHECK_EXT1(ARB_fragment_program, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->FragmentProgram.Enabled); + break; + case GL_MAX_TEXTURE_COORDS_ARB: + CHECK_EXT2(ARB_fragment_program, NV_fragment_program, "GetIntegerv"); + params[0] = ctx->Const.MaxTextureCoordUnits; + break; + case GL_MAX_TEXTURE_IMAGE_UNITS_ARB: + CHECK_EXT2(ARB_fragment_program, NV_fragment_program, "GetIntegerv"); + params[0] = ctx->Const.MaxTextureImageUnits; + break; + case GL_DEPTH_BOUNDS_TEST_EXT: + CHECK_EXT1(EXT_depth_bounds_test, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Depth.BoundsTest); + break; + case GL_DEPTH_BOUNDS_EXT: + CHECK_EXT1(EXT_depth_bounds_test, "GetIntegerv"); + params[0] = IROUND(ctx->Depth.BoundsMin); + params[1] = IROUND(ctx->Depth.BoundsMax); + break; + case GL_FRAGMENT_PROGRAM_CALLBACK_MESA: + CHECK_EXT1(MESA_program_debug, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->FragmentProgram.CallbackEnabled); + break; + case GL_VERTEX_PROGRAM_CALLBACK_MESA: + CHECK_EXT1(MESA_program_debug, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->VertexProgram.CallbackEnabled); + break; + case GL_FRAGMENT_PROGRAM_POSITION_MESA: + CHECK_EXT1(MESA_program_debug, "GetIntegerv"); + params[0] = ctx->FragmentProgram.CurrentPosition; + break; + case GL_VERTEX_PROGRAM_POSITION_MESA: + CHECK_EXT1(MESA_program_debug, "GetIntegerv"); + params[0] = ctx->VertexProgram.CurrentPosition; + break; + case GL_MAX_DRAW_BUFFERS_ARB: + CHECK_EXT1(ARB_draw_buffers, "GetIntegerv"); + params[0] = ctx->Const.MaxDrawBuffers; + break; + case GL_DRAW_BUFFER0_ARB: + CHECK_EXT1(ARB_draw_buffers, "GetIntegerv"); + params[0] = ENUM_TO_INT(ctx->DrawBuffer->ColorDrawBuffer[0]); + break; + case GL_DRAW_BUFFER1_ARB: + CHECK_EXT1(ARB_draw_buffers, "GetIntegerv"); + { + GLenum buffer; + if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) { + _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)"); + return; + } + buffer = ctx->DrawBuffer->ColorDrawBuffer[1]; + params[0] = ENUM_TO_INT(buffer); + } + break; + case GL_DRAW_BUFFER2_ARB: + CHECK_EXT1(ARB_draw_buffers, "GetIntegerv"); + { + GLenum buffer; + if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) { + _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)"); + return; + } + buffer = ctx->DrawBuffer->ColorDrawBuffer[2]; + params[0] = ENUM_TO_INT(buffer); + } + break; + case GL_DRAW_BUFFER3_ARB: + CHECK_EXT1(ARB_draw_buffers, "GetIntegerv"); + { + GLenum buffer; + if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) { + _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)"); + return; + } + buffer = ctx->DrawBuffer->ColorDrawBuffer[3]; + params[0] = ENUM_TO_INT(buffer); + } + break; + case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES: + CHECK_EXT1(OES_read_format, "GetIntegerv"); + params[0] = ctx->Const.ColorReadType; + break; + case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES: + CHECK_EXT1(OES_read_format, "GetIntegerv"); + params[0] = ctx->Const.ColorReadFormat; + break; + case GL_NUM_FRAGMENT_REGISTERS_ATI: + CHECK_EXT1(ATI_fragment_shader, "GetIntegerv"); + params[0] = 6; + break; + case GL_NUM_FRAGMENT_CONSTANTS_ATI: + CHECK_EXT1(ATI_fragment_shader, "GetIntegerv"); + params[0] = 8; + break; + case GL_NUM_PASSES_ATI: + CHECK_EXT1(ATI_fragment_shader, "GetIntegerv"); + params[0] = 2; + break; + case GL_NUM_INSTRUCTIONS_PER_PASS_ATI: + CHECK_EXT1(ATI_fragment_shader, "GetIntegerv"); + params[0] = 8; + break; + case GL_NUM_INSTRUCTIONS_TOTAL_ATI: + CHECK_EXT1(ATI_fragment_shader, "GetIntegerv"); + params[0] = 16; + break; + case GL_COLOR_ALPHA_PAIRING_ATI: + CHECK_EXT1(ATI_fragment_shader, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(GL_TRUE); + break; + case GL_NUM_LOOPBACK_COMPONENTS_ATI: + CHECK_EXT1(ATI_fragment_shader, "GetIntegerv"); + params[0] = 3; + break; + case GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI: + CHECK_EXT1(ATI_fragment_shader, "GetIntegerv"); + params[0] = 3; + break; + case GL_STENCIL_BACK_FUNC: + params[0] = ENUM_TO_INT(ctx->Stencil.Function[1]); + break; + case GL_STENCIL_BACK_VALUE_MASK: + params[0] = ctx->Stencil.ValueMask[1]; + break; + case GL_STENCIL_BACK_REF: + params[0] = ctx->Stencil.Ref[1]; + break; + case GL_STENCIL_BACK_FAIL: + params[0] = ENUM_TO_INT(ctx->Stencil.FailFunc[1]); + break; + case GL_STENCIL_BACK_PASS_DEPTH_FAIL: + params[0] = ENUM_TO_INT(ctx->Stencil.ZFailFunc[1]); + break; + case GL_STENCIL_BACK_PASS_DEPTH_PASS: + params[0] = ENUM_TO_INT(ctx->Stencil.ZPassFunc[1]); + break; + case GL_FRAMEBUFFER_BINDING_EXT: + CHECK_EXT1(EXT_framebuffer_object, "GetIntegerv"); + params[0] = ctx->DrawBuffer->Name; + break; + case GL_RENDERBUFFER_BINDING_EXT: + CHECK_EXT1(EXT_framebuffer_object, "GetIntegerv"); + params[0] = ctx->CurrentRenderbuffer ? ctx->CurrentRenderbuffer->Name : 0; + break; + case GL_MAX_COLOR_ATTACHMENTS_EXT: + CHECK_EXT1(EXT_framebuffer_object, "GetIntegerv"); + params[0] = ctx->Const.MaxColorAttachments; + break; + case GL_MAX_RENDERBUFFER_SIZE_EXT: + CHECK_EXT1(EXT_framebuffer_object, "GetIntegerv"); + params[0] = ctx->Const.MaxRenderbufferSize; + break; + case GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB: + CHECK_EXT1(ARB_fragment_shader, "GetIntegerv"); + params[0] = MAX_FRAGMENT_UNIFORM_COMPONENTS; + break; + case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB: + CHECK_EXT1(ARB_fragment_shader, "GetIntegerv"); + params[0] = ENUM_TO_INT(ctx->Hint.FragmentShaderDerivative); + break; + case GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB: + CHECK_EXT1(ARB_vertex_shader, "GetIntegerv"); + params[0] = MAX_VERTEX_UNIFORM_COMPONENTS; + break; + case GL_MAX_VARYING_FLOATS_ARB: + CHECK_EXT1(ARB_vertex_shader, "GetIntegerv"); + params[0] = MAX_VARYING_FLOATS; + break; + case GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB: + CHECK_EXT1(ARB_vertex_shader, "GetIntegerv"); + params[0] = MAX_VERTEX_TEXTURE_IMAGE_UNITS; + break; + case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB: + CHECK_EXT1(ARB_vertex_shader, "GetIntegerv"); + params[0] = MAX_COMBINED_TEXTURE_IMAGE_UNITS; + break; + default: + _mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerv(pname=0x%x)", pname); + } +} + + +void GLAPIENTRY +_mesa_GetDoublev( GLenum pname, GLdouble *params ) +{ + const GLfloat magic = -1234.5F; + GLfloat values[16]; + GLuint i; + + if (!params) + return; + + /* Init temp array to magic numbers so we can figure out how many values + * are returned by the GetFloatv() call. + */ + for (i = 0; i < 16; i++) + values[i] = magic; + + _mesa_GetFloatv(pname, values); + + for (i = 0; i < 16 && values[i] != magic; i++) + params[i] = (GLdouble) values[i]; +} + diff --git a/libGL/mesa_gl.h b/libGL/mesa_gl.h new file mode 100755 index 0000000..051b287 --- /dev/null +++ b/libGL/mesa_gl.h @@ -0,0 +1,2251 @@ +/* + * 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_ */ diff --git a/libGL/mesa_glext.h b/libGL/mesa_glext.h new file mode 100755 index 0000000..9309251 --- /dev/null +++ b/libGL/mesa_glext.h @@ -0,0 +1,7280 @@ +#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 + + +#ifdef __cplusplus +} +#endif + +#endif + + +/* ERO */ +GLAPI void GLAPIENTRY fake_gluBuild2DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *data); diff --git a/libGL/mesa_glx.h b/libGL/mesa_glx.h new file mode 100755 index 0000000..2930461 --- /dev/null +++ b/libGL/mesa_glx.h @@ -0,0 +1,510 @@ +/* + * Mesa 3-D graphics library + * Version: 6.5 + * + * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + + +#ifndef GLX_H +#define GLX_H + + +#ifdef __VMS +#include <GL/vms_x_fix.h> +# ifdef __cplusplus +/* VMS Xlib.h gives problems with C++. + * this avoids a bunch of trivial warnings */ +#pragma message disable nosimpint +#endif +#endif +#include <X11/Xlib.h> +#include <X11/Xutil.h> +#ifdef __VMS +# ifdef __cplusplus +#pragma message enable nosimpint +#endif +#endif +#include <mesa_gl.h> + + +#if defined(USE_MGL_NAMESPACE) +#include "glx_mangle.h" +#endif + + +#ifdef __cplusplus +extern "C" { +#endif + + +#define GLX_VERSION_1_1 1 +#define GLX_VERSION_1_2 1 +#define GLX_VERSION_1_3 1 +#define GLX_VERSION_1_4 1 + +#define GLX_EXTENSION_NAME "GLX" + + + +/* + * Tokens for glXChooseVisual and glXGetConfig: + */ +#define GLX_USE_GL 1 +#define GLX_BUFFER_SIZE 2 +#define GLX_LEVEL 3 +#define GLX_RGBA 4 +#define GLX_DOUBLEBUFFER 5 +#define GLX_STEREO 6 +#define GLX_AUX_BUFFERS 7 +#define GLX_RED_SIZE 8 +#define GLX_GREEN_SIZE 9 +#define GLX_BLUE_SIZE 10 +#define GLX_ALPHA_SIZE 11 +#define GLX_DEPTH_SIZE 12 +#define GLX_STENCIL_SIZE 13 +#define GLX_ACCUM_RED_SIZE 14 +#define GLX_ACCUM_GREEN_SIZE 15 +#define GLX_ACCUM_BLUE_SIZE 16 +#define GLX_ACCUM_ALPHA_SIZE 17 + + +/* + * Error codes returned by glXGetConfig: + */ +#define GLX_BAD_SCREEN 1 +#define GLX_BAD_ATTRIBUTE 2 +#define GLX_NO_EXTENSION 3 +#define GLX_BAD_VISUAL 4 +#define GLX_BAD_CONTEXT 5 +#define GLX_BAD_VALUE 6 +#define GLX_BAD_ENUM 7 + + +/* + * GLX 1.1 and later: + */ +#define GLX_VENDOR 1 +#define GLX_VERSION 2 +#define GLX_EXTENSIONS 3 + + +/* + * GLX 1.3 and later: + */ +#define GLX_CONFIG_CAVEAT 0x20 +#define GLX_DONT_CARE 0xFFFFFFFF +#define GLX_X_VISUAL_TYPE 0x22 +#define GLX_TRANSPARENT_TYPE 0x23 +#define GLX_TRANSPARENT_INDEX_VALUE 0x24 +#define GLX_TRANSPARENT_RED_VALUE 0x25 +#define GLX_TRANSPARENT_GREEN_VALUE 0x26 +#define GLX_TRANSPARENT_BLUE_VALUE 0x27 +#define GLX_TRANSPARENT_ALPHA_VALUE 0x28 +#define GLX_WINDOW_BIT 0x00000001 +#define GLX_PIXMAP_BIT 0x00000002 +#define GLX_PBUFFER_BIT 0x00000004 +#define GLX_AUX_BUFFERS_BIT 0x00000010 +#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001 +#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002 +#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004 +#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008 +#define GLX_DEPTH_BUFFER_BIT 0x00000020 +#define GLX_STENCIL_BUFFER_BIT 0x00000040 +#define GLX_ACCUM_BUFFER_BIT 0x00000080 +#define GLX_NONE 0x8000 +#define GLX_SLOW_CONFIG 0x8001 +#define GLX_TRUE_COLOR 0x8002 +#define GLX_DIRECT_COLOR 0x8003 +#define GLX_PSEUDO_COLOR 0x8004 +#define GLX_STATIC_COLOR 0x8005 +#define GLX_GRAY_SCALE 0x8006 +#define GLX_STATIC_GRAY 0x8007 +#define GLX_TRANSPARENT_RGB 0x8008 +#define GLX_TRANSPARENT_INDEX 0x8009 +#define GLX_VISUAL_ID 0x800B +#define GLX_SCREEN 0x800C +#define GLX_NON_CONFORMANT_CONFIG 0x800D +#define GLX_DRAWABLE_TYPE 0x8010 +#define GLX_RENDER_TYPE 0x8011 +#define GLX_X_RENDERABLE 0x8012 +#define GLX_FBCONFIG_ID 0x8013 +#define GLX_RGBA_TYPE 0x8014 +#define GLX_COLOR_INDEX_TYPE 0x8015 +#define GLX_MAX_PBUFFER_WIDTH 0x8016 +#define GLX_MAX_PBUFFER_HEIGHT 0x8017 +#define GLX_MAX_PBUFFER_PIXELS 0x8018 +#define GLX_PRESERVED_CONTENTS 0x801B +#define GLX_LARGEST_PBUFFER 0x801C +#define GLX_WIDTH 0x801D +#define GLX_HEIGHT 0x801E +#define GLX_EVENT_MASK 0x801F +#define GLX_DAMAGED 0x8020 +#define GLX_SAVED 0x8021 +#define GLX_WINDOW 0x8022 +#define GLX_PBUFFER 0x8023 +#define GLX_PBUFFER_HEIGHT 0x8040 +#define GLX_PBUFFER_WIDTH 0x8041 +#define GLX_RGBA_BIT 0x00000001 +#define GLX_COLOR_INDEX_BIT 0x00000002 +#define GLX_PBUFFER_CLOBBER_MASK 0x08000000 + + +/* + * GLX 1.4 and later: + */ +#define GLX_SAMPLE_BUFFERS 0x186a0 /*100000*/ +#define GLX_SAMPLES 0x186a1 /*100001*/ + + + +typedef struct __GLXcontextRec *GLXContext; +typedef XID GLXPixmap; +typedef XID GLXDrawable; +/* GLX 1.3 and later */ +typedef struct __GLXFBConfigRec *GLXFBConfig; +typedef XID GLXFBConfigID; +typedef XID GLXContextID; +typedef XID GLXWindow; +typedef XID GLXPbuffer; + + + +extern XVisualInfo* glXChooseVisual( Display *dpy, int screen, + int *attribList ); + +extern GLXContext glXCreateContext( Display *dpy, XVisualInfo *vis, + GLXContext shareList, Bool direct ); + +extern void glXDestroyContext( Display *dpy, GLXContext ctx ); + +extern Bool glXMakeCurrent( Display *dpy, GLXDrawable drawable, + GLXContext ctx); + +extern void glXCopyContext( Display *dpy, GLXContext src, GLXContext dst, + unsigned long mask ); + +extern void glXSwapBuffers( Display *dpy, GLXDrawable drawable ); + +extern GLXPixmap glXCreateGLXPixmap( Display *dpy, XVisualInfo *visual, + Pixmap pixmap ); + +extern void glXDestroyGLXPixmap( Display *dpy, GLXPixmap pixmap ); + +extern Bool glXQueryExtension( Display *dpy, int *errorb, int *event ); + +extern Bool glXQueryVersion( Display *dpy, int *maj, int *min ); + +extern Bool glXIsDirect( Display *dpy, GLXContext ctx ); + +extern int glXGetConfig( Display *dpy, XVisualInfo *visual, + int attrib, int *value ); + +extern GLXContext glXGetCurrentContext( void ); + +extern GLXDrawable glXGetCurrentDrawable( void ); + +extern void glXWaitGL( void ); + +extern void glXWaitX( void ); + +extern void glXUseXFont( Font font, int first, int count, int list ); + + + +/* GLX 1.1 and later */ +extern const char *glXQueryExtensionsString( Display *dpy, int screen ); + +extern const char *glXQueryServerString( Display *dpy, int screen, int name ); + +extern const char *glXGetClientString( Display *dpy, int name ); + + +/* GLX 1.2 and later */ +extern Display *glXGetCurrentDisplay( void ); + + +/* GLX 1.3 and later */ +extern GLXFBConfig *glXChooseFBConfig( Display *dpy, int screen, + const int *attribList, int *nitems ); + +extern int glXGetFBConfigAttrib( Display *dpy, GLXFBConfig config, + int attribute, int *value ); + +extern GLXFBConfig *glXGetFBConfigs( Display *dpy, int screen, + int *nelements ); + +extern XVisualInfo *glXGetVisualFromFBConfig( Display *dpy, + GLXFBConfig config ); + +extern GLXWindow glXCreateWindow( Display *dpy, GLXFBConfig config, + Window win, const int *attribList ); + +extern void glXDestroyWindow( Display *dpy, GLXWindow window ); + +extern GLXPixmap glXCreatePixmap( Display *dpy, GLXFBConfig config, + Pixmap pixmap, const int *attribList ); + +extern void glXDestroyPixmap( Display *dpy, GLXPixmap pixmap ); + +extern GLXPbuffer glXCreatePbuffer( Display *dpy, GLXFBConfig config, + const int *attribList ); + +extern void glXDestroyPbuffer( Display *dpy, GLXPbuffer pbuf ); + +extern void glXQueryDrawable( Display *dpy, GLXDrawable draw, int attribute, + unsigned int *value ); + +extern GLXContext glXCreateNewContext( Display *dpy, GLXFBConfig config, + int renderType, GLXContext shareList, + Bool direct ); + +extern Bool glXMakeContextCurrent( Display *dpy, GLXDrawable draw, + GLXDrawable read, GLXContext ctx ); + +extern GLXDrawable glXGetCurrentReadDrawable( void ); + +extern int glXQueryContext( Display *dpy, GLXContext ctx, int attribute, + int *value ); + +extern void glXSelectEvent( Display *dpy, GLXDrawable drawable, + unsigned long mask ); + +extern void glXGetSelectedEvent( Display *dpy, GLXDrawable drawable, + unsigned long *mask ); + + +/* GLX 1.4 and later */ +extern void (*glXGetProcAddress(const GLubyte *procname))( void ); + + +#ifndef GLX_GLXEXT_LEGACY + +#include <mesa_glxext.h> + +#else + + + +/* + * ARB 2. GLX_ARB_get_proc_address + */ +#ifndef GLX_ARB_get_proc_address +#define GLX_ARB_get_proc_address 1 + +typedef void (*__GLXextFuncPtr)(void); +extern __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *); + +#endif /* GLX_ARB_get_proc_address */ + + + +#endif /* GLX_GLXEXT_LEGACY */ + + +/** + ** The following aren't in glxext.h yet. + **/ + + +/* + * ???. GLX_NV_vertex_array_range + */ +#ifndef GLX_NV_vertex_array_range +#define GLX_NV_vertex_array_range + +extern void *glXAllocateMemoryNV(GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority); +extern void glXFreeMemoryNV(GLvoid *pointer); +typedef void * ( * PFNGLXALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority); +typedef void ( * PFNGLXFREEMEMORYNVPROC) (GLvoid *pointer); + +#endif /* GLX_NV_vertex_array_range */ + + +/* + * ???. GLX_MESA_allocate_memory + */ +#ifndef GLX_MESA_allocate_memory +#define GLX_MESA_allocate_memory 1 + +extern void *glXAllocateMemoryMESA(Display *dpy, int scrn, size_t size, float readfreq, float writefreq, float priority); +extern void glXFreeMemoryMESA(Display *dpy, int scrn, void *pointer); +extern GLuint glXGetMemoryOffsetMESA(Display *dpy, int scrn, const void *pointer); +typedef void * ( * PFNGLXALLOCATEMEMORYMESAPROC) (Display *dpy, int scrn, size_t size, float readfreq, float writefreq, float priority); +typedef void ( * PFNGLXFREEMEMORYMESAPROC) (Display *dpy, int scrn, void *pointer); +typedef GLuint (* PFNGLXGETMEMORYOFFSETMESAPROC) (Display *dpy, int scrn, const void *pointer); + +#endif /* GLX_MESA_allocate_memory */ + + +/* + * ARB ?. GLX_ARB_render_texture + * XXX This was never finalized! + */ +#ifndef GLX_ARB_render_texture +#define GLX_ARB_render_texture 1 + +extern Bool glXBindTexImageARB(Display *dpy, GLXPbuffer pbuffer, int buffer); +extern Bool glXReleaseTexImageARB(Display *dpy, GLXPbuffer pbuffer, int buffer); +extern Bool glXDrawableAttribARB(Display *dpy, GLXDrawable draw, const int *attribList); + +#endif /* GLX_ARB_render_texture */ + + +#ifndef GLX_ATI_render_texture +#define GLX_ATI_render_texture 1 + +extern void glXBindTexImageATI(Display *dpy, GLXPbuffer pbuffer, int buffer); +extern void glXReleaseTexImageATI(Display *dpy, GLXPbuffer pbuffer, int buffer); +extern void glXDrawableAttribATI(Display *dpy, GLXDrawable draw, const int *attribList); + +#endif /* GLX_ATI_render_texture */ + + +/* + * Remove this when glxext.h is updated. + */ +#ifndef GLX_NV_float_buffer +#define GLX_NV_float_buffer 1 + +#define GLX_FLOAT_COMPONENTS_NV 0x20B0 + +#endif /* GLX_NV_float_buffer */ + + + +/* + * #?. GLX_MESA_swap_frame_usage + */ +#ifndef GLX_MESA_swap_frame_usage +#define GLX_MESA_swap_frame_usage 1 + +extern int glXGetFrameUsageMESA(Display *dpy, GLXDrawable drawable, float *usage); +extern int glXBeginFrameTrackingMESA(Display *dpy, GLXDrawable drawable); +extern int glXEndFrameTrackingMESA(Display *dpy, GLXDrawable drawable); +extern int glXQueryFrameTrackingMESA(Display *dpy, GLXDrawable drawable, int64_t *swapCount, int64_t *missedFrames, float *lastMissedUsage); + +typedef int (*PFNGLXGETFRAMEUSAGEMESAPROC) (Display *dpy, GLXDrawable drawable, float *usage); +typedef int (*PFNGLXBEGINFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable); +typedef int (*PFNGLXENDFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable); +typedef int (*PFNGLXQUERYFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable, int64_t *swapCount, int64_t *missedFrames, float *lastMissedUsage); + +#endif /* GLX_MESA_swap_frame_usage */ + + + +/* + * #?. GLX_MESA_swap_control + */ +#ifndef GLX_MESA_swap_control +#define GLX_MESA_swap_control 1 + +extern int glXSwapIntervalMESA(unsigned int interval); +extern int glXGetSwapIntervalMESA(void); + +typedef int (*PFNGLXSWAPINTERVALMESAPROC)(unsigned int interval); +typedef int (*PFNGLXGETSWAPINTERVALMESAPROC)(void); + +#endif /* GLX_MESA_swap_control */ + + + +/* + * #?. GLX_EXT_texture_from_pixmap + * XXX not finished? + */ +#ifndef GLX_EXT_texture_from_pixmap +#define GLX_EXT_texture_from_pixmap 1 + +#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0 +#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1 +#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2 +#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3 +#define GLX_Y_INVERTED_EXT 0x20D4 + +#define GLX_TEXTURE_FORMAT_EXT 0x20D5 +#define GLX_TEXTURE_TARGET_EXT 0x20D6 +#define GLX_MIPMAP_TEXTURE_EXT 0x20D7 + +#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8 +#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9 +#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA + +#define GLX_TEXTURE_1D_BIT_EXT 0x00000001 +#define GLX_TEXTURE_2D_BIT_EXT 0x00000002 +#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004 + +#define GLX_TEXTURE_1D_EXT 0x20DB +#define GLX_TEXTURE_2D_EXT 0x20DC +#define GLX_TEXTURE_RECTANGLE_EXT 0x20DD + +#define GLX_FRONT_LEFT_EXT 0x20DE +#define GLX_FRONT_RIGHT_EXT 0x20DF +#define GLX_BACK_LEFT_EXT 0x20E0 +#define GLX_BACK_RIGHT_EXT 0x20E1 +#define GLX_FRONT_EXT GLX_FRONT_LEFT_EXT +#define GLX_BACK_EXT GLX_BACK_LEFT_EXT +#define GLX_AUX0_EXT 0x20E2 +#define GLX_AUX1_EXT 0x20E3 +#define GLX_AUX2_EXT 0x20E4 +#define GLX_AUX3_EXT 0x20E5 +#define GLX_AUX4_EXT 0x20E6 +#define GLX_AUX5_EXT 0x20E7 +#define GLX_AUX6_EXT 0x20E8 +#define GLX_AUX7_EXT 0x20E9 +#define GLX_AUX8_EXT 0x20EA +#define GLX_AUX9_EXT 0x20EB + +extern void glXBindTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list); +extern void glXReleaseTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer); + +#endif /* GLX_EXT_texture_from_pixmap */ + + + + +/*** Should these go here, or in another header? */ +/* +** GLX Events +*/ +typedef struct { + int event_type; /* GLX_DAMAGED or GLX_SAVED */ + int draw_type; /* GLX_WINDOW or GLX_PBUFFER */ + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came for SendEvent request */ + Display *display; /* display the event was read from */ + GLXDrawable drawable; /* XID of Drawable */ + unsigned int buffer_mask; /* mask indicating which buffers are affected */ + unsigned int aux_buffer; /* which aux buffer was affected */ + int x, y; + int width, height; + int count; /* if nonzero, at least this many more */ +} GLXPbufferClobberEvent; + +typedef union __GLXEvent { + GLXPbufferClobberEvent glxpbufferclobber; + long pad[24]; +} GLXEvent; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/libGL/mesa_glxext.h b/libGL/mesa_glxext.h new file mode 100755 index 0000000..79e2e90 --- /dev/null +++ b/libGL/mesa_glxext.h @@ -0,0 +1,785 @@ +#ifndef __glxext_h_ +#define __glxext_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 */ +/* glxext.h last updated 2007/04/21 */ +/* Current version at http://www.opengl.org/registry/ */ +#define GLX_GLXEXT_VERSION 19 + +#ifndef GLX_VERSION_1_3 +#define GLX_WINDOW_BIT 0x00000001 +#define GLX_PIXMAP_BIT 0x00000002 +#define GLX_PBUFFER_BIT 0x00000004 +#define GLX_RGBA_BIT 0x00000001 +#define GLX_COLOR_INDEX_BIT 0x00000002 +#define GLX_PBUFFER_CLOBBER_MASK 0x08000000 +#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001 +#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002 +#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004 +#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008 +#define GLX_AUX_BUFFERS_BIT 0x00000010 +#define GLX_DEPTH_BUFFER_BIT 0x00000020 +#define GLX_STENCIL_BUFFER_BIT 0x00000040 +#define GLX_ACCUM_BUFFER_BIT 0x00000080 +#define GLX_CONFIG_CAVEAT 0x20 +#define GLX_X_VISUAL_TYPE 0x22 +#define GLX_TRANSPARENT_TYPE 0x23 +#define GLX_TRANSPARENT_INDEX_VALUE 0x24 +#define GLX_TRANSPARENT_RED_VALUE 0x25 +#define GLX_TRANSPARENT_GREEN_VALUE 0x26 +#define GLX_TRANSPARENT_BLUE_VALUE 0x27 +#define GLX_TRANSPARENT_ALPHA_VALUE 0x28 +#define GLX_DONT_CARE 0xFFFFFFFF +#define GLX_NONE 0x8000 +#define GLX_SLOW_CONFIG 0x8001 +#define GLX_TRUE_COLOR 0x8002 +#define GLX_DIRECT_COLOR 0x8003 +#define GLX_PSEUDO_COLOR 0x8004 +#define GLX_STATIC_COLOR 0x8005 +#define GLX_GRAY_SCALE 0x8006 +#define GLX_STATIC_GRAY 0x8007 +#define GLX_TRANSPARENT_RGB 0x8008 +#define GLX_TRANSPARENT_INDEX 0x8009 +#define GLX_VISUAL_ID 0x800B +#define GLX_SCREEN 0x800C +#define GLX_NON_CONFORMANT_CONFIG 0x800D +#define GLX_DRAWABLE_TYPE 0x8010 +#define GLX_RENDER_TYPE 0x8011 +#define GLX_X_RENDERABLE 0x8012 +#define GLX_FBCONFIG_ID 0x8013 +#define GLX_RGBA_TYPE 0x8014 +#define GLX_COLOR_INDEX_TYPE 0x8015 +#define GLX_MAX_PBUFFER_WIDTH 0x8016 +#define GLX_MAX_PBUFFER_HEIGHT 0x8017 +#define GLX_MAX_PBUFFER_PIXELS 0x8018 +#define GLX_PRESERVED_CONTENTS 0x801B +#define GLX_LARGEST_PBUFFER 0x801C +#define GLX_WIDTH 0x801D +#define GLX_HEIGHT 0x801E +#define GLX_EVENT_MASK 0x801F +#define GLX_DAMAGED 0x8020 +#define GLX_SAVED 0x8021 +#define GLX_WINDOW 0x8022 +#define GLX_PBUFFER 0x8023 +#define GLX_PBUFFER_HEIGHT 0x8040 +#define GLX_PBUFFER_WIDTH 0x8041 +#endif + +#ifndef GLX_VERSION_1_4 +#define GLX_SAMPLE_BUFFERS 100000 +#define GLX_SAMPLES 100001 +#endif + +#ifndef GLX_ARB_get_proc_address +#endif + +#ifndef GLX_ARB_multisample +#define GLX_SAMPLE_BUFFERS_ARB 100000 +#define GLX_SAMPLES_ARB 100001 +#endif + +#ifndef GLX_ARB_fbconfig_float +#define GLX_RGBA_FLOAT_TYPE_ARB 0x20B9 +#define GLX_RGBA_FLOAT_BIT_ARB 0x00000004 +#endif + +#ifndef GLX_SGIS_multisample +#define GLX_SAMPLE_BUFFERS_SGIS 100000 +#define GLX_SAMPLES_SGIS 100001 +#endif + +#ifndef GLX_EXT_visual_info +#define GLX_X_VISUAL_TYPE_EXT 0x22 +#define GLX_TRANSPARENT_TYPE_EXT 0x23 +#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24 +#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25 +#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26 +#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27 +#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28 +#define GLX_NONE_EXT 0x8000 +#define GLX_TRUE_COLOR_EXT 0x8002 +#define GLX_DIRECT_COLOR_EXT 0x8003 +#define GLX_PSEUDO_COLOR_EXT 0x8004 +#define GLX_STATIC_COLOR_EXT 0x8005 +#define GLX_GRAY_SCALE_EXT 0x8006 +#define GLX_STATIC_GRAY_EXT 0x8007 +#define GLX_TRANSPARENT_RGB_EXT 0x8008 +#define GLX_TRANSPARENT_INDEX_EXT 0x8009 +#endif + +#ifndef GLX_SGI_swap_control +#endif + +#ifndef GLX_SGI_video_sync +#endif + +#ifndef GLX_SGI_make_current_read +#endif + +#ifndef GLX_SGIX_video_source +#endif + +#ifndef GLX_EXT_visual_rating +#define GLX_VISUAL_CAVEAT_EXT 0x20 +#define GLX_SLOW_VISUAL_EXT 0x8001 +#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D +/* reuse GLX_NONE_EXT */ +#endif + +#ifndef GLX_EXT_import_context +#define GLX_SHARE_CONTEXT_EXT 0x800A +#define GLX_VISUAL_ID_EXT 0x800B +#define GLX_SCREEN_EXT 0x800C +#endif + +#ifndef GLX_SGIX_fbconfig +#define GLX_WINDOW_BIT_SGIX 0x00000001 +#define GLX_PIXMAP_BIT_SGIX 0x00000002 +#define GLX_RGBA_BIT_SGIX 0x00000001 +#define GLX_COLOR_INDEX_BIT_SGIX 0x00000002 +#define GLX_DRAWABLE_TYPE_SGIX 0x8010 +#define GLX_RENDER_TYPE_SGIX 0x8011 +#define GLX_X_RENDERABLE_SGIX 0x8012 +#define GLX_FBCONFIG_ID_SGIX 0x8013 +#define GLX_RGBA_TYPE_SGIX 0x8014 +#define GLX_COLOR_INDEX_TYPE_SGIX 0x8015 +/* reuse GLX_SCREEN_EXT */ +#endif + +#ifndef GLX_SGIX_pbuffer +#define GLX_PBUFFER_BIT_SGIX 0x00000004 +#define GLX_BUFFER_CLOBBER_MASK_SGIX 0x08000000 +#define GLX_FRONT_LEFT_BUFFER_BIT_SGIX 0x00000001 +#define GLX_FRONT_RIGHT_BUFFER_BIT_SGIX 0x00000002 +#define GLX_BACK_LEFT_BUFFER_BIT_SGIX 0x00000004 +#define GLX_BACK_RIGHT_BUFFER_BIT_SGIX 0x00000008 +#define GLX_AUX_BUFFERS_BIT_SGIX 0x00000010 +#define GLX_DEPTH_BUFFER_BIT_SGIX 0x00000020 +#define GLX_STENCIL_BUFFER_BIT_SGIX 0x00000040 +#define GLX_ACCUM_BUFFER_BIT_SGIX 0x00000080 +#define GLX_SAMPLE_BUFFERS_BIT_SGIX 0x00000100 +#define GLX_MAX_PBUFFER_WIDTH_SGIX 0x8016 +#define GLX_MAX_PBUFFER_HEIGHT_SGIX 0x8017 +#define GLX_MAX_PBUFFER_PIXELS_SGIX 0x8018 +#define GLX_OPTIMAL_PBUFFER_WIDTH_SGIX 0x8019 +#define GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX 0x801A +#define GLX_PRESERVED_CONTENTS_SGIX 0x801B +#define GLX_LARGEST_PBUFFER_SGIX 0x801C +#define GLX_WIDTH_SGIX 0x801D +#define GLX_HEIGHT_SGIX 0x801E +#define GLX_EVENT_MASK_SGIX 0x801F +#define GLX_DAMAGED_SGIX 0x8020 +#define GLX_SAVED_SGIX 0x8021 +#define GLX_WINDOW_SGIX 0x8022 +#define GLX_PBUFFER_SGIX 0x8023 +#endif + +#ifndef GLX_SGI_cushion +#endif + +#ifndef GLX_SGIX_video_resize +#define GLX_SYNC_FRAME_SGIX 0x00000000 +#define GLX_SYNC_SWAP_SGIX 0x00000001 +#endif + +#ifndef GLX_SGIX_dmbuffer +#define GLX_DIGITAL_MEDIA_PBUFFER_SGIX 0x8024 +#endif + +#ifndef GLX_SGIX_swap_group +#endif + +#ifndef GLX_SGIX_swap_barrier +#endif + +#ifndef GLX_SGIS_blended_overlay +#define GLX_BLENDED_RGBA_SGIS 0x8025 +#endif + +#ifndef GLX_SGIS_shared_multisample +#define GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026 +#define GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027 +#endif + +#ifndef GLX_SUN_get_transparent_index +#endif + +#ifndef GLX_3DFX_multisample +#define GLX_SAMPLE_BUFFERS_3DFX 0x8050 +#define GLX_SAMPLES_3DFX 0x8051 +#endif + +#ifndef GLX_MESA_copy_sub_buffer +#endif + +#ifndef GLX_MESA_pixmap_colormap +#endif + +#ifndef GLX_MESA_release_buffers +#endif + +#ifndef GLX_MESA_set_3dfx_mode +#define GLX_3DFX_WINDOW_MODE_MESA 0x1 +#define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2 +#endif + +#ifndef GLX_SGIX_visual_select_group +#define GLX_VISUAL_SELECT_GROUP_SGIX 0x8028 +#endif + +#ifndef GLX_OML_swap_method +#define GLX_SWAP_METHOD_OML 0x8060 +#define GLX_SWAP_EXCHANGE_OML 0x8061 +#define GLX_SWAP_COPY_OML 0x8062 +#define GLX_SWAP_UNDEFINED_OML 0x8063 +#endif + +#ifndef GLX_OML_sync_control +#endif + +#ifndef GLX_NV_float_buffer +#define GLX_FLOAT_COMPONENTS_NV 0x20B0 +#endif + +#ifndef GLX_SGIX_hyperpipe +#define GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80 +#define GLX_BAD_HYPERPIPE_CONFIG_SGIX 91 +#define GLX_BAD_HYPERPIPE_SGIX 92 +#define GLX_HYPERPIPE_DISPLAY_PIPE_SGIX 0x00000001 +#define GLX_HYPERPIPE_RENDER_PIPE_SGIX 0x00000002 +#define GLX_PIPE_RECT_SGIX 0x00000001 +#define GLX_PIPE_RECT_LIMITS_SGIX 0x00000002 +#define GLX_HYPERPIPE_STEREO_SGIX 0x00000003 +#define GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX 0x00000004 +#define GLX_HYPERPIPE_ID_SGIX 0x8030 +#endif + +#ifndef GLX_MESA_agp_offset +#endif + +#ifndef GLX_EXT_fbconfig_packed_float +#define GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1 +#define GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008 +#endif + +#ifndef GLX_EXT_framebuffer_sRGB +#define GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20B2 +#endif + +#ifndef GLX_EXT_texture_from_pixmap +#define GLX_TEXTURE_1D_BIT_EXT 0x00000001 +#define GLX_TEXTURE_2D_BIT_EXT 0x00000002 +#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004 +#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0 +#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1 +#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2 +#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3 +#define GLX_Y_INVERTED_EXT 0x20D4 +#define GLX_TEXTURE_FORMAT_EXT 0x20D5 +#define GLX_TEXTURE_TARGET_EXT 0x20D6 +#define GLX_MIPMAP_TEXTURE_EXT 0x20D7 +#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8 +#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9 +#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA +#define GLX_TEXTURE_1D_EXT 0x20DB +#define GLX_TEXTURE_2D_EXT 0x20DC +#define GLX_TEXTURE_RECTANGLE_EXT 0x20DD +#define GLX_FRONT_LEFT_EXT 0x20DE +#define GLX_FRONT_RIGHT_EXT 0x20DF +#define GLX_BACK_LEFT_EXT 0x20E0 +#define GLX_BACK_RIGHT_EXT 0x20E1 +#define GLX_FRONT_EXT GLX_FRONT_LEFT_EXT +#define GLX_BACK_EXT GLX_BACK_LEFT_EXT +#define GLX_AUX0_EXT 0x20E2 +#define GLX_AUX1_EXT 0x20E3 +#define GLX_AUX2_EXT 0x20E4 +#define GLX_AUX3_EXT 0x20E5 +#define GLX_AUX4_EXT 0x20E6 +#define GLX_AUX5_EXT 0x20E7 +#define GLX_AUX6_EXT 0x20E8 +#define GLX_AUX7_EXT 0x20E9 +#define GLX_AUX8_EXT 0x20EA +#define GLX_AUX9_EXT 0x20EB +#endif + + +/*************************************************************/ + +#ifndef GLX_ARB_get_proc_address +typedef void (*__GLXextFuncPtr)(void); +#endif + +#ifndef GLX_SGIX_video_source +typedef XID GLXVideoSourceSGIX; +#endif + +#ifndef GLX_SGIX_fbconfig +typedef XID GLXFBConfigIDSGIX; +typedef struct __GLXFBConfigRec *GLXFBConfigSGIX; +#endif + +#ifndef GLX_SGIX_pbuffer +typedef XID GLXPbufferSGIX; +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came for SendEvent request */ + Display *display; /* display the event was read from */ + GLXDrawable drawable; /* i.d. of Drawable */ + int event_type; /* GLX_DAMAGED_SGIX or GLX_SAVED_SGIX */ + int draw_type; /* GLX_WINDOW_SGIX or GLX_PBUFFER_SGIX */ + unsigned int mask; /* mask indicating which buffers are affected*/ + int x, y; + int width, height; + int count; /* if nonzero, at least this many more */ +} GLXBufferClobberEventSGIX; +#endif + +#ifndef GLEXT_64_TYPES_DEFINED +/* This code block is duplicated in glxext.h, so must be protected */ +#define GLEXT_64_TYPES_DEFINED +/* Define int32_t, int64_t, and uint64_t types for UST/MSC */ +/* (as used in the GLX_OML_sync_control extension). */ +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +#include <inttypes.h> +#elif defined(__sun__) || defined(__digital__) +#include <inttypes.h> +#if defined(__STDC__) +#if defined(__arch64__) +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 GLX_VERSION_1_3 +#define GLX_VERSION_1_3 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern GLXFBConfig * glXGetFBConfigs (Display *, int, int *); +extern GLXFBConfig * glXChooseFBConfig (Display *, int, const int *, int *); +extern int glXGetFBConfigAttrib (Display *, GLXFBConfig, int, int *); +extern XVisualInfo * glXGetVisualFromFBConfig (Display *, GLXFBConfig); +extern GLXWindow glXCreateWindow (Display *, GLXFBConfig, Window, const int *); +extern void glXDestroyWindow (Display *, GLXWindow); +extern GLXPixmap glXCreatePixmap (Display *, GLXFBConfig, Pixmap, const int *); +extern void glXDestroyPixmap (Display *, GLXPixmap); +extern GLXPbuffer glXCreatePbuffer (Display *, GLXFBConfig, const int *); +extern void glXDestroyPbuffer (Display *, GLXPbuffer); +extern void glXQueryDrawable (Display *, GLXDrawable, int, unsigned int *); +extern GLXContext glXCreateNewContext (Display *, GLXFBConfig, int, GLXContext, Bool); +extern Bool glXMakeContextCurrent (Display *, GLXDrawable, GLXDrawable, GLXContext); +extern GLXDrawable glXGetCurrentReadDrawable (void); +extern Display * glXGetCurrentDisplay (void); +extern int glXQueryContext (Display *, GLXContext, int, int *); +extern void glXSelectEvent (Display *, GLXDrawable, unsigned long); +extern void glXGetSelectedEvent (Display *, GLXDrawable, unsigned long *); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef GLXFBConfig * ( * PFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements); +typedef GLXFBConfig * ( * PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements); +typedef int ( * PFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value); +typedef XVisualInfo * ( * PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config); +typedef GLXWindow ( * PFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list); +typedef void ( * PFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win); +typedef GLXPixmap ( * PFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list); +typedef void ( * PFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap); +typedef GLXPbuffer ( * PFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list); +typedef void ( * PFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf); +typedef void ( * PFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value); +typedef GLXContext ( * PFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct); +typedef Bool ( * PFNGLXMAKECONTEXTCURRENTPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx); +typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLEPROC) (void); +typedef Display * ( * PFNGLXGETCURRENTDISPLAYPROC) (void); +typedef int ( * PFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value); +typedef void ( * PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask); +typedef void ( * PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask); +#endif + +#ifndef GLX_VERSION_1_4 +#define GLX_VERSION_1_4 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern __GLXextFuncPtr glXGetProcAddress (const GLubyte *); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSPROC) (const GLubyte *procName); +#endif + +#ifndef GLX_ARB_get_proc_address +#define GLX_ARB_get_proc_address 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSARBPROC) (const GLubyte *procName); +#endif + +#ifndef GLX_ARB_multisample +#define GLX_ARB_multisample 1 +#endif + +#ifndef GLX_ARB_fbconfig_float +#define GLX_ARB_fbconfig_float 1 +#endif + +#ifndef GLX_SGIS_multisample +#define GLX_SGIS_multisample 1 +#endif + +#ifndef GLX_EXT_visual_info +#define GLX_EXT_visual_info 1 +#endif + +#ifndef GLX_SGI_swap_control +#define GLX_SGI_swap_control 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern int glXSwapIntervalSGI (int); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef int ( * PFNGLXSWAPINTERVALSGIPROC) (int interval); +#endif + +#ifndef GLX_SGI_video_sync +#define GLX_SGI_video_sync 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern int glXGetVideoSyncSGI (unsigned int *); +extern int glXWaitVideoSyncSGI (int, int, unsigned int *); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef int ( * PFNGLXGETVIDEOSYNCSGIPROC) (unsigned int *count); +typedef int ( * PFNGLXWAITVIDEOSYNCSGIPROC) (int divisor, int remainder, unsigned int *count); +#endif + +#ifndef GLX_SGI_make_current_read +#define GLX_SGI_make_current_read 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern Bool glXMakeCurrentReadSGI (Display *, GLXDrawable, GLXDrawable, GLXContext); +extern GLXDrawable glXGetCurrentReadDrawableSGI (void); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef Bool ( * PFNGLXMAKECURRENTREADSGIPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx); +typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLESGIPROC) (void); +#endif + +#ifndef GLX_SGIX_video_source +#define GLX_SGIX_video_source 1 +#ifdef _VL_H +#ifdef GLX_GLXEXT_PROTOTYPES +extern GLXVideoSourceSGIX glXCreateGLXVideoSourceSGIX (Display *, int, VLServer, VLPath, int, VLNode); +extern void glXDestroyGLXVideoSourceSGIX (Display *, GLXVideoSourceSGIX); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef GLXVideoSourceSGIX ( * PFNGLXCREATEGLXVIDEOSOURCESGIXPROC) (Display *display, int screen, VLServer server, VLPath path, int nodeClass, VLNode drainNode); +typedef void ( * PFNGLXDESTROYGLXVIDEOSOURCESGIXPROC) (Display *dpy, GLXVideoSourceSGIX glxvideosource); +#endif /* _VL_H */ +#endif + +#ifndef GLX_EXT_visual_rating +#define GLX_EXT_visual_rating 1 +#endif + +#ifndef GLX_EXT_import_context +#define GLX_EXT_import_context 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern Display * glXGetCurrentDisplayEXT (void); +extern int glXQueryContextInfoEXT (Display *, GLXContext, int, int *); +extern GLXContextID glXGetContextIDEXT (const GLXContext); +extern GLXContext glXImportContextEXT (Display *, GLXContextID); +extern void glXFreeContextEXT (Display *, GLXContext); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef Display * ( * PFNGLXGETCURRENTDISPLAYEXTPROC) (void); +typedef int ( * PFNGLXQUERYCONTEXTINFOEXTPROC) (Display *dpy, GLXContext context, int attribute, int *value); +typedef GLXContextID ( * PFNGLXGETCONTEXTIDEXTPROC) (const GLXContext context); +typedef GLXContext ( * PFNGLXIMPORTCONTEXTEXTPROC) (Display *dpy, GLXContextID contextID); +typedef void ( * PFNGLXFREECONTEXTEXTPROC) (Display *dpy, GLXContext context); +#endif + +#ifndef GLX_SGIX_fbconfig +#define GLX_SGIX_fbconfig 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern int glXGetFBConfigAttribSGIX (Display *, GLXFBConfigSGIX, int, int *); +extern GLXFBConfigSGIX * glXChooseFBConfigSGIX (Display *, int, int *, int *); +extern GLXPixmap glXCreateGLXPixmapWithConfigSGIX (Display *, GLXFBConfigSGIX, Pixmap); +extern GLXContext glXCreateContextWithConfigSGIX (Display *, GLXFBConfigSGIX, int, GLXContext, Bool); +extern XVisualInfo * glXGetVisualFromFBConfigSGIX (Display *, GLXFBConfigSGIX); +extern GLXFBConfigSGIX glXGetFBConfigFromVisualSGIX (Display *, XVisualInfo *); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef int ( * PFNGLXGETFBCONFIGATTRIBSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, int attribute, int *value); +typedef GLXFBConfigSGIX * ( * PFNGLXCHOOSEFBCONFIGSGIXPROC) (Display *dpy, int screen, int *attrib_list, int *nelements); +typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, Pixmap pixmap); +typedef GLXContext ( * PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct); +typedef XVisualInfo * ( * PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config); +typedef GLXFBConfigSGIX ( * PFNGLXGETFBCONFIGFROMVISUALSGIXPROC) (Display *dpy, XVisualInfo *vis); +#endif + +#ifndef GLX_SGIX_pbuffer +#define GLX_SGIX_pbuffer 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern GLXPbufferSGIX glXCreateGLXPbufferSGIX (Display *, GLXFBConfigSGIX, unsigned int, unsigned int, int *); +extern void glXDestroyGLXPbufferSGIX (Display *, GLXPbufferSGIX); +extern int glXQueryGLXPbufferSGIX (Display *, GLXPbufferSGIX, int, unsigned int *); +extern void glXSelectEventSGIX (Display *, GLXDrawable, unsigned long); +extern void glXGetSelectedEventSGIX (Display *, GLXDrawable, unsigned long *); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef GLXPbufferSGIX ( * PFNGLXCREATEGLXPBUFFERSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list); +typedef void ( * PFNGLXDESTROYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf); +typedef int ( * PFNGLXQUERYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value); +typedef void ( * PFNGLXSELECTEVENTSGIXPROC) (Display *dpy, GLXDrawable drawable, unsigned long mask); +typedef void ( * PFNGLXGETSELECTEDEVENTSGIXPROC) (Display *dpy, GLXDrawable drawable, unsigned long *mask); +#endif + +#ifndef GLX_SGI_cushion +#define GLX_SGI_cushion 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern void glXCushionSGI (Display *, Window, float); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef void ( * PFNGLXCUSHIONSGIPROC) (Display *dpy, Window window, float cushion); +#endif + +#ifndef GLX_SGIX_video_resize +#define GLX_SGIX_video_resize 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern int glXBindChannelToWindowSGIX (Display *, int, int, Window); +extern int glXChannelRectSGIX (Display *, int, int, int, int, int, int); +extern int glXQueryChannelRectSGIX (Display *, int, int, int *, int *, int *, int *); +extern int glXQueryChannelDeltasSGIX (Display *, int, int, int *, int *, int *, int *); +extern int glXChannelRectSyncSGIX (Display *, int, int, GLenum); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef int ( * PFNGLXBINDCHANNELTOWINDOWSGIXPROC) (Display *display, int screen, int channel, Window window); +typedef int ( * PFNGLXCHANNELRECTSGIXPROC) (Display *display, int screen, int channel, int x, int y, int w, int h); +typedef int ( * PFNGLXQUERYCHANNELRECTSGIXPROC) (Display *display, int screen, int channel, int *dx, int *dy, int *dw, int *dh); +typedef int ( * PFNGLXQUERYCHANNELDELTASSGIXPROC) (Display *display, int screen, int channel, int *x, int *y, int *w, int *h); +typedef int ( * PFNGLXCHANNELRECTSYNCSGIXPROC) (Display *display, int screen, int channel, GLenum synctype); +#endif + +#ifndef GLX_SGIX_dmbuffer +#define GLX_SGIX_dmbuffer 1 +#ifdef _DM_BUFFER_H_ +#ifdef GLX_GLXEXT_PROTOTYPES +extern Bool glXAssociateDMPbufferSGIX (Display *, GLXPbufferSGIX, DMparams *, DMbuffer); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef Bool ( * PFNGLXASSOCIATEDMPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuffer, DMparams *params, DMbuffer dmbuffer); +#endif /* _DM_BUFFER_H_ */ +#endif + +#ifndef GLX_SGIX_swap_group +#define GLX_SGIX_swap_group 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern void glXJoinSwapGroupSGIX (Display *, GLXDrawable, GLXDrawable); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef void ( * PFNGLXJOINSWAPGROUPSGIXPROC) (Display *dpy, GLXDrawable drawable, GLXDrawable member); +#endif + +#ifndef GLX_SGIX_swap_barrier +#define GLX_SGIX_swap_barrier 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern void glXBindSwapBarrierSGIX (Display *, GLXDrawable, int); +extern Bool glXQueryMaxSwapBarriersSGIX (Display *, int, int *); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef void ( * PFNGLXBINDSWAPBARRIERSGIXPROC) (Display *dpy, GLXDrawable drawable, int barrier); +typedef Bool ( * PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC) (Display *dpy, int screen, int *max); +#endif + +#ifndef GLX_SUN_get_transparent_index +#define GLX_SUN_get_transparent_index 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern Status glXGetTransparentIndexSUN (Display *, Window, Window, long *); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef Status ( * PFNGLXGETTRANSPARENTINDEXSUNPROC) (Display *dpy, Window overlay, Window underlay, long *pTransparentIndex); +#endif + +#ifndef GLX_MESA_copy_sub_buffer +#define GLX_MESA_copy_sub_buffer 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern void glXCopySubBufferMESA (Display *, GLXDrawable, int, int, int, int); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef void ( * PFNGLXCOPYSUBBUFFERMESAPROC) (Display *dpy, GLXDrawable drawable, int x, int y, int width, int height); +#endif + +#ifndef GLX_MESA_pixmap_colormap +#define GLX_MESA_pixmap_colormap 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern GLXPixmap glXCreateGLXPixmapMESA (Display *, XVisualInfo *, Pixmap, Colormap); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPMESAPROC) (Display *dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap); +#endif + +#ifndef GLX_MESA_release_buffers +#define GLX_MESA_release_buffers 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern Bool glXReleaseBuffersMESA (Display *, GLXDrawable); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef Bool ( * PFNGLXRELEASEBUFFERSMESAPROC) (Display *dpy, GLXDrawable drawable); +#endif + +#ifndef GLX_MESA_set_3dfx_mode +#define GLX_MESA_set_3dfx_mode 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern Bool glXSet3DfxModeMESA (int); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef Bool ( * PFNGLXSET3DFXMODEMESAPROC) (int mode); +#endif + +#ifndef GLX_SGIX_visual_select_group +#define GLX_SGIX_visual_select_group 1 +#endif + +#ifndef GLX_OML_swap_method +#define GLX_OML_swap_method 1 +#endif + +#ifndef GLX_OML_sync_control +#define GLX_OML_sync_control 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern Bool glXGetSyncValuesOML (Display *, GLXDrawable, int64_t *, int64_t *, int64_t *); +extern Bool glXGetMscRateOML (Display *, GLXDrawable, int32_t *, int32_t *); +extern int64_t glXSwapBuffersMscOML (Display *, GLXDrawable, int64_t, int64_t, int64_t); +extern Bool glXWaitForMscOML (Display *, GLXDrawable, int64_t, int64_t, int64_t, int64_t *, int64_t *, int64_t *); +extern Bool glXWaitForSbcOML (Display *, GLXDrawable, int64_t, int64_t *, int64_t *, int64_t *); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef Bool ( * PFNGLXGETSYNCVALUESOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t *ust, int64_t *msc, int64_t *sbc); +typedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (Display *dpy, GLXDrawable drawable, int32_t *numerator, int32_t *denominator); +typedef int64_t ( * PFNGLXSWAPBUFFERSMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder); +typedef Bool ( * PFNGLXWAITFORMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t *ust, int64_t *msc, int64_t *sbc); +typedef Bool ( * PFNGLXWAITFORSBCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_sbc, int64_t *ust, int64_t *msc, int64_t *sbc); +#endif + +#ifndef GLX_NV_float_buffer +#define GLX_NV_float_buffer 1 +#endif + +#ifndef GLX_SGIX_hyperpipe +#define GLX_SGIX_hyperpipe 1 + +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int networkId; +} GLXHyperpipeNetworkSGIX; + +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int channel; + unsigned int + participationType; + int timeSlice; +} GLXHyperpipeConfigSGIX; + +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int srcXOrigin, srcYOrigin, srcWidth, srcHeight; + int destXOrigin, destYOrigin, destWidth, destHeight; +} GLXPipeRect; + +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int XOrigin, YOrigin, maxHeight, maxWidth; +} GLXPipeRectLimits; + +#ifdef GLX_GLXEXT_PROTOTYPES +extern GLXHyperpipeNetworkSGIX * glXQueryHyperpipeNetworkSGIX (Display *, int *); +extern int glXHyperpipeConfigSGIX (Display *, int, int, GLXHyperpipeConfigSGIX *, int *); +extern GLXHyperpipeConfigSGIX * glXQueryHyperpipeConfigSGIX (Display *, int, int *); +extern int glXDestroyHyperpipeConfigSGIX (Display *, int); +extern int glXBindHyperpipeSGIX (Display *, int); +extern int glXQueryHyperpipeBestAttribSGIX (Display *, int, int, int, void *, void *); +extern int glXHyperpipeAttribSGIX (Display *, int, int, int, void *); +extern int glXQueryHyperpipeAttribSGIX (Display *, int, int, int, void *); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef GLXHyperpipeNetworkSGIX * ( * PFNGLXQUERYHYPERPIPENETWORKSGIXPROC) (Display *dpy, int *npipes); +typedef int ( * PFNGLXHYPERPIPECONFIGSGIXPROC) (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId); +typedef GLXHyperpipeConfigSGIX * ( * PFNGLXQUERYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId, int *npipes); +typedef int ( * PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId); +typedef int ( * PFNGLXBINDHYPERPIPESGIXPROC) (Display *dpy, int hpId); +typedef int ( * PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList); +typedef int ( * PFNGLXHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList); +typedef int ( * PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList); +#endif + +#ifndef GLX_MESA_agp_offset +#define GLX_MESA_agp_offset 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern unsigned int glXGetAGPOffsetMESA (const void *); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef unsigned int ( * PFNGLXGETAGPOFFSETMESAPROC) (const void *pointer); +#endif + +#ifndef GLX_EXT_fbconfig_packed_float +#define GLX_EXT_fbconfig_packed_float 1 +#endif + +#ifndef GLX_EXT_framebuffer_sRGB +#define GLX_EXT_framebuffer_sRGB 1 +#endif + +#ifndef GLX_EXT_texture_from_pixmap +#define GLX_EXT_texture_from_pixmap 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern void glXBindTexImageEXT (Display *, GLXDrawable, int, const int *); +extern void glXReleaseTexImageEXT (Display *, GLXDrawable, int); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef void ( * PFNGLXBINDTEXIMAGEEXTPROC) (Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list); +typedef void ( * PFNGLXRELEASETEXIMAGEEXTPROC) (Display *dpy, GLXDrawable drawable, int buffer); +#endif + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/libGL/opengl_client.c b/libGL/opengl_client.c new file mode 100755 index 0000000..2216dc4 --- /dev/null +++ b/libGL/opengl_client.c @@ -0,0 +1,758 @@ +/* + * Guest-side implementation of GL/GLX API. Replacement of standard libGL.so + * + * Copyright (c) 2006,2007 Even Rouault + * + * Parts 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. + */ + +#define _GNU_SOURCE +#define _XOPEN_SOURCE 600 +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <unistd.h> +#include <assert.h> +#include <dlfcn.h> + +#include <sys/mman.h> +#include <fcntl.h> + +#include "opengl_func.h" +#include "common.h" + +#include "opengl_utils.h" +#include "client_glx.h" +#include "client_gl.h" +#include "lock.h" +#include "log.h" + +//#define DEBUG_GLIO + +#ifdef DEBUG_GLIO +#define SIZE_OUT_HEADER (4*4) +#define SIZE_IN_HEADER (4*2) +#else +#define SIZE_OUT_HEADER (4*3) +#define SIZE_IN_HEADER 4 +#endif + +/* Locking globals... FIXMEIM find a better place */ +pthread_mutex_t global_mutex = PTHREAD_MUTEX_INITIALIZER; +pthread_key_t key_current_gl_state; + +pthread_t last_current_thread = 0; +GLState* _mono_threaded_current_gl_state = NULL; + +/* The access to the following global variables shoud be done under the global lock */ +int nbGLStates = 0; +GLState** glstates = NULL; +GLState* default_gl_state = NULL; + +static char *do_init(void); +static inline int get_args_buffer_size(int func_number, Signature *s, long *args, int *args_size_opt); +static inline int get_ret_buffer_size(int func_number, Signature *s, long *args, int *args_size_opt); +static inline int decode_ret_buffer(int func_number, Signature *s, long *args, char *buffer, void *ret_ptr); +static inline void buffer_args(int func_number, Signature *s, long *args, int *args_size_opt, char **args_buf); + +static const char* interestingEnvVars[] = +{ + "GL_ERR_FILE", /* default is stderr */ + "DEBUG_GL", /* default : not set */ + "DEBUG_ARRAY_PTR", /* default : not set */ + "DISABLE_OPTIM", /* default : not set */ + "LIMIT_FPS", /* default : not set */ /* unsupported for Win32 guest */ + "DISABLE_GL_BUFFERING", /* default : set if ??? detected */ +}; + +/**/ + +int debug_gl = 0; +int debug_array_ptr = 0; +int disable_optim = 0; + +static int glfd; + +static char* xfer_buffer = NULL; + +static inline int call_opengl(char *buffer, int args_len, int ret_len, char *ret_buffer) +{ + volatile int *i = (volatile int*)xfer_buffer; + char *ret_buf = ret_buffer?ret_buffer:buffer; + int remain; + +#ifdef DEBUG_GLIO + int j, sum = 0; + for(j = SIZE_OUT_HEADER; j < args_len ; j++) + sum += buffer[j]; + i[3] = sum; +#endif + + /* i[0] = pid; ...is filled in by the kernel module for virtio GL */ + i[1] = args_len; + i[2] = ret_len; + + /* following args_len is net load excluding OUT_HEADER */ + args_len -= SIZE_OUT_HEADER; + + if(buffer == xfer_buffer) { + // All data fits within one buffer + fsync(glfd); + } else { + // Data split across multiple in or out (or both) buffers. + char *ptr = buffer+SIZE_OUT_HEADER; + int len = args_len > SIZE_BUFFER_COMMAND-SIZE_OUT_HEADER ? + SIZE_BUFFER_COMMAND-SIZE_OUT_HEADER : args_len; + + while(args_len) { + memcpy(xfer_buffer + SIZE_OUT_HEADER, ptr, len); + + fsync(glfd); // Make magic happen + + args_len -= len; + ptr += len; + len = args_len > SIZE_BUFFER_COMMAND-SIZE_OUT_HEADER ? + SIZE_BUFFER_COMMAND-SIZE_OUT_HEADER : args_len; + + i[1] = len + SIZE_OUT_HEADER; + i[2] = 0; + } + + ptr = ret_buf; + remain = ret_len; + while(remain) { + int len = remain > SIZE_BUFFER_COMMAND ? SIZE_BUFFER_COMMAND + : remain; + + i[1] = 0; + i[2] = len; + + fsync(glfd); // Make magic happen + + memcpy(ptr, xfer_buffer, len); + remain -= len; + ptr += len; + } + } + + if(!((int*)ret_buf)[0]) { + /* Kernel decided to kill the process */ + *(int*)0 = 0; + exit(1); /* Just in case */ + } + +#ifdef DEBUG_GLIO + sum = 0; + for(j = SIZE_IN_HEADER; j < ret_len ; j++) + sum += ret_buf[j]; + if(sum != *(int*)(ret_buf + 4)) + fprintf(stderr, "Read checksum error (was: %d should be: %d)\n", sum, + *(int*)(ret_buf + 4)); +#endif + + return 0; +} + +static inline char *map_buffer(void) { + char *buffer; + + buffer = mmap(NULL, SIZE_BUFFER_COMMAND, PROT_READ | PROT_WRITE, MAP_SHARED, glfd, 0); + + if(buffer == MAP_FAILED) { + fprintf(stderr, "Failed to map buffer - dying horribly\n"); + exit(1); + } + + return buffer; +} + +static int exists_on_server_side[GL_N_CALLS]; +static char* cur_args_buffer = NULL; +static int enable_gl_buffering = 0; + +/* Must only be called if the global lock has already been taken ! */ +void do_opengl_call_no_lock(int func_number, void* ret_ptr, long* args, int* args_size_opt) +{ + Signature *signature; + static char *command_buffer; + char *ret_buf = NULL; + int again, req_args_buffer, req_ret_buffer, req_total_buffer, check_buf_full; + int current_thread; + int ret_int = 0; + static int init, nr_serial, cur_ret_buf; + + if( ! (func_number >= 0 && func_number < GL_N_CALLS) ) + { + log_gl("func_number >= 0 && func_number < GL_N_CALLS failed\n"); + return; + } + + current_thread = pthread_self(); + signature = (Signature*)tab_opengl_calls[func_number]; + + if (!init) { + do_init(); + init = 1; + } + + if (exists_on_server_side[func_number] == -1) + { + if (strchr(tab_opengl_calls_name[func_number], '_')) + { + exists_on_server_side[func_number] = 1; + } + else + { + exists_on_server_side[func_number] = + glXGetProcAddress_no_lock( + (const GLubyte *)tab_opengl_calls_name[func_number]) != NULL; + } + if (exists_on_server_side[func_number] == 0) + { + log_gl("Symbol %s not available in server libGL. Shouldn't have reach that point...\n", + tab_opengl_calls_name[func_number]); + return; + } + } + else if (exists_on_server_side[func_number] == 0) + { + return; + } + + GET_CURRENT_STATE(); + +#ifdef ENABLE_THREAD_SAFETY + if (last_current_thread != current_thread) + { + fprintf(stderr, "MULTI-THREADED!----------------------\n"); + last_current_thread = current_thread; + if (debug_gl) + log_gl("gl thread switch\n"); + glXMakeCurrent_no_lock(state->display, state->current_drawable, + state->context); + } +#endif + + if ((func_number >= glRasterPos2d_func && + func_number <= glRasterPos4sv_func) || + (func_number >= glWindowPos2d_func && + func_number <= glWindowPos3sv_func) || + (func_number >= glWindowPos2dARB_func && + func_number <= glWindowPos3svARB_func) || + (func_number >= glWindowPos2dMESA_func && + func_number <= glWindowPos4svMESA_func)) + { + state->currentRasterPosKnown = 0; + } + + /* Try to buffer the calls. + * If there isnt enough room to buffer the call empty the buffer and retry. + * If the call is > COMMAND_BUFFER_SIZE in length, pass it in a seperate + * buffer. call_opengl() will detect this and split the call up for us. + */ + + check_buf_full = 0; + again = 0; + do { + if(!command_buffer) + command_buffer = xfer_buffer; + + if(!cur_args_buffer) { + cur_args_buffer = command_buffer + SIZE_OUT_HEADER; + nr_serial = 0; + } + + /* Check buffer sizes */ + req_args_buffer = get_args_buffer_size(func_number, signature, + args, args_size_opt); + + // Only the last command in the buffer can return data so no need to + // increment the size of the required return buffer. Just set it if + // necessary. + + req_ret_buffer = get_ret_buffer_size(func_number, signature, + args, args_size_opt); + + if(((SIZE_BUFFER_COMMAND + command_buffer - cur_args_buffer) >= + req_args_buffer) && req_ret_buffer <= SIZE_BUFFER_COMMAND) + { + cur_ret_buf = req_ret_buffer; + buffer_args(func_number, signature, args, args_size_opt, &cur_args_buffer); + if(again > 0) + again--; + nr_serial++; + } + else { + again++; + if(again == 2) { + // FIXME - this shouldnt be needed. + req_total_buffer = MAX(req_args_buffer + SIZE_OUT_HEADER, + req_ret_buffer); + + if(req_total_buffer > MAX_SIZE_BUFFER_COMMAND) { + fprintf(stderr, "Attempt to allocate (%d) buffer over %d bytes", + req_total_buffer, MAX_SIZE_BUFFER_COMMAND); + *(int*)0 = 0; + } + + // Allocate temporary large buffer + command_buffer = malloc(req_total_buffer); + ret_buf = malloc(req_ret_buffer); + + cur_args_buffer = command_buffer + SIZE_OUT_HEADER; + cur_ret_buf = req_ret_buffer; + buffer_args(func_number, signature, args, args_size_opt, &cur_args_buffer); + nr_serial = 1; + } else { + check_buf_full = 1; + } + } + + /* If call is not bufferable or the buffer is full. */ + if (nr_serial && + (again || !enable_gl_buffering || + !(signature->ret_type == TYPE_NONE && + signature->has_out_parameters == 0 && + !(func_number == glXSwapBuffers_func || + func_number == glFlush_func || + func_number == glFinish_func || + func_number == _resize_surface_func || + func_number == _render_surface_func)))) + { + ret_int = call_opengl(command_buffer, cur_args_buffer - command_buffer, cur_ret_buf, ret_buf); + + if (check_buf_full == 0 || func_number == _render_surface_func + || func_number == _resize_surface_func) { + decode_ret_buffer(func_number, signature, args, ret_buf?ret_buf:command_buffer, ret_ptr); + } else { + // FIX ME : this variable be used to prevent to copy return value to args + check_buf_full = 0; + } + cur_args_buffer = NULL; // Reset pointers. + + if(again == 2) { + free(command_buffer); + free(ret_buf); + ret_buf = NULL; + command_buffer = NULL; + again = 0; + } + } + } while (again); +} + +#define GLINIT_FAIL_ABI 3 +#define GLINIT_QUEUE 2 +#define GLINIT_NOQUEUE 1 + +struct init_packet { + short func_number; + int version_major; + int version_minor; +} __attribute__((__packed__)); +GLFunctionTable glFuncTable; +static void init_gl_func_table (GLFunctionTable * ptable) +{ + void *handle = dlopen(getenv("REAL_LIBGL") ? getenv("REAL_LIBGL") : "libGL.so.1" ,RTLD_LAZY); + if (!handle) { + log_gl("%s\n", dlerror()); + exit(1); + } +#define ACTION(name) do { \ + ptable->fp##name = dlsym(handle, "gl" #name); \ + if (ptable->fp##name == NULL) ptable->fp##name = NULL; \ + } while (0) +#include "glfunclist.inl" +#undef ACTION + dlclose (handle); +} + +static char *do_init(void) +{ + int current_thread = pthread_self(); + FILE *f; + int i, init_ret; + struct init_packet *pkt; + + /* Sanity checks */ + assert(tab_args_type_length[TYPE_OUT_128UCHAR] == 128 * sizeof(char)); + assert(tab_args_type_length[TYPE_OUT_ARRAY_DOUBLE_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS] == sizeof(double)); + + memset(exists_on_server_side, 255, sizeof(exists_on_server_side)); + exists_on_server_side[glXGetProcAddress_fake_func] = 1; + exists_on_server_side[glXGetProcAddress_global_fake_func] = 1; + + f = fopen("/tmp/.opengl_client", "rb"); + + if (!f) + f = fopen("opengl_client.txt", "rb"); + + if (f) + { + char buffer[80]; + while (fgets(buffer, 80, f)) + { + for(i = 0 ; + i < sizeof(interestingEnvVars) / sizeof(interestingEnvVars[0]) ; + i++) + { + char tmp[256]; + strcpy(tmp, interestingEnvVars[i]); + strcat(tmp, "="); + if (strncmp(buffer, tmp, strlen(tmp)) == 0) + { + char* c = strdup(buffer + strlen(tmp)); + char* c2 = strchr(c, '\n'); + if (c2) + *c2 = 0; + setenv(interestingEnvVars[i], c, 1); + break; + } + } + } + fclose(f); + } + + last_current_thread = current_thread; + + debug_gl = getenv("DEBUG_GL") != NULL; + debug_array_ptr = getenv("DEBUG_ARRAY_PTR") != NULL; + disable_optim = getenv("DISABLE_OPTIM") != NULL; + + glfd = open("/dev/glmem", O_RDWR | O_NOCTTY | O_SYNC | O_CLOEXEC); + + if(glfd == -1) { + fprintf(stderr, "Failed to open GL device\n"); + exit(1); + } + + xfer_buffer = map_buffer(); + + /* special case init function - nothings set up yet... */ + pkt = (struct init_packet*)(xfer_buffer + SIZE_OUT_HEADER); + pkt->func_number = _init_func; + pkt->version_major = 1; + pkt->version_minor = 1; + + call_opengl(xfer_buffer, + SIZE_OUT_HEADER + sizeof(*pkt), + SIZE_IN_HEADER + sizeof(int), NULL); + + init_ret = *(int*)(xfer_buffer + SIZE_IN_HEADER); + + switch(init_ret) + { + case GLINIT_QUEUE: + case GLINIT_NOQUEUE: + enable_gl_buffering = (init_ret == GLINIT_QUEUE) && + !(getenv("DISABLE_GL_BUFFERING")); + break; + case GLINIT_FAIL_ABI: + log_gl("Incompatible ABI version\n"); + log_gl("exiting !\n"); + exit(-1); + } + if(debug_gl) + fprintf(stderr, "Enable buffering: %s (%d)\n", enable_gl_buffering?"yes":"no", init_ret); + + // init the function table for gl functions that are shared by OpenGL and GLES + init_gl_func_table (&glFuncTable); + return NULL; +} + +static inline void buffer_args(int func_number, Signature *s, long *args, int *args_size_opt, char **cur_args) +{ + int i; + char *args_buf = *cur_args; + int *args_size_buf; + + /* Store function number */ + *(short*)(args_buf) = func_number; + args_buf += sizeof(short); + + + for(i=0;i<s->nb_args;i++) + { + args_size_buf = (int*)args_buf; + args_buf += sizeof(int); + + switch(s->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_size_buf = sizeof(int); + memcpy(args_buf, &args[i], *args_size_buf); + args_buf += *args_size_buf; + args_size_buf++; + break; + + CASE_IN_UNKNOWN_SIZE_POINTERS: + memcpy(args_buf, (void *)&args[i], sizeof(int)); + args_buf += sizeof(int); + *args_size_buf = args_size_opt[i]; + if (*args_size_buf < 0) + { + log_gl("size < 0 : func=%s, param=%d\n", tab_opengl_calls_name[func_number], i); + exit(1); + } + memcpy(args_buf, (void *)args[i], *args_size_buf); + args_buf += *args_size_buf; + args_size_buf++; + break; + + case TYPE_NULL_TERMINATED_STRING: + memcpy(args_buf, (void *)&args[i], sizeof(int)); + args_buf += sizeof(int); + *args_size_buf = strlen((const char*)args[i]) + 1; + memcpy(args_buf, (void *)args[i], *args_size_buf); + args_buf += *args_size_buf; + args_size_buf++; + break; + + CASE_OUT_LENGTH_DEPENDING_ON_PREVIOUS_ARGS: + memcpy(args_buf, (void *)&args[i], sizeof(int)); + args_buf += sizeof(int); + *args_size_buf = compute_arg_length(func_number, s, i, args); + args_size_buf++; + break; + + CASE_IN_LENGTH_DEPENDING_ON_PREVIOUS_ARGS: + memcpy(args_buf, (void *)&args[i], sizeof(int)); + args_buf += sizeof(int); + *args_size_buf = compute_arg_length(func_number, s, i, args); + memcpy(args_buf, (void *)args[i], *args_size_buf); + args_buf += *args_size_buf; + args_size_buf++; + break; + + case TYPE_IN_IGNORED_POINTER: + *args_size_buf = 0; + args_size_buf++; + break; + + CASE_OUT_UNKNOWN_SIZE_POINTERS: + memcpy(args_buf, (void *)&args[i], sizeof(int)); + args_buf += sizeof(int); + *args_size_buf = args_size_opt[i]; + if (*args_size_buf < 0) + { + log_gl("size < 0 : func=%s, param=%d\n", tab_opengl_calls_name[func_number], i); + exit(1); + } + args_size_buf++; + break; + + CASE_OUT_KNOWN_SIZE_POINTERS: + memcpy(args_buf, (void *)&args[i], sizeof(int)); + args_buf += sizeof(int); + *args_size_buf = tab_args_type_length[s->args_type[i]]; + args_size_buf++; + break; + + case TYPE_DOUBLE: + CASE_IN_KNOWN_SIZE_POINTERS: + memcpy(args_buf, (void *)&args[i], sizeof(int)); + args_buf += sizeof(int); + *args_size_buf = tab_args_type_length[s->args_type[i]]; + memcpy(args_buf, (void *)args[i], *args_size_buf); + args_buf += *args_size_buf; + args_size_buf++; + break; + + default: + log_gl("(1) unexpected arg type %d at i=%d\n", s->args_type[i], i); + exit(-1); + break; + } + } + + *cur_args = args_buf; + +} + +static inline int get_args_buffer_size(int func_number, Signature *s, + long *args, int *args_size_opt) +{ + int this_func_args_size = sizeof(short); + int i; + + for(i=0;i<s->nb_args;i++) + { + this_func_args_size += sizeof(int); + switch(s->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: + this_func_args_size += sizeof(int); + break; + + CASE_IN_UNKNOWN_SIZE_POINTERS: + this_func_args_size += sizeof(int); + this_func_args_size += args_size_opt[i]; + break; + + case TYPE_NULL_TERMINATED_STRING: + this_func_args_size += sizeof(int); + this_func_args_size += strlen((const char*)args[i]) + 1; + break; + + CASE_OUT_LENGTH_DEPENDING_ON_PREVIOUS_ARGS: + this_func_args_size += sizeof(int); + break; + + CASE_IN_LENGTH_DEPENDING_ON_PREVIOUS_ARGS: + this_func_args_size += sizeof(int); + this_func_args_size += compute_arg_length(func_number, s, i, args); + break; + + case TYPE_IN_IGNORED_POINTER: + break; + + CASE_OUT_UNKNOWN_SIZE_POINTERS: + this_func_args_size += sizeof(int); + break; + + CASE_OUT_KNOWN_SIZE_POINTERS: + this_func_args_size += sizeof(int); + break; + + case TYPE_DOUBLE: + CASE_IN_KNOWN_SIZE_POINTERS: + this_func_args_size += sizeof(int); + this_func_args_size += tab_args_type_length[s->args_type[i]]; + break; + + default: + log_gl("(1) unexpected arg type %d at i=%d\n", s->args_type[i], i); + exit(-1); + break; + } + } + + return this_func_args_size; +} + +int get_ret_buffer_size(int func_number, Signature *s, long *args, + int *args_size_opt) +{ + int this_func_ret_size = SIZE_IN_HEADER; // return status + int i; + + for(i=0;i<s->nb_args;i++) + { + switch(s->args_type[i]) + { + CASE_OUT_LENGTH_DEPENDING_ON_PREVIOUS_ARGS: + this_func_ret_size += sizeof(int); + this_func_ret_size += compute_arg_length(func_number, s, i, + args); + break; + + CASE_OUT_UNKNOWN_SIZE_POINTERS: + this_func_ret_size += sizeof(int); + this_func_ret_size += args_size_opt[i] + sizeof(int); + break; + + CASE_OUT_KNOWN_SIZE_POINTERS: + this_func_ret_size += sizeof(int); + this_func_ret_size += tab_args_type_length[s->args_type[i]]; + break; + } + } + + switch(s->ret_type) { + case TYPE_CONST_CHAR: + this_func_ret_size += 32768; + break; + case TYPE_INT: + case TYPE_UNSIGNED_INT: + this_func_ret_size += 4; + break; + case TYPE_CHAR: + case TYPE_UNSIGNED_CHAR: + this_func_ret_size += 1; + break; + case TYPE_NONE: + break; + default: + log_gl("Unexpected return arg type %d !\n", s->ret_type); + exit(-1); + break; + } + + return this_func_ret_size; +} + +int decode_ret_buffer(int func_number, Signature *s, long *args, char *buffer, void *ret_ptr) +{ + char *cur_ptr = buffer; + int i; + int ret = *(int*)cur_ptr; + + cur_ptr += SIZE_IN_HEADER; + + for(i=0;i<s->nb_args;i++) + { + switch(s->args_type[i]) + { + int len; + CASE_OUT_POINTERS: + len = *(int*)cur_ptr; cur_ptr += sizeof(int); + if(args[i]) + memcpy((char*)args[i], cur_ptr, len); + cur_ptr += len; + break; + } + } + + if(ret_ptr) { + switch(s->ret_type) { + case TYPE_CONST_CHAR: + *(char**)ret_ptr = cur_ptr; + break; + case TYPE_INT: + case TYPE_UNSIGNED_INT: + memcpy(ret_ptr, cur_ptr, 4); + break; + case TYPE_CHAR: + case TYPE_UNSIGNED_CHAR: + *(char*)ret_ptr = *cur_ptr; + break; + case TYPE_NONE: + break; + default: + log_gl("Unexpected return arg type %d !\n", s->ret_type); + exit(-1); + break; + } + } + return ret; +} diff --git a/libGL/opengl_client_xfonts.c b/libGL/opengl_client_xfonts.c new file mode 100755 index 0000000..8254a00 --- /dev/null +++ b/libGL/opengl_client_xfonts.c @@ -0,0 +1,302 @@ +/* Adapted for qemu/OpenGL. Copyright (C) 2007, Even Rouault */ + +/* + * Mesa 3-D graphics library + * Version: 3.5 + * + * Copyright (C) 1999-2000 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. + */ + + +/* xfonts.c -- glXUseXFont() for Mesa written by + * Copyright (C) 1995 Thorsten.Ohl @ Physik.TH-Darmstadt.de + */ + +/* Implementation. */ + +/* Fill a BITMAP with a character C from thew current font + in the graphics context GC. WIDTH is the width in bytes + and HEIGHT is the height in bits. + + Note that the generated bitmaps must be used with + + glPixelStorei (GL_UNPACK_SWAP_BYTES, GL_FALSE); + glPixelStorei (GL_UNPACK_LSB_FIRST, GL_FALSE); + glPixelStorei (GL_UNPACK_ROW_LENGTH, 0); + glPixelStorei (GL_UNPACK_SKIP_ROWS, 0); + glPixelStorei (GL_UNPACK_SKIP_PIXELS, 0); + glPixelStorei (GL_UNPACK_ALIGNMENT, 1); + + Possible optimizations: + + * use only one reusable pixmap with the maximum dimensions. + * draw the entire font into a single pixmap (careful with + proportional fonts!). +*/ + + +/* + * Generate OpenGL-compatible bitmap. + */ +static void +fill_bitmap(Display * dpy, Window win, GC gc, + unsigned int width, unsigned int height, + int x0, int y0, unsigned int c, GLubyte * bitmap) +{ + XImage *image; + unsigned int x, y; + Pixmap pixmap; + XChar2b char2b; + + pixmap = XCreatePixmap(dpy, win, 8 * width, height, 1); + XSetForeground(dpy, gc, 0); + XFillRectangle(dpy, pixmap, gc, 0, 0, 8 * width, height); + XSetForeground(dpy, gc, 1); + + char2b.byte1 = (c >> 8) & 0xff; + char2b.byte2 = (c & 0xff); + + XDrawString16(dpy, pixmap, gc, x0, y0, &char2b, 1); + + image = XGetImage(dpy, pixmap, 0, 0, 8 * width, height, 1, XYPixmap); + if (image) { + /* Fill the bitmap (X11 and OpenGL are upside down wrt each other). */ + for (y = 0; y < height; y++) + for (x = 0; x < 8 * width; x++) + if (XGetPixel(image, x, y)) + bitmap[width * (height - y - 1) + x / 8] |= + (1 << (7 - (x % 8))); + XDestroyImage(image); + } + + XFreePixmap(dpy, pixmap); +} + +/* + * determine if a given glyph is valid and return the + * corresponding XCharStruct. + */ +static XCharStruct * +isvalid(XFontStruct * fs, unsigned int which) +{ + unsigned int rows, pages; + unsigned int byte1 = 0, byte2 = 0; + int i, valid = 1; + + rows = fs->max_byte1 - fs->min_byte1 + 1; + pages = fs->max_char_or_byte2 - fs->min_char_or_byte2 + 1; + + if (rows == 1) { + /* "linear" fonts */ + if ((fs->min_char_or_byte2 > which) || (fs->max_char_or_byte2 < which)) + valid = 0; + } + else { + /* "matrix" fonts */ + byte2 = which & 0xff; + byte1 = which >> 8; + if ((fs->min_char_or_byte2 > byte2) || + (fs->max_char_or_byte2 < byte2) || + (fs->min_byte1 > byte1) || (fs->max_byte1 < byte1)) + valid = 0; + } + + if (valid) { + if (fs->per_char) { + if (rows == 1) { + /* "linear" fonts */ + return (fs->per_char + (which - fs->min_char_or_byte2)); + } + else { + /* "matrix" fonts */ + i = ((byte1 - fs->min_byte1) * pages) + + (byte2 - fs->min_char_or_byte2); + return (fs->per_char + i); + } + } + else { + return (&fs->min_bounds); + } + } + return (NULL); +} + + +GLAPI void APIENTRY glXUseXFont( Font font, int first, int count, int listbase ) +{ + Display *dpy; + Window win; + Pixmap pixmap; + GC gc; + XGCValues values; + unsigned long valuemask; + XFontStruct *fs; + GLint swapbytes, lsbfirst, rowlength; + GLint skiprows, skippixels, alignment; + unsigned int max_width, max_height, max_bm_width, max_bm_height; + GLubyte *bm; + int i; + + dpy = glXGetCurrentDisplay(); + if (!dpy) + return; /* I guess glXMakeCurrent wasn't called */ + win = RootWindow(dpy, DefaultScreen(dpy)); + + fs = XQueryFont(dpy, font); + if (!fs) { + /*_mesa_error(NULL, GL_INVALID_VALUE, + "Couldn't get font structure information");*/ + return; + } + + /* Allocate a bitmap that can fit all characters. */ + max_width = fs->max_bounds.rbearing - fs->min_bounds.lbearing; + max_height = fs->max_bounds.ascent + fs->max_bounds.descent; + max_bm_width = (max_width + 7) / 8; + max_bm_height = max_height; + + bm = (GLubyte *) malloc((max_bm_width * max_bm_height) * sizeof(GLubyte)); + if (!bm) { + XFreeFontInfo(NULL, fs, 1); + /*_mesa_error(NULL, GL_OUT_OF_MEMORY, + "Couldn't allocate bitmap in glXUseXFont()");*/ + return; + } + +#if 0 + /* get the page info */ + pages = fs->max_char_or_byte2 - fs->min_char_or_byte2 + 1; + firstchar = (fs->min_byte1 << 8) + fs->min_char_or_byte2; + lastchar = (fs->max_byte1 << 8) + fs->max_char_or_byte2; + rows = fs->max_byte1 - fs->min_byte1 + 1; + unsigned int first_char, last_char, pages, rows; +#endif + + /* Save the current packing mode for bitmaps. */ + glGetIntegerv(GL_UNPACK_SWAP_BYTES, &swapbytes); + glGetIntegerv(GL_UNPACK_LSB_FIRST, &lsbfirst); + glGetIntegerv(GL_UNPACK_ROW_LENGTH, &rowlength); + glGetIntegerv(GL_UNPACK_SKIP_ROWS, &skiprows); + glGetIntegerv(GL_UNPACK_SKIP_PIXELS, &skippixels); + glGetIntegerv(GL_UNPACK_ALIGNMENT, &alignment); + + /* Enforce a standard packing mode which is compatible with + fill_bitmap() from above. This is actually the default mode, + except for the (non)alignment. */ + glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE); + glPixelStorei(GL_UNPACK_LSB_FIRST, GL_FALSE); + glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); + glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); + glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + + pixmap = XCreatePixmap(dpy, win, 10, 10, 1); + values.foreground = BlackPixel(dpy, DefaultScreen(dpy)); + values.background = WhitePixel(dpy, DefaultScreen(dpy)); + values.font = fs->fid; + valuemask = GCForeground | GCBackground | GCFont; + gc = XCreateGC(dpy, pixmap, valuemask, &values); + XFreePixmap(dpy, pixmap); + +#ifdef DEBUG + if (debug_xfonts) + dump_font_struct(fs); +#endif + + for (i = 0; i < count; i++) { + unsigned int width, height, bm_width, bm_height; + GLfloat x0, y0, dx, dy; + XCharStruct *ch; + int x, y; + unsigned int c = first + i; + int list = listbase + i; + int valid; + + /* check on index validity and get the bounds */ + ch = isvalid(fs, c); + if (!ch) { + ch = &fs->max_bounds; + valid = 0; + } + else { + valid = 1; + } + +#ifdef DEBUG + if (debug_xfonts) { + char s[7]; + sprintf(s, isprint(c) ? "%c> " : "\\%03o> ", c); + dump_char_struct(ch, s); + } +#endif + + /* glBitmap()' parameters: + straight from the glXUseXFont(3) manpage. */ + width = ch->rbearing - ch->lbearing; + height = ch->ascent + ch->descent; + x0 = -ch->lbearing; + y0 = ch->descent - 0; /* XXX used to subtract 1 here */ + /* but that caused a conformace failure */ + dx = ch->width; + dy = 0; + + /* X11's starting point. */ + x = -ch->lbearing; + y = ch->ascent; + + /* Round the width to a multiple of eight. We will use this also + for the pixmap for capturing the X11 font. This is slightly + inefficient, but it makes the OpenGL part real easy. */ + bm_width = (width + 7) / 8; + bm_height = height; + + glNewList(list, GL_COMPILE); + if (valid && (bm_width > 0) && (bm_height > 0)) { + + memset(bm, '\0', bm_width * bm_height); + fill_bitmap(dpy, win, gc, bm_width, bm_height, x, y, c, bm); + + glBitmap(width, height, x0, y0, dx, dy, bm); +#ifdef DEBUG + if (debug_xfonts) { + printf("width/height = %u/%u\n", width, height); + printf("bm_width/bm_height = %u/%u\n", bm_width, bm_height); + dump_bitmap(bm_width, bm_height, bm); + } +#endif + } + else { + glBitmap(0, 0, 0.0, 0.0, dx, dy, NULL); + } + glEndList(); + } + + free(bm); + XFreeFontInfo(NULL, fs, 1); + XFreeGC(dpy, gc); + + /* Restore saved packing modes. */ + glPixelStorei(GL_UNPACK_SWAP_BYTES, swapbytes); + glPixelStorei(GL_UNPACK_LSB_FIRST, lsbfirst); + glPixelStorei(GL_UNPACK_ROW_LENGTH, rowlength); + glPixelStorei(GL_UNPACK_SKIP_ROWS, skiprows); + glPixelStorei(GL_UNPACK_SKIP_PIXELS, skippixels); + glPixelStorei(GL_UNPACK_ALIGNMENT, alignment); +} diff --git a/libGL/opengl_func.h b/libGL/opengl_func.h new file mode 100755 index 0000000..7d48aa0 --- /dev/null +++ b/libGL/opengl_func.h @@ -0,0 +1,554 @@ +/* + * Main header for both host and guest sides + * + * 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. + */ + +#include "mesa_gl.h" +#include "enumtype.h" + +#include <stdio.h> + +typedef struct { + GLboolean (*fpIsBuffer)(GLuint); + GLboolean (*fpIsEnabled)(GLenum); + GLboolean (*fpIsFramebuffer)(GLuint); + GLboolean (*fpIsProgram)(GLuint); + GLboolean (*fpIsRenderbuffer)(GLuint); + GLboolean (*fpIsShader)(GLuint); + GLboolean (*fpIsTexture)(GLuint); + GLenum (*fpCheckFramebufferStatus)(GLenum); + GLenum (*fpGetError)(void); + GLint (*fpGetAttribLocation)(GLuint, const GLchar*); + GLint (*fpGetUniformLocation)(GLuint, const GLchar*); + GLuint (*fpCreateProgram)(void); + GLuint (*fpCreateShader)(GLenum); + const GLubyte* (*fpGetString)(GLenum); + void (*fpActiveTexture)(GLenum); + void (*fpAlphaFunc)(GLenum, GLclampf); + void (*fpAttachShader)(GLuint, GLuint); + void (*fpBindAttribLocation)(GLuint, GLuint, const GLchar*); + void (*fpBindBuffer)(GLenum, GLuint); + void (*fpBindFramebuffer)(GLenum, GLuint); + void (*fpBindRenderbuffer)(GLenum, GLuint); + void (*fpBindTexture)(GLenum, GLuint); + void (*fpBlendColor)(GLclampf, GLclampf, GLclampf, GLclampf); + void (*fpBlendEquation)(GLenum); + void (*fpBlendEquationSeparate)(GLenum, GLenum); + void (*fpBlendFunc)(GLenum, GLenum); + void (*fpBlendFuncSeparate)(GLenum, GLenum, GLenum, GLenum); + void (*fpBufferData)(GLenum, GLsizeiptr, const GLvoid*, GLenum); + void (*fpBufferSubData)(GLenum, GLintptr, GLsizeiptr, const GLvoid*); + void (*fpClear)(GLbitfield); + void (*fpClearColor)(GLclampf, GLclampf, GLclampf, GLclampf); +// void (*fpClearColorx)(GLclampx, GLclampx, GLclampx, GLclampx); + void (*fpClearDepthf)(GLclampd); + void (*fpClearStencil)(GLint); + void (*fpClientActiveTexture)(GLenum); + void (*fpClipPlane)(GLenum, const GLdouble*); + void (*fpColor4f)(GLfloat, GLfloat, GLfloat, GLfloat); + void (*fpColor4ub)(GLubyte, GLubyte, GLubyte, GLubyte); + void (*fpColorMask)(GLboolean, GLboolean, GLboolean, GLboolean); + void (*fpColorPointer)(GLint, GLenum, GLsizei, const GLvoid*); + void (*fpCompileShader)(GLuint); + void (*fpCompressedTexImage2D)(GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid*); + void (*fpCompressedTexSubImage2D)(GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid*); + void (*fpCopyTexImage2D)(GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint); + void (*fpCopyTexSubImage2D)(GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); + void (*fpCullFace)(GLenum); + void (*fpDeleteBuffers)(GLsizei, const GLuint*); + void (*fpDeleteFramebuffers)(GLsizei, const GLuint*); + void (*fpDeleteProgram)(GLuint); + void (*fpDeleteRenderbuffers)(GLsizei, const GLuint*); + void (*fpDeleteShader)(GLuint); + void (*fpDeleteTextures)(GLsizei, const GLuint*); + void (*fpDepthFunc)(GLenum); + void (*fpDepthMask)(GLboolean); + void (*fpDepthRangef)(GLclampf, GLclampf); + void (*fpDetachShader)(GLuint, GLuint); + void (*fpDisable)(GLenum); + void (*fpDisableClientState)(GLenum); + void (*fpDisableVertexAttribArray)(GLuint); + void (*fpDrawArrays)(GLenum, GLint, GLsizei); + void (*fpDrawElements)(GLenum, GLsizei, GLenum, const void*); + void (*fpEnable)(GLenum); + void (*fpEnableClientState)(GLenum); + void (*fpEnableVertexAttribArray)(GLuint); + void (*fpFinish)(void); + void (*fpFlush)(void); + void (*fpFogf)(GLenum, GLfloat); + void (*fpFogfv)(GLenum, const GLfloat*); + void (*fpFogi)(GLenum, GLint); + void (*fpFramebufferRenderbuffer)(GLenum, GLenum, GLenum, GLuint); + void (*fpFramebufferTexture2D)(GLenum, GLenum, GLenum, GLuint, GLint); + void (*fpFrontFace)(GLenum); + void (*fpGenBuffers)(GLsizei, GLuint*); + void (*fpGenFramebuffers)(GLsizei, GLuint*); + void (*fpGenRenderbuffers)(GLsizei, GLuint*); + void (*fpGenTextures)(GLsizei, GLuint*); + void (*fpGenerateMipmap)(GLenum); + void (*fpGetActiveAttrib)(GLuint, GLuint, GLsizei, GLsizei*, GLint*, GLenum*, GLchar*); + void (*fpGetActiveUniform)(GLuint, GLuint, GLsizei, GLsizei*, GLint*, GLenum*, GLchar*); + void (*fpGetAttachedShaders)(GLuint, GLsizei, GLsizei*, GLuint*); + void (*fpGetBooleanv)(GLenum, GLboolean*); + void (*fpGetBufferParameteriv)(GLenum, GLenum, GLint*); + void (*fpGetBufferSubData)(GLenum, GLintptr, GLsizeiptr, const GLvoid* data); + void (*fpGetClipPlane)(GLenum, GLdouble*); + void (*fpGetFloatv)(GLenum, GLfloat*); + void (*fpGetFramebufferAttachmentParameteriv)(GLenum, GLenum, GLenum, GLint*); + void (*fpGetIntegerv)(GLenum, GLint*); + void (*fpGetLightfv)(GLenum, GLenum, GLfloat*); + void (*fpGetMaterialfv)(GLenum, GLenum, GLfloat*); + void (*fpGetPointerv)(GLenum, GLvoid**); + void (*fpGetProgramInfoLog)(GLuint, GLsizei, GLsizei*, GLchar*); + void (*fpGetProgramiv)(GLuint, GLenum, GLint*); + void (*fpGetRenderbufferParameteriv)(GLenum, GLenum, GLint*); + void (*fpGetShaderInfoLog)(GLuint, GLsizei, GLsizei*, GLchar*); + void (*fpGetShaderSource)(GLuint, GLsizei, GLsizei*, GLchar*); + void (*fpGetShaderiv)(GLuint, GLenum, GLint*); + void (*fpGetTexEnvfv)(GLenum, GLenum, GLfloat*); + void (*fpGetTexEnviv)(GLenum, GLenum, GLint*); + void (*fpGetTexLevelParameteriv)(GLenum, GLint, GLenum, GLint*); + void (*fpGetTexParameterfv)(GLenum, GLenum, GLfloat*); + void (*fpGetTexParameteriv)(GLenum, GLenum, GLint*); + void (*fpGetUniformfv)(GLuint, GLint, GLfloat*); + void (*fpGetUniformiv)(GLuint, GLint, GLint*); + void (*fpGetVertexAttribPointerv)(GLuint, GLenum, void**); + void (*fpGetVertexAttribfv)(GLuint, GLenum, GLfloat*); + void (*fpGetVertexAttribiv)(GLuint, GLenum, GLint*); + void (*fpHint)(GLenum, GLenum); + void (*fpLightModelf)(GLenum, GLfloat); + void (*fpLightModelfv)(GLenum, const GLfloat*); + void (*fpLightf)(GLenum, GLenum, GLfloat); + void (*fpLightfv)(GLenum, GLenum, const GLfloat*); + void (*fpLineWidth)(GLfloat); + void (*fpLinkProgram)(GLuint); + void (*fpLoadIdentity)(void); + void (*fpLoadMatrixf)(const GLfloat*); + void (*fpLogicOp)(GLenum); + void (*fpMaterialf)(GLenum, GLenum, GLfloat); + void (*fpMaterialfv)(GLenum, GLenum, const GLfloat*); + void (*fpMatrixMode)(GLenum); + void (*fpMultMatrixf)(const GLfloat*); + void (*fpMultiTexCoord4f)(GLenum, GLfloat, GLfloat, GLfloat, GLfloat); + void (*fpNormal3f)(GLfloat, GLfloat, GLfloat); + void (*fpNormalPointer)(GLenum, GLsizei, const GLvoid*); + void (*fpOrtho)(GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble); + void (*fpOrthof)(GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +// void (*fpOrthox)(GLfixed, GLfixed, GLfixed, GLfixed, GLfixed, GLfixed); + void (*fpPixelStorei)(GLenum, GLint); + void (*fpPointParameterf)(GLenum, GLfloat); + void (*fpPointParameterfv)(GLenum, const GLfloat*); + void (*fpPointSize)(GLfloat); + void (*fpPolygonOffset)(GLfloat, GLfloat); + void (*fpPopMatrix)(void); + void (*fpPushMatrix)(void); + void (*fpReadPixels)(GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLvoid*); + void (*fpRenderbufferStorage)(GLenum, GLenum, GLsizei, GLsizei); + void (*fpRotatef)(GLfloat, GLfloat, GLfloat, GLfloat); +// void (*fpRotatex)(GLfixed, GLfixed, GLfixed, GLfixed); + void (*fpSampleCoverage)(GLclampf, GLboolean); + void (*fpScalef)(GLfloat, GLfloat, GLfloat); + void (*fpScissor)(GLint, GLint, GLsizei, GLsizei); + void (*fpShadeModel)(GLenum); + void (*fpShaderSource)(GLuint, GLsizei, const GLchar**, const GLint*); + void (*fpStencilFunc)(GLenum, GLint, GLuint); + void (*fpStencilFuncSeparate)(GLenum, GLenum, GLint, GLuint); + void (*fpStencilMask)(GLuint); + void (*fpStencilMaskSeparate)(GLenum, GLuint); + void (*fpStencilOp)(GLenum, GLenum, GLenum); + void (*fpStencilOpSeparate)(GLenum, GLenum, GLenum, GLenum); + void (*fpTexCoordPointer)(GLint, GLenum, GLsizei, const GLvoid*); + void (*fpTexEnvf)(GLenum, GLenum, GLfloat); + void (*fpTexEnvfv)(GLenum, GLenum, const GLfloat*); + void (*fpTexEnvi)(GLenum, GLenum, GLint); + void (*fpTexEnviv)(GLenum, GLenum, const GLint*); + void (*fpTexImage2D)(GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid*); + void (*fpTexParameterf)(GLenum, GLenum, GLfloat); + void (*fpTexParameterfv)(GLenum, GLenum, const GLfloat*); + void (*fpTexParameteri)(GLenum, GLenum, GLint); + void (*fpTexParameteriv)(GLenum, GLenum, const GLint*); + void (*fpTexSubImage2D)(GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid*); + void (*fpTranslatef)(GLfloat, GLfloat, GLfloat); +// void (*fpTranslatex)(GLfixed, GLfixed, GLfixed); + void (*fpUniform1f)(GLint, GLfloat); + void (*fpUniform1fv)(GLint, GLsizei, const GLfloat*); + void (*fpUniform1i)(GLint, GLint); + void (*fpUniform1iv)(GLint, GLsizei, const GLint*); + void (*fpUniform2f)(GLint, GLfloat, GLfloat); + void (*fpUniform2fv)(GLint, GLsizei, const GLfloat*); + void (*fpUniform2i)(GLint, GLint, GLint); + void (*fpUniform2iv)(GLint, GLsizei, const GLint*); + void (*fpUniform3f)(GLint, GLfloat, GLfloat, GLfloat); + void (*fpUniform3fv)(GLint, GLsizei, const GLfloat*); + void (*fpUniform3i)(GLint, GLint, GLint, GLint); + void (*fpUniform3iv)(GLint, GLsizei, const GLint*); + void (*fpUniform4f)(GLint, GLfloat, GLfloat, GLfloat, GLfloat); + void (*fpUniform4fv)(GLint, GLsizei, const GLfloat*); + void (*fpUniform4i)(GLint, GLint, GLint, GLint, GLint); + void (*fpUniform4iv)(GLint, GLsizei, const GLint*); + void (*fpUniformMatrix2fv)(GLint, GLsizei, GLboolean, const GLfloat*); + void (*fpUniformMatrix3fv)(GLint, GLsizei, GLboolean, const GLfloat*); + void (*fpUniformMatrix4fv)(GLint, GLsizei, GLboolean, const GLfloat*); + void (*fpUseProgram)(GLuint); + void (*fpValidateProgram)(GLuint); + void (*fpVertexAttrib1f)(GLuint, GLfloat); + void (*fpVertexAttrib1fv)(GLuint, const GLfloat*); + void (*fpVertexAttrib2f)(GLuint, GLfloat, GLfloat); + void (*fpVertexAttrib2fv)(GLuint, const GLfloat*); + void (*fpVertexAttrib3f)(GLuint, GLfloat, GLfloat, GLfloat); + void (*fpVertexAttrib3fv)(GLuint, const GLfloat*); + void (*fpVertexAttrib4f)(GLuint, GLfloat, GLfloat, GLfloat, GLfloat); + void (*fpVertexAttrib4fv)(GLuint, const GLfloat*); + void (*fpVertexAttribPointer)(GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid*); + void (*fpVertexPointer)(GLint, GLenum, GLsizei, const GLvoid*); + void (*fpViewport)(GLint, GLint, GLsizei, GLsizei); +} GLFunctionTable; +#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) + +typedef struct +{ + int ret_type; + int has_out_parameters; + int nb_args; + int args_type[0]; +} Signature; + +extern int tab_args_type_length[]; + +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 _changeWindowState_signature[] = {TYPE_NONE, 0, 2, TYPE_INT, TYPE_INT}; + +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) */ +//static const int glXMakeCurrent_signature[] = {TYPE_INT, 0, 3, TYPE_IN_IGNORED_POINTER, TYPE_INT, TYPE_INT}; +/* 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_signature[] = { TYPE_INT, 0, 3, TYPE_IN_IGNORED_POINTER, TYPE_INT, TYPE_INT }; +static const int glXReleaseTexImageARB_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 }; + +#define timesynchro_func -1 +#define memorize_array_func -2 +#define reuse_array_func -3 + +#include "gl_func.h" + +extern const int* tab_opengl_calls[GL_N_CALLS]; +extern const char* tab_opengl_calls_name[GL_N_CALLS]; + +extern GLint __glTexParameter_size(FILE* err_file, GLenum pname); +extern int __glLight_size(FILE* err_file, GLenum pname); +extern int __glMaterial_size(FILE* err_file, GLenum pname); + +#define IS_NULL_POINTER_OK_FOR_FUNC(func_number) \ + (func_number == glBitmap_func || \ + func_number == _send_cursor_func || \ + func_number == glTexImage1D_func || \ + func_number == glTexImage2D_func || \ + func_number == glTexImage3D_func || \ + func_number == glBufferDataARB_func || \ + func_number == glNewObjectBufferATI_func) + +#ifdef __amd64__ +#define _init_func _init64_func +#else +#ifdef __i386__ +#define _init_func _init32_func +#else +#error Unsupported ABI +#endif +#endif diff --git a/libGL/opengl_utils.c b/libGL/opengl_utils.c new file mode 100755 index 0000000..fdbb67c --- /dev/null +++ b/libGL/opengl_utils.c @@ -0,0 +1,501 @@ +/* + * Copyright (c) 2007 Even Rouault + * + * Modified by Ian Molton 2010 <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 <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include "opengl_func.h" +#include "log.h" + +/* Sizes of types in opengl_func.h */ +int tab_args_type_length[] = +{ + 0, + sizeof(char), + sizeof(unsigned char), + sizeof(short), + sizeof(unsigned short), + sizeof(int), + sizeof(unsigned int), + sizeof(float), + sizeof(double), + 1 * sizeof(char), + 2 * sizeof(char), + 3 * sizeof(char), + 4 * sizeof(char), + 128 * sizeof(char), + 1 * sizeof(short), + 2 * sizeof(short), + 3 * sizeof(short), + 4 * sizeof(short), + 1 * sizeof(int), + 2 * sizeof(int), + 3 * sizeof(int), + 4 * sizeof(int), + 1 * sizeof(float), + 2 * sizeof(float), + 3 * sizeof(float), + 4 * sizeof(float), + 16 * sizeof(float), + 1 * sizeof(double), + 2 * sizeof(double), + 3 * sizeof(double), + 4 * sizeof(double), + 16 * sizeof(double), + sizeof(int), + sizeof(float), + 4 * sizeof(char), + 4 * sizeof(int), + 4 * sizeof(float), + 4 * sizeof(double), + 128 * sizeof(char), + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + + /* the following sizes are the size of 1 element of the array */ + sizeof(char), + sizeof(short), + sizeof(int), + sizeof(float), + sizeof(double), + sizeof(char), + sizeof(short), + sizeof(int), + sizeof(float), + sizeof(double), +}; + +GLint __glTexParameter_size(FILE* err_file, GLenum pname) +{ + switch (pname) { + case GL_TEXTURE_MAG_FILTER: + case GL_TEXTURE_MIN_FILTER: + case GL_TEXTURE_WRAP_S: + case GL_TEXTURE_WRAP_T: + case GL_TEXTURE_PRIORITY: + case GL_TEXTURE_WRAP_R: + case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB: +/* case GL_SHADOW_AMBIENT_SGIX:*/ + case GL_TEXTURE_MIN_LOD: + case GL_TEXTURE_MAX_LOD: + case GL_TEXTURE_BASE_LEVEL: + case GL_TEXTURE_MAX_LEVEL: + case GL_TEXTURE_CLIPMAP_FRAME_SGIX: + case GL_TEXTURE_LOD_BIAS_S_SGIX: + case GL_TEXTURE_LOD_BIAS_T_SGIX: + case GL_TEXTURE_LOD_BIAS_R_SGIX: + case GL_GENERATE_MIPMAP: +/* case GL_GENERATE_MIPMAP_SGIS:*/ + case GL_TEXTURE_COMPARE_SGIX: + case GL_TEXTURE_COMPARE_OPERATOR_SGIX: + case GL_TEXTURE_MAX_CLAMP_S_SGIX: + case GL_TEXTURE_MAX_CLAMP_T_SGIX: + case GL_TEXTURE_MAX_CLAMP_R_SGIX: + case GL_TEXTURE_MAX_ANISOTROPY_EXT: + case GL_TEXTURE_LOD_BIAS: +/* case GL_TEXTURE_LOD_BIAS_EXT:*/ + case GL_DEPTH_TEXTURE_MODE: +/* case GL_DEPTH_TEXTURE_MODE_ARB:*/ + case GL_TEXTURE_COMPARE_MODE: +/* case GL_TEXTURE_COMPARE_MODE_ARB:*/ + case GL_TEXTURE_COMPARE_FUNC: +/* case GL_TEXTURE_COMPARE_FUNC_ARB:*/ + case GL_TEXTURE_UNSIGNED_REMAP_MODE_NV: + return 1; + case GL_TEXTURE_CLIPMAP_CENTER_SGIX: + case GL_TEXTURE_CLIPMAP_OFFSET_SGIX: + return 2; + case GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX: + return 3; + case GL_TEXTURE_BORDER_COLOR: + case GL_POST_TEXTURE_FILTER_BIAS_SGIX: + case GL_POST_TEXTURE_FILTER_SCALE_SGIX: + return 4; + default: + fprintf(err_file, "unhandled pname = %d\n", pname); + return 0; + } +} + +int __glLight_size(FILE* err_file, GLenum pname) +{ + switch(pname) + { + case GL_AMBIENT: + case GL_DIFFUSE: + case GL_SPECULAR: + case GL_POSITION: + return 4; + break; + + case GL_SPOT_DIRECTION: + return 3; + break; + + case GL_SPOT_EXPONENT: + case GL_SPOT_CUTOFF: + case GL_CONSTANT_ATTENUATION: + case GL_LINEAR_ATTENUATION: + case GL_QUADRATIC_ATTENUATION: + return 1; + break; + + default: + fprintf(err_file, "unhandled pname = %d\n", pname); + return 0; + } +} + +int __glMaterial_size(FILE* err_file, GLenum pname) +{ + switch(pname) + { + case GL_AMBIENT: + case GL_DIFFUSE: + case GL_SPECULAR: + case GL_EMISSION: + case GL_AMBIENT_AND_DIFFUSE: + return 4; + break; + + case GL_SHININESS: + return 1; + break; + + case GL_COLOR_INDEXES: + return 3; + break; + + default: + fprintf(err_file, "unhandled pname = %d\n", pname); + return 0; + } +} + +#define MIN(a, b) (((a) < (b)) ? (a) : (b)) + +int compute_arg_length(int func_number, Signature *signature, int arg_i, long* args) +{ + int* args_type = signature->args_type; + + switch (func_number) + { + case glProgramNamedParameter4fNV_func: + case glProgramNamedParameter4dNV_func: + case glProgramNamedParameter4fvNV_func: + case glProgramNamedParameter4dvNV_func: + case glGetProgramNamedParameterfvNV_func: + case glGetProgramNamedParameterdvNV_func: + if (arg_i == 2) + return 1 * args[arg_i-1] * tab_args_type_length[args_type[arg_i]]; + break; + + case glProgramStringARB_func: + case glLoadProgramNV_func: + case glGenProgramsNV_func: + case glDeleteProgramsNV_func: + case glGenProgramsARB_func: + case glDeleteProgramsARB_func: + case glRequestResidentProgramsNV_func: + case glDrawBuffers_func: + case glDrawBuffersARB_func: + case glDrawBuffersATI_func: + case glDeleteBuffers_func: + case glDeleteBuffersARB_func: + case glDeleteTextures_func: + case glDeleteTexturesEXT_func: + case glGenFramebuffersEXT_func: + case glDeleteFramebuffersEXT_func: + case glGenRenderbuffersEXT_func: + case glDeleteRenderbuffersEXT_func: + case glGenQueries_func: + case glGenQueriesARB_func: + case glDeleteQueries_func: + case glDeleteQueriesARB_func: + case glGenOcclusionQueriesNV_func: + case glDeleteOcclusionQueriesNV_func: + case glGenFencesNV_func: + case glDeleteFencesNV_func: + case glUniform1fv_func: + case glUniform1iv_func: + case glUniform1fvARB_func: + case glUniform1ivARB_func: + case glUniform1uivEXT_func: + case glVertexAttribs1dvNV_func: + case glVertexAttribs1fvNV_func: + case glVertexAttribs1svNV_func: + case glVertexAttribs1hvNV_func: + case glWeightbvARB_func: + case glWeightsvARB_func: + case glWeightivARB_func: + case glWeightfvARB_func: + case glWeightdvARB_func: + case glWeightubvARB_func: + case glWeightusvARB_func: + case glWeightuivARB_func: + case glPixelMapfv_func: + case glPixelMapuiv_func: + case glPixelMapusv_func: + case glProgramBufferParametersfvNV_func: + case glProgramBufferParametersIivNV_func: + case glProgramBufferParametersIuivNV_func: + case glTransformFeedbackAttribsNV_func: + case glTransformFeedbackVaryingsNV_func: + if (arg_i == signature->nb_args - 1) + return 1 * args[arg_i-1] * tab_args_type_length[args_type[arg_i]]; + break; + + case glUniform2fv_func: + case glUniform2iv_func: + case glUniform2fvARB_func: + case glUniform2ivARB_func: + case glUniform2uivEXT_func: + case glVertexAttribs2dvNV_func: + case glVertexAttribs2fvNV_func: + case glVertexAttribs2svNV_func: + case glVertexAttribs2hvNV_func: + case glDetailTexFuncSGIS_func: + case glSharpenTexFuncSGIS_func: + if (arg_i == signature->nb_args - 1) + return 2 * args[arg_i-1] * tab_args_type_length[args_type[arg_i]]; + break; + + case glUniform3fv_func: + case glUniform3iv_func: + case glUniform3fvARB_func: + case glUniform3ivARB_func: + case glUniform3uivEXT_func: + case glVertexAttribs3dvNV_func: + case glVertexAttribs3fvNV_func: + case glVertexAttribs3svNV_func: + case glVertexAttribs3hvNV_func: + if (arg_i == signature->nb_args - 1) + return 3 * args[arg_i-1] * tab_args_type_length[args_type[arg_i]]; + break; + + case glUniform4fv_func: + case glUniform4iv_func: + case glUniform4fvARB_func: + case glUniform4ivARB_func: + case glUniform4uivEXT_func: + case glVertexAttribs4dvNV_func: + case glVertexAttribs4fvNV_func: + case glVertexAttribs4svNV_func: + case glVertexAttribs4hvNV_func: + case glVertexAttribs4ubvNV_func: + case glProgramParameters4fvNV_func: + case glProgramParameters4dvNV_func: + case glProgramLocalParameters4fvEXT_func: + case glProgramEnvParameters4fvEXT_func: + case glProgramLocalParametersI4ivNV_func: + case glProgramLocalParametersI4uivNV_func: + case glProgramEnvParametersI4ivNV_func: + case glProgramEnvParametersI4uivNV_func: + if (arg_i == signature->nb_args - 1) + return 4 * args[arg_i-1] * tab_args_type_length[args_type[arg_i]]; + break; + + case glPrioritizeTextures_func: + case glPrioritizeTexturesEXT_func: + case glAreProgramsResidentNV_func: + case glAreTexturesResident_func: + case glAreTexturesResidentEXT_func: + if (arg_i == 1 || arg_i == 2) + return args[0] * tab_args_type_length[args_type[arg_i]]; + break; + + case glLightfv_func: + case glLightiv_func: + case glGetLightfv_func: + case glGetLightiv_func: + case glFragmentLightfvSGIX_func: + case glFragmentLightivSGIX_func: + case glGetFragmentLightfvSGIX_func: + case glGetFragmentLightivSGIX_func: + if (arg_i == signature->nb_args - 1) + return __glLight_size(get_err_file(), args[arg_i-1]) * tab_args_type_length[args_type[arg_i]]; + break; + + case glLightModelfv_func: + case glLightModeliv_func: + if (arg_i == signature->nb_args - 1) + return ((args[arg_i-1] == GL_LIGHT_MODEL_AMBIENT) ? 4 : 1) * tab_args_type_length[args_type[arg_i]]; + break; + + case glFragmentLightModelfvSGIX_func: + case glFragmentLightModelivSGIX_func: + if (arg_i == signature->nb_args - 1) + return ((args[arg_i-1] == GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX) ? 4 : 1) * tab_args_type_length[args_type[arg_i]]; + break; + + case glMaterialfv_func: + case glMaterialiv_func: + case glGetMaterialfv_func: + case glGetMaterialiv_func: + case glFragmentMaterialfvSGIX_func: + case glFragmentMaterialivSGIX_func: + case glGetFragmentMaterialfvSGIX_func: + case glGetFragmentMaterialivSGIX_func: + if (arg_i == signature->nb_args - 1) + return __glMaterial_size(get_err_file(), args[arg_i-1]) * tab_args_type_length[args_type[arg_i]]; + break; + + case glTexParameterfv_func: + case glTexParameteriv_func: + case glGetTexParameterfv_func: + case glGetTexParameteriv_func: + case glTexParameterIivEXT_func: + case glTexParameterIuivEXT_func: + case glGetTexParameterIivEXT_func: + case glGetTexParameterIuivEXT_func: + if (arg_i == signature->nb_args - 1) + return __glTexParameter_size(get_err_file(), args[arg_i-1]) * tab_args_type_length[args_type[arg_i]]; + break; + + case glFogiv_func: + case glFogfv_func: + if (arg_i == signature->nb_args - 1) + return ((args[arg_i-1] == GL_FOG_COLOR) ? 4 : 1) * tab_args_type_length[args_type[arg_i]]; + break; + + case glTexGendv_func: + case glTexGenfv_func: + case glTexGeniv_func: + case glGetTexGendv_func: + case glGetTexGenfv_func: + case glGetTexGeniv_func: + if (arg_i == signature->nb_args - 1) + return ((args[arg_i-1] == GL_TEXTURE_GEN_MODE) ? 1 : 4) * tab_args_type_length[args_type[arg_i]]; + break; + + case glTexEnvfv_func: + case glTexEnviv_func: + case glGetTexEnvfv_func: + case glGetTexEnviv_func: + if (arg_i == signature->nb_args - 1) + return ((args[arg_i-1] == GL_TEXTURE_ENV_MODE) ? 1 : 4) * tab_args_type_length[args_type[arg_i]]; + break; + + case glConvolutionParameterfv_func: + case glConvolutionParameteriv_func: + case glGetConvolutionParameterfv_func: + case glGetConvolutionParameteriv_func: + case glConvolutionParameterfvEXT_func: + case glConvolutionParameterivEXT_func: + case glGetConvolutionParameterfvEXT_func: + case glGetConvolutionParameterivEXT_func: + if (arg_i == signature->nb_args - 1) + return ((args[arg_i-1] == GL_CONVOLUTION_BORDER_COLOR || + args[arg_i-1] == GL_CONVOLUTION_FILTER_SCALE || + args[arg_i-1] == GL_CONVOLUTION_FILTER_BIAS) ? 4 : 1) * tab_args_type_length[args_type[arg_i]]; + break; + + case glGetVertexAttribfvARB_func: + case glGetVertexAttribfvNV_func: + case glGetVertexAttribfv_func: + case glGetVertexAttribdvARB_func: + case glGetVertexAttribdvNV_func: + case glGetVertexAttribdv_func: + case glGetVertexAttribivARB_func: + case glGetVertexAttribivNV_func: + case glGetVertexAttribiv_func: + case glGetVertexAttribIivEXT_func: + case glGetVertexAttribIuivEXT_func: + if (arg_i == signature->nb_args - 1) + return ((args[arg_i-1] == GL_CURRENT_VERTEX_ATTRIB_ARB) ? 4 : 1) * tab_args_type_length[args_type[arg_i]]; + break; + + + case glPointParameterfv_func: + case glPointParameterfvEXT_func: + case glPointParameterfvARB_func: + case glPointParameterfvSGIS_func: + case glPointParameteriv_func: + case glPointParameterivEXT_func: + if (arg_i == signature->nb_args - 1) + return ((args[arg_i-1] == GL_POINT_DISTANCE_ATTENUATION) ? 3 : 1) * tab_args_type_length[args_type[arg_i]]; + break; + + case glUniformMatrix2fv_func: + case glUniformMatrix2fvARB_func: + if (arg_i == signature->nb_args - 1) + return 2 * 2 * args[1] * tab_args_type_length[args_type[arg_i]]; + break; + + case glUniformMatrix3fv_func: + case glUniformMatrix3fvARB_func: + if (arg_i == signature->nb_args - 1) + return 3 * 3 * args[1] * tab_args_type_length[args_type[arg_i]]; + break; + + case glUniformMatrix4fv_func: + case glUniformMatrix4fvARB_func: + if (arg_i == signature->nb_args - 1) + return 4 * 4 * args[1] * tab_args_type_length[args_type[arg_i]]; + break; + + case glUniformMatrix2x3fv_func: + case glUniformMatrix3x2fv_func: + if (arg_i == signature->nb_args - 1) + return 2 * 3 * args[1] * tab_args_type_length[args_type[arg_i]]; + break; + + case glUniformMatrix2x4fv_func: + case glUniformMatrix4x2fv_func: + if (arg_i == signature->nb_args - 1) + return 2 * 4 * args[1] * tab_args_type_length[args_type[arg_i]]; + break; + + case glUniformMatrix3x4fv_func: + case glUniformMatrix4x3fv_func: + if (arg_i == signature->nb_args - 1) + return 3 * 4 * args[1] * tab_args_type_length[args_type[arg_i]]; + break; + + case glSpriteParameterivSGIX_func: + case glSpriteParameterfvSGIX_func: + if (arg_i == signature->nb_args - 1) + return ((args[arg_i-1] == GL_SPRITE_MODE_SGIX) ? 1 : 3) * tab_args_type_length[args_type[arg_i]]; + break; + + default: + break; + } + + return 0; +} + + diff --git a/libGL/opengl_utils.h b/libGL/opengl_utils.h new file mode 100755 index 0000000..47c95c1 --- /dev/null +++ b/libGL/opengl_utils.h @@ -0,0 +1,33 @@ +/* + * Functions used by host & client sides + * + * 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 + +extern int compute_arg_length(int func_number, Signature *s, int arg_i, long* args); + +#endif diff --git a/libGL/parse_gl_h.c b/libGL/parse_gl_h.c new file mode 100755 index 0000000..dd18c7c --- /dev/null +++ b/libGL/parse_gl_h.c @@ -0,0 +1,1503 @@ +/* + * 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> + +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_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", + + "glLinkProgram", + "glLinkProgramARB", + + /*"glEGLImageTargetTexture2DOES",*/ + + 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); + 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); + } +} + +int main(int argc, char* argv[]) +{ + FuncDesc funcDesc[3000]; + int funcDescCount = 0; + FILE* f; + + f = fopen("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("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* table = fopen("gl_func_tabs.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. DO NOT EDIT ! */\n\n"); + fprintf(table, "/* This is a generated file. DO NOT EDIT ! */\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. DO NOT EDIT ! */\n\n"); + + fprintf(server_stub, "/* This is a generated file. 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, "void execute_func(int func_number, long* args, int* pret_int, char* pret_char)\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(table, "static const int %s_signature[] = { %s, %d, ", + funcDesc[i].name, + get_type_string(funcDesc[i].type), + funcDesc[i].has_out_parameters); + fprintf(table, "%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(table, ", %s_OF_LENGTH_DEPENDING_ON_PREVIOUS_ARGS", get_type_string(funcDesc[i].args[j])); + } + else + fprintf(table, ", %s", get_type_string(funcDesc[i].args[j])); + } + + if (is_known_arg_vector(&funcDesc[i], &signature_type_name, NULL)) + { + fprintf(table, ", %s", signature_type_name); + } + fprintf(table, "};\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_int = "); + 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_char = "); + 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, " fprintf(stderr, \"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(table, "#define MAGIC_MACRO(x) COMPOSE(x,_signature)\n\n"); + fprintf(table, "const int* tab_opengl_calls[GL_N_CALLS] =\n"); + fprintf(table, "{\n"); + fprintf(table, "#include \"gl_func_perso.h\"\n"); + for(i=0;i<funcDescCount;i++) + { + if (funcDesc[i].ok) + { + fprintf(table, " %s_signature,\n", funcDesc[i].name); + } + } + fprintf(table, "};\n\n"); + + fprintf(table, "#undef MAGIC_MACRO\n"); + fprintf(table, "#define MAGIC_MACRO(x) #x\n"); + fprintf(table, "const char* tab_opengl_calls_name[GL_N_CALLS] =\n"); + fprintf(table, "{\n"); + fprintf(table, "#include \"gl_func_perso.h\"\n"); + for(i=0;i<funcDescCount;i++) + { + if (funcDesc[i].ok) + { + fprintf(table, " \"%s\",\n", funcDesc[i].name); + } + } + fprintf(table, "};\n\n"); + + fclose(header); + fclose(table); + fclose(server_stub); + fclose(client_stub); + + return 0; +} diff --git a/libGL/parse_mesa_get_c.c b/libGL/parse_mesa_get_c.c new file mode 100755 index 0000000..08068cc --- /dev/null +++ b/libGL/parse_mesa_get_c.c @@ -0,0 +1,229 @@ +/* + * Parse the "get.c" from mesa source tree to generate "glgetv_cst.h" + * + * Copyright (c) 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 -Wall parse_mesa_get_c.c -o parse_mesa_get_c -I. && ./parse_mesa_get_c + +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <assert.h> + +#include "mesa_gl.h" +#include "mesa_glext.h" + +/* #include "mesa_enums.c" */ + +int gl_lookup_enum_by_name(const char* name) +{ + FILE* f; + char buffer[256]; + char template1[256]; + char template2[256]; + int i; + sprintf(template1, "#define %s\t", name); + sprintf(template2, "#define %s ", name); + for(i=0;i<2;i++) + { + if (i == 0) + f = fopen("mesa_gl.h", "r"); + else + f = fopen("mesa_glext.h", "r"); + while(fgets(buffer, 256, f)) + { + if (strstr(buffer, template1) || strstr(buffer, template2)) + { + char* c = strstr(buffer, "0x"); + assert(c); + int ret; + ret = strtol(c, NULL, 16); + return ret; + } + } + fclose(f); + } + + return -1; +} + +typedef struct +{ + int value; + char* name; + int nb_elts; +} Token; + +int compare_func(const void* a, const void* b) +{ + return ((Token *)a)->value - ((Token *)b)->value; +} + +typedef struct +{ + int i; + char* str; +} Cpl; +#define CPL(x) {x, #x} + +Cpl constantsOneVal[] = +{ + CPL(GL_MAX_GENERAL_COMBINERS_NV), + CPL(GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT), + CPL(GL_MAX_VERTEX_SHADER_VARIANTS_EXT), + CPL(GL_MAX_VERTEX_SHADER_INVARIANTS_EXT), + CPL(GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT), + CPL(GL_MAX_VERTEX_SHADER_LOCALS_EXT), + CPL(GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT), + CPL(GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT), + CPL(GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT), + CPL(GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT), + CPL(GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT), +}; +#define NB_CONSTANTS_ONE_VAL 11 + +int main(int argc, char* argv[]) +{ + FILE* f = fopen("mesa_get.c", "r"); + char buffer[256]; + int state = 0; + char name[256]; + int count = 0; + char template[256]; + Token tokens[1000]; + int ntoken = 0; + int i; + FILE* outf = fopen("glgetv_cst.h", "w"); + + fprintf(outf, "/* This is a generated file. Do not edit !*/\n"); + fprintf(outf, "typedef struct {\n"); + fprintf(outf, " GLuint count;\n"); + fprintf(outf, " GLenum token;\n"); + fprintf(outf, " const char *name;\n"); + fprintf(outf, "} GlGetConstant ;\n"); + fprintf(outf, "static const GlGetConstant gl_get_constants[] = {\n"); + + while(fgets(buffer, 256, f)) + { + if (strstr(buffer, "_mesa_GetBooleanv")) + { + state = 1; + } + else if (state == 1) + { + if (strstr(buffer, "_mesa_GetFloatv")) + { + break; + } + else if (strstr(buffer, "case GL_")) + { + strcpy(name, strstr(buffer, "case GL_") + 5); + *strstr(name, ":") = 0; + count = 0; + strcpy(template, "params[0]"); + } + else if (strstr(buffer, template)) + { + count ++; + sprintf(template, "params[%d]", count); + } + else if (strstr(buffer, "break")) + { + if (count > 0) + { + int gl_lookup = gl_lookup_enum_by_name(name); + /* + int mesa_lookup = _mesa_lookup_enum_by_name(name); + if (mesa_lookup != -1) + { + if(mesa_lookup != gl_lookup) + { + fprintf(stderr, "wrong : %s %d %d !\n", name, mesa_lookup, gl_lookup); + exit(-1); + } + }*/ + if (gl_lookup == -1) + { + fprintf(stderr, "not found in includes : %s\n", name); + //fprintf(outf, "/* { %d, unknown value, \"%s\" },*/\n", count, name); + } + else + { + //fprintf(outf, " { %d, 0x%04X, \"%s\" },\n", count, gl_lookup, name); + tokens[ntoken].value = gl_lookup; + tokens[ntoken].nb_elts = count; + tokens[ntoken].name = strdup(name); + ntoken++; + } + /*fprintf(outf, "#ifdef %s\n", name); + fprintf(outf, " { %d, MAKE_TOKEN_NAME(%s) },\n", count, name); + fprintf(outf, "#endif\n");*/ + } + else + fprintf(stderr, "not recognized : %s\n", name); + } + } + } + + for(i=0;i<NB_CONSTANTS_ONE_VAL;i++) + { + tokens[ntoken].value = constantsOneVal[i].i; + tokens[ntoken].nb_elts = 1; + tokens[ntoken].name = strdup(constantsOneVal[i].str); + ntoken++; + } + + tokens[ntoken].value = GL_SPRITE_MODE_SGIX; + tokens[ntoken].nb_elts = 1; + tokens[ntoken].name = strdup("GL_SPRITE_MODE_SGIX"); + ntoken++; + + tokens[ntoken].value = GL_SPRITE_AXIS_SGIX ; + tokens[ntoken].nb_elts = 3; + tokens[ntoken].name = strdup("GL_SPRITE_AXIS_SGIX "); + ntoken++; + + tokens[ntoken].value = GL_SPRITE_TRANSLATION_SGIX; + tokens[ntoken].nb_elts = 3; + tokens[ntoken].name = strdup("GL_SPRITE_TRANSLATION_SGIX"); + ntoken++; + + tokens[ntoken].value = GL_REFERENCE_PLANE_EQUATION_SGIX; + tokens[ntoken].nb_elts = 4; + tokens[ntoken].name = strdup("GL_REFERENCE_PLANE_EQUATION_SGIX"); + ntoken++; + + tokens[ntoken].value = GL_CURRENT_PROGRAM; + tokens[ntoken].nb_elts = 1; + tokens[ntoken].name = strdup("GL_CURRENT_PROGRAM"); + ntoken++; + + qsort(tokens, ntoken, sizeof(Token), compare_func); + for(i=0;i<ntoken;i++) + { + fprintf(outf, " { %d, 0x%04X, \"%s\" },\n", tokens[i].nb_elts, tokens[i].value, tokens[i].name); + } + fprintf(outf, "};\n"); + fclose(f); + fclose(outf); + return 0; +} diff --git a/libGL/range_alloc.c b/libGL/range_alloc.c new file mode 100755 index 0000000..bb66508 --- /dev/null +++ b/libGL/range_alloc.c @@ -0,0 +1,195 @@ +/* + * Copyright (c) 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. + */ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include "range_alloc.h" +#include "log.h" + +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 = malloc(sizeof(int)); + range->values[0] = value; + range->nbValues = 1; + } +} + +/* return first value */ +unsigned int alloc_range(RangeAllocator* range, int n, unsigned int* values) +{ + int i, j; + if (range->nbValues == 0) + { + range->nbValues = n; + range->values = 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; + } +} + +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; + } + } + } +} + +void delete_range(RangeAllocator* range, int n, const unsigned int* values) +{ + int i; + for(i=0;i<n;i++) + { + delete_value(range, values[i]); + } +} + +void delete_consecutive_values(RangeAllocator* range, unsigned int first, int n) +{ + int i; + for(i=0;i<n;i++) + { + delete_value(range, first + i); + } +} + diff --git a/libGL/range_alloc.h b/libGL/range_alloc.h new file mode 100755 index 0000000..740ba93 --- /dev/null +++ b/libGL/range_alloc.h @@ -0,0 +1,41 @@ +/* + * Functions used by host & client sides + * + * Copyright (c) 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. + */ + + +#ifndef _RANGE_ALLOC +#define _RANGE_ALLOC + +typedef struct +{ + unsigned int* values; + int nbValues; +} RangeAllocator; + +extern void alloc_value(RangeAllocator* range, unsigned int value); +extern unsigned int alloc_range(RangeAllocator* range, int n, unsigned int* values); +extern void delete_value(RangeAllocator* range, unsigned int value); +extern void delete_range(RangeAllocator* range, int n, const unsigned int* values); +extern void delete_consecutive_values(RangeAllocator* range, unsigned int first, int n); + +#endif diff --git a/opengl-es.postinst.debhelper b/opengl-es.postinst.debhelper new file mode 100644 index 0000000..3d89d3e --- /dev/null +++ b/opengl-es.postinst.debhelper @@ -0,0 +1,5 @@ +# Automatically added by dh_makeshlibs +if [ "$1" = "configure" ]; then + ldconfig +fi +# End automatically added section diff --git a/opengl-es.postrm.debhelper b/opengl-es.postrm.debhelper new file mode 100644 index 0000000..7f44047 --- /dev/null +++ b/opengl-es.postrm.debhelper @@ -0,0 +1,5 @@ +# Automatically added by dh_makeshlibs +if [ "$1" = "remove" ]; then + ldconfig +fi +# End automatically added section diff --git a/opengl-es.substvars b/opengl-es.substvars new file mode 100644 index 0000000..27d6ac6 --- /dev/null +++ b/opengl-es.substvars @@ -0,0 +1 @@ +shlibs:Depends=libx11-6, libxfixes3 (>= 1:4.0.1) diff --git a/packaging/simulator-opengl.manifest b/packaging/simulator-opengl.manifest new file mode 100644 index 0000000..017d22d --- /dev/null +++ b/packaging/simulator-opengl.manifest @@ -0,0 +1,5 @@ +<manifest> + <request> + <domain name="_"/> + </request> +</manifest> diff --git a/packaging/simulator-opengl.spec b/packaging/simulator-opengl.spec new file mode 100644 index 0000000..0f9a337 --- /dev/null +++ b/packaging/simulator-opengl.spec @@ -0,0 +1,68 @@ +#sbs-git:sdk/simulator-opengl +Name: simulator-opengl +Summary: opengl-es acceleration module for emulator +Version: 0.2.3 +Release: 1 +License: MIT +URL: http://www.khronos.org +Source0: %{name}-%{version}.tar.gz +Source1001: packaging/simulator-opengl.manifest +ExclusiveArch: %{ix86} +BuildRequires: pkgconfig(xfixes) +BuildRequires: pkgconfig(x11) +BuildRequires: pkgconfig(x11-xcb) +BuildRequires: pkgconfig(xext) +Provides : libGL.so + + +%description +Opengl-es acceleration module for emulator. +This package contains 4 shared libraries, libGL, libEGL, libGLESv1, libGLESv2. + +%package devel +Summary: opengl-es acceleration module for emulator (devel) +Group: TO_BE/FILLED_IN +Requires: %{name} = %{version}-%{release} +Requires: pkgconfig(x11) + +%description devel +Opengl-es acceleration module for emulator. (devel) + + +%prep +%setup -q + +%build +cp %{SOURCE1001} . +make + +%install +mkdir -p %{buildroot}/usr/lib +cp -r lib/* %{buildroot}/usr/lib/ + +mkdir -p %{buildroot}/usr/include +cp -r include/EGL %{buildroot}/usr/include/ +cp -r include/GL %{buildroot}/usr/include/ +cp -r include/GLES %{buildroot}/usr/include/ +cp -r include/GLES2 %{buildroot}/usr/include/ +cp -r include/KHR %{buildroot}/usr/include/ + +%files +%manifest simulator-opengl.manifest +%defattr(-,root,root,-) +/usr/lib/libGL.* +/usr/lib/libEGL.* +/usr/lib/libGLES* +/usr/lib/host-gl/* + + +%files devel +%manifest simulator-opengl.manifest +%defattr(-,root,root,-) +/usr/include/EGL +/usr/include/GL +/usr/include/GLES +/usr/include/GLES2 +/usr/include/KHR +/usr/lib/pkgconfig + diff --git a/setPATH.sh b/setPATH.sh new file mode 100755 index 0000000..400c3ca --- /dev/null +++ b/setPATH.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +export LD_LIBRARY_PATH=../lib:$LD_LIBRARY_PATH +echo $LD_LIBRARY_PATH |